Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions tests/cacl/test_cacl_application.py
Original file line number Diff line number Diff line change
Expand Up @@ -578,11 +578,19 @@ def generate_expected_rules(duthost, tbinfo, docker_network, asic_index, expecte
.format(v['IPv6Address'],
docker_network['bridge']['IPv6Address']))

# dhcp_server uses bridge networking; its startup script adds an iptables
# rule to allow syslog (UDP 514) past caclmgrd's catch-all DROP.
if "dhcp_server" in docker_network['container']:
# dhcp_server and redfish both run in bridge mode, but only
# dhcp_server's rsyslog reaches the host over docker0 via RELP
# (tcp/2514). caclmgrd owns the INPUT ACCEPT
# exception for that traffic and re-emits it on every control-plane ACL
# flush-and-rebuild while FEATURE|dhcp_server is enabled, so the rule
# survives the rebuild. Gate the expectation on the feature state that
# caclmgrd keys on, not merely on the container being present.
dhcp_server_feature_state = duthost.shell(
"sonic-db-cli CONFIG_DB HGET 'FEATURE|dhcp_server' state",
module_ignore_errors=True)['stdout'].strip()
if dhcp_server_feature_state == "enabled":
iptables_rules.append(
Comment thread
Xichen96 marked this conversation as resolved.
"-A INPUT -i docker0 -p udp -m udp --dport 514"
"-A INPUT -i docker0 -p tcp -m tcp --dport 2514"
" -m comment --comment dhcp_server_syslog -j ACCEPT")

else:
Expand Down
Loading