summaryrefslogtreecommitdiffstats
path: root/net/mptcp/options.c
diff options
context:
space:
mode:
authorPaolo Abeni <pabeni@redhat.com>2020-03-13 16:52:42 +0100
committerDavid S. Miller <davem@davemloft.net>2020-03-15 08:19:03 +0100
commitdc093db5cc052b7879807a1d2906ed2f54bf386c (patch)
tree6bb09c946b5720e84789c281caa47722e2d3bd6a /net/mptcp/options.c
parentmptcp: create msk early (diff)
downloadlinux-dc093db5cc052b7879807a1d2906ed2f54bf386c.tar.xz
linux-dc093db5cc052b7879807a1d2906ed2f54bf386c.zip
mptcp: drop unneeded checks
After the previous patch subflow->conn is always != NULL and is never changed. We can drop a bunch of now unneeded checks. v1 -> v2: - rebased on top of commit 2398e3991bda ("mptcp: always include dack if possible.") Signed-off-by: Paolo Abeni <pabeni@redhat.com> Reviewed-by: Matthieu Baerts <matthieu.baerts@tessares.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/mptcp/options.c')
-rw-r--r--net/mptcp/options.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/net/mptcp/options.c b/net/mptcp/options.c
index 9c71f427e6e3..63c8ee49cef2 100644
--- a/net/mptcp/options.c
+++ b/net/mptcp/options.c
@@ -336,7 +336,6 @@ static bool mptcp_established_options_dss(struct sock *sk, struct sk_buff *skb,
unsigned int ack_size;
bool ret = false;
bool can_ack;
- u64 ack_seq;
u8 tcp_fin;
if (skb) {
@@ -368,16 +367,7 @@ static bool mptcp_established_options_dss(struct sock *sk, struct sk_buff *skb,
can_ack = true;
opts->ext_copy.use_ack = 0;
msk = mptcp_sk(subflow->conn);
- if (likely(msk && READ_ONCE(msk->can_ack))) {
- ack_seq = msk->ack_seq;
- } else if (subflow->can_ack) {
- mptcp_crypto_key_sha(subflow->remote_key, NULL, &ack_seq);
- ack_seq++;
- } else {
- can_ack = false;
- }
-
- if (unlikely(!can_ack)) {
+ if (!READ_ONCE(msk->can_ack)) {
*size = ALIGN(dss_size, 4);
return ret;
}
@@ -390,7 +380,7 @@ static bool mptcp_established_options_dss(struct sock *sk, struct sk_buff *skb,
dss_size += ack_size;
- opts->ext_copy.data_ack = ack_seq;
+ opts->ext_copy.data_ack = msk->ack_seq;
opts->ext_copy.ack64 = 1;
opts->ext_copy.use_ack = 1;