Commit Graph
100 Commits
Author SHA1 Message Date
Yu Watanabe 1d87a00a95 mkosi: fix typo
Follow-up for 4d0f1451b5.
2024-03-10 14:09:41 +09:00
Yu Watanabe 17be4d7b98 mkosi: fix typo
Follow-up for 4d0f1451b5.
2024-03-08 18:17:37 +01:00
Yu Watanabe 77630ec909 resolve: fix typo
Follow-up for d08566fad7.
2024-03-09 01:43:48 +09:00
Yu Watanabe 3d1279af79 meson: add missing dependency to libdl
Follow-up for 1c20c9f4fc.

Fixes https://github.com/systemd/systemd/pull/31550#issuecomment-1980458377.
2024-03-06 17:24:03 +00:00
Yu Watanabe 21fdecdc13 sd-netlink: allow to call rtnl_get_link_info() without iftype and flags 2024-03-05 12:19:47 +00:00
Yu Watanabe 1f901c2453 Merge pull request #31586 from YHNdnzj/progress-bar-minor-followup
shared/pretty-print: minor follow-up for progress bar
2024-03-02 15:31:29 +09:00
Yu Watanabe aa384c6430 Merge pull request #31583 from yuwata/sd-lldp-json-follow-up
sd-lldp: fix assignment of capabilities in JSON output
2024-03-02 15:31:00 +09:00
Yu Watanabe 4b35dab86a test-network: wait for the interface being processed by udevd
Otherwise, even if the interface is available, the requested config may
not be applied to the interface yet.

This also merges multiple tests for RPS setting. Hopefully the
performance of the test is improved.
2024-03-02 14:50:40 +09:00
Yu Watanabe a39a2a8121 test-network: introduce udevadm() and friends 2024-03-02 14:50:40 +09:00
Yu Watanabe 7e66e053d4 udev/net: fix ReceivePacketSteeringCPUMask=disable assignment
Follow-up for 0f30bf5886.

If 'mask' is newly allocated, previously the value was ignored.
2024-03-02 14:50:39 +09:00
Yu Watanabe eca7a4886d fuzz-lldp-rx: fuzz lldp_rx_build_neighbors_json()
Addresses https://github.com/systemd/systemd/pull/31583#discussion_r1509882453.
2024-03-02 13:52:28 +09:00
Yu Watanabe 0f805b4661 test-network: check enabled capabilities in LLDP neighbors
Addresses https://github.com/systemd/systemd/pull/31583#discussion_r1509880349.
2024-03-02 13:52:28 +09:00
Yu Watanabe e2290a7775 sd-lldp: fix assignment of capabilities in JSON output
Follow-up for 329146a9ac.
2024-03-02 13:52:28 +09:00
Yu Watanabe 5bafe8d1e7 man: fix typo
Follow-up for 419b25ddca.
2024-03-02 11:57:39 +09:00
Yu Watanabe d5e6df24bd Merge pull request #31498 from ssahani/bond
netdev: bond - add support for peer_notif_delay
2024-03-01 12:45:52 +09:00
Yu Watanabe 3807936cc5 Merge pull request #31502 from yuwata/network-lldp-json
network: support to dump LLDP neighbors in JSON format
2024-03-01 12:18:53 +09:00
Yu Watanabe 6a5134e83a Merge pull request #31555 from yuwata/sd-ndisc-trivial-cleanups
sd-ndisc: trivial cleanups
2024-03-01 12:18:19 +09:00
Yu Watanabe ccb1ace77f sd-ndisc: drop unused sd_ndisc_router_get_raw() 2024-03-01 09:44:58 +09:00
Yu Watanabe f169c56447 sd-ndisc: use _packed_ attribute 2024-03-01 09:44:58 +09:00
Yu Watanabe bbb2a0fb41 icmp6-packet: check the alignment of struct nd_opt_hdr for safety
Addresses https://github.com/systemd/systemd/pull/31492#discussion_r1507481748.
2024-03-01 09:44:45 +09:00
Yu Watanabe d6360819a7 test-network: add more test cases for LLDP 2024-03-01 09:40:26 +09:00
Yu Watanabe ac23c5596e sd-lldp-rx: drop unused functions
These are not used anymore.
2024-03-01 09:40:26 +09:00
Yu Watanabe 5a0f6adbb2 network/lldp: do not save LLDP neighbors under /run/systemd
Now LLDP neighbors are exposed through varlink. Hence, it is not
necessary to save to a file.
2024-03-01 09:40:26 +09:00
Yu WatanabeandTomáš Pecka 14a5c07afa networkctl: use varlink method to dump LLDP neighbors
`networkctl lldp` and `networkctl status INTERFACE` now use varlink
call to the networkd to query LLDP neighbors.

