wdp-xflow: Remove wx structure from global list when closing.
[sliver-openvswitch.git] / lib / xflow-util.c
index a673c38..622f9ef 100644 (file)
@@ -30,13 +30,10 @@ union xflow_action *
 xflow_actions_add(struct xflow_actions *actions, uint16_t type)
 {
     union xflow_action *a;
-    if (actions->n_actions < MAX_XFLOW_ACTIONS) {
-        a = &actions->actions[actions->n_actions++];
-    } else {
-        COVERAGE_INC(xflow_overflow);
-        actions->n_actions = MAX_XFLOW_ACTIONS + 1;
-        a = &actions->actions[MAX_XFLOW_ACTIONS - 1];
-    }
+    size_t idx;
+
+    idx = actions->n_actions++ & (MAX_XFLOW_ACTIONS - 1);
+    a = &actions->actions[idx];
     memset(a, 0, sizeof *a);
     a->type = type;
     return a;
@@ -108,6 +105,15 @@ format_xflow_action(struct ds *ds, const union xflow_action *a)
     case XFLOWAT_SET_TP_DST:
         ds_put_format(ds, "set_tp_dst(%"PRIu16")", ntohs(a->tp_port.tp_port));
         break;
+    case XFLOWAT_SET_PRIORITY:
+        ds_put_format(ds, "set_priority(0x%"PRIx32")", a->priority.priority);
+        break;
+    case XFLOWAT_POP_PRIORITY:
+        ds_put_cstr(ds, "pop_priority");
+        break;
+    case XFLOWAT_DROP_SPOOFED_ARP:
+        ds_put_cstr(ds, "drop_spoofed_arp");
+        break;
     default:
         ds_put_format(ds, "***bad action 0x%"PRIx16"***", a->type);
         break;