From 425b463df814aca19d05505541e22c3659b834cb Mon Sep 17 00:00:00 2001 From: Laurent Deru Date: Thu, 7 Dec 2017 15:34:34 +0100 Subject: [PATCH] Fix logic of RA flags related to RDNSS --- os/net/ipv6/uip-nd6.c | 22 ++++++++++------------ os/net/ipv6/uip-nd6.h | 2 +- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/os/net/ipv6/uip-nd6.c b/os/net/ipv6/uip-nd6.c index 5c01de392..97545c749 100644 --- a/os/net/ipv6/uip-nd6.c +++ b/os/net/ipv6/uip-nd6.c @@ -1027,18 +1027,16 @@ ra_input(void) break; #if UIP_ND6_RA_RDNSS case UIP_ND6_OPT_RDNSS: - if(UIP_ND6_RA_BUF->flags_reserved & (UIP_ND6_O_FLAG << 6)) { - LOG_DBG("Processing RDNSS option\n"); - uint8_t naddr = (UIP_ND6_OPT_RDNSS_BUF->len - 1) / 2; - uip_ipaddr_t *ip = (uip_ipaddr_t *)(&UIP_ND6_OPT_RDNSS_BUF->ip); - LOG_DBG("got %d nameservers\n", naddr); - while(naddr-- > 0) { - LOG_DBG("nameserver: "); - LOG_DBG_6ADDR(ip); - LOG_DBG_(" lifetime: %lx\n", uip_ntohl(UIP_ND6_OPT_RDNSS_BUF->lifetime)); - uip_nameserver_update(ip, uip_ntohl(UIP_ND6_OPT_RDNSS_BUF->lifetime)); - ip++; - } + LOG_DBG("Processing RDNSS option\n"); + uint8_t naddr = (UIP_ND6_OPT_RDNSS_BUF->len - 1) / 2; + uip_ipaddr_t *ip = (uip_ipaddr_t *)(&UIP_ND6_OPT_RDNSS_BUF->ip); + LOG_DBG("got %d nameservers\n", naddr); + while(naddr-- > 0) { + LOG_DBG("nameserver: "); + LOG_DBG_6ADDR(ip); + LOG_DBG_(" lifetime: %lx\n", (unsigned long)uip_ntohl(UIP_ND6_OPT_RDNSS_BUF->lifetime)); + uip_nameserver_update(ip, uip_ntohl(UIP_ND6_OPT_RDNSS_BUF->lifetime)); + ip++; } break; #endif /* UIP_ND6_RA_RDNSS */ diff --git a/os/net/ipv6/uip-nd6.h b/os/net/ipv6/uip-nd6.h index 43b989490..2c1e3226b 100644 --- a/os/net/ipv6/uip-nd6.h +++ b/os/net/ipv6/uip-nd6.h @@ -118,7 +118,7 @@ be added regardless of their reachability and liveness. */ #define UIP_ND6_MIN_RA_INTERVAL UIP_CONF_ND6_MIN_RA_INTERVAL #endif #define UIP_ND6_M_FLAG 0 -#define UIP_ND6_O_FLAG (UIP_ND6_RA_RDNSS || UIP_ND6_RA_DNSSL) +#define UIP_ND6_O_FLAG 0 #ifndef UIP_CONF_ROUTER_LIFETIME #define UIP_ND6_ROUTER_LIFETIME 3 * UIP_ND6_MAX_RA_INTERVAL #else