Then, this allows to dump LLDP neighbors in JSON format.

Co-authored-by: Tomáš Pecka <tomas.pecka@cesnet.cz>
2024-03-01 09:40:26 +09:00
Yu Watanabe 1dbd2cc72a networkctl: rename check_netns_match() -> varlink_connect_networkd()
Then optionally return the varlink connection to the caller.
2024-03-01 09:40:26 +09:00
Yu WatanabeandTomáš Pecka c48ca17aa8 network/varlink: add varlink method to get LLDP neighbors
The method provides the list of LLDP neighbors.

Co-authored-by: Tomáš Pecka <tomas.pecka@cesnet.cz>
2024-03-01 09:40:26 +09:00
Yu Watanabe 1e18e1aa11 Merge pull request #31492 from yuwata/icmp6-packet
sd-ndisc: introduce ICMP6Packet and relevant functions, and use them
2024-03-01 09:18:52 +09:00
Yu Watanabe 39af486a7f network/ndisc: drop redundant sd_ndisc_router_get_icmp6_ratelimit()
This effectively reverts 9175002864.

The retrans time field in RA message is for neighbor solicitation,
and the commit d4c8de21a0 makes the value
assigned to the correct sysctl property.

Let's deprecate the option, and drop the redundant functions.
2024-02-28 11:05:00 +00:00
Yu Watanabe 9398ef0786 cgroup-setup: clarify '<=' is evaluated earlier
Follow-up for 31323f21bb.

The code is correct, but let's silence Coverity.

Closes CID#1534787.
2024-02-28 14:11:43 +08:00
Yu Watanabe 630023e2e4 TODO: fix typo
Follow-up for 666a348d1c.
2024-02-28 11:46:21 +09:00
Yu Watanabe c4047829bb test-network: fix typo
Follow-up for a663ddc04e.
2024-02-28 11:44:20 +09:00
Yu Watanabe 25413fbfc7 sd-ndisc: ignore Router Advertisement messages sent by the same interface 2024-02-28 11:40:50 +09:00
Yu Watanabe c34cb1d645 sd-ndisc: use ICMP6Packet and ndisc_option_parse() 2024-02-28 11:37:36 +09:00
Yu Watanabe 45edf75c61 sd-ndisc: introduce ndisc_option_parse() helper function 2024-02-28 11:26:52 +09:00
Yu Watanabe 07db3ac66c icmp6-packet: introduce ICMP6Packet and several relevant functions 2024-02-28 11:26:39 +09:00
Yu Watanabe 2706065514 sysext: fix typo 2024-02-27 13:28:02 +09:00
Yu Watanabe 7036d472d0 network: fix use-after-free in {address,route}_remove_and_cancel()
Fixes #31485.
2024-02-26 11:02:13 +00:00
Yu Watanabe 52672db3f8 network/ndisc: rename Network.ipv6_accept_ra -> Network.ndisc
These settings are leated to sd-ndisc and Neighbor Discovery protocol.
Let's use more suitable name.
2024-02-26 11:38:57 +01:00
Yu Watanabe 815fce2c35 Merge pull request #31490 from yuwata/network-varlink-cleanups
network/varlink: several trivial cleanups
2024-02-26 15:12:12 +09:00
Yu Watanabe eaa260cd74 varlink/network: reindent methods 2024-02-26 13:42:37 +09:00
Yu Watanabe a569c2c5fd network/varlink: downgrade log level about failure in getting netns ID 2024-02-26 13:42:37 +09:00
Yu Watanabe 46877eb149 format-table: replace "(size_t) -1" with SIZE_MAX 2024-02-26 12:39:23 +08:00
Yu Watanabe c7f46150bb in-addr-util: introduce in{4,6}_addr_is_multicast() 2024-02-25 11:43:37 +00:00
Yu Watanabe 9f0430b74b icmp6-util: make icmp6_receive() refuse packets without IPv6 sender address
Previously, the function supports packets without IPv6 sender address
for unit tests. However, now unit tests use their own version of
icmp6_receive(). Hence, let's make the check more strict.
2024-02-25 11:41:39 +00:00
Yu Watanabe 28eef15898 sd-ndisc: make callback takes arbitrary type of message
No functional change. Preparation for supporting Neighbor Advertisement
message.
2024-02-25 11:38:58 +00:00
Yu Watanabe c75d119658 network/ndisc: drop all configurations without lifetime on stop
As we call ndisc_drop_outdated() with USEC_INFINITY on stop.
2024-02-25 11:38:08 +00:00
Yu Watanabe f2e5a28bdd network: use FOREACH_STRING() 2024-02-24 21:04:14 +09:00
Yu Watanabe a860df82b4 test: split out {dump,verify}_ra_message()
Then, let's not modify the global object.
2024-02-24 12:37:50 +09:00
Yu Watanabe 36653443f7 sd-radv: several cleanups
- split out radv_setup_recv_event(),
- slightly update log messages,
- use DIV_ROUND_UP(),
- use structured initializer more.

