lkml.org 
[lkml]   [2019]   [Jul]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH net v2] net: ipv6: Fix a bug in ndisc_send_ns when netdev only has a global address
From
Date
On 7/29/19 8:35 PM, Su Yanjun wrote:
> diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c
> index 083cc1c..156c027 100644
> --- a/net/ipv6/ndisc.c
> +++ b/net/ipv6/ndisc.c
> @@ -603,11 +603,14 @@ void ndisc_send_ns(struct net_device *dev, const struct in6_addr *solicit,
> int inc_opt = dev->addr_len;
> int optlen = 0;
> struct nd_msg *msg;
> + u32 banned_flags = IFA_F_TENTATIVE | IFA_F_OPTIMISTIC;
>
> if (!saddr) {

banned_flags should be declared here, under !saddr since that is the
scope of its use.


> - if (ipv6_get_lladdr(dev, &addr_buf,
> - (IFA_F_TENTATIVE|IFA_F_OPTIMISTIC)))
> - return;
> + if (ipv6_get_lladdr(dev, &addr_buf, banned_flags)) {
> + /* try global address */
> + if (ipv6_get_addr(dev, &addr_buf, banned_flags))
> + return;
> + }
> saddr = &addr_buf;
> }
>
>

\
 
 \ /
  Last update: 2019-07-30 15:45    [W:0.051 / U:2.004 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site