aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/ipmr.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2007-03-10 19:40:39 -0300
committerDavid S. Miller <davem@sunset.davemloft.net>2007-04-25 22:24:53 -0700
commit8856dfa3e9b71ac2177016f66ace3a8978afecc1 (patch)
tree10c62319ef9829e7599125c9c288ccc101e127fd /net/ipv4/ipmr.c
parent[SK_BUFF] ipconfig: Another conversion to skb_reset_network_header related to skb_put (diff)
downloadlinux-dev-8856dfa3e9b71ac2177016f66ace3a8978afecc1.tar.xz
linux-dev-8856dfa3e9b71ac2177016f66ace3a8978afecc1.zip
[SK_BUFF]: Use skb_reset_network_header after skb_push
Some more cases where skb->nh.iph was being set that were converted to using skb_reset_network_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/ipmr.c')
-rw-r--r--net/ipv4/ipmr.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c
index 45435f0a5d6c..51528d3cc334 100644
--- a/net/ipv4/ipmr.c
+++ b/net/ipv4/ipmr.c
@@ -1093,7 +1093,12 @@ static struct notifier_block ip_mr_notifier={
static void ip_encap(struct sk_buff *skb, __be32 saddr, __be32 daddr)
{
- struct iphdr *iph = (struct iphdr *)skb_push(skb,sizeof(struct iphdr));
+ struct iphdr *iph;
+
+ skb_push(skb, sizeof(struct iphdr));
+ skb->h.ipiph = skb->nh.iph;
+ skb_reset_network_header(skb);
+ iph = skb->nh.iph;
iph->version = 4;
iph->tos = skb->nh.iph->tos;
@@ -1107,8 +1112,6 @@ static void ip_encap(struct sk_buff *skb, __be32 saddr, __be32 daddr)
ip_select_ident(iph, skb->dst, NULL);
ip_send_check(iph);
- skb->h.ipiph = skb->nh.iph;
- skb->nh.iph = iph;
memset(&(IPCB(skb)->opt), 0, sizeof(IPCB(skb)->opt));
nf_reset(skb);
}