bool flags_present = false;
struct zebra_vrf *zvrf = NULL;
struct timeval detect_start_time = {0, 0};
+ char timebuf[MONOTIME_STRLEN];
zvrf = zebra_vrf_get_evpn();
if (!zvrf)
if (CHECK_FLAG(n->flags, ZEBRA_NEIGH_DUPLICATE)) {
vty_out(vty, " Duplicate, detected at %s",
- time_to_string(n->dad_dup_detect_time));
+ time_to_string(n->dad_dup_detect_time,
+ timebuf));
} else if (n->dad_count) {
monotime_since(&n->detect_start_time,
&detect_start_time);
if (detect_start_time.tv_sec <= zvrf->dad_time) {
- char *buf = time_to_string(
- n->detect_start_time.tv_sec);
- char tmp_buf[30];
-
- strlcpy(tmp_buf, buf, sizeof(tmp_buf));
+ time_to_string(n->detect_start_time.tv_sec,
+ timebuf);
vty_out(vty,
" Duplicate detection started at %s, detection count %u\n",
- tmp_buf, n->dad_count);
+ timebuf, n->dad_count);
}
}
} else {
char buf2[INET6_ADDRSTRLEN];
struct zebra_vrf *zvrf;
struct timeval detect_start_time = {0, 0};
+ char timebuf[MONOTIME_STRLEN];
zvrf = zebra_vrf_get_evpn();
if (!zvrf)
if (CHECK_FLAG(mac->flags, ZEBRA_MAC_DUPLICATE)) {
vty_out(vty, " Duplicate, detected at %s",
- time_to_string(mac->dad_dup_detect_time));
+ time_to_string(mac->dad_dup_detect_time,
+ timebuf));
} else if (mac->dad_count) {
monotime_since(&mac->detect_start_time,
&detect_start_time);
if (detect_start_time.tv_sec <= zvrf->dad_time) {
- char *buf = time_to_string(
- mac->detect_start_time.tv_sec);
- char tmp_buf[30];
-
- strlcpy(tmp_buf, buf, sizeof(tmp_buf));
+ time_to_string(mac->detect_start_time.tv_sec,
+ timebuf);
vty_out(vty,
" Duplicate detection started at %s, detection count %u\n",
- tmp_buf, mac->dad_count);
+ timebuf, mac->dad_count);
}
}
zvni->advertise_svi_macip = 0;
zvni->advertise_subnet = 0;
- zvni_neigh_del_all(zvni, 0, 0,
+ zvni_neigh_del_all(zvni, 1, 0,
DEL_REMOTE_NEIGH | DEL_REMOTE_NEIGH_FROM_VTEP);
- zvni_mac_del_all(zvni, 0, 0,
+ zvni_mac_del_all(zvni, 1, 0,
DEL_REMOTE_MAC | DEL_REMOTE_MAC_FROM_VTEP);
- zvni_vtep_del_all(zvni, 0);
+ zvni_vtep_del_all(zvni, 1);
}
/* Cleanup EVPN configuration of a specific VRF */
static void zebra_evpn_vrf_cfg_cleanup(struct zebra_vrf *zvrf)
{
+ zebra_l3vni_t *zl3vni = NULL;
+
zvrf->advertise_all_vni = 0;
zvrf->advertise_gw_macip = 0;
zvrf->advertise_svi_macip = 0;
zvrf->vxlan_flood_ctrl = VXLAN_FLOOD_HEAD_END_REPL;
hash_iterate(zvrf->vni_table, zvni_evpn_cfg_cleanup, NULL);
+
+ if (zvrf->l3vni)
+ zl3vni = zl3vni_lookup(zvrf->l3vni);
+ if (zl3vni) {
+ /* delete and uninstall all rmacs */
+ hash_iterate(zl3vni->rmac_table, zl3vni_del_rmac_hash_entry,
+ zl3vni);
+ /* delete and uninstall all next-hops */
+ hash_iterate(zl3vni->nh_table, zl3vni_del_nh_hash_entry,
+ zl3vni);
+ }
}
/* Cleanup BGP EVPN configuration upon client disconnect */