aboutsummaryrefslogtreecommitdiffstats
path: root/net/core
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2005-08-09 22:36:29 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2005-08-29 18:33:26 -0400
commit86e65da9c1fc6fb421b9f796b597b3eced6b55ab (patch)
tree69ae9d0c30afe54cea3e4c6119791c1318c2198d /net/core
parent0742fd53a3774781255bd1e471e7aa2e4a82d5f7 (diff)
[NET]: Remove explicit initializations of skb->input_dev
Instead, set it in one place, namely the beginning of netif_receive_skb(). Based upon suggestions from Jamal Hadi Salim. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
-rw-r--r--net/core/dev.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index e1cc162bf295..9d153eb1e8cf 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -1536,17 +1536,14 @@ static int ing_filter(struct sk_buff *skb)
1536 __u32 ttl = (__u32) G_TC_RTTL(skb->tc_verd); 1536 __u32 ttl = (__u32) G_TC_RTTL(skb->tc_verd);
1537 if (MAX_RED_LOOP < ttl++) { 1537 if (MAX_RED_LOOP < ttl++) {
1538 printk("Redir loop detected Dropping packet (%s->%s)\n", 1538 printk("Redir loop detected Dropping packet (%s->%s)\n",
1539 skb->input_dev?skb->input_dev->name:"??",skb->dev->name); 1539 skb->input_dev->name, skb->dev->name);
1540 return TC_ACT_SHOT; 1540 return TC_ACT_SHOT;
1541 } 1541 }
1542 1542
1543 skb->tc_verd = SET_TC_RTTL(skb->tc_verd,ttl); 1543 skb->tc_verd = SET_TC_RTTL(skb->tc_verd,ttl);
1544 1544
1545 skb->tc_verd = SET_TC_AT(skb->tc_verd,AT_INGRESS); 1545 skb->tc_verd = SET_TC_AT(skb->tc_verd,AT_INGRESS);
1546 if (NULL == skb->input_dev) { 1546
1547 skb->input_dev = skb->dev;
1548 printk("ing_filter: fixed %s out %s\n",skb->input_dev->name,skb->dev->name);
1549 }
1550 spin_lock(&dev->ingress_lock); 1547 spin_lock(&dev->ingress_lock);
1551 if ((q = dev->qdisc_ingress) != NULL) 1548 if ((q = dev->qdisc_ingress) != NULL)
1552 result = q->enqueue(skb, q); 1549 result = q->enqueue(skb, q);
@@ -1572,6 +1569,9 @@ int netif_receive_skb(struct sk_buff *skb)
1572 if (!skb->stamp.tv_sec) 1569 if (!skb->stamp.tv_sec)
1573 net_timestamp(&skb->stamp); 1570 net_timestamp(&skb->stamp);
1574 1571
1572 if (!skb->input_dev)
1573 skb->input_dev = skb->dev;
1574
1575 orig_dev = skb_bond(skb); 1575 orig_dev = skb_bond(skb);
1576 1576
1577 __get_cpu_var(netdev_rx_stat).total++; 1577 __get_cpu_var(netdev_rx_stat).total++;