Lines Matching refs:th
270 static void tcp_ecn_rcv_synack(struct tcp_sock *tp, const struct tcphdr *th) in tcp_ecn_rcv_synack() argument
272 if ((tp->ecn_flags & TCP_ECN_OK) && (!th->ece || th->cwr)) in tcp_ecn_rcv_synack()
276 static void tcp_ecn_rcv_syn(struct tcp_sock *tp, const struct tcphdr *th) in tcp_ecn_rcv_syn() argument
278 if ((tp->ecn_flags & TCP_ECN_OK) && (!th->ece || !th->cwr)) in tcp_ecn_rcv_syn()
282 static bool tcp_ecn_rcv_ecn_echo(const struct tcp_sock *tp, const struct tcphdr *th) in tcp_ecn_rcv_ecn_echo() argument
284 if (th->ece && !th->syn && (tp->ecn_flags & TCP_ECN_OK)) in tcp_ecn_rcv_ecn_echo()
3754 const struct tcphdr *th = tcp_hdr(skb); in tcp_parse_options() local
3755 int length = (th->doff * 4) - sizeof(struct tcphdr); in tcp_parse_options()
3757 ptr = (const unsigned char *)(th + 1); in tcp_parse_options()
3778 if (opsize == TCPOLEN_MSS && th->syn && !estab) { in tcp_parse_options()
3789 if (opsize == TCPOLEN_WINDOW && th->syn && in tcp_parse_options()
3812 if (opsize == TCPOLEN_SACK_PERM && th->syn && in tcp_parse_options()
3823 TCP_SKB_CB(skb)->sacked = (ptr - 2) - (unsigned char *)th; in tcp_parse_options()
3837 ptr, th->syn, foc, false); in tcp_parse_options()
3849 ptr + 2, th->syn, foc, true); in tcp_parse_options()
3860 static bool tcp_parse_aligned_timestamp(struct tcp_sock *tp, const struct tcphdr *th) in tcp_parse_aligned_timestamp() argument
3862 const __be32 *ptr = (const __be32 *)(th + 1); in tcp_parse_aligned_timestamp()
3883 const struct tcphdr *th, struct tcp_sock *tp) in tcp_fast_parse_options() argument
3888 if (th->doff == (sizeof(*th) / 4)) { in tcp_fast_parse_options()
3892 th->doff == ((sizeof(*th) + TCPOLEN_TSTAMP_ALIGNED) / 4)) { in tcp_fast_parse_options()
3893 if (tcp_parse_aligned_timestamp(tp, th)) in tcp_fast_parse_options()
3908 const u8 *tcp_parse_md5sig_option(const struct tcphdr *th) in tcp_parse_md5sig_option() argument
3910 int length = (th->doff << 2) - sizeof(*th); in tcp_parse_md5sig_option()
3911 const u8 *ptr = (const u8 *)(th + 1); in tcp_parse_md5sig_option()
3965 const struct tcphdr *th = tcp_hdr(skb); in tcp_disordered_ack() local
3970 (th->ack && seq == TCP_SKB_CB(skb)->end_seq && seq == tp->rcv_nxt) && in tcp_disordered_ack()
3976 !tcp_may_update_window(tp, ack, seq, ntohs(th->window) << tp->rx_opt.snd_wscale) && in tcp_disordered_ack()
5155 static void tcp_check_urg(struct sock *sk, const struct tcphdr *th) in tcp_check_urg() argument
5158 u32 ptr = ntohs(th->urg_ptr); in tcp_check_urg()
5162 ptr += ntohl(th->seq); in tcp_check_urg()
5221 static void tcp_urg(struct sock *sk, struct sk_buff *skb, const struct tcphdr *th) in tcp_urg() argument
5226 if (th->urg) in tcp_urg()
5227 tcp_check_urg(sk, th); in tcp_urg()
5231 u32 ptr = tp->urg_seq - ntohl(th->seq) + (th->doff * 4) - in tcp_urg()
5232 th->syn; in tcp_urg()
5294 const struct tcphdr *th, int syn_inerr) in tcp_validate_incoming() argument
5299 if (tcp_fast_parse_options(skb, th, tp) && tp->rx_opt.saw_tstamp && in tcp_validate_incoming()
5301 if (!th->rst) { in tcp_validate_incoming()
5320 if (!th->rst) { in tcp_validate_incoming()
5321 if (th->syn) in tcp_validate_incoming()
5332 if (th->rst) { in tcp_validate_incoming()
5351 if (th->syn) { in tcp_validate_incoming()
5391 const struct tcphdr *th, unsigned int len) in tcp_rcv_established() argument
5423 if ((tcp_flag_word(th) & TCP_HP_BITS) == tp->pred_flags && in tcp_rcv_established()
5436 if (!tcp_parse_aligned_timestamp(tp, th)) in tcp_rcv_established()
5549 if (len < (th->doff << 2) || tcp_checksum_complete_user(sk, skb)) in tcp_rcv_established()
5552 if (!th->ack && !th->rst && !th->syn) in tcp_rcv_established()
5559 if (!tcp_validate_incoming(sk, skb, th, 1)) in tcp_rcv_established()
5569 tcp_urg(sk, skb, th); in tcp_rcv_established()
5679 const struct tcphdr *th) in tcp_rcv_synsent_state_process() argument
5691 if (th->ack) { in tcp_rcv_synsent_state_process()
5719 if (th->rst) { in tcp_rcv_synsent_state_process()
5731 if (!th->syn) in tcp_rcv_synsent_state_process()
5741 tcp_ecn_rcv_synack(tp, th); in tcp_rcv_synsent_state_process()
5755 tp->snd_wnd = ntohs(th->window); in tcp_rcv_synsent_state_process()
5823 if (th->rst) { in tcp_rcv_synsent_state_process()
5838 if (th->syn) { in tcp_rcv_synsent_state_process()
5861 tp->snd_wnd = ntohs(th->window); in tcp_rcv_synsent_state_process()
5865 tcp_ecn_rcv_syn(tp, th); in tcp_rcv_synsent_state_process()
5915 const struct tcphdr *th = tcp_hdr(skb); in tcp_rcv_state_process() local
5927 if (th->ack) in tcp_rcv_state_process()
5930 if (th->rst) in tcp_rcv_state_process()
5933 if (th->syn) { in tcp_rcv_state_process()
5934 if (th->fin) in tcp_rcv_state_process()
5962 queued = tcp_rcv_synsent_state_process(sk, skb, th); in tcp_rcv_state_process()
5967 tcp_urg(sk, skb, th); in tcp_rcv_state_process()
5982 if (!th->ack && !th->rst && !th->syn) in tcp_rcv_state_process()
5985 if (!tcp_validate_incoming(sk, skb, th, 0)) in tcp_rcv_state_process()
6031 tp->snd_wnd = ntohs(th->window) << tp->rx_opt.snd_wscale; in tcp_rcv_state_process()
6091 after(TCP_SKB_CB(skb)->end_seq - th->fin, tp->rcv_nxt))) { in tcp_rcv_state_process()
6100 } else if (th->fin || sock_owned_by_user(sk)) { in tcp_rcv_state_process()
6132 tcp_urg(sk, skb, th); in tcp_rcv_state_process()
6149 after(TCP_SKB_CB(skb)->end_seq - th->fin, tp->rcv_nxt)) { in tcp_rcv_state_process()
6207 const struct tcphdr *th = tcp_hdr(skb); in tcp_ecn_create_request() local
6209 bool th_ecn = th->ece && th->cwr; in tcp_ecn_create_request()