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.
This commit is contained in:
Dan Williams 2010-05-10 15:19:03 -07:00
parent f3057a6844
commit 3e68d33583

View 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) {