Revision 0cfd0083
Added by Viktor Gurov over 3 years ago
src/etc/inc/system.inc | ||
---|---|---|
1621 | 1621 |
global $ntp_poll_min_default_gps, $ntp_poll_max_default_gps; |
1622 | 1622 |
global $ntp_poll_min_default_pps, $ntp_poll_max_default_pps; |
1623 | 1623 |
global $ntp_poll_min_default, $ntp_poll_max_default; |
1624 |
global $ntp_auth_halgos; |
|
1624 |
global $ntp_auth_halgos, $ntp_server_types;
|
|
1625 | 1625 |
$ntp_poll_min_value = 4; |
1626 | 1626 |
$ntp_poll_max_value = 17; |
1627 | 1627 |
$ntp_poll_min_default_gps = 4; |
... | ... | |
1635 | 1635 |
'sha1' => 'SHA1', |
1636 | 1636 |
'sha256' => 'SHA256' |
1637 | 1637 |
); |
1638 |
$ntp_server_types = array( |
|
1639 |
'server' => 'Server', |
|
1640 |
'pool' => 'Pool', |
|
1641 |
'peer' => 'Peer' |
|
1642 |
); |
|
1638 | 1643 |
|
1639 | 1644 |
function system_ntp_poll_values() { |
1640 | 1645 |
global $ntp_poll_min_value, $ntp_poll_max_value; |
... | ... | |
1996 | 2001 |
$ntpcfg .= 'pool '; |
1997 | 2002 |
$have_pools = true; |
1998 | 2003 |
} else { |
1999 |
$ntpcfg .= 'server '; |
|
2004 |
if (substr_count($config['ntpd']['ispeer'], $ts)) { |
|
2005 |
$ntpcfg .= 'peer '; |
|
2006 |
} else { |
|
2007 |
$ntpcfg .= 'server '; |
|
2008 |
} |
|
2000 | 2009 |
if ($config['ntpd']['dnsresolv'] == 'inet') { |
2001 | 2010 |
$ntpcfg .= '-4 '; |
2002 | 2011 |
} elseif ($config['ntpd']['dnsresolv'] == 'inet6') { |
... | ... | |
2004 | 2013 |
} |
2005 | 2014 |
} |
2006 | 2015 |
|
2007 |
$ntpcfg .= "{$ts} iburst"; |
|
2016 |
$ntpcfg .= "{$ts}"; |
|
2017 |
if (!substr_count($config['ntpd']['ispeer'], $ts)) { |
|
2018 |
$ntpcfg .= " iburst"; |
|
2019 |
} |
|
2008 | 2020 |
|
2009 | 2021 |
$ntpcfg .= system_ntp_fixup_poll_value('minpoll', $config['ntpd']['ntpminpoll'], $ntp_poll_min_default); |
2010 | 2022 |
$ntpcfg .= system_ntp_fixup_poll_value('maxpoll', $config['ntpd']['ntpmaxpoll'], $ntp_poll_max_default); |
Also available in: Unified diff
NTP Peer mode. Implements #11496