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
Fix test for return value from gtp_pdp_getimsi() so
we do not call show_one_pdp() with an uninitialised pdp_t
Change-Id: Ic40429939b185f97c020dd3904e054fe860b91e8
The PDP context is searched on the hash which is generated
on context creation from the IMSI in gtp format. - A hash
created from "human-readable" IMSI does not match.
Check user input for length then convert the IMSI to gtp format
before continuing.
Change-Id: Icd2e2bc6068c06fbf5d5fe905ebcda8954f33f04
queue_test.c:39:3: warning: format '%ld' expects argument of type
'long int', but argument 9 has type 'unsigned int' [-Wformat=]
Change-Id: Ie9530cdd191386ca3f6c336684f81c4582c4d962
Remove OpenSUSE bug report link, set version to @VERSION@, make it build
with CentOS 8 etc.
Related: OS#4550
Change-Id: Iba04d5c7b9beee80baca83063f9cb2cd533a0003
Remove old osmo-ggsn.spec.in file from 2017 in favor of the one imported
from mnhauke, which is currently used in openSUSE nightly builds (will
be added in a follow-up commit).
Related: OS#4550
Change-Id: I24794564f0d4d85d3955ab08f4e4c3c05f53a0cd
In debug.c the log category DICMP6 uses LOGL_DEBUG as default. This is
way to verbose, lets use LOGL_NOTICE instead.
Change-Id: I4c6a9165114d1240e7e2cfa98d30d571a3f4e9d2
Related: OS#2577
The device name option could be empty, using it without checking
would crash sgsnemu. Using the real device is better anyway.
Change-Id: Ic3934281bfc2e433323e4ab72cf5be2cbd1c962a
Until now, sgsnemu was able to identify pdp contexts of incoming packets
in the tun based on the assumption that the Interface-Identifier part of
public IPv6 addresses in incoming packets was equal to the announced
prefix path during Create Pdp Context Response (see changes in cb_tun_ind()).
This assumption works fine with osmo-ggsn due to implementation details but
breaks on other spec-conformant GGSNs.
In order to fix it, a new placeholder struct pdp_peer_sgsnemu_ctx is
introduced which will be assigned to each pdp_t "peer[0]" user-defined
pointer. This way, each pdp_t ctx upgrades from having only 1 iphash_t
item to 3 (hence being able to match against 3 different ip addresses).
This way, in IPv6 we can match against 2 different IP addresses set on
the tun iface:
* link-local: "fe80::IfId", where IfId is the Interface-Identifier
received during Pdp Context Resp and which can be used to communicate
with the nearest router (the GGSN).
* global: The global IPv6 addr set after SLAAC procedure, containing a
the prefix announced by CreatePdpContextResp/RouterAdvertisement and
an Interface-Identifier chosen by sgsnemu itself (currently ::ff).
This change is also a step forward towards supporting IPv4v6 APNs in sgsnemu.
Related: OS#4434
Change-Id: I0d36145250185e4cce699fdaedfe96bd969f5fa1
Disable IPv6 automatic SLAAC by linux kernel and handle it manually.
This allows us gaining control on local address acquisition and set
addresses and routing properly. It will also allow us to run in ping
mode without a tun iface.
Related: OS#4434
Change-Id: Iae59cf6ffb181357e10b3080a5c751bd454f4a1f
On older systems (like debian 8), the enum is not present in the header
file and build will fail (as saw in osmocom's OBS instance).
Furthermore, the sysctl to change the value was added at a later point
in time, which means compiling can go fine but running may fail due to
the sysctl not being available.
This is a fix-up to Change-Id I1d51f3ca91edbb3b788939982ab63264182ec2ce
Change-Id: I208970d5b16ea7148444d414b0a6f68c8d9a086c
Functions for IPv6 will be added soon afterwards. Also take the chance
to check for address length in sgsnemu and only apply the route if the
address matches.
Change-Id: Ic6c1b3c11c56f047e6e8c6f1040257fd62afea0f