IPv6: Remove comparisons to the address with all ones set. IPv6 does not support broadcast addresses and certainly not in that form. Replace with multicast addresses beginning with 0xff02.

This commit is contained in:
Gregory Nutt
2017-08-07 11:50:50 -06:00
parent 22dfa875fc
commit 2ada7d5892
17 changed files with 64 additions and 96 deletions
-65
View File
@@ -48,7 +48,6 @@
#include <nuttx/clock.h>
#include <nuttx/net/netstats.h>
#include <nuttx/net/ip.h>
#include "devif/devif.h"
@@ -76,70 +75,6 @@ uint16_t g_ipid;
uint8_t g_reassembly_timer;
#endif
#ifdef CONFIG_NET_IPv6
const net_ipv6addr_t g_ipv6_alloneaddr = /* An address of all ones */
{
0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff
};
const net_ipv6addr_t g_ipv6_allzeroaddr = /* An address of all zeroes */
{
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000
};
#if defined(CONFIG_NET_ICMPv6_AUTOCONF) || defined(CONFIG_NET_ICMPv6_ROUTER)
/* IPv6 Multi-cast IP addresses */
const net_ipv6addr_t g_ipv6_allnodes = /* All link local nodes */
{
HTONS(0xff02),
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
HTONS(0x0001)
};
const net_ipv6addr_t g_ipv6_allrouters = /* All link local routers */
{
HTONS(0xff02),
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
HTONS(0x0002)
};
#ifdef CONFIG_NET_ICMPv6_AUTOCONF
/* Link-Local Address: Link-local addresses have "1111 1110 10" for the
* first ten bits followed by 54 zeroes and then the 64 bit interface
* identifier (typically derived from the data link layer address).
*/
const net_ipv6addr_t g_ipv6_llnetmask = /* Netmask for local link address */
{
0xffff, 0xffff, 0xffff, 0xffff, 0x0000, 0x0000, 0x0000, 0x0000
};
#endif /* CONFIG_NET_ICMPv6_AUTOCONF */
#ifdef CONFIG_NET_ETHERNET
/* IPv6 Multi-cast Ethernet addresses. Formed from the 16-bit prefix:
*
* 0x33:0x33:xx:xx:xx:xx:
*
* and the last 32-bits of the IPv6 IP address
*/
const struct ether_addr g_ipv6_ethallnodes = /* All link local nodes */
{
{ 0x33, 0x33, 0x00, 0x00, 0x00, 0x01 }
};
const struct ether_addr g_ipv6_ethallrouters = /* All link local routers */
{
{ 0x33, 0x33, 0x00, 0x00, 0x00, 0x02 }
};
#endif /* CONFIG_NET_ETHERNET */
#endif /* CONFIG_NET_ICMPv6_AUTOCONF || CONFIG_NET_ICMPv6_ROUTER */
#endif /* CONFIG_NET_IPv4 */
/****************************************************************************
* Public Functions
****************************************************************************/