net/ipv6: Renaming IPv6 neighbor state related macros and function
Refining the names around IPv6's neighbor states to differentiate them easily from any net_nbr related names (which are not tighten to IPv6). Change-Id: Ibc24df2a9485477a53fe5fe1c8f993f0fcd91635 Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
This commit is contained in:
parent
4991499cab
commit
1e3dc0cbb4
6 changed files with 63 additions and 56 deletions
|
@ -58,33 +58,34 @@ NET_NBR_TABLE_INIT(NET_NBR_GLOBAL,
|
||||||
net_neighbor_pool,
|
net_neighbor_pool,
|
||||||
net_neighbor_table_clear);
|
net_neighbor_table_clear);
|
||||||
|
|
||||||
const char *net_nbr_state2str(enum net_nbr_state state)
|
const char *net_ipv6_nbr_state2str(enum net_ipv6_nbr_state state)
|
||||||
{
|
{
|
||||||
switch (state) {
|
switch (state) {
|
||||||
case NET_NBR_INCOMPLETE:
|
case NET_IPV6_NBR_STATE_INCOMPLETE:
|
||||||
return "incomplete";
|
return "incomplete";
|
||||||
case NET_NBR_REACHABLE:
|
case NET_IPV6_NBR_STATE_REACHABLE:
|
||||||
return "reachable";
|
return "reachable";
|
||||||
case NET_NBR_STALE:
|
case NET_IPV6_NBR_STATE_STALE:
|
||||||
return "stale";
|
return "stale";
|
||||||
case NET_NBR_DELAY:
|
case NET_IPV6_NBR_STATE_DELAY:
|
||||||
return "delay";
|
return "delay";
|
||||||
case NET_NBR_PROBE:
|
case NET_IPV6_NBR_STATE_PROBE:
|
||||||
return "probe";
|
return "probe";
|
||||||
}
|
}
|
||||||
|
|
||||||
return "<invalid state>";
|
return "<invalid state>";
|
||||||
}
|
}
|
||||||
|
|
||||||
static void nbr_set_state(struct net_nbr *nbr, enum net_nbr_state new_state)
|
static void ipv6_nbr_set_state(struct net_nbr *nbr,
|
||||||
|
enum net_ipv6_nbr_state new_state)
|
||||||
{
|
{
|
||||||
if (new_state == net_ipv6_nbr_data(nbr)->state) {
|
if (new_state == net_ipv6_nbr_data(nbr)->state) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
NET_DBG("nbr %p %s -> %s", nbr,
|
NET_DBG("nbr %p %s -> %s", nbr,
|
||||||
net_nbr_state2str(net_ipv6_nbr_data(nbr)->state),
|
net_ipv6_nbr_state2str(net_ipv6_nbr_data(nbr)->state),
|
||||||
net_nbr_state2str(new_state));
|
net_ipv6_nbr_state2str(new_state));
|
||||||
|
|
||||||
net_ipv6_nbr_data(nbr)->state = new_state;
|
net_ipv6_nbr_data(nbr)->state = new_state;
|
||||||
}
|
}
|
||||||
|
@ -245,7 +246,7 @@ struct net_nbr *net_ipv6_nbr_add(struct net_if *iface,
|
||||||
struct in6_addr *addr,
|
struct in6_addr *addr,
|
||||||
struct net_linkaddr *lladdr,
|
struct net_linkaddr *lladdr,
|
||||||
bool is_router,
|
bool is_router,
|
||||||
enum net_nbr_state state)
|
enum net_ipv6_nbr_state state)
|
||||||
{
|
{
|
||||||
struct net_nbr *nbr = net_nbr_get(&net_neighbor.table);
|
struct net_nbr *nbr = net_nbr_get(&net_neighbor.table);
|
||||||
|
|
||||||
|
@ -259,7 +260,7 @@ struct net_nbr *net_ipv6_nbr_add(struct net_if *iface,
|
||||||
}
|
}
|
||||||
|
|
||||||
net_ipaddr_copy(&net_ipv6_nbr_data(nbr)->addr, addr);
|
net_ipaddr_copy(&net_ipv6_nbr_data(nbr)->addr, addr);
|
||||||
nbr_set_state(nbr, state);
|
ipv6_nbr_set_state(nbr, state);
|
||||||
net_ipv6_nbr_data(nbr)->is_router = is_router;
|
net_ipv6_nbr_data(nbr)->is_router = is_router;
|
||||||
|
|
||||||
NET_DBG("[%d] nbr %p state %d router %d IPv6 %s ll %s",
|
NET_DBG("[%d] nbr %p state %d router %d IPv6 %s ll %s",
|
||||||
|
@ -274,7 +275,7 @@ static inline struct net_nbr *nbr_add(struct net_buf *buf,
|
||||||
struct in6_addr *addr,
|
struct in6_addr *addr,
|
||||||
struct net_linkaddr *lladdr,
|
struct net_linkaddr *lladdr,
|
||||||
bool is_router,
|
bool is_router,
|
||||||
enum net_nbr_state state)
|
enum net_ipv6_nbr_state state)
|
||||||
{
|
{
|
||||||
return net_ipv6_nbr_add(net_nbuf_iface(buf), addr, lladdr,
|
return net_ipv6_nbr_add(net_nbuf_iface(buf), addr, lladdr,
|
||||||
is_router, state);
|
is_router, state);
|
||||||
|
@ -319,7 +320,7 @@ static void ns_reply_timeout(struct k_work *work)
|
||||||
|
|
||||||
static struct net_nbr *nbr_new(struct net_if *iface,
|
static struct net_nbr *nbr_new(struct net_if *iface,
|
||||||
struct in6_addr *addr,
|
struct in6_addr *addr,
|
||||||
enum net_nbr_state state)
|
enum net_ipv6_nbr_state state)
|
||||||
{
|
{
|
||||||
struct net_nbr *nbr = net_nbr_get(&net_neighbor.table);
|
struct net_nbr *nbr = net_nbr_get(&net_neighbor.table);
|
||||||
|
|
||||||
|
@ -331,7 +332,7 @@ static struct net_nbr *nbr_new(struct net_if *iface,
|
||||||
nbr->iface = iface;
|
nbr->iface = iface;
|
||||||
|
|
||||||
net_ipaddr_copy(&net_ipv6_nbr_data(nbr)->addr, addr);
|
net_ipaddr_copy(&net_ipv6_nbr_data(nbr)->addr, addr);
|
||||||
nbr_set_state(nbr, state);
|
ipv6_nbr_set_state(nbr, state);
|
||||||
net_ipv6_nbr_data(nbr)->pending = NULL;
|
net_ipv6_nbr_data(nbr)->pending = NULL;
|
||||||
|
|
||||||
#if defined(CONFIG_NET_IPV6_ND)
|
#if defined(CONFIG_NET_IPV6_ND)
|
||||||
|
@ -779,7 +780,7 @@ try_send:
|
||||||
nbr ? nbr->idx : NET_NBR_LLADDR_UNKNOWN,
|
nbr ? nbr->idx : NET_NBR_LLADDR_UNKNOWN,
|
||||||
net_nbuf_iface(buf),
|
net_nbuf_iface(buf),
|
||||||
net_sprint_ipv6_addr(nexthop),
|
net_sprint_ipv6_addr(nexthop),
|
||||||
net_nbr_state2str(net_ipv6_nbr_data(nbr)->state));
|
net_ipv6_nbr_state2str(net_ipv6_nbr_data(nbr)->state));
|
||||||
|
|
||||||
if (nbr && nbr->idx != NET_NBR_LLADDR_UNKNOWN) {
|
if (nbr && nbr->idx != NET_NBR_LLADDR_UNKNOWN) {
|
||||||
struct net_linkaddr_storage *lladdr;
|
struct net_linkaddr_storage *lladdr;
|
||||||
|
@ -796,8 +797,8 @@ try_send:
|
||||||
* See RFC 4861 ch 7.3.3 for details.
|
* See RFC 4861 ch 7.3.3 for details.
|
||||||
*/
|
*/
|
||||||
#if defined(CONFIG_NET_IPV6_ND)
|
#if defined(CONFIG_NET_IPV6_ND)
|
||||||
if (net_ipv6_nbr_data(nbr)->state == NET_NBR_STALE) {
|
if (net_ipv6_nbr_data(nbr)->state == NET_IPV6_NBR_STATE_STALE) {
|
||||||
nbr_set_state(nbr, NET_NBR_DELAY);
|
ipv6_nbr_set_state(nbr, NET_IPV6_NBR_STATE_DELAY);
|
||||||
|
|
||||||
k_delayed_work_submit(
|
k_delayed_work_submit(
|
||||||
&net_ipv6_nbr_data(nbr)->reachable,
|
&net_ipv6_nbr_data(nbr)->reachable,
|
||||||
|
@ -936,7 +937,8 @@ static inline void handle_ns_neighbor(struct net_buf *buf,
|
||||||
nbr_print();
|
nbr_print();
|
||||||
|
|
||||||
nbr = nbr_new(net_nbuf_iface(buf),
|
nbr = nbr_new(net_nbuf_iface(buf),
|
||||||
&NET_IPV6_BUF(buf)->src, NET_NBR_INCOMPLETE);
|
&NET_IPV6_BUF(buf)->src,
|
||||||
|
NET_IPV6_NBR_STATE_INCOMPLETE);
|
||||||
if (nbr) {
|
if (nbr) {
|
||||||
NET_DBG("Added %s to nbr cache",
|
NET_DBG("Added %s to nbr cache",
|
||||||
net_sprint_ipv6_addr(&NET_IPV6_BUF(buf)->src));
|
net_sprint_ipv6_addr(&NET_IPV6_BUF(buf)->src));
|
||||||
|
@ -969,11 +971,12 @@ static inline void handle_ns_neighbor(struct net_buf *buf,
|
||||||
net_linkaddr_set(cached_lladdr, lladdr.addr,
|
net_linkaddr_set(cached_lladdr, lladdr.addr,
|
||||||
lladdr.len);
|
lladdr.len);
|
||||||
|
|
||||||
nbr_set_state(nbr, NET_NBR_STALE);
|
ipv6_nbr_set_state(nbr, NET_IPV6_NBR_STATE_STALE);
|
||||||
} else {
|
} else {
|
||||||
if (net_ipv6_nbr_data(nbr)->state ==
|
if (net_ipv6_nbr_data(nbr)->state ==
|
||||||
NET_NBR_INCOMPLETE) {
|
NET_IPV6_NBR_STATE_INCOMPLETE) {
|
||||||
nbr_set_state(nbr, NET_NBR_STALE);
|
ipv6_nbr_set_state(nbr,
|
||||||
|
NET_IPV6_NBR_STATE_STALE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1240,7 +1243,7 @@ static void nd_reachable_timeout(struct k_work *work)
|
||||||
|
|
||||||
switch (data->state) {
|
switch (data->state) {
|
||||||
|
|
||||||
case NET_NBR_INCOMPLETE:
|
case NET_IPV6_NBR_STATE_INCOMPLETE:
|
||||||
if (data->ns_count >= MAX_MULTICAST_SOLICIT) {
|
if (data->ns_count >= MAX_MULTICAST_SOLICIT) {
|
||||||
nbr_free(nbr);
|
nbr_free(nbr);
|
||||||
} else {
|
} else {
|
||||||
|
@ -1254,21 +1257,21 @@ static void nd_reachable_timeout(struct k_work *work)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case NET_NBR_REACHABLE:
|
case NET_IPV6_NBR_STATE_REACHABLE:
|
||||||
data->state = NET_NBR_STALE;
|
data->state = NET_IPV6_NBR_STATE_STALE;
|
||||||
|
|
||||||
NET_DBG("nbr %p moving %s state to STALE (%d)",
|
NET_DBG("nbr %p moving %s state to STALE (%d)",
|
||||||
nbr, net_sprint_ipv6_addr(&data->addr), data->state);
|
nbr, net_sprint_ipv6_addr(&data->addr), data->state);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case NET_NBR_STALE:
|
case NET_IPV6_NBR_STATE_STALE:
|
||||||
NET_DBG("nbr %p removing stale address %s",
|
NET_DBG("nbr %p removing stale address %s",
|
||||||
nbr, net_sprint_ipv6_addr(&data->addr));
|
nbr, net_sprint_ipv6_addr(&data->addr));
|
||||||
nbr_free(nbr);
|
nbr_free(nbr);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case NET_NBR_DELAY:
|
case NET_IPV6_NBR_STATE_DELAY:
|
||||||
data->state = NET_NBR_PROBE;
|
data->state = NET_IPV6_NBR_STATE_PROBE;
|
||||||
data->ns_count = 0;
|
data->ns_count = 0;
|
||||||
|
|
||||||
NET_DBG("nbr %p moving %s state to PROBE (%d)",
|
NET_DBG("nbr %p moving %s state to PROBE (%d)",
|
||||||
|
@ -1276,7 +1279,7 @@ static void nd_reachable_timeout(struct k_work *work)
|
||||||
|
|
||||||
/* Intentionally continuing to probe state */
|
/* Intentionally continuing to probe state */
|
||||||
|
|
||||||
case NET_NBR_PROBE:
|
case NET_IPV6_NBR_STATE_PROBE:
|
||||||
if (data->ns_count >= MAX_UNICAST_SOLICIT) {
|
if (data->ns_count >= MAX_UNICAST_SOLICIT) {
|
||||||
struct net_if_router *router;
|
struct net_if_router *router;
|
||||||
|
|
||||||
|
@ -1383,7 +1386,7 @@ static inline bool handle_na_neighbor(struct net_buf *buf,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Update the cached address if we do not yet known it */
|
/* Update the cached address if we do not yet known it */
|
||||||
if (net_ipv6_nbr_data(nbr)->state == NET_NBR_INCOMPLETE) {
|
if (net_ipv6_nbr_data(nbr)->state == NET_IPV6_NBR_STATE_INCOMPLETE) {
|
||||||
if (!tllao) {
|
if (!tllao) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -1400,7 +1403,7 @@ static inline bool handle_na_neighbor(struct net_buf *buf,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (net_is_solicited(buf)) {
|
if (net_is_solicited(buf)) {
|
||||||
nbr_set_state(nbr, NET_NBR_REACHABLE);
|
ipv6_nbr_set_state(nbr, NET_IPV6_NBR_STATE_REACHABLE);
|
||||||
net_ipv6_nbr_data(nbr)->ns_count = 0;
|
net_ipv6_nbr_data(nbr)->ns_count = 0;
|
||||||
|
|
||||||
/* We might have active timer from PROBE */
|
/* We might have active timer from PROBE */
|
||||||
|
@ -1410,7 +1413,7 @@ static inline bool handle_na_neighbor(struct net_buf *buf,
|
||||||
net_ipv6_nbr_set_reachable_timer(net_nbuf_iface(buf),
|
net_ipv6_nbr_set_reachable_timer(net_nbuf_iface(buf),
|
||||||
nbr);
|
nbr);
|
||||||
} else {
|
} else {
|
||||||
nbr_set_state(nbr, NET_NBR_STALE);
|
ipv6_nbr_set_state(nbr, NET_IPV6_NBR_STATE_STALE);
|
||||||
}
|
}
|
||||||
|
|
||||||
net_ipv6_nbr_data(nbr)->is_router = net_is_router(buf);
|
net_ipv6_nbr_data(nbr)->is_router = net_is_router(buf);
|
||||||
|
@ -1422,8 +1425,9 @@ static inline bool handle_na_neighbor(struct net_buf *buf,
|
||||||
* and we have a valid address in the cache.
|
* and we have a valid address in the cache.
|
||||||
*/
|
*/
|
||||||
if (!net_is_override(buf) && lladdr_changed) {
|
if (!net_is_override(buf) && lladdr_changed) {
|
||||||
if (net_ipv6_nbr_data(nbr)->state == NET_NBR_REACHABLE) {
|
if (net_ipv6_nbr_data(nbr)->state ==
|
||||||
nbr_set_state(nbr, NET_NBR_STALE);
|
NET_IPV6_NBR_STATE_REACHABLE) {
|
||||||
|
ipv6_nbr_set_state(nbr, NET_IPV6_NBR_STATE_STALE);
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
@ -1444,7 +1448,7 @@ static inline bool handle_na_neighbor(struct net_buf *buf,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (net_is_solicited(buf)) {
|
if (net_is_solicited(buf)) {
|
||||||
nbr_set_state(nbr, NET_NBR_REACHABLE);
|
ipv6_nbr_set_state(nbr, NET_IPV6_NBR_STATE_REACHABLE);
|
||||||
|
|
||||||
/* We might have active timer from PROBE */
|
/* We might have active timer from PROBE */
|
||||||
k_delayed_work_cancel(
|
k_delayed_work_cancel(
|
||||||
|
@ -1454,7 +1458,8 @@ static inline bool handle_na_neighbor(struct net_buf *buf,
|
||||||
nbr);
|
nbr);
|
||||||
} else {
|
} else {
|
||||||
if (lladdr_changed) {
|
if (lladdr_changed) {
|
||||||
nbr_set_state(nbr, NET_NBR_STALE);
|
ipv6_nbr_set_state(nbr,
|
||||||
|
NET_IPV6_NBR_STATE_STALE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1687,7 +1692,7 @@ int net_ipv6_send_ns(struct net_if *iface,
|
||||||
|
|
||||||
nbr = nbr_new(net_nbuf_iface(buf),
|
nbr = nbr_new(net_nbuf_iface(buf),
|
||||||
&NET_ICMPV6_NS_BUF(buf)->tgt,
|
&NET_ICMPV6_NS_BUF(buf)->tgt,
|
||||||
NET_NBR_INCOMPLETE);
|
NET_IPV6_NBR_STATE_INCOMPLETE);
|
||||||
if (!nbr) {
|
if (!nbr) {
|
||||||
NET_DBG("Could not create new neighbor %s",
|
NET_DBG("Could not create new neighbor %s",
|
||||||
net_sprint_ipv6_addr(
|
net_sprint_ipv6_addr(
|
||||||
|
@ -1864,7 +1869,7 @@ static inline struct net_buf *handle_ra_neighbor(struct net_buf *buf,
|
||||||
nbr_print();
|
nbr_print();
|
||||||
|
|
||||||
*nbr = nbr_add(buf, &NET_IPV6_BUF(buf)->src, &lladdr,
|
*nbr = nbr_add(buf, &NET_IPV6_BUF(buf)->src, &lladdr,
|
||||||
true, NET_NBR_STALE);
|
true, NET_IPV6_NBR_STATE_STALE);
|
||||||
if (!*nbr) {
|
if (!*nbr) {
|
||||||
NET_ERR("Could not add router neighbor %s [%s]",
|
NET_ERR("Could not add router neighbor %s [%s]",
|
||||||
net_sprint_ipv6_addr(&NET_IPV6_BUF(buf)->src),
|
net_sprint_ipv6_addr(&NET_IPV6_BUF(buf)->src),
|
||||||
|
@ -1888,11 +1893,12 @@ static inline struct net_buf *handle_ra_neighbor(struct net_buf *buf,
|
||||||
net_linkaddr_set(cached_lladdr, lladdr.addr,
|
net_linkaddr_set(cached_lladdr, lladdr.addr,
|
||||||
lladdr.len);
|
lladdr.len);
|
||||||
|
|
||||||
nbr_set_state(*nbr, NET_NBR_STALE);
|
ipv6_nbr_set_state(*nbr, NET_IPV6_NBR_STATE_STALE);
|
||||||
} else {
|
} else {
|
||||||
if (net_ipv6_nbr_data(*nbr)->state ==
|
if (net_ipv6_nbr_data(*nbr)->state ==
|
||||||
NET_NBR_INCOMPLETE) {
|
NET_IPV6_NBR_STATE_INCOMPLETE) {
|
||||||
nbr_set_state(*nbr, NET_NBR_STALE);
|
ipv6_nbr_set_state(*nbr,
|
||||||
|
NET_IPV6_NBR_STATE_STALE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -64,15 +64,15 @@
|
||||||
#define NET_IPV6_MLDv2_BLOCK_OLD_SOURCES 6
|
#define NET_IPV6_MLDv2_BLOCK_OLD_SOURCES 6
|
||||||
|
|
||||||
/* State of the neighbor */
|
/* State of the neighbor */
|
||||||
enum net_nbr_state {
|
enum net_ipv6_nbr_state {
|
||||||
NET_NBR_INCOMPLETE,
|
NET_IPV6_NBR_STATE_INCOMPLETE,
|
||||||
NET_NBR_REACHABLE,
|
NET_IPV6_NBR_STATE_REACHABLE,
|
||||||
NET_NBR_STALE,
|
NET_IPV6_NBR_STATE_STALE,
|
||||||
NET_NBR_DELAY,
|
NET_IPV6_NBR_STATE_DELAY,
|
||||||
NET_NBR_PROBE,
|
NET_IPV6_NBR_STATE_PROBE,
|
||||||
};
|
};
|
||||||
|
|
||||||
const char *net_nbr_state2str(enum net_nbr_state state);
|
const char *net_ipv6_nbr_state2str(enum net_ipv6_nbr_state state);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief IPv6 neighbor information.
|
* @brief IPv6 neighbor information.
|
||||||
|
@ -91,7 +91,7 @@ struct net_ipv6_nbr_data {
|
||||||
struct k_delayed_work send_ns;
|
struct k_delayed_work send_ns;
|
||||||
|
|
||||||
/** State of the neighbor discovery */
|
/** State of the neighbor discovery */
|
||||||
enum net_nbr_state state;
|
enum net_ipv6_nbr_state state;
|
||||||
|
|
||||||
/** Link metric for the neighbor */
|
/** Link metric for the neighbor */
|
||||||
uint16_t link_metric;
|
uint16_t link_metric;
|
||||||
|
@ -289,7 +289,7 @@ struct net_nbr *net_ipv6_nbr_add(struct net_if *iface,
|
||||||
struct in6_addr *addr,
|
struct in6_addr *addr,
|
||||||
struct net_linkaddr *lladdr,
|
struct net_linkaddr *lladdr,
|
||||||
bool is_router,
|
bool is_router,
|
||||||
enum net_nbr_state state);
|
enum net_ipv6_nbr_state state);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Remove a neighbour from neighbor cache.
|
* @brief Remove a neighbour from neighbor cache.
|
||||||
|
@ -332,7 +332,7 @@ static inline struct net_nbr *net_ipv6_nbr_add(struct net_if *iface,
|
||||||
struct in6_addr *addr,
|
struct in6_addr *addr,
|
||||||
struct net_linkaddr *lladdr,
|
struct net_linkaddr *lladdr,
|
||||||
bool is_router,
|
bool is_router,
|
||||||
enum net_nbr_state state)
|
enum net_ipv6_nbr_state state)
|
||||||
{
|
{
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
|
@ -144,7 +144,8 @@ static void ipsp_connected(struct bt_l2cap_chan *chan)
|
||||||
* A Bluetooth LE 6LN MUST NOT register its link-local address.
|
* A Bluetooth LE 6LN MUST NOT register its link-local address.
|
||||||
*/
|
*/
|
||||||
net_ipv6_addr_create_iid(&in6, &ll);
|
net_ipv6_addr_create_iid(&in6, &ll);
|
||||||
net_ipv6_nbr_add(ctxt->iface, &in6, &ll, false, NET_NBR_REACHABLE);
|
net_ipv6_nbr_add(ctxt->iface, &in6, &ll, false,
|
||||||
|
NET_IPV6_NBR_STATE_REACHABLE);
|
||||||
|
|
||||||
/* Set iface up */
|
/* Set iface up */
|
||||||
net_if_up(ctxt->iface);
|
net_if_up(ctxt->iface);
|
||||||
|
|
|
@ -721,7 +721,7 @@ static void nbr_cb(struct net_nbr *nbr, void *user_data)
|
||||||
net_ipv6_nbr_data(nbr)->is_router,
|
net_ipv6_nbr_data(nbr)->is_router,
|
||||||
net_ipv6_nbr_data(nbr)->link_metric,
|
net_ipv6_nbr_data(nbr)->link_metric,
|
||||||
nbr->iface,
|
nbr->iface,
|
||||||
net_nbr_state2str(net_ipv6_nbr_data(nbr)->state),
|
net_ipv6_nbr_state2str(net_ipv6_nbr_data(nbr)->state),
|
||||||
k_delayed_work_remaining_get(
|
k_delayed_work_remaining_get(
|
||||||
&net_ipv6_nbr_data(nbr)->reachable),
|
&net_ipv6_nbr_data(nbr)->reachable),
|
||||||
nbr->idx == NET_NBR_LLADDR_UNKNOWN ? "?" :
|
nbr->idx == NET_NBR_LLADDR_UNKNOWN ? "?" :
|
||||||
|
|
|
@ -2700,7 +2700,7 @@ static enum net_verdict handle_dio(struct net_buf *buf)
|
||||||
&NET_IPV6_BUF(buf)->src,
|
&NET_IPV6_BUF(buf)->src,
|
||||||
net_nbuf_ll_src(buf),
|
net_nbuf_ll_src(buf),
|
||||||
0,
|
0,
|
||||||
NET_NBR_REACHABLE);
|
NET_IPV6_NBR_STATE_REACHABLE);
|
||||||
if (!nbr) {
|
if (!nbr) {
|
||||||
NET_DBG("Cannot add neighbor by DIO");
|
NET_DBG("Cannot add neighbor by DIO");
|
||||||
goto out;
|
goto out;
|
||||||
|
@ -3391,7 +3391,7 @@ static enum net_verdict handle_dao(struct net_buf *buf)
|
||||||
if (!nbr) {
|
if (!nbr) {
|
||||||
nbr = net_ipv6_nbr_add(net_nbuf_iface(buf), dao_sender,
|
nbr = net_ipv6_nbr_add(net_nbuf_iface(buf), dao_sender,
|
||||||
net_nbuf_ll_src(buf), false,
|
net_nbuf_ll_src(buf), false,
|
||||||
NET_NBR_REACHABLE);
|
NET_IPV6_NBR_STATE_REACHABLE);
|
||||||
if (nbr) {
|
if (nbr) {
|
||||||
/* Set reachable timer */
|
/* Set reachable timer */
|
||||||
net_ipv6_nbr_set_reachable_timer(net_nbuf_iface(buf),
|
net_ipv6_nbr_set_reachable_timer(net_nbuf_iface(buf),
|
||||||
|
|
|
@ -440,7 +440,7 @@ static bool net_test_send_ns(void)
|
||||||
&in6addr_my,
|
&in6addr_my,
|
||||||
&iface->link_addr,
|
&iface->link_addr,
|
||||||
false,
|
false,
|
||||||
NET_NBR_REACHABLE);
|
NET_IPV6_NBR_STATE_REACHABLE);
|
||||||
if (!nbr) {
|
if (!nbr) {
|
||||||
TC_ERROR("Cannot add to neighbor cache\n");
|
TC_ERROR("Cannot add to neighbor cache\n");
|
||||||
return false;
|
return false;
|
||||||
|
@ -484,7 +484,7 @@ static bool net_test_nbr_lookup_ok(void)
|
||||||
net_sprint_ipv6_addr(&peer_addr),
|
net_sprint_ipv6_addr(&peer_addr),
|
||||||
net_sprint_ll_addr(llstorage->addr, llstorage->len));
|
net_sprint_ll_addr(llstorage->addr, llstorage->len));
|
||||||
|
|
||||||
net_ipv6_nbr_data(nbr)->state = NET_NBR_REACHABLE;
|
net_ipv6_nbr_data(nbr)->state = NET_IPV6_NBR_STATE_REACHABLE;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue