[MERGED] osmo-sgsn[master]: Fix APN printing

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
Fri Oct 20 18:19:24 UTC 2017


Harald Welte has submitted this change and it was merged.

Change subject: Fix APN printing
......................................................................


Fix APN printing

Previously first character of APN was omitted. Fix this by getting rid
of errorneous wrapper function and using osmo_apn_to_str() directly.

The breaking change was introduced in
I7315ffcbed8a54cca2056f313bb7783ad82d0ee9.

Change-Id: Ie13b6cd0066e0370e2adf48d12a363c2e405eaf2
Related: SYS#3610
---
M src/gprs/sgsn_vty.c
1 file changed, 2 insertions(+), 18 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/gprs/sgsn_vty.c b/src/gprs/sgsn_vty.c
index ab02d81..faac69b 100644
--- a/src/gprs/sgsn_vty.c
+++ b/src/gprs/sgsn_vty.c
@@ -118,23 +118,6 @@
 DECLARE_TIMER(3395, "Wait for DEACT PDP CTX ACK timer (s)")
 DECLARE_TIMER(3397, "Wait for DEACT AA PDP CTX ACK timer (s)")
 
-
-#define GSM48_MAX_APN_LEN	102	/* 10.5.6.1 */
-/** Copy apn to a static buffer, replacing the length octets in apn_enc with '.'
- * and terminating with a '\0'. Return the static buffer.
- * len: the length of the encoded APN (which has no terminating zero).
- */
-static char *gprs_apn2str(uint8_t *apn, unsigned int len)
-{
-	static char apnbuf[GSM48_MAX_APN_LEN+1];
-
-	if (!apn)
-		return "";
-	osmo_apn_to_str(apnbuf, apn, len);
-
-	return apnbuf+1;
-}
-
 char *gprs_pdpaddr2str(uint8_t *pdpa, uint8_t len)
 {
 	static char str[INET6_ADDRSTRLEN + 10];
@@ -459,8 +442,9 @@
 	vty_out(vty, "%sPDP Context IMSI: %s, SAPI: %u, NSAPI: %u, TI: %u%s",
 		pfx, imsi, pdp->sapi, pdp->nsapi, pdp->ti, VTY_NEWLINE);
 	if (pdp->lib) {
+		char apnbuf[APN_MAXLEN + 1];
 		vty_out(vty, "%s  APN: %s%s", pfx,
-			gprs_apn2str(pdp->lib->apn_use.v, pdp->lib->apn_use.l),
+			osmo_apn_to_str(apnbuf, pdp->lib->apn_use.v, pdp->lib->apn_use.l),
 			VTY_NEWLINE);
 		vty_out(vty, "%s  PDP Address: %s%s", pfx,
 			gprs_pdpaddr2str(pdp->lib->eua.v, pdp->lib->eua.l),

-- 
To view, visit https://gerrit.osmocom.org/4356
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie13b6cd0066e0370e2adf48d12a363c2e405eaf2
Gerrit-PatchSet: 3
Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-Owner: Max <msuraev at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder



More information about the gerrit-log mailing list