aboutsummaryrefslogtreecommitdiff
path: root/net/dccp/ccids/ccid2.h
diff options
context:
space:
mode:
Diffstat (limited to 'net/dccp/ccids/ccid2.h')
-rw-r--r--net/dccp/ccids/ccid2.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/net/dccp/ccids/ccid2.h b/net/dccp/ccids/ccid2.h
index e9985dafc2c..f17460a8fe7 100644
--- a/net/dccp/ccids/ccid2.h
+++ b/net/dccp/ccids/ccid2.h
@@ -88,6 +88,15 @@ static inline bool ccid2_cwnd_network_limited(struct ccid2_hc_tx_sock *hc)
return hc->tx_pipe >= hc->tx_cwnd;
}
+/*
+ * Convert RFC 3390 larger initial window into an equivalent number of packets.
+ * This is based on the numbers specified in RFC 5681, 3.1.
+ */
+static inline u32 rfc3390_bytes_to_packets(const u32 smss)
+{
+ return smss <= 1095 ? 4 : (smss > 2190 ? 2 : 3);
+}
+
struct ccid2_hc_rx_sock {
int rx_data;
};