diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2007-04-10 23:45:18 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-04-26 01:24:46 -0400 |
commit | c1d2bbe1cd6c7bbdc6d532cefebb66c7efb789ce (patch) | |
tree | 03a715961ba576a11cbc0e91c5d465e4c4d95d82 /net/ipv4 | |
parent | 57effc70a5be9f7804e9a99964eb7265367effca (diff) |
[SK_BUFF]: Introduce skb_reset_network_header(skb)
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>
Diffstat (limited to 'net/ipv4')
-rw-r--r-- | net/ipv4/arp.c | 2 | ||||
-rw-r--r-- | net/ipv4/ip_gre.c | 2 | ||||
-rw-r--r-- | net/ipv4/ip_output.c | 4 | ||||
-rw-r--r-- | net/ipv4/ipip.c | 4 | ||||
-rw-r--r-- | net/ipv4/route.c | 2 | ||||
-rw-r--r-- | net/ipv4/xfrm4_mode_tunnel.c | 2 |
6 files changed, 8 insertions, 8 deletions
diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c index e6e196cd3b8c..8c533ceb9709 100644 --- a/net/ipv4/arp.c +++ b/net/ipv4/arp.c | |||
@@ -578,7 +578,7 @@ struct sk_buff *arp_create(int type, int ptype, __be32 dest_ip, | |||
578 | return NULL; | 578 | return NULL; |
579 | 579 | ||
580 | skb_reserve(skb, LL_RESERVED_SPACE(dev)); | 580 | skb_reserve(skb, LL_RESERVED_SPACE(dev)); |
581 | skb->nh.raw = skb->data; | 581 | skb_reset_network_header(skb); |
582 | arp = (struct arphdr *) skb_put(skb,sizeof(struct arphdr) + 2*(dev->addr_len+4)); | 582 | arp = (struct arphdr *) skb_put(skb,sizeof(struct arphdr) + 2*(dev->addr_len+4)); |
583 | skb->dev = dev; | 583 | skb->dev = dev; |
584 | skb->protocol = htons(ETH_P_ARP); | 584 | skb->protocol = htons(ETH_P_ARP); |
diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c index 88f8aae873f4..ced2c4baf174 100644 --- a/net/ipv4/ip_gre.c +++ b/net/ipv4/ip_gre.c | |||
@@ -474,7 +474,7 @@ out: | |||
474 | dst_release(skb2->dst); | 474 | dst_release(skb2->dst); |
475 | skb2->dst = NULL; | 475 | skb2->dst = NULL; |
476 | skb_pull(skb2, skb->data - (u8*)eiph); | 476 | skb_pull(skb2, skb->data - (u8*)eiph); |
477 | skb2->nh.raw = skb2->data; | 477 | skb_reset_network_header(skb2); |
478 | 478 | ||
479 | /* Try to guess incoming interface */ | 479 | /* Try to guess incoming interface */ |
480 | memset(&fl, 0, sizeof(fl)); | 480 | memset(&fl, 0, sizeof(fl)); |
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c index ddba857bd243..32f1a23a80f9 100644 --- a/net/ipv4/ip_output.c +++ b/net/ipv4/ip_output.c | |||
@@ -593,7 +593,7 @@ slow_path: | |||
593 | ip_copy_metadata(skb2, skb); | 593 | ip_copy_metadata(skb2, skb); |
594 | skb_reserve(skb2, ll_rs); | 594 | skb_reserve(skb2, ll_rs); |
595 | skb_put(skb2, len + hlen); | 595 | skb_put(skb2, len + hlen); |
596 | skb2->nh.raw = skb2->data; | 596 | skb_reset_network_header(skb2); |
597 | skb2->h.raw = skb2->data + hlen; | 597 | skb2->h.raw = skb2->data + hlen; |
598 | 598 | ||
599 | /* | 599 | /* |
@@ -722,7 +722,7 @@ static inline int ip_ufo_append_data(struct sock *sk, | |||
722 | skb_put(skb,fragheaderlen + transhdrlen); | 722 | skb_put(skb,fragheaderlen + transhdrlen); |
723 | 723 | ||
724 | /* initialize network header pointer */ | 724 | /* initialize network header pointer */ |
725 | skb->nh.raw = skb->data; | 725 | skb_reset_network_header(skb); |
726 | 726 | ||
727 | /* initialize protocol header pointer */ | 727 | /* initialize protocol header pointer */ |
728 | skb->h.raw = skb->data + fragheaderlen; | 728 | skb->h.raw = skb->data + fragheaderlen; |
diff --git a/net/ipv4/ipip.c b/net/ipv4/ipip.c index 3ec5ce0f5498..5f886c892861 100644 --- a/net/ipv4/ipip.c +++ b/net/ipv4/ipip.c | |||
@@ -405,7 +405,7 @@ out: | |||
405 | dst_release(skb2->dst); | 405 | dst_release(skb2->dst); |
406 | skb2->dst = NULL; | 406 | skb2->dst = NULL; |
407 | skb_pull(skb2, skb->data - (u8*)eiph); | 407 | skb_pull(skb2, skb->data - (u8*)eiph); |
408 | skb2->nh.raw = skb2->data; | 408 | skb_reset_network_header(skb2); |
409 | 409 | ||
410 | /* Try to guess incoming interface */ | 410 | /* Try to guess incoming interface */ |
411 | memset(&fl, 0, sizeof(fl)); | 411 | memset(&fl, 0, sizeof(fl)); |
@@ -487,7 +487,7 @@ static int ipip_rcv(struct sk_buff *skb) | |||
487 | secpath_reset(skb); | 487 | secpath_reset(skb); |
488 | 488 | ||
489 | skb->mac.raw = skb->nh.raw; | 489 | skb->mac.raw = skb->nh.raw; |
490 | skb->nh.raw = skb->data; | 490 | skb_reset_network_header(skb); |
491 | skb->protocol = htons(ETH_P_IP); | 491 | skb->protocol = htons(ETH_P_IP); |
492 | skb->pkt_type = PACKET_HOST; | 492 | skb->pkt_type = PACKET_HOST; |
493 | 493 | ||
diff --git a/net/ipv4/route.c b/net/ipv4/route.c index 486ab93127ce..d29861844903 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c | |||
@@ -2748,7 +2748,7 @@ int inet_rtm_getroute(struct sk_buff *in_skb, struct nlmsghdr* nlh, void *arg) | |||
2748 | through good chunk of routing engine. | 2748 | through good chunk of routing engine. |
2749 | */ | 2749 | */ |
2750 | skb_reset_mac_header(skb); | 2750 | skb_reset_mac_header(skb); |
2751 | skb->nh.raw = skb->data; | 2751 | skb_reset_network_header(skb); |
2752 | 2752 | ||
2753 | /* Bugfix: need to give ip_route_input enough of an IP header to not gag. */ | 2753 | /* Bugfix: need to give ip_route_input enough of an IP header to not gag. */ |
2754 | skb->nh.iph->protocol = IPPROTO_ICMP; | 2754 | skb->nh.iph->protocol = IPPROTO_ICMP; |
diff --git a/net/ipv4/xfrm4_mode_tunnel.c b/net/ipv4/xfrm4_mode_tunnel.c index 8e123e30cf61..ffc6005d1d55 100644 --- a/net/ipv4/xfrm4_mode_tunnel.c +++ b/net/ipv4/xfrm4_mode_tunnel.c | |||
@@ -129,7 +129,7 @@ static int xfrm4_tunnel_input(struct xfrm_state *x, struct sk_buff *skb) | |||
129 | old_mac = skb_mac_header(skb); | 129 | old_mac = skb_mac_header(skb); |
130 | skb_set_mac_header(skb, -skb->mac_len); | 130 | skb_set_mac_header(skb, -skb->mac_len); |
131 | memmove(skb_mac_header(skb), old_mac, skb->mac_len); | 131 | memmove(skb_mac_header(skb), old_mac, skb->mac_len); |
132 | skb->nh.raw = skb->data; | 132 | skb_reset_network_header(skb); |
133 | err = 0; | 133 | err = 0; |
134 | 134 | ||
135 | out: | 135 | out: |