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

September 2026

  • 1 participants
  • 1894 discussions
[XS] Change in osmo-mgw[master]: mgcp_client: generate mgcp_common.h with printf
by Andrei G 08 Sep '26

08 Sep '26
Andrei G has uploaded a new patch set (#2). ( https://gerrit.osmocom.org/c/osmo-mgw/+/43576?usp=email ) Change subject: mgcp_client: generate mgcp_common.h with printf ...................................................................... mgcp_client: generate mgcp_common.h with printf The rule in include/osmocom/mgcp_client/Makefile.am that copies <osmocom/mgcp/mgcp_common.h> into the mgcp_client include directory writes its banner with "echo -e". The -e option is a bash extension. Shells whose echo follows the XSI convention expand the backslash escapes on their own and do not take options, so -e is passed through as the first argument to print. The generated header then starts with -e /* and every file that includes it fails to compile: mgcp_common.h:1:2: error: unknown type name 'e' Measured on macOS, where /bin/sh is bash invoked as sh: the escapes are expanded as intended, but the leading "-e " is printed literally. Any shell with an XSI-style echo, dash among them, behaves the same way. The build only works where /bin/sh accepts -e. Replace it with printf and one argument per line. printf is POSIX, takes no such option, and produces the same seven lines on every shell. Change-Id: Ibc547513745104212469ccddbc2e636c985cffe5 Signed-off-by: Andrei Gosman <andrei.gosman(a)gmail.com> --- M include/osmocom/mgcp_client/Makefile.am 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/76/43576/2 -- To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/43576?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newpatchset Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Change-Id: Ibc547513745104212469ccddbc2e636c985cffe5 Gerrit-Change-Number: 43576 Gerrit-PatchSet: 2 Gerrit-Owner: Andrei G <andrei.gosman(a)gmail.com>
1 0
0 0
[XS] Change in osmo-mgw[master]: mgcp_client: generate mgcp_common.h banner with printf
by Andrei G 08 Sep '26

08 Sep '26
Andrei G has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-mgw/+/43576?usp=email ) Change subject: mgcp_client: generate mgcp_common.h banner with printf ...................................................................... mgcp_client: generate mgcp_common.h banner with printf The rule in include/osmocom/mgcp_client/Makefile.am that copies <osmocom/mgcp/mgcp_common.h> into the mgcp_client include directory writes its banner with "echo -e". The -e option is a bash extension. Shells whose echo follows the XSI convention expand the backslash escapes on their own and do not take options, so -e is passed through as the first argument to print. The generated header then starts with -e /* and every file that includes it fails to compile: mgcp_common.h:1:2: error: unknown type name 'e' Measured on macOS, where /bin/sh is bash invoked as sh: the escapes are expanded as intended, but the leading "-e " is printed literally. Any shell with an XSI-style echo, dash among them, behaves the same way. The build only works where /bin/sh accepts -e. Replace it with printf and one argument per line. printf is POSIX, takes no such option, and produces the same seven lines on every shell. Change-Id: Ibc547513745104212469ccddbc2e636c985cffe5 Signed-off-by: Andrei Gosman <andrei.gosman(a)gmail.com> --- M include/osmocom/mgcp_client/Makefile.am 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/76/43576/1 diff --git a/include/osmocom/mgcp_client/Makefile.am b/include/osmocom/mgcp_client/Makefile.am index 7415142..5374dc5 100644 --- a/include/osmocom/mgcp_client/Makefile.am +++ b/include/osmocom/mgcp_client/Makefile.am @@ -9,7 +9,7 @@ $(NULL) mgcp_common.h: $(top_srcdir)/include/osmocom/mgcp/mgcp_common.h - echo -e "/*\n\n DO NOT EDIT THIS FILE!\n THIS IS OVERWRITTEN DURING BUILD\n This is an automatic copy of <osmocom/mgcp/mgcp_common.h>\n\n */" > mgcp_common.h + printf '%s\n' "/*" "" " DO NOT EDIT THIS FILE!" " THIS IS OVERWRITTEN DURING BUILD" " This is an automatic copy of <osmocom/mgcp/mgcp_common.h>" "" " */" > mgcp_common.h cat $(top_srcdir)/include/osmocom/mgcp/mgcp_common.h >> mgcp_common.h version.h: version.h.tpl -- To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/43576?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Change-Id: Ibc547513745104212469ccddbc2e636c985cffe5 Gerrit-Change-Number: 43576 Gerrit-PatchSet: 1 Gerrit-Owner: Andrei G <andrei.gosman(a)gmail.com>
1 0
0 0
[M] Change in libosmocore[master]: core/socket: sockaddr_cmp: compare fields
by Andrei G 08 Sep '26

