You are not logged in.

#1 2017-07-04 12:02:39

Odysseus
Member
Registered: 2009-02-15
Posts: 141

[Solved] Resolvconf loses DNS after suspend using netctl-auto w/ IPv6

I have been using netctl-auto to manage my laptops wireless connection for a long time without issue. However, I just switched ISPs and I now have a modem which supports IPv6, so I figured I'd tweak my netctl profile to support it too. It works fine initially (I receive both an IPv4 and IPv6 address), but after resuming from suspend I cannot resolve domain names, though I can still use IP addresses.

I know that /etc/resolv.conf is managed via openresolv, but during this condition that file is blank, and there are no files listed under /run/resolvconf/interfaces.

Any ideas?

/etc/netctl/wlan0-The\ Innernette\ Beta:

Description='Automatically generated profile by wifi-menu'
Interface=wlan0
Connection=wireless
Security=wpa
ESSID=The\ Innernette\ Beta
IP=dhcp
DHCPClient=dhcpcd
IP6=dhcp
DHCP6Client=dhcpcd
Key=beautiful 

journalctl output during suspend:

Jul 04 07:10:47 arch-laptop systemd-logind[325]: Power key pressed.
Jul 04 07:10:47 arch-laptop systemd[1]: Starting netctl sleep hook...
Jul 04 07:10:48 arch-laptop systemd[1]: Started netctl sleep hook.
Jul 04 07:10:48 arch-laptop systemd[1]: Reached target Sleep.
Jul 04 07:10:48 arch-laptop systemd[1]: Starting Suspend...
Jul 04 07:10:48 arch-laptop systemd-sleep[8881]: Suspending system...
Jul 04 07:10:48 arch-laptop kernel: PM: Syncing filesystems ... done.
Jul 04 07:10:55 arch-laptop kernel: PM: Preparing system for sleep (mem)
Jul 04 07:10:55 arch-laptop kernel: Freezing user space processes ... (elapsed 0.001 seconds) done.
Jul 04 07:10:55 arch-laptop kernel: Freezing remaining freezable tasks ... (elapsed 0.001 seconds) done.
Jul 04 07:10:55 arch-laptop kernel: PM: Suspending system (mem)
Jul 04 07:10:55 arch-laptop kernel: Suspending console(s) (use no_console_suspend to debug)
Jul 04 07:10:55 arch-laptop kernel: wlan0: deauthenticating from 40:70:09:93:c8:30 by local choice (Reason: 3=DEAUTH_LEAVING)
Jul 04 07:10:55 arch-laptop kernel: sd 0:0:0:0: [sda] Synchronizing SCSI cache
Jul 04 07:10:55 arch-laptop kernel: ACPI : EC: event blocked
Jul 04 07:10:55 arch-laptop kernel: sd 0:0:0:0: [sda] Stopping disk
Jul 04 07:10:55 arch-laptop kernel: PM: suspend of devices complete after 1064.302 msecs
Jul 04 07:10:55 arch-laptop kernel: PM: late suspend of devices complete after 16.001 msecs
Jul 04 07:10:55 arch-laptop kernel: ACPI : EC: interrupt blocked
Jul 04 07:10:55 arch-laptop kernel: ehci-pci 0000:00:1d.0: System wakeup enabled by ACPI
Jul 04 07:10:55 arch-laptop kernel: ehci-pci 0000:00:1a.0: System wakeup enabled by ACPI
Jul 04 07:10:55 arch-laptop kernel: PM: noirq suspend of devices complete after 16.828 msecs
Jul 04 07:10:55 arch-laptop kernel: ACPI: Preparing to enter system sleep state S3
Jul 04 07:10:55 arch-laptop kernel: ACPI : EC: EC stopped
Jul 04 07:10:55 arch-laptop kernel: PM: Saving platform NVS memory
Jul 04 07:10:55 arch-laptop kernel: Disabling non-boot CPUs ...
Jul 04 07:10:55 arch-laptop kernel: smpboot: CPU 1 is now offline
Jul 04 07:10:55 arch-laptop kernel: smpboot: CPU 2 is now offline
Jul 04 07:10:55 arch-laptop kernel: smpboot: CPU 3 is now offline
Jul 04 07:10:55 arch-laptop kernel: ACPI: Low-level resume complete
Jul 04 07:10:55 arch-laptop kernel: ACPI : EC: EC started
Jul 04 07:10:55 arch-laptop kernel: PM: Restoring platform NVS memory
Jul 04 07:10:55 arch-laptop kernel: Suspended for 4.980 seconds
Jul 04 07:10:55 arch-laptop kernel: Enabling non-boot CPUs ...
Jul 04 07:10:55 arch-laptop kernel: x86: Booting SMP configuration:
Jul 04 07:10:55 arch-laptop kernel: smpboot: Booting Node 0 Processor 1 APIC 0x4
Jul 04 07:10:55 arch-laptop kernel:  cache: parent cpu1 should not be sleeping
Jul 04 07:10:55 arch-laptop kernel: microcode: sig=0x20655, pf=0x10, revision=0x2
Jul 04 07:10:55 arch-laptop kernel: CPU1 is up
Jul 04 07:10:55 arch-laptop kernel: smpboot: Booting Node 0 Processor 2 APIC 0x1
Jul 04 07:10:55 arch-laptop kernel:  cache: parent cpu2 should not be sleeping
Jul 04 07:10:55 arch-laptop kernel: microcode: sig=0x20655, pf=0x10, revision=0x4
Jul 04 07:10:55 arch-laptop kernel: CPU2 is up
Jul 04 07:10:55 arch-laptop kernel: smpboot: Booting Node 0 Processor 3 APIC 0x5
Jul 04 07:10:55 arch-laptop kernel:  cache: parent cpu3 should not be sleeping
Jul 04 07:10:55 arch-laptop kernel: CPU3 is up
Jul 04 07:10:55 arch-laptop kernel: ACPI: Waking up from system sleep state S3
Jul 04 07:10:55 arch-laptop kernel: ACPI : EC: interrupt unblocked
Jul 04 07:10:55 arch-laptop kernel: ehci-pci 0000:00:1d.0: System wakeup disabled by ACPI
Jul 04 07:10:55 arch-laptop kernel: ehci-pci 0000:00:1a.0: System wakeup disabled by ACPI
Jul 04 07:10:55 arch-laptop kernel: PM: noirq resume of devices complete after 17.957 msecs
Jul 04 07:10:55 arch-laptop kernel: PM: early resume of devices complete after 2.112 msecs
Jul 04 07:10:55 arch-laptop kernel: ACPI : EC: event unblocked
Jul 04 07:10:55 arch-laptop kernel: sd 0:0:0:0: [sda] Starting disk
Jul 04 07:10:55 arch-laptop kernel: iwlwifi 0000:04:00.0: L1 Enabled - LTR Disabled
Jul 04 07:10:55 arch-laptop kernel: iwlwifi 0000:04:00.0: L1 Enabled - LTR Disabled
Jul 04 07:10:55 arch-laptop kernel: iwlwifi 0000:04:00.0: Radio type=0x0-0x0-0x3
Jul 04 07:10:55 arch-laptop kernel: rtc_cmos 00:01: System wakeup disabled by ACPI
Jul 04 07:10:55 arch-laptop kernel: iwlwifi 0000:04:00.0: L1 Enabled - LTR Disabled
Jul 04 07:10:55 arch-laptop kernel: iwlwifi 0000:04:00.0: L1 Enabled - LTR Disabled
Jul 04 07:10:55 arch-laptop kernel: iwlwifi 0000:04:00.0: Radio type=0x0-0x0-0x3
Jul 04 07:10:55 arch-laptop kernel: usb 1-1.3: reset full-speed USB device number 4 using ehci-pci
Jul 04 07:10:55 arch-laptop kernel: ata5: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
Jul 04 07:10:55 arch-laptop kernel: ata5.00: configured for UDMA/66
Jul 04 07:10:55 arch-laptop kernel: usb 1-1.2: reset full-speed USB device number 3 using ehci-pci
Jul 04 07:10:55 arch-laptop kernel: usb 1-1.6: reset high-speed USB device number 5 using ehci-pci
Jul 04 07:10:55 arch-laptop kernel: PM: resume of devices complete after 683.548 msecs
Jul 04 07:10:55 arch-laptop kernel: usb 1-1.2:1.0: rebind failed: -517
Jul 04 07:10:55 arch-laptop kernel: usb 1-1.2:1.1: rebind failed: -517
Jul 04 07:10:55 arch-laptop kernel: PM: Finishing wakeup.
Jul 04 07:10:55 arch-laptop kernel: Restarting tasks ... done.
Jul 04 07:10:55 arch-laptop dhcpcd[7215]: wlan0: carrier lost
Jul 04 07:10:55 arch-laptop systemd[1]: Starting Load/Save RF Kill Switch Status...
Jul 04 07:10:55 arch-laptop wpa_actiond[7119]: Interface 'wlan0' lost connection to network 'The Innernette Beta'
Jul 04 07:10:55 arch-laptop systemd[1]: Started Load/Save RF Kill Switch Status.
Jul 04 07:10:55 arch-laptop systemd[1]: bluetooth.target: Unit not needed anymore. Stopping.
Jul 04 07:10:55 arch-laptop systemd[1]: Stopped target Bluetooth.
Jul 04 07:10:55 arch-laptop systemd[1]: Reached target Bluetooth.
Jul 04 07:10:55 arch-laptop dhcpcd[7215]: wlan0: deleting address 2605:6000:f6c6:6c00:5f1f:f40f:bebd:e9e5/128
Jul 04 07:10:55 arch-laptop dhcpcd[7215]: wlan0: deleting default route via fe80::4270:9ff:fe93:c837
Jul 04 07:10:55 arch-laptop kernel: usb 2-1.5: new high-speed USB device number 14 using ehci-pci
Jul 04 07:10:55 arch-laptop dhcpcd[7215]: wlan0: deleting route to 2605:6000:f6c6:6c00::/64
Jul 04 07:10:55 arch-laptop dhcpcd[7215]: wlan0: deleting address fe80::6854:4115:a488:34a9
Jul 04 07:10:56 arch-laptop kernel: ums-realtek 2-1.5:1.0: USB Mass Storage device detected
Jul 04 07:10:56 arch-laptop kernel: scsi host5: usb-storage 2-1.5:1.0
Jul 04 07:10:56 arch-laptop kernel: video LNXVIDEO:00: Restoring backlight state
Jul 04 07:10:56 arch-laptop kernel: video LNXVIDEO:01: Restoring backlight state
Jul 04 07:10:56 arch-laptop systemd-sleep[8881]: System resumed.
Jul 04 07:10:56 arch-laptop systemd[1]: Started Suspend.
Jul 04 07:10:56 arch-laptop systemd[1]: sleep.target: Unit not needed anymore. Stopping.
Jul 04 07:10:56 arch-laptop systemd[1]: Stopped target Sleep.
Jul 04 07:10:56 arch-laptop systemd[1]: netctl-sleep.service: Unit not needed anymore. Stopping.
Jul 04 07:10:56 arch-laptop systemd[1]: Stopping netctl sleep hook...
Jul 04 07:10:56 arch-laptop systemd[1]: suspend.target: Bound to unit systemd-suspend.service, but unit isn't active.
Jul 04 07:10:56 arch-laptop systemd[1]: Dependency failed for Suspend.
Jul 04 07:10:56 arch-laptop systemd-logind[325]: Operation 'sleep' finished.
Jul 04 07:10:56 arch-laptop systemd[1]: suspend.target: Job suspend.target/start failed with result 'dependency'.
Jul 04 07:10:56 arch-laptop systemd[1]: Stopped netctl sleep hook.
Jul 04 07:10:56 arch-laptop kernel: usb 2-1.5: USB disconnect, device number 14
Jul 04 07:10:56 arch-laptop kernel: wlan0: authenticate with 40:70:09:93:c8:30
Jul 04 07:10:56 arch-laptop kernel: wlan0: send auth to 40:70:09:93:c8:30 (try 1/3)
Jul 04 07:10:56 arch-laptop kernel: wlan0: authenticated
Jul 04 07:10:56 arch-laptop kernel: wlan0: associating with AP with corrupt probe response
Jul 04 07:10:56 arch-laptop kernel: wlan0: associate with 40:70:09:93:c8:30 (try 1/3)
Jul 04 07:10:56 arch-laptop kernel: wlan0: RX AssocResp from 40:70:09:93:c8:30 (capab=0xc31 status=0 aid=1)
Jul 04 07:10:56 arch-laptop kernel: wlan0: associated
Jul 04 07:10:56 arch-laptop dhcpcd[7215]: wlan0: carrier acquired
Jul 04 07:10:56 arch-laptop wpa_actiond[7119]: Interface 'wlan0' reestablished connection to network 'The Innernette Beta'
Jul 04 07:10:56 arch-laptop dhcpcd[7215]: wlan0: IAID c7:e7:79:56
Jul 04 07:10:56 arch-laptop dhcpcd[7215]: wlan0: adding address fe80::6854:4115:a488:34a9
Jul 04 07:10:56 arch-laptop dhcpcd[7215]: wlan0: soliciting an IPv6 router
Jul 04 07:10:57 arch-laptop kernel: ata1: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
Jul 04 07:10:57 arch-laptop kernel: ata1.00: configured for UDMA/133
Jul 04 07:10:58 arch-laptop dhcpcd[7215]: wlan0: Router Advertisement from fe80::4270:9ff:fe93:c837
Jul 04 07:10:58 arch-laptop dhcpcd[7215]: wlan0: adding route to 2605:6000:f6c6:6c00::/64
Jul 04 07:10:58 arch-laptop dhcpcd[7215]: wlan0: adding default route via fe80::4270:9ff:fe93:c837
Jul 04 07:10:58 arch-laptop dhcpcd[7215]: wlan0: confirming prior DHCPv6 lease
Jul 04 07:10:59 arch-laptop dhcpcd[7215]: wlan0: REPLY6 received from fe80::4270:9ff:fe93:c837
Jul 04 07:10:59 arch-laptop dhcpcd[7215]: wlan0: adding address 2605:6000:f6c6:6c00:5f1f:f40f:bebd:e9e5/128
Jul 04 07:10:59 arch-laptop dhcpcd[7215]: wlan0: renew in 1800, rebind in 2880, expire in 3600 seconds

