Skip to content

Commit a5a4f2a

Browse files
authored
Merge pull request #1355 from kernelkit/fwfixes
2 parents 5a65180 + 5e180ab commit a5a4f2a

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

src/confd/src/firewall.c

Lines changed: 11 additions & 4 deletions
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) {
@@ -549,9 +557,8 @@ int firewall_change(sr_session_ctx_t *session, struct lyd_node *config, struct l
549557
goto done;
550558
}
551559

552-
if (lydx_get_descendant(diff, "firewall", "default", NULL) ||
553-
lydx_get_descendant(diff, "firewall", "logging", NULL))
554-
generate_firewalld_conf(global);
560+
/* Always generate firewalld.conf when firewall is enabled */
561+
generate_firewalld_conf(global);
555562

556563
/*
557564
* Regenerate everything if anything in firewall changed, firewalld

0 commit comments

Comments
 (0)