nxm_dst_check() requires a writable field. Since NX_LEARN_DST_MATCH only
matches on a field and doesn't write to a field, use nxm_src_check() for
that case instead.
Bug #7507.
Reported-by: Michael Mao <mmao@nicira.com>
int dst_ofs = ntohs(get_be16(&p));
int error;
- error = nxm_dst_check(dst_field, dst_ofs, n_bits, &rule.flow);
+ error = (dst_type == NX_LEARN_DST_LOAD
+ ? nxm_dst_check(dst_field, dst_ofs, n_bits, &rule.flow)
+ : nxm_src_check(dst_field, dst_ofs, n_bits, &rule.flow));
if (error) {
return error;
}