net: tcp2: Don't instantiate an extra connection on SYN+ACK

On incoming SYN+ACK, use the existing TCP connection.

This problem was overlooked earlier and was found while
testing TCP2 client side.

Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
This commit is contained in:
Oleg Zhurakivskyy 2020-03-06 15:41:52 +02:00 committed by Jukka Rissanen
commit 4c81935c2e

View file

@ -917,7 +917,7 @@ static enum net_verdict tcp_recv(struct net_conn *net_conn,
th = th_get(pkt);
if (th->th_flags & SYN) {
if (th->th_flags & SYN && !(th->th_flags & ACK)) {
struct tcp *conn_old = ((struct net_context *)user_data)->tcp;
conn = tcp_conn_new(pkt);