From: Dave Hart Date: Sat, 4 Dec 2010 08:15:35 +0000 (+0000) Subject: [Bug 1736] tos int, bool options broken in 4.2.7p66. X-Git-Tag: NTP_4_2_7P89~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6cd48dae59d2f2b4278ea0e76e309248791b399d;p=thirdparty%2Fntp.git [Bug 1736] tos int, bool options broken in 4.2.7p66. bk: 4cf9f8a7P-fwanUdIyXBVXtEERxoVA --- diff --git a/ChangeLog b/ChangeLog index fa1fb8e0c..f61bcae78 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,5 @@ -* [Bug 1735] 'clocktime()' aborts ntpd on bogus input +* [Bug 1735] clocktime() aborts ntpd on bogus input. +* [Bug 1736] tos int, bool options broken in 4.2.7p66. (4.2.7p87) 2010/12/01 Released by Harlan Stenn * from 4.2.6p3-RC12: Clean up m4 quoting in configure.ac, *.m4 files, resolving intermittent AC_LANG_PROGRAM possibly undefined errors. diff --git a/clockstuff/Makefile.am b/clockstuff/Makefile.am index 6b244beb7..b97a3641e 100644 --- a/clockstuff/Makefile.am +++ b/clockstuff/Makefile.am @@ -2,7 +2,8 @@ AUTOMAKE_OPTIONS = noinst_PROGRAMS = @PROPDELAY@ @CHUTEST@ @CLKTEST@ EXTRA_PROGRAMS = propdelay chutest clktest -BUILT_SOURCES = $(srcdir)/clktest-opts.c $(srcdir)/clktest-opts.h +BUILT_SOURCES = clktest-opts.c clktest-opts.h +EXTRA_DIST = clktest-opts.def clktest_SOURCES = clktest.c clktest-opts.c diff --git a/ntpd/ntp_config.c b/ntpd/ntp_config.c index 9e3dd9da9..daa226810 100644 --- a/ntpd/ntp_config.c +++ b/ntpd/ntp_config.c @@ -675,16 +675,11 @@ dump_config_tree( #ifdef DEBUG default: fprintf(df, "\n# dump error:\n" - "# unknown tos attr type %d\n" - "tos", atrv->type); + "# unknown tos attr type %d %s\n" + "tos", atrv->type, + token_name(atrv->type)); break; #endif - case T_Integer: - fprintf(df, " %s %d", - keyword(atrv->attr), - atrv->value.i); - break; - case T_Double: fprintf(df, " %s %s", keyword(atrv->attr), diff --git a/ntpd/ntp_parser.c b/ntpd/ntp_parser.c index bbccf6a41..882b83b47 100644 --- a/ntpd/ntp_parser.c +++ b/ntpd/ntp_parser.c @@ -2479,7 +2479,7 @@ yyreduce: /* Line 1464 of yacc.c */ #line 593 "ntp_parser.y" - { (yyval.Attr_val) = create_attr_ival((yyvsp[(1) - (2)].Integer), (yyvsp[(2) - (2)].Integer)); } + { (yyval.Attr_val) = create_attr_dval((yyvsp[(1) - (2)].Integer), (double)(yyvsp[(2) - (2)].Integer)); } break; case 81: @@ -2493,7 +2493,7 @@ yyreduce: /* Line 1464 of yacc.c */ #line 597 "ntp_parser.y" - { (yyval.Attr_val) = create_attr_ival((yyvsp[(1) - (2)].Integer), (yyvsp[(2) - (2)].Integer)); } + { (yyval.Attr_val) = create_attr_dval((yyvsp[(1) - (2)].Integer), (double)(yyvsp[(2) - (2)].Integer)); } break; case 93: diff --git a/ntpd/ntp_parser.y b/ntpd/ntp_parser.y index 4338f6be1..9cd2800d1 100644 --- a/ntpd/ntp_parser.y +++ b/ntpd/ntp_parser.y @@ -590,11 +590,11 @@ tos_option_list tos_option : tos_option_int_keyword T_Integer - { $$ = create_attr_ival($1, $2); } + { $$ = create_attr_dval($1, (double)$2); } | tos_option_dbl_keyword number { $$ = create_attr_dval($1, $2); } | T_Cohort boolean - { $$ = create_attr_ival($1, $2); } + { $$ = create_attr_dval($1, (double)$2); } ; tos_option_int_keyword