Bug 1934638 - [spec] Disable libiptc support
Summary: [spec] Disable libiptc support
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: systemd
Version: 35
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: systemd-maint
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-03-03 15:35 UTC by Phil Sutter
Modified: 2022-03-17 17:54 UTC (History)
20 users (show)

Fixed In Version: systemd-249.7-3.fc35
Clone Of: 1817265
Environment:
Last Closed: 2022-03-17 17:54:55 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Comment 1 Zbigniew Jędrzejewski-Szmek 2021-03-03 15:57:44 UTC
Why should this be disabled in Fedora?

Comment 2 Phil Sutter 2021-03-03 16:20:56 UTC
(In reply to Zbigniew Jędrzejewski-Szmek from comment #1)
> Why should this be disabled in Fedora?

Using libiptc is not a compatible method of manipulating netfilter, especially
in light of iptables-nft being the default iptables variant meanwhile. Ideally
systemd would refer to firewalld for such tasks, but with PR#17026[1] talking
to nftables directly is an option at least.

[1] https://github.com/systemd/systemd/pull/17026

Comment 3 Zbigniew Jędrzejewski-Szmek 2021-03-03 16:34:24 UTC
I assumed that the two backends can coexist, and the right one is selected on the running system.
Fedora still has support for iptables, even if it is not the default, no?

Comment 4 Phil Sutter 2021-03-03 17:08:36 UTC
(In reply to Zbigniew Jędrzejewski-Szmek from comment #3)
> I assumed that the two backends can coexist, and the right one is selected
> on the running system.

Well, using both at the same time is a bad idea, but that's probably not what
you had in mind with "coexist". Users choose between the two via Alternatives.
There is no libiptc equivalent though, so that doesn't change magically. Using
it may be fine (if iptables-legacy is active), but mostly not (new installs use
nft variant by default).

> Fedora still has support for iptables, even if it is not the default, no?

*Legacy* iptables, but indeed it does. With libiptc, the situation is pretty
ugly though, as there is no equivalent. If systemd called iptables command for
instance, things would "just work". Regarding the use of nftables in
systemd-nspawn, one could say doing that on a system with legacy backend active
is equivalently inappropriate as using libiptc on a system with nft backend
active. And this doesn't even take concurrent users into account.

Comment 5 Zbigniew Jędrzejewski-Szmek 2021-03-24 16:52:35 UTC
Let me reiterate:
systemd never calls any executables directly. So let's not talk about the iptables executable
and alternatives, it's not directly relevant.

Systemd either does some nftables setup using netlink directly, or (if compiled in),
does iptables setup using libiptc. Right now, both backends are available, and
nftables is preferred, i.e. it is probed first.

Hence my question: why should this be disabled? Is it to fix an issue where the iptables
backend is used when it shoudln't, or to remove  a dependency that is effectively unused,
or what?

Comment 6 Yu Watanabe 2021-03-25 05:17:41 UTC
Could you provide any real issues caused by the libiptc backend?

Note, it is already commented by Zbignew in the above, the libiptc backend is used as a fallback when we cannot use nf_tables through netlink.
If I understand correctly, that happens only when the corresponding kernel modules are not installed, but all required kernel modules are provided by kernel-core.rpm.
So, only situation I can imagine when the libiptc backend is used is when an image created without the modules (ie, copying binaries manually rather than using rpm) runs in a vm or so.

Anyway, without any clear reproducers, we cannot take any actions about this...

Comment 7 Phil Sutter 2021-04-13 10:57:40 UTC
(In reply to Zbigniew Jędrzejewski-Szmek from comment #5)
> Let me reiterate:
> systemd never calls any executables directly. So let's not talk about the
> iptables executable
> and alternatives, it's not directly relevant.

The problem is mixed use of legacy iptables or libiptc and iptables-nft or
nftables. For that matter, alternatives configuration is as relevant as systemd
behaviour or firewalld configuration.

> Systemd either does some nftables setup using netlink directly, or (if
> compiled in),
> does iptables setup using libiptc. Right now, both backends are available,
> and
> nftables is preferred, i.e. it is probed first.

This is good to know. So installations running without nftables installed are
fine and so are those with nftables installed and in use. The only problematic
scenario is usage of legacy iptables by users while nftables is installed. In
that case, users won't see the rules added by systemd.

> Hence my question: why should this be disabled? Is it to fix an issue where
> the iptables
> backend is used when it shoudln't, or to remove  a dependency that is
> effectively unused,
> or what?

My concern was with mixed use of the technologies causing confusion as each is
invisible to the other. Though given that systemd defaults to nftables if
available means removing support for legacy iptables (via libiptc) won't
improve the situation - in fact, it causes trouble if nftables is not
available.

(In reply to Yu Watanabe from comment #6)
[...]
> Anyway, without any clear reproducers, we cannot take any actions about
> this...

Yes, I agree. And with the given systemd default I don't think there's much to
improve, at least not with feasible effort. Assuming that legacy iptables will
eventually lose relevance, this remaining compatibility problem will fade as
well.

I'll therefore close this ticket, sorry for the noise.

Comment 8 Zbigniew Jędrzejewski-Szmek 2021-11-19 17:39:52 UTC
This will be done in rawhide now.

Comment 9 Zbigniew Jędrzejewski-Szmek 2022-03-17 17:54:55 UTC
This was done a while back. Let's close this.


Note You need to log in before you can comment on or make changes to this bug.