Skip to content

Commit

Permalink
ipv4: Simplify iph->daddr overwrite in ip_options_rcv_srr().
Browse files Browse the repository at this point in the history
We already copy the 4-byte nexthop from the options block into
local variable "nexthop" for the route lookup.

Re-use that variable instead of memcpy()'ing again when assigning
to iph->daddr after the route lookup succeeds.

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller committed May 12, 2011
1 parent 1094955 commit c30883b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/ipv4/ip_options.c
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,7 @@ int ip_options_rcv_srr(struct sk_buff *skb)
if (rt2->rt_type != RTN_LOCAL)
break;
/* Superfast 8) loopback forward */
memcpy(&iph->daddr, &optptr[srrptr-1], 4);
iph->daddr = nexthop;
opt->is_changed = 1;
}
if (srrptr <= srrspace) {
Expand Down

0 comments on commit c30883b

Please sign in to comment.