Skip to content

Commit

Permalink
net: tcp: Do not overwrite remote address in new conn
Browse files Browse the repository at this point in the history
When a new incoming connection is accepted, do not overwrite
the listening remote address. The remote address for the
listening socket is the any address (like :: for IPv6)
and not the accepted socket remote address.
This only affects the "net conn" shell command which prints
the remote address incorrectly. There is no problem accepting
new connections in this case.

Signed-off-by: Jukka Rissanen <[email protected]>
  • Loading branch information
jukkar authored and MaureenHelm committed Oct 23, 2023
1 parent bc41d03 commit 2238baa
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions subsys/net/ip/tcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1852,8 +1852,6 @@ static enum net_verdict tcp_recv(struct net_conn *net_conn,
goto in;
}

net_ipaddr_copy(&conn_old->context->remote, &conn->dst.sa);

conn->accepted_conn = conn_old;
}
in:
Expand Down

0 comments on commit 2238baa

Please sign in to comment.