pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-sccp/+/27041 )
Change subject: xua_asp_fsm: Fix gcc false positive warning
......................................................................
xua_asp_fsm: Fix gcc false positive warning
As of GCC 11.1.0, it starts printing a warning about uninitialized
variable. It is a false positive since tmode is really only used in the
case where traffic_mode is not zero, in which case tmode is set.
Let's restrict the scope of tmode to fix the issue and also make it
clearer where the variable is used.
"""
In file included from /git/libosmo-sccp/src/xua_asp_fsm.c:25:
/git/libosmo-sccp/src/xua_asp_fsm.c: In function ‘xua_asp_fsm_inactive’:
/git/libosmo-sccp/include/osmocom/sigtran/osmo_ss7.h:274:16: error: ‘tmode’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
274 | return get_value_string(osmo_ss7_as_traffic_mode_vals, mode);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/git/libosmo-sccp/src/xua_asp_fsm.c:476:39: note: ‘tmode’ was declared here
476 | enum osmo_ss7_as_traffic_mode tmode;
|
"""
Change-Id: I4fc38724aba3a3f178ba0b45444e1394db44d039
---
M src/xua_asp_fsm.c
1 file changed, 1 insertion(+), 2 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/41/27041/1
diff --git a/src/xua_asp_fsm.c b/src/xua_asp_fsm.c
index 5fe1d80..a93dbd2 100644
--- a/src/xua_asp_fsm.c
+++ b/src/xua_asp_fsm.c
@@ -473,7 +473,6 @@
struct osmo_ss7_as *as;
struct xua_msg *xua_in;
uint32_t traf_mode = 0;
- enum osmo_ss7_as_traffic_mode tmode;
struct xua_msg_part *part;
int i;
@@ -515,7 +514,6 @@
peer_send_error(fi, M3UA_ERR_UNSUPP_TRAF_MOD_TYP);
return;
}
- tmode = osmo_ss7_tmode_from_xua(traf_mode);
}
if ((part = xua_msg_find_tag(xua_in, M3UA_IEI_ROUTE_CTX))) {
for (i = 0; i < part->len / sizeof(uint32_t); i++) {
@@ -529,6 +527,7 @@
}
if (traf_mode) { /* if the peer has specified a traffic mode at all */
+ enum osmo_ss7_as_traffic_mode tmode = osmo_ss7_tmode_from_xua(traf_mode);
llist_for_each_entry(as, &asp->inst->as_list, list) {
if (!osmo_ss7_as_has_asp(as, asp))
continue;
--
To view, visit https://gerrit.osmocom.org/c/libosmo-sccp/+/27041
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Change-Id: I4fc38724aba3a3f178ba0b45444e1394db44d039
Gerrit-Change-Number: 27041
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: newchange
Attention is currently required from: pespin.
osmith has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-bsc-nat/+/27030 )
Change subject: bsc_nat_fsm: initial msc <> bsc msg forwarding
......................................................................
Patch Set 5:
(1 comment)
File src/osmo-bsc-nat/bsc_nat_fsm.c:
https://gerrit.osmocom.org/c/osmo-bsc-nat/+/27030/comment/645d50ef_cf58b721
PS5, Line 142: oph->msg = NULL;
> Why are you doing this?
So I can properly msgb_free(oph->msg) before return of this function, if it is not NULL.
> Is msgb_free() called somewhere inside osmo_sccp_tx_unitdata_msg ?
Yes:
https://git.osmocom.org/libosmo-sccp/tree/src/sccp_helpers.c?id=5cac653a986…
> Did you check if oph pointer is actually allocated INSIDE the msg data? because then you are writing to already-freed memory. If that's the case, you should not use oph nor oph->msg anymore.
Thanks for pointing this out, indeed the callers of sccp_user_prim_up in libosmo-sccp allocate oph inside msg and as I understand, I should set oph = NULL to check later if msgb_free is needed. I'm not so familiar with internals of msgb, but now I understood that I don't even need to set l3h to l2h, I can just use msgb_pull_to_l2. Patch updated.
--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc-nat/+/27030
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bsc-nat
Gerrit-Branch: master
Gerrit-Change-Id: I4af398bb433341a98f818822e6c3af28b6d9dacd
Gerrit-Change-Number: 27030
Gerrit-PatchSet: 5
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Tue, 01 Feb 2022 10:58:32 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: comment
Attention is currently required from: osmith.
Hello Jenkins Builder,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/osmo-bsc-nat/+/27030
to look at the new patch set (#6).
Change subject: bsc_nat_fsm: initial msc <> bsc msg forwarding
......................................................................
bsc_nat_fsm: initial msc <> bsc msg forwarding
Add an initial implementation of sccp_sap_up, that assumes one BSC and
one MSC, and successfully forwards RESET and RESET ACK between both.
Related: SYS#5560
Depends: libosmo-sccp I0f38b0d038b0dd8cd355e7284e5b56d438811bd9
Change-Id: I4af398bb433341a98f818822e6c3af28b6d9dacd
---
M doc/examples/osmo-bsc-nat/osmo-bsc-nat.cfg
M src/osmo-bsc-nat/bsc_nat_fsm.c
2 files changed, 113 insertions(+), 3 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bsc-nat refs/changes/30/27030/6
--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc-nat/+/27030
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bsc-nat
Gerrit-Branch: master
Gerrit-Change-Id: I4af398bb433341a98f818822e6c3af28b6d9dacd
Gerrit-Change-Number: 27030
Gerrit-PatchSet: 6
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: osmith <osmith(a)sysmocom.de>
Gerrit-MessageType: newpatchset