diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2007-03-10 19:40:39 -0300 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-04-25 22:24:53 -0700 |
commit | 8856dfa3e9b71ac2177016f66ace3a8978afecc1 (patch) | |
tree | 10c62319ef9829e7599125c9c288ccc101e127fd /net/ipv4/ipmr.c | |
parent | 04b964dbad25cbd6edd8ecbeca2efb40c9860865 (diff) | |
download | linux-8856dfa3e9b71ac2177016f66ace3a8978afecc1.tar.bz2 |
[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.c | 9 |
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); } |