Merge pull request #10790 from anlancs/zebra-adjust-flag

zebra: minor changes on "zebra_evpn_mac_gw_macip_add" function
This commit is contained in:
Donald Sharp 2022-03-16 16:25:24 -04:00 committed by GitHub
commit 60cd8d3b14
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 18 deletions

View File

@ -442,10 +442,8 @@ int zebra_evpn_gw_macip_add(struct interface *ifp, struct zebra_evpn *zevpn,
vxl = &zif->l2info.vxl; vxl = &zif->l2info.vxl;
if (zebra_evpn_mac_gw_macip_add(ifp, zevpn, ip, &mac, macaddr, zebra_evpn_mac_gw_macip_add(ifp, zevpn, ip, &mac, macaddr,
vxl->access_vlan, true) vxl->access_vlan, true);
!= 0)
return -1;
return zebra_evpn_neigh_gw_macip_add(ifp, zevpn, ip, mac); return zebra_evpn_neigh_gw_macip_add(ifp, zevpn, ip, mac);
} }

View File

@ -2464,11 +2464,12 @@ int zebra_evpn_del_local_mac(struct zebra_evpn *zevpn, struct zebra_mac *mac,
return 0; return 0;
} }
int zebra_evpn_mac_gw_macip_add(struct interface *ifp, struct zebra_evpn *zevpn, void zebra_evpn_mac_gw_macip_add(struct interface *ifp,
const struct ipaddr *ip, struct zebra_evpn *zevpn,
struct zebra_mac **macp, const struct ipaddr *ip,
const struct ethaddr *macaddr, vlanid_t vlan_id, struct zebra_mac **macp,
bool def_gw) const struct ethaddr *macaddr,
vlanid_t vlan_id, bool def_gw)
{ {
struct zebra_mac *mac; struct zebra_mac *mac;
ns_id_t local_ns_id = NS_DEFAULT; ns_id_t local_ns_id = NS_DEFAULT;
@ -2488,13 +2489,13 @@ int zebra_evpn_mac_gw_macip_add(struct interface *ifp, struct zebra_evpn *zevpn,
SET_FLAG(mac->flags, ZEBRA_MAC_AUTO); SET_FLAG(mac->flags, ZEBRA_MAC_AUTO);
if (def_gw) if (def_gw)
SET_FLAG(mac->flags, ZEBRA_MAC_DEF_GW); SET_FLAG(mac->flags, ZEBRA_MAC_DEF_GW);
else
SET_FLAG(mac->flags, ZEBRA_MAC_SVI);
mac->fwd_info.local.ifindex = ifp->ifindex; mac->fwd_info.local.ifindex = ifp->ifindex;
mac->fwd_info.local.ns_id = local_ns_id; mac->fwd_info.local.ns_id = local_ns_id;
mac->fwd_info.local.vid = vlan_id; mac->fwd_info.local.vid = vlan_id;
*macp = mac; *macp = mac;
return 0;
} }
void zebra_evpn_mac_svi_del(struct interface *ifp, struct zebra_evpn *zevpn) void zebra_evpn_mac_svi_del(struct interface *ifp, struct zebra_evpn *zevpn)
@ -2549,8 +2550,6 @@ void zebra_evpn_mac_svi_add(struct interface *ifp, struct zebra_evpn *zevpn)
mac = NULL; mac = NULL;
zebra_evpn_mac_gw_macip_add(ifp, zevpn, NULL, &mac, &macaddr, 0, false); zebra_evpn_mac_gw_macip_add(ifp, zevpn, NULL, &mac, &macaddr, 0, false);
if (mac)
SET_FLAG(mac->flags, ZEBRA_MAC_SVI);
new_bgp_ready = zebra_evpn_mac_is_ready_for_bgp(mac->flags); new_bgp_ready = zebra_evpn_mac_is_ready_for_bgp(mac->flags);
zebra_evpn_mac_send_add_del_to_client(mac, old_bgp_ready, zebra_evpn_mac_send_add_del_to_client(mac, old_bgp_ready,

View File

@ -278,11 +278,12 @@ int zebra_evpn_add_update_local_mac(struct zebra_vrf *zvrf,
bool dp_static, struct zebra_mac *mac); bool dp_static, struct zebra_mac *mac);
int zebra_evpn_del_local_mac(struct zebra_evpn *zevpn, struct zebra_mac *mac, int zebra_evpn_del_local_mac(struct zebra_evpn *zevpn, struct zebra_mac *mac,
bool clear_static); bool clear_static);
int zebra_evpn_mac_gw_macip_add(struct interface *ifp, struct zebra_evpn *zevpn, void zebra_evpn_mac_gw_macip_add(struct interface *ifp,
const struct ipaddr *ip, struct zebra_evpn *zevpn,
struct zebra_mac **macp, const struct ipaddr *ip,
const struct ethaddr *macaddr, vlanid_t vlan_id, struct zebra_mac **macp,
bool def_gw); const struct ethaddr *macaddr,
vlanid_t vlan_id, bool def_gw);
void zebra_evpn_mac_svi_add(struct interface *ifp, struct zebra_evpn *zevpn); void zebra_evpn_mac_svi_add(struct interface *ifp, struct zebra_evpn *zevpn);
void zebra_evpn_mac_svi_del(struct interface *ifp, struct zebra_evpn *zevpn); void zebra_evpn_mac_svi_del(struct interface *ifp, struct zebra_evpn *zevpn);
void zebra_evpn_mac_ifp_del(struct interface *ifp); void zebra_evpn_mac_ifp_del(struct interface *ifp);