mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
[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>
This commit is contained in:
parent
0742fd53a3
commit
86e65da9c1
7 changed files with 8 additions and 13 deletions
|
@ -1536,17 +1536,14 @@ static int ing_filter(struct sk_buff *skb)
|
|||
__u32 ttl = (__u32) G_TC_RTTL(skb->tc_verd);
|
||||
if (MAX_RED_LOOP < ttl++) {
|
||||
printk("Redir loop detected Dropping packet (%s->%s)\n",
|
||||
skb->input_dev?skb->input_dev->name:"??",skb->dev->name);
|
||||
skb->input_dev->name, skb->dev->name);
|
||||
return TC_ACT_SHOT;
|
||||
}
|
||||
|
||||
skb->tc_verd = SET_TC_RTTL(skb->tc_verd,ttl);
|
||||
|
||||
skb->tc_verd = SET_TC_AT(skb->tc_verd,AT_INGRESS);
|
||||
if (NULL == skb->input_dev) {
|
||||
skb->input_dev = skb->dev;
|
||||
printk("ing_filter: fixed %s out %s\n",skb->input_dev->name,skb->dev->name);
|
||||
}
|
||||
|
||||
spin_lock(&dev->ingress_lock);
|
||||
if ((q = dev->qdisc_ingress) != NULL)
|
||||
result = q->enqueue(skb, q);
|
||||
|
@ -1572,6 +1569,9 @@ int netif_receive_skb(struct sk_buff *skb)
|
|||
if (!skb->stamp.tv_sec)
|
||||
net_timestamp(&skb->stamp);
|
||||
|
||||
if (!skb->input_dev)
|
||||
skb->input_dev = skb->dev;
|
||||
|
||||
orig_dev = skb_bond(skb);
|
||||
|
||||
__get_cpu_var(netdev_rx_stat).total++;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue