Commit Graph
34349 Commits
Author SHA1 Message Date
Yu Watanabe 5062b8593a network: introduce link_request_to_set_bond()
This will be used in later commits.
2021-06-08 06:33:27 +09:00
Yu Watanabe 7d5b232f40 network: introduce link_request_to_set_bridge()
This will be used in later commits.
2021-06-08 06:33:27 +09:00
Yu Watanabe 71a754f70f network: introduce link_request_to_create_stacked_netdev()
This will be used in later commits.
2021-06-08 06:33:27 +09:00
Yu Watanabe d24bf1b514 network: introduce link_request_to_set_master()
The function will be used later.
2021-06-08 06:33:27 +09:00
Yu Watanabe 8e00e24cc9 network: use request queue to set IPv6LL address generation mode 2021-06-08 06:33:27 +09:00
Yu Watanabe cc4c8fb136 network: use request queue to set interface group 2021-06-08 06:33:27 +09:00
Yu Watanabe a8e5e27c9f network: use request queue to set MAC address 2021-06-08 06:33:27 +09:00
Yu Watanabe 93fabc10fa network: use request queue to set link flags 2021-06-08 06:33:27 +09:00
Yu Watanabe 0fa8ee6c77 network: use request queue to set MTU 2021-06-08 06:33:27 +09:00
Yu Watanabe fa28381202 network: merge link_configure() and link_configure_continue() again
It is not necessary to stop whole configuration process until MTU and
IPv6LL address generation mode are set. But it is enough just setting
IPv6 MTU again after MTU is set, and dropping IPv6LL address after
setting the address generation mode.
2021-06-08 06:33:27 +09:00
Yu Watanabe 793117b3fd network: drop meaningless condition about setting MTU
The condition does not fix infinite loop of interface reset, as the
interface is reset after netlink reply is received, thus setting_mtu is
false.

See also #18738.
2021-06-08 06:33:27 +09:00
Yu Watanabe b9bf3f22a8 network: introduces link_drop_ipv6ll_addresses()
It is not necessary to parse whole message and store the address in
Link::addresses_foreign, as the address will be removed soon later.
2021-06-08 06:33:27 +09:00
Yu Watanabe f0269653e9 network: make link enter failed state on failure in link_update() and link_reset_carrier()
Previously, several failures in link_carrier_gained() make link enter
failed state, and other errors are ignored. Now, all failures in
link_carrier_gained(), moreover, link_update() are critical.
2021-06-08 06:33:27 +09:00
Yu Watanabe 8566df791e network: rename link_acquire_conf() -> link_acquire_dynamic_conf()
To clarify it starts dynamic configuration engines e.g. DHCP clients.
2021-06-08 06:33:27 +09:00
Yu Watanabe 9710895378 network: request to configure static settings earlier
Now, all static configs should be ordered after the link gains its carrier.
So, it is not necessary to wait for that before queuing requests.
2021-06-08 06:33:27 +09:00
Yu Watanabe 40b12fa20d network: introduce request_hash_ops to dedup requests
If KeepConfiguration= or ConfigureWithoutCarrier= is set, then the same
requests may be queued.
2021-06-08 06:33:27 +09:00
Yu Watanabe 5f33159190 network: expose hash and compare functions 2021-06-08 06:33:27 +09:00
Yu Watanabe fdeba3f5cc network: use request queue to configure IPv6 proxy NDP addresses 2021-06-08 06:33:27 +09:00
Yu Watanabe d8350b60e0 network: move logic for setting proxy_ndp sysctl to networkd-sysctl.c 2021-06-08 06:33:27 +09:00
Yu Watanabe 14d9ab9d32 network: introduce network_adjust_ipv6_proxy_ndp() 2021-06-08 06:33:27 +09:00
Yu Watanabe 354bc760cd network: address label: use request queue to configure address labels 2021-06-08 06:33:27 +09:00
Yu Watanabe 4c0c8d1e72 network: address label: use struct in6_addr instead
Address label is for IPv6.
2021-06-08 06:33:27 +09:00
Yu Watanabe 2551b422e1 network: address label: refuse IPv4 mapped address with large prefix length
See ip6addrlbl_alloc() in net/ipv6/addrlabel.c of kernel.
2021-06-08 06:33:27 +09:00
Yu Watanabe c3e960883f in-addr-util: introduce in6_addr_is_ipv4_mapped_address() 2021-06-08 06:33:27 +09:00
Yu Watanabe 9a038aaced network: use request queue to configure bridge MDB 2021-06-08 06:33:27 +09:00
Yu Watanabe ff9e07838d network: rename MdbEntry -> BridgeMDB 2021-06-08 06:33:27 +09:00
Yu Watanabe 165d7c5c42 network: introduce UplinkInterface= setting for DHCP server 2021-06-08 06:33:27 +09:00
Yu Watanabe fb3aec45a0 network: make manager_find_uplink() uses stored route information
networkd already has all information about routes. It is not necessary
to re-read them by using local_gateways().

