]> err.no Git - linux-2.6/commitdiff
[NET]: Remove explicit initializations of skb->input_dev
authorDavid S. Miller <davem@davemloft.net>
Wed, 10 Aug 2005 02:36:29 +0000 (19:36 -0700)
committerDavid S. Miller <davem@sunset.davemloft.net>
Mon, 29 Aug 2005 22:33:26 +0000 (15:33 -0700)
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>
drivers/isdn/i4l/isdn_net.c
drivers/isdn/i4l/isdn_ppp.c
drivers/net/ppp_generic.c
include/net/pkt_cls.h
include/net/x25device.h
net/core/dev.c
net/ethernet/eth.c

index f30e8e63ae0dedf9802a044d5d3c6eedd3679721..96c115e13389cd16b2d18a34bd5bc65e19d4fd47 100644 (file)
@@ -1786,7 +1786,6 @@ isdn_net_receive(struct net_device *ndev, struct sk_buff *skb)
                lp->stats.rx_bytes += skb->len;
        }
        skb->dev = ndev;
-       skb->input_dev = ndev;
        skb->pkt_type = PACKET_HOST;
        skb->mac.raw = skb->data;
 #ifdef ISDN_DEBUG_NET_DUMP
index 260a323a96d38c07003f80b92c2b3dad5c2c025a..d97a9be5469c45deb6f8d5965a3a84125c446314 100644 (file)
@@ -1177,7 +1177,6 @@ isdn_ppp_push_higher(isdn_net_dev * net_dev, isdn_net_local * lp, struct sk_buff
                mlp->huptimer = 0;
 #endif /* CONFIG_IPPP_FILTER */
        skb->dev = dev;
-       skb->input_dev = dev;
        skb->mac.raw = skb->data;
        netif_rx(skb);
        /* net_dev->local->stats.rx_packets++; done in isdn_net.c */
index a32668e88e09fc2a157e3ac5500c94ae158c9529..bb71638a7c4484a6dfe5b6ba19ad7512ea4e911d 100644 (file)
@@ -1657,7 +1657,6 @@ ppp_receive_nonmp_frame(struct ppp *ppp, struct sk_buff *skb)
                        skb->dev = ppp->dev;
                        skb->protocol = htons(npindex_to_ethertype[npi]);
                        skb->mac.raw = skb->data;
-                       skb->input_dev = ppp->dev;
                        netif_rx(skb);
                        ppp->dev->last_rx = jiffies;
                }
index 4abda6aec05a8cc4ca2cde35d6115427d71044fc..b902d24a32563f424d0934a6fb04d504a0b1e3ca 100644 (file)
@@ -352,10 +352,10 @@ tcf_change_indev(struct tcf_proto *tp, char *indev, struct rtattr *indev_tlv)
 static inline int
 tcf_match_indev(struct sk_buff *skb, char *indev)
 {
-       if (0 != indev[0]) {
-               if  (NULL == skb->input_dev)
+       if (indev[0]) {
+               if  (!skb->input_dev)
                        return 0;
-               else if (0 != strcmp(indev, skb->input_dev->name))
+               if (strcmp(indev, skb->input_dev->name))
                        return 0;
        }
 
index d45ae883bd1dabebf1e304bf29e6e5c382267a5f..1a318374faefc42e853ab4692b9aeb046aebda46 100644 (file)
@@ -8,7 +8,6 @@
 static inline __be16 x25_type_trans(struct sk_buff *skb, struct net_device *dev)
 {
        skb->mac.raw = skb->data;
-       skb->input_dev = skb->dev = dev;
        skb->pkt_type = PACKET_HOST;
        
        return htons(ETH_P_X25);
index e1cc162bf295f8b6a9dec45d3c42860446b725e4..9d153eb1e8cf59a2d26a12f1d487c0fe81fb70c8 100644 (file)
@@ -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++;
index f6dbfb99b14ddf76db0d26eae2d904fda3ccb5c0..f444a2f2675fed47ea4260d0c1c5f932dd1b015e 100644 (file)
@@ -163,7 +163,6 @@ __be16 eth_type_trans(struct sk_buff *skb, struct net_device *dev)
        skb->mac.raw=skb->data;
        skb_pull(skb,ETH_HLEN);
        eth = eth_hdr(skb);
-       skb->input_dev = dev;
        
        if(*eth->h_dest&1)
        {