Skip to content

Commit

Permalink
[acl_loader] Fix bugs in acl_loader (sonic-net#991)
Browse files Browse the repository at this point in the history
- Support protocol number == 0
- Emit warning if --table_name not found in Config DB

Signed-off-by: Danny Allen <daall@microsoft.com>
  • Loading branch information
daall authored Jul 16, 2020
1 parent 527860d commit e3d6ba0
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 @@ -244,6 +244,9 @@ def set_table_name(self, table_name):
:param table_name: Table name
:return:
"""
if not self.is_table_valid(table_name):
warning("Table \"%s\" not found" % table_name)

self.current_table = table_name

def set_session_name(self, session_name):
Expand Down Expand Up @@ -412,7 +415,7 @@ def convert_l2(self, table_name, rule_idx, rule):
def convert_ip(self, table_name, rule_idx, rule):
rule_props = {}

if rule.ip.config.protocol:
if rule.ip.config.protocol or rule.ip.config.protocol == 0: # 0 is a valid protocol number
if self.ip_protocol_map.has_key(rule.ip.config.protocol):
rule_props["IP_PROTOCOL"] = self.ip_protocol_map[rule.ip.config.protocol]
else:
Expand Down

0 comments on commit e3d6ba0

Please sign in to comment.