gtp_build_payload(): Support absent peer and SGSN address

When deleting a PDP context via "gtp-tunnel delete", we specify only
the gtp netdevice, the gtp version and the TID/TEI.  However, the
gtp_build_payload() function unconditionally created the netlink
attributes for GTPA_PEER_ADDRESS and GTPA_MS_ADDRESS, having their
addresses set to zero.  The kernel then tried to find a PDP context with
MS and PEER address of 0.0.0.0, and always failed with ENOENT.

The same problem also occurred with OsmoGGSN and OpenGGSN: PDP contexts
could be added but never removed.

The corresponding kernel change that requires this userland change
is the following commit introduced in 4.12-rc1:

commit d9e2dd122637034a0697bf268eed9233701b9dca
Author: Andreas Schultz <aschultz@tpip.net>
Date:   Thu Mar 9 17:43:00 2017 +0100

    gtp: unify genl_find_pdp and prepare for per socket lookup

Older kernels will work with libgtpnl both before and after this commit,
as they internally will simply disregard any attributes beyond TID/TEI.

Change-Id: Ie2ceb2cd6d2fb009bba01a05b5480c1ad775d619
1 file changed
tree: af678411699b6b836a334e06409de7394c2237ea
  1. contrib/
  2. debian/
  3. include/
  4. m4/
  5. src/
  6. tools/
  7. .gitignore
  8. AUTHORS
  9. configure.ac
  10. COPYING
  11. libgtpnl.pc.in
  12. Make_global.am
  13. Makefile.am
  14. README.md
  15. TODO-RELEASE
README.md

libgtpnl - netlink library for Linux kernel GTP

In order to control the kernel-side GTP-U plane, a netlink based control interface between GTP-C in userspace and GTP-U in kernelspace was invented.

The encoding and decoding of these control messages is implemented in the libgtpnl (library for GTP netlink).

libgtpnl is part of the Osmocom Open Source Mobile Communications project.

Homepage

The official homepage of the project is https://osmocom.org/projects/libgtpnl/wiki/

GIT Repository

You can clone from the official libgtpnl.git repository using

git clone git://git.osmocom.org/libgtpnl.git

There is a cgit interface at http://git.osmocom.org/libgtpnl/

Mailing List

Discussions related to libgtpnl are happening on the osmocom-net-gprs@lists.osmocom.org mailing list, please see https://lists.osmocom.org/mailman/listinfo/osmocom-net-gprs for subscription options and the list archive.

Please observe the Osmocom Mailing List Rules when posting.

Contributing

Our coding standards are described at https://osmocom.org/projects/cellular-infrastructure/wiki/Coding_standards

We use a gerrit based patch submission/review process for managing contributions. Please see https://osmocom.org/projects/cellular-infrastructure/wiki/Gerrit for more details

The current patch queue for libgtpnl can be seen at https://gerrit.osmocom.org/#/q/project:libgtpnl+status:open