tcp: remove tcp_rcv_state_process() tcp_hdr argument
authorEric Dumazet <edumazet@google.com>
Tue, 29 Sep 2015 14:42:41 +0000 (07:42 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 29 Sep 2015 23:53:07 +0000 (16:53 -0700)
Factorize code to get tcp header from skb. It makes no sense
to duplicate code in callers.

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
net/ipv4/tcp_ipv4.c
net/ipv4/tcp_minisocks.c
net/ipv6/tcp_ipv6.c

index 1cfdedbe47e1d5922896f9c91599987e6b2acb9d..1fe0bd458cb4b6865cee8f435dba749ed7a7da8e 100644 (file)
@@ -365,8 +365,7 @@ void tcp_wfree(struct sk_buff *skb);
 void tcp_write_timer_handler(struct sock *sk);
 void tcp_delack_timer_handler(struct sock *sk);
 int tcp_ioctl(struct sock *sk, int cmd, unsigned long arg);
-int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb,
-                         const struct tcphdr *th);
+int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb);
 void tcp_rcv_established(struct sock *sk, struct sk_buff *skb,
                         const struct tcphdr *th, unsigned int len);
 void tcp_rcv_space_adjust(struct sock *sk);
index dcbddf12f4b32b73791c0c6efeee79a280da5f95..67b27aee8d280dd43a041cf99c7f03534aa1fc06 100644 (file)
@@ -5698,11 +5698,11 @@ reset_and_undo:
  *     address independent.
  */
 
-int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb,
-                         const struct tcphdr *th)
+int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb)
 {
        struct tcp_sock *tp = tcp_sk(sk);
        struct inet_connection_sock *icsk = inet_csk(sk);
+       const struct tcphdr *th = tcp_hdr(skb);
        struct request_sock *req;
        int queued = 0;
        bool acceptable;
index 7e5ae1e0100957120bfbcd3d7310d229394dc07f..67c0dc8bddbf3c7bfb252f66d0f64a0adaf2d2ae 100644 (file)
@@ -1420,7 +1420,7 @@ int tcp_v4_do_rcv(struct sock *sk, struct sk_buff *skb)
        } else
                sock_rps_save_rxhash(sk, skb);
 
-       if (tcp_rcv_state_process(sk, skb, tcp_hdr(skb))) {
+       if (tcp_rcv_state_process(sk, skb)) {
                rsk = sk;
                goto reset;
        }
index 9c7c61cf7462ccce5e8e0d941fa2dc99c5b196bd..139668cc23473c425a88454d9f95efced0ec6529 100644 (file)
@@ -821,7 +821,7 @@ int tcp_child_process(struct sock *parent, struct sock *child,
        int state = child->sk_state;
 
        if (!sock_owned_by_user(child)) {
-               ret = tcp_rcv_state_process(child, skb, tcp_hdr(skb));
+               ret = tcp_rcv_state_process(child, skb);
                /* Wakeup parent, send SIGIO */
                if (state == TCP_SYN_RECV && child->sk_state != state)
                        parent->sk_data_ready(parent);
index b6e473f0f62eb4ae827c96f1fae56e8a440ce596..334d548a0cf61e453615ac19d9aae09e12a48e3f 100644 (file)
@@ -1272,7 +1272,7 @@ static int tcp_v6_do_rcv(struct sock *sk, struct sk_buff *skb)
        } else
                sock_rps_save_rxhash(sk, skb);
 
-       if (tcp_rcv_state_process(sk, skb, tcp_hdr(skb)))
+       if (tcp_rcv_state_process(sk, skb))
                goto reset;
        if (opt_skb)
                goto ipv6_pktoptions;