summaryrefslogtreecommitdiff
path: root/openbsd-compat/port-tun.c
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2010-08-23 22:56:08 +0100
committerColin Watson <cjwatson@debian.org>2010-08-23 22:56:08 +0100
commit31e30b835fd9695d3b6647cab4867001b092e28f (patch)
tree138e715c25661825457c7280cd66e3f4853d474c /openbsd-compat/port-tun.c
parent78eedc2c60ff4718200f9271d8ee4f437da3a0c5 (diff)
parent43094ebf14c9b16f1ea398bc5b65a7335e947288 (diff)
merge 5.6p1
Diffstat (limited to 'openbsd-compat/port-tun.c')
-rw-r--r--openbsd-compat/port-tun.c8
1 files changed, 5 insertions, 3 deletions
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);