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/.
laforge gerrit-no-reply at lists.osmocom.orglaforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/19936 ) Change subject: Fail on invalid IP addresses passed to IPACC MDCX ...................................................................... Fail on invalid IP addresses passed to IPACC MDCX IPACC protocol supports only IPv4 addresses, so make sure if an IPv6 address (or whatever malformed address) is caught is not sent without noticing. Prior to this patch, faulty addresses would be sent over the wire as 255.255.255.255 (-1 returned from inet_addr()). Change-Id: Iee84e8b40cdede1cacd8e8a9e26dda0d85383ec8 --- M src/osmo-bsc/lchan_rtp_fsm.c 1 file changed, 8 insertions(+), 2 deletions(-) Approvals: Jenkins Builder: Verified fixeria: Looks good to me, but someone else must approve laforge: Looks good to me, approved diff --git a/src/osmo-bsc/lchan_rtp_fsm.c b/src/osmo-bsc/lchan_rtp_fsm.c index 1fe5452..1dd31b1 100644 --- a/src/osmo-bsc/lchan_rtp_fsm.c +++ b/src/osmo-bsc/lchan_rtp_fsm.c @@ -330,6 +330,7 @@ int rc; struct gsm_lchan *lchan = lchan_rtp_fi_lchan(fi); const struct mgcp_conn_peer *mgw_rtp; + struct in_addr sin; if (lchan->release.requested) { lchan_rtp_fail("Release requested while activating"); @@ -344,8 +345,13 @@ return; } - /* Other RTP settings were already setup in lchan_rtp_fsm_wait_ipacc_crcx_ack_onenter() */ - lchan->abis_ip.connect_ip = ntohl(inet_addr(mgw_rtp->addr)); + /* Other RTP settings were already set up in lchan_rtp_fsm_wait_ipacc_crcx_ack_onenter() */ + if (inet_pton(AF_INET, mgw_rtp->addr, &sin) != 1) { + /* Only IPv4 addresses are supported in IPACC */ + lchan_rtp_fail("Invalid remote IPv4 address %s", mgw_rtp->addr); + return; + } + lchan->abis_ip.connect_ip = ntohl(sin.s_addr); lchan->abis_ip.connect_port = mgw_rtp->port; /* send-recv */ -- To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/19936 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Change-Id: Iee84e8b40cdede1cacd8e8a9e26dda0d85383ec8 Gerrit-Change-Number: 19936 Gerrit-PatchSet: 3 Gerrit-Owner: pespin <pespin at sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy at sysmocom.de> Gerrit-Reviewer: laforge <laforge at osmocom.org> Gerrit-MessageType: merged -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200902/add0d101/attachment.htm>