]> git.proxmox.com Git - mirror_frr.git/commitdiff
lib: Fix possible usage of uninited data
authorDonald Sharp <sharpd@nvidia.com>
Thu, 17 Feb 2022 19:07:57 +0000 (14:07 -0500)
committerDonald Sharp <sharpd@nvidia.com>
Tue, 22 Feb 2022 16:02:15 +0000 (11:02 -0500)
assert when if_lookup_address is passed with
a family that is not AF_INET or AF_INET6 as
that we are dead in the water and this is a
dev escape

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
lib/if.c

index a2918b6d748d7c0422236c521a603e8ce782ed77..83fa85ecc1eedf509cc3bd491862fa77c17fd1bb 100644 (file)
--- a/lib/if.c
+++ b/lib/if.c
@@ -490,7 +490,8 @@ struct connected *if_lookup_address(const void *matchaddr, int family,
                addr.family = AF_INET6;
                addr.u.prefix6 = *((struct in6_addr *)matchaddr);
                addr.prefixlen = IPV6_MAX_BITLEN;
-       }
+       } else
+               assert(!"Attempted lookup of family not supported");
 
        match = NULL;