Change in libosmocore[master]: Make osmo_sockaddr_str_from_sockaddr() less picky
Attention is currently required from: msuraev, dexter. pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/28995 ) Change subject: Make osmo_sockaddr_str_from_sockaddr() less picky ...................................................................... Patch Set 7: Code-Review-2 (1 comment) File src/sockaddr_str.c: https://gerrit.osmocom.org/c/libosmocore/+/28995/comment/e33a20a3_838eba20 PS7, Line 389: guess = (src->ss_family == AF_UNSPEC) ? osmo_sockaddr_guess_unspec((const struct sockaddr *)src) : src->ss_family; This all looks wrong to me, or I'm missing soemthing. So you have a sockaddr_storage, which has size enough to contain whatever. Let's say it has ss_family=AF_UNSPEC; so you call osmo_sockaddr_guess_unspec() on it. Then, osmo_sockaddr_guess_unspec() calls osmo_sockaddr_str_from_in6_addr() on it, which should convert fine no matter the random contents in the struct, since any possible value is acceptable in there. So you end up handling AD_UNSPEC as AF_INET6, printing random stuff which may not be correct. -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/28995 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: I36f20701663c3c7eae7fedc6551da44800b325bf Gerrit-Change-Number: 28995 Gerrit-PatchSet: 7 Gerrit-Owner: msuraev <msuraev@sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge@osmocom.org> Gerrit-Reviewer: pespin <pespin@sysmocom.de> Gerrit-CC: dexter <pmaier@sysmocom.de> Gerrit-Attention: msuraev <msuraev@sysmocom.de> Gerrit-Attention: dexter <pmaier@sysmocom.de> Gerrit-Comment-Date: Fri, 12 Aug 2022 11:50:31 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
participants (1)
-
pespin