Lines Matching defs:th
402 static void tcp_ecn_rcv_synack(struct tcp_sock *tp, const struct tcphdr *th)
404 if (tcp_ecn_mode_rfc3168(tp) && (!th->ece || th->cwr))
408 static void tcp_ecn_rcv_syn(struct tcp_sock *tp, const struct tcphdr *th)
410 if (tcp_ecn_mode_rfc3168(tp) && (!th->ece || !th->cwr))
414 static bool tcp_ecn_rcv_ecn_echo(const struct tcp_sock *tp, const struct tcphdr *th)
416 if (th->ece && !th->syn && tcp_ecn_mode_rfc3168(tp))
4010 static bool smc_parse_options(const struct tcphdr *th,
4017 if (th->syn && !(opsize & 1) &&
4031 u16 tcp_parse_mss_option(const struct tcphdr *th, u16 user_mss)
4033 const unsigned char *ptr = (const unsigned char *)(th + 1);
4034 int length = (th->doff * 4) - sizeof(struct tcphdr);
4081 const struct tcphdr *th = tcp_hdr(skb);
4082 int length = (th->doff * 4) - sizeof(struct tcphdr);
4084 ptr = (const unsigned char *)(th + 1);
4108 if (opsize == TCPOLEN_MSS && th->syn && !estab) {
4119 if (opsize == TCPOLEN_WINDOW && th->syn &&
4143 if (opsize == TCPOLEN_SACK_PERM && th->syn &&
4154 TCP_SKB_CB(skb)->sacked = (ptr - 2) - (unsigned char *)th;
4174 ptr, th->syn, foc, false);
4186 ptr + 2, th->syn, foc, true);
4190 if (smc_parse_options(th, opt_rx, ptr, opsize))
4206 static bool tcp_parse_aligned_timestamp(struct tcp_sock *tp, const struct tcphdr *th)
4208 const __be32 *ptr = (const __be32 *)(th + 1);
4230 const struct tcphdr *th, struct tcp_sock *tp)
4235 if (th->doff == (sizeof(*th) / 4)) {
4239 th->doff == ((sizeof(*th) + TCPOLEN_TSTAMP_ALIGNED) / 4)) {
4240 if (tcp_parse_aligned_timestamp(tp, th))
4255 int tcp_do_parse_auth_options(const struct tcphdr *th,
4258 int length = (th->doff << 2) - sizeof(*th);
4259 const u8 *ptr = (const u8 *)(th + 1);
4349 const struct tcphdr *th = tcp_hdr(skb);
4355 if (!th->ack || seq != TCP_SKB_CB(skb)->end_seq)
4369 if (tcp_may_update_window(tp, ack, seq, ntohs(th->window) <<
5759 static void tcp_check_urg(struct sock *sk, const struct tcphdr *th)
5762 u32 ptr = ntohs(th->urg_ptr);
5766 ptr += ntohl(th->seq);
5825 static void tcp_urg(struct sock *sk, struct sk_buff *skb, const struct tcphdr *th)
5830 if (unlikely(th->urg))
5831 tcp_check_urg(sk, th);
5835 u32 ptr = tp->urg_seq - ntohl(th->seq) + (th->doff * 4) -
5836 th->syn;
5871 const struct tcphdr *th, int syn_inerr)
5877 if (!tcp_fast_parse_options(sock_net(sk), skb, th, tp) ||
5886 if (th->rst)
5888 if (unlikely(th->syn))
5915 if (!th->rst) {
5916 if (th->syn)
5934 if (th->rst) {
5981 if (th->syn) {
5982 if (sk->sk_state == TCP_SYN_RECV && sk->sk_socket && th->ack &&
6037 const struct tcphdr *th = (const struct tcphdr *)skb->data;
6073 if ((tcp_flag_word(th) & TCP_HP_BITS) == tp->pred_flags &&
6081 * is automatically equal to th->doff*4 due to pred_flags
6088 if (!tcp_parse_aligned_timestamp(tp, th))
6189 if (len < (th->doff << 2) || tcp_checksum_complete(skb))
6192 if (!th->ack && !th->rst && !th->syn) {
6201 if (!tcp_validate_incoming(sk, skb, th, 1))
6213 tcp_urg(sk, skb, th);
6381 const struct tcphdr *th)
6394 if (th->ack) {
6430 if (th->rst) {
6444 if (!th->syn) {
6455 tcp_ecn_rcv_synack(tp, th);
6470 tp->snd_wnd = ntohs(th->window);
6533 if (th->rst) {
6549 if (th->syn) {
6560 WRITE_ONCE(ao->risn, th->seq);
6582 tp->snd_wnd = ntohs(th->window);
6586 tcp_ecn_rcv_syn(tp, th);
6680 const struct tcphdr *th = tcp_hdr(skb);
6691 if (th->ack)
6694 if (th->rst) {
6698 if (th->syn) {
6699 if (th->fin) {
6721 queued = tcp_rcv_synsent_state_process(sk, skb, th);
6726 tcp_urg(sk, skb, th);
6747 if (!th->ack && !th->rst && !th->syn) {
6751 if (!tcp_validate_incoming(sk, skb, th, 0))
6805 tp->snd_wnd = ntohs(th->window) << tp->rx_opt.snd_wscale;
6846 after(TCP_SKB_CB(skb)->end_seq - th->fin, tp->rcv_nxt)) {
6848 if (tp->syn_fastopen && th->fin)
6858 } else if (th->fin || sock_owned_by_user(sk)) {
6890 tcp_urg(sk, skb, th);
6914 after(TCP_SKB_CB(skb)->end_seq - th->fin, tp->rcv_nxt)) {
6971 * Exception: At least one of the reserved bits of the TCP header (th->res1) is
6981 const struct tcphdr *th = tcp_hdr(skb);
6983 bool th_ecn = th->ece && th->cwr;
6994 if (((!ect || th->res1) && ecn_ok) || tcp_ca_needs_ecn(listen_sk) ||
7103 struct sock *sk, struct tcphdr *th)
7120 mss = tcp_parse_mss_option(th, tp->rx_opt.user_mss);