Last edited by Odysseus (2017-07-06 03:38:34)


I'm the type to fling myself headlong through the magical wardrobe, and then incinerate the ornate mahogany portal behind me with a Molotov cocktail.

Offline

#2 2017-07-04 21:10:31

seth
Member
Registered: 2012-09-03
Posts: 51,165

Offline

#3 2017-07-05 00:13:20

Odysseus
Member
Registered: 2009-02-15
Posts: 141

Re: [Solved] Resolvconf loses DNS after suspend using netctl-auto w/ IPv6

That's what I would resort to as a workaround, but I wouldn't personally consider that a solution to the problem. Restarting netctl-auto takes a (relatively) long time to bring down/up the interface, re-authenticate, and negotiate both IPv4 and IPv6 DHCP. In fact, all of those steps already work just fine without restarting, but somewhere along the line resolvconf's DNS config gets dropped.


Any ideas where I could look to further trouble shoot the problem?

EDIT:
So I added a dumb hook into resolvconf to log anytime it gets executed, and I can see it being called like "resolvconf -a wlan0.dhcp" when I start netctl-auto, as expected.  There is also a call to "resolvconf -d wlan0.dhcp6 -f" and repeated calls to "resolvconf -d wlan0.ra -f" presumably because my router doesn't provide DNS via DHCPv6 or through router advertisements, but that is not a problem. During the resume from suspend, there is a "resolvconf -d wlan0.dhcp -f" which empties /etc/resolv.conf, but it never gets added back. You can see in my journalctl output that after suspend, dhcpcd only renews via DHCPv6.

