[SK_BUFF]: Introduce skb_reset_transport_header(skb)
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>
diff --git a/net/appletalk/aarp.c b/net/appletalk/aarp.c
index de495c5..5ef6a23 100644
--- a/net/appletalk/aarp.c
+++ b/net/appletalk/aarp.c
@@ -119,7 +119,7 @@
/* 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 @@
/* 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 @@
/* 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;
diff --git a/net/appletalk/ddp.c b/net/appletalk/ddp.c
index 934f259..137341b 100644
--- a/net/appletalk/ddp.c
+++ b/net/appletalk/ddp.c
@@ -1275,7 +1275,7 @@
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 @@
/* 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:
diff --git a/net/ax25/af_ax25.c b/net/ax25/af_ax25.c
index b1a4d60..14db01a 100644
--- a/net/ax25/af_ax25.c
+++ b/net/ax25/af_ax25.c
@@ -1631,8 +1631,8 @@
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;
diff --git a/net/ax25/ax25_in.c b/net/ax25/ax25_in.c
index 3b2aac6..724ad5c 100644
--- a/net/ax25/ax25_in.c
+++ b/net/ax25/ax25_in.c
@@ -62,7 +62,7 @@
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 @@
* 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 @@
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 @@
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;
diff --git a/net/bluetooth/af_bluetooth.c b/net/bluetooth/af_bluetooth.c
index c7228cf..d942b94 100644
--- a/net/bluetooth/af_bluetooth.c
+++ b/net/bluetooth/af_bluetooth.c
@@ -221,7 +221,7 @@
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);
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index 64fea09..c11ceb6 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -1074,11 +1074,11 @@
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 @@
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;
diff --git a/net/bluetooth/hci_sock.c b/net/bluetooth/hci_sock.c
index 71f5cfb..832b5f4 100644
--- a/net/bluetooth/hci_sock.c
+++ b/net/bluetooth/hci_sock.c
@@ -375,7 +375,7 @@
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);
diff --git a/net/core/dev.c b/net/core/dev.c
index 3af0bdc..99f1572 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -1773,7 +1773,7 @@
__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;
diff --git a/net/core/netpoll.c b/net/core/netpoll.c
index 496b062..8b22723 100644
--- a/net/core/netpoll.c
+++ b/net/core/netpoll.c
@@ -362,7 +362,7 @@
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) &&
diff --git a/net/decnet/dn_nsp_in.c b/net/decnet/dn_nsp_in.c
index 9d20904..d9498a1 100644
--- a/net/decnet/dn_nsp_in.c
+++ b/net/decnet/dn_nsp_in.c
@@ -725,7 +725,7 @@
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)
diff --git a/net/decnet/dn_nsp_out.c b/net/decnet/dn_nsp_out.c
index 2d2cda8..84b8c5b 100644
--- a/net/decnet/dn_nsp_out.c
+++ b/net/decnet/dn_nsp_out.c
@@ -79,7 +79,7 @@
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);
diff --git a/net/decnet/dn_route.c b/net/decnet/dn_route.c
index 32a7db3..bb73bf1 100644
--- a/net/decnet/dn_route.c
+++ b/net/decnet/dn_route.c
@@ -504,7 +504,7 @@
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 @@
goto drop_it;
skb_pull(skb, 5);
- skb->h.raw = skb->data;
+ skb_reset_transport_header(skb);
cb->dst = *(__le16 *)ptr;
ptr += 2;
diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c
index e7720c7..f011390 100644
--- a/net/ipv4/af_inet.c
+++ b/net/ipv4/af_inet.c
@@ -1120,7 +1120,8 @@
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 @@
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);
diff --git a/net/ipv4/ah4.c b/net/ipv4/ah4.c
index 00fd31d..ebcc797 100644
--- a/net/ipv4/ah4.c
+++ b/net/ipv4/ah4.c
@@ -182,7 +182,8 @@
}
((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;
diff --git a/net/ipv4/ip_input.c b/net/ipv4/ip_input.c
index 237880a..324e7e0 100644
--- a/net/ipv4/ip_input.c
+++ b/net/ipv4/ip_input.c
@@ -201,7 +201,7 @@
__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();
{
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
index 1abc488..63c05be 100644
--- a/net/ipv4/ip_output.c
+++ b/net/ipv4/ip_output.c
@@ -500,7 +500,7 @@
* 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);
diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c
index e002149..03869d9 100644
--- a/net/ipv4/ipmr.c
+++ b/net/ipv4/ipmr.c
@@ -563,7 +563,7 @@
*/
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;
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index b4cad50..13739cd 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -1002,7 +1002,8 @@
* 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;
diff --git a/net/ipv4/xfrm4_mode_transport.c b/net/ipv4/xfrm4_mode_transport.c
index 124f24b..2c46cbb 100644
--- a/net/ipv4/xfrm4_mode_transport.c
+++ b/net/ipv4/xfrm4_mode_transport.c
@@ -52,7 +52,7 @@
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;
}
diff --git a/net/ipv6/ip6_input.c b/net/ipv6/ip6_input.c
index 9c3c787..2dd32a2 100644
--- a/net/ipv6/ip6_input.c
+++ b/net/ipv6/ip6_input.c
@@ -101,7 +101,7 @@
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);
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
index 1900c62..0f4434e 100644
--- a/net/ipv6/ip6_output.c
+++ b/net/ipv6/ip6_output.c
@@ -654,7 +654,7 @@
* 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 @@
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 @@
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;
diff --git a/net/ipv6/ipv6_sockglue.c b/net/ipv6/ipv6_sockglue.c
index d16e0fd..da930fa 100644
--- a/net/ipv6/ipv6_sockglue.c
+++ b/net/ipv6/ipv6_sockglue.c
@@ -108,7 +108,7 @@
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 @@
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();
diff --git a/net/ipv6/netfilter/nf_conntrack_reasm.c b/net/ipv6/netfilter/nf_conntrack_reasm.c
index d3fbb1f..75138cf 100644
--- a/net/ipv6/netfilter/nf_conntrack_reasm.c
+++ b/net/ipv6/netfilter/nf_conntrack_reasm.c
@@ -634,7 +634,7 @@
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);
diff --git a/net/ipv6/reassembly.c b/net/ipv6/reassembly.c
index 156a37f..2594f0f 100644
--- a/net/ipv6/reassembly.c
+++ b/net/ipv6/reassembly.c
@@ -653,7 +653,7 @@
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);
diff --git a/net/ipv6/xfrm6_mode_transport.c b/net/ipv6/xfrm6_mode_transport.c
index 358b60d..cae6cac 100644
--- a/net/ipv6/xfrm6_mode_transport.c
+++ b/net/ipv6/xfrm6_mode_transport.c
@@ -59,7 +59,7 @@
}
ipv6_hdr(skb)->payload_len = htons(skb->len + ihl -
sizeof(struct ipv6hdr));
- skb->h.raw = skb->data;
+ skb_reset_transport_header(skb);
return 0;
}
diff --git a/net/ipx/af_ipx.c b/net/ipx/af_ipx.c
index 9aa7b96..392f8bc 100644
--- a/net/ipx/af_ipx.c
+++ b/net/ipx/af_ipx.c
@@ -577,7 +577,7 @@
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));
diff --git a/net/ipx/ipx_route.c b/net/ipx/ipx_route.c
index e8277f5..e16c114 100644
--- a/net/ipx/ipx_route.c
+++ b/net/ipx/ipx_route.c
@@ -204,7 +204,7 @@
/* 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));
diff --git a/net/irda/af_irda.c b/net/irda/af_irda.c
index 0eb7d59..c3cd2ba 100644
--- a/net/irda/af_irda.c
+++ b/net/irda/af_irda.c
@@ -1363,8 +1363,8 @@
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",
diff --git a/net/irda/irlap_frame.c b/net/irda/irlap_frame.c
index 7c815de..803ac41 100644
--- a/net/irda/irlap_frame.c
+++ b/net/irda/irlap_frame.c
@@ -95,7 +95,7 @@
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;
diff --git a/net/iucv/af_iucv.c b/net/iucv/af_iucv.c
index a485496..5563288 100644
--- a/net/iucv/af_iucv.c
+++ b/net/iucv/af_iucv.c
@@ -953,7 +953,7 @@
return;
}
- skb->h.raw = skb->data;
+ skb_reset_transport_header(skb);
skb_reset_network_header(skb);
skb->len = msg->length;
}
diff --git a/net/key/af_key.c b/net/key/af_key.c
index 3450193..3cd228a 100644
--- a/net/key/af_key.c
+++ b/net/key/af_key.c
@@ -3667,7 +3667,7 @@
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;
diff --git a/net/llc/llc_sap.c b/net/llc/llc_sap.c
index e76bbbf..2525165 100644
--- a/net/llc/llc_sap.c
+++ b/net/llc/llc_sap.c
@@ -39,7 +39,7 @@
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)
diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c
index 350ed1c..50dc5ed 100644
--- a/net/netlink/af_netlink.c
+++ b/net/netlink/af_netlink.c
@@ -1215,7 +1215,7 @@
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) {
diff --git a/net/netrom/af_netrom.c b/net/netrom/af_netrom.c
index a54e7ef..8d0f30a 100644
--- a/net/netrom/af_netrom.c
+++ b/net/netrom/af_netrom.c
@@ -878,7 +878,7 @@
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 @@
}
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 @@
return er;
}
- skb->h.raw = skb->data;
+ skb_reset_transport_header(skb);
copied = skb->len;
if (copied > size) {
diff --git a/net/netrom/nr_in.c b/net/netrom/nr_in.c
index 5560acb..e6dc749 100644
--- a/net/netrom/nr_in.c
+++ b/net/netrom/nr_in.c
@@ -51,7 +51,7 @@
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);
diff --git a/net/netrom/nr_loopback.c b/net/netrom/nr_loopback.c
index e856ae1..99fdab1 100644
--- a/net/netrom/nr_loopback.c
+++ b/net/netrom/nr_loopback.c
@@ -35,7 +35,7 @@
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);
diff --git a/net/rose/af_rose.c b/net/rose/af_rose.c
index f64be93..6d8684a 100644
--- a/net/rose/af_rose.c
+++ b/net/rose/af_rose.c
@@ -1234,7 +1234,7 @@
*asmptr = qbit;
}
- skb->h.raw = skb->data;
+ skb_reset_transport_header(skb);
copied = skb->len;
if (copied > size) {
diff --git a/net/rose/rose_loopback.c b/net/rose/rose_loopback.c
index 3e41bd9..cd01642 100644
--- a/net/rose/rose_loopback.c
+++ b/net/rose/rose_loopback.c
@@ -77,7 +77,7 @@
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) {
diff --git a/net/rose/rose_route.c b/net/rose/rose_route.c
index a1233e1..1f9aefd 100644
--- a/net/rose/rose_route.c
+++ b/net/rose/rose_route.c
@@ -906,7 +906,7 @@
}
}
else {
- skb->h.raw = skb->data;
+ skb_reset_transport_header(skb);
res = rose_process_rx_frame(sk, skb);
goto out;
}
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index 6069716..aec8cf1 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -1319,7 +1319,7 @@
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;
diff --git a/net/x25/af_x25.c b/net/x25/af_x25.c
index a198843..fc71305 100644
--- a/net/x25/af_x25.c
+++ b/net/x25/af_x25.c
@@ -1210,8 +1210,7 @@
}
}
- skb->h.raw = skb->data;
-
+ skb_reset_transport_header(skb);
copied = skb->len;
if (copied > size) {
diff --git a/net/x25/x25_dev.c b/net/x25/x25_dev.c
index 94fd12f..848a6b6 100644
--- a/net/x25/x25_dev.c
+++ b/net/x25/x25_dev.c
@@ -48,7 +48,7 @@
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);
diff --git a/net/x25/x25_in.c b/net/x25/x25_in.c
index c5239fc..b2bbe55 100644
--- a/net/x25/x25_in.c
+++ b/net/x25/x25_in.c
@@ -53,7 +53,7 @@
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);