- nxm_put_32(b, NXM_NX_IPV6_LABEL, flow->ipv6_label);
- }
-
- if (!(wc & FWW_NW_DSCP)) {
- nxm_put_8(b, NXM_OF_IP_TOS, flow->nw_tos & IP_DSCP_MASK);
- }
-
- if (!(wc & FWW_NW_ECN)) {
- nxm_put_8(b, NXM_NX_IP_ECN, flow->nw_tos & IP_ECN_MASK);
- }
-
- if (!(wc & FWW_NW_TTL)) {
- nxm_put_8(b, NXM_NX_IP_TTL, flow->nw_ttl);
- }
-
- if (!(wc & FWW_NW_PROTO)) {
- nxm_put_8(b, NXM_OF_IP_PROTO, flow->nw_proto);
- switch (flow->nw_proto) {
- /* TCP. */
- case IPPROTO_TCP:
- if (!(wc & FWW_TP_SRC)) {
- nxm_put_16(b, NXM_OF_TCP_SRC, flow->tp_src);
- }
- if (!(wc & FWW_TP_DST)) {
- nxm_put_16(b, NXM_OF_TCP_DST, flow->tp_dst);
- }
- break;
-
- /* UDP. */
- case IPPROTO_UDP:
- if (!(wc & FWW_TP_SRC)) {
- nxm_put_16(b, NXM_OF_UDP_SRC, flow->tp_src);
- }
- if (!(wc & FWW_TP_DST)) {
- nxm_put_16(b, NXM_OF_UDP_DST, flow->tp_dst);
- }
- break;
-
- /* ICMPv6. */
- case IPPROTO_ICMPV6:
- if (!(wc & FWW_TP_SRC)) {
- nxm_put_8(b, NXM_NX_ICMPV6_TYPE, ntohs(flow->tp_src));
-
- if (flow->tp_src == htons(ND_NEIGHBOR_SOLICIT) ||
- flow->tp_src == htons(ND_NEIGHBOR_ADVERT)) {
- if (!(wc & FWW_ND_TARGET)) {
- nxm_put_ipv6(b, NXM_NX_ND_TARGET, &flow->nd_target,
- &in6addr_exact);
- }
- if (!(wc & FWW_ARP_SHA)
- && flow->tp_src == htons(ND_NEIGHBOR_SOLICIT)) {
- nxm_put_eth(b, NXM_NX_ND_SLL, flow->arp_sha);
- }
- if (!(wc & FWW_ARP_THA)
- && flow->tp_src == htons(ND_NEIGHBOR_ADVERT)) {
- nxm_put_eth(b, NXM_NX_ND_TLL, flow->arp_tha);
- }
- }
- }
- if (!(wc & FWW_TP_DST)) {
- nxm_put_8(b, NXM_NX_ICMPV6_CODE, ntohs(flow->tp_dst));
- }
- break;
+ nxm_put_32(b, oxm ? OXM_OF_IPV6_FLABEL : NXM_NX_IPV6_LABEL,
+ flow->ipv6_label);
+ }
+
+ if (flow->nw_proto == IPPROTO_ICMPV6
+ && (flow->tp_src == htons(ND_NEIGHBOR_SOLICIT) ||
+ flow->tp_src == htons(ND_NEIGHBOR_ADVERT))) {
+ nxm_put_ipv6(b, oxm ? OXM_OF_IPV6_ND_TARGET : NXM_NX_ND_TARGET,
+ &flow->nd_target, &cr->wc.nd_target_mask);
+ if (!(wc & FWW_ARP_SHA)
+ && flow->tp_src == htons(ND_NEIGHBOR_SOLICIT)) {
+ nxm_put_eth(b, oxm ? OXM_OF_IPV6_ND_SLL : NXM_NX_ND_SLL,
+ flow->arp_sha);
+ }
+ if (!(wc & FWW_ARP_THA)
+ && flow->tp_src == htons(ND_NEIGHBOR_ADVERT)) {
+ nxm_put_eth(b, oxm ? OXM_OF_IPV6_ND_TLL : NXM_NX_ND_TLL,
+ flow->arp_tha);