public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dipankar Sarma <dipankar@in.ibm.com>
To: Andrew Morton <akpm@digeo.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Misc 2.5 Fixes: arcnet-oops-fix
Date: Tue, 10 Jun 2003 15:36:43 +0530	[thread overview]
Message-ID: <20030610100643.GB2194@in.ibm.com> (raw)
In-Reply-To: <20030610100527.GA2194@in.ibm.com>



Fix arcnet oopses with raw socket


 drivers/net/arcnet/arc-rawmode.c |    9 ++++-----
 drivers/net/arcnet/arcnet.c      |   15 ++++++++-------
 drivers/net/arcnet/rfc1051.c     |    9 ++++-----
 drivers/net/arcnet/rfc1201.c     |    9 ++++-----
 include/linux/arcdevice.h        |    4 ++--
 5 files changed, 22 insertions(+), 24 deletions(-)

diff -puN drivers/net/arcnet/arcnet.c~arcnet-oops-fix drivers/net/arcnet/arcnet.c
--- linux-2.5.70-ds/drivers/net/arcnet/arcnet.c~arcnet-oops-fix	2003-06-08 02:09:38.000000000 +0530
+++ linux-2.5.70-ds-dipankar/drivers/net/arcnet/arcnet.c	2003-06-08 02:09:38.000000000 +0530
@@ -57,8 +57,8 @@
 /* "do nothing" functions for protocol drivers */
 static void null_rx(struct net_device *dev, int bufnum,
 		    struct archdr *pkthdr, int length);
-static int null_build_header(struct sk_buff *skb, unsigned short type,
-			     uint8_t daddr);
+static int null_build_header(struct sk_buff *skb, struct net_device *dev,
+			     unsigned short type, uint8_t daddr);
 static int null_prepare_tx(struct net_device *dev, struct archdr *pkt,
 			   int length, int bufnum);
 
@@ -479,7 +479,7 @@ static int arcnet_header(struct sk_buff 
 		       arc_bcast_proto->suffix);
 		proto = arc_bcast_proto;
 	}
-	return proto->build_header(skb, type, _daddr);
+	return proto->build_header(skb, dev, type, _daddr);
 }
 
 
