Change in ...osmo-ggsn[master]: Introduce LOGTUN log helper

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

laforge gerrit-no-reply at lists.osmocom.org
Thu Aug 29 05:28:07 UTC 2019


laforge has submitted this change and it was merged. ( https://gerrit.osmocom.org/c/osmo-ggsn/+/15252 )

Change subject: Introduce LOGTUN log helper
......................................................................

Introduce LOGTUN log helper

Change-Id: I237acdee0be19498804e0d509c610f4e0454ba72
---
M ggsn/ggsn.c
M ggsn/ggsn.h
2 files changed, 8 insertions(+), 5 deletions(-)

Approvals:
  Jenkins Builder: Verified
  osmith: Looks good to me, approved
  laforge: Looks good to me, approved



diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c
index 4e13151..94f47e3 100644
--- a/ggsn/ggsn.c
+++ b/ggsn/ggsn.c
@@ -556,7 +556,7 @@
 		pool = apn->v6.pool;
 		break;
 	default:
-		LOGP(DTUN, LOGL_NOTICE, "non-IPv%u packet received from tun\n", iph->version);
+		LOGTUN(LOGL_NOTICE, tun, "non-IPv%u packet received\n", iph->version);
 		return -1;
 	}
 
@@ -564,15 +564,15 @@
 	if (!pool)
 		return 0;
 
-	DEBUGP(DTUN, "Received packet for APN(%s) from tun %s", apn->cfg.name, tun->devname);
-
 	if (ippool_getip(pool, &ipm, &dst)) {
-		DEBUGPC(DTUN, " with no PDP contex! (%s)\n", iph->version == 4 ?
+		LOGTUN(LOGL_DEBUG, tun, "Received packet for APN(%s) with no PDP contex! (%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;
 	}
-	DEBUGPC(DTUN, "\n");
+	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);
diff --git a/ggsn/ggsn.h b/ggsn/ggsn.h
index 88fd8b9..6155b30 100644
--- a/ggsn/ggsn.h
+++ b/ggsn/ggsn.h
@@ -153,3 +153,6 @@
 	LOGP(DGGSN, level, "GGSN(%s): " fmt, (ggsn)->cfg.name, ## args)
 
 #define LOGPPDP(level, pdp, fmt, args...) LOGPDPX(DGGSN, level, pdp, fmt, ## args)
+
+#define LOGTUN(level, tun, fmt, args...) \
+	LOGP(DTUN, level, "TUN(%s): " fmt, (tun)->devname, ## args)

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

Gerrit-Project: osmo-ggsn
Gerrit-Branch: master
Gerrit-Change-Id: I237acdee0be19498804e0d509c610f4e0454ba72
Gerrit-Change-Number: 15252
Gerrit-PatchSet: 3
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at gnumonks.org>
Gerrit-Reviewer: osmith <osmith at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190829/087604f0/attachment.htm>


More information about the gerrit-log mailing list