summaryrefslogtreecommitdiffstats
path: root/misc.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2005-12-13 10:44:13 +0100
committerDamien Miller <djm@mindrot.org>2005-12-13 10:44:13 +0100
commit62a31c9fd06506ab976a4dc2050882f29ab24693 (patch)
tree95d0a397c4aa0d69aea733f80216e787ad14a816 /misc.c
parent - markus@cvs.openbsd.org 2005/12/12 13:46:18 (diff)
downloadopenssh-62a31c9fd06506ab976a4dc2050882f29ab24693.tar.xz
openssh-62a31c9fd06506ab976a4dc2050882f29ab24693.zip
- (djm) [misc.c] Disable tunnel code for non-OpenBSD (for now), enable
again by providing a sys_tun_open() function for your platform and setting the CUSTOM_SYS_TUN_OPEN define. More work is required to match OpenBSD's tunnel protocol, which prepends the address family to the packet
Diffstat (limited to 'misc.c')
-rw-r--r--misc.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/misc.c b/misc.c
index 4f41332f9..4141e6c48 100644
--- a/misc.c
+++ b/misc.c
@@ -541,6 +541,9 @@ read_keyfile_line(FILE *f, const char *filename, char *buf, size_t bufsz,
int
tun_open(int tun, int mode)
{
+#if defined(CUSTOM_SYS_TUN_OPEN)
+ return (sys_tun_open(tun, mode));
+#elif defined(SSH_TUN_BSD)
struct ifreq ifr;
char name[100];
int fd = -1, sock;
@@ -594,6 +597,10 @@ tun_open(int tun, int mode)
debug("%s: failed to set %s mode %d: %s", __func__, name,
mode, strerror(errno));
return (-1);
+#else
+ error("Tunnel interfaces are not supported on this platform");
+ return (-1);
+#endif
}
void