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

   ## Summary
   
   More network configurations that do not build on master (a follow-up of 
#22377):
   
   - `CONFIG_NET_IPFORWARD` with IPv4 and IPv6 and without `CONFIG_NET_UDP`: 
`forward_ipselect()` uses `IPv4UDP_HDRLEN` / `IPv6UDP_HDRLEN`, but 
`netfwd_forward.c` got `<nuttx/net/udp.h>` only through 
`<nuttx/net/netstats.h>`, which includes it under `CONFIG_NET_UDP`. Commit 1 
includes the header.
   - The ICMPv6 stack together with a usrsock ICMP socket 
(`NET_ICMP_NO_STACK`): `net/utils` built `net_icmpchksum.c` for the ICMPv6 
stack only in the `else` branch of `CONFIG_NET_ICMP`, so `icmpv6_chksum()` was 
missing at link time. Commit 2 builds it when either stack is built (Make.defs 
and CMakeLists.txt).
   - An ICMP or ICMPv6 stack without TCP, UDP or a link layer (usrsock only, 
for example sim:rpproxy with the ICMP stack): the stacks use IOBs, but nothing 
selected `MM_IOB`. Commit 3: the stacks (not `NET_ICMP(v6)_NO_STACK`) select 
`MM_IOB`. Eight usrsock defconfigs set `CONFIG_MM_IOB=y` by hand; 
`tools/refresh.sh` removes that line now.
   - The ICMPv6 stack without a link layer that has an address (sim:rpproxy + 
`CONFIG_NET_IPv6` + `CONFIG_NET_ICMPv6`): five ICMPv6 files use `dev->d_mac`, 
which exists only with Ethernet, 6LoWPAN, Bluetooth, IEEE 802.15.4 or TUN. 
Commit 4 gives that condition a name, `NETDEV_HAVE_LLADDR` in 
`<nuttx/net/netdev.h>`, and uses the address only when it exists 
(`netdev_lladdrsize()` gives 0 for the other link layers). `neighbor_lookup.c`, 
which got the same condition written out in #22377, uses the name too.
   
   ## Impact
   
   Build fixes. Configurations with an ICMP stack now always have `MM_IOB` (all 
such configurations that built had it already). The 8 defconfigs 
(spresense:wifi, spresense:wifi_smp, sabre-6quad:citest, nrf9160-dk:modem_ns, 
stm32f4discovery:wifi, rv-virt:citest64, sim:citest, sim:usrsocktest) give the 
same `.config`. No API, ABI or code change for the configurations that built 
before. The same in all build modes and on all architectures.
   
   ## Testing
   
   Builds with `-Werror` in the CI image (gcc 12.3):
   
   | Config | master | this PR |
   |---|---|---|
   | qemu-armv8a:netnsh + NET_IPv6 + NET_IPFORWARD, NET_UDP off | FAIL: 
`netfwd_forward.c:86: 'IPv4UDP_HDRLEN' undeclared` | OK |
   | sim:rpproxy + NET_IPv6 + NET_ICMPv6 (+ NEIGHBOR, AUTOCONF, ROUTER, SOCKET) 
| FAIL: `icmpv6_advertise.c:106: 'struct net_driver_s' has no member named 
'd_mac'` (8 such); with commits 3 and 4 only, the link fails: `undefined 
reference to 'icmpv6_chksum'` | OK |
   | sim:rpproxy + NET_IPv6 + NET_ICMPv6 | FAIL: 22 errors, `d_mac` and 
`icmpv6_reply.c:113: invalid use of undefined type 'struct iob_s'` | OK |
   | sim:rpproxy with the ICMP stack (NET_USRSOCK_ICMP and NET_ICMP_NO_STACK 
off) | FAIL: `icmp_input.c:330: implicit declaration of function 
'icmp_chksum_iob'`, `icmp_reply.c:124: invalid use of undefined type 'struct 
iob_s'` | OK |
   
   The sim:rpproxy rows also need apache/nuttx-apps#4151 (netinit, merged); 
they were built with it. `tools/refresh.sh --silent` of the 8 defconfigs: no 
change on master, the `CONFIG_MM_IOB=y` line removed with commit 3, no change 
after.
   
   Also OK: qemu-armv8a:netnsh with and without IPFORWARD, rv-virt:netnsh, 
rv-virt:knetnsh64 (kernel), qemu-armv8a:knsh (kernel) with IPv4, IPv6, ICMPv6, 
IPFORWARD, sim:rpproxy, sim:usrsocktest, rv-virt:citest64, qemu-armv8a:nsh, 
rv-virt:nsh64. With #22375 also rv-virt:netnsh + IPv6 + IPFORWARD + usrsock 
ICMPv6 without UDP (that one needs #22375 for `ipv6_forward.c`).
   


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

  • [PR] net: Fix the build of fo... casaroli (via GitHub) via commits

Reply via email to