Commit Graph

31121 Commits

Author SHA1 Message Date
Lennart Poettering dfc22cb472 bootspec: tweak error message
Clarify that the name of the entry failed validation, not the entry
itself.
2020-10-19 14:22:25 +02:00
Harald Seiler 583cef3b73 core: treat "uninitialized" in /etc/machine-id as first boot as well
When /etc/machine-id contains the string "uninitialized" instead of
a valid machine-id, treat this like the file was missing and mark this
boot as the first (-> units with ConditionFirstBoot=yes will run).
2020-10-19 12:33:39 +02:00
Michal Sekletár 3e545ae5ab udev/net_id: parse _SUN ACPI index as a signed integer
Negative value means there is no match between a PCI device and any of
the slots. In the following commit we will extend this and value of 0
will indicate that there is a match between some slot and PCI device,
but that device is a PCI bridge.
2020-10-19 12:18:03 +02:00
Anita Zhang 349a2003fd oomd: simplify if/else error check 2020-10-19 02:46:07 -07:00
Anita Zhang f561e8c659 core: move where we send unit change updates to oomd
Post-merge suggestion from #15206
2020-10-19 02:46:07 -07:00
Anita Zhang 620ed14e44 core: reindent and align table in load-fragment-gperf.gperf.m4 2020-10-19 02:46:07 -07:00
Anita Zhang 2801d36e25 core: varlink tweaks
Suggested post-merge in #15206
2020-10-19 02:46:00 -07:00
Yu Watanabe 27ff0490e6 network: rename IPv6PrefixDelegation= to IPv6SendRA= 2020-10-19 14:55:18 +09:00
Yu Watanabe 4afd986753 network: introduce Announce= in [DHCPv6PrefixDelegation]
When disabled, the delegated prefixes are not emit by RA.

Closes #17353.
2020-10-19 12:09:36 +09:00
Yu Watanabe e502f94dcf network: introduce DHCPv6PrefixDelegation= setting
Then, the link can configure prefix delegated by DHCPv6 without emitting
RA.
2020-10-19 10:09:38 +09:00
Yu Watanabe 8a08bbfc98 network: drop static prefixes and static route prefixes earlier if IPv6PrefixDelegation=no or dhcpv6 2020-10-19 10:09:38 +09:00
Yu Watanabe db5756f3f3 network: sort and rename elements in Network object 2020-10-19 10:09:38 +09:00
Yu Watanabe 69e0f833a3 network: introduce network_adjust_radv() 2020-10-19 10:09:38 +09:00
Yu Watanabe a3c1a94947 network: clear DNS and domains for RA when an empty string is assigned 2020-10-19 10:09:38 +09:00
Yu Watanabe 5e2767720a network: use string_hash_ops_free for search domains 2020-10-19 10:09:38 +09:00
Anita Zhang 3e9b4f9156 oomd: fix unit test when xattrs not supported 2020-10-16 16:19:15 -07:00
Lennart Poettering d991100291 core: log about "systemctl kill" requests
let's add informational logging about each client requested signal
sending. While we are at, let's beef up error handling/log messages in
this case quite a bit: let's log errors both to syslog and report errors
back to client.

Fixes: #17254
2020-10-16 17:21:51 +02:00
Lennart Poettering 2ae0508e6d core: correct handling of "systemctl kill --kill-who=main-fail"
--kill-who=main-fail never worked correctly, due to a copy and paste
mistake in ac5e3a505e, where the same item
was listed twice. The mistake was
later noticed, but fixed incorrectly, in
201f0c916d.

Let's list all *-fail types correctly, finally.

And while we are at it, add a nice comment and generate a prettier D-Bus
error about this.
2020-10-16 17:19:20 +02:00
Lennart Poettering 8aff7ac4a7 core: add comment explaining unit_kill_context() vs. unit_kill_common() a bit 2020-10-16 17:16:02 +02:00
Michal Koutný 0bc2f071e1 meson: Fix missing libseccomp dependencies
The builds with HAVE_SECCOMP fail on missing include paths:

FAILED: src/basic/libbasic.a.p/parse-util.c.o
cc -Isrc/basic/libbasic.a.p -Isrc/basic -I../src/basic -Isrc/boot -I../src/boot -Isrc/home -I../src/home -Isrc/shared -I../src/shared -Isrc/systemd -I../src/systemd -Isrc/journal -I../src/journal -Isrc/journal-remote -I../src/journal-remote -Isrc/nspawn -I../src/nspawn -Isrc/resolve -I../src/resolve -Isrc/timesync -I../src/timesync -I../src/time-wait-sync -Isrc/login -I../src/login -Isrc/udev -I../src/udev -Isrc/libudev -I../src/libudev -Isrc/core -I../src/core -Isrc/shutdown -I../src/shutdown -I../src/xdg-autostart-generator -I../src/libsystemd/sd-bus -I../src/libsystemd/sd-device -I../src/libsystemd/sd-event -I../src/libsystemd/sd-hwdb -I../src/libsystemd/sd-id128 -I../src/libsystemd/sd-netlink -I../src/libsystemd/sd-network -I../src/libsystemd/sd-resolve -Isrc/libsystemd-network -I../src/libsystemd-network -I. -I.. -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -std=gnu99 -g -Wno-unused-parameter -Wno-missing-field-initializers -Wno-unused-result -Wno-format-signedness -Werror=undef -Wlogical-op -Wmissing-include-dirs -Wold-style-definition -Wpointer-arith -Winit-self -Wfloat-equal -Wsuggest-attribute=noreturn -Werror=missing-prototypes -Werror=implicit-function-declaration -Werror=missing-declarations -Werror=return-type -Werror=incompatible-pointer-types -Werror=format=2 -Wstrict-prototypes -Wredundant-decls -Wmissing-noreturn -Wimplicit-fallthrough=5 -Wshadow -Wendif-labels -Wstrict-aliasing=2 -Wwrite-strings -Werror=overflow -Werror=shift-count-overflow -Werror=shift-overflow=2 -Wdate-time -Wnested-externs -Wno-maybe-uninitialized -ffast-math -fno-common -fdiagnostics-show-option -fno-strict-aliasing -fvisibility=hidden -fstack-protector -fstack-protector-strong --param=ssp-buffer-size=4 -Werror=shadow -include config.h -fPIC -pthread -fvisibility=default -MD -MQ src/basic/libbasic.a.p/parse-util.c.o -MF src/basic/libbasic.a.p/parse-util.c.o.d -o src/basic/libbasic.a.p/parse-util.c.o -c ../src/basic/parse-util.c
In file included from ../src/basic/parse-util.c:20:
../src/shared/seccomp-util.h:4:10: fatal error: seccomp.h: No such file or directory
    4 | #include <seccomp.h>
      |          ^~~~~~~~~~~
compilation terminated.

