bool sync)
{
char ipbuf[INET6_ADDRSTRLEN];
+ char mac_buf[MAC_BUF_SIZE];
uint32_t tmp_seq;
const char *n_type;
if (seq < tmp_seq) {
/* if the mac was never advertised to bgp we must accept
* whatever sequence number bgp sends
- * XXX - check with Vivek
*/
- if (CHECK_FLAG(mac->flags, ZEBRA_MAC_LOCAL)
- && !zebra_evpn_mac_is_ready_for_bgp(mac->flags)) {
- if (IS_ZEBRA_DEBUG_EVPN_MH_MAC
- || IS_ZEBRA_DEBUG_VXLAN) {
- char mac_buf[MAC_BUF_SIZE];
-
+ if (zebra_vxlan_accept_bgp_seq()) {
+ if (IS_ZEBRA_DEBUG_EVPN_MH_MAC ||
+ IS_ZEBRA_DEBUG_VXLAN) {
zlog_debug(
"%s-macip accept vni %u %s-mac %pEA%s%s lower seq %u f %s",
sync ? "sync" : "rem", zevpn->vni,
- n_type,
- &mac->macaddr,
+ n_type, &mac->macaddr,
ipa_len ? " IP " : "",
ipa_len ? ipaddr2str(ipaddr, ipbuf,
sizeof(ipbuf))
}
if (IS_ZEBRA_DEBUG_EVPN_MH_MAC || IS_ZEBRA_DEBUG_VXLAN) {
- char mac_buf[MAC_BUF_SIZE];
-
zlog_debug(
"%s-macip ignore vni %u %s-mac %pEA%s%s as existing has higher seq %u f %s",
sync ? "sync" : "rem", zevpn->vni, n_type,
zebra_evpn_zebra_mac_flag_dump(
mac, mac_buf, sizeof(mac_buf)));
}
+
return false;
}
if (seq < tmp_seq) {
/* if the neigh was never advertised to bgp we must accept
* whatever sequence number bgp sends
- * XXX - check with Vivek
*/
- if (CHECK_FLAG(n->flags, ZEBRA_NEIGH_LOCAL)
- && !zebra_evpn_neigh_is_ready_for_bgp(n)) {
+ if (zebra_vxlan_accept_bgp_seq()) {
if (IS_ZEBRA_DEBUG_EVPN_MH_NEIGH
|| IS_ZEBRA_DEBUG_VXLAN)
zlog_debug(
return ret;
}
+DEFPY_HIDDEN (evpn_accept_bgp_seq,
+ evpn_accept_bgp_seq_cmd,
+ "evpn accept-bgp-seq",
+ "EVPN\n"
+ "Accept all sequence numbers from BGP\n")
+{
+ zebra_vxlan_set_accept_bgp_seq(true);
+ return CMD_SUCCESS;
+}
+
+DEFPY_HIDDEN (no_evpn_accept_bgp_seq,
+ no_evpn_accept_bgp_seq_cmd,
+ "no evpn accept-bgp-seq",
+ NO_STR
+ "EVPN\n"
+ "Accept all sequence numbers from BGP\n")
+{
+ zebra_vxlan_set_accept_bgp_seq(false);
+ return CMD_SUCCESS;
+}
+
/* Static ip route configuration write function. */
static int zebra_ip_config(struct vty *vty)
{
zebra_pbr_config_write(vty);
+ if (!zebra_vxlan_accept_bgp_seq())
+ vty_out(vty, "no evpn accept-bgp-seq\n");
+
/* Include nexthop-group config */
if (!zebra_nhg_kernel_nexthops_enabled())
vty_out(vty, "no zebra nexthop kernel enable\n");
install_element(VIEW_NODE, &show_evpn_neigh_vni_dad_cmd);
install_element(VIEW_NODE, &show_evpn_neigh_vni_all_dad_cmd);
install_element(ENABLE_NODE, &clear_evpn_dup_addr_cmd);
+ install_element(CONFIG_NODE, &evpn_accept_bgp_seq_cmd);
+ install_element(CONFIG_NODE, &no_evpn_accept_bgp_seq_cmd);
install_element(VIEW_NODE, &show_neigh_cmd);
const char *reason),
(rmac, zl3vni, delete, reason));
+/* config knobs */
+static bool accept_bgp_seq = true;
+
/* static function declarations */
static void zevpn_print_neigh_hash_all_evpn(struct hash_bucket *bucket,
void **args);
return;
}
+/* Config knob for accepting lower sequence numbers */
+void zebra_vxlan_set_accept_bgp_seq(bool set)
+{
+ accept_bgp_seq = set;
+}
+
+bool zebra_vxlan_accept_bgp_seq(void)
+{
+ return accept_bgp_seq;
+}
+
/* Cleanup BGP EVPN configuration upon client disconnect */
extern void zebra_evpn_init(void)
{
struct ethaddr *macaddr,
vlanid_t vid);
+extern void zebra_vxlan_set_accept_bgp_seq(bool set);
+extern bool zebra_vxlan_accept_bgp_seq(void);
+
#ifdef __cplusplus
}
#endif