]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
tcp/dccp: constify rtx_synack() and friends
authorEric Dumazet <edumazet@google.com>
Fri, 25 Sep 2015 14:39:23 +0000 (07:39 -0700)
committerDavid S. Miller <davem@davemloft.net>
Fri, 25 Sep 2015 20:00:39 +0000 (13:00 -0700)
This is done to make sure we do not change listener socket
while sending SYNACK packets while socket lock is not held.

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

index 87935cad2f7b37eadd01d30a3d39a9f73d0145b9..ff7ce1e53ed47d69f9b1fae9a893ee9e503ad6c8 100644 (file)
@@ -32,7 +32,7 @@ struct request_sock_ops {
        int             obj_size;
        struct kmem_cache       *slab;
        char            *slab_name;
-       int             (*rtx_syn_ack)(struct sock *sk,
+       int             (*rtx_syn_ack)(const struct sock *sk,
                                       struct request_sock *req);
        void            (*send_ack)(struct sock *sk, struct sk_buff *skb,
                                    struct request_sock *req);
index 868c535321695849464feaa82c176bcc274e9231..6630ab180f5cdf43ae41a2ee89454220387170c0 100644 (file)
@@ -1676,7 +1676,7 @@ int tcp4_proc_init(void);
 void tcp4_proc_exit(void);
 #endif
 
-int tcp_rtx_synack(struct sock *sk, struct request_sock *req);
+int tcp_rtx_synack(const struct sock *sk, struct request_sock *req);
 int tcp_conn_request(struct request_sock_ops *rsk_ops,
                     const struct tcp_request_sock_ops *af_ops,
                     struct sock *sk, struct sk_buff *skb);
index ccf4c5629b3c8672f348a3ca29b0b6bd46cc23e8..a46ae9c69ccff88418ecd527ccc3127d2edb1e18 100644 (file)
@@ -498,7 +498,7 @@ static struct dst_entry* dccp_v4_route_skb(struct net *net, struct sock *sk,
        return &rt->dst;
 }
 
-static int dccp_v4_send_response(struct sock *sk, struct request_sock *req)
+static int dccp_v4_send_response(const struct sock *sk, struct request_sock *req)
 {
        int err = -1;
        struct sk_buff *skb;
index 5165571f397aa6d40da19d36287ca8339852ab54..4fa199dc69a3878ca31d35a4d5f753ae9adcb0d6 100644 (file)
@@ -181,7 +181,7 @@ static void dccp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
 }
 
 
-static int dccp_v6_send_response(struct sock *sk, struct request_sock *req)
+static int dccp_v6_send_response(const struct sock *sk, struct request_sock *req)
 {
        struct inet_request_sock *ireq = inet_rsk(req);
        struct ipv6_pinfo *np = inet6_sk(sk);
index 9eb67a8933f14cb73d007b00af133577fd26d498..53ce6cf555984b67fe6e53f4d615e50095731202 100644 (file)
@@ -3502,7 +3502,7 @@ void tcp_send_probe0(struct sock *sk)
                                  TCP_RTO_MAX);
 }
 
-int tcp_rtx_synack(struct sock *sk, struct request_sock *req)
+int tcp_rtx_synack(const struct sock *sk, struct request_sock *req)
 {
        const struct tcp_request_sock_ops *af_ops = tcp_rsk(req)->af_specific;
        struct flowi fl;