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

52616 Commits

Author SHA1 Message Date
Yu Watanabe
b713a99b1a sd-dhcp-server: support static lease outside of address pool
Closes #20341.
2021-08-11 16:43:26 +09:00
Yu Watanabe
3dc8fb0eb8 sd-dhcp-server: fix possible double-free or use-after-free 2021-08-11 16:43:25 +09:00
Yu Watanabe
cedf6a8da5 sd-dhcp-server: use hashmap_ensure_put() 2021-08-11 16:43:25 +09:00
MertsA
bbd239f67a Get rid of dangling setutxent()
utmp_wall() and utmp_put_dead_process() called setutxent() directly instead of the stub in utmp-wtmp.h and never called endutxent(). This would leave /run/utmp left open by PID 1 or journald. This can be reproduced by e.g. lsof /run/utmp and systemd-cat -p 0 echo test. For utmp_put_dead_process() it would only leave it open if it returned early before calling write_utmp_wtmp()
2021-08-11 09:40:10 +02:00
Lennart Poettering
5afcf89ca2 alloc-util: make mfree() typesafe
Make sure we return the same type as we accept.

One incorrect use of mfree() is discovered and fixed this way.
2021-08-11 04:47:10 +09:00
Luca Boccassi
76f226d71b
Merge pull request #20414 from yuwata/sd-dhcp6-client-trivial-fixes
sd-dhcp6-client: several fixes and cleanups
2021-08-10 20:32:29 +01:00
Luca Boccassi
06e8d75a5d
Merge pull request #20413 from poettering/mempmen
add and use mempmem_safe()
2021-08-10 20:31:36 +01:00
Lennart Poettering
9cbf128202 core: don't go to disk for masked unit state if we know it anyway
This should speed up our selinux checks a bit, since in most cases we
already know if a unit is masked, so use that info.
2021-08-10 20:30:41 +01:00
Yegor Alexeyev
836fb00f21 units: added factory-reset.target 2021-08-10 17:08:00 +02:00
Jack Dähn
b553abd8ae resolved: Don't omit AD bit in reply if DO is set in the query
Set the AD bit in the response if the data is authenticated and AD or DO is set in the query, as suggested by section 5.8 of RFC6840.

Fixes #20332
2021-08-10 16:41:33 +02:00
Michael Biebl
d84f316cce test: fix TEST-10-ISSUE-2467
Depending on the timing, socat will either get ECONNREFUSED oder EPIPE
from systemd. The latter will cause it to exit(1) and subsequently the
test to fail.
We are not actually interested in the return code of socat though. The
test is supposed to check, whether rate limiting of a socket unit works
properly.

So ignore any failures from the socat invocation and instead check, if
test10.socket is in state "failed" with result "trigger-limit-hit" after
it has been triggered.

TriggerLimitIntervalSec= by default is set to 2s. A "sleep 10" should
give systemd enough time even on slower machines, to reach the trigger
limit.

For better readability, break the test into separate ExecStart lines.

Fixes #19154.
2021-08-10 23:24:35 +09:00
Lennart Poettering
9a6549f6f8 update TODO 2021-08-10 15:07:44 +02:00
Yu Watanabe
0eec7f5ffa sd-dhcp6-client: use SYNTHETIC_ERRNO() 2021-08-10 21:57:42 +09:00
Lennart Poettering
e8b08edcdf tree-wide: use memmem_safe()
Let's be paranoid and do something useful if we operate with empty
haystack/needle. This doesn't actually fix anything, as the places as
far as I can see check for non-emptyness already beforehand, but I will
sleep safer at night, if we don't even allow the trap to be fallen in,
ever, even if the code is changed sooner or later.
2021-08-10 14:55:50 +02:00
Lennart Poettering
d8782cc5c2 memory-util: add mempmem_safe()
This is like memmem_safe() but returns a pointer after the needle,
instead to the beginning of the needle.

