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

April 2024

  • 1 participants
  • 1128 discussions
[M] Change in osmo-smlc[master]: .deb/.rpm: add osmocom user during package install
by osmith 25 Apr '24

25 Apr '24
osmith has submitted this change. ( https://gerrit.osmocom.org/c/osmo-smlc/+/29720?usp=email ) Change subject: .deb/.rpm: add osmocom user during package install ...................................................................... .deb/.rpm: add osmocom user during package install Create osmocom user & group during package installation. Fix the configuration dir/files permission to match. Related: OS#4107 Tweaked-By: Oliver Smith <osmith(a)sysmocom.de> Change-Id: I459ac6b80526afa0f5d47a8b56f40d5f636dbe28 --- M contrib/osmo-smlc.spec.in M contrib/systemd/osmo-smlc.service M debian/control A debian/postinst 4 files changed, 70 insertions(+), 2 deletions(-) Approvals: osmith: Looks good to me, approved laforge: Looks good to me, but someone else must approve pespin: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/contrib/osmo-smlc.spec.in b/contrib/osmo-smlc.spec.in index c1821db..6a6dc4b 100644 --- a/contrib/osmo-smlc.spec.in +++ b/contrib/osmo-smlc.spec.in @@ -58,19 +58,32 @@ %install %make_install -%if 0%{?suse_version} %preun +%if 0%{?suse_version} %service_del_preun %{name}.service +%endif %postun +%if 0%{?suse_version} %service_del_postun %{name}.service +%endif %pre +getent group osmocom >/dev/null || groupadd --system osmocom +getent passwd osmocom >/dev/null || useradd --system --gid osmocom --home-dir /var/lib/osmocom \ + --shell /sbin/nologin --comment "Open Source Mobile Communications" osmocom +%if 0%{?suse_version} %service_add_pre %{name}.service +%endif %post +%if 0%{?suse_version} %service_add_post %{name}.service %endif +chown osmocom:osmocom /etc/osmocom/osmo-smlc.cfg +chmod 0660 /etc/osmocom/osmo-smlc.cfg +chown root:osmocom /etc/osmocom +chmod 2775 /etc/osmocom %check make %{?_smp_mflags} check || (find . -name testsuite.log -exec cat {} +) diff --git a/contrib/systemd/osmo-smlc.service b/contrib/systemd/osmo-smlc.service index 65e552f..f5dd44a 100644 --- a/contrib/systemd/osmo-smlc.service +++ b/contrib/systemd/osmo-smlc.service @@ -8,6 +8,8 @@ Restart=always StateDirectory=osmocom WorkingDirectory=%S/osmocom +User=osmocom +Group=osmocom ExecStart=/usr/bin/osmo-smlc -c /etc/osmocom/osmo-smlc.cfg RestartSec=2 diff --git a/debian/control b/debian/control index 242a797..bdfe6e9 100644 --- a/debian/control +++ b/debian/control @@ -23,7 +23,7 @@ Package: osmo-smlc Architecture: any Multi-Arch: foreign -Depends: ${misc:Depends}, ${shlibs:Depends}, libdbd-sqlite3 +Depends: ${misc:Depends}, ${shlibs:Depends}, libdbd-sqlite3, adduser Description: OsmoSMLC: Osmocom's Location Services Center FIXME . diff --git a/debian/postinst b/debian/postinst new file mode 100755 index 0000000..ae5fcb4 --- /dev/null +++ b/debian/postinst @@ -0,0 +1,39 @@ +#!/bin/sh -e +# Create 'osmocom' user and group (if it doesn't exist yet) and adjust permissions +# of directories which are not automatically adjusted by systemd from previous (root-owned) +# install. + +# N. B: the user is intentionally NOT removed during package uninstall: +# see https://wiki.debian.org/AccountHandlingInMaintainerScripts for reasoning. +chperms() { + # chperms <user> <group> <perms> <file> + if ! OVERRIDE=`dpkg-statoverride --list $4 2>&1`; then + if [ -e $4 ]; then + chown $1:$2 $4 + chmod $3 $4 + fi + fi +} + +case "$1" in + configure) + if ! getent passwd osmocom > /dev/null; then + adduser --quiet \ + --system \ + --group \ + --no-create-home \ + --disabled-password \ + --home /var/lib/osmocom \ + --gecos "Open Source Mobile Communications" \ + osmocom + fi +# Set permissions according to https://www.debian.org/doc/debian-policy/ch-files.html#s-permissions-owners + chperms osmocom osmocom 0660 /etc/osmocom/osmo-smlc.cfg + chperms root osmocom 2775 /etc/osmocom + + ;; +esac + +# dh_installdeb(1) will replace this with shell code automatically +# generated by other debhelper scripts. +#DEBHELPER# -- To view, visit https://gerrit.osmocom.org/c/osmo-smlc/+/29720?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-smlc Gerrit-Branch: master Gerrit-Change-Id: I459ac6b80526afa0f5d47a8b56f40d5f636dbe28 Gerrit-Change-Number: 29720 Gerrit-PatchSet: 3 Gerrit-Owner: msuraev <msuraev(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
[M] Change in osmo-smlc[master]: .deb/.rpm: add osmocom user during package install
by osmith 25 Apr '24

25 Apr '24
Attention is currently required from: msuraev. osmith has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-smlc/+/29720?usp=email ) Change subject: .deb/.rpm: add osmocom user during package install ...................................................................... Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmo-smlc/+/29720?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-smlc Gerrit-Branch: master Gerrit-Change-Id: I459ac6b80526afa0f5d47a8b56f40d5f636dbe28 Gerrit-Change-Number: 29720 Gerrit-PatchSet: 3 Gerrit-Owner: msuraev <msuraev(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: msuraev <msuraev(a)sysmocom.de> Gerrit-Comment-Date: Thu, 25 Apr 2024 08:35:14 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[M] Change in osmo-cbc[master]: .deb/.rpm: add osmocom user during package install
by osmith 25 Apr '24

25 Apr '24
osmith has submitted this change. ( https://gerrit.osmocom.org/c/osmo-cbc/+/29717?usp=email ) Change subject: .deb/.rpm: add osmocom user during package install ...................................................................... .deb/.rpm: add osmocom user during package install Create osmocom user & group during package installation. Fix the configuration dir/files permission to match. Related: OS#4107 Tweaked-By: Oliver Smith <osmith(a)sysmocom.de> Change-Id: Ifcc882125a22d8f2e1bfcd19622aed4e8a723e6c --- M contrib/osmo-cbc.spec.in M contrib/systemd/osmo-cbc.service M debian/control A debian/postinst 4 files changed, 71 insertions(+), 2 deletions(-) Approvals: pespin: Looks good to me, but someone else must approve osmith: Looks good to me, approved Jenkins Builder: Verified laforge: Looks good to me, but someone else must approve diff --git a/contrib/osmo-cbc.spec.in b/contrib/osmo-cbc.spec.in index c837bbe..0fee4b9 100644 --- a/contrib/osmo-cbc.spec.in +++ b/contrib/osmo-cbc.spec.in @@ -84,19 +84,33 @@ install -m 755 contrib/cbc-apitool.py %{buildroot}/usr/bin/cbc-apitool.py find %{buildroot} \( -name '*.la' -o -name '*.a' \) -delete -print -%if 0%{?suse_version} %preun +%if 0%{?suse_version} %service_del_preun %{name}.service +%endif %postun +%if 0%{?suse_version} %service_del_postun %{name}.service +%endif %pre +getent group osmocom >/dev/null || groupadd --system osmocom +getent passwd osmocom >/dev/null || useradd --system --gid osmocom --home-dir /var/lib/osmocom \ + --shell /sbin/nologin --comment "Open Source Mobile Communications" osmocom +%if 0%{?suse_version} %service_add_pre %{name}.service +%endif %post +%if 0%{?suse_version} %service_add_post %{name}.service %endif +chown osmocom:osmocom /etc/osmocom/osmo-cbc.cfg +chmod 0660 /etc/osmocom/osmo-cbc.cfg +chown root:osmocom /etc/osmocom +chmod 2775 /etc/osmocom + %check make %{?_smp_mflags} check || (find . -name testsuite.log -exec cat {} +) diff --git a/contrib/systemd/osmo-cbc.service b/contrib/systemd/osmo-cbc.service index 037b04f..fb01039 100644 --- a/contrib/systemd/osmo-cbc.service +++ b/contrib/systemd/osmo-cbc.service @@ -8,6 +8,8 @@ StateDirectory=osmocom WorkingDirectory=%S/osmocom Restart=always +User=osmocom +Group=osmocom ExecStart=/usr/bin/osmo-cbc -c /etc/osmocom/osmo-cbc.cfg RestartSec=2 diff --git a/debian/control b/debian/control index a1b7f04..e3937e5 100644 --- a/debian/control +++ b/debian/control @@ -25,7 +25,7 @@ Package: osmo-cbc Architecture: any Multi-Arch: foreign -Depends: ${misc:Depends}, ${shlibs:Depends} +Depends: ${misc:Depends}, ${shlibs:Depends}, adduser Description: OsmoCBC: Osmocom's Cell Broadcast Center Package: osmo-cbc-utils diff --git a/debian/postinst b/debian/postinst new file mode 100755 index 0000000..1894ff7 --- /dev/null +++ b/debian/postinst @@ -0,0 +1,39 @@ +#!/bin/sh -e +# Create 'osmocom' user and group (if it doesn't exist yet) and adjust permissions +# of directories which are not automatically adjusted by systemd from previous (root-owned) +# install. + +# N. B: the user is intentionally NOT removed during package uninstall: +# see https://wiki.debian.org/AccountHandlingInMaintainerScripts for reasoning. +chperms() { + # chperms <user> <group> <perms> <file> + if ! OVERRIDE=`dpkg-statoverride --list $4 2>&1`; then + if [ -e $4 ]; then + chown $1:$2 $4 + chmod $3 $4 + fi + fi +} + +case "$1" in + configure) + if ! getent passwd osmocom > /dev/null; then + adduser --quiet \ + --system \ + --group \ + --no-create-home \ + --disabled-password \ + --home /var/lib/osmocom \ + --gecos "Open Source Mobile Communications" \ + osmocom + fi +# Set permissions according to https://www.debian.org/doc/debian-policy/ch-files.html#s-permissions-owners + chperms osmocom osmocom 0660 /etc/osmocom/osmo-cbc.cfg + chperms root osmocom 2775 /etc/osmocom + + ;; +esac + +# dh_installdeb(1) will replace this with shell code automatically +# generated by other debhelper scripts. +#DEBHELPER# -- To view, visit https://gerrit.osmocom.org/c/osmo-cbc/+/29717?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-cbc Gerrit-Branch: master Gerrit-Change-Id: Ifcc882125a22d8f2e1bfcd19622aed4e8a723e6c Gerrit-Change-Number: 29717 Gerrit-PatchSet: 3 Gerrit-Owner: msuraev <msuraev(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
[M] Change in osmo-cbc[master]: .deb/.rpm: add osmocom user during package install
by osmith 25 Apr '24

25 Apr '24
Attention is currently required from: msuraev. osmith has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-cbc/+/29717?usp=email ) Change subject: .deb/.rpm: add osmocom user during package install ...................................................................... Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmo-cbc/+/29717?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-cbc Gerrit-Branch: master Gerrit-Change-Id: Ifcc882125a22d8f2e1bfcd19622aed4e8a723e6c Gerrit-Change-Number: 29717 Gerrit-PatchSet: 3 Gerrit-Owner: msuraev <msuraev(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: msuraev <msuraev(a)sysmocom.de> Gerrit-Comment-Date: Thu, 25 Apr 2024 08:35:05 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[S] Change in docker-playground[master]: ttcn3-sgsn-test-sns: add missing symlink to osmo-stp.cfg
by osmith 25 Apr '24

25 Apr '24
Attention is currently required from: fixeria, pespin. osmith has posted comments on this change. ( https://gerrit.osmocom.org/c/docker-playground/+/36635?usp=email ) Change subject: ttcn3-sgsn-test-sns: add missing symlink to osmo-stp.cfg ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/docker-playground/+/36635?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: docker-playground Gerrit-Branch: master Gerrit-Change-Id: Ie0f887dc68e89d2fa1f9a2ee8dfd7f8ce71fc329 Gerrit-Change-Number: 36635 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Thu, 25 Apr 2024 08:28:18 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[S] Change in osmo-ci[master]: repo-install-test: centos8: fix almalinux keys
by osmith 25 Apr '24

25 Apr '24
osmith has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ci/+/36630?usp=email ) Change subject: repo-install-test: centos8: fix almalinux keys ...................................................................... repo-install-test: centos8: fix almalinux keys Run "dnf upgrade almalinux-release" inside centos8/almalinux8 to upgrade the gpg keys first, in order to prevent gpg key errors while installing packages. We are not running repo-install-test for centos8 in CI anymore (SYS#6759), but I'm currently using this configuration to manually test that fixing permissions during upgrade and running systemd services as users works as expected on an rpm-based system. Related: OS#4107 Related: https://almalinux.org/blog/2023-12-20-almalinux-8-key-update/ Change-Id: Ia06d24ce7ce48651f5a41489e78b5b55dc2d3921 --- M scripts/repo-install-test.sh 1 file changed, 28 insertions(+), 0 deletions(-) Approvals: fixeria: Looks good to me, approved Jenkins Builder: Verified pespin: Looks good to me, but someone else must approve laforge: Looks good to me, but someone else must approve diff --git a/scripts/repo-install-test.sh b/scripts/repo-install-test.sh index 7bef5bf..66604f6 100755 --- a/scripts/repo-install-test.sh +++ b/scripts/repo-install-test.sh @@ -137,6 +137,15 @@ "$@" } +qemu_prepare_vm() { + case "$DISTRO" in + centos8) + # https://almalinux.org/blog/2023-12-20-almalinux-8-key-update/ + qemu_ssh dnf upgrade -y almalinux-release + ;; + esac +} + qemu_run_test_script() { cat <<- EOF > "$TEST_DIR/run-inside-env.sh" #!/bin/sh -ex @@ -268,4 +277,5 @@ echo set -x +qemu_prepare_vm qemu_run_test_script -- To view, visit https://gerrit.osmocom.org/c/osmo-ci/+/36630?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Change-Id: Ia06d24ce7ce48651f5a41489e78b5b55dc2d3921 Gerrit-Change-Number: 36630 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
[S] Change in docker-playground[master]: ttcn3-sgsn-test-sns: add missing symlink to osmo-stp.cfg
by fixeria 25 Apr '24

25 Apr '24
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/docker-playground/+/36635?usp=email ) Change subject: ttcn3-sgsn-test-sns: add missing symlink to osmo-stp.cfg ...................................................................... ttcn3-sgsn-test-sns: add missing symlink to osmo-stp.cfg This commit fixes the following error: cp osmo-stp.cfg /home/osmocom-build/jenkins/workspace/ttcn3-sgsn-test-sns/logs/stp/ cp: cannot stat 'osmo-stp.cfg': No such file or directory Change-Id: Ie0f887dc68e89d2fa1f9a2ee8dfd7f8ce71fc329 Fixes: e4fdd72 "ttcn3-sgsn-test-sns: add missing symlink to osmo-stp.cfg" --- A ttcn3-sgsn-test-sns/osmo-stp.cfg 1 file changed, 16 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/docker-playground refs/changes/35/36635/1 diff --git a/ttcn3-sgsn-test-sns/osmo-stp.cfg b/ttcn3-sgsn-test-sns/osmo-stp.cfg new file mode 120000 index 0000000..6760339 --- /dev/null +++ b/ttcn3-sgsn-test-sns/osmo-stp.cfg @@ -0,0 +1 @@ +../ttcn3-sgsn-test/osmo-stp.cfg \ No newline at end of file -- To view, visit https://gerrit.osmocom.org/c/docker-playground/+/36635?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: docker-playground Gerrit-Branch: master Gerrit-Change-Id: Ie0f887dc68e89d2fa1f9a2ee8dfd7f8ce71fc329 Gerrit-Change-Number: 36635 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[S] Change in osmo-hnbgw[master]: drop legacy hack: do not start MGW endp in loopback mode
by neels 24 Apr '24

24 Apr '24
neels has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-hnbgw/+/36634?usp=email ) Change subject: drop legacy hack: do not start MGW endp in loopback mode ...................................................................... drop legacy hack: do not start MGW endp in loopback mode We used to tell osmo-mgw to create an IuUP endpoint in loopback mode, in order to hack it into responding to an IuUP Initialization. The loopback mode here in osmo-hnbgw is a leftover from that hack. Drop it. Change-Id: I0eca75d7abf66f8b9fde9c68ec10d4265f64a189 --- M TODO-RELEASE M src/osmo-hnbgw/mgw_fsm.c 2 files changed, 18 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hnbgw refs/changes/34/36634/1 diff --git a/TODO-RELEASE b/TODO-RELEASE index b5a838d..a80e188 100644 --- a/TODO-RELEASE +++ b/TODO-RELEASE @@ -7,4 +7,7 @@ # If any interfaces have been added since the last public release: c:r:a + 1. # If any interfaces have been removed or changed since the last public release: c:r:0. #library what description / commit summary line -osmo-iuh >1.5.0 proper decoding of X.213 IPv4 address len=7 \ No newline at end of file +osmo-iuh >1.5.0 proper decoding of X.213 IPv4 address len=7 + +MGW MGCP CRCX osmo-hnbgw used to CRCX in loopback mode, to trigger a legacy IuUP hack. CRCX is no + longer in loopback mode now, so older osmo-mgw may fail to respond to IuUP Initialization. diff --git a/src/osmo-hnbgw/mgw_fsm.c b/src/osmo-hnbgw/mgw_fsm.c index d0dc6df..48b4899 100644 --- a/src/osmo-hnbgw/mgw_fsm.c +++ b/src/osmo-hnbgw/mgw_fsm.c @@ -175,7 +175,7 @@ mgw_info = (struct mgcp_conn_peer) { .call_id = (map->rua_ctx_id << 8) | mgw_fsm_priv->rab_id, .ptime = 20, - .conn_mode = MGCP_CONN_LOOPBACK, + .conn_mode = MGCP_CONN_RECV_SEND, }; mgw_info.codecs[0] = CODEC_IUFP; mgw_info.codecs_len = 1; -- To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/36634?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hnbgw Gerrit-Branch: master Gerrit-Change-Id: I0eca75d7abf66f8b9fde9c68ec10d4265f64a189 Gerrit-Change-Number: 36634 Gerrit-PatchSet: 1 Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[M] Change in osmo-mgw[master]: mgcp-client: always send 'm=audio' line
by neels 24 Apr '24

24 Apr '24
neels has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-mgw/+/36633?usp=email ) Change subject: mgcp-client: always send 'm=audio' line ...................................................................... mgcp-client: always send 'm=audio' line Re-add the m=audio line to SDP emitted from libosmo-mgcp-client, even if the audio port is not set yet Patch a5acaa68db4cc26e342069ad2ef37c1b09e1efc2 introduced a presence flag for the RTP audio port number. This flag, when unset, also omitted the 'm=audio...' line completely, dropping the PT number definitions. Correct: m=audio 1234 RTP/AVP 96 <--- anounce 96 a=rtpmap:96 VND.3GPP.IUFP/16000 <--- further specify 96 a=fmtp:96 ... <--- further specify 96 When m=audio is missing, we only have orphaned rtpmap and fmtp entries. They are supposed to further specify the 96 listed in 'RTP/AVP 96', instead they are without context: a=rtpmap:96 VND.3GPP.IUFP/16000 a=fmtp:96 ... When the presence map indicates no port known, we still need to emit the list of PT numbers; so we're forced to send a port of 0: m=audio 0 RTP/AVP 96 a=rtpmap:96 VND.3GPP.IUFP/16000 a=fmtp:96 ... This is an important fix for osmo-hnbgw, which sends the first CRCX with an IUFP codec. osmo-mgw requires this to accept incoming IuUP Initializaition requests. When m=audio is missing, osmo-mgw does not parse the IUFP codec, and 3G voice fails completely. This mgcp-client patch will emit valid codec config also when port == 0, fixing osmo-hnbgw voice, because osmo-mgw will know about IUFP from the start. Related: SYS#6907 Related: osmo-mgw a5acaa68db4cc26e342069ad2ef37c1b09e1efc2 Change-Id: Id95b629453aec999100b5af821c6a0b9562bb597 --- M src/libosmo-mgcp-client/mgcp_client.c 1 file changed, 58 insertions(+), 10 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/33/36633/1 diff --git a/src/libosmo-mgcp-client/mgcp_client.c b/src/libosmo-mgcp-client/mgcp_client.c index 8b311d3..a9ad4c0 100644 --- a/src/libosmo-mgcp-client/mgcp_client.c +++ b/src/libosmo-mgcp-client/mgcp_client.c @@ -1315,6 +1315,7 @@ int local_ip_family, audio_ip_family; const char *codec; unsigned int pt; + uint16_t audio_port; #define MSGB_PRINTF_OR_RET(FMT, ARGS...) do { \ if (msgb_printf(msg, FMT, ##ARGS) != 0) { \ @@ -1366,17 +1367,19 @@ MSGB_PRINTF_OR_RET("t=0 0\r\n"); /* Add RTP address port and codecs */ - if (mgcp_msg->presence & MGCP_MSG_PRESENCE_AUDIO_PORT) { - if (mgcp_msg->audio_port == 0) { - LOGPMGW(mgcp, LOGL_ERROR, - "Invalid port number, can not generate MGCP message\n"); - return -EINVAL; - } - MSGB_PRINTF_OR_RET("m=audio %u RTP/AVP", mgcp_msg->audio_port); - for (i = 0; i < mgcp_msg->ptmap_len; i++) - MSGB_PRINTF_OR_RET(" %u", mgcp_msg->ptmap[i].pt); - MSGB_PRINTF_OR_RET("\r\n"); + audio_port = 0; + if ((mgcp_msg->presence & MGCP_MSG_PRESENCE_AUDIO_PORT)) { + audio_port = mgcp_msg->audio_port; + if (!audio_port) { + LOGPMGW(mgcp, LOGL_ERROR, + "Invalid port number, can not generate MGCP message\n"); + return -EINVAL; + } } + MSGB_PRINTF_OR_RET("m=audio %u RTP/AVP", audio_port); + for (i = 0; i < mgcp_msg->ptmap_len; i++) + MSGB_PRINTF_OR_RET(" %u", mgcp_msg->ptmap[i].pt); + MSGB_PRINTF_OR_RET("\r\n"); /* Add optional codec parameters (fmtp) */ if (mgcp_msg->param_present) { -- To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/36633?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Change-Id: Id95b629453aec999100b5af821c6a0b9562bb597 Gerrit-Change-Number: 36633 Gerrit-PatchSet: 1 Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[M] Change in libosmocore[master]: osmo_io: Add iofd param to segmentation_cb
by pespin 24 Apr '24

