tap-bsd: OpenBSD uses tap(4) now
PATCH 1/1 tap-bsd: OpenBSD uses tap(4) now
Update the tap-bsd code now that OpenBSD uses tap(4).
net/tap-bsd.c +0 -4
@@ -55,11 +55,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__) -snprintf (dname,sizeof dname,"/dev/tun%d" , i); -#else snprintf (dname,sizeof dname,"/dev/tap%d" , i); -#endif }TFR (fd =open (dname,O_RDWR ));if (fd >=0 ) {
Quoted 11 lines · Brad Smith
Update the tap-bsd code now that OpenBSD uses tap(4).
Signed-off-by Brad Smith <[email protected]>net/tap-bsd.c +0
-0@@ -55,11 +55,7 @@ int tap_open(char *ifname, int ifname_size, int *vnet_hdr,if (*ifname) {
net/tap-bsd.c int tap_open(char *ifname, int ifname_size, int *vnet_hdr, · line 61
Quoted 10 lines
net/tap-bsd.c +0
-4snprintf (dname,sizeof dname,"/dev/%s" , ifname); }else { -#if defined(__OpenBSD__) -snprintf (dname,sizeof dname,"/dev/tun%d" , i); -#else snprintf (dname,sizeof dname,"/dev/tap%d" , i); -#endif }TFR (fd =open (dname,O_RDWR ));if (fd >=0 ) {
Looking at http://man.openbsd.org/tap.4 it seems like OpenBSD is indeed supporting /dev/tap nowadays, so:
PS: Please make sure to CC: the QEMU subsystem maintainer (see MAINTAINERS or use scripts/get_maintainer.pl) to make sure that your patches do not get lost in the high traffic of the qemu-devel mailing list.
Quoted 16 lines · Thomas Huth
Quoted 15 lines · Brad Smith
Update the tap-bsd code now that OpenBSD uses tap(4).
Signed-off-by Brad Smith <[email protected]>net/tap-bsd.c +0
-2@@ -55,11 +55,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__) -snprintf (dname,sizeof dname,"/dev/tun%d" , i);
Quoted 8 lines
net/tap-bsd.c int tap_open(char *ifname, int ifname_size, int *vnet_hdr, · line 61
Quoted 6 lines
net/tap-bsd.c +0
-2-#else snprintf (dname,sizeof dname,"/dev/tap%d" , i); -#endif }TFR (fd =open (dname,O_RDWR ));if (fd >=0 ) {Looking at http://man.openbsd.org/tap.4 it seems like OpenBSD is indeed supporting
/dev/tapnowadays, so:
A question is what happens if we are using old version of OpenBSD which does not have tap?
Quoted 9 lines
Reviewed-by Thomas Huth <[email protected]>PS: Please make sure to CC: the QEMU subsystem maintainer (see
MAINTAINERSor usescripts/get_maintainer.pl) to make sure that your patches do not get lost in the high traffic of the qemu-devel mailing list.
Quoted 29 lines · Jason Wang
Quoted 17 lines · Thomas Huth
Quoted 16 lines · Brad Smith
Update the tap-bsd code now that OpenBSD uses tap(4).
Signed-off-by Brad Smith <[email protected]>net/tap-bsd.c +0
-2@@ -55,11 +55,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__) -snprintf (dname,sizeof dname,"/dev/tun%d" , i);Quoted 8 lines
Quoted 6 lines
net/tap-bsd.c +0
-2-#else snprintf (dname,sizeof dname,"/dev/tap%d" , i); -#endif }TFR (fd =open (dname,O_RDWR ));if (fd >= 0) {Looking at http://man.openbsd.org/tap.4 it seems like OpenBSD is indeed supporting
/dev/tapnowadays, so:
Quoted 2 lines
A question is what happens if we are using old version of OpenBSD which does not have tap?
You can still specify the ifname manually, can't you?
Thomas
Quoted 28 lines · Thomas Huth
Quoted 27 lines · Jason Wang
Quoted 25 lines · Thomas Huth
Quoted 21 lines · Brad Smith
Update the tap-bsd code now that OpenBSD uses tap(4).
Signed-off-by Brad Smith <[email protected]>net/tap-bsd.c +0
-4@@ -55,11 +55,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__) -snprintf (dname,sizeof dname,"/dev/tun%d" , i); -#else snprintf (dname,sizeof dname,"/dev/tap%d" , i); -#endif }TFR (fd =open (dname,O_RDWR ));Quoted 1 line
if (fd >= 0) {Looking at http://man.openbsd.org/tap.4 it seems like OpenBSD is indeed supporting
/dev/tapnowadays, so:
Quoted 6 lines
Quoted 2 lines
A question is what happens if we are using old version of OpenBSD which does not have tap?
You can still specify the ifname manually, can't you?
Thomas
Yes, but the codes were for cases that ifname were not given.
Thanks