X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=lib%2Fbundle.c;fp=lib%2Fbundle.c;h=86762f92a850c0e97ecfdbfb1f4e013c650de56f;hb=476466a0e7acb3fd008c6bcf0a0f479f1ad4d885;hp=227d3597cd7448d2c4499f3743a095c950f98e9d;hpb=72c644fd6de23d69f66b755237e3f5c74b4d9af7;p=sliver-openvswitch.git diff --git a/lib/bundle.c b/lib/bundle.c index 227d3597c..86762f92a 100644 --- a/lib/bundle.c +++ b/lib/bundle.c @@ -145,7 +145,16 @@ bundle_check(const struct nx_action_bundle *nab, int max_ports, } if (subtype == NXAST_BUNDLE_LOAD) { - error = nxm_dst_check(nab->dst, nab->ofs_nbits, 16, flow) || error; + int ofs = nxm_decode_ofs(nab->ofs_nbits); + int n_bits = nxm_decode_n_bits(nab->ofs_nbits); + + if (n_bits < 16) { + 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; + } } if (slaves_size < n_slaves * sizeof(ovs_be16)) {