@@ -2018,7 +2018,7 @@ struct tcp_request_sock_ops {
const struct sk_buff *skb);
#endif
void (*init_req)(struct request_sock *req,
- const struct sock *sk_listener,
+ struct sock *sk_listener,
struct sk_buff *skb);
#ifdef CONFIG_SYN_COOKIES
__u32 (*cookie_init_seq)(const struct sk_buff *skb,
@@ -1420,7 +1420,7 @@ static bool tcp_v4_inbound_md5_hash(const struct sock *sk,
}
static void tcp_v4_init_req(struct request_sock *req,
- const struct sock *sk_listener,
+ struct sock *sk_listener,
struct sk_buff *skb)
{
struct inet_request_sock *ireq = inet_rsk(req);
@@ -792,7 +792,7 @@ static bool tcp_v6_inbound_md5_hash(const struct sock *sk,
}
static void tcp_v6_init_req(struct request_sock *req,
- const struct sock *sk_listener,
+ struct sock *sk_listener,
struct sk_buff *skb)
{
bool l3_slave = ipv6_l3mdev_skb(TCP_SKB_CB(skb)->header.h6.flags);
@@ -175,7 +175,7 @@ static void subflow_init_req(struct request_sock *req,
}
static void subflow_v4_init_req(struct request_sock *req,
- const struct sock *sk_listener,
+ struct sock *sk_listener,
struct sk_buff *skb)
{
tcp_rsk(req)->is_mptcp = 1;
@@ -187,7 +187,7 @@ static void subflow_v4_init_req(struct request_sock *req,
#if IS_ENABLED(CONFIG_MPTCP_IPV6)
static void subflow_v6_init_req(struct request_sock *req,
- const struct sock *sk_listener,
+ struct sock *sk_listener,
struct sk_buff *skb)
{
tcp_rsk(req)->is_mptcp = 1;
In MPTCP case, we may want to add the request sock to the listner backlog even when syncookies are in use in order to handle MPTCP JOIN requests. This will push the request queue past its limit, but is subject to other checks: 1. The (32bit) token resolves to a established MPTCP connection. 2. The MPTCP connection can still accept another subflow. Without this, the mptcp req_init function needs to use a cast such as foo((void *)sk_listener); to suppress a compiler warning. Signed-off-by: Florian Westphal <fw@strlen.de> --- This isn't nice given this is only for MPTCP syncookies. Possible alternatives are: 1. Give up on JOIN support in cookie mode and toss this patch. 2. live with a cast and toss this patch. 3. Allow ->init_req() to cancel syncookie mode and do the add of rsk to sk_listener in the caller/tcp stack. 4. Do not store the request socket but some more minimal state (peers nonce, connid, our nonce, ...) I'd rather avoid that since it won't resolve the fundamental issue of storing information, also needs to reinvent several things e.g. timeouts and so on. include/net/tcp.h | 2 +- net/ipv4/tcp_ipv4.c | 2 +- net/ipv6/tcp_ipv6.c | 2 +- net/mptcp/subflow.c | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-)