tap-bsd: OpenBSD uses tap(4) now
PATCH v2 1/1 tap-bsd: OpenBSD uses tap(4) now
Update the tap-bsd code now that OpenBSD uses tap(4).
Signed-off-by Brad Smith <[email protected]>
---
v2: Allow the code to deal with newer vs older OpenBSD releases
net/tap-bsd.c +5 -1
@@ -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);
Quoted 5 lines · Brad Smith
Update the tap-bsd code now that OpenBSD uses tap(4).
Signed-off-by Brad Smith <[email protected]>---
v2: Allow the code to deal with newer vs older OpenBSD releases
ping.
Quoted 25 lines
net/tap-bsd.c +5
-1@@ -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);
Jason Wang
AppliedQuoted 22 lines · Brad Smith
Update the tap-bsd code now that OpenBSD uses tap(4).
Signed-off-by Brad Smith <[email protected]>---
v2: Allow the code to deal with newer vs older OpenBSD releasesnet/tap-bsd.c +4
-0@@ -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)
net/tap-bsd.c int tap_open(char *ifname, int ifname_size, int *vnet_hdr, · line 65
Quoted 8 lines
net/tap-bsd.c +1
-1@@ -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);
Applied, thanks.