Skip to content

Commit

Permalink
Merge pull request #14698 from opensourcerouting/fix/remove_static_ar…
Browse files Browse the repository at this point in the history
…p_entries_on_ifdown_events

zebra: Remove static ARP entries on interface down events
  • Loading branch information
riw777 authored Nov 7, 2023
2 parents f57763e + a35bb7e commit cf51579
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
3 changes: 3 additions & 0 deletions zebra/redistribute.c
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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. */
Expand Down
13 changes: 13 additions & 0 deletions zebra/zebra_neigh.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions zebra/zebra_neigh.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit cf51579

Please sign in to comment.