bundle: Fix returned error code in one bundle_check() corner case.
authorBen Pfaff <blp@nicira.com>
Tue, 27 Dec 2011 23:44:41 +0000 (15:44 -0800)
committerBen Pfaff <blp@nicira.com>
Wed, 28 Dec 2011 01:01:23 +0000 (17:01 -0800)
In C, the || operator yields 0 or 1, not (as in some other languages) the
value of its first nonzero operand.

Found by inspection.

Signed-off-by: Ben Pfaff <blp@nicira.com>
lib/bundle.c

index af1be63031857c163e538642aed7489ab7960eb3..5db97d39395e31548683e46f272284a45f0c13a4 100644 (file)
@@ -152,8 +152,8 @@ bundle_check(const struct nx_action_bundle *nab, int max_ports,
             VLOG_WARN_RL(&rl, "bundle_load action requires at least 16 bit "
                          "destination.");
             error = ofp_mkerr(OFPET_BAD_ACTION, OFPBAC_BAD_ARGUMENT);
-        } else {
-            error = nxm_dst_check(nab->dst, ofs, n_bits, flow) || error;
+        } else if (!error) {
+            error = nxm_dst_check(nab->dst, ofs, n_bits, flow);
         }
     }