FAILED: test-parse-util.p/src_test_test-parse-util.c.o
cc -Itest-parse-util.p -I. -I.. -Isrc/basic -I../src/basic -Isrc/boot -I../src/boot -Isrc/home -I../src/home -Isrc/shared -I../src/shared -Isrc/systemd -I../src/systemd -Isrc/journal -I../src/journal -Isrc/journal-remote -I../src/journal-remote -Isrc/nspawn -I../src/nspawn -Isrc/resolve -I../src/resolve -Isrc/timesync -I../src/timesync -I../src/time-wait-sync -Isrc/login -I../src/login -Isrc/udev -I../src/udev -Isrc/libudev -I../src/libudev -Isrc/core -I../src/core -Isrc/shutdown -I../src/shutdown -I../src/xdg-autostart-generator -I../src/libsystemd/sd-bus -I../src/libsystemd/sd-device -I../src/libsystemd/sd-event -I../src/libsystemd/sd-hwdb -I../src/libsystemd/sd-id128 -I../src/libsystemd/sd-netlink -I../src/libsystemd/sd-network -I../src/libsystemd/sd-resolve -Isrc/libsystemd-network -I../src/libsystemd-network -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -std=gnu99 -g -Wno-unused-parameter -Wno-missing-field-initializers -Wno-unused-result -Wno-format-signedness -Werror=undef -Wlogical-op -Wmissing-include-dirs -Wold-style-definition -Wpointer-arith -Winit-self -Wfloat-equal -Wsuggest-attribute=noreturn -Werror=missing-prototypes -Werror=implicit-function-declaration -Werror=missing-declarations -Werror=return-type -Werror=incompatible-pointer-types -Werror=format=2 -Wstrict-prototypes -Wredundant-decls -Wmissing-noreturn -Wimplicit-fallthrough=5 -Wshadow -Wendif-labels -Wstrict-aliasing=2 -Wwrite-strings -Werror=overflow -Werror=shift-count-overflow -Werror=shift-overflow=2 -Wdate-time -Wnested-externs -Wno-maybe-uninitialized -ffast-math -fno-common -fdiagnostics-show-option -fno-strict-aliasing -fvisibility=hidden -fstack-protector -fstack-protector-strong --param=ssp-buffer-size=4 -Werror=shadow -include config.h -MD -MQ test-parse-util.p/src_test_test-parse-util.c.o -MF test-parse-util.p/src_test_test-parse-util.c.o.d -o test-parse-util.p/src_test_test-parse-util.c.o -c ../src/test/test-parse-util.c
In file included from ../src/test/test-parse-util.c:14:
../src/shared/seccomp-util.h:4:10: fatal error: seccomp.h: No such file or directory
    4 | #include <seccomp.h>
      |          ^~~~~~~~~~~
compilation terminated.

Add the respective deps.

Fixes: 005bfaf118 ("exec: Add kill action to system call filters")
2020-10-16 12:30:24 +09:00
Yu Watanabe dd82626a0d
Merge pull request #17361 from keszybz/oomd-introspection-stub
Implement --version,--bus-introspect in oomd, add man page for the dbus api
2020-10-16 12:24:37 +09:00
Lennart Poettering 6f997852c8 pid1: ignore whole /run/host hierarchy
Let's mark the whole /run/host hierarchy as something to ignore by PID 1
for generation of .mount units, i.e. consider it as "extrinsic".

By unifying container mgr supplied resources in one dir it's also easy
to exclude the whole lot from PID1's management inside the container.
This is the right thing to do, since from the payload's PoV these mounts
are just API and not manipulatable as they are established, managed and
owned by the container manager, not the payload.

(While we are it, also add the boot ID mount to the existing list, as
nspawn and other container managers overmount that too, typically, and
it is thus owned by the container manager and not the payload
typically.)
2020-10-15 17:16:36 +02:00
Zbigniew Jędrzejewski-Szmek c9a00f5a3b oomd: add names to dbus parameters and implement --bus-introspection 2020-10-15 15:03:49 +02:00
Zbigniew Jędrzejewski-Szmek ddc543bed8 oomd: check number of arguments, add --version, fix indentation 2020-10-15 15:03:07 +02:00
Zbigniew Jędrzejewski-Szmek 69c0807432
Merge pull request #15206 from anitazha/systoomd-v0
systemd-oomd
2020-10-15 14:16:52 +02:00
Lennart Poettering edfa55174b systemctl: fix tabs indentations 2020-10-15 10:56:01 +02:00
Lennart Poettering b8f736b30e pager: lets check SYSTEMD_PAGERSECURE with secure_getenv()
I can't think of any real vulnerability about this, but it still feels
better to check a variable with "secure" in its name with
secure_getenv() rather than plain getenv().

Paranoia FTW!
2020-10-15 10:54:53 +02:00
Zbigniew Jędrzejewski-Szmek cc6ceec23e
Merge pull request #17354 from dtardon/udev-cleanup
some udev cleanup
2020-10-15 08:01:01 +02:00
Zbigniew Jędrzejewski-Szmek 93a59b1ae5 sd-bus: break the loop in bus_ensure_running() if the bus is not connecting
This might fix #17025:
> the call trace is
> bus_ensure_running -> sd_bus_process -> bus_process_internal -> process_closeing --> sd_bus_close
>                                                                                  |
>                                                                                  \-> process_match

We ended doing callouts to the Disconnected matches from bus_ensure_running()
and shouldn't. bus_ensure_running() should never do callouts. This change
should fix this however: once we notice that the connection is going down we
will now fail instantly with ENOTOCONN instead of calling any callbacks.
2020-10-15 11:15:03 +09:00
Yu Watanabe 7abe175c00 network: also unref IPv4 ACD clients in Address objects
This should not change any behavior, as currently link_free_engines() is
always called after all addresses are dropped. But the function may be
used in other places in the future. So, let's also stop the clients.
2020-10-15 08:11:32 +09:00
Yu Watanabe 1c49487284 network: move link_lldp_emit_stop() to link_free_engines()
This should not change any behavior.
2020-10-15 08:06:04 +09:00
Yu Watanabe 9cc65242d7 network: also stop LLDP client in link_stop_engines() 2020-10-15 07:57:33 +09:00
Yu Watanabe 2a99eed02c network: stop DHCPv4 server in link_stop_clients()
Then, rename link_stop_clients() -> link_stop_engines().
2020-10-15 07:56:30 +09:00
Yu Watanabe a391901eb2 network: drop unnecessary conditions
sd_ipv4acd_stop() and sd_ipv4ll_stop() are idempotent.
2020-10-15 07:40:13 +09:00
Yu Watanabe c6a7531e0e network: voidify sd_ipv4acd_stop() at one place 2020-10-15 07:39:40 +09:00
Yu Watanabe 84add3cd2b network: drop conditions to check existence of each engine 2020-10-15 07:38:45 +09:00
Yu Watanabe c8bae36372 libsystemd-network: do not request each daemon exist in sd_xxx_stop() 2020-10-15 07:24:17 +09:00
Yu Watanabe 956dbf361b network: warn if dynamic gateway is specified but corresponding protocol is disabled 2020-10-15 07:07:46 +09:00
Yu Watanabe 22d37e5df6 network: introduce network_adjust_dhcp() 2020-10-15 07:06:58 +09:00
Yu Watanabe 3773eb5485 network: introduce network_adjust_ipv6_accept_ra() 2020-10-15 07:06:36 +09:00
Yu Watanabe c27abcf4fb network: when Gateway=_dhcp4, set several properties based on lease if they are not explicitly specified
Before this commit, event when Gateway=_dhcp4 or _ra is set, the
route was configured with 'protocol static', and other properties
specified by RouteTable=, RouteMTU=, or etc, were ignored.

