Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6224b5ec authored by Chia-chi Yeh's avatar Chia-chi Yeh
Browse files

VPN: set IFF_NO_PI on TUN interface.

Packet info header (struct tun_pi) was required to support IPv6
in kernel prior to 2.6.26. Setting IFF_NO_PI will remove the header
from the packets sent/recieved via TUN file descriptor, so now they
are just raw IP packets.

Change-Id: I0b4ae9db23d3bc10995a00eb053527b499ad6eb6
parent 3663227a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -68,7 +68,7 @@ static int create_interface(int mtu, char *name, int *index)
    memset(&ifr4, 0, sizeof(ifr4));

    // Allocate interface.
    ifr4.ifr_flags = IFF_TUN;
    ifr4.ifr_flags = IFF_TUN | IFF_NO_PI;
    if (ioctl(tun, TUNSETIFF, &ifr4)) {
        LOGE("Cannot allocate TUN: %s", strerror(errno));
        goto error;