08 Sep '26
Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/libosmocore/+/43575?usp=email to look at the new patch set (#3). The following approvals got outdated and were removed: Verified+1 by Jenkins Builder Change subject: core/socket: sockaddr_cmp: compare fields ...................................................................... core/socket: sockaddr_cmp: compare fields osmo_sockaddr_cmp() decides whether two addresses are equal with a memcmp() over the whole struct sockaddr_in or sockaddr_in6. On Linux those structures hold only family, port, address and padding, so the comparison is exact. On Darwin and the BSDs the first byte is sin_len / sin6_len. The kernel fills it in on recvfrom() and accept(), while an address the application built from configuration leaves it zero. The same peer then compares as two different addresses. Every static NS-VC in gprs_ns2 breaks on this. The answer to the first NS-RESET arrives from the configured remote, gprs_ns2_udp.c cannot match it to the NS-VC ("Ignoring NS RESET ACK from newconnection for non-existing NS-VC", gprs_ns2.c:1066) and the link never leaves RESET. Observed with osmo-pcu against osmo-sgsn on Darwin loopback: the SGSN side, which learned the peer from the packet, goes to BLOCKED and then loses every NS-ALIVE-ACK, while the PCU side stays in RESET. Dynamic NS-VCs are unaffected because their remote address is a copy of what recvfrom() returned. Compare the fields instead of the bytes: port and address for AF_INET, port, flow info, address and scope id for AF_INET6, in the order memcmp() visited them, so the ordering the function gives to sorted users does not change. The default branch keeps its memcmp() over the full osmo_sockaddr. Linux behaviour is unchanged. Add tests/sockaddr_cmp covering the two cases that regressed and the ordering the fix has to preserve: an IPv4 and an IPv6 pair equal in port and address but differing in the length byte, both expected to compare equal, and ordering by port, by address, by flow info and by scope id, each checked in both directions. Against the previous implementation the two length-byte cases return -16 and -28 instead of 0. The length byte only exists where the sockaddr carries one, so configure.ac gains an AC_CHECK_MEMBER for struct sockaddr_in.sin_len, in the style of the existing s6_addr32 check. Where the member is absent the two addresses are identical and the expectation is the same, so the test and its .ok output are the same on every platform. Note that sin6_flowinfo and sin6_scope_id are compared byte by byte, which is not numeric order on a little endian host. That is unchanged from the memcmp() this replaces. The test uses values differing in one byte only, where both orders agree. Change-Id: I75fc62a92f546a906dbb1440984d62f962579255 Signed-off-by: Andrei Gosman <andrei.gosman(a)gmail.com> --- M configure.ac M src/core/socket.c M tests/Makefile.am A tests/sockaddr_cmp/sockaddr_cmp_test.c A tests/sockaddr_cmp/sockaddr_cmp_test.ok M tests/testsuite.at 6 files changed, 201 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/75/43575/3 -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/43575?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newpatchset Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: I75fc62a92f546a906dbb1440984d62f962579255 Gerrit-Change-Number: 43575 Gerrit-PatchSet: 3 Gerrit-Owner: Andrei G <andrei.gosman(a)gmail.com> Gerrit-Reviewer: Jenkins Builder
1 0
0 0
[S] Change in libosmocore[master]: core/socket: sockaddr_cmp: compare fields
by Andrei G 08 Sep '26

08 Sep '26
Andrei G has uploaded a new patch set (#2). ( https://gerrit.osmocom.org/c/libosmocore/+/43575?usp=email ) Change subject: core/socket: sockaddr_cmp: compare fields ...................................................................... core/socket: sockaddr_cmp: compare fields osmo_sockaddr_cmp() decides whether two addresses are equal with a memcmp() over the whole struct sockaddr_in or sockaddr_in6. On Linux those structures hold only family, port, address and padding, so the comparison is exact. On Darwin and the BSDs the first byte is sin_len / sin6_len. The kernel fills it in on recvfrom() and accept(), while an address the application built from configuration leaves it zero. The same peer then compares as two different addresses. Every static NS-VC in gprs_ns2 breaks on this. The answer to the first NS-RESET arrives from the configured remote, gprs_ns2_udp.c cannot match it to the NS-VC ("Ignoring NS RESET ACK from newconnection for non-existing NS-VC", gprs_ns2.c:1066) and the link never leaves RESET. Observed with osmo-pcu against osmo-sgsn on Darwin loopback: the SGSN side, which learned the peer from the packet, goes to BLOCKED and then loses every NS-ALIVE-ACK, while the PCU side stays in RESET. Dynamic NS-VCs are unaffected because their remote address is a copy of what recvfrom() returned. Compare the fields instead of the bytes: port and address for AF_INET, port, flow info, address and scope id for AF_INET6, in the order memcmp() visited them, so the ordering the function gives to sorted users does not change. The default branch keeps its memcmp() over the full osmo_sockaddr. Linux behaviour is unchanged. Change-Id: I75fc62a92f546a906dbb1440984d62f962579255 Signed-off-by: Andrei Gosman <andrei.gosman(a)gmail.com> --- M src/core/socket.c 1 file changed, 30 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/75/43575/2 -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/43575?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newpatchset Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: I75fc62a92f546a906dbb1440984d62f962579255 Gerrit-Change-Number: 43575 Gerrit-PatchSet: 2 Gerrit-Owner: Andrei G <andrei.gosman(a)gmail.com>
1 0
0 0
[S] Change in libosmocore[master]: core/socket: sockaddr_cmp: compare fields, not bytes
by Andrei G 08 Sep '26

08 Sep '26
Andrei G has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/43575?usp=email ) Change subject: core/socket: sockaddr_cmp: compare fields, not bytes ...................................................................... core/socket: sockaddr_cmp: compare fields, not bytes osmo_sockaddr_cmp() decides whether two addresses are equal with a memcmp() over the whole struct sockaddr_in or sockaddr_in6. On Linux those structures hold only family, port, address and padding, so the comparison is exact. On Darwin and the BSDs the first byte is sin_len / sin6_len. The kernel fills it in on recvfrom() and accept(), while an address the application built from configuration leaves it zero. The same peer then compares as two different addresses. Every static NS-VC in gprs_ns2 breaks on this. The answer to the first NS-RESET arrives from the configured remote, gprs_ns2_udp.c cannot match it to the NS-VC ("Ignoring NS RESET ACK from newconnection for non-existing NS-VC", gprs_ns2.c:1066) and the link never leaves RESET. Observed with osmo-pcu against osmo-sgsn on Darwin loopback: the SGSN side, which learned the peer from the packet, goes to BLOCKED and then loses every NS-ALIVE-ACK, while the PCU side stays in RESET. Dynamic NS-VCs are unaffected because their remote address is a copy of what recvfrom() returned. Compare the fields instead of the bytes: port and address for AF_INET, port, flow info, address and scope id for AF_INET6, in the order memcmp() visited them, so the ordering the function gives to sorted users does not change. The default branch keeps its memcmp() over the full osmo_sockaddr. Linux behaviour is unchanged. Change-Id: I75fc62a92f546a906dbb1440984d62f962579255 Signed-off-by: Andrei Gosman <andrei.gosman(a)gmail.com> --- M src/core/socket.c 1 file changed, 30 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/75/43575/1 diff --git a/src/core/socket.c b/src/core/socket.c index 3a2d7b7..724d8ef 100644 --- a/src/core/socket.c +++ b/src/core/socket.c @@ -2599,11 +2599,37 @@ return OSMO_CMP(a->u.sa.sa_family, b->u.sa.sa_family); } + /* Compare the address fields, not the raw bytes of the structure. + * On the BSDs and Darwin the sockaddr carries a length byte (sin_len, + * sin6_len) that the kernel fills in on recvfrom()/accept() and that + * is zero in an address the application built itself; a memcmp() over + * the whole structure then reports two equal addresses as different. + * The order of the comparisons keeps the ordering memcmp() gave. */ switch (a->u.sa.sa_family) { - case AF_INET: - return memcmp(&a->u.sin, &b->u.sin, sizeof(struct sockaddr_in)); - case AF_INET6: - return memcmp(&a->u.sin6, &b->u.sin6, sizeof(struct sockaddr_in6)); + case AF_INET: { + int rc = memcmp(&a->u.sin.sin_port, &b->u.sin.sin_port, + sizeof(a->u.sin.sin_port)); + if (rc) + return rc; + return memcmp(&a->u.sin.sin_addr, &b->u.sin.sin_addr, + sizeof(a->u.sin.sin_addr)); + } + case AF_INET6: { + int rc = memcmp(&a->u.sin6.sin6_port, &b->u.sin6.sin6_port, + sizeof(a->u.sin6.sin6_port)); + if (rc) + return rc; + rc = memcmp(&a->u.sin6.sin6_flowinfo, &b->u.sin6.sin6_flowinfo, + sizeof(a->u.sin6.sin6_flowinfo)); + if (rc) + return rc; + rc = memcmp(&a->u.sin6.sin6_addr, &b->u.sin6.sin6_addr, + sizeof(a->u.sin6.sin6_addr)); + if (rc) + return rc; + return memcmp(&a->u.sin6.sin6_scope_id, &b->u.sin6.sin6_scope_id, + sizeof(a->u.sin6.sin6_scope_id)); + } default: /* fallback to memcmp for remaining AF over the full osmo_sockaddr length */ return memcmp(a, b, sizeof(struct osmo_sockaddr)); -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/43575?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: I75fc62a92f546a906dbb1440984d62f962579255 Gerrit-Change-Number: 43575 Gerrit-PatchSet: 1 Gerrit-Owner: Andrei G <andrei.gosman(a)gmail.com>
1 0
0 0
[L] Change in pysim[master]: bip: move the BIP relay into pySim.bip
by laforge 08 Sep '26

08 Sep '26
Attention is currently required from: Hoernchen, dexter. laforge has posted comments on this change by Hoernchen. ( https://gerrit.osmocom.org/c/pysim/+/43540?usp=email ) Change subject: bip: move the BIP relay into pySim.bip ...................................................................... Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/pysim/+/43540?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: Ifd8a15684939977d29ea83a6b669daee14484e88 Gerrit-Change-Number: 43540 Gerrit-PatchSet: 2 Gerrit-Owner: Hoernchen <ewild(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Attention: Hoernchen <ewild(a)sysmocom.de> Gerrit-Attention: dexter <pmaier(a)sysmocom.de> Gerrit-Comment-Date: Tue, 08 Sep 2026 14:33:53 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes
1 0
0 0
[L] Change in pysim[master]: ota: add TS 102 226 5.2 Expanded Remote Application data format
by laforge 08 Sep '26

08 Sep '26
Attention is currently required from: Hoernchen, daniel, dexter. laforge has posted comments on this change by Hoernchen. ( https://gerrit.osmocom.org/c/pysim/+/43541?usp=email ) Change subject: ota: add TS 102 226 5.2 Expanded Remote Application data format ...................................................................... Patch Set 2: Code-Review+1 (1 comment) File pySim/ota.py: https://gerrit.osmocom.org/c/pysim/+/43541/comment/8aedbfae_16d95c6b?usp=em… : PS1, Line 221: last_response_data=last['response_data'] if last else '', > pylint says: […] Done -- To view, visit https://gerrit.osmocom.org/c/pysim/+/43541?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: Idec00d16fd1a7d4a7129b2a3b6f0ef37dabcecb7 Gerrit-Change-Number: 43541 Gerrit-PatchSet: 2 Gerrit-Owner: Hoernchen <ewild(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de> Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Attention: Hoernchen <ewild(a)sysmocom.de> Gerrit-Attention: daniel <dwillmann(a)sysmocom.de> Gerrit-Attention: dexter <pmaier(a)sysmocom.de> Gerrit-Comment-Date: Tue, 08 Sep 2026 14:33:42 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: Yes Comment-In-Reply-To: laforge <laforge(a)osmocom.org>
1 0
0 0
[XS] Change in libosmocore[master]: core/socket: init_osa: pass family-correct len
by Andrei G 08 Sep '26

08 Sep '26
Andrei G has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/43574?usp=email ) Change subject: core/socket: init_osa: pass family-correct len ...................................................................... core/socket: init_osa: pass family-correct len osmo_sock_init_osa() hands bind() and connect() sizeof(struct osmo_sockaddr), the 128 byte union, whatever the address family. Linux accepts a namelen longer than the family needs and reads only the family-appropriate part. Darwin returns EINVAL because the kernel enforces the exact length (16 for IPv4, 28 for IPv6). The BSDs behave like Darwin. Use osmo_sockaddr_size(), which the header already provides and which the sendto() callers already use. It returns sizeof(struct sockaddr_in) or sizeof(struct sockaddr_in6) by family. Linux behaviour is unchanged. Consequence on Darwin without this fix: gprs_ns2_ip_bind() cannot bind its NS-VC UDP socket ("unable to bind socket: 0.0.0.0:23001: Invalid argument"), so osmo-pcu exits with "No NSVC available to connect to the SGSN" right after the INFO_IND from osmo-bts. osmo-sgsn and osmo-gbproxy reach the same call. Change-Id: I37cb08a6e1809d51c97e666f980d4c68f8b56933 Signed-off-by: Andrei Gosman <andrei.gosman(a)gmail.com> --- M src/core/socket.c 1 file changed, 4 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/74/43574/1 diff --git a/src/core/socket.c b/src/core/socket.c index 3a2d7b7..e392710 100644 --- a/src/core/socket.c +++ b/src/core/socket.c @@ -598,7 +598,9 @@ } } - if (bind(sfd, &local->u.sa, sizeof(struct osmo_sockaddr)) == -1) { + /* Pass the length of the address family in use, not of the union: + * Darwin and the BSDs reject a longer namelen with EINVAL. */ + if (bind(sfd, &local->u.sa, osmo_sockaddr_size(local)) == -1) { int err = errno; _SOCKADDR_TO_STR(sastr, local); LOGP(DLGLOBAL, LOGL_ERROR, "unable to bind socket: " OSMO_SOCKADDR_STR_FMT ": %s\n", @@ -621,7 +623,7 @@ } } - rc = connect(sfd, &remote->u.sa, sizeof(struct osmo_sockaddr)); + rc = connect(sfd, &remote->u.sa, osmo_sockaddr_size(remote)); if (rc != 0 && errno != EINPROGRESS) { int err = errno; _SOCKADDR_TO_STR(sastr, remote); -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/43574?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: I37cb08a6e1809d51c97e666f980d4c68f8b56933 Gerrit-Change-Number: 43574 Gerrit-PatchSet: 1 Gerrit-Owner: Andrei G <andrei.gosman(a)gmail.com>
1 0
0 0
[XS] Change in libosmocore[master]: core/socket: local_ip: connect to discard port
by Andrei G 08 Sep '26

08 Sep '26
Andrei G has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/43573?usp=email ) Change subject: core/socket: local_ip: connect to discard port ...................................................................... core/socket: local_ip: connect to discard port osmo_sock_local_ip() finds the source address for a remote by connecting a dummy UDP socket to that remote and reading the local side back with getsockname(). It connects to port 0. Linux accepts that and returns the source address. Darwin rejects it with EADDRNOTAVAIL (errno 49), so the function returns -EINVAL for every remote. The BSDs behave like Darwin here. Two consumers break on Darwin as a result. libosmo-mgcp-client cannot determine its local address at mgcp_client.c:1347 and fails to build any MGCP message carrying SDP ("Could not determine local IP-Address!"); the mgcp_client test then dereferences the message it did not get. In osmo-mgw, mgcp_network.c:137 uses the same call to pick the local RTP address when none is configured. No packet is ever sent on the dummy socket, so the remote port has no effect on the answer: the socket is connected, read with getsockname() and closed. Use 9 (discard, IANA reserved), which every kernel accepts. Behaviour on Linux is unchanged. Change-Id: I597874d5b2a81dd34c6a2b274fcf8d9bfc14c301 Signed-off-by: Andrei Gosman <andrei.gosman(a)gmail.com> --- M src/core/socket.c 1 file changed, 4 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/73/43573/1 diff --git a/src/core/socket.c b/src/core/socket.c index 3a2d7b7..cf737fe 100644 --- a/src/core/socket.c +++ b/src/core/socket.c @@ -2466,8 +2466,10 @@ /* Connect a dummy socket to trick the kernel into determining the * ip-address of the interface that would be used if we would send - * out an actual packet */ - sfd = osmo_sock_init2(family, SOCK_DGRAM, IPPROTO_UDP, NULL, 0, remote_ip, 0, OSMO_SOCK_F_CONNECT); + * out an actual packet. No packet is sent, so the remote port does + * not matter, but it must not be 0: Linux accepts a UDP connect() to + * port 0, while Darwin and the BSDs reject it with EADDRNOTAVAIL. */ + sfd = osmo_sock_init2(family, SOCK_DGRAM, IPPROTO_UDP, NULL, 0, remote_ip, 9, OSMO_SOCK_F_CONNECT); if (sfd < 0) return -EINVAL; -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/43573?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: I597874d5b2a81dd34c6a2b274fcf8d9bfc14c301 Gerrit-Change-Number: 43573 Gerrit-PatchSet: 1 Gerrit-Owner: Andrei G <andrei.gosman(a)gmail.com>
1 0
0 0
[XS] Change in libosmocore[master]: core/stats_tcp: declare struct osmo_fd in header
by Andrei G 08 Sep '26

08 Sep '26
Andrei G has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/43572?usp=email ) Change subject: core/stats_tcp: declare struct osmo_fd in header ...................................................................... core/stats_tcp: declare struct osmo_fd in header include/osmocom/core/stats_tcp.h names struct osmo_fd in its prototypes without declaring it and without including select.h. A translation unit that includes stats_tcp.h on its own therefore gives the type function prototype scope, and a later definition of one of those functions in the same unit has a different, incompatible type. Clang reports -Wvisibility and then rejects the definitions outright. Every in-tree caller happens to include select.h first, which is why this never showed up. It surfaced while writing a Darwin implementation of the same functions, where stats_tcp.h is the only include. Add the forward declaration to the header rather than requiring each includer to get the order right. A forward declaration is enough: the prototypes take a pointer. Nothing here is platform specific and there is no runtime impact. Change-Id: I2f31f45317e6a28f47470ba6a5e4a31e4704e831 Signed-off-by: Andrei Gosman <andrei.gosman(a)gmail.com> --- M include/osmocom/core/stats_tcp.h 1 file changed, 6 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/72/43572/1 diff --git a/include/osmocom/core/stats_tcp.h b/include/osmocom/core/stats_tcp.h index 9bc7111..759dc3b 100644 --- a/include/osmocom/core/stats_tcp.h +++ b/include/osmocom/core/stats_tcp.h @@ -11,6 +11,12 @@ }; extern struct osmo_tcp_stats_config *osmo_tcp_stats_config; +/* The prototypes below name struct osmo_fd without declaring it. A translation + * unit that includes this header on its own therefore gives the type function + * prototype scope, and a later definition of one of these functions is a + * different type. Declare it here instead of relying on the includer. */ +struct osmo_fd; + int osmo_stats_tcp_osmo_fd_register(const struct osmo_fd *fd, const char *name); int osmo_stats_tcp_osmo_fd_unregister(const struct osmo_fd *fd); int osmo_stats_tcp_set_interval(int interval); -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/43572?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: I2f31f45317e6a28f47470ba6a5e4a31e4704e831 Gerrit-Change-Number: 43572 Gerrit-PatchSet: 1 Gerrit-Owner: Andrei G <andrei.gosman(a)gmail.com>
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 127
  • 128
  • 129
  • 130
  • 131
  • 132
  • 133
  • ...
  • 190
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.