Skip to content

Commit ba3b3ac

Browse files
authored
Don't use dhcp4 for none mode (#6001)
For the context, we had an strange behavior where an host installed with IPv6 stack only got an Ipv4 address only during the first boot due to the start of a systemd service called chrony-wait. This is because during the first boot the **xcp-networkd** looks for a configuration from `/etc/firstboot.d/data/management.conf` and if the `MODE=none` it uses DHCP4. And as chrony-wait is started it got a source in IPv4 before XAPI had time to reconfigure it using IPv6 stack. So we think that if the MODE is none we shouldn't use DHCP4. Regards, Guillaume
2 parents 9ff72f1 + d0215ed commit ba3b3ac

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

ocaml/networkd/lib/network_config.ml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,12 @@ let read_management_conf () =
135135
in
136136
let dns = (nameservers, domains) in
137137
(Static4 [(ip, prefixlen)], gateway, dns)
138-
| "dhcp" | _ ->
138+
| "dhcp" ->
139139
(DHCP4, None, ([], []))
140+
| _ ->
141+
(None4, None, ([], []))
140142
in
143+
141144
let phy_interface = {default_interface with persistent_i= true} in
142145
let bridge_interface =
143146
{default_interface with ipv4_conf; ipv4_gateway; persistent_i= true; dns}

0 commit comments

Comments
 (0)