[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 04e31f8..8593037 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 8ebfc87..ab05bff 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 4ab7b40..74062dc 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 03e44b3..db2346f 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 2b242a4..c722e5c 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 ba0ee5c..93f7456 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 838b373..fadb929 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 1b2df80..be91505 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 b691292..d5b878d 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 dba5e51..28cb79c 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 2ea44ce..1268243 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 6318814..e0a18e7 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 6648558..6c764b6 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 6d6c69f..2de8877 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 bee3422..460a095 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 3fb354d..e3c9e2e 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 217a2ee..916162c 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 199e506..ebcf35e 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 8946f7a..b5cf2a6 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 cebf8c3..0f10758 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 37914dc..27afd0f 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 11af0ae..ddfa6c3 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 1d510bd..6ef375a 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 f0c61f3..3ff1f4b 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 29b5ccd..8ce7dad 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 2272156..f35d7d4 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 937372d..056639f 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 31c6233..103a2d1 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 20d306f..a22175f 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 c3ed9b3..5ff4163 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 3457e9d..79b407f 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 4212657..bee4451 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 ee26ef5..de09265 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 ef58e41..18f1790 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 b9fa4fb..1de3eec 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 a57aa01..288d855 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 5b82e4f..c198511 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 a631d1c..016b3ff 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 7369875..66be20c 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 c45d6a8..58a53b6 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 2b54f1b..6d28883 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 62184de..edbc555 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 5873c34..de02a07 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 e50b148..692a23f 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 f78ee26..e4082f9 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 4a5be70..159baef 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 efb8cf3..cc18f96 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 3079378..9003ff7 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 9077e6e..0e29ff7 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 c878a2f..b04c56a 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 3f9d78d..f1415bf 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 fc2e0f3..6ebfff0 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 f5ce1c6..2a299a0 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 0d6d5fc..787c013 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 594320c..82edf20 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 7c735e1..910a8ab 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 d502b77..2882202 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 d4b3339..0fe562a 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 df229bd..748f254 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 47ff2f4..99a4e36 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 1d10c87..1415bcf 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 f8a0c9f..91dde41 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 138302c..d871900 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 987d915..eb2de0d 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 c444f5e..900d42c 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 8c38258..ccba24f 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 4a6b26b..6d11b06 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 f7ade18..b1c2fa9 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 905a39c..b22ada5 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 424d6d0..2fcaf5b 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 32a9f80..0ad3896 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 336958f..8f6ebd0 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 c1b5502..ef94ca5 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 01ecbe4..0ac2524 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 d5f5c66..f39bf7c 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 9151da6..88f8aae 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 5db301b..ddba857 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 0b3d7bf..29ee7be 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 7e25043..a5f4562 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 cc08cc4..0aa4762 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 0b04603..1b7e249 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 5abfb71..2acc66d 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 f4291f3..729e251 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 9a97ed6..17c3f1e 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 5d2d93d..c49e223 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;
 }