summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPat Ruddy <pat@voltanet.io>2020-08-12 13:01:22 +0100
committerPat Ruddy <pat@voltanet.io>2020-08-12 18:03:21 +0100
commit2bdd4461c1edf81d3a94be9c41d3326bc9f4112c (patch)
treed5c462f30ba89eb13546837b7d24a6727e6aa6b2
parent707b76d79555dc2c5e130c6f2dc79827a54c112c (diff)
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>
-rw-r--r--zebra/zebra_evpn_mac.c1
-rw-r--r--zebra/zebra_evpn_neigh.c2
-rw-r--r--zebra/zebra_vxlan.c3
3 files changed, 4 insertions, 2 deletions
diff --git a/zebra/zebra_evpn_mac.c b/zebra/zebra_evpn_mac.c
index a74fdd2243..b9cc02a276 100644
--- a/zebra/zebra_evpn_mac.c
+++ b/zebra/zebra_evpn_mac.c
@@ -1902,6 +1902,7 @@ int zebra_evpn_add_update_local_mac(struct zebra_vrf *zvrf, zebra_evpn_t *zevpn,
bool inform_dataplane = false;
bool new_static = false;
+ assert(ifp);
/* Check if we need to create or update or it is a NO-OP. */
mac = zebra_evpn_mac_lookup(zevpn, macaddr);
if (!mac) {
diff --git a/zebra/zebra_evpn_neigh.c b/zebra/zebra_evpn_neigh.c
index 58430b8ece..492052b1b2 100644
--- a/zebra/zebra_evpn_neigh.c
+++ b/zebra/zebra_evpn_neigh.c
@@ -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_router;
+ assert(mac);
is_router = !!CHECK_FLAG(flags, ZEBRA_MACIP_TYPE_ROUTER_FLAG);
/* 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 buf2[INET6_ADDRSTRLEN];
+ assert(mac);
n = zebra_evpn_neigh_lookup(zevpn, ip);
if (!n) {
diff --git a/zebra/zebra_vxlan.c b/zebra/zebra_vxlan.c
index c27be4743e..13a58bc34a 100644
--- a/zebra/zebra_vxlan.c
+++ b/zebra/zebra_vxlan.c
@@ -3963,8 +3963,7 @@ int zebra_vxlan_local_mac_add_update(struct interface *ifp,
struct zebra_vrf *zvrf;
char buf[ETHER_ADDR_STRLEN];
- if (ifp == NULL)
- return -1;
+ assert(ifp);
/* We are interested in MACs only on ports or (port, VLAN) that
* map to an EVPN.