FS#64855 - [iwd] DNS resolution broken with iwd 1.3-1

Attached to Project: Community Packages
Opened by Caleb (alpha64) - Monday, 16 December 2019, 05:30 GMT
Last edited by Christian Rebischke (Shibumi) - Sunday, 22 December 2019, 18:14 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Christian Rebischke (Shibumi)
Levente Polyak (anthraxx)
Architecture x86_64
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description: When running a fully-updated Arch Linux system (as of Monday 16 Dec 2019 05:25 AM UTC), with a relatively minimal iwd configuration utilizing iwd's built-in Network Configuration (with systemd for Name Resolution), DNS resolution in Chromium (at least) is non-functional. Checking /run/systemd/resolve/resolv.conf shows no nameservers listed. Downgrading to iwd 1.2-1 restores expected functionality. With iwd 1.2-1, nameservers show up as expected in /run/systemd/resolve/resolv.conf

Additional info:
* package version: 1.3-1
* config (/etc/iwd/main.conf):
-----------------
[General]
EnableNetworkConfiguration=true

[Network]
NameResolvingService=systemd
-----------------
* link to upstream bug report, if any
(not open yet, not sure if the problem is Arch-specific or not

Steps to reproduce:
1. Upgrade to iwd 1.3-1 (latest version)
2. Configure /etc/iwd/main.conf as shown above
3. Restart iwd / reboot computer. Validate dns servers are not showing up in /run/systemd/resolve/resolv.conf
This task depends upon

Closed by  Christian Rebischke (Shibumi)
Sunday, 22 December 2019, 18:14 GMT
Reason for closing:  Fixed
Additional comments about closing:  iwd-1.4-1
Comment by Caleb (alpha64) - Monday, 16 December 2019, 05:50 GMT
Trying to do some debugging on this by myself, I am seeing the iwd 1.3 logs (when run manually in debug mode) showing some new information about interface-specific dns entries that do not appear in iwd 1.2:

1.2 log:
...
[DHCPv4] dhcp_client_rx_message:970 Entering state: DHCP_STATE_BOUND
src/netconfig.c:netconfig_ipv4_dhcp_event_handler() DHCPv4 event 0
src/netconfig.c:netconfig_ifaddr_added() wlan0: ifaddr 192.168.1.234/24 broadcast 192.168.1.255
src/resolve.c:resolve_systemd_add_dns() ifindex: 8
src/resolve.c:systemd_builder_add_dns() installing DNS: 192.168.1.1 2
src/station.c:station_enter_state() Old State: connecting, new state: connected
...

1.3 log:
...
[DHCPv4] dhcp_client_rx_message:988 Entering state: DHCP_STATE_BOUND
src/netconfig.c:netconfig_ipv4_dhcp_event_handler() DHCPv4 event 0
src/netconfig.c:netconfig_ifaddr_added() wlan0: ifaddr 192.168.1.234/24 broadcast 192.168.1.255
src/resolve.c:resolve_systemd_add_dns() ifindex: 9
src/resolve.c:systemd_builder_add_dns() installing DNS: 192.168.1.1 2
src/resolve.c:resolve_systemd_add_domain_name() ifindex: 9
src/station.c:station_enter_state() Old State: connecting, new state: connected
...

Note the line:
src/resolve.c:resolve_systemd_add_domain_name() ifindex: 9

only appears in 1.3, not 1.2. Perhaps this is the cause of the issue?
Comment by Caleb (alpha64) - Monday, 16 December 2019, 05:54 GMT
There are a couple of git commits between iwd v1.2 and v1.3 relating to name resolution:

https://git.kernel.org/pub/scm/network/wireless/iwd.git/commit/?id=fb338154a2b1cd0412072b2e697b8c4af6729106
https://git.kernel.org/pub/scm/network/wireless/iwd.git/commit/?id=930528e35e30c53ac3dea450ce95edee3d9f72dc

Maybe one of these changed (and seems to have broken) things?
Comment by Caleb (alpha64) - Monday, 16 December 2019, 07:05 GMT
I have found that reverting commit 930528e35e30c53ac3dea450ce95edee3d9f72dc (and the removal of dependent call from line 786 in src/netconfig.c) fixes the issue in my testing.

See attached patch (which is simply a revert of said commit, and the removal of the dependent call that was made later).
Comment by Caleb (alpha64) - Monday, 16 December 2019, 08:04 GMT
Note: I have sent an email to the upstream mail list about this as well, including what I have found. I am not sure if this is arch-specific or not, so I am not sure the best path forward. Hopefully, others can look into this as well and figure out if this is specific to something in Arch or not.
Comment by Geoffrey Host (carbonchauvinist) - Monday, 16 December 2019, 21:41 GMT
I've run into this issue as well with 1.3. I'm using iwd + systemd-resolved (using iwd to manage the network, i.e. no systemd-networkd at play here).

From what I can tell it's due to the fact that commit 930528e35 appends domain names as routing-only domains (i.e. prepends with "~"). I have "lan" as the domain value in my router and this is in turn added as "~lan" when viewing the output with resolvectl status. This changes the way systemd-resolved sets the "DefaultRoute" value and causes it to be false instead of true.

Currently I can either manually, and non-permanently, set the DefaultRoute to true on the link in order to get name resolution (i.e.: `# resolvectl default-route wlan0 1`) or I can remove the domain designation from my router/dhcp server.

I wonder if the goal was to add the domains as search-domains instead of routing-only-domains? (https://www.freedesktop.org/software/systemd/man/systemd.network.html#Domains=)

Because I'm not using systemd-networkd I don't know/see a way to override the DefaultRoute value permanently, though I obviously could be missing something. I've added this information to the ML thread as well.
Comment by Caleb (alpha64) - Tuesday, 17 December 2019, 05:04 GMT
The initial upstream patch to fix the issue is attached.
Comment by Caleb (alpha64) - Wednesday, 18 December 2019, 06:01 GMT
This has now been fixed upstream (commit 295e42f87a8faa8accc1a6eb4ef6721ccd177750), and should be included in the 1.4 release.
Comment by Caleb (alpha64) - Friday, 20 December 2019, 05:20 GMT
IWD 1.4 was just released, which fixes this problem.

Loading...