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

November 2022

  • 2 participants
  • 2503 discussions
Change in osmo-pcu[master]: Split tbf_fsm as tbf_{ul,dl}_fsm
by pespin 21 Nov '22

21 Nov '22
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-pcu/+/30220 ) Change subject: Split tbf_fsm as tbf_{ul,dl}_fsm ...................................................................... Split tbf_fsm as tbf_{ul,dl}_fsm The 2 types of TBF share some parts of the implementation, but actually half of the code is specific to one direction or another. Since FSM are becoming (and will become even) more complex, split the FSM implementation into 2 separate FSMs, one for each direction. The FSM interface is kept compatible (events and states), hence code can still operate on the tbfs on events and states which are shared. Test output changes are mainly due to: * FSM instance now created in subclass constructor, so order of log lines during constructor of parent class and subclass slightly changes. * osmo_fsm doesn't allow having 2 FSM types with same name registered, hence the "TBF" name has to be changed to "DL_TBF" and "UL_TBF" for each FSM class. * FSM classes now use DTBFUL and DTBFDL instead of DTBF for logging. Some tests don't have those categories enabled, hence some log lines dissappear (it's actually fine we don't care about those in the test cases). Change-Id: I879af3f4b3e330687d498cd59f5f4933d6ca56f0 --- M src/Makefile.am M src/pcu_vty_functions.cpp M src/tbf.cpp M src/tbf.h M src/tbf_dl.cpp M src/tbf_dl.h A src/tbf_dl_fsm.c M src/tbf_fsm.c M src/tbf_fsm.h M src/tbf_ul.cpp M src/tbf_ul.h A src/tbf_ul_fsm.c M tests/alloc/AllocTest.err M tests/tbf/TbfTest.err M tests/types/TypesTest.err 15 files changed, 1,472 insertions(+), 100,908 deletions(-) Approvals: Jenkins Builder: Verified laforge: Looks good to me, but someone else must approve osmith: Looks good to me, but someone else must approve pespin: Looks good to me, approved -- To view, visit https://gerrit.osmocom.org/c/osmo-pcu/+/30220 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Change-Id: I879af3f4b3e330687d498cd59f5f4933d6ca56f0 Gerrit-Change-Number: 30220 Gerrit-PatchSet: 3 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: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-CC: msuraev <msuraev(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
Change in osmo-pcu[master]: Split tbf_fsm as tbf_{ul,dl}_fsm
by pespin 21 Nov '22

21 Nov '22
Attention is currently required from: osmith, fixeria, msuraev. pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-pcu/+/30220 ) Change subject: Split tbf_fsm as tbf_{ul,dl}_fsm ...................................................................... Patch Set 3: Code-Review+2 (1 comment) File src/tbf_dl_fsm.c: https://gerrit.osmocom.org/c/osmo-pcu/+/30220/comment/99a7e1f4_8f12869f PS3, Line 182: osmo_fsm_inst_dispatch(tbf_ul_ass_fi(ctx->tbf), TBF_UL_ASS_EV_ABORT, NULL); > just to be sure, dispatching to the UL FSM is done on purpose here? Yes a DL TBF can be used to assign a new UL TBF through PACCH. -- To view, visit https://gerrit.osmocom.org/c/osmo-pcu/+/30220 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Change-Id: I879af3f4b3e330687d498cd59f5f4933d6ca56f0 Gerrit-Change-Number: 30220 Gerrit-PatchSet: 3 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: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-CC: msuraev <msuraev(a)sysmocom.de> Gerrit-Attention: osmith <osmith(a)sysmocom.de> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Attention: msuraev <msuraev(a)sysmocom.de> Gerrit-Comment-Date: Mon, 21 Nov 2022 11:26:49 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: Yes Comment-In-Reply-To: osmith <osmith(a)sysmocom.de> Gerrit-MessageType: comment
1 0
0 0
Change in docker-playground[master]: ttcn3-{pgw,ggsn}-test: Update smf.yml with new metrics section location
by osmith 21 Nov '22

