From: Juergen Perlinger Date: Thu, 8 Mar 2018 17:59:17 +0000 (+0100) Subject: [Bug 3465] Default TTL values cannot be used X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=05d79bbaa5a9ebccb686fc1b372f2bf1cb85e03c;p=thirdparty%2Fntp.git [Bug 3465] Default TTL values cannot be used bk: 5aa179f5ZIGNuyDJlV9Owc3VdbLRVw --- diff --git a/ChangeLog b/ChangeLog index dcfa59c07..ef21e3e9d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +--- +* [Bug 3465] Default TTL values cannot be used + --- (4.2.8p11) 2018/02/27 Released by Harlan Stenn diff --git a/ntpd/ntp_config.c b/ntpd/ntp_config.c index 003b1534a..895c53523 100644 --- a/ntpd/ntp_config.c +++ b/ntpd/ntp_config.c @@ -3383,6 +3383,10 @@ config_ttl( size_t i = 0; int_node *curr_ttl; + /* [Bug 3465] There is a built-in default for the TTLs. We must + * overwrite 'sys_ttlmax' if we change that preset, and leave it + * alone otherwise! + */ curr_ttl = HEAD_PFIFO(ptree->ttl); for (; curr_ttl != NULL; curr_ttl = curr_ttl->link) { if (i < COUNTOF(sys_ttl)) @@ -3392,7 +3396,8 @@ config_ttl( "ttl: Number of TTL entries exceeds %zu. Ignoring TTL %d...", COUNTOF(sys_ttl), curr_ttl->i); } - sys_ttlmax = (i) ? (i - 1) : 0; + if (0 != i) /* anything written back at all? */ + sys_ttlmax = i - 1; } #endif /* !SIM */