Attention is currently required from: arehbein.
laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmo-sccp/+/35073?usp=email )
Change subject: port from osmo_stream_*_get_ofd() to osmo_stream_srv_get_fd() ......................................................................
Patch Set 1:
(1 comment)
File src/osmo_ss7_asp.c:
https://gerrit.osmocom.org/c/libosmo-sccp/+/35073/comment/3820fecd_d0282112 PS1, Line 915: return ipa_rx_msg(asp, msg, fd & 0xf);
probably very problematic without a check `if (fd < 0)` ... […]
no, not problematic at all. All we're doing here is choosing the SLS (link selector within a linkset). That's basically a "random" number between 0..15 (hence the 0xF). We're just abusing the property that file descriptors lower 4 bits are presumably "reasonably distributed" so that we get some spread over different SLS.
I would argue fd < 0 can never happen in the first place, as the function is only called in a context where the file dscriptor is long initialized, as we're alreay reading data.
But let's assume the fd would be negative: All we'd do is tale the lower 4 bits of -1 (0xF) and use that as SLS. Nothing wrong with that.