Commit Graph
34349 Commits
Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek e3e64a1abd resolved: indent tables for readability
Some of the tables in resolved were already doing using this convention. This
makes the rest of them do so too.
2021-05-14 16:25:54 +02:00
Zbigniew Jędrzejewski-Szmek f86887af6e meson: print autodetected sbat fields
...
Message: sbat-distro (from ID): fedora
Message: sbat-distro-summary (from NAME): Fedora
Message: sbat-distro-url (from BUG_REPORT_URL): https://bugzilla.redhat.com/
...
2021-05-14 14:37:14 +02:00
Zbigniew Jędrzejewski-Szmek 0f4c4f3824 meson: call find_program() once and reuse the variable everywhere
Meson 0.58 has gotten quite bad with emitting a message every time
a quoted command is used:
Program /home/zbyszek/src/systemd-work/tools/meson-make-symlink.sh found: YES (/home/zbyszek/src/systemd-work/tools/meson-make-symlink.sh)
Program sh found: YES (/usr/bin/sh)
Program sh found: YES (/usr/bin/sh)
Program sh found: YES (/usr/bin/sh)
Program sh found: YES (/usr/bin/sh)
Program sh found: YES (/usr/bin/sh)
Program sh found: YES (/usr/bin/sh)
Program xsltproc found: YES (/usr/bin/xsltproc)
Configuring custom-entities.ent using configuration
Message: Skipping bootctl.1 because ENABLE_EFI is false
Program ln found: YES (/usr/bin/ln)
Program ln found: YES (/usr/bin/ln)
Program ln found: YES (/usr/bin/ln)
Program ln found: YES (/usr/bin/ln)
Program ln found: YES (/usr/bin/ln)
Program ln found: YES (/usr/bin/ln)
Message: Skipping journal-remote.conf.5 because HAVE_MICROHTTPD is false
Message: Skipping journal-upload.conf.5 because HAVE_MICROHTTPD is false
Program ln found: YES (/usr/bin/ln)
Program ln found: YES (/usr/bin/ln)
Message: Skipping loader.conf.5 because ENABLE_EFI is false
Program ln found: YES (/usr/bin/ln)
Program ln found: YES (/usr/bin/ln)
Program ln found: YES (/usr/bin/ln)
Program ln found: YES (/usr/bin/ln)
Program ln found: YES (/usr/bin/ln)
Program ln found: YES (/usr/bin/ln)
Program ln found: YES (/usr/bin/ln)
Program ln found: YES (/usr/bin/ln)
Program ln found: YES (/usr/bin/ln)
Program ln found: YES (/usr/bin/ln)
Program ln found: YES (/usr/bin/ln)
Program ln found: YES (/usr/bin/ln)
Program ln found: YES (/usr/bin/ln)
Program ln found: YES (/usr/bin/ln)
Program ln found: YES (/usr/bin/ln)
Program ln found: YES (/usr/bin/ln)
Program ln found: YES (/usr/bin/ln)
Program ln found: YES (/usr/bin/ln)
Program ln found: YES (/usr/bin/ln)
Program ln found: YES (/usr/bin/ln)
Program ln found: YES (/usr/bin/ln)
Program ln found: YES (/usr/bin/ln)
...

Let's suffer one message only for each command. Hopefully we can silence
even this when https://github.com/mesonbuild/meson/issues/8642 is
resolved.
2021-05-14 14:21:27 +02:00
Christian Göttsche c46c768811 selinux: reload label db on policy load with libselinux 3.2
Currently the label database is not reloaded with libselinux 3.2 on a
policy reload.

Since libselinux 3.2 avc_open(3) uses the SELinux status page instead of
a netlink socket to check for policy reloads.
The status page is also queried in mac_selinux_maybe_reload().
Thus calls to selinux_check_access(3) might consume an update, queried
by selinux_status_updated(3), leaving mac_selinux_maybe_reload() unable
to detect a policy reload.

Do not use selinux_status_updated(3), use selinux_status_policyload(3)
unconditionally.

Relevant libselinux commit: https://github.com/SELinuxProject/selinux/commit/05bdc03130d741e53e1fb45a958d0a2c184be503

