From: Harlan Stenn Date: Tue, 5 Aug 2008 09:00:05 +0000 (-0400) Subject: [Bug 1047] enable/disable options processing fix X-Git-Tag: NTP_4_2_5P122~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1aaf54890c6a8a924d18aa72b4e261ea9440f392;p=thirdparty%2Fntp.git [Bug 1047] enable/disable options processing fix bk: 48981695ni_v01zT6uucG5DrsmOb6Q --- diff --git a/ChangeLog b/ChangeLog index a3d9158d2..3b169886f 100644 --- 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 diff --git a/ntpd/ntp_config.c b/ntpd/ntp_config.c index adae53b3c..80ba65eb2 100644 --- a/ntpd/ntp_config.c +++ b/ntpd/ntp_config.c @@ -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