net: tcp: Swap tcp->context backpointers
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: Andy Ross <c70f9a6bf6ee0cd69c8af4ce5e6b131945769315@intel.com>

bboozzoo/zephyr,tidyjiang8/zephyr-doc,punitvara/zephyr,holtmann/zephyr,tidyjiang8/zephyr-doc,runchip/zephyr-cc3220,erwango/zephyr,fbsder/zephyr,nashif/zephyr,bboozzoo/zephyr,galak/zephyr,fbsder/zephyr,erwango/zephyr,galak/zephyr,fbsder/zephyr,kraj/zephyr,bboozzoo/zephyr,nashif/zephyr,mbolivar/zephyr,mbolivar/zephyr,zephyrproject-rtos/zephyr,runchip/zephyr-cc3220,aceofall/zephyr-iotos,kraj/zephyr,finikorg/zephyr,galak/zephyr,pklazy/zephyr,galak/zephyr,finikorg/zephyr,fractalclone/zephyr-riscv,mbolivar/zephyr,aceofall/zephyr-iotos,fractalclone/zephyr-riscv,nashif/zephyr,sharronliu/zephyr,holtmann/zephyr,runchip/zephyr-cc3200,explora26/zephyr,pklazy/zephyr,kraj/zephyr,rsalveti/zephyr,fbsder/zephyr,nashif/zephyr,bigdinotech/zephyr,Vudentz/zephyr,sharronliu/zephyr,runchip/zephyr-cc3200,erwango/zephyr,fractalclone/zephyr-riscv,Vudentz/zephyr,GiulianoFranchetto/zephyr,ldts/zephyr,GiulianoFranchetto/zephyr,bboozzoo/zephyr,ldts/zephyr,punitvara/zephyr,zephyriot/zephyr,rsalveti/zephyr,tidyjiang8/zephyr-doc,pklazy/zephyr,erwango/zephyr,nashif/zephyr,fractalclone/zephyr-riscv,zephyrproject-rtos/zephyr,pklazy/zephyr,fractalclone/zephyr-riscv,bigdinotech/zephyr,mbolivar/zephyr,runchip/zephyr-cc3200,ldts/zephyr,holtmann/zephyr,kraj/zephyr,runchip/zephyr-cc3220,finikorg/zephyr,ldts/zephyr,finikorg/zephyr,zephyrproject-rtos/zephyr,runchip/zephyr-cc3200,GiulianoFranchetto/zephyr,fbsder/zephyr,bigdinotech/zephyr,bboozzoo/zephyr,punitvara/zephyr,kraj/zephyr,pklazy/zephyr,explora26/zephyr,zephyriot/zephyr,zephyrproject-rtos/zephyr,bigdinotech/zephyr,zephyrproject-rtos/zephyr,galak/zephyr,runchip/zephyr-cc3200,bigdinotech/zephyr,punitvara/zephyr,erwango/zephyr,explora26/zephyr,Vudentz/zephyr,rsalveti/zephyr,sharronliu/zephyr,tidyjiang8/zephyr-doc,explora26/zephyr,Vudentz/zephyr,explora26/zephyr,rsalveti/zephyr,aceofall/zephyr-iotos,sharronliu/zephyr,finikorg/zephyr,ldts/zephyr,tidyjiang8/zephyr-doc,rsalveti/zephyr,zephyriot/zephyr,aceofall/zephyr-iotos,Vudentz/zephyr,zephyriot/zephyr,punitvara/zephyr,Vudentz/zephyr,holtmann/zephyr,GiulianoFranchetto/zephyr,zephyriot/zephyr,GiulianoFranchetto/zephyr,runchip/zephyr-cc3220,mbolivar/zephyr,runchip/zephyr-cc3220,aceofall/zephyr-iotos,sharronliu/zephyr,holtmann/zephyr