[SK_BUFF]: Introduce skb_reset_transport_header(skb)
authorArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 13 Mar 2007 16:06:52 +0000 (13:06 -0300)
committerDavid S. Miller <davem@sunset.davemloft.net>
Thu, 26 Apr 2007 05:25:15 +0000 (22:25 -0700)
For the common, open coded 'skb->h.raw = skb->data' operation, so that we can
later turn skb->h.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 cases:

skb->h.raw = skb->data;
skb->h.raw = {skb_push|[__]skb_pull}()

The next ones 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>
49 files changed:
drivers/infiniband/hw/cxgb3/iwch_cm.c
drivers/net/appletalk/cops.c
drivers/net/appletalk/ltpc.c
drivers/net/cxgb3/sge.c
include/linux/dccp.h
include/linux/skbuff.h
net/appletalk/aarp.c
net/appletalk/ddp.c
net/ax25/af_ax25.c
net/ax25/ax25_in.c
net/bluetooth/af_bluetooth.c
net/bluetooth/hci_core.c
net/bluetooth/hci_sock.c
net/core/dev.c
net/core/netpoll.c
net/decnet/dn_nsp_in.c
net/decnet/dn_nsp_out.c
net/decnet/dn_route.c
net/ipv4/af_inet.c
net/ipv4/ah4.c
net/ipv4/ip_input.c
net/ipv4/ip_output.c
net/ipv4/ipmr.c
net/ipv4/udp.c
net/ipv4/xfrm4_mode_transport.c
net/ipv6/ip6_input.c
net/ipv6/ip6_output.c
net/ipv6/ipv6_sockglue.c
net/ipv6/netfilter/nf_conntrack_reasm.c
net/ipv6/reassembly.c
net/ipv6/xfrm6_mode_transport.c
net/ipx/af_ipx.c
net/ipx/ipx_route.c
net/irda/af_irda.c
net/irda/irlap_frame.c
net/iucv/af_iucv.c
net/key/af_key.c
net/llc/llc_sap.c
net/netlink/af_netlink.c
net/netrom/af_netrom.c
net/netrom/nr_in.c
net/netrom/nr_loopback.c
net/rose/af_rose.c
net/rose/rose_loopback.c
net/rose/rose_route.c
net/unix/af_unix.c
net/x25/af_x25.c
net/x25/x25_dev.c
net/x25/x25_in.c

index 2d2de9b8b7293eb6042fea3f350ffb0acea52ec7..66ad4d40ba1d38cf378be3921f33ab3a96bef39e 100644 (file)
@@ -507,7 +507,7 @@ static void send_mpa_req(struct iwch_ep *ep, struct sk_buff *skb)
         */
        skb_get(skb);
        set_arp_failure_handler(skb, arp_failure_discard);
-       skb->h.raw = skb->data;
+       skb_reset_transport_header(skb);
        len = skb->len;
        req = (struct tx_data_wr *) skb_push(skb, sizeof(*req));
        req->wr_hi = htonl(V_WR_OP(FW_WROPCODE_OFLD_TX_DATA));
@@ -559,7 +559,7 @@ static int send_mpa_reject(struct iwch_ep *ep, const void *pdata, u8 plen)
        skb_get(skb);
        skb->priority = CPL_PRIORITY_DATA;
        set_arp_failure_handler(skb, arp_failure_discard);
-       skb->h.raw = skb->data;
+       skb_reset_transport_header(skb);
        req = (struct tx_data_wr *) skb_push(skb, sizeof(*req));
        req->wr_hi = htonl(V_WR_OP(FW_WROPCODE_OFLD_TX_DATA));
        req->wr_lo = htonl(V_WR_TID(ep->hwtid));
@@ -610,7 +610,7 @@ static int send_mpa_reply(struct iwch_ep *ep, const void *pdata, u8 plen)
         */
        skb_get(skb);
        set_arp_failure_handler(skb, arp_failure_discard);
-       skb->h.raw = skb->data;
+       skb_reset_transport_header(skb);
        len = skb->len;
        req = (struct tx_data_wr *) skb_push(skb, sizeof(*req));
        req->wr_hi = htonl(V_WR_OP(FW_WROPCODE_OFLD_TX_DATA));
index 28cb79cee910db24acad165585b9e31d51dacfa3..da6ffa8cd81e35c9960c9d9d61cd8677842e4c84 100644 (file)
@@ -855,7 +855,7 @@ static void cops_rx(struct net_device *dev)
 
         skb_reset_mac_header(skb);    /* Point to entire packet. */
         skb_pull(skb,3);
-        skb->h.raw      = skb->data;    /* Point to data (Skip header). */
+        skb_reset_transport_header(skb);    /* Point to data (Skip header). */
 
         /* Update the counters. */
         lp->stats.rx_packets++;
