Yu Watanabe
03677889f0
list: declare iterator of LIST_FOREACH() in the loop
2022-03-19 08:10:29 +09:00
Yu Watanabe
faaf3d66ce
sd-radv: fix indentation
2022-03-17 14:34:58 +09:00
Yu Watanabe
56aa51432e
sd-radv: do not use iterater outside of the loop
2022-03-17 14:34:58 +09:00
Yu Watanabe
95931532aa
sd-radv: voidify sd_radv_remove_prefix()
...
If the prefix is only referenced by sd_radv, then the returned pointer
is already freed.
networkd does not uses the returned value. Let's voidify the function.
2022-03-17 14:34:58 +09:00
Jan Janssen
68da8adf54
test: Use TEST macros in more places
2022-03-16 14:50:12 +01:00
Yu Watanabe
6278e42878
network: dhcp: rename NextServer= and Filename= settings
...
And make the settings configures DHCP option 66 and 67.
Follow-ups for #22615 .
Fixes #22661 .
2022-03-11 10:14:57 +09:00
Yu Watanabe
71a9e3a304
dhcp: list all known message type
2022-03-10 14:47:28 +09:00
Yu Watanabe
3d80c57b7e
sd-dhcp6-client: rename timezone options
...
To make them follow corresponding DHCPv4 options.
2022-03-10 14:47:28 +09:00
Yu Watanabe
3cb62efef8
dhcp: list all known DHCP options
2022-03-10 14:47:28 +09:00
Yu Watanabe
1aaab93621
network: refuse string which contains non-safe or non-ascii characters for Filename=
...
The string will be used when the client load additional config file to
boot, and it must be a valid path or url. Hence, let's refuse non-safe or
non-characters.
2022-03-10 14:43:48 +09:00
Zbigniew Jędrzejewski-Szmek
2f492a739c
meson: move files' closing brace to separate line
2022-03-03 12:14:13 +01:00
Zbigniew Jędrzejewski-Szmek
f1b98127ff
meson: do not use split() in file lists
...
The approach to use '''…'''.split() instead of a list of strings was initially
used when converting from automake because it allowed identical blocks of lines
to be used for both, making the conversion easier.
But over the years we have been using normal lists more and more, especially
when there were just a few filenames listed. This converts the rest.
No functional change.
2022-03-02 14:49:32 +01:00
Yu Watanabe
d5e5cd5c34
sd-dhcp-server: add support to send next server and filename option for PXE boot systems
2022-02-25 02:32:58 +09:00
Zbigniew Jędrzejewski-Szmek
f2acaf39c1
Merge pull request #22600 from poettering/timestamp_is_set-more
...
make more use of timestamp_is_set()
2022-02-23 08:59:49 +01:00
Lennart Poettering
0da36375eb
tree-wide: use timestamp_is_set() more
2022-02-22 22:49:40 +01:00
Yu Watanabe
8306912b0e
test: fix memory and fd leak in test-dhcp6-client
...
Fixes an issue reported in #22576 .
2022-02-22 21:50:43 +09:00
Yu Watanabe
2e37084fc9
test: drop timeout handlers
...
Fixes file descriptor leak reported in #22576 .
2022-02-22 21:50:32 +09:00
Yu Watanabe
9e0cb8b61f
sd-dhcp-server: do not offer server address
...
The server address may be in the pool.
2022-02-17 16:45:10 +09:00
Yu Watanabe
37598ac6eb
sd-dhcp6-client: use mempcpy() or mempcpy_safe()
2022-02-16 16:23:58 +09:00
Yu Watanabe
c9333c236f
dhcp-identifier: use offsetof()
...
Also use appropriate place to store UUID.
2022-02-16 16:23:54 +09:00
Yu Watanabe
fc62d1c54f
sd-dhcp6-client: add comment about ia_na and ia_pd
2022-02-15 23:36:45 +09:00
Yu Watanabe
119c00c1fa
test-dhcp6-client: add test for rapid commit
2022-02-14 15:09:37 +09:00
Yu Watanabe
1f28019113
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.
2022-02-14 15:09:28 +09:00
Yu Watanabe
bccb8fc61a
fuzz-dhcp6-client: add prefix hint and vendor option to sent message
2022-02-14 15:02:33 +09:00
Yu Watanabe
7b53d3ead3
fuzz-dhcp6-client: merge with fuzz-dhcp6-client-send
2022-02-14 15:02:33 +09:00
Yu Watanabe
013c6904fa
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.
2022-02-14 15:02:33 +09:00
Yu Watanabe
bbe3f62a16
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.
2022-02-14 15:02:33 +09:00
Yu Watanabe
e261d31557
sd-dhcp6-client: logs invalid NTP option
...
Returning negative errno triggers to produce debugging log in
dhcp6_lease_parse_message().
2022-02-14 15:02:33 +09:00
Yu Watanabe
3f09d563f4
sd-dhcp6-client: split dhcp6-internal.h into two
...
Also, this moves string tables to dhcp6-protocol.c.
2022-02-14 15:02:33 +09:00
Yu Watanabe
dd73db7850
sd-dhcp6-client: reset Information Refresh Time on stop
2022-02-14 15:02:30 +09:00
Yu Watanabe
e1774086a7
sd-dhcp6-client: add log about Information Refresh Time
...
And store IRT only when the client is running in information
requesting mode.
2022-02-14 15:01:02 +09:00
Yu Watanabe
9c9fee8002
sd-dhcp6-client: use memcmp_nn() at one more place
2022-02-14 15:01:02 +09:00
Yu Watanabe
ac680f766d
dhcp-identifier: generate static and constant DUID-EN when the client is running in test mode
...
Follow-up for 9216fddc5a .
2022-02-14 15:00:59 +09:00
Yu Watanabe
5e1618fafa
dhcp-identifier: introduce dhcp_identifier_set_duid()
2022-02-14 14:58:49 +09:00
Yu Watanabe
f9971018eb
dhcp-identifier: introduce duid_type_to_string()
2022-02-14 14:58:49 +09:00
Yu Watanabe
6f3fc86131
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.
2022-02-14 14:58:49 +09:00
Yu Watanabe
9e4dee4cec
sd-dhcp6-client: use OrderedSet for vendor option
...
This also fixes memleak.
2022-02-14 14:58:49 +09:00
Yu Watanabe
1978efb9a5
sd-dhcp6-client: use struct hw_addr_data
2022-02-14 14:58:49 +09:00
Yu Watanabe
6f8ff34218
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.
2022-02-14 14:58:49 +09:00
Yu Watanabe
6f4490bb0c
sd-dhcp6-client: adjust assertions
2022-02-14 14:58:46 +09:00
Yu Watanabe
65b85f2340
sd-dhcp6-client: log state transition
2022-02-14 14:57:35 +09:00
Yu Watanabe
e5d69be216
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.
2022-02-14 14:57:35 +09:00
Yu Watanabe
fa78d165bb
sd-dhcp6-client: use proper type for string table lookup funcs
2022-02-14 14:57:35 +09:00
Yu Watanabe
a8d1012f30
sd-dhcp6-client: voidify client_set_state()
2022-02-14 14:57:34 +09:00
Yu Watanabe
cfcc85bbca
sd-dhcp6-client: log message is processed before state is changed
2022-02-14 14:57:34 +09:00
Yu Watanabe
c50c9e509f
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.
2022-02-14 14:57:34 +09:00
Yu Watanabe
0eca25ba00
sd-dhcp6-client: move client_ensure_iaid()
...
No functional change.
2022-02-14 14:57:34 +09:00
Yu Watanabe
af2b484141
sd-dhcp6-client: merge client_start() and client_reset()
2022-02-14 14:56:54 +09:00
Yu Watanabe
ec7baf998d
sd-dhcp6-client: use event_reset_time_relative() at one more place
2022-02-14 14:54:08 +09:00
Yu Watanabe
22ad018b5e
sd-dhcp6-client: max_retransmit_count is only used when client is in DHCP6_STATE_REQUEST
2022-02-14 14:54:08 +09:00