This commit makes set the route protocol based on the protocol the
gateway address is obtained, and apply other settings if it is not
explicitly specified in the [Route] section.
2020-10-15 07:06:23 +09:00
Yu Watanabe 5bb80a4603 network: determine a [Route] section will be used or not by gateway family instead of route family
By this commit, user can configure dynamic IPv6 Gateway with IPv4
destination.
2020-10-15 07:06:03 +09:00
Yu Watanabe c3d679c43f network: when Gateway=_dhcp, assume gateway family based on other settings 2020-10-15 07:05:58 +09:00
Yu Watanabe b8caa4ef34 network: rename Gateway=_dhcp6 -> Gateway=_ipv6ra 2020-10-15 07:04:02 +09:00
Yu Watanabe 1a3a6309a7 network: rename gateway_from_dhcp -> gateway_from_dhcp_or_ra
As for IPv6 case gateway is given by RA.
2020-10-15 06:58:53 +09:00
Lennart Poettering 1008f5b069
Merge pull request #17351 from poettering/exec-rt-typo-fix
fix one character typo in execute.c
2020-10-14 19:41:27 +02:00
Lennart Poettering 21ad331873
Merge pull request #17350 from poettering/bus-read-array
sd-bus: initialize return values on success in sd_bus_message_read_ar…
2020-10-14 19:41:01 +02:00
Lennart Poettering 64a7fcc5cd bootctl: separate boot loader specific commands in man and --help
bootctl implements three types of operation: those that work with an EFI
boot loader, those which work with any EFI boot loader that implements
the boot loader spec + interface, and finally those specific to sd-boot.
Previously the --help text and the man page mixed them all up. Let's put
them clearly in three separate sections however, to communicate clearly
what is supposed to work everywhere, and what is specific to
systemd-boot or boot loaders implementing the two specs.

This adjusts wording here and there, but is mostly just about
re-ordering existing docs, and putting them under new sections.
2020-10-14 19:40:39 +02:00
David Tardon af2e52f4aa udev-rules: drop pointless cast 2020-10-14 19:31:30 +02:00
David Tardon 3b57baff7e udev-ctrl: drop workaround for old kernel bug
It's been 7 years. That should be long enough :-)

This reverts commit b97caef538.
2020-10-14 19:31:30 +02:00
Lennart Poettering 84fc961082
Merge pull request #17270 from keszybz/less-secure-mode
Use less in "secure" mode when under sudo
2020-10-14 18:33:10 +02:00
Lennart Poettering b0eb40cda4
Merge pull request #17188 from keszybz/envvars-posix
Follow (mostly) POSIX rules for environment variables
2020-10-14 18:32:22 +02:00
Zbigniew Jędrzejewski-Szmek ab4a88eb92 sd-bus: add custom return code when $XDG_RUNTIME_DIR is not set
We would return ENOENT, which is extremely confusing. Strace is not helpful because
no *file* is actually missing. So let's add some logs at debug level and also use
a custom return code. Let all user-facing utilities print a custom error message
in that case.
2020-10-14 18:28:30 +02:00
Lennart Poettering fc8bc57f6b
Merge pull request #16968 from yuwata/remove-old-device-on-move-event
core, udev: remove old device on move event
2020-10-14 17:49:37 +02:00
Lennart Poettering 6293d958a4 sd-bus: initialize return values on success in sd_bus_message_read_array()
Fixes: #17346
2020-10-14 17:35:00 +02:00
Zbigniew Jędrzejewski-Szmek 165fee860a sd-bus: add debug logs where we try to connect
When connection to the bus fails it can be mighty hard to figure out
what went wrong because we have many different connection mechanisms and
we don't log what is happenning.
2020-10-14 17:34:07 +02:00
Lennart Poettering 7848cb8c57
Merge pull request #17338 from poettering/close-range
make use of new kernel 5.9 close_range() syscall in close_all_fds()
2020-10-14 17:22:15 +02:00
Lennart Poettering 670eed4c8c core: debug log about received fds 2020-10-14 16:41:37 +02:00
Lennart Poettering 74aaf59b1a execute: make sure some more functions follow coding style
Initialize all return values on success, as our usual coding style
suggests.
2020-10-14 16:41:37 +02:00
Lennart Poettering f5fa352f1e execute: fix single character typo
Corrects: c413bb28df

Fixes: #17313
2020-10-14 16:41:37 +02:00
Yu Watanabe fd8f865c9f
Merge pull request #17342 from yuwata/network-dhcp-ipv4-acd-fixes
network: fixes several issues in IPv4 DAD for DHCP4
2020-10-14 23:12:41 +09:00
Zbigniew Jędrzejewski-Szmek 547f724f7a
Merge pull request #17267 from yuwata/hashmap_put_strdup
hashmap: make hashmap_put_strdup() take hash_ops
2020-10-14 15:05:15 +02:00
Zbigniew Jędrzejewski-Szmek 540e0bad3e
Merge pull request #17316 from yuwata/network-address-ipv4-peer-issue-17304
network: directly compare with in_addr element for IPv4 case
2020-10-14 15:02:14 +02:00
Yu Watanabe dfc637d0ff
Merge pull request #17341 from yuwata/sd-dhcp-client-fix-eexist-issue-16964
sd-dhcp: make sd_dhcp_client_set_request_option() not return -EEXIST
2020-10-14 18:55:39 +09:00
Yu Watanabe 0e569a439a network: start dynamic addressing clients like DHCP after setting netdevs
The function link_acquire_conf() may make the link state 'configuring'
when DHCP6 PD is enabled. Previously link_acquire_conf() was called
before link_enter_join_netdev(), and thus the assertion in the function
might be triggered.

