Commit Graph
100 Commits
Author SHA1 Message Date
Yu Watanabe ffc36c276c efi: drop glibc header and use pre-defined macros
This reverts 72dc626b3d and replace glibc
specific macros with compiler's pre-defined macros.
2021-06-03 13:49:33 +09:00
Yu Watanabe 2255e8adee sd-device: do not use ::subsystem member directly
The value is set dynamically when sd_device_get_subsystem() is called
first time.

Fixes the following issue:
```
$ build/udevadm test /sys/class/block/dm-1
...
Assertion '_subsystem' failed at src/libsystemd/sd-device/sd-device.c:767, function device_set_subsystem(). Aborting.
Program received signal SIGABRT, Aborted.
```
2021-06-03 05:59:03 +09:00
Yu Watanabe f0273cba25 Merge pull request #19798 from bluca/todo_landlock
Add new item to TODO list
2021-06-03 03:37:33 +09:00
Yu Watanabe a884774635 Merge pull request #19792 from keszybz/more-logging-stuff
More logging tweaks
2021-06-03 03:36:28 +09:00
Yu Watanabe 63b8a781b6 Merge pull request #19791 from yuwata/udev-node-logs
udev: update several log messages
2021-06-03 01:32:29 +09:00
Yu Watanabe 7b80829575 udev: upgrade log level about failure in updating devlinks 2021-06-02 21:00:45 +09:00
Yu Watanabe cd8bcff507 udev: check that passed symbolic link path starts with /dev 2021-06-02 21:00:22 +09:00
Yu Watanabe d46969072a udev: explicitly mention that the error will be ignored
See #19788.
2021-06-02 19:15:02 +09:00
Yu Watanabe 6be1feb1d7 udev: ignore the case that the device is already removed
See #19788.
2021-06-02 19:10:52 +09:00
Yu Watanabe 7bbcaee307 cryptsetup: fix typo 2021-06-02 11:35:14 +02:00
Yu Watanabe 505ab9dda2 meson: sort compiler flags 2021-06-02 15:53:29 +09:00
Yu Watanabe 6526736397 meson: enable more warnings when building efi binary 2021-06-02 15:49:44 +09:00
Yu Watanabe ca474d5114 efi: constify several arguments of functions which handle loader entries 2021-06-02 15:45:47 +09:00
Yu Watanabe cfb7fa289d efi: drop const qualifiers from arguments in uefi_call_wrapper() 2021-06-02 15:43:21 +09:00
Yu Watanabe edad24c61e efi: add const qualifier to EFI variable handling functions 2021-06-02 15:41:39 +09:00
Yu Watanabe ef53d52b01 efi: add const qualifier to string utils 2021-06-02 15:40:56 +09:00
Yu Watanabe 72dc626b3d efi: include endian.h to handle endian correctly
The macro __BYTE_ORDER__ is defined in endian.h.
2021-06-02 15:38:32 +09:00
Yu Watanabe 959ab90bbc efi: do not use _STRING_ARCH_unaligned macro
It is already removed from glibc. See,
https://sourceware.org/git/?p=glibc.git;a=commit;h=16396c41deab45f715ffd813280d9d685b3b281e
https://sourceware.org/git/?p=glibc.git;a=commit;h=09a596cc2cf4e0f9f8e9f3bba4b1a97efcb13bcb
2021-06-02 15:36:29 +09:00
Yu Watanabe 122dbd92c9 string-util: trivial optimizations for strverscmp_improved() 2021-06-02 14:20:25 +09:00
Yu Watanabe a8f76a8db7 Merge pull request #19766 from keszybz/fuzz-fixes
Fuzz fixes
2021-06-01 11:14:45 +09:00
Yu Watanabe d65c5d04f9 Merge pull request #19759 from poettering/emoji-token-text
fido2: add emoji to log message whenever "up" or "uv" is requested
2021-05-29 13:42:48 +09:00
Yu Watanabe 304e637c88 Merge pull request #19754 from yuwata/fix-coverity-issues-and-typo
Fix coverity issues and typo
2021-05-28 23:03:01 +09:00
Yu Watanabe 48008c1cbf tree-wide: fix typo 2021-05-28 19:52:12 +09:00
Yu Watanabe 7f1238bd04 basic/unit-file: fix use-after-free
This fixes a bug introduced by e8630e6952.

