mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-12-25 18:14:53 +00:00
IPv6 addr: clarify tentative count/LWIP_IPV6_DUP_DETECT_ATTEMPTS
This commit is contained in:
parent
7c0d952379
commit
43d6812b3e
@ -62,6 +62,9 @@
|
|||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
#if LWIP_IPV6_DUP_DETECT_ATTEMPTS > IP6_ADDR_TENTATIVE_COUNT_MASK
|
||||||
|
#error LWIP_IPV6_DUP_DETECT_ATTEMPTS > IP6_ADDR_TENTATIVE_COUNT_MASK
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Router tables. */
|
/* Router tables. */
|
||||||
struct nd6_neighbor_cache_entry neighbor_cache[LWIP_ND6_NUM_NEIGHBORS];
|
struct nd6_neighbor_cache_entry neighbor_cache[LWIP_ND6_NUM_NEIGHBORS];
|
||||||
@ -805,13 +808,13 @@ nd6_tmr(void)
|
|||||||
for (netif = netif_list; netif != NULL; netif = netif->next) {
|
for (netif = netif_list; netif != NULL; netif = netif->next) {
|
||||||
for (i = 0; i < LWIP_IPV6_NUM_ADDRESSES; ++i) {
|
for (i = 0; i < LWIP_IPV6_NUM_ADDRESSES; ++i) {
|
||||||
if (ip6_addr_istentative(netif->ip6_addr_state[i])) {
|
if (ip6_addr_istentative(netif->ip6_addr_state[i])) {
|
||||||
if ((netif->ip6_addr_state[i] & 0x07) >= LWIP_IPV6_DUP_DETECT_ATTEMPTS) {
|
if ((netif->ip6_addr_state[i] & IP6_ADDR_TENTATIVE_COUNT_MASK) >= LWIP_IPV6_DUP_DETECT_ATTEMPTS) {
|
||||||
/* No NA received in response. Mark address as valid. */
|
/* No NA received in response. Mark address as valid. */
|
||||||
netif->ip6_addr_state[i] = IP6_ADDR_PREFERRED;
|
netif->ip6_addr_state[i] = IP6_ADDR_PREFERRED;
|
||||||
/* @todo implement preferred and valid lifetimes. */
|
/* @todo implement preferred and valid lifetimes. */
|
||||||
} else if (netif->flags & NETIF_FLAG_UP) {
|
} else if (netif->flags & NETIF_FLAG_UP) {
|
||||||
#if LWIP_IPV6_MLD
|
#if LWIP_IPV6_MLD
|
||||||
if ((netif->ip6_addr_state[i] & 0x07) == 0) {
|
if ((netif->ip6_addr_state[i] & IP6_ADDR_TENTATIVE_COUNT_MASK) == 0) {
|
||||||
/* Join solicited node multicast group. */
|
/* Join solicited node multicast group. */
|
||||||
ip6_addr_set_solicitednode(&multicast_address, netif_ip6_addr(netif, i)->addr[3]);
|
ip6_addr_set_solicitednode(&multicast_address, netif_ip6_addr(netif, i)->addr[3]);
|
||||||
mld6_joingroup(netif_ip6_addr(netif, i), &multicast_address);
|
mld6_joingroup(netif_ip6_addr(netif, i), &multicast_address);
|
||||||
|
@ -263,6 +263,8 @@ Little-endian version, stored in network order (no htonl). */
|
|||||||
#define IP6_ADDR_PREFERRED 0x30
|
#define IP6_ADDR_PREFERRED 0x30
|
||||||
#define IP6_ADDR_DEPRECATED 0x50
|
#define IP6_ADDR_DEPRECATED 0x50
|
||||||
|
|
||||||
|
#define IP6_ADDR_TENTATIVE_COUNT_MASK 0x07 /* 1-7 probes sent */
|
||||||
|
|
||||||
#define ip6_addr_isinvalid(addr_state) (addr_state == IP6_ADDR_INVALID)
|
#define ip6_addr_isinvalid(addr_state) (addr_state == IP6_ADDR_INVALID)
|
||||||
#define ip6_addr_istentative(addr_state) (addr_state & IP6_ADDR_TENTATIVE)
|
#define ip6_addr_istentative(addr_state) (addr_state & IP6_ADDR_TENTATIVE)
|
||||||
#define ip6_addr_isvalid(addr_state) (addr_state & IP6_ADDR_VALID) /* Include valid, preferred, and deprecated. */
|
#define ip6_addr_isvalid(addr_state) (addr_state & IP6_ADDR_VALID) /* Include valid, preferred, and deprecated. */
|
||||||
|
@ -2214,7 +2214,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* LWIP_IPV6_DUP_DETECT_ATTEMPTS: Number of duplicate address detection attempts.
|
* LWIP_IPV6_DUP_DETECT_ATTEMPTS=[0..7]: Number of duplicate address detection attempts.
|
||||||
*/
|
*/
|
||||||
#if !defined LWIP_IPV6_DUP_DETECT_ATTEMPTS || defined __DOXYGEN__
|
#if !defined LWIP_IPV6_DUP_DETECT_ATTEMPTS || defined __DOXYGEN__
|
||||||
#define LWIP_IPV6_DUP_DETECT_ATTEMPTS 1
|
#define LWIP_IPV6_DUP_DETECT_ATTEMPTS 1
|
||||||
|
Loading…
Reference in New Issue
Block a user