If I disable IPv6 in my netctl profile and repeat the experiment, then I initially get "resolvconf -a wlan0.dhcp" and resolvconf never gets called again. DNS never gets removed at any point during suspend, so nothing breaks. So now the question is why resolvconf gets told to remove the IPv4 DNS entries when IPv6 is enabled.

By the way, here is the before and after suspend contents of /etc/resolv.conf

Before:

# Generated by resolvconf
nameserver 209.18.47.62
nameserver 209.18.47.61

After

# Generated by resolvconf 

EDIT:
Hmm, two more observations:
1) The dhcpcd process which calls "resolvconf -a wlan0.dhcp" is the one which is supposed to be for IPv6 (it's passed -6). Is this a bug?
2) If I just start the profile directly through netctl instead of netctl-auto, then DHCP for IPv4 is renegotiated after resuming. This appears to be because "-K" isn't passed to the dhcpcd process which handles IPv4.

Last edited by Odysseus (2017-07-05 06:46:48)


I'm the type to fling myself headlong through the magical wardrobe, and then incinerate the ornate mahogany portal behind me with a Molotov cocktail.

Offline

#4 2017-07-05 05:53:44

seth
Member
Registered: 2012-09-03
Posts: 51,165

Re: [Solved] Resolvconf loses DNS after suspend using netctl-auto w/ IPv6

