summaryrefslogtreecommitdiff
path: root/net/mptcp
diff options
context:
space:
mode:
authorFlorian Westphal <fw@strlen.de>2020-03-06 23:29:46 +0300
committerDavid S. Miller <davem@davemloft.net>2020-03-10 05:30:08 +0300
commitec33916d47cbac546e0437b59e6ed779d3c31ac3 (patch)
treeaa2e8d86f05c74838a972a71afbb8349856894db /net/mptcp
parent8a4b910d005db03ce644e4657ae1fc512a67e596 (diff)
downloadlinux-ec33916d47cbac546e0437b59e6ed779d3c31ac3.tar.xz
mptcp: don't grow mptcp socket receive buffer when rcvbuf is locked
The mptcp rcvbuf size is adjusted according to the subflow rcvbuf size. This should not be done if userspace did set a fixed value. Fixes: 600911ff5f72bae ("mptcp: add rmem queue accounting") Signed-off-by: Florian Westphal <fw@strlen.de> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/mptcp')
-rw-r--r--net/mptcp/protocol.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
index 4c075a9f7ed0..95007e433109 100644
--- a/net/mptcp/protocol.c
+++ b/net/mptcp/protocol.c
@@ -141,11 +141,13 @@ static bool __mptcp_move_skbs_from_subflow(struct mptcp_sock *msk,
bool more_data_avail;
struct tcp_sock *tp;
bool done = false;
- int rcvbuf;
- rcvbuf = max(ssk->sk_rcvbuf, sk->sk_rcvbuf);
- if (rcvbuf > sk->sk_rcvbuf)
- sk->sk_rcvbuf = rcvbuf;
+ if (!(sk->sk_userlocks & SOCK_RCVBUF_LOCK)) {
+ int rcvbuf = max(ssk->sk_rcvbuf, sk->sk_rcvbuf);
+
+ if (rcvbuf > sk->sk_rcvbuf)
+ sk->sk_rcvbuf = rcvbuf;
+ }
tp = tcp_sk(ssk);
do {