]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
3 years agotest-dhcp6-client: add test for rapid commit 22412/head
Yu Watanabe [Mon, 14 Feb 2022 06:08:20 +0000 (15:08 +0900)] 
test-dhcp6-client: add test for rapid commit

3 years agotest-dhcp6-client: cleanups
Yu Watanabe [Thu, 10 Feb 2022 07:14:21 +0000 (16:14 +0900)] 
test-dhcp6-client: cleanups

This does many cleanups. Most prominently,
- check the sents packet more strictly,
- make the packets used in the test more readable,
- unify callbacks.

3 years agofuzz-dhcp6-client: add prefix hint and vendor option to sent message
Yu Watanabe [Mon, 7 Feb 2022 16:19:50 +0000 (01:19 +0900)] 
fuzz-dhcp6-client: add prefix hint and vendor option to sent message

3 years agofuzz-dhcp6-client: merge with fuzz-dhcp6-client-send
Yu Watanabe [Mon, 7 Feb 2022 16:19:27 +0000 (01:19 +0900)] 
fuzz-dhcp6-client: merge with fuzz-dhcp6-client-send

3 years agofuzz-dhcp6-client: test multiple states
Yu Watanabe [Mon, 7 Feb 2022 15:30:56 +0000 (00:30 +0900)] 
fuzz-dhcp6-client: test multiple states

Then, now all three paths client_process_information(),
client_process_reply(), and client_process_advertise_or_rapid_commit_reply()
in client_receive_message() are fuzzed.

3 years agosd-dhcp6-client: append extra options before elapsed time option
Yu Watanabe [Thu, 10 Feb 2022 12:44:28 +0000 (21:44 +0900)] 
sd-dhcp6-client: append extra options before elapsed time option

The value of elapsed time option is determined in runtime and not
deterministic. It is hard to test the sent packets if it is located
in the intermidiate of the packet.

3 years agosd-dhcp6-client: logs invalid NTP option
Yu Watanabe [Thu, 10 Feb 2022 12:11:32 +0000 (21:11 +0900)] 
sd-dhcp6-client: logs invalid NTP option

Returning negative errno triggers to produce debugging log in
dhcp6_lease_parse_message().

3 years agosd-dhcp6-client: split dhcp6-internal.h into two
Yu Watanabe [Mon, 7 Feb 2022 19:05:00 +0000 (04:05 +0900)] 
sd-dhcp6-client: split dhcp6-internal.h into two

Also, this moves string tables to dhcp6-protocol.c.

3 years agonetwork: do not restart DHCPv6 client when it is already running in managed mode
Yu Watanabe [Mon, 7 Feb 2022 14:36:49 +0000 (23:36 +0900)] 
network: do not restart DHCPv6 client when it is already running in managed mode

Otherwise, if a network has two router and one provides M flag and the
other provides O flag, then the DHCPv6 client switches the running mode
repeatedly. That makes the IPv6 network configuration of the host
unstable.

3 years agosd-dhcp6-client: reset Information Refresh Time on stop
Yu Watanabe [Mon, 7 Feb 2022 14:23:05 +0000 (23:23 +0900)] 
sd-dhcp6-client: reset Information Refresh Time on stop

3 years agosd-dhcp6-client: add log about Information Refresh Time
Yu Watanabe [Mon, 7 Feb 2022 12:04:50 +0000 (21:04 +0900)] 
sd-dhcp6-client: add log about Information Refresh Time

And store IRT only when the client is running in information
requesting mode.

3 years agosd-dhcp6-client: use memcmp_nn() at one more place
Yu Watanabe [Mon, 7 Feb 2022 12:09:53 +0000 (21:09 +0900)] 
sd-dhcp6-client: use memcmp_nn() at one more place

3 years agodhcp-identifier: generate static and constant DUID-EN when the client is running...
Yu Watanabe [Mon, 7 Feb 2022 06:31:33 +0000 (15:31 +0900)] 
dhcp-identifier: generate static and constant DUID-EN when the client is running in test mode

