Change in osmo-ggsn[master]: osmo-ggsn: check result of osmo_apn_to_str()

Harald Welte gerrit-no-reply at lists.osmocom.org
Tue May 14 08:31:51 UTC 2019


Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/14015 )

Change subject: osmo-ggsn: check result of osmo_apn_to_str()
......................................................................

osmo-ggsn: check result of osmo_apn_to_str()

Change-Id: I03d0eb266dca176f342e77a54f0291cc5bd7df43
---
M ggsn/ggsn.c
1 file changed, 7 insertions(+), 5 deletions(-)

Approvals:
  Jenkins Builder: Verified
  Pau Espin Pedrol: Looks good to me, but someone else must approve
  Harald Welte: Looks good to me, approved



diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c
index 2d37cf0..a3bf4db 100644
--- a/ggsn/ggsn.c
+++ b/ggsn/ggsn.c
@@ -639,15 +639,17 @@
 	struct in46_addr addr[2];
 	struct ippoolm_t *member = NULL, *addrv4 = NULL, *addrv6 = NULL;
 	char straddrv4[INET_ADDRSTRLEN], straddrv6[INET6_ADDRSTRLEN];
-	struct apn_ctx *apn;
+	struct apn_ctx *apn = NULL;
 	int rc, num_addr, i;
+	char *apn_name;
 
-	osmo_apn_to_str(name_buf, pdp->apn_req.v, pdp->apn_req.l);
-
-	LOGPPDP(LOGL_DEBUG, pdp, "Processing create PDP context request for APN '%s'\n", name_buf);
+	apn_name = osmo_apn_to_str(name_buf, pdp->apn_req.v, pdp->apn_req.l);
+	LOGPPDP(LOGL_DEBUG, pdp, "Processing create PDP context request for APN '%s'\n",
+		apn_name ? name_buf : "(NONE)");
 
 	/* First find an exact APN name match */
-	apn = ggsn_find_apn(ggsn, name_buf);
+	if (apn_name != NULL)
+		apn = ggsn_find_apn(ggsn, name_buf);
 	/* ignore if the APN has not been started */
 	if (apn && !apn->started)
 		apn = NULL;

-- 
To view, visit https://gerrit.osmocom.org/14015
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ggsn
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I03d0eb266dca176f342e77a54f0291cc5bd7df43
Gerrit-Change-Number: 14015
Gerrit-PatchSet: 1
Gerrit-Owner: Vadim Yanitskiy <axilirator at gmail.com>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder (1000002)
Gerrit-Reviewer: Pau Espin Pedrol <pespin at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190514/ed965d0d/attachment.html>


More information about the gerrit-log mailing list