]> git.puffer.fish Git - mirror/frr.git/commitdiff
zebra: clean up SA warning in EVPN code 6883/head
authorPat Ruddy <pat@voltanet.io>
Wed, 12 Aug 2020 12:01:22 +0000 (13:01 +0100)
committerPat Ruddy <pat@voltanet.io>
Wed, 12 Aug 2020 17:03:21 +0000 (18:03 +0100)
Use asserts rather thank test where the values should definitely
not be NULL.

Signed-off-by: Pat Ruddy <pat@voltanet.io>
zebra/zebra_evpn_mac.c
zebra/zebra_evpn_neigh.c
zebra/zebra_vxlan.c

index a74fdd2243fcd8dd5813c674ae719716a2152939..b9cc02a2762e57c9013d1f4c193f2cf725878142 100644 (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 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) {
index 58430b8ece1164dba125a49461d05723e8e392e1..492052b1b24d3eb9c68a4df10afa7139a38d7a41 100644 (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_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) {
index c27be4743e977798d27c0c455cf7716094e235ec..13a58bc34a52c155f9dcf8c0e0cb593770486ce7 100644 (file)
@@ -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.