Follow-up for 9216fddc5a8ac2742e6cfa7660f95c20ca4f2193.

3 years agodhcp-identifier: introduce dhcp_identifier_set_duid()
Yu Watanabe [Mon, 7 Feb 2022 06:10:25 +0000 (15:10 +0900)] 
dhcp-identifier: introduce dhcp_identifier_set_duid()

3 years agodhcp-identifier: introduce duid_type_to_string()
Yu Watanabe [Mon, 7 Feb 2022 06:08:27 +0000 (15:08 +0900)] 
dhcp-identifier: introduce duid_type_to_string()

3 years agosd-dhcp6-client: do not expose set_transaction_id()
Yu Watanabe [Mon, 7 Feb 2022 04:56:36 +0000 (13:56 +0900)] 
sd-dhcp6-client: do not expose set_transaction_id()

This is mostly for tests or fuzzers. Hence, this makes the function
requires that the client is running in the test mode.

Also, now the function mask the value for message type.

3 years agosd-dhcp6-client: use OrderedSet for vendor option
Yu Watanabe [Sun, 6 Feb 2022 20:37:02 +0000 (05:37 +0900)] 
sd-dhcp6-client: use OrderedSet for vendor option

This also fixes memleak.

3 years agoordered-set: introduce ordered_set_clear()
Yu Watanabe [Sun, 6 Feb 2022 20:34:37 +0000 (05:34 +0900)] 
ordered-set: introduce ordered_set_clear()

3 years agosd-dhcp6-client: use struct hw_addr_data
Yu Watanabe [Sun, 6 Feb 2022 20:21:52 +0000 (05:21 +0900)] 
sd-dhcp6-client: use struct hw_addr_data

3 years agosd-dhcp6-client: stop IO event source when client entered bound state
Yu Watanabe [Sun, 6 Feb 2022 20:21:31 +0000 (05:21 +0900)] 
sd-dhcp6-client: stop IO event source when client entered bound state

Also when the client receives a reply when running in information
requesting mode.

3 years agosd-dhcp6-client: adjust assertions
Yu Watanabe [Sun, 6 Feb 2022 19:34:05 +0000 (04:34 +0900)] 
sd-dhcp6-client: adjust assertions

3 years agosd-dhcp6-client: log state transition
Yu Watanabe [Sun, 6 Feb 2022 19:15:22 +0000 (04:15 +0900)] 
sd-dhcp6-client: log state transition

3 years agosd-dhcp6-client: rename client_set_state() -> client_start_transaction()
Yu Watanabe [Sun, 6 Feb 2022 19:04:34 +0000 (04:04 +0900)] 
sd-dhcp6-client: rename client_set_state() -> client_start_transaction()

Previously, it obeys state transition, but now it is only used when
(re-)starting transaction. Let's rename again in more explanative name.

3 years agosd-dhcp6-client: use proper type for string table lookup funcs
Yu Watanabe [Sun, 6 Feb 2022 18:53:08 +0000 (03:53 +0900)] 
sd-dhcp6-client: use proper type for string table lookup funcs

3 years agosd-dhcp6-client: voidify client_set_state()
Yu Watanabe [Sun, 6 Feb 2022 18:43:25 +0000 (03:43 +0900)] 
sd-dhcp6-client: voidify client_set_state()

3 years agosd-dhcp6-client: log message is processed before state is changed
Yu Watanabe [Sun, 6 Feb 2022 18:42:07 +0000 (03:42 +0900)] 
sd-dhcp6-client: log message is processed before state is changed

3 years agosd-dhcp6-client: move client_timeout_resend() and client_set_state()
Yu Watanabe [Sun, 6 Feb 2022 18:34:45 +0000 (03:34 +0900)] 
sd-dhcp6-client: move client_timeout_resend() and client_set_state()

These are deeply related to client_message_send(). Hence, move them near
the function.

