diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2007-03-10 17:40:39 -0500 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-04-26 01:24:53 -0400 |
commit | 8856dfa3e9b71ac2177016f66ace3a8978afecc1 (patch) | |
tree | 10c62319ef9829e7599125c9c288ccc101e127fd /net/ipv4/ipmr.c | |
parent | 04b964dbad25cbd6edd8ecbeca2efb40c9860865 (diff) |
[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={ | |||
1093 | 1093 | ||
1094 | static void ip_encap(struct sk_buff *skb, __be32 saddr, __be32 daddr) | 1094 | static void ip_encap(struct sk_buff *skb, __be32 saddr, __be32 daddr) |
1095 | { | 1095 | { |
1096 | struct iphdr *iph = (struct iphdr *)skb_push(skb,sizeof(struct iphdr)); | 1096 | struct iphdr *iph; |
1097 | |||
1098 | skb_push(skb, sizeof(struct iphdr)); | ||
1099 | skb->h.ipiph = skb->nh.iph; | ||
1100 | skb_reset_network_header(skb); | ||
1101 | iph = skb->nh.iph; | ||
1097 | 1102 | ||
1098 | iph->version = 4; | 1103 | iph->version = 4; |
1099 | iph->tos = skb->nh.iph->tos; | 1104 | iph->tos = skb->nh.iph->tos; |
@@ -1107,8 +1112,6 @@ static void ip_encap(struct sk_buff *skb, __be32 saddr, __be32 daddr) | |||
1107 | ip_select_ident(iph, skb->dst, NULL); | 1112 | ip_select_ident(iph, skb->dst, NULL); |
1108 | ip_send_check(iph); | 1113 | ip_send_check(iph); |
1109 | 1114 | ||
1110 | skb->h.ipiph = skb->nh.iph; | ||
1111 | skb->nh.iph = iph; | ||
1112 | memset(&(IPCB(skb)->opt), 0, sizeof(IPCB(skb)->opt)); | 1115 | memset(&(IPCB(skb)->opt), 0, sizeof(IPCB(skb)->opt)); |
1113 | nf_reset(skb); | 1116 | nf_reset(skb); |
1114 | } | 1117 | } |