diff options
author | Donald Sharp <sharpd@nvidia.com> | 2022-06-17 19:47:03 +0200 |
---|---|---|
committer | Donald Sharp <sharpd@nvidia.com> | 2022-06-17 19:47:03 +0200 |
commit | c08f56304b12a9d765d8ec80b9f145c1274fecd7 (patch) | |
tree | ce8379e03eb2b69b745ad2863c610cd06529ad77 /lib/sockunion.c | |
parent | bgpd: Display useful values when using json for missing neighbor state (diff) | |
download | frr-c08f56304b12a9d765d8ec80b9f145c1274fecd7.tar.xz frr-c08f56304b12a9d765d8ec80b9f145c1274fecd7.zip |
lib: Add some extra error messages for when things go wrong
In sockunion.c let's eliminate the silent and unexpected failure
mode to let the end operator figure out something is terribly wrong.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to '')
-rw-r--r-- | lib/sockunion.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/sockunion.c b/lib/sockunion.c index 97b198c01..eff38798c 100644 --- a/lib/sockunion.c +++ b/lib/sockunion.c @@ -525,6 +525,11 @@ union sockunion *sockunion_getsockname(int fd) sockunion_normalise_mapped(su); return su; } + + flog_err( + EC_LIB_SOCKET, + "Unexpected AFI received(%d) for sockunion_getsockname call for fd: %d", + name.sa.sa_family, fd); return NULL; } @@ -561,6 +566,11 @@ union sockunion *sockunion_getpeername(int fd) sockunion_normalise_mapped(su); return su; } + + flog_err( + EC_LIB_SOCKET, + "Unexpected AFI received(%d) for sockunion_getpeername call for fd: %d", + name.sa.sa_family, fd); return NULL; } |