packet: fix second argument of sock_tx_timestamp()

This patch fixes an issue that a syscall (e.g. sendto syscall) cannot
work correctly. Since the sendto syscall doesn't have msg_control buffer,
the sock_tx_timestamp() in packet_snd() cannot work correctly because
the socks.tsflags is set to 0.
So, this patch sets the socks.tsflags to sk->sk_tsflags as default.

Fixes: c14ac9451c34 ("sock: enable timestamping using control messages")
Reported-by: Kazuya Mizuguchi <>
Reported-by: Keita Kobayashi <>
Signed-off-by: Yoshihiro Shimoda <>
Acked-by: Soheil Hassas Yeganeh <>
Acked-by: Willem de Bruijn <>
Signed-off-by: David S. Miller <>
1 file changed