[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4CA47951.3050006@6wind.com>
Date: Thu, 30 Sep 2010 13:49:37 +0200
From: Nicolas Dichtel <nicolas.dichtel@...nd.com>
To: Eric Dumazet <eric.dumazet@...il.com>
CC: netdev <netdev@...r.kernel.org>,
Octavian Purdila <opurdila@...acom.com>
Subject: Re: [PATCH] ipv4: remove all rt cache entries on UNREGISTER event
Patch works well with my case.
In fact, it's more proper to returns an error to the daemon to let it
knows that packet was not sent.
Acked-by: Nicolas Dichtel <nicolas.dichtel@...nd.com>
Regards,
Nicolas
Eric Dumazet wrote:
> 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) ||
>
>
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists