Re: TCP connection problem

Vakul Garg <vakul.garg@...>

The issue seems fixed in latest code base.


-----Original Message-----
From: Paul Sokolovsky []
Sent: Tuesday, August 08, 2017 2:08 AM
To: Vakul Garg <>
Subject: Re: [Zephyr-users] TCP connection problem

Hello Vakul,

What do you mean by "in my application running under zephyr ... TCP POSIX sockets" below? What version of Zephyr do you use?

To shorten communication loops, I'd recommend you to try the latest Zephyr master (now 1.9-pre), and if the problem persists, open a ticket at with the minimal testcase (source
code) to reproduce it.

On Fri, 4 Aug 2017 14:00:34 +0000
Vakul Garg <> wrote:


In my application running under zephyr, I open multiple TCP POSIX
sockets and connect them with a TCP server on linux host. The first
client socket connects with TCP server gracefully. The second client
socket chooses the same local port as the first one. This causes the
TCP connection for second client socket to fail.

On executing 'conn' command on zephyr shell, it reveal that the two of
the connections use same local & remote port. It seems that the
connect() call is not choosing a free port for the socket.


net> conn
Context Iface Flags Local Remote
[ 1] 0x0040c200 0x004051a0 4ST
[ 2] 0x0040c258 0x004051a0 4ST [ 3] 0x0040c2b0 0x004051a0 4DU [ 4] 0x0040c308 0x004051a0
4ST [ 5] 0x0040c360
0x004051a0 4ST [ 6]
0x0040c3b8 0x004051a0 4DU
[ 7] 0x0040c410 0x004051a0 4ST

TCP Src port Dst port Send-Seq Send-Ack MSS State
0x0040dba0 9238 52589 1234687429 1974441142 1460
ESTABLISHED 0x0040dc60 9238 52590 2778482509 379001672
1460 ESTABLISHED 0x0040dd20 16384 9239 1326661533
1311733184 1460 ESTABLISHED 0x0040dde0 9238 0
2778482508 379001612 1460 LISTEN 0x0040dea0 16384 9239
2832855501 0 1460 SYN_SENT

Best Regards,
Paul | Open source software for ARM SoCs Follow Linaro:!/linaroorg -

Join to automatically receive all group messages.