X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=lib%2Fnx-match.c;h=cccf6fe671c6c644f8994b9da4d40376e237d216;hb=8d5634845f9032468982c09a737a9f30c3764c3e;hp=e698cc628504d4ebf2f15728ac0109d6f9a6275c;hpb=54d54726993aec2a04542c76a69458f9c9244489;p=sliver-openvswitch.git diff --git a/lib/nx-match.c b/lib/nx-match.c index e698cc628..cccf6fe67 100644 --- a/lib/nx-match.c +++ b/lib/nx-match.c @@ -162,6 +162,8 @@ parse_nxm_entry(struct cls_rule *rule, const struct nxm_field *f, struct flow_wildcards *wc = &rule->wc; struct flow *flow = &rule->flow; + BUILD_ASSERT_DECL(FLOW_WC_SEQ == 1); + switch (f->index) { /* Metadata. */ case NFI_NXM_OF_IN_PORT: @@ -706,6 +708,8 @@ nx_put_match(struct ofpbuf *b, const struct cls_rule *cr) int match_len; int i; + BUILD_ASSERT_DECL(FLOW_WC_SEQ == 1); + /* Metadata. */ if (!(wc & FWW_IN_PORT)) { uint16_t in_port = flow->in_port; @@ -1467,7 +1471,7 @@ nxm_execute_reg_move(const struct nx_action_reg_move *action, /* Get the interesting bits of the source field. */ const struct nxm_field *src = nxm_field_lookup(ntohl(action->src)); int src_ofs = ntohs(action->src_ofs); - uint64_t src_data = nxm_read_field(src, flow) & (mask << src_ofs); + uint64_t src_data = (nxm_read_field(src, flow) >> src_ofs) & mask; nxm_reg_load(action->dst, nxm_encode_ofs_nbits(ntohs(action->dst_ofs), n_bits),