mirror of
https://github.com/openvswitch/ovs
synced 2025-08-31 06:15:47 +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:
@@ -491,7 +491,9 @@ parse_protocol(const char *name, const struct protocol **p_out)
|
||||
FIELD(F_TP_SRC, "tp_src", FWW_TP_SRC) \
|
||||
FIELD(F_TP_DST, "tp_dst", FWW_TP_DST) \
|
||||
FIELD(F_ICMP_TYPE, "icmp_type", FWW_TP_SRC) \
|
||||
FIELD(F_ICMP_CODE, "icmp_code", FWW_TP_DST)
|
||||
FIELD(F_ICMP_CODE, "icmp_code", FWW_TP_DST) \
|
||||
FIELD(F_ARP_SHA, "arp_sha", FWW_ARP_SHA) \
|
||||
FIELD(F_ARP_THA, "arp_tha", FWW_ARP_THA)
|
||||
|
||||
enum field_index {
|
||||
#define FIELD(ENUM, NAME, WILDCARD) ENUM,
|
||||
@@ -607,6 +609,16 @@ parse_field_value(struct cls_rule *rule, enum field_index index,
|
||||
cls_rule_set_icmp_code(rule, str_to_u32(value));
|
||||
break;
|
||||
|
||||
case F_ARP_SHA:
|
||||
str_to_mac(value, mac);
|
||||
cls_rule_set_arp_sha(rule, mac);
|
||||
break;
|
||||
|
||||
case F_ARP_THA:
|
||||
str_to_mac(value, mac);
|
||||
cls_rule_set_arp_tha(rule, mac);
|
||||
break;
|
||||
|
||||
case N_FIELDS:
|
||||
NOT_REACHED();
|
||||
}
|
||||
|
Reference in New Issue
Block a user