Skip to content

Commit de31184

Browse files
jlevequelguohan
authored andcommitted
[acl-loader] Use V6 ethertype for IPv6 ACL rule (sonic-net#788)
If ACL table name contains the substring "v6", set the EtherType of the rule to V6, otherwise set to V4.
1 parent 6babd1c commit de31184

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

acl_loader/main.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -474,8 +474,11 @@ def deny_rule(self, table_name):
474474
rule_props = {}
475475
rule_data = {(table_name, "DEFAULT_RULE"): rule_props}
476476
rule_props["PRIORITY"] = str(self.min_priority)
477-
rule_props["ETHER_TYPE"] = str(self.ethertype_map["ETHERTYPE_IPV4"])
478477
rule_props["PACKET_ACTION"] = "DROP"
478+
if 'v6' in table_name.lower():
479+
rule_props["ETHER_TYPE"] = str(self.ethertype_map["ETHERTYPE_IPV6"])
480+
else:
481+
rule_props["ETHER_TYPE"] = str(self.ethertype_map["ETHERTYPE_IPV4"])
479482
return rule_data
480483

481484
def convert_rules(self):

0 commit comments

Comments
 (0)