Attention is currently required from: daniel.
laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/33493 )
Change subject: osmo_io: Return early on error in osmo_iofd_register()
......................................................................
Patch Set 1: Code-Review+1
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/33493
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I2561c82e6bf7e2bb5fd699c899238f9c43ea4d9c
Gerrit-Change-Number: 33493
Gerrit-PatchSet: 1
Gerrit-Owner: daniel <dwillmann(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Attention: daniel <dwillmann(a)sysmocom.de>
Gerrit-Comment-Date: Tue, 27 Jun 2023 08:38:23 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
laforge has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/33451 )
Change subject: tlv: Fix IE.from_dict() method
......................................................................
tlv: Fix IE.from_dict() method
The existing IE.from_dict() method *supposedly* accepts a dict as
input value, but it actually expects the raw decoded value, unless it is
a nested IE. This is inconsistent in various ways, and results in a bug
visible at a higher layer, such as files like EF.{DOMAIN,IMPI,IMPU},
which are transparent files containing a single BER-TLV IE.
Decoding such files worked, but re-encoding them did not, due to the
fact that we'd pass a dict to the from_dict method, which then gets
assigned to self.decoded and further passed along to any later actual
encoder function like to_bytes or to_tlv. In that instance, the dict
might be handed to a self._construct which has no idea how to process
the dict, as it expects the raw decoded value.
Change-Id: I3dd5204510e5c32ef1c4a999258d87cb3f1df8c8
Closes: OS#6073
Related: OS#6072
---
M pySim/tlv.py
1 file changed, 29 insertions(+), 2 deletions(-)
Approvals:
fixeria: Looks good to me, but someone else must approve
Jenkins Builder: Verified
laforge: Looks good to me, approved
diff --git a/pySim/tlv.py b/pySim/tlv.py
index a5baa23..bd95505 100644
--- a/pySim/tlv.py
+++ b/pySim/tlv.py
@@ -161,7 +161,10 @@
self.children = self.nested_collection.from_dict(decoded)
else:
self.children = []
- self.decoded = decoded
+ expected_key_name = camel_to_snake(type(self).__name__)
+ if not expected_key_name in decoded:
+ raise ValueError("Dict %s doesn't contain expected key %s" % (decoded, expected_key_name))
+ self.decoded = decoded[expected_key_name]
def is_constructed(self):
"""Is this IE constructed by further nested IEs?"""
@@ -388,7 +391,7 @@
if k in self.members_by_name:
cls = self.members_by_name[k]
inst = cls()
- inst.from_dict(i[k])
+ inst.from_dict({k: i[k]})
res.append(inst)
else:
raise ValueError('%s: Unknown TLV Class %s in %s; expected %s' %
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/33451
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I3dd5204510e5c32ef1c4a999258d87cb3f1df8c8
Gerrit-Change-Number: 33451
Gerrit-PatchSet: 2
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: merged
laforge has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/33492 )
Change subject: work-around what appears to be a pylint bug
......................................................................
work-around what appears to be a pylint bug
smpp.pdu.pdu_types.DataCodingScheme.GSM_MESSAGE_CLASS very much exists,
and I can prove that manually in the python shell. So let's assume this
is a pylint bug and work around it
pySim/sms.py:72:21: E1101: Instance of 'DataCodingScheme' has no 'GSM_MESSAGE_CLASS' member (no-member)
Change-Id: Iab34bae06940fecf681af9f45b8657e9be8cbc7b
---
M pySim/sms.py
1 file changed, 17 insertions(+), 0 deletions(-)
Approvals:
fixeria: Looks good to me, but someone else must approve
Jenkins Builder: Verified
laforge: Looks good to me, approved
diff --git a/pySim/sms.py b/pySim/sms.py
index a15bbcb..88ee27a 100644
--- a/pySim/sms.py
+++ b/pySim/sms.py
@@ -69,6 +69,8 @@
if dcs == pdu_types.DataCoding(pdu_types.DataCodingScheme.DEFAULT,
pdu_types.DataCodingDefault.OCTET_UNSPECIFIED_COMMON):
return True
+ # pySim/sms.py:72:21: E1101: Instance of 'DataCodingScheme' has no 'GSM_MESSAGE_CLASS' member (no-member)
+ # pylint: disable=no-member
if dcs.scheme == pdu_types.DataCodingScheme.GSM_MESSAGE_CLASS and dcs.schemeData['msgCoding'] == pdu_types.DataCodingGsmMsgCoding.DATA_8BIT:
return True
else:
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/33492
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: Iab34bae06940fecf681af9f45b8657e9be8cbc7b
Gerrit-Change-Number: 33492
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: merged
laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/pysim/+/33492 )
Change subject: work-around what appears to be a pylint bug
......................................................................
Patch Set 1: Code-Review+2
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/33492
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: Iab34bae06940fecf681af9f45b8657e9be8cbc7b
Gerrit-Change-Number: 33492
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Comment-Date: Tue, 27 Jun 2023 08:37:23 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
Attention is currently required from: falconia.
fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-bts/+/33470 )
Change subject: ECU in UL path: move state alloc/free to l1sap
......................................................................
Patch Set 1: Code-Review+1
--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/33470
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: Ic98a2eb26b5a99bc4a89ad07ae87c9a86b921418
Gerrit-Change-Number: 33470
Gerrit-PatchSet: 1
Gerrit-Owner: falconia <falcon(a)freecalypso.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: falconia <falcon(a)freecalypso.org>
Gerrit-Comment-Date: Tue, 27 Jun 2023 08:20:09 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
Jenkins Builder has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/33495 )
Change subject: osmo_io: Use bitfield for various boolean flags
......................................................................
Patch Set 1:
(2 comments)
File src/core/osmo_io_internal.h:
Robot Comment from checkpatch (run ID jenkins-gerrit-lint-8649):
https://gerrit.osmocom.org/c/libosmocore/+/33495/comment/ecda9da0_c56a05d5
PS1, Line 37: #define IOFD_FLAG_SET(iofd, flag) \
Single statement macros should not use a do {} while (0) loop
Robot Comment from checkpatch (run ID jenkins-gerrit-lint-8649):
https://gerrit.osmocom.org/c/libosmocore/+/33495/comment/beb0829f_4acf0289
PS1, Line 42: #define IOFD_FLAG_UNSET(iofd, flag) \
Single statement macros should not use a do {} while (0) loop
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/33495
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Ic134e4c8d791c34778202fea98a70bc04007a113
Gerrit-Change-Number: 33495
Gerrit-PatchSet: 1
Gerrit-Owner: daniel <dwillmann(a)sysmocom.de>
Gerrit-CC: Jenkins Builder
Gerrit-Comment-Date: Tue, 27 Jun 2023 08:12:03 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment