Skip to content
Commit 02174b8e authored by Andy Ross's avatar Andy Ross Committed by Anas Nashif
Browse files

net: tcp: Swap tcp->context backpointers



On accepting a new connection, the stack does an odd "swap" trick
where it updates the struct net_tcp record on the *listening* context
with the values from the new connection, and then swaps it with the
empty one that got allocated for the *new* context.

Unfortunately this swap forgot to swap the net_tcp "context" field
backpointers, so the net_context retrieved at runtime was for the
wrong connection.  Surprisingly, this actually almost worked for a
long time, except that the destination address would be wrong in the
newer setup.

Change-Id: I0c1812ddb9f9ff3e7deb60d1fd67cafd9ba96997
Signed-off-by: default avatarAndy Ross <andrew.j.ross@intel.com>
parent a5b694fb
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment