diff options
author | Ben Pfaff <blp@nicira.com> | 2012-03-07 14:11:09 -0800 |
---|---|---|
committer | Ben Pfaff <blp@nicira.com> | 2012-03-07 14:13:15 -0800 |
commit | 7b58d76df5d7798ae28fce292de83ff1f3cdf8a7 (patch) | |
tree | 626c6b9a689705344e3e1a515854c7b40f4305db /datapath | |
parent | 05bfbcb693680794c5a0398587a7da6b46b3e3f5 (diff) |
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.
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>
Diffstat (limited to 'datapath')
-rw-r--r-- | datapath/datapath.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/datapath/datapath.c b/datapath/datapath.c index e9a4e189..e8667ad0 100644 --- a/datapath/datapath.c +++ b/datapath/datapath.c @@ -1689,6 +1689,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]); |