lists.osmocom.org
Sign In Sign Up
Manage this list Sign In Sign Up

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview

gerrit-log

Thread Start a new thread
Download
Threads by month
  • ----- 2026 -----
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2025 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2024 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2023 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2022 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
gerrit-log@lists.osmocom.org

October 2022

  • 2 participants
  • 2331 discussions
Change in libosmocore[master]: msgb: dont return a length when msgb->lXh is NULL
by dexter 04 Oct '22

04 Oct '22
dexter has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/29591 ) Change subject: msgb: dont return a length when msgb->lXh is NULL ...................................................................... msgb: dont return a length when msgb->lXh is NULL When any of l1h, l2h, l2h or l4h is set to NULL (which is the default for newly allocated message buffers). Then the msgb_lXhlen() functions will return the value of msgb->tail. This is not logical. When the msgb->lXh pointers are not used then a mgsb_lXhlen() should return 0 and not a very high random number. Change-Id: I1795c559f190713ebbabfbabf3453ab77da46a49 Related: OS#5645 --- M include/osmocom/core/msgb.h 1 file changed, 8 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/91/29591/1 diff --git a/include/osmocom/core/msgb.h b/include/osmocom/core/msgb.h index 117fcb0..8535e04 100644 --- a/include/osmocom/core/msgb.h +++ b/include/osmocom/core/msgb.h @@ -144,6 +144,8 @@ */ static inline unsigned int msgb_l1len(const struct msgb *msgb) { + if (!msgb->l1h) + return 0; return msgb->tail - (uint8_t *)msgb_l1(msgb); } @@ -156,6 +158,8 @@ */ static inline unsigned int msgb_l2len(const struct msgb *msgb) { + if (!msgb->l2h) + return 0; return msgb->tail - (uint8_t *)msgb_l2(msgb); } @@ -168,6 +172,8 @@ */ static inline unsigned int msgb_l3len(const struct msgb *msgb) { + if (!msgb->l3h) + return 0; return msgb->tail - (uint8_t *)msgb_l3(msgb); } @@ -180,6 +186,8 @@ */ static inline unsigned int msgb_l4len(const struct msgb *msgb) { + if (!msgb->l4h) + return 0; return msgb->tail - (uint8_t *)msgb_sms(msgb); } -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/29591 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: I1795c559f190713ebbabfbabf3453ab77da46a49 Gerrit-Change-Number: 29591 Gerrit-PatchSet: 1 Gerrit-Owner: dexter <pmaier(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
Change in osmo-bsc[master]: vty: 'hopping arfcn add': succeed if adding arfcn already in set
by pespin 04 Oct '22

04 Oct '22
Attention is currently required from: osmith, neels, fixeria. pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/29551 ) Change subject: vty: 'hopping arfcn add': succeed if adding arfcn already in set ...................................................................... Patch Set 1: (1 comment) Patchset: PS1: ping. This needs pushing forward. -- To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/29551 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Change-Id: Ia4e70d20d48a28c46a21dd10358577e5c798744c Gerrit-Change-Number: 29551 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-CC: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Attention: osmith <osmith(a)sysmocom.de> Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Comment-Date: Tue, 04 Oct 2022 12:47:15 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Gerrit-MessageType: comment
1 0
0 0
Change in osmo-mgw[master]: Get rid of separate rtp_port field
by pespin 04 Oct '22