No functional change, just preparation for later commits.
2024-02-24 12:37:50 +09:00
Yu Watanabe 6a27ca08c6 sd-ndisc: several trivial cleanups
- update several log messages,
- use event_reset_time_relative(),
- split out ndisc_setup_recv_event() and ndisc_setup_timer().

No functional change, just refactoring and preparation for later commits.
2024-02-24 12:37:50 +09:00
Yu Watanabe 37c011e74c icmp6-util: merge icmp6_bind_router_{solicitation,advertisement}() into icmp6_bind()
No functional change, just refactoring.
2024-02-24 12:37:50 +09:00
Yu Watanabe 16a52db488 docs: fix typo 2024-02-24 11:30:39 +09:00
Yu Watanabe d0a337bb72 sd-dhcp,sd-ndisc: drop mistakenly set copyright
Follow-ups for
  6efa51f862 (sd-dhcp-client-id.h),
  97c3506dcd (sd-dhcp-duid.h),
  461dbb2fa9 (sd-dhcp-option.h),
  dd8ab4a206 (sd-dhcp-server-lease.h),
  ca34b43481 (sd-ndisc-protocol.h and sd-ndisc-router.h).
2024-02-23 10:09:26 +01:00
Yu Watanabe 3976c43092 network: introduce per-interface IP forwarding settings
This deprecates IPForward= setting, which unconditionally controled
the global setting, even though it is a setting in .network file.

Instead, this introduces new IPv4Forwarding= and IPv6Forwarding=
settings both in .network and networkd.conf.
If these settings are specified in a .network file, then the
per-interface forwarding setting will be configured.
If specified in networkd.conf, then the global IP forwarding setting will
be configured.

