Commit Graph

45982 Commits

Author SHA1 Message Date
Yu Watanabe 3dd95ab6c5 util: introduce bus_message_read_ifindex() 2020-07-21 04:08:22 +09:00
Yu Watanabe 10d4620467 util: introduce bus_mesage_read_dns_servers() 2020-07-21 04:08:22 +09:00
Yu Watanabe 976009897b util: introduce helper functions to read in_addr from bus message 2020-07-21 04:08:22 +09:00
Yu Watanabe e293e755d5 util: drop duplicated inclusion of sd-bus.h 2020-07-21 04:08:22 +09:00
Yu Watanabe 66479677a9 test-network: add tests for DNS= with port number and SNI 2020-07-21 04:08:22 +09:00
Yu Watanabe a747e71c56 resolvectl: show DNS servers with port and SNI 2020-07-21 04:08:22 +09:00
Yu Watanabe b1881e8320 resolvectl: make DNS servers can be specified with port number and SNI 2020-07-21 04:08:22 +09:00
Yu Watanabe 8e56ea4c88 resolve: add DBus properties which support DNS SNI and port number 2020-07-21 04:08:22 +09:00
Yu Watanabe 95ce1ba87b resolve: add DBus method to set DNS server with port number and SNI 2020-07-21 04:08:22 +09:00
Yu Watanabe 4e11ddfdd3 network: add DBus method to set DNS server with port number and SNI 2020-07-21 04:08:22 +09:00
Yu Watanabe 87d6489776 network: save DNS servers specified by DBus interface
Also, filter out DNS servers which do not match link ifindex.
2020-07-21 04:08:22 +09:00
Yu Watanabe 6458176514 network: do not save DNS= entries not match link ifindex 2020-07-21 04:08:22 +09:00
Yu Watanabe e77bd3fdff network: support port number and SNI in [Network] DNS= 2020-07-21 04:08:22 +09:00
Yu Watanabe 8aa5afd20f resolve: read/save port number and SNI from/into link state file 2020-07-21 04:08:16 +09:00
Yu Watanabe b6af282475 resolve: compare port and SNI in dns_server_hash_ops 2020-07-21 04:04:49 +09:00
Yu Watanabe 1b86009298 resolve: also compare port and SNI in dns_server_find() 2020-07-21 04:04:49 +09:00
Yu Watanabe da9de7385a resolve: support port specifier in DNS= setting 2020-07-21 04:04:42 +09:00
Yu Watanabe 395aa34023 resolve: ignore empty server name
Just for safety.
2020-07-21 03:55:34 +09:00
Yu Watanabe 408f8fbc0f util: introduce 'struct in_addr_full' and its helper functions 2020-07-21 03:55:34 +09:00
Yu Watanabe a723fb85da util: introduce in_addr_port_ifindex_name_from_string_auto() and in_addr_port_ifindex_name_to_string() 2020-07-21 03:55:34 +09:00
Yu Watanabe cbe194b39e resolve: propagate error in link_load_user()
Most error path in link_load_user() are ENOMEM. Hence, it is critical.
2020-07-21 03:55:34 +09:00
Yu Watanabe eced0d2a46
Merge pull request #16518 from yuwata/network-fix-failure-in-updating-mac-address
network: fix failures in updating MAC address
2020-07-21 02:13:24 +09:00
Frantisek Sumsal 2665327a41 travis: compile with -O1 with clang
libc in the Debian container got updated to 2.31, which in combination
with clang-9 triggers systemd/systemd#14865.

