ANDROID: rename struct tcm_sock.cwnd_usage_seq to fix ABI

In commit 49d429760d ("tcp: fix tcp_cwnd_validate() to not forget
is_cwnd_limited"), the field max_packets_seq in struct tcm_sock was
renamed to cwnd_usage_seq, which broke the ABI.  Keep the same logic in
the bugfix, but rename the field back to preserve the ABI.

Bug: 161946584
Fixes: 49d429760d ("tcp: fix tcp_cwnd_validate() to not forget is_cwnd_limited")
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I9ffb10be63a22c36d5864feea794dde390ef69a1
This commit is contained in:
Greg Kroah-Hartman
2022-11-22 11:09:16 +00:00
parent c51f6b79ce
commit dfd3aa1729
2 changed files with 8 additions and 3 deletions

View File

@@ -266,7 +266,12 @@ struct tcp_sock {
u32 packets_out; /* Packets which are "in flight" */
u32 retrans_out; /* Retransmitted packets out */
u32 max_packets_out; /* max packets_out in last window */
u32 cwnd_usage_seq; /* right edge of cwnd usage tracking flight */
/* ANDROID:
* max_packets_seq is really cwnd_usage_seq upstream, old name kept
* to preserve ABI due to changes in commit 49d429760df7 ("tcp: fix
* tcp_cwnd_validate() to not forget is_cwnd_limited")
*/
u32 max_packets_seq; /* right edge of cwnd usage tracking flight */
u16 urg_data; /* Saved octet of OOB data and control flags */
u8 ecn_flags; /* ECN status bits. */

View File

@@ -1885,13 +1885,13 @@ static void tcp_cwnd_validate(struct sock *sk, bool is_cwnd_limited)
* chose to not update tp->max_packets_out to avoid an extra else
* clause with no functional impact.)
*/
if (!before(tp->snd_una, tp->cwnd_usage_seq) ||
if (!before(tp->snd_una, tp->max_packets_seq) ||
is_cwnd_limited ||
(!tp->is_cwnd_limited &&
tp->packets_out > tp->max_packets_out)) {
tp->is_cwnd_limited = is_cwnd_limited;
tp->max_packets_out = tp->packets_out;
tp->cwnd_usage_seq = tp->snd_nxt;
tp->max_packets_seq= tp->snd_nxt;
}
if (tcp_is_cwnd_limited(sk)) {