@@ -495,6 +495,7 @@ static int arcnet_rebuild_header(struct 
 	int status = 0;		/* default is failure */
 	unsigned short type;
 	uint8_t daddr=0;
+	struct ArcProto *proto;
 
 	if (skb->nh.raw - skb->mac.raw != 2) {
 		BUGMSG(D_NORMAL,
@@ -523,7 +524,8 @@ static int arcnet_rebuild_header(struct 
 		return 0;
 
 	/* add the _real_ header this time! */
-	arc_proto_map[lp->default_proto[daddr]]->build_header(skb, type, daddr);
+	proto = arc_proto_map[lp->default_proto[daddr]];
+	proto->build_header(skb, dev, type, daddr);
 
 	return 1;		/* success */
 }
@@ -952,10 +954,9 @@ static void null_rx(struct net_device *d
 }
 
 
-static int null_build_header(struct sk_buff *skb, unsigned short type,
-			     uint8_t daddr)
+static int null_build_header(struct sk_buff *skb, struct net_device *dev,
+			     unsigned short type, uint8_t daddr)
 {
-	struct net_device *dev = skb->dev;
 	struct arcnet_local *lp = (struct arcnet_local *) dev->priv;
 
 	BUGMSG(D_PROTO,
diff -puN drivers/net/arcnet/arc-rawmode.c~arcnet-oops-fix drivers/net/arcnet/arc-rawmode.c
--- linux-2.5.70-ds/drivers/net/arcnet/arc-rawmode.c~arcnet-oops-fix	2003-06-08 02:09:38.000000000 +0530
+++ linux-2.5.70-ds-dipankar/drivers/net/arcnet/arc-rawmode.c	2003-06-08 02:09:38.000000000 +0530
@@ -37,8 +37,8 @@
 
 static void rx(struct net_device *dev, int bufnum,
 	       struct archdr *pkthdr, int length);
-static int build_header(struct sk_buff *skb, unsigned short type,
-			uint8_t daddr);
+static int build_header(struct sk_buff *skb, struct net_device *dev,
+			unsigned short type, uint8_t daddr);
 static int prepare_tx(struct net_device *dev, struct archdr *pkt, int length,
 		      int bufnum);
 
@@ -131,10 +131,9 @@ static void rx(struct net_device *dev, i
  * Create the ARCnet hard/soft headers for raw mode.
  * There aren't any soft headers in raw mode - not even the protocol id.
  */
-static int build_header(struct sk_buff *skb, unsigned short type,
-			uint8_t daddr)
+static int build_header(struct sk_buff *skb, struct net_device *dev,
+			unsigned short type, uint8_t daddr)
 {
-	struct net_device *dev = skb->dev;
 	int hdr_size = ARC_HDR_SIZE;
 	struct archdr *pkt = (struct archdr *) skb_push(skb, hdr_size);
 
diff -puN drivers/net/arcnet/rfc1051.c~arcnet-oops-fix drivers/net/arcnet/rfc1051.c
--- linux-2.5.70-ds/drivers/net/arcnet/rfc1051.c~arcnet-oops-fix	2003-06-08 02:09:38.000000000 +0530
+++ linux-2.5.70-ds-dipankar/drivers/net/arcnet/rfc1051.c	2003-06-08 02:09:38.000000000 +0530
@@ -37,8 +37,8 @@
 static unsigned short type_trans(struct sk_buff *skb, struct net_device *dev);
 static void rx(struct net_device *dev, int bufnum,
 	       struct archdr *pkthdr, int length);
-static int build_header(struct sk_buff *skb, unsigned short type,
-			uint8_t daddr);
+static int build_header(struct sk_buff *skb, struct net_device *dev,
+			unsigned short type, uint8_t daddr);
 static int prepare_tx(struct net_device *dev, struct archdr *pkt, int length,
 		      int bufnum);
 
@@ -163,10 +163,9 @@ static void rx(struct net_device *dev, i
 /*
  * Create the ARCnet hard/soft headers for RFC1051.
  */
-static int build_header(struct sk_buff *skb, unsigned short type,
-			uint8_t daddr)
+static int build_header(struct sk_buff *skb, struct net_device *dev,
+			unsigned short type, uint8_t daddr)
 {
-	struct net_device *dev = skb->dev;
 	struct arcnet_local *lp = (struct arcnet_local *) dev->priv;
 	int hdr_size = ARC_HDR_SIZE + RFC1051_HDR_SIZE;
 	struct archdr *pkt = (struct archdr *) skb_push(skb, hdr_size);
diff -puN drivers/net/arcnet/rfc1201.c~arcnet-oops-fix drivers/net/arcnet/rfc1201.c
--- linux-2.5.70-ds/drivers/net/arcnet/rfc1201.c~arcnet-oops-fix	2003-06-08 02:09:38.000000000 +0530
+++ linux-2.5.70-ds-dipankar/drivers/net/arcnet/rfc1201.c	2003-06-08 02:09:38.000000000 +0530
@@ -36,8 +36,8 @@
 static unsigned short type_trans(struct sk_buff *skb, struct net_device *dev);
 static void rx(struct net_device *dev, int bufnum,
 	       struct archdr *pkthdr, int length);
-static int build_header(struct sk_buff *skb, unsigned short type,
-			uint8_t daddr);
+static int build_header(struct sk_buff *skb, struct net_device *dev,
+			unsigned short type, uint8_t daddr);
 static int prepare_tx(struct net_device *dev, struct archdr *pkt, int length,
 		      int bufnum);
 static int continue_tx(struct net_device *dev, int bufnum);
@@ -370,10 +370,9 @@ static void rx(struct net_device *dev, i
 
 
 /* Create the ARCnet hard/soft headers for RFC1201. */
-static int build_header(struct sk_buff *skb, unsigned short type,
-			uint8_t daddr)
+static int build_header(struct sk_buff *skb, struct net_device *dev,
+			unsigned short type, uint8_t daddr)
 {
-	struct net_device *dev = skb->dev;
 	struct arcnet_local *lp = (struct arcnet_local *) dev->priv;
 	int hdr_size = ARC_HDR_SIZE + RFC1201_HDR_SIZE;
 	struct archdr *pkt = (struct archdr *) skb_push(skb, hdr_size);
diff -puN include/linux/arcdevice.h~arcnet-oops-fix include/linux/arcdevice.h
--- linux-2.5.70-ds/include/linux/arcdevice.h~arcnet-oops-fix	2003-06-08 02:09:38.000000000 +0530
+++ linux-2.5.70-ds-dipankar/include/linux/arcdevice.h	2003-06-08 02:09:38.000000000 +0530
@@ -190,8 +190,8 @@ struct ArcProto {
 
 	void (*rx) (struct net_device * dev, int bufnum,
 		    struct archdr * pkthdr, int length);
-	int (*build_header) (struct sk_buff * skb, unsigned short ethproto,
-			     uint8_t daddr);
+	int (*build_header) (struct sk_buff * skb, struct net_device *dev,
+			     unsigned short ethproto, uint8_t daddr);
 
 	/* these functions return '1' if the skb can now be freed */
 	int (*prepare_tx) (struct net_device * dev, struct archdr * pkt, int length,

_

  parent reply	other threads:[~2003-06-10  9:50 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-06-10 10:05 Misc 2.5 Fixes: Summary Dipankar Sarma
2003-06-10 10:05 ` Joshua Kwan
2003-06-10 10:11   ` Joshua Kwan
2003-06-10 10:06 ` Dipankar Sarma [this message]
2003-06-10 10:07   ` Misc 2.5 Fixes: x25-facilities-parse Dipankar Sarma
2003-06-10 10:09     ` Misc 2.5 Fixes: cp-user-awe Dipankar Sarma
2003-06-10 10:09       ` Misc 2.5 Fixes: cp-user-cmpci Dipankar Sarma
2003-06-10 10:10         ` Misc 2.5 Fixes: cp-user-eicon Dipankar Sarma
2003-06-10 10:11           ` Misc 2.5 Fixes: cp-user-intermezzo Dipankar Sarma
2003-06-10 10:13             ` Misc 2.5 Fixes: cp-user-mdc800 Dipankar Sarma
2003-06-10 10:15               ` Misc 2.5 Fixes: cp-user-mpu401 Dipankar Sarma
2003-06-10 10:18                 ` Misc 2.5 Fixes: cp-user-sisfb Dipankar Sarma
2003-06-10 10:20                   ` Misc 2.5 Fixes: cp-user-vicam Dipankar Sarma
2003-06-10 10:22                     ` Misc 2.5 Fixes: cp-user-zoran Dipankar Sarma
2003-06-10 10:23                       ` Misc 2.5 Fixes: mem-leak-emu10k1 Dipankar Sarma
2003-06-10 10:24                         ` Misc 2.5 Fixes: mem-leak-rio Dipankar Sarma
2003-06-10 10:25                           ` Misc 2.5 Fixes: resrc-leak-i810 Dipankar Sarma
2003-06-10 14:53                       ` Misc 2.5 Fixes: cp-user-zoran Hollis Blanchard
2003-06-11 10:48                     ` Misc 2.5 Fixes: cp-user-vicam Dipankar Sarma
2003-06-11 12:18                       ` Alan Cox
2003-06-11 12:38                         ` Dipankar Sarma
2003-06-10 16:31                   ` Misc 2.5 Fixes: cp-user-sisfb Thomas Winischhofer
2003-06-10 17:34                     ` Dipankar Sarma
2003-06-10 18:29                       ` James Simmons
2003-06-10 14:38         ` Misc 2.5 Fixes: cp-user-cmpci Hollis Blanchard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030610100643.GB2194@in.ibm.com \
    --to=dipankar@in.ibm.com \
    --cc=akpm@digeo.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox