]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
openvswitch: Honor dp_ifindex, when specified, for vport lookup by name.
authorBen Pfaff <blp@nicira.com>
Tue, 6 Mar 2012 23:04:04 +0000 (15:04 -0800)
committerJesse Gross <jesse@nicira.com>
Tue, 6 Mar 2012 23:04:04 +0000 (15:04 -0800)
When OVS_VPORT_ATTR_NAME is specified and dp_ifindex is nonzero, the
logical behavior would be for the vport name lookup scope to be limited
to the specified datapath, but in fact the dp_ifindex value was ignored.
This commit causes the search scope to be honored.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
net/openvswitch/datapath.c

index ce64c18b8c79a99ef4251e7c9d2a752105207725..2c030505b335fd3ef9ab971fb9abd664548d8c38 100644 (file)
@@ -1521,6 +1521,9 @@ static struct vport *lookup_vport(struct ovs_header *ovs_header,
                vport = ovs_vport_locate(nla_data(a[OVS_VPORT_ATTR_NAME]));
                if (!vport)
                        return ERR_PTR(-ENODEV);
+               if (ovs_header->dp_ifindex &&
+                   ovs_header->dp_ifindex != get_dpifindex(vport->dp))
+                       return ERR_PTR(-ENODEV);
                return vport;
        } else if (a[OVS_VPORT_ATTR_PORT_NO]) {
                u32 port_no = nla_get_u32(a[OVS_VPORT_ATTR_PORT_NO]);