osmo-ggsn/gtp
Pau Espin 623c5b36e9 libgtp: Remove packets in tx queue belonging pdp being freed
Doing so should avoid the crash seen in OS#3956, where a message is
received in osmo-sgsn gtp iface after having received a DeleteCtxAccept
message where pdp and associated cbp is freed. As a result, when new
confirmation arrives, it can still be matched against an old request and
be sent to upper layers providing an already freed cbp.

With this patch, since all queued messages belonging to that pdp are
dropped, confirmation won't find a match and be discarded in libgtp.

In order to be able to drop all req messages belonging to a pdp, a new list
is added to pdp_t and qmsg_t are added to that list when inserted into the per-gsn
req transmit queue. This way upon pdp free time it's simply a
matter of iterating over that list to remove all messages.

There's no need to do same for resp queue, and it'd be actually
counter-productive, because it wouldn't be possible to detect and
discard duplicates anymore after pdp ctx has been freed.

Related: OS#3956
Change-Id: Id86d0b241454d3ad49c64c28087fd2710fa2d17a
2019-08-23 14:38:56 +02:00
..
Makefile.am Bump version: 1.3.0.50-ea1c-dirty → 1.4.0 2019-08-07 21:28:30 +02:00
gtp.c libgtp: Remove packets in tx queue belonging pdp being freed 2019-08-23 14:38:56 +02:00
gtp.h gtp: Introduce new pdp APIs (and deprecate old ones) to support multiple GSN 2019-06-04 17:42:16 +02:00
gtpie.c gtpie_{encaps,encaps2}(): RAI is a fixe 6-byte length field, not 8 bytes 2017-10-14 07:59:07 +02:00
gtpie.h gtpie.h: Add IE identifier definitions up to 29.60 v11.8.0 Release 11 2017-10-14 07:49:15 +02:00
lookupa.c Convert all code to Linux coding style 2011-11-02 13:06:18 +01:00
lookupa.h Convert all code to Linux coding style 2011-11-02 13:06:18 +01:00
pdp.c libgtp: Remove packets in tx queue belonging pdp being freed 2019-08-23 14:38:56 +02:00
pdp.h libgtp: Remove packets in tx queue belonging pdp being freed 2019-08-23 14:38:56 +02:00
queue.c libgtp: Remove packets in tx queue belonging pdp being freed 2019-08-23 14:38:56 +02:00
queue.h libgtp: Remove packets in tx queue belonging pdp being freed 2019-08-23 14:38:56 +02:00