summaryrefslogtreecommitdiff
path: root/include/net/request_sock.h
diff options
context:
space:
mode:
authorThomas Zimmermann <tzimmermann@suse.de>2024-07-29 09:35:54 +0200
committerThomas Zimmermann <tzimmermann@suse.de>2024-07-29 09:35:54 +0200
commit0e8655b4e852ef97655648b91ce780384a073ff4 (patch)
tree11052a81da749dda3357f7748bdf93549c8007bf /include/net/request_sock.h
parent0c3f3a83c7e8dfaaae4ba8a5b69bd6bc13340d0b (diff)
parentd4ef5d2b7ee0cbb5f2d864716140366a618400d6 (diff)
downloadlinux-next-0e8655b4e852ef97655648b91ce780384a073ff4.tar.gz
linux-next-0e8655b4e852ef97655648b91ce780384a073ff4.zip
Merge drm/drm-next into drm-misc-next
Backmerging to get a late RC of v6.10 before moving into v6.11. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Diffstat (limited to 'include/net/request_sock.h')
-rw-r--r--include/net/request_sock.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/net/request_sock.h b/include/net/request_sock.h
index d88c0dfc2d46..ebcb8896bffc 100644
--- a/include/net/request_sock.h
+++ b/include/net/request_sock.h
@@ -285,4 +285,16 @@ static inline int reqsk_queue_len_young(const struct request_sock_queue *queue)
return atomic_read(&queue->young);
}
+/* RFC 7323 2.3 Using the Window Scale Option
+ * The window field (SEG.WND) of every outgoing segment, with the
+ * exception of <SYN> segments, MUST be right-shifted by
+ * Rcv.Wind.Shift bits.
+ *
+ * This means the SEG.WND carried in SYNACK can not exceed 65535.
+ * We use this property to harden TCP stack while in NEW_SYN_RECV state.
+ */
+static inline u32 tcp_synack_window(const struct request_sock *req)
+{
+ return min(req->rsk_rcv_wnd, 65535U);
+}
#endif /* _REQUEST_SOCK_H */