diff options
-rw-r--r-- | net/ipv4/ipmr.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c index 54b7543190f1..b24dffe3bd46 100644 --- a/net/ipv4/ipmr.c +++ b/net/ipv4/ipmr.c | |||
@@ -1096,6 +1096,7 @@ static struct notifier_block ip_mr_notifier={ | |||
1096 | static void ip_encap(struct sk_buff *skb, __be32 saddr, __be32 daddr) | 1096 | static void ip_encap(struct sk_buff *skb, __be32 saddr, __be32 daddr) |
1097 | { | 1097 | { |
1098 | struct iphdr *iph; | 1098 | struct iphdr *iph; |
1099 | struct iphdr *old_iph = skb->nh.iph; | ||
1099 | 1100 | ||
1100 | skb_push(skb, sizeof(struct iphdr)); | 1101 | skb_push(skb, sizeof(struct iphdr)); |
1101 | skb->h.ipiph = skb->nh.iph; | 1102 | skb->h.ipiph = skb->nh.iph; |
@@ -1103,8 +1104,8 @@ static void ip_encap(struct sk_buff *skb, __be32 saddr, __be32 daddr) | |||
1103 | iph = skb->nh.iph; | 1104 | iph = skb->nh.iph; |
1104 | 1105 | ||
1105 | iph->version = 4; | 1106 | iph->version = 4; |
1106 | iph->tos = skb->nh.iph->tos; | 1107 | iph->tos = old_iph->tos; |
1107 | iph->ttl = skb->nh.iph->ttl; | 1108 | iph->ttl = old_iph->ttl; |
1108 | iph->frag_off = 0; | 1109 | iph->frag_off = 0; |
1109 | iph->daddr = daddr; | 1110 | iph->daddr = daddr; |
1110 | iph->saddr = saddr; | 1111 | iph->saddr = saddr; |