Skip to content
Snippets Groups Projects
Commit c30883bd authored by David S. Miller's avatar David S. Miller
Browse files

ipv4: Simplify iph->daddr overwrite in ip_options_rcv_srr().


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: default avatarDavid S. Miller <davem@davemloft.net>
parent 10949550
No related branches found
No related tags found
No related merge requests found
......@@ -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) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment