aboutsummaryrefslogtreecommitdiffstats
path: root/src/gprs/sgsn_libgtp.c
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2018-07-09 14:39:47 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2018-07-13 11:47:51 +0200
commita98fead4642ba0ecf7ab0e7862fb468d0ae911ad (patch)
tree48bd3989759581d8d486ace764511fdeec1c698f /src/gprs/sgsn_libgtp.c
parent80d407fc3f407898de3c62d6265665d08a830280 (diff)
Maintain per ggsn pdp ctx list
This way we can easily track all pdp context associated to a specific ggsn, which is useful to handle some scenarios, such as the one implemented in next commit, in which specs references that GSNs should ping only other GSNs with at least one pdp ctx in common. So the list of pdp ctx per GGSN is really useful too (and cheap computationally) to check if we should arm or disarm the echo procedure timer. So this commit can be seen as a preparation for next commit. Change-Id: I3bbcc0883df2bf1290ba8d4bd70db8baa494087a
Diffstat (limited to 'src/gprs/sgsn_libgtp.c')
-rw-r--r--src/gprs/sgsn_libgtp.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/gprs/sgsn_libgtp.c b/src/gprs/sgsn_libgtp.c
index 70112cbfd..2da8c4a74 100644
--- a/src/gprs/sgsn_libgtp.c
+++ b/src/gprs/sgsn_libgtp.c
@@ -145,7 +145,7 @@ struct sgsn_pdp_ctx *sgsn_create_pdp_ctx(struct sgsn_ggsn_ctx *ggsn,
const uint8_t *qos;
int rc;
- pctx = sgsn_pdp_ctx_alloc(mmctx, nsapi);
+ pctx = sgsn_pdp_ctx_alloc(mmctx, ggsn, nsapi);
if (!pctx) {
LOGP(DGPRS, LOGL_ERROR, "Couldn't allocate PDP Ctx\n");
return NULL;
@@ -160,7 +160,6 @@ struct sgsn_pdp_ctx *sgsn_create_pdp_ctx(struct sgsn_ggsn_ctx *ggsn,
}
pdp->priv = pctx;
pctx->lib = pdp;
- pctx->ggsn = ggsn;
//pdp->peer = /* sockaddr_in of GGSN (receive) */
//pdp->ipif = /* not used by library */
@@ -603,7 +602,7 @@ static int cb_recovery(struct sockaddr_in *peer, uint8_t recovery)
"releasing all PDP contexts\n",
ggsn->remote_restart_ctr, recovery);
ggsn->remote_restart_ctr = recovery;
- drop_all_pdp_for_ggsn(ggsn);
+ sgsn_ggsn_ctx_drop_all_pdp(ggsn);
}
return 0;
}