[SK_BUFF]: Introduce skb_reset_mac_header(skb)
authorArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 19 Mar 2007 22:30:44 +0000 (15:30 -0700)
committerDavid S. Miller <davem@sunset.davemloft.net>
Thu, 26 Apr 2007 05:24:32 +0000 (22:24 -0700)
For the common, open coded 'skb->mac.raw = skb->data' operation, so that we can
later turn skb->mac.raw into a offset, reducing the size of struct sk_buff in
64bit land while possibly keeping it as a pointer on 32bit.

This one touches just the most simple case, next will handle the slightly more
"complex" cases.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
85 files changed:
arch/um/drivers/net_kern.c
arch/xtensa/platform-iss/network.c
drivers/block/aoe/aoecmd.c
drivers/ieee1394/eth1394.c
drivers/infiniband/ulp/ipoib/ipoib_cm.c
drivers/infiniband/ulp/ipoib/ipoib_ib.c
drivers/isdn/i4l/isdn_net.c
drivers/isdn/i4l/isdn_ppp.c
drivers/message/fusion/mptlan.c
drivers/net/appletalk/cops.c
drivers/net/appletalk/ltpc.c
drivers/net/arcnet/arc-rawmode.c
drivers/net/arcnet/capmode.c
drivers/net/arcnet/rfc1051.c
drivers/net/arcnet/rfc1201.c
drivers/net/bonding/bond_3ad.c
drivers/net/bonding/bond_alb.c
drivers/net/cxgb3/cxgb3_offload.c
drivers/net/cxgb3/sge.c
drivers/net/irda/ali-ircc.c
drivers/net/irda/au1k_ir.c
drivers/net/irda/donauboe.c
drivers/net/irda/irda-usb.c
drivers/net/irda/mcs7780.c
drivers/net/irda/nsc-ircc.c
drivers/net/irda/pxaficp_ir.c
drivers/net/irda/sa1100_ir.c
drivers/net/irda/smsc-ircc2.c
drivers/net/irda/stir4200.c
drivers/net/irda/via-ircc.c
drivers/net/irda/vlsi_ir.c
drivers/net/irda/w83977af_ir.c
drivers/net/myri_sbus.c
drivers/net/ppp_generic.c
drivers/net/sb1000.c
drivers/net/tun.c
drivers/net/wan/cosa.c
drivers/net/wan/cycx_x25.c
drivers/net/wan/dlci.c
drivers/net/wan/farsync.c
drivers/net/wan/lmc/lmc_main.c
drivers/net/wan/pc300_drv.c
drivers/net/wan/pc300_tty.c
drivers/net/wireless/airo.c
drivers/net/wireless/hostap/hostap_80211_rx.c
drivers/net/wireless/hostap/hostap_80211_tx.c
drivers/net/wireless/hostap/hostap_ap.c
drivers/net/wireless/hostap/hostap_hw.c
drivers/net/wireless/hostap/hostap_main.c
drivers/net/wireless/ipw2200.c
drivers/net/wireless/orinoco.c
drivers/net/wireless/prism54/islpci_eth.c
drivers/net/wireless/strip.c
drivers/s390/net/ctcmain.c
drivers/s390/net/netiucv.c
drivers/s390/net/qeth_eddp.c
drivers/s390/net/qeth_main.c
include/linux/hdlc.h
include/linux/skbuff.h
include/net/ax25.h
include/net/x25device.h
net/802/fddi.c
net/802/hippi.c
net/802/tr.c
net/atm/br2684.c
net/atm/clip.c
net/ax25/ax25_in.c
net/bluetooth/bnep/core.c
net/bridge/br_device.c
net/core/dev.c
net/core/netpoll.c
net/core/skbuff.c
net/decnet/dn_route.c
net/ethernet/eth.c
net/ieee80211/ieee80211_rx.c
net/ipv4/ip_gre.c
net/ipv4/ip_output.c
net/ipv4/route.c
net/ipv6/ip6_output.c
net/ipv6/route.c
net/irda/irlap_frame.c
net/irda/wrapper.c
net/llc/llc_output.c
net/netrom/nr_dev.c
net/wanrouter/wanmain.c

index 04e31f86c10afb88f21002b7b0eb8c261e3490a9..859303730b2f9faed861b1bc3252b4ddc284d65c 100644 (file)
@@ -55,7 +55,7 @@ static int uml_net_rx(struct net_device *dev)
 
        skb->dev = dev;
        skb_put(skb, dev->mtu);
