]> 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)
committerLuca Boccassi <luca.boccassi@gmail.com>
Fri, 20 Dec 2024 19:43:57 +0000 (19:43 +0000)
This is nothing interesting to warn about. Also use the symbolic
constant name when testing for this condition.

(cherry picked from commit e803e95760be87588533f9affd76db6ad0b5fac8)
(cherry picked from commit 0cddbebfbeedd3f71037d988dc91b6fb9f9b281f)

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

index 3c3d815a4afa6a98e5577ebdf6e702f4873d8b07..7a32f99f96ffb980f9dc8acf29c42ebf69efe3bd 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 a126d5d73b1eac40a1321ebbb786223f07570f4f..25f2bc509ce4ebe8e62b2131f31b4c2557b4f7cf 100644 (file)
@@ -466,7 +466,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)