Attention is currently required from: neels. pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/27085 )
Change subject: follow-up to osmo_sockaddr_from/to_octets() ......................................................................
Patch Set 1:
(1 comment)
File src/socket.c:
https://gerrit.osmocom.org/c/libosmocore/+/27085/comment/04321114_283f779e PS1, Line 1779: os->u.sa.sa_family = AF_INET; This should have been kept as os->u.sin.sin_family, since here you already know you are using the struct sockaddr_in of the union.
In the case above which I asked you change, it's more conceptually correct to check the generic struct sockaddr (os->u.sa) field instead of the struct sockaddr_in one (os->u.sin), since you still don't know at that point whether the osmo_sockaddr is from type sockaddr_in.
In practice of course it doesn't matter since the os->u.sa.sa_family and os->u.sin.sin_family field point to same place in memory, but conceptually it makes sense to do it the way I say. Otherwise it's like accessing a subclass field without knowing whether the abstract class/interface is actually an instance of that subclass.