summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/alpha/include/uapi/asm/socket.h23
-rw-r--r--arch/mips/include/uapi/asm/socket.h23
-rw-r--r--arch/parisc/include/uapi/asm/socket.h23
-rw-r--r--arch/sparc/include/uapi/asm/socket.h24
-rw-r--r--include/uapi/asm-generic/socket.h23
-rw-r--r--net/compat.c6
-rw-r--r--net/core/sock.c16
-rw-r--r--net/ipv4/tcp.c6
-rw-r--r--net/rds/af_rds.c2
-rw-r--r--net/rds/recv.c2
-rw-r--r--net/rxrpc/local_object.c2
-rw-r--r--net/socket.c8
12 files changed, 101 insertions, 57 deletions
diff --git a/arch/alpha/include/uapi/asm/socket.h b/arch/alpha/include/uapi/asm/socket.h
index b1c9b542c021..992a0a6dcea1 100644
--- a/arch/alpha/include/uapi/asm/socket.h
+++ b/arch/alpha/include/uapi/asm/socket.h
@@ -51,13 +51,9 @@
51#define SO_GET_FILTER SO_ATTACH_FILTER 51#define SO_GET_FILTER SO_ATTACH_FILTER
52 52
53#define SO_PEERNAME 28 53#define SO_PEERNAME 28
54#define SO_TIMESTAMP 29
55#define SCM_TIMESTAMP SO_TIMESTAMP
56 54
57#define SO_PEERSEC 30 55#define SO_PEERSEC 30
58#define SO_PASSSEC 34 56#define SO_PASSSEC 34
59#define SO_TIMESTAMPNS 35
60#define SCM_TIMESTAMPNS SO_TIMESTAMPNS
61 57
62/* Security levels - as per NRL IPv6 - don't actually do anything */ 58/* Security levels - as per NRL IPv6 - don't actually do anything */
63#define SO_SECURITY_AUTHENTICATION 19 59#define SO_SECURITY_AUTHENTICATION 19
@@ -66,9 +62,6 @@
66 62
67#define SO_MARK 36 63#define SO_MARK 36
68 64
69#define SO_TIMESTAMPING 37
70#define SCM_TIMESTAMPING SO_TIMESTAMPING
71
72#define SO_RXQ_OVFL 40 65#define SO_RXQ_OVFL 40
73 66
74#define SO_WIFI_STATUS 41 67#define SO_WIFI_STATUS 41
@@ -117,4 +110,20 @@
117 110
118#define SO_BINDTOIFINDEX 62 111#define SO_BINDTOIFINDEX 62
119 112
113#define SO_TIMESTAMP_OLD 29
114#define SO_TIMESTAMPNS_OLD 35
115#define SO_TIMESTAMPING_OLD 37
116
117#if !defined(__KERNEL__)
118
119#define SO_TIMESTAMP SO_TIMESTAMP_OLD
120#define SO_TIMESTAMPNS SO_TIMESTAMPNS_OLD
121#define SO_TIMESTAMPING SO_TIMESTAMPING_OLD
122
123#define SCM_TIMESTAMP SO_TIMESTAMP
124#define SCM_TIMESTAMPNS SO_TIMESTAMPNS
125#define SCM_TIMESTAMPING SO_TIMESTAMPING
126
127#endif
128
120#endif /* _UAPI_ASM_SOCKET_H */ 129#endif /* _UAPI_ASM_SOCKET_H */
diff --git a/arch/mips/include/uapi/asm/socket.h b/arch/mips/include/uapi/asm/socket.h
index 73e25e35d803..0f4516c34df2 100644
--- a/arch/mips/include/uapi/asm/socket.h
+++ b/arch/mips/include/uapi/asm/socket.h
@@ -65,21 +65,14 @@
65#define SO_GET_FILTER SO_ATTACH_FILTER 65#define SO_GET_FILTER SO_ATTACH_FILTER
66 66
67#define SO_PEERNAME 28 67#define SO_PEERNAME 28
68#define SO_TIMESTAMP 29
69#define SCM_TIMESTAMP SO_TIMESTAMP
70 68
71#define SO_PEERSEC 30 69#define SO_PEERSEC 30
72#define SO_SNDBUFFORCE 31 70#define SO_SNDBUFFORCE 31
73#define SO_RCVBUFFORCE 33 71#define SO_RCVBUFFORCE 33
74#define SO_PASSSEC 34 72#define SO_PASSSEC 34
75#define SO_TIMESTAMPNS 35
76#define SCM_TIMESTAMPNS SO_TIMESTAMPNS
77 73
78#define SO_MARK 36 74#define SO_MARK 36
79 75
80#define SO_TIMESTAMPING 37
81#define SCM_TIMESTAMPING SO_TIMESTAMPING
82
83#define SO_RXQ_OVFL 40 76#define SO_RXQ_OVFL 40
84 77
85#define SO_WIFI_STATUS 41 78#define SO_WIFI_STATUS 41
@@ -128,4 +121,20 @@
128 121
129#define SO_BINDTOIFINDEX 62 122#define SO_BINDTOIFINDEX 62
130 123
124#define SO_TIMESTAMP_OLD 29
125#define SO_TIMESTAMPNS_OLD 35
126#define SO_TIMESTAMPING_OLD 37
127
128#if !defined(__KERNEL__)
129
130#define SO_TIMESTAMP SO_TIMESTAMP_OLD
131#define SO_TIMESTAMPNS SO_TIMESTAMPNS_OLD
132#define SO_TIMESTAMPING SO_TIMESTAMPING_OLD
133
134#define SCM_TIMESTAMP SO_TIMESTAMP
135#define SCM_TIMESTAMPNS SO_TIMESTAMPNS
136#define SCM_TIMESTAMPING SO_TIMESTAMPING
137
138#endif
139
131#endif /* _UAPI_ASM_SOCKET_H */ 140#endif /* _UAPI_ASM_SOCKET_H */
diff --git a/arch/parisc/include/uapi/asm/socket.h b/arch/parisc/include/uapi/asm/socket.h
index 52bed5976cbe..7c180321ebd6 100644
--- a/arch/parisc/include/uapi/asm/socket.h
+++ b/arch/parisc/include/uapi/asm/socket.h
@@ -34,10 +34,6 @@
34#define SO_BSDCOMPAT 0x400e 34#define SO_BSDCOMPAT 0x400e
35#define SO_PASSCRED 0x4010 35#define SO_PASSCRED 0x4010
36#define SO_PEERCRED 0x4011 36#define SO_PEERCRED 0x4011
37#define SO_TIMESTAMP 0x4012
38#define SCM_TIMESTAMP SO_TIMESTAMP
39#define SO_TIMESTAMPNS 0x4013
40#define SCM_TIMESTAMPNS SO_TIMESTAMPNS
41 37
42/* Security levels - as per NRL IPv6 - don't actually do anything */ 38/* Security levels - as per NRL IPv6 - don't actually do anything */
43#define SO_SECURITY_AUTHENTICATION 0x4016 39#define SO_SECURITY_AUTHENTICATION 0x4016
@@ -58,9 +54,6 @@
58 54
59#define SO_MARK 0x401f 55#define SO_MARK 0x401f
60 56
61#define SO_TIMESTAMPING 0x4020
62#define SCM_TIMESTAMPING SO_TIMESTAMPING
63
64#define SO_RXQ_OVFL 0x4021 57#define SO_RXQ_OVFL 0x4021
65 58
66#define SO_WIFI_STATUS 0x4022 59#define SO_WIFI_STATUS 0x4022
@@ -109,4 +102,20 @@
109 102
110#define SO_BINDTOIFINDEX 0x4037 103#define SO_BINDTOIFINDEX 0x4037
111 104
105#define SO_TIMESTAMP_OLD 0x4012
106#define SO_TIMESTAMPNS_OLD 0x4013
107#define SO_TIMESTAMPING_OLD 0x4020
108
109#if !defined(__KERNEL__)
110
111#define SO_TIMESTAMP SO_TIMESTAMP_OLD
112#define SO_TIMESTAMPNS SO_TIMESTAMPNS_OLD
113#define SO_TIMESTAMPING SO_TIMESTAMPING_OLD
114
115#define SCM_TIMESTAMP SO_TIMESTAMP
116#define SCM_TIMESTAMPNS SO_TIMESTAMPNS
117#define SCM_TIMESTAMPING SO_TIMESTAMPING
118
119#endif
120
112#endif /* _UAPI_ASM_SOCKET_H */ 121#endif /* _UAPI_ASM_SOCKET_H */
diff --git a/arch/sparc/include/uapi/asm/socket.h b/arch/sparc/include/uapi/asm/socket.h
index bbdb81594dd4..d8a1bbc3e6c4 100644
--- a/arch/sparc/include/uapi/asm/socket.h
+++ b/arch/sparc/include/uapi/asm/socket.h
@@ -33,7 +33,6 @@
33#define SO_PROTOCOL 0x1028 33#define SO_PROTOCOL 0x1028
34#define SO_DOMAIN 0x1029 34#define SO_DOMAIN 0x1029
35 35
36
37/* Linux specific, keep the same. */ 36/* Linux specific, keep the same. */
38#define SO_NO_CHECK 0x000b 37#define SO_NO_CHECK 0x000b
39#define SO_PRIORITY 0x000c 38#define SO_PRIORITY 0x000c
@@ -45,19 +44,12 @@
45#define SO_GET_FILTER SO_ATTACH_FILTER 44#define SO_GET_FILTER SO_ATTACH_FILTER
46 45
47#define SO_PEERNAME 0x001c 46#define SO_PEERNAME 0x001c
48#define SO_TIMESTAMP 0x001d
49#define SCM_TIMESTAMP SO_TIMESTAMP
50 47
51#define SO_PEERSEC 0x001e 48#define SO_PEERSEC 0x001e
52#define SO_PASSSEC 0x001f 49#define SO_PASSSEC 0x001f
53#define SO_TIMESTAMPNS 0x0021
54#define SCM_TIMESTAMPNS SO_TIMESTAMPNS
55 50
56#define SO_MARK 0x0022 51#define SO_MARK 0x0022
57 52
58#define SO_TIMESTAMPING 0x0023
59#define SCM_TIMESTAMPING SO_TIMESTAMPING
60
61#define SO_RXQ_OVFL 0x0024 53#define SO_RXQ_OVFL 0x0024
62 54
63#define SO_WIFI_STATUS 0x0025 55#define SO_WIFI_STATUS 0x0025
@@ -111,4 +103,20 @@
111#define SO_SECURITY_ENCRYPTION_TRANSPORT 0x5002 103#define SO_SECURITY_ENCRYPTION_TRANSPORT 0x5002
112#define SO_SECURITY_ENCRYPTION_NETWORK 0x5004 104#define SO_SECURITY_ENCRYPTION_NETWORK 0x5004
113 105
106#define SO_TIMESTAMP_OLD 0x001d
107#define SO_TIMESTAMPNS_OLD 0x0021
108#define SO_TIMESTAMPING_OLD 0x0023
109
110#if !defined(__KERNEL__)
111
112#define SO_TIMESTAMP SO_TIMESTAMP_OLD
113#define SO_TIMESTAMPNS SO_TIMESTAMPNS_OLD
114#define SO_TIMESTAMPING SO_TIMESTAMPING_OLD
115
116#define SCM_TIMESTAMP SO_TIMESTAMP
117#define SCM_TIMESTAMPNS SO_TIMESTAMPNS
118#define SCM_TIMESTAMPING SO_TIMESTAMPING
119
120#endif
121
114#endif /* _ASM_SOCKET_H */ 122#endif /* _ASM_SOCKET_H */
diff --git a/include/uapi/asm-generic/socket.h b/include/uapi/asm-generic/socket.h
index 3066ab3853a8..4ef3aed31fb7 100644
--- a/include/uapi/asm-generic/socket.h
+++ b/include/uapi/asm-generic/socket.h
@@ -46,21 +46,14 @@
46#define SO_GET_FILTER SO_ATTACH_FILTER 46#define SO_GET_FILTER SO_ATTACH_FILTER
47 47
48#define SO_PEERNAME 28 48#define SO_PEERNAME 28
49#define SO_TIMESTAMP 29
50#define SCM_TIMESTAMP SO_TIMESTAMP
51 49
52#define SO_ACCEPTCONN 30 50#define SO_ACCEPTCONN 30
53 51
54#define SO_PEERSEC 31 52#define SO_PEERSEC 31
55#define SO_PASSSEC 34 53#define SO_PASSSEC 34
56#define SO_TIMESTAMPNS 35
57#define SCM_TIMESTAMPNS SO_TIMESTAMPNS
58 54
59#define SO_MARK 36 55#define SO_MARK 36
60 56
61#define SO_TIMESTAMPING 37
62#define SCM_TIMESTAMPING SO_TIMESTAMPING
63
64#define SO_PROTOCOL 38 57#define SO_PROTOCOL 38
65#define SO_DOMAIN 39 58#define SO_DOMAIN 39
66 59
@@ -112,4 +105,20 @@
112 105
113#define SO_BINDTOIFINDEX 62 106#define SO_BINDTOIFINDEX 62
114 107
108#define SO_TIMESTAMP_OLD 29
109#define SO_TIMESTAMPNS_OLD 35
110#define SO_TIMESTAMPING_OLD 37
111
112#if !defined(__KERNEL__)
113
114#define SO_TIMESTAMP SO_TIMESTAMP_OLD
115#define SO_TIMESTAMPNS SO_TIMESTAMPNS_OLD
116#define SO_TIMESTAMPING SO_TIMESTAMPING_OLD
117
118#define SCM_TIMESTAMP SO_TIMESTAMP
119#define SCM_TIMESTAMPNS SO_TIMESTAMPNS
120#define SCM_TIMESTAMPING SO_TIMESTAMPING
121
122#endif
123
115#endif /* __ASM_GENERIC_SOCKET_H */ 124#endif /* __ASM_GENERIC_SOCKET_H */
diff --git a/net/compat.c b/net/compat.c
index ce8f6e8cdcd2..ccf93cd0e49b 100644
--- a/net/compat.c
+++ b/net/compat.c
@@ -219,7 +219,7 @@ int put_cmsg_compat(struct msghdr *kmsg, int level, int type, int len, void *dat
219 } 219 }
220 220
221 if (!COMPAT_USE_64BIT_TIME) { 221 if (!COMPAT_USE_64BIT_TIME) {
222 if (level == SOL_SOCKET && type == SCM_TIMESTAMP) { 222 if (level == SOL_SOCKET && type == SO_TIMESTAMP_OLD) {
223 struct timeval *tv = (struct timeval *)data; 223 struct timeval *tv = (struct timeval *)data;
224 ctv.tv_sec = tv->tv_sec; 224 ctv.tv_sec = tv->tv_sec;
225 ctv.tv_usec = tv->tv_usec; 225 ctv.tv_usec = tv->tv_usec;
@@ -227,8 +227,8 @@ int put_cmsg_compat(struct msghdr *kmsg, int level, int type, int len, void *dat
227 len = sizeof(ctv); 227 len = sizeof(ctv);
228 } 228 }
229 if (level == SOL_SOCKET && 229 if (level == SOL_SOCKET &&
230 (type == SCM_TIMESTAMPNS || type == SCM_TIMESTAMPING)) { 230 (type == SO_TIMESTAMPNS_OLD || type == SO_TIMESTAMPING_OLD)) {
231 int count = type == SCM_TIMESTAMPNS ? 1 : 3; 231 int count = type == SO_TIMESTAMPNS_OLD ? 1 : 3;
232 int i; 232 int i;
233 struct timespec *ts = (struct timespec *)data; 233 struct timespec *ts = (struct timespec *)data;
234 for (i = 0; i < count; i++) { 234 for (i = 0; i < count; i++) {
diff --git a/net/core/sock.c b/net/core/sock.c
index 29c0028df5ae..d5ca8641968f 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -867,10 +867,10 @@ set_rcvbuf:
867 clear_bit(SOCK_PASSCRED, &sock->flags); 867 clear_bit(SOCK_PASSCRED, &sock->flags);
868 break; 868 break;
869 869
870 case SO_TIMESTAMP: 870 case SO_TIMESTAMP_OLD:
871 case SO_TIMESTAMPNS: 871 case SO_TIMESTAMPNS_OLD:
872 if (valbool) { 872 if (valbool) {
873 if (optname == SO_TIMESTAMP) 873 if (optname == SO_TIMESTAMP_OLD)
874 sock_reset_flag(sk, SOCK_RCVTSTAMPNS); 874 sock_reset_flag(sk, SOCK_RCVTSTAMPNS);
875 else 875 else
876 sock_set_flag(sk, SOCK_RCVTSTAMPNS); 876 sock_set_flag(sk, SOCK_RCVTSTAMPNS);
@@ -882,7 +882,7 @@ set_rcvbuf:
882 } 882 }
883 break; 883 break;
884 884
885 case SO_TIMESTAMPING: 885 case SO_TIMESTAMPING_OLD:
886 if (val & ~SOF_TIMESTAMPING_MASK) { 886 if (val & ~SOF_TIMESTAMPING_MASK) {
887 ret = -EINVAL; 887 ret = -EINVAL;
888 break; 888 break;
@@ -1243,16 +1243,16 @@ int sock_getsockopt(struct socket *sock, int level, int optname,
1243 sock_warn_obsolete_bsdism("getsockopt"); 1243 sock_warn_obsolete_bsdism("getsockopt");
1244 break; 1244 break;
1245 1245
1246 case SO_TIMESTAMP: 1246 case SO_TIMESTAMP_OLD:
1247 v.val = sock_flag(sk, SOCK_RCVTSTAMP) && 1247 v.val = sock_flag(sk, SOCK_RCVTSTAMP) &&
1248 !sock_flag(sk, SOCK_RCVTSTAMPNS); 1248 !sock_flag(sk, SOCK_RCVTSTAMPNS);
1249 break; 1249 break;
1250 1250
1251 case SO_TIMESTAMPNS: 1251 case SO_TIMESTAMPNS_OLD:
1252 v.val = sock_flag(sk, SOCK_RCVTSTAMPNS); 1252 v.val = sock_flag(sk, SOCK_RCVTSTAMPNS);
1253 break; 1253 break;
1254 1254
1255 case SO_TIMESTAMPING: 1255 case SO_TIMESTAMPING_OLD:
1256 v.val = sk->sk_tsflags; 1256 v.val = sk->sk_tsflags;
1257 break; 1257 break;
1258 1258
@@ -2168,7 +2168,7 @@ int __sock_cmsg_send(struct sock *sk, struct msghdr *msg, struct cmsghdr *cmsg,
2168 return -EINVAL; 2168 return -EINVAL;
2169 sockc->mark = *(u32 *)CMSG_DATA(cmsg); 2169 sockc->mark = *(u32 *)CMSG_DATA(cmsg);
2170 break; 2170 break;
2171 case SO_TIMESTAMPING: 2171 case SO_TIMESTAMPING_OLD:
2172 if (cmsg->cmsg_len != CMSG_LEN(sizeof(u32))) 2172 if (cmsg->cmsg_len != CMSG_LEN(sizeof(u32)))
2173 return -EINVAL; 2173 return -EINVAL;
2174 2174
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index 6f8d292ad501..e29aec59cad1 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -1867,13 +1867,13 @@ static void tcp_recv_timestamp(struct msghdr *msg, const struct sock *sk,
1867 if (tss->ts[0].tv_sec || tss->ts[0].tv_nsec) { 1867 if (tss->ts[0].tv_sec || tss->ts[0].tv_nsec) {
1868 if (sock_flag(sk, SOCK_RCVTSTAMP)) { 1868 if (sock_flag(sk, SOCK_RCVTSTAMP)) {
1869 if (sock_flag(sk, SOCK_RCVTSTAMPNS)) { 1869 if (sock_flag(sk, SOCK_RCVTSTAMPNS)) {
1870 put_cmsg(msg, SOL_SOCKET, SCM_TIMESTAMPNS, 1870 put_cmsg(msg, SOL_SOCKET, SO_TIMESTAMPNS_OLD,
1871 sizeof(tss->ts[0]), &tss->ts[0]); 1871 sizeof(tss->ts[0]), &tss->ts[0]);
1872 } else { 1872 } else {
1873 tv.tv_sec = tss->ts[0].tv_sec; 1873 tv.tv_sec = tss->ts[0].tv_sec;
1874 tv.tv_usec = tss->ts[0].tv_nsec / 1000; 1874 tv.tv_usec = tss->ts[0].tv_nsec / 1000;
1875 1875
1876 put_cmsg(msg, SOL_SOCKET, SCM_TIMESTAMP, 1876 put_cmsg(msg, SOL_SOCKET, SO_TIMESTAMP_OLD,
1877 sizeof(tv), &tv); 1877 sizeof(tv), &tv);
1878 } 1878 }
1879 } 1879 }
@@ -1893,7 +1893,7 @@ static void tcp_recv_timestamp(struct msghdr *msg, const struct sock *sk,
1893 1893
1894 if (has_timestamping) { 1894 if (has_timestamping) {
1895 tss->ts[1] = (struct timespec) {0}; 1895 tss->ts[1] = (struct timespec) {0};
1896 put_cmsg(msg, SOL_SOCKET, SCM_TIMESTAMPING, 1896 put_cmsg(msg, SOL_SOCKET, SO_TIMESTAMPING_OLD,
1897 sizeof(*tss), tss); 1897 sizeof(*tss), tss);
1898 } 1898 }
1899} 1899}
diff --git a/net/rds/af_rds.c b/net/rds/af_rds.c
index 65387e1e6964..eeb4639adbe5 100644
--- a/net/rds/af_rds.c
+++ b/net/rds/af_rds.c
@@ -430,7 +430,7 @@ static int rds_setsockopt(struct socket *sock, int level, int optname,
430 ret = rds_set_transport(rs, optval, optlen); 430 ret = rds_set_transport(rs, optval, optlen);
431 release_sock(sock->sk); 431 release_sock(sock->sk);
432 break; 432 break;
433 case SO_TIMESTAMP: 433 case SO_TIMESTAMP_OLD:
434 lock_sock(sock->sk); 434 lock_sock(sock->sk);
435 ret = rds_enable_recvtstamp(sock->sk, optval, optlen); 435 ret = rds_enable_recvtstamp(sock->sk, optval, optlen);
436 release_sock(sock->sk); 436 release_sock(sock->sk);
diff --git a/net/rds/recv.c b/net/rds/recv.c
index 727639dac8a7..04e30d63a159 100644
--- a/net/rds/recv.c
+++ b/net/rds/recv.c
@@ -550,7 +550,7 @@ static int rds_cmsg_recv(struct rds_incoming *inc, struct msghdr *msg,
550 if ((inc->i_rx_tstamp != 0) && 550 if ((inc->i_rx_tstamp != 0) &&
551 sock_flag(rds_rs_to_sk(rs), SOCK_RCVTSTAMP)) { 551 sock_flag(rds_rs_to_sk(rs), SOCK_RCVTSTAMP)) {
552 struct timeval tv = ktime_to_timeval(inc->i_rx_tstamp); 552 struct timeval tv = ktime_to_timeval(inc->i_rx_tstamp);
553 ret = put_cmsg(msg, SOL_SOCKET, SCM_TIMESTAMP, 553 ret = put_cmsg(msg, SOL_SOCKET, SO_TIMESTAMP_OLD,
554 sizeof(tv), &tv); 554 sizeof(tv), &tv);
555 if (ret) 555 if (ret)
556 goto out; 556 goto out;
diff --git a/net/rxrpc/local_object.c b/net/rxrpc/local_object.c
index 0906e51d3cfb..15cf42d5b53a 100644
--- a/net/rxrpc/local_object.c
+++ b/net/rxrpc/local_object.c
@@ -202,7 +202,7 @@ static int rxrpc_open_socket(struct rxrpc_local *local, struct net *net)
202 202
203 /* We want receive timestamps. */ 203 /* We want receive timestamps. */
204 opt = 1; 204 opt = 1;
205 ret = kernel_setsockopt(local->socket, SOL_SOCKET, SO_TIMESTAMPNS, 205 ret = kernel_setsockopt(local->socket, SOL_SOCKET, SO_TIMESTAMPNS_OLD,
206 (char *)&opt, sizeof(opt)); 206 (char *)&opt, sizeof(opt));
207 if (ret < 0) { 207 if (ret < 0) {
208 _debug("setsockopt failed"); 208 _debug("setsockopt failed");
diff --git a/net/socket.c b/net/socket.c
index e89884e2197b..5087f9e40f3a 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -669,7 +669,7 @@ static bool skb_is_err_queue(const struct sk_buff *skb)
669 * before the software timestamp is received, a hardware TX timestamp may be 669 * before the software timestamp is received, a hardware TX timestamp may be
670 * returned only if there is no software TX timestamp. Ignore false software 670 * returned only if there is no software TX timestamp. Ignore false software
671 * timestamps, which may be made in the __sock_recv_timestamp() call when the 671 * timestamps, which may be made in the __sock_recv_timestamp() call when the
672 * option SO_TIMESTAMP(NS) is enabled on the socket, even when the skb has a 672 * option SO_TIMESTAMP_OLD(NS) is enabled on the socket, even when the skb has a
673 * hardware timestamp. 673 * hardware timestamp.
674 */ 674 */
675static bool skb_is_swtx_tstamp(const struct sk_buff *skb, int false_tstamp) 675static bool skb_is_swtx_tstamp(const struct sk_buff *skb, int false_tstamp)
@@ -721,12 +721,12 @@ void __sock_recv_timestamp(struct msghdr *msg, struct sock *sk,
721 if (!sock_flag(sk, SOCK_RCVTSTAMPNS)) { 721 if (!sock_flag(sk, SOCK_RCVTSTAMPNS)) {
722 struct timeval tv; 722 struct timeval tv;
723 skb_get_timestamp(skb, &tv); 723 skb_get_timestamp(skb, &tv);
724 put_cmsg(msg, SOL_SOCKET, SCM_TIMESTAMP, 724 put_cmsg(msg, SOL_SOCKET, SO_TIMESTAMP_OLD,
725 sizeof(tv), &tv); 725 sizeof(tv), &tv);
726 } else { 726 } else {
727 struct timespec ts; 727 struct timespec ts;
728 skb_get_timestampns(skb, &ts); 728 skb_get_timestampns(skb, &ts);
729 put_cmsg(msg, SOL_SOCKET, SCM_TIMESTAMPNS, 729 put_cmsg(msg, SOL_SOCKET, SO_TIMESTAMPNS_OLD,
730 sizeof(ts), &ts); 730 sizeof(ts), &ts);
731 } 731 }
732 } 732 }
@@ -746,7 +746,7 @@ void __sock_recv_timestamp(struct msghdr *msg, struct sock *sk,
746 } 746 }
747 if (!empty) { 747 if (!empty) {
748 put_cmsg(msg, SOL_SOCKET, 748 put_cmsg(msg, SOL_SOCKET,
749 SCM_TIMESTAMPING, sizeof(tss), &tss); 749 SO_TIMESTAMPING_OLD, sizeof(tss), &tss);
750 750
751 if (skb_is_err_queue(skb) && skb->len && 751 if (skb_is_err_queue(skb) && skb->len &&
752 SKB_EXT_ERR(skb)->opt_stats) 752 SKB_EXT_ERR(skb)->opt_stats)