1
0
mirror of https://github.com/systemd/systemd synced 2024-07-09 12:36:12 +00:00
Commit Graph

51937 Commits

Author SHA1 Message Date
Matt Johnston
e65357b658 man: fix sd_bus_add_node_enumerator() ret_nodes
ret_nodes is NULL terminated, the return value isn't a count.
2021-06-15 11:29:44 +01:00
Yu Watanabe
21d03e6c63 man: add an example to configure default route on device with table
Prompted by #19911.
2021-06-15 11:29:20 +01:00
Luca Boccassi
c35949a51c
Merge pull request #19930 from yuwata/update-comments
Update comments
2021-06-15 11:28:51 +01:00
Yu Watanabe
a3f5f4a5c0 fix typo 2021-06-15 14:19:30 +09:00
Yu Watanabe
7802194ac0 tree-wide: add missing whitespace at the end of comments 2021-06-15 14:09:29 +09:00
Yu Watanabe
f7bef77a16
Merge pull request #19924 from yuwata/sd-event-fix-assertion
sd-event: fix assrtion in sleep_between()
2021-06-15 13:34:03 +09:00
Khem Raj
0643eb47a0
test-seccomp: Check for __NR_ppoll before use (#19858)
some newer architectures like riscv32 do not have __NR_ppoll from get go
2021-06-15 13:12:30 +09:00
Yu Watanabe
9868493e17
Merge pull request #19913 from yuwata/network-fix-counter
network: add missing increment of Link::set_flags_messages
2021-06-15 10:51:24 +09:00
Lennart Poettering
05a2166a06 repart: show partitions we don't grow/create as "unchanged"
The previous string was "unknown", but that's wrong, because we *do*
know what we are going to do with those partitions: we leave them
unmodified, hence say "unchanged" in the output, to be clearer.
2021-06-15 05:39:33 +09:00
Lennart Poettering
9c07c9ec0e repart: align all sizes in table to the right 2021-06-15 05:39:33 +09:00
Frantisek Sumsal
785256a320 test: correctly configure the NUMA node memory pool
The currently hardcoded value works with the default configuration, but
breaks when QEMU_MEM != 512M (in sanitizer runs, for example).

```
# QEMU_MEM=1G make -C test/TEST-36-NUMAPOLICY/ run
make: Entering directory '/home/fsumsal/repos/@systemd/systemd/test/TEST-36-NUMAPOLICY'
TEST-36-NUMAPOLICY RUN: test NUMAPolicy= and NUMAMask= options
+ /bin/qemu-kvm -smp 8 -net none -m 1G -nographic -kernel /boot/vmlinuz-5.12.5-300.fc34.x86_64 -drive format=raw'
qemu-kvm: total memory for NUMA nodes (0x20000000) should equal RAM size (0x40000000)
E: QEMU failed with exit code 1
```
2021-06-15 05:37:28 +09:00
Yu Watanabe
2502e7befe
Merge pull request #19905 from yuwata/network-set-mac-try-again
network: try to bring down interface before setting MAC address
2021-06-15 05:35:45 +09:00
Yu Watanabe
710fa1b3fb network: update wlan information when IFF_LOWER_UP flag is gained
Fixes the issue mentioned at
https://github.com/systemd/systemd/issues/19832#issuecomment-860269320.
2021-06-15 05:14:22 +09:00
Yu Watanabe
7f80fa12c2 network: add brief comment about reconfiguring interfaces
This also renames link_reconfigure_internal() -> link_reconfigure_impl().
2021-06-15 05:12:25 +09:00
Yu Watanabe
ecb3deccdc network: do not partially update wlan information on failure 2021-06-15 04:32:31 +09:00
Yu Watanabe
7149bde4ba network: add missing increment of Link::set_flags_messages
link_up_or_down() will decrement the counter when the subsequent
RTM_GETLINK netlink method is finished. So, we need to increment
the counter here.

Fixes the issue mentioned at
https://github.com/systemd/systemd/issues/19832#issuecomment-860255692.
2021-06-15 03:58:59 +09:00
Yu Watanabe
2115b9b662 sd-event: always reshuffle time prioq on changing online/offline state
Before 81107b8419, the compare functions
for the latest or earliest prioq did not handle ratelimited flag.
So, it was ok to not reshuffle the time prioq when changing the flag.

But now, those two compare functions also compare the source is
ratelimited or not. So, it is necessary to reshuffle the time prioq
after changing the ratelimited flag.

Hopefully fixes #19903.
2021-06-15 02:34:26 +09:00
Yu Watanabe
5c08c7ab23 sd-event: make event_source_time_prioq_reshuffle() accept all event source type
But it does nothing for an event source which is neither a timer nor
ratelimited.
2021-06-15 02:34:16 +09:00
Yu Watanabe
a595fb5ca9 sd-event: use usec_add() 2021-06-15 01:01:48 +09:00
Yu Watanabe
06e131477d sd-event: use CMP() macro 2021-06-15 00:51:33 +09:00
Yu Watanabe
7e2bf71ca3 sd-event: drop unnecessary "else" 2021-06-15 00:44:04 +09:00
Topi Miettinen
1753d30215 Revert "Mount all fs nosuid when NoNewPrivileges=yes"
This reverts commit d8e3c31bd8.

A poorly documented fact is that SELinux unfortunately uses nosuid mount flag
to specify that also a fundamental feature of SELinux, domain transitions, must
not be allowed either. While this could be mitigated case by case by changing
the SELinux policy to use `nosuid_transition`, such mitigations would probably
have to be added everywhere if systemd used automatic nosuid mount flags when
`NoNewPrivileges=yes` would be implied. This isn't very desirable from SELinux
policy point of view since also untrusted mounts in service's mount namespaces
could start triggering domain transitions.

Alternatively there could be directives to override this behavior globally or
for each service (for example, new directives `SUIDPaths=`/`NoSUIDPaths=` or
more generic mount flag applicators), but since there's little value of the
commit by itself (setting NNP already disables most setuid functionality), it's
simpler to revert the commit. Such new directives could be used to implement
the original goal.
2021-06-15 00:33:22 +09:00
Luca Boccassi
2fbb5df8e9
Merge pull request #19898 from yuwata/network-multipath-route-without-interface-name
network: set link ifindex when multi-path routes specified without interface name
2021-06-14 14:27:50 +01:00
Luca Boccassi
feaf43158a
Merge pull request #19894 from yuwata/network-fix-configure-without-carrier
network: always check dynamic address assignments before entering con…
2021-06-14 14:23:09 +01:00
Luca Boccassi
1340574cf7
Merge pull request #19866 from yuwata/sd-device-new-from-ifindex
sd-device: introduce sd_device_new_from_ifindex()
2021-06-14 14:21:17 +01:00
Yu Watanabe
b5d0fd1e7f network: drop misleading debugging logs about MTU
This fixes the following spurious logs on enumerating links:
```
wlan0: Saved original MTU 1500 (min: 256, max: 2304)
wlan0: MTU is changed: 0 → 1500 (min: 256, max: 2304)
```
2021-06-14 14:19:02 +01:00
Yu Watanabe
d05c332c8d network: try to bring down before setting MAC address
Most real network devices refuse to set MAC address when its operstate
is not down. So, setting MAC address once failed, then let's bring down
the interface and retry to set.

Closes #6696.
2021-06-14 20:42:54 +09:00
Yu Watanabe
5388e103ea network: check the size of hardware address before setting MAC address
Also, skip to set MAC address when the current address equals to the
requrested one.
2021-06-14 20:42:50 +09:00
Jayanth Ananthapadmanaban
279082ed49 Add a network timeout option to journal-upload 2021-06-14 11:16:38 +02:00
Daniel Schaefer
5a750c49a9 doc: Add RISC-V to FAQ
Was added to the spec in 499f0f8209.
2021-06-13 18:20:09 +09:00
Zbigniew Jędrzejewski-Szmek
dce95d0b15 test/TEST-17-UDEV: use default image
No need to build a separate 700MB image to save 3080 bytes in the default image.
2021-06-12 11:19:04 +02:00
Yu Watanabe
4bcb862548 network: always check dynamic address assignments before entering configured state
Previously (v248 or earlier), even if no static address is configured,
the link did not enter configured state, as e.g. Link::static_addresses_configured
is false until the link gained its carrier.
But, after the commit 1187fc3375, the
situation was changed. Static addresses, routes, and etc are requested even
if the link does not have its carrier, and thus the link enters configured
state when no static address and etc are specified.

This makes the link does not enter configured state before it gains its
carrier when at least one of dynamic address assignment protocols (e.g.
DHCP) except for NDISC is enabled.

Note that, unfortunately, netplan always enables ConfigureWithoutCarrier=
for all virtual devices, e.g. bridge. See,
978e20f902
So, we need to support e.g. the following strange config:
```
[Netowkr]
ConfigureWithoutCarrier=yes
DHCP=yes
```

Fixes #19855.
2021-06-12 08:51:16 +09:00
Yu Watanabe
740b638267 test-network: disable dynamic addressing protocols when ConfigureWithoutCarrier= is enabled 2021-06-12 08:51:16 +09:00
Yu Watanabe
705c7b1860 test-network: refuse routable state when no-carrier is expected
If we do not set the maximum operstate in wait-online, then routable
state is allowed when no-carrier state is expected.
2021-06-12 08:51:16 +09:00
Yu Watanabe
7a0fef8688 test-network: add a testcase for MultiPathRoute= without interface name 2021-06-12 05:37:57 +09:00
Yu Watanabe
08c2fcdc0d network: route: set link ifindex when multi-path routes specified without interface name
And do not set RTA_OIF attribute when multi-path routes are specified.
See kernel's fib_get_nhs() in net/ipv4/fib_semantics.c.

Fixes #19890.
2021-06-12 05:34:52 +09:00
Yu Watanabe
af7b405dff sd-dhcp: refuse to set iaid if we cannot find the interface 2021-06-12 03:19:08 +09:00
Yu Watanabe
8d71f2b3a6 dhcp: do not use ifindex when generating iaid in tests 2021-06-12 03:19:08 +09:00
Yu Watanabe
0299deab53 sd-dhcp: do not use detect_container() to guess udev is running or not 2021-06-12 03:19:08 +09:00
Yu Watanabe
27fce94ae6 nspawn: path_is_read_only_fs() may return negative errno
And we usually assume /sys is not read only on error.
2021-06-12 03:19:08 +09:00
Yu Watanabe
0ac655a63b tree-wide: use sd_device_new_from_ifindex/ifname() 2021-06-12 03:19:08 +09:00
Yu Watanabe
bd44a727f7 sd-device: introduce sd_device_new_from_ifname/ifindex() 2021-06-12 03:19:08 +09:00
Yu Watanabe
afdf6c3b60 netlink: make rtnl_resolve_link_alternative_name() optionally return the main interface name 2021-06-12 03:19:08 +09:00
Yu Watanabe
57bd6aa701 netlink: check input name is valid before calling netlink method 2021-06-12 03:19:08 +09:00
Yu Watanabe
f6e491547d netlink: move resolve_ifname() or friends to netlink-util.[ch] 2021-06-12 03:19:08 +09:00
Yu Watanabe
f0ad7aedd9 network: use link_get_by_name() 2021-06-12 03:19:08 +09:00
Zbigniew Jędrzejewski-Szmek
756755d0fc docs: update coding style a bit
Say that r should be declared at the top of the function.

Don't say that fixed buffers result in truncation, right after saying that they
must only be used if size is known.

Adjust order of examples to be consistent.
2021-06-11 18:45:31 +01:00
Zbigniew Jędrzejewski-Szmek
e77365b479
Merge pull request #19882 from keszybz/test-stat-util-more
Add a test for path_is_read_only_fs()
2021-06-11 18:44:58 +02:00
Lennart Poettering
8f56d1a859 update TODO 2021-06-11 16:13:49 +02:00
Michal Koutný
cc815b7fea core: Avoid spurious realization of unit cgroups
Cgroups may be unnecessarily realized when they are not needed. This
happens, e.g. for mount units parsed from /proc/$PID/mountinfo, check

        touch /run/ns_mount
        unshare -n sh -c "mount --bind /proc/self/ns/net /run/ns_mount"
        # no cgroup exists
        file /sys/fs/cgroup/system.slice/run-ns_mount.mount
        systemctl daemon-reload
        # the vain cgroup exists
        file /sys/fs/cgroup/system.slice/run-ns_mount.mount

. (Such cgroups can account to a large number with many similar mounts.)

The code already accounts for "lazy" realization (see various checks for
Unit.cgroup_realized) but the unit_deserialize() in the reload/reexec
path performs unconditional realization.

Invalidate (and queue) the units for realization only if we know that
they were already realized in the past. This is a safe thing to do even
in the case the reload brings some new cgroup setting (controllers, BPF)
because units that aren't realized will use the updated setting when the
time for their realization comes. (It's not even needed to add a code
comment because the current formulation suggests the changed behavior.)
2021-06-11 10:34:22 +01:00