X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=lib%2Fofp-util.c;h=1125b83fc17752de195b11ee6479136da958fb45;hb=9591fefeea4b475ee0d1387486a410bbb592b050;hp=59a5fc43f29be903064327cafe272e921da6d04e;hpb=bad68a9965215511b305c59d7f1830344ec2241f;p=openvswitch diff --git a/lib/ofp-util.c b/lib/ofp-util.c index 59a5fc43..1125b83f 100644 --- a/lib/ofp-util.c +++ b/lib/ofp-util.c @@ -126,7 +126,7 @@ ofputil_cls_rule_from_match(const struct ofp_match *match, wc->wildcards = ofpfw & WC_INVARIANTS; /* Wildcard fields that aren't defined by ofp_match or tun_id. */ - wc->wildcards |= (FWW_ARP_SHA | FWW_ARP_THA); + wc->wildcards |= (FWW_ARP_SHA | FWW_ARP_THA | FWW_ND_TARGET); if (ofpfw & OFPFW_NW_TOS) { wc->wildcards |= FWW_NW_TOS; @@ -868,6 +868,12 @@ is_nxm_required(const struct cls_rule *rule, bool cookie_support, return true; } + /* Only NXM supports matching IPv6 traffic. */ + if (!(wc->wildcards & FWW_DL_TYPE) + && (rule->flow.dl_type == htons(ETH_TYPE_IPV6))) { + return true; + } + /* Only NXM supports matching registers. */ if (!regs_fully_wildcarded(wc)) { return true; @@ -2041,6 +2047,9 @@ normalize_match(struct ofp_match *m) m->nw_dst &= ofputil_wcbits_to_netmask(wc >> OFPFW_NW_DST_SHIFT); } m->tp_src = m->tp_dst = m->nw_tos = 0; + } else if (m->dl_type == htons(ETH_TYPE_IPV6)) { + /* Don't normalize IPv6 traffic, since OpenFlow doesn't have a + * way to express it. */ } else { /* Network and transport layer fields will always be extracted as * zeros, so we can do an exact-match on those values. */