Sounds quite like a simple bug in netctl

https://bugs.archlinux.org/index.php?st … =&do=index

Offline

#5 2017-07-05 08:48:46

Odysseus
Member
Registered: 2009-02-15
Posts: 141

Re: [Solved] Resolvconf loses DNS after suspend using netctl-auto w/ IPv6

I believe there is a bug in dhcpcd, not netctl. Here I've reduced the problem down to a much simpler reconstruction. For the following commands, I start with no interfaces up/configured, no network manager running, and /etc/resolv.conf is empty.

> ip link set eth0 up
> dhcpcd -4 -K eth0 # -K is used by netctl-auto
> dhcpcd -6 eth0
> cat /etc/resolv.conf
# Generated by resolvconf
nameserver 209.18.47.62
nameserver 209.18.47.61
> ip link set eth0 down
> ip link set eth0 up
> cat /etc/resolv.conf
# Generated by resolvconf

When the link goes down, the "dhcpcd -6" process calls "resolvconf -d eth0.dhcp" which empties /etc/resolv.conf. I think this is the bug in dhcpcd.
When the link comes back up, the "dhcpcd -4 -K" process doesn't receive link messages, never renews dhcp, so /etc/resolv.conf stays empty.

If I alternatively run the same set of commands without "dhcpcd -6 eth0", then /etc/resolv.conf is left alone while eth0 is brought down/up.  Afterwards, I have to re-add the default gateway route, but then connections/DNS works as normal.

