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

51220 Commits

Author SHA1 Message Date
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
Zbigniew Jędrzejewski-Szmek
a2031de849 tools/make-directive-index: parallelize
I occasionally do 'build/man/man systemd.directives' when working on man pages,
and it's annoying slow. By paralellizing the parsing of xml, we can make it a
bit faster.

This is still rather innefficient. Only the parsing part is serialized, xml is
still produced serially at the end, which is hard to avoid.

$ ninja -C build man/systemd.directives.xml
before:
8.20s user 0.21s system 99% cpu 8.460 total
8.33s user 0.18s system 98% cpu 8.619 total
8.72s user 0.19s system 98% cpu 9.019 total

after:
13.99s user 0.73s system 345% cpu 4.262 total
14.15s user 0.35s system 348% cpu 4.161 total
14.33s user 0.35s system 339% cpu 4.321 total

I.e. it uses almost twice as much cpu, but cuts the wallclock time down (on a
2-core/4-thread cpu) to about half too, which is an overall win if you're just
trying to render the man page.

The change from list and .append() to set and .add() is something that could
have been done before too, but it's noticable now. It cuts down on the
serialization/deserialization time (about .2s).
2021-05-13 11:53:01 +02:00
Simon Watts
31b5be17e0 Add Microsoft Pro Intellimouse MOUSE_DPI to hwdb
- Internet specifications give 1600 DPI @ 1000Hz for this sensor
- Confirmed experimentally via `mouse-dpi-tool`
- vid, pid, and name match string from `mouse-dpi-tool`
2021-05-13 11:21:27 +02:00
Seong-ho Cho
6c041ce387
Update Korean translation (#19083)
Co-authored-by: Seong-ho Cho <shcho@gnome.org>
2021-05-13 10:19:48 +02: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
Lennart Poettering
971c07fc68 pam: fix typo try_authtok → use_authtok
This was a copy/paste mistae apparently, there's not "try_authtok" and
this was supposed to copy what Fedora uses, which uses "use_authtok"
correctly. Hence adjust this.

Fixes: #19369
2021-05-12 12:14:17 +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
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