This also makes manager_find_uplink() take family.
2021-06-08 06:33:27 +09:00
Yu Watanabe ab486ef4eb network: restart DHCP server on carrier gain 2021-06-08 06:33:27 +09:00
Yu Watanabe b27e5d53f3 sd-dhcp-server: make sd_dhcp_server_start() no-op if it is already running 2021-06-08 06:33:27 +09:00
Yu Watanabe 1d28a3cf6c network: use request queue to configure DHCP server 2021-06-08 06:33:27 +09:00
Ondrej Kozina 1319c7e044 cryptsetup-pkcs11: use erase_and_free for decrypted key cleanup.
It's hard to hit but it could leave decrypted key in memory on error
path.
2021-06-07 23:09:00 +02:00
Ondrej Kozina 26fbc5aa05 cryptsetup: Fix misplaced assert.
Seems the assert should be placed in-before decrypted_key
pointer is passed to libcryptsetup API.

Original placement would trigger abort in case tpm2
hw was not present in the system while required
to activate crypt devices.
2021-06-07 22:40:32 +02:00
Yu Watanabe b6fce22a67 Merge pull request #19839 from yuwata/network-address-fix-flags-handling
network: fix address flag handling
2021-06-08 03:38:15 +09:00
Zbigniew Jędrzejewski-Szmek b0ec372a96 install: allow adding plain templates to .wants/ or .requires/
Fixes #19437.

As reported in the bug:

> # drkonqi-coredump-processor@.service
>  ...
> [Install]
> WantedBy=systemd-coredump@.service
>
> The plan here is to have a systemd-coredump@ instance start the same %i for
> drkonqi-coredump-processor@. Works perfectly when creating the symlink manually
> ln -sv /usr/lib/systemd/system/drkonqi-coredump-processor@.service
> /etc/systemd/system/systemd-coredump@.service.wants/.

When DefaultInstance is set, we replace template references with
template@default-inst. But in this case we want to create a symlink for the
template name, so that systemd will fill in the instance from the
wanting/requiring unit. This is only possible for those units that actually
have an instance set, so we create the symlink only from .requires/ or .wants
of an instantiated unit (then this specific instance will be used), or a
template (than some instance will be inherited later).

Specifically:
...
[Install]
WantedBy=other@.service, fixed.service
DefaultInstance=inst

→ enable foo@.service creates other@.service.wants/foo@inst.service, and
other@a.service will want foo@inst.service, and other@b.service will want foo@inst.service,
and fixed.service will want foo@inst.service.

Without DefaultInstance,
→ enable foo@.service creates other@.service.wants/foo@.service, and
other@a.service would want foo@a.service, and other@b.service would want foo@b.service,
but enablement fails because no dependency can be created for fixed.service:

  Failed to enable unit, unit fixed.service is a non-template unit.
