]> err.no Git - linux-2.6/commitdiff
[SK_BUFF]: Introduce skb_reset_network_header(skb)
authorArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 11 Apr 2007 03:45:18 +0000 (20:45 -0700)
committerDavid S. Miller <davem@sunset.davemloft.net>
Thu, 26 Apr 2007 05:24:46 +0000 (22:24 -0700)
For the common, open coded 'skb->nh.raw = skb->data' operation, so that we can
later turn skb->nh.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>
47 files changed:
drivers/block/aoe/aoecmd.c
drivers/net/cxgb3/sge.c
drivers/net/hamradio/bpqether.c
drivers/net/loopback.c
drivers/net/pppoe.c
drivers/net/wan/hdlc_cisco.c
drivers/net/wan/hdlc_fr.c
drivers/net/wan/lmc/lmc_main.c
drivers/net/wireless/hostap/hostap_80211_rx.c
drivers/net/wireless/hostap/hostap_ap.c
drivers/net/wireless/hostap/hostap_main.c
include/linux/skbuff.h
include/net/llc_pdu.h
net/appletalk/aarp.c
net/atm/mpc.c
net/ax25/af_ax25.c
net/ax25/ax25_ds_subr.c
net/ax25/ax25_in.c
net/ax25/ax25_ip.c
net/ax25/ax25_out.c
net/ax25/ax25_subr.c
net/core/dev.c
net/core/netpoll.c
net/decnet/dn_dev.c
net/decnet/dn_neigh.c
net/decnet/dn_route.c
net/econet/af_econet.c
net/ieee80211/ieee80211_rx.c
net/ipv4/arp.c
net/ipv4/ip_gre.c
net/ipv4/ip_output.c
net/ipv4/ipip.c
net/ipv4/route.c
net/ipv4/xfrm4_mode_tunnel.c
net/ipv6/ip6_output.c
net/ipv6/ip6_tunnel.c
net/ipv6/sit.c
net/ipv6/xfrm6_mode_beet.c
net/ipv6/xfrm6_mode_tunnel.c
net/ipv6/xfrm6_output.c
net/irda/irlap_frame.c
net/iucv/af_iucv.c
net/llc/llc_sap.c
net/netrom/nr_dev.c
net/packet/af_packet.c
net/tipc/eth_media.c
net/x25/x25_dev.c