Debian Bullseye is going to ship libselinux 3.1, so stay compatible for
backports.
2021-05-14 14:12:39 +02:00
Yu Watanabe 893e3ffe7d network: shorten code a bit and update log message 2021-05-14 09:38:41 +02:00
Yu Watanabe bfc2b05e59 networkctl: introduce --json option for "status" and "list" commands
When `--json` option is specified, "status" and "list" commands gives
the same information, as originally "list" just gives partial
information of "status" in different format.
2021-05-14 09:18:29 +09:00
Yu Watanabe fec7a9e0ac json: make JSON_VARIANT_ARRAY/OBJECT_FOREACH() nestable 2021-05-14 09:18:29 +09:00
Yu Watanabe 484f22dd66 networkctl: use table_set_empty_string() 2021-05-14 09:18:29 +09:00
Yu Watanabe 54a16efe18 network: introduce Describe() method for manager and links 2021-05-14 09:18:29 +09:00
Yu Watanabe 1a3caa49d7 udev,network: make link_get_type_string() return negative errno on failure
And make net_match_config() propagate the error.
2021-05-14 09:18:29 +09:00
Yu Watanabe 170e88c8e3 network: move and rename network_get() -> link_get_network()
This also drops test_network_get(). But it tests almost nothing. So, it
should be ok to not re-implement something like test_link_get_network().
2021-05-14 09:18:29 +09:00
Anita Zhang cbdc294920 run: update checks to allow running with a user's bus
systemd-run is documented to as being able to connect and run on a
specific user bus with "--user --machine=lennart@.host" arguments.
This PR updates some logic that prevented this from working.
2021-05-13 16:49:06 +01:00
Yu Watanabe 7df7ba457c Merge pull request #19590 from keszybz/comments-and-service-modernization
Comments and service modernization
2021-05-13 12:17:19 +09:00
Zbigniew Jędrzejewski-Szmek c799d93cfa Merge pull request #19567 from poettering/ipv4-ipv6-lowercase
various follow-ups to socket-bind logic
2021-05-12 12:21:58 +02:00
Michael Catanzaro aa2b370ddd resolved.conf.in: add missing Quad9 servers
The example configuration is missing half of Quad9's addresses.
2021-05-12 12:17:39 +02:00
Lennart Poettering 5a0d0b8f9c resolved: be more careful with weird links with low MTUs
Apparently CAN links will show up in rtnetlink with very low MTUs. We
shouldn't consider them relevant if no IP is spoken over them, since
these MTUs are irrelevant for us then.

Hence, let's check if there's an address assigned to the link before
considering its MTU.

As additional safety net filter out MTUs smaller than the minimum DNS
packet size, too.

Finally, in case we don't find any suitable interface MTU, let's default
to 1500 as the generic Ethernet MTU.

Fixes: #19396
2021-05-12 12:15:56 +02:00
Zbigniew Jędrzejewski-Szmek 7a7e58ce44 Merge pull request #19533 from yuwata/network-queue
network: introduce queue to configure address, route, etc
2021-05-12 12:12:22 +02:00
Zbigniew Jędrzejewski-Szmek e78695d44b core/service: modernization 2021-05-12 12:05:21 +02:00
Zbigniew Jędrzejewski-Szmek 6f350e05c1 test-bpf-foreign-programs: fix message 2021-05-12 12:05:21 +02:00
Zbigniew Jędrzejewski-Szmek de02634c73 sd-event: tweak comments 2021-05-12 12:05:21 +02:00
Zbigniew Jędrzejewski-Szmek 8f0ea0efd9 timedated: make ntp_synced() static
No need to have this in basic.
2021-05-12 12:05:21 +02:00
Zbigniew Jędrzejewski-Szmek 8f7123731d Merge pull request #18986 from poettering/oomd-varlink-fix
varlink ref fix
2021-05-12 11:36:32 +02:00
Zbigniew Jędrzejewski-Szmek 01d0123f04 Merge pull request #19506 from xnox/ship-stub-elf
boot/efi: install ELF linux.elf.stub in addition to PE linux.efi.stub
2021-05-12 09:45:36 +02:00
Lennart Poettering dc90ad6825 Merge pull request #19581 from yuwata/specifier-refuse-too-long-results
specifier: refuse too long results
2021-05-12 09:42:08 +02:00
Lennart Poettering 041ea9f9bb netlink,network: drop "const" from opaque object parameters in supposed-to-be-public APIs
This drops the "const" specifier from the opaque object parameters to
various functions in our API.

This effectively reverts #19292 and more.

Why drop this? Our public APIs should not leak too much information
about how stuff is implemented internally. In our public APIs we
shouldn't give too many guarantees we don#t want to necessarily keep.
Specifically: in many cases it makes sense that getters actually
generate/parse/allocate data on the fly, storing/caching the result
internally, to speed things up, do things lazily or to track memory
allocations so that they can be freed later. Doing this means we need to
change the objects, even though the getters are semantically a read
operation.

We want to retain the freedom that we can change things around
internally. By exposing the objects as "const" we remove a good chunk of
that, for little gain.

See sd_bus_creds_get_description() for a real example of a getter that
implicitly caches and thus modifies the relevant object.

