[PATCH kexec-tools 2/2] kexec/ifdown.c: Hide error if sockets are disabled

Mason Rocha mrocha at turretllc.us
Tue Oct 21 19:07:04 PDT 2025


Prevents the message "Function not implemented" from being logged when
a system with networking support disabled, as there couldn't possibly be
any interfaces to bring down to the point where we need to make sure the
user knows that the interfaces were not brought down.

Signed-off-by: Mason Rocha <mrocha at turretllc.us>
---
 kexec/ifdown.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/kexec/ifdown.c b/kexec/ifdown.c
index 6a60bcb..e6ea0ae 100644
--- a/kexec/ifdown.c
+++ b/kexec/ifdown.c
@@ -32,8 +32,10 @@ int ifdown(void)
 	int fd, shaper;
 
 	if ((fd = socket(AF_NETLINK, SOCK_DGRAM, 0)) < 0) {
-		fprintf(stderr, "ifdown: ");
-		perror("socket");
+		if(errno != ENOSYS) {
+			fprintf(stderr, "ifdown: ");
+			perror("socket");
+		}
 		goto error;
 	}
 
-- 
2.51.0




More information about the kexec mailing list