Closes #30648.
2024-02-22 19:24:12 +00:00
Yu Watanabe 189eeddaec sd-ndisc: actually refuse RA message from null address 2024-02-22 14:35:24 +09:00
Yu Watanabe e7cb80474d sd-ndisc: disable timer event source only when a valid RA received
Fixes #31439.
2024-02-22 14:35:24 +09:00
Yu Watanabe be66a80bc2 Merge pull request #31409 from ssahani/macvlan
netdev: macvlan - Allow to set the broadcast queueing threshold
2024-02-22 12:40:54 +09:00
Yu Watanabe 0183d48ddb test-network: use assertIn() 2024-02-22 09:46:45 +09:00
Yu Watanabe 9a7c555c68 Merge pull request #31429 from poettering/pcrlock-hash-order-fix
pcrlock: handle cases where order of hash algs in firmware binary logs differs in header and records
2024-02-22 08:29:56 +09:00
Yu Watanabe 0584e2aa7c Merge pull request #31425 from YHNdnzj/fd-util-followup
fd-util: introduce fd_verify_safe_flags
2024-02-22 08:29:11 +09:00
Yu Watanabe 46be112082 Merge pull request #31403 from yuwata/pam-sd-bus-session
pam_systemd_home: close sd-bus connection on failure
2024-02-22 08:28:38 +09:00
Yu Watanabe c6939752c1 basic/linux: update kernel headers from v6.8-rc5 2024-02-22 06:22:22 +08:00
Yu Watanabe 6e2343c714 network/json: use DUID obtained by sd_dhcp6_client_get_duid()
Follow-up for e5aa8c193d.
2024-02-22 05:58:59 +09:00
Yu Watanabe 3c6d9d1c39 Merge pull request #31405 from yuwata/network-ndisc-reachable-time
network/ndisc: set neighbor reachable time
2024-02-21 14:29:01 +09:00
Yu Watanabe a6a6197e9d pam_systemd_home: always close already opened bus connection in open_session()
Fixes #31375.
2024-02-21 13:22:54 +09:00
Yu Watanabe 0324e3d045 pam_systemd_home: open sd-bus session when necessary
No functional change, just refactoring.
2024-02-21 12:45:32 +09:00
Yu Watanabe 9891f1d371 pam-util: add one more debugging log about sd-bus connection
Continuation of b5b2510800.
2024-02-21 12:09:21 +09:00
Yu Watanabe 9e39d0a32a Merge pull request #31408 from mrc0mmand/verify-unit-files-v2
test: verify our own units (where applicable)
2024-02-21 12:01:48 +09:00
Yu Watanabe 142f0e9517 analyze: skip to check ExecCommand for .mount and .swap units
They are not set by a unit file, but dynamically generated.

Fixes a bug caused by abf0ccc1c6.

Fixes #31396.
2024-02-20 11:59:10 +00:00
Yu Watanabe 1452d49741 network/ndisc: set IPv6 neighbor reachable time
Closes #31402.
2024-02-20 15:31:39 +09:00
Yu Watanabe a68f007a23 sd-ndisc: introduce sd_ndisc_router_get_reachable_time() 2024-02-20 15:31:39 +09:00
Yu Watanabe ffef01acdd network/ndisc: ignore most fields of RA header when lifetime is zero 2024-02-20 15:31:39 +09:00
Yu Watanabe 479d3e1994 network/ndisc: drop configurations when received RA with zero lifetime 2024-02-20 15:31:39 +09:00
Yu Watanabe 828b5dbf2f sd-ndisc: allow to call sd_ndisc_router_get_lifetime() with NULL for 'ret' 2024-02-20 15:31:39 +09:00
Yu Watanabe 787e71e432 sd-ndisc: introduce sd_ndisc_is_running() 2024-02-20 15:30:49 +09:00
Yu Watanabe ca34b43481 sd-ndisc: split sd-ndisc.h into small pieces 2024-02-20 15:30:49 +09:00
Yu Watanabe 4b6d8de09c home: fix typo
Follow-up for 25c89b8977 and
a4d72746c7.
2024-02-20 09:25:30 +09:00
Yu Watanabe 5ad2874b24 vconsole-setup: fix typo
Follow-up for 190ff0d0a8.
2024-02-20 09:23:18 +09:00
Yu Watanabe c6c7c461a3 resolve: several follow-ups for resolving service via varlink
Follow-ups for e1634bb832.

- Allow to call the method without "name" and "type".
- Allow to specify SD_RESOLVE_NO_TXT and SD_RESOLVE_NO_ADDRESS.
- Allow to provide multiple services, and fix memory leak.
- Rearrange the return value format.
- Encode TXT field with octescape() to make the field matches with the
  io.systemd.Resolve.Monitor interface.

Fixes #31371.
2024-02-19 22:13:07 +01:00
Yu Watanabe ac63c8df30 sd-radv: fix potential buffer overflow
Fixes a bug in 1925f829ab and
6a6d27bc5b (v255).
2024-02-19 10:16:36 +00:00
Yu Watanabe b5b2510800 pam-util: include cache ID of bus connection in the log message
To make it easier to debug issues like #31375.
2024-02-19 10:15:33 +00:00
Yu Watanabe d42b81f93f core/exec: do not crash with UtmpMode=user without User= setting
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=2264404.

