Lines Matching refs:th

263 static void tcp_ecn_rcv_synack(struct tcp_sock *tp, const struct tcphdr *th)  in tcp_ecn_rcv_synack()  argument
265 if ((tp->ecn_flags & TCP_ECN_OK) && (!th->ece || th->cwr)) in tcp_ecn_rcv_synack()
269 static void tcp_ecn_rcv_syn(struct tcp_sock *tp, const struct tcphdr *th) in tcp_ecn_rcv_syn() argument
271 if ((tp->ecn_flags & TCP_ECN_OK) && (!th->ece || !th->cwr)) in tcp_ecn_rcv_syn()
275 static bool tcp_ecn_rcv_ecn_echo(const struct tcp_sock *tp, const struct tcphdr *th) in tcp_ecn_rcv_ecn_echo() argument
277 if (th->ece && !th->syn && (tp->ecn_flags & TCP_ECN_OK)) in tcp_ecn_rcv_ecn_echo()
3702 const struct tcphdr *th = tcp_hdr(skb); in tcp_parse_options() local
3703 int length = (th->doff * 4) - sizeof(struct tcphdr); in tcp_parse_options()
3705 ptr = (const unsigned char *)(th + 1); in tcp_parse_options()
3726 if (opsize == TCPOLEN_MSS && th->syn && !estab) { in tcp_parse_options()
3737 if (opsize == TCPOLEN_WINDOW && th->syn && in tcp_parse_options()
3760 if (opsize == TCPOLEN_SACK_PERM && th->syn && in tcp_parse_options()
3771 TCP_SKB_CB(skb)->sacked = (ptr - 2) - (unsigned char *)th; in tcp_parse_options()
3785 ptr, th->syn, foc, false); in tcp_parse_options()
3797 ptr + 2, th->syn, foc, true); in tcp_parse_options()
3808 static bool tcp_parse_aligned_timestamp(struct tcp_sock *tp, const struct tcphdr *th) in tcp_parse_aligned_timestamp() argument
3810 const __be32 *ptr = (const __be32 *)(th + 1); in tcp_parse_aligned_timestamp()
3831 const struct tcphdr *th, struct tcp_sock *tp) in tcp_fast_parse_options() argument
3836 if (th->doff == (sizeof(*th) / 4)) { in tcp_fast_parse_options()
3840 th->doff == ((sizeof(*th) + TCPOLEN_TSTAMP_ALIGNED) / 4)) { in tcp_fast_parse_options()
3841 if (tcp_parse_aligned_timestamp(tp, th)) in tcp_fast_parse_options()
3856 const u8 *tcp_parse_md5sig_option(const struct tcphdr *th) in tcp_parse_md5sig_option() argument
3858 int length = (th->doff << 2) - sizeof(*th); in tcp_parse_md5sig_option()
3859 const u8 *ptr = (const u8 *)(th + 1); in tcp_parse_md5sig_option()
3916 const struct tcphdr *th = tcp_hdr(skb); in tcp_disordered_ack() local
3921 (th->ack && seq == TCP_SKB_CB(skb)->end_seq && seq == tp->rcv_nxt) && in tcp_disordered_ack()
3927 !tcp_may_update_window(tp, ack, seq, ntohs(th->window) << tp->rx_opt.snd_wscale) && in tcp_disordered_ack()
4993 static void tcp_check_urg(struct sock *sk, const struct tcphdr *th) in tcp_check_urg() argument
4996 u32 ptr = ntohs(th->urg_ptr); in tcp_check_urg()
5000 ptr += ntohl(th->seq); in tcp_check_urg()
5059 static void tcp_urg(struct sock *sk, struct sk_buff *skb, const struct tcphdr *th) in tcp_urg() argument
5064 if (th->urg) in tcp_urg()
5065 tcp_check_urg(sk, th); in tcp_urg()
5069 u32 ptr = tp->urg_seq - ntohl(th->seq) + (th->doff * 4) - in tcp_urg()
5070 th->syn; in tcp_urg()
5132 const struct tcphdr *th, int syn_inerr) in tcp_validate_incoming() argument
5137 if (tcp_fast_parse_options(skb, th, tp) && tp->rx_opt.saw_tstamp && in tcp_validate_incoming()
5139 if (!th->rst) { in tcp_validate_incoming()
5158 if (!th->rst) { in tcp_validate_incoming()
5159 if (th->syn) in tcp_validate_incoming()
5170 if (th->rst) { in tcp_validate_incoming()
5189 if (th->syn) { in tcp_validate_incoming()
5229 const struct tcphdr *th, unsigned int len) in tcp_rcv_established() argument
5261 if ((tcp_flag_word(th) & TCP_HP_BITS) == tp->pred_flags && in tcp_rcv_established()
5274 if (!tcp_parse_aligned_timestamp(tp, th)) in tcp_rcv_established()
5385 if (len < (th->doff << 2) || tcp_checksum_complete_user(sk, skb)) in tcp_rcv_established()
5388 if (!th->ack && !th->rst && !th->syn) in tcp_rcv_established()
5395 if (!tcp_validate_incoming(sk, skb, th, 1)) in tcp_rcv_established()
5405 tcp_urg(sk, skb, th); in tcp_rcv_established()
5518 const struct tcphdr *th) in tcp_rcv_synsent_state_process() argument
5529 if (th->ack) { in tcp_rcv_synsent_state_process()
5557 if (th->rst) { in tcp_rcv_synsent_state_process()
5569 if (!th->syn) in tcp_rcv_synsent_state_process()
5579 tcp_ecn_rcv_synack(tp, th); in tcp_rcv_synsent_state_process()
5593 tp->snd_wnd = ntohs(th->window); in tcp_rcv_synsent_state_process()
5657 if (th->rst) { in tcp_rcv_synsent_state_process()
5672 if (th->syn) { in tcp_rcv_synsent_state_process()
5695 tp->snd_wnd = ntohs(th->window); in tcp_rcv_synsent_state_process()
5699 tcp_ecn_rcv_syn(tp, th); in tcp_rcv_synsent_state_process()
5749 const struct tcphdr *th = tcp_hdr(skb); in tcp_rcv_state_process() local
5761 if (th->ack) in tcp_rcv_state_process()
5764 if (th->rst) in tcp_rcv_state_process()
5767 if (th->syn) { in tcp_rcv_state_process()
5768 if (th->fin) in tcp_rcv_state_process()
5796 queued = tcp_rcv_synsent_state_process(sk, skb, th); in tcp_rcv_state_process()
5801 tcp_urg(sk, skb, th); in tcp_rcv_state_process()
5816 if (!th->ack && !th->rst && !th->syn) in tcp_rcv_state_process()
5819 if (!tcp_validate_incoming(sk, skb, th, 0)) in tcp_rcv_state_process()
5861 tp->snd_wnd = ntohs(th->window) << tp->rx_opt.snd_wscale; in tcp_rcv_state_process()
5929 after(TCP_SKB_CB(skb)->end_seq - th->fin, tp->rcv_nxt))) { in tcp_rcv_state_process()
5938 } else if (th->fin || sock_owned_by_user(sk)) { in tcp_rcv_state_process()
5970 tcp_urg(sk, skb, th); in tcp_rcv_state_process()
5987 after(TCP_SKB_CB(skb)->end_seq - th->fin, tp->rcv_nxt)) { in tcp_rcv_state_process()
6045 const struct tcphdr *th = tcp_hdr(skb); in tcp_ecn_create_request() local
6047 bool th_ecn = th->ece && th->cwr; in tcp_ecn_create_request()