Re: Interface auto-cloning bug or feature?

From: Maksim Yevmenkin <maksim.yevmenkin_at_gmail.com>
Date: Mon, 22 Sep 2008 18:49:14 -0700
[...]

>>> ok, how about attached patch. i put it together *very* quickly and
>>> only gave it a light testing. its for tap(4), because i could compile
>>> it as a module and tun(4) is compiled into kernel by default, but the
>>> idea should identical for tun(4). should be even simpler for tun(4)
>>> because it does not have to deal with 2 kind of devices (i.e. tap and
>>> vmnet). give it a try, and see if it works. please try both cloning
>>> paths, i.e.
>>>
>>> 1) cat /dev/tap (/dev/vmnet) with and/or without unit number
>>>
>>> and
>>>
>>> 2) ifconfig tapX (vmnetX) create/destroy
>>>
>>> in the mean time i will prepare something similar for tun(4).
>>
>> attached is similar patch for tun(4). i only made sure it compiles :)
>> rebuilding kernel now...

attached is a slightly better patch for tap(4). the idea is to use
extra ALLOCATED flag that prevents the race Kostik pointed out. could
you please give it a try? any review comments are greatly appreciated.
if this is acceptable, i will prepare something similar for tun(4)

thanks,
max

Received on Mon Sep 22 2008 - 23:49:16 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:35 UTC