3 years agosd-dhcp6-client: move client_ensure_iaid()
Yu Watanabe [Sun, 6 Feb 2022 18:23:34 +0000 (03:23 +0900)] 
sd-dhcp6-client: move client_ensure_iaid()

No functional change.

3 years agosd-dhcp6-client: merge client_start() and client_reset()
Yu Watanabe [Sun, 6 Feb 2022 18:19:40 +0000 (03:19 +0900)] 
sd-dhcp6-client: merge client_start() and client_reset()

3 years agosd-dhcp6-client: use event_reset_time_relative() at one more place
Yu Watanabe [Sun, 6 Feb 2022 18:03:24 +0000 (03:03 +0900)] 
sd-dhcp6-client: use event_reset_time_relative() at one more place

3 years agosd-dhcp6-client: max_retransmit_count is only used when client is in DHCP6_STATE_REQUEST
Yu Watanabe [Sun, 6 Feb 2022 17:59:31 +0000 (02:59 +0900)] 
sd-dhcp6-client: max_retransmit_count is only used when client is in DHCP6_STATE_REQUEST

3 years agosd-dhcp6-client: drop unnecessary event_source_disable()
Yu Watanabe [Sun, 6 Feb 2022 17:48:03 +0000 (02:48 +0900)] 
sd-dhcp6-client: drop unnecessary event_source_disable()

The event source will be soon re-enabled in the same function.

The function client_timeout_resend() may return earlier without
re-enabling the timer souce. However,
- the timer event source is one shot by default. Hence, it is not
  necessary to disable in the callback function,
- when it returns early, then client_set_state() or client_stop() is
  called before return, and they re-ernable or disable the timer.

3 years agosd-dhcp6-client: set lease expiration timer in client_enter_bound_state()
Yu Watanabe [Sun, 6 Feb 2022 17:36:55 +0000 (02:36 +0900)] 
sd-dhcp6-client: set lease expiration timer in client_enter_bound_state()

The timer must be active until the client get re-enter bound state,
and the timeout must be determined by the lease acquired when entering
the bound state.

3 years agosd-dhcp6-client: drop unnecessary assignment
Yu Watanabe [Sun, 6 Feb 2022 16:59:27 +0000 (01:59 +0900)] 
sd-dhcp6-client: drop unnecessary assignment

3 years agosd-dhcp6-client: initialize IO event source in sd_dhcp6_client_start()
Yu Watanabe [Sun, 6 Feb 2022 16:38:21 +0000 (01:38 +0900)] 
sd-dhcp6-client: initialize IO event source in sd_dhcp6_client_start()

3 years agosd-dhcp6-client: make state transition stricter
Yu Watanabe [Sun, 6 Feb 2022 16:24:01 +0000 (01:24 +0900)] 
sd-dhcp6-client: make state transition stricter

3 years agosd-dhcp6-client: prohibit spurious state transition
Yu Watanabe [Sun, 6 Feb 2022 16:09:09 +0000 (01:09 +0900)] 
sd-dhcp6-client: prohibit spurious state transition

Previously, `client_set_state(client, DHCP6_STATE_STOPPED)` might make
the client enter the SOLICIT state.

3 years agosd-dhcp6-client: disable T1 timer on T2
Yu Watanabe [Sun, 6 Feb 2022 15:23:19 +0000 (00:23 +0900)] 
sd-dhcp6-client: disable T1 timer on T2

Otherwise, the client may be enter RENEW state after REBIND state.

3 years agosd-dhcp6-client: call client_notify() in client_enter_bound_state()
Yu Watanabe [Sun, 6 Feb 2022 14:58:36 +0000 (23:58 +0900)] 
sd-dhcp6-client: call client_notify() in client_enter_bound_state()

3 years agosd-dhcp6-client: fix lifetime handling
Yu Watanabe [Sun, 6 Feb 2022 14:51:43 +0000 (23:51 +0900)] 
sd-dhcp6-client: fix lifetime handling

