Skip to content

Commit e3d6ba0

Browse files
authored
[acl_loader] Fix bugs in acl_loader (sonic-net#991)
- Support protocol number == 0 - Emit warning if --table_name not found in Config DB Signed-off-by: Danny Allen <[email protected]>
1 parent 527860d commit e3d6ba0

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

acl_loader/main.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,9 @@ def set_table_name(self, table_name):
244244
:param table_name: Table name
245245
:return:
246246
"""
247+
if not self.is_table_valid(table_name):
248+
warning("Table \"%s\" not found" % table_name)
249+
247250
self.current_table = table_name
248251

249252
def set_session_name(self, session_name):
@@ -412,7 +415,7 @@ def convert_l2(self, table_name, rule_idx, rule):
412415
def convert_ip(self, table_name, rule_idx, rule):
413416
rule_props = {}
414417

415-
if rule.ip.config.protocol:
418+
if rule.ip.config.protocol or rule.ip.config.protocol == 0: # 0 is a valid protocol number
416419
if self.ip_protocol_map.has_key(rule.ip.config.protocol):
417420
rule_props["IP_PROTOCOL"] = self.ip_protocol_map[rule.ip.config.protocol]
418421
else:

0 commit comments

Comments
 (0)