[PATCH] osmo-sgsn[master]: Fix display of GTP 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:55:13 UTC 2017


Hello Jenkins Builder,

I'd like you to reexamine a change.  Please visit

    https://gerrit.osmocom.org/5197

to look at the new patch set (#2).

Fix display of GTP addresses

Previously we've tried to convert addresses manually which lead to
wrongly displayed GTP addresses (e. g. '4.0.0.0' instead of
'127.0.0.2'). 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/2

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: newpatchset
Gerrit-Change-Id: I695a9c9497d675564a088b002299096e0dcd267d
Gerrit-PatchSet: 2
Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-Owner: Max <msuraev at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder



More information about the gerrit-log mailing list