netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: wen.gang.wang@oracle.com
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH] ip: find correct route for socket which is not bound (v2)
Date: Sun, 01 Nov 2015 11:47:30 -0500 (EST)	[thread overview]
Message-ID: <20151101.114730.490692280193173443.davem@davemloft.net> (raw)
In-Reply-To: <1443145960-20514-1-git-send-email-wen.gang.wang@oracle.com>

From: Wengang Wang <wen.gang.wang@oracle.com>
Date: Fri, 25 Sep 2015 09:52:40 +0800

> diff --git a/net/ipv4/route.c b/net/ipv4/route.c
> index 5f4a556..c0534c2 100644
> --- a/net/ipv4/route.c
> +++ b/net/ipv4/route.c
> @@ -2097,7 +2097,10 @@ struct rtable *__ip_route_output_key(struct net *net, struct flowi4 *fl4)
>  			 */
>  
>  			fl4->flowi4_oif = dev_out->ifindex;
> -			goto make_route;
> +			if (dev_out->flags & IFF_LOOPBACK)
> +				goto make_route;
> +			else
> +				goto lookup;
>  		}

This is still broken.

By definition invoking fib_lookup() and depending upon it finding
something in this path is going to break things for somebody,
somewhere.  Before your change, if we lacked a multicast route,
the user would still get a functioning path.

Furthermore, most of the other "goto make_route" cases in this
function suffer from the same exact problem you're trying to
solve.  Therefore, special casing one instance makes no sense
at all.

I want you to, instead of making potentially lethal semantic changes
here, fix the real problem instead.

That is, I want you to fix how we do not cache routes we create merely
because we lack a fib_info.

Thanks.

  parent reply	other threads:[~2015-11-01 16:47 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-25  1:52 [PATCH] ip: find correct route for socket which is not bound (v2) Wengang Wang
2015-10-08  3:31 ` Wengang Wang
2015-10-08 10:30   ` David Miller
2015-11-01 16:47 ` David Miller [this message]
  -- strict thread matches above, loose matches on Subject: below --
2015-09-21  8:00 Wengang Wang
2015-09-24 21:22 ` David Miller
2015-09-25  0:54   ` Wengang Wang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20151101.114730.490692280193173443.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=wen.gang.wang@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).