[PATCH] Fix crash while parsing ntp servers from DHCP6 (#969303)
Martin Kolman
mkolman at redhat.com
Wed Jul 24 13:24:25 UTC 2013
On Tue, 2013-07-23 at 16:29 -0400, David Shea wrote:
> This removes anaconda's attempt to collect NTP servers through
> NetworkManager's DHCP6 options. The reasons for this are as follows:
>
> - NetworkManager does not currently request NTP or SNTP options. When
> using a DHCP6 that honors OPTION_ORO (e.g., ISC dhcpd6), no time
> servers will be returned
> - dhclient does not support the NTP server option (dhcp6 option 56,
> RFC 5908). If a server does return an OPTION_NTP_SERVER block, it
> will not be parsed and NetworkManager will only be aware of the
> presence of an unknown option 56.
>
> It is possible to use the OPTION_SNTP_SERVER data, which is formated in
> the same way the IPv4 DHCP NTP server option data. To use this we would
> need to create /etc/NetworkManager/dhclient6.conf containing "also
> request dhcp6.sntp-servers" and fix the option parsing code in nm.py to
> pull the right value out of the Dhcp6Config.Options dictionary. However,
> it's probably not worth it, since obviously no one was using DHCP6
> options at all, because it would have crashed.
OK, thanks for the information - I guess we can just remove the code
for now and add another implementation once someone might be actually
using it on IPv6 to get NTP servers from DHCP. :)
> ---
> pyanaconda/nm.py | 10 +---------
> 1 file changed, 1 insertion(+), 9 deletions(-)
>
> diff --git a/pyanaconda/nm.py b/pyanaconda/nm.py
> index 0932a2e..56c59d4 100644
> --- a/pyanaconda/nm.py
> +++ b/pyanaconda/nm.py
> @@ -284,15 +284,7 @@ def nm_ntp_servers_from_dhcp():
> for ip in ntp_servers_string.split(" "):
> ntp_servers.append(ip)
>
> - # harvest NTP servers from DHCPv6
> - dhcp6_path = nm_device_property(device, "Dhcp6Config")
> - dhcp6_proxy = _get_proxy(object_path=dhcp6_path,
> - interface_name="org.freedesktop.NetworkManager.DHCP6Config")
> - options = dhcp6_proxy.get_cached_property("Options")
> - if options is not None:
> - # NTP server addresses returned by DHCP are whitespace delimited
> - for ip in options.unpack().split(" "):
> - ntp_servers.append(ip)
> + # NetworkManager does not request NTP/SNTP options for DHCP6
> return ntp_servers
>
> def _device_settings(name):
The patch looks good to me, thanks!
More information about the anaconda-patches
mailing list