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

lib, zebra: Allow for interface deletion when kernel event happens #5009

Merged
merged 8 commits into from
Sep 30, 2019
2 changes: 2 additions & 0 deletions lib/if.c
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,8 @@ void if_destroy_via_zapi(struct interface *ifp)
(*ifp_master.destroy_hook)(ifp);

if_set_index(ifp, IFINDEX_INTERNAL);
if (!ifp->configured)
if_delete(ifp);
}
pguibert6WIND marked this conversation as resolved.
Show resolved Hide resolved

void if_up_via_zapi(struct interface *ifp)
Expand Down
6 changes: 5 additions & 1 deletion lib/zclient.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ enum event { ZCLIENT_SCHEDULE, ZCLIENT_READ, ZCLIENT_CONNECT };
/* Prototype for event manager. */
static void zclient_event(enum event, struct zclient *);

static void zebra_interface_if_set_value(struct stream *s,
struct interface *ifp);

struct zclient_options zclient_options_default = {.receive_notify = false};

struct sockaddr_storage zclient_addr;
Expand Down Expand Up @@ -1696,7 +1699,8 @@ struct interface *zebra_interface_link_params_read(struct stream *s,
return ifp;
}

void zebra_interface_if_set_value(struct stream *s, struct interface *ifp)
static void zebra_interface_if_set_value(struct stream *s,
struct interface *ifp)
{
uint8_t link_params_status = 0;
ifindex_t old_ifindex;
Expand Down
1 change: 0 additions & 1 deletion lib/zclient.h
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,6 @@ zebra_interface_nbr_address_read(int, struct stream *, vrf_id_t);
extern struct interface *zebra_interface_vrf_update_read(struct stream *s,
vrf_id_t vrf_id,
vrf_id_t *new_vrf_id);
extern void zebra_interface_if_set_value(struct stream *, struct interface *);
extern void zebra_router_id_update_read(struct stream *s, struct prefix *rid);

extern struct interface *zebra_interface_link_params_read(struct stream *s,
Expand Down