Project

General

Profile

Actions

Bug #6382

open

"TC_pdp6_act_deact_gtpu_access" fails with kernel gtp-u

Added by osmith 2 months ago. Updated 2 months ago.

Status:
Feedback
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
03/01/2024
Due date:
% Done:

0%

Spec Reference:

Description

Pau and I debugged why TC_pdp6_act_deact_gtpu_access does not work with osmo-ggsn with kernel gtp-u. It passes without kernel gtp-u.

pespin: so I'd say that use case cannot really be performed right now as with current setup, but it's quite a specific one and not sure what would be the best desired behavior

pespin‎: so in summary: a GTP-U/IPv6(src-addr-link-local) arrives to the gtp kernel module (socket fd1u), and it decides the GGSN (userspace) needs to handle the packet, so the packet is pushed/read by osmo-ggsn, which in our current logic decides to forward the packet out of the tun. In order to do that, when we have a non-gtp generic tun, we use the tun FD to inject the decapsulted packet (IPv6(src-addr-link-local) into the network stack.

pespin‎: but when using the gtp tundev kind, we apparently do have the "tun fd" we need to inject decapsulated packets from the userspace program (osmo-ggsn), that only happens through the network stack internally.

pespin‎: So the question would be: 1- Can we somehow obtain an fd for the tun so we can inject decapsulated packets to it like we do in the userspace-gtp scenario? If yes, we should replace fd = -1 with that. If no, then we simply assume we don't want to inject those packets and discard them

pespin‎: feel free to create the ticket or point me to the existing one and I can fill in more info

osmo-ggsn log + dmesg

The error happens in lib/tun.c:

int tun_encaps(struct tun_t *tun, void *pack, unsigned len)
{
    int rc;
    rc = write(tun->fd, pack, len);
    if (rc < 0) {
        SYS_ERR(DTUN, LOGL_ERROR, errno, "TUN(%s): write() failed", tun->devname);
    ...
tun->fd is -1 for kernel gtp-u, it gets set in lib/tun.c:tun_new():
    if (!use_kernel) {
        /* Open the actual tun device */
        if (((*tun)->fd = open("/dev/net/tun", O_RDWR)) < 0) {
        ...
    } else {
        strncpy((*tun)->devname, dev_name, IFNAMSIZ);
        (*tun)->devname[IFNAMSIZ - 1] = 0;
        (*tun)->fd = -1;

        if (gtp_kernel_create(-1, dev_name, fd0, fd1u) < 0) {
Actions

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 48.8 MB)