Skip to content

Commit 5e180ab

Browse files
committed
Fix firewall not updating when interfaces become bridge/LAG ports
When interfaces were moved from firewall zones to become bridge or LAG ports (e.g., sfp1/sfp2 moved from WAN zone to lan-br), the firewall configuration was not regenerated. This caused stale entries in /etc/firewalld/zones/*.xml where interfaces remained listed in their old zones despite no longer being L3 interfaces. Root cause: firewall_change() only triggered on firewall model changes, but interface membership changes (bridge-port/lag-port) occur in the ietf-interfaces model. When interfaces become member ports, they transition from L3 to L2, which affects the result of interfaces_get_all_l3() used for default zone assignment. Fix: Expand the diff check to also trigger firewall regeneration when bridge-port or lag-port configuration changes, ensuring firewall zones stay synchronized with actual L3 interface topology. Fixes #1345 Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
1 parent 125ea47 commit 5e180ab

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

src/confd/src/firewall.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,15 @@ int firewall_change(sr_session_ctx_t *session, struct lyd_node *config, struct l
487487
sr_error_t err = SR_ERR_OK;
488488
char **ifaces = NULL;
489489

490-
if (diff && !lydx_get_xpathf(diff, XPATH))
490+
/*
491+
* Trigger firewall regeneration if:
492+
* 1. Firewall configuration changed, OR
493+
* 2. Interface membership changed (bridge-port/lag-port)
494+
* which affects L3 interface enumeration
495+
*/
496+
if (diff && !lydx_get_xpathf(diff, XPATH) &&
497+
!lydx_get_xpathf(diff, "/ietf-interfaces:interfaces/interface/bridge-port") &&
498+
!lydx_get_xpathf(diff, "/ietf-interfaces:interfaces/interface/lag-port"))
491499
return SR_ERR_OK;
492500

493501
switch (event) {

0 commit comments

Comments
 (0)