summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuss White <russ@riw.us>2023-11-07 09:40:01 -0500
committerGitHub <noreply@github.com>2023-11-07 09:40:01 -0500
commitcf51579b5bb0044298dab95056e2f43b5d75ab85 (patch)
treea18344835679efc48be0df7ca9e853f4aba069c3
parentf57763eaed67e2f1cb9547cfc3876e29410df577 (diff)
parenta35bb7e2a89097dc90105a75cbd68618fb74451c (diff)
Merge pull request #14698 from opensourcerouting/fix/remove_static_arp_entries_on_ifdown_events
zebra: Remove static ARP entries on interface down events
-rw-r--r--zebra/redistribute.c3
-rw-r--r--zebra/zebra_neigh.c13
-rw-r--r--zebra/zebra_neigh.h1
3 files changed, 17 insertions, 0 deletions
diff --git a/zebra/redistribute.c b/zebra/redistribute.c
index 6121949ced..1cfed6df4b 100644
--- a/zebra/redistribute.c
+++ b/zebra/redistribute.c
@@ -28,6 +28,7 @@
#include "zebra/zapi_msg.h"
#include "zebra/zebra_vxlan.h"
#include "zebra/zebra_errors.h"
+#include "zebra/zebra_neigh.h"
#define ZEBRA_PTM_SUPPORT
@@ -518,6 +519,8 @@ void zebra_interface_down_update(struct interface *ifp)
zsend_interface_update(ZEBRA_INTERFACE_DOWN, client, ifp);
}
+
+ zebra_neigh_del_all(ifp);
}
/* Interface information update. */
diff --git a/zebra/zebra_neigh.c b/zebra/zebra_neigh.c
index 0c3fb97afd..941088afd6 100644
--- a/zebra/zebra_neigh.c
+++ b/zebra/zebra_neigh.c
@@ -152,6 +152,19 @@ void zebra_neigh_del(struct interface *ifp, struct ipaddr *ip)
zebra_neigh_free(n);
}
+/* kernel neigh delete all for a given interface */
+void zebra_neigh_del_all(struct interface *ifp)
+{
+ struct zebra_neigh_ent *n, *nn;
+
+ if (IS_ZEBRA_DEBUG_NEIGH)
+ zlog_debug("zebra neigh delete all for interface %s/%d",
+ ifp->name, ifp->ifindex);
+
+ RB_FOREACH_SAFE (n, zebra_neigh_rb_head, &zneigh_info->neigh_rb_tree, nn)
+ zebra_neigh_del(ifp, &n->ip);
+}
+
/* kernel neigh add */
void zebra_neigh_add(struct interface *ifp, struct ipaddr *ip,
struct ethaddr *mac)
diff --git a/zebra/zebra_neigh.h b/zebra/zebra_neigh.h
index b957b5efe5..adc5f94f76 100644
--- a/zebra/zebra_neigh.h
+++ b/zebra/zebra_neigh.h
@@ -43,6 +43,7 @@ struct zebra_neigh_info {
extern void zebra_neigh_add(struct interface *ifp, struct ipaddr *ip,
struct ethaddr *mac);
extern void zebra_neigh_del(struct interface *ifp, struct ipaddr *ip);
+extern void zebra_neigh_del_all(struct interface *ifp);
extern void zebra_neigh_show(struct vty *vty);
extern void zebra_neigh_init(void);
extern void zebra_neigh_terminate(void);