ofp-util: Make validate_actions() take a struct flow *.
authorBen Pfaff <blp@nicira.com>
Tue, 26 Oct 2010 16:41:24 +0000 (09:41 -0700)
committerBen Pfaff <blp@nicira.com>
Wed, 10 Nov 2010 01:08:09 +0000 (17:08 -0800)
The upcoming support for actions on registers will require the flow to
validate actions, so this commit adds the parameter in advance.  It is
not yet used.

lib/ofp-util.c
lib/ofp-util.h
ofproto/ofproto.c

index b1678ad..838617c 100644 (file)
@@ -612,7 +612,7 @@ check_action(const union ofp_action *a, unsigned int len, int max_ports)
 
 int
 validate_actions(const union ofp_action *actions, size_t n_actions,
-                 int max_ports)
+                 const struct flow *flow OVS_UNUSED, int max_ports)
 {
     size_t i;
 
index 28bce5f..6f8c259 100644 (file)
@@ -78,7 +78,7 @@ const union ofp_action *actions_first(struct actions_iterator *,
                                       size_t n_actions);
 const union ofp_action *actions_next(struct actions_iterator *);
 int validate_actions(const union ofp_action *, size_t n_actions,
-                     int max_ports);
+                     const struct flow *, int max_ports);
 bool action_outputs_to_port(const union ofp_action *, uint16_t port);
 
 void normalize_match(struct ofp_match *);
index 36a23d9..cd87cd0 100644 (file)
@@ -2930,7 +2930,7 @@ handle_packet_out(struct ofconn *ofconn, struct ofp_header *oh)
     /* Extract flow, check actions. */
     flow_extract(&payload, 0, ofp_port_to_odp_port(ntohs(opo->in_port)),
                  &flow);
-    error = validate_actions(ofp_actions, n_ofp_actions, p->max_ports);
+    error = validate_actions(ofp_actions, n_ofp_actions, &flow, p->max_ports);
     if (error) {
         goto exit;
     }
@@ -4022,7 +4022,8 @@ flow_mod_core(struct ofconn *ofconn, struct flow_mod *fm)
         return error;
     }
 
-    error = validate_actions(fm->actions, fm->n_actions, p->max_ports);
+    error = validate_actions(fm->actions, fm->n_actions,
+                             &fm->cr.flow, p->max_ports);
     if (error) {
         return error;
     }