Change in openbsc[master]: Migrate from osmo_ipa_idtag_parse() to ipa_ccm_id_resp_parse()

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Wed Aug 1 12:08:01 UTC 2018


Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/10298


Change subject: Migrate from osmo_ipa_idtag_parse() to ipa_ccm_id_resp_parse()
......................................................................

Migrate from osmo_ipa_idtag_parse() to ipa_ccm_id_resp_parse()

In libosmocore Change-ID I1834d90fbcdbfcb05f5b8cfe39bfe9543737ef8f
we have introduced ipa_ccm_id_resp_parse() as a bugfixed replacement
of ipa_ccm_idtag_parse().

The main difference is that the returned "value" parts now have
a correct reported "length", whereas before this commit they all
reported a one-byte too-long "length" for each IE.

Change-Id: Id7f9a69f0921e97865db5720e5bb5e288b2f216b
---
M openbsc/src/osmo-bsc/osmo_bsc_msc.c
M openbsc/src/osmo-bsc_nat/bsc_nat.c
2 files changed, 2 insertions(+), 6 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/98/10298/1

diff --git a/openbsc/src/osmo-bsc/osmo_bsc_msc.c b/openbsc/src/osmo-bsc/osmo_bsc_msc.c
index b179ff1..36273b9 100644
--- a/openbsc/src/osmo-bsc/osmo_bsc_msc.c
+++ b/openbsc/src/osmo-bsc/osmo_bsc_msc.c
@@ -456,9 +456,7 @@
 		.algo		= OSMO_AUTH_ALG_MILENAGE,
 	};
 
-	ret = ipa_ccm_idtag_parse_off(&tvp,
-				inp->l2h + 1,
-				msgb_l2len(inp) - 1, 1);
+	ret = ipa_ccm_id_get_parse(&tvp, inp->l2h+1, msgb_l2len(inp)-1);
 	if (ret < 0) {
 		LOGP(DMSC, LOGL_ERROR, "ignoring IPA response "
 			"message with malformed TLVs: %s\n", osmo_hexdump(inp->l2h + 1,
diff --git a/openbsc/src/osmo-bsc_nat/bsc_nat.c b/openbsc/src/osmo-bsc_nat/bsc_nat.c
index 0559758..74ae430 100644
--- a/openbsc/src/osmo-bsc_nat/bsc_nat.c
+++ b/openbsc/src/osmo-bsc_nat/bsc_nat.c
@@ -1291,9 +1291,7 @@
 		if (msg->l2h[0] == IPAC_MSGT_ID_RESP && msgb_l2len(msg) > 2) {
 			struct tlv_parsed tvp;
 			int ret;
-			ret = ipa_ccm_idtag_parse_off(&tvp,
-					     (unsigned char *) msg->l2h + 2,
-					     msgb_l2len(msg) - 2, 0);
+			ret = ipa_ccm_id_resp_parse(&tvp, (const uint8_t *)msg->l2h+1, msgb_l2len(msg)-1);
 			if (ret < 0) {
 				LOGP(DNAT, LOGL_ERROR, "ignoring IPA response "
 					"message with malformed TLVs\n");

-- 
To view, visit https://gerrit.osmocom.org/10298
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Id7f9a69f0921e97865db5720e5bb5e288b2f216b
Gerrit-Change-Number: 10298
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20180801/80aafc42/attachment.htm>


More information about the gerrit-log mailing list