From: anlan_cs Date: Wed, 22 Dec 2021 01:03:36 +0000 (-0500) Subject: zebra: cleanup checking zebra_evpn_mac_add function's return value X-Git-Tag: base_8.2~99^2 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=07361b8fdfb5c0cb96a4760005373632c3b93d66;p=matthieu%2Ffrr.git zebra: cleanup checking zebra_evpn_mac_add function's return value This function is sure to return correct value by "assert", so the checking its return value should be removed. Signed-off-by: anlan_cs --- diff --git a/zebra/zebra_evpn_mac.c b/zebra/zebra_evpn_mac.c index e285c206b8..d3791f3e58 100644 --- a/zebra/zebra_evpn_mac.c +++ b/zebra/zebra_evpn_mac.c @@ -2034,13 +2034,6 @@ int zebra_evpn_mac_remote_macip_add( if (update_mac) { if (!mac) { mac = zebra_evpn_mac_add(zevpn, macaddr); - if (!mac) { - zlog_warn( - "Failed to add MAC %pEA VNI %u Remote VTEP %pI4", - macaddr, zevpn->vni, &vtep_ip); - return -1; - } - zebra_evpn_es_mac_ref(mac, esi); /* Is this MAC created for a MACIP? */ @@ -2182,14 +2175,6 @@ int zebra_evpn_add_update_local_mac(struct zebra_vrf *zvrf, local_inactive ? " local-inactive" : ""); mac = zebra_evpn_mac_add(zevpn, macaddr); - if (!mac) { - flog_err( - EC_ZEBRA_MAC_ADD_FAILED, - "Failed to add MAC %pEA intf %s(%u) VID %u VNI %u", - macaddr, ifp->name, ifp->ifindex, vid, - zevpn->vni); - return -1; - } SET_FLAG(mac->flags, ZEBRA_MAC_LOCAL); es_change = zebra_evpn_local_mac_update_fwd_info(mac, ifp, vid); if (sticky) @@ -2486,15 +2471,8 @@ int zebra_evpn_mac_gw_macip_add(struct interface *ifp, struct zebra_evpn *zevpn, local_ns_id = zvrf->zns->ns_id; mac = zebra_evpn_mac_lookup(zevpn, macaddr); - if (!mac) { + if (!mac) mac = zebra_evpn_mac_add(zevpn, macaddr); - if (!mac) { - flog_err(EC_ZEBRA_MAC_ADD_FAILED, - "Failed to add MAC %pEA intf %s(%u) VID %u", - macaddr, ifp->name, ifp->ifindex, vlan_id); - return -1; - } - } /* Set "local" forwarding info. */ zebra_evpn_mac_clear_fwd_info(mac); diff --git a/zebra/zebra_evpn_neigh.c b/zebra/zebra_evpn_neigh.c index 5fb4e07665..7299391ef6 100644 --- a/zebra/zebra_evpn_neigh.c +++ b/zebra/zebra_evpn_neigh.c @@ -1286,12 +1286,6 @@ int zebra_evpn_local_neigh_update(struct zebra_evpn *zevpn, macaddr, ip, zevpn->vni); zmac = zebra_evpn_mac_add(zevpn, macaddr); - if (!zmac) { - zlog_debug("Failed to add MAC %pEA VNI %u", macaddr, - zevpn->vni); - return -1; - } - zebra_evpn_mac_clear_fwd_info(zmac); memset(&zmac->flags, 0, sizeof(uint32_t)); SET_FLAG(zmac->flags, ZEBRA_MAC_AUTO);