This is then used at one place. Not much, but it makes me sleep safer at
night, as it avoids the manual counting done so far.
2021-08-10 14:55:50 +02:00
Yu Watanabe
de949e911e sd-dhcp6-client: cirtainly adjust T1 and T2
This fixes a bug introduced by 99f1d3fc50.
Note that in the information requesting mode, the lease has neither
addresses nor PD prefixes.
2021-08-10 21:39:30 +09:00
Yu Watanabe
0c42b61348 sd-dhcp6-client: fix copy-and-paste mistake
Fix bug introduced by b47fb949b3.
2021-08-10 21:36:07 +09:00
Zbigniew Jędrzejewski-Szmek
b2efed520b fstab-generator: put What= before Where=
All units in units/ follow this pattern, as do all other generators that we
provide. The question of the order was raised in
https://github.com/systemd/zram-generator/pull/90#discussion_r684965984,
and I think it's nice to make it consistent everywhere
(What= before Where= matches mount(8) and fstab(5)).
2021-08-10 13:29:08 +02:00
Lennart Poettering
a7a04de0ec
Merge pull request #19959 from yuwata/udev-reduce-loop
udev: reduce number of times checking event dependency
2021-08-10 13:28:48 +02:00
Yu Watanabe
76b34df91f
Merge pull request #20410 from yuwata/network-ndisc-cleanups
network: several NDisc cleanups
2021-08-10 19:44:39 +09:00
Yu Watanabe
8fd9920273
Merge pull request #19939 from yuwata/network-dhcp-client-use-request-queue
network: use request queue to configure DHCP clients
2021-08-10 19:44:14 +09:00
Yu Watanabe
5e739f7eed
Merge pull request #19901 from yuwata/network-reconfigure-after-sleep
network: reconfigure interface after coming back from sleep
2021-08-10 19:43:54 +09:00
Yu Watanabe
c6f78234d1 udev: skip event when its dependency cannot be checked 2021-08-10 15:35:57 +09:00
Yu Watanabe
044ac33c35 udev: do not try to find blocker again when no blocker found previously 2021-08-10 15:35:01 +09:00
Yu Watanabe
bd335c961f list: introduce LIST_FOREACH_BACKWARDS() macro and drop LIST_FOREACH_AFTER/BEFORE() 2021-08-10 15:32:27 +09:00
Yu Watanabe
a1fa99d841 udev: rename is_device_busy() -> event_is_blocked()
Also this rename delaying_seqnum -> blocker_seqnum.
2021-08-10 15:19:41 +09:00
Yu Watanabe
5f4bca9dcc udev: do not try to process events if there is no free worker 2021-08-10 15:19:41 +09:00
Yu Watanabe
f2a5412bf2 udev: propagate error on spawning a worker 2021-08-10 15:19:41 +09:00
Yu Watanabe
92fd70addf udev: add usec_add() at one more place 2021-08-10 15:19:41 +09:00
Yu Watanabe
0744e74c52 udev: make event_queue_start() return negative errno on error 2021-08-10 15:19:27 +09:00
Yu Watanabe
5393c52897 udev: make event_free() return NULL 2021-08-10 15:16:56 +09:00
Yu Watanabe
6be97d67c8 udev: update log message to clarify that the error is ignored 2021-08-10 15:16:56 +09:00
Yu Watanabe
419ec63135 udev: move several functions
No functional chage.
2021-08-10 15:16:56 +09:00
Yu Watanabe
e0d61dac33 udev: also rename struct udev_ctrl -> UdevCtrl 2021-08-10 15:16:56 +09:00
Yu Watanabe
d9239923c1 udev: rename type name e.g. struct worker -> Worker 2021-08-10 15:16:56 +09:00
Yu Watanabe
4c2c2a1256 network: use usec_add() at several more places 2021-08-10 15:12:24 +09:00
Yu Watanabe
ae48d2d142 network: make IPv6Token private, and ipv6token_new() static 2021-08-10 15:12:24 +09:00
Yu Watanabe
f784681a3e network: ndisc: update a log message
Also slightly rename functions.
2021-08-10 15:12:24 +09:00
Yu Watanabe
b378b150b7 network: adjust log messages
Follow-up for #19944.
2021-08-10 15:04:04 +09:00
Yu Watanabe
8716018664 network: DHCP[46] -> DHCPv[46] in log messages 2021-08-10 15:02:35 +09:00
Yu Watanabe
ccffa166d8 network: use request queue to configure DHCP{4,6} clients
Previously, when UUID is requested for DUID, then the clients are
configured in callback of bus methods.
But now, 'request queue' was implemented, so we can use it to wait until
the product UUID is obtained.
2021-08-10 14:55:34 +09:00
Yu Watanabe
6211b7362a network: do not request UUID frequently on failure
If many interfaces request UUID, and networkd cannot get it for some
reasons, then previously we call the DBus method so frequently.
2021-08-10 14:48:18 +09:00
Yu Watanabe
bc8bd68db8 network: downgrade log level in dhcp6_configure()
And make the callers warn about failures.
2021-08-10 14:48:18 +09:00
Yu Watanabe
5aebe9c898 network: downgrade log level in dhcp4_configure()
And make the callers warn about failures.
2021-08-10 14:48:18 +09:00
Yu Watanabe
3bad5487e9 test-network: add a testcase to enter unmanaged state on reconfiguring 2021-08-10 14:44:47 +09:00
Yu Watanabe
cb71e9c606 network: drop configurations in the previous .network file when entering unmanaged state
When reconfiguring an interface and it will enter unmanaged state,
let's drop configurations from the previously assigned .network file.
2021-08-10 14:44:39 +09:00
Yu Watanabe
5e3bb5da98 network: do not drop foreign configs for loopback and critical interfaces on carrier lost 2021-08-10 14:43:54 +09:00
Yu Watanabe
6bfa06fc39 network: do not drop foreign configs based on the previous .network file
`link_drop_foreign_config()` will be called later in link_configure().
2021-08-10 14:43:54 +09:00
Yu Watanabe
f85499108f network: start/stop LLDP client on carrier gained/lost
Then, link_acquire_dynamic_conf() matches link_stop_engines().
Previously, LLDP client is started on interface is up, and stopped
on both down and carrier loss.
2021-08-10 14:43:54 +09:00
Yu Watanabe
d09a179e69 network: reconfigure link after coming back from sleep
Previously, link was reconfigured with `link_carrier_reset()`, but it
just re-request to configure static addresses, routes, etc, and restart
engines (e.g. DHCP client).
However, after coming back from sleep, several link information may be
changed, especially the wifi access point may be different. So, we may
need to reconfigure the interface.
2021-08-10 14:43:34 +09:00