> The following patch fixes the problem by *not* replacing ntp servers with an address beginning with "127."
No, it doesn't. It masks the problem by removing only servers with a name or address that starts with something other than a '1', followed by something other than a '2', followed by something other than a '7', followed by a dot. For example, with your patch, the following entries are no longer removed:
server 0.ubuntu.pool.ntp.org
server 1.ubuntu.pool.ntp.org
server 2.ubuntu.pool.ntp.org
server 3.ubuntu.pool.ntp.org
server 127.1.2.3
server clock-1.cs.cmu.edu
... but this is:
server ntp.ubuntu.com
Unfortunately, this means that several of the server entries in the default /etc/ntp.conf are no longer removed. As a result, an unmodified machine booting on a network where DHCP provides a list of local NTP servers gets the local servers plus four from pool.ntp.org.
A better answer here would be to find a proper solution to #374896, such that locally-added entries can be retained when desired (and only then!), and use that for refclock entries (127.*) as well.
> The following patch fixes the problem by *not* replacing ntp servers with an address beginning with "127."
No, it doesn't. It masks the problem by removing only servers with a name or address that starts with something other than a '1', followed by something other than a '2', followed by something other than a '7', followed by a dot. For example, with your patch, the following entries are no longer removed:
server 0.ubuntu. pool.ntp. org pool.ntp. org pool.ntp. org pool.ntp. org
server 1.ubuntu.
server 2.ubuntu.
server 3.ubuntu.
server 127.1.2.3
server clock-1.cs.cmu.edu
... but this is:
server ntp.ubuntu.com
Unfortunately, this means that several of the server entries in the default /etc/ntp.conf are no longer removed. As a result, an unmodified machine booting on a network where DHCP provides a list of local NTP servers gets the local servers plus four from pool.ntp.org.
A better answer here would be to find a proper solution to #374896, such that locally-added entries can be retained when desired (and only then!), and use that for refclock entries (127.*) as well.