gtp: Re-arrange free pdp ctx code in non-teardown scenario
Code modified actually behaves the same, since gtp_freepdp() also calls delete cb, and this way it's more consistent with rest of the code base. Change-Id: I299765816e9d885497110d2e834f7ccdc943052c
This commit is contained in:
parent
8651573632
commit
93dd798a99
27
gtp/gtp.c
27
gtp/gtp.c
|
@ -2421,13 +2421,14 @@ int gtp_delete_context_req(struct gsn_t *gsn, struct pdp_t *pdp, void *cbp,
|
||||||
because we don't want user to release its related
|
because we don't want user to release its related
|
||||||
data and not use it anymore.
|
data and not use it anymore.
|
||||||
*/
|
*/
|
||||||
if (gsn->cb_delete_context)
|
|
||||||
gsn->cb_delete_context(pdp);
|
|
||||||
if (pdp == linked_pdp) {
|
if (pdp == linked_pdp) {
|
||||||
linked_pdp->secondary_tei[pdp->nsapi & 0xf0] = 0;
|
if (gsn->cb_delete_context)
|
||||||
linked_pdp->nodata = 1;
|
gsn->cb_delete_context(pdp);
|
||||||
} else
|
pdp->secondary_tei[pdp->nsapi & 0xf0] = 0;
|
||||||
pdp_freepdp(pdp);
|
pdp->nodata = 1;
|
||||||
|
} else {
|
||||||
|
gtp_freepdp(gsn, pdp);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -2510,14 +2511,14 @@ int gtp_delete_pdp_resp(struct gsn_t *gsn, int version,
|
||||||
because we don't want user to release its related
|
because we don't want user to release its related
|
||||||
data and not use it anymore.
|
data and not use it anymore.
|
||||||
*/
|
*/
|
||||||
if (gsn->cb_delete_context)
|
|
||||||
gsn->cb_delete_context(pdp);
|
|
||||||
if (pdp == linked_pdp) {
|
if (pdp == linked_pdp) {
|
||||||
linked_pdp->secondary_tei[pdp->nsapi & 0xf0] =
|
if (gsn->cb_delete_context)
|
||||||
0;
|
gsn->cb_delete_context(pdp);
|
||||||
linked_pdp->nodata = 1;
|
pdp->secondary_tei[pdp->nsapi & 0xf0] = 0;
|
||||||
} else
|
pdp->nodata = 1;
|
||||||
pdp_freepdp(pdp);
|
} else {
|
||||||
|
gtp_freepdp(gsn, pdp);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* if (cause == GTPCAUSE_ACC_REQ) */
|
/* if (cause == GTPCAUSE_ACC_REQ) */
|
||||||
|
|
Loading…
Reference in New Issue