[systemd-devel] [PATCH] network: add UseNTP DHCP option

Michael Marineau michael.marineau at coreos.com
Fri Mar 13 12:01:29 PDT 2015


Despite having the internal logic in place to enable/disable using NTP
servers provided by DHCP the network config didn't expose the option.
---
 man/systemd.network.xml                  | 8 ++++++++
 src/network/networkd-network-gperf.gperf | 1 +
 2 files changed, 9 insertions(+)

diff --git a/man/systemd.network.xml b/man/systemd.network.xml
index 5d7518b..95be132 100644
--- a/man/systemd.network.xml
+++ b/man/systemd.network.xml
@@ -515,6 +515,14 @@
           </listitem>
         </varlistentry>
         <varlistentry>
+          <term><varname>UseNTP=</varname></term>
+          <listitem>
+            <para>When true (the default), the NTP servers received
+            from the DHCP server will be used by systemd-timesyncd
+            and take precedence over any statically configured ones.</para>
+          </listitem>
+        </varlistentry>
+        <varlistentry>
           <term><varname>UseMTU=</varname></term>
           <listitem>
             <para>When true, the interface maximum transmission unit
diff --git a/src/network/networkd-network-gperf.gperf b/src/network/networkd-network-gperf.gperf
index 93df83a..8abf5bc 100644
--- a/src/network/networkd-network-gperf.gperf
+++ b/src/network/networkd-network-gperf.gperf
@@ -60,6 +60,7 @@ Route.Metric,                config_parse_route_priority,        0,
 Route.Scope,                 config_parse_route_scope,           0,                             0
 DHCP.ClientIdentifier,       config_parse_dhcp_client_identifier,0,                             offsetof(Network, dhcp_client_identifier)
 DHCP.UseDNS,                 config_parse_bool,                  0,                             offsetof(Network, dhcp_dns)
+DHCP.UseNTP,                 config_parse_bool,                  0,                             offsetof(Network, dhcp_ntp)
 DHCP.UseMTU,                 config_parse_bool,                  0,                             offsetof(Network, dhcp_mtu)
 DHCP.UseHostname,            config_parse_bool,                  0,                             offsetof(Network, dhcp_hostname)
 DHCP.UseDomains,             config_parse_bool,                  0,                             offsetof(Network, dhcp_domains)
-- 
2.0.5



More information about the systemd-devel mailing list