This has been fixed by https://reviews.llvm.org/D74712 which is (to my
knowledge) included in clang-10. To mitigate this without upgrading to
clang-10 we can compile with -O1 which works around it as well, see
https://bugzilla.redhat.com/show_bug.cgi?id=1803203.
2020-07-21 02:00:04 +09:00
David Edmundson d7d717b7e2 docs: Document xdg-autostart parameter X-systemd-skip 2020-07-20 16:03:47 +02:00
Zbigniew Jędrzejewski-Szmek 4c0668bc14
Merge pull request #16478 from bluca/dissect_tests
Expand TEST-50-DISSECT to cover dm-verity features
2020-07-20 12:59:56 +02:00
Benjamin Berg 6a097936b2 docs: Update section about XDG autostart generator
The generator is already merged. So update the corresponding section to
describe the current status.
2020-07-20 12:46:56 +02:00
Zbigniew Jędrzejewski-Szmek e6791b5522
Merge pull request #16497 from DaanDeMeyer/mkosi
mkosi: Keep mkosi.default out of the repository
2020-07-20 09:03:51 +02:00
Zbigniew Jędrzejewski-Szmek 7e8279c0a6
Merge pull request #16501 from yuwata/udev-fix-renaming
udev: fix issues in renaming interface vs alternative names
2020-07-20 09:00:02 +02:00
Yu Watanabe 807667f7ac network: stop already running engines before updating MAC address
In NetworkdBridgeTests.test_bridge_configure_without_carrier of
systemd-networkd-tests.py

```
bridge99: MAC address: 2e:3a:ec:4d:d3:62
Assertion 'sd_ipv4ll_is_running(ll) == 0' failed at src/libsystemd-network/sd-ipv4ll.c:110, function int sd_ipv4ll_set_mac(sd_ipv4ll *, const struct ether_addr *)(). Ignoring.
bridge99: Could not update MAC address in IPv4LL client: Device or resource busy
```
2020-07-20 15:29:55 +09:00
Yu Watanabe 96fe813c42 radv: introduce sd_radv_is_running() 2020-07-20 15:29:12 +09:00
Yu Watanabe 48c5398951 networkctl: do not ignore -EOPNOTSUPP when reading netlink message
If the kernel does not support alternative interface names, then
sd_netlink_message_read_strv() should just return -ENODATA.
2020-07-20 15:24:40 +09:00
Yu Watanabe ae5b779252 networkctl: sort alternative names 2020-07-20 15:24:40 +09:00
Franck Bui 0ef1adf512 vconsole-setup: downgrade log message when setting font fails on dummy console
Since commit 883eb9be98, vconsole-setup might be
called again to operate on dummy console where font operations are not
supported but where it's still important to have the correct keymap set [0][1].

vconsole-setup is mainly called by udev but can also be run via a dependency of
an early service. Both cases might end up calling vconsole-setup on the dummy
console.

The first case can happen during early boot even on systems that use (instead
of the dummy console) a "simple" video console driver supporting font
operations (such as vgacon) until a more specific driver (such as i915) takes
the console over. While this is happening vgacon is deactivated and temporarly
replaced by the dummy console [2].

There are also other cases where systemd-vconsole-setup might be called on
dummy console especially during (very) early boot. Indeed
systemd-vconsole-setup.service might be pulled in by early interactive services
such as 'dracut-cmdline-ask.service` which is run before udev.

If that happens on platforms with no grapical HWs (such as embedded ARM) or
with dummy console initially installed until a driver takes over (like Xen and
xen-fbfront) then setting font will fail.

Therefore this patch downgrades the log message emitted when setting font fails
to LOG_DEBUG and when font operations is not implemented like it's the case for
the dummy console.

Fixes: #16406.

[0] https://github.com/systemd/systemd/issues/10826
[1] https://bugzilla.redhat.com/show_bug.cgi?id=1652473
[2] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/gpu/vga/vgaarb.c?h=v5.7#n204
2020-07-20 08:15:50 +02:00
Yu Watanabe 628f08b66d sd-netlink: make timeout message sealed
When sd_netlink_call_async() timed out, then we reply the synthetic
error message, but it was not sealed. So, reading the message causes
the following assertion:

