Skip to content

Conversation

@wojcik91
Copy link
Contributor

When preparing destination addrs for firewall rules we combine all the IPs, networks and IP ranges into non-overlapping IP ranges to avoid nftables errors since nftables don't accept overlapping elements.

Initially this meant that all networks got converted into ranges which caused issues with BSD packet filter which generates a separate rule for each IP in range. As a workaround we skipped converting networks into ranges, but this meant that we could no longer guarantee generated elements to be non-overlapping.

This PR introduces the ability to extract all possible subnets from generated ranges, thus resolving both of the above issues (networks are not needlessly turned into ranges and elements no longer overlap).

@wojcik91 wojcik91 requested a review from moubctez June 22, 2025 21:43
@wojcik91 wojcik91 self-assigned this Jun 22, 2025
@wojcik91 wojcik91 changed the title fix IP address merging when generating firewall config from ACLs WIP: fix IP address merging when generating firewall config from ACLs Jun 22, 2025
@moubctez moubctez changed the base branch from release/1.4-alpha to release/1.4 June 23, 2025 11:47
@wojcik91 wojcik91 marked this pull request as ready for review June 24, 2025 09:58
@wojcik91 wojcik91 force-pushed the fix_addrs_merging branch from eec437a to d03cf4b Compare June 24, 2025 09:59
@wojcik91 wojcik91 changed the title WIP: fix IP address merging when generating firewall config from ACLs fix IP address merging when generating firewall config from ACLs Jun 24, 2025
@wojcik91
Copy link
Contributor Author

resolves #1255

@wojcik91 wojcik91 merged commit f0b0c16 into release/1.4 Jun 24, 2025
1 check passed
@wojcik91 wojcik91 deleted the fix_addrs_merging branch June 24, 2025 11:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants