Until now this has just silently failed, but it seems to me like we should
actively reject it.

Signed-off-by: Ben Pfaff <b...@nicira.com>
---
 datapath/datapath.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/datapath/datapath.c b/datapath/datapath.c
index b3e2442..cd29482 100644
--- a/datapath/datapath.c
+++ b/datapath/datapath.c
@@ -1751,7 +1751,9 @@ static int ovs_vport_cmd_set(struct sk_buff *skb, struct 
genl_info *info)
                goto exit_unlock;
 
        err = 0;
-       if (a[OVS_VPORT_ATTR_OPTIONS])
+       if (a[OVS_VPORT_ATTR_TYPE] && nla_get_u32(a[OVS_VPORT_ATTR_TYPE]) != 
vport_get_type(vport))
+               err = -EINVAL;
+       if (!err && a[OVS_VPORT_ATTR_OPTIONS])
                err = vport_set_options(vport, a[OVS_VPORT_ATTR_OPTIONS]);
        if (!err)
                err = change_vport(vport, a);
-- 
1.7.4.4

_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to