angt / glorytun

Multipath UDP tunnel
BSD 2-Clause "Simplified" License
675 stars 103 forks source link

src/bind.c: Strip tun_name path if device file. #63

Closed vifino closed 4 years ago

vifino commented 4 years ago

Hello again. Decided to not just make a new issue, but make a PR.

After the most recent commit, glorytun compiles fine under OpenBSD, however, it doesn't run.

host# $GLORYTUN bind 0.0.0.0 to SERVER_IP keyfile gt.key
AES is not available, enjoy ChaCha20!
couldn't disable persist mode on device /dev/tun0
couldn't create /var/run/glorytun.0//dev/tun0: No such file or directory

It tries to use the tun_name as the socket name, which contains slashes, therefore needing parent directories. On Linux, this is just the device name, not the device file path. This patch makes tun_name just the device name on OpenBSD as well, which allows glorytun to work fine.

Thanks for your software, I've got a single-pathed ping going from OpenBSD amd64 to Linux ppc64.

angt commented 4 years ago

Hi, I've just fixed that on master. The last fix was a little too fast, I replaced tmp by name while I should have (re)create tmp...

Thanks a lot for working on the issue !