diff options
author | Oliver Smith <osmith@sysmocom.de> | 2019-05-13 11:35:03 +0200 |
---|---|---|
committer | Oliver Smith <osmith@sysmocom.de> | 2019-05-13 14:17:07 +0200 |
commit | 6c08f9ceb7c099e1efcb303511e00afadb8aae63 (patch) | |
tree | c6612d349cb28772ad198177a74fcae3e99a724f | |
parent | 9272d212c3f959b4829134ef5827f7652c6af30c (diff) |
Use gtp_delete_context_req2() everywhereosmith/gtp_delete_context_req2
Replace calls to gtp_delete_context_req() with
gtp_delete_context_req2().
Related: OS#2741
Change-Id: Iecc8c5ac45207e7e20129559c4ac7f3c67dfb36a
-rw-r--r-- | ggsn/ggsn.c | 12 | ||||
-rw-r--r-- | sgsnemu/sgsnemu.c | 4 |
2 files changed, 13 insertions, 3 deletions
diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index 2d37cf0..deb090d 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -107,7 +107,7 @@ static void pool_close_all_pdp(struct ippool_t *pool) if (!pdp) continue; LOGPPDP(LOGL_DEBUG, pdp, "Sending DELETE PDP CTX due to shutdown\n"); - gtp_delete_context_req(pdp->gsn, pdp, NULL, 1); + gtp_delete_context_req2(pdp->gsn, pdp, NULL, 1); } } @@ -972,6 +972,15 @@ static void signal_handler(int s) } } +/* libgtp callback for confirmations */ +static int cb_conf(int type, int cause, struct pdp_t *pdp, void *cbp) +{ + switch (type) { + case GTP_DELETE_PDP_REQ: + return pdp_freepdp(pdp); + } + return 0; +} /* Start a given GGSN */ int ggsn_start(struct ggsn_ctx *ggsn) @@ -1018,6 +1027,7 @@ int ggsn_start(struct ggsn_ctx *ggsn) gtp_set_cb_data_ind(ggsn->gsn, encaps_tun); gtp_set_cb_delete_context(ggsn->gsn, delete_context); gtp_set_cb_create_context_ind(ggsn->gsn, create_context_ind); + gtp_set_cb_conf(ggsn->gsn, cb_conf); LOGPGGSN(LOGL_NOTICE, ggsn, "Successfully started\n"); ggsn->started = true; diff --git a/sgsnemu/sgsnemu.c b/sgsnemu/sgsnemu.c index a2220f0..575b173 100644 --- a/sgsnemu/sgsnemu.c +++ b/sgsnemu/sgsnemu.c @@ -1474,6 +1474,7 @@ static int delete_pdp_conf(struct pdp_t *pdp, int cause) { printf("Received delete PDP context response. Cause value: %d\n", cause); + pdp_freepdp(pdp); return 0; } @@ -1756,8 +1757,7 @@ int main(int argc, char **argv) for (n = 0; n < options.contexts; n++) { /* Delete context */ printf("Disconnecting PDP context #%d\n", n); - gtp_delete_context_req(gsn, iparr[n].pdp, NULL, - 1); + gtp_delete_context_req2(gsn, iparr[n].pdp, NULL, 1); if ((options.pinghost.s_addr != 0) && ntransmitted) ping_finish(); |