On Mon, Sep 30, 2013 at 1:01 PM, Pravin B Shelar <[email protected]> wrote:
> diff --git a/datapath/datapath.c b/datapath/datapath.c
> index 4defcdb..7178513 100644
> --- a/datapath/datapath.c
> +++ b/datapath/datapath.c
> @@ -1428,12 +962,17 @@ static int ovs_flow_cmd_get(struct sk_buff *skb,
> struct genl_info *info)
> }
>
> table = ovsl_dereference(dp->table);
> - flow = ovs_flow_lookup_unmasked_key(table, &match);
> + flow = ovs_flow_tbl_lookup(table, &key);
> if (!flow) {
> err = -ENOENT;
> goto unlock;
> }
>
> + if (flow && (!ovs_flow_cmp_unmasked_key(flow, &match))) {
> + err = -ENOENT;
> + goto unlock;
> + }
I think we probably could just make this into a single condition with:
if (!flow || (!ovs_flow_cmp_unmasked_key(flow, &match))) {
[...]
> @@ -1473,24 +1012,29 @@ static int ovs_flow_cmd_del(struct sk_buff *skb,
> struct genl_info *info)
> }
>
> ovs_match_init(&match, &key, NULL);
> - err = ovs_match_from_nlattrs(&match, a[OVS_FLOW_ATTR_KEY], NULL);
> + err = ovs_nla_get_match(&match, a[OVS_FLOW_ATTR_KEY], NULL);
> if (err)
> goto unlock;
>
> table = ovsl_dereference(dp->table);
> - flow = ovs_flow_lookup_unmasked_key(table, &match);
> + flow = ovs_flow_tbl_lookup(table, &key);
> if (!flow) {
> err = -ENOENT;
> goto unlock;
> }
>
> + if (flow && (!ovs_flow_cmp_unmasked_key(flow, &match))) {
> + err = -ENOENT;
> + goto unlock;
> + }
And here as well.
> diff --git a/datapath/flow.h b/datapath/flow.h
> index 03eae03..c50c76f 100644
> --- a/datapath/flow.h
> +++ b/datapath/flow.h
>
> +#define MAX_ACTIONS_BUFSIZE (32 * 1024)
We might just want to put this in flow_netlink.c since I think that's
the only place where it is used.
_______________________________________________
dev mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/dev