aboutsummaryrefslogtreecommitdiffstats
path: root/gtp/gtp.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2017-08-12 14:55:09 +0200
committerHarald Welte <laforge@gnumonks.org>2017-09-05 23:13:14 +0200
commite257be1d6974abddb56602fe2d844924bc736d0c (patch)
tree745da8b266bf71f7fca91579a9837cc8eba00f91 /gtp/gtp.c
parent8a03ea8a326bb60cae3400076660ee08911bb9b1 (diff)
libgtp: Add back-reference to gsn from pdp context
This is required once one wants to support multiple GSNs in a single application. WARNING: This breaks ABI compatibility, LIBVERSION must be adjusted Change-Id: I68ae49a765828fa681054c68bf7f5e74dbe48ad2
Diffstat (limited to 'gtp/gtp.c')
-rw-r--r--gtp/gtp.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/gtp/gtp.c b/gtp/gtp.c
index a3f6eb2..87ab075 100644
--- a/gtp/gtp.c
+++ b/gtp/gtp.c
@@ -90,7 +90,11 @@ const char *gtp_version()
int gtp_newpdp(struct gsn_t *gsn, struct pdp_t **pdp,
uint64_t imsi, uint8_t nsapi)
{
- return pdp_newpdp(pdp, imsi, nsapi, NULL);
+ int rc;
+ rc = pdp_newpdp(pdp, imsi, nsapi, NULL);
+ if (!rc && *pdp)
+ (*pdp)->gsn = gsn;
+ return rc;
}
int gtp_freepdp(struct gsn_t *gsn, struct pdp_t *pdp)
@@ -1570,6 +1574,8 @@ int gtp_create_pdp_ind(struct gsn_t *gsn, int version,
}
pdp_newpdp(&pdp, pdp->imsi, pdp->nsapi, pdp);
+ if (pdp)
+ pdp->gsn = gsn;
/* Callback function to validata login */
if (gsn->cb_create_context_ind != 0)