Merge pull request #240 from cetic/fix-ra-rdnss

RDNSS and DNSSL do not rely on O Flag
This commit is contained in:
Simon Duquennoy 2017-12-20 13:14:11 +01:00 committed by GitHub
commit be4535c49e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 13 deletions

View File

@ -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 */

View File

@ -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