From d20a7aba0c1779587baaa2b04631a4027285873c Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Thu, 16 Nov 2017 20:01:55 +0800 Subject: [PATCH] netif: Use ip6_addr_isvalid() at appropriate places Signed-off-by: Axel Lin Signed-off-by: goldsimon --- src/core/netif.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/netif.c b/src/core/netif.c index d056a19f..dae0c32f 100644 --- a/src/core/netif.c +++ b/src/core/netif.c @@ -1189,7 +1189,7 @@ netif_ip6_addr_set_parts(struct netif *netif, s8_t addr_idx, u32_t i0, u32_t i1, IP_ADDR6(&new_ipaddr, i0, i1, i2, i3); ip6_addr_assign_zone(ip_2_ip6(&new_ipaddr), IP6_UNICAST, netif); - if (netif_ip6_addr_state(netif, addr_idx) & IP6_ADDR_VALID) { + if (ip6_addr_isvalid(netif_ip6_addr_state(netif, addr_idx))) { #if LWIP_TCP tcp_netif_ip_addr_changed(netif_ip_addr6(netif, addr_idx), &new_ipaddr); #endif /* LWIP_TCP */ @@ -1204,7 +1204,7 @@ netif_ip6_addr_set_parts(struct netif *netif, s8_t addr_idx, u32_t i0, u32_t i1, ip_addr_copy(netif->ip6_addr[addr_idx], new_ipaddr); - if (netif_ip6_addr_state(netif, addr_idx) & IP6_ADDR_VALID) { + if (ip6_addr_isvalid(netif_ip6_addr_state(netif, addr_idx))) { netif_issue_reports(netif, NETIF_REPORT_TYPE_IPV6); NETIF_STATUS_CALLBACK(netif); }