to save the preserved space(1KB) and also avoid the heap overhead
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I694073f68e1bd63960cedeea1ddec441437be025
* Simplify EINTR/ECANCEL error handling
1. Add semaphore uninterruptible wait function
2 .Replace semaphore wait loop with a single uninterruptible wait
3. Replace all sem_xxx to nxsem_xxx
* Unify the void cast usage
1. Remove void cast for function because many place ignore the returned value witout cast
2. Replace void cast for variable with UNUSED macro
The MLD implementation did not follow the RFC correctly when it is the Querier. The Querier should use a general query and get query messages from all members of all groups. This would be driven by a single timer per sub-nset since all groups are queried at once. Instead, the design used a Multicast Address Specific Query with one timer per group and ignores groups that we are not members of.
Similary, the MLDv1 compatibility timer should be a single, separate timer, not a per-group timer.
net/mld: Group may be NULL when sending a general query
net/icmpv6/icmpv6_input.c: Correct caculation of the ICMPv6 header address
net/mld/mld_query.c: Correct back test for group found.
net/mld/mld_report.c: Fix host vs. network order problem.
net/mld/mld_send.c: Correct the address used in sending the General Query. It should be the unspecified address in that case.
net/mld: Querying workaround. The MLD implementation does not follow the RFC correct when it is the Querier. The Querier should use a general query and get query messages from all members of all groups. This would be driven by a single timer since all groups are queried at once. Instead, the design currently uses a Multicast Address Specific Query with one timer per group and ignores groups that we are not members of.
net/mld: Fix a couple of places where I forgot to unlock the network in the previous commit.
net/mld: Implement 'Other Querier Present Timer'. This timer is used to revert to Querier mode if there is no other querier on the network. Also, fix some naming: The Done message is not just Version 1 but is used with Version 2 as well.
net/igmp: Back out some blind, backported improvements to IGMP from MLD. There are too many subtle differences in the protocols for this to be safe.
net/mld: Checksum calculation needs to know the full size of the IPv6 header, including the size of the extension headers. The payload size in the IPv64 header must include the extension headers (not considered part of the header in this case). Fixes a few additional errors in size, endian-ness and checksum calculations. Wireshark now reports the the outgoing Report has a good checksum.
net/mld/mld_query.c: Add a cast to assure that the left shift does not overflow.
net/mld: More updates from comparison with roughly leveraged code and the MDL RFCs 2710 and 3810.
net/mld: More updated from comparison with roughly leveraged code and the MDL RFCs 2710 and 3810.
net/mld: Beginning comparison with roughly leveraged code and the MDL RFCs 2710 and 3810.
include/nuttx/net/ipv6ext.h: Fix some terminology: Hop-by-hop, not Hop-to-hop or Hop2hop.
net/devif/ipv6_input.c and net/icmpv6/icmpv6_input.c: Add logic to skiip over the variable number of IPv6 extension headers that may be present between the IPv6 header and the transport layer header. The extension headers are simply ignored. This is necessary because with MLD, certain incoming messages may have, at a mimimum, a Router Alert Hop-by-hop extension header.
net/inet/ipv6_setsockopt.c: Implement the IPV6_JOIN_GROUP and IPV6_LEAVE_GROUP socket options.