aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax <msuraev@sysmocom.de>2017-10-19 16:52:30 +0200
committerHarald Welte <laforge@gnumonks.org>2017-10-20 18:19:24 +0000
commit7933d965319e265423421dbbae91f10a402b4c14 (patch)
treef8e195ecef751932b7fea2549c57b9222705bd0f
parent6f2440282cd06adc8ddb08b32546ab6f27abe9ce (diff)
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
-rw-r--r--src/gprs/sgsn_vty.c20
1 files changed, 2 insertions, 18 deletions
diff --git a/src/gprs/sgsn_vty.c b/src/gprs/sgsn_vty.c
index ab02d817..faac69b1 100644
--- a/src/gprs/sgsn_vty.c
+++ b/src/gprs/sgsn_vty.c
@@ -118,23 +118,6 @@ DECLARE_TIMER(3386, "Wait for MODIFY PDP CTX ACK timer (s)")
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 @@ static void vty_dump_pdp(struct vty *vty, const char *pfx,
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),