Attention is currently required from: laforge, pespin.
fixeria has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/libosmo-abis/+/38806?usp=email )
Change subject: ipaccess: Simplify code after early return if block
......................................................................
Patch Set 1: Code-Review+2
(1 comment)
Patchset:
PS1:
> Oh yes, in this code, every small step towards clarification helps in not falling below a big rock g […]
It's two unrelated if-blocks, so IMO the patch makes it cleaner. CR+2 from me.
--
To view, visit https://gerrit.osmocom.org/c/libosmo-abis/+/38806?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: libosmo-abis
Gerrit-Branch: master
Gerrit-Change-Id: I406b4f4e973c9b75b102aea3d6fe6aab73d91185
Gerrit-Change-Number: 38806
Gerrit-PatchSet: 1
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-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Mon, 18 Nov 2024 19:33:38 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: laforge <laforge(a)osmocom.org>
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-abis/+/38808?usp=email )
Change subject: ipaccess: Clarify access to msgb ipa payload in code path
......................................................................
ipaccess: Clarify access to msgb ipa payload in code path
The pointer to the data payload is gathered at a later place after the
first byte of the pointer has actually already been read.
Clean it up so that it becomes obvious when and how the payload is
accessed.
Change-Id: I5eac24bdf72021e500c554bdc6d8449bf37d2231
---
M src/input/ipaccess.c
1 file changed, 4 insertions(+), 3 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-abis refs/changes/08/38808/1
diff --git a/src/input/ipaccess.c b/src/input/ipaccess.c
index dc523ef..51e6087 100644
--- a/src/input/ipaccess.c
+++ b/src/input/ipaccess.c
@@ -871,7 +871,10 @@
/* special handling for IPA CCM. */
if (hh->proto == IPAC_PROTO_IPACCESS) {
- uint8_t msg_type = *(msg->l2h);
+ uint8_t *data = msgb_l2(msg);
+ int len = msgb_l2len(msg);
+ OSMO_ASSERT(len > 0);
+ uint8_t msg_type = *data;
/* peek the pong for our keepalive fsm */
if (line && msg_type == IPAC_MSGT_PONG) {
@@ -886,8 +889,6 @@
/* this is a request for identification from the BSC. */
if (msg_type == IPAC_MSGT_ID_GET) {
- uint8_t *data = msgb_l2(msg);
- int len = msgb_l2len(msg);
int trx_nr = 0;
if (link->ofd->priv_nr >= E1INP_SIGN_RSL)
--
To view, visit https://gerrit.osmocom.org/c/libosmo-abis/+/38808?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: libosmo-abis
Gerrit-Branch: master
Gerrit-Change-Id: I5eac24bdf72021e500c554bdc6d8449bf37d2231
Gerrit-Change-Number: 38808
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>