remove skb->dev NULL assignation in tcp_v[4|6]_rcv functions
Subsystems (3)
RFC 1/1 remove skb->dev NULL assignation in tcp_v[4|6]_rcv functions
Subject: [RFC] remove skb->dev NULL assignation
From: Daniel Lezcano <[email protected]>
I was trying to figure out why in the tcp_v4_rcv/tcp_v6_rcv function, the skb->dev field is set to NULL. There is certainly a good reason, but I was not able to find it.
Is it possible to remove this ?
--- net/ipv4/tcp_ipv4.c | 2 -- net/ipv6/tcp_ipv6.c | 2 -- 2 files changed, 4 deletions(-)
net/ipv4/tcp_ipv4.c +0 -2
@@ -1661,8 +1661,6 @@ process:if (sk_filter (sk, skb)) goto discard_and_relse; - skb->dev =NULL ; -bh_lock_sock_nested (sk); ret =0 ;if (!sock_owned_by_user (sk)) {
net/ipv6/tcp_ipv6.c +0 -2
@@ -1722,8 +1722,6 @@ process:if (sk_filter (sk, skb)) goto discard_and_relse; - skb->dev =NULL ; -bh_lock_sock_nested (sk); ret =0 ;if (!sock_owned_by_user (sk)) {
David Miller
maintainerFrom: Daniel Lezcano <[email protected]>
Date: Thu, 07 Feb 2008 12:17:27 +0100
Quoted 9 lines
Subject: [RFC] remove
skb->devNULL assignationI was trying to figure out why in the tcp_v4_rcv/tcp_v6_rcv function, the
skb->devfield is set to NULL. There is certainly a good reason, but I was not able to find it.Is it possible to remove this ?
Signed-off-by Daniel Lezcano <[email protected]>
It is illegal to reference a device outside of the netif_receive_skb() code path without taking a reference to it.
Since we are queueing it to a socket, we have to NULL out the skb->dev since thee packets lifetime is being expanded outside of that allowed window.
Quoted 11 lines · David Miller
From: Daniel Lezcano <[email protected]>
Date: Thu, 07 Feb 2008 12:17:27 +0100Quoted 8 lines
Subject: [RFC] remove
skb->devNULL assignationI was trying to figure out why in the tcp_v4_rcv/tcp_v6_rcv function, the
skb->devfield is set to NULL. There is certainly a good reason, but I was not able to find it.Is it possible to remove this ?
Quoted 8 lines
Quoted 1 line
Signed-off-by Daniel Lezcano <[email protected]>It is illegal to reference a device outside of the
netif_receive_skb()code path without taking a reference to it.Since we are queueing it to a socket, we have to NULL out the
skb->devsince thee packets lifetime is being expanded outside of that allowed window.
Got it. Thank you very much.