This fixes the following issues:
- if T1 is finite and T2 is infinite, then the timer for T1 was not
  enabled,
- after T1 and T2 are randomized, T1 may be longer than T2.

3 years agosd-dhcp6-client: use event_reset_time_relative()
Yu Watanabe [Sun, 6 Feb 2022 14:43:52 +0000 (23:43 +0900)] 
sd-dhcp6-client: use event_reset_time_relative()

3 years agosd-dhcp6-client: introduce client_enter_bound_state()
Yu Watanabe [Sun, 6 Feb 2022 14:33:55 +0000 (23:33 +0900)] 
sd-dhcp6-client: introduce client_enter_bound_state()

To make client_set_state() smaller. This should not change any behavior.

3 years agosd-dhcp6-client: fix overflow in calculating timeout value
Yu Watanabe [Sun, 6 Feb 2022 14:25:07 +0000 (23:25 +0900)] 
sd-dhcp6-client: fix overflow in calculating timeout value

3 years agosd-dhcp6-client: disable event source when client is stopped or freed
Yu Watanabe [Sun, 6 Feb 2022 13:35:17 +0000 (22:35 +0900)] 
sd-dhcp6-client: disable event source when client is stopped or freed

3 years agosd-dhcp6-client: use in6_addr_to_string()
Yu Watanabe [Sun, 6 Feb 2022 13:34:04 +0000 (22:34 +0900)] 
sd-dhcp6-client: use in6_addr_to_string()

3 years agosd-dhcp6-client: stop client on error in client state transition
Yu Watanabe [Sun, 6 Feb 2022 13:22:38 +0000 (22:22 +0900)] 
sd-dhcp6-client: stop client on error in client state transition

3 years agosd-dhcp6-client: add missing one more error handling
Yu Watanabe [Sun, 6 Feb 2022 13:17:43 +0000 (22:17 +0900)] 
sd-dhcp6-client: add missing one more error handling

3 years agosd-dhcp6-client: rename client_start() -> client_set_state()
Yu Watanabe [Sun, 6 Feb 2022 13:16:17 +0000 (22:16 +0900)] 
sd-dhcp6-client: rename client_start() -> client_set_state()

3 years agosd-dhcp6-client: introduce client_process_*()
Yu Watanabe [Sun, 6 Feb 2022 12:59:07 +0000 (21:59 +0900)] 
sd-dhcp6-client: introduce client_process_*()

This is mostly for shortening `client_receive_message()`.

This also fixes the following:
- do not trigger SD_DHCP6_CLIENT_EVENT_INFORMATION_REQUEST notification
  when non-reply message,
- add several missing error handlings caused in client_start().

3 years agosd-dhcp6-client: fix possible unaligned read or write
Yu Watanabe [Sun, 6 Feb 2022 11:53:34 +0000 (20:53 +0900)] 
sd-dhcp6-client: fix possible unaligned read or write

3 years agosd-dhcp6-client: voidify client_reset()
Yu Watanabe [Sun, 6 Feb 2022 10:42:58 +0000 (19:42 +0900)] 
sd-dhcp6-client: voidify client_reset()

3 years agosd-dhcp6-client: introduce dhcp6_lease_new_from_message()
Yu Watanabe [Sun, 6 Feb 2022 10:36:30 +0000 (19:36 +0900)] 
sd-dhcp6-client: introduce dhcp6_lease_new_from_message()

3 years agosd-dhcp6-client: use structured initializer
Yu Watanabe [Sun, 6 Feb 2022 09:24:13 +0000 (18:24 +0900)] 
sd-dhcp6-client: use structured initializer

3 years agosd-dhcp6-lease: unify lease lifetime calculation
Yu Watanabe [Sun, 6 Feb 2022 07:12:10 +0000 (16:12 +0900)] 
sd-dhcp6-lease: unify lease lifetime calculation

