Change in osmocom-bb[master]: osmo_mcast_sock: make sure SO_REUSEADDR is applied

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Fri Aug 24 06:58:25 UTC 2018


Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10590 )

Change subject: osmo_mcast_sock: make sure SO_REUSEADDR is applied
......................................................................

osmo_mcast_sock: make sure SO_REUSEADDR is applied

virtphy uses UDP multicast to communicate with its osmo-bts-virtual
counterpart. At the momemnt SO_REUSEADDR is not applied for those
multicast connections because OSMO_SOCK_F_UDP_REUSEADDR is not set. This
makes prevents the proper function of UDP multicast.

- Make sure OSMO_SOCK_F_UDP_REUSEADDR is set

Change-Id: Ia1014ac5e0522e77178249cdc6398dec2168bffe
Depends: libosmocore I1399a428467ca12f1564a14eb8ffb294d4f59874
Related: OS#3497
---
M src/host/virt_phy/src/shared/osmo_mcast_sock.c
1 file changed, 3 insertions(+), 2 deletions(-)

Approvals:
  Jenkins Builder: Verified
  Harald Welte: Looks good to me, approved



diff --git a/src/host/virt_phy/src/shared/osmo_mcast_sock.c b/src/host/virt_phy/src/shared/osmo_mcast_sock.c
index b52e005..9a713fc 100644
--- a/src/host/virt_phy/src/shared/osmo_mcast_sock.c
+++ b/src/host/virt_phy/src/shared/osmo_mcast_sock.c
@@ -17,7 +17,7 @@
 			    uint16_t tx_mcast_port, bool loopback)
 {
 	int rc;
-	unsigned int flags = OSMO_SOCK_F_CONNECT;
+	unsigned int flags = OSMO_SOCK_F_CONNECT | OSMO_SOCK_F_UDP_REUSEADDR;
 
 	if (!loopback)
 		flags |= OSMO_SOCK_F_NO_MCAST_LOOP;
@@ -41,6 +41,7 @@
 			    void *osmo_fd_data)
 {
 	int rc;
+	unsigned int flags = OSMO_SOCK_F_BIND | OSMO_SOCK_F_NO_MCAST_ALL | OSMO_SOCK_F_UDP_REUSEADDR;
 
 	ofd->cb = fd_rx_cb;
 	ofd->when = BSC_FD_READ;
@@ -48,7 +49,7 @@
 
 	/* Create mcast client socket */
 	rc = osmo_sock_init_ofd(ofd, AF_INET, SOCK_DGRAM, IPPROTO_UDP,
-				NULL, mcast_port, OSMO_SOCK_F_BIND|OSMO_SOCK_F_NO_MCAST_ALL);
+				NULL, mcast_port, flags);
 	if (rc < 0) {
 		perror("Could not create mcast client socket");
 		return rc;

-- 
To view, visit https://gerrit.osmocom.org/10590
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ia1014ac5e0522e77178249cdc6398dec2168bffe
Gerrit-Change-Number: 10590
Gerrit-PatchSet: 2
Gerrit-Owner: dexter <pmaier at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder (1000002)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20180824/f1bc3a39/attachment.htm>


More information about the gerrit-log mailing list