Skip to content

Commit

Permalink
tap-bsd: OpenBSD uses tap(4) now
Browse files Browse the repository at this point in the history
Update the tap-bsd code now that OpenBSD uses tap(4).

Signed-off-by: Brad Smith <[email protected]>
Signed-off-by: Jason Wang <[email protected]>
  • Loading branch information
brad0 authored and jasowang committed Oct 26, 2016
1 parent 67aa449 commit 9463c07
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion net/tap-bsd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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);
Expand Down

0 comments on commit 9463c07

Please sign in to comment.