Skip to content

Commit

Permalink
[acl-loader] Use V6 ethertype for IPv6 ACL rule (sonic-net#788)
Browse files Browse the repository at this point in the history
If ACL table name contains the substring "v6", set the EtherType of the rule to V6, otherwise set to V4.
  • Loading branch information
jleveque authored and lguohan committed Jan 25, 2020
1 parent 6babd1c commit de31184
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion acl_loader/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -474,8 +474,11 @@ def deny_rule(self, table_name):
rule_props = {}
rule_data = {(table_name, "DEFAULT_RULE"): rule_props}
rule_props["PRIORITY"] = str(self.min_priority)
rule_props["ETHER_TYPE"] = str(self.ethertype_map["ETHERTYPE_IPV4"])
rule_props["PACKET_ACTION"] = "DROP"
if 'v6' in table_name.lower():
rule_props["ETHER_TYPE"] = str(self.ethertype_map["ETHERTYPE_IPV6"])
else:
rule_props["ETHER_TYPE"] = str(self.ethertype_map["ETHERTYPE_IPV4"])
return rule_data

def convert_rules(self):
Expand Down

0 comments on commit de31184

Please sign in to comment.