From: Jiri Benc Date: Fri, 4 Oct 2013 15:04:48 +0000 (+0200) Subject: ipv4: fix ineffective source address selection X-Git-Tag: v4.9.8~7602^2~64 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0a7e22609067ff524fc7bbd45c6951dd08561667;p=platform%2Fkernel%2Flinux-rpi3.git ipv4: fix ineffective source address selection When sending out multicast messages, the source address in inet->mc_addr is ignored and rewritten by an autoselected one. This is caused by a typo in commit 813b3b5db831 ("ipv4: Use caller's on-stack flowi as-is in output route lookups"). Signed-off-by: Jiri Benc Acked-by: Eric Dumazet Signed-off-by: David S. Miller --- diff --git a/net/ipv4/route.c b/net/ipv4/route.c index 727f436..6011615 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c @@ -2072,7 +2072,7 @@ struct rtable *__ip_route_output_key(struct net *net, struct flowi4 *fl4) RT_SCOPE_LINK); goto make_route; } - if (fl4->saddr) { + if (!fl4->saddr) { if (ipv4_is_multicast(fl4->daddr)) fl4->saddr = inet_select_addr(dev_out, 0, fl4->flowi4_scope);