[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20140122001607.GA20565@order.stressinduktion.org>
Date: Wed, 22 Jan 2014 01:16:07 +0100
From: Hannes Frederic Sowa <hannes@...essinduktion.org>
To: Francois-Xavier Le Bail <fx.lebail@...oo.com>
Cc: netdev <netdev@...r.kernel.org>,
David Stevens <dlstevens@...ibm.com>,
David Miller <davem@...emloft.net>
Subject: Re: [PATCH net-next v2] ipv6: enable anycast addresses as source addresses for datagrams
On Tue, Jan 21, 2014 at 05:01:10PM +0100, Francois-Xavier Le Bail wrote:
> diff --git a/net/ipv6/anycast.c b/net/ipv6/anycast.c
> index 5a80f15..d3a6e2d 100644
> --- a/net/ipv6/anycast.c
> +++ b/net/ipv6/anycast.c
> @@ -383,6 +383,17 @@ bool ipv6_chk_acast_addr(struct net *net, struct net_device *dev,
> return found;
> }
>
> +/* check if this anycast address is link-local on given interface or
> + * is global
> + */
> +bool ipv6_chk_acast_addr_src(struct net *net, struct net_device *dev,
> + const struct in6_addr *addr)
> +{
> + if (ipv6_addr_type(addr) & IPV6_ADDR_LINKLOCAL)
> + return ipv6_chk_acast_dev(dev, addr);
> + else
> + return ipv6_chk_acast_addr(net, NULL, addr);
> +}
You need to do the check with ipv6_chk_acast_addr in both cases, as only
ipv6_chk_acast_addr does a rcu_read_lock and it is needed for the dereference
of inet6_dev (__in6_dev_get is not safe in ipv6_chk_acast_dev without
rcu_read_lock).
Otherwise I am fine with this patch, thanks!
--
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