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

Simon Horman horms at kernel.org
Tue Nov 11 05:39:03 PST 2025


On Tue, Oct 21, 2025 at 09:07:04PM -0500, Mason Rocha wrote:
> 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) {

nit: I'd prefer a space between 'if' and '('

     I added one when applying this series.

> +			fprintf(stderr, "ifdown: ");
> +			perror("socket");
> +		}
>  		goto error;
>  	}
>  
> -- 
> 2.51.0
> 



More information about the kexec mailing list