summaryrefslogtreecommitdiff
path: root/net/miredo/patches/patch-ac
blob: 4bf0a7378bfd0b209de5d98008c4a2789affdd75 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
$NetBSD: patch-ac,v 1.1.1.1.2.1 2006/06/07 18:23:42 ghen Exp $

--- libtun6/tun6.c.orig	2006-05-01 12:57:31.000000000 +0000
+++ libtun6/tun6.c
@@ -94,6 +94,8 @@ static const char *os_driver = "BSD";
 
 # if defined (HAVE_NET_IF_TUN_H)
 #  include <net/if_tun.h> // TUNSIFHEAD, TUNSLMODE
+# elif defined(__DragonFly__)
+#  include <net/tun/if_tun.h>
 # elif defined (__APPLE__)
 #  define TUNSIFHEAD  _IOW('t', 96, int)
 # endif
@@ -213,7 +215,7 @@ tun6 *tun6_create (const char *req_name)
 		 * Some BSD variants or older kernel versions do not support /dev/tun,
 		 * so fallback to the old scheme.
 		 */
-		for (unsigned i = 0; (fd == -1) && (errno != ENOENT); i++)
+		for (unsigned i = 0; (fd == -1) && (errno == ENOENT); i++)
 		{
 			char tundev[5 + IFNAMSIZ];
 			snprintf (tundev, sizeof (tundev), "/dev/tun%u", i);