summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--babeld/babel_interface.c13
-rw-r--r--babeld/babel_zebra.c1
-rw-r--r--bgpd/bgp_zebra.c19
-rw-r--r--eigrpd/eigrp_interface.c7
-rw-r--r--eigrpd/eigrp_zebra.c21
-rw-r--r--isisd/isis_circuit.c7
-rw-r--r--isisd/isis_zebra.c19
-rw-r--r--ldpd/ldp_zebra.c29
-rw-r--r--lib/if.c6
-rw-r--r--lib/if.h1
-rw-r--r--lib/zclient.c17
-rw-r--r--lib/zclient.h1
-rw-r--r--nhrpd/nhrp_interface.c14
-rw-r--r--nhrpd/nhrp_route.c1
-rw-r--r--ospf6d/ospf6_interface.c9
-rw-r--r--ospf6d/ospf6_zebra.c20
-rw-r--r--ospfd/ospf_interface.c13
-rw-r--r--ospfd/ospf_zebra.c25
-rw-r--r--pbrd/pbr_zebra.c12
-rw-r--r--pimd/pim_iface.c29
-rw-r--r--pimd/pim_zebra.c45
-rw-r--r--ripd/rip_interface.c19
-rw-r--r--ripd/rip_zebra.c1
-rw-r--r--ripngd/ripng_interface.c18
-rw-r--r--ripngd/ripng_zebra.c1
-rw-r--r--sharpd/sharp_zebra.c11
-rw-r--r--staticd/static_zebra.c15
-rw-r--r--vrrpd/vrrp_zebra.c22
28 files changed, 106 insertions, 290 deletions
diff --git a/babeld/babel_interface.c b/babeld/babel_interface.c
index a0df6d9e1..59d065116 100644
--- a/babeld/babel_interface.c
+++ b/babeld/babel_interface.c
@@ -86,16 +86,10 @@ babel_interface_up (ZAPI_CALLBACK_ARGS)
}
int
-babel_interface_down (ZAPI_CALLBACK_ARGS)
+babel_ifp_down(struct interface *ifp)
{
- struct stream *s = NULL;
- struct interface *ifp = NULL;
-
debugf(BABEL_DEBUG_IF, "receive a 'interface down'");
- s = zclient->ibuf;
- ifp = zebra_interface_state_read(s, vrf_id); /* it updates iflist */
-
if (ifp == NULL) {
return 0;
}
@@ -1256,11 +1250,6 @@ int babel_ifp_up(struct interface *ifp)
return 0;
}
-int babel_ifp_down(struct interface *ifp)
-{
- return 0;
-}
-
int babel_ifp_destroy(struct interface *ifp)
{
return 0;
diff --git a/babeld/babel_zebra.c b/babeld/babel_zebra.c
index 7fc2bfd1c..fd4e497b9 100644
--- a/babeld/babel_zebra.c
+++ b/babeld/babel_zebra.c
@@ -241,7 +241,6 @@ void babelz_zebra_init(void)
zclient->zebra_connected = babel_zebra_connected;
zclient->interface_delete = babel_interface_delete;
- zclient->interface_down = babel_interface_down;
zclient->interface_address_add = babel_interface_address_add;
zclient->interface_address_delete = babel_interface_address_delete;
zclient->redistribute_route_add = babel_zebra_read_route;
diff --git a/bgpd/bgp_zebra.c b/bgpd/bgp_zebra.c
index e758cd2e6..5efe1087e 100644
--- a/bgpd/bgp_zebra.c
+++ b/bgpd/bgp_zebra.c
@@ -253,27 +253,20 @@ static int bgp_ifp_up(struct interface *ifp)
return 0;
}
-static int bgp_interface_down(ZAPI_CALLBACK_ARGS)
+static int bgp_ifp_down(struct interface *ifp)
{
- struct stream *s;
- struct interface *ifp;
struct connected *c;
struct nbr_connected *nc;
struct listnode *node, *nnode;
struct bgp *bgp;
struct peer *peer;
- bgp = bgp_lookup_by_vrf_id(vrf_id);
-
- s = zclient->ibuf;
- ifp = zebra_interface_state_read(s, vrf_id);
- if (!ifp)
- return 0;
+ bgp = bgp_lookup_by_vrf_id(ifp->vrf_id);
bgp_mac_del_mac_entry(ifp);
if (BGP_DEBUG(zebra, ZEBRA))
- zlog_debug("Rx Intf down VRF %u IF %s", vrf_id, ifp->name);
+ zlog_debug("Rx Intf down VRF %u IF %s", ifp->vrf_id, ifp->name);
if (!bgp)
return 0;
@@ -2707,11 +2700,6 @@ static int bgp_ifp_create(struct interface *ifp)
return 0;
}
-static int bgp_ifp_down(struct interface *ifp)
-{
- return 0;
-}
-
static int bgp_ifp_destroy(struct interface *ifp)
{
return 0;
@@ -2738,7 +2726,6 @@ void bgp_zebra_init(struct thread_master *master, unsigned short instance)
zclient->interface_vrf_update = bgp_interface_vrf_update;
zclient->redistribute_route_add = zebra_read_route;
zclient->redistribute_route_del = zebra_read_route;
- zclient->interface_down = bgp_interface_down;
zclient->nexthop_update = bgp_read_nexthop_update;
zclient->import_check_update = bgp_read_import_check_update;
zclient->fec_update = bgp_read_fec_update;
diff --git a/eigrpd/eigrp_interface.c b/eigrpd/eigrp_interface.c
index 7c0c03f48..9c2ced9ea 100644
--- a/eigrpd/eigrp_interface.c
+++ b/eigrpd/eigrp_interface.c
@@ -184,6 +184,13 @@ static int eigrp_ifp_up(struct interface *ifp)
static int eigrp_ifp_down(struct interface *ifp)
{
+ if (IS_DEBUG_EIGRP(zebra, ZEBRA_INTERFACE))
+ zlog_debug("Zebra: Interface[%s] state change to down.",
+ ifp->name);
+
+ if (ifp->info)
+ eigrp_if_down(ifp->info);
+
return 0;
}
diff --git a/eigrpd/eigrp_zebra.c b/eigrpd/eigrp_zebra.c
index 8fdb279e5..256906824 100644
--- a/eigrpd/eigrp_zebra.c
+++ b/eigrpd/eigrp_zebra.c
@@ -56,7 +56,6 @@
static int eigrp_interface_delete(ZAPI_CALLBACK_ARGS);
static int eigrp_interface_address_add(ZAPI_CALLBACK_ARGS);
static int eigrp_interface_address_delete(ZAPI_CALLBACK_ARGS);
-static int eigrp_interface_state_down(ZAPI_CALLBACK_ARGS);
static int eigrp_zebra_read_route(ZAPI_CALLBACK_ARGS);
@@ -111,7 +110,6 @@ void eigrp_zebra_init(void)
zclient->zebra_connected = eigrp_zebra_connected;
zclient->router_id_update = eigrp_router_id_update_zebra;
zclient->interface_delete = eigrp_interface_delete;
- zclient->interface_down = eigrp_interface_state_down;
zclient->interface_address_add = eigrp_interface_address_add;
zclient->interface_address_delete = eigrp_interface_address_delete;
zclient->redistribute_route_add = eigrp_zebra_read_route;
@@ -228,25 +226,6 @@ static int eigrp_interface_address_delete(ZAPI_CALLBACK_ARGS)
return 0;
}
-static int eigrp_interface_state_down(ZAPI_CALLBACK_ARGS)
-{
- struct interface *ifp;
-
- ifp = zebra_interface_state_read(zclient->ibuf, vrf_id);
-
- if (ifp == NULL)
- return 0;
-
- if (IS_DEBUG_EIGRP(zebra, ZEBRA_INTERFACE))
- zlog_debug("Zebra: Interface[%s] state change to down.",
- ifp->name);
-
- if (ifp->info)
- eigrp_if_down(ifp->info);
-
- return 0;
-}
-
void eigrp_zebra_route_add(struct eigrp *eigrp, struct prefix *p,
struct list *successors, uint32_t distance)
{
diff --git a/isisd/isis_circuit.c b/isisd/isis_circuit.c
index ce3e972e4..153e7ec26 100644
--- a/isisd/isis_circuit.c
+++ b/isisd/isis_circuit.c
@@ -1411,6 +1411,13 @@ static int isis_ifp_up(struct interface *ifp)
static int isis_ifp_down(struct interface *ifp)
{
+ struct isis_circuit *circuit;
+
+ circuit = isis_csm_state_change(IF_DOWN_FROM_Z,
+ circuit_scan_by_ifp(ifp), ifp);
+ if (circuit)
+ SET_FLAG(circuit->flags, ISIS_CIRCUIT_FLAPPED_AFTER_SPF);
+
return 0;
}
diff --git a/isisd/isis_zebra.c b/isisd/isis_zebra.c
index 5309a220a..2299354b1 100644
--- a/isisd/isis_zebra.c
+++ b/isisd/isis_zebra.c
@@ -98,24 +98,6 @@ static int isis_zebra_if_del(ZAPI_CALLBACK_ARGS)
return 0;
}
-static int isis_zebra_if_state_down(ZAPI_CALLBACK_ARGS)
-{
- struct interface *ifp;
- struct isis_circuit *circuit;
-
- ifp = zebra_interface_state_read(zclient->ibuf, vrf_id);
-
- if (ifp == NULL)
- return 0;
-
- circuit = isis_csm_state_change(IF_DOWN_FROM_Z,
- circuit_scan_by_ifp(ifp), ifp);
- if (circuit)
- SET_FLAG(circuit->flags, ISIS_CIRCUIT_FLAPPED_AFTER_SPF);
-
- return 0;
-}
-
static int isis_zebra_if_address_add(ZAPI_CALLBACK_ARGS)
{
struct connected *c;
@@ -358,7 +340,6 @@ void isis_zebra_init(struct thread_master *master)
zclient->zebra_connected = isis_zebra_connected;
zclient->router_id_update = isis_router_id_update_zebra;
zclient->interface_delete = isis_zebra_if_del;
- zclient->interface_down = isis_zebra_if_state_down;
zclient->interface_address_add = isis_zebra_if_address_add;
zclient->interface_address_delete = isis_zebra_if_address_del;
zclient->interface_link_params = isis_zebra_link_params;
diff --git a/ldpd/ldp_zebra.c b/ldpd/ldp_zebra.c
index d3eac6017..37ecc0673 100644
--- a/ldpd/ldp_zebra.c
+++ b/ldpd/ldp_zebra.c
@@ -40,7 +40,6 @@ static void ifc2kaddr(struct interface *, struct connected *,
static int ldp_zebra_send_mpls_labels(int, struct kroute *);
static int ldp_router_id_update(ZAPI_CALLBACK_ARGS);
static int ldp_interface_delete(ZAPI_CALLBACK_ARGS);
-static int ldp_interface_status_change(ZAPI_CALLBACK_ARGS);
static int ldp_interface_address_add(ZAPI_CALLBACK_ARGS);
static int ldp_interface_address_delete(ZAPI_CALLBACK_ARGS);
static int ldp_zebra_read_route(ZAPI_CALLBACK_ARGS);
@@ -329,19 +328,14 @@ ldp_interface_status_change_helper(struct interface *ifp)
return (0);
}
-static int
-ldp_interface_status_change(ZAPI_CALLBACK_ARGS)
-{
- struct interface *ifp;
- /*
- * zebra_interface_state_read() updates interface structure in
- * iflist.
- */
- ifp = zebra_interface_state_read(zclient->ibuf, vrf_id);
- if (ifp == NULL)
- return (0);
+static int ldp_ifp_up(struct interface *ifp)
+{
+ return ldp_interface_status_change_helper(ifp);
+}
+static int ldp_ifp_down(struct interface *ifp)
+{
return ldp_interface_status_change_helper(ifp);
}
@@ -535,16 +529,6 @@ ldp_zebra_connected(struct zclient *zclient)
extern struct zebra_privs_t ldpd_privs;
-static int ldp_ifp_up(struct interface *ifp)
-{
- return ldp_interface_status_change_helper(ifp);
-}
-
-static int ldp_ifp_down(struct interface *ifp)
-{
- return 0;
-}
-
static int ldp_ifp_destroy(struct interface *ifp)
{
return 0;
@@ -564,7 +548,6 @@ ldp_zebra_init(struct thread_master *master)
zclient->zebra_connected = ldp_zebra_connected;
zclient->router_id_update = ldp_router_id_update;
zclient->interface_delete = ldp_interface_delete;
- zclient->interface_down = ldp_interface_status_change;
zclient->interface_address_add = ldp_interface_address_add;
zclient->interface_address_delete = ldp_interface_address_delete;
zclient->redistribute_route_add = ldp_zebra_read_route;
diff --git a/lib/if.c b/lib/if.c
index d4835d136..de9ec46ff 100644
--- a/lib/if.c
+++ b/lib/if.c
@@ -187,6 +187,12 @@ void if_up_via_zapi(struct interface *ifp)
(*ifp_master.up_hook)(ifp);
}
+void if_down_via_zapi(struct interface *ifp)
+{
+ if (ifp_master.down_hook)
+ (*ifp_master.down_hook)(ifp);
+}
+
struct interface *if_create(const char *name, vrf_id_t vrf_id)
{
return if_create_backend(name, IFINDEX_INTERNAL, vrf_id);
diff --git a/lib/if.h b/lib/if.h
index 28c147365..bd8eb0b66 100644
--- a/lib/if.h
+++ b/lib/if.h
@@ -565,6 +565,7 @@ extern void if_zapi_callbacks(int (*create)(struct interface *ifp),
extern void if_new_via_zapi(struct interface *ifp);
extern void if_up_via_zapi(struct interface *ifp);
+extern void if_down_via_zapi(struct interface *ifp);
extern const struct frr_yang_module_info frr_interface_info;
diff --git a/lib/zclient.c b/lib/zclient.c
index a8e5e0290..0540b129b 100644
--- a/lib/zclient.c
+++ b/lib/zclient.c
@@ -1605,6 +1605,19 @@ static void zclient_interface_up(struct zclient *zclient, vrf_id_t vrf_id)
if_up_via_zapi(ifp);
}
+static void zclient_interface_down(struct zclient *zclient, vrf_id_t vrf_id)
+{
+ struct interface *ifp;
+ struct stream *s = zclient->ibuf;
+
+ ifp = zebra_interface_state_read(s, vrf_id);
+
+ if (!ifp)
+ return;
+
+ if_down_via_zapi(ifp);
+}
+
static void link_params_set_value(struct stream *s, struct if_link_params *iflp)
{
@@ -2838,9 +2851,7 @@ static int zclient_read(struct thread *thread)
zclient_interface_up(zclient, vrf_id);
break;
case ZEBRA_INTERFACE_DOWN:
- if (zclient->interface_down)
- (*zclient->interface_down)(command, zclient, length,
- vrf_id);
+ zclient_interface_down(zclient, vrf_id);
break;
case ZEBRA_INTERFACE_VRF_UPDATE:
if (zclient->interface_vrf_update)
diff --git a/lib/zclient.h b/lib/zclient.h
index 60b2ec820..890fa4aae 100644
--- a/lib/zclient.h
+++ b/lib/zclient.h
@@ -241,7 +241,6 @@ struct zclient {
void (*zebra_capabilities)(struct zclient_capabilities *cap);
int (*router_id_update)(ZAPI_CALLBACK_ARGS);
int (*interface_delete)(ZAPI_CALLBACK_ARGS);
- int (*interface_down)(ZAPI_CALLBACK_ARGS);
int (*interface_address_add)(ZAPI_CALLBACK_ARGS);
int (*interface_address_delete)(ZAPI_CALLBACK_ARGS);
int (*interface_link_params)(ZAPI_CALLBACK_ARGS);
diff --git a/nhrpd/nhrp_interface.c b/nhrpd/nhrp_interface.c
index 29e614477..ecf4bd750 100644
--- a/nhrpd/nhrp_interface.c
+++ b/nhrpd/nhrp_interface.c
@@ -334,16 +334,11 @@ int nhrp_ifp_up(struct interface *ifp)
return 0;
}
-int nhrp_interface_down(ZAPI_CALLBACK_ARGS)
+int nhrp_ifp_down(struct interface *ifp)
{
- struct interface *ifp;
-
- ifp = zebra_interface_state_read(zclient->ibuf, vrf_id);
- if (ifp == NULL)
- return 0;
-
debugf(NHRP_DEBUG_IF, "if-down: %s", ifp->name);
nhrp_interface_update(ifp);
+
return 0;
}
@@ -424,11 +419,6 @@ void nhrp_interface_set_source(struct interface *ifp, const char *ifname)
nhrp_interface_update_nbma(ifp);
}
-int nhrp_ifp_down(struct interface *ifp)
-{
- return 0;
-}
-
int nhrp_ifp_destroy(struct interface *ifp)
{
return 0;
diff --git a/nhrpd/nhrp_route.c b/nhrpd/nhrp_route.c
index 1cb99b4ee..84bee5761 100644
--- a/nhrpd/nhrp_route.c
+++ b/nhrpd/nhrp_route.c
@@ -346,7 +346,6 @@ void nhrp_zebra_init(void)
zclient = zclient_new(master, &zclient_options_default);
zclient->zebra_connected = nhrp_zebra_connected;
zclient->interface_delete = nhrp_interface_delete;
- zclient->interface_down = nhrp_interface_down;
zclient->interface_address_add = nhrp_interface_address_add;
zclient->interface_address_delete = nhrp_interface_address_delete;
zclient->redistribute_route_add = nhrp_route_read;
diff --git a/ospf6d/ospf6_interface.c b/ospf6d/ospf6_interface.c
index f931b1848..d4f3f25ac 100644
--- a/ospf6d/ospf6_interface.c
+++ b/ospf6d/ospf6_interface.c
@@ -1962,6 +1962,15 @@ static int ospf6_ifp_up(struct interface *ifp)
static int ospf6_ifp_down(struct interface *ifp)
{
+ if (IS_OSPF6_DEBUG_ZEBRA(RECV))
+ zlog_debug(
+ "Zebra Interface state change: "
+ "%s index %d flags %llx metric %d mtu %d bandwidth %d",
+ ifp->name, ifp->ifindex, (unsigned long long)ifp->flags,
+ ifp->metric, ifp->mtu6, ifp->bandwidth);
+
+ ospf6_interface_state_update(ifp);
+
return 0;
}
diff --git a/ospf6d/ospf6_zebra.c b/ospf6d/ospf6_zebra.c
index c28838f3e..f2b86e136 100644
--- a/ospf6d/ospf6_zebra.c
+++ b/ospf6d/ospf6_zebra.c
@@ -116,25 +116,6 @@ static int ospf6_zebra_if_del(ZAPI_CALLBACK_ARGS)
return 0;
}
-static int ospf6_zebra_if_state_update(ZAPI_CALLBACK_ARGS)
-{
- struct interface *ifp;
-
- ifp = zebra_interface_state_read(zclient->ibuf, vrf_id);
- if (ifp == NULL)
- return 0;
-
- if (IS_OSPF6_DEBUG_ZEBRA(RECV))
- zlog_debug(
- "Zebra Interface state change: "
- "%s index %d flags %llx metric %d mtu %d bandwidth %d",
- ifp->name, ifp->ifindex, (unsigned long long)ifp->flags,
- ifp->metric, ifp->mtu6, ifp->bandwidth);
-
- ospf6_interface_state_update(ifp);
- return 0;
-}
-
static int ospf6_zebra_if_address_update_add(ZAPI_CALLBACK_ARGS)
{
struct connected *c;
@@ -571,7 +552,6 @@ void ospf6_zebra_init(struct thread_master *master)
zclient->zebra_connected = ospf6_zebra_connected;
zclient->router_id_update = ospf6_router_id_update_zebra;
zclient->interface_delete = ospf6_zebra_if_del;
- zclient->interface_down = ospf6_zebra_if_state_update;
zclient->interface_address_add = ospf6_zebra_if_address_update_add;
zclient->interface_address_delete =
ospf6_zebra_if_address_update_delete;
diff --git a/ospfd/ospf_interface.c b/ospfd/ospf_interface.c
index 570624f92..75d6211f8 100644
--- a/ospfd/ospf_interface.c
+++ b/ospfd/ospf_interface.c
@@ -1305,6 +1305,19 @@ static int ospf_ifp_up(struct interface *ifp)
static int ospf_ifp_down(struct interface *ifp)
{
+ struct ospf_interface *oi;
+ struct route_node *node;
+
+ if (IS_DEBUG_OSPF(zebra, ZEBRA_INTERFACE))
+ zlog_debug("Zebra: Interface[%s] state change to down.",
+ ifp->name);
+
+ for (node = route_top(IF_OIFS(ifp)); node; node = route_next(node)) {
+ if ((oi = node->info) == NULL)
+ continue;
+ ospf_if_down(oi);
+ }
+
return 0;
}
diff --git a/ospfd/ospf_zebra.c b/ospfd/ospf_zebra.c
index 16ab10252..dc0501ec6 100644
--- a/ospfd/ospf_zebra.c
+++ b/ospfd/ospf_zebra.c
@@ -126,30 +126,6 @@ static int ospf_interface_delete(ZAPI_CALLBACK_ARGS)
return 0;
}
-static int ospf_interface_state_down(ZAPI_CALLBACK_ARGS)
-{
- struct interface *ifp;
- struct ospf_interface *oi;
- struct route_node *node;
-
- ifp = zebra_interface_state_read(zclient->ibuf, vrf_id);
-
- if (ifp == NULL)
- return 0;
-
- if (IS_DEBUG_OSPF(zebra, ZEBRA_INTERFACE))
- zlog_debug("Zebra: Interface[%s] state change to down.",
- ifp->name);
-
- for (node = route_top(IF_OIFS(ifp)); node; node = route_next(node)) {
- if ((oi = node->info) == NULL)
- continue;
- ospf_if_down(oi);
- }
-
- return 0;
-}
-
static int ospf_interface_address_add(ZAPI_CALLBACK_ARGS)
{
struct connected *c;
@@ -1417,7 +1393,6 @@ void ospf_zebra_init(struct thread_master *master, unsigned short instance)
zclient->zebra_connected = ospf_zebra_connected;
zclient->router_id_update = ospf_router_id_update_zebra;
zclient->interface_delete = ospf_interface_delete;
- zclient->interface_down = ospf_interface_state_down;
zclient->interface_address_add = ospf_interface_address_add;
zclient->interface_address_delete = ospf_interface_address_delete;
zclient->interface_link_params = ospf_interface_link_params;
diff --git a/pbrd/pbr_zebra.c b/pbrd/pbr_zebra.c
index e82bed5ed..eadc39264 100644
--- a/pbrd/pbr_zebra.c
+++ b/pbrd/pbr_zebra.c
@@ -136,12 +136,8 @@ int pbr_ifp_up(struct interface *ifp)
return 0;
}
-static int interface_state_down(ZAPI_CALLBACK_ARGS)
+int pbr_ifp_down(struct interface *ifp)
{
- struct interface *ifp;
-
- ifp = zebra_interface_state_read(zclient->ibuf, vrf_id);
-
DEBUGD(&pbr_dbg_zebra,
"%s: %s is down", __PRETTY_FUNCTION__, ifp->name);
@@ -437,7 +433,6 @@ void pbr_zebra_init(void)
zclient_init(zclient, ZEBRA_ROUTE_PBR, 0, &pbr_privs);
zclient->zebra_connected = zebra_connected;
zclient->interface_delete = interface_delete;
- zclient->interface_down = interface_state_down;
zclient->interface_address_add = interface_address_add;
zclient->interface_address_delete = interface_address_delete;
zclient->route_notify_owner = route_notify_owner;
@@ -567,11 +562,6 @@ void pbr_send_pbr_map(struct pbr_map_sequence *pbrms,
zclient_send_message(zclient);
}
-int pbr_ifp_down(struct interface *ifp)
-{
- return 0;
-}
-
int pbr_ifp_destroy(struct interface *ifp)
{
return 0;
diff --git a/pimd/pim_iface.c b/pimd/pim_iface.c
index 26829b3a3..5ed5abf03 100644
--- a/pimd/pim_iface.c
+++ b/pimd/pim_iface.c
@@ -1639,6 +1639,35 @@ int pim_ifp_up(struct interface *ifp)
int pim_ifp_down(struct interface *ifp)
{
+ if (PIM_DEBUG_ZEBRA) {
+ zlog_debug(
+ "%s: %s index %d(%u) flags %ld metric %d mtu %d operative %d",
+ __PRETTY_FUNCTION__, ifp->name, ifp->ifindex,
+ ifp->vrf_id, (long)ifp->flags, ifp->metric, ifp->mtu,
+ if_is_operative(ifp));
+ }
+
+ if (!if_is_operative(ifp)) {
+ pim_ifchannel_delete_all(ifp);
+ /*
+ pim_if_addr_del_all() suffices for shutting down IGMP,
+ but not for shutting down PIM
+ */
+ pim_if_addr_del_all(ifp);
+
+ /*
+ pim_sock_delete() closes the socket, stops read and timer
+ threads,
+ and kills all neighbors.
+ */
+ if (ifp->info) {
+ pim_sock_delete(ifp, "link down");
+ }
+ }
+
+ if (ifp->info)
+ pim_if_del_vif(ifp);
+
return 0;
}
diff --git a/pimd/pim_zebra.c b/pimd/pim_zebra.c
index 58d906339..128746558 100644
--- a/pimd/pim_zebra.c
+++ b/pimd/pim_zebra.c
@@ -92,50 +92,6 @@ static int pim_zebra_if_del(ZAPI_CALLBACK_ARGS)
return 0;
}
-static int pim_zebra_if_state_down(ZAPI_CALLBACK_ARGS)
-{
- struct interface *ifp;
-
- /*
- zebra api notifies interface up/down events by using the same call
- zebra_interface_state_read below, see comments in lib/zclient.c
- */
- ifp = zebra_interface_state_read(zclient->ibuf, vrf_id);
- if (!ifp)
- return 0;
-
- if (PIM_DEBUG_ZEBRA) {
- zlog_debug(
- "%s: %s index %d(%u) flags %ld metric %d mtu %d operative %d",
- __PRETTY_FUNCTION__, ifp->name, ifp->ifindex, vrf_id,
- (long)ifp->flags, ifp->metric, ifp->mtu,
- if_is_operative(ifp));
- }
-
- if (!if_is_operative(ifp)) {
- pim_ifchannel_delete_all(ifp);
- /*
- pim_if_addr_del_all() suffices for shutting down IGMP,
- but not for shutting down PIM
- */
- pim_if_addr_del_all(ifp);
-
- /*
- pim_sock_delete() closes the socket, stops read and timer
- threads,
- and kills all neighbors.
- */
- if (ifp->info) {
- pim_sock_delete(ifp, "link down");
- }
- }
-
- if (ifp->info)
- pim_if_del_vif(ifp);
-
- return 0;
-}
-
static int pim_zebra_interface_vrf_update(ZAPI_CALLBACK_ARGS)
{
struct interface *ifp;
@@ -655,7 +611,6 @@ void pim_zebra_init(void)
zclient->zebra_connected = pim_zebra_connected;
zclient->router_id_update = pim_router_id_update_zebra;
zclient->interface_delete = pim_zebra_if_del;
- zclient->interface_down = pim_zebra_if_state_down;
zclient->interface_address_add = pim_zebra_if_address_add;
zclient->interface_address_delete = pim_zebra_if_address_del;
zclient->interface_vrf_update = pim_zebra_interface_vrf_update;
diff --git a/ripd/rip_interface.c b/ripd/rip_interface.c
index e654c0912..13b9b874e 100644
--- a/ripd/rip_interface.c
+++ b/ripd/rip_interface.c
@@ -346,20 +346,8 @@ int if_check_address(struct rip *rip, struct in_addr addr)
}
/* Inteface link down message processing. */
-int rip_interface_down(ZAPI_CALLBACK_ARGS)
+static int rip_ifp_down(struct interface *ifp)
{
- struct interface *ifp;
- struct stream *s;
-
- s = zclient->ibuf;
-
- /* zebra_interface_state_read() updates interface structure in
- iflist. */
- ifp = zebra_interface_state_read(s, vrf_id);
-
- if (ifp == NULL)
- return 0;
-
rip_interface_sync(ifp);
rip_if_down(ifp);
@@ -1241,11 +1229,6 @@ static int rip_interface_delete_hook(struct interface *ifp)
return 0;
}
-static int rip_ifp_down(struct interface *ifp)
-{
- return 0;
-}
-
static int rip_ifp_destroy(struct interface *ifp)
{
return 0;
diff --git a/ripd/rip_zebra.c b/ripd/rip_zebra.c
index 0635c15d9..7b57fc79f 100644
--- a/ripd/rip_zebra.c
+++ b/ripd/rip_zebra.c
@@ -241,7 +241,6 @@ void rip_zclient_init(struct thread_master *master)
zclient->interface_delete = rip_interface_delete;
zclient->interface_address_add = rip_interface_address_add;
zclient->interface_address_delete = rip_interface_address_delete;
- zclient->interface_down = rip_interface_down;
zclient->interface_vrf_update = rip_interface_vrf_update;
zclient->redistribute_route_add = rip_zebra_read_route;
zclient->redistribute_route_del = rip_zebra_read_route;
diff --git a/ripngd/ripng_interface.c b/ripngd/ripng_interface.c
index 1f056906c..4f238f179 100644
--- a/ripngd/ripng_interface.c
+++ b/ripngd/ripng_interface.c
@@ -219,19 +219,8 @@ static int ripng_ifp_up(struct interface *ifp)
}
/* Inteface link down message processing. */
-int ripng_interface_down(ZAPI_CALLBACK_ARGS)
+static int ripng_ifp_down(struct interface *ifp)
{
- struct stream *s;
- struct interface *ifp;
-
- /* zebra_interface_state_read() updates interface structure in iflist.
- */
- s = zclient->ibuf;
- ifp = zebra_interface_state_read(s, vrf_id);
-
- if (ifp == NULL)
- return 0;
-
ripng_interface_sync(ifp);
ripng_if_down(ifp);
@@ -975,11 +964,6 @@ static struct cmd_node interface_node = {
INTERFACE_NODE, "%s(config-if)# ", 1 /* VTYSH */
};
-static int ripng_ifp_down(struct interface *ifp)
-{
- return 0;
-}
-
static int ripng_ifp_destroy(struct interface *ifp)
{
return 0;
diff --git a/ripngd/ripng_zebra.c b/ripngd/ripng_zebra.c
index 13d7fc3e4..227777681 100644
--- a/ripngd/ripng_zebra.c
+++ b/ripngd/ripng_zebra.c
@@ -242,7 +242,6 @@ void zebra_init(struct thread_master *master)
zclient_init(zclient, ZEBRA_ROUTE_RIPNG, 0, &ripngd_privs);
zclient->zebra_connected = ripng_zebra_connected;
- zclient->interface_down = ripng_interface_down;
zclient->interface_delete = ripng_interface_delete;
zclient->interface_address_add = ripng_interface_address_add;
zclient->interface_address_delete = ripng_interface_address_delete;
diff --git a/sharpd/sharp_zebra.c b/sharpd/sharp_zebra.c
index 76bfae254..5991b84c6 100644
--- a/sharpd/sharp_zebra.c
+++ b/sharpd/sharp_zebra.c
@@ -96,11 +96,8 @@ static int sharp_ifp_up(struct interface *ifp)
return 0;
}
-static int interface_state_down(ZAPI_CALLBACK_ARGS)
+static int sharp_ifp_down(struct interface *ifp)
{
-
- zebra_interface_state_read(zclient->ibuf, vrf_id);
-
return 0;
}
@@ -371,11 +368,6 @@ static int sharp_nexthop_update(ZAPI_CALLBACK_ARGS)
return 0;
}
-static int sharp_ifp_down(struct interface *ifp)
-{
- return 0;
-}
-
static int sharp_ifp_destroy(struct interface *ifp)
{
return 0;
@@ -395,7 +387,6 @@ void sharp_zebra_init(void)
zclient_init(zclient, ZEBRA_ROUTE_SHARP, 0, &sharp_privs);
zclient->zebra_connected = zebra_connected;
zclient->interface_delete = interface_delete;
- zclient->interface_down = interface_state_down;
zclient->interface_address_add = interface_address_add;
zclient->interface_address_delete = interface_address_delete;
zclient->route_notify_owner = route_notify_owner;
diff --git a/staticd/static_zebra.c b/staticd/static_zebra.c
index 4ba244208..c494cf6cc 100644
--- a/staticd/static_zebra.c
+++ b/staticd/static_zebra.c
@@ -112,14 +112,9 @@ static int static_ifp_up(struct interface *ifp)
return 0;
}
-static int interface_state_down(ZAPI_CALLBACK_ARGS)
+static int static_ifp_down(struct interface *ifp)
{
- struct interface *ifp;
-
- ifp = zebra_interface_state_read(zclient->ibuf, vrf_id);
-
- if (ifp)
- static_ifindex_update(ifp, false);
+ static_ifindex_update(ifp, false);
return 0;
}
@@ -481,11 +476,6 @@ extern void static_zebra_route_add(struct route_node *rn,
zclient, &api);
}
-static int static_ifp_down(struct interface *ifp)
-{
- return 0;
-}
-
static int static_ifp_destroy(struct interface *ifp)
{
return 0;
@@ -504,7 +494,6 @@ void static_zebra_init(void)
zclient->zebra_capabilities = static_zebra_capabilities;
zclient->zebra_connected = zebra_connected;
zclient->interface_delete = interface_delete;
- zclient->interface_down = interface_state_down;
zclient->interface_address_add = interface_address_add;
zclient->interface_address_delete = interface_address_delete;
zclient->route_notify_owner = route_notify_owner;
diff --git a/vrrpd/vrrp_zebra.c b/vrrpd/vrrp_zebra.c
index 3b8be9da1..4678a2333 100644
--- a/vrrpd/vrrp_zebra.c
+++ b/vrrpd/vrrp_zebra.c
@@ -117,21 +117,9 @@ int vrrp_ifp_up(struct interface *ifp)
return 0;
}
-static int vrrp_zebra_if_state_down(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+int vrrp_ifp_down(struct interface *ifp)
{
- struct interface *ifp;
-
- /*
- * zebra api notifies interface up/down events by using the same call
- * zebra_interface_state_read below, see comments in lib/zclient.c
- */
- ifp = zebra_interface_state_read(zclient->ibuf, vrf_id);
-
- if (!ifp)
- return 0;
-
- vrrp_zebra_debug_if_state(ifp, vrf_id, __func__);
+ vrrp_zebra_debug_if_state(ifp, ifp->vrf_id, __func__);
vrrp_if_down(ifp);
@@ -211,11 +199,6 @@ int vrrp_zclient_send_interface_protodown(struct interface *ifp, bool down)
down);
}
-int vrrp_ifp_down(struct interface *ifp)
-{
- return 0;
-}
-
int vrrp_ifp_destroy(struct interface *ifp)
{
return 0;
@@ -232,7 +215,6 @@ void vrrp_zebra_init(void)
zclient->zebra_connected = vrrp_zebra_connected;
zclient->router_id_update = vrrp_router_id_update_zebra;
zclient->interface_delete = vrrp_zebra_if_del;
- zclient->interface_down = vrrp_zebra_if_state_down;
zclient->interface_address_add = vrrp_zebra_if_address_add;
zclient->interface_address_delete = vrrp_zebra_if_address_del;