Re: Problem with "no bufferspace" - solution#2

[ Available lists | Index of freebsd-isdn | Month of Jan 2003 | Week of 30 Jan 2003 | Raw email | View thread | Wrap long lines | Reply | Tag ]
From
Ari Suutari <ari.suutari@syncrontech.com>
Date
30 Jan 2003 00:06:08
Subject
Re: Problem with "no bufferspace" - solution#2
Message-ID
200301301005.57188.ari.suutari@syncrontech.com

In reply to
References to
Replies

[ Hide this part ]
Hi,

Here is a patch for i4b_isppp.c which works
(at least for me) without any complications.
Maybe someone else could try it also ?

The solution was actually simple. I finally figured out why
the PPP spec didn't allow Down event that I sent in my
first patch. It was because it things that layer must go Up
before it can go Down !

Now, when i4b_isppp.c receives notification about
dial failure, it first tells sppp that it is up and
immediately after that tells that it is down. Calling
up doesn't hurt because not packets will be sent
as the i4b_isppp.c is not in ST_CONNECTED state.

I think that this is a good and simple solution and
it doesn't require any changes into if_spppsubr.c.

Any chance getting this committed into sources ?

Ari S.

-- here is the patch ---
*** i4b_isppp.c.orig Thu Jan 30 09:43:55 2003
--- i4b_isppp.c Thu Jan 30 09:50:40 2003
***************
*** 614,619 ****
--- 614,620 ----
i4bisppp_dialresponse(int unit, int status, cause_t cause)
{
struct i4bisppp_softc *sc = &i4bisppp_softc[unit];
+ struct sppp *sp = &sc->sc_if_un.scu_sp;

NDBGL4(L4_ISPDBG, "isp%d: status=%d, cause=%d", unit, status, cause);

***************
*** 628,633 ****
--- 629,647 ----
while((m = sppp_dequeue(&sc->sc_if)) != NULL)
m_freem(m);
}
+
+ sc->sc_cdp = (call_desc_t *)0;
+ /* do thhis here because pp_down calls i4bisppp_tlf */
+ sc->sc_state = ST_IDLE;
+
+ /* Ahh. ppp does't like to get a down event when
+ * dialing fails. So first tell that we are up
+ * (doesn't hurt us since sc_state != ST_CONNECTED)
+ * and then go down.
+ */
+
+ sp->pp_up(sp);
+ sp->pp_down(sp);
}
}



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-isdn" in the body of the message



Elapsed time: 0.121 seconds