Commit 72a8f97bf2dfe1b0f02ba8dbaed7d6b76657aae3

Authored by David S. Miller
1 parent 5c5095494f

ipv4: Fix 'iph' use before set.

I swear none of my compilers warned about this, yet it is so
obvious.

> net/ipv4/ip_forward.c: In function 'ip_forward':
> net/ipv4/ip_forward.c:87: warning: 'iph' may be used uninitialized in this function

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>

Showing 1 changed file with 1 additions and 1 deletions Side-by-side Diff

net/ipv4/ip_forward.c
... ... @@ -84,7 +84,7 @@
84 84  
85 85 rt = skb_rtable(skb);
86 86  
87   - if (opt->is_strictroute && iph->daddr != rt->rt_gateway)
  87 + if (opt->is_strictroute && ip_hdr(skb)->daddr != rt->rt_gateway)
88 88 goto sr_failed;
89 89  
90 90 if (unlikely(skb->len > dst_mtu(&rt->dst) && !skb_is_gso(skb) &&