Skip to content

Commit

Permalink
dccp: Inline dccp_listen_start().
Browse files Browse the repository at this point in the history
This patch inlines dccp_listen_start() and removes a stale comment in
inet_dccp_listen() so that it looks like inet_listen().

Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.co.jp>
Reviewed-by: Richard Sailer <richard_siegfried@systemli.org>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Kuniyuki Iwashima authored and Jakub Kicinski committed Nov 24, 2021
1 parent e704939 commit b4a8e74
Showing 1 changed file with 11 additions and 16 deletions.
27 changes: 11 additions & 16 deletions net/dccp/proto.c
Original file line number Diff line number Diff line change
Expand Up @@ -238,17 +238,6 @@ void dccp_destroy_sock(struct sock *sk)

EXPORT_SYMBOL_GPL(dccp_destroy_sock);

static inline int dccp_listen_start(struct sock *sk)
{
struct dccp_sock *dp = dccp_sk(sk);

dp->dccps_role = DCCP_ROLE_LISTEN;
/* do not start to listen if feature negotiation setup fails */
if (dccp_feat_finalise_settings(dp))
return -EPROTO;
return inet_csk_listen_start(sk);
}

static inline int dccp_need_reset(int state)
{
return state != DCCP_CLOSED && state != DCCP_LISTEN &&
Expand Down Expand Up @@ -931,11 +920,17 @@ int inet_dccp_listen(struct socket *sock, int backlog)
* we can only allow the backlog to be adjusted.
*/
if (old_state != DCCP_LISTEN) {
/*
* FIXME: here it probably should be sk->sk_prot->listen_start
* see tcp_listen_start
*/
err = dccp_listen_start(sk);
struct dccp_sock *dp = dccp_sk(sk);

dp->dccps_role = DCCP_ROLE_LISTEN;

/* do not start to listen if feature negotiation setup fails */
if (dccp_feat_finalise_settings(dp)) {
err = -EPROTO;
goto out;
}

err = inet_csk_listen_start(sk);
if (err)
goto out;
}
Expand Down

0 comments on commit b4a8e74

Please sign in to comment.