NXM/OXM are only supposed to put 1-bits in a value if the corresponding bit
in the mask is a 1-bit, but in the case of cookie matching, e.g.
ovs-ofctl del-flows br0 cookie=0x3/0x1
ovs-ofctl would encode a bad OXM. This fixes the problem.
(The test "ofproto - del flows based on cookie mask" in the OVS testsuite
tickles this bug.)
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
flow->metadata, match->wc.masks.metadata);
/* Cookie. */
- nxm_put_64m(b, NXM_NX_COOKIE, cookie, cookie_mask);
+ nxm_put_64m(b, NXM_NX_COOKIE, cookie & cookie_mask, cookie_mask);
match_len = ofpbuf_size(b) - start_len;
return match_len;
|| fm->command == OFPFC_ADD) {
ofm->cookie = fm->new_cookie;
} else {
- ofm->cookie = fm->cookie;
+ ofm->cookie = fm->cookie & fm->cookie_mask;
}
ofm->cookie_mask = fm->cookie_mask;
if (fm->table_id != OFPTT_ALL