Attention is currently required from: osmith.
pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/35232?usp=email )
Change subject: socket: Reimplement osmo_sock_init2_multiaddr() ......................................................................
Patch Set 2:
(3 comments)
File src/core/socket.c:
https://gerrit.osmocom.org/c/libosmocore/+/35232/comment/9eb46716_ec2e3ae6 PS2, Line 922: IPv4 or IPv6
IPv4-only or IPv6-only
Ack
https://gerrit.osmocom.org/c/libosmocore/+/35232/comment/a8a8901b_f66bfa2a PS2, Line 933: * Both are checked here through "or" here to account for "bind flag set,
what do you mean with 'checked through "or" here', did you mean to write it like this? […]
I'm talking about OSMO_SOCK_F_BIND or OSMO_SOCK_F_CONNECT flags here. If for instance OSMO_SOCK_F_BIND is not set, rem_has_v6addr needs checking, and if OSMO_SOCK_F_CONNECT is not set, loc_has_v6addr needs checking. If both are set, both need checking.
https://gerrit.osmocom.org/c/libosmocore/+/35232/comment/0e84c9ea_7790b3dc PS2, Line 945: (loc_has_v4addr != rem_has_v4addr || loc_has_v6addr != rem_has_v6addr)) {
with multiple return paths I mean, to potentially make it more readable
I thought about it, but in the end writing it this way is the easiest way of writing it, instead of writing lots of cases. I think the comment already hints it. My point is that no matter how you write it, it's going to need some thinking when reading it.