From: Steven Barth Date: Mon, 24 Feb 2014 13:29:31 +0000 (+0100) Subject: Fix DNS-server and routes announced in RA for certain prefix cases X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=24c344b621b0d8d81be2aaac806d905dbe6bbca6;p=oweals%2Fodhcpd.git Fix DNS-server and routes announced in RA for certain prefix cases --- diff --git a/src/router.c b/src/router.c index b29e531..ddec21e 100644 --- a/src/router.c +++ b/src/router.c @@ -276,7 +276,7 @@ static void send_router_advert(struct uloop_timeout *event) bool have_public = false; size_t cnt = 0; - struct in6_addr *dns_addr = NULL; + struct in6_addr dns_pref, *dns_addr = &dns_pref; uint32_t dns_time = 0; size_t dns_cnt = 1; @@ -327,7 +327,7 @@ static void send_router_advert(struct uloop_timeout *event) if (addr->preferred > dns_time) { dns_time = addr->preferred; - dns_addr = &addr->addr; + dns_pref = addr->addr; } } @@ -427,8 +427,8 @@ static void send_router_advert(struct uloop_timeout *event) routes[routes_cnt].lifetime = htonl(addr->valid); routes[routes_cnt].addr[0] = addr->addr.s6_addr32[0]; routes[routes_cnt].addr[1] = addr->addr.s6_addr32[1]; - routes[routes_cnt].addr[2] = addr->addr.s6_addr32[2]; - routes[routes_cnt].addr[3] = addr->addr.s6_addr32[3]; + routes[routes_cnt].addr[2] = 0; + routes[routes_cnt].addr[3] = 0; ++routes_cnt; }