mptcp: backup flag from incoming MPJ ack option
authorPaolo Abeni <pabeni@redhat.com>
Fri, 13 Aug 2021 22:15:47 +0000 (15:15 -0700)
committerDavid S. Miller <davem@davemloft.net>
Sat, 14 Aug 2021 10:37:25 +0000 (11:37 +0100)
the parsed incoming backup flag is not propagated
to the subflow itself, the client may end-up using it
to send data.

Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/191
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/mptcp/subflow.c

index 966f777..1151926 100644 (file)
@@ -435,10 +435,12 @@ static void subflow_finish_connect(struct sock *sk, const struct sk_buff *skb)
                        goto do_reset;
                }
 
+               subflow->backup = mp_opt.backup;
                subflow->thmac = mp_opt.thmac;
                subflow->remote_nonce = mp_opt.nonce;
-               pr_debug("subflow=%p, thmac=%llu, remote_nonce=%u", subflow,
-                        subflow->thmac, subflow->remote_nonce);
+               pr_debug("subflow=%p, thmac=%llu, remote_nonce=%u backup=%d",
+                        subflow, subflow->thmac, subflow->remote_nonce,
+                        subflow->backup);
 
                if (!subflow_thmac_valid(subflow)) {
                        MPTCP_INC_STATS(sock_net(sk), MPTCP_MIB_JOINACKMAC);