diff options
author | Petar Penkov <ppenkov@google.com> | 2019-07-29 09:59:14 -0700 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2019-07-30 21:03:05 -0700 |
commit | 9349d600fb6a1ca0aaeb515523e1bb5409483d76 (patch) | |
tree | 214a3a4b68356a5977e75afe2117538810b64d10 /include/net/tcp.h | |
parent | 965112785e4bd4355262c6c5a32ea8f349adb401 (diff) | |
download | linux-9349d600fb6a1ca0aaeb515523e1bb5409483d76.tar.gz linux-9349d600fb6a1ca0aaeb515523e1bb5409483d76.tar.bz2 linux-9349d600fb6a1ca0aaeb515523e1bb5409483d76.zip |
tcp: add skb-less helpers to retrieve SYN cookie
This patch allows generation of a SYN cookie before an SKB has been
allocated, as is the case at XDP.
Signed-off-by: Petar Penkov <ppenkov@google.com>
Reviewed-by: Lorenz Bauer <lmb@cloudflare.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'include/net/tcp.h')
-rw-r--r-- | include/net/tcp.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/net/tcp.h b/include/net/tcp.h index e5cf514ba118..fb7e153aecc5 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h @@ -415,6 +415,16 @@ void tcp_parse_options(const struct net *net, const struct sk_buff *skb, const u8 *tcp_parse_md5sig_option(const struct tcphdr *th); /* + * BPF SKB-less helpers + */ +u16 tcp_v4_get_syncookie(struct sock *sk, struct iphdr *iph, + struct tcphdr *th, u32 *cookie); +u16 tcp_v6_get_syncookie(struct sock *sk, struct ipv6hdr *iph, + struct tcphdr *th, u32 *cookie); +u16 tcp_get_syncookie_mss(struct request_sock_ops *rsk_ops, + const struct tcp_request_sock_ops *af_ops, + struct sock *sk, struct tcphdr *th); +/* * TCP v4 functions exported for the inet6 API */ |