pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-mgw/+/39180?usp=email )
Change subject: mgcp-cli: Fix filling in wrong local IP address of SDP Origin o=
......................................................................
mgcp-cli: Fix filling in wrong local IP address of SDP Origin o=
If user (VTY) configured the local IP address to use for MGCP, and that
IP address was not the one selected by kernel routing table lookup, the
IP address filled in the MGCP message would be wrong, not matching the
one sending the MGCP message.
Change-Id: I35624db853dc1f0fee85503105960613f70473c6
---
M src/libosmo-mgcp-client/mgcp_client.c
1 file changed, 34 insertions(+), 7 deletions(-)
Approvals:
Jenkins Builder: Verified
fixeria: Looks good to me, approved
laforge: Looks good to me, but someone else must approve
diff --git a/src/libosmo-mgcp-client/mgcp_client.c b/src/libosmo-mgcp-client/mgcp_client.c
index 1c89e69..8a7c1f6 100644
--- a/src/libosmo-mgcp-client/mgcp_client.c
+++ b/src/libosmo-mgcp-client/mgcp_client.c
@@ -1320,6 +1320,36 @@
#undef MSGB_PRINTF_OR_RET
}
+/* Helper function to obtain local IP address used in MGCP towards MGW,
+ * in string format, to fill the SDP "Origin" ("o=") field.
+ * return 0 on success, negative on error.
+ */
+static int get_mgcp_local_addr(const struct mgcp_client *mgcp, char *local_ip, size_t local_ip_len)
+{
+ int fd;
+
+ /* Try to get the socket local IP address if available: */
+ if (mgcp->iofd && ((fd = osmo_iofd_get_fd(mgcp->iofd)) >= 0)) {
+ if (osmo_sock_get_local_ip(fd, local_ip, local_ip_len) == 0)
+ return 0;
+ /* else: continue below */
+ }
+
+ /* If MGCP local address was explicitly specified in config, use it: */
+ if (mgcp->actual.local_addr) {
+ osmo_strlcpy(local_ip, mgcp->actual.local_addr, local_ip_len);
+ return 0;
+ }
+
+ /* Guess our local address based on system routing towards MGW: */
+ OSMO_ASSERT(local_ip_len >= INET6_ADDRSTRLEN);
+ if (osmo_sock_local_ip(local_ip, mgcp->actual.remote_addr) == 0)
+ return 0;
+
+ LOGPMGW(mgcp, LOGL_ERROR, "Could not determine local IP-Address!\n");
+ return -EINVAL;
+}
+
/* Helper function for mgcp_msg_gen(): Add SDP information to MGCP message */
static int add_sdp(struct msgb *msg, struct mgcp_msg *mgcp_msg, struct mgcp_client *mgcp)
{
@@ -1329,6 +1359,7 @@
const char *codec;
unsigned int pt;
uint16_t audio_port;
+ int rc;
#define MSGB_PRINTF_OR_RET(FMT, ARGS...) do { \
if (msgb_printf(msg, FMT, ##ARGS) != 0) { \
@@ -1344,13 +1375,9 @@
MSGB_PRINTF_OR_RET("v=0\r\n");
/* Determine local IP-Address */
- if (mgcp->actual.local_addr) {
- OSMO_STRLCPY_ARRAY(local_ip, mgcp->actual.local_addr);
- } else if (osmo_sock_local_ip(local_ip, mgcp->actual.remote_addr) < 0) {
- LOGPMGW(mgcp, LOGL_ERROR,
- "Could not determine local IP-Address!\n");
- return -EINVAL;
- }
+ rc = get_mgcp_local_addr(mgcp, local_ip, sizeof(local_ip));
+ if (rc < 0)
+ return rc;
local_ip_family = osmo_ip_str_type(local_ip);
if (local_ip_family == AF_UNSPEC)
return -EINVAL;
--
To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/39180?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Change-Id: I35624db853dc1f0fee85503105960613f70473c6
Gerrit-Change-Number: 39180
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Attention is currently required from: fixeria.
pespin has posted comments on this change by fixeria. ( https://gerrit.osmocom.org/c/libosmo-gprs/+/39187?usp=email )
Change subject: rlcmac: fix EGPRS BEP Link Quality Measurements Type 2
......................................................................
Patch Set 2: Code-Review+1
--
To view, visit https://gerrit.osmocom.org/c/libosmo-gprs/+/39187?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: libosmo-gprs
Gerrit-Branch: master
Gerrit-Change-Id: Iac4de18ef25386f774bb409201b7a7996d1c8824
Gerrit-Change-Number: 39187
Gerrit-PatchSet: 2
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Comment-Date: Fri, 20 Dec 2024 19:40:33 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Attention is currently required from: pespin.
fixeria has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/osmo-mgw/+/39181?usp=email )
Change subject: mgw: Drop own MGCP extension 'noanswer'
......................................................................
Patch Set 1: Code-Review+2
--
To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/39181?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Change-Id: Ica2d3d54cda41e0c6416913ab056843a0cd80c17
Gerrit-Change-Number: 39181
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Fri, 20 Dec 2024 19:37:11 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Attention is currently required from: pespin.
fixeria has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/osmo-mgw/+/39180?usp=email )
Change subject: mgcp-cli: Fix filling in wrong local IP address of SDP Origin o=
......................................................................
Patch Set 1: Code-Review+2
--
To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/39180?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Change-Id: I35624db853dc1f0fee85503105960613f70473c6
Gerrit-Change-Number: 39180
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Fri, 20 Dec 2024 19:36:38 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Attention is currently required from: fixeria.
Hello Jenkins Builder,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/libosmo-gprs/+/39187?usp=email
to look at the new patch set (#2).
The following approvals got outdated and were removed:
Verified-1 by Jenkins Builder
Change subject: rlcmac: fix EGPRS BEP Link Quality Measurements Type 2
......................................................................
rlcmac: fix EGPRS BEP Link Quality Measurements Type 2
This IE is defined in 3GPP TS 44.060 Table 12.5a.2.1. Each presence
bit indicates presence of the next two entries, not one.
This patch does affect the output of csn1_ts_44_060_test, though it
does not fix decoding because it's caused by an unrelated problem.
Related: osmo-pcu.git I061ac16df5e6413266de08884f791f0264791192
Change-Id: Iac4de18ef25386f774bb409201b7a7996d1c8824
---
M src/rlcmac/csn1_ts_44_060.c
M tests/rlcmac/csn1_ts_44_060_test.err
2 files changed, 8 insertions(+), 8 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-gprs refs/changes/87/39187/2
--
To view, visit https://gerrit.osmocom.org/c/libosmo-gprs/+/39187?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: libosmo-gprs
Gerrit-Branch: master
Gerrit-Change-Id: Iac4de18ef25386f774bb409201b7a7996d1c8824
Gerrit-Change-Number: 39187
Gerrit-PatchSet: 2
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>