[ovs-dev] [PATCH 3/3] netdev: Warn on opening netdev as unexpected type.

Ben Pfaff blp at nicira.com
Fri May 2 14:56:37 UTC 2014

On Fri, May 02, 2014 at 01:13:43PM +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. The
> bridge code would expect it to be opened as the latter type and try to
> apply configuration to it. This patch catches the problem earlier by
> detecting the case in netdev_open() and logging a warning message.
> Bug #1198386.
> Signed-off-by: Joe Stringer <joestringer at nicira.com>
> ---
> I'm not sure if this case is meant to be possible, but I've observed it,
> and this patch makes the error more obvious in the logs.

You might want to test this against usage patterns that would try to
reuse a netdev name quickly for a different kind of device.  e.g.:

        # Create myport as internal port.
        ovs-vsctl add-port br0 myport -- set interface myport type=internal

        # Change myport to a tunnel.
        ovs-vsctl set interface myport type=gre options:remote_ip=

(I believe that this currently works.  It should; it used to.)

More information about the dev mailing list