[ipxe-devel] [PATCH 1/2] Prevent a netdevice (VLAN) to open/close twice.

Michael Brown mcb30 at ipxe.org
Wed Mar 5 14:55:55 UTC 2014


On 05/03/14 14:44, Wissam Shoukair wrote:
> I wanted to do this fix (that you attached), but I saw in the patch 8ab2f51997db80c88d098844ad5a9af5736d1c9e (Mark devices as open only if opening succeeds) that this fixed some issue in the netdev_close, so I wanted to go more on the safe side and add 2 more states

The problem addressed by 8ab2f51 was that a failed open would leave the 
device flagged as open.  My previously-attached patch avoids this 
problem by clearing the open flag if opening fails.

> also for the following reason:
>
> In the close flow:
> call netdev_close(vlan_dev) ->
>       mark vlan_dev as closed
>       call vlan_close(vlan_dev) ->
>          call netdev_notify(vlan dev)
>               call vlan_sync(trunk_dev) ->
>                     Open vlan because the trunk is open (not yet closed).

netdev_notify(vlan_dev) will call vlan_notify(vlan_dev) which will do 
nothing, since vlan_notify only acts in response to changes to a trunk 
device.  vlan_sync() will not be called on this path.

Michael



More information about the ipxe-devel mailing list