netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* bug: nft include with includedir path with globs loads files twice
@ 2025-09-24 20:23 Christoph Anton Mitterer
  2025-09-25 20:00 ` Jeremy Sowden
  0 siblings, 1 reply; 3+ messages in thread
From: Christoph Anton Mitterer @ 2025-09-24 20:23 UTC (permalink / raw)
  To: netfilter-devel

Hey.

With:
   # nft -v
   nftables v1.1.5 (Commodore Bullmoose #6)
from Debian sid which uses a default include dir of:
   # nft -h | grep includepath
     -I, --includepath <directory>   Add <directory> to the paths searched for include files. Default is: /etc


And e.g.:
/etc/nftables.conf
   #!/usr/sbin/nft -f
   
   flush ruleset
   
   table inet filter {
   	chain input {
   		type filter hook input priority filter
   		ct state {established,related} accept
   	}
   }
   
   include "nftables/rules.d/*.nft"

and:
/etc/nftables/rules.d/x.nft:
   table inet filter {
           chain bla {
                   type filter hook input priority filter
                   ip daddr 1.1.1.1 drop
           }
   }
and no other files in rules.d... nft seem to somehow include x.nft
twice:

# nft -f /etc/nftables.conf; nft list ruleset
table inet filter {
	chain input {
		type filter hook input priority filter; policy accept;
		ct state { established, related } accept
	}

	chain bla {
		type filter hook input priority filter; policy accept;
		ip daddr 1.1.1.1 drop
		ip daddr 1.1.1.1 drop
	}
}

If I change the include to "nftables/rules.d/x.nft" or to
"/etc/nftables/rules.d/*.nft"... it works (i.e. only one ip daddr
1.1.1.1 drop).


Thanks,
Chris.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-09-25 21:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-24 20:23 bug: nft include with includedir path with globs loads files twice Christoph Anton Mitterer
2025-09-25 20:00 ` Jeremy Sowden
2025-09-25 21:44   ` Pablo Neira Ayuso

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).