diff options
| author | Donald Sharp <sharpd@nvidia.com> | 2023-01-30 10:06:29 -0500 |
|---|---|---|
| committer | Donald Sharp <sharpd@nvidia.com> | 2023-01-31 15:15:42 -0500 |
| commit | bde30e78cb27fba58ca7107bcb25cc0b2685b826 (patch) | |
| tree | 97dffefafaa55a83ea6c959dcd85050886706519 /lib/ipaddr.h | |
| parent | a98701f0531c54e425ef4ffa5f3f2c67aad2ae17 (diff) | |
lib: Add missing enum's to switch statement
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'lib/ipaddr.h')
| -rw-r--r-- | lib/ipaddr.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/ipaddr.h b/lib/ipaddr.h index 43b3028200..4934a83b4c 100644 --- a/lib/ipaddr.h +++ b/lib/ipaddr.h @@ -70,9 +70,11 @@ static inline int ipaddr_family(const struct ipaddr *ip) return AF_INET; case IPADDR_V6: return AF_INET6; - default: + case IPADDR_NONE: return AF_UNSPEC; } + + assert(!"Reached end of function where we should never hit"); } static inline int str2ipaddr(const char *str, struct ipaddr *ip) @@ -158,9 +160,11 @@ static inline int ipaddr_cmp(const struct ipaddr *a, const struct ipaddr *b) case IPADDR_V6: return memcmp((void *)&a->ipaddr_v6, (void *)&b->ipaddr_v6, sizeof(a->ipaddr_v6)); - default: + case IPADDR_NONE: return 0; } + + assert(!"Reached end of function we should never hit"); } static inline bool ipaddr_is_zero(const struct ipaddr *ip) |
