aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/ipmr.c
diff options
context:
space:
mode:
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={
1093 1093
1094static void ip_encap(struct sk_buff *skb, __be32 saddr, __be32 daddr) 1094static 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}