]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network: actually show the unexpected flags
authorFrantisek Sumsal <frantisek@sumsal.cz>
Mon, 11 Dec 2023 15:16:02 +0000 (16:16 +0100)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 12 Dec 2023 09:56:43 +0000 (18:56 +0900)
The original version would yield a slightly _unexpected_ message for
this [Address] section:

[Address]
Address=10.9.3.1/24
HomeAddress=yes
ManageTemporaryAddress=yes

systemd-networkd[68396]: /run/systemd/network/25-address-static.network: unexpected address flags "n/a" were configured. Ignoring [Address] section from line 144.

Let's instead show the unexpected flags:

systemd-networkd[69160]: /run/systemd/network/25-address-static.network: unexpected address flags "home-address,manage-temporary-address" were configured. Ignoring [Address] section from line 144.

src/network/networkd-address.c

index c0dff888e0929ba52fc78480b19222be3d0397f7..124f0e08044cf957fecd2fff10ab959fe7b5700b 100644 (file)
@@ -2472,7 +2472,7 @@ int address_section_verify(Address *address) {
         if (address->flags != filtered_flags) {
                 _cleanup_free_ char *str = NULL;
 
-                (void) address_flags_to_string_alloc(filtered_flags, address->family, &str);
+                (void) address_flags_to_string_alloc(address->flags ^ filtered_flags, address->family, &str);
                 return log_warning_errno(SYNTHETIC_ERRNO(EINVAL),
                                          "%s: unexpected address flags \"%s\" were configured. "
                                          "Ignoring [Address] section from line %u.",