[PATCH net] net: Implement missing SO_TIMESTAMPING_NEW cmsg support

Thomas Lange posted 1 patch 1 year, 11 months ago
There is a newer version of this series
net/core/sock.c | 1 +
1 file changed, 1 insertion(+)
[PATCH net] net: Implement missing SO_TIMESTAMPING_NEW cmsg support
Posted by Thomas Lange 1 year, 11 months ago
Commit 9718475e6908 ("socket: Add SO_TIMESTAMPING_NEW") added the new
socket option SO_TIMESTAMPING_NEW. However, it was never implemented in
__sock_cmsg_send thus breaking SO_TIMESTAMPING cmsg for platforms using
SO_TIMESTAMPING_NEW.

Fixes: 9718475e6908 ("socket: Add SO_TIMESTAMPING_NEW")
Link: https://lore.kernel.org/netdev/6a7281bf-bc4a-4f75-bb88-7011908ae471@app.fastmail.com/
Signed-off-by: Thomas Lange <thomas@corelatus.se>
---
  net/core/sock.c | 1 +
  1 file changed, 1 insertion(+)

diff --git a/net/core/sock.c b/net/core/sock.c
index 51d52859e942..d02534c77413 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -2813,6 +2813,7 @@ int __sock_cmsg_send(struct sock *sk, struct cmsghdr *cmsg,
  		sockc->mark = *(u32 *)CMSG_DATA(cmsg);
  		break;
  	case SO_TIMESTAMPING_OLD:
+	case SO_TIMESTAMPING_NEW:
  		if (cmsg->cmsg_len != CMSG_LEN(sizeof(u32)))
  			return -EINVAL;

--
2.39.2
Re: [PATCH net] net: Implement missing SO_TIMESTAMPING_NEW cmsg support
Posted by Jakub Kicinski 1 year, 11 months ago
On Tue, 2 Jan 2024 22:13:50 +0100 Thomas Lange wrote:
> Commit 9718475e6908 ("socket: Add SO_TIMESTAMPING_NEW") added the new
> socket option SO_TIMESTAMPING_NEW. However, it was never implemented in
> __sock_cmsg_send thus breaking SO_TIMESTAMPING cmsg for platforms using
> SO_TIMESTAMPING_NEW.
> 
> Fixes: 9718475e6908 ("socket: Add SO_TIMESTAMPING_NEW")
> Link: https://lore.kernel.org/netdev/6a7281bf-bc4a-4f75-bb88-7011908ae471@app.fastmail.com/
> Signed-off-by: Thomas Lange <thomas@corelatus.se>

patch looks mangled, could you resend with git send-email?
There are multiple spaces at the start of the diff lines.
-- 
pw-bot: cr
Re: [PATCH net] net: Implement missing SO_TIMESTAMPING_NEW cmsg support
Posted by Arnd Bergmann 1 year, 11 months ago
On Tue, Jan 2, 2024, at 22:13, Thomas Lange wrote:
> Commit 9718475e6908 ("socket: Add SO_TIMESTAMPING_NEW") added the new
> socket option SO_TIMESTAMPING_NEW. However, it was never implemented in
> __sock_cmsg_send thus breaking SO_TIMESTAMPING cmsg for platforms using
> SO_TIMESTAMPING_NEW.
>
> Fixes: 9718475e6908 ("socket: Add SO_TIMESTAMPING_NEW")
> Link: 
> https://lore.kernel.org/netdev/6a7281bf-bc4a-4f75-bb88-7011908ae471@app.fastmail.com/
> Signed-off-by: Thomas Lange <thomas@corelatus.se>

Cc: stable@vger.kernel.org
Acked-by: Arnd Bergmann <arnd@arndb.de>
Re: [PATCH net] net: Implement missing SO_TIMESTAMPING_NEW cmsg support
Posted by Willem de Bruijn 1 year, 11 months ago
Arnd Bergmann wrote:
> On Tue, Jan 2, 2024, at 22:13, Thomas Lange wrote:
> > Commit 9718475e6908 ("socket: Add SO_TIMESTAMPING_NEW") added the new
> > socket option SO_TIMESTAMPING_NEW. However, it was never implemented in
> > __sock_cmsg_send thus breaking SO_TIMESTAMPING cmsg for platforms using
> > SO_TIMESTAMPING_NEW.
> >
> > Fixes: 9718475e6908 ("socket: Add SO_TIMESTAMPING_NEW")
> > Link: 
> > https://lore.kernel.org/netdev/6a7281bf-bc4a-4f75-bb88-7011908ae471@app.fastmail.com/
> > Signed-off-by: Thomas Lange <thomas@corelatus.se>
> 
> Cc: stable@vger.kernel.org
> Acked-by: Arnd Bergmann <arnd@arndb.de>

Reviewed-by: Willem de Bruijn <willemb@google.com>