Does my conclusion appear correct?


I'm the type to fling myself headlong through the magical wardrobe, and then incinerate the ornate mahogany portal behind me with a Molotov cocktail.

Offline

#6 2017-07-05 13:28:35

rsmarples
Member
Registered: 2009-05-12
Posts: 287

Re: [Solved] Resolvconf loses DNS after suspend using netctl-auto w/ IPv6

Odysseus wrote:

I believe there is a bug in dhcpcd, not netctl. Here I've reduced the problem down to a much simpler reconstruction. For the following commands, I start with no interfaces up/configured, no network manager running, and /etc/resolv.conf is empty.

> ip link set eth0 up
> dhcpcd -4 -K eth0 # -K is used by netctl-auto
> dhcpcd -6 eth0
> cat /etc/resolv.conf
# Generated by resolvconf
nameserver 209.18.47.62
nameserver 209.18.47.61
> ip link set eth0 down
> ip link set eth0 up
> cat /etc/resolv.conf
# Generated by resolvconf

When the link goes down, the "dhcpcd -6" process calls "resolvconf -d eth0.dhcp" which empties /etc/resolv.conf. I think this is the bug in dhcpcd.
When the link comes back up, the "dhcpcd -4 -K" process doesn't receive link messages, never renews dhcp, so /etc/resolv.conf stays empty.

If I alternatively run the same set of commands without "dhcpcd -6 eth0", then /etc/resolv.conf is left alone while eth0 is brought down/up.  Afterwards, I have to re-add the default gateway route, but then connections/DNS works as normal.

Does my conclusion appear correct?

Hi! I'm upstream for both dhcpcd and openresolv.
My quick testing of the issue implies you are correct.
Can you open a ticket on my tracker please? https://dev.marples.name/
It would also help if you added these to your dhcpcd command line

--debug --logfile /var/log/dhcpcd-6.log

Change dhcpcd-6 to dhcpd-4 for the IPv4 daemon.
Then you can upload the debug log files for each as well.

Offline

#7 2017-07-06 03:36:22

Odysseus
Member
Registered: 2009-02-15
Posts: 141

Re: [Solved] Resolvconf loses DNS after suspend using netctl-auto w/ IPv6

Done: https://dev.marples.name/T129

Since Roy's on the case I'm marking this as solved. In the mean time, I can switch from using netctl-auto to netctl since I typically only need to use a single profile.


I'm the type to fling myself headlong through the magical wardrobe, and then incinerate the ornate mahogany portal behind me with a Molotov cocktail.

Offline

Board footer

Powered by FluxBB