21 Nov '22
Attention is currently required from: pespin. osmith has posted comments on this change. ( https://gerrit.osmocom.org/c/docker-playground/+/30249 ) Change subject: ttcn3-{pgw,ggsn}-test: Update smf.yml with new metrics section location ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/docker-playground/+/30249 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: docker-playground Gerrit-Branch: master Gerrit-Change-Id: Iae16bfccfbaaed37701e671ba619f8082f55506d Gerrit-Change-Number: 30249 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Mon, 21 Nov 2022 11:15:52 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
Change in osmo-pcu[master]: Split tbf_fsm as tbf_{ul,dl}_fsm
by osmith 21 Nov '22

21 Nov '22
Attention is currently required from: pespin, fixeria, msuraev. osmith has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-pcu/+/30220 ) Change subject: Split tbf_fsm as tbf_{ul,dl}_fsm ...................................................................... Patch Set 3: Code-Review+1 (1 comment) File src/tbf_dl_fsm.c: https://gerrit.osmocom.org/c/osmo-pcu/+/30220/comment/f947d01c_4e1c185a PS3, Line 182: osmo_fsm_inst_dispatch(tbf_ul_ass_fi(ctx->tbf), TBF_UL_ASS_EV_ABORT, NULL); just to be sure, dispatching to the UL FSM is done on purpose here? -- To view, visit https://gerrit.osmocom.org/c/osmo-pcu/+/30220 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Change-Id: I879af3f4b3e330687d498cd59f5f4933d6ca56f0 Gerrit-Change-Number: 30220 Gerrit-PatchSet: 3 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: osmith <osmith(a)sysmocom.de> Gerrit-CC: msuraev <msuraev(a)sysmocom.de> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Attention: msuraev <msuraev(a)sysmocom.de> Gerrit-Comment-Date: Mon, 21 Nov 2022 11:14:44 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
Change in libosmo-pfcp[master]: tests: use 'check_PROGRAMS' instead of 'noinst_PROGRAMS'
by fixeria 21 Nov '22

21 Nov '22
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-pfcp/+/30250 ) Change subject: tests: use 'check_PROGRAMS' instead of 'noinst_PROGRAMS' ...................................................................... tests: use 'check_PROGRAMS' instead of 'noinst_PROGRAMS' When using 'check_PROGRAMS', autoconf/automake generates smarter Makefiles, so that the test programs are not being compiled during the normal 'make all', but only during 'make check'. Change-Id: I62a7b4d76c910b3fa90deb0d35a8fc36146d66e6 --- M tests/libosmo-gtlv/Makefile.am M tests/libosmo-gtlv/test_gtlv_gen/Makefile.am M tests/libosmo-gtlv/test_tliv/Makefile.am M tests/libosmo-pfcp/Makefile.am 4 files changed, 4 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-pfcp refs/changes/50/30250/1 diff --git a/tests/libosmo-gtlv/Makefile.am b/tests/libosmo-gtlv/Makefile.am index 20721c0..d73f940 100644 --- a/tests/libosmo-gtlv/Makefile.am +++ b/tests/libosmo-gtlv/Makefile.am @@ -13,7 +13,7 @@ $(LIBOSMOCORE_CFLAGS) \ $(NULL) -noinst_PROGRAMS = \ +check_PROGRAMS = \ gtlv_test \ gtlv_dec_enc_test \ $(NULL) diff --git a/tests/libosmo-gtlv/test_gtlv_gen/Makefile.am b/tests/libosmo-gtlv/test_gtlv_gen/Makefile.am index e13e7b5..9f791fe 100644 --- a/tests/libosmo-gtlv/test_gtlv_gen/Makefile.am +++ b/tests/libosmo-gtlv/test_gtlv_gen/Makefile.am @@ -9,7 +9,7 @@ $(LIBOSMOCORE_CFLAGS) \ $(NULL) -noinst_PROGRAMS = \ +check_PROGRAMS = \ gen__myproto_ies_auto \ gtlv_gen_test \ $(NULL) diff --git a/tests/libosmo-gtlv/test_tliv/Makefile.am b/tests/libosmo-gtlv/test_tliv/Makefile.am index 458a410..5b7dd7c 100644 --- a/tests/libosmo-gtlv/test_tliv/Makefile.am +++ b/tests/libosmo-gtlv/test_tliv/Makefile.am @@ -9,7 +9,7 @@ $(LIBOSMOCORE_CFLAGS) \ $(NULL) -noinst_PROGRAMS = \ +check_PROGRAMS = \ gen__myproto_ies_auto \ tliv_test \ $(NULL) diff --git a/tests/libosmo-pfcp/Makefile.am b/tests/libosmo-pfcp/Makefile.am index 6f3eca1..b393d52 100644 --- a/tests/libosmo-pfcp/Makefile.am +++ b/tests/libosmo-pfcp/Makefile.am @@ -9,7 +9,7 @@ $(LIBOSMOCORE_CFLAGS) \ $(NULL) -noinst_PROGRAMS = \ +check_PROGRAMS = \ pfcp_test \ $(NULL) -- To view, visit https://gerrit.osmocom.org/c/libosmo-pfcp/+/30250 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-pfcp Gerrit-Branch: master Gerrit-Change-Id: I62a7b4d76c910b3fa90deb0d35a8fc36146d66e6 Gerrit-Change-Number: 30250 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
Change in osmo-bts[master]: osmux: Use new osmux_xfrm_input API to set name on each link
by pespin 21 Nov '22

