Don't announce :: as DNS
authorSteven Barth <steven@midlink.org>
Mon, 24 Feb 2014 13:36:28 +0000 (14:36 +0100)
committerSteven Barth <steven@midlink.org>
Mon, 24 Feb 2014 13:36:28 +0000 (14:36 +0100)
src/router.c

index ddec21e434845a528d0984fa2794b1702f7c0003..3ba552daffa6246154abdcfe5e91bdf0a94cf835 100644 (file)
@@ -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_pref, *dns_addr = &dns_pref;
+       struct in6_addr dns_pref = IN6ADDR_ANY_INIT, *dns_addr = &dns_pref;
        uint32_t dns_time = 0;
        size_t dns_cnt = 1;
 
@@ -344,7 +344,7 @@ static void send_router_advert(struct uloop_timeout *event)
                dns_time = 2 * MaxRtrAdvInterval;
        }
 
-       if (!dns_addr)
+       if (!dns_addr || IN6_IS_ADDR_UNSPECIFIED(dns_addr))
                dns_cnt = 0;
 
        struct {