Change in ...osmo-sgsn[master]: gprs_gmm.c: Replace inet_ntoa with inet_ntop

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

pespin gerrit-no-reply at lists.osmocom.org
Fri Aug 30 16:33:45 UTC 2019


pespin has uploaded this change for review. ( 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(-)



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

diff --git a/src/gprs/gprs_gmm.c b/src/gprs/gprs_gmm.c
index 9c5f689..766d0f4 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));
@@ -2469,6 +2471,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) {
@@ -2525,7 +2528,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;
@@ -2561,6 +2565,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);
@@ -2589,7 +2594,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: 1
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190830/f3a5c76a/attachment.htm>


More information about the gerrit-log mailing list