]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
[Bug 1047] enable/disable options processing fix
authorHarlan Stenn <stenn@ntp.org>
Tue, 5 Aug 2008 09:00:05 +0000 (05:00 -0400)
committerHarlan Stenn <stenn@ntp.org>
Tue, 5 Aug 2008 09:00:05 +0000 (05:00 -0400)
bk: 48981695ni_v01zT6uucG5DrsmOb6Q

ChangeLog
ntpd/ntp_config.c

index a3d9158d262face813b51fec4aa8a81a9a1254be..3b169886f758bca3394fb8804d51149b3ad431e4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,4 @@
+* [Bug 1047] enable/disable options processing fix.
 * header file cleanup.
 * [Bug 1037] buffer in subroutine was 1 byte short.
 * configure.ac: cleanup, add option for wintime, and lay the groundwork
index adae53b3ced49b386959eb80a1a51b6e76692b4d..80ba65eb280bd9b4d4448c8d25f95d24cb905402 100644 (file)
@@ -198,7 +198,7 @@ extern unsigned int qos;                            /* QoS setting */
 
 /* FUNCTION PROTOTYPES */
 
-static int get_flags_from_list(queue *flag_list);
+static void call_proto_config_from_list(queue *flag_list, int able_flag);
 static void init_auth_node(void);
 static void init_syntax_tree(void);
 double *create_dval(double val);
@@ -249,20 +249,23 @@ static void do_resolve_internal(void);
  * ----------------------------
  */
 
-static int
-get_flags_from_list(
-       queue *flag_list
+static void
+call_proto_config_from_list(
+       queue *flag_list,
+       int able
        )
 {
-       int flags = 0;
+       int flag;
        struct attr_val *curr_flag;
 
        while (!empty(flag_list)) {
                curr_flag = (struct attr_val *) dequeue(flag_list);
-               flags |= curr_flag->value.i;
+               flag = curr_flag->value.i;
+               if (flag)
+                       proto_config(flag, able, 0., NULL);
                free_node(curr_flag);
        }
-       return flags;
+       return;
 }
 
 static void
@@ -1290,16 +1293,10 @@ config_tinker(void)
 static void
 config_system_opts(void)
 {
-       int enable_flags;
-       int disable_flags;
 
-       enable_flags = get_flags_from_list(my_config.enable_opts);
-       disable_flags = get_flags_from_list(my_config.disable_opts);
+       call_proto_config_from_list(my_config.enable_opts, 1);
+       call_proto_config_from_list(my_config.disable_opts, 0);
 
-       if (enable_flags)
-               proto_config(enable_flags, 1, 0., NULL);
-       if (disable_flags)
-               proto_config(disable_flags, 0, 0., NULL);
 }
 
 static void