From 3e68d3358311cd04ae85884ef593da7554f4b3e3 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 10 May 2010 15:19:03 -0700 Subject: [PATCH] ip6: only honor kernel-provided RA flags if an RA was received (rh #588560) 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 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/ip6-manager/nm-ip6-manager.c b/src/ip6-manager/nm-ip6-manager.c index be22e6465b..ba6be259f8 100644 --- a/src/ip6-manager/nm-ip6-manager.c +++ b/src/ip6-manager/nm-ip6-manager.c @@ -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) {