router: fix managed address configuration setting
authorHans Dedecker <dedeckeh@gmail.com>
Wed, 18 Apr 2018 12:09:47 +0000 (14:09 +0200)
committerHans Dedecker <dedeckeh@gmail.com>
Wed, 18 Apr 2018 12:16:24 +0000 (14:16 +0200)
Don't announce managed address configuration in case DHCPv6 is disabled

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
src/router.c

index e9919b2387976c28775717363986a8fded0317f1..79b688a556e1d662e6f00269388010f7bf328497 100644 (file)
@@ -314,11 +314,12 @@ static uint64_t send_router_advert(struct interface *iface, const struct in6_add
        if (hlim > 0)
                adv.h.nd_ra_curhoplimit = hlim;
 
-       if (iface->dhcpv6)
+       if (iface->dhcpv6) {
                adv.h.nd_ra_flags_reserved = ND_RA_FLAG_OTHER;
 
-       if (iface->ra_managed >= RA_MANAGED_MFLAG)
-               adv.h.nd_ra_flags_reserved |= ND_RA_FLAG_MANAGED;
+               if (iface->ra_managed >= RA_MANAGED_MFLAG)
+                       adv.h.nd_ra_flags_reserved |= ND_RA_FLAG_MANAGED;
+       }
 
        if (iface->route_preference < 0)
                adv.h.nd_ra_flags_reserved |= ND_RA_PREF_LOW;