Commit Graph

7 Commits

Author SHA1 Message Date
Oliver Smith ec357c5377 lib/gtp-kernel.c: check rc of in46a_from_eua
Fixes: b17fe7bf ("kernel-gtp: support IPv6 on inner layer")
Change-Id: I40e4de1517de8871224a45c173208810b42312ff
2024-02-27 16:04:42 +01:00
Oliver Smith 768d6d5be9 lib/gtp-kernel.c: initialize ret with 0
Fix -Werror=maybe-uninitialize found in Pau's build env:

/home/pespin/dev/sysmocom/git/osmo-ggsn/lib/gtp-kernel.c: In function ‘gtp_kernel_tunnel_add’:
/home/pespin/dev/sysmocom/git/osmo-ggsn/lib/gtp-kernel.c:111:13: error: ‘ret’ may be used uninitialized [-Werror=maybe-uninitialize]
  111 |         int ret;
      |             ^~~
/home/pespin/dev/sysmocom/git/osmo-ggsn/lib/gtp-kernel.c: In function ‘gtp_kernel_tunnel_del’:
/home/pespin/dev/sysmocom/git/osmo-ggsn/lib/gtp-kernel.c:167:13: error: ‘ret’ may be used uninitialized [-Werror=maybe-uninitialize]
  167 |         int ret;
      |             ^~~

Fixes: b17fe7bf ("kernel-gtp: support IPv6 on inner layer")
Change-Id: I19067ebe561d4c067b9ace7f5b201e15af6b342e
2024-02-27 15:00:59 +01:00
Oliver Smith b17fe7bfe9 kernel-gtp: support IPv6 on inner layer
Related: OS#6096
Change-Id: I3df47b6c209f1e2f8254ba139581d6e622c6b35f
2024-02-21 16:22:24 +01:00
Harald Welte f01ce65f5b gtp-kernel: don't #include libmnl headers
* 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
2021-02-20 11:28:59 +01:00
Harald Welte be1cf99e9a gtp-kernel: Remove duplicate #include section
This was probably a wrong patch merge at some point.

Change-Id: I54191aca8fd55de84d86591035fe9785d379205f
2021-02-20 11:05:53 +01:00
Pau Espin 1ef2621d3f gtp-kernel.c: Fix wrong use of in46a_from_eua, print IPv6 euas
in46a_from_eua() API documentation clearly states an array of 2 items
should be passed as pointer, but show_one_pdp() was passing only one,
which would end up in out-of-bounds writes on v4v6 EUAs.

Let's better use ippool to print allocated ip addresses instead of
parsing EUAs we sent some point in the past.

Change-Id: I7e164f40f50de43027bcd4464aa879450d2fb10e
2019-08-28 11:14:57 +02:00
Harald Welte f2286395e9 Move kernel GTP support from ggsn/ to lib/
This way, the IP address / route handling between TUN devices and kernel
GTP can be shared, which will provide not only a unified codebase but
also a more consistent behavior.

This also paves the road for to use kernel GTP from sgsnemu in the future.

Related: OS#3214
Change-Id: Ic53a971136edd0d8871fbd6746d7b0090ce3a188
2018-04-25 21:44:46 +02:00