- (djm) bz#1561: don't bother setting IFF_UP on tun(4) device if it is
already set. Makes FreeBSD user openable tunnels useful; patch from richard.burakowski+ossh AT mrburak.net, ok dtucker@
This commit is contained in:
parent
792010bafd
commit
2c4b13aa32
|
@ -1,3 +1,8 @@
|
|||
20100809
|
||||
- (djm) bz#1561: don't bother setting IFF_UP on tun(4) device if it is
|
||||
already set. Makes FreeBSD user openable tunnels useful; patch from
|
||||
richard.burakowski+ossh AT mrburak.net, ok dtucker@
|
||||
|
||||
20100809
|
||||
- OpenBSD CVS Sync
|
||||
- djm@cvs.openbsd.org 2010/08/08 16:26:42
|
||||
|
|
|
@ -173,9 +173,11 @@ sys_tun_open(int tun, int mode)
|
|||
|
||||
if (ioctl(sock, SIOCGIFFLAGS, &ifr) == -1)
|
||||
goto failed;
|
||||
ifr.ifr_flags |= IFF_UP;
|
||||
if (ioctl(sock, SIOCSIFFLAGS, &ifr) == -1)
|
||||
goto failed;
|
||||
if ((ifr.ifr_flags & IFF_UP) == 0) {
|
||||
ifr.ifr_flags |= IFF_UP;
|
||||
if (ioctl(sock, SIOCSIFFLAGS, &ifr) == -1)
|
||||
goto failed;
|
||||
}
|
||||
|
||||
close(sock);
|
||||
return (fd);
|
||||
|
|
Loading…
Reference in New Issue