Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zebra: Remove static ARP entries on interface down events #14698

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -522,6 +523,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
Loading