pespin has submitted this change and it was merged. (
https://gerrit.osmocom.org/c/osmo-sgsn/+/15352 )
Change subject: gprs_gmm.c: Replace inet_ntoa with inet_ntop
......................................................................
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
---
M src/gprs/gprs_gmm.c
1 file changed, 8 insertions(+), 3 deletions(-)
Approvals:
laforge: Looks good to me, approved
osmith: Looks good to me, approved
Jenkins Builder: Verified
diff --git a/src/gprs/gprs_gmm.c b/src/gprs/gprs_gmm.c
index badb881..b28a4a1 100644
--- a/src/gprs/gprs_gmm.c
+++ b/src/gprs/gprs_gmm.c
@@ -118,10 +118,12 @@
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 @@
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 @@
}
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 @@
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 @@
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:
--
To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/15352
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-Change-Id: I0c708d047122f349acf46797a9e5973040e7ae04
Gerrit-Change-Number: 15352
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <[email protected]>
Gerrit-Reviewer: osmith <[email protected]>
Gerrit-Reviewer: pespin <[email protected]>
Gerrit-MessageType: merged