a-lunev opened a new pull request #5239: URL: https://github.com/apache/incubator-nuttx/pull/5239
## Summary tcp_sendfile() reads data directly from a file and does not use NET_TCP_WRITE_BUFFERS data flow even if CONFIG_NET_TCP_WRITE_BUFFERS option is enabled. Despite this, tcp_sendfile relied on NET_TCP_WRITE_BUFFERS specific flow control variables that were idle during sendfile operation. Thus it was a total inconsistency. E.g. because of the issue, TCP socket used by sendfile() operation never issued FIN packet on close() command, and the TCP connection hung up. This PR fixes the inconsistency issues. Now simultaneously enabled CONFIG_NET_TCP_WRITE_BUFFERS and CONFIG_NET_SENDFILE options can coexist. ## Impact TCP ## Testing Build NuttX: ``` $ ./tools/configure.sh -l sim:tcpblaster $ make menuconfig (enable CONFIG_NETUTILS_NETCAT_SENDFILE, enable CONFIG_NET_TCP_WRITE_BUFFERS) $ make ``` Enable TUN/TAP on Linux host: ``` $ sudo setcap cap_net_admin+ep ./nuttx $ sudo ./tools/simhostroute.sh wlan0 on ``` Run netcat server on Linux host: `$ netcat -l -p 31337` Run NuttX on Linux host: ``` $ ./nuttx NuttShell (NSH) NuttX-10.2.0 nsh> ifconfig eth0 10.0.1.2 nsh> ifup eth0 ifup eth0...OK ``` Start Wireshark (or tcpdump) and capture appeared tap0 interface. Run in NuttX: ``` nsh> dd if=/dev/zero of=/tmp/test.bin count=1000 nsh> netcat LINUX_HOST_IP_ADDRESS 31337 /tmp/test.bin ``` Observe TCP dump. Shutdown NuttX: `nsh> poweroff` Disable TUN/TAP on Linux host: `$ sudo ./tools/simhostroute.sh wlan0 off` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
