diff options
author | Damien Miller <djm@mindrot.org> | 2005-12-13 20:44:13 +1100 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2005-12-13 20:44:13 +1100 |
commit | 62a31c9fd06506ab976a4dc2050882f29ab24693 (patch) | |
tree | 95d0a397c4aa0d69aea733f80216e787ad14a816 /misc.c | |
parent | d47c62a714c2c3e6a564aa498e3ef0445c9f9ea3 (diff) |
- (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.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -541,6 +541,9 @@ read_keyfile_line(FILE *f, const char *filename, char *buf, size_t bufsz, | |||
541 | int | 541 | int |
542 | tun_open(int tun, int mode) | 542 | tun_open(int tun, int mode) |
543 | { | 543 | { |
544 | #if defined(CUSTOM_SYS_TUN_OPEN) | ||
545 | return (sys_tun_open(tun, mode)); | ||
546 | #elif defined(SSH_TUN_BSD) | ||
544 | struct ifreq ifr; | 547 | struct ifreq ifr; |
545 | char name[100]; | 548 | char name[100]; |
546 | int fd = -1, sock; | 549 | int fd = -1, sock; |
@@ -594,6 +597,10 @@ tun_open(int tun, int mode) | |||
594 | debug("%s: failed to set %s mode %d: %s", __func__, name, | 597 | debug("%s: failed to set %s mode %d: %s", __func__, name, |
595 | mode, strerror(errno)); | 598 | mode, strerror(errno)); |
596 | return (-1); | 599 | return (-1); |
600 | #else | ||
601 | error("Tunnel interfaces are not supported on this platform"); | ||
602 | return (-1); | ||
603 | #endif | ||
597 | } | 604 | } |
598 | 605 | ||
599 | void | 606 | void |