mirror of
https://github.com/openvswitch/ovs
synced 2025-08-31 06:15:47 +00:00
nicira-ext: Support masking of nd_target field
This commit adds support to specify a mask in CIDR format for the nd_target field. Signed-off-by: Ansis Atteka <aatteka@nicira.com>
This commit is contained in:
@@ -407,7 +407,7 @@ static const struct mf_field mf_fields[MFF_N_IDS] = {
|
||||
{
|
||||
MFF_ND_TARGET, "nd_target", NULL,
|
||||
MF_FIELD_SIZES(ipv6),
|
||||
MFM_NONE, FWW_ND_TARGET,
|
||||
MFM_CIDR, 0,
|
||||
MFS_IPV6,
|
||||
MFP_ND,
|
||||
false,
|
||||
@@ -553,7 +553,6 @@ mf_is_all_wild(const struct mf_field *mf, const struct flow_wildcards *wc)
|
||||
case MFF_ARP_OP:
|
||||
case MFF_ARP_SHA:
|
||||
case MFF_ARP_THA:
|
||||
case MFF_ND_TARGET:
|
||||
case MFF_ND_SLL:
|
||||
case MFF_ND_TLL:
|
||||
assert(mf->fww_bit != 0);
|
||||
@@ -612,6 +611,9 @@ mf_is_all_wild(const struct mf_field *mf, const struct flow_wildcards *wc)
|
||||
case MFF_IPV6_DST:
|
||||
return ipv6_mask_is_any(&wc->ipv6_dst_mask);
|
||||
|
||||
case MFF_ND_TARGET:
|
||||
return ipv6_mask_is_any(&wc->nd_target_mask);
|
||||
|
||||
case MFF_IP_FRAG:
|
||||
return !(wc->nw_frag_mask & FLOW_NW_FRAG_MASK);
|
||||
|
||||
@@ -659,7 +661,6 @@ mf_get_mask(const struct mf_field *mf, const struct flow_wildcards *wc,
|
||||
case MFF_ARP_OP:
|
||||
case MFF_ARP_SHA:
|
||||
case MFF_ARP_THA:
|
||||
case MFF_ND_TARGET:
|
||||
case MFF_ND_SLL:
|
||||
case MFF_ND_TLL:
|
||||
assert(mf->fww_bit != 0);
|
||||
@@ -729,6 +730,10 @@ mf_get_mask(const struct mf_field *mf, const struct flow_wildcards *wc,
|
||||
mask->ipv6 = wc->ipv6_dst_mask;
|
||||
break;
|
||||
|
||||
case MFF_ND_TARGET:
|
||||
mask->ipv6 = wc->nd_target_mask;
|
||||
break;
|
||||
|
||||
case MFF_IP_FRAG:
|
||||
mask->u8 = wc->nw_frag_mask & FLOW_NW_FRAG_MASK;
|
||||
break;
|
||||
@@ -1624,7 +1629,7 @@ mf_set_wild(const struct mf_field *mf, struct cls_rule *rule)
|
||||
break;
|
||||
|
||||
case MFF_ND_TARGET:
|
||||
rule->wc.wildcards |= FWW_ND_TARGET;
|
||||
memset(&rule->wc.nd_target_mask, 0, sizeof rule->wc.nd_target_mask);
|
||||
memset(&rule->flow.nd_target, 0, sizeof rule->flow.nd_target);
|
||||
break;
|
||||
|
||||
@@ -1676,7 +1681,6 @@ mf_set(const struct mf_field *mf,
|
||||
case MFF_ICMPV4_CODE:
|
||||
case MFF_ICMPV6_TYPE:
|
||||
case MFF_ICMPV6_CODE:
|
||||
case MFF_ND_TARGET:
|
||||
case MFF_ND_SLL:
|
||||
case MFF_ND_TLL:
|
||||
NOT_REACHED();
|
||||
@@ -1742,6 +1746,10 @@ mf_set(const struct mf_field *mf,
|
||||
cls_rule_set_ipv6_dst_masked(rule, &value->ipv6, &mask->ipv6);
|
||||
break;
|
||||
|
||||
case MFF_ND_TARGET:
|
||||
cls_rule_set_nd_target_masked(rule, &value->ipv6, &mask->ipv6);
|
||||
break;
|
||||
|
||||
case MFF_IP_FRAG:
|
||||
cls_rule_set_nw_frag_masked(rule, value->u8, mask->u8);
|
||||
break;
|
||||
|
Reference in New Issue
Block a user