Thread (5 messages) flat view 5 messages, 1 author, 2021-10-22

Re: [PATCH v6 2/3] net: ndisc: introduce ndisc_evict_nocarrier sysctl parameter

From: James Prestwood <hidden>
Date: 2021-10-22 21:06:56

[snip]
quoted hunk ↗ jump to hunk
@@ -1810,10 +1811,19 @@ 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-
quoted
cnf.ndisc_evict_nocarrier ||
+                                         net->ipv6.devconf_all-
quoted
ndisc_evict_nocarrier;
Whoops, this should be &&
+                       in6_dev_put(idev);
+               }
+
                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:
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help