Skip to content

Commit

Permalink
Merge pull request #10733 from anlancs/zebra-remove-update
Browse files Browse the repository at this point in the history
zebra: remove ZEBRA_INTERFACE_VRF_UPDATE
  • Loading branch information
rzalamena authored Oct 8, 2023
2 parents 5c0a5aa + 56f141e commit 4a60045
Show file tree
Hide file tree
Showing 17 changed files with 6 additions and 537 deletions.
17 changes: 0 additions & 17 deletions bfdd/ptm_adapter.c
Original file line number Diff line number Diff line change
Expand Up @@ -756,20 +756,6 @@ static int bfd_ifp_destroy(struct interface *ifp)
return 0;
}

static int bfdd_interface_vrf_update(ZAPI_CALLBACK_ARGS)
{
struct interface *ifp;
vrf_id_t nvrfid;

ifp = zebra_interface_vrf_update_read(zclient->ibuf, vrf_id, &nvrfid);
if (ifp == NULL)
return 0;

if_update_to_new_vrf(ifp, nvrfid);

return 0;
}

static void bfdd_sessions_enable_address(struct connected *ifc)
{
struct bfd_session_observer *bso;
Expand Down Expand Up @@ -833,9 +819,6 @@ static zclient_handler *const bfd_handlers[] = {
*/
[ZEBRA_BFD_DEST_REPLAY] = bfdd_replay,

/* Learn about interface VRF. */
[ZEBRA_INTERFACE_VRF_UPDATE] = bfdd_interface_vrf_update,

/* Learn about new addresses being registered. */
[ZEBRA_INTERFACE_ADDRESS_ADD] = bfdd_interface_address_update,
[ZEBRA_INTERFACE_ADDRESS_DELETE] = bfdd_interface_address_update,
Expand Down
61 changes: 0 additions & 61 deletions bgpd/bgp_zebra.c
Original file line number Diff line number Diff line change
Expand Up @@ -477,66 +477,6 @@ static int bgp_interface_nbr_address_delete(ZAPI_CALLBACK_ARGS)
return 0;
}

/* VRF update for an interface. */
static int bgp_interface_vrf_update(ZAPI_CALLBACK_ARGS)
{
struct interface *ifp;
vrf_id_t new_vrf_id;
struct connected *c;
struct nbr_connected *nc;
struct listnode *node, *nnode;
struct bgp *bgp;
struct peer *peer;

ifp = zebra_interface_vrf_update_read(zclient->ibuf, vrf_id,
&new_vrf_id);
if (!ifp)
return 0;

if (BGP_DEBUG(zebra, ZEBRA))
zlog_debug("Rx Intf VRF change VRF %u IF %s NewVRF %u", vrf_id,
ifp->name, new_vrf_id);

bgp = bgp_lookup_by_vrf_id(vrf_id);

if (bgp) {
for (ALL_LIST_ELEMENTS(ifp->connected, node, nnode, c))
bgp_connected_delete(bgp, c);

for (ALL_LIST_ELEMENTS(ifp->nbr_connected, node, nnode, nc))
bgp_nbr_connected_delete(bgp, nc, 1);

/* Fast external-failover */
if (!CHECK_FLAG(bgp->flags, BGP_FLAG_NO_FAST_EXT_FAILOVER)) {
for (ALL_LIST_ELEMENTS(bgp->peer, node, nnode, peer)) {
if ((peer->ttl != BGP_DEFAULT_TTL)
&& (peer->gtsm_hops
!= BGP_GTSM_HOPS_CONNECTED))
continue;

if (ifp == peer->nexthop.ifp)
BGP_EVENT_ADD(peer->connection,
BGP_Stop);
}
}
}

if_update_to_new_vrf(ifp, new_vrf_id);

bgp = bgp_lookup_by_vrf_id(new_vrf_id);
if (!bgp)
return 0;

for (ALL_LIST_ELEMENTS(ifp->connected, node, nnode, c))
bgp_connected_add(bgp, c);

for (ALL_LIST_ELEMENTS(ifp->nbr_connected, node, nnode, nc))
bgp_nbr_connected_add(bgp, nc);

hook_call(bgp_vrf_status_changed, bgp, ifp);
return 0;
}

/* Zebra route add and delete treatment. */
static int zebra_read_route(ZAPI_CALLBACK_ARGS)
{
Expand Down Expand Up @@ -3401,7 +3341,6 @@ static zclient_handler *const bgp_handlers[] = {
[ZEBRA_INTERFACE_ADDRESS_DELETE] = bgp_interface_address_delete,
[ZEBRA_INTERFACE_NBR_ADDRESS_ADD] = bgp_interface_nbr_address_add,
[ZEBRA_INTERFACE_NBR_ADDRESS_DELETE] = bgp_interface_nbr_address_delete,
[ZEBRA_INTERFACE_VRF_UPDATE] = bgp_interface_vrf_update,
[ZEBRA_REDISTRIBUTE_ROUTE_ADD] = zebra_read_route,
[ZEBRA_REDISTRIBUTE_ROUTE_DEL] = zebra_read_route,
[ZEBRA_NEXTHOP_UPDATE] = bgp_read_nexthop_update,
Expand Down
Loading

0 comments on commit 4a60045

Please sign in to comment.