public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: David Ahern <dsahern@gmail•com>
To: James Prestwood <prestwoj@gmail•com>, netdev@vger•kernel.org
Subject: Re: [PATCH v5 2/2] net: ndisc: introduce ndisc_evict_nocarrier sysctl parameter
Date: Thu, 21 Oct 2021 08:15:00 -0600	[thread overview]
Message-ID: <dc0b9353-0eea-63e2-ccba-681bd07288b0@gmail.com> (raw)
In-Reply-To: <20211021003212.878786-3-prestwoj@gmail.com>

On 10/20/21 6:32 PM, James Prestwood wrote:
> diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c
> index 184190b9ea25..4db58c29ab53 100644
> --- a/net/ipv6/ndisc.c
> +++ b/net/ipv6/ndisc.c
> @@ -1810,10 +1811,16 @@ static int ndisc_netdev_event(struct notifier_block *this, unsigned long event,
>  		in6_dev_put(idev);
>  		break;
>  	case NETDEV_CHANGE:
> +		idev = in6_dev_get(dev);
> +		if (!idev)
> +			evict_nocarrier = true;
> +		else
> +			evict_nocarrier = idev->cnf.ndisc_evict_nocarrier;
> +

missing in6_dev_put here


>  		change_info = ptr;
>  		if (change_info->flags_changed & IFF_NOARP)
>  			neigh_changeaddr(&nd_tbl, dev);
> -		if (!netif_carrier_ok(dev))
> +		if (evict_nocarrier && !netif_carrier_ok(dev))
>  			neigh_carrier_down(&nd_tbl, dev);
>  		break;
>  	case NETDEV_DOWN:
> 


  reply	other threads:[~2021-10-21 14:15 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-21  0:32 [PATCH v5 0/2] Make neighbor eviction controllable by userspace James Prestwood
2021-10-21  0:32 ` [PATCH v5 1/2] net: arp: introduce arp_evict_nocarrier sysctl parameter James Prestwood
2021-10-21 14:08   ` David Ahern
2021-10-21  0:32 ` [PATCH v5 2/2] net: ndisc: introduce ndisc_evict_nocarrier " James Prestwood
2021-10-21 14:15   ` David Ahern [this message]
2021-10-21  2:33 ` [PATCH v5 0/2] Make neighbor eviction controllable by userspace David Ahern
2021-10-21 21:59   ` James Prestwood
2021-10-21 22:09     ` David Ahern

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=dc0b9353-0eea-63e2-ccba-681bd07288b0@gmail.com \
    --to=dsahern@gmail$(echo .)com \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=prestwoj@gmail$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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