tcp: move tcp_openreq_init() to tcp_input.c
authorEric Dumazet <edumazet@google.com>
Tue, 17 Mar 2015 04:06:19 +0000 (21:06 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 17 Mar 2015 19:18:00 +0000 (15:18 -0400)
This big helper is called once from tcp_conn_request(), there is no
point having it in an include. Compiler will inline it anyway.

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

index 2e11e38205c226b3a0644e1b4752570414918e50..9fe1d535cd6c13b3f5ddfb8ddf6da5d2fa3a3a03 100644 (file)
@@ -1137,31 +1137,6 @@ static inline int tcp_full_space(const struct sock *sk)
        return tcp_win_from_space(sk->sk_rcvbuf);
 }
 
-static inline void tcp_openreq_init(struct request_sock *req,
-                                   struct tcp_options_received *rx_opt,
-                                   struct sk_buff *skb, struct sock *sk)
-{
-       struct inet_request_sock *ireq = inet_rsk(req);
-
-       req->rcv_wnd = 0;               /* So that tcp_send_synack() knows! */
-       req->cookie_ts = 0;
-       tcp_rsk(req)->rcv_isn = TCP_SKB_CB(skb)->seq;
-       tcp_rsk(req)->rcv_nxt = TCP_SKB_CB(skb)->seq + 1;
-       tcp_rsk(req)->snt_synack = tcp_time_stamp;
-       tcp_rsk(req)->last_oow_ack_time = 0;
-       req->mss = rx_opt->mss_clamp;
-       req->ts_recent = rx_opt->saw_tstamp ? rx_opt->rcv_tsval : 0;
-       ireq->tstamp_ok = rx_opt->tstamp_ok;
-       ireq->sack_ok = rx_opt->sack_ok;
-       ireq->snd_wscale = rx_opt->snd_wscale;
-       ireq->wscale_ok = rx_opt->wscale_ok;
-       ireq->acked = 0;
-       ireq->ecn_ok = 0;
-       ireq->ir_rmt_port = tcp_hdr(skb)->source;
-       ireq->ir_num = ntohs(tcp_hdr(skb)->dest);
-       ireq->ir_mark = inet_request_mark(sk, skb);
-}
-
 extern void tcp_openreq_init_rwin(struct request_sock *req,
                                  struct sock *sk, struct dst_entry *dst);
 
index 717d437b6ce13574d34bcb328f0eac168a8e0b0d..10d6bd93f2291e091b5b35c3589f8a8d0d4dca02 100644 (file)
@@ -5912,6 +5912,31 @@ static void tcp_ecn_create_request(struct request_sock *req,
                inet_rsk(req)->ecn_ok = 1;
 }
 
+static void tcp_openreq_init(struct request_sock *req,
+                            const struct tcp_options_received *rx_opt,
+                            struct sk_buff *skb, const struct sock *sk)
+{
+       struct inet_request_sock *ireq = inet_rsk(req);
+
+       req->rcv_wnd = 0;               /* So that tcp_send_synack() knows! */
+       req->cookie_ts = 0;
+       tcp_rsk(req)->rcv_isn = TCP_SKB_CB(skb)->seq;
+       tcp_rsk(req)->rcv_nxt = TCP_SKB_CB(skb)->seq + 1;
+       tcp_rsk(req)->snt_synack = tcp_time_stamp;
+       tcp_rsk(req)->last_oow_ack_time = 0;
+       req->mss = rx_opt->mss_clamp;
+       req->ts_recent = rx_opt->saw_tstamp ? rx_opt->rcv_tsval : 0;
+       ireq->tstamp_ok = rx_opt->tstamp_ok;
+       ireq->sack_ok = rx_opt->sack_ok;
+       ireq->snd_wscale = rx_opt->snd_wscale;
+       ireq->wscale_ok = rx_opt->wscale_ok;
+       ireq->acked = 0;
+       ireq->ecn_ok = 0;
+       ireq->ir_rmt_port = tcp_hdr(skb)->source;
+       ireq->ir_num = ntohs(tcp_hdr(skb)->dest);
+       ireq->ir_mark = inet_request_mark(sk, skb);
+}
+
 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)