diff options
author | David Gibson <david@gibson.dropbear.id.au> | 2025-04-10 17:16:39 +1000 |
---|---|---|
committer | Stefano Brivio <sbrivio@redhat.com> | 2025-04-10 19:46:13 +0200 |
commit | 695c62396eb3f4627c1114ce444394e3ba34373a (patch) | |
tree | 6727cac8140c8bb3acd44b77285a4563a9387c19 | |
parent | f4b0dd8b06850bacb2da57c8576e3377daa88572 (diff) | |
download | passt-695c62396eb3f4627c1114ce444394e3ba34373a.tar passt-695c62396eb3f4627c1114ce444394e3ba34373a.tar.gz passt-695c62396eb3f4627c1114ce444394e3ba34373a.tar.bz2 passt-695c62396eb3f4627c1114ce444394e3ba34373a.tar.lz passt-695c62396eb3f4627c1114ce444394e3ba34373a.tar.xz passt-695c62396eb3f4627c1114ce444394e3ba34373a.tar.zst passt-695c62396eb3f4627c1114ce444394e3ba34373a.zip |
inany: Improve ASSERT message for bad socket family
inany_from_sockaddr() can only handle sockaddrs of family AF_INET or
AF_INET6 and asserts if given something else. I hit this assertion while
debugging something else, and wanted to see what the bad sockaddr family
was. Now that we have ASSERT_WITH_MSG() its easy to add this information.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
-rw-r--r-- | inany.h | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -252,7 +252,8 @@ static inline void inany_from_sockaddr(union inany_addr *aa, in_port_t *port, *port = ntohs(sa->sa4.sin_port); } else { /* Not valid to call with other address families */ - ASSERT(0); + ASSERT_WITH_MSG(0, "Unexpected sockaddr family: %u", + sa->sa_family); } } |