hyperboria / bugs

Peer-to-peer IPv6 networking, secure and near-zero-conf.
154 stars 17 forks source link

Failed to configure tunnel on OpenBSD 5.9 (due to changes in TUN interface (?)) #135

Closed wstrm closed 7 years ago

wstrm commented 8 years ago

Tested on both crashey and master branch. With OpenBSD 5.9 GENERIC#1761 amd64

WARN Configurator.c:111 Got error [Failed to configure tunnel [NetPlatform_openbsd.c:104 ioctl(SIOCAIFADDR) [Device not configured]]] calling [Core_initTunnel], ignoring.

Full log: https://gist.github.com/willeponken/4b65db8a3cce5be3e3c6e0f84c5781fe

I suppose this is because new changes to the TUN interface on OpenBSD 5.9:

New tap(4) pseudo-device, split up from tun(4), providing a layer 3 interface with userland tools. -- https://www.openbsd.org/59.html

Also, there is a formatting/style issue in TUNInterface_openbsd.c, should this be pushed to crashey or master?:

index 650eede..9c3605b 100644
--- a/interface/tuntap/TUNInterface_openbsd.c
+++ b/interface/tuntap/TUNInterface_openbsd.c
@@ -69,7 +69,7 @@ struct Iface* TUNInterface_new(const char* interfaceName,
     // Since devices are numbered rather than named, it's not possible to have tun0 and cjdns0
     // so we'll skip the pretty names and call everything tunX
     if (assignedInterfaceName) {
-        if(ppa == -1) {
+        if (ppa == -1) {
             snprintf(assignedInterfaceName, TUNInterface_IFNAMSIZ, "%s", interfaceName);
         } else {
             snprintf(assignedInterfaceName, TUNInterface_IFNAMSIZ, "tun%d", ppa);
kpcyrd commented 7 years ago
             // The name of a persistent TUN device to use.
             // This for starting cjdroute as its own user.
             // *MOST USERS DON'T NEED THIS*
             "tunDevice": "tun0"

This issue goes away if you set the tunDevice explicitly. I assume it's not detecting the automatic name correctly.

kpcyrd commented 7 years ago

This has been fixed in crashey.