This removes the "const" decorators from sd-dhcp and sd-netlink, two
APIs that we intend to make public eventually even though they still are
not, leaving us the chance to still fix this before it becomes set in
stone.
2021-05-12 16:19:58 +09:00
Yu Watanabe 5cb76467af network: make route_configure() return all created routes 2021-05-12 11:26:06 +09:00
Yu Watanabe b19afdfef8 network: make log_route_debug() show multipath routes and Gateway=_dhcp4 or _ipv6ra 2021-05-12 11:26:06 +09:00
Yu Watanabe 76c5a0f27b network: use request queue to configure addresses, routes, and nexthops
Why is this necessary? Several examples below.

- When a route sets prefsrc, then the address must be already assigned
  (see issue #19285), and also it must be ready if IPv6.
- When a route or nexthop sets gateway, then the address must be reachable.
- When a route sets nexthop ID, then the corresponding nexthop must be
  assigned.
- When a route sets multipath routes on another interface, then the
  interface must exist and be ready to configure.
- When configuring address, the same address must not be under removing
  (see issue #18108).
Etc,. etc,...

So, this makes all requests about addresses, routes, and nethops are once
stored in the queue, and will be processed when they are ready to configure.

Fixes #18108 and #19285.
2021-05-12 11:26:06 +09:00
Yu Watanabe 40ca350ea1 network: use request queue to configure neighbors 2021-05-12 11:26:06 +09:00
Yu Watanabe 0e5ef6beb6 network: use request queue to configure routing policy rules 2021-05-12 11:26:06 +09:00
Yu Watanabe 7191a57a0e network: introduce link_is_ready_to_configure() helper function
This will be used in later commits.
2021-05-12 11:26:06 +09:00
Yu Watanabe 19d9a5adf0 network: add skeleton of request queue
This will be used in later commits.
2021-05-12 11:26:06 +09:00
Yu Watanabe 17060f02cc network: nexthop: add NextHop object before sending netlink request
Otherwise, if nexthop_add() fails, then assertion about nexthop_messages in
static_nexthop_handler() will be triggered.
2021-05-12 11:26:06 +09:00
Yu Watanabe 5a07fa9dd1 network: split out common part of route or address handlers 2021-05-12 11:26:06 +09:00
Yu Watanabe e36d601c5e network: change order of dropping network configs
As routes may requires nexthops and addresses, nexthops may requires
addresses.
2021-05-12 11:26:06 +09:00
Yu Watanabe e80509a904 network: simplify and rename routing_policy_rule_copy() 2021-05-12 11:25:55 +09:00
Yu Watanabe c0bd9eb1ed network: introduce route_dup()
The function will be used in later commits.
2021-05-12 11:22:24 +09:00
Yu Watanabe 4867b9d711 sd-netlink: introduce multipath_route_dup()
The function will be used in later commits.
2021-05-12 10:39:12 +09:00
Yu Watanabe d94e8ba021 network: introduce manager_address_is_reachable()
The function will be used in later commits.
2021-05-12 10:39:12 +09:00
Yu Watanabe 884a63d76e network: introduce link_has_route()
The function will be used in later commits.
2021-05-12 10:39:12 +09:00
Yu Watanabe e8f52f3c19 network: delay resolving interface specifier in MultiPathRoute=
The interface may not exist when .network files are loaded.
2021-05-12 10:37:17 +09:00
Yu Watanabe 591bd5f35d network: introduce manager_has_address()
The function will be used in later commits.
2021-05-12 10:30:45 +09:00
Yu Watanabe d38a6476aa ordered-set: introduce ordered_set_clear/free_with_destructor() 2021-05-12 10:30:45 +09:00
Yu Watanabe 38c116df7f hashmap,set: make hashmap_clear_with_destructor() or friends safer 2021-05-12 10:30:45 +09:00
Yu Watanabe b8ce3b4490 network: use IPV4_ADDRESS_FMT_STR/VAL macros and in6_addr_to_string() or friends 2021-05-12 10:30:45 +09:00
Yu Watanabe 280323984b in-addr-util: move IPV4_ADDRESS_FMT_STR/VAL macros from networkd-address.h 2021-05-12 10:30:45 +09:00
Yu Watanabe ae7b68db97 in-addr-util: introduce in6_addr_to_string() or friends 2021-05-12 10:30:45 +09:00
Yu Watanabe 5c97932f09 network: use in6_addr_is_link_local() or friends 2021-05-12 10:30:45 +09:00
Yu Watanabe 7ad3e90932 network: rename routing_policy_rule_configure_internal() and make it take callback 2021-05-12 10:30:45 +09:00
Yu Watanabe 3eacccf493 network: make nexthop_configure() take callback 2021-05-12 10:30:45 +09:00