[PATCH 2/3] net: Make skb->skb_iif always track skb->dev

Subsystems: networking [general], the rest

STALE5135d

2 messages, 2 authors, 2012-07-24 · open the first message on its own page

[PATCH 2/3] net: Make skb->skb_iif always track skb->dev

From: David Miller <davem@davemloft.net>
Date: 2012-07-23 23:45:43

Make it follow device decapsulation, from things such as VLAN and
bonding.

The stuff that actually cares about pre-demuxed device pointers, is
handled by the "orig_dev" variable in __netif_receive_skb().  And
the only consumer of that is the po->origdev feature of AF_PACKET
sockets.

Signed-off-by: David S. Miller <davem@davemloft.net>
---
 net/core/dev.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/net/core/dev.c b/net/core/dev.c
index cca02ae..0ebaea1 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -3173,8 +3173,6 @@ static int __netif_receive_skb(struct sk_buff *skb)
 	if (netpoll_receive_skb(skb))
 		return NET_RX_DROP;
 
-	if (!skb->skb_iif)
-		skb->skb_iif = skb->dev->ifindex;
 	orig_dev = skb->dev;
 
 	skb_reset_network_header(skb);
@@ -3186,6 +3184,7 @@ static int __netif_receive_skb(struct sk_buff *skb)
 	rcu_read_lock();
 
 another_round:
+	skb->skb_iif = skb->dev->ifindex;
 
 	__this_cpu_inc(softnet_data.processed);
 
-- 
1.7.10.4

Re: [PATCH 2/3] net: Make skb->skb_iif always track skb->dev

From: Nicolas de Pesloüan <hidden>
Date: 2012-07-24 21:42:16

Le 24/07/2012 01:45, David Miller a écrit :
Make it follow device decapsulation, from things such as VLAN and
bonding.

The stuff that actually cares about pre-demuxed device pointers, is
handled by the "orig_dev" variable in __netif_receive_skb().  And
the only consumer of that is the po->origdev feature of AF_PACKET
sockets.

Signed-off-by: David S. Miller<davem@davemloft.net>
Jiri tried to remove this orig_dev usage in af_packet in march 2011, without success, by using the 
value of skb_iif instead :-)

In case my opinion might be relevant:

Reviewed-by: Nicolas de Pesloüan <redacted>

	Nicolas.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help