diff options
author | Eric Dumazet <edumazet@google.com> | 2012-04-22 19:34:26 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-04-23 22:28:28 -0400 |
commit | f545a38f74584cc7424cb74f792a00c6d2589485 (patch) | |
tree | b272cbfed3267a7750f55f23989e1b070ae6ac3e /net/sctp | |
parent | b98985073bc5403ef1320866e4ef8bbc5d587ceb (diff) |
net: add a limit parameter to sk_add_backlog()
sk_add_backlog() & sk_rcvqueues_full() hard coded sk_rcvbuf as the
memory limit. We need to make this limit a parameter for TCP use.
No functional change expected in this patch, all callers still using the
old sk_rcvbuf limit.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Neal Cardwell <ncardwell@google.com>
Cc: Tom Herbert <therbert@google.com>
Cc: Maciej Żenczykowski <maze@google.com>
Cc: Yuchung Cheng <ycheng@google.com>
Cc: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
Cc: Rick Jones <rick.jones2@hp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sctp')
-rw-r--r-- | net/sctp/input.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/sctp/input.c b/net/sctp/input.c index 80f71af71384..80564fe03024 100644 --- a/net/sctp/input.c +++ b/net/sctp/input.c | |||
@@ -342,7 +342,7 @@ int sctp_backlog_rcv(struct sock *sk, struct sk_buff *skb) | |||
342 | sctp_bh_lock_sock(sk); | 342 | sctp_bh_lock_sock(sk); |
343 | 343 | ||
344 | if (sock_owned_by_user(sk)) { | 344 | if (sock_owned_by_user(sk)) { |
345 | if (sk_add_backlog(sk, skb)) | 345 | if (sk_add_backlog(sk, skb, sk->sk_rcvbuf)) |
346 | sctp_chunk_free(chunk); | 346 | sctp_chunk_free(chunk); |
347 | else | 347 | else |
348 | backloged = 1; | 348 | backloged = 1; |
@@ -376,7 +376,7 @@ static int sctp_add_backlog(struct sock *sk, struct sk_buff *skb) | |||
376 | struct sctp_ep_common *rcvr = chunk->rcvr; | 376 | struct sctp_ep_common *rcvr = chunk->rcvr; |
377 | int ret; | 377 | int ret; |
378 | 378 | ||
379 | ret = sk_add_backlog(sk, skb); | 379 | ret = sk_add_backlog(sk, skb, sk->sk_rcvbuf); |
380 | if (!ret) { | 380 | if (!ret) { |
381 | /* Hold the assoc/ep while hanging on the backlog queue. | 381 | /* Hold the assoc/ep while hanging on the backlog queue. |
382 | * This way, we know structures we need will not disappear | 382 | * This way, we know structures we need will not disappear |