Thursday, November 28, 2019

Re: net/mlvpn ioctl(TUNSIFMODE): Invalid argument

On Thu, Nov 28, 2019 at 01:41:08PM +0100, Solene Rapenne wrote:
> On Thu, Nov 28, 2019 at 01:35:11PM +0100, Tim Kuijsten wrote:
> > Looking at [1] I see they don't set tuninfo.type. This should be set to
> > IFT_TUNNEL:
> > net/if_types.h:#define IFT_TUNNEL 0x83
> >
> > Does that help?
> >
> > [1] https://github.com/zehome/MLVPN/blob/2.3.2/src/tuntap_bsd.c#L146-L150
> >
>
> with the following patch it starts but I can't see any mlvpn process
> running, but it starts without any error message.
> I'll try setting up a server now and see if it works.
>
> Thanks for the help!
>
>
> Index: src/tuntap_bsd.c
> --- src/tuntap_bsd.c.orig
> +++ src/tuntap_bsd.c
> @@ -146,6 +146,7 @@ root_tuntap_open(int tuntapmode, char *devname, int mt
> struct tuninfo tuninfo;
> tuninfo.mtu = mtu;
> tuninfo.flags = IFF_POINTOPOINT;
> + tuninfo.type = IFT_TUNNEL;
> tuninfo.baudrate = 0;
> if (ioctl(fd, TUNSIFINFO, &tuninfo, sizeof(tuninfo)) < 0) {
> warn("ioctl(TUNSIFMODE)");
>

with this patch, server is able to listen correctly, but the client
displays output and exits, no data is sent on the udp port 5080

solene# mlvpn -c mlvpn.conf --debug -v -u _mlvpn
2019-11-28T18:24:33 [ DBG] absolute maximum mtu: 1444
2019-11-28T18:24:33 [INFO/config] new password set
2019-11-28T18:24:33 [INFO/config] dsl1 tunnel added
2019-11-28T18:24:33 [INFO] created interface `tun0'
2019-11-28T18:24:33 [INFO] dsl1 bind to *
solene#
solene# ps auxww | grep mlvpn
solene#

I don't know if I do it wrong.

[general]
statuscommand = "/etc/mlvpn/mlvpn_updown.sh"
mode = "client"
ip4 = "10.42.43.1/30"
ip4_gateway = "10.42.43.2"
ip4_routes = "192.168.0.0/24 192.168.1.0/24"
mtu = 1444
tuntap = "tun"
interface_name = "tun0"
timeout = 30
password = "X"
cleartext_data = 0

[dsl1]
bindhost = "*"
remotehost = "163.172.223.238"
remoteport = 5080

No comments:

Post a Comment