summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2014-02-24 14:29:31 +0100
committerSteven Barth <steven@midlink.org>2014-02-24 14:29:31 +0100
commit24c344b621b0d8d81be2aaac806d905dbe6bbca6 (patch)
treef41ff16b2a89fb03b9259a9885a4ae0f43a9b826
parent79d005edf35a363e2d254e37ca2edcd743c2b4f6 (diff)
Fix DNS-server and routes announced in RA for certain prefix cases
-rw-r--r--src/router.c8
1 files changed, 4 insertions, 4 deletions
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;
}