04 Oct '22
Attention is currently required from: pespin. Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/osmo-mgw/+/29589 to look at the new patch set (#3). Change subject: Get rid of separate rtp_port field ...................................................................... Get rid of separate rtp_port field Let's use the port part of the struct mgcp_rtp_end->addr field instead of keeping it separate. This makes it easier passing around and using/checking the RTP remote address + port, and avoids confusion having to check stuff outside of the address, with its port part potentially unset. Change-Id: I294eb5d85fae79bf62d36eb9e818426e187d442c --- M include/osmocom/mgcp/mgcp.h M include/osmocom/mgcp/mgcp_network.h M src/libosmo-mgcp/mgcp_conn.c M src/libosmo-mgcp/mgcp_iuup.c M src/libosmo-mgcp/mgcp_network.c M src/libosmo-mgcp/mgcp_osmux.c M src/libosmo-mgcp/mgcp_protocol.c M src/libosmo-mgcp/mgcp_sdp.c M tests/mgcp/mgcp_test.c 9 files changed, 50 insertions(+), 70 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/89/29589/3 -- To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/29589 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Change-Id: I294eb5d85fae79bf62d36eb9e818426e187d442c Gerrit-Change-Number: 29589 Gerrit-PatchSet: 3 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: newpatchset
1 0
0 0
Change in osmo-mgw[master]: Get rid of separate rtp_port field
by pespin 04 Oct '22

04 Oct '22
pespin has uploaded a new patch set (#2). ( https://gerrit.osmocom.org/c/osmo-mgw/+/29589 ) Change subject: Get rid of separate rtp_port field ...................................................................... Get rid of separate rtp_port field Let's use the port part of the struct mgcp_rtp_end->addr field instead of keeping it separate. This makes it easier passing around and using/checking the RTP remote address + port, and avoids confusion having to check stuff outside of the address, with its port part potentially unset. Change-Id: I294eb5d85fae79bf62d36eb9e818426e187d442c --- M include/osmocom/mgcp/mgcp.h M include/osmocom/mgcp/mgcp_network.h M src/libosmo-mgcp/mgcp_conn.c M src/libosmo-mgcp/mgcp_iuup.c M src/libosmo-mgcp/mgcp_network.c M src/libosmo-mgcp/mgcp_osmux.c M src/libosmo-mgcp/mgcp_protocol.c M src/libosmo-mgcp/mgcp_sdp.c M tests/mgcp/mgcp_test.c 9 files changed, 50 insertions(+), 70 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/89/29589/2 -- To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/29589 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Change-Id: I294eb5d85fae79bf62d36eb9e818426e187d442c Gerrit-Change-Number: 29589 Gerrit-PatchSet: 2 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-CC: Jenkins Builder Gerrit-MessageType: newpatchset
1 0
0 0
Change in osmo-mgw[master]: osmux: Use available API to check if remote end is known
by pespin 04 Oct '22

04 Oct '22
pespin has uploaded a new patch set (#2). ( https://gerrit.osmocom.org/c/osmo-mgw/+/29590 ) Change subject: osmux: Use available API to check if remote end is known ...................................................................... osmux: Use available API to check if remote end is known Since recently the port is guaranteed to be placed at CRCX/MDCX in the sockaddr, hence we can check it using the API instead of checking manually only for the address part. In osmux_send_dummy() we actually fix a bug where an in_addr was being compared against a struct sockaddr. Change-Id: I736e7f4c51e577d8eb0b96bc776f984f928b6d27 --- M src/libosmo-mgcp/mgcp_osmux.c 1 file changed, 2 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/90/29590/2 -- To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/29590 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Change-Id: I736e7f4c51e577d8eb0b96bc776f984f928b6d27 Gerrit-Change-Number: 29590 Gerrit-PatchSet: 2 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-CC: Jenkins Builder Gerrit-MessageType: newpatchset
1 0
0 0
Change in osmo-mgw[master]: WIP: Get rid of separate rtp_port field
by Jenkins Builder 04 Oct '22

04 Oct '22
Jenkins Builder has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-mgw/+/29589 ) Change subject: WIP: Get rid of separate rtp_port field ...................................................................... Patch Set 1: (1 comment) File src/libosmo-mgcp/mgcp_osmux.c: Robot Comment from checkpatch (run ID jenkins-gerrit-osmo-mgw-lint-554): https://gerrit.osmocom.org/c/osmo-mgw/+/29589/comment/a15d30d2_adf32b0c PS1, Line 655: return mgcp_udp_send(osmux_fd.fd, &conn->end.addr, (char*)osmuxh, buf_len); "(foo*)" should be "(foo *)" -- To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/29589 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Change-Id: I294eb5d85fae79bf62d36eb9e818426e187d442c Gerrit-Change-Number: 29589 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-CC: Jenkins Builder Gerrit-Comment-Date: Tue, 04 Oct 2022 12:43:46 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Gerrit-MessageType: comment
1 0
0 0
Change in osmo-mgw[master]: osmux: Use available API to check if remote end is known
by pespin 04 Oct '22

04 Oct '22
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-mgw/+/29590 ) Change subject: osmux: Use available API to check if remote end is known ...................................................................... osmux: Use available API to check if remote end is known Since recently the port is guaranteed to be placed at CRCX/MDCX in the sockaddr, hence we can check it using the API instead of checking manually only for the address part. In osmux_send_dummy() we actually fix a bug where an in_addr was being compared against a struct sockaddr. Change-Id: I736e7f4c51e577d8eb0b96bc776f984f928b6d27 --- M src/libosmo-mgcp/mgcp_osmux.c 1 file changed, 2 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/90/29590/1 diff --git a/src/libosmo-mgcp/mgcp_osmux.c b/src/libosmo-mgcp/mgcp_osmux.c index b5a2c57..cd8881f 100644 --- a/src/libosmo-mgcp/mgcp_osmux.c +++ b/src/libosmo-mgcp/mgcp_osmux.c @@ -504,7 +504,6 @@ * overlapping RTP SSRC traveling to the BTSes behind the BSC, * similarly, for flows traveling to the MSC. */ - struct in6_addr addr_unset = {}; static const uint32_t rtp_ssrc_winlen = UINT32_MAX / (OSMUX_CID_MAX + 1); uint16_t osmux_dummy = endp->trunk->cfg->osmux_dummy; @@ -517,10 +516,7 @@ } /* Wait until we have the connection information from MDCX */ - if (memcmp(&conn->end.addr, &addr_unset, - conn->end.addr.u.sa.sa_family == AF_INET6 ? - sizeof(struct in6_addr) : - sizeof(struct in_addr)) == 0) { + if (!mgcp_rtp_end_remote_addr_available(&conn->end)) { LOGPCONN(conn->conn, DOSMUX, LOGL_INFO, "Osmux remote address/port still unknown\n"); return -1; @@ -622,7 +618,6 @@ char ipbuf[INET6_ADDRSTRLEN]; struct osmux_hdr *osmuxh; int buf_len; - struct in_addr addr_unset = {}; /*! The dummy packet will not be sent via the actual OSMUX connection, * instead it is sent out of band to port where the remote OSMUX @@ -634,7 +629,7 @@ * approach is simple though. */ /* Wait until we have the connection information from MDCX */ - if (memcmp(&conn->end.addr, &addr_unset, sizeof(addr_unset)) == 0) + if (!mgcp_rtp_end_remote_addr_available(&conn->end)) return 0; if (endp_osmux_state_check(endp, conn, true) < 0) -- To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/29590 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Change-Id: I736e7f4c51e577d8eb0b96bc776f984f928b6d27 Gerrit-Change-Number: 29590 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
Change in osmo-mgw[master]: WIP: Get rid of separate rtp_port field
by pespin 04 Oct '22

04 Oct '22
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-mgw/+/29589 ) Change subject: WIP: Get rid of separate rtp_port field ...................................................................... WIP: Get rid of separate rtp_port field Let's use the port part of the struct mgcp_rtp_end->addr field instead of keeping it separate. This makes it easier passing around and using/checking the RTP remote address + port, and avoids confusion having to check stuff outside of the address, with its port part potentially unset. Change-Id: I294eb5d85fae79bf62d36eb9e818426e187d442c --- M include/osmocom/mgcp/mgcp.h M include/osmocom/mgcp/mgcp_network.h M src/libosmo-mgcp/mgcp_conn.c M src/libosmo-mgcp/mgcp_iuup.c M src/libosmo-mgcp/mgcp_network.c M src/libosmo-mgcp/mgcp_osmux.c M src/libosmo-mgcp/mgcp_protocol.c M src/libosmo-mgcp/mgcp_sdp.c M tests/mgcp/mgcp_test.c 9 files changed, 50 insertions(+), 70 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/89/29589/1 diff --git a/include/osmocom/mgcp/mgcp.h b/include/osmocom/mgcp/mgcp.h index a4d4e6f..4c541cb 100644 --- a/include/osmocom/mgcp/mgcp.h +++ b/include/osmocom/mgcp/mgcp.h @@ -208,4 +208,4 @@ int mgcp_create_bind(const char *source_addr, struct osmo_fd *fd, int port, uint8_t dscp, uint8_t prio); -int mgcp_udp_send(int fd, struct osmo_sockaddr *addr, int port, const char *buf, int len); +int mgcp_udp_send(int fd, const struct osmo_sockaddr *addr, const char *buf, int len); diff --git a/include/osmocom/mgcp/mgcp_network.h b/include/osmocom/mgcp/mgcp_network.h index 854c92d..349ff94 100644 --- a/include/osmocom/mgcp/mgcp_network.h +++ b/include/osmocom/mgcp/mgcp_network.h @@ -93,7 +93,7 @@ struct osmo_sockaddr addr; /* in network byte order */ - int rtp_port, rtcp_port; + int rtcp_port; /* currently selected audio codec */ struct mgcp_rtp_codec *codec; diff --git a/src/libosmo-mgcp/mgcp_conn.c b/src/libosmo-mgcp/mgcp_conn.c index cc309a3..08c9301 100644 --- a/src/libosmo-mgcp/mgcp_conn.c +++ b/src/libosmo-mgcp/mgcp_conn.c @@ -105,7 +105,8 @@ end->rtp.fd = -1; end->rtcp.fd = -1; - end->rtp_port = end->rtcp_port = 0; + memset(&end->addr, 0, sizeof(end->addr)); + end->rtcp_port = 0; talloc_free(end->fmtp_extra); end->fmtp_extra = NULL; @@ -368,7 +369,7 @@ conn->name, conn->id, osmo_sockaddr_ntop(&conn->u.rtp.end.addr.u.sa, ipbuf), - ntohs(conn->u.rtp.end.rtp_port), + osmo_sockaddr_port(&conn->u.rtp.end.addr.u.sa), ntohs(conn->u.rtp.end.rtcp_port)); break; diff --git a/src/libosmo-mgcp/mgcp_iuup.c b/src/libosmo-mgcp/mgcp_iuup.c index 48e4ce7..90021f3 100644 --- a/src/libosmo-mgcp/mgcp_iuup.c +++ b/src/libosmo-mgcp/mgcp_iuup.c @@ -489,7 +489,7 @@ "rtp_port:%u rtcp_port:%u\n", dest_name, osmo_sockaddr_ntop(&rtp_end->addr.u.sa, ipbuf), - ntohs(rtp_end->rtp_port), ntohs(rtp_end->rtcp_port) + osmo_sockaddr_port(&rtp_end->addr.u.sa), ntohs(rtp_end->rtcp_port) ); return 0; } @@ -505,14 +505,13 @@ LOGPENDP(endp, DRTP, LOGL_DEBUG, "process/send IuUP to %s %s rtp_port:%u rtcp_port:%u\n", dest_name, osmo_sockaddr_ntop(&rtp_end->addr.u.sa, ipbuf), - ntohs(rtp_end->rtp_port), ntohs(rtp_end->rtcp_port)); + osmo_sockaddr_port(&rtp_end->addr.u.sa), ntohs(rtp_end->rtcp_port)); /* Forward a copy of the RTP data to a debug ip/port */ forward_data_tap(rtp_end->rtp.fd, &conn_src->tap_out, msg); - len = mgcp_udp_send(rtp_end->rtp.fd, &rtp_end->addr, rtp_end->rtp_port, - (char *)hdr, buflen); + len = mgcp_udp_send(rtp_end->rtp.fd, &rtp_end->addr, (char *)hdr, buflen); if (len <= 0) return len; @@ -617,9 +616,8 @@ force_output_enabled = true; /* Fill in the peer address so that we can send Init-ACK back: */ prev_rem_addr = conn_rtp_src->end.addr; - prev_rem_rtp_port = conn_rtp_src->end.rtp_port; + prev_rem_rtp_port = osmo_sockaddr_port(&conn_rtp_src->end.addr.u.sa); conn_rtp_src->end.addr = *mc->from_addr; - conn_rtp_src->end.rtp_port = htons(osmo_sockaddr_port(&mc->from_addr->u.sa)); } rc = _conn_iuup_rtp_pl_up(conn_rtp_src, msg); @@ -627,7 +625,7 @@ if (force_output_enabled) { conn_rtp_src->end.output_enabled = prev_output_enabled; conn_rtp_src->end.addr = prev_rem_addr; - conn_rtp_src->end.rtp_port = prev_rem_rtp_port; + osmo_sockaddr_set_port(&conn_rtp_src->end.addr.u.sa, prev_rem_rtp_port); } return rc; diff --git a/src/libosmo-mgcp/mgcp_network.c b/src/libosmo-mgcp/mgcp_network.c index 86a6330..401bb09 100644 --- a/src/libosmo-mgcp/mgcp_network.c +++ b/src/libosmo-mgcp/mgcp_network.c @@ -74,7 +74,8 @@ bool mgcp_rtp_end_remote_addr_available(const struct mgcp_rtp_end *rtp_end) { - return rtp_end->rtp_port && (osmo_sockaddr_is_any(&rtp_end->addr) == 0); + return (osmo_sockaddr_port(&rtp_end->addr.u.sa) != 0) && + (osmo_sockaddr_is_any(&rtp_end->addr) == 0); } /*! Determine the local rtp bind IP-address. @@ -870,14 +871,14 @@ * the same as the remote port where we transmit outgoing RTP traffic * to (set by MDCX). We use this to check the origin of the data for * plausibility. */ - if (ntohs(conn->end.rtp_port) != osmo_sockaddr_port(&addr->u.sa) && + if (osmo_sockaddr_port(&conn->end.addr.u.sa) != osmo_sockaddr_port(&addr->u.sa) && ntohs(conn->end.rtcp_port) != osmo_sockaddr_port(&addr->u.sa)) { LOGPCONN(conn->conn, DRTP, LOGL_ERROR, "data from wrong source port: %d, ", osmo_sockaddr_port(&addr->u.sa)); LOGPC(DRTP, LOGL_ERROR, "expected: %d for RTP or %d for RTCP\n", - ntohs(conn->end.rtp_port), ntohs(conn->end.rtcp_port)); + osmo_sockaddr_port(&conn->end.addr.u.sa), ntohs(conn->end.rtcp_port)); LOGPCONN(conn->conn, DRTP, LOGL_ERROR, "packet tossed\n"); return -1; } @@ -891,27 +892,28 @@ { char ipbuf[INET6_ADDRSTRLEN]; bool ip_is_any = osmo_sockaddr_is_any(&conn->end.addr) != 0; + uint16_t port = osmo_sockaddr_port(&conn->end.addr.u.sa); /* Note: it is legal to create a connection but never setting a port * and IP-address for outgoing data. */ - if (ip_is_any && conn->end.rtp_port == 0) { + if (ip_is_any && port == 0) { LOGPCONN(conn->conn, DRTP, LOGL_DEBUG, "destination IP-address and rtp port is not (yet) known (%s:%u)\n", - osmo_sockaddr_ntop(&conn->end.addr.u.sa, ipbuf), conn->end.rtp_port); + osmo_sockaddr_ntop(&conn->end.addr.u.sa, ipbuf), port); return -1; } if (ip_is_any) { LOGPCONN(conn->conn, DRTP, LOGL_ERROR, "destination IP-address is invalid (%s:%u)\n", - osmo_sockaddr_ntop(&conn->end.addr.u.sa, ipbuf), conn->end.rtp_port); + osmo_sockaddr_ntop(&conn->end.addr.u.sa, ipbuf), port); return -1; } - if (conn->end.rtp_port == 0) { + if (port == 0) { LOGPCONN(conn->conn, DRTP, LOGL_ERROR, "destination rtp port is invalid (%s:%u)\n", - osmo_sockaddr_ntop(&conn->end.addr.u.sa, ipbuf), conn->end.rtp_port); + osmo_sockaddr_ntop(&conn->end.addr.u.sa, ipbuf), port); return -1; } @@ -1033,26 +1035,22 @@ /*! send udp packet. * \param[in] fd associated file descriptor. * \param[in] addr destination ip-address. - * \param[in] port destination UDP port (network byte order). * \param[in] buf buffer that holds the data to be send. * \param[in] len length of the data to be sent. * \returns bytes sent, -1 on error. */ -int mgcp_udp_send(int fd, struct osmo_sockaddr *addr, int port, const char *buf, int len) +int mgcp_udp_send(int fd, const struct osmo_sockaddr *addr, const char *buf, int len) { char ipbuf[INET6_ADDRSTRLEN]; size_t addr_len; - bool is_ipv6 = addr->u.sa.sa_family == AF_INET6; LOGP(DRTP, LOGL_DEBUG, "sending %i bytes length packet to %s:%u ...\n", len, osmo_sockaddr_ntop(&addr->u.sa, ipbuf), - ntohs(port)); + osmo_sockaddr_port(&addr->u.sa)); - if (is_ipv6) { - addr->u.sin6.sin6_port = port; + if (addr->u.sa.sa_family == AF_INET6) { addr_len = sizeof(addr->u.sin6); } else { - addr->u.sin.sin_port = port; addr_len = sizeof(addr->u.sin); } @@ -1067,6 +1065,7 @@ { int rc; int was_rtcp = 0; + struct osmo_sockaddr rtcp_addr; OSMO_ASSERT(endp); OSMO_ASSERT(conn); @@ -1083,7 +1082,7 @@ if (mgcp_conn_rtp_is_iuup(conn)) rc = mgcp_conn_iuup_send_dummy(conn); else - rc = mgcp_udp_send(conn->end.rtp.fd, &conn->end.addr, conn->end.rtp_port, + rc = mgcp_udp_send(conn->end.rtp.fd, &conn->end.addr, rtp_dummy_payload, sizeof(rtp_dummy_payload)); if (rc == -1) @@ -1093,8 +1092,10 @@ return rc; was_rtcp = 1; - rc = mgcp_udp_send(conn->end.rtcp.fd, &conn->end.addr, - conn->end.rtcp_port, rtp_dummy_payload, sizeof(rtp_dummy_payload)); + rtcp_addr = conn->end.addr; + osmo_sockaddr_set_port(&rtcp_addr.u.sa, ntohs(conn->end.rtcp_port)); + rc = mgcp_udp_send(conn->end.rtcp.fd, &rtcp_addr, + rtp_dummy_payload, sizeof(rtp_dummy_payload)); if (rc >= 0) return rc; @@ -1174,7 +1175,7 @@ "rtp_port:%u rtcp_port:%u\n", dest_name, osmo_sockaddr_ntop(&rtp_end->addr.u.sa, ipbuf), - ntohs(rtp_end->rtp_port), ntohs(rtp_end->rtcp_port) + osmo_sockaddr_port(&rtp_end->addr.u.sa), ntohs(rtp_end->rtcp_port) ); } else if (is_rtp) { int cont; @@ -1219,14 +1220,14 @@ "rtp_port:%u rtcp_port:%u\n", dest_name, osmo_sockaddr_ntop(&rtp_end->addr.u.sa, ipbuf), - ntohs(rtp_end->rtp_port), ntohs(rtp_end->rtcp_port) + osmo_sockaddr_port(&rtp_end->addr.u.sa), ntohs(rtp_end->rtcp_port) ); /* Forward a copy of the RTP data to a debug ip/port */ forward_data_tap(rtp_end->rtp.fd, &conn_src->tap_out, msg); - len = mgcp_udp_send(rtp_end->rtp.fd, &rtp_end->addr, rtp_end->rtp_port, + len = mgcp_udp_send(rtp_end->rtp.fd, &rtp_end->addr, (char *)msgb_data(msg), msgb_length(msg)); if (len <= 0) @@ -1241,15 +1242,17 @@ } while (buflen > 0); return nbytes; } else if (!trunk->omit_rtcp) { + struct osmo_sockaddr rtcp_addr = rtp_end->addr; + osmo_sockaddr_set_port(&rtcp_addr.u.sa, rtp_end->rtcp_port); LOGPENDP(endp, DRTP, LOGL_DEBUG, "send to %s %s rtp_port:%u rtcp_port:%u\n", - dest_name, osmo_sockaddr_ntop(&rtp_end->addr.u.sa, ipbuf), - ntohs(rtp_end->rtp_port), ntohs(rtp_end->rtcp_port) + dest_name, osmo_sockaddr_ntop(&rtcp_addr.u.sa, ipbuf), + osmo_sockaddr_port(&rtp_end->addr.u.sa), + osmo_sockaddr_port(&rtcp_addr.u.sa) ); - len = mgcp_udp_send(rtp_end->rtcp.fd, - &rtp_end->addr, - rtp_end->rtcp_port, (char *)msgb_data(msg), msgb_length(msg)); + len = mgcp_udp_send(rtp_end->rtcp.fd, &rtcp_addr, + (char *)msgb_data(msg), msgb_length(msg)); rtpconn_rate_ctr_inc(conn_dst, endp, RTP_PACKETS_TX_CTR); rtpconn_rate_ctr_add(conn_dst, endp, RTP_OCTETS_TX_CTR, len); @@ -1295,23 +1298,13 @@ * packets back to their origin. We will use the originating * address data from the UDP packet header to patch the * outgoing address in connection on the fly */ - if (conn->u.rtp.end.rtp_port == 0) { + if (osmo_sockaddr_port(&conn->u.rtp.end.addr.u.sa) == 0) { memcpy(&conn->u.rtp.end.addr, from_addr, sizeof(conn->u.rtp.end.addr)); - switch (from_addr->u.sa.sa_family) { - case AF_INET: - conn->u.rtp.end.rtp_port = from_addr->u.sin.sin_port; - break; - case AF_INET6: - conn->u.rtp.end.rtp_port = from_addr->u.sin6.sin6_port; - break; - default: - OSMO_ASSERT(false); - } LOG_CONN_RTP(conn_src, LOGL_NOTICE, "loopback mode: implicitly using source address (%s:%u) as destination address\n", osmo_sockaddr_ntop(&from_addr->u.sa, ipbuf), - conn->u.rtp.end.rtp_port); + osmo_sockaddr_port(&conn->u.rtp.end.addr.u.sa)); } return mgcp_send_rtp(conn_src, msg); } @@ -1370,23 +1363,13 @@ * packets back to their origin. We will use the originating * address data from the UDP packet header to patch the * outgoing address in connection on the fly */ - if (conn->u.rtp.end.rtp_port == 0) { + if (osmo_sockaddr_port(&conn->u.rtp.end.addr.u.sa) == 0) { memcpy(&conn->u.rtp.end.addr, from_addr, sizeof(conn->u.rtp.end.addr)); - switch (from_addr->u.sa.sa_family) { - case AF_INET: - conn->u.rtp.end.rtp_port = from_addr->u.sin.sin_port; - break; - case AF_INET6: - conn->u.rtp.end.rtp_port = from_addr->u.sin6.sin6_port; - break; - default: - OSMO_ASSERT(false); - } LOG_CONN_RTP(conn_src, LOGL_NOTICE, "loopback mode: implicitly using source address (%s:%u) as destination address\n", osmo_sockaddr_ntop(&from_addr->u.sa, ipbuf), - conn->u.rtp.end.rtp_port); + osmo_sockaddr_port(&conn->u.rtp.end.addr.u.sa)); } return mgcp_send_rtp(conn_src, msg); } diff --git a/src/libosmo-mgcp/mgcp_osmux.c b/src/libosmo-mgcp/mgcp_osmux.c index 23e4dad..b5a2c57 100644 --- a/src/libosmo-mgcp/mgcp_osmux.c +++ b/src/libosmo-mgcp/mgcp_osmux.c @@ -338,7 +338,6 @@ switch(conn->osmux.state) { case OSMUX_STATE_ACTIVATING: rem_addr = conn->end.addr; - osmo_sockaddr_set_port(&rem_addr.u.sa, ntohs(conn->end.rtp_port)); if (osmux_enable_conn(endp, conn, &rem_addr) < 0) { LOGPCONN(conn->conn, DOSMUX, LOGL_ERROR, "Could not enable osmux for conn on %s: %s\n", @@ -651,10 +650,9 @@ LOGPCONN(conn->conn, DOSMUX, LOGL_DEBUG, "sending OSMUX dummy load to %s:%u CID %u\n", osmo_sockaddr_ntop(&conn->end.addr.u.sa, ipbuf), - ntohs(conn->end.rtp_port), conn->osmux.remote_cid); + osmo_sockaddr_port(&conn->end.addr.u.sa), conn->osmux.remote_cid); - return mgcp_udp_send(osmux_fd.fd, &conn->end.addr, - conn->end.rtp_port, (char*)osmuxh, buf_len); + return mgcp_udp_send(osmux_fd.fd, &conn->end.addr, (char*)osmuxh, buf_len); } /* bsc-nat allocates/releases the Osmux circuit ID. +7 to round up to 8 bit boundary. */ diff --git a/src/libosmo-mgcp/mgcp_protocol.c b/src/libosmo-mgcp/mgcp_protocol.c index 5493917..a257ffe 100644 --- a/src/libosmo-mgcp/mgcp_protocol.c +++ b/src/libosmo-mgcp/mgcp_protocol.c @@ -708,7 +708,7 @@ LOGPENDP(endp, DLMGCP, LOGL_DEBUG, "Configuring RTP endpoint: local port %d%s%s\n", - ntohs(rtp->rtp_port), + osmo_sockaddr_port(&rtp->addr.u.sa), rtp->force_aligned_timing ? ", force constant timing" : "", rtp->force_constant_ssrc ? ", force constant ssrc" : ""); } @@ -1057,7 +1057,7 @@ /* check connection mode setting */ if (conn->conn->mode != MGCP_CONN_LOOPBACK && conn->conn->mode != MGCP_CONN_RECV_ONLY - && conn->end.rtp_port == 0) { + && osmo_sockaddr_port(&conn->end.addr.u.sa) == 0) { LOGPCONN(_conn, DLMGCP, LOGL_ERROR, "CRCX: selected connection mode type requires an opposite end!\n"); error_code = 527; diff --git a/src/libosmo-mgcp/mgcp_sdp.c b/src/libosmo-mgcp/mgcp_sdp.c index 98b3099..1414cf9 100644 --- a/src/libosmo-mgcp/mgcp_sdp.c +++ b/src/libosmo-mgcp/mgcp_sdp.c @@ -384,7 +384,7 @@ case 'm': rc = sscanf(line, "m=audio %d RTP/AVP", &port); if (rc == 1) { - rtp->rtp_port = htons(port); + osmo_sockaddr_set_port(&rtp->addr.u.sa, port); rtp->rtcp_port = htons(port + 1); } @@ -432,7 +432,7 @@ LOGPCONN(conn->conn, DLMGCP, LOGL_NOTICE, "Got media info via SDP: port:%d, addr:%s, duration:%d, payload-types:", - ntohs(rtp->rtp_port), osmo_sockaddr_ntop(&rtp->addr.u.sa, ipbuf), + osmo_sockaddr_port(&rtp->addr.u.sa), osmo_sockaddr_ntop(&rtp->addr.u.sa, ipbuf), rtp->packet_duration_ms); if (codecs_used == 0) LOGPC(DLMGCP, LOGL_NOTICE, "none"); diff --git a/tests/mgcp/mgcp_test.c b/tests/mgcp/mgcp_test.c index e28a574..d843d10 100644 --- a/tests/mgcp/mgcp_test.c +++ b/tests/mgcp/mgcp_test.c @@ -1492,7 +1492,7 @@ conn = mgcp_conn_get_rtp(endp, conn_id); OSMO_ASSERT(conn); OSMO_ASSERT(conn->end.codec->payload_type == 3); - OSMO_ASSERT(conn->end.rtp_port == htons(16434)); + OSMO_ASSERT(osmo_sockaddr_port(&conn->end.addr.u.sa) == 16434); memset(&addr, 0, sizeof(addr)); inet_aton("8.8.8.8", &addr); OSMO_ASSERT(conn->end.addr.u.sa.sa_family == AF_INET); -- To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/29589 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Change-Id: I294eb5d85fae79bf62d36eb9e818426e187d442c Gerrit-Change-Number: 29589 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
Change in osmo-bts[master]: osmux: Close osmux socket when bts is freed
by pespin 04 Oct '22

04 Oct '22
Attention is currently required from: pespin, fixeria. Hello Jenkins Builder, laforge, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/osmo-bts/+/29576 to look at the new patch set (#4). Change subject: osmux: Close osmux socket when bts is freed ...................................................................... osmux: Close osmux socket when bts is freed Related: SYS#5987 Change-Id: Ibd3faa33b28d45048c340b177f13d5685f41a784 --- M src/common/osmux.c 1 file changed, 12 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/76/29576/4 -- To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/29576 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Change-Id: Ibd3faa33b28d45048c340b177f13d5685f41a784 Gerrit-Change-Number: 29576 Gerrit-PatchSet: 4 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-CC: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-MessageType: newpatchset
1 0
0 0
Change in osmo-bts[master]: osmux: Close osmux socket when bts is freed
by pespin 04 Oct '22

04 Oct '22
Attention is currently required from: fixeria. Hello Jenkins Builder, laforge, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/osmo-bts/+/29576 to look at the new patch set (#3). Change subject: osmux: Close osmux socket when bts is freed ...................................................................... osmux: Close osmux socket when bts is freed Related: SYS#5987 Change-Id: Ibd3faa33b28d45048c340b177f13d5685f41a784 --- M src/common/osmux.c 1 file changed, 9 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/76/29576/3 -- To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/29576 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Change-Id: Ibd3faa33b28d45048c340b177f13d5685f41a784 Gerrit-Change-Number: 29576 Gerrit-PatchSet: 3 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-CC: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-MessageType: newpatchset
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 211
  • 212
  • 213
  • 214
  • 215
  • 216
  • 217
  • ...
  • 234
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.