]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network: don't warn with no NSID assigned
authorRonan Pigott <ronan@rjp.ie>
Sat, 14 Dec 2024 21:39:26 +0000 (14:39 -0700)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 15 Dec 2024 00:09:26 +0000 (09:09 +0900)
This is nothing interesting to warn about. Also use the symbolic
constant name when testing for this condition.

src/network/networkd-manager-bus.c
src/shared/socket-netlink.c

index 04a986a38d983b02f8c2e49240ae963510d03c45..29e589525507aee98cd42dd12e6b5dff9506344d 100644 (file)
@@ -304,7 +304,7 @@ static int property_get_namespace_nsid(
          * number. */
 
         r = netns_get_nsid(/* netnsfd= */ -EBADF, &nsid);
-        if (r < 0)
+        if (r < 0 && r != -ENODATA)
                 log_warning_errno(r, "Failed to query network nsid, ignoring: %m");
 
         return sd_bus_message_append(reply, "u", nsid);
index 09477449b98a5d5914423c088da62e078ea9371e..b0500abd8b140e87d7d29c11429b28cf346ec02b 100644 (file)
@@ -475,7 +475,7 @@ int netns_get_nsid(int netnsfd, uint32_t *ret) {
                 if (r < 0)
                         return r;
 
-                if (u == UINT32_MAX) /* no NSID assigned yet */
+                if (u == (uint32_t) NETNSA_NSID_NOT_ASSIGNED) /* no NSID assigned yet */
                         return -ENODATA;
 
                 if (ret)