]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
[Bug 3465] Default TTL values cannot be used
authorJuergen Perlinger <perlinger@ntp.org>
Thu, 8 Mar 2018 17:59:17 +0000 (18:59 +0100)
committerJuergen Perlinger <perlinger@ntp.org>
Thu, 8 Mar 2018 17:59:17 +0000 (18:59 +0100)
bk: 5aa179f5ZIGNuyDJlV9Owc3VdbLRVw

ChangeLog
ntpd/ntp_config.c

index dcfa59c07f3fb687e22c57016ce0cd382df674e5..ef21e3e9dce0db7f441393e6019dc85e8c7cb4af 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,6 @@
+---
+* [Bug 3465] Default TTL values cannot be used <perlinger@ntp.org>
+
 ---
 (4.2.8p11) 2018/02/27 Released by Harlan Stenn <stenn@ntp.org>
 
index 003b1534a9c42634d046f7c710757e4fc9111a57..895c53523d07c6afaef0f18ce21b0ce00eded27d 100644 (file)
@@ -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 */