aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2007-04-11 00:21:55 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-04-26 01:26:20 -0400
commitb0e380b1d8a8e0aca215df97702f99815f05c094 (patch)
tree95f402ca155f5211150178811669ebf0a88e8e00 /net/ipv4
parentcfe1fc7759fdacb0c650b575daed1692bf3eaece (diff)
[SK_BUFF]: unions of just one member don't get anything done, kill them
Renaming skb->h to skb->transport_header, skb->nh to skb->network_header and skb->mac to skb->mac_header, to match the names of the associated helpers (skb[_[re]set]_{transport,network,mac}_header). Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4')
-rw-r--r--net/ipv4/ah4.c4
-rw-r--r--net/ipv4/igmp.c2
-rw-r--r--net/ipv4/ip_gre.c2
-rw-r--r--net/ipv4/ip_output.c11
-rw-r--r--net/ipv4/ipcomp.c2
-rw-r--r--net/ipv4/ipip.c4
-rw-r--r--net/ipv4/ipmr.c8
-rw-r--r--net/ipv4/ipvs/ip_vs_xmit.c4
-rw-r--r--net/ipv4/netfilter/ipt_LOG.c2
-rw-r--r--net/ipv4/netfilter/ipt_ULOG.c2
-rw-r--r--net/ipv4/raw.c2
-rw-r--r--net/ipv4/xfrm4_mode_beet.c4
-rw-r--r--net/ipv4/xfrm4_mode_transport.c8
-rw-r--r--net/ipv4/xfrm4_mode_tunnel.c2
14 files changed, 28 insertions, 29 deletions
diff --git a/net/ipv4/ah4.c b/net/ipv4/ah4.c
index e1bb9e0aa5f3..6da8ff597ad3 100644
--- a/net/ipv4/ah4.c
+++ b/net/ipv4/ah4.c
@@ -181,9 +181,9 @@ static int ah_input(struct xfrm_state *x, struct sk_buff *skb)
181 } 181 }
182 } 182 }
183 ((struct iphdr*)work_buf)->protocol = ah->nexthdr; 183 ((struct iphdr*)work_buf)->protocol = ah->nexthdr;
184 skb->nh.raw += ah_hlen; 184 skb->network_header += ah_hlen;
185 memcpy(skb_network_header(skb), work_buf, ihl); 185 memcpy(skb_network_header(skb), work_buf, ihl);
186 skb->h.raw = skb->nh.raw; 186 skb->transport_header = skb->network_header;
187 __skb_pull(skb, ah_hlen + ihl); 187 __skb_pull(skb, ah_hlen + ihl);
188 188
189 return 0; 189 return 0;
diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c
index 4695ada1d9b1..1fc637fb6750 100644
--- a/net/ipv4/igmp.c
+++ b/net/ipv4/igmp.c
@@ -333,7 +333,7 @@ static struct sk_buff *igmpv3_newpack(struct net_device *dev, int size)
333 ((u8*)&pip[1])[2] = 0; 333 ((u8*)&pip[1])[2] = 0;
334 ((u8*)&pip[1])[3] = 0; 334 ((u8*)&pip[1])[3] = 0;
335 335
336 skb->h.raw = skb->nh.raw + sizeof(struct iphdr) + 4; 336 skb->transport_header = skb->network_header + sizeof(struct iphdr) + 4;
337 skb_put(skb, sizeof(*pig)); 337 skb_put(skb, sizeof(*pig));
338 pig = igmpv3_report_hdr(skb); 338 pig = igmpv3_report_hdr(skb);
339 pig->type = IGMPV3_HOST_MEMBERSHIP_REPORT; 339 pig->type = IGMPV3_HOST_MEMBERSHIP_REPORT;
diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c
index e6a9e452fd61..f49afaa81298 100644
--- a/net/ipv4/ip_gre.c
+++ b/net/ipv4/ip_gre.c
@@ -828,7 +828,7 @@ static int ipgre_tunnel_xmit(struct sk_buff *skb, struct net_device *dev)
828 old_iph = ip_hdr(skb); 828 old_iph = ip_hdr(skb);
829 } 829 }
830 830
831 skb->h.raw = skb->nh.raw; 831 skb->transport_header = skb->network_header;
832 skb_push(skb, gre_hlen); 832 skb_push(skb, gre_hlen);
833 skb_reset_network_header(skb); 833 skb_reset_network_header(skb);
834 memset(&(IPCB(skb)->opt), 0, sizeof(IPCB(skb)->opt)); 834 memset(&(IPCB(skb)->opt), 0, sizeof(IPCB(skb)->opt));
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
index 02988fb262d6..875da382d9b9 100644
--- a/net/ipv4/ip_output.c
+++ b/net/ipv4/ip_output.c
@@ -582,7 +582,7 @@ slow_path:
582 skb_reserve(skb2, ll_rs); 582 skb_reserve(skb2, ll_rs);
583 skb_put(skb2, len + hlen); 583 skb_put(skb2, len + hlen);
584 skb_reset_network_header(skb2); 584 skb_reset_network_header(skb2);
585 skb2->h.raw = skb2->nh.raw + hlen; 585 skb2->transport_header = skb2->network_header + hlen;
586 586
587 /* 587 /*
588 * Charge the memory for the fragment to any owner 588 * Charge the memory for the fragment to any owner
@@ -713,7 +713,7 @@ static inline int ip_ufo_append_data(struct sock *sk,
713 skb_reset_network_header(skb); 713 skb_reset_network_header(skb);
714 714
715 /* initialize protocol header pointer */ 715 /* initialize protocol header pointer */
716 skb->h.raw = skb->nh.raw + fragheaderlen; 716 skb->transport_header = skb->network_header + fragheaderlen;
717 717
718 skb->ip_summed = CHECKSUM_PARTIAL; 718 skb->ip_summed = CHECKSUM_PARTIAL;
719 skb->csum = 0; 719 skb->csum = 0;
@@ -918,7 +918,8 @@ alloc_new_skb:
918 */ 918 */
919 data = skb_put(skb, fraglen); 919 data = skb_put(skb, fraglen);
920 skb_set_network_header(skb, exthdrlen); 920 skb_set_network_header(skb, exthdrlen);
921 skb->h.raw = skb->nh.raw + fragheaderlen; 921 skb->transport_header = (skb->network_header +
922 fragheaderlen);
922 data += fragheaderlen; 923 data += fragheaderlen;
923 924
924 if (fraggap) { 925 if (fraggap) {
@@ -1112,8 +1113,8 @@ ssize_t ip_append_page(struct sock *sk, struct page *page,
1112 */ 1113 */
1113 skb_put(skb, fragheaderlen + fraggap); 1114 skb_put(skb, fragheaderlen + fraggap);
1114 skb_reset_network_header(skb); 1115 skb_reset_network_header(skb);
1115 skb->h.raw = skb->nh.raw + fragheaderlen; 1116 skb->transport_header = (skb->network_header +
1116 1117 fragheaderlen);
1117 if (fraggap) { 1118 if (fraggap) {
1118 skb->csum = skb_copy_and_csum_bits(skb_prev, 1119 skb->csum = skb_copy_and_csum_bits(skb_prev,
1119 maxfraglen, 1120 maxfraglen,
diff --git a/net/ipv4/ipcomp.c b/net/ipv4/ipcomp.c
index 1f13cc507a47..ba348b1e5f84 100644
--- a/net/ipv4/ipcomp.c
+++ b/net/ipv4/ipcomp.c
@@ -87,7 +87,7 @@ static int ipcomp_input(struct xfrm_state *x, struct sk_buff *skb)
87 iph = ip_hdr(skb); 87 iph = ip_hdr(skb);
88 ipch = (void *)skb->data; 88 ipch = (void *)skb->data;
89 iph->protocol = ipch->nexthdr; 89 iph->protocol = ipch->nexthdr;
90 skb->h.raw = skb->nh.raw + sizeof(*ipch); 90 skb->transport_header = skb->network_header + sizeof(*ipch);
91 __skb_pull(skb, sizeof(*ipch)); 91 __skb_pull(skb, sizeof(*ipch));
92 err = ipcomp_decompress(x, skb); 92 err = ipcomp_decompress(x, skb);
93 93
diff --git a/net/ipv4/ipip.c b/net/ipv4/ipip.c
index b32b50114806..37ab39170175 100644
--- a/net/ipv4/ipip.c
+++ b/net/ipv4/ipip.c
@@ -485,7 +485,7 @@ static int ipip_rcv(struct sk_buff *skb)
485 485
486 secpath_reset(skb); 486 secpath_reset(skb);
487 487
488 skb->mac.raw = skb->nh.raw; 488 skb->mac_header = skb->network_header;
489 skb_reset_network_header(skb); 489 skb_reset_network_header(skb);
490 skb->protocol = htons(ETH_P_IP); 490 skb->protocol = htons(ETH_P_IP);
491 skb->pkt_type = PACKET_HOST; 491 skb->pkt_type = PACKET_HOST;
@@ -617,7 +617,7 @@ static int ipip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev)
617 old_iph = ip_hdr(skb); 617 old_iph = ip_hdr(skb);
618 } 618 }
619 619
620 skb->h.raw = skb->nh.raw; 620 skb->transport_header = skb->network_header;
621 skb_push(skb, sizeof(struct iphdr)); 621 skb_push(skb, sizeof(struct iphdr));
622 skb_reset_network_header(skb); 622 skb_reset_network_header(skb);
623 memset(&(IPCB(skb)->opt), 0, sizeof(IPCB(skb)->opt)); 623 memset(&(IPCB(skb)->opt), 0, sizeof(IPCB(skb)->opt));
diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c
index 357894259f8f..50d0b301380e 100644
--- a/net/ipv4/ipmr.c
+++ b/net/ipv4/ipmr.c
@@ -597,7 +597,7 @@ static int ipmr_cache_report(struct sk_buff *pkt, vifi_t vifi, int assert)
597 msg->im_msgtype = assert; 597 msg->im_msgtype = assert;
598 igmp->code = 0; 598 igmp->code = 0;
599 ip_hdr(skb)->tot_len = htons(skb->len); /* Fix the length */ 599 ip_hdr(skb)->tot_len = htons(skb->len); /* Fix the length */
600 skb->h.raw = skb->nh.raw; 600 skb->transport_header = skb->network_header;
601 } 601 }
602 602
603 if (mroute_socket == NULL) { 603 if (mroute_socket == NULL) {
@@ -1102,7 +1102,7 @@ static void ip_encap(struct sk_buff *skb, __be32 saddr, __be32 daddr)
1102 struct iphdr *old_iph = ip_hdr(skb); 1102 struct iphdr *old_iph = ip_hdr(skb);
1103 1103
1104 skb_push(skb, sizeof(struct iphdr)); 1104 skb_push(skb, sizeof(struct iphdr));
1105 skb->h.raw = skb->nh.raw; 1105 skb->transport_header = skb->network_header;
1106 skb_reset_network_header(skb); 1106 skb_reset_network_header(skb);
1107 iph = ip_hdr(skb); 1107 iph = ip_hdr(skb);
1108 1108
@@ -1461,7 +1461,7 @@ int pim_rcv_v1(struct sk_buff * skb)
1461 if (reg_dev == NULL) 1461 if (reg_dev == NULL)
1462 goto drop; 1462 goto drop;
1463 1463
1464 skb->mac.raw = skb->nh.raw; 1464 skb->mac_header = skb->network_header;
1465 skb_pull(skb, (u8*)encap - skb->data); 1465 skb_pull(skb, (u8*)encap - skb->data);
1466 skb_reset_network_header(skb); 1466 skb_reset_network_header(skb);
1467 skb->dev = reg_dev; 1467 skb->dev = reg_dev;
@@ -1517,7 +1517,7 @@ static int pim_rcv(struct sk_buff * skb)
1517 if (reg_dev == NULL) 1517 if (reg_dev == NULL)
1518 goto drop; 1518 goto drop;
1519 1519
1520 skb->mac.raw = skb->nh.raw; 1520 skb->mac_header = skb->network_header;
1521 skb_pull(skb, (u8*)encap - skb->data); 1521 skb_pull(skb, (u8*)encap - skb->data);
1522 skb_reset_network_header(skb); 1522 skb_reset_network_header(skb);
1523 skb->dev = reg_dev; 1523 skb->dev = reg_dev;
diff --git a/net/ipv4/ipvs/ip_vs_xmit.c b/net/ipv4/ipvs/ip_vs_xmit.c
index c6276d08b31e..fded9b2f227c 100644
--- a/net/ipv4/ipvs/ip_vs_xmit.c
+++ b/net/ipv4/ipvs/ip_vs_xmit.c
@@ -323,7 +323,7 @@ ip_vs_tunnel_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
323 struct iphdr *old_iph = ip_hdr(skb); 323 struct iphdr *old_iph = ip_hdr(skb);
324 u8 tos = old_iph->tos; 324 u8 tos = old_iph->tos;
325 __be16 df = old_iph->frag_off; 325 __be16 df = old_iph->frag_off;
326 unsigned char *old_h = skb_transport_header(skb); 326 unsigned char *old_transport_header = skb->transport_header;
327 struct iphdr *iph; /* Our new IP header */ 327 struct iphdr *iph; /* Our new IP header */
328 int max_headroom; /* The extra header space needed */ 328 int max_headroom; /* The extra header space needed */
329 int mtu; 329 int mtu;
@@ -381,7 +381,7 @@ ip_vs_tunnel_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
381 old_iph = ip_hdr(skb); 381 old_iph = ip_hdr(skb);
382 } 382 }
383 383
384 skb->h.raw = old_h; 384 skb->transport_header = old_transport_header;
385 385
386 /* fix old IP header checksum */ 386 /* fix old IP header checksum */
387 ip_send_check(old_iph); 387 ip_send_check(old_iph);
diff --git a/net/ipv4/netfilter/ipt_LOG.c b/net/ipv4/netfilter/ipt_LOG.c
index c697971fe317..2fa36618c517 100644
--- a/net/ipv4/netfilter/ipt_LOG.c
+++ b/net/ipv4/netfilter/ipt_LOG.c
@@ -399,7 +399,7 @@ ipt_log_packet(unsigned int pf,
399 /* MAC logging for input chain only. */ 399 /* MAC logging for input chain only. */
400 printk("MAC="); 400 printk("MAC=");
401 if (skb->dev && skb->dev->hard_header_len 401 if (skb->dev && skb->dev->hard_header_len
402 && skb->mac.raw != skb->nh.raw) { 402 && skb->mac_header != skb->network_header) {
403 int i; 403 int i;
404 const unsigned char *p = skb_mac_header(skb); 404 const unsigned char *p = skb_mac_header(skb);
405 for (i = 0; i < skb->dev->hard_header_len; i++,p++) 405 for (i = 0; i < skb->dev->hard_header_len; i++,p++)
diff --git a/net/ipv4/netfilter/ipt_ULOG.c b/net/ipv4/netfilter/ipt_ULOG.c
index fae2a34d23d0..ace711e2b05a 100644
--- a/net/ipv4/netfilter/ipt_ULOG.c
+++ b/net/ipv4/netfilter/ipt_ULOG.c
@@ -251,7 +251,7 @@ static void ipt_ulog_packet(unsigned int hooknum,
251 *(pm->prefix) = '\0'; 251 *(pm->prefix) = '\0';
252 252
253 if (in && in->hard_header_len > 0 253 if (in && in->hard_header_len > 0
254 && skb->mac.raw != skb->nh.raw 254 && skb->mac_header != skb->network_header
255 && in->hard_header_len <= ULOG_MAC_LEN) { 255 && in->hard_header_len <= ULOG_MAC_LEN) {
256 memcpy(pm->mac, skb_mac_header(skb), in->hard_header_len); 256 memcpy(pm->mac, skb_mac_header(skb), in->hard_header_len);
257 pm->mac_len = in->hard_header_len; 257 pm->mac_len = in->hard_header_len;
diff --git a/net/ipv4/raw.c b/net/ipv4/raw.c
index bf101dc1a972..24d7c9f31918 100644
--- a/net/ipv4/raw.c
+++ b/net/ipv4/raw.c
@@ -297,7 +297,7 @@ static int raw_send_hdrinc(struct sock *sk, void *from, size_t length,
297 297
298 skb->ip_summed = CHECKSUM_NONE; 298 skb->ip_summed = CHECKSUM_NONE;
299 299
300 skb->h.raw = skb->nh.raw; 300 skb->transport_header = skb->network_header;
301 err = memcpy_fromiovecend((void *)iph, from, 0, length); 301 err = memcpy_fromiovecend((void *)iph, from, 0, length);
302 if (err) 302 if (err)
303 goto error_fault; 303 goto error_fault;
diff --git a/net/ipv4/xfrm4_mode_beet.c b/net/ipv4/xfrm4_mode_beet.c
index 74859dfb3a25..3650e027ce70 100644
--- a/net/ipv4/xfrm4_mode_beet.c
+++ b/net/ipv4/xfrm4_mode_beet.c
@@ -33,7 +33,7 @@ static int xfrm4_beet_output(struct xfrm_state *x, struct sk_buff *skb)
33 int hdrlen, optlen; 33 int hdrlen, optlen;
34 34
35 iph = ip_hdr(skb); 35 iph = ip_hdr(skb);
36 skb->h.raw = skb->nh.raw; 36 skb->transport_header = skb->network_header;
37 37
38 hdrlen = 0; 38 hdrlen = 0;
39 optlen = iph->ihl * 4 - sizeof(*iph); 39 optlen = iph->ihl * 4 - sizeof(*iph);
@@ -43,7 +43,7 @@ static int xfrm4_beet_output(struct xfrm_state *x, struct sk_buff *skb)
43 skb_push(skb, x->props.header_len + hdrlen); 43 skb_push(skb, x->props.header_len + hdrlen);
44 skb_reset_network_header(skb); 44 skb_reset_network_header(skb);
45 top_iph = ip_hdr(skb); 45 top_iph = ip_hdr(skb);
46 skb->h.raw += sizeof(*iph) - hdrlen; 46 skb->transport_header += sizeof(*iph) - hdrlen;
47 47
48 memmove(top_iph, iph, sizeof(*iph)); 48 memmove(top_iph, iph, sizeof(*iph));
49 if (unlikely(optlen)) { 49 if (unlikely(optlen)) {
diff --git a/net/ipv4/xfrm4_mode_transport.c b/net/ipv4/xfrm4_mode_transport.c
index dc8834ea3754..601047161ea6 100644
--- a/net/ipv4/xfrm4_mode_transport.c
+++ b/net/ipv4/xfrm4_mode_transport.c
@@ -26,9 +26,7 @@ static int xfrm4_transport_output(struct xfrm_state *x, struct sk_buff *skb)
26 struct iphdr *iph = ip_hdr(skb); 26 struct iphdr *iph = ip_hdr(skb);
27 int ihl = iph->ihl * 4; 27 int ihl = iph->ihl * 4;
28 28
29 skb->h.raw = skb->nh.raw; 29 skb->transport_header = skb->network_header + ihl;
30 skb->h.raw += ihl;
31
32 skb_push(skb, x->props.header_len); 30 skb_push(skb, x->props.header_len);
33 skb_reset_network_header(skb); 31 skb_reset_network_header(skb);
34 memmove(skb_network_header(skb), iph, ihl); 32 memmove(skb_network_header(skb), iph, ihl);
@@ -47,10 +45,10 @@ static int xfrm4_transport_input(struct xfrm_state *x, struct sk_buff *skb)
47{ 45{
48 int ihl = skb->data - skb_transport_header(skb); 46 int ihl = skb->data - skb_transport_header(skb);
49 47
50 if (skb->h.raw != skb->nh.raw) { 48 if (skb->transport_header != skb->network_header) {
51 memmove(skb_transport_header(skb), 49 memmove(skb_transport_header(skb),
52 skb_network_header(skb), ihl); 50 skb_network_header(skb), ihl);
53 skb->nh.raw = skb->h.raw; 51 skb->network_header = skb->transport_header;
54 } 52 }
55 ip_hdr(skb)->tot_len = htons(skb->len + ihl); 53 ip_hdr(skb)->tot_len = htons(skb->len + ihl);
56 skb_reset_transport_header(skb); 54 skb_reset_transport_header(skb);
diff --git a/net/ipv4/xfrm4_mode_tunnel.c b/net/ipv4/xfrm4_mode_tunnel.c
index 521e52f055c1..a2f2e6a5ec5d 100644
--- a/net/ipv4/xfrm4_mode_tunnel.c
+++ b/net/ipv4/xfrm4_mode_tunnel.c
@@ -47,7 +47,7 @@ static int xfrm4_tunnel_output(struct xfrm_state *x, struct sk_buff *skb)
47 int flags; 47 int flags;
48 48
49 iph = ip_hdr(skb); 49 iph = ip_hdr(skb);
50 skb->h.raw = skb->nh.raw; 50 skb->transport_header = skb->network_header;
51 51
52 skb_push(skb, x->props.header_len); 52 skb_push(skb, x->props.header_len);
53 skb_reset_network_header(skb); 53 skb_reset_network_header(skb);