Fixes #17329.
2020-10-14 10:52:02 +02:00
Lennart Poettering 59c4bbfb93 test-fd-util: add test case for close_all_fd() 2020-10-14 10:40:32 +02:00
Lennart Poettering b8cfa2da7c fd-util: port close_all_fds() to close_range() 2020-10-14 10:40:29 +02:00
Lennart Poettering 441e0fdb90 missing: add close_range() wrapper
The syscall was added in 5.9 and is not yet exposed in glibc, hence
define our own wrapper.
2020-10-14 10:40:10 +02:00
Lennart Poettering 6ea0d25c57 seccomp: allowlist close_range() by default in @basic-io 2020-10-14 10:40:06 +02:00
Lennart Poettering 562b01e996 alloc-util: avoid allocating zero size memory blocks
It's not clear what libc's make of this. We clamp to 1 byte allocations
in most cases already, let's add this for a few where this was missing.
2020-10-14 10:39:48 +02:00
Lennart Poettering a748b122be
analyze: show ungrouped syscalls separately (#17343)
This updates the "systemd-analyze syscall-filter" command to show a
special section of syscalls that are included in @known but in no other
group. Typically this should show syscalls we either should add to any
of the existing groups or where we unsure were they best fit in.

Right now, it mostly shows arch-specific compat syscalls, we probably
should move "@obsolete". This patch doesn't add thta however.
2020-10-14 10:31:59 +02:00
Zbigniew Jędrzejewski-Szmek 0a42426d79 pager: make pager secure when under euid is changed or explicitly requested
The variable is renamed to SYSTEMD_PAGERSECURE (because it's not just about
less now), and we automatically enable secure mode in certain cases, but not
otherwise.

This approach is more nuanced, but should provide a better experience for
users:

- Previusly we would set LESSSECURE=1 and trust the pager to make use of
  it. But this has an effect only on less. We need to not start pagers which
  are insecure when in secure mode. In particular more is like that and is a
  very popular pager.

- We don't enable secure mode always, which means that those other pagers can
  reasonably used.

- We do the right thing by default, but the user has ultimate control by
  setting SYSTEMD_PAGERSECURE.

Fixes #5666.

v2:
- also check $PKEXEC_UID

v3:
- use 'sd_pid_get_owner_uid() != geteuid()' as the condition
2020-10-14 10:04:12 +02:00
Yu Watanabe 5431227400 network: update MAC address in IPv4ACD client for DHCP4 2020-10-14 15:38:29 +09:00
Yu Watanabe a7df5cae54 network: also stop IPv4ACD client in link_stop_clients() 2020-10-14 15:38:29 +09:00
Yu Watanabe 66f507e1ba network: stop IPv4ACD client for DHCPv4 when lease is exprired 2020-10-14 15:38:29 +09:00
Yu Watanabe 10fa21c0dc network: move IPv4ACD client for DHCPv4 from Network to Link object
A .network file may matches multiple interfaces.
2020-10-14 15:38:29 +09:00
Yu Watanabe 8ff85383b4 network: voidify link_stop_clients() in link_enter_failed() 2020-10-14 15:38:29 +09:00
Yu Watanabe 4eb6a826b8 network: drop unused condition 2020-10-14 13:02:46 +09:00
Yu Watanabe 4081756a63 sd-dhcp-client: make sd_dhcp_client_set_request_option() not return -EEXIST
Fixes #16964.
2020-10-14 12:54:55 +09:00
Yu Watanabe a0887abbd8 sd-device: use trivial_hash_ops_free_free for managing match sysattrs or properties
This fixes an issue caused by eb1c1dc029.

Before the commit, multiple values can be specified for the same
sysattr or property.

Fixes #17259.
2020-10-13 22:45:15 +09:00
Yu Watanabe 5e71868ced util: introduce two trivial hash_ops
Will be used in a later commit.
2020-10-13 22:40:22 +09:00
Yu Watanabe 11e9fec259 hashmap: introduce {hashmap,set}_put_strdup_full()
They can take hash_ops.
2020-10-13 22:39:06 +09:00
Zbigniew Jędrzejewski-Szmek 1b5b507cd2 test-login: always test sd_pid_get_owner_uid(), modernize
A long time some function only worked when in a session, and the test
didn't execute them when sd_pid_get_session() failed. Let's always call
them to increase coverage.

While at it, let's test for ==0 not >=0 where we don't expect the function
to return anything except 0 or error.
2020-10-13 14:43:08 +02:00
Yu Watanabe b1476b5210 network: constify arguments 2020-10-13 20:30:38 +09:00
Yu Watanabe fe841414ef network: read peer address, label, broadcast from rtnl message
Then, Address objects in Network and Link can be easily compared by
address_equal().
2020-10-13 20:30:35 +09:00
Yu Watanabe 9b9c5fff16 network: directly compare with in_addr element for IPv4 case
When peer address is set, address_compare_func() (or address_equal())
does not work in link_is_static_address_configured(), as an Address object
stored in a Link does not contain peer addresses. So, we need to also
compare with in_addr element for IPv4 case.

Fixes #17304.
2020-10-13 20:30:16 +09:00
Zbigniew Jędrzejewski-Szmek a4ccce22d9 systemctl: ignore invalid variables in import-environment
When doing import-environment, we shouldn't fail if some assignment is invalid.
OTOH, if the invalid assignment is specified as a positional argument, we should
keep failing.

This would also fix https://bugzilla.redhat.com/show_bug.cgi?id=1754395, by
ignoring certain variables which are not important in that scenario. It seems
like the right thing to do in general.
2020-10-12 18:27:20 +02:00
Zbigniew Jędrzejewski-Szmek b45c068dd8 basic/env-util: (mostly) follow POSIX for what variable names are allowed
There was some confusion about what POSIX says about variable names:

   names shall not contain the character '='. For values to be portable
   across systems conforming to POSIX.1-2008, the value shall be composed
   of characters from the portable character set (except NUL and as
   indicated below).

i.e. it allows almost all ASCII in variable names (without NUL and DEL and
'='). OTOH, it says that *utilities* use a smaller set of characters:

   Environment variable names used by the utilities in the Shell and
   Utilities volume of POSIX.1-2008 consist solely of uppercase letters,
   digits, and the <underscore> ( '_' ) from the characters defined in
   Portable Character Set and do not begin with a digit.

When enforcing variable names in environment blocks, we need to use this
first definition, so that we can propagate all valid variables.
I think having non-printable characters in variable names is too much, so
I took out the whitespace stuff from the first definition.

OTOH, when we use *shell syntax*, for example doing variable expansion,
it seems enough to support expansion of variables that the shell would allow.

Fixes #14878,
https://bugzilla.redhat.com/show_bug.cgi?id=1754395,
https://bugzilla.redhat.com/show_bug.cgi?id=1879216.
2020-10-12 18:24:28 +02:00
Zbigniew Jędrzejewski-Szmek 0b3456428b test-env-util: print function headers 2020-10-12 18:23:52 +02:00
Zbigniew Jędrzejewski-Szmek 4b6f74f5a0 basic/selinux: work around mallinfo deprecation
Latest glibc has deprecated mallinfo(), so it might become unavailable at some point
in the future. There is malloc_info(), but it returns XML, ffs. I think the information
that we get from mallinfo() is quite useful, so let's use mallinfo() if available, and
not otherwise.
2020-10-12 15:51:39 +02:00
Benjamin Berg 47c1db6730 xdg-autostart: Lower most info messages to debug level
It is expected for numerous autostart files to not be convertible to
corresponding units. The information is only useful for someone
debugging why a file might not be started, but it is not generally
useful for users in most situations.

As such, lower the warnings. Anyone wondering why an application is not
started will easily notice that the unit is not generated. From there it
will be somewhat harder to figure out why, but the overall trade-off is
still improved.

Fixes: #17305
2020-10-12 11:56:09 +02:00
Lennart Poettering 5de5dc30df
Merge pull request #17302 from keszybz/fix-inhibitors
Fix inhibitors
2020-10-12 11:41:18 +02:00
Lennart Poettering 656f7f8aa5
Merge pull request #17273 from mrc0mmand/coccinelle-check-for-bad-errno
coccinelle: resolve our own macros to avoid skipping functions
2020-10-12 11:39:25 +02:00
Zbigniew Jędrzejewski-Szmek 092f5d2ed3
Merge pull request #17292 from poettering/idn-dlsym
turn libidn/libidn2 dep into dlopen() one
2020-10-10 16:25:49 +02:00
Lennart Poettering c36d5b5be9 resolved: don't append RFC6975 data to stub replies
We previously checked the QR bit to decide whether the RFC6975 algorithm
data in our packets. But that doesn't work in many cases, since we
initialize the QR flags along with the other flags usually only after
appending OPT (since success to do so propagates into flags). Hence,
let's add an explicit parameter that controls whether to include RFC6975
data in DNS packets, and set it to false for stub reply, and on true for
upstream queries.

Fixes: #17217
2020-10-10 16:22:22 +02:00
Zbigniew Jędrzejewski-Szmek 43e94f86c0 logind: fix taking of inhibitors
Ooops made in 0a9bf7fa59.
2020-10-10 09:58:47 +02:00
Zbigniew Jędrzejewski-Szmek bf135d8258 logind: print what action is ignored
My logs have lines like this:
Oct 10 09:38:38 krowka systemd-logind[1889]: External (2) displays connected.
Oct 10 09:38:38 krowka systemd-logind[1889]: Refusing operation, as it is turned off.
Without some hint *what* operation is ignored, this is not very informative.

(I remember this came up before, but I don't remember why we didn't change this
log line back then...)
2020-10-10 09:58:47 +02:00
Zbigniew Jędrzejewski-Szmek 3537577c37 tmpfiles,sysusers: disable --image= support in standalone versions
Fixes #17278.
2020-10-09 18:03:04 +02:00
Lennart Poettering 6c08f84ac6
Merge pull request #17211 from poettering/udev-loop-fixes
two udev fixes, split out of #16859
2020-10-09 17:16:07 +02:00
Lennart Poettering d2ec13fa8a
Merge pull request #17286 from benzea/benzea/xdg-autostart-improvements
XDG autostart improvements
2020-10-09 15:56:43 +02:00
mirabilos 356e9c6687 missing_syscall: fixup syscall numbers for x32 vs. amd64 2020-10-09 15:56:19 +02:00
Lennart Poettering 4917e7c727 shared: make libidn/libdidn2 dependency a dlopen() one 2020-10-09 15:47:09 +02:00
Frantisek Sumsal d46b79bbe0 tree-wide: drop if braces around single line expressions as well 2020-10-09 15:11:55 +02:00
Frantisek Sumsal d7a0f1f4f9 tree-wide: assorted coccinelle fixes 2020-10-09 15:02:23 +02:00
Lennart Poettering b8380cc67a udev: make sure to install an inotify watch whenever we find a block device locked
This fixes a race where a block device that pops up and immediately is
locked (such as a loopback device in preparation) might result in
udev never run any rules for it, and thus never turn on inotify watching
for it (as inotify watching is controlled via an option set via udev
rules), thus not noticing when the device is unlocked/closed again
(which is noticed via IN_CLOSE_WRITE inotify events).

This changes two things:

1. Whenever we encounter a locked block device we'll now inotify watch
   it, so that it is guaranteed we'll notice when the BSD lock fd is
   closed again, and will reprobe.

2. We'll now turn off inotify watching again once we realise the
   udev rules don't actually want that. Previously, once watching a
   device was enabled via a udev rule, it would be watched forever until
   the device disappeared, even if the option was dropped by the rules
   for later events.

Together this will make sure that we'll watch the device via inotify
in both of the following cases:

a) The block device has been BSD locked when udev wanted to look at it

