Open pdepaulis opened 1 year ago
seems SO_BINDTODEVICE
only works on Linux so need to make sure it doesn't break Windows or macOS etc.
Also, maybe make it optional and only enable it if some option is set?
@seven1240 et. al. I'm trying to figure out where Sofia transport options go so I can add one as you suggested in your previous comment.
I now added a tp_params tag tpp_socket_bind_ifc
(Linux only), that is used in the tport_xyz_init_primary()
via TPTAG_SOCKET_BIND_IFC to optionally apply this (default is zero (0) so N/A by default).
So, basically, to eliminate any risk for most users, as this is written, there is no change in socket-binding behavior. One can then change the default parameter value for tpp_socket_bind_ifc to one (1) if need be. In the future this behavior could be controlled via same in mod_sofia and passed in nua_create()
, but that hasn't yet been implemented.
Address an issue seen in openWRT 22 (kernel 5.10) whereas the transport socket would not properly bind to an interface, almost at random, in a multi-homed system with a failover SIP profile. This caused the Sofia failover profile to bind to the primary interface, and thus the failover to still attempting to use the primary interface on a failover. By forcing the socket to bind to the interface explicitly (SO_BINDTODEVICE), the proper interface binding is achieved. Resolves #218