21 Nov '22
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bts/+/30213 ) Change subject: osmux: Use new osmux_xfrm_input API to set name on each link ...................................................................... osmux: Use new osmux_xfrm_input API to set name on each link Change-Id: Iaea980a2e11282add12f9af585500d90f0462279 Depends: libosmo-netif.git Change-Id 8bb688e4827f345416c2a4526ced956a07fcc60b --- M src/common/osmux.c 1 file changed, 4 insertions(+), 0 deletions(-) Approvals: fixeria: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/common/osmux.c b/src/common/osmux.c index fa0f7cc..9d3c5ed 100644 --- a/src/common/osmux.c +++ b/src/common/osmux.c @@ -165,6 +165,7 @@ static struct osmux_handle *osmux_handle_alloc(struct gsm_bts *bts, const struct osmo_sockaddr *rem_addr) { struct osmux_handle *h; + char name[128] = "r="; h = talloc_zero(bts, struct osmux_handle); if (!h) @@ -178,6 +179,9 @@ talloc_free(h); return NULL; } + + osmo_sockaddr_to_str_buf(name + 2, sizeof(name) - 2, rem_addr); + osmux_xfrm_input_set_name(h->in, name); /* sequence number to start OSMUX message from */ osmux_xfrm_input_set_initial_seqnum(h->in, 0); osmux_xfrm_input_set_batch_factor(h->in, bts->osmux.batch_factor); -- To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/30213 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Change-Id: Iaea980a2e11282add12f9af585500d90f0462279 Gerrit-Change-Number: 30213 Gerrit-PatchSet: 2 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> Gerrit-MessageType: merged
1 0
0 0
Change in osmo-mgw[master]: osmux: Use new osmux_xfrm_input API to set name on each link
by pespin 21 Nov '22