b) The udev rules run for the last seen event for the device say so

In all other cases inotify is off for block devices.

This new behaviour both fixes the race, but also makes the most sense,
as the rules (when they are run) actually really control the watch state
now. And if someone BSD locks a block device then it should be OK to
inotify watch it briefly until the lock is released again as the user
this way more or less opts into the locking protocol.
2020-10-09 13:22:29 +02:00
Lennart Poettering e13d96ca2c udev-util: ignore remove events, we care about initialization after all 2020-10-09 13:22:25 +02:00
Lennart Poettering d156a4fa0f
Merge pull request #17289 from keszybz/two-coverity-fixes
Two coverity-inspired fixes
2020-10-09 11:56:15 +02:00
Benjamin Berg 51ac77d58c xdg-autostart: Ignore more common XDG Desktop Entry fields
It makes sense to ignore all the common fields that are expected and
that we can safely ignore. Note that it is fine to ignore URL as we will
already warn about the type= being wrong in that case.

Closes: #17276
2020-10-09 11:04:19 +02:00
Benjamin Berg d5273f51a1 xdg-autostart: Add support for Path= in XDG Desktop File
This sets the working directory of the application.
2020-10-09 11:04:19 +02:00
Lennart Poettering 2a155c53ab ratelimit: add ratelimit_configured() helper
This helper alone doesn't make too much sense, but it's preparatory work
for #17274, and I guess it can't hurt to land it early, it does make the
ratelimit code a tiny bit prettier after all.
2020-10-09 08:58:59 +02:00
Lennart Poettering 15c689d77f sd-event: check return value of syscals directly, avoid redundant variable assignment
And while we are at it, fix one incorrect error propagation.
2020-10-09 08:58:23 +02:00
Zbigniew Jędrzejewski-Szmek 081b300976 networkd: add assert to appease coverity
The code was OK, but not obviously so. Let's add an assert to help a
human or nonhuman reader figure it out.

Coverity CID#1433224.
2020-10-09 08:14:54 +02:00
Zbigniew Jędrzejewski-Szmek b4c527f4ec systemctl: fix reversed arguments in function call
This is confusing, but had no effect because the arguments were consistently
switched.

Coverity CID#1433223.
2020-10-09 08:04:25 +02:00
Lennart Poettering ba28df775d missing-syscall: fix copypasta
As noticed by @mbiebl:

5134e18eed (r43033443)
2020-10-08 13:52:44 +02:00
Michael Biebl cd20659891 basic/missing_syscall: fix syscall numbers for mips*
Thanks Christian Brauner @brauner
Fixes: #17261
2020-10-08 10:25:15 +02:00
Lennart Poettering e7bcecf0e4
Merge pull request #17279 from poettering/systemctl-split-up
systemctl: split huge .c file into smaller bits
2020-10-08 10:17:29 +02:00
Yu Watanabe 45a536980c
Merge pull request #17271 from yuwata/network-route-improve-multipath-route-support
network: improve multipath route support
2020-10-08 15:55:35 +09:00
Anita Zhang a2db02253c core: add systemd-oomd implicit dependencies 2020-10-07 17:12:24 -07:00
Anita Zhang 87e2bafff9 systemd-oomd: service files 2020-10-07 17:12:24 -07:00
Anita Zhang 5c616ecfcd systemd-oomd: dbus hook ups and oomctl CLI 2020-10-07 17:12:24 -07:00
Anita Zhang fe8d22fb09 core: systemd-oomd pid1 integration 2020-10-07 17:12:24 -07:00
Anita Zhang 9de5e32136 systemd-oomd: manager/daemon 2020-10-07 17:12:24 -07:00
Anita Zhang b41dcc51eb cgroup-util: add cg_get_attribute_as_bool() helper 2020-10-07 17:12:24 -07:00
Anita Zhang 61ff7397d0 systemd-oomd: unit testable helper functions
Helpers used by the systemd-oomd daemon to read/fill in various contexts and
make detection and kill decisions.

