mirror of
https://github.com/openvswitch/ovs
synced 2025-08-30 22:05:19 +00:00
nicira-ext: Support matching ARP source and target hardware addresses.
OpenFlow 1.0 doesn't allow matching on the ARP source and target hardware address. This has caused us to introduce hacks such as the Drop Spoofed ARP action. Now that we have extensible match, we can match on more fields within ARP: - Source Hardware Address (arp_sha) - Target Hardware Address (arp_tha) Signed-off-by: Justin Pettit <jpettit@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
This commit is contained in:
@@ -124,6 +124,10 @@ ofputil_cls_rule_from_match(const struct ofp_match *match,
|
||||
/* Initialize most of rule->wc. */
|
||||
flow_wildcards_init_catchall(wc);
|
||||
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);
|
||||
|
||||
if (ofpfw & OFPFW_NW_TOS) {
|
||||
wc->wildcards |= FWW_NW_TOS;
|
||||
}
|
||||
@@ -859,6 +863,11 @@ is_nxm_required(const struct cls_rule *rule, bool cookie_support,
|
||||
return true;
|
||||
}
|
||||
|
||||
/* Only NXM supports matching ARP hardware addresses. */
|
||||
if (!(wc->wildcards & FWW_ARP_SHA) || !(wc->wildcards & FWW_ARP_THA)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
/* Only NXM supports matching registers. */
|
||||
if (!regs_fully_wildcarded(wc)) {
|
||||
return true;
|
||||
|
Reference in New Issue
Block a user