1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-01-08 21:17:47 +03:00
Commit Graph

53832 Commits

Author SHA1 Message Date
Jonas Dreßler
afa31f8c0f hwdb: Allow USB autosuspend for MS Surface Pro (2017) Type Cover
The Surface Type Covers are known to support USB autosuspend just fine
(and it's also enabled by default on Windows), so enable it in hwdb.
2021-10-21 18:59:06 +01:00
Yu Watanabe
f45fb83996
Merge pull request #21072 from yuwata/network-address-lifetime
network: address: use usec_t for handling lifetime
2021-10-22 01:46:55 +09:00
Yu Watanabe
a3e33adfb5
Merge pull request #21050 from yuwata/network-bpf-cleanups
libsystemd-network: cleanup BPF code
2021-10-22 01:46:15 +09:00
Yu Watanabe
113e124f9b icmp6: shorten code a bit 2021-10-21 22:40:03 +09:00
Yu Watanabe
ea51deb188 dhcp: shorten BPF code a bit
- replace `A = k` and `X = A` with `X = k`,
- replace `A ^= X` and `A == 0` with `A == X`.
- use UINT32_MAX when accept a packet
2021-10-21 22:39:53 +09:00
Yu Watanabe
155943b259 dhcp: rebreak function arguments 2021-10-21 22:39:43 +09:00
Yu Watanabe
b8319d748f dhcp: fix assertions 2021-10-21 22:39:43 +09:00
Yu Watanabe
d70c78131d dhcp: shorten code a bit 2021-10-21 22:39:43 +09:00
Yu Watanabe
36f1955da8 lldp: shorten code a bit 2021-10-21 22:39:43 +09:00
Yu Watanabe
e2c7c38b74 arp-util: shorten BPF code a bit
- replace `A = k` and `X = A` with `X = k`,
- replace `A ^= X` and `A == 0` with `A == X`.
- use UINT32_MAX when accept a packet
2021-10-21 22:39:25 +09:00
Yu Watanabe
16bc8635d5 network: address: use usec_t for handling lifetime
This drops stuct ifa_cacheinfo from Address, and store lifetime with
usec_t.

Why? Now, all requests of address configurations are once stored in
the request queue, and will be processed when it is ready. So, the
timestamp value passed to the kernel must be evaluated on configure.

This also fixes the following two issues.
- Time values in struct ifa_cacheinfo are stored in uint32_t.
  So, the validity check of the address configured by NDisc may fail on
  long running systems.
- If a system uses DHCPv6PD, when an interface may appear or be
  reconfigured later, then the lifetime value may be inappropriate.
  We need to adjust the lifetime with the current time and the timestamp
  of the lease.
2021-10-21 20:58:15 +09:00
Yu Watanabe
03ccc4b423 network: ndisc: rename valid_until -> lifetime_usec 2021-10-21 20:58:15 +09:00
Yu Watanabe
09845af54b network: ndisc: add missing lifetime check 2021-10-21 20:58:15 +09:00
Yu Watanabe
91fc5135e6 network: route: rename lifetime -> lifetime_usec 2021-10-21 20:58:15 +09:00
Zbigniew Jędrzejewski-Szmek
97c373c7de
Merge pull request #21065 from keszybz/efi-warnings
Clean up unused variables in efi code
2021-10-21 08:33:08 +02:00
Yu Watanabe
1c15c3653e network: drop unnecessary header inclusion 2021-10-21 08:32:04 +02:00
Luca Boccassi
0ad536c16a CI: disable code coverage in GH Action
It is now ran on the nightly CentOS build, so that it can cover
integration tests too, and not just unit tests. It's nightly as
it considerably increases the integration test runtime, so it's
not appropriate for all PRs.
2021-10-21 00:10:52 +01:00
Frantisek Sumsal
140557021a test: don't install test-network-generator-conversion.sh w/o networkd
otherwise TEST-02 will fail:

```
=== Failed test log ===
--- test-network-generator-conversion.sh begin ---
+ [[ -n '' ]]
+ [[ -x /usr/lib/systemd/systemd-network-generator ]]
+ [[ -x /lib/systemd/systemd-network-generator ]]
+ exit 1
--- test-network-generator-conversion.sh end ---
```

Before:
```
$ meson build -Dnetworkd=false -Dinstall-tests=true
$ ninja -C build
$ DESTDIR=$PWD/test-install ninja -C build install
$ find test-install/ -name test-network-generator-conversion.sh
test-install/usr/lib/systemd/tests/test-network-generator-conversion.sh
```

After:
```
$ find test-install/ -name test-network-generator-conversion.sh
<no output>
```
2021-10-20 22:04:45 +01:00
Frantisek Sumsal
0b5fe54ff5 test: collect coverage in a couple more codepaths
Otherwise we'd miss coverage from TEST-{02,24,61}, since they don't go
through the "standard" `check_result_common` hook.

Follow-up to 7bf20e48bd.
2021-10-20 16:46:58 +01:00
Yu Watanabe
21f2b19cc2 zsh-completion: nspawn: add --suppress-sync option
Follow-up for 4a4654e024.
2021-10-20 22:53:39 +09:00
Yu Watanabe
241167e68a
Merge pull request #21051 from poettering/nspawn-no-sync
nspawn: add --suppress-sync=yes mode for turning sync() and friends i…
2021-10-20 22:42:43 +09:00
Luca Boccassi
b78524f48d
Merge pull request #21055 from yuwata/network-dhcp6-pd-route-lifetime-metric
network: dhcp6pd: set lifetime and route metric
2021-10-20 14:38:03 +01:00
Yu Watanabe
6417e8925c
Merge pull request #21061 from poettering/direct-io-loopback-tweaks
tweaks to O_DIRECT loop work
2021-10-20 22:21:30 +09:00
Dimitri Papadopoulos
ba669952b2 Typos found by codespell 2021-10-20 22:20:18 +09:00
Zbigniew Jędrzejewski-Szmek
2fffe2ed19 efi: check input parameter
clang complained about an unused variable. We cast the buffer to
struct boot_params, so let's check that it's at least this long.
2021-10-20 14:20:44 +02:00
Zbigniew Jędrzejewski-Szmek
f3611cfb0b efi: drop two unused variables
It seems the code was added in 2553a5482c and
those two were never used for anything.
2021-10-20 13:58:03 +02:00
Lennart Poettering
4a4654e024 nspawn: add --suppress-sync=yes mode for turning sync() and friends into NOPs via seccomp
This is supposed to be used by package/image builders such as mkosi to
speed up building, since it allows us to suppress sync() inside a
container.

This does what Debian's eatmydata tool does, but for a container, and
via seccomp (instead of LD_PRELOAD).
2021-10-20 11:35:15 +02:00
Lennart Poettering
0193b93eb5 loop-util: call loop_device_make_internal() at the right place
The whole reason loop_device_make_internal() exists (as opposed to just
loop_device_make()) is to avoid mangling the loop flags value/call
getenv twice. Hence let's actually call it when we already mangled the
flags value.
2021-10-20 09:57:16 +02:00
Lennart Poettering
aa4d3aa3ef loop-util: add debug logging about O_RDWR vs. O_RDONLY + O_DIRECT mode
Once we managed to open the file let's log what we wanted and what we
got.
2021-10-20 09:56:20 +02:00
Lennart Poettering
bfd084454d loop-util: minor coding style updates
As suggested here: https://github.com/systemd/systemd/pull/21044#pullrequestreview-783530343
2021-10-20 09:55:33 +02:00
Yu Watanabe
231c7645ca
Merge pull request #21041 from yuwata/network-bpf-neighbor
network: introduce BPF to reject netlink messages about non-static neighbor
2021-10-20 13:30:32 +09:00
Yu Watanabe
952d873f56
Merge pull request #21056 from yuwata/test-network-cleanups
test-network: several cleanups related to dnsmasq
2021-10-20 13:29:45 +09:00
Yu Watanabe
a4a1385e07 test-network: cleanup dnsmasq related file on setup
Just for safety.
2021-10-20 03:49:05 +09:00
Yu Watanabe
888f57c11c test-network: drop pid_file argument from stop_dnsmasq() 2021-10-20 03:49:05 +09:00
Yu Watanabe
ed08ed4a45 test-network: use constant variables in dnsmasq command 2021-10-20 03:49:05 +09:00
Yu Watanabe
d0619f2c2b network: dhcp6pd: set default metric 256 for delegated prefix
When Assign= in [DHCPv6PrefixDelegation] is enabled, then the kernel
will create the prefix route for the assigned address with metric 256.
When Assign= is disabled, then the kernel will create the route with
metric 1024.

For the default value, we should choose a smaller value (higher priority)
than 1024, as the unreachable routes for delegated prefix will be
configured with 1024.
2021-10-20 02:36:20 +09:00
Yu Watanabe
10ab5ed5a8 network: dhcp6: explicitly specify metric for unreachable route
For static IPv6 routes without metric is specified, then we use 1024.
But such an adjustment is not performed to dynamic routes. So, let's
specify the metric explicitly.
Otherwise, configured routes will be handled as foreign.
2021-10-20 02:36:20 +09:00
Yu Watanabe
937e894747 network: dhcp6pd: set lifetime to routes for assigned prefixes
Note that the kernel (at least 5.14.11) seems not to support lifetime
for IPv6 unreachable routes. The lifetime for routes of the type will be
handled by sd-event's timer event source.
So, we cannot confirm the lifetime with 'ip route' command.
2021-10-20 02:36:20 +09:00
Yu Watanabe
653ddc1d18 sd-dhcp6-client: introduce sd_dhcp6_lease_get_timestamp() 2021-10-20 02:36:20 +09:00
Yu Watanabe
a2ca8c54cc
Merge pull request #21035 from yuwata/network-route-fix-lifetime
network: route: drop kernel version check
2021-10-20 01:48:44 +09:00
Lennart Poettering
ac6b19a216
Merge pull request #21044 from poettering/loopback-direct-io
loop-util: enable LO_FLAGS_DIRECT_IO by default on loopback devices
2021-10-19 18:42:25 +02:00
Daan De Meyer
ab6df52083 CI: disable opensuse mkosi CI
Until https://github.com/systemd/systemd/issues/21019 is fixed,
there's no point in running the opensuse CI job so let's disable
it for now.
2021-10-19 17:21:29 +01:00
Lennart Poettering
b9a9748abc loop-util: work around cache invalidation bug in older kernels
Inspired by the discussions in #21003.

Inspired in particular by what Android apexd does:

https://android.googlesource.com/platform/system/apex/+/refs/heads/master/apexd/apexd_loop.cpp
2021-10-19 15:38:21 +02:00
Lennart Poettering
e8c7c4d9d1 loop-util: enable LO_FLAGS_DIRECT_IO by default on loopback devices
Fixes: #21003
2021-10-19 15:38:21 +02:00
Yu Watanabe
26a8be48bc network: introduce BPF to reject netlink messages about non-static neighbor
Fixes #21031.
2021-10-19 20:41:34 +09:00
Yu Watanabe
dc317a9aed sd-netlink: introduce sd_netlink_attach_filter() 2021-10-19 20:41:09 +09:00
Yu Watanabe
0b0c81bb53 network: route: drop kernel version check for route expiration
Even in newer kernel version, it seems that some route type does not
support expiration, e.g. IPv4 route or unreachable route. Let's use
timer event source for such routes.
2021-10-19 20:33:43 +09:00
Lennart Poettering
aabb252577
Merge pull request #20905 from medhefgo/boot-cleanup
sd-boot: Code cleanups
2021-10-19 10:23:12 +02:00
Zbigniew Jędrzejewski-Szmek
33539ffe59
Merge pull request #20988 from DaanDeMeyer/rotate-reason
journal: Improve rotation logging
2021-10-19 09:53:31 +02:00
Zbigniew Jędrzejewski-Szmek
b5d26617bb
Merge pull request #21037 from yuwata/network-dhcp6-pd-simplify-distribute
network: dhcp6-pd: simplify dhcp6_pd_prefix_distribute()
2021-10-19 09:24:38 +02:00