i.e. a simplified/less configurable version of
https://github.com/facebookincubator/oomd/tree/master/src/oomd.
2020-10-07 17:12:22 -07:00
Anita Zhang 42b83e8e33 shared: helpers to read pressure stats from cgroups 2020-10-07 16:17:24 -07:00
Anita Zhang 510ca79cf2 parse-util: add parse_loadavg_fixed_point 2020-10-07 16:17:24 -07:00
Anita Zhang e30bbc90c9 core: add varlink call to get cgroup paths of units using ManagedOOM*= 2020-10-07 16:17:23 -07:00
Anita Zhang e8e9227f5c varlink: add server write states to disconnect check
While a server is in the VARLINK_PENDING_METHOD or VARLINK_PENDING_METHOD_MORE
states and its write end is disconnected and it gets a POLLHUP, we
should disconnect since it can't write anymore.

In the case of systemd-oomd disconnecting while pid1 was pending-more, this
condition left pid1 in a state where it started throttling from
continually getting POLLHUP.
2020-10-07 16:17:23 -07:00
Anita Zhang 4d824a4e0b core: add ManagedOOM*= properties to configure systemd-oomd on the unit
This adds the hook ups so it can be read with the usual systemd
utilities. Used in later commits by sytemd-oomd.
2020-10-07 16:17:23 -07:00
Lennart Poettering daf71ef61c systemctl: split up humungous systemctl.c file
This is just some refactoring: shifting around of code, not change in
codeflow.

This splits up the way too huge systemctl.c in multiple more easily
digestable files. It roughly follows the rule that each family of verbs
gets its own .c/.h file pair, and so do all the compat executable names
we support. Plus three extra files for sysv compat (which existed before
already, but I renamed slightly, to get the systemctl- prefix lik
everything else), a -util file with generic stuff everything uses, and a
-logind file with everything that talks directly to logind instead of
PID1.

systemctl is still a bit too complex for my taste, but I think this way
itc omes in a more digestable bits at least.

No change of behaviour, just reshuffling of some code.
2020-10-07 23:12:15 +02:00
Lennart Poettering 4dcc0653b5 systemctl: move compare_unit_info() to bus-unit-util.[ch]
It's an auxiliary function to the UnitInfo structures, and very generic.
Let's hence move it over to the other code operating with UnitInfo, even
if it's not used by code outside of systemctl (yet).
2020-10-07 22:19:37 +02:00
Lennart Poettering e2d839d316 pretty-print: don't abbreviate needlessly in user-facing string 2020-10-07 22:19:33 +02:00
Lennart Poettering 0f2219bb8f basic: include stddef.h since we use NULL in header 2020-10-07 22:19:10 +02:00
Yu Watanabe ceea6c1aff network: introduce IPV4_ADDRESS_FMT_STR macro
This also moves ADDRESS_FMT_VAL() macro to networkd-address.h, and
renames it to IPV4_ADDRESS_FMT_VAL().
2020-10-08 02:51:23 +09:00
Yu Watanabe d442bb3728 network: make Gateway= in [Route] section accept an empty string 2020-10-08 02:51:23 +09:00
Yu Watanabe d306d1d0ca network: introduce Gateway=_dhcp4 and _dhcp6, and deprecate "_dhcp"
Fixes #17249.
2020-10-08 02:51:23 +09:00
Yu Watanabe bff94a84c2 util: make local_gateways() support RT_VIA and RT_MULTIPATH
Then, `networkctl status` correctly shows gateways.
2020-10-08 02:51:23 +09:00
Yu Watanabe f9bb333832 network: manage multipath routes separately 2020-10-08 02:51:23 +09:00
Yu Watanabe de52a83cb7 sd-netlink: introduce sd_netlink_message_read_data() 2020-10-08 02:51:23 +09:00
Yu Watanabe 2fe1d557e5 sd-netlink: introduce rtattr_read_nexthop() 2020-10-08 02:51:23 +09:00
Yu Watanabe d6ad41e27d network: free Route object when route_remove() fails
When route_remove() succeeds, the Route object will be freed later by
manager_rtnl_process_route().
2020-10-08 02:51:23 +09:00
Yu Watanabe 423c249c2e network: constify arguments 2020-10-08 02:51:23 +09:00
Renaud Métrich 5177cb0a9a unit: don't emit PropertiesChanged signal if adding a dependency to a unit is a no-op 2020-10-07 18:16:08 +02:00
Yu Watanabe 6dd5398137 network: support IPv4 route with IPv6 gateway 2020-10-08 00:06:19 +09:00
Yu Watanabe 2c59a8a624 sd-netlink: fix type of RTA_VIA 2020-10-07 15:22:10 +02:00
Yu Watanabe ad208fac73 network: also manage routes without RTA_OIF attribute 2020-10-07 15:22:10 +02:00
Yu Watanabe fd7701bf31 network: ignore Scope= for IPv6 routes as it will not be used 2020-10-07 15:22:10 +02:00
Yu Watanabe 8973df5c42 network: set default priority for IPv6 routes
See inet6_rtm_newroute() in kernel's net/ipv6/route.c.
2020-10-07 15:22:09 +02:00
Yu Watanabe b2f61e0da0 basic: import linux/ipv6_route.h 2020-10-07 15:22:09 +02:00
Yu Watanabe 473a64e569 meson: add missing files 2020-10-07 15:22:09 +02:00
Lennart Poettering b8aaceb9b5 systemctl: drop unsused variable original_stdout_is_tty
Unused since de9a8fe18e.
2020-10-07 14:13:19 +02:00
Lennart Poettering 1378ac6989
Merge pull request #17231 from poettering/event-source-exit-on-failure
sd-event: add "exit-on-failure" feature for event source
2020-10-07 12:55:56 +02:00
Zbigniew Jędrzejewski-Szmek 206178a9d2 Document some reasonable DNS servers in the example config file
We have an option to set the fallback list, so we don't know what the contents
are. It may in fact be empty. Let's add some examples to make it easy for a user
stranded without any DNS to fill in something that would work. As a bonus, this
also gives names to the entries we provide by default.
(I added google and cloudflare because that's what we have currently, and quad9
because it seems to be a good privacy-concious and fast choice and was requested
in #12499. As a minimum, things we should include should be well-known global
services with a documented privacy policy and both IPv4 and IPv6 support and
decent response times.)
2020-10-07 11:38:07 +02:00
Lennart Poettering cbda8bd5fb udev: make use of NULL callback in IO handlers 2020-10-07 09:40:32 +02:00
Lennart Poettering b9350e70aa sd-event: support callback=NULL in IO/child/inotify/defer event sources, too
Also, document this functionality more prominently, including with a
reference from sd_event_exit().

This is mostly to make things complete, as previously we supported NULL
callbacks only in _add_time() and _add_signal(). However, I think this
makes snese for IO event sources too (think: when some fd such as a pipe
end sees SIGHUP or so, exit), as well as defer or post event sources (i.e. exit
once we got nothing else to do). This also adds support for inotify
event sources, simply to complete things (I can't see the immediate use,
but maybe someone else comes up with it).

