From 20b7c34c649fb1089a0d6c95394e268430566b30 Mon Sep 17 00:00:00 2001 From: Jeremy Karst Date: Sat, 28 Nov 2026 04:27:43 -0500 Subject: [PATCH] cmm: remove the unused cmm_neigh_invalidate() and cmm_neigh_flush_ifindex() Neither had a caller; cmm_neigh_check() now marks neighbors whose MAC changed or is gone. Co-Authored-By: Claude Opus 5.5 --- fastpath/cmm/cmm_neigh.c | 39 --------------------------------------- fastpath/cmm/cmm_neigh.h | 6 ------ 2 files changed, 45 deletions(-) diff --git a/fastpath/cmm/cmm_neigh.c b/fastpath/cmm/cmm_neigh.c index a58c6fd..1bfd294 100644 --- a/fastpath/cmm/cmm_neigh.c +++ b/fastpath/cmm/cmm_neigh.c @@ -341,23 +341,6 @@ cmm_neigh_put(struct cmm_neigh *neigh) } } -void -cmm_neigh_flush_ifindex(int ifindex) -{ - struct cmm_neigh *neigh; - struct list_head *pos; - int i; - - for (i = 0; i < NEIGH_HASH_TOTAL; i++) { - for (pos = list_first(&neigh_hash[i]); - pos != &neigh_hash[i]; pos = list_next(pos)) { - neigh = container_of(pos, struct cmm_neigh, entry); - if (neigh->ifindex == ifindex) - neigh->state = NEIGH_STALE; - } - } -} - void cmm_neigh_flush_all(void) { @@ -373,25 +356,3 @@ cmm_neigh_flush_all(void) } } } - -void -cmm_neigh_invalidate(sa_family_t af, const void *ip) -{ - struct cmm_neigh *neigh; - unsigned int h; - struct list_head *pos; - int alen; - - h = neigh_hash_index(af, ip); - alen = (af == AF_INET) ? 4 : 16; - - for (pos = list_first(&neigh_hash[h]); pos != &neigh_hash[h]; - pos = list_next(pos)) { - neigh = container_of(pos, struct cmm_neigh, entry); - if (neigh->family == af && - memcmp(neigh->ipaddr, ip, alen) == 0) { - neigh->state = NEIGH_STALE; - return; - } - } -} diff --git a/fastpath/cmm/cmm_neigh.h b/fastpath/cmm/cmm_neigh.h index 1384463..e0befbe 100644 --- a/fastpath/cmm/cmm_neigh.h +++ b/fastpath/cmm/cmm_neigh.h @@ -51,12 +51,6 @@ void cmm_neigh_put(struct cmm_neigh *neigh); kernel's ARP/NDP table; returns the number marked */ int cmm_neigh_check(void); -/* Invalidate all neighbors on a given interface */ -void cmm_neigh_flush_ifindex(int ifindex); - -/* Invalidate a specific neighbor (e.g. on ARP change) */ -void cmm_neigh_invalidate(sa_family_t af, const void *ip); - /* Mark all neighbors as stale (full reset) */ void cmm_neigh_flush_all(void);