3 years agosd-dhcp6-client: always use ENODATA when a lease does not have requested data
Yu Watanabe [Sun, 6 Feb 2022 06:01:47 +0000 (15:01 +0900)] 
sd-dhcp6-client: always use ENODATA when a lease does not have requested data

3 years agosd-dhcp6-client: unify dhcp6_option_append_{ia,pd}()
Yu Watanabe [Sun, 6 Feb 2022 05:56:59 +0000 (14:56 +0900)] 
sd-dhcp6-client: unify dhcp6_option_append_{ia,pd}()

3 years agosd-dhcp6-client: store PD prefix hint in ia_pd
Yu Watanabe [Sun, 6 Feb 2022 05:32:36 +0000 (14:32 +0900)] 
sd-dhcp6-client: store PD prefix hint in ia_pd

And allows to specify multiple hints.

3 years agosd-dhcp6-client: introduce dhcp6_ia_free()
Yu Watanabe [Sun, 6 Feb 2022 05:18:44 +0000 (14:18 +0900)] 
sd-dhcp6-client: introduce dhcp6_ia_free()

3 years agosd-dhcp6-client: unify IA option header
Yu Watanabe [Sun, 6 Feb 2022 04:38:08 +0000 (13:38 +0900)] 
sd-dhcp6-client: unify IA option header

This also fixes possible unaligned read of message.

3 years agosd-dhcp6-lease: reset client or server ID when length is zero
Yu Watanabe [Fri, 4 Feb 2022 01:45:40 +0000 (10:45 +0900)] 
sd-dhcp6-lease: reset client or server ID when length is zero

Addresses https://github.com/systemd/systemd/pull/22406#issuecomment-1029391091.

3 years agosd-dhcp6-lease: convert assert_return() -> assert() in non-public functions
Yu Watanabe [Fri, 4 Feb 2022 01:40:33 +0000 (10:40 +0900)] 
sd-dhcp6-lease: convert assert_return() -> assert() in non-public functions

3 years agosd-dhcp6-client: rename ia -> ia_na, pd -> ia_pd in sd_dhcp6_lease
Yu Watanabe [Fri, 4 Feb 2022 01:17:44 +0000 (10:17 +0900)] 
sd-dhcp6-client: rename ia -> ia_na, pd -> ia_pd in sd_dhcp6_lease

The previous naming is quite misleading.

3 years agosd-dhcp6-client: fix typo ia_pd -> ia_na
Yu Watanabe [Fri, 4 Feb 2022 01:15:49 +0000 (10:15 +0900)] 
sd-dhcp6-client: fix typo ia_pd -> ia_na

Fortunately, currently both ia_pd and ia_na in sd_dhcp6_client are
equivalent now.

3 years agosd-dhcp6-client: introduce two helpers to create message
Yu Watanabe [Sat, 5 Feb 2022 05:19:59 +0000 (14:19 +0900)] 
sd-dhcp6-client: introduce two helpers to create message

3 years agosd-dhcp6-client: trigger assertion whn invalid IA type is provided
Yu Watanabe [Sat, 5 Feb 2022 05:29:33 +0000 (14:29 +0900)] 
sd-dhcp6-client: trigger assertion whn invalid IA type is provided

If the condition hits, then it is an error in coding, instead of a user
misconfiguration or invalid receivd message.

3 years agosd-dhcp6-client: add missing address existence check
Yu Watanabe [Sat, 5 Feb 2022 05:24:42 +0000 (14:24 +0900)] 
sd-dhcp6-client: add missing address existence check

This adds similar check as 58da18251f468de9de4cc7b36804c924e2fd4421.

3 years agoMerge pull request #22471 from yuwata/network-bridge-vlan-protocol
Yu Watanabe [Thu, 10 Feb 2022 11:40:04 +0000 (20:40 +0900)] 
Merge pull request #22471 from yuwata/network-bridge-vlan-protocol

network: bridge: fix vlan protocol

3 years agoMerge pull request #22452 from yuwata/network-ipv6ll
Yu Watanabe [Thu, 10 Feb 2022 11:38:56 +0000 (20:38 +0900)] 
Merge pull request #22452 from yuwata/network-ipv6ll

