summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2012-03-07 14:11:09 -0800
committerBen Pfaff <blp@nicira.com>2012-10-24 12:42:10 -0700
commitce4fa66066ed79071e4876f024724aa8e1116106 (patch)
treeff91784e41fd922efa66a0b20fc8a9fd46cc3dd4
parent991634882e5df23ea3bac0eb472b65130ec1f317 (diff)
downloadopenvswitch-ce4fa66066ed79071e4876f024724aa8e1116106.tar.gz
datapath: Honor dp_ifindex, when specified, for vport lookup by name.
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. This is a crossport of commit 24ce832d5e076e5686b15d2aadd39e8c0818e932 from master. Bug #9889. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Pravin B Shelar <pshelar@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com>
-rw-r--r--datapath/datapath.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/datapath/datapath.c b/datapath/datapath.c
index 4ee8f8698..11a74da36 100644
--- a/datapath/datapath.c
+++ b/datapath/datapath.c
@@ -1693,6 +1693,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]);