Skip to content

Commit

Permalink
[IPMR]: Fix bug introduced when converting to skb_network_reset_header
Browse files Browse the repository at this point in the history
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Arnaldo Carvalho de Melo authored and David S. Miller committed Apr 26, 2007
1 parent c9bdd4b commit e023dd6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions net/ipv4/ipmr.c
Original file line number Diff line number Diff line change
Expand Up @@ -1096,15 +1096,16 @@ 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;
skb_reset_network_header(skb);
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;
Expand Down

0 comments on commit e023dd6

Please sign in to comment.