From 901664eca1e52a61500496c86ff47c509ad0b625 Mon Sep 17 00:00:00 2001 From: David van Moolenbroek Date: Thu, 29 Dec 2016 22:27:10 +0000 Subject: [PATCH] netif: more ip6 state changes invoke status callback For applications that use NETIF_STATUS_CALLBACK to help keep track of extra per-address shadow state of IPv6 addresses, even in the light of autogenerated addresses (which may "spontaneously" appear/disappear), state transitions between tentative, duplicated, and invalid are important as well. Therefore, invoke the status callback for all such state transitions. Continue to filter out state changes between various levels of progress of the tentative state, though. --- src/core/netif.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/netif.c b/src/core/netif.c index be34cdf8..c5bd3c50 100644 --- a/src/core/netif.c +++ b/src/core/netif.c @@ -1127,9 +1127,9 @@ netif_ip6_addr_set_state(struct netif* netif, s8_t addr_idx, u8_t state) /* @todo: add mib2 ip6 entries? */ netif_issue_reports(netif, NETIF_REPORT_TYPE_IPV6); } - if ((old_state & IP6_ADDR_PREFERRED) != (state & IP6_ADDR_PREFERRED)) { - /* address state has changed (valid flag changed or switched between - preferred and deprecated) -> call the callback function */ + if ((old_state & ~IP6_ADDR_TENTATIVE_COUNT_MASK) != + (state & ~IP6_ADDR_TENTATIVE_COUNT_MASK)) { + /* address state has changed -> call the callback function */ NETIF_STATUS_CALLBACK(netif); } }