The MS protocol needs to be passed to gtp-tunnel delete, instead of the
SGSN_GGSN_PROTO.
Fix for:
+ gtp-tunnel add gtp_sgsn v1 200 100 172.99.0.1 fd00::2
…
+ gtp-tunnel delete gtp_sgsn v1 200 ip6
genl_socket_talk: No such file or directory
Change-Id: Ib6b011520fe41855b87ed0e2f6f8a6af3d0b2400
gtp-link add <device> <family> [--sgsn] [<address>]
Allow to specify listener address, if not specified use ANY_ADDRESS.
Change-Id: I7a9b64393fd68d58c2c158c0e85c0470be007f63
Add tests to ensure libgtpnl + kernel driver work as expected.
Right now a kernel needs to be built from source, using Pablo's tree:
https://git.kernel.org/pub/scm/linux/kernel/git/pablo/gtp.git/
Make sure to enable:
CONFIG_GTP=y
CONFIG_NET_NS=y
CONFIG_VETH=y
$ cp bzImage tests/qemu/_linux
$ ./configure --enable-qemu-tests
$ make
$ make check
Once patches are upstreamed, it will be possible to use a pre-built
kernel from jenkins with: make -C tests qemu-download-kernel
Related: OS#1952
Change-Id: Ibf75514b866fffb11e90529e4705f126b23d7415
Flags tells us what fields have been set in this object.
This is required by
./gtp-tunnel del
otherwise, build helper function adds the MS/UE address and kernel reports
ENOENT, and tunnel identifier is ignored.
Update gtp-tunnel tool to set flowid to zero in the GTP version 0 case,
otherwise kernel reports EINVAL since now this flag is not ever set.
Change-Id: I66677ab2d4de2c459ed9987c465fce6f059d6d93
Kernel now supports for TID/I_TEI to be used in both IPv4 and IPv6 GTP
tunnels. This improves dualstack support for MS/UE so GTP traffic can
be identified with the same tunnel identifier.
Update gtp-tunnel to specify the family, since a tunnel is now
identified by the following tuple [ version, identifier, family ].
Change-Id: I584d3997ffb89cd430dfda9615a4ce0ce517ab2a
GTP driver bails out for IPv4-mapped-IPv6 socket with EADDRNOAVAIL,
to prevent issues with setsockopt IPV6_ADDRFORM.
GTP control plane checks that tunnel family matches the socket family
for this GTP device, ie. there is a 1:1 mapping between the socket
listener and the device which determines the supported IP tunnel header.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Change-Id: I887a107657059adeb14ae425576ae7ea9018f762
Update tool to allow to specify family that is used for the outer network
header in GTP tunnels.
./gtp-link add gtp0 ip # IPv4 GGSN
./gtp-link add gtp0 ip --sgsn # IPv4 SGSN
./gtp-link add gtp0 ip6 # IPv6 GGSN
./gtp-link add gtp0 ip6 --sgsn # IPv6 SGSN
Change-Id: I201c32a1bf9a2ab7a228287590bc7ec19c4997b9
Instead of having one file in AC_OUTPUT, and all others in
AC_CONFIG_FILES, move all of them to AC_CONFIG_FILES. Sort the files
while at it and have one per line.
Fix this warning:
configure.ac:86: warning: AC_OUTPUT should be used without arguments.
Change-Id: Iea782b03c9ede154eedbd0c0e9f0d7359bb49967
Implement IPv6 in libgtpnl and the gtp-tunnel testing tool. Allow to
combine:
- GTPA_MS_ADDRESS and GTPA_PEER_ADDR6
- GTPA_MS_ADDR6 and GTPA_PEER_ADDRESS
to specify IPv4-in-IPv6-GTP and IPv6-in-IPv4-GTP in the tunnel
declaration from control plane.
This patch is based on multiple patches from Pablo in OS#6123. I decided
to squash them to directly implement v4-in-v6 and vice versa, instead of
implementing another variant first and then changing it again.
Co-developed-by: Pablo Neira Ayuso <pablo@netfilter.org>
Related: OS#6096
Change-Id: If864c9170f74af52a95cbc4cdb1b866e0309306b
Prepare for IPv6 support by using a new struct for MS and SGSN
addresses, in which either an IPv4 or IPv6 can be stored.
Related: OS#6096
Change-Id: Ifc7e3b03a723fb544d1c7b789101102b2c27b60e
Make the file exactly the same as include/uapi/linux/gtp.h in
linux.git. GTPA_SGSN_ADDRESS is not used, but we decided to rather add
it and not have a diff.
Related: https://gerrit.osmocom.org/c/libgtpnl/+/34735/comment/909c69a6_2fe7781a/
Change-Id: Icf7b78e6655b6573c09c2eaa71d22ef6742b2594
Apply same fix as done by Pablo in linux.git:
> Subtract one to __GTPA_MAX, otherwise GTPA_MAX is off by 2
Change-Id: I42a358fc795d0e593e2c5509dcfa6ffdbad3cbfa
Make it consistent with other Osmocom projects by removing special
naming for CFLAGS and CPPFLAGS. Otherwise the arguments we typically
add, such as --enable-sanitize which is already there, or
--enable-werror which I'll add in the next patch, do not work without
further changes.
Change-Id: I11e9657fb0c038169bd414a6455044ff4a4709b7
Otherwise, inet_ntop() might return ENOSPC because of the buffer
being too small to accomodate an IPv6 address.
Change-Id: I2283e0c3112bec8e6e7e7b5c96657facc09d0a7a
When genl_socket_talk() fails, return rc != 0.
While testing the new osmo-upf program, I noticed that I failed to get a
"Operation not permitted" error when forgetting to set cap_net_admin on
the osmo-upf binary. It looked like everything should work, but doesn't.
It is possible to catch these error cases without this patch, by
monitoring errno. That may well be the intention of the API? I'm still
submitting this patch because it seems better to return rc != 0.
Here is a code example that also catches all error cases without this
patch:
errno = 0;
rc = gtp_add_tunnel(genl_id, nl, t);
if (errno) {
rc = -errno;
} else if (rc) {
rc = -EINVAL;
} else {
tun->active = true;
}
return rc;
Related: SYS#5599
Change-Id: I22fd69709e023572c6c616a4184340a554456faf
Remove OpenSUSE bug report link, set version to @VERSION@, make it build with
CentOS 8 etc.
Related: OS#4550
Change-Id: I5376fde96c7442eb70f49a2ce38f57a817a94f81
Current LIBVERSION is 1:1:1 (current:revision:age), so major=current-age
makes it be major=0: libgtpnl0.
It can bee seen in current osmocom debian repos that libgtpnl1 package
contains libgtpnl.so.0.
Let's set package name accordingly.
Change-Id: I7d2fa50b6a17a598467f555558660ef2396c1744
The .tarball-version file should contain the *source version* uniquely
identifying the git commit, and not the Debian package name.
With https://gerrit.osmocom.org/#/c/osmo-ci/+/10343/ there is a correct
.tarball-version file in the .tar.xz of the nightly source packages.
Related: OS#3449
Change-Id: I22dac8524ce8acb033dc9c72eab107999f49f975