From: Nicolas Dichtel <nicolas.dichtel@6wind.com>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: netdev <netdev@vger.kernel.org>, Octavian Purdila <opurdila@ixiacom.com>
Subject: Re: [PATCH] ipv4: remove all rt cache entries on UNREGISTER event
Date: Wed, 22 Dec 2010 09:32:44 +0100 [thread overview]
Message-ID: <4D11B7AC.8000205@6wind.com> (raw)
In-Reply-To: <1285751929.2615.30.camel@edumazet-laptop>
What is the status of this patch? The initial problem is still here in 2.6.37-rc5+
Regards,
Nicolas
Le 29.09.2010 11:18, Eric Dumazet a écrit :
> I found following patch was enough to avoid route being created if
> device is down. This is still racy and needs more thinking.
>
>
> diff --git a/net/ipv4/route.c b/net/ipv4/route.c
> index ac6559c..1ee0b1a 100644
> --- a/net/ipv4/route.c
> +++ b/net/ipv4/route.c
> @@ -2586,9 +2586,10 @@ static int ip_route_output_slow(struct net *net, struct rtable **rp,
> goto out;
>
> /* RACE: Check return value of inet_select_addr instead. */
> - if (__in_dev_get_rtnl(dev_out) == NULL) {
> + if (!(dev_out->flags & IFF_UP) || __in_dev_get_rtnl(dev_out) == NULL) {
> dev_put(dev_out);
> - goto out; /* Wrong error code */
> + err = -ENETUNREACH;
> + goto out;
> }
>
> if (ipv4_is_local_multicast(oldflp->fl4_dst) ||
>
>
next prev parent reply other threads:[~2010-12-22 8:32 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-28 15:24 [PATCH] ipv4: remove all rt cache entries on UNREGISTER event Nicolas Dichtel
2010-09-28 16:33 ` Eric Dumazet
2010-09-28 16:45 ` Nicolas Dichtel
2010-09-28 16:56 ` Eric Dumazet
2010-09-29 7:49 ` Nicolas Dichtel
2010-09-29 8:35 ` Eric Dumazet
2010-09-29 9:18 ` Eric Dumazet
2010-09-30 11:49 ` Nicolas Dichtel
2010-12-22 8:32 ` Nicolas Dichtel [this message]
2010-12-22 9:55 ` Eric Dumazet
2010-12-22 10:07 ` Eric Dumazet
2010-12-22 13:43 ` Nicolas Dichtel
2010-12-22 14:39 ` [PATCH] ipv4: dont create routes on down devices Eric Dumazet
2010-12-23 8:50 ` Octavian Purdila
2010-12-26 4:05 ` David Miller
2010-09-28 17:35 ` [PATCH] ipv4: remove all rt cache entries on UNREGISTER event Octavian Purdila
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=4D11B7AC.8000205@6wind.com \
--to=nicolas.dichtel@6wind.com \
--cc=eric.dumazet@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=opurdila@ixiacom.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).