From a794811416685e34e60508128e968d79918c55cf Mon Sep 17 00:00:00 2001 From: Pau Espin Pedrol Date: Fri, 30 Aug 2019 17:19:38 +0200 Subject: gprs_gmm.c: Replace inet_ntoa with inet_ntop inet_ntop manual states: "inet_ntoa(3) is now considered to be deprecated in favor of inet_ntop()". Change-Id: I0c708d047122f349acf46797a9e5973040e7ae04 --- src/gprs/gprs_gmm.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/gprs/gprs_gmm.c b/src/gprs/gprs_gmm.c index badb881c1..b28a4a13c 100644 --- a/src/gprs/gprs_gmm.c +++ b/src/gprs/gprs_gmm.c @@ -118,10 +118,12 @@ static const struct value_string gprs_mm_state_iu_names[] = { static void mmctx_change_gtpu_endpoints_to_sgsn(struct sgsn_mm_ctx *mm_ctx) { + char buf[INET_ADDRSTRLEN]; struct sgsn_pdp_ctx *pdp; llist_for_each_entry(pdp, &mm_ctx->pdp_list, list) { LOGMMCTXP(LOGL_INFO, mm_ctx, "Changing GTP-U endpoints %s -> %s\n", - sgsn_gtp_ntoa(&pdp->lib->gsnlu), inet_ntoa(sgsn->cfg.gtp_listenaddr.sin_addr)); + sgsn_gtp_ntoa(&pdp->lib->gsnlu), + inet_ntop(AF_INET, &sgsn->cfg.gtp_listenaddr.sin_addr, buf, sizeof(buf))); sgsn_pdp_upd_gtp_u(pdp, &sgsn->cfg.gtp_listenaddr.sin_addr, sizeof(sgsn->cfg.gtp_listenaddr.sin_addr)); @@ -2479,6 +2481,7 @@ static void ggsn_lookup_cb(void *arg, int status, int timeouts, struct hostent * struct sgsn_ggsn_ctx *ggsn; struct sgsn_ggsn_lookup *lookup = arg; struct in_addr *addr = NULL; + char buf[INET_ADDRSTRLEN]; /* The context is gone while we made a request */ if (!lookup->mmctx) { @@ -2535,7 +2538,8 @@ static void ggsn_lookup_cb(void *arg, int status, int timeouts, struct hostent * } ggsn->remote_addr = *addr; LOGMMCTXP(LOGL_NOTICE, lookup->mmctx, - "Selected %s as GGSN.\n", inet_ntoa(*addr)); + "Selected %s as GGSN.\n", + inet_ntop(AF_INET, addr, buf, sizeof(buf))); /* forget about the ggsn look-up */ lookup->mmctx->ggsn_lookup = NULL; @@ -2571,6 +2575,7 @@ static int do_act_pdp_req(struct sgsn_mm_ctx *mmctx, struct msgb *msg, bool *del char *hostname; int rc; struct gprs_llc_lle *lle; + char buf[INET_ADDRSTRLEN]; LOGMMCTXP(LOGL_INFO, mmctx, "-> ACTIVATE PDP CONTEXT REQ: SAPI=%u NSAPI=%u ", act_req->req_llc_sapi, act_req->req_nsapi); @@ -2599,7 +2604,7 @@ static int do_act_pdp_req(struct sgsn_mm_ctx *mmctx, struct msgb *msg, bool *del if (req_pdpa_len >= 6) { struct in_addr ia; ia.s_addr = ntohl(*((uint32_t *) (req_pdpa+2))); - DEBUGPC(DMM, "%s ", inet_ntoa(ia)); + DEBUGPC(DMM, "%s ", inet_ntop(AF_INET, &ia, buf, sizeof(buf))); } break; case 0x57: -- cgit v1.2.3