Bug 1353184 - Network inoperable after a manual NetworkManager restart
Summary: Network inoperable after a manual NetworkManager restart
Keywords:
Status: CLOSED WORKSFORME
Alias: None
Product: Fedora
Classification: Fedora
Component: NetworkManager
Version: 24
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Beniamino Galvani
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-07-06 12:37 UTC by Joachim Backes
Modified: 2016-07-20 09:18 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-07-20 09:18:22 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Status of NetworkManager (125.22 KB, image/png)
2016-07-06 12:37 UTC, Joachim Backes
no flags Details
NM log (110.62 KB, text/plain)
2016-07-07 10:08 UTC, Joachim Backes
no flags Details
[PATCH] dhcp: don't set permanent lifetime for addresses (3.17 KB, patch)
2016-07-09 11:52 UTC, Beniamino Galvani
no flags Details | Diff

Description Joachim Backes 2016-07-06 12:37:20 UTC
Created attachment 1176853 [details]
Status of NetworkManager

Description of problem:
after a manual restart of NetworkManager (for some reasons) with

sudo systemctl restart NetworkManager.service

having some problems:

1. The Networkmanager icon disappeared from the dashboard of the GNOME3 desktop

2. DNS is no more operable: trying to access remote hosts by a hostname:

"ping <hostname>" fails with "ping: <hostname>: Name or service not known"

Using the IP address instead of hostname works.

Status of NetworkManager: See attachment


Version-Release number of selected component (if applicable):
NetworkManager-1.2.2-2.fc24.x86_64

How reproducible:
Always

Steps to Reproduce:
1.sudo systemctl restart NetworkManager.service
2.
3.

Actual results:
No access to DNS

Expected results:
NetworkManager icon in the GNOME3 dasboard, and a fully accessible network
Additional info: 
Restarting the NetworkManager with "sudo service NetworkManager restart" in the early days of F24 left a clean network.

Comment 1 Beniamino Galvani 2016-07-07 09:04:01 UTC
Can you please set level=DEBUG in the [logging] section of /etc/NetworkManager/NetworkManager.conf, reproduce the issue and attach NM logs gathered with "journalctl -u NetworkManager -b" ? Thanks!

Comment 2 Joachim Backes 2016-07-07 10:08:45 UTC
Created attachment 1177242 [details]
NM log

Comment 3 Joachim Backes 2016-07-07 10:15:03 UTC
The import part in the NM log starts with time flag: "Jul 07, 12:01"

Comment 4 Beniamino Galvani 2016-07-09 11:52:15 UTC
Created attachment 1177840 [details]
[PATCH] dhcp: don't set permanent lifetime for addresses

(In reply to Joachim Backes from comment #3)
> The import part in the NM log starts with time flag: "Jul 07, 12:01"

The DHCP returns a infinite lease and thus the address is added with "forever" lifetime. Then when NM is restarted it fails to recognize that the DHCP connection was active on the device due to the permanent address.

I think a fix for this would be to avoid setting permanent addresses for DHCP connections and use the maximum value instead, as per attached patch.

Comment 5 Francesco Giudici 2016-07-11 09:08:30 UTC
patch lgtm.

Anyway, i wonder if we should deal with this in IPv6 too with something like:

--- a/src/dhcp-manager/nm-dhcp-systemd.c
+++ b/src/dhcp-manager/nm-dhcp-systemd.c
@@ -737,6 +737,9 @@ lease_to_ip6_config (const char *iface,
        /* Addresses */
        sd_dhcp6_lease_reset_address_iter (lease);
        while (sd_dhcp6_lease_get_address (lease, &tmp_addr, &lft_pref, &lft_valid) >= 0) {
+               if (lft_valid == NM_PLATFORM_LIFETIME_PERMANENT)
+                       lft_valid--;
+
                NMPlatformIP6Address address = {
                        .plen = 128,
                        .address = tmp_addr,
diff --git a/src/dhcp-manager/nm-dhcp-utils.c b/src/dhcp-manager/nm-dhcp-utils.c
index 3c397ce..a36e9c1 100644

--- a/src/dhcp-manager/nm-dhcp-utils.c
+++ b/src/dhcp-manager/nm-dhcp-utils.c
@@ -624,6 +624,8 @@ nm_dhcp_utils_ip6_config_from_options (int ifindex,
        str = g_hash_table_lookup (options, "max_life");
        if (str) {
                address.lifetime = strtoul (str, NULL, 10);
+               if (address.lifetime == NM_PLATFORM_LIFETIME_PERMANENT)
+                       address.lifetime = NM_PLATFORM_LIFETIME_PERMANENT - 1;
                nm_log_info (LOGD_DHCP6, "  valid_lft %u", address.lifetime);
        }


Note You need to log in before you can comment on or make changes to this bug.