From f0af39ff6cbe2e4be7e58bd9993d22490774ccb0 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Tue, 27 Dec 2011 15:44:41 -0800 Subject: [PATCH] bundle: Fix returned error code in one bundle_check() corner case. 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 --- lib/bundle.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/bundle.c b/lib/bundle.c index 227d3597c..e6e39a070 100644 --- a/lib/bundle.c +++ b/lib/bundle.c @@ -144,8 +144,8 @@ bundle_check(const struct nx_action_bundle *nab, int max_ports, error = ofp_mkerr(OFPET_BAD_ACTION, OFPBAC_BAD_ARGUMENT); } - if (subtype == NXAST_BUNDLE_LOAD) { - error = nxm_dst_check(nab->dst, nab->ofs_nbits, 16, flow) || error; + if (subtype == NXAST_BUNDLE_LOAD && !error) { + error = nxm_dst_check(nab->dst, nab->ofs_nbits, 16, flow); } if (slaves_size < n_slaves * sizeof(ovs_be16)) { -- 2.47.0