netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andi Kleen <ak@muc.de>
To: Simon Roscic <simon.roscic@chello.at>
Cc: linux-kernel@vger.kernel.org, netdev@oss.sgi.com
Subject: Re: [2.6.0-test8/9] ethertap oops
Date: Sun, 26 Oct 2003 23:45:52 +0100	[thread overview]
Message-ID: <m3ekwz7h3z.fsf@averell.firstfloor.org> (raw)
In-Reply-To: <L1fo.3gb.9@gated-at.bofh.it> (Simon Roscic's message of "Sun, 26 Oct 2003 23:10:14 +0100")

Simon Roscic <simon.roscic@chello.at> writes:

> EIP is at ethertap_rx+0x131/0x2a0 [ethertap]

Does this patch fix it?

-Andi

diff -u linux-2.6.0test7mm1-averell/drivers/net/ethertap.c-o linux-2.6.0test7mm1-averell/drivers/net/ethertap.c
--- linux-2.6.0test7mm1-averell/drivers/net/ethertap.c-o	2003-09-11 04:12:33.000000000 +0200
+++ linux-2.6.0test7mm1-averell/drivers/net/ethertap.c	2003-10-26 23:41:17.000000000 +0100
@@ -302,11 +302,12 @@
 
 static void ethertap_rx(struct sock *sk, int len)
 {
-	struct net_device *dev = tap_map[sk->sk_protocol];
+	unsigned unit = sk->sk_protocol - NETLINK_TAPBASE; 
+	struct net_device *dev;
 	struct sk_buff *skb;
 
-	if (dev==NULL) {
-		printk(KERN_CRIT "ethertap: bad unit!\n");
+	if (unit >= max_taps || (dev = tap_map[unit]) == NULL) { 
+		printk(KERN_CRIT "ethertap: bad unit %u!\n", unit);
 		skb_queue_purge(&sk->sk_receive_queue);
 		return;
 	}
diff -u linux-2.6.0test7mm1-averell/net/netlink/af_netlink.c-o linux-2.6.0test7mm1-averell/net/netlink/af_netlink.c
--- linux-2.6.0test7mm1-averell/net/netlink/af_netlink.c-o	2003-10-09 00:29:02.000000000 +0200
+++ linux-2.6.0test7mm1-averell/net/netlink/af_netlink.c	2003-10-26 23:42:44.000000000 +0100
@@ -777,6 +777,7 @@
 	if (input)
 		nlk_sk(sk)->data_ready = input;
 
+	sk->sk_protocol = unit;
 	netlink_insert(sk, 0);
 	return sk;
 }

       reply	other threads:[~2003-10-26 22:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <L1fo.3gb.9@gated-at.bofh.it>
2003-10-26 22:45 ` Andi Kleen [this message]
2003-10-27  7:48   ` [2.6.0-test8/9] ethertap oops David S. Miller
2003-10-27 12:26     ` Andi Kleen
     [not found]     ` <20031027122635.GB16013@wotan.suse.de>
2003-10-27 12:22       ` David S. Miller
2003-10-27 17:40       ` Simon Roscic

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=m3ekwz7h3z.fsf@averell.firstfloor.org \
    --to=ak@muc.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@oss.sgi.com \
    --cc=simon.roscic@chello.at \
    /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;
as well as URLs for NNTP newsgroup(s).