From ef7bd2a3d5ecab37018f4035391f99c25ddadeab Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Wed, 18 Sep 2019 22:26:55 -0400 Subject: *: Switch all zclient->interface_add to interface create callback Switch the zclient->interface_add functionality to have everyone use the interface create callback in lib/if.c Signed-off-by: Donald Sharp --- bfdd/ptm_adapter.c | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) (limited to 'bfdd/ptm_adapter.c') diff --git a/bfdd/ptm_adapter.c b/bfdd/ptm_adapter.c index 2d1b17ce4a..dc90b4d6e1 100644 --- a/bfdd/ptm_adapter.c +++ b/bfdd/ptm_adapter.c @@ -677,20 +677,6 @@ static int bfdd_interface_update(ZAPI_CALLBACK_ARGS) { struct interface *ifp; - /* - * `zebra_interface_add_read` will handle the interface creation - * on `lib/if.c`. We'll use that data structure instead of - * rolling our own. - */ - if (cmd == ZEBRA_INTERFACE_ADD) { - ifp = zebra_interface_add_read(zclient->ibuf, vrf_id); - if (ifp == NULL) - return 0; - - bfdd_sessions_enable_interface(ifp); - return 0; - } - /* Update interface information. */ ifp = zebra_interface_state_read(zclient->ibuf, vrf_id); if (ifp == NULL) @@ -758,6 +744,8 @@ static int bfdd_interface_address_update(ZAPI_CALLBACK_ARGS) static int bfd_ifp_create(struct interface *ifp) { + bfdd_sessions_enable_interface(ifp); + return 0; } @@ -784,7 +772,6 @@ void bfdd_zclient_init(struct zebra_privs_t *bfdd_priv) zclient->zebra_connected = bfdd_zebra_connected; /* Learn interfaces from zebra instead of the OS. */ - zclient->interface_add = bfdd_interface_update; zclient->interface_delete = bfdd_interface_update; /* Learn about interface VRF. */ -- cgit v1.2.3