inet: makes syn_ack_timeout mandatory
authorEric Dumazet <edumazet@google.com>
Thu, 12 Apr 2012 22:16:05 +0000 (22:16 +0000)
committerDavid S. Miller <davem@davemloft.net>
Sat, 14 Apr 2012 19:24:26 +0000 (15:24 -0400)
There are two struct request_sock_ops providers, tcp and dccp.

inet_csk_reqsk_queue_prune() can avoid testing syn_ack_timeout being
NULL if we make it non NULL like syn_ack_timeout

Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Gerrit Renker <gerrit@erg.abdn.ac.uk>
Cc: dccp@vger.kernel.org
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/dccp.h
net/dccp/ipv4.c
net/dccp/ipv6.c
net/ipv4/inet_connection_sock.c

index eaf95a023af4ee3b4276aa892a8280181a8cfeee..d16294e2a11818261607aee670be9d0dedc14dff 100644 (file)
@@ -549,6 +549,8 @@ static inline const char *dccp_role(const struct sock *sk)
        return NULL;
 }
 
+extern void dccp_syn_ack_timeout(struct sock *sk, struct request_sock *req);
+
 #endif /* __KERNEL__ */
 
 #endif /* _LINUX_DCCP_H */
index caf6e1734b6296b92a8d4223632a264d9ee09075..07f5579ca756c90030758b99fff0e43708f115be 100644 (file)
@@ -574,6 +574,11 @@ static void dccp_v4_reqsk_destructor(struct request_sock *req)
        kfree(inet_rsk(req)->opt);
 }
 
+void dccp_syn_ack_timeout(struct sock *sk, struct request_sock *req)
+{
+}
+EXPORT_SYMBOL(dccp_syn_ack_timeout);
+
 static struct request_sock_ops dccp_request_sock_ops __read_mostly = {
        .family         = PF_INET,
        .obj_size       = sizeof(struct dccp_request_sock),
@@ -581,6 +586,7 @@ static struct request_sock_ops dccp_request_sock_ops __read_mostly = {
        .send_ack       = dccp_reqsk_send_ack,
        .destructor     = dccp_v4_reqsk_destructor,
        .send_reset     = dccp_v4_ctl_send_reset,
+       .syn_ack_timeout = dccp_syn_ack_timeout,
 };
 
 int dccp_v4_conn_request(struct sock *sk, struct sk_buff *skb)
index 4dc588f520e04047c24b2b27f9d94aef0cb634ba..e923ac95bb04d3d8bf16fb99e05e29fbfc54ada8 100644 (file)
@@ -343,6 +343,7 @@ static struct request_sock_ops dccp6_request_sock_ops = {
        .send_ack       = dccp_reqsk_send_ack,
        .destructor     = dccp_v6_reqsk_destructor,
        .send_reset     = dccp_v6_ctl_send_reset,
+       .syn_ack_timeout = dccp_syn_ack_timeout,
 };
 
 static struct sock *dccp_v6_hnd_req(struct sock *sk,struct sk_buff *skb)
index c12396f2785fdf0a002eea58a78ebb89ce3c1b7b..d19f32aca6ca1b26725ddfdd46b5a5570130accf 100644 (file)
@@ -555,8 +555,7 @@ void inet_csk_reqsk_queue_prune(struct sock *parent,
                                syn_ack_recalc(req, thresh, max_retries,
                                               queue->rskq_defer_accept,
                                               &expire, &resend);
-                               if (req->rsk_ops->syn_ack_timeout)
-                                       req->rsk_ops->syn_ack_timeout(parent, req);
+                               req->rsk_ops->syn_ack_timeout(parent, req);
                                if (!expire &&
                                    (!resend ||
                                     !req->rsk_ops->rtx_syn_ack(parent, req, NULL) ||