2021-06-08 01:58:27 +09:00
Yu Watanabe 6260e85fc8 Merge pull request #19835 from keszybz/user-manager-bpf-errors
Silence errors about BPF object permissions in user manager
2021-06-08 01:50:57 +09:00
Lennart Poettering d27e6aee50 udevadm: fix --tag-match help + description 2021-06-08 01:47:01 +09:00
Yu Watanabe 0718266017 Merge pull request #19837 from keszybz/disable-more-units
Disable more units
2021-06-08 01:46:15 +09:00
Yu Watanabe a066dc9c18 Merge pull request #19815 from yuwata/sd-device-clone
sd-device: make cloned sd_device object can read udev database without uevent file
2021-06-08 01:45:45 +09:00
Lennart Poettering be45211388 Merge pull request #19820 from yuwata/udev-node-fix-hashed-path
udev: fix conflict of hashed string
2021-06-07 17:19:38 +02:00
Yu Watanabe 0828a38605 network: address: always read address flag from IFA_FLAGS attribute
Otherwise, update flag become incomplete and the IFA_F_MANAGETEMPADDR flag
will not be stored, thus no temporary addresses will be removed when
networkd requests to remove the main address.

Follow-up for a8481354f0.
Fixes #13218.
Fixes #19838.
2021-06-08 00:13:25 +09:00
Yu Watanabe a23624846f network: show address flag in debugging logs 2021-06-07 23:02:56 +09:00
Franck Bui b2c7d1bbc2 pid1: only add a Wants= type dependency on /tmp when PrivateTmp=yes
We support that tmp.mount being masked, and this should not be considered an
error.
2021-06-07 14:10:56 +02:00
Zbigniew Jędrzejewski-Szmek 294eace024 core: disable "update" units in the initramfs
Initially I wanted to add ConditionPathExists=!/etc/initrd-release in various
units (ldconfig.service, systemd-sysusers.service, systemd-hwdb-update.service,
systemd-journal-catalog-update, systemd-update-done.service), but I think it's
better to just disable the mechanism in the initrd altogether. Initrd images
are put together in a very particular way, and there is not need to do
post-update steps on them. If a unit from some other package winds up in the
initrd, we wouldn't want to invoke it either.

Also, any modifications are ephemeral, so any update would happen on every
use. And finally, initrd images are all about speed, and we shouldn't invoke
any unneeded services.
2021-06-07 13:40:08 +02:00
Sebastian Blunt 2cbca51a71 Rename crypttab opt silent to password-echo
Use the option name 'password-echo' instead of the generic term
'silent'.

Make the option take an argument for better control over echoing
behavior.

Related discussion in https://github.com/systemd/systemd/pull/19619
2021-06-07 10:35:28 +02:00
Zbigniew Jędrzejewski-Szmek 1a9e33aee3 core: downgrade errors about BPF loading when called from socket_bind_supported()
prepare_socket_bind_bpf() is called from two sites: socket_bind_supported() and
socket_bind_install_impl(). For the latter, when errors occur we certainly want
to log, since they'll be fatal for the unit.  But for the former, we should be
quiet, at least on the "expected" errors like lack of permissions. I kept error
on map resizing and such, which should not fail, at log_warning(). They are not
fatal when called from socket_bind_suppported(), but still a sign that
something is off.

Currently BPF filters can only be used by privileged users. Thus each systemd
--user will fail in socket_bind_supported(). With the patch, we only log this
at debug level.

https://lwn.net/ml/bpf/cover.1620499942.git.yifeifz2@illinois.edu/ gives some
hope that unprivileged access will be possible, so let's keep the code trying.
We might get lucky and get support for filters in user mode without any changes
on our side.
2021-06-07 10:28:46 +02:00
Zbigniew Jędrzejewski-Szmek 5b35b56eae core/bpf: add forgotten %m 2021-06-07 10:28:46 +02:00
Luca Boccassi 3745355764 Merge pull request #19793 from keszybz/tmpfiles-autofs-and-globs
tmpfiles: better handling of autofs and globs
2021-06-07 09:14:27 +01:00
Yu Watanabe 381f6d4ba5 sd-device: make cloned sd_device object can read udev database without uevent file
Some devices sent CHANGE and REMOVE uevent simultaneously.
To support that such device read udev database, let's copy minimal set of
properties which requires to read the database.

Fixes #19788.
2021-06-05 18:05:26 +09:00
Yu Watanabe c7d6ebb13e sd-device: do not try to read uevent file multiple times 2021-06-05 17:58:53 +09:00