vconn: Fix byte-swapping of message type when validating OpenFlow actions.
authorJean Tourrihles <jt@hpl.hp.com>
Fri, 11 Sep 2009 22:19:15 +0000 (15:19 -0700)
committerBen Pfaff <blp@nicira.com>
Fri, 11 Sep 2009 22:19:15 +0000 (15:19 -0700)
It seems really strange that this one slipped through.  Perhaps this
means that we have never tested with any action other than OFPAT_OUTPUT
(which has value 0 and thus is not affected by byte-swapping).

lib/vconn.c

index b5e1102..12680c5 100644 (file)
@@ -1247,7 +1247,7 @@ check_action(const union ofp_action *a, unsigned int len, int max_ports)
 {
     int error;
 
-    switch (a->type) {
+    switch (ntohs(a->type)) {
     case OFPAT_OUTPUT:
         error = check_action_port(ntohs(a->output.port), max_ports);
         if (error) {