| To: | David Stevens <dlstevens@xxxxxxxxxx>, "David S. Miller" <davem@xxxxxxxxxx>, "YOSHIFUJI Hideaki / _$B5HF#1QL@" <yoshfuji@xxxxxxxxxxxxxx> |
|---|---|
| Subject: | [PATCH] fix outstanding ref's preventing ether driver unload |
| From: | Stephen Hemminger <shemminger@xxxxxxxx> |
| Date: | Tue, 23 Dec 2003 14:29:31 -0800 |
| Cc: | netdev@xxxxxxxxxxx |
| In-reply-to: | <OFB4EC53DF.8138874D-ON88256DF9.0082A560@xxxxxxxxxx> |
| Organization: | Open Source Development Lab |
| References: | <OFB4EC53DF.8138874D-ON88256DF9.0082A560@xxxxxxxxxx> |
| Sender: | netdev-bounce@xxxxxxxxxxx |
Patch against 2.6.0 to fix the problem of being unable to load the ethernet
driver because of reference's still being held. The problem reference's
are from IPV6 network discovery packets that get captured by the af_packet
protocol
and queued onto a socket queue (which may never drain). The route dst entries
in the skbuff get clone'd and won't be freed until the socket read.
diff -Nru a/net/packet/af_packet.c b/net/packet/af_packet.c
--- a/net/packet/af_packet.c Tue Dec 23 14:25:10 2003
+++ b/net/packet/af_packet.c Tue Dec 23 14:25:10 2003
@@ -246,6 +246,10 @@
if ((skb = skb_share_check(skb, GFP_ATOMIC)) == NULL)
goto oom;
+ /* drop any routing info */
+ dst_release(skb->dst);
+ skb->dst = NULL;
+
spkt = (struct sockaddr_pkt*)skb->cb;
skb_push(skb, skb->data-skb->mac.raw);
@@ -486,6 +490,9 @@
skb_set_owner_r(skb, sk);
skb->dev = NULL;
+ dst_release(skb->dst);
+ skb->dst = NULL;
+
spin_lock(&sk->sk_receive_queue.lock);
po->stats.tp_packets++;
__skb_queue_tail(&sk->sk_receive_queue, skb);
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | [patch] handle kmalloc fails: tokenring/3c359, maximilian attems |
|---|---|
| Next by Date: | Re: [PATCH] fix outstanding ref's preventing ether driver unload, David S. Miller |
| Previous by Thread: | [patch] handle kmalloc fails: tokenring/3c359, maximilian attems |
| Next by Thread: | Re: [PATCH] fix outstanding ref's preventing ether driver unload, David S. Miller |
| Indexes: | [Date] [Thread] [Top] [All Lists] |