Lines Matching refs:th
259 static void tcp_ecn_rcv_synack(struct tcp_sock *tp, const struct tcphdr *th) in tcp_ecn_rcv_synack() argument
261 if ((tp->ecn_flags & TCP_ECN_OK) && (!th->ece || th->cwr)) in tcp_ecn_rcv_synack()
265 static void tcp_ecn_rcv_syn(struct tcp_sock *tp, const struct tcphdr *th) in tcp_ecn_rcv_syn() argument
267 if ((tp->ecn_flags & TCP_ECN_OK) && (!th->ece || !th->cwr)) in tcp_ecn_rcv_syn()
271 static bool tcp_ecn_rcv_ecn_echo(const struct tcp_sock *tp, const struct tcphdr *th) in tcp_ecn_rcv_ecn_echo() argument
273 if (th->ece && !th->syn && (tp->ecn_flags & TCP_ECN_OK)) in tcp_ecn_rcv_ecn_echo()
3653 const struct tcphdr *th = tcp_hdr(skb); in tcp_parse_options() local
3654 int length = (th->doff * 4) - sizeof(struct tcphdr); in tcp_parse_options()
3656 ptr = (const unsigned char *)(th + 1); in tcp_parse_options()
3677 if (opsize == TCPOLEN_MSS && th->syn && !estab) { in tcp_parse_options()
3688 if (opsize == TCPOLEN_WINDOW && th->syn && in tcp_parse_options()
3711 if (opsize == TCPOLEN_SACK_PERM && th->syn && in tcp_parse_options()
3722 TCP_SKB_CB(skb)->sacked = (ptr - 2) - (unsigned char *)th; in tcp_parse_options()
3736 ptr, th->syn, foc, false); in tcp_parse_options()
3748 ptr + 2, th->syn, foc, true); in tcp_parse_options()
3759 static bool tcp_parse_aligned_timestamp(struct tcp_sock *tp, const struct tcphdr *th) in tcp_parse_aligned_timestamp() argument
3761 const __be32 *ptr = (const __be32 *)(th + 1); in tcp_parse_aligned_timestamp()
3782 const struct tcphdr *th, struct tcp_sock *tp) in tcp_fast_parse_options() argument
3787 if (th->doff == (sizeof(*th) / 4)) { in tcp_fast_parse_options()
3791 th->doff == ((sizeof(*th) + TCPOLEN_TSTAMP_ALIGNED) / 4)) { in tcp_fast_parse_options()
3792 if (tcp_parse_aligned_timestamp(tp, th)) in tcp_fast_parse_options()
3807 const u8 *tcp_parse_md5sig_option(const struct tcphdr *th) in tcp_parse_md5sig_option() argument
3809 int length = (th->doff << 2) - sizeof(*th); in tcp_parse_md5sig_option()
3810 const u8 *ptr = (const u8 *)(th + 1); in tcp_parse_md5sig_option()
3867 const struct tcphdr *th = tcp_hdr(skb); in tcp_disordered_ack() local
3872 (th->ack && seq == TCP_SKB_CB(skb)->end_seq && seq == tp->rcv_nxt) && in tcp_disordered_ack()
3878 !tcp_may_update_window(tp, ack, seq, ntohs(th->window) << tp->rx_opt.snd_wscale) && in tcp_disordered_ack()
4945 static void tcp_check_urg(struct sock *sk, const struct tcphdr *th) in tcp_check_urg() argument
4948 u32 ptr = ntohs(th->urg_ptr); in tcp_check_urg()
4952 ptr += ntohl(th->seq); in tcp_check_urg()
5011 static void tcp_urg(struct sock *sk, struct sk_buff *skb, const struct tcphdr *th) in tcp_urg() argument
5016 if (th->urg) in tcp_urg()
5017 tcp_check_urg(sk, th); in tcp_urg()
5021 u32 ptr = tp->urg_seq - ntohl(th->seq) + (th->doff * 4) - in tcp_urg()
5022 th->syn; in tcp_urg()
5084 const struct tcphdr *th, int syn_inerr) in tcp_validate_incoming() argument
5089 if (tcp_fast_parse_options(skb, th, tp) && tp->rx_opt.saw_tstamp && in tcp_validate_incoming()
5091 if (!th->rst) { in tcp_validate_incoming()
5110 if (!th->rst) { in tcp_validate_incoming()
5111 if (th->syn) in tcp_validate_incoming()
5122 if (th->rst) { in tcp_validate_incoming()
5141 if (th->syn) { in tcp_validate_incoming()
5181 const struct tcphdr *th, unsigned int len) in tcp_rcv_established() argument
5213 if ((tcp_flag_word(th) & TCP_HP_BITS) == tp->pred_flags && in tcp_rcv_established()
5226 if (!tcp_parse_aligned_timestamp(tp, th)) in tcp_rcv_established()
5337 if (len < (th->doff << 2) || tcp_checksum_complete_user(sk, skb)) in tcp_rcv_established()
5340 if (!th->ack && !th->rst && !th->syn) in tcp_rcv_established()
5347 if (!tcp_validate_incoming(sk, skb, th, 1)) in tcp_rcv_established()
5357 tcp_urg(sk, skb, th); in tcp_rcv_established()
5470 const struct tcphdr *th, unsigned int len) in tcp_rcv_synsent_state_process() argument
5481 if (th->ack) { in tcp_rcv_synsent_state_process()
5509 if (th->rst) { in tcp_rcv_synsent_state_process()
5521 if (!th->syn) in tcp_rcv_synsent_state_process()
5531 tcp_ecn_rcv_synack(tp, th); in tcp_rcv_synsent_state_process()
5545 tp->snd_wnd = ntohs(th->window); in tcp_rcv_synsent_state_process()
5609 if (th->rst) { in tcp_rcv_synsent_state_process()
5624 if (th->syn) { in tcp_rcv_synsent_state_process()
5647 tp->snd_wnd = ntohs(th->window); in tcp_rcv_synsent_state_process()
5651 tcp_ecn_rcv_syn(tp, th); in tcp_rcv_synsent_state_process()
5698 const struct tcphdr *th, unsigned int len) in tcp_rcv_state_process() argument
5714 if (th->ack) in tcp_rcv_state_process()
5717 if (th->rst) in tcp_rcv_state_process()
5720 if (th->syn) { in tcp_rcv_state_process()
5721 if (th->fin) in tcp_rcv_state_process()
5749 queued = tcp_rcv_synsent_state_process(sk, skb, th, len); in tcp_rcv_state_process()
5754 tcp_urg(sk, skb, th); in tcp_rcv_state_process()
5769 if (!th->ack && !th->rst && !th->syn) in tcp_rcv_state_process()
5772 if (!tcp_validate_incoming(sk, skb, th, 0)) in tcp_rcv_state_process()
5813 tp->snd_wnd = ntohs(th->window) << tp->rx_opt.snd_wscale; in tcp_rcv_state_process()
5882 after(TCP_SKB_CB(skb)->end_seq - th->fin, tp->rcv_nxt))) { in tcp_rcv_state_process()
5891 } else if (th->fin || sock_owned_by_user(sk)) { in tcp_rcv_state_process()
5923 tcp_urg(sk, skb, th); in tcp_rcv_state_process()
5940 after(TCP_SKB_CB(skb)->end_seq - th->fin, tp->rcv_nxt)) { in tcp_rcv_state_process()
5998 const struct tcphdr *th = tcp_hdr(skb); in tcp_ecn_create_request() local
6000 bool th_ecn = th->ece && th->cwr; in tcp_ecn_create_request()