Skip to content

Commit

Permalink
lib: delete interface if you can in upper level protocol
Browse files Browse the repository at this point in the history
In an upper level protocol, delete the interface on notification
about deletion.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
  • Loading branch information
donaldsharp committed Sep 19, 2019
1 parent 3c3c325 commit 26f8f6f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
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);
}

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

0 comments on commit 26f8f6f

Please sign in to comment.