zebra: clean up SA warning in EVPN code

Use asserts rather thank test where the values should definitely
not be NULL.

Signed-off-by: Pat Ruddy <pat@voltanet.io>
This commit is contained in:
Pat Ruddy 2020-08-12 13:01:22 +01:00
parent 707b76d795
commit 2bdd4461c1
3 changed files with 4 additions and 2 deletions

View File

@ -1902,6 +1902,7 @@ int zebra_evpn_add_update_local_mac(struct zebra_vrf *zvrf, zebra_evpn_t *zevpn,
bool inform_dataplane = false; bool inform_dataplane = false;
bool new_static = false; bool new_static = false;
assert(ifp);
/* Check if we need to create or update or it is a NO-OP. */ /* Check if we need to create or update or it is a NO-OP. */
mac = zebra_evpn_mac_lookup(zevpn, macaddr); mac = zebra_evpn_mac_lookup(zevpn, macaddr);
if (!mac) { if (!mac) {

View File

@ -2112,6 +2112,7 @@ void process_neigh_remote_macip_add(zebra_evpn_t *zevpn, struct zebra_vrf *zvrf,
bool is_dup_detect = false; bool is_dup_detect = false;
bool is_router; bool is_router;
assert(mac);
is_router = !!CHECK_FLAG(flags, ZEBRA_MACIP_TYPE_ROUTER_FLAG); is_router = !!CHECK_FLAG(flags, ZEBRA_MACIP_TYPE_ROUTER_FLAG);
/* Check if the remote neighbor itself is unknown or has a /* Check if the remote neighbor itself is unknown or has a
@ -2264,6 +2265,7 @@ int zebra_evpn_neigh_gw_macip_add(struct interface *ifp, zebra_evpn_t *zevpn,
char buf[ETHER_ADDR_STRLEN]; char buf[ETHER_ADDR_STRLEN];
char buf2[INET6_ADDRSTRLEN]; char buf2[INET6_ADDRSTRLEN];
assert(mac);
n = zebra_evpn_neigh_lookup(zevpn, ip); n = zebra_evpn_neigh_lookup(zevpn, ip);
if (!n) { if (!n) {

View File

@ -3963,8 +3963,7 @@ int zebra_vxlan_local_mac_add_update(struct interface *ifp,
struct zebra_vrf *zvrf; struct zebra_vrf *zvrf;
char buf[ETHER_ADDR_STRLEN]; char buf[ETHER_ADDR_STRLEN];
if (ifp == NULL) assert(ifp);
return -1;
/* We are interested in MACs only on ports or (port, VLAN) that /* We are interested in MACs only on ports or (port, VLAN) that
* map to an EVPN. * map to an EVPN.