aboutsummaryrefslogtreecommitdiff
path: root/net/ipv4
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2007-04-10 20:46:21 -0700
committerDavid S. Miller <davem@sunset.davemloft.net>2007-04-25 22:24:47 -0700
commite2d1bca7e6134671bcb19810d004a252aa6a644d (patch)
tree5d8ee962cd69cd886aaedff8ac253590a985dd1c /net/ipv4
parentc1d2bbe1cd6c7bbdc6d532cefebb66c7efb789ce (diff)
[SK_BUFF]: Use skb_reset_network_header in skb_push cases
skb_push updates and returns skb->data, so we can just call skb_reset_network_header after the call to skb_push. 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/ip_gre.c3
-rw-r--r--net/ipv4/ip_output.c3
-rw-r--r--net/ipv4/ipip.c3
-rw-r--r--net/ipv4/ipmr.c3
-rw-r--r--net/ipv4/ipvs/ip_vs_xmit.c3
-rw-r--r--net/ipv4/xfrm4_mode_beet.c3
-rw-r--r--net/ipv4/xfrm4_mode_transport.c4
-rw-r--r--net/ipv4/xfrm4_mode_tunnel.c3
8 files changed, 17 insertions, 8 deletions
diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c
index ced2c4baf17..f84ca6668fb 100644
--- a/net/ipv4/ip_gre.c
+++ b/net/ipv4/ip_gre.c
@@ -828,7 +828,8 @@ static int ipgre_tunnel_xmit(struct sk_buff *skb, struct net_device *dev)
}
skb->h.raw = skb->nh.raw;
- skb->nh.raw = skb_push(skb, gre_hlen);
+ skb_push(skb, gre_hlen);
+ skb_reset_network_header(skb);
memset(&(IPCB(skb)->opt), 0, sizeof(IPCB(skb)->opt));
IPCB(skb)->flags &= ~(IPSKB_XFRM_TUNNEL_SIZE | IPSKB_XFRM_TRANSFORMED |
IPSKB_REROUTED);
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
index 32f1a23a80f..d329718a8e8 100644
--- a/net/ipv4/ip_output.c
+++ b/net/ipv4/ip_output.c
@@ -503,7 +503,8 @@ int ip_fragment(struct sk_buff *skb, int (*output)(struct sk_buff*))
if (frag) {
frag->ip_summed = CHECKSUM_NONE;
frag->h.raw = frag->data;
- frag->nh.raw = __skb_push(frag, hlen);
+ __skb_push(frag, hlen);
+ skb_reset_network_header(frag);
memcpy(frag->nh.raw, iph, hlen);
iph = frag->nh.iph;
iph->tot_len = htons(frag->len);
diff --git a/net/ipv4/ipip.c b/net/ipv4/ipip.c
index 5f886c89286..843cc09f961 100644
--- a/net/ipv4/ipip.c
+++ b/net/ipv4/ipip.c
@@ -619,7 +619,8 @@ static int ipip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev)
}
skb->h.raw = skb->nh.raw;
- skb->nh.raw = skb_push(skb, sizeof(struct iphdr));
+ skb_push(skb, sizeof(struct iphdr));
+ skb_reset_network_header(skb);
memset(&(IPCB(skb)->opt), 0, sizeof(IPCB(skb)->opt));
IPCB(skb)->flags &= ~(IPSKB_XFRM_TUNNEL_SIZE | IPSKB_XFRM_TRANSFORMED |
IPSKB_REROUTED);
diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c
index f73f4e402f7..05c82ca45aa 100644
--- a/net/ipv4/ipmr.c
+++ b/net/ipv4/ipmr.c
@@ -1593,7 +1593,8 @@ int ipmr_get_route(struct sk_buff *skb, struct rtmsg *rtm, int nowait)
return -ENOMEM;
}
- skb2->nh.raw = skb_push(skb2, sizeof(struct iphdr));
+ skb_push(skb2, sizeof(struct iphdr));
+ skb_reset_network_header(skb2);
skb2->nh.iph->ihl = sizeof(struct iphdr)>>2;
skb2->nh.iph->saddr = rt->rt_src;
skb2->nh.iph->daddr = rt->rt_dst;
diff --git a/net/ipv4/ipvs/ip_vs_xmit.c b/net/ipv4/ipvs/ip_vs_xmit.c
index f73c5acf5dd..d1403d0855e 100644
--- a/net/ipv4/ipvs/ip_vs_xmit.c
+++ b/net/ipv4/ipvs/ip_vs_xmit.c
@@ -385,7 +385,8 @@ ip_vs_tunnel_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
/* fix old IP header checksum */
ip_send_check(old_iph);
- skb->nh.raw = skb_push(skb, sizeof(struct iphdr));
+ skb_push(skb, sizeof(struct iphdr));
+ skb_reset_network_header(skb);
memset(&(IPCB(skb)->opt), 0, sizeof(IPCB(skb)->opt));
/* drop old route */
diff --git a/net/ipv4/xfrm4_mode_beet.c b/net/ipv4/xfrm4_mode_beet.c
index d419e15d980..eaaf3565f3b 100644
--- a/net/ipv4/xfrm4_mode_beet.c
+++ b/net/ipv4/xfrm4_mode_beet.c
@@ -40,7 +40,8 @@ static int xfrm4_beet_output(struct xfrm_state *x, struct sk_buff *skb)
if (unlikely(optlen))
hdrlen += IPV4_BEET_PHMAXLEN - (optlen & 4);
- skb->nh.raw = skb_push(skb, x->props.header_len + hdrlen);
+ skb_push(skb, x->props.header_len + hdrlen);
+ skb_reset_network_header(skb);
top_iph = skb->nh.iph;
skb->h.raw += sizeof(*iph) - hdrlen;
diff --git a/net/ipv4/xfrm4_mode_transport.c b/net/ipv4/xfrm4_mode_transport.c
index 92676b7e403..290c0f2e7c2 100644
--- a/net/ipv4/xfrm4_mode_transport.c
+++ b/net/ipv4/xfrm4_mode_transport.c
@@ -32,7 +32,9 @@ static int xfrm4_transport_output(struct xfrm_state *x, struct sk_buff *skb)
ihl = iph->ihl * 4;
skb->h.raw += ihl;
- skb->nh.raw = memmove(skb_push(skb, x->props.header_len), iph, ihl);
+ skb_push(skb, x->props.header_len);
+ skb_reset_network_header(skb);
+ memmove(skb->nh.raw, iph, ihl);
return 0;
}
diff --git a/net/ipv4/xfrm4_mode_tunnel.c b/net/ipv4/xfrm4_mode_tunnel.c
index ffc6005d1d5..bec851f278e 100644
--- a/net/ipv4/xfrm4_mode_tunnel.c
+++ b/net/ipv4/xfrm4_mode_tunnel.c
@@ -49,7 +49,8 @@ static int xfrm4_tunnel_output(struct xfrm_state *x, struct sk_buff *skb)
iph = skb->nh.iph;
skb->h.ipiph = iph;
- skb->nh.raw = skb_push(skb, x->props.header_len);
+ skb_push(skb, x->props.header_len);
+ skb_reset_network_header(skb);
top_iph = skb->nh.iph;
top_iph->ihl = 5;