}
void
-cls_rule_set_nd_target(struct cls_rule *rule, const struct in6_addr target)
+cls_rule_set_nd_target(struct cls_rule *rule, const struct in6_addr *target)
{
rule->wc.wildcards &= ~FWW_ND_TARGET;
- rule->flow.nd_target = target;
+ rule->flow.nd_target = *target;
}
/* Returns true if 'a' and 'b' have the same priority, wildcard the same
ovs_be32 netmask)
{
if (netmask) {
- ds_put_format(s, "%s="IP_FMT, name, IP_ARGS(&ip));
- if (netmask != htonl(UINT32_MAX)) {
- if (ip_is_cidr(netmask)) {
- int wcbits = ofputil_netmask_to_wcbits(netmask);
- ds_put_format(s, "/%d", 32 - wcbits);
- } else {
- ds_put_format(s, "/"IP_FMT, IP_ARGS(&netmask));
- }
- }
+ ds_put_format(s, "%s=", name);
+ ip_format_masked(ip, netmask, s);
ds_put_char(s, ',');
}
}
{
if (!ipv6_mask_is_any(netmask)) {
ds_put_format(s, "%s=", name);
- print_ipv6_addr(s, addr);
- if (!ipv6_mask_is_exact(netmask)) {
- if (ipv6_is_cidr(netmask)) {
- int cidr_bits = ipv6_count_cidr_bits(netmask);
- ds_put_format(s, "/%d", cidr_bits);
- } else {
- ds_put_char(s, '/');
- print_ipv6_addr(s, netmask);
- }
- }
+ print_ipv6_masked(s, addr, netmask);
ds_put_char(s, ',');
}
}
int i;
+ BUILD_ASSERT_DECL(FLOW_WC_SEQ == 1);
+
if (rule->priority != OFP_DEFAULT_PRIORITY) {
ds_put_format(s, "priority=%d,", rule->priority);
}
}
if (!skip_proto && !(w & FWW_NW_PROTO)) {
if (f->dl_type == htons(ETH_TYPE_ARP)) {
- ds_put_format(s, "opcode=%"PRIu8",", f->nw_proto);
+ ds_put_format(s, "arp_op=%"PRIu8",", f->nw_proto);
} else {
ds_put_format(s, "nw_proto=%"PRIu8",", f->nw_proto);
}
ds_put_char(s, ',');
}
if (!(w & FWW_ARP_SHA)) {
- ds_put_format(s, "nd_sll="ETH_ADDR_FMT",",
+ ds_put_format(s, "nd_sll="ETH_ADDR_FMT",",
ETH_ADDR_ARGS(f->arp_sha));
}
if (!(w & FWW_ARP_THA)) {
- ds_put_format(s, "nd_tll="ETH_ADDR_FMT",",
+ ds_put_format(s, "nd_tll="ETH_ADDR_FMT",",
ETH_ADDR_ARGS(f->arp_tha));
}
} else {
const flow_wildcards_t wc = wildcards->wildcards;
int i;
- BUILD_ASSERT_DECL(FLOW_SIG_SIZE == 100 + FLOW_N_REGS * 4);
+ BUILD_ASSERT_DECL(FLOW_WC_SEQ == 1);
for (i = 0; i < FLOW_N_REGS; i++) {
if ((a->regs[i] ^ b->regs[i]) & wildcards->reg_masks[i]) {
&wildcards->ipv6_src_mask)
&& ipv6_equal_except(&a->ipv6_dst, &b->ipv6_dst,
&wildcards->ipv6_dst_mask)
- && (wc & FWW_ND_TARGET
+ && (wc & FWW_ND_TARGET
|| ipv6_addr_equals(&a->nd_target, &b->nd_target)));
}
const flow_wildcards_t wc = wildcards->wildcards;
int i;
- BUILD_ASSERT_DECL(FLOW_SIG_SIZE == 100 + 4 * FLOW_N_REGS);
+ BUILD_ASSERT_DECL(FLOW_WC_SEQ == 1);
for (i = 0; i < FLOW_N_REGS; i++) {
flow->regs[i] &= wildcards->reg_masks[i];