cederom commented on PR #4150:
URL: https://github.com/apache/nuttx-apps/pull/4150#issuecomment-7247601074

   LGTM. Checked against `net/inet/ipv6_setsockopt.c` on master after 
apache/nuttx#22376:
   
   - `IPV6_JOIN_GROUP` / `IPV6_LEAVE_GROUP` with `sizeof(struct ipv6_mreq) - 1` 
hit the new `value_len < sizeof(struct ipv6_mreq)` check → `-EINVAL`. The LEAVE 
case is meaningful on its own: the group isn't joined at that point, so without 
the length check it would fail with a different errno from `mld_leavegroup()`, 
not `EINVAL`.
   - `IPV6_MULTICAST_IF` with `sizeof(int) - 1` hits the length check before 
any `ifindex` validation, so `ifindex = 0` can't produce `EINVAL` (or `ENODEV`) 
by another path. `sfd` isn't bound to a device, so the 
`CONFIG_NET_BINDTODEVICE` branch doesn't interfere either.
   - Expected errno matches Linux (`EINVAL` for a short `ipv6_mreq` and for 
`IPV6_MULTICAST_IF` with `optlen != sizeof(int)`), so the test isn't asserting 
NuttX-only behaviour.
   - `memset(&mreq, 0, ...)` before filling: good (the existing 
`test_mcast_leave_ipv6` skips it).
   
   Optional nits, none blocking:
   
   1. The new description says "shorter than its structure", but 
`IPV6_MULTICAST_IF` takes an `int`. Maybe "shorter than its option type" / 
"than the option it expects".
   2. On a kernel without #22376 the short `IPV6_JOIN_GROUP` succeeds and the 
assert at L211 aborts the test before the LEAVE. Since MLD membership is per 
device, not per socket, `ff02::123` stays joined on `lo` after teardown. That 
only matters when the test is already failing, but you could do the LEAVE-style 
cleanup (or put the JOIN case last) if you care about later cases staying 
independent on old kernels.
   3. `IPV6_MULTICAST_IF` has no positive case with a full-length option 
anywhere in the suite. A `setsockopt(..., &ifindex, sizeof(ifindex))` → `0` 
right after would show the `EINVAL` comes from the length alone. Same idea as 
`test_mcast_leave_ipv6` covering full-length JOIN/LEAVE.
   
   The sim-03 CI failure is the unrelated `CONFIG_TESTING_WZIPFS` defconfig 
drift anjiahao1 described; a rebase/push should clear it.


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