- (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
|
20100809
|
||||||
- OpenBSD CVS Sync
|
- OpenBSD CVS Sync
|
||||||
- djm@cvs.openbsd.org 2010/08/08 16:26:42
|
- 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)
|
if (ioctl(sock, SIOCGIFFLAGS, &ifr) == -1)
|
||||||
goto failed;
|
goto failed;
|
||||||
ifr.ifr_flags |= IFF_UP;
|
if ((ifr.ifr_flags & IFF_UP) == 0) {
|
||||||
if (ioctl(sock, SIOCSIFFLAGS, &ifr) == -1)
|
ifr.ifr_flags |= IFF_UP;
|
||||||
goto failed;
|
if (ioctl(sock, SIOCSIFFLAGS, &ifr) == -1)
|
||||||
|
goto failed;
|
||||||
|
}
|
||||||
|
|
||||||
close(sock);
|
close(sock);
|
||||||
return (fd);
|
return (fd);
|
||||||
|
|
Loading…
Reference in New Issue