Fixes CID#1453292.
2021-05-28 19:48:38 +09:00
Yu Watanabe a04842dfb2 network,sd-hwdb: voidify fchmod()
Fixes CID#1453294.
2021-05-28 19:41:07 +09:00
Yu Watanabe 50fd596efc path-util: add missing varargs cleanup
Fixes CID#1453293.
2021-05-28 19:38:37 +09:00
Yu Watanabe cb71ed91f7 path-util: make path_simplify() use path_find_first_component() 2021-05-28 13:44:38 +09:00
Yu Watanabe 4ff361cc86 tree-wide: always drop unnecessary dot in path 2021-05-28 13:44:38 +09:00
Yu Watanabe 0195046449 path-util: make path_extract_filename/directory() handle "." gracefully
This makes the functions handle "xx/" and "xx/." as equivalent.
Moreover, now path_extract_directory() returns normalized path, that is
no redundant "/" or "/./" are contained.
2021-05-28 13:44:38 +09:00
Yu Watanabe 484cd43cae path-util: introduce path_find_last_component() 2021-05-28 13:44:38 +09:00
Yu Watanabe 15bac3e8fd path-util: use path_equal() in empty_or_root() 2021-05-28 13:44:38 +09:00
Yu Watanabe 39d7af99c2 fs-util: make chase_symlinks() use path_find_first_component()
The previous commit about path_compare() breaks chase_symlinks().
This commit fixes it.
2021-05-28 13:44:19 +09:00
Yu Watanabe 353df4438e path-util: make path_compare() and path_hash_func() ignore "."
This also makes path_compare() may return arbitrary integer as it now
simply pass the result of strcmp() or memcmp().

This changes the behavior of path_extract_filename/directory() when
e.g. "/." or "/./" are input. But the change should be desired.
2021-05-28 13:41:23 +09:00
Yu Watanabe fe69c41ee8 path-util: use path_find_first_component() in path_make_relative()
This also makes the function checks the result is a valid path or not.
2021-05-28 13:41:23 +09:00
Yu Watanabe 63f11e354a path-util: use path_find_first_component() in path_startswith()
This makes path_startswith() stricter. If one of the path component in
arguments is longer than NAME_MAX, it returns NULL.
2021-05-28 13:41:23 +09:00
Yu Watanabe 0b8696256b path-util: use path_is_safe() in path_is_normalized() 2021-05-28 13:41:23 +09:00
Yu Watanabe 32df2e1447 path-util: introduce path_is_safe()
The function is similar to path_is_valid(), but it refuses paths which
contain ".." component.
2021-05-28 13:41:23 +09:00
Yu Watanabe 6636883564 path-util: use path_find_first_component() in path_is_valid() 2021-05-28 13:41:23 +09:00
Yu Watanabe 0ee54dd4e2 path-util: introduce path_find_first_component()
The function may be useful to iterate on each path component.
2021-05-28 13:41:23 +09:00
Yu Watanabe 340cd6b6f9 path-util: fix off by one issue to detect slash at the end in path_extend() 2021-05-28 13:41:23 +09:00
Yu Watanabe 4e95bc56df Merge pull request #19749 from poettering/path-extend
add path_extend() helper which is a like if path_join() and strextend() had a baby
2021-05-28 05:53:57 +09:00
Yu Watanabe 38dd7673b3 Merge pull request #19703 from yuwata/network-ndisc-valid-time
network: ndisc: always honor valid time
2021-05-27 18:42:31 +09:00
Yu Watanabe facaf083f0 Merge pull request #19743 from yuwata/dhcpv4-static-leases
network: dhcp-server:  support static lease
2021-05-27 18:41:22 +09:00
Yu Watanabe a19b1ac7c8 network: ndisc: update log message 2021-05-27 16:33:36 +09:00
Yu Watanabe 25db3aeaf3 network: ndisc: always honor valid time
See draft-ietf-6man-slaac-renum-02, section 4.2.
https://datatracker.ietf.org/doc/html/draft-ietf-6man-slaac-renum#section-4.2

