linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Syncppp
@ 2001-08-06 19:15 Matt Schulkind
  2001-08-06 22:49 ` Syncppp Paul Fulghum
  0 siblings, 1 reply; 4+ messages in thread
From: Matt Schulkind @ 2001-08-06 19:15 UTC (permalink / raw)
  To: 'linux-ppp@vger.kernel.org', 'paulus@samba.org',
	'linux-kernel@vger.kernel.org'

In the 2.2.16 kernel, it seems that the ppp_device structure was changed to
use a pointer to the net device instead of haveing the structure contained
within, and the if_down procedure was changed accordingly to use the sppp_of
macro. But, if I take a look at the 2.4.x kernel sources, it seems only the
first change, the pointer vs. struct change was made, but the if_down
procedure was not changed. I believe this is a bug and the if_down procedure
in the 2.4.x kernel must be changed to match 2.2.16+. Could anyone confirm
this?

Please CC me personally with any replies.

-Matt Schulkind

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Syncppp
  2001-08-06 19:15 Syncppp Matt Schulkind
@ 2001-08-06 22:49 ` Paul Fulghum
  2001-08-07  9:26   ` Syncppp Bob Dunlop
  0 siblings, 1 reply; 4+ messages in thread
From: Paul Fulghum @ 2001-08-06 22:49 UTC (permalink / raw)
  To: Matt Schulkind, linux-ppp, paulus, linux-kernel

> In the 2.2.16 kernel, it seems that the ppp_device structure was changed to
> use a pointer to the net device instead of haveing the structure contained
> within, and the if_down procedure was changed accordingly to use the sppp_of
> macro. But, if I take a look at the 2.4.x kernel sources, it seems only the
> first change, the pointer vs. struct change was made, but the if_down
> procedure was not changed. I believe this is a bug and the if_down procedure
> in the 2.4.x kernel must be changed to match 2.2.16+. Could anyone confirm
> this?
> -Matt Schulkind

It looks like you are right. The current 2.4 code
appears to scribble into the net_device structure
someplace (yuck) when if_down() is called.

I'm going to change this and test it tomorrow to be
for sure.

Paul Fulghum paulkf@microgate.com
Microgate Corporation www.microgate.com



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Syncppp
  2001-08-06 22:49 ` Syncppp Paul Fulghum
@ 2001-08-07  9:26   ` Bob Dunlop
  2001-08-07 14:32     ` Syncppp Paul Fulghum
  0 siblings, 1 reply; 4+ messages in thread
From: Bob Dunlop @ 2001-08-07  9:26 UTC (permalink / raw)
  To: Paul Fulghum; +Cc: Matt Schulkind, linux-ppp, paulus, linux-kernel

Hi,

On Mon, Aug  6,  Paul Fulghum wrote:
> > In the 2.2.16 kernel, it seems that the ppp_device structure was changed to
> > use a pointer to the net device instead of haveing the structure contained
> > within, and the if_down procedure was changed accordingly to use the sppp_of
> > macro. But, if I take a look at the 2.4.x kernel sources, it seems only the
> > first change, the pointer vs. struct change was made, but the if_down
> > procedure was not changed. I believe this is a bug and the if_down procedure
> > in the 2.4.x kernel must be changed to match 2.2.16+. Could anyone confirm
> > this?
> > -Matt Schulkind
> 
> It looks like you are right. The current 2.4 code
> appears to scribble into the net_device structure
> someplace (yuck) when if_down() is called.

I agree it's a bug.
Well spotted!  How many times have I scrolled past that line?

On Intel (i386) it looks like it clobbers last_rx which is probably harmless,
but it's close to some hairy pointers so who knows on other architectures.
The fact that pp_link_state is not being reset could well explain how I was
getting into that negotiation loop problem earlier in the year.  The loop
fix is still a valid safety however.

> I'm going to change this and test it tomorrow to be
> for sure.

Well I've applied the obvious fix (below) and tested it on Intel with the
Farsync driver and all looks good.  Don't have access to other architectures
for any other testing.


--- linux/drivers/net/wan/syncppp.c.orig	Thu Jun 28 01:10:55 2001
+++ linux/drivers/net/wan/syncppp.c	Tue Aug  7 08:14:43 2001
@@ -156,7 +156,7 @@
 
 static void if_down(struct net_device *dev)
 {
-	struct sppp *sp = &((struct ppp_device *)dev)->sppp;
+	struct sppp *sp = (struct sppp *)sppp_of(dev);
 
 	sp->pp_link_state=SPPP_LINK_DOWN;
 }



-- 
        Bob Dunlop
        FarSite Communications Ltd.
        http://www.farsite.co.uk/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Syncppp
  2001-08-07  9:26   ` Syncppp Bob Dunlop
@ 2001-08-07 14:32     ` Paul Fulghum
  0 siblings, 0 replies; 4+ messages in thread
From: Paul Fulghum @ 2001-08-07 14:32 UTC (permalink / raw)
  To: Bob Dunlop; +Cc: Matt Schulkind, linux-kernel

> On Intel (i386) it looks like it clobbers last_rx which is probably harmless,
> but it's close to some hairy pointers so who knows on other architectures.
> The fact that pp_link_state is not being reset could well explain how I was
> getting into that negotiation loop problem earlier in the year.  The loop
> fix is still a valid safety however.

Part of the problem is the masochistic construction of
the (ppp_device/net_device/struct sppp/serial context data)
quad. A nasty mess of casts and followed pointers
likely to make your head spin (and your code wrong).

Paul Fulghum paulkf@microgate.com
Microgate Corporation www.microgate.com





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2001-08-07 13:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-08-06 19:15 Syncppp Matt Schulkind
2001-08-06 22:49 ` Syncppp Paul Fulghum
2001-08-07  9:26   ` Syncppp Bob Dunlop
2001-08-07 14:32     ` Syncppp Paul Fulghum

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).