Skip to content

Commit 4b8d708

Browse files
committed
zebra: Start EVPN neighbor hold timer only when interface is operative
- Fix issue where mh_peer_sync flag was missing on EVPN MH neighbor entries after networking service restart. Earlier the hold timer for the ES_PEER_ACTIVE flag was unconditionally started when a sync neighbor was deleted. which removes the sync flag. - Added more debugs Ticket: #3863954 Signed-off-by: Rajesh Varatharaj <[email protected]
1 parent d22414d commit 4b8d708

1 file changed

Lines changed: 34 additions & 0 deletions

File tree

zebra/zebra_evpn_neigh.c

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -601,6 +601,40 @@ void zebra_evpn_sync_neigh_del(struct zebra_neigh *n)
601601
zlog_debug("sync-neigh del vni %u ip %pIA mac %pEA f 0x%x",
602602
n->zevpn->vni, &n->ip, &n->emac, n->flags);
603603

604+
if (CHECK_FLAG(n->flags, ZEBRA_NEIGH_ES_PEER_ACTIVE)) {
605+
struct zebra_ns *zns = NULL;
606+
struct interface *ifp = NULL;
607+
608+
if (n->zevpn && n->zevpn->vxlan_if && n->zevpn->vxlan_if->vrf) {
609+
struct zebra_vrf *zvrf = n->zevpn->vxlan_if->vrf->info;
610+
if (zvrf)
611+
zns = zvrf->zns;
612+
}
613+
614+
if (zns)
615+
ifp = if_lookup_by_index_per_ns(zns, n->ifindex);
616+
617+
/* Only start the hold timer if the local interface is operative.
618+
If the interface is down, ES_PEER_ACTIVE will stay until
619+
the interface comes up and BGP provides a new update.*/
620+
621+
if (ifp && if_is_operative(ifp)) {
622+
zebra_evpn_neigh_start_hold_timer(n);
623+
} else {
624+
if (IS_ZEBRA_DEBUG_EVPN_MH_NEIGH) {
625+
char if_name_buf[64] = "unknown";
626+
if (ifp)
627+
strlcpy(if_name_buf, ifp->name, sizeof(if_name_buf));
628+
else if (n->ifindex != 0)
629+
snprintf(if_name_buf, sizeof(if_name_buf), "ifindex %d",
630+
n->ifindex);
631+
632+
zlog_debug("sync-neigh vni %u ip %pIA DEL: ifp %s (idx %d) is not operative, not starting hold_timer for ES_PEER_ACTIVE flag 0x%x",
633+
n->zevpn->vni, &n->ip, if_name_buf, n->ifindex, n->flags);
634+
}
635+
}
636+
}
637+
604638
old_n_static = zebra_evpn_neigh_is_static(n);
605639
UNSET_FLAG(n->flags, ZEBRA_NEIGH_ES_PEER_PROXY);
606640
if (CHECK_FLAG(n->flags, ZEBRA_NEIGH_ES_PEER_ACTIVE))

0 commit comments

Comments
 (0)