network: use sysctl to set IPv6LL address generation mode when the interface is already up

3 years agotest-network: add missing tests for bridge properties 22471/head
Yu Watanabe [Thu, 10 Feb 2022 09:04:34 +0000 (18:04 +0900)] 
test-network: add missing tests for bridge properties

3 years agonetwork: bridge: fix endian of vlan protocol
Yu Watanabe [Thu, 10 Feb 2022 08:47:14 +0000 (17:47 +0900)] 
network: bridge: fix endian of vlan protocol

Fixes #22469.

3 years agotest-network: add testcase for re-generating IPv6LL address 22452/head
Yu Watanabe [Tue, 8 Feb 2022 14:53:43 +0000 (23:53 +0900)] 
test-network: add testcase for re-generating IPv6LL address

3 years agonetwork: attempt to trigger kernel IPv6LL address generation
Joerie de Gram [Tue, 8 Feb 2022 13:56:26 +0000 (22:56 +0900)] 
network: attempt to trigger kernel IPv6LL address generation

Try to ensure kernel IPv6 link local address generation occurs by
setting the per-if addr_gen_mode sysctl when the link is already up,
instead of the netlink interface (IFLA_INET6_ADDR_GEN_MODE).

The netlink setting is sufficient in cases where the interface is not
yet up when networkd configures an interface - bringing the interface
up will trigger in-kernel address generation.

If the interface is already up, yet the interface has no IPv6LL assigned
setting IFLA_INET6_ADDR_GEN_MODE has no effect.

Writing the addr_gen_mode sysctl is a best effort attempt at triggering
address generation regardless of interface state because it also works
in cases where the interface is already up.

Fixes #22424.

3 years agonetwork: move link_set_ipv6ll_stable_secret() to networkd-ipv6ll.c
Yu Watanabe [Tue, 8 Feb 2022 13:53:33 +0000 (22:53 +0900)] 
network: move link_set_ipv6ll_stable_secret() to networkd-ipv6ll.c

3 years agonetwork: skip to set IPv6LL address generation mode if the requested mode is already set
Yu Watanabe [Tue, 8 Feb 2022 13:27:17 +0000 (22:27 +0900)] 
network: skip to set IPv6LL address generation mode if the requested mode is already set

3 years agonetwork: use log_link_warning_errno() or friends where applicable
Yu Watanabe [Tue, 8 Feb 2022 17:14:12 +0000 (02:14 +0900)] 
network: use log_link_warning_errno() or friends where applicable

3 years agonetwork: monitor current IPv6LL address generation mode
Yu Watanabe [Tue, 8 Feb 2022 13:26:23 +0000 (22:26 +0900)] 
network: monitor current IPv6LL address generation mode

3 years agonetwork: introduce two helper functions for setting IPv6LL address generation mode
Yu Watanabe [Tue, 8 Feb 2022 13:16:38 +0000 (22:16 +0900)] 
network: introduce two helper functions for setting IPv6LL address generation mode

