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
osmo-ggsn crashes when concurrent pdp context num 1024 is created, due to
the gsn->pdpa array (of size PDP_MAX, 1024) being full.
The crash happens because return code of gtp_pdp_newpdp was not checked,
and hence a pointer "pdp" pointing to a temporary not-fully-allocated
object was being passed to gsn->cb_create_context_ind() callback.
Let's avoid crashing and instead reject the PDP context.
Related: OS#5469
Change-Id: I0d94ffad97eb4fef477d981bf285bf99740592a3
Coverity warns around that test code:
"Overrunning struct type in46_addr of 20 bytes by passing it to a
function which accesses it at byte offset 39."
That's basically because in64a_from_eua expects to be passed a 2 element
array to be filled. The second element, though, is only accessed in the
case where an IPv4v6 EUA is passed, so in the cases where the test
explicitly passes an IPv4 or IPv6 EUA it's not really an issue, hence
coverity throwing a false positive here.
Let's anyway rewrite the code to pass a 2 element array for completeness,
since it doesn't hurt and makes coverity happy.
Related: Coverity CID#249006
Change-Id: Idfc9104f48eeee6e7f11ebc5c17d4b0e4b2fe9e2
from "man strtoul":
"""
If endptr is not NULL, strtoul() stores the address of the first invalid character in *endptr.
In particular, if *nptr is not '\0' but **endptr is '\0' on return, the entire string is valid.
"""
Fixes: ae81195418
Change-Id: I89d26a575ef81ee17483db035924354588d9d094
This is a small standalone program (under MIT license, hence cannot make
use of libosmocore) whose only purpose is to answer GTPC (v1 and v2)
Echo Request messages with Echo Reply ones, with information provided
from the command line.
A small python script companion is provided to easily test the program.
Related: SYS#5598
Change-Id: Ibdd6d8f6920571db0c60cf8b3b25d541b15ad3f1
The previous order of parsing lead to non-optimal information gathering
when pushing events to upper layers.
This patch rearranges parsing of packet data to always gather as much
info as possible for the benefit of the upper layer. This way it can
gather information such as the cause, which is important in the case of
"Non-existent", since user should then drop the context.
First we want to parse the recovery state, but delay cb to upper layers
until we tried to gather the pdp ctx (meaning all except that pdp ctx
should be freed).
Second, we want to parse the cause, in order to know if there's an
associated pdp ctx we can gather from TEID.
Third, once we know if we should expect a meaningul TEID, parse it.
Related: SYS#5435
Change-Id: Idd10b494e8fbac8703c49ecd8f9bbe4246e51c57
Currently, osmo-ggsn doesn't implement PDP contexts with static IP
addresses. The code for specifying ranges that can be used for
static IPs was always present even from OpenGGSN days, but we never
really treated them. Let's not raise the impression we do by
warning accordingly if the user configures them.
Change-Id: I7787dae037c46c0c5052aa6dd000be330984f144
Related: OS#5097
We don't implement handling of static IP addresses for now,
let's properly reject those rather than allocating a dynamic address
anyway.
Change-Id: Iac8868438655fe4e5e07d167d7dbd6273dbb7678
Related: OS#5097
This is an auxiliary example config file, which should not be installed
to /etc/ and hence not be in OSMOCONF_FILES
This fixes the following rpm packaging error:
[ 149s] error: Installed (but unpackaged) file(s) found:
[ 149s] /etc/osmocom/sgsnemu.conf
Change-Id: Id31f6542590405531ff61a9434041c15e779865b
Fixes: Icd6f3efcf5a9ef50237a3d0a76d4cce55051f447
This is an auxiliary example config file, which should not be installed
to /etc/ and hence not be in OSMOCONF_FILES
This fixes the following rpm packaging error:
[ 149s] error: Installed (but unpackaged) file(s) found:
[ 149s] /etc/osmocom/osmo-ggsn-kernel-gtp.cfg
Change-Id: If118ed26491a1edda83eda7f95479e165ca4c150
Fixes: I6fbe8a8e55bad41532e9aed3cf71ebebffdcee52
Add a copy of osmo-ggsn.cfg, with gtpu-mode set to kernel-gtp and apn
inet6 and inet46 removed (as the kernel module only supports ipv4).
Related: OS#3209
Change-Id: I6fbe8a8e55bad41532e9aed3cf71ebebffdcee52
Remove ggsn_vty_reference from the source tree.
In manuals/Makefile.am use the new BUILT_REFERENCE_XML feature recently added
to osmo-gsm-manuals, and add a build target to generate the XML using the new
osmo-ggsn --vty-ref-xml cmdline switch.
Change-Id: I772293cc78a6c95e07565a7048c1c8dadf87d2fc
Depends: I613d692328050a036d05b49a436ab495fc2087ba
Related: OS#5041
* we don't check for libmnl via pkg-config in configure.ac
* we don't add libmnl include path to CFLAGS
As a result, we cannot #include related files.
libmnl is completely encapsulated by libgtpnl. It even
includes a forward-declaration of 'struct mnl_socket'.
Change-Id: I0af869cc3c8e30b69d73a4985c56ef7743565e95
Let's disable category here since we don't care about its formatting here.
In any case, every test relying on logging output validation should
always explicitly state the config to avoid issues in the future if
default values change.
Change-Id: Icce09882ef3ed07328679594ff84902383d16c72
Related: OS#5034
Check if tun-device is defined and give the user a hint that it is
missing instead of segfaulting with gtpu-mode kernel-gtp:
20210205141701206 DGGSN <0002> ggsn.c:186 APN(internet): Starting
20210205141701206 DGGSN <0002> ggsn.c:204 APN(internet): Opening Kernel GTP device (null)
Segmentation fault
With gtpu-mode tun it didn't segfault, but still tried to open the NULL
device:
20210205141557598 DGGSN <0002> ggsn.c:186 APN(internet): Starting
20210205141557599 DGGSN <0002> ggsn.c:189 APN(internet): Opening TUN device (null)
20210205141557599 DTUN <0001> tun.c:195 errno=1/Operation not permitted ioctl() failed
Related: OS#3208
Change-Id: I9f71af65cc0eed71728c04b774e5c08352947913
Previous code relied on abort() switching sigaction to SIG_FDL +
retriggering SIGABRT in case the signal handler returns, which would
then generate the coredump + terminate the process.
However, if a SIGABRT is received from somewhere else (kill -SIGABRT),
then the process would print the talloc report and continue running,
which is not desired.
Change-Id: I7acfdfe5020320d853cba98b5add7479f8aaaf39
Fixes: OS#4865