From: Arnaldo Carvalho de Melo Date: Mon, 12 Mar 2007 23:09:36 +0000 (-0300) Subject: [IPMR]: Fix bug introduced when converting to skb_network_reset_header X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=e023dd643798c4f06c16466af90b4d250e4b8bd7;p=linux-beck.git [IPMR]: Fix bug introduced when converting to skb_network_reset_header Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: David S. Miller --- 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={ static void ip_encap(struct sk_buff *skb, __be32 saddr, __be32 daddr) { struct iphdr *iph; + struct iphdr *old_iph = skb->nh.iph; skb_push(skb, sizeof(struct iphdr)); skb->h.ipiph = skb->nh.iph; @@ -1103,8 +1104,8 @@ static void ip_encap(struct sk_buff *skb, __be32 saddr, __be32 daddr) iph = skb->nh.iph; iph->version = 4; - iph->tos = skb->nh.iph->tos; - iph->ttl = skb->nh.iph->ttl; + iph->tos = old_iph->tos; + iph->ttl = old_iph->ttl; iph->frag_off = 0; iph->daddr = daddr; iph->saddr = saddr;