-       skb->mac.raw = skb->data;
+       skb_reset_mac_header(skb);
        pkt_len = (*lp->read)(lp->fd, &skb, lp);
 
        if (pkt_len > 0) {
index 8ebfc87612298115875a440293266120865dbe35..ab05bff40104c80ac2849131b57213a9aa898b5a 100644 (file)
@@ -386,7 +386,7 @@ static int iss_net_rx(struct net_device *dev)
        /* Setup skb */
 
        skb->dev = dev;
-       skb->mac.raw = skb->data;
+       skb_reset_mac_header(skb);
        pkt_len = lp->tp.read(lp, &skb);
        skb_put(skb, pkt_len);
 
index 4ab7b40e8c5af5e4de493f114f3a98c84ba7c9e2..74062dc4e90dd1d21889d26e954914d55b853660 100644 (file)
@@ -27,7 +27,8 @@ new_skb(ulong len)
 
        skb = alloc_skb(len, GFP_ATOMIC);
        if (skb) {
-               skb->nh.raw = skb->mac.raw = skb->data;
+               skb_reset_mac_header(skb);
+               skb->nh.raw = skb->data;
                skb->protocol = __constant_htons(ETH_P_AOE);
                skb->priority = 0;
                skb->next = skb->prev = NULL;
index 03e44b337eb018c488073aa015c6dd63d481ed2e..db2346f4d2075ee956bce08e2bf17a48cf3a224c 100644 (file)
@@ -834,7 +834,7 @@ static inline u16 ether1394_type_trans(struct sk_buff *skb,
        struct eth1394hdr *eth;
        unsigned char *rawp;
 
-       skb->mac.raw = skb->data;
+       skb_reset_mac_header(skb);
        skb_pull (skb, ETH1394_HLEN);
        eth = eth1394_hdr(skb);
 
index 2b242a4823f8d42525323d3fac318f2c33851c17..c722e5c141b3be697e69557ed6e7047d8404c409 100644 (file)
@@ -408,7 +408,7 @@ void ipoib_cm_handle_rx_wc(struct net_device *dev, struct ib_wc *wc)
        skb_put_frags(skb, IPOIB_CM_HEAD_SIZE, wc->byte_len, newskb);
 
        skb->protocol = ((struct ipoib_header *) skb->data)->proto;
-       skb->mac.raw = skb->data;
+       skb_reset_mac_header(skb);
        skb_pull(skb, IPOIB_ENCAP_LEN);
 
        dev->last_rx = jiffies;
index ba0ee5cf2ad75cf4ea89b2f754dc6e98cf314572..93f74567897e6dcf385c24621266e52de4de3e66 100644 (file)
@@ -216,7 +216,7 @@ static void ipoib_ib_handle_rx_wc(struct net_device *dev, struct ib_wc *wc)
        if (wc->slid != priv->local_lid ||
            wc->src_qp != priv->qp->qp_num) {
                skb->protocol = ((struct ipoib_header *) skb->data)->proto;
-               skb->mac.raw = skb->data;
+               skb_reset_mac_header(skb);
                skb_pull(skb, IPOIB_ENCAP_LEN);
 
                dev->last_rx = jiffies;
index 838b3734e2b6d82cf2bda00072399167077da68a..fadb9291bc1b76c6796e91266549eb4d8febb65b 100644 (file)
@@ -1366,7 +1366,7 @@ isdn_net_type_trans(struct sk_buff *skb, struct net_device *dev)
        struct ethhdr *eth;
        unsigned char *rawp;
 
-       skb->mac.raw = skb->data;
+       skb_reset_mac_header(skb);
        skb_pull(skb, ETH_HLEN);
        eth = eth_hdr(skb);
 
@@ -1786,7 +1786,7 @@ isdn_net_receive(struct net_device *ndev, struct sk_buff *skb)
        }
        skb->dev = ndev;
        skb->pkt_type = PACKET_HOST;
-       skb->mac.raw = skb->data;
+       skb_reset_mac_header(skb);
 #ifdef ISDN_DEBUG_NET_DUMP
        isdn_dumppkt("R:", skb->data, skb->len, 40);
 #endif
index 1b2df80c3bce818598e724bebd25385b4e487276..be915051cb2e2e4cd9bd1d815aec7b68663b35dd 100644 (file)
@@ -1167,7 +1167,7 @@ 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->mac.raw = skb->data;
+       skb_reset_mac_header(skb);
        netif_rx(skb);
        /* net_dev->local->stats.rx_packets++; done in isdn_net.c */
        return;
index b691292ff59969fcafc3607ad7f426cc289d1ec9..d5b878d56280ee8472e849eff978ba96aae020b5 100644 (file)
@@ -753,7 +753,7 @@ mpt_lan_sdu_send (struct sk_buff *skb, struct net_device *dev)
        /* Set the mac.raw pointer, since this apparently isn't getting
         * done before we get the skb. Pull the data pointer past the mac data.
         */
-       skb->mac.raw = skb->data;
+       skb_reset_mac_header(skb);
        skb_pull(skb, 12);
 
         dma = pci_map_single(mpt_dev->pcidev, skb->data, skb->len,
@@ -1549,7 +1549,7 @@ mpt_lan_type_trans(struct sk_buff *skb, struct net_device *dev)
        struct mpt_lan_ohdr *fch = (struct mpt_lan_ohdr *)skb->data;
        struct fcllc *fcllc;
 
-       skb->mac.raw = skb->data;
+       skb_reset_mac_header(skb);
        skb_pull(skb, sizeof(struct mpt_lan_ohdr));
 
        if (fch->dtype == htons(0xffff)) {
index dba5e5165452ba6a72bd250b4bd3d63b8bb7f250..28cb79cee910db24acad165585b9e31d51dacfa3 100644 (file)
@@ -853,7 +853,7 @@ static void cops_rx(struct net_device *dev)
                 return;
         }
 
-        skb->mac.raw    = skb->data;    /* Point to entire packet. */
+        skb_reset_mac_header(skb);    /* Point to entire packet. */
         skb_pull(skb,3);
         skb->h.raw      = skb->data;    /* Point to data (Skip header). */
 
index 2ea44ce4981064ed0589918a9b1ded3a45a7d793..12682439f8bdfb105045ba23b3403942a7c01573 100644 (file)
@@ -770,7 +770,7 @@ static int sendup_buffer (struct net_device *dev)
        skb->data[0] = dnode;
        skb->data[1] = snode;
        skb->data[2] = llaptype;
-       skb->mac.raw = skb->data;       /* save pointer to llap header */
+       skb_reset_mac_header(skb);      /* save pointer to llap header */
        skb_pull(skb,3);
 
        /* copy ddp(s,e)hdr + contents */
index 6318814a11a8a7a3294ee371e2d4017f48900afa..e0a18e7c73cb59d36150bc9007fb82d39819bb21 100644 (file)
@@ -110,7 +110,7 @@ static void rx(struct net_device *dev, int bufnum,
 
        pkt = (struct archdr *) skb->data;
 
-       skb->mac.raw = skb->data;
+       skb_reset_mac_header(skb);
        skb_pull(skb, ARC_HDR_SIZE);
 
        /* up to sizeof(pkt->soft) has already been copied from the card */
index 66485585ab393a1fc7eb210895cdd896be9d81d6..6c764b66e9cc6fba1c71482324c9f9a52ef555e1 100644 (file)
@@ -122,10 +122,8 @@ static void rx(struct net_device *dev, int bufnum,
        }
        skb_put(skb, length + ARC_HDR_SIZE + sizeof(int));
        skb->dev = dev;
-
-       pkt = (struct archdr *) skb->data;
-
-       skb->mac.raw = skb->data;
+       skb_reset_mac_header(skb);
+       pkt = (struct archdr *)skb->mac.raw;
        skb_pull(skb, ARC_HDR_SIZE);
 
        /* up to sizeof(pkt->soft) has already been copied from the card */
@@ -270,9 +268,8 @@ static int ack_tx(struct net_device *dev, int acked)
   skb_put(ackskb, length + ARC_HDR_SIZE );
   ackskb->dev = dev;
 
-  ackpkt = (struct archdr *) ackskb->data;
-
-  ackskb->mac.raw = ackskb->data;
+  skb_reset_mac_header(ackskb);
+  ackpkt = (struct archdr *)ackskb->mac.raw;
   /* skb_pull(ackskb, ARC_HDR_SIZE); */
 
 
index 6d6c69f036ef8b1d6df8f378f20683a7fa2a172d..2de8877ece292df4e84c85e2c6ba01c58366a74b 100644 (file)
@@ -94,7 +94,7 @@ static unsigned short type_trans(struct sk_buff *skb, struct net_device *dev)
        int hdr_size = ARC_HDR_SIZE + RFC1051_HDR_SIZE;
 
        /* Pull off the arcnet header. */
-       skb->mac.raw = skb->data;
+       skb_reset_mac_header(skb);
        skb_pull(skb, hdr_size);
 
        if (pkt->hard.dest == 0)
index bee34226abfa1e0aea58bac9e7f998c5634c45be..460a095000c22a756ae24274d8aeaa96db9fb07f 100644 (file)
@@ -96,7 +96,7 @@ static unsigned short type_trans(struct sk_buff *skb, struct net_device *dev)
        int hdr_size = ARC_HDR_SIZE + RFC1201_HDR_SIZE;
 
        /* Pull off the arcnet header. */
-       skb->mac.raw = skb->data;
+       skb_reset_mac_header(skb);
        skb_pull(skb, hdr_size);
 
        if (pkt->hard.dest == 0)
index 3fb354d9c5156b6e25ab617cbcded5d4e57e74d1..e3c9e2e56d14852616b59071c1e75f07b46f08e7 100644 (file)
@@ -884,7 +884,7 @@ static int ad_lacpdu_send(struct port *port)
        }
 
        skb->dev = slave->dev;
-       skb->mac.raw = skb->data;
+       skb_reset_mac_header(skb);
        skb->nh.raw = skb->data + ETH_HLEN;
        skb->protocol = PKT_TYPE_LACPDU;
        skb->priority = TC_PRIO_CONTROL;
@@ -928,7 +928,7 @@ static int ad_marker_send(struct port *port, struct marker *marker)
        skb_reserve(skb, 16);
 
        skb->dev = slave->dev;
-       skb->mac.raw = skb->data;
+       skb_reset_mac_header(skb);
        skb->nh.raw = skb->data + ETH_HLEN;
        skb->protocol = PKT_TYPE_LACPDU;
 
index 217a2eedee0aafc143e5533aff617b70693927cb..916162ca0c98888c68768ac9d6a5300ea40ff969 100644 (file)
@@ -890,7 +890,7 @@ static void alb_send_learning_packets(struct slave *slave, u8 mac_addr[])
                data = skb_put(skb, size);
                memcpy(data, &pkt, size);
 
-               skb->mac.raw = data;
+               skb_reset_mac_header(skb);
                skb->nh.raw = data + ETH_HLEN;
                skb->protocol = pkt.type;
                skb->priority = TC_PRIO_CONTROL;
@@ -1266,7 +1266,7 @@ int bond_alb_xmit(struct sk_buff *skb, struct net_device *bond_dev)
        u8 *hash_start = NULL;
        int res = 1;
 
-       skb->mac.raw = (unsigned char *)skb->data;
+       skb_reset_mac_header(skb);
        eth_data = eth_hdr(skb);
 
        /* make sure that the curr_active_slave and the slaves list do
index 199e5066acf395ced8afe97112cf20588b3602a2..ebcf35e4cf5b45db0c7ffda9054c20d7982e826b 100644 (file)
@@ -783,7 +783,7 @@ static int do_trace(struct t3cdev *dev, struct sk_buff *skb)
        skb->protocol = htons(0xffff);
        skb->dev = dev->lldev;
        skb_pull(skb, sizeof(*p));
-       skb->mac.raw = skb->data;
+       skb_reset_mac_header(skb);
        netif_receive_skb(skb);
        return 0;
 }
index 8946f7aa97cde40ac638bbdca821af1f62b59efc..b5cf2a60834dd4e26620dc6ee7da10d8b386d67c 100644 (file)
@@ -1620,7 +1620,8 @@ static inline int rx_offload(struct t3cdev *tdev, struct sge_rspq *rq,
                             unsigned int gather_idx)
 {
        rq->offload_pkts++;
-       skb->mac.raw = skb->nh.raw = skb->h.raw = skb->data;
+       skb_reset_mac_header(skb);
+       skb->nh.raw = skb->h.raw = skb->data;
 
        if (rq->polling) {
                rx_gather[gather_idx++] = skb;
index cebf8c374bc57521fa93325fd531e3d127bccf3b..0f10758226fac369c1658fe2b6239d6262b8c89a 100644 (file)
@@ -1932,7 +1932,7 @@ static int  ali_ircc_dma_receive_complete(struct ali_ircc_cb *self)
                        self->stats.rx_packets++;
 
                        skb->dev = self->netdev;
-                       skb->mac.raw  = skb->data;
+                       skb_reset_mac_header(skb);
                        skb->protocol = htons(ETH_P_IRDA);
                        netif_rx(skb);
                        self->netdev->last_rx = jiffies;
index 37914dc5b90ee57063b3f86c42d00eb561c99008..27afd0f367d644da22f626f9b6f6ce4b54728bbf 100644 (file)
@@ -606,7 +606,7 @@ static int au1k_irda_rx(struct net_device *dev)
                                skb_put(skb, count-2);
                        memcpy(skb->data, (void *)pDB->vaddr, count-2);
                        skb->dev = dev;
-                       skb->mac.raw = skb->data;
+                       skb_reset_mac_header(skb);
                        skb->protocol = htons(ETH_P_IRDA);
                        netif_rx(skb);
                        prxd->count_0 = 0;
index 11af0ae7510e0823d033629a3bdf15f1a6175f2c..ddfa6c38a16bc6aba1e447a59ceafff0b9403928 100644 (file)
@@ -1286,7 +1286,7 @@ dumpbufs(self->rx_bufs[self->rxs],len,'<');
 
                       self->stats.rx_packets++;
                       skb->dev = self->netdev;
-                      skb->mac.raw = skb->data;
+                      skb_reset_mac_header(skb);
                       skb->protocol = htons (ETH_P_IRDA);
                     }
                   else
index 1d510bdc9b84a176655240d447dac97c1323ba8b..6ef375a095f418913c625453906b4f04399881f4 100644 (file)
@@ -921,7 +921,7 @@ static void irda_usb_receive(struct urb *urb)
 
        /* Ask the networking layer to queue the packet for the IrDA stack */
        dataskb->dev = self->netdev;
-       dataskb->mac.raw  = dataskb->data;
+       skb_reset_mac_header(dataskb);
        dataskb->protocol = htons(ETH_P_IRDA);
        len = dataskb->len;
        netif_rx(dataskb);
index f0c61f3b2a82e992fee61cdf664dd2d42e62cfdc..3ff1f4b33c06660c600f348129d8588ec412283b 100644 (file)
@@ -428,7 +428,7 @@ static void mcs_unwrap_mir(struct mcs_cb *mcs, __u8 *buf, int len)
        skb_reserve(skb, 1);
        memcpy(skb->data, buf, new_len);
        skb_put(skb, new_len);
-       skb->mac.raw = skb->data;
+       skb_reset_mac_header(skb);
        skb->protocol = htons(ETH_P_IRDA);
        skb->dev = mcs->netdev;
 
@@ -481,7 +481,7 @@ static void mcs_unwrap_fir(struct mcs_cb *mcs, __u8 *buf, int len)
        skb_reserve(skb, 1);
        memcpy(skb->data, buf, new_len);
        skb_put(skb, new_len);
-       skb->mac.raw = skb->data;
+       skb_reset_mac_header(skb);
        skb->protocol = htons(ETH_P_IRDA);
        skb->dev = mcs->netdev;
 
index 29b5ccd29d0bbcca3a7d7e78cf352da4848a9d3a..8ce7dad582f4aad0349967c29169463a63d802a3 100644 (file)
@@ -1881,7 +1881,7 @@ static int nsc_ircc_dma_receive_complete(struct nsc_ircc_cb *self, int iobase)
                        self->stats.rx_packets++;
 
                        skb->dev = self->netdev;
-                       skb->mac.raw  = skb->data;
+                       skb_reset_mac_header(skb);
                        skb->protocol = htons(ETH_P_IRDA);
                        netif_rx(skb);
                        self->netdev->last_rx = jiffies;
index 2272156af31e5b09afaaacd2a962dcff2c2010a5..f35d7d42624e8bc67091b359db7619bec106e8d8 100644 (file)
@@ -391,7 +391,7 @@ static void pxa_irda_fir_irq_eif(struct pxa_irda *si, struct net_device *dev, in
 
                /* Feed it to IrLAP  */
                skb->dev = dev;
-               skb->mac.raw  = skb->data;
+               skb_reset_mac_header(skb);
                skb->protocol = htons(ETH_P_IRDA);
                netif_rx(skb);
 
index 937372d00398af170db4c3c6371bb2ec6c61fb10..056639f72becf049657601585f82e83c0c20a6a1 100644 (file)
@@ -504,7 +504,7 @@ static void sa1100_irda_fir_error(struct sa1100_irda *si, struct net_device *dev
 
                skb_put(skb, len);
                skb->dev = dev;
-               skb->mac.raw = skb->data;
+               skb_reset_mac_header(skb);
                skb->protocol = htons(ETH_P_IRDA);
                si->stats.rx_packets++;
                si->stats.rx_bytes += len;
index 31c623381ea84d7bfb638e36056984f725b2b6d8..103a2d18ed2f9c3db0132b97a0e26630f72d47da 100644 (file)
@@ -1412,7 +1412,7 @@ static void smsc_ircc_dma_receive_complete(struct smsc_ircc_cb *self)
        self->stats.rx_bytes += len;
 
        skb->dev = self->netdev;
-       skb->mac.raw  = skb->data;
+       skb_reset_mac_header(skb);
        skb->protocol = htons(ETH_P_IRDA);
        netif_rx(skb);
 }
index 20d306fea4cbd558e3b0dc906548174b03475a79..a22175f4ea812e98979d64139bf8f7c168cb4511 100644 (file)
@@ -364,7 +364,7 @@ static void fir_eof(struct stir_cb *stir)
 
        skb_put(skb, len);
 
-       skb->mac.raw  = skb->data;
+       skb_reset_mac_header(skb);
        skb->protocol = htons(ETH_P_IRDA);
        skb->dev = stir->netdev;
 
index c3ed9b3067e5b76fc7c9549c48ab46e11a32ac98..5ff416314604d22d882595a0cab0607a0f645deb 100644 (file)
@@ -1125,7 +1125,7 @@ static int via_ircc_dma_receive_complete(struct via_ircc_cb *self,
                self->stats.rx_bytes += len;
                self->stats.rx_packets++;
                skb->dev = self->netdev;
-               skb->mac.raw = skb->data;
+               skb_reset_mac_header(skb);
                skb->protocol = htons(ETH_P_IRDA);
                netif_rx(skb);
                return TRUE;
@@ -1198,7 +1198,7 @@ F01_E */
                self->stats.rx_bytes += len;
                self->stats.rx_packets++;
                skb->dev = self->netdev;
-               skb->mac.raw = skb->data;
+               skb_reset_mac_header(skb);
                skb->protocol = htons(ETH_P_IRDA);
                netif_rx(skb);
 
@@ -1244,7 +1244,7 @@ static int upload_rxdata(struct via_ircc_cb *self, int iobase)
        self->stats.rx_bytes += len;
        self->stats.rx_packets++;
        skb->dev = self->netdev;
-       skb->mac.raw = skb->data;
+       skb_reset_mac_header(skb);
        skb->protocol = htons(ETH_P_IRDA);
        netif_rx(skb);
        if (st_fifo->len < (MAX_RX_WINDOW + 2)) {
@@ -1313,7 +1313,7 @@ static int RxTimerHandler(struct via_ircc_cb *self, int iobase)
                        self->stats.rx_bytes += len;
                        self->stats.rx_packets++;
                        skb->dev = self->netdev;
-                       skb->mac.raw = skb->data;
+                       skb_reset_mac_header(skb);
                        skb->protocol = htons(ETH_P_IRDA);
                        netif_rx(skb);
                }               //while
index 3457e9d8b6671ec7a7ffc322efba0c29011bd9e6..79b407f3a49a5411077246f9eb2975c0d6d1fe1d 100644 (file)
@@ -595,7 +595,7 @@ static int vlsi_process_rx(struct vlsi_ring *r, struct ring_descr *rd)
        rd->skb = NULL;
        skb->dev = ndev;
        memcpy(skb_put(skb,len), rd->buf, len);
-       skb->mac.raw = skb->data;
+       skb_reset_mac_header(skb);
        if (in_interrupt())
                netif_rx(skb);
        else
index 4212657fa4f976900f498d813d3cc60363f3815b..bee4451309524779c602847baab75ab75e2b9039 100644 (file)
@@ -919,7 +919,7 @@ int w83977af_dma_receive_complete(struct w83977af_ir *self)
                        self->stats.rx_packets++;
                        
                        skb->dev = self->netdev;
-                       skb->mac.raw  = skb->data;
+                       skb_reset_mac_header(skb);
                        skb->protocol = htons(ETH_P_IRDA);
                        netif_rx(skb);
                        self->netdev->last_rx = jiffies;
index ee26ef52289f38259dbddf7ee39f8c8da981c61d..de092658db6cd2b15c2fd351d78247bf5741dc92 100644 (file)
@@ -368,7 +368,7 @@ static __be16 myri_type_trans(struct sk_buff *skb, struct net_device *dev)
        struct ethhdr *eth;
        unsigned char *rawp;
 
-       skb->mac.raw = (((unsigned char *)skb->data) + MYRI_PAD_LEN);
+       skb->mac.raw = skb->data + MYRI_PAD_LEN;
        skb_pull(skb, dev->hard_header_len);
        eth = eth_hdr(skb);
 
index ef58e41287820dd23d0066c4aede6b3822983299..18f1790aab9a02459572c232a68a2170e32e8cff 100644 (file)
@@ -1685,7 +1685,7 @@ ppp_receive_nonmp_frame(struct ppp *ppp, struct sk_buff *skb)
                        skb_pull_rcsum(skb, 2);
                        skb->dev = ppp->dev;
                        skb->protocol = htons(npindex_to_ethertype[npi]);
-                       skb->mac.raw = skb->data;
+                       skb_reset_mac_header(skb);
                        netif_rx(skb);
                        ppp->dev->last_rx = jiffies;
                }
index b9fa4fbb13987fb32beb2b0cfffc463dbfdc4e12..1de3eec1a792f13312cf809c0b6ab528c3103ba8 100644 (file)
@@ -834,7 +834,7 @@ printk("cm0: IP identification: %02x%02x  fragment offset: %02x%02x\n", buffer[3
                        goto dropped_frame;
                }
                skb->dev = dev;
-               skb->mac.raw = skb->data;
+               skb_reset_mac_header(skb);
                skb->protocol = (unsigned short) buffer[NewDatagramHeaderSkip + 16];
                insw(ioaddr, skb_put(skb, NewDatagramDataSize),
                        NewDatagramDataSize / 2);
index a57aa010cb25898668b88e03508b69dffbe22be0..288d8559f8c5c48238a231331156454b0a735288 100644 (file)
@@ -256,7 +256,7 @@ static __inline__ ssize_t tun_get_user(struct tun_struct *tun, struct iovec *iv,
 
        switch (tun->flags & TUN_TYPE_MASK) {
        case TUN_TUN_DEV:
-               skb->mac.raw = skb->data;
+               skb_reset_mac_header(skb);
                skb->protocol = pi.proto;
                skb->dev = tun->dev;
                break;
index 5b82e4fd0d735a206d7a75bace529bd513ae4039..c198511ec3f56c31cbeb1ef02235b8127d019c2f 100644 (file)
@@ -773,7 +773,7 @@ static int sppp_rx_done(struct channel_data *chan)
        }
        chan->rx_skb->protocol = htons(ETH_P_WAN_PPP);
        chan->rx_skb->dev = chan->pppdev.dev;
-       chan->rx_skb->mac.raw = chan->rx_skb->data;
+       skb_reset_mac_header(chan->rx_skb)
        chan->stats.rx_packets++;
        chan->stats.rx_bytes += chan->cosa->rxsize;
        netif_rx(chan->rx_skb);
index a631d1c2fa148a7191ac775baab2f2c4a82fe12b..016b3ff3ea5e5cc36874a644ede970036ba7256b 100644 (file)
@@ -834,7 +834,7 @@ static void cycx_x25_irq_rx(struct cycx_device *card, struct cycx_x25_cmd *cmd)
        ++chan->ifstats.rx_packets;
        chan->ifstats.rx_bytes += pktlen;
 
-       skb->mac.raw = skb->data;
+       skb_reset_mac_header(skb);
        netif_rx(skb);
        dev->last_rx = jiffies;         /* timestamp */
 }
index 7369875594321aaabe38457a55f29ff03e5964e6..66be20c292b6dcd8855ec84830a15e7850c70baa 100644 (file)
@@ -176,7 +176,7 @@ static void dlci_receive(struct sk_buff *skb, struct net_device *dev)
        if (process)
        {
                /* we've set up the protocol, so discard the header */
-               skb->mac.raw = skb->data; 
+               skb_reset_mac_header(skb);
                skb_pull(skb, header);
                dlp->stats.rx_bytes += skb->len;
                netif_rx(skb);
index c45d6a83339d187e6c999427a1d42573e6e7f039..58a53b6d9b429181a40dca4aa597890086e73bd2 100644 (file)
@@ -864,7 +864,7 @@ fst_tx_dma_complete(struct fst_card_info *card, struct fst_port_info *port,
 static __be16 farsync_type_trans(struct sk_buff *skb, struct net_device *dev)
 {
        skb->dev = dev;
-       skb->mac.raw = skb->data;
+       skb_reset_mac_header(skb);
        skb->pkt_type = PACKET_HOST;
        return htons(ETH_P_CUST);
 }
index 2b54f1bc3a0d3bd18d3ee1cd0e47e5483573788b..6d288839ddaa829ab6b2b4197e74fa874640be5e 100644 (file)
@@ -1667,7 +1667,7 @@ static int lmc_rx (struct net_device *dev) /*fold00*/
             skb_put (skb, len);
             skb->protocol = lmc_proto_type(sc, skb);
             skb->protocol = htons(ETH_P_WAN_PPP);
-            skb->mac.raw = skb->data;
+            skb_reset_mac_header(skb);
 //            skb->nh.raw = skb->data;
             skb->dev = dev;
             lmc_proto_netif(sc, skb);
@@ -1705,7 +1705,7 @@ static int lmc_rx (struct net_device *dev) /*fold00*/
             memcpy(skb_put(nsb, len), skb->data, len);
             
             nsb->protocol = lmc_proto_type(sc, skb);
-            nsb->mac.raw = nsb->data;
+            skb_reset_mac_header(nsb);
 //            nsb->nh.raw = nsb->data;
             nsb->dev = dev;
             lmc_proto_netif(sc, nsb);
index 62184dee377c5961c33b30179ba8784ea45185c1..edbc55528be516ee5628b2b79d6ca85f2791b29b 100644 (file)
@@ -1755,7 +1755,7 @@ cpc_trace(struct net_device *dev, struct sk_buff *skb_main, char rx_tx)
 
        skb->dev = dev;
        skb->protocol = htons(ETH_P_CUST);
-       skb->mac.raw = skb->data;
+       skb_reset_mac_header(skb);
        skb->pkt_type = PACKET_HOST;
        skb->len = 10 + skb_main->len;
 
index 5873c346e7e9ee25ee53f3679982407c6b99d0eb..de02a07259cf7e0ac5e31efbf4811ccf9e4c0f95 100644 (file)
@@ -1003,7 +1003,7 @@ static void cpc_tty_trace(pc300dev_t *dev, char* buf, int len, char rxtx)
        skb_put (skb, 10 + len); 
        skb->dev = dev->dev; 
        skb->protocol = htons(ETH_P_CUST); 
-       skb->mac.raw = skb->data; 
+       skb_reset_mac_header(skb);
        skb->pkt_type = PACKET_HOST; 
        skb->len = 10 + len; 
 
index e50b1482d79260abf608ad8cbd25f694b7fcf3ac..692a23f9834da040d346bb2abacc8a0f5f26d8f5 100644 (file)
@@ -3411,7 +3411,7 @@ badrx:
                        OUT4500( apriv, EVACK, EV_RX);
 
                        if (test_bit(FLAG_802_11, &apriv->flags)) {
-                               skb->mac.raw = skb->data;
+                               skb_reset_mac_header(skb);
                                skb->pkt_type = PACKET_OTHERHOST;
                                skb->dev = apriv->wifidev;
                                skb->protocol = htons(ETH_P_802_2);
@@ -3746,7 +3746,7 @@ void mpi_receive_802_11 (struct airo_info *ai)
                wireless_spy_update(ai->dev, sa, &wstats);
        }
 #endif /* IW_WIRELESS_SPY */
-       skb->mac.raw = skb->data;
+       skb_reset_mac_header(skb);
        skb->pkt_type = PACKET_OTHERHOST;
        skb->dev = ai->wifidev;
        skb->protocol = htons(ETH_P_802_2);
index f78ee26d787a94a9a78f6c83d703f247476f4dc8..e4082f9d766b869a81b96e41759e8dd86457317c 100644 (file)
@@ -167,7 +167,7 @@ hdr->f.status = s; hdr->f.len = l; hdr->f.data = d
 
        ret = skb->len - phdrlen;
        skb->dev = dev;
-       skb->mac.raw = skb->data;
+       skb_reset_mac_header(skb);
        skb_pull(skb, hdrlen);
        if (prism_header)
                skb_pull(skb, phdrlen);
@@ -1073,10 +1073,11 @@ void hostap_80211_rx(struct net_device *dev, struct sk_buff *skb,
 
        if (skb2 != NULL) {
                /* send to wireless media */
+               skb2->dev = dev;
                skb2->protocol = __constant_htons(ETH_P_802_3);
-               skb2->mac.raw = skb2->nh.raw = skb2->data;
+               skb_reset_mac_header(skb2);
+               skb2->nh.raw = skb2->data;
                /* skb2->nh.raw = skb2->data + ETH_HLEN; */
-               skb2->dev = dev;
                dev_queue_xmit(skb2);
        }
 
index 4a5be70c04195c412aca816fb796cfc4e96cb8f3..159baef18e4abf982cda0609b4e21c9a0ec78f7c 100644 (file)
@@ -237,7 +237,7 @@ int hostap_data_start_xmit(struct sk_buff *skb, struct net_device *dev)
        iface->stats.tx_packets++;
        iface->stats.tx_bytes += skb->len;
 
-       skb->mac.raw = skb->data;
+       skb_reset_mac_header(skb);
        meta = (struct hostap_skb_tx_data *) skb->cb;
        memset(meta, 0, sizeof(*meta));
        meta->magic = HOSTAP_SKB_TX_DATA_MAGIC;
index efb8cf3bd8ad6c0eaebc789fd2b8caf787d48d88..cc18f9686d277f3007ca0b89bd8ce7e22ef175ac 100644 (file)
@@ -982,7 +982,8 @@ static void prism2_send_mgmt(struct net_device *dev,
        meta->tx_cb_idx = tx_cb_idx;
 
        skb->dev = dev;
-       skb->mac.raw = skb->nh.raw = skb->data;
+       skb_reset_mac_header(skb);
+       skb->nh.raw = skb->data;
        dev_queue_xmit(skb);
 }
 #endif /* PRISM2_NO_KERNEL_IEEE80211_MGMT */
index 3079378fb8cd284effe9f0285a3a81c5f8af1392..9003ff7d151af839113e935487e5cbf0e6165bd7 100644 (file)
@@ -2217,7 +2217,7 @@ static void hostap_tx_callback(local_info_t *local,
                memcpy(skb_put(skb, len), payload, len);
 
        skb->dev = local->dev;
-       skb->mac.raw = skb->data;
+       skb_reset_mac_header(skb);
 
        cb->func(skb, ok, cb->data);
 }
index 9077e6edde3411319e7a472a4f67e68b4b9fc69f..0e29ff76287996bf0c9f9beb4c77594bb54d6c6b 100644 (file)
@@ -1063,7 +1063,8 @@ int prism2_sta_send_mgmt(local_info_t *local, u8 *dst, u16 stype,
        meta->iface = netdev_priv(dev);
 
        skb->dev = dev;
-       skb->mac.raw = skb->nh.raw = skb->data;
+       skb_reset_mac_header(skb);
+       skb->nh.raw = skb->data;
        dev_queue_xmit(skb);
 
        return 0;
index c878a2f3239c1295a3b37e498c5ad5541f36da86..b04c56a25cc5bec7031a096db40fba9d0a242d45 100644 (file)
@@ -8133,7 +8133,7 @@ static void ipw_handle_mgmt_packet(struct ipw_priv *priv,
                skb->dev = priv->ieee->dev;
 
                /* Point raw at the ieee80211_stats */
-               skb->mac.raw = skb->data;
+               skb_reset_mac_header(skb);
 
                skb->pkt_type = PACKET_OTHERHOST;
                skb->protocol = __constant_htons(ETH_P_80211_STATS);
index 3f9d78d059b5c853ddfbeb2d68bd85a01eacd1c5..f1415bff527fdf91af5aeb88da4e08e9b538580d 100644 (file)
@@ -770,7 +770,7 @@ static void orinoco_rx_monitor(struct net_device *dev, u16 rxfid,
 
        /* Copy the 802.11 header to the skb */
        memcpy(skb_put(skb, hdrlen), &(desc->frame_ctl), hdrlen);
-       skb->mac.raw = skb->data;
+       skb_reset_mac_header(skb);
 
        /* If any, copy the data from the card to the skb */
        if (datalen > 0) {
index fc2e0f3a896e5a386e22741fb73ad6447016913f..6ebfff0342422875c48409965d0a4d5565461408 100644 (file)
@@ -303,7 +303,7 @@ islpci_monitor_rx(islpci_private *priv, struct sk_buff **skb)
                skb_pull(*skb, sizeof (struct rfmon_header));
 
        (*skb)->protocol = htons(ETH_P_802_2);
-       (*skb)->mac.raw = (*skb)->data;
+       skb_reset_mac_header(*skb);
        (*skb)->pkt_type = PACKET_OTHERHOST;
 
        return 0;
index f5ce1c6063d823ed52dead7b417179783c1a4fec..2a299a0676a640e6c41a4f734f87871e2b9bec67 100644 (file)
@@ -2009,7 +2009,7 @@ static void deliver_packet(struct strip *strip_info, STRIP_Header * header,
                       packetlen);
                skb->dev = get_strip_dev(strip_info);
                skb->protocol = header->protocol;
-               skb->mac.raw = skb->data;
+               skb_reset_mac_header(skb);
 
                /* Having put a fake header on the front of the sk_buff for the */
                /* benefit of tools like tcpdump, skb_pull now 'consumes' that  */
index 0d6d5fcc128b8231d3b53d87ae762a4a83075bd8..787c01317042fece3bc3ef5b1624a6bbb44e76ae 100644 (file)
@@ -455,7 +455,7 @@ ctc_unpack_skb(struct channel *ch, struct sk_buff *pskb)
                        return;
                }
                skb_put(pskb, header->length);
-               pskb->mac.raw = pskb->data;
+               skb_reset_mac_header(pskb);
                len -= header->length;
                skb = dev_alloc_skb(pskb->len);
                if (!skb) {
@@ -473,7 +473,7 @@ ctc_unpack_skb(struct channel *ch, struct sk_buff *pskb)
                        return;
                }
                memcpy(skb_put(skb, pskb->len), pskb->data, pskb->len);
-               skb->mac.raw = skb->data;
+               skb_reset_mac_header(skb);
                skb->dev = pskb->dev;
                skb->protocol = pskb->protocol;
                pskb->ip_summed = CHECKSUM_UNNECESSARY;
index 594320ca1b7c96ae7e69284017e6d77edb0e691e..82edf2014402a8fbadf0249aec259c600a5e666b 100644 (file)
@@ -635,7 +635,7 @@ static void netiucv_unpack_skb(struct iucv_connection *conn,
                        return;
                }
                skb_put(pskb, header->next);
-               pskb->mac.raw = pskb->data;
+               skb_reset_mac_header(pskb);
                skb = dev_alloc_skb(pskb->len);
                if (!skb) {
                        PRINT_WARN("%s Out of memory in netiucv_unpack_skb\n",
@@ -646,7 +646,7 @@ static void netiucv_unpack_skb(struct iucv_connection *conn,
                        return;
                }
                memcpy(skb_put(skb, pskb->len), pskb->data, pskb->len);
-               skb->mac.raw = skb->data;
+               skb_reset_mac_header(skb);
                skb->dev = pskb->dev;
                skb->protocol = pskb->protocol;
                pskb->ip_summed = CHECKSUM_UNNECESSARY;
index 7c735e1fe06377835f508d6abec84d9f7bf09d1d..910a8ab66b057aa1e62a60d7b5a7369a4f062e3e 100644 (file)
@@ -486,7 +486,7 @@ qeth_eddp_fill_context_tcp(struct qeth_eddp_context *ctx,
                return -ENOMEM;
        }
        if (qhdr->hdr.l2.id == QETH_HEADER_TYPE_LAYER2) {
-               skb->mac.raw = (skb->data) + sizeof(struct qeth_hdr);
+               skb->mac.raw = skb->data + sizeof(struct qeth_hdr);
                memcpy(&eddp->mac, eth_hdr(skb), ETH_HLEN);
 #ifdef CONFIG_QETH_VLAN
                if (eddp->mac.h_proto == __constant_htons(ETH_P_8021Q)) {
index d502b77adf6bd03bafe8d823fe331b01cce9add8..28822025b791f28e892852e043476dd1690883c0 100644 (file)
@@ -2278,7 +2278,7 @@ qeth_type_trans(struct sk_buff *skb, struct net_device *dev)
            (card->info.link_type == QETH_LINK_TYPE_LANE_TR))
                return tr_type_trans(skb,dev);
 #endif /* CONFIG_TR */
-       skb->mac.raw = skb->data;
+       skb_reset_mac_header(skb);
        skb_pull(skb, ETH_HLEN );
        eth = eth_hdr(skb);
 
@@ -2461,7 +2461,7 @@ qeth_rebuild_skb(struct qeth_card *card, struct sk_buff *skb,
        if (card->options.fake_ll)
                qeth_rebuild_skb_fake_ll(card, skb, hdr);
        else
-               skb->mac.raw = skb->data;
+               skb_reset_mac_header(skb);
        skb->ip_summed = card->options.checksum_type;
        if (card->options.checksum_type == HW_CHECKSUMMING){
                if ( (hdr->hdr.l3.ext_flags &
index d4b333938f73277790ae2a512b374da747512fae..0fe562af9c8cfb51088df41866362953970c5591 100644 (file)
@@ -132,8 +132,8 @@ static __inline__ __be16 hdlc_type_trans(struct sk_buff *skb,
 {
        hdlc_device *hdlc = dev_to_hdlc(dev);
 
-       skb->mac.raw  = skb->data;
-       skb->dev      = dev;
+       skb->dev = dev;
+       skb_reset_mac_header(skb);
 
        if (hdlc->proto->type_trans)
                return hdlc->proto->type_trans(skb, dev);
index df229bd5f1a9ef5d5c22838f3086ac3890e28045..748f254b50cc1805dd3aa1a4969e1dcb19984796 100644 (file)
@@ -960,6 +960,11 @@ static inline void skb_reserve(struct sk_buff *skb, int len)
        skb->tail += len;
 }
 
+static inline void skb_reset_mac_header(struct sk_buff *skb)
+{
+       skb->mac.raw = skb->data;
+}
+
 /*
  * CPUs often take a performance hit when accessing unaligned memory
  * locations. The actual performance hit varies, it can be small if the
index 47ff2f46e9086b7d465f5357bc5b156330849acf..99a4e364c74ae6db4efa55849890617e11cc7258 100644 (file)
@@ -263,8 +263,8 @@ static __inline__ void ax25_cb_put(ax25_cb *ax25)
 static inline __be16 ax25_type_trans(struct sk_buff *skb, struct net_device *dev)
 {
        skb->dev      = dev;
+       skb_reset_mac_header(skb);
        skb->pkt_type = PACKET_HOST;
-       skb->mac.raw  = skb->data;
        return htons(ETH_P_AX25);
 }
 
index 1d10c879f7e241b8543e0f86cb51d45e56381982..1415bcf93980f9c06aca48ee41de41065d72cedb 100644 (file)
@@ -7,8 +7,8 @@
 
 static inline __be16 x25_type_trans(struct sk_buff *skb, struct net_device *dev)
 {
-       skb->mac.raw = skb->data;
        skb->dev = dev;
+       skb_reset_mac_header(skb);
        skb->pkt_type = PACKET_HOST;
        
        return htons(ETH_P_X25);
index f8a0c9f6fec90f9ba84229959457c2d1ffcb15d4..91dde41b54819998d2db2e603611910da1604b77 100644 (file)
@@ -131,7 +131,7 @@ __be16 fddi_type_trans(struct sk_buff *skb, struct net_device *dev)
         */
 
        skb->dev = dev;
-       skb->mac.raw = skb->data;       /* point to frame control (FC) */
+       skb_reset_mac_header(skb);      /* point to frame control (FC) */
 
        if(fddi->hdr.llc_8022_1.dsap==0xe0)
        {
index 138302c14ee605c84cca9fa3760c0826b91d1f42..d87190038edb37d7a76ea4ec2def1e49ca8936e9 100644 (file)
@@ -131,7 +131,7 @@ __be16 hippi_type_trans(struct sk_buff *skb, struct net_device *dev)
         * set the raw address here.
         */
        skb->dev = dev;
-       skb->mac.raw = skb->data;
+       skb_reset_mac_header(skb);
        hip = (struct hippi_hdr *)skb->mac.raw;
        skb_pull(skb, HIPPI_HLEN);
 
index 987d91559bccf4034927d7942302b0ba9f74d319..eb2de0d162086c4d7f7404d5cb04a8d53c57c960 100644 (file)
@@ -194,7 +194,7 @@ __be16 tr_type_trans(struct sk_buff *skb, struct net_device *dev)
        unsigned riflen=0;
 
        skb->dev = dev;
-       skb->mac.raw = skb->data;
+       skb_reset_mac_header(skb);
        trh = tr_hdr(skb);
 
        if(trh->saddr[0] & TR_RII)
index c444f5eda22d3c7fdaf8d36e7ea5532b8b08b8df..900d42ca8a5063f4549300c553276e58447dd129 100644 (file)
@@ -458,7 +458,7 @@ static void br2684_push(struct atm_vcc *atmvcc, struct sk_buff *skb)
        /* FIXME: tcpdump shows that pointer to mac header is 2 bytes earlier,
           than should be. What else should I set? */
        skb_pull(skb, plen);
-       skb->mac.raw = ((char *) (skb->data)) - ETH_HLEN;
+       skb->mac.raw = skb->data - ETH_HLEN;
        skb->pkt_type = PACKET_HOST;
 #ifdef CONFIG_BR2684_FAST_TRANS
        skb->protocol = ((u16 *) skb->data)[-1];
index 8c38258160852a5a21e4020f51051b1ea2b4d77b..ccba24ffb96621382625c9464c807174328cd5fc 100644 (file)
@@ -213,7 +213,7 @@ static void clip_push(struct atm_vcc *vcc, struct sk_buff *skb)
                return;
        }
        ATM_SKB(skb)->vcc = vcc;
-       skb->mac.raw = skb->data;
+       skb_reset_mac_header(skb);
        if (!clip_vcc->encap
            || skb->len < RFC1483LLC_LEN
            || memcmp(skb->data, llc_oui, sizeof (llc_oui)))
index 4a6b26becadc67fb3cd6da9ca307d1708526a228..6d11b0633d5aff0c54af5cd7aa51f73fc1c1d059 100644 (file)
@@ -122,7 +122,7 @@ int ax25_rx_iframe(ax25_cb *ax25, struct sk_buff *skb)
                }
 
                skb_pull(skb, 1);       /* Remove PID */
-               skb->mac.raw  = skb->nh.raw;
+               skb_reset_mac_header(skb);
                skb->nh.raw   = skb->data;
                skb->dev      = ax25->ax25_dev->dev;
                skb->pkt_type = PACKET_HOST;
index f7ade186bf939bb79763ebd677a69d76dfd24d52..b1c2fa96c69ee4a6045b68f8d2e9f9f232782eae 100644 (file)
@@ -326,7 +326,7 @@ static inline int bnep_rx_frame(struct bnep_session *s, struct sk_buff *skb)
                return 0;
        }
 
-       skb->mac.raw = skb->data;
+       skb_reset_mac_header(skb);
 
        /* Verify and pull out header */
        if (!skb_pull(skb, __bnep_rx_hlen[type & BNEP_TYPE_MASK]))
index 905a39c33a16f73ce82beaaa9fd05295550485b5..b22ada529cc3dba1209ee966b464c9ee51fee897 100644 (file)
@@ -37,7 +37,7 @@ int br_dev_xmit(struct sk_buff *skb, struct net_device *dev)
        br->statistics.tx_packets++;
        br->statistics.tx_bytes += skb->len;
 
-       skb->mac.raw = skb->data;
+       skb_reset_mac_header(skb);
        skb_pull(skb, ETH_HLEN);
 
        if (dest[0] & 1)
index 424d6d0e98f8b48f0ef7c0332e578d24ffb6c2d1..2fcaf5bc4a9ce25d3728307e7476c13ecaeb26fe 100644 (file)
@@ -1066,7 +1066,7 @@ static void dev_queue_xmit_nit(struct sk_buff *skb, struct net_device *dev)
                           set by sender, so that the second statement is
                           just protection against buggy protocols.
                         */
-                       skb2->mac.raw = skb2->data;
+                       skb_reset_mac_header(skb2);
 
                        if (skb2->nh.raw < skb2->data ||
                            skb2->nh.raw > skb2->tail) {
@@ -1206,7 +1206,7 @@ struct sk_buff *skb_gso_segment(struct sk_buff *skb, int features)
 
        BUG_ON(skb_shinfo(skb)->frag_list);
 
-       skb->mac.raw = skb->data;
+       skb_reset_mac_header(skb);
        skb->mac_len = skb->nh.raw - skb->data;
        __skb_pull(skb, skb->mac_len);
 
index 32a9f80b5f19fd524258699102fae1feb651af53..0ad3896bbf62fa6b95825f63dc6b73662853bd32 100644 (file)
@@ -324,7 +324,7 @@ void netpoll_send_udp(struct netpoll *np, const char *msg, int len)
        iph->check    = ip_fast_csum((unsigned char *)iph, iph->ihl);
 
        eth = (struct ethhdr *) skb_push(skb, ETH_HLEN);
-       skb->mac.raw = skb->data;
+       skb_reset_mac_header(skb);
        skb->protocol = eth->h_proto = htons(ETH_P_IP);
        memcpy(eth->h_source, np->local_mac, 6);
        memcpy(eth->h_dest, np->remote_mac, 6);
index 336958fbbcb2bc87b5391240846d21260fa72765..8f6ebd0d36935dee4f7499f8fbaf6936d1d38bdb 100644 (file)
@@ -1928,7 +1928,7 @@ struct sk_buff *skb_segment(struct sk_buff *skb, int features)
                nskb->mac_len = skb->mac_len;
 
                skb_reserve(nskb, headroom);
-               nskb->mac.raw = nskb->data;
+               skb_reset_mac_header(nskb);
                nskb->nh.raw = nskb->data + skb->mac_len;
                nskb->h.raw = nskb->nh.raw + (skb->h.raw - skb->nh.raw);
                memcpy(skb_put(nskb, doffset), skb->data, doffset);
index c1b5502f195be2ffd05ed3ada14c1ded000f0a4b..ef94ca56d7bda0de8b46d03b65894c479a207968 100644 (file)
@@ -1537,7 +1537,7 @@ int dn_cache_getroute(struct sk_buff *in_skb, struct nlmsghdr *nlh, void *arg)
        skb = alloc_skb(NLMSG_GOODSIZE, GFP_KERNEL);
        if (skb == NULL)
                return -ENOBUFS;
-       skb->mac.raw = skb->data;
+       skb_reset_mac_header(skb);
        cb = DN_SKB_CB(skb);
 
        if (rta[RTA_SRC-1])
index 01ecbe42b1e7054e5320e74a073e6ceec0bbbea8..0ac2524f3b68f73c53517b69e807f51c131d9701 100644 (file)
@@ -157,7 +157,7 @@ __be16 eth_type_trans(struct sk_buff *skb, struct net_device *dev)
        unsigned char *rawp;
 
        skb->dev = dev;
-       skb->mac.raw = skb->data;
+       skb_reset_mac_header(skb);
        skb_pull(skb, ETH_HLEN);
        eth = eth_hdr(skb);
 
index d5f5c661668917428eb9244796a8f33919471549..f39bf7c4101238aa141a93c6c4f3fe1b1916013d 100644 (file)
@@ -42,7 +42,7 @@ static void ieee80211_monitor_rx(struct ieee80211_device *ieee,
        u16 fc = le16_to_cpu(hdr->frame_ctl);
 
        skb->dev = ieee->dev;
-       skb->mac.raw = skb->data;
+       skb_reset_mac_header(skb);
        skb_pull(skb, ieee80211_get_hdrlen(fc));
        skb->pkt_type = PACKET_OTHERHOST;
        skb->protocol = __constant_htons(ETH_P_80211_RAW);
@@ -789,10 +789,11 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
 
        if (skb2 != NULL) {
                /* send to wireless media */
+               skb2->dev = dev;
                skb2->protocol = __constant_htons(ETH_P_802_3);
-               skb2->mac.raw = skb2->nh.raw = skb2->data;
+               skb_reset_mac_header(skb2);
+               skb2->nh.raw = skb2->data;
                /* skb2->nh.raw = skb2->data + ETH_HLEN; */
-               skb2->dev = dev;
                dev_queue_xmit(skb2);
        }
 #endif
index 9151da64231851199cafba4b844f8e20b81426b5..88f8aae873f4bcdd4258f21ba86180358498db36 100644 (file)
@@ -616,7 +616,7 @@ static int ipgre_rcv(struct sk_buff *skb)
                                offset += 4;
                }
 
-               skb->mac.raw = skb->nh.raw;
+               skb_reset_mac_header(skb);
                skb->nh.raw = __pskb_pull(skb, offset);
                skb_postpull_rcsum(skb, skb->h.raw, offset);
                skb->pkt_type = PACKET_HOST;
index 5db301b33372c48f53e53410a99e0538a32fa507..ddba857bd2439b218fa3f6ab692a98e1c3559149 100644 (file)
@@ -95,7 +95,7 @@ __inline__ void ip_send_check(struct iphdr *iph)
 /* dev_loopback_xmit for use with netfilter. */
 static int ip_dev_loopback_xmit(struct sk_buff *newskb)
 {
-       newskb->mac.raw = newskb->data;
+       skb_reset_mac_header(newskb);
        __skb_pull(newskb, newskb->nh.raw - newskb->data);
        newskb->pkt_type = PACKET_LOOPBACK;
        newskb->ip_summed = CHECKSUM_UNNECESSARY;
index 0b3d7bf40f4e1bfaeb44849ea5b74b1ef041c67f..29ee7be45aa6ab465c2f398a10d713ec07f1f444 100644 (file)
@@ -2747,7 +2747,8 @@ int inet_rtm_getroute(struct sk_buff *in_skb, struct nlmsghdr* nlh, void *arg)
        /* Reserve room for dummy headers, this skb can pass
           through good chunk of routing engine.
         */
-       skb->mac.raw = skb->nh.raw = skb->data;
+       skb_reset_mac_header(skb);
+       skb->nh.raw = skb->data;
 
        /* Bugfix: need to give ip_route_input enough of an IP header to not gag. */
        skb->nh.iph->protocol = IPPROTO_ICMP;
index 7e25043d826c0b772007fbc5cdd86d396dbe2088..a5f4562b5d29c19697bc4407914d7797cc61162d 100644 (file)
@@ -88,7 +88,7 @@ static inline int ip6_output_finish(struct sk_buff *skb)
 /* dev_loopback_xmit for use with netfilter. */
 static int ip6_dev_loopback_xmit(struct sk_buff *newskb)
 {
-       newskb->mac.raw = newskb->data;
+       skb_reset_mac_header(newskb);
        __skb_pull(newskb, newskb->nh.raw - newskb->data);
        newskb->pkt_type = PACKET_LOOPBACK;
        newskb->ip_summed = CHECKSUM_UNNECESSARY;
index cc08cc48e9e9c23dfef6ec59115ac4f81f62f865..0aa4762f53f767fd4aad19dcb2f8602a6572d52c 100644 (file)
@@ -2218,7 +2218,7 @@ int inet6_rtm_getroute(struct sk_buff *in_skb, struct nlmsghdr* nlh, void *arg)
        /* Reserve room for dummy headers, this skb can pass
           through good chunk of routing engine.
         */
-       skb->mac.raw = skb->data;
+       skb_reset_mac_header(skb);
        skb_reserve(skb, MAX_HEADER + sizeof(struct ipv6hdr));
 
        rt = (struct rt6_info*) ip6_route_output(NULL, &fl);
index 0b04603e9c475bb9b95ac05d1c5d6e48e3c08a6c..1b7e2490e2e18c17fad9e9871ca1f260448f7c62 100644 (file)
@@ -93,7 +93,8 @@ void irlap_queue_xmit(struct irlap_cb *self, struct sk_buff *skb)
 {
        /* Some common init stuff */
        skb->dev = self->netdev;
-       skb->h.raw = skb->nh.raw = skb->mac.raw = skb->data;
+       skb_reset_mac_header(skb);
+       skb->h.raw = skb->nh.raw = skb->data;
        skb->protocol = htons(ETH_P_IRDA);
        skb->priority = TC_PRIO_BESTEFFORT;
 
index 5abfb71aae8db6045d76236a4dd0285c4296bd31..2acc66dfb5586772d0852f2f3304f035332fab77 100644 (file)
@@ -256,7 +256,7 @@ async_bump(struct net_device *dev,
 
        /* Feed it to IrLAP layer */
        dataskb->dev = dev;
-       dataskb->mac.raw  = dataskb->data;
+       skb_reset_mac_header(dataskb);
        dataskb->protocol = htons(ETH_P_IRDA);
 
        netif_rx(dataskb);
index f4291f349e92c458f8181e9ac085904a9605dfd2..729e251082754c0d772392a0f58e8bde5c98ca87 100644 (file)
@@ -52,7 +52,7 @@ int llc_mac_hdr_init(struct sk_buff *skb,
                if (da) {
                        memcpy(trh->daddr, da, dev->addr_len);
                        tr_source_route(skb, trh, dev);
-                       skb->mac.raw = skb->data;
+                       skb_reset_mac_header(skb);
                }
                break;
        }
index 9a97ed6e6910d656b1a2a0c505f7238b51484db3..17c3f1ef83e97e463b514427d199010336753172 100644 (file)
@@ -56,7 +56,7 @@ int nr_rx_ip(struct sk_buff *skb, struct net_device *dev)
 
        /* Spoof incoming device */
        skb->dev      = dev;
-       skb->mac.raw  = skb->nh.raw;
+       skb_reset_mac_header(skb);
        skb->nh.raw   = skb->data;
        skb->pkt_type = PACKET_HOST;
 
index 5d2d93dc083727348c26f26746bf8fc15c2e7e9c..c49e223084f12a8ebcdf24c22f6a42a4fffd15c6 100644 (file)
@@ -339,7 +339,7 @@ __be16 wanrouter_type_trans(struct sk_buff *skb, struct net_device *dev)
        skb->protocol = ethertype;
        skb->pkt_type = PACKET_HOST;    /*      Physically point to point */
        skb_pull(skb, cnt);
-       skb->mac.raw  = skb->data;
+       skb_reset_mac_header(skb);
        return ethertype;
 }