[ovs-dev] [PATCH 1/2] datapath: Don't dump partial action lists in flows.

Jesse Gross jesse at nicira.com
Mon Jan 21 11:59:16 UTC 2013

From: Ben Pfaff <blp at nicira.com>

After commit 9b405f1aa8d175dc63ad3ffe5d0fe05d5ee09162 (datapath: More
flexible kernel/userspace tunneling attribute.), it was possible for a
flow dump to return a partial action list.  It's better to return no
action list at all in this situation since then userspace will know
that it should request the full thing if it wants rather than have
incorrect results.  Therefore, this prevents those partial lists in
situations where we have a very large number of actions.

Signed-off-by: Jesse Gross <jesse at nicira.com>
Ben, the patch you had in your message to Pravin looked good to me so
I turned it in a commit to expedite things.  Can I get your signed-off-by?
 datapath/datapath.c |   11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/datapath/datapath.c b/datapath/datapath.c
index 054a1ac..754bc7c 100644
--- a/datapath/datapath.c
+++ b/datapath/datapath.c
@@ -1113,9 +1113,14 @@ static int ovs_flow_cmd_fill_info(struct sw_flow *flow, struct datapath *dp,
 	start = nla_nest_start(skb, OVS_FLOW_ATTR_ACTIONS);
 	if (start) {
 		err = actions_to_attr(sf_acts->actions, sf_acts->actions_len, skb);
-		if (err < 0 && skb_orig_len)
-			goto error;
-		nla_nest_end(skb, start);
+		if (!err)
+			nla_nest_end(skb, start);
+		else {
+			if (skb_orig_len)
+				goto error;
+			nla_nest_cancel(skb, start);
+		}
 	} else if (skb_orig_len) {
 		err = -ENOMEM;
 		goto error;

More information about the dev mailing list