index 12682439f8bdfb105045ba23b3403942a7c01573..dc3bce992dcf0280f1a5620dedf9e48ea3be0fff 100644 (file)
@@ -776,7 +776,7 @@ static int sendup_buffer (struct net_device *dev)
        /* copy ddp(s,e)hdr + contents */
        memcpy(skb->data,(void*)ltdmabuf,len);
 
-       skb->h.raw = skb->data;
+       skb_reset_transport_header(skb);
 
        stats->rx_packets++;
        stats->rx_bytes+=skb->len;
@@ -923,7 +923,7 @@ static int ltpc_xmit(struct sk_buff *skb, struct net_device *dev)
        cbuf.laptype = skb->data[2];
        skb_pull(skb,3);        /* skip past LLAP header */
        cbuf.length = skb->len; /* this is host order */
-       skb->h.raw=skb->data;
+       skb_reset_transport_header(skb);
 
        if(debug & DEBUG_UPPER) {
                printk("command ");
index 892e5dcafa0453dd4a6d102daaf712f2b1e5181d..a891f6f81527536c15a7083b0bb18c4e7eb99252 100644 (file)
@@ -1622,7 +1622,7 @@ static inline int rx_offload(struct t3cdev *tdev, struct sge_rspq *rq,
        rq->offload_pkts++;
        skb_reset_mac_header(skb);
        skb_reset_network_header(skb);
-       skb->h.raw = skb->data;
+       skb_reset_transport_header(skb);
 
        if (rq->polling) {
                rx_gather[gather_idx++] = skb;
index 1cb054bd93f2805fcb1ee88e966d75b3e498423e..1f4df61735f770029b4629d24ae292420831cabe 100644 (file)
@@ -265,9 +265,9 @@ static inline struct dccp_hdr *dccp_hdr(const struct sk_buff *skb)
 
 static inline struct dccp_hdr *dccp_zeroed_hdr(struct sk_buff *skb, int headlen)
 {
-       skb->h.raw = skb_push(skb, headlen);
-       memset(skb->h.raw, 0, headlen);
-       return dccp_hdr(skb);
+       skb_push(skb, headlen);
+       skb_reset_transport_header(skb);
+       return memset(skb->h.raw, 0, headlen);
 }
 
 static inline struct dccp_hdr_ext *dccp_hdrx(const struct sk_buff *skb)
index 31806a7ce40ef8021d2395e797e49e1f7bef84d1..7c1f1756e482dd587f00ea2237afd86f9b8e292a 100644 (file)
@@ -957,6 +957,11 @@ static inline void skb_reserve(struct sk_buff *skb, int len)
        skb->tail += len;
 }
 
+static inline void skb_reset_transport_header(struct sk_buff *skb)
+{
+       skb->h.raw = skb->data;
+}
+
 static inline unsigned char *skb_network_header(const struct sk_buff *skb)
 {
        return skb->nh.raw;
index de495c57aa90519514ab13ed4f38406cfbda49ad..5ef6a238bdbc7b043fee57bddaf1433867004775 100644 (file)
@@ -119,7 +119,7 @@ static void __aarp_send_query(struct aarp_entry *a)
        /* Set up the buffer */
        skb_reserve(skb, dev->hard_header_len + aarp_dl->header_length);
        skb_reset_network_header(skb);
-       skb->h.raw       = skb->data;
+       skb_reset_transport_header(skb);
        skb_put(skb, sizeof(*eah));
        skb->protocol    = htons(ETH_P_ATALK);
        skb->dev         = dev;
@@ -166,7 +166,7 @@ static void aarp_send_reply(struct net_device *dev, struct atalk_addr *us,
        /* Set up the buffer */
        skb_reserve(skb, dev->hard_header_len + aarp_dl->header_length);
        skb_reset_network_header(skb);
-       skb->h.raw       = skb->data;
+       skb_reset_transport_header(skb);
        skb_put(skb, sizeof(*eah));
        skb->protocol    = htons(ETH_P_ATALK);
        skb->dev         = dev;
@@ -217,7 +217,7 @@ static void aarp_send_probe(struct net_device *dev, struct atalk_addr *us)
        /* Set up the buffer */
        skb_reserve(skb, dev->hard_header_len + aarp_dl->header_length);
        skb_reset_network_header(skb);
-       skb->h.raw       = skb->data;
+       skb_reset_transport_header(skb);
        skb_put(skb, sizeof(*eah));
        skb->protocol    = htons(ETH_P_ATALK);
        skb->dev         = dev;
index 934f25993ce880ddcc91e5ed99877eda8538ef38..137341b4d833c54eb60d79465d81c03602804159 100644 (file)
@@ -1275,7 +1275,7 @@ static int handle_ip_over_ddp(struct sk_buff *skb)
        skb->protocol = htons(ETH_P_IP);
        skb_pull(skb, 13);
        skb->dev   = dev;
-       skb->h.raw = skb->data;
+       skb_reset_transport_header(skb);
 
        stats = dev->priv;
        stats->rx_packets++;
@@ -1522,7 +1522,7 @@ static int ltalk_rcv(struct sk_buff *skb, struct net_device *dev,
                /* Non routable, so force a drop if we slip up later */
                ddp->deh_len_hops = htons(skb->len + (DDP_MAXHOPS << 10));
        }
-       skb->h.raw = skb->data;
+       skb_reset_transport_header(skb);
 
        return atalk_rcv(skb, dev, pt, orig_dev);
 freeit:
index b1a4d60ce9a8f40bb43d7fa0999ee086f344931a..14db01a4ff631ce255e7d6c5bcbea9fb0bef27c8 100644 (file)
@@ -1631,8 +1631,8 @@ static int ax25_recvmsg(struct kiocb *iocb, struct socket *sock,
        if (!ax25_sk(sk)->pidincl)
                skb_pull(skb, 1);               /* Remove PID */
 
-       skb->h.raw = skb->data;
-       copied     = skb->len;
+       skb_reset_transport_header(skb);
+       copied = skb->len;
 
        if (copied > size) {
                copied = size;
index 3b2aac670266aedc443430ee45e95f2c31d42828..724ad5ce75d45f223b0b630eef318b9ade9f374b 100644 (file)
@@ -62,7 +62,7 @@ static int ax25_rx_fragment(ax25_cb *ax25, struct sk_buff *skb)
 
                                        skbn->dev   = ax25->ax25_dev->dev;
                                        skb_reset_network_header(skbn);
-                                       skbn->h.raw = skbn->data;
+                                       skb_reset_transport_header(skbn);
 
                                        /* Copy data from the fragments */
                                        while ((skbo = skb_dequeue(&ax25->frag_queue)) != NULL) {
@@ -196,7 +196,7 @@ static int ax25_rcv(struct sk_buff *skb, struct net_device *dev,
         *      Process the AX.25/LAPB frame.
         */
 
-       skb->h.raw = skb->data;
+       skb_reset_transport_header(skb);
 
        if ((ax25_dev = ax25_dev_ax25dev(dev)) == NULL) {
                kfree_skb(skb);
@@ -246,7 +246,7 @@ static int ax25_rcv(struct sk_buff *skb, struct net_device *dev,
                switch (skb->data[1]) {
                case AX25_P_IP:
                        skb_pull(skb,2);                /* drop PID/CTRL */
-                       skb->h.raw    = skb->data;
+                       skb_reset_transport_header(skb);
                        skb_reset_network_header(skb);
                        skb->dev      = dev;
                        skb->pkt_type = PACKET_HOST;
@@ -256,7 +256,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_reset_transport_header(skb);
                        skb_reset_network_header(skb);
                        skb->dev      = dev;
                        skb->pkt_type = PACKET_HOST;
index c7228cfc6218b031e17a5f2779595ea365499ce4..d942b946ba07efb959686d968677a2ad0faf00ef 100644 (file)
@@ -221,7 +221,7 @@ int bt_sock_recvmsg(struct kiocb *iocb, struct socket *sock,
                copied = len;
        }
 
-       skb->h.raw = skb->data;
+       skb_reset_transport_header(skb);
        err = skb_copy_datagram_iovec(skb, 0, msg->msg_iov, copied);
 
        skb_free_datagram(sk, skb);
index 64fea0903fd745a9bcacb41260081d219b37a99c..c11ceb6b3f79c1d6082822ea3bba729d9183bc15 100644 (file)
@@ -1074,11 +1074,11 @@ static void hci_add_acl_hdr(struct sk_buff *skb, __u16 handle, __u16 flags)
        struct hci_acl_hdr *hdr;
        int len = skb->len;
 
-       hdr = (struct hci_acl_hdr *) skb_push(skb, HCI_ACL_HDR_SIZE);
+       skb_push(skb, HCI_ACL_HDR_SIZE);
+       skb_reset_transport_header(skb);
+       hdr = (struct hci_acl_hdr *)skb->h.raw;
        hdr->handle = cpu_to_le16(hci_handle_pack(handle, flags));
        hdr->dlen   = cpu_to_le16(len);
-
-       skb->h.raw = (void *) hdr;
 }
 
 int hci_send_acl(struct hci_conn *conn, struct sk_buff *skb, __u16 flags)
@@ -1143,7 +1143,8 @@ int hci_send_sco(struct hci_conn *conn, struct sk_buff *skb)
        hdr.handle = cpu_to_le16(conn->handle);
        hdr.dlen   = skb->len;
 
-       skb->h.raw = skb_push(skb, HCI_SCO_HDR_SIZE);
+       skb_push(skb, HCI_SCO_HDR_SIZE);
+       skb_reset_transport_header(skb);
        memcpy(skb->h.raw, &hdr, HCI_SCO_HDR_SIZE);
 
        skb->dev = (void *) hdev;
index 71f5cfbbebb834ce1ffa3283cde1f00db372b580..832b5f44be5c2f483e5ec0b5c2b8e594447d2cd6 100644 (file)
@@ -375,7 +375,7 @@ static int hci_sock_recvmsg(struct kiocb *iocb, struct socket *sock,
                copied = len;
        }
 
-       skb->h.raw = skb->data;
+       skb_reset_transport_header(skb);
        err = skb_copy_datagram_iovec(skb, 0, msg->msg_iov, copied);
 
        hci_sock_cmsg(sk, msg, skb);
index 3af0bdc864918834875dd0d1ab499eb9405f9c5d..99f15728d9cb2a6c14488832720b44b0760f708a 100644 (file)
@@ -1773,7 +1773,7 @@ int netif_receive_skb(struct sk_buff *skb)
        __get_cpu_var(netdev_rx_stat).total++;
 
        skb_reset_network_header(skb);
-       skb->h.raw = skb->data;
+       skb_reset_transport_header(skb);
        skb->mac_len = skb->nh.raw - skb->mac.raw;
 
        pt_prev = NULL;
index 496b06244a8e9bad36a032355b7bdb7ab2557472..8b22723d643645a22d0d1e4fcc416ae27932142a 100644 (file)
@@ -362,7 +362,7 @@ static void arp_reply(struct sk_buff *skb)
                return;
 
        skb_reset_network_header(skb);
-       skb->h.raw = skb->data;
+       skb_reset_transport_header(skb);
        arp = arp_hdr(skb);
 
        if ((arp->ar_hrd != htons(ARPHRD_ETHER) &&
index 9d20904f6f52ebe60b5cdbe2c0b0de42a92a7a5e..d9498a165acf64ce2c4f87f4df169a5a5a415b86 100644 (file)
@@ -725,7 +725,7 @@ static int dn_nsp_rx_packet(struct sk_buff *skb)
        if (!pskb_may_pull(skb, 2))
                goto free_out;
 
-       skb->h.raw    = skb->data;
+       skb_reset_transport_header(skb);
        cb->nsp_flags = *ptr++;
 
        if (decnet_debug_level & 2)
index 2d2cda82c7db998f88db3113880143a77b143705..84b8c5b45fefe0f7f15940ca0ee094145104579e 100644 (file)
@@ -79,7 +79,7 @@ static void dn_nsp_send(struct sk_buff *skb)
        struct dst_entry *dst;
        struct flowi fl;
 
-       skb->h.raw = skb->data;
+       skb_reset_transport_header(skb);
        scp->stamp = jiffies;
 
        dst = sk_dst_check(sk, 0);
index 32a7db36c9e5c012f3d4c6e01d9c90ec5594ccad..bb73bf16630f5f27889c913715eb2ed8564d224d 100644 (file)
@@ -504,7 +504,7 @@ static int dn_route_rx_long(struct sk_buff *skb)
                goto drop_it;
 
        skb_pull(skb, 20);
-       skb->h.raw = skb->data;
+       skb_reset_transport_header(skb);
 
        /* Destination info */
        ptr += 2;
@@ -542,7 +542,7 @@ static int dn_route_rx_short(struct sk_buff *skb)
                goto drop_it;
 
        skb_pull(skb, 5);
-       skb->h.raw = skb->data;
+       skb_reset_transport_header(skb);
 
        cb->dst = *(__le16 *)ptr;
        ptr += 2;
index e7720c72a6e23792c4cf9c90ed4cc665b1297a1d..f011390f19c914764e62b98a0f6c131417abf579 100644 (file)
@@ -1120,7 +1120,8 @@ static int inet_gso_send_check(struct sk_buff *skb)
        if (unlikely(!pskb_may_pull(skb, ihl)))
                goto out;
 
-       skb->h.raw = __skb_pull(skb, ihl);
+       __skb_pull(skb, ihl);
+       skb_reset_transport_header(skb);
        iph = ip_hdr(skb);
        proto = iph->protocol & (MAX_INET_PROTOS - 1);
        err = -EPROTONOSUPPORT;
@@ -1163,7 +1164,8 @@ static struct sk_buff *inet_gso_segment(struct sk_buff *skb, int features)
        if (unlikely(!pskb_may_pull(skb, ihl)))
                goto out;
 
-       skb->h.raw = __skb_pull(skb, ihl);
+       __skb_pull(skb, ihl);
+       skb_reset_transport_header(skb);
        iph = ip_hdr(skb);
        id = ntohs(iph->id);
        proto = iph->protocol & (MAX_INET_PROTOS - 1);
index 00fd31da252ecda5f8595a21568aba4a03fd61d9..ebcc797e1c13d2d0530b387cb6fdfec6b8abd253 100644 (file)
@@ -182,7 +182,8 @@ static int ah_input(struct xfrm_state *x, struct sk_buff *skb)
        }
        ((struct iphdr*)work_buf)->protocol = ah->nexthdr;
        skb->nh.raw += ah_hlen;
-       skb->h.raw = memcpy(skb_network_header(skb), work_buf, ihl);
+       memcpy(skb_network_header(skb), work_buf, ihl);
+       skb->h.raw = skb->nh.raw;
        __skb_pull(skb, ah_hlen + ihl);
 
        return 0;
index 237880a804321cbe8d90c2263ec9bd2a524f732e..324e7e0fdb2aa506f9dcb1c80afb374dae7cab0d 100644 (file)
@@ -201,7 +201,7 @@ static inline int ip_local_deliver_finish(struct sk_buff *skb)
        __skb_pull(skb, ip_hdrlen(skb));
 
        /* Point into the IP datagram, just past the header. */
-       skb->h.raw = skb->data;
+       skb_reset_transport_header(skb);
 
        rcu_read_lock();
        {
index 1abc48899f2dfaf4bc7b7375cd21daf37229dcc5..63c05be0764d4f678630b6ac981a0b5024bc46f4 100644 (file)
@@ -500,7 +500,7 @@ int ip_fragment(struct sk_buff *skb, int (*output)(struct sk_buff*))
                         * before previous one went down. */
                        if (frag) {
                                frag->ip_summed = CHECKSUM_NONE;
-                               frag->h.raw = frag->data;
+                               skb_reset_transport_header(frag);
                                __skb_push(frag, hlen);
                                skb_reset_network_header(frag);
                                memcpy(skb_network_header(frag), iph, hlen);
index e0021499093fc8613859395585bc19a6777af8c9..03869d91f6f0aa1dd2a51aa7e98ba1119e7f9cdc 100644 (file)
@@ -563,7 +563,7 @@ static int ipmr_cache_report(struct sk_buff *pkt, vifi_t vifi, int assert)
                 */
                skb_push(skb, sizeof(struct iphdr));
                skb_reset_network_header(skb);
-               skb->h.raw = skb->data;
+               skb_reset_transport_header(skb);
                msg = (struct igmpmsg *)skb_network_header(skb);
                memcpy(msg, skb_network_header(pkt), sizeof(struct iphdr));
                msg->im_msgtype = IGMPMSG_WHOLEPKT;
index b4cad50c18e903e7656dadf1da11ad27965fb007..13739cd8206f76c1bb05359761d22de4a768980d 100644 (file)
@@ -1002,7 +1002,8 @@ static int udp_encap_rcv(struct sock * sk, struct sk_buff *skb)
         * transport header to point to ESP.  Keep UDP on the stack
         * for later.
         */
-       skb->h.raw = __skb_pull(skb, len);
+       __skb_pull(skb, len);
+       skb_reset_transport_header(skb);
 
        /* modify the protocol (it's ESP!) */
        iph->protocol = IPPROTO_ESP;
index 124f24bc4dbce4a9e47c859b9895100975ab0d96..2c46cbb3bbb538dfb47dd80208eb18af4d071cae 100644 (file)
@@ -52,7 +52,7 @@ static int xfrm4_transport_input(struct xfrm_state *x, struct sk_buff *skb)
                skb->nh.raw = skb->h.raw;
        }
        ip_hdr(skb)->tot_len = htons(skb->len + ihl);
-       skb->h.raw = skb->data;
+       skb_reset_transport_header(skb);
        return 0;
 }
 
index 9c3c787a21c10699a0a38e6074fb2cbe0f1da005..2dd32a2ca05645ad6b6ffdddddd3d4702880395f 100644 (file)
@@ -101,7 +101,7 @@ int ipv6_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt
        if (hdr->version != 6)
                goto err;
 
-       skb->h.raw = (u8 *)(hdr + 1);
+       skb->h.raw = skb->nh.raw + sizeof(*hdr);
        IP6CB(skb)->nhoff = offsetof(struct ipv6hdr, nexthdr);
 
        pkt_len = ntohs(hdr->payload_len);
index 1900c6226866771587194556de576ade1d11ab2d..0f4434eff66a1504c567114fb75318ce3aefed62 100644 (file)
@@ -654,7 +654,7 @@ static int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *))
                         * before previous one went down. */
                        if (frag) {
                                frag->ip_summed = CHECKSUM_NONE;
-                               frag->h.raw = frag->data;
+                               skb_reset_transport_header(frag);
                                fh = (struct frag_hdr*)__skb_push(frag, sizeof(struct frag_hdr));
                                __skb_push(frag, hlen);
                                skb_reset_network_header(frag);
@@ -747,8 +747,8 @@ slow_path:
                skb_reserve(frag, LL_RESERVED_SPACE(rt->u.dst.dev));
                skb_put(frag, len + hlen + sizeof(struct frag_hdr));
                skb_reset_network_header(frag);
-               fh = (struct frag_hdr*)(frag->data + hlen);
-               frag->h.raw = frag->data + hlen + sizeof(struct frag_hdr);
+               fh = (struct frag_hdr *)(skb_network_header(frag) + hlen);
+               frag->h.raw = frag->nh.raw + hlen + sizeof(struct frag_hdr);
 
                /*
                 *      Charge the memory for the fragment to any owner
@@ -991,7 +991,7 @@ static inline int ip6_ufo_append_data(struct sock *sk,
                skb_reset_network_header(skb);
 
                /* initialize protocol header pointer */
-               skb->h.raw = skb->data + fragheaderlen;
+               skb->h.raw = skb->nh.raw + fragheaderlen;
 
                skb->ip_summed = CHECKSUM_PARTIAL;
                skb->csum = 0;
index d16e0fd2cd89d02f291cebdbf4880c1fe0a6e0db..da930fa089c915bc387e1bda5c48cd7b59338e5e 100644 (file)
@@ -108,7 +108,7 @@ static int ipv6_gso_send_check(struct sk_buff *skb)
        rcu_read_lock();
        ops = ipv6_gso_pull_exthdrs(skb, ipv6h->nexthdr);
        if (likely(ops && ops->gso_send_check)) {
-               skb->h.raw = skb->data;
+               skb_reset_transport_header(skb);
                err = ops->gso_send_check(skb);
        }
        rcu_read_unlock();
@@ -144,7 +144,7 @@ static struct sk_buff *ipv6_gso_segment(struct sk_buff *skb, int features)
        rcu_read_lock();
        ops = ipv6_gso_pull_exthdrs(skb, ipv6h->nexthdr);
        if (likely(ops && ops->gso_segment)) {
-               skb->h.raw = skb->data;
+               skb_reset_transport_header(skb);
                segs = ops->gso_segment(skb, features);
        }
        rcu_read_unlock();
index d3fbb1f1caf58de61791046f74e486566fcd10a4..75138cf1fa61b3a77c656a2a669e49e67b9075e4 100644 (file)
@@ -634,7 +634,7 @@ nf_ct_frag6_reasm(struct nf_ct_frag6_queue *fq, struct net_device *dev)
        head->nh.raw += sizeof(struct frag_hdr);
 
        skb_shinfo(head)->frag_list = head->next;
-       head->h.raw = head->data;
+       skb_reset_transport_header(head);
        skb_push(head, head->data - skb_network_header(head));
        atomic_sub(head->truesize, &nf_ct_frag6_mem);
 
index 156a37fe3ff3e6c25dcc63d0d435bd049f62a466..2594f0fb290db55816f5ad212ba9bed194c7e359 100644 (file)
@@ -653,7 +653,7 @@ static int ip6_frag_reasm(struct frag_queue *fq, struct sk_buff **skb_in,
        head->nh.raw += sizeof(struct frag_hdr);
 
        skb_shinfo(head)->frag_list = head->next;
-       head->h.raw = head->data;
+       skb_reset_transport_header(head);
        skb_push(head, head->data - skb_network_header(head));
        atomic_sub(head->truesize, &ip6_frag_mem);
 
index 358b60d9d91259356c36565b6996a54e73229007..cae6cacd58c4a45b0b0fbd2b81b7882bb4287555 100644 (file)
@@ -59,7 +59,7 @@ static int xfrm6_transport_input(struct xfrm_state *x, struct sk_buff *skb)
        }
        ipv6_hdr(skb)->payload_len = htons(skb->len + ihl -
                                           sizeof(struct ipv6hdr));
-       skb->h.raw = skb->data;
+       skb_reset_transport_header(skb);
        return 0;
 }
 
index 9aa7b961b3ebf659462ad1fca6d34650c8c135b5..392f8bc92691e2ed5ccd2cac0941a111aa9d2951 100644 (file)
@@ -577,7 +577,7 @@ static struct sk_buff *ipxitf_adjust_skbuff(struct ipx_interface *intrfc,
        if (skb2) {
                skb_reserve(skb2, out_offset);
                skb_reset_network_header(skb2);
-               skb2->h.raw = skb2->data;
+               skb_reset_transport_header(skb2);
                skb_put(skb2, skb->len);
                memcpy(ipx_hdr(skb2), ipx_hdr(skb), skb->len);
                memcpy(skb2->cb, skb->cb, sizeof(skb->cb));
index e8277f544e72511749c1e31d1653a2e1084c5c6d..e16c11423527df9832485de4479eb019d51d9c1b 100644 (file)
@@ -204,7 +204,7 @@ int ipxrtr_route_packet(struct sock *sk, struct sockaddr_ipx *usipx,
 
        /* Fill in IPX header */
        skb_reset_network_header(skb);
-       skb->h.raw = skb->data;
+       skb_reset_transport_header(skb);
        skb_put(skb, sizeof(struct ipxhdr));
        ipx = ipx_hdr(skb);
        ipx->ipx_pktsize = htons(len + sizeof(struct ipxhdr));
index 0eb7d596d4703cd3f773c529b6888eaad5172b48..c3cd2ba123e5479270c94dfd5c152c519f6abe44 100644 (file)
@@ -1363,8 +1363,8 @@ static int irda_recvmsg_dgram(struct kiocb *iocb, struct socket *sock,
        if (!skb)
                return err;
 
-       skb->h.raw = skb->data;
-       copied     = skb->len;
+       skb_reset_transport_header(skb);
+       copied = skb->len;
 
        if (copied > size) {
                IRDA_DEBUG(2, "%s(), Received truncated frame (%zd < %zd)!\n",
index 7c815de4a3bf95671da2b366b030411794fa2074..803ac41874852933b91853d470f58c88097ba145 100644 (file)
@@ -95,7 +95,7 @@ void irlap_queue_xmit(struct irlap_cb *self, struct sk_buff *skb)
        skb->dev = self->netdev;
        skb_reset_mac_header(skb);
        skb_reset_network_header(skb);
-       skb->h.raw = skb->data;
+       skb_reset_transport_header(skb);
        skb->protocol = htons(ETH_P_IRDA);
        skb->priority = TC_PRIO_BESTEFFORT;
 
index a485496059c6d15679785f766319aef7d3a705ae..55632883d17b5ce2ebb848611ea003504cf45986 100644 (file)
@@ -953,7 +953,7 @@ static void iucv_callback_rx(struct iucv_path *path, struct iucv_message *msg)
                        return;
                }
 
-               skb->h.raw = skb->data;
+               skb_reset_transport_header(skb);
                skb_reset_network_header(skb);
                skb->len = msg->length;
        }
index 345019345f09254292831cb75c6824d826592b09..3cd228aacfe855b4b84869304a26ab9d4d20bce1 100644 (file)
@@ -3667,7 +3667,7 @@ static int pfkey_recvmsg(struct kiocb *kiocb,
                copied = len;
        }
 
-       skb->h.raw = skb->data;
+       skb_reset_transport_header(skb);
        err = skb_copy_datagram_iovec(skb, 0, msg->msg_iov, copied);
        if (err)
                goto out_free;
index e76bbbfb64bd21003e4771a90dd0932bfc397eb5..2525165e2e8fdb8a53e774f82f72f8acba4eb94e 100644 (file)
@@ -39,7 +39,7 @@ struct sk_buff *llc_alloc_frame(struct sock *sk, struct net_device *dev)
                skb_reset_mac_header(skb);
                skb_reserve(skb, 50);
                skb_reset_network_header(skb);
-               skb->h.raw = skb->data;
+               skb_reset_transport_header(skb);
                skb->protocol = htons(ETH_P_802_2);
                skb->dev      = dev;
                if (sk != NULL)
index 350ed1c0e70252ba52c72806d622ddcc6e6eeef1..50dc5edb7752308f896c87976f5b64052cc9c451 100644 (file)
@@ -1215,7 +1215,7 @@ static int netlink_recvmsg(struct kiocb *kiocb, struct socket *sock,
                copied = len;
        }
 
-       skb->h.raw = skb->data;
+       skb_reset_transport_header(skb);
        err = skb_copy_datagram_iovec(skb, 0, msg->msg_iov, copied);
 
        if (msg->msg_name) {
index a54e7ef2568a47692d6e0cc59ec638d90c04ea0c..8d0f30a015df49588008fc7887c69fd9ffe11a75 100644 (file)
@@ -878,7 +878,7 @@ int nr_rx_frame(struct sk_buff *skb, struct net_device *dev)
        if (frametype == NR_PROTOEXT &&
            circuit_index == NR_PROTO_IP && circuit_id == NR_PROTO_IP) {
                skb_pull(skb, NR_NETWORK_LEN + NR_TRANSPORT_LEN);
-               skb->h.raw = skb->data;
+               skb_reset_transport_header(skb);
 
                return nr_rx_ip(skb, dev);
        }
@@ -904,7 +904,7 @@ int nr_rx_frame(struct sk_buff *skb, struct net_device *dev)
        }
 
        if (sk != NULL) {
-               skb->h.raw = skb->data;
+               skb_reset_transport_header(skb);
 
                if (frametype == NR_CONNACK && skb->len == 22)
                        nr_sk(sk)->bpqext = 1;
@@ -1149,7 +1149,7 @@ static int nr_recvmsg(struct kiocb *iocb, struct socket *sock,
                return er;
        }
 
-       skb->h.raw = skb->data;
+       skb_reset_transport_header(skb);
        copied     = skb->len;
 
        if (copied > size) {
index 5560acbaaa9548d78feabbd877370b1fb214a2c7..e6dc749e14be278cdc4ce86acc97b191a820c2ee 100644 (file)
@@ -51,7 +51,7 @@ static int nr_queue_rx_frame(struct sock *sk, struct sk_buff *skb, int more)
                if ((skbn = alloc_skb(nr->fraglen, GFP_ATOMIC)) == NULL)
                        return 1;
 
-               skbn->h.raw = skbn->data;
+               skb_reset_transport_header(skbn);
 
                while ((skbo = skb_dequeue(&nr->frag_queue)) != NULL) {
                        memcpy(skb_put(skbn, skbo->len), skbo->data, skbo->len);
index e856ae1b360a1e805097f9b409a19b3fb34dd3ca..99fdab16ded027c06d59a38d2a1efaf698c18397 100644 (file)
@@ -35,7 +35,7 @@ int nr_loopback_queue(struct sk_buff *skb)
 
        if ((skbn = alloc_skb(skb->len, GFP_ATOMIC)) != NULL) {
                memcpy(skb_put(skbn, skb->len), skb->data, skb->len);
-               skbn->h.raw = skbn->data;
+               skb_reset_transport_header(skbn);
 
                skb_queue_tail(&loopback_queue, skbn);
 
index f64be9369ef7bb453ee3a1bdf01b7088679e3ae2..6d8684a11ac64dc210f3577fab93120c6bedd471 100644 (file)
@@ -1234,7 +1234,7 @@ static int rose_recvmsg(struct kiocb *iocb, struct socket *sock,
                *asmptr = qbit;
        }
 
-       skb->h.raw = skb->data;
+       skb_reset_transport_header(skb);
        copied     = skb->len;
 
        if (copied > size) {
index 3e41bd93ab9f02ec46b345c51a990d2e39fbfa13..cd01642f0491ae01f57e86ba6868bc13172eec9a 100644 (file)
@@ -77,7 +77,7 @@ static void rose_loopback_timer(unsigned long param)
                dest      = (rose_address *)(skb->data + 4);
                lci_o     = 0xFFF - lci_i;
 
-               skb->h.raw = skb->data;
+               skb_reset_transport_header(skb);
 
                sk = rose_find_socket(lci_o, &rose_loopback_neigh);
                if (sk) {
index a1233e1b1ab60a103d2eca883826346f40c1ec81..1f9aefd95a994e5b03a0e303c327d741d9ae4c85 100644 (file)
@@ -906,7 +906,7 @@ int rose_route_frame(struct sk_buff *skb, ax25_cb *ax25)
                        }
                }
                else {
-                       skb->h.raw = skb->data;
+                       skb_reset_transport_header(skb);
                        res = rose_process_rx_frame(sk, skb);
                        goto out;
                }
index 606971645b33e0c43e5f8e097144570fa317a80f..aec8cf165e1a5d774d5136ab91c30c8f45842a1a 100644 (file)
@@ -1319,7 +1319,7 @@ static int unix_dgram_sendmsg(struct kiocb *kiocb, struct socket *sock,
                unix_attach_fds(siocb->scm, skb);
        unix_get_secdata(siocb->scm, skb);
 
-       skb->h.raw = skb->data;
+       skb_reset_transport_header(skb);
        err = memcpy_fromiovec(skb_put(skb,len), msg->msg_iov, len);
        if (err)
                goto out_free;
index a198843156226a0c2c4d33b4aac15de584040a62..fc713059ccddfaace2717674a9c54f7260508993 100644 (file)
@@ -1210,8 +1210,7 @@ static int x25_recvmsg(struct kiocb *iocb, struct socket *sock,
                }
        }
 
-       skb->h.raw = skb->data;
-
+       skb_reset_transport_header(skb);
        copied = skb->len;
 
        if (copied > size) {
index 94fd12f3a9095852fb2ebdec2c3d80964b6ffd4a..848a6b6f90a658d98167916e3d118a1907df28ba 100644 (file)
@@ -48,7 +48,7 @@ static int x25_receive_data(struct sk_buff *skb, struct x25_neigh *nb)
        if ((sk = x25_find_socket(lci, nb)) != NULL) {
                int queued = 1;
 
-               skb->h.raw = skb->data;
+               skb_reset_transport_header(skb);
                bh_lock_sock(sk);
                if (!sock_owned_by_user(sk)) {
                        queued = x25_process_rx_frame(sk, skb);
index c5239fcdefa0c6b155364ad70e7a11c3423982ec..b2bbe552a89d5fd8bb4961e4540d15b271d05fb1 100644 (file)
@@ -53,7 +53,7 @@ static int x25_queue_rx_frame(struct sock *sk, struct sk_buff *skb, int more)
 
                skb_queue_tail(&x25->fragment_queue, skb);
 
-               skbn->h.raw = skbn->data;
+               skb_reset_transport_header(skbn);
 
                skbo = skb_dequeue(&x25->fragment_queue);
                memcpy(skb_put(skbn, skbo->len), skbo->data, skbo->len);