]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/blobdiff - net/ipv4/tcp_dctcp.c
tipc: re-fetch skb cb after tipc_msg_validate
[mirror_ubuntu-jammy-kernel.git] / net / ipv4 / tcp_dctcp.c
index 79f705450c162832e73f22a00a57916e6eddf8cd..43bcefbaefbb1f85647f5258a451e1867f22a8e0 100644 (file)
@@ -104,8 +104,8 @@ static u32 dctcp_ssthresh(struct sock *sk)
        struct dctcp *ca = inet_csk_ca(sk);
        struct tcp_sock *tp = tcp_sk(sk);
 
-       ca->loss_cwnd = tp->snd_cwnd;
-       return max(tp->snd_cwnd - ((tp->snd_cwnd * ca->dctcp_alpha) >> 11U), 2U);
+       ca->loss_cwnd = tcp_snd_cwnd(tp);
+       return max(tcp_snd_cwnd(tp) - ((tcp_snd_cwnd(tp) * ca->dctcp_alpha) >> 11U), 2U);
 }
 
 static void dctcp_update_alpha(struct sock *sk, u32 flags)
@@ -146,8 +146,8 @@ static void dctcp_react_to_loss(struct sock *sk)
        struct dctcp *ca = inet_csk_ca(sk);
        struct tcp_sock *tp = tcp_sk(sk);
 
-       ca->loss_cwnd = tp->snd_cwnd;
-       tp->snd_ssthresh = max(tp->snd_cwnd >> 1U, 2U);
+       ca->loss_cwnd = tcp_snd_cwnd(tp);
+       tp->snd_ssthresh = max(tcp_snd_cwnd(tp) >> 1U, 2U);
 }
 
 static void dctcp_state(struct sock *sk, u8 new_state)
@@ -209,8 +209,9 @@ static size_t dctcp_get_info(struct sock *sk, u32 ext, int *attr,
 static u32 dctcp_cwnd_undo(struct sock *sk)
 {
        const struct dctcp *ca = inet_csk_ca(sk);
+       struct tcp_sock *tp = tcp_sk(sk);
 
-       return max(tcp_sk(sk)->snd_cwnd, ca->loss_cwnd);
+       return max(tcp_snd_cwnd(tp), ca->loss_cwnd);
 }
 
 static struct tcp_congestion_ops dctcp __read_mostly = {