Message ID | 1356541801.20133.20615.camel@edumazet-glaptop |
---|---|
State | Changes Requested, archived |
Delegated to: | David Miller |
Headers | show |
From: Eric Dumazet <eric.dumazet@gmail.com> Date: Wed, 26 Dec 2012 09:10:01 -0800 > @@ -5540,6 +5540,9 @@ no_ack: > } > > slow_path: > + if (!th->ack) > + goto discard; One too many tabs there on that last line :-) > + > if (len < (th->doff << 2) || tcp_checksum_complete_user(sk, skb)) > goto csum_error; > > @@ -5551,7 +5554,7 @@ slow_path: Also, I would say that this checksum test should come first, because that takes priority since you could be testing the ACK bit of a corrupted packet. Better to get the statistic bump on the bad checksum then a silent drop on the ACK being cleared. > @@ -5984,11 +5987,15 @@ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb, > if (tcp_check_req(sk, skb, req, NULL, true) == NULL) > goto discard; > } > + > + if (!th->ack) > + goto discard; > + And that is effectively what is going to happen in this case since the caller has already done the checksum checks. Thanks. -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index a136925..903d0ef 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c @@ -5540,6 +5540,9 @@ no_ack: } slow_path: + if (!th->ack) + goto discard; + if (len < (th->doff << 2) || tcp_checksum_complete_user(sk, skb)) goto csum_error; @@ -5551,7 +5554,7 @@ slow_path: return 0; step5: - if (th->ack && tcp_ack(sk, skb, FLAG_SLOWPATH) < 0) + if (tcp_ack(sk, skb, FLAG_SLOWPATH) < 0) goto discard; /* ts_recent update must be made after we are sure that the packet @@ -5984,11 +5987,15 @@ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb, if (tcp_check_req(sk, skb, req, NULL, true) == NULL) goto discard; } + + if (!th->ack) + goto discard; + if (!tcp_validate_incoming(sk, skb, th, 0)) return 0; /* step 5: check the ACK field */ - if (th->ack) { + if (true) { int acceptable = tcp_ack(sk, skb, FLAG_SLOWPATH) > 0; switch (sk->sk_state) { @@ -6138,8 +6145,7 @@ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb, } break; } - } else - goto discard; + } /* ts_recent update must be made after we are sure that the packet * is in window.