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

Joe Stringer joestringer at nicira.com
Thu May 8 21:30:32 UTC 2014


Thanks Ben, it's useful to know that this could be regular behaviour. I
dropped this patch and I plan to drop the patch which warns in this case
instead.

As Alex mentioned, I dug deeper and found a better solution.

On 9 May 2014 06:41, Alex Wang <alexw at nicira.com> wrote:

> Hey Ben,
>
> FYI, Joe changed the implementation to:
> http://openvswitch.org/pipermail/dev/2014-May/039790.html
>
> Thanks for pointing this out, this actually reminds me of the similar
> issue in another project.
>
> Thanks,
> Alex Wang,
>
>
>  On Thu, May 8, 2014 at 11:31 AM, Ben Pfaff <blp at nicira.com> wrote:
>
>>  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.
>> _______________________________________________
>> dev mailing list
>> dev at openvswitch.org
>> http://openvswitch.org/mailman/listinfo/dev
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openvswitch.org/pipermail/ovs-dev/attachments/20140509/6144ea84/attachment-0005.html>


More information about the dev mailing list