aboutsummaryrefslogtreecommitdiffstats
path: root/net/core/secure_seq.c
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2018-07-09 10:34:43 +0200
committerJason Gunthorpe <jgg@mellanox.com>2018-07-11 12:10:19 -0600
commit07f3355df7e6d043d36d4c172a18e74510fe7e7b (patch)
treeaf9dd5aec8f33edaa2c88caa964d136f513ffc83 /net/core/secure_seq.c
parentRDMA/nes: Avoid complaints about unused variables (diff)
downloadlinux-dev-07f3355df7e6d043d36d4c172a18e74510fe7e7b.tar.xz
linux-dev-07f3355df7e6d043d36d4c172a18e74510fe7e7b.zip
infiniband: i40iw, nes: don't use wall time for TCP sequence numbers
The nes infiniband driver uses current_kernel_time() to get a nanosecond granunarity timestamp to initialize its tcp sequence counters. This is one of only a few remaining users of that deprecated function, so we should try to get rid of it. Aside from using a deprecated API, there are several problems I see here: - Using a CLOCK_REALTIME based time source makes it predictable in case the time base is synchronized. - Using a coarse timestamp means it only gets updated once per jiffie, making it even more predictable in order to avoid having to access the hardware clock source - The upper 2 bits are always zero because the nanoseconds are at most 999999999. For the Linux TCP implementation, we use secure_tcp_seq(), which appears to be appropriate here as well, and solves all the above problems. i40iw uses a variant of the same code, so I do that same thing there for ipv4. Unlike nes, i40e also supports ipv6, which needs to call secure_tcpv6_seq instead. Acked-by: Shiraz Saleem <shiraz.saleem@intel.com> Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to 'net/core/secure_seq.c')
-rw-r--r--net/core/secure_seq.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/net/core/secure_seq.c b/net/core/secure_seq.c
index 7232274de334..af6ad467ed61 100644
--- a/net/core/secure_seq.c
+++ b/net/core/secure_seq.c
@@ -140,6 +140,7 @@ u32 secure_tcp_seq(__be32 saddr, __be32 daddr,
&net_secret);
return seq_scale(hash);
}
+EXPORT_SYMBOL_GPL(secure_tcp_seq);
u32 secure_ipv4_port_ephemeral(__be32 saddr, __be32 daddr, __be16 dport)
{