[PATCH 4/7] linux: Fix setsockopt fallback

Florian Weimer fweimer@redhat.com
Mon Jul 5 19:07:54 GMT 2021


* Adhemerval Zanella via Libc-alpha:

> The final 2 arguments for SO_TIMESTAMP/SO_TIMESTAMPNS are being set
> wrongly.
>
> Checked on x86_64-linux-gnu and i686-linux-gnu.
> ---
>  sysdeps/unix/sysv/linux/setsockopt.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/sysdeps/unix/sysv/linux/setsockopt.c b/sysdeps/unix/sysv/linux/setsockopt.c
> index a4780a9d33..fae7305c9d 100644
> --- a/sysdeps/unix/sysv/linux/setsockopt.c
> +++ b/sysdeps/unix/sysv/linux/setsockopt.c
> @@ -78,7 +78,7 @@ setsockopt32 (int fd, int level, int optname, const void *optval,
>  	  optname = COMPAT_SO_TIMESTAMP_OLD;
>  	if (optname == COMPAT_SO_TIMESTAMPNS_NEW)
>  	  optname = COMPAT_SO_TIMESTAMPNS_OLD;
> -	r = setsockopt_syscall (fd, level, optname, NULL, 0);
> +	r = setsockopt_syscall (fd, level, optname, optval, len);
>        }
>        break;
>      }

Maybe add a comment that the recvmsg code does conversation, so the old
socket option is also acceptable?

The patch itself looks okay to me.

Thanks,
Florian



More information about the Libc-alpha mailing list