Commit 42cb80a2 authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller

inet: remove sk_listener parameter from syn_ack_timeout()

It is not needed, and req->sk_listener points to the listener anyway.
request_sock argument can be const.
Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 2b41fab7
...@@ -317,6 +317,6 @@ static inline const char *dccp_role(const struct sock *sk) ...@@ -317,6 +317,6 @@ static inline const char *dccp_role(const struct sock *sk)
return NULL; return NULL;
} }
extern void dccp_syn_ack_timeout(struct sock *sk, struct request_sock *req); extern void dccp_syn_ack_timeout(const struct request_sock *req);
#endif /* _LINUX_DCCP_H */ #endif /* _LINUX_DCCP_H */
...@@ -39,8 +39,7 @@ struct request_sock_ops { ...@@ -39,8 +39,7 @@ struct request_sock_ops {
void (*send_reset)(struct sock *sk, void (*send_reset)(struct sock *sk,
struct sk_buff *skb); struct sk_buff *skb);
void (*destructor)(struct request_sock *req); void (*destructor)(struct request_sock *req);
void (*syn_ack_timeout)(struct sock *sk, void (*syn_ack_timeout)(const struct request_sock *req);
struct request_sock *req);
}; };
int inet_rtx_syn_ack(struct sock *parent, struct request_sock *req); int inet_rtx_syn_ack(struct sock *parent, struct request_sock *req);
......
...@@ -433,7 +433,7 @@ int compat_tcp_getsockopt(struct sock *sk, int level, int optname, ...@@ -433,7 +433,7 @@ int compat_tcp_getsockopt(struct sock *sk, int level, int optname,
int compat_tcp_setsockopt(struct sock *sk, int level, int optname, int compat_tcp_setsockopt(struct sock *sk, int level, int optname,
char __user *optval, unsigned int optlen); char __user *optval, unsigned int optlen);
void tcp_set_keepalive(struct sock *sk, int val); void tcp_set_keepalive(struct sock *sk, int val);
void tcp_syn_ack_timeout(struct sock *sk, struct request_sock *req); void tcp_syn_ack_timeout(const struct request_sock *req);
int tcp_recvmsg(struct sock *sk, struct msghdr *msg, size_t len, int nonblock, int tcp_recvmsg(struct sock *sk, struct msghdr *msg, size_t len, int nonblock,
int flags, int *addr_len); int flags, int *addr_len);
void tcp_parse_options(const struct sk_buff *skb, void tcp_parse_options(const struct sk_buff *skb,
......
...@@ -576,7 +576,7 @@ static void dccp_v4_reqsk_destructor(struct request_sock *req) ...@@ -576,7 +576,7 @@ static void dccp_v4_reqsk_destructor(struct request_sock *req)
kfree(inet_rsk(req)->opt); kfree(inet_rsk(req)->opt);
} }
void dccp_syn_ack_timeout(struct sock *sk, struct request_sock *req) void dccp_syn_ack_timeout(const struct request_sock *req)
{ {
} }
EXPORT_SYMBOL(dccp_syn_ack_timeout); EXPORT_SYMBOL(dccp_syn_ack_timeout);
......
...@@ -615,7 +615,7 @@ static void reqsk_timer_handler(unsigned long data) ...@@ -615,7 +615,7 @@ static void reqsk_timer_handler(unsigned long data)
max_retries = defer_accept; max_retries = defer_accept;
syn_ack_recalc(req, thresh, max_retries, defer_accept, syn_ack_recalc(req, thresh, max_retries, defer_accept,
&expire, &resend); &expire, &resend);
req->rsk_ops->syn_ack_timeout(sk_listener, req); req->rsk_ops->syn_ack_timeout(req);
if (!expire && if (!expire &&
(!resend || (!resend ||
!inet_rtx_syn_ack(sk_listener, req) || !inet_rtx_syn_ack(sk_listener, req) ||
......
...@@ -327,7 +327,7 @@ static void tcp_fastopen_synack_timer(struct sock *sk) ...@@ -327,7 +327,7 @@ static void tcp_fastopen_synack_timer(struct sock *sk)
struct request_sock *req; struct request_sock *req;
req = tcp_sk(sk)->fastopen_rsk; req = tcp_sk(sk)->fastopen_rsk;
req->rsk_ops->syn_ack_timeout(sk, req); req->rsk_ops->syn_ack_timeout(req);
if (req->num_timeout >= max_retries) { if (req->num_timeout >= max_retries) {
tcp_write_err(sk); tcp_write_err(sk);
...@@ -539,9 +539,11 @@ static void tcp_write_timer(unsigned long data) ...@@ -539,9 +539,11 @@ static void tcp_write_timer(unsigned long data)
sock_put(sk); sock_put(sk);
} }
void tcp_syn_ack_timeout(struct sock *sk, struct request_sock *req) void tcp_syn_ack_timeout(const struct request_sock *req)
{ {
NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_TCPTIMEOUTS); struct net *net = read_pnet(&inet_rsk(req)->ireq_net);
NET_INC_STATS_BH(net, LINUX_MIB_TCPTIMEOUTS);
} }
EXPORT_SYMBOL(tcp_syn_ack_timeout); EXPORT_SYMBOL(tcp_syn_ack_timeout);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment