casaroli opened a new pull request, #3990:
URL: https://github.com/apache/nuttx-apps/pull/3990

   ## Summary
   
   The TCP server, the UDP server and the UDP client of `netutils/iperf` pass 
an `int opt` that is never set to `setsockopt(SO_REUSEADDR)`. The option then 
gets a value from the stack, so address reuse is on or off by chance. clang 
reports it with `-Wuninitialized-const-pointer` (`iperf.c:506`, `:620`, 
`:705`), which breaks a `-Werror` build, for example sim:rpproxy on a macOS 
host.
   
   The second commit sets `opt` to 1, so that address reuse is always on. The 
first commit adds four blank lines that nxstyle asks for in the same file 
(whitespace only).
   
   ## Impact
   
   - iperf only. The sockets now always have SO_REUSEADDR set.
   - No documentation describes this option of iperf.
   
   ## Testing
   
   Builds with `EXTRAFLAGS=-Wno-cpp -Werror` on nuttx master 6d1fa235d69:
   
   | Configuration | apps master | this PR |
   |---|---|---|
   | sim:rpproxy, macOS host (clang) | FAIL: the three 
`-Wuninitialized-const-pointer` errors in `iperf.c` | `iperf.c` builds; the 
build then stops in `net/netdev/netdev_checksum.c` (apache/nuttx#21560) |
   | sim:rpproxy, macOS host, with apache/nuttx#21560 | not run | OK |
   | rv-virt:netnsh (riscv gcc) | OK (gcc does not report it) | OK |
   | qemu-armv8a:netnsh (aarch64 gcc) | not run | OK |
   
   `tools/checkpatch.sh -c -u -m -g` passes.
   
   Not run: iperf at run time.
   


-- 
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]

Reply via email to