--- zzzz-none-000/linux-2.6.28.10/net/ipv4/tcp_input.c 2009-05-02 18:54:43.000000000 +0000 +++ fusiv-7390-686/linux-2.6.28.10/net/ipv4/tcp_input.c 2019-07-09 13:47:39.000000000 +0000 @@ -73,7 +73,7 @@ int sysctl_tcp_timestamps __read_mostly = 1; int sysctl_tcp_window_scaling __read_mostly = 1; -int sysctl_tcp_sack __read_mostly = 1; +int sysctl_tcp_sack __read_mostly = 0; int sysctl_tcp_fack __read_mostly = 1; int sysctl_tcp_reordering __read_mostly = TCP_FASTRETRANS_THRESH; int sysctl_tcp_ecn __read_mostly; @@ -138,6 +138,7 @@ * * "len" is invariant segment length, including TCP header. */ + struct tcphdr *ptcph = tcp_hdr(skb); len += skb->data - skb_transport_header(skb); if (len >= TCP_MIN_RCVMSS + sizeof(struct tcphdr) || /* If PSH is not set, packet should be @@ -146,7 +147,7 @@ * to handle super-low mtu links fairly. */ (len >= TCP_MIN_MSS + sizeof(struct tcphdr) && - !(tcp_flag_word(tcp_hdr(skb)) & TCP_REMNANT))) { + !(tcp_flag_word(ptcph) & TCP_REMNANT))) { /* Subtract also invariant (if peer is RFC compliant), * tcp header plus fixed timestamp option length. * Resulting "len" is MSS free of SACK jitter. @@ -237,7 +238,7 @@ static inline int TCP_ECN_rcv_ecn_echo(struct tcp_sock *tp, struct tcphdr *th) { - if (th->ece && !th->syn && (tp->ecn_flags & TCP_ECN_OK)) + if (TCP_ECE(th) && !TCP_SYN(th) && (tp->ecn_flags & TCP_ECN_OK)) return 1; return 0; } @@ -3067,7 +3068,7 @@ int flag = 0; u32 nwin = ntohs(tcp_hdr(skb)->window); - if (likely(!tcp_hdr(skb)->syn)) + if (likely(!TCP_SYN(tcp_hdr(skb)))) nwin <<= tp->rx_opt.snd_wscale; if (tcp_may_update_window(tp, ack, ack_seq, nwin)) { @@ -3459,13 +3460,13 @@ { __be32 *ptr = (__be32 *)(th + 1); - if (*ptr == htonl((TCPOPT_NOP << 24) | (TCPOPT_NOP << 16) + if (RD16(*ptr) == htonl((TCPOPT_NOP << 24) | (TCPOPT_NOP << 16) | (TCPOPT_TIMESTAMP << 8) | TCPOLEN_TIMESTAMP)) { tp->rx_opt.saw_tstamp = 1; ++ptr; - tp->rx_opt.rcv_tsval = ntohl(*ptr); + tp->rx_opt.rcv_tsval = ntohl(RD16(*ptr)); ++ptr; - tp->rx_opt.rcv_tsecr = ntohl(*ptr); + tp->rx_opt.rcv_tsecr = ntohl(RD16(*ptr)); return 1; } return 0; @@ -3477,11 +3478,11 @@ static int tcp_fast_parse_options(struct sk_buff *skb, struct tcphdr *th, struct tcp_sock *tp) { - if (th->doff == sizeof(struct tcphdr) >> 2) { + if (TCP_DOFF(th) == sizeof(struct tcphdr) >> 2) { tp->rx_opt.saw_tstamp = 0; return 0; } else if (tp->rx_opt.tstamp_ok && - th->doff == (sizeof(struct tcphdr)>>2)+(TCPOLEN_TSTAMP_ALIGNED>>2)) { + TCP_DOFF(th) == (sizeof(struct tcphdr)>>2)+(TCPOLEN_TSTAMP_ALIGNED>>2)) { if (tcp_parse_aligned_timestamp(tp, th)) return 1; } @@ -3985,7 +3986,7 @@ if (TCP_SKB_CB(skb)->seq == TCP_SKB_CB(skb)->end_seq) goto drop; - __skb_pull(skb, th->doff * 4); + __skb_pull(skb, TCP_DOFF(th) * 4); TCP_ECN_accept_cwr(tp, skb); @@ -4015,7 +4016,7 @@ if (!skb_copy_datagram_iovec(skb, 0, tp->ucopy.iov, chunk)) { tp->ucopy.len -= chunk; tp->copied_seq += chunk; - eaten = (chunk == skb->len && !th->fin); + eaten = (chunk == skb->len && !TCP_FIN(th)); tcp_rcv_space_adjust(sk); } local_bh_disable(); @@ -4033,7 +4034,7 @@ tp->rcv_nxt = TCP_SKB_CB(skb)->end_seq; if (skb->len) tcp_event_data_recv(sk, skb); - if (th->fin) + if (TCP_FIN(th)) tcp_fin(skb, sk, th); if (!skb_queue_empty(&tp->out_of_order_queue)) { @@ -4604,7 +4605,7 @@ struct tcp_sock *tp = tcp_sk(sk); /* Check if we get a new urgent pointer - normally not. */ - if (th->urg) + if (TCP_URG(th)) tcp_check_urg(sk, th); /* Do we wait for any urgent data? - normally not... */ @@ -4743,13 +4744,13 @@ * an acknowledgment should be sent in reply (unless the RST * bit is set, if so drop the segment and return)". */ - if (!th->rst) + if (!TCP_RST(th)) tcp_send_dupack(sk, skb); goto discard; } /* Step 2: check RST bit */ - if (th->rst) { + if (TCP_RST(th)) { tcp_reset(sk); goto discard; } @@ -4762,7 +4763,7 @@ /* step 3: check security and precedence [ignored] */ /* step 4: Check for a SYN in window. */ - if (th->syn && !before(TCP_SKB_CB(skb)->seq, tp->rcv_nxt)) { + if (TCP_SYN(th) && !before(TCP_SKB_CB(skb)->seq, tp->rcv_nxt)) { if (syn_inerr) TCP_INC_STATS_BH(sock_net(sk), TCP_MIB_INERRS); NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_TCPABORTONSYN);