From: Donald Sharp Date: Thu, 19 Sep 2019 13:59:00 +0000 (-0400) Subject: lib: delete interface if you can in upper level protocol X-Git-Tag: base_7.3~298^2 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=26f8f6fe7fb90208d4a5eb285fdf0dca83bde508;p=mirror%2Ffrr.git lib: delete interface if you can in upper level protocol In an upper level protocol, delete the interface on notification about deletion. Signed-off-by: Donald Sharp --- diff --git a/lib/if.c b/lib/if.c index 5a46a8026d..87d0ea968b 100644 --- a/lib/if.c +++ b/lib/if.c @@ -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) diff --git a/lib/zclient.c b/lib/zclient.c index 6ba71eba49..9129466685 100644 --- a/lib/zclient.c +++ b/lib/zclient.c @@ -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; @@ -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; diff --git a/lib/zclient.h b/lib/zclient.h index 37f20a6bf0..5f9edc36ff 100644 --- a/lib/zclient.h +++ b/lib/zclient.h @@ -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,