21 Nov '22
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-mgw/+/30212 ) Change subject: osmux: Use new osmux_xfrm_input API to set name on each link ...................................................................... osmux: Use new osmux_xfrm_input API to set name on each link Depends: libosmo-netif.git Change-Id 8bb688e4827f345416c2a4526ced956a07fcc60b Change-Id: Id5b7d497be4b3405403d30e40e1a52f13101cf5f --- M src/libosmo-mgcp/mgcp_osmux.c 1 file changed, 4 insertions(+), 0 deletions(-) Approvals: fixeria: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/libosmo-mgcp/mgcp_osmux.c b/src/libosmo-mgcp/mgcp_osmux.c index fcff841..185aecd 100644 --- a/src/libosmo-mgcp/mgcp_osmux.c +++ b/src/libosmo-mgcp/mgcp_osmux.c @@ -155,6 +155,7 @@ { struct osmux_handle *h; const struct mgcp_config *cfg = trunk->cfg; + char name[128] = "r="; h = talloc_zero(trunk, struct osmux_handle); if (!h) @@ -167,6 +168,9 @@ talloc_free(h); return NULL; } + + osmo_sockaddr_to_str_buf(name + 2, sizeof(name) - 2, rem_addr); + osmux_xfrm_input_set_name(h->in, name); /* sequence number to start OSMUX message from */ osmux_xfrm_input_set_initial_seqnum(h->in, 0); osmux_xfrm_input_set_batch_factor(h->in, cfg->osmux.batch_factor); -- To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/30212 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Change-Id: Id5b7d497be4b3405403d30e40e1a52f13101cf5f Gerrit-Change-Number: 30212 Gerrit-PatchSet: 2 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> Gerrit-MessageType: merged
1 0
0 0
Change in docker-playground[master]: ttcn3-{pgw,ggsn}-test: Update smf.yml with new metrics section location
by pespin 21 Nov '22

21 Nov '22
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/docker-playground/+/30249 ) Change subject: ttcn3-{pgw,ggsn}-test: Update smf.yml with new metrics section location ...................................................................... ttcn3-{pgw,ggsn}-test: Update smf.yml with new metrics section location The "metrics" section was moved inside each program node to avoid clashes when several network programs are run in the same process and use the same config file. Depends: open5gs.git 2d4fbf92eb1be9ffe84df6dc103ee7401d1d3b0f Change-Id: Iae16bfccfbaaed37701e671ba619f8082f55506d --- M ttcn3-ggsn-test/ogs/open5gs-smf.yaml M ttcn3-pgw-test/open5gs-smf.yaml 2 files changed, 20 insertions(+), 29 deletions(-) git pull ssh://gerrit.osmocom.org:29418/docker-playground refs/changes/49/30249/1 diff --git a/ttcn3-ggsn-test/ogs/open5gs-smf.yaml b/ttcn3-ggsn-test/ogs/open5gs-smf.yaml index 9d47250..38579be 100644 --- a/ttcn3-ggsn-test/ogs/open5gs-smf.yaml +++ b/ttcn3-ggsn-test/ogs/open5gs-smf.yaml @@ -109,6 +109,13 @@ # gtpu: # name: localhost # +# <Metrics Server> +# +# o Metrics Server(http://<any address>:9090) +# metrics: +# addr: 0.0.0.0 +# port: 9090 +# # <Subnet for UE Pool> # # o IPv4 Pool @@ -342,6 +349,9 @@ port: 2152 option: so_bindtodevice: eth0 + metrics: + addr: 172.18.3.201 + port: 9090 subnet: - addr: 176.16.16.1/20 dnn: internet @@ -351,7 +361,6 @@ dnn: inet46 - addr: 2001:780:44:2100:0:0:0:1/56 dnn: inet46 - dns: - 172.18.3.222 - 8.8.8.8 @@ -533,17 +542,3 @@ # handover: # duration: 500 time: - -# -# metrics: -# -# <Metrics Server> -# -# o Metrics Server(http://<any address>:9090) -# metrics: -# addr: 0.0.0.0 -# port: 9090 -# -metrics: - addr: 172.18.3.201 - port: 9090 diff --git a/ttcn3-pgw-test/open5gs-smf.yaml b/ttcn3-pgw-test/open5gs-smf.yaml index b637aee..ac8bd80 100644 --- a/ttcn3-pgw-test/open5gs-smf.yaml +++ b/ttcn3-pgw-test/open5gs-smf.yaml @@ -109,6 +109,13 @@ # gtpu: # name: localhost # +# <Metrics Server> +# +# o Metrics Server(http://<any address>:9090) +# metrics: +# addr: 0.0.0.0 +# port: 9090 +# # <Subnet for UE Pool> # # o IPv4 Pool @@ -337,6 +344,9 @@ - addr: 172.18.18.4 gtpu: - addr: 172.18.18.4 + metrics: + addr: 172.18.18.4 + port: 9090 subnet: - addr: 10.45.0.1/16 dnn: internet @@ -521,17 +531,3 @@ # handover: # duration: 500 time: - -# -# metrics: -# -# <Metrics Server> -# -# o Metrics Server(http://<any address>:9090) -# metrics: -# addr: 0.0.0.0 -# port: 9090 -# -metrics: - addr: 172.18.18.4 - port: 9090 -- To view, visit https://gerrit.osmocom.org/c/docker-playground/+/30249 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: docker-playground Gerrit-Branch: master Gerrit-Change-Id: Iae16bfccfbaaed37701e671ba619f8082f55506d Gerrit-Change-Number: 30249 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
Change in libosmo-netif[master]: osmux: Check received osmuxh->amr_ft is correct before using it
by pespin 21 Nov '22

