diff options
author | Brad Smith <brad@comstyle.com> | 2016-10-06 21:28:33 -0400 |
---|---|---|
committer | Jason Wang <jasowang@redhat.com> | 2016-10-26 09:57:59 +0800 |
commit | 9463c0778b122dee31de3e0883c6564c31d894a4 (patch) | |
tree | d0c2715e1713ddbecabc3b819ee2275a3ed20a0d | |
parent | 67aa4493444c6bda0eca14a027653dd426bede97 (diff) |
tap-bsd: OpenBSD uses tap(4) now
Update the tap-bsd code now that OpenBSD uses tap(4).
Signed-off-by: Brad Smith <brad@comstyle.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
-rw-r--r-- | net/tap-bsd.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/net/tap-bsd.c b/net/tap-bsd.c index c506ac31d6..6c9692263d 100644 --- a/net/tap-bsd.c +++ b/net/tap-bsd.c @@ -35,6 +35,10 @@ #include <net/if_tap.h> #endif +#if defined(__OpenBSD__) +#include <sys/param.h> +#endif + #ifndef __FreeBSD__ int tap_open(char *ifname, int ifname_size, int *vnet_hdr, int vnet_hdr_required, int mq_required, Error **errp) @@ -55,7 +59,7 @@ int tap_open(char *ifname, int ifname_size, int *vnet_hdr, if (*ifname) { snprintf(dname, sizeof dname, "/dev/%s", ifname); } else { -#if defined(__OpenBSD__) +#if defined(__OpenBSD__) && OpenBSD < 201605 snprintf(dname, sizeof dname, "/dev/tun%d", i); #else snprintf(dname, sizeof dname, "/dev/tap%d", i); |