24 Apr '24
pespin has submitted this change. ( https://gerrit.osmocom.org/c/libosmocore/+/36582?usp=email ) Change subject: osmo_io: Add iofd param to segmentation_cb ...................................................................... osmo_io: Add iofd param to segmentation_cb See related ticket for full rant and historical facts about this callback. Since anyway we are still developing osmo_io stuff and there will be ABI breaks when releasing new version, let's udpate the callback signature too. Related: OS#6437 Change-Id: Ib8d77e30b1ea759ee5ac2a69d704e81ea71e3079 --- M include/osmocom/core/osmo_io.h M src/core/osmo_io.c 2 files changed, 53 insertions(+), 7 deletions(-) Approvals: laforge: Looks good to me, but someone else must approve Jenkins Builder: Verified fixeria: Looks good to me, but someone else must approve pespin: Looks good to me, approved diff --git a/include/osmocom/core/osmo_io.h b/include/osmocom/core/osmo_io.h index 8c931dd..6f4dfa8 100644 --- a/include/osmocom/core/osmo_io.h +++ b/include/osmocom/core/osmo_io.h @@ -100,6 +100,7 @@ * \param[in] msg message buffer containing the read data. Ownership is transferred to the * call-back, and it must make sure to msgb_free() it eventually! */ void (*read_cb)(struct osmo_io_fd *iofd, int res, struct msgb *msg); + /*! completion call-back function when write issued via osmo_iofd_write_msgb() has completed * on fd. Only valid in OSMO_IO_FD_MODE_READ_WRITE. * \param[in] iofd on which a write() has completed. @@ -108,9 +109,14 @@ * call-back; it is automatically freed after the call-back terminates! */ void (*write_cb)(struct osmo_io_fd *iofd, int res, struct msgb *msg); - /*! optional call-back function to segment the data at message boundaries. This is useful when - * message boundaries are to be preserved over a SOCK_STREAM transport socket like TCP. Can - * be NULL for any application not requiring de-segmentation of received data. + + /*! optional call-back function to segment the data at message boundaries. + * \param[in] msg message buffer whose data is to be segmented + * \returns See full function description. + * + * This is useful when message boundaries are to be preserved over a SOCK_STREAM transport + * socket like TCP. Can be NULL for any application not requiring de-segmentation of + * received data. * * The call-back needs to return the size of the next message. If it returns * -EAGAIN or a value larger than msgb_length() (message is incomplete) @@ -119,8 +125,26 @@ * If a full message was received (segmentation_cb() returns a value <= msgb_length()) * the msgb will be trimmed to size by osmo_io and forwarded to the read call-back. Any * parsing done to the msgb by segmentation_cb() will be preserved for the read_cb() - * (e.g. setting lxh or msgb->cb). */ + * (e.g. setting lxh or msgb->cb). + * + * Only one (or none) of both segmentation_cb and segmentation_cb2 shall be set. + * Having both set will be considered an error during iofd setup. */ int (*segmentation_cb)(struct msgb *msg); + + /*! optional call-back function to segment the data at message boundaries. + * \param[in] iofd handling msg + * \param[in] msg message buffer whose data is to be segmented + * \returns See full function description. + * + * Same as segmentation_cb above, with an extra parameter to have access to the iofd and its + * related functionalities (eg data pointer). This is useful for users requiring to store + * global state or access external objects while segmenting. + * + * The provided iofd shall not be freed by the user during the callback. + * + * Only one (or none) of both segmentation_cb and segmentation_cb2 shall be set. + * Having both set will be considered an error during iofd setup. */ + int (*segmentation_cb2)(struct osmo_io_fd *iofd, struct msgb *msg); }; /* mode OSMO_IO_FD_MODE_RECVFROM_SENDTO: */ diff --git a/src/core/osmo_io.c b/src/core/osmo_io.c index b589cb7..af096e6 100644 --- a/src/core/osmo_io.c +++ b/src/core/osmo_io.c @@ -267,7 +267,7 @@ */ static enum iofd_seg_act iofd_handle_segmentation(struct osmo_io_fd *iofd, struct msgb *msg, struct msgb **pending_out) { - int extra_len, received_len; + int extra_len, received_len, expected_len; struct msgb *msg_pending; /* Save the start of message before segmentation_cb (which could change it) */ @@ -275,12 +275,15 @@ received_len = msgb_length(msg); - if (!iofd->io_ops.segmentation_cb) { + if (iofd->io_ops.segmentation_cb2) { + expected_len = iofd->io_ops.segmentation_cb2(iofd, msg); + } else if (iofd->io_ops.segmentation_cb) { + expected_len = iofd->io_ops.segmentation_cb(msg); + } else { *pending_out = NULL; return IOFD_SEG_ACT_HANDLE_ONE; } - int expected_len = iofd->io_ops.segmentation_cb(msg); if (expected_len == -EAGAIN) { goto defer; } else if (expected_len < 0) { @@ -599,6 +602,9 @@ return false; if (ops->recvmsg_cb || ops->sendmsg_cb) return false; + /* Forbid both segementation_cb set, something is wrong: */ + if (ops->segmentation_cb && ops->segmentation_cb2) + return false; break; case OSMO_IO_FD_MODE_RECVFROM_SENDTO: if (ops->read_cb || ops->write_cb) -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/36582?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: Ib8d77e30b1ea759ee5ac2a69d704e81ea71e3079 Gerrit-Change-Number: 36582 Gerrit-PatchSet: 4 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel <daniel(a)totalueberwachung.de> Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: jolly <andreas(a)eversberg.eu> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • ...
  • 113
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.