Commit Graph
100 Commits
Author SHA1 Message Date
Yu Watanabe bbb7a0e6ed sd-varlink: make the argument type consistent with header 2024-08-28 05:35:07 +09:00
Yu Watanabe 44eee910c0 Merge pull request #34124 from YHNdnzj/socket-accept-name
core: honor FileDescriptorName= too for Accept=yes sockets, plus several other cleanups
2024-08-27 12:11:20 +09:00
Yu Watanabe 57bdb24f9d NEWS: mention "resolvconf -p" 2024-08-27 05:42:34 +09:00
Yu Watanabe 80e038221b test: add more test cases for resolvconf 2024-08-27 05:37:34 +09:00
Yu Watanabe 374825ec05 resolvconf: disable default route when -p is specified
Internally, the switch triggers 'resolvectl default-route INTERFACE no'.

Closes #34112.
2024-08-27 05:30:06 +09:00
Yu Watanabe 189cb2b15f resolvconf: clear domains if nothing specified 2024-08-27 05:23:12 +09:00
Yu Watanabe b3102c05e1 resolvectl: make enum name consistent with the option name 2024-08-27 05:17:52 +09:00
Yu Watanabe 36f6e87dd3 man: reword about default route for DNS traffic
DefaultRoute is a D-Bus property, not a valid setting name in .network
files nor resolved.conf.
Whether a link is the default route or not is configured with
DNSDefaultRoute= setting in .network files.
2024-08-26 11:14:26 +01:00
Yu Watanabe b1fc342cdd Merge pull request #34120 from weblate/weblate-systemd-main
Translations update from Fedora Weblate
2024-08-25 21:28:53 +09:00
Yu Watanabe 605377e7b3 network/routing-policy-rule: use config_parse_routing_policy_rule() more
Then, we can drop allocation of RoutingPolicyRule object in each conf
parsers.

