Commit Graph

54224 Commits

Author SHA1 Message Date
Lennart Poettering
2d09ea44fc nspawn: only copy syscall filters from settings if actually configured
As in the previous commit, let's not copy settings that aren#t
configured, so that --settings=override with an empty .nspawn file is
truly a NOP.
2021-11-09 18:32:25 +01:00
Lennart Poettering
0cc3c9f997 nspawn: copy BindUser= setting from settings only if set
Let's only pick this up from the settings if actually set.

As in the previous commit this makes sure that an empty settings file in
--settings=override mode is really a NOP.
2021-11-09 18:32:20 +01:00
Lennart Poettering
d3689b9435 nspawn: use three boolean fields from settings file when actually set
Let's turn these three fields into tristates, so that we can distinguish
whether they are not configured at all from explicitly turned off.

Let#s then use this to ensure that we only copy the settings fields into
our execution environment if they are actually configured.

We already do this for some of the boolean settings, this adds it for
the missing ones.

The goal here is to ensure that an empty settings file used in
--settings=override mode (i.e. the default mode used in the
systemd-nspawn@.service unit) is truly a NOP.
2021-11-09 18:32:15 +01:00
Lennart Poettering
a1dfd585c4 nspawn: add helper settings_network_configured()
The new helper returns whether the settings file had *any* networking
setting configured at all. We already have a similar helper
settings_private_network() which returns a similar result. The
difference is that the new helper will return true when the private
network was explicitly turned off, while the old one will only return
true if configured and enabled.

We'll reuse the helper a 2nd time later on, but even without it it makes
things a bit more readable.
2021-11-09 18:32:10 +01:00
Lennart Poettering
8c1e088ac9 nspawn: drop two entirely redundant lines 2021-11-09 18:31:24 +01:00
Lennart Poettering
fb2fcad5d2 Merge pull request #21270 from poettering/event-mem-corruption
sd-event: fix memory corruption
2021-11-09 16:54:25 +01:00
Lennart Poettering
035daf73fb test: add test case for self-destroy inotify handler 2021-11-09 13:13:25 +01:00
Lennart Poettering
e67d738a87 sd-event: add sd_event_add_inotify_fd() call
sd_event_add_inotify_fd() is like sd_event_add_inotify(), but takes an
fd to an inode instead of a path, and is hence a ton nicer.
2021-11-09 13:02:13 +01:00
Lennart Poettering
53baf2efa4 sd-event: don't destroy inotify data structures from inotify event handler
This fixes a bad memory access when we destroy an inotify source handler
from the handler itself, and thus destroy the associated inotify_data
structures.

Fixes: #20177
2021-11-09 12:53:04 +01:00
Lennart Poettering
9830d71614 logind: downgrade message about /run/utmp missing to LOG_DEBUG
This isn't really anything to really complain about, let's debug log
about this, and continue quietly as if utmp was empty.
2021-11-09 12:52:59 +01:00
Lennart Poettering
4f538d7b22 tree-wide: use sd_event_source_disable_unref() where we can 2021-11-09 12:52:53 +01:00
Lennart Poettering
3777940ab2 inotify-util: improve reported error codes when inotify_add_watch() fails 2021-11-09 12:52:07 +01:00
Michal Koutný
7a0895c2eb Revert "CI: disable opensuse mkosi CI"
This reverts commit ab6df52083.

The image build failed during kernel RPM installation (bug in %post
scriptlet). This has been fixed in the package suse-module-tools 16.0.13
[1]. The fix is in openSUSE Tumbleweed repos so the tests can be enabled
again.

[1] https://github.com/openSUSE/suse-module-tools/pull/53

