UPSTREAM: net/tcp-fastopen: refactor cookie check logic

Refactor the cookie check logic in tcp_send_syn_data() into a function.
This function will be called else where in later changes.

Bug: 63449462
Test: Tests in https://android-review.googlesource.com/535357/ pass
Change-Id: I14b0fadd8f97569f773a2e2f15f0b4e8dca48402
Signed-off-by: Wei Wang <weiwan@google.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Acked-by: Yuchung Cheng <ycheng@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry-picked from commit 065263f40f0972d5f1cd294bb0242bd5aa5f06b2)
diff --git a/include/net/tcp.h b/include/net/tcp.h
index 2700f92..6386e7b 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -1507,6 +1507,8 @@
 			      struct tcp_fastopen_cookie *foc,
 			      struct dst_entry *dst);
 void tcp_fastopen_init_key_once(bool publish);
+bool tcp_fastopen_cookie_check(struct sock *sk, u16 *mss,
+			     struct tcp_fastopen_cookie *cookie);
 #define TCP_FASTOPEN_KEY_LENGTH 16
 
 /* Fastopen key context */