-
Notifications
You must be signed in to change notification settings - Fork 292
xapi/nm: Send non-empty dns to networkd when using IPv6 autoconf #6586
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Because Autoconf is not DHCP, networkd uses the dns value to write to resolv.conf. This is done on ocaml/networkd/bin/network_server.ml line 745 This allows to have non-empty resolv.conf when using IPv6 autoconf. Signed-off-by: Pau Ruiz Safont <[email protected]>
Previously both xapi and networkd had to inspect the IP configuration to decide whether the DNS values should be persistend into /etc/resolv.conf. This actually lead to a mismatch in them. Instead use an option value for DNS that simply means that if there's a value, it must be persisted. Now xapi decides the instances where these values are written. Signed-off-by: Pau Ruiz Safont <[email protected]>
Signed-off-by: Pau Ruiz Safont <[email protected]>
Signed-off-by: Pau Ruiz Safont <[email protected]>
Signed-off-by: Pau Ruiz Safont <[email protected]>
From the discussion, especially xcp-ng/xcp#641 (comment) |
Yes, this patch fixes the case where DNS is configured using IPv4 mechanisms, but not written to /etc/resolv.conf because IPv6 is configured in Autoconf mode. I'm working on a design to make configuration of IP and DNS independent from each other under IPv6 mode, but that will take longer to get done. In any case RDNSS needs to be implemented independently |
Rob is in vacation. He will be back in 2 weeks.
Without these DNS server addresses, would the applications not be able to find DNS server to resolve their DNS name? XS doesn't have |
The glibc function This is an independent matter from the new design, the new design is meant to configure the IP addresses (yes, plural) of each PIF independently from its DNS configuration. |
An example for something that doesn't work when DNS is empty, is yum update. |
@@ -158,7 +158,10 @@ type interface_config_t = { | |||
; ipv6_conf: ipv6 [@default None6] | |||
; ipv6_gateway: Unix.inet_addr option [@default None] | |||
; ipv4_routes: ipv4_route_t list [@default []] | |||
; dns: Unix.inet_addr list * string list [@default [], []] | |||
; dns: (Unix.inet_addr list * string list) option [@default None] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we assume that changing to an option type here does not change the expected JSON format? That is, existing dns
fields in networkd.db
(written before applying this patch) will be parsed correctly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will check, interestingly I didn't spot any issue, nor users reported it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I modified the network_db executable to parse a custom networkdb file, on top of this PR, and extracted the networkd.db from a couple hosts to test this. I couldn't find any issue parsing the file:
$ dune exec ocaml/networkd/bin_db/networkd_db.exe -- -db networkd.old_dhcp.db -bridge xenbr1 -iface xenbr1
interfaces=eth1
mode=dhcp
$ dune exec ocaml/networkd/bin_db/networkd_db.exe -- -db networkd.old_static.db -bridge xenbr0 -iface xenbr0
interfaces=eth0
mode=static
ipaddr=192.168.178.14
netmask=255.255.255.0
gateway=192.168.178.1
dns=192.168.178.64
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, thanks for checking!
…onf (xapi-project#6586)" This reverts commit 05e6317, reversing changes made to 1fbdaae.
Because Autoconf is not DHCP, networkd uses the dns value to write to
resolv.conf. This is done on ocaml/networkd/bin/network_server.ml line 745
This allows to have non-empty resolv.conf when using IPv6 autoconf.
This mismatch was caused byt technical debt that cause this check to be duplicated, the second removes it so
xapi decides the instances where these values are written and networkd follows that decision.
I've tested new isntallations using IPv4 and couldn't see any regression, two users have tested the patch and now the DNS entries don't get overriden when using IPv6 in Autoconf mode: xcp-ng/xcp#641 (comment)
I'd like Rob to review this approach in any case