[PATCH] osmo-sgsn[master]: Fix display of GTP control addresses

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/.

Max gerrit-no-reply at lists.osmocom.org
Tue Dec 5 16:34:36 UTC 2017


Review at  https://gerrit.osmocom.org/5197

Fix display of GTP control addresses

Previously we've tried to convert addresses manually which lead to
wrongly displayed GTP addresses (e. g. '4.0.0.0'). Use libgtp function
for conversion to fix it.

Change-Id: I695a9c9497d675564a088b002299096e0dcd267d
---
M src/gprs/sgsn_vty.c
1 file changed, 5 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/97/5197/1

diff --git a/src/gprs/sgsn_vty.c b/src/gprs/sgsn_vty.c
index c8dfc43..e9ce199 100644
--- a/src/gprs/sgsn_vty.c
+++ b/src/gprs/sgsn_vty.c
@@ -431,12 +431,12 @@
 
 char *sgsn_gtp_ntoa(struct ul16_t *ul)
 {
-	if (ul->l == 4) {
-		struct in_addr *ia = (struct in_addr *) ul;
-		return inet_ntoa(*ia);
-	} else {
+	struct in_addr ia;
+
+	if (gsna2in_addr(&ia, ul) != 0)
 		return "UNKNOWN";
-	}
+
+	return inet_ntoa(ia);
 }
 
 static void vty_dump_pdp(struct vty *vty, const char *pfx,

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I695a9c9497d675564a088b002299096e0dcd267d
Gerrit-PatchSet: 1
Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-Owner: Max <msuraev at sysmocom.de>



More information about the gerrit-log mailing list