Re: [PATCH net] net: Implement missing getsockopt(SO_TIMESTAMPING_NEW)

From: Willem de Bruijn
Date: Fri Dec 22 2023 - 10:04:04 EST


Jörn-Thorben Hinz wrote:
> Commit 9718475e6908 ("socket: Add SO_TIMESTAMPING_NEW") added the new
> socket option SO_TIMESTAMPING_NEW. Setting the option is handled in
> sk_setsockopt(), querying it was not handled in sk_getsockopt(), though.
>
> Following remarks on an earlier submission of this patch, keep the old
> behavior of getsockopt(SO_TIMESTAMPING_OLD) which returns the active
> flags even if they actually have been set through SO_TIMESTAMPING_NEW.
>
> The new getsockopt(SO_TIMESTAMPING_NEW) is stricter, returning flags
> only if they have been set through the same option.
>
> Fixes: 9718475e6908 ("socket: Add SO_TIMESTAMPING_NEW")
> Link: https://lore.kernel.org/lkml/20230703175048.151683-1-jthinz@xxxxxxxxxxxxxxxxxxxx/
> Link: https://lore.kernel.org/netdev/0d7cddc9-03fa-43db-a579-14f3e822615b@xxxxxxxxxxxxxxxx/
> Signed-off-by: Jörn-Thorben Hinz <jthinz@xxxxxxxxxxxxxxxxxxxx>

Reviewed-by: Willem de Bruijn <willemb@xxxxxxxxxx>