ip6: only honor kernel-provided RA flags if an RA was received (rh #588560)
authorDan Williams <dcbw@redhat.com>
Mon, 10 May 2010 22:19:03 +0000 (15:19 -0700)
committerDan Williams <dcbw@redhat.com>
Mon, 10 May 2010 22:19:03 +0000 (15:19 -0700)
The kernel apparently caches the value and will send Managed/Other flags
in the newlink message even if the router is no longer reachable and
and RA hasn't been received for a while.  So we need to make sure we
check for IF_RA_RCVD before paying attention to Managed/Other.

src/ip6-manager/nm-ip6-manager.c

index be22e64..ba6be25 100644 (file)
@@ -390,9 +390,10 @@ nm_ip6_device_sync_from_netlink (NMIP6Device *device, gboolean config_changed)
                    device->iface, state_to_string (device->state));
 
        /* We only care about router advertisements if we want a real IPv6 address */
-       if (device->target_state == NM_IP6_DEVICE_GOT_ADDRESS) {
-               if (   (device->ra_flags & IF_RA_RCVD)
-                   && (device->state < NM_IP6_DEVICE_GOT_ROUTER_ADVERTISEMENT))
+       if (   (device->target_state == NM_IP6_DEVICE_GOT_ADDRESS)
+           && (device->ra_flags & IF_RA_RCVD)) {
+
+               if (device->state < NM_IP6_DEVICE_GOT_ROUTER_ADVERTISEMENT)
                        device->state = NM_IP6_DEVICE_GOT_ROUTER_ADVERTISEMENT;
 
                if (device->ra_flags & IF_RA_MANAGED) {