Skip to content

Commit

Permalink
ipv4: Fix 'iph' use before set.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
David S. Miller committed May 13, 2011
1 parent 5c50954 commit 72a8f97
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/ipv4/ip_forward.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ int ip_forward(struct sk_buff *skb)

rt = skb_rtable(skb);

if (opt->is_strictroute && iph->daddr != rt->rt_gateway)
if (opt->is_strictroute && ip_hdr(skb)->daddr != rt->rt_gateway)
goto sr_failed;

if (unlikely(skb->len > dst_mtu(&rt->dst) && !skb_is_gso(skb) &&
Expand Down

0 comments on commit 72a8f97

Please sign in to comment.