@@ -2091,24 +2091,17 @@ nl_msg_put_flower_rewrite_pedits(struct ofpbuf *request,
static int
nl_msg_put_flower_acts(struct ofpbuf *request, struct tc_flower *flower)
{
+ bool ingress, released = false;
size_t offset;
size_t act_offset;
uint16_t act_index = 1;
struct tc_action *action;
int i, ifindex = 0;
- bool ingress;
offset = nl_msg_start_nested(request, TCA_FLOWER_ACT);
{
int error;
- if (flower->tunnel) {
- act_offset = nl_msg_start_nested(request, act_index++);
- nl_msg_put_act_tunnel_key_release(request);
- nl_msg_put_act_flags(request);
- nl_msg_end_nested(request, act_offset);
- }
-
action = flower->actions;
for (i = 0; i < flower->action_count; i++, action++) {
switch (action->type) {
@@ -2185,6 +2178,13 @@ nl_msg_put_flower_acts(struct ofpbuf *request, struct tc_flower *flower)
}
break;
case TC_ACT_OUTPUT: {
+ if (!released && flower->tunnel) {
+ act_offset = nl_msg_start_nested(request, act_index++);
+ nl_msg_put_act_tunnel_key_release(request);
+ nl_msg_end_nested(request, act_offset);
+ released = true;
+ }
+
ingress = action->out.ingress;
ifindex = action->out.ifindex_out;
if (ifindex < 1) {