Change in osmo-ggsn[master]: ggsn: Improve logging on incoming DL data packets

pespin gerrit-no-reply at lists.osmocom.org
Thu Apr 22 12:23:01 UTC 2021


pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ggsn/+/23861 )


Change subject: ggsn: Improve logging on incoming DL data packets
......................................................................

ggsn: Improve logging on incoming DL data packets

Change-Id: I3617c8f68d8f18617871c070e28cc6ae5c6a925b
---
M ggsn/ggsn.c
1 file changed, 20 insertions(+), 6 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/61/23861/1

diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c
index bde7f4b..a96949a 100644
--- a/ggsn/ggsn.c
+++ b/ggsn/ggsn.c
@@ -626,17 +626,31 @@
 		return 0;
 
 	if (ippool_getip(pool, &ipm, &dst)) {
-		LOGTUN(LOGL_DEBUG, tun, "Received packet for APN(%s) with no PDP contex! (%s)\n",
+		LOGTUN(LOGL_DEBUG, tun, "APN(%s) Rx DL data packet for IP address not "
+		       "in the pool of managed addresses: (%s)\n",
+		       apn->cfg.name,
+		       iph->version == 4 ?
+		        inet_ntop(AF_INET, &iph->saddr, straddr, sizeof(straddr)) :
+		        inet_ntop(AF_INET6, &ip6h->ip6_src, straddr, sizeof(straddr)));
+		return 0;
+	}
+
+	if (ipm->peer)	{	/* Check if a peer protocol is defined */
+		struct pdp_t *pdp = (struct pdp_t *)ipm->peer;
+		LOGTUN(LOGL_DEBUG, tun, "APN(%s) Rx DL data packet for %s, PDP(%s:%u)\n",
+		       apn->cfg.name,
+		       iph->version == 4 ?
+		        inet_ntop(AF_INET, &iph->saddr, straddr, sizeof(straddr)) :
+		        inet_ntop(AF_INET6, &ip6h->ip6_src, straddr, sizeof(straddr)),
+		       imsi_gtp2str(&(pdp)->imsi), (pdp)->nsapi);
+		gtp_data_req(apn->ggsn->gsn, pdp, pack, len);
+	} else {
+		LOGTUN(LOGL_DEBUG, tun, "APN(%s) Rx DL data packet for IP address with no associated PDP Ctx: %s\n",
 			apn->cfg.name,
 			iph->version == 4 ?
 			inet_ntop(AF_INET, &iph->saddr, straddr, sizeof(straddr)) :
 			inet_ntop(AF_INET6, &ip6h->ip6_src, straddr, sizeof(straddr)));
-		return 0;
 	}
-	LOGTUN(LOGL_DEBUG, tun, "Received packet for APN(%s)\n", apn->cfg.name);
-
-	if (ipm->peer)		/* Check if a peer protocol is defined */
-		gtp_data_req(apn->ggsn->gsn, (struct pdp_t *)ipm->peer, pack, len);
 	return 0;
 }
 

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ggsn/+/23861
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ggsn
Gerrit-Branch: master
Gerrit-Change-Id: I3617c8f68d8f18617871c070e28cc6ae5c6a925b
Gerrit-Change-Number: 23861
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/20210422/09445172/attachment.htm>


More information about the gerrit-log mailing list