Change in osmo-bsc[master]: Fix creating MGCP proxy socket if MGW listens on an IPv6 address

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/.

pespin gerrit-no-reply at lists.osmocom.org
Mon Aug 31 18:12:41 UTC 2020


pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bsc/+/19921 )


Change subject: Fix creating MGCP proxy socket if MGW listens on an IPv6 address
......................................................................

Fix creating MGCP proxy socket if MGW listens on an IPv6 address

If for instance "mgw remote-ip ::1" is configured, the MGCP IPA proxy
socket towards the MGW will use ::1 as the destination address, but it
was being created as AF_INET. Let's use AF_UNSPEC instead and let
osmo_sock_init2 decide the best socket type to create.
Moreover, change the default local address from "0.0.0.0" to NULL to
also let osmo_sock_init2 pick an IPv6 address if necessary.

Change-Id: Ide88c7358a38702ef11c84145518794e75870ef8
---
M src/osmo-bsc/osmo_bsc_msc.c
1 file changed, 2 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/21/19921/1

diff --git a/src/osmo-bsc/osmo_bsc_msc.c b/src/osmo-bsc/osmo_bsc_msc.c
index b1bb245..26d2bc8 100644
--- a/src/osmo-bsc/osmo_bsc_msc.c
+++ b/src/osmo-bsc/osmo_bsc_msc.c
@@ -164,7 +164,7 @@
 	else
 		mgw_port = MGCP_CLIENT_REMOTE_PORT_DEFAULT;
 
-	rc = osmo_sock_init2_ofd(&msc->mgcp_ipa.ofd, AF_INET, SOCK_DGRAM, IPPROTO_UDP,
+	rc = osmo_sock_init2_ofd(&msc->mgcp_ipa.ofd, AF_UNSPEC, SOCK_DGRAM, IPPROTO_UDP,
 				 msc->mgcp_ipa.local_addr, msc->mgcp_ipa.local_port,
 				 net->mgw.conf->remote_addr, mgw_port,
 				 OSMO_SOCK_F_BIND | OSMO_SOCK_F_CONNECT);
@@ -256,7 +256,7 @@
 	msc_data->audio_support[4]->hr = 1;
 
 	osmo_fd_setup(&msc_data->mgcp_ipa.ofd, -1, OSMO_FD_READ, &bsc_sccplite_mgcp_proxy_cb, msc_data, 0);
-	msc_data->mgcp_ipa.local_addr = talloc_strdup(msc_data, "0.0.0.0");
+	msc_data->mgcp_ipa.local_addr = NULL; /* = INADDR(6)_ANY */
 	msc_data->mgcp_ipa.local_port = 0; /* dynamic */
 
 	msc_data->nri_ranges = osmo_nri_ranges_alloc(msc_data);

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/19921
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: Ide88c7358a38702ef11c84145518794e75870ef8
Gerrit-Change-Number: 19921
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200831/7db5ea9e/attachment.htm>


More information about the gerrit-log mailing list