index 74062dc4e90dd1d21889d26e954914d55b853660..1a6aeac5a1c3b55d7cece59efadf571afc6c2fa2 100644 (file)
@@ -28,7 +28,7 @@ new_skb(ulong len)
        skb = alloc_skb(len, GFP_ATOMIC);
        if (skb) {
                skb_reset_mac_header(skb);
-               skb->nh.raw = skb->data;
+               skb_reset_network_header(skb);
                skb->protocol = __constant_htons(ETH_P_AOE);
                skb->priority = 0;
                skb->next = skb->prev = NULL;
index b5cf2a60834dd4e26620dc6ee7da10d8b386d67c..4dd712088bcf930850f44def47dbf29c6772946b 100644 (file)
@@ -1621,7 +1621,8 @@ static inline int rx_offload(struct t3cdev *tdev, struct sge_rspq *rq,
 {
        rq->offload_pkts++;
        skb_reset_mac_header(skb);
-       skb->nh.raw = skb->h.raw = skb->data;
+       skb_reset_network_header(skb);
+       skb->h.raw = skb->data;
 
        if (rq->polling) {
                rx_gather[gather_idx++] = skb;
index d2542697e298d198b9431d7f42ee1d76682f898e..656f2789c9ba03585866ba490f3ab1c11a306c98 100644 (file)
@@ -282,7 +282,7 @@ static int bpq_xmit(struct sk_buff *skb, struct net_device *dev)
        }
 
        skb->protocol = ax25_type_trans(skb, dev);
-       skb->nh.raw = skb->data;
+       skb_reset_network_header(skb);
        dev->hard_header(skb, dev, ETH_P_BPQ, bpq->dest_addr, NULL, 0);
        bpq->stats.tx_packets++;
        bpq->stats.tx_bytes+=skb->len;
index a71d8e0a9b57dafa2edbda9a3c1614ee9d95771a..af476d2a513d2ca1d120cd3a113707995a9f5ce8 100644 (file)
@@ -91,7 +91,7 @@ static void emulate_large_send_offload(struct sk_buff *skb)
                        break;
                skb_reserve(nskb, 32);
                skb_set_mac_header(nskb, -ETH_HLEN);
-               nskb->nh.raw = nskb->data;
+               skb_reset_network_header(nskb);
                iph = nskb->nh.iph;
                memcpy(nskb->data, skb->nh.raw, doffset);
                if (skb_copy_bits(skb,
index 3080a44b23abc40699143dbaa3d48a005522b781..e94790632d558b6b5b4221fcccf0905a4630ed75 100644 (file)
@@ -799,7 +799,7 @@ static int pppoe_sendmsg(struct kiocb *iocb, struct socket *sock,
 
        /* Reserve space for headers. */
        skb_reserve(skb, dev->hard_header_len);
-       skb->nh.raw = skb->data;
+       skb_reset_network_header(skb);
 
        skb->dev = dev;
 
@@ -884,7 +884,7 @@ static int __pppoe_xmit(struct sock *sk, struct sk_buff *skb)
        memcpy(ph, &hdr, sizeof(struct pppoe_hdr));
        skb2->protocol = __constant_htons(ETH_P_PPP_SES);
 
-       skb2->nh.raw = skb2->data;
+       skb_reset_network_header(skb2);
 
        skb2->dev = dev;
 
index c9664fd8a917eaf0889dedcd0b931db3e544a390..00e0aaadabccd326ead25b186ca03b0334636a47 100644 (file)
@@ -124,7 +124,7 @@ static void cisco_keepalive_send(struct net_device *dev, u32 type,
        skb_put(skb, sizeof(struct cisco_packet));
        skb->priority = TC_PRIO_CONTROL;
        skb->dev = dev;
-       skb->nh.raw = skb->data;
+       skb_reset_network_header(skb);
 
        dev_queue_xmit(skb);
 }
index 3240d10fc86d75f1d97dd4f65cfc8f1be9bed853..b747228c719898e0e3e5d73ae0b580ffe3e22bc6 100644 (file)
@@ -590,7 +590,7 @@ static void fr_lmi_send(struct net_device *dev, int fullrep)
        skb_put(skb, i);
        skb->priority = TC_PRIO_CONTROL;
        skb->dev = dev;
-       skb->nh.raw = skb->data;
+       skb_reset_network_header(skb);
 
        dev_queue_xmit(skb);
 }
index 6d288839ddaa829ab6b2b4197e74fa874640be5e..d4851465c83b3a9c5af6beb122cbe29e8e6611ff 100644 (file)
@@ -1668,7 +1668,7 @@ static int lmc_rx (struct net_device *dev) /*fold00*/
             skb->protocol = lmc_proto_type(sc, skb);
             skb->protocol = htons(ETH_P_WAN_PPP);
             skb_reset_mac_header(skb);
-//            skb->nh.raw = skb->data;
+            /* skb_reset_network_header(skb); */
             skb->dev = dev;
             lmc_proto_netif(sc, skb);
 
@@ -1706,7 +1706,7 @@ static int lmc_rx (struct net_device *dev) /*fold00*/
             
             nsb->protocol = lmc_proto_type(sc, skb);
             skb_reset_mac_header(nsb);
-//            nsb->nh.raw = nsb->data;
+            /* skb_reset_network_header(nsb); */
             nsb->dev = dev;
             lmc_proto_netif(sc, nsb);
         }
index e4082f9d766b869a81b96e41759e8dd86457317c..7b7c1ca8f1f41e51e0eedaaaa1934848f825c2c8 100644 (file)
@@ -1076,8 +1076,8 @@ void hostap_80211_rx(struct net_device *dev, struct sk_buff *skb,
                skb2->dev = dev;
                skb2->protocol = __constant_htons(ETH_P_802_3);
                skb_reset_mac_header(skb2);
-               skb2->nh.raw = skb2->data;
-               /* skb2->nh.raw = skb2->data + ETH_HLEN; */
+               skb_reset_network_header(skb2);
+               /* skb2->nh.raw += ETH_HLEN; */
                dev_queue_xmit(skb2);
        }
 
index cc18f9686d277f3007ca0b89bd8ce7e22ef175ac..797d950d5d61ca1e97e14f1a673912024e84e5fd 100644 (file)
@@ -983,7 +983,7 @@ static void prism2_send_mgmt(struct net_device *dev,
 
        skb->dev = dev;
        skb_reset_mac_header(skb);
-       skb->nh.raw = skb->data;
+       skb_reset_network_header(skb);
        dev_queue_xmit(skb);
 }
 #endif /* PRISM2_NO_KERNEL_IEEE80211_MGMT */
index c2616e7b00597d8e68834cae09934f4d44a57205..1f9edd91565d26c8304d2f18872c8e1ebf2894f3 100644 (file)
@@ -1064,7 +1064,7 @@ int prism2_sta_send_mgmt(local_info_t *local, u8 *dst, u16 stype,
 
        skb->dev = dev;
        skb_reset_mac_header(skb);
-       skb->nh.raw = skb->data;
+       skb_reset_network_header(skb);
        dev_queue_xmit(skb);
 
        return 0;
index dff81af454b7059994125c70a908d0cf3a4e2c06..6440c78fe625ddee7363bdfc7bc66b57995ce64c 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_network_header(struct sk_buff *skb)
+{
+       skb->nh.raw = skb->data;
+}
+
 static inline unsigned char *skb_mac_header(const struct sk_buff *skb)
 {
        return skb->mac.raw;
index 4e620992c806883fa1bbf06279720628f83ef70b..778f75a40b4d8f77de51cda44c2d39ea3fdf15db 100644 (file)
@@ -235,7 +235,7 @@ static inline void llc_pdu_header_init(struct sk_buff *skb, u8 type,
        struct llc_pdu_un *pdu;
 
        skb_push(skb, hlen);
-       skb->nh.raw = skb->data;
+       skb_reset_network_header(skb);
        pdu = llc_pdu_un_hdr(skb);
        pdu->dsap = dsap;
        pdu->ssap = ssap;
index d89d62f3702fd2551f97e28dbcd7f897702bf333..d4e5ba22e24613b287135ded258f7f1b7a304580 100644 (file)
@@ -539,7 +539,7 @@ int aarp_send_ddp(struct net_device *dev, struct sk_buff *skb,
        int hash;
        struct aarp_entry *a;
 
-       skb->nh.raw = skb->data;
+       skb_reset_network_header(skb);
 
        /* Check for LocalTalk first */
        if (dev->type == ARPHRD_LOCALTLK) {
index cb3c004ff0224986485cc8228db6b15b9d6f573a..bc15728fd84772259794333a4598047f0d5379c4 100644 (file)
@@ -713,7 +713,7 @@ static void mpc_push(struct atm_vcc *vcc, struct sk_buff *skb)
        skb_push(new_skb, eg->ctrl_info.DH_length);     /* add MAC header */
        memcpy(new_skb->data, eg->ctrl_info.DLL_header, eg->ctrl_info.DH_length);
        new_skb->protocol = eth_type_trans(new_skb, dev);
-       new_skb->nh.raw = new_skb->data;
+       skb_reset_network_header(new_skb);
 
        eg->latest_ip_addr = new_skb->nh.iph->saddr;
        eg->packets_rcvd++;
index c89e4f6f90258ec0ce994134a7df6e9c13a2d4b2..b1a4d60ce9a8f40bb43d7fa0999ee086f344931a 100644 (file)
@@ -1548,7 +1548,7 @@ static int ax25_sendmsg(struct kiocb *iocb, struct socket *sock,
                goto out;
        }
 
-       skb->nh.raw = skb->data;
+       skb_reset_network_header(skb);
 
        /* Add the PID if one is not supplied by the user in the skb */
        if (!ax25->pidincl) {
index 9569dd3fa466e0e0e275b01bc10a2013edb47eda..a49773ff2b92262ab7e75479d3ef4325014063e2 100644 (file)
@@ -136,7 +136,7 @@ static void ax25_kiss_cmd(ax25_dev *ax25_dev, unsigned char cmd, unsigned char p
        if ((skb = alloc_skb(2, GFP_ATOMIC)) == NULL)
                return;
 
-       skb->nh.raw = skb->data;
+       skb_reset_network_header(skb);
        p = skb_put(skb, 2);
 
        *p++ = cmd;
index 6d11b0633d5aff0c54af5cd7aa51f73fc1c1d059..3b2aac670266aedc443430ee45e95f2c31d42828 100644 (file)
@@ -61,8 +61,8 @@ static int ax25_rx_fragment(ax25_cb *ax25, struct sk_buff *skb)
                                        skb_reserve(skbn, AX25_MAX_HEADER_LEN);
 
                                        skbn->dev   = ax25->ax25_dev->dev;
+                                       skb_reset_network_header(skbn);
                                        skbn->h.raw = skbn->data;
-                                       skbn->nh.raw = skbn->data;
 
                                        /* Copy data from the fragments */
                                        while ((skbo = skb_dequeue(&ax25->frag_queue)) != NULL) {
@@ -123,7 +123,7 @@ int ax25_rx_iframe(ax25_cb *ax25, struct sk_buff *skb)
 
                skb_pull(skb, 1);       /* Remove PID */
                skb_reset_mac_header(skb);
-               skb->nh.raw   = skb->data;
+               skb_reset_network_header(skb);
                skb->dev      = ax25->ax25_dev->dev;
                skb->pkt_type = PACKET_HOST;
                skb->protocol = htons(ETH_P_IP);
@@ -247,7 +247,7 @@ static int ax25_rcv(struct sk_buff *skb, struct net_device *dev,
                case AX25_P_IP:
                        skb_pull(skb,2);                /* drop PID/CTRL */
                        skb->h.raw    = skb->data;
-                       skb->nh.raw   = skb->data;
+                       skb_reset_network_header(skb);
                        skb->dev      = dev;
                        skb->pkt_type = PACKET_HOST;
                        skb->protocol = htons(ETH_P_IP);
@@ -257,7 +257,7 @@ static int ax25_rcv(struct sk_buff *skb, struct net_device *dev,
                case AX25_P_ARP:
                        skb_pull(skb,2);
                        skb->h.raw    = skb->data;
-                       skb->nh.raw   = skb->data;
+                       skb_reset_network_header(skb);
                        skb->dev      = dev;
                        skb->pkt_type = PACKET_HOST;
                        skb->protocol = htons(ETH_P_ARP);
index 7f818bbcd1c5e1a7030057453545b4d120c60216..4d4ef35e1782ab1f8f9a17d8c2ef351803d41177 100644 (file)
@@ -171,7 +171,7 @@ int ax25_rebuild_header(struct sk_buff *skb)
                        src_c = *(ax25_address *)(bp + 8);
 
                        skb_pull(ourskb, AX25_HEADER_LEN - 1);  /* Keep PID */
-                       ourskb->nh.raw = ourskb->data;
+                       skb_reset_network_header(ourskb);
 
                        ax25=ax25_send_frame(
                            ourskb,
index 223835092b7afe743ca7d1050e9fe473457652b6..6e08dc8dee40492f20833a4597cc8f5ff8b771a6 100644 (file)
@@ -205,7 +205,7 @@ static void ax25_send_iframe(ax25_cb *ax25, struct sk_buff *skb, int poll_bit)
        if (skb == NULL)
                return;
 
-       skb->nh.raw = skb->data;
+       skb_reset_network_header(skb);
 
        if (ax25->modulus == AX25_MODULUS) {
                frame = skb_push(skb, 1);
index b6c577e3c9140a6b216f23b267b2338a22d3632c..5fe9b2a6697d117af0c0ee77e8c7cc46c2d8e7b7 100644 (file)
@@ -162,7 +162,7 @@ void ax25_send_control(ax25_cb *ax25, int frametype, int poll_bit, int type)
 
        skb_reserve(skb, ax25->ax25_dev->dev->hard_header_len);
 
-       skb->nh.raw = skb->data;
+       skb_reset_network_header(skb);
 
        /* Assume a response - address structure for DTE */
        if (ax25->modulus == AX25_MODULUS) {
@@ -205,7 +205,7 @@ void ax25_return_dm(struct net_device *dev, ax25_address *src, ax25_address *des
                return; /* Next SABM will get DM'd */
 
        skb_reserve(skb, dev->hard_header_len);
-       skb->nh.raw = skb->data;
+       skb_reset_network_header(skb);
 
        ax25_digi_invert(digi, &retdigi);
 
index 560560fe30648ca0037b8e5ffa171c7bbee8c4e3..1b0758254ba0526cf731bf68cd7fe09a53e9f505 100644 (file)
@@ -1074,7 +1074,7 @@ static void dev_queue_xmit_nit(struct sk_buff *skb, struct net_device *dev)
                                        printk(KERN_CRIT "protocol %04x is "
                                               "buggy, dev %s\n",
                                               skb2->protocol, dev->name);
-                               skb2->nh.raw = skb2->data;
+                               skb_reset_network_header(skb2);
                        }
 
                        skb2->h.raw = skb2->nh.raw;
@@ -1771,7 +1771,8 @@ int netif_receive_skb(struct sk_buff *skb)
 
        __get_cpu_var(netdev_rx_stat).total++;
 
-       skb->h.raw = skb->nh.raw = skb->data;
+       skb_reset_network_header(skb);
+       skb->h.raw = skb->data;
        skb->mac_len = skb->nh.raw - skb->mac.raw;
 
        pt_prev = NULL;
index 0ad3896bbf62fa6b95825f63dc6b73662853bd32..b4d1cdd58f11542d189a2d64a8554767d7dddba2 100644 (file)
@@ -359,7 +359,8 @@ static void arp_reply(struct sk_buff *skb)
                                 (2 * sizeof(u32)))))
                return;
 
-       skb->h.raw = skb->nh.raw = skb->data;
+       skb_reset_network_header(skb);
+       skb->h.raw = skb->data;
        arp = skb->nh.arph;
 
        if ((arp->ar_hrd != htons(ARPHRD_ETHER) &&
@@ -389,7 +390,7 @@ static void arp_reply(struct sk_buff *skb)
        if (!send_skb)
                return;
 
-       send_skb->nh.raw = send_skb->data;
+       skb_reset_network_header(send_skb);
        arp = (struct arphdr *) skb_put(send_skb, size);
        send_skb->dev = skb->dev;
        send_skb->protocol = htons(ETH_P_ARP);
index 060d725e2942b909580497b2a3c7ee9c9fe8c475..95871a669dc4807cf996dec1f88646fcad59084b 100644 (file)
@@ -913,7 +913,7 @@ static void dn_send_endnode_hello(struct net_device *dev, struct dn_ifaddr *ifa)
        pktlen = (__le16 *)skb_push(skb,2);
        *pktlen = dn_htons(skb->len - 2);
 
-       skb->nh.raw = skb->data;
+       skb_reset_network_header(skb);
 
        dn_rt_finish_output(skb, dn_rt_all_rt_mcast, msg->id);
 }
@@ -1005,7 +1005,7 @@ static void dn_send_router_hello(struct net_device *dev, struct dn_ifaddr *ifa)
        pktlen = (__le16 *)skb_push(skb, 2);
        *pktlen = dn_htons(skb->len - 2);
 
-       skb->nh.raw = skb->data;
+       skb_reset_network_header(skb);
 
        if (dn_am_i_a_router(dn, dn_db, ifa)) {
                struct sk_buff *skb2 = skb_copy(skb, GFP_ATOMIC);
index bf701cf5a386121f9234f7f20f4cb434db350104..4bf066c416e2d8b0ba1e6160b377cb687081b0b7 100644 (file)
@@ -261,7 +261,7 @@ static int dn_long_output(struct sk_buff *skb)
        lp->s_class  = 0;
        lp->pt       = 0;
 
-       skb->nh.raw = skb->data;
+       skb_reset_network_header(skb);
 
        return NF_HOOK(PF_DECnet, NF_DN_POST_ROUTING, skb, NULL, neigh->dev, dn_neigh_output_packet);
 }
@@ -300,7 +300,7 @@ static int dn_short_output(struct sk_buff *skb)
        sp->srcnode    = cb->src;
        sp->forward    = cb->hops & 0x3f;
 
-       skb->nh.raw = skb->data;
+       skb_reset_network_header(skb);
 
        return NF_HOOK(PF_DECnet, NF_DN_POST_ROUTING, skb, NULL, neigh->dev, dn_neigh_output_packet);
 }
@@ -342,7 +342,7 @@ static int dn_phase3_output(struct sk_buff *skb)
        sp->srcnode  = cb->src & dn_htons(0x03ff);
        sp->forward  = cb->hops & 0x3f;
 
-       skb->nh.raw = skb->data;
+       skb_reset_network_header(skb);
 
        return NF_HOOK(PF_DECnet, NF_DN_POST_ROUTING, skb, NULL, neigh->dev, dn_neigh_output_packet);
 }
index ef94ca56d7bda0de8b46d03b65894c479a207968..34079b7ba1d382cbd788675ee86d655521b6baf5 100644 (file)
@@ -615,7 +615,7 @@ int dn_route_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type
                flags = *skb->data;
        }
 
-       skb->nh.raw = skb->data;
+       skb_reset_network_header(skb);
 
        /*
         * Weed out future version DECnet
index 487f879f5a195c71895293d619f13087687a19ed..099543f5401f5edc3f813bf2f40b02b682026324 100644 (file)
@@ -345,7 +345,7 @@ static int econet_sendmsg(struct kiocb *iocb, struct socket *sock,
                        goto out_unlock;
 
                skb_reserve(skb, LL_RESERVED_SPACE(dev));
-               skb->nh.raw = skb->data;
+               skb_reset_network_header(skb);
 
                eb = (struct ec_cb *)&skb->cb;
 
index f39bf7c4101238aa141a93c6c4f3fe1b1916013d..be5ffaf6e8a5867fc46cffa57c08be4281562841 100644 (file)
@@ -792,7 +792,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
                skb2->dev = dev;
                skb2->protocol = __constant_htons(ETH_P_802_3);
                skb_reset_mac_header(skb2);
-               skb2->nh.raw = skb2->data;
+               skb_reset_network_header(skb2);
                /* skb2->nh.raw = skb2->data + ETH_HLEN; */
                dev_queue_xmit(skb2);
        }
index e6e196cd3b8cc11954140de9105c5419542dc45b..8c533ceb970956e3c54a14cb2217a16f3a0b27d7 100644 (file)
@@ -578,7 +578,7 @@ struct sk_buff *arp_create(int type, int ptype, __be32 dest_ip,
                return NULL;
 
        skb_reserve(skb, LL_RESERVED_SPACE(dev));
-       skb->nh.raw = skb->data;
+       skb_reset_network_header(skb);
        arp = (struct arphdr *) skb_put(skb,sizeof(struct arphdr) + 2*(dev->addr_len+4));
        skb->dev = dev;
        skb->protocol = htons(ETH_P_ARP);
index 88f8aae873f4bcdd4258f21ba86180358498db36..ced2c4baf174f5782c10b4d057440e191f9f8517 100644 (file)
@@ -474,7 +474,7 @@ out:
        dst_release(skb2->dst);
        skb2->dst = NULL;
        skb_pull(skb2, skb->data - (u8*)eiph);
-       skb2->nh.raw = skb2->data;
+       skb_reset_network_header(skb2);
 
        /* Try to guess incoming interface */
        memset(&fl, 0, sizeof(fl));
index ddba857bd2439b218fa3f6ab692a98e1c3559149..32f1a23a80f9a9c920e7064e75eceedb10d90659 100644 (file)
@@ -593,7 +593,7 @@ slow_path:
                ip_copy_metadata(skb2, skb);
                skb_reserve(skb2, ll_rs);
                skb_put(skb2, len + hlen);
-               skb2->nh.raw = skb2->data;
+               skb_reset_network_header(skb2);
                skb2->h.raw = skb2->data + hlen;
 
                /*
@@ -722,7 +722,7 @@ static inline int ip_ufo_append_data(struct sock *sk,
                skb_put(skb,fragheaderlen + transhdrlen);
 
                /* initialize network header pointer */
-               skb->nh.raw = skb->data;
+               skb_reset_network_header(skb);
 
                /* initialize protocol header pointer */
                skb->h.raw = skb->data + fragheaderlen;
index 3ec5ce0f5498cb17deead77b228e0408e3f9c050..5f886c892861e84214b331a6d48a9b86d3a10b2f 100644 (file)
@@ -405,7 +405,7 @@ out:
        dst_release(skb2->dst);
        skb2->dst = NULL;
        skb_pull(skb2, skb->data - (u8*)eiph);
-       skb2->nh.raw = skb2->data;
+       skb_reset_network_header(skb2);
 
        /* Try to guess incoming interface */
        memset(&fl, 0, sizeof(fl));
@@ -487,7 +487,7 @@ static int ipip_rcv(struct sk_buff *skb)
                secpath_reset(skb);
 
                skb->mac.raw = skb->nh.raw;
-               skb->nh.raw = skb->data;
+               skb_reset_network_header(skb);
                skb->protocol = htons(ETH_P_IP);
                skb->pkt_type = PACKET_HOST;
 
index 486ab93127ce390682b4740f3c031dc10d79f899..d29861844903b7bb9a00a63a48143c66e79f83be 100644 (file)
@@ -2748,7 +2748,7 @@ int inet_rtm_getroute(struct sk_buff *in_skb, struct nlmsghdr* nlh, void *arg)
           through good chunk of routing engine.
         */
        skb_reset_mac_header(skb);
-       skb->nh.raw = skb->data;
+       skb_reset_network_header(skb);
 
        /* Bugfix: need to give ip_route_input enough of an IP header to not gag. */
        skb->nh.iph->protocol = IPPROTO_ICMP;
index 8e123e30cf61ec2a39bf16cf761b52f7e72efb92..ffc6005d1d558cc78dde6d78a754e3ba74717ffd 100644 (file)
@@ -129,7 +129,7 @@ static int xfrm4_tunnel_input(struct xfrm_state *x, struct sk_buff *skb)
        old_mac = skb_mac_header(skb);
        skb_set_mac_header(skb, -skb->mac_len);
        memmove(skb_mac_header(skb), old_mac, skb->mac_len);
-       skb->nh.raw = skb->data;
+       skb_reset_network_header(skb);
        err = 0;
 
 out:
index a5f4562b5d29c19697bc4407914d7797cc61162d..4406546d3ce82e5448c1a11922e215d3f082ffe2 100644 (file)
@@ -735,7 +735,7 @@ slow_path:
                ip6_copy_metadata(frag, skb);
                skb_reserve(frag, LL_RESERVED_SPACE(rt->u.dst.dev));
                skb_put(frag, len + hlen + sizeof(struct frag_hdr));
-               frag->nh.raw = frag->data;
+               skb_reset_network_header(frag);
                fh = (struct frag_hdr*)(frag->data + hlen);
                frag->h.raw = frag->data + hlen + sizeof(struct frag_hdr);
 
@@ -976,7 +976,7 @@ static inline int ip6_ufo_append_data(struct sock *sk,
                skb_put(skb,fragheaderlen + transhdrlen);
 
                /* initialize network header pointer */
-               skb->nh.raw = skb->data;
+               skb_reset_network_header(skb);
 
                /* initialize protocol header pointer */
                skb->h.raw = skb->data + fragheaderlen;
index d8c84d8d7cf8654adfb3d1347921191bc778891c..30df8e6c42ccb83729eac101f3a61ec3c98a8d03 100644 (file)
@@ -525,7 +525,7 @@ ip4ip6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
        dst_release(skb2->dst);
        skb2->dst = NULL;
        skb_pull(skb2, offset);
-       skb2->nh.raw = skb2->data;
+       skb_reset_network_header(skb2);
        eiph = skb2->nh.iph;
 
        /* Try to guess incoming interface */
@@ -599,7 +599,7 @@ ip6ip6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
                dst_release(skb2->dst);
                skb2->dst = NULL;
                skb_pull(skb2, offset);
-               skb2->nh.raw = skb2->data;
+               skb_reset_network_header(skb2);
 
                /* Try to guess incoming interface */
                rt = rt6_lookup(&skb2->nh.ipv6h->saddr, NULL, 0, 0);
@@ -704,7 +704,7 @@ static int ip6_tnl_rcv(struct sk_buff *skb, __u16 protocol,
                }
                secpath_reset(skb);
                skb->mac.raw = skb->nh.raw;
-               skb->nh.raw = skb->data;
+               skb_reset_network_header(skb);
                skb->protocol = htons(protocol);
                skb->pkt_type = PACKET_HOST;
                memset(skb->cb, 0, sizeof(struct inet6_skb_parm));
index 08d6ed3396e42f6deb53c4422562eb9afb260765..0477728578fe8e1b4d42c7b6f1fb312cbd2304a1 100644 (file)
@@ -340,7 +340,7 @@ out:
        dst_release(skb2->dst);
        skb2->dst = NULL;
        skb_pull(skb2, skb->data - (u8*)iph6);
-       skb2->nh.raw = skb2->data;
+       skb_reset_network_header(skb2);
 
        /* Try to guess incoming interface */
        rt6i = rt6_lookup(&iph6->saddr, NULL, NULL, 0);
@@ -383,7 +383,7 @@ static int ipip6_rcv(struct sk_buff *skb)
        if ((tunnel = ipip6_tunnel_lookup(iph->saddr, iph->daddr)) != NULL) {
                secpath_reset(skb);
                skb->mac.raw = skb->nh.raw;
-               skb->nh.raw = skb->data;
+               skb_reset_network_header(skb);
                IPCB(skb)->flags = 0;
                skb->protocol = htons(ETH_P_IPV6);
                skb->pkt_type = PACKET_HOST;
index 79364b1e965a3c034093811ab740133247b05c92..c015bfde2b1ce897edcd34d010679950a54ea88c 100644 (file)
@@ -45,7 +45,7 @@ static int xfrm6_beet_output(struct xfrm_state *x, struct sk_buff *skb)
        skb->h.raw = skb->data + hdr_len;
        memmove(skb->data, iph, hdr_len);
 
-       skb->nh.raw = skb->data;
+       skb_reset_network_header(skb);
        top_iph = skb->nh.ipv6h;
        skb->nh.raw = &top_iph->nexthdr;
        skb->h.ipv6h = top_iph + 1;
@@ -68,7 +68,7 @@ static int xfrm6_beet_input(struct xfrm_state *x, struct sk_buff *skb)
 
        skb_push(skb, size);
        memmove(skb->data, skb->nh.raw, size);
-       skb->nh.raw = skb->data;
+       skb_reset_network_header(skb);
 
        old_mac = skb_mac_header(skb);
        skb_set_mac_header(skb, -skb->mac_len);
index 5bb0677d373068199562beb6737cfa47268256a1..8ce5ef2d0b1cd67b60af1c9f6c660cff2a29222d 100644 (file)
@@ -53,7 +53,7 @@ static int xfrm6_tunnel_output(struct xfrm_state *x, struct sk_buff *skb)
        skb_push(skb, x->props.header_len);
        iph = skb->nh.ipv6h;
 
-       skb->nh.raw = skb->data;
+       skb_reset_network_header(skb);
        top_iph = skb->nh.ipv6h;
        skb->nh.raw = &top_iph->nexthdr;
        skb->h.ipv6h = top_iph + 1;
@@ -111,7 +111,7 @@ static int xfrm6_tunnel_input(struct xfrm_state *x, struct sk_buff *skb)
        old_mac = skb_mac_header(skb);
        skb_set_mac_header(skb, -skb->mac_len);
        memmove(skb_mac_header(skb), old_mac, skb->mac_len);
-       skb->nh.raw = skb->data;
+       skb_reset_network_header(skb);
        err = 0;
 
 out:
index c52e9d6c75ec16b62e95d5905276f214b6205d9b..56364a5f676ad71830c9b4118088e29b6da30cc5 100644 (file)
@@ -82,7 +82,7 @@ static int xfrm6_output_one(struct sk_buff *skb)
 
                spin_unlock_bh(&x->lock);
 
-               skb->nh.raw = skb->data;
+               skb_reset_network_header(skb);
 
                if (!(skb->dst = dst_pop(dst))) {
                        err = -EHOSTUNREACH;
index 1b7e2490e2e18c17fad9e9871ca1f260448f7c62..7c815de4a3bf95671da2b366b030411794fa2074 100644 (file)
@@ -94,7 +94,8 @@ void irlap_queue_xmit(struct irlap_cb *self, struct sk_buff *skb)
        /* Some common init stuff */
        skb->dev = self->netdev;
        skb_reset_mac_header(skb);
-       skb->h.raw = skb->nh.raw = skb->data;
+       skb_reset_network_header(skb);
+       skb->h.raw = skb->data;
        skb->protocol = htons(ETH_P_IRDA);
        skb->priority = TC_PRIO_BESTEFFORT;
 
index acc94214bde6f75903083bab3adced73930d174c..a485496059c6d15679785f766319aef7d3a705ae 100644 (file)
@@ -954,7 +954,7 @@ static void iucv_callback_rx(struct iucv_path *path, struct iucv_message *msg)
                }
 
                skb->h.raw = skb->data;
-               skb->nh.raw = skb->data;
+               skb_reset_network_header(skb);
                skb->len = msg->length;
        }
 
index 5fa31117e46b5dd9d27383b8323fb2d0fcd99f80..e76bbbfb64bd21003e4771a90dd0932bfc397eb5 100644 (file)
@@ -38,7 +38,8 @@ struct sk_buff *llc_alloc_frame(struct sock *sk, struct net_device *dev)
        if (skb) {
                skb_reset_mac_header(skb);
                skb_reserve(skb, 50);
-               skb->nh.raw   = skb->h.raw = skb->data;
+               skb_reset_network_header(skb);
+               skb->h.raw = skb->data;
                skb->protocol = htons(ETH_P_802_2);
                skb->dev      = dev;
                if (sk != NULL)
index 17c3f1ef83e97e463b514427d199010336753172..c7b5d930e7323b84313acf551939229a40663233 100644 (file)
@@ -57,7 +57,7 @@ int nr_rx_ip(struct sk_buff *skb, struct net_device *dev)
        /* Spoof incoming device */
        skb->dev      = dev;
        skb_reset_mac_header(skb);
-       skb->nh.raw   = skb->data;
+       skb_reset_network_header(skb);
        skb->pkt_type = PACKET_HOST;
 
        netif_rx(skb);
index 73cb2d3e27d25eb8a8e0844708b250b48925fabf..1225e751b3f174587197f689315a720d2b73db74 100644 (file)
@@ -401,14 +401,14 @@ static int packet_sendmsg_spkt(struct kiocb *iocb, struct socket *sock,
         * notable one here. This should really be fixed at the driver level.
         */
        skb_reserve(skb, LL_RESERVED_SPACE(dev));
-       skb->nh.raw = skb->data;
+       skb_reset_network_header(skb);
 
        /* Try to align data part correctly */
        if (dev->hard_header) {
                skb->data -= dev->hard_header_len;
                skb->tail -= dev->hard_header_len;
                if (len < dev->hard_header_len)
-                       skb->nh.raw = skb->data;
+                       skb_reset_network_header(skb);
        }
 
        /* Returns -EFAULT on error */
@@ -768,7 +768,7 @@ static int packet_sendmsg(struct kiocb *iocb, struct socket *sock,
                goto out_unlock;
 
        skb_reserve(skb, LL_RESERVED_SPACE(dev));
-       skb->nh.raw = skb->data;
+       skb_reset_network_header(skb);
 
        if (dev->hard_header) {
                int res;
index 03a9db3645386a9e509fd168e88daab82a477014..67bb29b44d1bff31696b3a1d626d06a4d640e4b8 100644 (file)
@@ -73,7 +73,7 @@ static int send_msg(struct sk_buff *buf, struct tipc_bearer *tb_ptr,
 
        clone = skb_clone(buf, GFP_ATOMIC);
        if (clone) {
-               clone->nh.raw = clone->data;
+               skb_reset_network_header(clone);
                dev = ((struct eth_bearer *)(tb_ptr->usr_handle))->dev;
                clone->dev = dev;
                dev->hard_header(clone, dev, ETH_P_TIPC,
index c7221de98a9529cff4d11ac141ccc00eb7da9bcc..94fd12f3a9095852fb2ebdec2c3d80964b6ffd4a 100644 (file)
@@ -191,7 +191,7 @@ void x25_send_frame(struct sk_buff *skb, struct x25_neigh *nb)
 {
        unsigned char *dptr;
 
-       skb->nh.raw = skb->data;
+       skb_reset_network_header(skb);
 
        switch (nb->dev->type) {
                case ARPHRD_X25: