]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
include tunnel device path in error message
authorDamien Miller <djm@mindrot.org>
Sat, 25 Jan 2020 05:30:22 +0000 (16:30 +1100)
committerDamien Miller <djm@mindrot.org>
Sat, 25 Jan 2020 05:30:22 +0000 (16:30 +1100)
openbsd-compat/port-net.c

index bb535626ffe02062a7e87f6edb4d0680d23d8904..617bffcebe8adddf06862122966958768fca84d9 100644 (file)
@@ -137,6 +137,7 @@ sys_set_process_rdomain(const char *name)
 
 #if defined(SSH_TUN_LINUX)
 #include <linux/if_tun.h>
+#define TUN_CTRL_DEV "/dev/net/tun"
 
 int
 sys_tun_open(int tun, int mode, char **ifname)
@@ -147,10 +148,9 @@ sys_tun_open(int tun, int mode, char **ifname)
 
        if (ifname != NULL)
                *ifname = NULL;
-
-       if ((fd = open("/dev/net/tun", O_RDWR)) == -1) {
-               debug("%s: failed to open tunnel control interface: %s",
-                   __func__, strerror(errno));
+       if ((fd = open(TUN_CTRL_DEV, O_RDWR)) == -1) {
+               debug("%s: failed to open tunnel control device \"%s\": %s",
+                   __func__, TUN_CTRL_DEV, strerror(errno));
                return (-1);
        }