Replaces #15260.
2021-05-27 16:33:33 +09:00
Yu Watanabe e954939b9e Merge pull request #19736 from poettering/udev-trigger-uuid
sd-device: add support for triggering devices with UUID support
2021-05-27 13:05:00 +09:00
Yu Watanabe 06043c7821 test-network: refuse RA if not necessary 2021-05-26 21:22:13 +09:00
Yu Watanabe 618da3e7d5 test-network: wait for that the link is in configuring state at the beginning 2021-05-26 21:13:56 +09:00
Yu Watanabe 89c629fc4b Merge pull request #19726 from poettering/path-event-symlink
teach .path units to notice events on paths with components that are symlinks
2021-05-26 10:51:00 +09:00
Yu Watanabe b69855e645 Merge pull request #19727 from poettering/pcr-comma
Allow PCRs to be separated by "+" instead of ","
2021-05-26 10:37:24 +09:00
Yu Watanabe 95599cacd3 core/service: do not set zero error to log_unit_debug_errno()
Fixes #19725.
2021-05-26 10:23:36 +09:00
Yu Watanabe 764dca0edc dns-domain: fix build failure with libidn
Follow-up for 319a4f4bc4.

Fixes #19723.
2021-05-26 10:23:36 +09:00
Yu Watanabe 13eeefe1a8 Merge pull request #19716 from yuwata/sd-netlink-NETLINK_GET_STRICT_CHK
sd-netlink: enable NETLINK_GET_STRICT_CHK socket option to filter out message on kernel
2021-05-25 22:38:59 +09:00
Yu Watanabe 5de0d10bee Merge pull request #19715 from yuwata/network-link-group
network: allow to set Group=0 in [Link] section
2021-05-25 13:29:50 +09:00
Yu Watanabe 5709c7fe4e Merge pull request #19713 from nabijaczleweli/bootctlpsko-liter
The "obviously good stuff" from #19006 again
2021-05-25 08:31:38 +09:00
Yu Watanabe 922a653090 test: add testcases of filtering on dumping addresses 2021-05-25 08:26:00 +09:00
Yu Watanabe 6a28b78f2e local-addresses: set ifindex when dump addresses on an interface 2021-05-25 08:26:00 +09:00
Yu Watanabe c31298be7a network: set ifindex when dump addresses on an interface 2021-05-25 08:26:00 +09:00
Yu Watanabe d7418b3bb2 sd-netlink: set NETLINK_GET_STRICT_CHK socket option
Then kernel filters out unnecessary info on dumping, e.g. RTM_GETADDR.
2021-05-25 08:26:00 +09:00
Yu Watanabe 3e0eeb8e33 sd-netlink: do not set route type and table by default for RTM_GETROUTE or friends 2021-05-25 08:26:00 +09:00
Yu Watanabe 3ca619061d sd-netlink: do not set action for RTM_GETRULE message
Otherwise, when NETLINK_GET_STRICT_CHK socket option is enabled, no rule
will be dumped.
2021-05-25 08:26:00 +09:00
Yu Watanabe f318f64388 sd-netlink: do not enable dump flag by default for RTM_GETADDR message 2021-05-25 08:26:00 +09:00
Yu Watanabe 97bb863c25 sd-netlink: do not append prefixlen by default
Otherwise, when NETLINK_GET_STRICT_CHK socket option is enabled, no
address will be dumped.
2021-05-25 08:26:00 +09:00
Yu Watanabe 5aafd5b190 network: add several assertions in conf parsers 2021-05-25 07:12:05 +09:00
Yu Watanabe f0c09831bd network: allow to set Group=0 in [Link] section
Previously, when a link has already in a numbered group, we cannot
remove the link from the group.

This also fixes the range mentioned in the man page.
2021-05-25 07:12:05 +09:00
Yu Watanabe 113d94c393 Merge pull request #19704 from yuwata/network-small-fixes
network: several tiny cleanups
2021-05-23 23:02:07 +09:00
Yu Watanabe 70f32a260b udev/net: do not manage loopback interfaces
There are nothing we can configure in udevd for loopback interfaces;
no ethertool configs can be applied, MAC address, interface name should
not be touched.
2021-05-23 22:58:47 +09:00
Yu Watanabe f25e642bca sd-netlink: rename rtnl_get_link_iftype() -> rtnl_get_link_info() and make it optionally return link flags 2021-05-23 22:58:03 +09:00
Yu Watanabe ce01c07f1c udev/net: rename link_config -> LinkConfig 2021-05-23 22:58:03 +09:00
Yu Watanabe afca7ac13d udev/net: rename link_config_ctx -> LinkConfigContext 2021-05-23 22:58:03 +09:00
Yu Watanabe 75d5abd298 network: IPv6LinkLocalAddressGenerationMode=none disables IPv6LL addressing 2021-05-23 17:13:06 +09:00
Yu Watanabe c3b9425130 network: make link_configure() static 2021-05-23 17:12:48 +09:00
Yu Watanabe fbb1a39866 ordered-set: introduce ordered_set_get() 2021-05-23 17:12:40 +09:00
Yu Watanabe 2a5a844259 Merge pull request #19681 from yuwata/ethtool-util-log
ethtool-util: several cleanups
2021-05-23 15:24:46 +09:00
Yu Watanabe 3ee316bd7b ethtool-util: drop unused function 2021-05-23 11:40:15 +09:00
Yu Watanabe 80662eecbf udev/net: drop unnecessary conditions 2021-05-23 11:40:15 +09:00
Yu Watanabe a7994dd3ab udev/net: drop fallback logic to set speed
ethtool_set_glinksettings() already fallback to use ETHTOOL_GSET/ETHTOOL_SSET
commands when ETHTOOL_GLINKSETTINGS/ETHTOOL_SLINKSETTINGS are not
supported.
2021-05-23 11:40:15 +09:00
Yu Watanabe ba1030594e ethtool-util: do not touch anything if nothing is requested
And update settings only when it is necessary.
2021-05-23 11:40:15 +09:00
Yu Watanabe c8e644b116 ethtool-util: disable autonegotiation when speed, duplex, or port is specified
And if autonegotiation is enabled, speed, duplex, and port are ignored.

