On Mon, Nov 23, 2026 at 08:58:41PM +0100, Marc Haber wrote:
>No, that test didn't exist, it now does (in a branch).

Nice, thanks.

>> Turning to the rules in the package itself, writing the per-domain parts
>> as plain "chain INPUT-early" blocks avoids the issue entirely, since
>> that appends to the chain without adding a jump:
[...]
>That triggers warnings as well. And I am not particularly fond of having
>just another ordering issue in the rule set. Otoh, we're putting gold
>plating on a package I originally intended to barely keep alive untli I
>am ready to migrate to nft+wrapper myself.

Fair enough on both counts. I had a look at the current zg/icmpv6
branch (1a6c501). The "Chain is already specified" warning there comes
from nesting "interface + chain INPUT-early { ... }" inside "chain
INPUT { ... }". (FWIW, the top-level "domain ip6 table filter chain
INPUT-early { ... }" form I suggested doesn't warn here, but you're right
that it depends on ordering.)

But I think there's a simpler option that has neither problem:
ferm-early.conf already uses @if @eq($DOMAIN, ip) for the esp/ah rule,
so the ICMP and DHCPv6 rules can go into the single dual-stack @subchain
the same way, and the two single-domain stanzas at the bottom can be
dropped altogether:

                # allow SSH connections
                proto tcp dport ssh ACCEPT;

                @if @eq($DOMAIN, ip) {
                    # allow all ICMP
                    proto icmp ACCEPT;

                    # n.b. special handling for DHCPv4 is probably not needed
                    # [...existing comment...]
                } @else {
                    # allow all ICMPv6
                    proto ipv6-icmp ACCEPT;

                    # allow DHCPv6
                    proto udp saddr fe80::/10 sport 547 dport 546 ACCEPT;
                }
            }

That gives one subchain, one jump, no warnings and no ordering
dependency, and the file gets shorter. "ferm --remote --noexec" for both
ip and ip6 produces the same rules as your branch, minus the redundant
"--in-interface +" on the ICMP/DHCPv6 rules, so those three lines in
debian/tests/expected/parse/early.ipv{4,6}.compare would need the
same adjustment.

Also, ferm.conf on the branch parses cleanly now, so the stray "}" is
gone.

Cheers,
David

Reply via email to