udp/gsmtap multicast is broken osmo-bts-virtual and virtphy
Unfortunately libosmocore change I4a8ffb8d598aca88801a4a0322944d7cdd8d4047 introduced than SO_REUSEADDR should be disabled when IPPROTO_UDP is used. Under normal conditions this makes sense and is also necessary to detect when two processes try to use the same port but for multicast situations like we have them with osmo-bts-virtual, virtphy and gsmtap in general this becomes a problem.
- Status changed from New to In Progress
- % Done changed from 0 to 90
socket.c has now an additional flag (OSMO_SOCK_F_UDP_REUSEADDR) that the user can pass in order to restore the old behavior. Since we do not have much applications that use multicast I think this is a good compromise. Unfortunately it was not possible to set SO_REUSEADDR after calling the osmo_sock... API. This is because the the function would exit with an error. SO_REUSEADDR must be set before the bind(). Also using a flag looks cleaner to me than to modify the socket parameters by hand after the api-call.
https://gerrit.osmocom.org/#/c/libosmocore/+/10587 socket: add flag to enforce SO_REUSEADDR on UDP sockets
https://gerrit.osmocom.org/#/c/libosmocore/+/10588 gsmtap_util: make sure SO_REUSEADDR is applied for GSMTAP
https://gerrit.osmocom.org/#/c/osmo-bts/+/10589 osmo_mcast_sock: make sure SO_REUSEADDR is applied
https://gerrit.osmocom.org/#/c/osmocom-bb/+/10590 osmo_mcast_sock: make sure SO_REUSEADDR is applied