The only event source type that doesn't allow callback=NULL now are exit
callbacks, but for them they make little sense, as the event loop is
exiting then anyway.
2020-10-07 09:40:16 +02:00
Lennart Poettering bac0bfc1d0 udev-util: make use of sd-event's NULL callback support 2020-10-07 09:40:12 +02:00
Lennart Poettering 463f9ce3bc test: add test that validates that PTR_TO_INT(INT_TO_PTR()) covers whole int range 2020-10-07 09:40:09 +02:00
Lennart Poettering ccaa30c199 socket-proxy: port to new sd_event_source_set_exit_on_failure() API 2020-10-07 09:40:05 +02:00
Lennart Poettering 76c59537f3 socket-proxy: close correct fd, log at right log level 2020-10-07 09:40:02 +02:00
Lennart Poettering b778cba4bf sd-event: optionally, if an event source fails, exit the event loop
Currently, if an event source callback returns an error, we'll disable
the event source and continue. This adds a per-event source flag that if
turned on goes further: the event loop is also exited, propagating the
error code.

This is inspired by some patterns repeatedly seen in #15206.

The idea is that event sources that server the "primary" function of a
program are marked like this, so that if they fail the failure is
instantly propagated and terminates the program.
2020-10-07 09:38:41 +02:00
Lennart Poettering 612ebf6c91 pager: set $LESSSECURE whenver we invoke a pager
Some extra safety when invoked via "sudo". With this we address a
genuine design flaw of sudo, and we shouldn't need to deal with this.
But it's still a good idea to disable this surface given how exotic it
is.

Prompted by #5666
2020-10-07 09:23:07 +02:00
Yu Watanabe ab582fda48
Merge pull request #17240 from yuwata/network-cleanup
network: several cleanups and fix IPv4DAD and IP Masqurade
2020-10-07 07:42:40 +09:00
Marco Wang ee85122987 boot/efi: Explicitly specify void in parameter list
Functions that accept no arguments should be
explicitly declared a void parameter in their parameter list.