No functional change, just refactoring.
2024-08-25 06:25:07 +09:00
Yu Watanabe 7f66a94ecf network/routing-policy-rule: introduce a generic conf-parser for [RoutingPolicyRule] sectin
This introduce config_parse_routing_policy_rule(), which wraps existing
conf parsers. With this, we can drop many custom conf parsers for
[RoutingPolicyRule], and can reuse generic conf parsers in conf-parser.[ch].
2024-08-25 06:19:51 +09:00
Yu Watanabe f7a1e57e1f conf-parser: move config_parse_ip_protocol() from network/netdev/fou-tunnel.c
The function is generic enough. Currently it is used at only one place.
But it will be used at another place.
2024-08-25 06:18:46 +09:00
Yu Watanabe 6db311fdc8 conf-parser: introduce config_parse_uint32_flag()
This is not used currently, but will be used later.
2024-08-25 06:18:37 +09:00
Yu Watanabe f4810fe237 conf-parser: return 1 on success
Typically, conf parsers will ignore most errors during parsing strings
and return 0. Let's return 1 on success. Otherwise it is hard to reused
these function in another conf parser.
2024-08-25 06:18:30 +09:00
Yu Watanabe 83c187f585 parse-util: drop unused parse_ip_prefix_length() 2024-08-25 06:18:30 +09:00
Yu Watanabe 74601abcdd network/routing-policy-rule: merge two conf parsers
Both conf parsers takes an integer. Only difference is the maximum
value. Let's merge them, and pass the maximum value through ltype.
2024-08-25 06:17:05 +09:00
Yu Watanabe 78ff6156d1 network/routing-policy-rule: trivial cleanups for conf-parsers
No functional change, just refactoring.
2024-08-25 06:16:29 +09:00
Yu Watanabe e0978eb8cf network/routing-policy-rule: rename n -> rule 2024-08-25 05:38:05 +09:00
Yu Watanabe 07561ff414 Merge pull request #34115 from weblate/weblate-systemd-main
Translations update from Fedora Weblate
2024-08-25 02:14:37 +09:00
Yu Watanabe 4e03518b16 Merge pull request #34111 from yuwata/log_section_full_errno
network: introduce log_section_full_errno() and friends, and use them
2024-08-24 08:31:02 +09:00
Yu Watanabe b0e6c3261c Merge pull request #34110 from yuwata/network-routing-policy-cleanups
network/routing-policy-rule: assorted trivial cleanups
2024-08-24 08:30:48 +09:00
Yu Watanabe 4388efca4a network/routing-policy-rule: use log_section_warning_errno() 2024-08-24 00:05:49 +09:00
Yu Watanabe 75f59c6ea5 conf-parser: introduce log_section_full_errno() and friends 2024-08-24 00:05:49 +09:00
Yu Watanabe 5dc74c6667 test-network: check one more rule we configure 2024-08-23 23:57:17 +09:00
Yu Watanabe 361f70f707 network/routing-policy-rule: read FRA_PROTOCOL afer reading other properties
No functional change, just refactoring.
2024-08-23 23:57:17 +09:00
Yu Watanabe 21719d67c1 network/routing-policy-rule: add more assertions 2024-08-23 23:57:17 +09:00
Yu Watanabe 18c9e9acd5 network/routing-policy-rule: sort conf-parser prototypes 2024-08-23 23:57:13 +09:00
Yu Watanabe 407d91d872 labeler: support varlink tag 2024-08-23 16:46:16 +02:00
Yu Watanabe 5537e4417c updatectl: fix typo and drop space in empty lines
Follow-ups for ec15bb71c2 (#32363).
2024-08-23 23:10:24 +09:00
Yu Watanabe a4db21c856 Merge pull request #34108 from mrc0mmand/update-translation-files
po: update translation files
2024-08-23 23:07:57 +09:00
Yu Watanabe d8e298c497 Merge pull request #34102 from yuwata/udev-net_id
udev/net_id: trivial cleanups
2024-08-23 18:06:06 +09:00
Yu Watanabe b9142e2ba7 udevadm/test,test-builtin: enable debugging logs by default again
The lines were mistakenly dropped by
aa976d8788.
2024-08-23 17:34:14 +09:00
Yu Watanabe 02b88d6c62 udev/net_id: update log messages
This also downgrades the log level of a message to debug.
2024-08-23 10:21:11 +09:00
Yu Watanabe 8c6f484595 udev/net_id: move naming scheme check
We usually do not set r = -1 when a functionality is disabled or not
supported. Even though the error code is not used, let's set a negative
errno in such case.

No functional change, just refactoring.

Follow-up for 0a4ecc54cb.
2024-08-23 10:20:56 +09:00
Yu Watanabe ab61b8865b test: use ASSERT_EQ_ID128() and ASSERT_NE_ID128() 2024-08-23 10:18:08 +09:00
Yu Watanabe b6b9ddb2b5 Merge pull request #34087 from DaanDeMeyer/nspawn-init-revert
Revert "nspawn: Allow specifying custom init program"
2024-08-23 07:42:16 +09:00
Yu Watanabe 6b0561d86a Merge pull request #34092 from poettering/ambient-caps-fixup
minor tweaks to the recent ambient caps rework
2024-08-23 06:41:45 +09:00
Yu Watanabe a3b571b2cc Merge pull request #34096 from YHNdnzj/logind-followup-256
logind: two follow-ups
2024-08-23 05:38:18 +09:00
Yu Watanabe ce4c4f4c32 Merge pull request #34097 from YHNdnzj/journal-browse-prepare
shared/logs-show: introduce journal_browse_prepare()
2024-08-23 05:25:19 +09:00
Yu Watanabe 80c9c81779 Merge pull request #34051 from rpigott/resolved-demote-fallback
resolved: demote only the fallback servers in the global scope
2024-08-22 20:21:33 +09:00
Yu Watanabe 04de947eea Merge pull request #34079 from AdrianVovk/sysupdate-fixups
systemd-sysupdated follow-ups
2024-08-22 13:59:55 +09:00
Yu Watanabe 595bd7083d labeler: add more rules 2024-08-22 01:38:51 +02:00
Yu Watanabe 00ed8c6dfa Merge pull request #34072 from yuwata/networkd-routing-policy-rule-follow-up
network/routing-policy-rule: follow up for recent change
2024-08-22 07:17:10 +09:00
Yu Watanabe 20a5465640 po: update Japanese translations 2024-08-22 07:10:47 +09:00
Yu Watanabe cd67b61ff1 polkit: add missing period in messages 2024-08-22 07:08:05 +09:00
Yu Watanabe e1c9c44e95 po: update Japanese translations 2024-08-22 05:03:24 +09:00
Yu Watanabe 2ddf5bdece Merge pull request #34053 from YHNdnzj/follow-ups
Two follow-ups for recent PRs
2024-08-22 04:34:11 +09:00
Yu Watanabe 26823f980d hwdb: rename hwdb_bin_paths -> HWDB_BIN_PATHS
We usually use upper letters for constant definitions.
2024-08-22 04:26:07 +09:00
Yu Watanabe cd2a1e2df9 test-network: also test routing policy rules are configured as expected after reconfiguration
For issue #34068.
2024-08-22 04:21:02 +09:00
Yu Watanabe 462be8c957 test-network: find routing policy rule by priority
We usually configure a test rule with a unique priority. Hence, finding
rule by priority reduces the lines of output, and we can debug easily.

Also print short comments on check. That's helpful when the check is
called several times.
2024-08-22 04:16:12 +09:00
Yu Watanabe 04d10fdb1d network/routing-policy-rule: use address family of existing rule when judging if existing rule can be updated
Otherwise, the other RoutingPolicyRule object may not have a valid
address family yet, and the existing rule may be wrongly handled as
that it is not requested by any interface, and it may be removed.

Follow-up for 727235006a.
Fixes #34068.
2024-08-22 04:11:52 +09:00
Yu Watanabe a3e4dc6762 Merge pull request #34055 from whot/wip/eviocrevoke-warnings
Update warnings for failed EVIOCREVOKE invocations
2024-08-22 01:34:35 +09:00
Yu Watanabe 2276483a7d Merge pull request #34054 from yuwata/network-failed-state
network: several fixlets for reconfiguration after entered failed state
2024-08-22 01:22:29 +09:00
Yu Watanabe 1bf49198b5 networkctl: split networkctl.c into small pieces
No functional change, just refactoring.
2024-08-22 01:12:39 +09:00
Yu Watanabe 7321a87b53 network/ipv4acd: adjust comment and logging 2024-08-21 11:45:57 +09:00
Yu Watanabe 22c864d885 sd-dhcp-client: actually restart daemon after sending DECLINE message
client_stop() sets DHCP_STATE_STOPPED to client->state, thus the server
never restarted.
2024-08-21 11:45:57 +09:00
Yu Watanabe 2bb7559ade sd-dhcp-client: stop client without calling notification after sending RELEASE
Otherwise, even the acquired lease is released, the client may be in
e.g. BOUND state or so, and may send renew or rebind after timeout
later.
2024-08-21 11:43:59 +09:00
Yu Watanabe f8cdd37d0a sd-dhcp-client: refuse to send RELEASE or friends gracefully when the daemon is stopped or so
We can easily hit the assertions without checking the internal states of
the DHCP client before calling these functions. That's annoying.
Let's do more gracefully.
2024-08-21 11:34:50 +09:00
Yu Watanabe e5b19cbed2 sd-dhcp-client: do not call callback with SD_DHCP_CLIENT_EVENT_STOP if already stopped
When an interface enters the failed state, even if the DHCP client is
stopped, the acquired DHCP lease is not unreferenced, as the callback
dhcp4_handler() do nothing in that case. When the failed interface is
being reconfigured after that, the DHCP client is stopped again
(though it is already stopped), and SD_DHCP_CLIENT_EVENT_STOP event is
triggered and sd_dhcp_client_send_release() is called, and the
assertion in the function is triggered.

E.g.
===
systemd-networkd[98588]: wlp59s0: DHCPv4 address 192.168.86.250/24, gateway 192.168.86.1 acquired from 192.168.86.1
systemd-networkd[98588]: wlp59s0: Could not set DHCPv4 route: Nexthop has invalid gateway. Network is unreachable
systemd-networkd[98588]: wlp59s0: Failed
systemd-networkd[98588]: wlp59s0: State changed: configuring -> failed
systemd-networkd[98588]: wlp59s0: The interface entered the failed state frequently, refusing to reconfigure it automatically.
systemd-networkd[98588]: wlp59s0: DHCPv4 client: STOPPED
systemd-networkd[98588]: wlp59s0: DHCPv4 client: State changed: bound -> stopped
systemd-networkd[98588]: Got message type=method_call sender=:1.449 destination=org.freedesktop.network1 path=/org/freedesktop/network1 interface=org.freedesktop.network1.Manager member=ReconfigureLink ...
systemd-networkd[98588]: wlp59s0: State changed: failed -> initialized
systemd-networkd[98588]: wlp59s0: found matching network '/etc/systemd/network/50-wifi.network'.
systemd-networkd[98588]: wlp59s0: Configuring with /etc/systemd/network/50-wifi.network.
systemd-networkd[98588]: wlp59s0: DHCPv4 client: STOPPED
systemd-networkd[98588]: Assertion 'sd_dhcp_client_is_running(client)' failed at src/libsystemd-network/sd-dhcp-client.c:2197, function sd_dhcp_client_send_release(). Aborting.
===
2024-08-21 11:34:45 +09:00
Yu Watanabe 021d39d3d1 network: log and enter failed state in link_reconfigure()
No functional change, just refactoring.
2024-08-21 07:29:30 +09:00
Yu Watanabe 685fd0d729 network: enter initialized state when the interface will be reconfigured
When the interface is in the failed state, link_getlink_handler_internal()
will do nothing and return zero, thus the interface will not be
reconfigured, especially when the reconfiguration is triggered in
link_enter_failed().

Follow-up for c2eb7753dd.
2024-08-21 07:29:19 +09:00
Yu Watanabe ebf66d0c05 network: introduce reconfigure_data_free() and _freep()
No functional change, just refactoring.
2024-08-21 07:24:43 +09:00
Yu Watanabe 2656f44c3c Merge pull request #34018 from yuwata/network-address-label
network: allow to configure IPv6 address label in networkd.conf
2024-08-21 02:05:22 +09:00
Yu Watanabe 085818569b test-network: add test for ManageForeignRoutingPolicyRules= 2024-08-20 21:02:31 +09:00
Yu Watanabe 49454d9ced test-network: add tests for Type=table, goto, and nop 2024-08-20 21:02:31 +09:00
Yu Watanabe 936dec4337 test-network: do not pass '[detached]' to 'ip rule del'
That indicates the interface name in 'iif' or 'oif' cannot be resolved
when 'ip rule' command is invoked. That's natural when networkd fail to
remove rule but the corresponding interface is already removed.
To make not the residual rules interfere subsequent test cases, let's
ignore the flag and actually remove unwanted rules.
2024-08-20 21:02:31 +09:00
Yu Watanabe ac1d8aa5bc network/routing-policy-rule: support all known type of rule
This also adds GoTo= to specify the target priority of goto rule.

Note, table was the default but could not be specified in Type=.
2024-08-20 21:02:31 +09:00
Yu Watanabe 3ac8148e20 network/routing-policy-rule: also manage remaining attributes
Currently, these attributes are not configured by us, but there may be a
existing rule created by user manually with one of these attribute.
To correctly manage such foreign rules, let's read these attributes.
2024-08-20 21:02:30 +09:00
Yu Watanabe 7275739728 sd-netlink: introduce sd_netlink_message_read_u64() 2024-08-20 21:02:30 +09:00
Yu Watanabe 727235006a network/routing-policy-rule: remove rules that have conflicting flags
The kernel does not distinguish rules with different flags in
rule_exists(), but the flags of an existing rule cannot be updated.
Let's remove rules that have conflicting flags, and configure new rules
later with requested flags.
2024-08-20 21:02:30 +09:00
Yu Watanabe 689438419b network/routing-policy-rule: anyway detach rule even when we fail to remove it
When we fail to remove a rule, that mostly means the rule does not exist
in the kernel anymore, e.g. already removed manually and we have not
received notification about that yet.
Let's detach the rule in that case.
2024-08-20 21:02:30 +09:00
Yu Watanabe 65f5f58156 network/routing-policy-rule: do not save rule to Manager before it is configured
Otherwise, if we fail to configure the rule, then the manager will keep
nonexistent rule forever. So, let's first copy the rule and put it on
Request, then on success generate a new copy based on the netlink
notification and store it to Manager.

This is the same as 0a0c2672db, but for
routing policy rule.
2024-08-20 21:02:30 +09:00
Yu Watanabe 4f8b153d90 network/routing-policy-rule: skip requesting when rule is already requested
If it is already requested, the new request will be anyway silently refused by
link_queue_request_safe(), which returns 0 in such case. Let's return earlier.

There should be no functional change, just refactoring.
2024-08-20 21:00:05 +09:00
Yu Watanabe 489671d225 network/address-label: allow to configure IPv6 address label in networkd.conf
Closes #23159.
2024-08-20 20:50:56 +09:00
Yu Watanabe 477defd774 network/queue: introduce manager_queue_request_full()
Currently it is not used, but will be used later.
2024-08-20 20:49:32 +09:00
Yu Watanabe 7b2e07ca4c network/address-label: split out address_label_fill_message()
No functional change, just refactoring and preparation for later
commits.
2024-08-20 20:49:28 +09:00
Yu Watanabe 4dfbecd2ff network/address-label: several cleanups for conf parsers
- Check userdata, instead of data, though they point to the same
  position.
- Support an empty string.
- Use UINT32_MAX, as the label is uint32_t.
2024-08-20 20:48:48 +09:00
Yu Watanabe c95fa6acb5 network/address-label: introduce custom hash_ops
No functional change, just refactoring.
2024-08-20 20:48:48 +09:00
Yu Watanabe d37afb5779 network/routing-policy-rule: add trailing period to the log message 2024-08-20 20:48:26 +09:00
Yu Watanabe fc58350aa4 network/routing-policy-rule: do not modify RountingPolicyRule objects managed by Manager or Network
They are stored in Manager.rules set or Network.rules_by_section hashmap.
For safety, let's not edit them even temporarily.

No functional change, just refactoring.
2024-08-20 20:48:26 +09:00
Yu Watanabe 41f5e66cf2 Merge pull request #34044 from poettering/isatty-fixes
fixes around isatty() handling
2024-08-20 20:36:07 +09:00
Yu Watanabe 0197fb599a test-network: make kernel send NA with router flag
If the router interface send NA without router flag, client interface will drop
SLAAC addresses. To make the router interface send NA with router flag,
IPv6 forwarding needs to be enabled.
===
client: NDISC: Received Neighbor Advertisement from fe80::1034:56ff:fe78:9a99: Router=no, Solicited=yes, Override=no
client: NDISC: Invoking callback for 'neighbor' event.
client: Removing NDisc route (configured): dst: 2002:da8:1:99::/64, src: n/a, gw: n/a, prefsrc: n/a, table: main(254), priority: 1024, proto: ra, scope: global, type: unicast, flags: n/a
client: Removing NDisc route (configured): dst: n/a, src: n/a, gw: fe80::1034:56ff:fe78:9a99, prefsrc: n/a, table: main(254), priority: 1024, proto: ra, scope: global, type: unicast, flags: n/a
client: Removing NDisc address (configured): 2002:da8:1:99:1034:56ff:fe78:9a00/64 (valid for 23h 59min 58s, preferred for 3h 59min 58s), flags: manage-temporary-address,no-prefixroute, scope: global
===
2024-08-20 09:01:08 +02:00
Yu Watanabe 93f91df671 network/routing-policy-rule: drop unused argument 2024-08-20 02:21:21 +09:00
Yu Watanabe 6c72e80a3c network/routing-policy-rule: introduce ref and unref functions for RoutingPolicyRule
No functional change, just refactoring and preparation for later change.
2024-08-20 02:21:21 +09:00
Yu Watanabe 957d94c5bd network/routing-policy-rule: manage all flags
Currently, only FIB_RULE_INVERT flag can be configurable, but for
simplicity and future extension, let's manage all flags.

No functional change, just refactoring.
2024-08-20 02:21:21 +09:00
Yu Watanabe 933448defe network/routing-policy-rule: use int32_t for suppress_prefixlen
The kernel parses FRA_SUPPRESS_PREFIXLEN as uint32_t, but internally
handled as signed integer and negative values as unset. Let's explicitly
specify the size of the variable.

No functional change, just refactoring.
2024-08-20 02:21:21 +09:00
Yu Watanabe 0a3a3a2a1e network/routing-policy-rule: reorder elements of RoutingPolicyRule and add comments
No functional change, just refactoring.
2024-08-20 02:21:21 +09:00
Yu Watanabe 82ddfaa591 network/routing-policy-rule: update hash and compare function for fib rule
Let's manage fib rules with the logic used by the kernel.

Should not change any behavior.
2024-08-20 02:21:16 +09:00
Yu Watanabe cc3e48b3c1 run: also enable interactive authentication on opening pty 2024-08-19 11:36:32 +09:00
Yu Watanabe 1b8a74678c run: use sd_bus_set_allow_interactive_authorization() 2024-08-19 11:36:32 +09:00
Yu Watanabe 04834552ed mount: use sd_bus_set_allow_interactive_authorization() 2024-08-19 11:36:32 +09:00
Yu Watanabe 335608593c timedatectl: drop unnecessary temporal variables
Also drop unnecessary spaces.
2024-08-19 11:36:32 +09:00
Yu Watanabe f3cf6167ef tree-wide: voidify polkit_agent_open_if_enabled() 2024-08-19 11:36:32 +09:00
Yu Watanabe 69e7d2efdf timedatectl: enable interactive authentication for DBus methods 2024-08-19 11:36:32 +09:00
Yu Watanabe 470cea62da resolve: inherit server userdata
No functional change, just refactoring.
2024-08-19 11:36:32 +09:00
Yu Watanabe cf01bbb7a4 resolve: support polkit authentication for io.systemd.Resolve.Monitor
Then, non-privilege user can call e.g. 'resolvectl monitor' with
authentication.
2024-08-19 11:36:32 +09:00
Yu Watanabe 302cc03cc8 sd-varlink: allow to dispatch method again on pending-method-more state
Otherwise, polkit authentication does not work for methods that require
the MORE flag.
2024-08-19 11:36:32 +09:00
Yu Watanabe 614a6770f9 resolvectl: acquire DBus connection only when necessary
When e.g. `resolvectl monitor` is called, it is not necessary to acquire
DBus connection.
2024-08-19 11:36:32 +09:00
Yu Watanabe f75ecb9f8b resolvectl: several coding style cleanups
Use RET_GATHER(), FOREACH_ARRAY(), and strv_skip().
2024-08-19 11:36:32 +09:00
Yu Watanabe 5703301ada resolvectl: introduce --no-ask-password option 2024-08-19 11:36:22 +09:00