]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
ssh-generator: suppress error message for vsock EADDRNOTAVAIL 39785/head
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 18 Nov 2025 10:37:59 +0000 (11:37 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 19 Nov 2025 10:37:49 +0000 (11:37 +0100)
In logs in the Fedora OpenQA CI:
Nov 17 22:20:06 fedora systemd-ssh-generator[4117]: Failed to query local AF_VSOCK CID: Cannot assign requested address
Nov 17 22:20:06 fedora (generato[4088]: /usr/lib/systemd/system-generators/systemd-ssh-generator failed with exit status 1.
Nov 17 22:20:06 fedora systemd[1]: sshd-vsock.socket: Unit configuration changed while unit was running, and no socket file descriptors are open. Unit not functional until restarted.

AF_VSOCK is not configured there and systemd-ssh-generator should just exit
quietly. vsock_get_local_cid() already does some logging at debug level, so we
don't need to.

There is also a second bug, we report modifications to the unit have just
created. I think we have an issue open for this somewhere, but cannot find it.

src/ssh-generator/ssh-util.c

index d414713486658fcf91b5ddee462d63d97d5caf91..48cb662b71026e3ab5c38f77666195d33522a5b9 100644 (file)
@@ -27,8 +27,9 @@ int vsock_get_local_cid_or_warn(unsigned *ret) {
         int r;
 
         r = vsock_get_local_cid(ret);
-        if (ERRNO_IS_NEG_DEVICE_ABSENT(r)) {
-                log_debug_errno(r, "/dev/vsock is not available (even though AF_VSOCK is), ignoring: %m");
+        if (ERRNO_IS_NEG_DEVICE_ABSENT(r) || r == -EADDRNOTAVAIL) {
+                if (ERRNO_IS_NEG_DEVICE_ABSENT(r))
+                        log_debug_errno(r, "/dev/vsock is not available (even though AF_VSOCK is), ignoring: %m");
                 if (ret)
                         *ret = 0;  /* bogus value */
                 return 0;