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>
This commit is contained in:
Donald Sharp 2022-06-17 13:47:03 -04:00
parent 1e592331cb
commit c08f56304b

View File

@ -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;
}