```
Assertion 'm->sealed' failed at src/libsystemd/sd-netlink/netlink-message.c:652, function netlink_message_read_internal(). Ignoring.
```
2020-07-20 07:49:55 +02:00
Zbigniew Jędrzejewski-Szmek d735e4f2d6
Merge pull request #16505 from yuwata/network-manage-foreign-routes-cleanups
network: do not enumerate foreign routes when ManageForeignRoutes=no, and tiny cleanups
2020-07-20 07:48:57 +02:00
Luca Boccassi ed4512d009 nspawn: set container_host env vars before user arguments
Allows users on the command line to seamlessly override
$container_host_* just like they can override $container_id and
$container
2020-07-20 07:28:22 +02:00
YmrDtnJu a9c9b18a95 networkd: Use NLM_F_ACK on the netlink message to add a neighbor.
sd_netlink_message_set_flags is called without NLM_F_ACK which results in
a timeout while networkd is waiting for an ACK that the kernel will never send.
2020-07-20 11:30:35 +09:00
Norbert Lange d3f45d130e clang-format: set Break afer enum to false
if set to true, the opening bracket will be moved to the next line.
2020-07-19 15:44:04 +02:00
Yu Watanabe 4573592ddf
Merge pull request #16512 from keszybz/offline-passwd-altfiles
Support alternate passwd/group locations in tmpfiles
2020-07-19 06:46:05 +09:00
Zbigniew Jędrzejewski-Szmek 241947d1b4 shared/offline-passwd: look at /usr/lib/{passwd,group} too
This changes the code to allow looking at multiple files with different
prefixes, but uses "/etc" and "/usr/lib". rpm-ostree uses
/usr/lib/{passwd,group} with nss-altfiles. I see no harm in simply trying both
paths on all systems.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1857530.

A minor memory leak is fixed: hashmap_put() returns -EEXIST is the key is
present *and* and the value is different. It return 0 if the value is the
same. Thus, we would leak the user/group name if it was specified multiple
times with the same uid/gid. I opted to remove the warning message completely:
with multiple files it is reasonable to have the same name defined more than
once. But even with one file the warning is dubious: all tools that read those
files deal correctly with duplicate entries and we are not writing a linter.
2020-07-18 14:14:19 +02:00
Zbigniew Jędrzejewski-Szmek 3e5d2264b5 Move offline-password.[ch] to shared and add test-offline-passwd
The test binary has two modes: in the default argument-less mode, it
just checks that "root" can be resolved. When invoked manually, a root
prefix and user/group names can be specified.
2020-07-18 14:14:19 +02:00
Norbert Lange 55678b9eae build: skip installation of 2 files if feature is disabled
dont install systemd-update-utmp if utmp is disabled.
dont install systemd-initctl.service if sysv is disabled.
2020-07-18 13:50:39 +09:00
Yu Watanabe 0119ab3d6c
Merge pull request #16476 from keszybz/qemu-autosuspend-rules
Add autosuspend rules for emulated QEMU devices
2020-07-18 09:10:20 +09:00
Yu Watanabe a8c10331b4 network: replace NDISC -> NDisc in log messages 2020-07-18 05:51:41 +09:00
Yu Watanabe 5eec0a0810 network: introduce address_exists() helper function 2020-07-18 05:51:41 +09:00
Yu Watanabe d15818f227 network: update debug log when foreign routes are received with ManageForeignRoutes=no 2020-07-18 05:51:41 +09:00
Yu Watanabe 5ff1ef31f2 network: do not enumerate routes if ManageForeignRoutes=no 2020-07-18 05:51:32 +09:00
Yu Watanabe 97fdae33df udev: do not try to reassign alternative names
Setting alternative names may fail if some of them are already assigned.
2020-07-17 21:36:11 +09:00
Yu Watanabe 434a348380 netlink: do not fail when new interface name is already used as an alternative name
When renaming a network interface, the new name may be used as an
alternative name. In that case, let's swap the current name and the
alternative name. That is, first drop the new name from the list of
alternative names, then rename the interface, finally set the old name
as an alternative name.
2020-07-17 21:31:47 +09:00
Yu Watanabe 1498252614 netlink: introduce rtnl_get/delete_link_alternative_names() 2020-07-17 21:29:13 +09:00