From 6551e9bbc4c464f627045db76fb20344591b11b5 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 13 Dec 2012 10:52:10 -0600 Subject: [PATCH] core: don't fail IPv6 if otherconf/info-only DHCPv6 fails Just like we don't fail IPv4 if DHCP fails to get DNS servers, don't fail IPv6 if we've already got an RA and for some reason DHCPv6 fails. otherconf/info-only DHCP is not mandatory, and lack of results thus should not fail the entire IPv6 config, since DNS servers can also be passed in the RA. RFC4861: 1-bit "Other configuration" flag. When set, it indicates that other configuration information is available via DHCPv6. Examples of such information are DNS-related information or information on other servers within the network. --- src/nm-device.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/nm-device.c b/src/nm-device.c index b12cf463c7..6ce61f737e 100644 --- a/src/nm-device.c +++ b/src/nm-device.c @@ -2653,12 +2653,28 @@ static void dhcp6_timeout (NMDHCPClient *client, gpointer user_data) { NMDevice *device = NM_DEVICE (user_data); + NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (device); + NMIP6Config *config; g_return_if_fail (nm_device_get_act_request (device) != NULL); g_return_if_fail (nm_dhcp_client_get_ipv6 (client) == TRUE); nm_dhcp_client_stop (client, FALSE); - dhcp6_fail (device, TRUE); + if (priv->dhcp6_mode == IP6_DHCP_OPT_MANAGED) + dhcp6_fail (device, TRUE); + else { + /* not a hard failure; just live with the RA info */ + nm_dhcp6_config_reset (priv->dhcp6_config); + if (priv->dhcp6_ip6_config) + g_object_unref (priv->dhcp6_ip6_config); + priv->dhcp6_ip6_config = NULL; + + if (priv->ip6_state == IP_CONF) { + config = nm_ip6_config_new (); + nm_device_activate_schedule_ip6_config_result (device, config); + g_object_unref (config); + } + } } static NMActStageReturn