* [Qemu-devel] [PATCH] tap-bsd: OpenBSD uses tap(4) now
@ 2016-09-26 1:58 Brad Smith
2016-09-26 10:35 ` Thomas Huth
0 siblings, 1 reply; 5+ messages in thread
From: Brad Smith @ 2016-09-26 1:58 UTC (permalink / raw)
To: qemu-devel
Update the tap-bsd code now that OpenBSD uses tap(4).
Signed-off-by: Brad Smith <brad@comstyle.com>
diff --git a/net/tap-bsd.c b/net/tap-bsd.c
index c506ac3..8d0f049 100644
--- a/net/tap-bsd.c
+++ b/net/tap-bsd.c
@@ -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) {
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH] tap-bsd: OpenBSD uses tap(4) now
2016-09-26 1:58 [Qemu-devel] [PATCH] tap-bsd: OpenBSD uses tap(4) now Brad Smith
@ 2016-09-26 10:35 ` Thomas Huth
2016-09-29 1:41 ` Jason Wang
0 siblings, 1 reply; 5+ messages in thread
From: Thomas Huth @ 2016-09-26 10:35 UTC (permalink / raw)
To: Brad Smith, qemu-devel, Jason Wang
[-- Attachment #1: Type: text/plain, Size: 1116 bytes --]
On 26.09.2016 03:58, Brad Smith wrote:
> Update the tap-bsd code now that OpenBSD uses tap(4).
>
> Signed-off-by: Brad Smith <brad@comstyle.com>
>
>
> diff --git a/net/tap-bsd.c b/net/tap-bsd.c
> index c506ac3..8d0f049 100644
> --- a/net/tap-bsd.c
> +++ b/net/tap-bsd.c
> @@ -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) {
Looking at http://man.openbsd.org/tap.4 it seems like OpenBSD is indeed
supporting /dev/tap nowadays, so:
Reviewed-by: Thomas Huth <thuth@redhat.com>
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.
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH] tap-bsd: OpenBSD uses tap(4) now
2016-09-26 10:35 ` Thomas Huth
@ 2016-09-29 1:41 ` Jason Wang
2016-09-29 4:55 ` Thomas Huth
0 siblings, 1 reply; 5+ messages in thread
From: Jason Wang @ 2016-09-29 1:41 UTC (permalink / raw)
To: Thomas Huth, Brad Smith, qemu-devel
On 2016年09月26日 18:35, Thomas Huth wrote:
> On 26.09.2016 03:58, Brad Smith wrote:
>> Update the tap-bsd code now that OpenBSD uses tap(4).
>>
>> Signed-off-by: Brad Smith <brad@comstyle.com>
>>
>>
>> diff --git a/net/tap-bsd.c b/net/tap-bsd.c
>> index c506ac3..8d0f049 100644
>> --- a/net/tap-bsd.c
>> +++ b/net/tap-bsd.c
>> @@ -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) {
> Looking at http://man.openbsd.org/tap.4 it seems like OpenBSD is indeed
> supporting /dev/tap nowadays, so:
A question is what happens if we are using old version of OpenBSD which
does not have tap?
>
> Reviewed-by: Thomas Huth <thuth@redhat.com>
>
>
> 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.
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH] tap-bsd: OpenBSD uses tap(4) now
2016-09-29 1:41 ` Jason Wang
@ 2016-09-29 4:55 ` Thomas Huth
2016-09-30 2:53 ` Jason Wang
0 siblings, 1 reply; 5+ messages in thread
From: Thomas Huth @ 2016-09-29 4:55 UTC (permalink / raw)
To: Jason Wang, Brad Smith, qemu-devel
On 29.09.2016 03:41, Jason Wang wrote:
>
>
> On 2016年09月26日 18:35, Thomas Huth wrote:
>> On 26.09.2016 03:58, Brad Smith wrote:
>>> Update the tap-bsd code now that OpenBSD uses tap(4).
>>>
>>> Signed-off-by: Brad Smith <brad@comstyle.com>
>>>
>>>
>>> diff --git a/net/tap-bsd.c b/net/tap-bsd.c
>>> index c506ac3..8d0f049 100644
>>> --- a/net/tap-bsd.c
>>> +++ b/net/tap-bsd.c
>>> @@ -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) {
>> Looking at http://man.openbsd.org/tap.4 it seems like OpenBSD is indeed
>> supporting /dev/tap nowadays, so:
>
> 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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH] tap-bsd: OpenBSD uses tap(4) now
2016-09-29 4:55 ` Thomas Huth
@ 2016-09-30 2:53 ` Jason Wang
0 siblings, 0 replies; 5+ messages in thread
From: Jason Wang @ 2016-09-30 2:53 UTC (permalink / raw)
To: Thomas Huth, Brad Smith, qemu-devel
On 2016年09月29日 12:55, Thomas Huth wrote:
> On 29.09.2016 03:41, Jason Wang wrote:
>>
>> On 2016年09月26日 18:35, Thomas Huth wrote:
>>> On 26.09.2016 03:58, Brad Smith wrote:
>>>> Update the tap-bsd code now that OpenBSD uses tap(4).
>>>>
>>>> Signed-off-by: Brad Smith <brad@comstyle.com>
>>>>
>>>>
>>>> diff --git a/net/tap-bsd.c b/net/tap-bsd.c
>>>> index c506ac3..8d0f049 100644
>>>> --- a/net/tap-bsd.c
>>>> +++ b/net/tap-bsd.c
>>>> @@ -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) {
>>> Looking at http://man.openbsd.org/tap.4 it seems like OpenBSD is indeed
>>> supporting /dev/tap nowadays, so:
>> 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
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2016-09-30 2:53 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-26 1:58 [Qemu-devel] [PATCH] tap-bsd: OpenBSD uses tap(4) now Brad Smith
2016-09-26 10:35 ` Thomas Huth
2016-09-29 1:41 ` Jason Wang
2016-09-29 4:55 ` Thomas Huth
2016-09-30 2:53 ` Jason Wang
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.