From: Hannes Frederic Sowa <hannes@stressinduktion.org>
To: Francois-Xavier Le Bail <fx.lebail@yahoo.com>
Cc: netdev <netdev@vger.kernel.org>,
David Stevens <dlstevens@us.ibm.com>,
David Miller <davem@davemloft.net>
Subject: Re: [PATCH net-next v2] ipv6: enable anycast addresses as source addresses for datagrams
Date: Wed, 22 Jan 2014 01:16:07 +0100 [thread overview]
Message-ID: <20140122001607.GA20565@order.stressinduktion.org> (raw)
In-Reply-To: <1390320070-12735-1-git-send-email-fx.lebail@yahoo.com>
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!
prev parent reply other threads:[~2014-01-22 0:16 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-21 16:01 [PATCH net-next v2] ipv6: enable anycast addresses as source addresses for datagrams Francois-Xavier Le Bail
2014-01-22 0:16 ` Hannes Frederic Sowa [this message]
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=20140122001607.GA20565@order.stressinduktion.org \
--to=hannes@stressinduktion.org \
--cc=davem@davemloft.net \
--cc=dlstevens@us.ibm.com \
--cc=fx.lebail@yahoo.com \
--cc=netdev@vger.kernel.org \
/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