tcp: remove tcp_rcv_state_process() tcp_hdr argument

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>
This commit is contained in:
Eric Dumazet 2015-09-29 07:42:41 -07:00 committed by David S. Miller
parent bda07a64c0
commit 72ab4a86f7
5 changed files with 6 additions and 7 deletions

View File

@ -365,8 +365,7 @@ void tcp_wfree(struct sk_buff *skb);
void tcp_write_timer_handler(struct sock *sk); void tcp_write_timer_handler(struct sock *sk);
void tcp_delack_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_ioctl(struct sock *sk, int cmd, unsigned long arg);
int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb, int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb);
const struct tcphdr *th);
void tcp_rcv_established(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); const struct tcphdr *th, unsigned int len);
void tcp_rcv_space_adjust(struct sock *sk); void tcp_rcv_space_adjust(struct sock *sk);

View File

@ -5698,11 +5698,11 @@ static int tcp_rcv_synsent_state_process(struct sock *sk, struct sk_buff *skb,
* address independent. * address independent.
*/ */
int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb, int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb)
const struct tcphdr *th)
{ {
struct tcp_sock *tp = tcp_sk(sk); struct tcp_sock *tp = tcp_sk(sk);
struct inet_connection_sock *icsk = inet_csk(sk); struct inet_connection_sock *icsk = inet_csk(sk);
const struct tcphdr *th = tcp_hdr(skb);
struct request_sock *req; struct request_sock *req;
int queued = 0; int queued = 0;
bool acceptable; bool acceptable;

View File

@ -1420,7 +1420,7 @@ int tcp_v4_do_rcv(struct sock *sk, struct sk_buff *skb)
} else } else
sock_rps_save_rxhash(sk, skb); 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; rsk = sk;
goto reset; goto reset;
} }

View File

@ -821,7 +821,7 @@ int tcp_child_process(struct sock *parent, struct sock *child,
int state = child->sk_state; int state = child->sk_state;
if (!sock_owned_by_user(child)) { 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 */ /* Wakeup parent, send SIGIO */
if (state == TCP_SYN_RECV && child->sk_state != state) if (state == TCP_SYN_RECV && child->sk_state != state)
parent->sk_data_ready(parent); parent->sk_data_ready(parent);

View File

@ -1272,7 +1272,7 @@ static int tcp_v6_do_rcv(struct sock *sk, struct sk_buff *skb)
} else } else
sock_rps_save_rxhash(sk, skb); 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; goto reset;
if (opt_skb) if (opt_skb)
goto ipv6_pktoptions; goto ipv6_pktoptions;