X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=lib%2Fofp-util.c;h=48b8928713cd2cf095795301f1409f83c98accbe;hb=340c7bb2b9565b07de7c105d7fae298be908d138;hp=028eaeba70260ba95724010cf9f881f2e5e01049;hpb=9cae45dc699f64e85ad68db5f3b2f50758ad6e34;p=sliver-openvswitch.git diff --git a/lib/ofp-util.c b/lib/ofp-util.c index 028eaeba7..48b892871 100644 --- a/lib/ofp-util.c +++ b/lib/ofp-util.c @@ -1086,8 +1086,19 @@ ofputil_usable_protocols(const struct match *match) | OFPUTIL_P_OF13_OXM; } - /* NXM and OXM support matching IPv6 traffic. */ - if (match->flow.dl_type == htons(ETH_TYPE_IPV6)) { + /* NXM and OXM support matching L3 and L4 fields within IPv6. + * + * (arp_sha, arp_tha, nw_frag, and nw_ttl are covered elsewhere so they + * don't need to be included in this test too.) */ + if (match->flow.dl_type == htons(ETH_TYPE_IPV6) + && (!ipv6_mask_is_any(&wc->masks.ipv6_src) + || !ipv6_mask_is_any(&wc->masks.ipv6_dst) + || !ipv6_mask_is_any(&wc->masks.nd_target) + || wc->masks.ipv6_label + || wc->masks.tp_src + || wc->masks.tp_dst + || wc->masks.nw_proto + || wc->masks.nw_tos)) { return OFPUTIL_P_OF10_NXM_ANY | OFPUTIL_P_OF12_OXM | OFPUTIL_P_OF13_OXM; } @@ -1112,12 +1123,6 @@ ofputil_usable_protocols(const struct match *match) | OFPUTIL_P_OF13_OXM; } - /* NXM and OXM support matching IPv6 flow label. */ - if (wc->masks.ipv6_label) { - return OFPUTIL_P_OF10_NXM_ANY | OFPUTIL_P_OF12_OXM - | OFPUTIL_P_OF13_OXM; - } - /* NXM and OXM support matching IP ECN bits. */ if (wc->masks.nw_tos & IP_ECN_MASK) { return OFPUTIL_P_OF10_NXM_ANY | OFPUTIL_P_OF12_OXM