All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] (1/2) syncppp wan device regression
@ 2003-10-13 18:09 Stephen Hemminger
  2003-10-13 18:12 ` David S. Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Stephen Hemminger @ 2003-10-13 18:09 UTC (permalink / raw)
  To: David S. Miller, Jeff Garzik; +Cc: netdev

In 2.6.0-test6, I put in a patch which fixed sealevel driver, but broke
all the other wan devices because it got rid of one level of indirection.

This puts back the indirection, and hopefully prevents others from
misreading it the same way. The SPPP drivers expect that
netdev->priv points to device local structure whose first element
is a pointer to the ppp device. 

This is a resend of an earlier patch which seems not to have been included.

diff -Nru a/drivers/net/wan/syncppp.c b/drivers/net/wan/syncppp.c
--- a/drivers/net/wan/syncppp.c	Fri Oct  3 11:28:23 2003
+++ b/drivers/net/wan/syncppp.c	Fri Oct  3 11:28:23 2003
@@ -1069,6 +1069,9 @@
 	struct sppp *sp = &pd->sppp;
 	unsigned long flags;
 
+	/* Make sure embedding is safe for sppp_of */
+	BUG_ON(sppp_of(dev) != sp);
+
 	spin_lock_irqsave(&spppq_lock, flags);
 	/* Initialize keepalive handler. */
 	if (! spppq)
diff -Nru a/include/net/syncppp.h b/include/net/syncppp.h
--- a/include/net/syncppp.h	Fri Oct  3 11:28:23 2003
+++ b/include/net/syncppp.h	Fri Oct  3 11:28:23 2003
@@ -59,8 +59,9 @@
 
 static inline struct sppp *sppp_of(struct net_device *dev) 
 {
-	struct ppp_device *ppp = dev->priv;
-	return &ppp->sppp;
+	struct ppp_device **ppp = dev->priv;
+	BUG_ON((*ppp)->dev != dev);
+	return &(*ppp)->sppp;
 }
 
 #define PP_KEEPALIVE    0x01    /* use keepalive protocol */

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

* Re: [PATCH] (1/2) syncppp wan device regression
  2003-10-13 18:09 [PATCH] (1/2) syncppp wan device regression Stephen Hemminger
@ 2003-10-13 18:12 ` David S. Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David S. Miller @ 2003-10-13 18:12 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: jgarzik, netdev

On Mon, 13 Oct 2003 11:09:55 -0700
Stephen Hemminger <shemminger@osdl.org> wrote:

> This is a resend of an earlier patch which seems not to have been included.

Jeff seems to be really busy, so I'll take care of applying
these patches.

Thanks.

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

end of thread, other threads:[~2003-10-13 18:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-10-13 18:09 [PATCH] (1/2) syncppp wan device regression Stephen Hemminger
2003-10-13 18:12 ` David S. Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.