summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--openbsd-compat/port-tun.c8
2 files changed, 10 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 3bb45baff..184c36980 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,9 @@
120100809 120100809
2 - (djm) bz#1561: don't bother setting IFF_UP on tun(4) device if it is
3 already set. Makes FreeBSD user openable tunnels useful; patch from
4 richard.burakowski+ossh AT mrburak.net, ok dtucker@
5
620100809
2 - OpenBSD CVS Sync 7 - OpenBSD CVS Sync
3 - djm@cvs.openbsd.org 2010/08/08 16:26:42 8 - djm@cvs.openbsd.org 2010/08/08 16:26:42
4 [version.h] 9 [version.h]
diff --git a/openbsd-compat/port-tun.c b/openbsd-compat/port-tun.c
index ddc92d0f3..0d756f74f 100644
--- a/openbsd-compat/port-tun.c
+++ b/openbsd-compat/port-tun.c
@@ -173,9 +173,11 @@ sys_tun_open(int tun, int mode)
173 173
174 if (ioctl(sock, SIOCGIFFLAGS, &ifr) == -1) 174 if (ioctl(sock, SIOCGIFFLAGS, &ifr) == -1)
175 goto failed; 175 goto failed;
176 ifr.ifr_flags |= IFF_UP; 176 if ((ifr.ifr_flags & IFF_UP) == 0) {
177 if (ioctl(sock, SIOCSIFFLAGS, &ifr) == -1) 177 ifr.ifr_flags |= IFF_UP;
178 goto failed; 178 if (ioctl(sock, SIOCSIFFLAGS, &ifr) == -1)
179 goto failed;
180 }
179 181
180 close(sock); 182 close(sock);
181 return (fd); 183 return (fd);