]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
[Bug 2060] Warn about restrictions with "kod" but not "limited"
authorHarlan Stenn <stenn@ntp.org>
Wed, 1 Jan 2014 08:25:27 +0000 (08:25 +0000)
committerHarlan Stenn <stenn@ntp.org>
Wed, 1 Jan 2014 08:25:27 +0000 (08:25 +0000)
bk: 52c3d0f7pfLO_MZ1D8BLDW0VTj0sfQ

ntpd/ntp_config.c

index 3917254dff68f1d3cb320dd3c33695e7828c6f8e..4ac3aa3844d2cfd0a4bbf1bfbe967cb35d0e942a 100644 (file)
@@ -2457,10 +2457,15 @@ config_access(
 
                /* It would be swell if we could identify the line number */
                if ((RES_KOD & flags) && !(RES_LIMITED & flags)) {
+                       char *kod_where = (my_node->addr)
+                                         ? my_node->addr->address
+                                         : (mflags & RESM_SOURCE)
+                                           ? "source"
+                                           : "default";
                        char *kod_warn = "KOD does nothing without LIMITED.";
 
-                       fprintf(stderr, "%s\n", kod_warn);
-                       msyslog(LOG_WARNING, "%s", kod_warn);
+                       fprintf(stderr, "restrict %s: %s\n", kod_where, kod_warn);
+                       msyslog(LOG_WARNING, "restrict %s: %s", kod_where, kod_warn);
                }
 
                ZERO_SOCK(&addr);