Patchwork neigh: Netlink notification for administrative NUD state change

login
register
mail settings
Submitter Bob Gilligan
Date Dec. 15, 2013, 9:39 p.m.
Message ID <52ae21ac.oFg7QoGcVg2CCThY%gilligan@aristanetworks.com>
Download mbox | patch
Permalink /patch/301399/
State Accepted
Delegated to: David Miller
Headers show

Comments

Bob Gilligan - Dec. 15, 2013, 9:39 p.m.
The neighbour code sends up an RTM_NEWNEIGH netlink notification if
the NUD state of a neighbour cache entry is changed by a timer (e.g.
from REACHABLE to STALE), even if the lladdr of the entry has not
changed.

But an administrative change to the the NUD state of a neighbour cache
entry that does not change the lladdr (e.g. via "ip -4 neigh change
...  nud ...") does not trigger a netlink notification.  This means
that netlink listeners will not hear about administrative NUD state
changes such as from a resolved state to PERMANENT.

This patch changes the neighbor code to generate an RTM_NEWNEIGH
message when the NUD state of an entry is changed administratively.

Signed-off-by: Bob Gilligan <gilligan@aristanetworks.com>
---

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Nicolas Dichtel - Dec. 16, 2013, 8:23 a.m.
Le 15/12/2013 22:39, Bob Gilligan a écrit :
>
> The neighbour code sends up an RTM_NEWNEIGH netlink notification if
> the NUD state of a neighbour cache entry is changed by a timer (e.g.
> from REACHABLE to STALE), even if the lladdr of the entry has not
> changed.
>
> But an administrative change to the the NUD state of a neighbour cache
> entry that does not change the lladdr (e.g. via "ip -4 neigh change
> ...  nud ...") does not trigger a netlink notification.  This means
> that netlink listeners will not hear about administrative NUD state
> changes such as from a resolved state to PERMANENT.
>
> This patch changes the neighbor code to generate an RTM_NEWNEIGH
> message when the NUD state of an entry is changed administratively.
>
> Signed-off-by: Bob Gilligan <gilligan@aristanetworks.com>
Acked-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller - Dec. 17, 2013, 9:15 p.m.
From: Bob Gilligan <gilligan@aristanetworks.com>
Date: Sun, 15 Dec 2013 13:39:56 -0800

> 
> The neighbour code sends up an RTM_NEWNEIGH netlink notification if
> the NUD state of a neighbour cache entry is changed by a timer (e.g.
> from REACHABLE to STALE), even if the lladdr of the entry has not
> changed.
> 
> But an administrative change to the the NUD state of a neighbour cache
> entry that does not change the lladdr (e.g. via "ip -4 neigh change
> ...  nud ...") does not trigger a netlink notification.  This means
> that netlink listeners will not hear about administrative NUD state
> changes such as from a resolved state to PERMANENT.
> 
> This patch changes the neighbor code to generate an RTM_NEWNEIGH
> message when the NUD state of an entry is changed administratively.
> 
> Signed-off-by: Bob Gilligan <gilligan@aristanetworks.com>

Applied, thanks Bob.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/net/core/neighbour.c b/net/core/neighbour.c
index 6072610..7f0e838 100644
--- a/net/core/neighbour.c
+++ b/net/core/neighbour.c
@@ -1161,6 +1161,7 @@  int neigh_update(struct neighbour *neigh, const u8 *lladdr, u8 new,
 						 neigh->parms->reachable_time :
 						 0)));
 		neigh->nud_state = new;
+		notify = 1;
 	}
 
 	if (lladdr != neigh->ha) {