[ovs-dev] [PATCH] netdev: Open devices as the type specified.

Ben Pfaff blp at nicira.com
Thu May 8 18:31:46 UTC 2014


On Mon, May 05, 2014 at 11:17:23AM +1200, Joe Stringer wrote:
> Previously, it was possible to open a netdevice as one type, then
> proceed to open it as a different type without first closing it. This
> would result in the original device and netdev class being used rather
> than the new one.
> 
> An example configuration that would previously give unexpected behaviour:
> 
> ovs-vsctl add-port br0 p0 -- set int p0 type=gre options:remote_ip=1.2.3.4
> ovs-vsctl add-port br0 p1 -- set int p1 type=internal
> ovs-vsctl set int p1 type=gre options:remote_ip=1.2.3.4
> ovs-vsctl set int p1 type=internal
> 
> The final command would report in the ovs-vswitchd logs that it is
> attempting to configure the port with the same gre settings as p0,
> despite the command specifying the type as internal.
> 
> This patch catches this case in netdev_open(), removes the old device
> from the netdev shash and ensures that one with the new type is created.
> 
> Bug #1198386.
> 
> Signed-off-by: Joe Stringer <joestringer at nicira.com>

I'm almost certain that this is going to trade one kind of unexpected
behavior for a different one.  For example, any call to
netdev_get_in4_by_name() is now going to destroy a non-system device.



More information about the dev mailing list