From: David S. Miller Date: Thu, 12 May 2011 23:30:58 +0000 (-0400) Subject: ipv4: Simplify iph->daddr overwrite in ip_options_rcv_srr(). X-Git-Tag: v3.0~749^2~104^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c30883bdff0b3544900a5c4aba18b8985436878f;p=platform%2Fkernel%2Flinux-amlogic.git 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: David S. Miller --- diff --git a/net/ipv4/ip_options.c b/net/ipv4/ip_options.c index e82c304..c5c2619 100644 --- a/net/ipv4/ip_options.c +++ b/net/ipv4/ip_options.c @@ -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) {