1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-01 09:21:26 +03:00
Commit Graph

51455 Commits

Author SHA1 Message Date
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
75e0990874 docs/HACKING: wrap long lines 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
932e157b5e test-network: wait for the interfaces are configured after reloading .network files 2021-05-12 11:26:06 +09:00
Yu Watanabe
1ef2eedce7 test-network: wait for the intreface is configured if it is expected 2021-05-12 11:26:06 +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
Yu Watanabe
7575e1f42d network: make neighbor_configure() take callback 2021-05-12 10:30:45 +09:00
Yu Watanabe
0653649202 tree-wide: refuse too long strings earlier in specifier_printf()
We usually call specifier_printf() and then check the validity of
the result. In many cases, validity checkers, e.g. path_is_valid(),
refuse too long strings. This makes specifier_printf() refuse such
long results earlier.

Moreover, unit_full_string() and description field in sysuser now
refuse results longer than LONG_LINE_MAX. config_parse() already
refuses the line longer than LONG_LINE_MAX. Hence, it should be ok
to set the same value as the maximum length of the resolved string.
2021-05-12 10:26:07 +09:00
Yu Watanabe
678d6b4f92 dns-domain: use DNS_LABEL_MAX at one more place 2021-05-12 10:21:22 +09:00
Yu Watanabe
3d862ff066 creds-util: introduce CREDENTIAL_NAME_MAX 2021-05-12 10:20:47 +09:00
Yu Watanabe
ae3f4bae68 fd-util: introduce FDNAME_MAX 2021-05-12 10:19:19 +09:00
Yu Watanabe
6001df6594 gpt: introduce GPT_LAVEL_MAX 2021-05-12 10:16:36 +09:00
Yu Watanabe
f4767dc081 test: move test_specifier_printf() to test-specifier.c 2021-05-12 10:09:11 +09:00
Yu Watanabe
695c5fee6d specifier: rename variable 2021-05-12 10:09:11 +09:00
Yu Watanabe
567097848c specifier: use SD_ID128_STRING_MAX 2021-05-12 10:09:11 +09:00
Lennart Poettering
d65e974e67 core: don't accidentally unref a varlink connection twice
Let's make sure that our close handler unrefs a connection again that we
are already unreffing a few stack frames up by invalidating the pointer
first, and dropping the ref counter only after that.

Replaces: 39ad3f1c09

Fixes: #18025
2021-05-11 21:45:32 +02:00
Lennart Poettering
cc6b0a18ff Revert "varlink: avoid using dangling ref in varlink_close_unref()"
This reverts commit 39ad3f1c09.
2021-05-11 21:45:32 +02:00
Lennart Poettering
11ab01e439 cgroup: drop explicit NULL comparisons 2021-05-11 15:42:47 +02:00
Lennart Poettering
a67abc490b tree-wide: move variables to innermost scope 2021-05-11 15:42:46 +02:00