tcp: constify tcp_v{4|6}_route_req() sock argument
authorEric Dumazet <edumazet@google.com>
Tue, 29 Sep 2015 14:42:50 +0000 (07:42 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 29 Sep 2015 23:53:09 +0000 (16:53 -0700)
These functions do not change the listener socket.
Goal is to make sure tcp_conn_request() is not messing with
listener in a racy way.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/tcp.h
net/ipv4/tcp_ipv4.c
net/ipv6/tcp_ipv6.c

index 5aa6672c6f5bc9732cca6b36225afb82750c9cd1..2c7dfe52f473fc97d4ee92f7cac6e59d661bf711 100644 (file)
@@ -1711,7 +1711,7 @@ struct tcp_request_sock_ops {
        __u32 (*cookie_init_seq)(const struct sk_buff *skb,
                                 __u16 *mss);
 #endif
-       struct dst_entry *(*route_req)(struct sock *sk, struct flowi *fl,
+       struct dst_entry *(*route_req)(const struct sock *sk, struct flowi *fl,
                                       const struct request_sock *req,
                                       bool *strict);
        __u32 (*init_seq)(const struct sk_buff *skb);
index ee0239e190cfc15298c81284a2f90aa69d25795c..f551e9e862dbfdb9bd761199078a06be1e334ddc 100644 (file)
@@ -1180,7 +1180,8 @@ static void tcp_v4_init_req(struct request_sock *req,
        ireq->opt = tcp_v4_save_options(skb);
 }
 
-static struct dst_entry *tcp_v4_route_req(struct sock *sk, struct flowi *fl,
+static struct dst_entry *tcp_v4_route_req(const struct sock *sk,
+                                         struct flowi *fl,
                                          const struct request_sock *req,
                                          bool *strict)
 {
index 2330c7be6323af1b0a5e747dc5dd5022b618b9c5..97bc26e0cd0f51e78312e5011ef7d06cb9e57aea 100644 (file)
@@ -689,7 +689,8 @@ static void tcp_v6_init_req(struct request_sock *req,
        }
 }
 
-static struct dst_entry *tcp_v6_route_req(struct sock *sk, struct flowi *fl,
+static struct dst_entry *tcp_v6_route_req(const struct sock *sk,
+                                         struct flowi *fl,
                                          const struct request_sock *req,
                                          bool *strict)
 {