diff options
author | Philipp Maier <pmaier@sysmocom.de> | 2018-08-23 20:18:55 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2018-08-24 10:31:18 +0000 |
commit | b8a91625dd974f596214646da345d9d649f4dae3 (patch) | |
tree | f61f730e64d5c62b873a6bc8da3f0c5f281da31e | |
parent | 73196e77fb28d71f5ab536d4e6265cfcbb169b3d (diff) |
gsmtap_util: make sure SO_REUSEADDR is applied for GSMTAP
When gsmtap adding a new sink it does not supply OSMO_SOCK_F_UDP_REUSEADDR
in order to have SO_REUSEADDR applied. In most cases, the gsmtap sink is
just receiving packets to toss them immediately, so having one of them
is sufficient. However, in other use cases - particularly virt_phy -
we actually want to receve and process GSMTAP messages via multicast
Applying SO_REUSEADDR (like we did before disabling it globally for UDP
in I4a8ffb8d598aca88801a4a0322944d7cdd8d4047 on August 1st) resolves
the issue.
Change-Id: I1399a428467ca12f1564a14eb8ffb294d4f59874
Related: OS#3497
-rw-r--r-- | src/gsmtap_util.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gsmtap_util.c b/src/gsmtap_util.c index b21c690b..385b4672 100644 --- a/src/gsmtap_util.c +++ b/src/gsmtap_util.c @@ -254,7 +254,9 @@ int gsmtap_source_add_sink_fd(int gsmtap_fd) if (osmo_sockaddr_is_local((struct sockaddr *)&ss, ss_len) == 1) { rc = osmo_sock_init_sa((struct sockaddr *)&ss, SOCK_DGRAM, - IPPROTO_UDP, OSMO_SOCK_F_BIND); + IPPROTO_UDP, + OSMO_SOCK_F_BIND | + OSMO_SOCK_F_UDP_REUSEADDR); if (rc >= 0) return rc; } |