diff options
author | Yafang Shao <laoar.shao@gmail.com> | 2018-11-07 19:20:16 +0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-11-07 22:31:07 -0800 |
commit | 1295e2cf3065a55f35d112e4dfeb2c7322823249 (patch) | |
tree | eca7c4d056966400406e516f9cb77e2d0c0cc432 /net/dccp | |
parent | 7dad9937e064a6411cc3427f3f5870fa72132ad8 (diff) | |
download | linux-stable-1295e2cf3065a55f35d112e4dfeb2c7322823249.tar.gz linux-stable-1295e2cf3065a55f35d112e4dfeb2c7322823249.tar.bz2 linux-stable-1295e2cf3065a55f35d112e4dfeb2c7322823249.zip |
inet: minor optimization for backlog setting in listen(2)
Set the backlog earlier in inet_dccp_listen() and inet_listen(),
then we can avoid the redundant setting.
Signed-off-by: Yafang Shao <laoar.shao@gmail.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dccp')
-rw-r--r-- | net/dccp/proto.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/dccp/proto.c b/net/dccp/proto.c index 43733accf58e..658cd32bb7b3 100644 --- a/net/dccp/proto.c +++ b/net/dccp/proto.c @@ -948,6 +948,7 @@ int inet_dccp_listen(struct socket *sock, int backlog) if (!((1 << old_state) & (DCCPF_CLOSED | DCCPF_LISTEN))) goto out; + sk->sk_max_ack_backlog = backlog; /* Really, if the socket is already in listen state * we can only allow the backlog to be adjusted. */ @@ -960,7 +961,6 @@ int inet_dccp_listen(struct socket *sock, int backlog) if (err) goto out; } - sk->sk_max_ack_backlog = backlog; err = 0; out: |