In odp_flow_key_from_flow__(), when converting ICMPv6 flow/mask
to flow/mask key, we should always use flow to check for whether
ND informaition is present or not. In mask case, both type and code
field should be masked, otherwise ND fields can be masked.
This patch is an abridged version of the same patch committed on master.
This patch only contains necessary bug fix, but dropped extra protocol
sanity checks.
Signed-off-by: Guolin Yang <gyang@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
icmpv6_key->icmpv6_type = ntohs(data->tp_src);
icmpv6_key->icmpv6_code = ntohs(data->tp_dst);
- if (icmpv6_key->icmpv6_type == ND_NEIGHBOR_SOLICIT
- || icmpv6_key->icmpv6_type == ND_NEIGHBOR_ADVERT) {
+ if (flow->tp_dst == htons(0) &&
+ (flow->tp_src == htons(ND_NEIGHBOR_SOLICIT) ||
+ flow->tp_src == htons(ND_NEIGHBOR_ADVERT)) &&
+ (!is_mask || (data->tp_src == htons(0xffff) &&
+ data->tp_dst == htons(0xffff)))) {
struct ovs_key_nd *nd_key;
nd_key = nl_msg_put_unspec_uninit(buf, OVS_KEY_ATTR_ND,