Replaces #31356.
2024-02-19 10:51:00 +01:00
Yu Watanabe ff509772f1 TODO: fix typo
Follow-up for 10e3f15ac1.
2024-02-18 07:15:01 +09:00
Yu Watanabe 20fedbe32b Merge pull request #31318 from mrc0mmand/test-switch-to-btrfs
test: use btrfs by default on Arch as well
2024-02-18 04:55:56 +09:00
Yu Watanabe 9736839d0c Merge pull request #31362 from yuwata/network-fix-dhcp-pd-ready
network: do not request DHCP addresses configured on checking prefix delegation
2024-02-18 04:55:13 +09:00
Yu Watanabe 3b677c6f94 test-network: add one more test case for DHCP prefix delegation
For issue #31349.
2024-02-17 11:48:25 +00:00
Yu Watanabe ab06b74fd3 test-network: split test_dhcp6pd() into small pieces 2024-02-17 11:48:25 +00:00
Yu Watanabe b4054aff24 network: do not request DHCP addresses configured on checking prefix delegation
This does not change anything for DHCPv4, as a DHCPv4 address is always
requested anyway. However for DHCPv6, the client may not request IA_NA
addresses by UseAddress=no, or even if it is requested, the server may
not provide any IA_NA addresses. Even in such cases, here the check is
for delegated prefixes, hence it is not necessary to check if DHCPv6
IA_NA addresses are configured.

Fixes a bug introduced by 195b83edf8.

Fixes #31349.
2024-02-17 11:48:25 +00:00
Yu Watanabe 43a752669e network/dhcp6: deem DHCPv6 configuration to be finished even if no IA_NA is provided
Follow-up for fc4aa64c2d.

Otherwise, even if we request no address, Link.dhcp6_configured stuck on
false.
2024-02-17 11:48:25 +00:00
Yu Watanabe 160d636ff4 resolve: name field may be NULL
Follow-up for e1634bb832.

Fixes #31361.
2024-02-17 10:22:53 +00:00
Yu Watanabe ad48cc6f81 core/unit: fix superficial NULL-pointer dereference
Though, when unit_prepare_exec() is called, the unit should always
have the cgroup runtime context 'crt'. So, I think we can insert assert().
But, for consistency with other places that call unit_get_cgroup_runtime(),
here use the simple non-NULL check for 'crt' instead of using assert().

Follow-up for 9cc545447e.

Fixes CID#1534667.
2024-02-17 16:50:46 +09:00
Yu Watanabe e7cf5c82da core/cgroup: drop duplicated free()s
Follow-up for 9cc545447e.

Fixes CID#1534665 and CID#1534666.
2024-02-17 16:46:19 +09:00
Yu Watanabe e21dd22040 Merge pull request #31338 from ssahani/network-bond-missed
network: netdev - bond add support for ARP missed max
2024-02-17 06:16:42 +09:00
Yu Watanabe 18d4e475c7 journal-file-util: use COPY_VERIFY_LINKED
As the main thread may call journal_directory_vacuum() ->
unlinkat_deallocate() while another thread is copying the file.

Fixes #24150 and #31222.
2024-02-16 03:48:18 +09:00
Yu Watanabe 72ef2a617f copy: introduce COPY_VERIFY_LINKED flag
If the flag is set, then copy_file() and friends check if the source
file still exists when the copy operation finished.
2024-02-16 03:48:18 +09:00
Yu Watanabe cb0d5f73e6 sd-journal: use stat_verify_linked() 2024-02-16 03:48:18 +09:00
Yu Watanabe a6d0cf939c stat-util: introduce {stat,fd}_verify_linked() 2024-02-16 03:48:18 +09:00
Yu Watanabe dd7fa015a6 stat-util: rebreak comment 2024-02-16 03:48:18 +09:00
Yu Watanabe f0455cec53 bsod: fix -c/--continuous support
Fixes a bug introduced by f7f062bf9f.

Fixes #31334.
2024-02-16 02:21:11 +09:00
Yu Watanabe 3900255ac1 Merge pull request #31331 from yuwata/xopenat
tree-wide: several cleanups related to xopenat()
2024-02-16 01:32:21 +09:00