Signed-off-by: Marco Wang <m.aesophor@gmail.com>
2020-10-06 22:29:57 +02:00
Yu Watanabe 13ffa39f8e network: rename network_verify_xxx() -> network_drop_invalid_xxx()
As 'verify' implies a boolean result.
2020-10-07 03:22:03 +09:00
Yu Watanabe 494b6b43cb network: fix masquerade setting logic
Previously, address_establish() took Address object stored in Network
object. And address_release() took Address object stored in Link
object. Thus, address_release() always did nothing.
2020-10-07 03:13:26 +09:00
Yu Watanabe cd1caf30c0 network: always use RT_SCOPE_HOST for IPv4 loopback addresses
For IPv6 case, use RT_SCOPE_HOST only when scope is not explicitly specified.
2020-10-07 03:13:18 +09:00
Yu Watanabe d93d655c40 network: update MAC address in IPv4 ACD clients
When the MAC address of a link is updated, an address on the link may
be under checking address duplication. Or, (currently such code is not
implemented yet, but) address duplication check may be restarted later.
For that case, the IPv4 ACD clients must use the new updated MAC address.
2020-10-07 02:59:34 +09:00
Yu Watanabe 490ccbd5e5 network: configure IPv4 DAD per link address
Previously, IPv4 DAD is configured in each Address object stored in
Network object. If a .network file matches multipe links, then it causes
an assertion. To prevent it, now IPv4 DAD is configured in each Address
object belogs to Link object.
2020-10-07 02:57:58 +09:00
Yu Watanabe 693ec5ca83 network: constify one argument 2020-10-07 02:57:54 +09:00
Yu Watanabe cde1f0e8fc network: introduce address_copy() 2020-10-07 02:54:01 +09:00
Yu Watanabe eaff204f09 network: do not update Address::flags in address_configure() 2020-10-07 02:50:51 +09:00
Yu Watanabe f5ee7d74af network: fix indentation 2020-10-07 02:50:51 +09:00
Yu Watanabe 4cf8500067 network: use sd_event stored in Manager 2020-10-07 02:50:51 +09:00
Yu Watanabe 2ffd6d73f9 network: check feature is enabled in xxx_configure() 2020-10-07 02:50:51 +09:00
Yu Watanabe 51f5dfd8ba network: move link_enumerate_ipv6_tentative_addresses() 2020-10-07 02:50:51 +09:00
Yu Watanabe acc9fc2f51 network: drop unused function 2020-10-07 02:50:51 +09:00
Yu Watanabe 5e0534f1c1 network: move sysctl related functions to networkd-sysctl.c 2020-10-07 02:50:51 +09:00
Yu Watanabe be9363ccab network: introduce radv_update_mac() 2020-10-07 02:50:51 +09:00
Yu Watanabe eebba6dc24 network: introduce dhcp6_update_mac() 2020-10-07 02:50:51 +09:00
Yu Watanabe d947f7f977 network: introduce dhcp4_update_mac() 2020-10-07 02:50:50 +09:00
Yu Watanabe a3adb4a6a2 network: introduce ipv4ll_update_mac() 2020-10-07 02:50:50 +09:00
Yu Watanabe 5460bde5c5 network: introduce link_serialize_dhcp6_client() 2020-10-07 02:50:50 +09:00
Yu Watanabe ca21a19a2e network: introduce link_serialize_ipv4ll() 2020-10-07 02:50:50 +09:00
Yu Watanabe daad60d19e network: introduce link_deserialize_ipv4ll() 2020-10-07 02:50:50 +09:00
Yu Watanabe 571eeba909 network: introduce link_deserialize_dhcp4() 2020-10-07 02:50:50 +09:00
Yu Watanabe bbe694f91f network: introduce network_verify_sr_iov() 2020-10-07 02:50:50 +09:00
Yu Watanabe f3a3ff2762 network: move link_configure_sr_iov() 2020-10-07 02:50:50 +09:00
Yu Watanabe 209af9a67a network: introduce network_verify_traffic_control() 2020-10-07 02:50:50 +09:00
Yu Watanabe 200543791a network: move link_configure_traffic_control() 2020-10-07 02:50:50 +09:00
Yu Watanabe 34d7f2c99e network: merge link_set_bridge_vlan() and br_vlan_configure() 2020-10-07 02:50:50 +09:00
Yu Watanabe 256c75fd1f network: move DUID related functions 2020-10-07 02:50:50 +09:00
Yu Watanabe 086b8853d1 network: move link_radv_enabled() 2020-10-07 02:50:50 +09:00
Yu Watanabe 5ae0fb7fb7 network: move link_dhcp4_server_enabled() 2020-10-07 02:50:50 +09:00
Yu Watanabe 062c020fb6 network: move link_ipv6_accept_ra_enabled() 2020-10-07 02:50:50 +09:00
Yu Watanabe 6f7a17ff0c network: unify link_ipv{4,6}_forward_enabled() 2020-10-07 02:50:50 +09:00
Yu Watanabe 67c311abd3 network: unify link_dhcp{4,6}_enabled() 2020-10-07 02:50:50 +09:00
Yu Watanabe ac49887e8c network: move link_get_xxx_route_table() 2020-10-07 02:50:50 +09:00
Yu Watanabe bfbf150ee6 network: manage address pools by OrderedSet 2020-10-07 02:50:50 +09:00
Yu Watanabe 3fe721c674 network: drop unused argument 2020-10-07 02:50:50 +09:00
Yu Watanabe ed76f58521 network: move functions related to address pool 2020-10-07 02:50:50 +09:00
Yu Watanabe 093e35334d network: header cleanup 2020-10-07 02:50:50 +09:00
Yu Watanabe 67a58eb378 network: make several functions static 2020-10-07 02:50:50 +09:00
Yu Watanabe aa651e88de network: manage addresses from pool by Set 2020-10-07 02:50:50 +09:00
Yu Watanabe 9cd9fc8f44 network: drop list of static addresses
[Address] sections are managed by both LIST and Hashmap. Let's drop the
list and manage them by OrderedHashmap.
2020-10-07 02:50:50 +09:00
Yu Watanabe 7818f8589a network: make address_free() return NULL 2020-10-07 02:50:50 +09:00
Yu Watanabe 2488e4d934 network: introduce link_stop_ipv4_dad() 2020-10-07 02:50:50 +09:00
Yu Watanabe b87d6a8284 network: move link_configure_ipv4_dad() 2020-10-07 02:50:50 +09:00
Yu Watanabe da4d3a612d network: introduce link_deserialize_addresses() 2020-10-07 02:50:50 +09:00
Yu Watanabe 3b31e2b718 network: introduce link_serialize_addresses() 2020-10-07 02:50:50 +09:00
Yu Watanabe 32400c2ff0 network: introduce network_verify_addresses() 2020-10-07 02:50:50 +09:00
Yu Watanabe 9a0ad16b26 network: update log messages
And drop unnecessary log for in_addr_to_string(), as its result is used
only for the consequent logs.
2020-10-07 02:49:17 +09:00
Yu Watanabe e1fc2c4371 network: move manager_rtnl_process_address() 2020-10-07 02:44:43 +09:00
Yu Watanabe d7fbb9f50c network: introduce link_drop_addresses() 2020-10-07 02:44:43 +09:00
Yu Watanabe f8f2f880d4 network: introduce link_drop_foreign_addresses() 2020-10-07 02:44:43 +09:00
Yu Watanabe 682c65b04c network: introduce link_set_addresses() 2020-10-07 02:44:43 +09:00
Yu Watanabe e2263711ba network: cleanup networkd-route.h 2020-10-07 02:44:43 +09:00
Yu Watanabe 2a54a0446b network: drop list of static routes
[Route] sections are managed by both LIST and Hashmap. Let's drop the
list.
2020-10-07 02:44:43 +09:00
Yu Watanabe 833f3663a0 network: introduce hashmap_find_free_section_line() 2020-10-07 02:44:43 +09:00
Yu Watanabe 74154c2e28 network: make several functions static 2020-10-07 02:44:43 +09:00
Yu Watanabe d9940a3f8a network: introduce network_verify_routes() 2020-10-07 02:44:42 +09:00
Yu Watanabe 565194127a network: introduce link_serialize_routes() 2020-10-07 02:44:42 +09:00
Yu Watanabe 731ff05b32 network: introduce link_deserialize_routes() 2020-10-07 02:44:42 +09:00
Yu Watanabe 62f0ea5fae network: introduce link_drop_routes() 2020-10-07 02:44:42 +09:00
Yu Watanabe 779804dd60 network: introduce link_drop_foreign_routes() 2020-10-07 02:44:42 +09:00
Yu Watanabe 169948e9d2 network: make route_free() return NULL 2020-10-07 02:44:42 +09:00
Yu Watanabe 4468f01b67 network: move manager_rtnl_process_route() 2020-10-07 02:44:42 +09:00
Yu Watanabe 141318f777 network: move link_request_set_routes() 2020-10-07 02:44:42 +09:00
Yu Watanabe be023c670b network: make network_get_ipv6_dns() always set return value on success 2020-10-07 02:44:42 +09:00
Yu Watanabe a8d4a21091 network: fix indentation 2020-10-07 02:44:42 +09:00
Yu Watanabe b5ce40472c network: cleanup networkd-radv.h 2020-10-07 02:44:42 +09:00
Yu Watanabe 1a7deb2fcf network: introduce network_verify_prefix() and network_verify_route_prefix() 2020-10-07 02:44:42 +09:00
Yu Watanabe d30081c24e network: also check route prefixes are configured 2020-10-07 02:44:42 +09:00
Yu Watanabe ecb0e85ea9 network: drop redundant list of prefixes and route prefixes 2020-10-07 02:44:42 +09:00
Yu Watanabe 064dfb05f0 network: make prefix_free() and route_prefix_free() return NULL 2020-10-07 02:44:42 +09:00
Yu Watanabe 87851e0feb network: warn if IPv6ProxyNDPAddress= is set and IPv6ProxyNDP= is disabled 2020-10-07 02:44:42 +09:00
Yu Watanabe fd773a11d8 network: propagate errors in ipv6_proxy_ndp_set()
And ignore IPv6ProxyNDPAddress= settings if proxy_ndp is zero.
2020-10-07 02:44:42 +09:00
Yu Watanabe 5823a48993 network: drop networkd-ipv6-proxy-ndp.h from networkd-network.h 2020-10-07 02:44:42 +09:00
Yu Watanabe c16b58217a network: rename ipv6_proxy_ndp_addresses_configure() -> link_set_ipv6_proxy_ndp_addresses() 2020-10-07 02:44:42 +09:00
Yu Watanabe d349f5026e network: drop struct IPv6ProxyNDPAddress
Its only important value is in6_addr. So, let's just use struct in6_addr
and drop IPv6ProxyNDPAddress.
2020-10-07 02:44:42 +09:00
Yu Watanabe a8c82f90e7 network: move functions 2020-10-07 02:44:42 +09:00
Yu Watanabe dbf6319691 network: cleanup networkd-mdb.h 2020-10-07 02:44:42 +09:00
Yu Watanabe ee4522ce86 network: introduce network_verify_mdb_entries() 2020-10-07 02:44:42 +09:00
Yu Watanabe 03c9738e1d network: drop list of bridge MDB entries
[BridgeMDB] sections are managed by LIST and Hashmap, and they contins
the completely same information. Let's drop the list.
2020-10-07 02:44:42 +09:00
Yu Watanabe 8c06da1cd1 network: move mdb_entry_free() and friends 2020-10-07 02:44:42 +09:00
Yu Watanabe ee446d57b8 network: cleanup networkd-fdb.h 2020-10-07 02:44:42 +09:00
Yu Watanabe 75ffb011b0 network: drop unused fdb_ntf_flags_to_string() 2020-10-07 02:44:42 +09:00
Yu Watanabe e6ad630d77 network: introduce network_verify_fdb_entries() 2020-10-07 02:44:42 +09:00
Yu Watanabe 5bb4542b0c network: move link_set_bridge_fdb() 2020-10-07 02:44:42 +09:00
Yu Watanabe 62ed9442bf network: drop list of bridge FDB entries
[BridgeFDB] sections are managed by both LIST and Hashmap, and they
contains the completely same information. Let's drop the list.
2020-10-07 02:44:42 +09:00
Yu Watanabe df3a18f87f network: make fdb_entry_free() return NULL 2020-10-07 02:44:42 +09:00