[IPMR]: Fix bug introduced when converting to skb_network_reset_header
authorArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 12 Mar 2007 23:09:36 +0000 (20:09 -0300)
committerDavid S. Miller <davem@sunset.davemloft.net>
Thu, 26 Apr 2007 05:25:08 +0000 (22:25 -0700)
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/ipmr.c

index 54b7543190f1eec06b8d487cc26dc3d4b59bab44..b24dffe3bd464c157f7e4556d0640d493f429beb 100644 (file)
@@ -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;