3 years agoudev/net: support Match.Firmware= in .link files (#22462)
Alvin Šipraga [Thu, 10 Feb 2022 07:19:28 +0000 (08:19 +0100)] 
udev/net: support Match.Firmware= in .link files (#22462)

In cbcdcaaa0ec5 ("Add support for conditions on the machines firmware")
a new Firmware= directive was added for .netdev and .network files.
While it was also documented to work on .link files, in actual fact the
support was missing. Add that one extra line to make it work, and also
update the fuzzer directives.

3 years agoMerge pull request #22467 from mrc0mmand/TEST-64-lvm-static-autoactivation
Anita Zhang [Thu, 10 Feb 2022 01:10:06 +0000 (17:10 -0800)] 
Merge pull request #22467 from mrc0mmand/TEST-64-lvm-static-autoactivation

test: lvm 2.03.15 dropped the static autoactivation

3 years agotest: lvm 2.03.15 dropped the static autoactivation 22467/head
Frantisek Sumsal [Wed, 9 Feb 2022 21:35:03 +0000 (22:35 +0100)] 
test: lvm 2.03.15 dropped the static autoactivation

so install the respective generator only if we're running with older
lvm versions.

See: https://sourceware.org/git/?p=lvm2.git;a=commit;h=ee8fb0310c53ed003a43b324c99cdfd891dd1a7c

3 years agoClarify protocol used in systemd-journal-upload (#22465)
Federico Ceratto [Wed, 9 Feb 2022 20:34:29 +0000 (20:34 +0000)] 
Clarify protocol used in systemd-journal-upload (#22465)

* Clarify protocol used in systemd-journal-upload

3 years agoMerge pull request #22458 from poettering/parse-safe-string
Luca Boccassi [Wed, 9 Feb 2022 16:59:14 +0000 (16:59 +0000)] 
Merge pull request #22458 from poettering/parse-safe-string

some safety tweaks to conf-parser.[ch]

3 years agomeson: disable export-dbus-interfaces target when cross-compiling
Luca Boccassi [Tue, 8 Feb 2022 13:19:52 +0000 (13:19 +0000)] 
meson: disable export-dbus-interfaces target when cross-compiling

ERROR:
Cannot use target systemd as a generator because it is built for the
host machine and no exe wrapper is defined or needs_exe_wrapper is
true. You might want to set `native: true` instead to build it for
the build machine.

3 years agoci: remove MULTI_STATUS from superlinter
Evgeny Vereshchagin [Tue, 8 Feb 2022 20:35:17 +0000 (20:35 +0000)] 
ci: remove MULTI_STATUS from superlinter

Judging by
ERROR! Failed to call GitHub Status API!

it doesn't seem to work. Even if it did it would just clutter the status
checks I think so let's just remove MULTI_STATUS along with
GITHUB_TOKEN.

3 years agoMerge pull request #22248 from yuwata/network-tc-use-request-queue
Yu Watanabe [Wed, 9 Feb 2022 09:57:37 +0000 (18:57 +0900)] 
Merge pull request #22248 from yuwata/network-tc-use-request-queue

network: tc: use request queue to configure QDisc or TClass

3 years agoconf-parser: add specific parser for PID values 22458/head
Lennart Poettering [Wed, 9 Feb 2022 09:13:59 +0000 (10:13 +0100)] 
conf-parser: add specific parser for PID values

3 years agotree-wide: use config_parse_safe_string() at various places
Lennart Poettering [Wed, 9 Feb 2022 09:07:17 +0000 (10:07 +0100)] 
tree-wide: use config_parse_safe_string() at various places

3 years agoconf-parser: update config_item_*_lookup() to follow modern coding style
Lennart Poettering [Wed, 9 Feb 2022 08:55:21 +0000 (09:55 +0100)] 
conf-parser: update config_item_*_lookup() to follow modern coding style

Let's rename the return parameters ret_xyz, and always initialize them
if we return >= 0, as per our current coding style.

3 years agoconf-parser: refuse section headers with control characters early, just in case
Lennart Poettering [Wed, 9 Feb 2022 08:47:53 +0000 (09:47 +0100)] 
conf-parser: refuse section headers with control characters early, just in case

3 years agoconf-parser: minor refactorings/modernizations
Lennart Poettering [Wed, 9 Feb 2022 08:47:50 +0000 (09:47 +0100)] 
conf-parser: minor refactorings/modernizations

3 years agoconf-parser: use _cleanup_free_ where appropriate
Lennart Poettering [Wed, 9 Feb 2022 08:47:10 +0000 (09:47 +0100)] 
conf-parser: use _cleanup_free_ where appropriate

3 years agoconf-parse: add generic config_parse_safe_string() helper
Lennart Poettering [Wed, 9 Feb 2022 08:45:12 +0000 (09:45 +0100)] 
conf-parse: add generic config_parse_safe_string() helper

This helper is just like config_parse_string() but does some superficial
checks for control characters and quotes.

In most cases we currently use config_parse_string() we probably want to
use config_parse_safe_string() for safety reasons.

3 years agoAdd support for `isolated` parameter
Santa Wiryaman [Mon, 3 May 2021 22:48:26 +0000 (18:48 -0400)] 
Add support for `isolated` parameter

Add the "Isolated" parameter in the *.network file, e.g.,

[Bridge]
Isolated=true|false

When the Isolated parameter is true, traffic coming out of this port
will only be forward to other ports whose Isolated parameter is false.

When Isolated is not specified, the port uses the kernel default
setting (false).

The "Isolated" parameter was introduced in Linux 4.19.
See man bridge(8) for more details.
But even though the kernel and bridge/iproute2 recognize the "Isolated"
parameter, systemd-networkd did not have a way to set it.

3 years agoci: validate actions and fix actionlint warnings
Evgeny Vereshchagin [Tue, 8 Feb 2022 17:34:10 +0000 (17:34 +0000)] 
ci: validate actions and fix actionlint warnings

some actions like Coverity and CFLite aren't run on every PR so to make
sure they are more or less fine when they are changed it makes sense to
at least check them with superlinter/actionlint: https://github.com/rhysd/actionlint

The following warnings were fixed along the way:
```
.github/workflows/mkosi.yml:55:7: shellcheck reported issue in this script: SC2086:info:6:14: Double quote to prevent globbing and word splitting [shellcheck]
   |
55 |       run: |
   |       ^~~~
.github/workflows/mkosi.yml:55:7: shellcheck reported issue in this script: SC2046:warning:6:40: Quote this to prevent word splitting [shellcheck]
   |
55 |       run: |
   |       ^~~~
.github/workflows/mkosi.yml:55:7: shellcheck reported issue in this script: SC2006:style:6:40: Use $(...) notation instead of legacy backticked `...` [shellcheck]
   |
55 |       run: |
   |       ^~~~
```
```
.github/workflows/coverity.yml:31:9: shellcheck reported issue in this script: SC2086:info:1:93: Double quote to prevent globbing and word splitting [shellcheck]
   |
31 |         run: echo "COVERITY_SCAN_NOTIFICATION_EMAIL=$(git log -1 ${{ github.sha }} --pretty=\"%aE\")" >> $GITHUB_ENV
   |         ^~~~
```

3 years agonetwork: tc: use hashmap to store traffic control settings in .network files 22248/head
Yu Watanabe [Wed, 26 Jan 2022 04:06:37 +0000 (13:06 +0900)] 
network: tc: use hashmap to store traffic control settings in .network files

As now each qdisc or tclass is configured when it is ready.

3 years agonetwork: tc: introduce order dependency of traffic control
Yu Watanabe [Wed, 26 Jan 2022 04:01:19 +0000 (13:01 +0900)] 
network: tc: introduce order dependency of traffic control

3 years agonetwork: tc: use request queue to configure traffic control
Yu Watanabe [Tue, 25 Jan 2022 18:49:27 +0000 (03:49 +0900)] 
network: tc: use request queue to configure traffic control

But no dependency resolution is implemented.

3 years agonetwork: tc/teql: set tca_kind in verify()
Yu Watanabe [Wed, 26 Jan 2022 03:18:47 +0000 (12:18 +0900)] 
network: tc/teql: set tca_kind in verify()

Then, qdisc_configure() can be simplified.

3 years agonetwork: tc: monitor qdisc and tclass
Yu Watanabe [Tue, 25 Jan 2022 23:42:22 +0000 (08:42 +0900)] 
network: tc: monitor qdisc and tclass

3 years agosd-netlink: allow to dump qdisc and tclass
Yu Watanabe [Wed, 26 Jan 2022 01:24:50 +0000 (10:24 +0900)] 
sd-netlink: allow to dump qdisc and tclass