aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax <msuraev@sysmocom.de>2017-12-05 17:28:15 +0100
committerMax <msuraev@sysmocom.de>2017-12-05 17:49:17 +0100
commit8492c2018cecc51db32917609897302683bc5bb8 (patch)
treef4fd5dbb4e314e86e11f1db9ea6f123fb98953e5
parent2e9ea50f7824e2028e44a27b72d5ae268cfc66f0 (diff)
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
-rw-r--r--src/gprs/sgsn_vty.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/gprs/sgsn_vty.c b/src/gprs/sgsn_vty.c
index c8dfc437..e9ce1998 100644
--- a/src/gprs/sgsn_vty.c
+++ b/src/gprs/sgsn_vty.c
@@ -431,12 +431,12 @@ const struct value_string gprs_mm_st_strs[] = {
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,