From 8928a08f657948c5d04807de399b89051ae54d88 Mon Sep 17 00:00:00 2001 From: Renato Westphal Date: Mon, 2 Oct 2017 22:06:03 -0300 Subject: [PATCH] *: eliminate IFINDEX_DELETED in favor of IFINDEX_INTERNAL IFINDEX_DELETED is not necessary anymore as we moved from a global list of interfaces to a list of interfaces per VRF. This reverts commit 84361d615. Signed-off-by: Renato Westphal --- bgpd/bgp_zebra.c | 2 +- isisd/isis_circuit.c | 3 --- isisd/isis_zebra.c | 2 +- ldpd/ldp_zebra.c | 2 +- lib/if.h | 1 - ospf6d/ospf6_zebra.c | 2 +- ospfd/ospf_vty.c | 3 --- ospfd/ospf_zebra.c | 2 +- ripd/rip_interface.c | 5 +---- ripngd/ripng_interface.c | 2 +- 10 files changed, 7 insertions(+), 17 deletions(-) diff --git a/bgpd/bgp_zebra.c b/bgpd/bgp_zebra.c index 9c8f56636c..ae8f2f26d4 100644 --- a/bgpd/bgp_zebra.c +++ b/bgpd/bgp_zebra.c @@ -238,7 +238,7 @@ static int bgp_interface_delete(int command, struct zclient *zclient, bgp_update_interface_nbrs(bgp, ifp, NULL); - ifp->ifindex = IFINDEX_DELETED; + ifp->ifindex = IFINDEX_INTERNAL; return 0; } diff --git a/isisd/isis_circuit.c b/isisd/isis_circuit.c index 761e73aa83..939dc71bee 100644 --- a/isisd/isis_circuit.c +++ b/isisd/isis_circuit.c @@ -941,9 +941,6 @@ int isis_interface_config_write(struct vty *vty) int i; RB_FOREACH (ifp, if_name_head, &vrf->ifaces_by_name) { - if (ifp->ifindex == IFINDEX_DELETED) - continue; - /* IF name */ vty_frame(vty, "interface %s\n", ifp->name); write++; diff --git a/isisd/isis_zebra.c b/isisd/isis_zebra.c index bc81314097..7109bfb110 100644 --- a/isisd/isis_zebra.c +++ b/isisd/isis_zebra.c @@ -128,7 +128,7 @@ static int isis_zebra_if_del(int command, struct zclient *zclient, in case there is configuration info attached to it. */ if_delete_retain(ifp); - ifp->ifindex = IFINDEX_DELETED; + ifp->ifindex = IFINDEX_INTERNAL; return 0; } diff --git a/ldpd/ldp_zebra.c b/ldpd/ldp_zebra.c index 2dda5f57bf..4b3f5b0f99 100644 --- a/ldpd/ldp_zebra.c +++ b/ldpd/ldp_zebra.c @@ -288,7 +288,7 @@ ldp_interface_delete(int command, struct zclient *zclient, zebra_size_t length, /* To support pseudo interface do not free interface structure. */ /* if_delete(ifp); */ - ifp->ifindex = IFINDEX_DELETED; + ifp->ifindex = IFINDEX_INTERNAL; ifp2kif(ifp, &kif); main_imsg_compose_both(IMSG_IFSTATUS, &kif, sizeof(kif)); diff --git a/lib/if.h b/lib/if.h index a8058c9e9e..d4ae8fc429 100644 --- a/lib/if.h +++ b/lib/if.h @@ -217,7 +217,6 @@ struct interface { deleted interfaces). */ ifindex_t ifindex; #define IFINDEX_INTERNAL 0 -#define IFINDEX_DELETED INT_MAX /* Zebra internal interface status */ u_char status; diff --git a/ospf6d/ospf6_zebra.c b/ospf6d/ospf6_zebra.c index 30bb4393c7..14dc6aa30b 100644 --- a/ospf6d/ospf6_zebra.c +++ b/ospf6d/ospf6_zebra.c @@ -126,7 +126,7 @@ static int ospf6_zebra_if_del(int command, struct zclient *zclient, ospf6_interface_if_del (ifp); #endif /*0*/ - ifp->ifindex = IFINDEX_DELETED; + ifp->ifindex = IFINDEX_INTERNAL; return 0; } diff --git a/ospfd/ospf_vty.c b/ospfd/ospf_vty.c index 3c709df384..a755bb7e65 100644 --- a/ospfd/ospf_vty.c +++ b/ospfd/ospf_vty.c @@ -8647,9 +8647,6 @@ static int config_write_interface_one(struct vty *vty, struct ospf *ospf) if (memcmp(ifp->name, "VLINK", 5) == 0) continue; - if (ifp->ifindex == IFINDEX_DELETED) - continue; - vrf = vrf_lookup_by_id(ifp->vrf_id); vty_frame(vty, "!\n"); diff --git a/ospfd/ospf_zebra.c b/ospfd/ospf_zebra.c index 0697c7801f..a171e5f046 100644 --- a/ospfd/ospf_zebra.c +++ b/ospfd/ospf_zebra.c @@ -166,7 +166,7 @@ static int ospf_interface_delete(int command, struct zclient *zclient, if (rn->info) ospf_if_free((struct ospf_interface *)rn->info); - ifp->ifindex = IFINDEX_DELETED; + ifp->ifindex = IFINDEX_INTERNAL; return 0; } diff --git a/ripd/rip_interface.c b/ripd/rip_interface.c index fe72de229f..6fba0512e5 100644 --- a/ripd/rip_interface.c +++ b/ripd/rip_interface.c @@ -471,7 +471,7 @@ int rip_interface_delete(int command, struct zclient *zclient, /* To support pseudo interface do not free interface structure. */ /* if_delete(ifp); */ - ifp->ifindex = IFINDEX_DELETED; + ifp->ifindex = IFINDEX_INTERNAL; return 0; } @@ -1734,9 +1734,6 @@ static int rip_interface_config_write(struct vty *vty) RB_FOREACH (ifp, if_name_head, &vrf->ifaces_by_name) { struct rip_interface *ri; - if (ifp->ifindex == IFINDEX_DELETED) - continue; - ri = ifp->info; /* Do not display the interface if there is no diff --git a/ripngd/ripng_interface.c b/ripngd/ripng_interface.c index aab2b23245..dbee3ce69f 100644 --- a/ripngd/ripng_interface.c +++ b/ripngd/ripng_interface.c @@ -299,7 +299,7 @@ int ripng_interface_delete(int command, struct zclient *zclient, /* To support pseudo interface do not free interface structure. */ /* if_delete(ifp); */ - ifp->ifindex = IFINDEX_DELETED; + ifp->ifindex = IFINDEX_INTERNAL; return 0; } -- 2.39.5