21 Nov '22
pespin has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-netif/+/30224 ) Change subject: osmux: Check received osmuxh->amr_ft is correct before using it ...................................................................... osmux: Check received osmuxh->amr_ft is correct before using it Fixes: Coverity CID#283432 Change-Id: Iab525c5b7eb1e455a8229fb39e96897aac53298c --- M src/osmux_output.c 1 file changed, 5 insertions(+), 0 deletions(-) Approvals: Jenkins Builder: Verified laforge: Looks good to me, approved fixeria: Looks good to me, but someone else must approve osmith: Looks good to me, but someone else must approve msuraev: Looks good to me, but someone else must approve diff --git a/src/osmux_output.c b/src/osmux_output.c index a6e6513..6b9f451 100644 --- a/src/osmux_output.c +++ b/src/osmux_output.c @@ -68,6 +68,11 @@ case OSMUX_FT_VOICE_AMR: break; case OSMUX_FT_DUMMY: + if (!osmo_amr_ft_valid(osmuxh->amr_ft)) { + LOGP(DLMUX, LOGL_ERROR, "Discarding bad Dummy FT: amr_ft=%u\n", + osmuxh->amr_ft); + return NULL; + } len = osmux_ft_dummy_size(osmuxh->amr_ft, osmuxh->ctr + 1); if (msgb_length(msg) < len) { LOGP(DLMUX, LOGL_ERROR, "Discarding bad Dummy FT: %s\n", 3 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one. -- To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/30224 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Change-Id: Iab525c5b7eb1e455a8229fb39e96897aac53298c Gerrit-Change-Number: 30224 Gerrit-PatchSet: 4 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: msuraev <msuraev(a)sysmocom.de> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
Change in libosmo-netif[master]: osmux: Refactor osmux_xfrm_output_pull() to simplify code flow
by pespin 21 Nov '22

