diff options
Diffstat (limited to 'net/core/secure_seq.c')
-rw-r--r-- | net/core/secure_seq.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/net/core/secure_seq.c b/net/core/secure_seq.c index a8d6062cbb4a..88a8e429fc3e 100644 --- a/net/core/secure_seq.c +++ b/net/core/secure_seq.c | |||
@@ -12,6 +12,7 @@ | |||
12 | #include <net/secure_seq.h> | 12 | #include <net/secure_seq.h> |
13 | 13 | ||
14 | #if IS_ENABLED(CONFIG_IPV6) || IS_ENABLED(CONFIG_INET) | 14 | #if IS_ENABLED(CONFIG_IPV6) || IS_ENABLED(CONFIG_INET) |
15 | #include <net/tcp.h> | ||
15 | #define NET_SECRET_SIZE (MD5_MESSAGE_BYTES / 4) | 16 | #define NET_SECRET_SIZE (MD5_MESSAGE_BYTES / 4) |
16 | 17 | ||
17 | static u32 net_secret[NET_SECRET_SIZE] ____cacheline_aligned; | 18 | static u32 net_secret[NET_SECRET_SIZE] ____cacheline_aligned; |
@@ -58,7 +59,7 @@ u32 secure_tcpv6_sequence_number(const __be32 *saddr, const __be32 *daddr, | |||
58 | 59 | ||
59 | md5_transform(hash, secret); | 60 | md5_transform(hash, secret); |
60 | 61 | ||
61 | *tsoff = hash[1]; | 62 | *tsoff = sysctl_tcp_timestamps == 1 ? hash[1] : 0; |
62 | return seq_scale(hash[0]); | 63 | return seq_scale(hash[0]); |
63 | } | 64 | } |
64 | EXPORT_SYMBOL(secure_tcpv6_sequence_number); | 65 | EXPORT_SYMBOL(secure_tcpv6_sequence_number); |
@@ -100,7 +101,7 @@ u32 secure_tcp_sequence_number(__be32 saddr, __be32 daddr, | |||
100 | 101 | ||
101 | md5_transform(hash, net_secret); | 102 | md5_transform(hash, net_secret); |
102 | 103 | ||
103 | *tsoff = hash[1]; | 104 | *tsoff = sysctl_tcp_timestamps == 1 ? hash[1] : 0; |
104 | return seq_scale(hash[0]); | 105 | return seq_scale(hash[0]); |
105 | } | 106 | } |
106 | 107 | ||