QUEUE_SIZE holds the number of pending transmitted messages
which can be handled concurrently.
Current value was 1024, same as PDP contexts (PDP_MAX). However, that
seems to be a quite low amount, which can be filled under certain
conditions, for instance if recovery procedure is triggered on the GSN
which is running full (around PDP_MAX pdp contexts created).
In this scenario, the GSN would need to send around PDP_MAX concurrent
messages (DeletePDPContextReq), which means the queue would very likely
end up being full.
Hence, let's define QUEUE_SIZE based on PDP_MAX, and set it to twice the
size to make sure it won't be filled in extreme conditions.
Change-Id: I6034b0fab2b2e5962314c2fca2f893246ce5cf4f
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
Those headers are using types defined in other places (like sockaddr_in)
and don't explicitly include them, which makes future queue_test fail.
Change-Id: I65e12a067d89ef71be3719636b64f4d93ea73cc4
Osmocom has maintained this program since about 7 years now, while
the original author / copyright holder has completely disappeared.
With the introduction of Osmocom-style CTRL and VTY interfaces,
the way how the program is used and configured has substantially
changed. In order to avoid confusion in terms of configuration file
format etc, let's rename it to OsmoGGSN.
Change-Id: I2da30f7d4828e185bfac1a4e2d8414b01cbe4f9d
After so many years of silence, we don't expect the original author to
return to the project. To make things a bit simpler for us, we convert
the coding style to what we are used to (Linux style).
The conversion was made using the 'Lindent' script which is part of the
Linux kernel.