Skip to content

Commit 91eddd3

Browse files
committed
Merge branch 'dccp-tcp-minor-fixes-for-inet_csk_listen_start'
Kuniyuki Iwashima says: ==================== dccp/tcp: Minor fixes for inet_csk_listen_start(). The first patch removes an unused argument, and the second removes a stale comment. ==================== Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2 parents c6d5f19 + b4a8e74 commit 91eddd3

File tree

5 files changed

+15
-20
lines changed

5 files changed

+15
-20
lines changed

include/net/inet_connection_sock.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ static inline __poll_t inet_csk_listen_poll(const struct sock *sk)
304304
(EPOLLIN | EPOLLRDNORM) : 0;
305305
}
306306

307-
int inet_csk_listen_start(struct sock *sk, int backlog);
307+
int inet_csk_listen_start(struct sock *sk);
308308
void inet_csk_listen_stop(struct sock *sk);
309309

310310
void inet_csk_addr2sockaddr(struct sock *sk, struct sockaddr *uaddr);

net/dccp/proto.c

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -238,17 +238,6 @@ void dccp_destroy_sock(struct sock *sk)
238238

239239
EXPORT_SYMBOL_GPL(dccp_destroy_sock);
240240

241-
static inline int dccp_listen_start(struct sock *sk, int backlog)
242-
{
243-
struct dccp_sock *dp = dccp_sk(sk);
244-
245-
dp->dccps_role = DCCP_ROLE_LISTEN;
246-
/* do not start to listen if feature negotiation setup fails */
247-
if (dccp_feat_finalise_settings(dp))
248-
return -EPROTO;
249-
return inet_csk_listen_start(sk, backlog);
250-
}
251-
252241
static inline int dccp_need_reset(int state)
253242
{
254243
return state != DCCP_CLOSED && state != DCCP_LISTEN &&
@@ -931,11 +920,17 @@ int inet_dccp_listen(struct socket *sock, int backlog)
931920
* we can only allow the backlog to be adjusted.
932921
*/
933922
if (old_state != DCCP_LISTEN) {
934-
/*
935-
* FIXME: here it probably should be sk->sk_prot->listen_start
936-
* see tcp_listen_start
937-
*/
938-
err = dccp_listen_start(sk, backlog);
923+
struct dccp_sock *dp = dccp_sk(sk);
924+
925+
dp->dccps_role = DCCP_ROLE_LISTEN;
926+
927+
/* do not start to listen if feature negotiation setup fails */
928+
if (dccp_feat_finalise_settings(dp)) {
929+
err = -EPROTO;
930+
goto out;
931+
}
932+
933+
err = inet_csk_listen_start(sk);
939934
if (err)
940935
goto out;
941936
}

net/ipv4/af_inet.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ int inet_listen(struct socket *sock, int backlog)
225225
tcp_fastopen_init_key_once(sock_net(sk));
226226
}
227227

228-
err = inet_csk_listen_start(sk, backlog);
228+
err = inet_csk_listen_start(sk);
229229
if (err)
230230
goto out;
231231
tcp_call_bpf(sk, BPF_SOCK_OPS_TCP_LISTEN_CB, 0, NULL);

net/ipv4/inet_connection_sock.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1035,7 +1035,7 @@ void inet_csk_prepare_forced_close(struct sock *sk)
10351035
}
10361036
EXPORT_SYMBOL(inet_csk_prepare_forced_close);
10371037

1038-
int inet_csk_listen_start(struct sock *sk, int backlog)
1038+
int inet_csk_listen_start(struct sock *sk)
10391039
{
10401040
struct inet_connection_sock *icsk = inet_csk(sk);
10411041
struct inet_sock *inet = inet_sk(sk);

tools/testing/selftests/bpf/progs/test_sk_storage_tracing.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ static void set_task_info(struct sock *sk)
6868
}
6969

7070
SEC("fentry/inet_csk_listen_start")
71-
int BPF_PROG(trace_inet_csk_listen_start, struct sock *sk, int backlog)
71+
int BPF_PROG(trace_inet_csk_listen_start, struct sock *sk)
7272
{
7373
set_task_info(sk);
7474

0 commit comments

Comments
 (0)