21 Nov '22
pespin has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-netif/+/30225 ) Change subject: osmux: Refactor osmux_xfrm_output_pull() to simplify code flow ...................................................................... osmux: Refactor osmux_xfrm_output_pull() to simplify code flow Change-Id: I0da1d7875bd32f6c1022676b64f9f0d14bad3144 --- M src/osmux_output.c 1 file changed, 34 insertions(+), 39 deletions(-) Approvals: Jenkins Builder: Verified pespin: Looks good to me, but someone else must approve laforge: Looks good to me, approved msuraev: Looks good to me, but someone else must approve osmith: Looks good to me, but someone else must approve diff --git a/src/osmux_output.c b/src/osmux_output.c index 6b9f451..33d977b 100644 --- a/src/osmux_output.c +++ b/src/osmux_output.c @@ -57,58 +57,53 @@ struct osmux_hdr *osmux_xfrm_output_pull(struct msgb *msg) { struct osmux_hdr *osmuxh; + size_t len; + next: - osmuxh = NULL; - if (msg->len > sizeof(struct osmux_hdr)) { - size_t len; + if (msgb_length(msg) == 0) + return NULL; /* base case, we drained the msg successfully, tell user it is done. */ - osmuxh = (struct osmux_hdr *)msg->data; + if (msgb_length(msg) < sizeof(struct osmux_hdr)) { + LOGP(DLMUX, LOGL_ERROR, "remaining %d bytes, broken osmuxhdr?\n", msgb_length(msg)); + return NULL; + } - switch (osmuxh->ft) { - case OSMUX_FT_VOICE_AMR: - break; - case OSMUX_FT_DUMMY: - if (!osmo_amr_ft_valid(osmuxh->amr_ft)) { - LOGP(DLMUX, LOGL_ERROR, "Discarding bad Dummy FT: amr_ft=%u\n", - osmuxh->amr_ft); - return NULL; - } - len = osmux_ft_dummy_size(osmuxh->amr_ft, osmuxh->ctr + 1); - if (msgb_length(msg) < len) { - LOGP(DLMUX, LOGL_ERROR, "Discarding bad Dummy FT: %s\n", - osmo_hexdump(msg->data, msgb_length(msg))); - return NULL; - } - msgb_pull(msg, len); - goto next; - default: - LOGP(DLMUX, LOGL_ERROR, "Discarding unsupported Osmux FT %d\n", - osmuxh->ft); - return NULL; - } + osmuxh = (struct osmux_hdr *)msgb_data(msg); + switch (osmuxh->ft) { + case OSMUX_FT_VOICE_AMR: if (!osmo_amr_ft_valid(osmuxh->amr_ft)) { - LOGP(DLMUX, LOGL_ERROR, "Discarding bad AMR FT %d\n", - osmuxh->amr_ft); + LOGP(DLMUX, LOGL_ERROR, "Discarding bad AMR FT %d\n", osmuxh->amr_ft); return NULL; } - - len = osmo_amr_bytes(osmuxh->amr_ft) * (osmuxh->ctr+1) + - sizeof(struct osmux_hdr); - + len = osmo_amr_bytes(osmuxh->amr_ft) * (osmuxh->ctr + 1) + sizeof(struct osmux_hdr); if (msgb_length(msg) < len) { LOGP(DLMUX, LOGL_ERROR, "Discarding malformed OSMUX message: %s\n", - osmo_hexdump(msg->data, msgb_length(msg))); + osmo_hexdump(msgb_data(msg), msgb_length(msg))); return NULL; } - msgb_pull(msg, len); - } else if (msg->len > 0) { - LOGP(DLMUX, LOGL_ERROR, - "remaining %d bytes, broken osmuxhdr?\n", msg->len); - } + return osmuxh; - return osmuxh; + case OSMUX_FT_DUMMY: + if (!osmo_amr_ft_valid(osmuxh->amr_ft)) { + LOGP(DLMUX, LOGL_ERROR, "Discarding bad Dummy FT: amr_ft=%u\n", osmuxh->amr_ft); + return NULL; + } + len = osmux_ft_dummy_size(osmuxh->amr_ft, osmuxh->ctr + 1); + if (msgb_length(msg) < len) { + LOGP(DLMUX, LOGL_ERROR, "Discarding bad Dummy FT: %s\n", + osmo_hexdump(msgb_data(msg), msgb_length(msg))); + return NULL; + } + msgb_pull(msg, len); + goto next; + + default: + LOGP(DLMUX, LOGL_ERROR, "Discarding unsupported Osmux FT %d\n", + osmuxh->ft); + return NULL; + } } static struct msgb * 3 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one. -- To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/30225 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Change-Id: I0da1d7875bd32f6c1022676b64f9f0d14bad3144 Gerrit-Change-Number: 30225 Gerrit-PatchSet: 4 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: msuraev <msuraev(a)sysmocom.de> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-CC: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • ...
  • 251
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.