[ovs-dev] [PATCH 2/2] datapath: Honor dp_ifindex, when specified, for vport lookup by name.
Pravin Shelar
pshelar at nicira.com
Mon Feb 27 17:51:21 PST 2012
On Mon, Feb 27, 2012 at 5:03 PM, Ben Pfaff <blp at nicira.com> wrote:
> 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 at nicira.com>
> ---
> datapath/datapath.c | 3 +++
> 1 files changed, 3 insertions(+), 0 deletions(-)
>
> diff --git a/datapath/datapath.c b/datapath/datapath.c
> index 23fb1dc..bb96967 100644
> --- a/datapath/datapath.c
> +++ b/datapath/datapath.c
> @@ -1729,6 +1729,9 @@ static struct vport *lookup_vport(struct net *net,
> vport = ovs_vport_locate(net, 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]);
> --
> 1.7.2.5
>
Looks good. Acked-by: Pravin B Shelar <pshelar at nicira.com>
> _______________________________________________
> dev mailing list
> dev at openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev
More information about the dev
mailing list