netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ipv4: fix ineffective source address selection
@ 2013-10-04 15:04 Jiri Benc
  2013-10-04 15:49 ` Eric Dumazet
  2013-10-07 19:27 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Jiri Benc @ 2013-10-04 15:04 UTC (permalink / raw)
  To: netdev

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 <jbenc@redhat.com>
---
 net/ipv4/route.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

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);
-- 
1.7.6.5

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] ipv4: fix ineffective source address selection
  2013-10-04 15:04 [PATCH] ipv4: fix ineffective source address selection Jiri Benc
@ 2013-10-04 15:49 ` Eric Dumazet
  2013-10-07 19:27 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Eric Dumazet @ 2013-10-04 15:49 UTC (permalink / raw)
  To: Jiri Benc; +Cc: netdev

On Fri, 2013-10-04 at 17:04 +0200, Jiri Benc wrote:
> 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 <jbenc@redhat.com>
> ---

Nice catch !

Acked-by: Eric Dumazet <edumazet@google.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] ipv4: fix ineffective source address selection
  2013-10-04 15:04 [PATCH] ipv4: fix ineffective source address selection Jiri Benc
  2013-10-04 15:49 ` Eric Dumazet
@ 2013-10-07 19:27 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2013-10-07 19:27 UTC (permalink / raw)
  To: jbenc; +Cc: netdev

From: Jiri Benc <jbenc@redhat.com>
Date: Fri,  4 Oct 2013 17:04:48 +0200

> 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 <jbenc@redhat.com>

My bad :-)  Applied and queued up for -stable, thanks!

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-10-07 19:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-04 15:04 [PATCH] ipv4: fix ineffective source address selection Jiri Benc
2013-10-04 15:49 ` Eric Dumazet
2013-10-07 19:27 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).