View | Details | Raw Unified | Return to bug 1561 | Differences between
and this patch

Collapse All | Expand All

(-)openbsd-compat/port-tun.c (-3 / +5 lines)
Lines 173-181 sys_tun_open(int tun, int mode) Link Here
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);

Return to bug 1561