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

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

Vadim Yanitskiy gerrit-no-reply at lists.osmocom.org
Mon May 13 15:30:56 UTC 2019


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



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

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: newchange
Gerrit-Change-Id: I03d0eb266dca176f342e77a54f0291cc5bd7df43
Gerrit-Change-Number: 14015
Gerrit-PatchSet: 1
Gerrit-Owner: Vadim Yanitskiy <axilirator at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190513/3348258a/attachment.htm>


More information about the gerrit-log mailing list