Fixes #19625.
2021-05-23 11:40:15 +09:00
Yu Watanabe 4323046c5f ethtool-util: move and rebreak comments 2021-05-23 11:40:15 +09:00
Yu Watanabe 4f5040313d ethtool-util: make ethtool_connect() open fd only when it is not opened 2021-05-23 11:39:56 +09:00
Yu Watanabe af92e46527 Merge pull request #19594 from yuwata/network-nexthop-group
network: nexthop: add Group= setting to configure multipath route with group nexthop
2021-05-22 16:01:13 +09:00
Yu Watanabe a6c747a63f Merge pull request #19691 from poettering/read-virtual-file-tweaks
tweaks to read_virtual_file()
2021-05-22 15:59:17 +09:00
Yu Watanabe 9c8f90d0f9 test-network: add a test case for nexthop Group= setting 2021-05-22 04:59:45 +09:00
Yu Watanabe 228c3e21e9 network: nexthop: add Group= setting to configure multipath route with group nexthop 2021-05-22 04:59:40 +09:00
Yu Watanabe 8031e5ca8d network: nexthop: IFF_UP flag is required for nexthops which attached to a link 2021-05-22 04:56:46 +09:00
Yu Watanabe 7b3a7581e3 network: make nexthop_add(), nexthop_configure() and friends return 0 on success
After request queue is introduced, the return value on success is unused.
2021-05-22 04:56:46 +09:00
Yu Watanabe 234106dbf9 network: route: make stored multipath route weight equivalent to hop of nexthop 2021-05-22 04:54:09 +09:00
Yu Watanabe 11a288e846 ethtool-util: downgrade log level
This just hides issue #19625. It will be fixed in later commits.
2021-05-22 04:40:54 +09:00
Yu Watanabe e8f99f4e24 network: fix an infinite loop
Fixes #19467.
2021-05-21 12:03:01 +09:00
Yu Watanabe e6655fbe40 man: mention that drop-in files are merged in alphanumeric order
This addresses the request in https://github.com/systemd/systemd/issues/19467#issuecomment-829332877.
2021-05-20 21:20:51 +02:00
Yu Watanabe 580bf61304 sysv-generator: use strextend_with_separator() 2021-05-20 21:57:09 +09:00
Yu Watanabe 742a011a3a systemctl: use strextend_with_separator() 2021-05-20 21:57:09 +09:00
Yu Watanabe eda397c966 run: use strextend_with_separator() 2021-05-20 21:57:09 +09:00
Yu Watanabe cfea7618f2 nspawn: use strextendf_with_separator() 2021-05-20 21:57:04 +09:00
Yu Watanabe db5486b450 test-network: add a testcase for OutgoingInterface= in [BridgeFDB] 2021-05-20 18:23:15 +09:00
Yu Watanabe e5b35bf6c2 network: use queue to configure bridge FDB 2021-05-20 18:23:15 +09:00
Yu Watanabe 9671ae9d51 network: bridgeFDB: rename FdbEntry -> BridgeFDB 2021-05-20 18:23:15 +09:00
Yu Watanabe 4ff6ff9a91 networkctl: use strextend() 2021-05-20 18:18:56 +09:00
Yu Watanabe 03c324c578 sd-bus: use strextend() 2021-05-20 18:18:56 +09:00