Fixes: #21019
2021-11-09 10:57:03 +00:00
Yu Watanabe
777c17b9d1 Merge pull request #21269 from yuwata/network-netdev-cleanups
network/netdev: several trivial cleanups
2021-11-09 19:08:11 +09:00
Zbigniew Jędrzejewski-Szmek
7368e69bc7 Merge pull request #21271 from yuwata/ether-addr-util-helper-functions
ether-addr-util: introduce several helper functions
2021-11-09 10:02:55 +01:00
Zbigniew Jędrzejewski-Szmek
ed8ba68f3b Merge pull request #21272 from yuwata/netif-util-split
netif-util: move several functions from network-util.c to netif-util.c
2021-11-09 10:01:07 +01:00
Yu Watanabe
b01895bf70 arp-util: drop redundant line
The client's IP address is already loaded to X.
(The comment of the dropped line is wrong, X instead of A.)
2021-11-09 09:32:09 +01:00
Yu Watanabe
bc945c2b42 network/netdev: sort netdev kinds 2021-11-09 16:00:49 +09:00
Yu Watanabe
ad851caebd network/bridge: drop if_bridge.h from bridge.h
To avoid future header conflicts.
2021-11-09 16:00:49 +09:00
Yu Watanabe
fddb337cc8 network/netdev: fix typo 2021-11-09 16:00:49 +09:00
Yu Watanabe
e331889a5e network: bareudp: use fill_message_create 2021-11-09 16:00:49 +09:00
Yu Watanabe
8e30e5fcd4 network: geneve: use fill_message_create 2021-11-09 16:00:49 +09:00
Yu Watanabe
7f0ed7d1c9 network/netdev: update comment 2021-11-09 16:00:49 +09:00
Yu Watanabe
28a8cc0a44 network/netdev: reduce indentation 2021-11-09 16:00:45 +09:00
Yu Watanabe
e5a7570188 Merge pull request #21226 from yuwata/network-tc-cake
network: add several CAKE settings
2021-11-09 14:18:41 +09:00
Yu Watanabe
2c7b14fa19 Merge pull request #21268 from yuwata/network-ndisc-use-gateway
network: ndisc: introduce UseGateway= and UseRoutePrefix=
2021-11-09 11:33:21 +09:00
Yu Watanabe
0b251e8bf9 test-network: add testcases for CAKE settings 2021-11-09 10:58:44 +09:00
Yu Watanabe
1c7a81e626 network: tc/cake: introduce UseRawPacketSize= setting 2021-11-09 10:58:44 +09:00
Yu Watanabe
35896db489 network: tc/cake: introduce SplitGSO= setting 2021-11-09 10:58:44 +09:00
Yu Watanabe
d05dce95d8 network: tc/cake: introduce Wash= setting 2021-11-09 10:58:44 +09:00
Yu Watanabe
049b66ccdd network: tc/cake: introduce FirewallMark= setting 2021-11-09 10:58:44 +09:00
Yu Watanabe
fe8e156e7a network: tc/cake: introduce PriorityQueueingProfile= setting 2021-11-09 10:58:44 +09:00
Yu Watanabe
863542e1ce network: tc/cake: introduce MPUBytes= setting 2021-11-09 10:58:44 +09:00
Yu Watanabe
4bff808648 network: tc/cake: introduce NAT= setting 2021-11-09 10:58:44 +09:00
Yu Watanabe
a049cf166c network: tc/cake: introduce FlowIsolationMode= setting 2021-11-09 10:58:44 +09:00
Yu Watanabe
b6eccfda1a network: tc/cake: introduce CompensationMode= setting 2021-11-09 10:58:44 +09:00
Yu Watanabe
3a86a31e0c network: tc/cake: do not pass 0 if OverheadBytes= is not specified 2021-11-09 10:58:44 +09:00
Yu Watanabe
025cd94e1c network: tc/cake: introduce AutoRateIngress= setting 2021-11-09 10:58:44 +09:00
Yu Watanabe
69978eb910 man: use "…" for specifying ranges 2021-11-09 10:58:44 +09:00
Yu Watanabe
ca2c3e921f man: move Bandwidth= setting at the beginning of the [CAKE] section
For consistency with tc-cake(8).
2021-11-09 10:58:44 +09:00
Yu Watanabe
fb076d5f6c sd-netlink: add more attributes for CAKE 2021-11-09 10:58:44 +09:00
Jan Janssen
42e3bb357c meson: Add --warn-common and --fatal-warnings to link flags 2021-11-09 08:57:29 +09:00
Yu Watanabe
0295b2fd1d netif-util: split net_get_unique_predictable_data() into two 2021-11-09 08:24:10 +09:00
Yu Watanabe
043b193f6e netif-util: rename net_get_name_persistent() -> net_get_persistent_name() 2021-11-09 08:24:10 +09:00
Yu Watanabe
4eef6fad31 netif-util: rename link_get_type_string() -> net_get_type_string() 2021-11-09 08:24:10 +09:00
Yu Watanabe
b5cc5591fa netif-util: move several functions from network-util.[ch] to shared/netif-util.[ch]
These functions are not relevant to sd-network, and only used by
networkd, networkctl, and udevd.
2021-11-09 08:24:10 +09:00
Yu Watanabe
91961fff43 arphrd-util: introduce arphrd_to_hw_addr_len() 2021-11-09 08:24:10 +09:00
Yu Watanabe
f09d20256a arphrd-util: rename arphrd-list.[ch] -> arphrd-util.[ch] 2021-11-09 08:24:10 +09:00
Yu Watanabe
de0f157984 ether-addr-util: make hw_addr_is_null() return true also for all zero address
This fixes the following error:
---
systemd-networkd[1449490]: ip6tnl0: Saved hardware address: 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00
systemd-networkd[1449490]: ip6tnl0: Failed to manage link by its new hardware address, ignoring: File exists
---
2021-11-09 08:20:51 +09:00
Yu Watanabe
1f86a3fe52 ether-addr-util: introduce several helper functions 2021-11-09 08:20:51 +09:00