From: Poul-Henning Kamp Date: Sat, 9 Aug 2014 20:32:45 +0000 (+0000) Subject: ntp.h, ntp_proto.c: X-Git-Tag: NTP_4_2_7P459~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=012b7623a08a554f8443641e744e6479aa4a6e48;p=thirdparty%2Fntp.git ntp.h, ntp_proto.c: Don't do arithmetic on NULL pointer when we have a real pointer to use ntp_parser.y, ntp_config.c: A set of no-op pedantic changes inspired by FlexeLints complaints, while looking for ways to make the simulator work again: Add prototype for yyparser() until bison joins the century of the fruit-bat. Make some functions static. Spell NTP_INSIST() INSIST() Deal with "SIM-only" stuff in ntp_parser.y rather than later. Mark knowingly unused arguments Signed/Unsigned/Long fixes to constants. Const char* argument to fprintf(3). ntp_assert.h: Use systems assert(3) for FlexeLint analysis bk: 53e6856d1mpn7gIDx_lh20Go3k6uwA --- diff --git a/include/ntp.h b/include/ntp.h index 60adc4f34..38343f23a 100644 --- a/include/ntp.h +++ b/include/ntp.h @@ -463,8 +463,7 @@ struct peer { */ #define CLEAR_TO_ZERO(p) ((char *)&((p)->clear_to_zero)) #define END_CLEAR_TO_ZERO(p) ((char *)&((p)->end_clear_to_zero)) -#define LEN_CLEAR_TO_ZERO (END_CLEAR_TO_ZERO((struct peer *)0) \ - - CLEAR_TO_ZERO((struct peer *)0)) +#define LEN_CLEAR_TO_ZERO(p) (END_CLEAR_TO_ZERO(p) - CLEAR_TO_ZERO(p)) #define CRYPTO_TO_ZERO(p) ((char *)&((p)->clear_to_zero)) #define END_CRYPTO_TO_ZERO(p) ((char *)&((p)->end_clear_to_zero)) #define LEN_CRYPTO_TO_ZERO (END_CRYPTO_TO_ZERO((struct peer *)0) \ diff --git a/include/ntp_assert.h b/include/ntp_assert.h index 206d50d26..2f3bbc8a0 100644 --- a/include/ntp_assert.h +++ b/include/ntp_assert.h @@ -28,6 +28,7 @@ #define NTP_ASSERT_H # ifdef CALYSTO +/* see: http://www.domagoj-babic.com/index.php/ResearchProjects/Calysto */ extern void calysto_assume(unsigned char cnd); /* assume this always holds */ extern void calysto_assert(unsigned char cnd); /* check whether this holds */ @@ -57,7 +58,17 @@ extern void calysto_assert(unsigned char cnd); /* check whether this holds */ #define ALWAYS_ENSURE(x) assert(x) */ -# else /* neither Coverity nor Calysto */ + +#elif defined(__FLEXELINT__) + +#include + +#define ALWAYS_REQUIRE(x) assert(x) +#define ALWAYS_INSIST(x) assert(x) +#define ALWAYS_INVARIANT(x) assert(x) +#define ALWAYS_ENSURE(x) assert(x) + +# else /* neither Calysto, Coverity or FlexeLint */ #include "isc/assertions.h" diff --git a/ntpd/ntp_config.c b/ntpd/ntp_config.c index 116a22f69..0f48983f8 100644 --- a/ntpd/ntp_config.c +++ b/ntpd/ntp_config.c @@ -54,6 +54,9 @@ #include "ntpd-opts.h" +/* Bison still(!) does not emit usable prototypes for the calling code */ +int yyparse (struct FILE_INFO *ip_file); + /* list of servers from command line for config_peers() */ int cmdline_server_count; char ** cmdline_servers; @@ -143,7 +146,7 @@ int config_priority; #endif const char *config_file; -char default_ntp_signd_socket[] = +static char default_ntp_signd_socket[] = #ifdef NTP_SIGND_PATH NTP_SIGND_PATH; #else @@ -188,7 +191,6 @@ int old_config_style = 1; /* A boolean flag, which when set, */ int cryptosw; /* crypto command called */ -extern int sys_maxclock; extern char *stats_drift_file; /* name of the driftfile */ #ifdef BC_LIST_FRAMEWORK_NOT_YET_USED @@ -216,6 +218,7 @@ static void apply_enable_disable(attr_val_fifo *q, int enable); #ifdef FREE_CFG_T static void free_auth_node(config_tree *); +static void free_all_config_trees(void); static void free_config_access(config_tree *); static void free_config_auth(config_tree *); @@ -327,13 +330,13 @@ static int peerflag_bits(peer_node *); #endif /* !SIM */ #ifdef WORKER -void peer_name_resolved(int, int, void *, const char *, const char *, +static void peer_name_resolved(int, int, void *, const char *, const char *, const struct addrinfo *, const struct addrinfo *); -void unpeer_name_resolved(int, int, void *, const char *, const char *, +static void unpeer_name_resolved(int, int, void *, const char *, const char *, const struct addrinfo *, const struct addrinfo *); -void trap_name_resolved(int, int, void *, const char *, const char *, +static void trap_name_resolved(int, int, void *, const char *, const char *, const struct addrinfo *, const struct addrinfo *); #endif @@ -344,7 +347,7 @@ enum gnn_type { t_MSK /* Network Mask */ }; -void ntpd_set_tod_using(const char *); +static void ntpd_set_tod_using(const char *); static char * normal_dtoa(double); static u_int32 get_pfxmatch(const char **, struct masks *); static u_int32 get_match(const char *, struct masks *); @@ -393,7 +396,7 @@ init_syntax_tree( #ifdef FREE_CFG_T -void +static void free_all_config_trees(void) { config_tree *ptree; @@ -666,7 +669,7 @@ dump_config_tree( ? HEAD_PFIFO(ptree->enable_opts) : HEAD_PFIFO(ptree->disable_opts); if (atrv != NULL) { - fprintf(df, (enable) + fprintf(df, "%s", (enable) ? "enable" : "disable"); for ( ; atrv != NULL; atrv = atrv->link) @@ -703,7 +706,7 @@ dump_config_tree( if (atrv != NULL) { fprintf(df, "rlimit"); for ( ; atrv != NULL; atrv = atrv->link) { - NTP_INSIST(T_Integer == atrv->type); + INSIST(T_Integer == atrv->type); fprintf(df, " %s %d", keyword(atrv->attr), atrv->value.i); } @@ -714,7 +717,7 @@ dump_config_tree( if (atrv != NULL) { fprintf(df, "tinker"); for ( ; atrv != NULL; atrv = atrv->link) { - NTP_INSIST(T_Double == atrv->type); + INSIST(T_Double == atrv->type); fprintf(df, " %s %s", keyword(atrv->attr), normal_dtoa(atrv->value.d)); } @@ -775,8 +778,8 @@ dump_config_tree( atrv = HEAD_PFIFO(peern->peerflags); for ( ; atrv != NULL; atrv = atrv->link) { - NTP_INSIST(T_Flag == atrv->attr); - NTP_INSIST(T_Integer == atrv->type); + INSIST(T_Flag == atrv->attr); + INSIST(T_Integer == atrv->type); fprintf(df, " %s", keyword(atrv->value.i)); } @@ -1596,15 +1599,13 @@ create_addr_opts_node( } +#ifdef SIM script_info * create_sim_script_info( double duration, attr_val_fifo * script_queue ) { -#ifndef SIM - return NULL; -#else /* SIM follows */ script_info *my_info; attr_val *my_attr_val; @@ -1651,8 +1652,8 @@ create_sim_script_info( } return my_info; -#endif /* SIM */ } +#endif /* SIM */ #ifdef SIM @@ -1695,6 +1696,7 @@ get_next_address( #endif /* SIM */ +#ifdef SIM server_info * create_sim_server( address_node * addr, @@ -1702,9 +1704,6 @@ create_sim_server( script_info_fifo * script ) { -#ifndef SIM - return NULL; -#else /* SIM follows */ server_info *my_info; my_info = emalloc_zero(sizeof(*my_info)); @@ -1714,8 +1713,8 @@ create_sim_server( UNLINK_FIFO(my_info->curr_script, *my_info->script, link); return my_info; -#endif /* SIM */ } +#endif /* SIM */ sim_node * create_sim_node( @@ -1838,7 +1837,7 @@ config_auth( switch (my_val->attr) { default: - NTP_INSIST(0); + INSIST(0); break; case T_Host: @@ -1956,7 +1955,7 @@ config_auth( #ifdef AUTOKEY /* crypto revoke command */ if (ptree->auth.revoke) - sys_revoke = 1 << ptree->auth.revoke; + sys_revoke = 1UL << ptree->auth.revoke; #endif /* AUTOKEY */ } #endif /* !SIM */ @@ -1992,7 +1991,7 @@ config_tos( switch(tos->attr) { default: - NTP_INSIST(0); + INSIST(0); break; case T_Ceiling: @@ -2144,7 +2143,7 @@ config_monitor( switch (my_opts->value.i) { default: - NTP_INSIST(0); + INSIST(0); break; case T_None: @@ -2278,7 +2277,7 @@ config_access( case T_Incmem: if (0 <= my_opt->value.i) - mru_incalloc = (my_opt->value.u * 1024) + mru_incalloc = (my_opt->value.u * 1024U) / sizeof(mon_entry); else range_err = TRUE; @@ -2293,7 +2292,7 @@ config_access( case T_Initmem: if (0 <= my_opt->value.i) - mru_initalloc = (my_opt->value.u * 1024) + mru_initalloc = (my_opt->value.u * 1024U) / sizeof(mon_entry); else range_err = TRUE; @@ -2319,7 +2318,7 @@ config_access( case T_Maxmem: if (0 <= my_opt->value.i) - mru_maxdepth = my_opt->value.u * 1024 / + mru_maxdepth = (my_opt->value.u * 1024U) / sizeof(mon_entry); else mru_maxdepth = UINT_MAX; @@ -2381,7 +2380,7 @@ config_access( switch (curr_flag->i) { default: - NTP_INSIST(0); + INSIST(0); break; case T_Ntpport: @@ -2525,14 +2524,14 @@ config_access( my_node->addr->address); continue; } - NTP_INSIST(ai_list != NULL); + INSIST(ai_list != NULL); pai = ai_list; - NTP_INSIST(pai->ai_addr != NULL); - NTP_INSIST(sizeof(addr) >= + INSIST(pai->ai_addr != NULL); + INSIST(sizeof(addr) >= pai->ai_addrlen); memcpy(&addr, pai->ai_addr, pai->ai_addrlen); - NTP_INSIST(AF_INET == AF(&addr) || + INSIST(AF_INET == AF(&addr) || AF_INET6 == AF(&addr)); } @@ -2568,13 +2567,13 @@ config_access( &mask, mflags, flags, 0); if (pai != NULL && NULL != (pai = pai->ai_next)) { - NTP_INSIST(pai->ai_addr != NULL); - NTP_INSIST(sizeof(addr) >= + INSIST(pai->ai_addr != NULL); + INSIST(sizeof(addr) >= pai->ai_addrlen); ZERO_SOCK(&addr); memcpy(&addr, pai->ai_addr, pai->ai_addrlen); - NTP_INSIST(AF_INET == AF(&addr) || + INSIST(AF_INET == AF(&addr) || AF_INET6 == AF(&addr)); SET_HOSTMASK(&mask, AF(&addr)); } @@ -2606,15 +2605,13 @@ config_rlimit( ) { attr_val * rlimit_av; - int item; - item = -1; /* quiet warning */ rlimit_av = HEAD_PFIFO(ptree->rlimit); for (; rlimit_av != NULL; rlimit_av = rlimit_av->link) { switch (rlimit_av->attr) { default: - NTP_INSIST(0); + INSIST(0); break; case T_Memlock: @@ -2676,7 +2673,7 @@ config_tinker( switch (tinker->attr) { default: - NTP_INSIST(0); + INSIST(0); break; case T_Allan: @@ -2739,7 +2736,7 @@ free_config_tinker( * config_nic_rules - apply interface listen/ignore/drop items */ #ifndef SIM -void +static void config_nic_rules( config_tree *ptree ) @@ -3011,6 +3008,9 @@ config_logconfig( case '=': ntp_syslogmask = get_logmask(my_lc->value.s); break; + default: + INSIST(0); + break; } } } @@ -3270,7 +3270,7 @@ config_trap( * Callback invoked when config_trap()'s DNS lookup completes. */ # ifdef WORKER -void +static void trap_name_resolved( int rescode, int gai_errno, @@ -3285,6 +3285,9 @@ trap_name_resolved( struct interface *localaddr; sockaddr_u peeraddr; + (void)gai_errno; + (void)service; + (void)hints; pstp = context; if (rescode) { msyslog(LOG_ERR, @@ -3293,7 +3296,7 @@ trap_name_resolved( free(pstp); return; } - NTP_INSIST(sizeof(peeraddr) >= res->ai_addrlen); + INSIST(sizeof(peeraddr) >= res->ai_addrlen); ZERO(peeraddr); memcpy(&peeraddr, res->ai_addr, res->ai_addrlen); localaddr = NULL; @@ -3635,7 +3638,7 @@ peerflag_bits( switch (option->value.i) { default: - NTP_INSIST(0); + INSIST(0); break; case T_Autokey: @@ -3750,7 +3753,7 @@ config_peers( ZERO_SOCK(&peeraddr); /* Find the correct host-mode */ hmode = get_correct_host_mode(curr_peer->host_mode); - NTP_INSIST(hmode != 0); + INSIST(hmode != 0); if (T_Pool == curr_peer->host_mode) { AF(&peeraddr) = curr_peer->addr->type; @@ -3829,7 +3832,7 @@ config_peers( * Callback invoked when config_peers()'s DNS lookup completes. */ #ifdef WORKER -void +static void peer_name_resolved( int rescode, int gai_errno, @@ -3845,6 +3848,9 @@ peer_name_resolved( u_short af; const char * fam_spec; + (void)gai_errno; + (void)service; + (void)hints; ctx = context; DPRINTF(1, ("peer_name_resolved(%s) rescode %d\n", name, rescode)); @@ -4010,7 +4016,7 @@ config_unpeers( * Callback invoked when config_unpeers()'s DNS lookup completes. */ #ifdef WORKER -void +static void unpeer_name_resolved( int rescode, int gai_errno, @@ -4026,6 +4032,8 @@ unpeer_name_resolved( u_short af; const char * fam_spec; + (void)context; + (void)hints; DPRINTF(1, ("unpeer_name_resolved(%s) rescode %d\n", name, rescode)); if (rescode) { @@ -4037,7 +4045,7 @@ unpeer_name_resolved( * Loop through the addresses found */ for (; res != NULL; res = res->ai_next) { - NTP_INSIST(res->ai_addrlen <= sizeof(peeraddr)); + INSIST(res->ai_addrlen <= sizeof(peeraddr)); memcpy(&peeraddr, res->ai_addr, res->ai_addrlen); DPRINTF(1, ("unpeer: searching for peer %s\n", stoa(&peeraddr))); @@ -4320,7 +4328,8 @@ config_ntpdsim( config_tos(ptree); config_monitor(ptree); config_tinker(ptree); - /* config_rlimit(ptree); *//* not needed for the simulator */ + if (0) + config_rlimit(ptree); /* not needed for the simulator */ config_system_opts(ptree); config_logconfig(ptree); config_vars(ptree); @@ -4533,13 +4542,13 @@ save_and_apply_config_tree(void) #ifndef SAVECONFIG UNLINK_SLIST(punlinked, cfg_tree_history, ptree, link, config_tree); - NTP_INSIST(punlinked == ptree); + INSIST(punlinked == ptree); free_config_tree(ptree); #endif } -void +static void ntpd_set_tod_using( const char *which ) diff --git a/ntpd/ntp_parser.c b/ntpd/ntp_parser.c index 163e90c52..c14a5158b 100644 --- a/ntpd/ntp_parser.c +++ b/ntpd/ntp_parser.c @@ -94,9 +94,15 @@ #define YYMAXDEPTH 1000 /* stop the madness sooner */ void yyerror(struct FILE_INFO *ip_file, const char *msg); + #ifdef SIM + # define ONLY_SIM(a) (a) + #else + # define ONLY_SIM(a) NULL + #endif + /* Line 268 of yacc.c */ -#line 100 "ntp_parser.c" +#line 106 "ntp_parser.c" /* Enabling traces. */ #ifndef YYDEBUG @@ -507,7 +513,7 @@ typedef union YYSTYPE { /* Line 293 of yacc.c */ -#line 48 "ntp_parser.y" +#line 54 "ntp_parser.y" char * String; double Double; @@ -529,7 +535,7 @@ typedef union YYSTYPE /* Line 293 of yacc.c */ -#line 533 "ntp_parser.c" +#line 539 "ntp_parser.c" } YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ @@ -541,7 +547,7 @@ typedef union YYSTYPE /* Line 343 of yacc.c */ -#line 545 "ntp_parser.c" +#line 551 "ntp_parser.c" #ifdef short # undef short @@ -949,37 +955,37 @@ static const yytype_int16 yyrhs[] = /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { - 0, 357, 357, 361, 362, 363, 377, 378, 379, 380, - 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, - 398, 408, 409, 410, 411, 412, 416, 417, 422, 427, - 429, 435, 436, 444, 445, 446, 450, 455, 456, 457, - 458, 459, 460, 461, 462, 466, 468, 473, 474, 475, - 476, 477, 478, 482, 487, 496, 506, 507, 517, 519, - 521, 532, 539, 541, 546, 548, 550, 552, 554, 563, - 569, 570, 578, 580, 592, 593, 594, 595, 596, 605, - 610, 615, 623, 625, 627, 632, 633, 634, 635, 636, - 637, 641, 642, 643, 644, 653, 655, 664, 674, 679, - 687, 688, 689, 690, 691, 692, 693, 694, 699, 700, - 708, 718, 727, 742, 747, 748, 752, 753, 757, 758, - 759, 760, 761, 762, 763, 772, 776, 780, 788, 796, - 804, 819, 834, 847, 848, 856, 857, 858, 859, 860, - 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, - 874, 879, 887, 892, 893, 894, 898, 903, 911, 916, - 917, 918, 919, 920, 921, 922, 923, 931, 941, 946, - 954, 956, 958, 960, 962, 967, 968, 972, 973, 974, - 975, 983, 988, 993, 1001, 1006, 1007, 1008, 1017, 1019, - 1024, 1029, 1037, 1039, 1056, 1057, 1058, 1059, 1060, 1061, - 1065, 1066, 1074, 1079, 1084, 1092, 1097, 1098, 1099, 1100, - 1101, 1102, 1103, 1104, 1113, 1114, 1115, 1122, 1129, 1145, - 1164, 1169, 1171, 1173, 1175, 1177, 1184, 1189, 1190, 1191, - 1195, 1196, 1197, 1201, 1202, 1206, 1213, 1223, 1232, 1237, - 1239, 1244, 1245, 1253, 1255, 1263, 1268, 1276, 1301, 1308, - 1318, 1319, 1323, 1324, 1325, 1326, 1330, 1331, 1332, 1336, - 1341, 1346, 1354, 1355, 1356, 1357, 1358, 1359, 1360, 1370, - 1375, 1383, 1388, 1396, 1398, 1402, 1407, 1412, 1420, 1425, - 1433, 1442, 1443, 1447, 1448, 1457, 1475, 1479, 1484, 1492, - 1497, 1498, 1502, 1507, 1515, 1520, 1525, 1530, 1535, 1543, - 1548, 1553, 1561, 1566, 1567, 1568, 1569, 1570 + 0, 363, 363, 367, 368, 369, 383, 384, 385, 386, + 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, + 404, 414, 415, 416, 417, 418, 422, 423, 428, 433, + 435, 441, 442, 450, 451, 452, 456, 461, 462, 463, + 464, 465, 466, 467, 468, 472, 474, 479, 480, 481, + 482, 483, 484, 488, 493, 502, 512, 513, 523, 525, + 527, 538, 545, 547, 552, 554, 556, 558, 560, 569, + 575, 576, 584, 586, 598, 599, 600, 601, 602, 611, + 616, 621, 629, 631, 633, 638, 639, 640, 641, 642, + 643, 647, 648, 649, 650, 659, 661, 670, 680, 685, + 693, 694, 695, 696, 697, 698, 699, 700, 705, 706, + 714, 724, 733, 748, 753, 754, 758, 759, 763, 764, + 765, 766, 767, 768, 769, 778, 782, 786, 794, 802, + 810, 825, 840, 853, 854, 862, 863, 864, 865, 866, + 867, 868, 869, 870, 871, 872, 873, 874, 875, 876, + 880, 885, 893, 898, 899, 900, 904, 909, 917, 922, + 923, 924, 925, 926, 927, 928, 929, 937, 947, 952, + 960, 962, 964, 966, 968, 973, 974, 978, 979, 980, + 981, 989, 994, 999, 1007, 1012, 1013, 1014, 1023, 1025, + 1030, 1035, 1043, 1045, 1062, 1063, 1064, 1065, 1066, 1067, + 1071, 1072, 1080, 1085, 1090, 1098, 1103, 1104, 1105, 1106, + 1107, 1108, 1109, 1110, 1119, 1120, 1121, 1128, 1135, 1151, + 1170, 1175, 1177, 1179, 1181, 1183, 1190, 1195, 1196, 1197, + 1201, 1202, 1203, 1207, 1208, 1212, 1219, 1229, 1238, 1243, + 1245, 1250, 1251, 1259, 1261, 1269, 1274, 1282, 1307, 1314, + 1324, 1325, 1329, 1330, 1331, 1332, 1336, 1337, 1338, 1342, + 1347, 1352, 1360, 1361, 1362, 1363, 1364, 1365, 1366, 1376, + 1381, 1389, 1394, 1402, 1404, 1408, 1413, 1418, 1426, 1431, + 1439, 1448, 1449, 1453, 1454, 1463, 1481, 1485, 1490, 1498, + 1503, 1504, 1508, 1513, 1521, 1526, 1531, 1536, 1541, 1549, + 1554, 1559, 1567, 1572, 1573, 1574, 1575, 1576 }; #endif @@ -2326,7 +2332,7 @@ yyreduce: case 5: /* Line 1806 of yacc.c */ -#line 364 "ntp_parser.y" +#line 370 "ntp_parser.y" { /* I will need to incorporate much more fine grained * error messages. The following should suffice for @@ -2343,7 +2349,7 @@ yyreduce: case 20: /* Line 1806 of yacc.c */ -#line 399 "ntp_parser.y" +#line 405 "ntp_parser.y" { peer_node *my_node; @@ -2355,42 +2361,42 @@ yyreduce: case 27: /* Line 1806 of yacc.c */ -#line 418 "ntp_parser.y" +#line 424 "ntp_parser.y" { (yyval.Address_node) = create_address_node((yyvsp[(2) - (2)].String), (yyvsp[(1) - (2)].Integer)); } break; case 28: /* Line 1806 of yacc.c */ -#line 423 "ntp_parser.y" +#line 429 "ntp_parser.y" { (yyval.Address_node) = create_address_node((yyvsp[(1) - (1)].String), AF_UNSPEC); } break; case 29: /* Line 1806 of yacc.c */ -#line 428 "ntp_parser.y" +#line 434 "ntp_parser.y" { (yyval.Integer) = AF_INET; } break; case 30: /* Line 1806 of yacc.c */ -#line 430 "ntp_parser.y" +#line 436 "ntp_parser.y" { (yyval.Integer) = AF_INET6; } break; case 31: /* Line 1806 of yacc.c */ -#line 435 "ntp_parser.y" +#line 441 "ntp_parser.y" { (yyval.Attr_val_fifo) = NULL; } break; case 32: /* Line 1806 of yacc.c */ -#line 437 "ntp_parser.y" +#line 443 "ntp_parser.y" { (yyval.Attr_val_fifo) = (yyvsp[(1) - (2)].Attr_val_fifo); APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[(2) - (2)].Attr_val)); @@ -2400,35 +2406,35 @@ yyreduce: case 36: /* Line 1806 of yacc.c */ -#line 451 "ntp_parser.y" +#line 457 "ntp_parser.y" { (yyval.Attr_val) = create_attr_ival(T_Flag, (yyvsp[(1) - (1)].Integer)); } break; case 45: /* Line 1806 of yacc.c */ -#line 467 "ntp_parser.y" +#line 473 "ntp_parser.y" { (yyval.Attr_val) = create_attr_ival((yyvsp[(1) - (2)].Integer), (yyvsp[(2) - (2)].Integer)); } break; case 46: /* Line 1806 of yacc.c */ -#line 469 "ntp_parser.y" +#line 475 "ntp_parser.y" { (yyval.Attr_val) = create_attr_uval((yyvsp[(1) - (2)].Integer), (yyvsp[(2) - (2)].Integer)); } break; case 53: /* Line 1806 of yacc.c */ -#line 483 "ntp_parser.y" +#line 489 "ntp_parser.y" { (yyval.Attr_val) = create_attr_sval((yyvsp[(1) - (2)].Integer), (yyvsp[(2) - (2)].String)); } break; case 55: /* Line 1806 of yacc.c */ -#line 497 "ntp_parser.y" +#line 503 "ntp_parser.y" { unpeer_node *my_node; @@ -2441,28 +2447,28 @@ yyreduce: case 58: /* Line 1806 of yacc.c */ -#line 518 "ntp_parser.y" +#line 524 "ntp_parser.y" { cfgt.broadcastclient = 1; } break; case 59: /* Line 1806 of yacc.c */ -#line 520 "ntp_parser.y" +#line 526 "ntp_parser.y" { CONCAT_G_FIFOS(cfgt.manycastserver, (yyvsp[(2) - (2)].Address_fifo)); } break; case 60: /* Line 1806 of yacc.c */ -#line 522 "ntp_parser.y" +#line 528 "ntp_parser.y" { CONCAT_G_FIFOS(cfgt.multicastclient, (yyvsp[(2) - (2)].Address_fifo)); } break; case 61: /* Line 1806 of yacc.c */ -#line 533 "ntp_parser.y" +#line 539 "ntp_parser.y" { attr_val *atrv; @@ -2474,14 +2480,14 @@ yyreduce: case 62: /* Line 1806 of yacc.c */ -#line 540 "ntp_parser.y" +#line 546 "ntp_parser.y" { cfgt.auth.control_key = (yyvsp[(2) - (2)].Integer); } break; case 63: /* Line 1806 of yacc.c */ -#line 542 "ntp_parser.y" +#line 548 "ntp_parser.y" { cfgt.auth.cryptosw++; CONCAT_G_FIFOS(cfgt.auth.crypto_cmd_list, (yyvsp[(2) - (2)].Attr_val_fifo)); @@ -2491,35 +2497,35 @@ yyreduce: case 64: /* Line 1806 of yacc.c */ -#line 547 "ntp_parser.y" +#line 553 "ntp_parser.y" { cfgt.auth.keys = (yyvsp[(2) - (2)].String); } break; case 65: /* Line 1806 of yacc.c */ -#line 549 "ntp_parser.y" +#line 555 "ntp_parser.y" { cfgt.auth.keysdir = (yyvsp[(2) - (2)].String); } break; case 66: /* Line 1806 of yacc.c */ -#line 551 "ntp_parser.y" +#line 557 "ntp_parser.y" { cfgt.auth.request_key = (yyvsp[(2) - (2)].Integer); } break; case 67: /* Line 1806 of yacc.c */ -#line 553 "ntp_parser.y" +#line 559 "ntp_parser.y" { cfgt.auth.revoke = (yyvsp[(2) - (2)].Integer); } break; case 68: /* Line 1806 of yacc.c */ -#line 555 "ntp_parser.y" +#line 561 "ntp_parser.y" { cfgt.auth.trusted_key_list = (yyvsp[(2) - (2)].Attr_val_fifo); @@ -2533,21 +2539,21 @@ yyreduce: case 69: /* Line 1806 of yacc.c */ -#line 564 "ntp_parser.y" +#line 570 "ntp_parser.y" { cfgt.auth.ntp_signd_socket = (yyvsp[(2) - (2)].String); } break; case 70: /* Line 1806 of yacc.c */ -#line 569 "ntp_parser.y" +#line 575 "ntp_parser.y" { (yyval.Attr_val_fifo) = NULL; } break; case 71: /* Line 1806 of yacc.c */ -#line 571 "ntp_parser.y" +#line 577 "ntp_parser.y" { (yyval.Attr_val_fifo) = (yyvsp[(1) - (2)].Attr_val_fifo); APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[(2) - (2)].Attr_val)); @@ -2557,14 +2563,14 @@ yyreduce: case 72: /* Line 1806 of yacc.c */ -#line 579 "ntp_parser.y" +#line 585 "ntp_parser.y" { (yyval.Attr_val) = create_attr_sval((yyvsp[(1) - (2)].Integer), (yyvsp[(2) - (2)].String)); } break; case 73: /* Line 1806 of yacc.c */ -#line 581 "ntp_parser.y" +#line 587 "ntp_parser.y" { (yyval.Attr_val) = NULL; cfgt.auth.revoke = (yyvsp[(2) - (2)].Integer); @@ -2578,14 +2584,14 @@ yyreduce: case 79: /* Line 1806 of yacc.c */ -#line 606 "ntp_parser.y" +#line 612 "ntp_parser.y" { CONCAT_G_FIFOS(cfgt.orphan_cmds, (yyvsp[(2) - (2)].Attr_val_fifo)); } break; case 80: /* Line 1806 of yacc.c */ -#line 611 "ntp_parser.y" +#line 617 "ntp_parser.y" { (yyval.Attr_val_fifo) = (yyvsp[(1) - (2)].Attr_val_fifo); APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[(2) - (2)].Attr_val)); @@ -2595,7 +2601,7 @@ yyreduce: case 81: /* Line 1806 of yacc.c */ -#line 616 "ntp_parser.y" +#line 622 "ntp_parser.y" { (yyval.Attr_val_fifo) = NULL; APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[(1) - (1)].Attr_val)); @@ -2605,35 +2611,35 @@ yyreduce: case 82: /* Line 1806 of yacc.c */ -#line 624 "ntp_parser.y" +#line 630 "ntp_parser.y" { (yyval.Attr_val) = create_attr_dval((yyvsp[(1) - (2)].Integer), (double)(yyvsp[(2) - (2)].Integer)); } break; case 83: /* Line 1806 of yacc.c */ -#line 626 "ntp_parser.y" +#line 632 "ntp_parser.y" { (yyval.Attr_val) = create_attr_dval((yyvsp[(1) - (2)].Integer), (yyvsp[(2) - (2)].Double)); } break; case 84: /* Line 1806 of yacc.c */ -#line 628 "ntp_parser.y" +#line 634 "ntp_parser.y" { (yyval.Attr_val) = create_attr_dval((yyvsp[(1) - (2)].Integer), (double)(yyvsp[(2) - (2)].Integer)); } break; case 95: /* Line 1806 of yacc.c */ -#line 654 "ntp_parser.y" +#line 660 "ntp_parser.y" { CONCAT_G_FIFOS(cfgt.stats_list, (yyvsp[(2) - (2)].Int_fifo)); } break; case 96: /* Line 1806 of yacc.c */ -#line 656 "ntp_parser.y" +#line 662 "ntp_parser.y" { if (input_from_file) { cfgt.stats_dir = (yyvsp[(2) - (2)].String); @@ -2647,7 +2653,7 @@ yyreduce: case 97: /* Line 1806 of yacc.c */ -#line 665 "ntp_parser.y" +#line 671 "ntp_parser.y" { filegen_node *fgn; @@ -2659,7 +2665,7 @@ yyreduce: case 98: /* Line 1806 of yacc.c */ -#line 675 "ntp_parser.y" +#line 681 "ntp_parser.y" { (yyval.Int_fifo) = (yyvsp[(1) - (2)].Int_fifo); APPEND_G_FIFO((yyval.Int_fifo), create_int_node((yyvsp[(2) - (2)].Integer))); @@ -2669,7 +2675,7 @@ yyreduce: case 99: /* Line 1806 of yacc.c */ -#line 680 "ntp_parser.y" +#line 686 "ntp_parser.y" { (yyval.Int_fifo) = NULL; APPEND_G_FIFO((yyval.Int_fifo), create_int_node((yyvsp[(1) - (1)].Integer))); @@ -2679,14 +2685,14 @@ yyreduce: case 108: /* Line 1806 of yacc.c */ -#line 699 "ntp_parser.y" +#line 705 "ntp_parser.y" { (yyval.Attr_val_fifo) = NULL; } break; case 109: /* Line 1806 of yacc.c */ -#line 701 "ntp_parser.y" +#line 707 "ntp_parser.y" { (yyval.Attr_val_fifo) = (yyvsp[(1) - (2)].Attr_val_fifo); APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[(2) - (2)].Attr_val)); @@ -2696,7 +2702,7 @@ yyreduce: case 110: /* Line 1806 of yacc.c */ -#line 709 "ntp_parser.y" +#line 715 "ntp_parser.y" { if (input_from_file) { (yyval.Attr_val) = create_attr_sval((yyvsp[(1) - (2)].Integer), (yyvsp[(2) - (2)].String)); @@ -2711,7 +2717,7 @@ yyreduce: case 111: /* Line 1806 of yacc.c */ -#line 719 "ntp_parser.y" +#line 725 "ntp_parser.y" { if (input_from_file) { (yyval.Attr_val) = create_attr_ival((yyvsp[(1) - (2)].Integer), (yyvsp[(2) - (2)].Integer)); @@ -2725,7 +2731,7 @@ yyreduce: case 112: /* Line 1806 of yacc.c */ -#line 728 "ntp_parser.y" +#line 734 "ntp_parser.y" { const char *err; @@ -2745,14 +2751,14 @@ yyreduce: case 113: /* Line 1806 of yacc.c */ -#line 743 "ntp_parser.y" +#line 749 "ntp_parser.y" { (yyval.Attr_val) = create_attr_ival(T_Flag, (yyvsp[(1) - (1)].Integer)); } break; case 125: /* Line 1806 of yacc.c */ -#line 773 "ntp_parser.y" +#line 779 "ntp_parser.y" { CONCAT_G_FIFOS(cfgt.discard_opts, (yyvsp[(2) - (2)].Attr_val_fifo)); } @@ -2761,7 +2767,7 @@ yyreduce: case 126: /* Line 1806 of yacc.c */ -#line 777 "ntp_parser.y" +#line 783 "ntp_parser.y" { CONCAT_G_FIFOS(cfgt.mru_opts, (yyvsp[(2) - (2)].Attr_val_fifo)); } @@ -2770,7 +2776,7 @@ yyreduce: case 127: /* Line 1806 of yacc.c */ -#line 781 "ntp_parser.y" +#line 787 "ntp_parser.y" { restrict_node *rn; @@ -2783,7 +2789,7 @@ yyreduce: case 128: /* Line 1806 of yacc.c */ -#line 789 "ntp_parser.y" +#line 795 "ntp_parser.y" { restrict_node *rn; @@ -2796,7 +2802,7 @@ yyreduce: case 129: /* Line 1806 of yacc.c */ -#line 797 "ntp_parser.y" +#line 803 "ntp_parser.y" { restrict_node *rn; @@ -2809,7 +2815,7 @@ yyreduce: case 130: /* Line 1806 of yacc.c */ -#line 805 "ntp_parser.y" +#line 811 "ntp_parser.y" { restrict_node *rn; @@ -2829,7 +2835,7 @@ yyreduce: case 131: /* Line 1806 of yacc.c */ -#line 820 "ntp_parser.y" +#line 826 "ntp_parser.y" { restrict_node *rn; @@ -2849,7 +2855,7 @@ yyreduce: case 132: /* Line 1806 of yacc.c */ -#line 835 "ntp_parser.y" +#line 841 "ntp_parser.y" { restrict_node * rn; @@ -2863,14 +2869,14 @@ yyreduce: case 133: /* Line 1806 of yacc.c */ -#line 847 "ntp_parser.y" +#line 853 "ntp_parser.y" { (yyval.Int_fifo) = NULL; } break; case 134: /* Line 1806 of yacc.c */ -#line 849 "ntp_parser.y" +#line 855 "ntp_parser.y" { (yyval.Int_fifo) = (yyvsp[(1) - (2)].Int_fifo); APPEND_G_FIFO((yyval.Int_fifo), create_int_node((yyvsp[(2) - (2)].Integer))); @@ -2880,7 +2886,7 @@ yyreduce: case 150: /* Line 1806 of yacc.c */ -#line 875 "ntp_parser.y" +#line 881 "ntp_parser.y" { (yyval.Attr_val_fifo) = (yyvsp[(1) - (2)].Attr_val_fifo); APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[(2) - (2)].Attr_val)); @@ -2890,7 +2896,7 @@ yyreduce: case 151: /* Line 1806 of yacc.c */ -#line 880 "ntp_parser.y" +#line 886 "ntp_parser.y" { (yyval.Attr_val_fifo) = NULL; APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[(1) - (1)].Attr_val)); @@ -2900,14 +2906,14 @@ yyreduce: case 152: /* Line 1806 of yacc.c */ -#line 888 "ntp_parser.y" +#line 894 "ntp_parser.y" { (yyval.Attr_val) = create_attr_ival((yyvsp[(1) - (2)].Integer), (yyvsp[(2) - (2)].Integer)); } break; case 156: /* Line 1806 of yacc.c */ -#line 899 "ntp_parser.y" +#line 905 "ntp_parser.y" { (yyval.Attr_val_fifo) = (yyvsp[(1) - (2)].Attr_val_fifo); APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[(2) - (2)].Attr_val)); @@ -2917,7 +2923,7 @@ yyreduce: case 157: /* Line 1806 of yacc.c */ -#line 904 "ntp_parser.y" +#line 910 "ntp_parser.y" { (yyval.Attr_val_fifo) = NULL; APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[(1) - (1)].Attr_val)); @@ -2927,14 +2933,14 @@ yyreduce: case 158: /* Line 1806 of yacc.c */ -#line 912 "ntp_parser.y" +#line 918 "ntp_parser.y" { (yyval.Attr_val) = create_attr_ival((yyvsp[(1) - (2)].Integer), (yyvsp[(2) - (2)].Integer)); } break; case 167: /* Line 1806 of yacc.c */ -#line 932 "ntp_parser.y" +#line 938 "ntp_parser.y" { addr_opts_node *aon; @@ -2946,7 +2952,7 @@ yyreduce: case 168: /* Line 1806 of yacc.c */ -#line 942 "ntp_parser.y" +#line 948 "ntp_parser.y" { (yyval.Attr_val_fifo) = (yyvsp[(1) - (2)].Attr_val_fifo); APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[(2) - (2)].Attr_val)); @@ -2956,7 +2962,7 @@ yyreduce: case 169: /* Line 1806 of yacc.c */ -#line 947 "ntp_parser.y" +#line 953 "ntp_parser.y" { (yyval.Attr_val_fifo) = NULL; APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[(1) - (1)].Attr_val)); @@ -2966,49 +2972,49 @@ yyreduce: case 170: /* Line 1806 of yacc.c */ -#line 955 "ntp_parser.y" +#line 961 "ntp_parser.y" { (yyval.Attr_val) = create_attr_dval((yyvsp[(1) - (2)].Integer), (yyvsp[(2) - (2)].Double)); } break; case 171: /* Line 1806 of yacc.c */ -#line 957 "ntp_parser.y" +#line 963 "ntp_parser.y" { (yyval.Attr_val) = create_attr_ival((yyvsp[(1) - (2)].Integer), (yyvsp[(2) - (2)].Integer)); } break; case 172: /* Line 1806 of yacc.c */ -#line 959 "ntp_parser.y" +#line 965 "ntp_parser.y" { (yyval.Attr_val) = create_attr_ival((yyvsp[(1) - (2)].Integer), (yyvsp[(2) - (2)].Integer)); } break; case 173: /* Line 1806 of yacc.c */ -#line 961 "ntp_parser.y" +#line 967 "ntp_parser.y" { (yyval.Attr_val) = create_attr_sval((yyvsp[(1) - (2)].Integer), (yyvsp[(2) - (2)].String)); } break; case 174: /* Line 1806 of yacc.c */ -#line 963 "ntp_parser.y" +#line 969 "ntp_parser.y" { (yyval.Attr_val) = create_attr_sval((yyvsp[(1) - (2)].Integer), (yyvsp[(2) - (2)].String)); } break; case 181: /* Line 1806 of yacc.c */ -#line 984 "ntp_parser.y" +#line 990 "ntp_parser.y" { CONCAT_G_FIFOS(cfgt.rlimit, (yyvsp[(2) - (2)].Attr_val_fifo)); } break; case 182: /* Line 1806 of yacc.c */ -#line 989 "ntp_parser.y" +#line 995 "ntp_parser.y" { (yyval.Attr_val_fifo) = (yyvsp[(1) - (2)].Attr_val_fifo); APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[(2) - (2)].Attr_val)); @@ -3018,7 +3024,7 @@ yyreduce: case 183: /* Line 1806 of yacc.c */ -#line 994 "ntp_parser.y" +#line 1000 "ntp_parser.y" { (yyval.Attr_val_fifo) = NULL; APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[(1) - (1)].Attr_val)); @@ -3028,28 +3034,28 @@ yyreduce: case 184: /* Line 1806 of yacc.c */ -#line 1002 "ntp_parser.y" +#line 1008 "ntp_parser.y" { (yyval.Attr_val) = create_attr_ival((yyvsp[(1) - (2)].Integer), (yyvsp[(2) - (2)].Integer)); } break; case 188: /* Line 1806 of yacc.c */ -#line 1018 "ntp_parser.y" +#line 1024 "ntp_parser.y" { CONCAT_G_FIFOS(cfgt.enable_opts, (yyvsp[(2) - (2)].Attr_val_fifo)); } break; case 189: /* Line 1806 of yacc.c */ -#line 1020 "ntp_parser.y" +#line 1026 "ntp_parser.y" { CONCAT_G_FIFOS(cfgt.disable_opts, (yyvsp[(2) - (2)].Attr_val_fifo)); } break; case 190: /* Line 1806 of yacc.c */ -#line 1025 "ntp_parser.y" +#line 1031 "ntp_parser.y" { (yyval.Attr_val_fifo) = (yyvsp[(1) - (2)].Attr_val_fifo); APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[(2) - (2)].Attr_val)); @@ -3059,7 +3065,7 @@ yyreduce: case 191: /* Line 1806 of yacc.c */ -#line 1030 "ntp_parser.y" +#line 1036 "ntp_parser.y" { (yyval.Attr_val_fifo) = NULL; APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[(1) - (1)].Attr_val)); @@ -3069,14 +3075,14 @@ yyreduce: case 192: /* Line 1806 of yacc.c */ -#line 1038 "ntp_parser.y" +#line 1044 "ntp_parser.y" { (yyval.Attr_val) = create_attr_ival(T_Flag, (yyvsp[(1) - (1)].Integer)); } break; case 193: /* Line 1806 of yacc.c */ -#line 1040 "ntp_parser.y" +#line 1046 "ntp_parser.y" { if (input_from_file) { (yyval.Attr_val) = create_attr_ival(T_Flag, (yyvsp[(1) - (1)].Integer)); @@ -3095,14 +3101,14 @@ yyreduce: case 202: /* Line 1806 of yacc.c */ -#line 1075 "ntp_parser.y" +#line 1081 "ntp_parser.y" { CONCAT_G_FIFOS(cfgt.tinker, (yyvsp[(2) - (2)].Attr_val_fifo)); } break; case 203: /* Line 1806 of yacc.c */ -#line 1080 "ntp_parser.y" +#line 1086 "ntp_parser.y" { (yyval.Attr_val_fifo) = (yyvsp[(1) - (2)].Attr_val_fifo); APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[(2) - (2)].Attr_val)); @@ -3112,7 +3118,7 @@ yyreduce: case 204: /* Line 1806 of yacc.c */ -#line 1085 "ntp_parser.y" +#line 1091 "ntp_parser.y" { (yyval.Attr_val_fifo) = NULL; APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[(1) - (1)].Attr_val)); @@ -3122,14 +3128,14 @@ yyreduce: case 205: /* Line 1806 of yacc.c */ -#line 1093 "ntp_parser.y" +#line 1099 "ntp_parser.y" { (yyval.Attr_val) = create_attr_dval((yyvsp[(1) - (2)].Integer), (yyvsp[(2) - (2)].Double)); } break; case 216: /* Line 1806 of yacc.c */ -#line 1116 "ntp_parser.y" +#line 1122 "ntp_parser.y" { attr_val *av; @@ -3141,7 +3147,7 @@ yyreduce: case 217: /* Line 1806 of yacc.c */ -#line 1123 "ntp_parser.y" +#line 1129 "ntp_parser.y" { attr_val *av; @@ -3153,7 +3159,7 @@ yyreduce: case 218: /* Line 1806 of yacc.c */ -#line 1130 "ntp_parser.y" +#line 1136 "ntp_parser.y" { char error_text[64]; attr_val *av; @@ -3174,7 +3180,7 @@ yyreduce: case 219: /* Line 1806 of yacc.c */ -#line 1146 "ntp_parser.y" +#line 1152 "ntp_parser.y" { if (!input_from_file) { yyerror(ip_file, "remote includefile ignored"); @@ -3198,7 +3204,7 @@ yyreduce: case 220: /* Line 1806 of yacc.c */ -#line 1165 "ntp_parser.y" +#line 1171 "ntp_parser.y" { while (curr_include_level != -1) FCLOSE(fp[curr_include_level--]); @@ -3208,35 +3214,35 @@ yyreduce: case 221: /* Line 1806 of yacc.c */ -#line 1170 "ntp_parser.y" +#line 1176 "ntp_parser.y" { /* see drift_parm below for actions */ } break; case 222: /* Line 1806 of yacc.c */ -#line 1172 "ntp_parser.y" +#line 1178 "ntp_parser.y" { CONCAT_G_FIFOS(cfgt.logconfig, (yyvsp[(2) - (2)].Attr_val_fifo)); } break; case 223: /* Line 1806 of yacc.c */ -#line 1174 "ntp_parser.y" +#line 1180 "ntp_parser.y" { CONCAT_G_FIFOS(cfgt.phone, (yyvsp[(2) - (2)].String_fifo)); } break; case 224: /* Line 1806 of yacc.c */ -#line 1176 "ntp_parser.y" +#line 1182 "ntp_parser.y" { APPEND_G_FIFO(cfgt.setvar, (yyvsp[(2) - (2)].Set_var)); } break; case 225: /* Line 1806 of yacc.c */ -#line 1178 "ntp_parser.y" +#line 1184 "ntp_parser.y" { addr_opts_node *aon; @@ -3248,14 +3254,14 @@ yyreduce: case 226: /* Line 1806 of yacc.c */ -#line 1185 "ntp_parser.y" +#line 1191 "ntp_parser.y" { CONCAT_G_FIFOS(cfgt.ttl, (yyvsp[(2) - (2)].Attr_val_fifo)); } break; case 235: /* Line 1806 of yacc.c */ -#line 1207 "ntp_parser.y" +#line 1213 "ntp_parser.y" { attr_val *av; @@ -3267,7 +3273,7 @@ yyreduce: case 236: /* Line 1806 of yacc.c */ -#line 1214 "ntp_parser.y" +#line 1220 "ntp_parser.y" { attr_val *av; @@ -3281,7 +3287,7 @@ yyreduce: case 237: /* Line 1806 of yacc.c */ -#line 1223 "ntp_parser.y" +#line 1229 "ntp_parser.y" { attr_val *av; @@ -3293,28 +3299,28 @@ yyreduce: case 238: /* Line 1806 of yacc.c */ -#line 1233 "ntp_parser.y" +#line 1239 "ntp_parser.y" { (yyval.Set_var) = create_setvar_node((yyvsp[(1) - (4)].String), (yyvsp[(3) - (4)].String), (yyvsp[(4) - (4)].Integer)); } break; case 240: /* Line 1806 of yacc.c */ -#line 1239 "ntp_parser.y" +#line 1245 "ntp_parser.y" { (yyval.Integer) = 0; } break; case 241: /* Line 1806 of yacc.c */ -#line 1244 "ntp_parser.y" +#line 1250 "ntp_parser.y" { (yyval.Attr_val_fifo) = NULL; } break; case 242: /* Line 1806 of yacc.c */ -#line 1246 "ntp_parser.y" +#line 1252 "ntp_parser.y" { (yyval.Attr_val_fifo) = (yyvsp[(1) - (2)].Attr_val_fifo); APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[(2) - (2)].Attr_val)); @@ -3324,14 +3330,14 @@ yyreduce: case 243: /* Line 1806 of yacc.c */ -#line 1254 "ntp_parser.y" +#line 1260 "ntp_parser.y" { (yyval.Attr_val) = create_attr_ival((yyvsp[(1) - (2)].Integer), (yyvsp[(2) - (2)].Integer)); } break; case 244: /* Line 1806 of yacc.c */ -#line 1256 "ntp_parser.y" +#line 1262 "ntp_parser.y" { (yyval.Attr_val) = create_attr_sval((yyvsp[(1) - (2)].Integer), estrdup((yyvsp[(2) - (2)].Address_node)->address)); destroy_address_node((yyvsp[(2) - (2)].Address_node)); @@ -3341,7 +3347,7 @@ yyreduce: case 245: /* Line 1806 of yacc.c */ -#line 1264 "ntp_parser.y" +#line 1270 "ntp_parser.y" { (yyval.Attr_val_fifo) = (yyvsp[(1) - (2)].Attr_val_fifo); APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[(2) - (2)].Attr_val)); @@ -3351,7 +3357,7 @@ yyreduce: case 246: /* Line 1806 of yacc.c */ -#line 1269 "ntp_parser.y" +#line 1275 "ntp_parser.y" { (yyval.Attr_val_fifo) = NULL; APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[(1) - (1)].Attr_val)); @@ -3361,7 +3367,7 @@ yyreduce: case 247: /* Line 1806 of yacc.c */ -#line 1277 "ntp_parser.y" +#line 1283 "ntp_parser.y" { char prefix; char * type; @@ -3388,7 +3394,7 @@ yyreduce: case 248: /* Line 1806 of yacc.c */ -#line 1302 "ntp_parser.y" +#line 1308 "ntp_parser.y" { nic_rule_node *nrn; @@ -3400,7 +3406,7 @@ yyreduce: case 249: /* Line 1806 of yacc.c */ -#line 1309 "ntp_parser.y" +#line 1315 "ntp_parser.y" { nic_rule_node *nrn; @@ -3412,14 +3418,14 @@ yyreduce: case 259: /* Line 1806 of yacc.c */ -#line 1337 "ntp_parser.y" +#line 1343 "ntp_parser.y" { CONCAT_G_FIFOS(cfgt.reset_counters, (yyvsp[(2) - (2)].Int_fifo)); } break; case 260: /* Line 1806 of yacc.c */ -#line 1342 "ntp_parser.y" +#line 1348 "ntp_parser.y" { (yyval.Int_fifo) = (yyvsp[(1) - (2)].Int_fifo); APPEND_G_FIFO((yyval.Int_fifo), create_int_node((yyvsp[(2) - (2)].Integer))); @@ -3429,7 +3435,7 @@ yyreduce: case 261: /* Line 1806 of yacc.c */ -#line 1347 "ntp_parser.y" +#line 1353 "ntp_parser.y" { (yyval.Int_fifo) = NULL; APPEND_G_FIFO((yyval.Int_fifo), create_int_node((yyvsp[(1) - (1)].Integer))); @@ -3439,7 +3445,7 @@ yyreduce: case 269: /* Line 1806 of yacc.c */ -#line 1371 "ntp_parser.y" +#line 1377 "ntp_parser.y" { (yyval.Attr_val_fifo) = (yyvsp[(1) - (2)].Attr_val_fifo); APPEND_G_FIFO((yyval.Attr_val_fifo), create_int_node((yyvsp[(2) - (2)].Integer))); @@ -3449,7 +3455,7 @@ yyreduce: case 270: /* Line 1806 of yacc.c */ -#line 1376 "ntp_parser.y" +#line 1382 "ntp_parser.y" { (yyval.Attr_val_fifo) = NULL; APPEND_G_FIFO((yyval.Attr_val_fifo), create_int_node((yyvsp[(1) - (1)].Integer))); @@ -3459,7 +3465,7 @@ yyreduce: case 271: /* Line 1806 of yacc.c */ -#line 1384 "ntp_parser.y" +#line 1390 "ntp_parser.y" { (yyval.Attr_val_fifo) = (yyvsp[(1) - (2)].Attr_val_fifo); APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[(2) - (2)].Attr_val)); @@ -3469,7 +3475,7 @@ yyreduce: case 272: /* Line 1806 of yacc.c */ -#line 1389 "ntp_parser.y" +#line 1395 "ntp_parser.y" { (yyval.Attr_val_fifo) = NULL; APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[(1) - (1)].Attr_val)); @@ -3479,21 +3485,21 @@ yyreduce: case 273: /* Line 1806 of yacc.c */ -#line 1397 "ntp_parser.y" +#line 1403 "ntp_parser.y" { (yyval.Attr_val) = create_attr_ival('i', (yyvsp[(1) - (1)].Integer)); } break; case 275: /* Line 1806 of yacc.c */ -#line 1403 "ntp_parser.y" +#line 1409 "ntp_parser.y" { (yyval.Attr_val) = create_attr_rangeval('-', (yyvsp[(2) - (5)].Integer), (yyvsp[(4) - (5)].Integer)); } break; case 276: /* Line 1806 of yacc.c */ -#line 1408 "ntp_parser.y" +#line 1414 "ntp_parser.y" { (yyval.String_fifo) = (yyvsp[(1) - (2)].String_fifo); APPEND_G_FIFO((yyval.String_fifo), create_string_node((yyvsp[(2) - (2)].String))); @@ -3503,7 +3509,7 @@ yyreduce: case 277: /* Line 1806 of yacc.c */ -#line 1413 "ntp_parser.y" +#line 1419 "ntp_parser.y" { (yyval.String_fifo) = NULL; APPEND_G_FIFO((yyval.String_fifo), create_string_node((yyvsp[(1) - (1)].String))); @@ -3513,7 +3519,7 @@ yyreduce: case 278: /* Line 1806 of yacc.c */ -#line 1421 "ntp_parser.y" +#line 1427 "ntp_parser.y" { (yyval.Address_fifo) = (yyvsp[(1) - (2)].Address_fifo); APPEND_G_FIFO((yyval.Address_fifo), (yyvsp[(2) - (2)].Address_node)); @@ -3523,7 +3529,7 @@ yyreduce: case 279: /* Line 1806 of yacc.c */ -#line 1426 "ntp_parser.y" +#line 1432 "ntp_parser.y" { (yyval.Address_fifo) = NULL; APPEND_G_FIFO((yyval.Address_fifo), (yyvsp[(1) - (1)].Address_node)); @@ -3533,7 +3539,7 @@ yyreduce: case 280: /* Line 1806 of yacc.c */ -#line 1434 "ntp_parser.y" +#line 1440 "ntp_parser.y" { if ((yyvsp[(1) - (1)].Integer) != 0 && (yyvsp[(1) - (1)].Integer) != 1) { yyerror(ip_file, "Integer value is not boolean (0 or 1). Assuming 1"); @@ -3547,28 +3553,28 @@ yyreduce: case 281: /* Line 1806 of yacc.c */ -#line 1442 "ntp_parser.y" +#line 1448 "ntp_parser.y" { (yyval.Integer) = 1; } break; case 282: /* Line 1806 of yacc.c */ -#line 1443 "ntp_parser.y" +#line 1449 "ntp_parser.y" { (yyval.Integer) = 0; } break; case 283: /* Line 1806 of yacc.c */ -#line 1447 "ntp_parser.y" +#line 1453 "ntp_parser.y" { (yyval.Double) = (double)(yyvsp[(1) - (1)].Integer); } break; case 285: /* Line 1806 of yacc.c */ -#line 1458 "ntp_parser.y" +#line 1464 "ntp_parser.y" { sim_node *sn; @@ -3583,14 +3589,14 @@ yyreduce: case 286: /* Line 1806 of yacc.c */ -#line 1475 "ntp_parser.y" +#line 1481 "ntp_parser.y" { old_config_style = 0; } break; case 287: /* Line 1806 of yacc.c */ -#line 1480 "ntp_parser.y" +#line 1486 "ntp_parser.y" { (yyval.Attr_val_fifo) = (yyvsp[(1) - (3)].Attr_val_fifo); APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[(2) - (3)].Attr_val)); @@ -3600,7 +3606,7 @@ yyreduce: case 288: /* Line 1806 of yacc.c */ -#line 1485 "ntp_parser.y" +#line 1491 "ntp_parser.y" { (yyval.Attr_val_fifo) = NULL; APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[(1) - (2)].Attr_val)); @@ -3610,14 +3616,14 @@ yyreduce: case 289: /* Line 1806 of yacc.c */ -#line 1493 "ntp_parser.y" +#line 1499 "ntp_parser.y" { (yyval.Attr_val) = create_attr_dval((yyvsp[(1) - (3)].Integer), (yyvsp[(3) - (3)].Double)); } break; case 292: /* Line 1806 of yacc.c */ -#line 1503 "ntp_parser.y" +#line 1509 "ntp_parser.y" { (yyval.Sim_server_fifo) = (yyvsp[(1) - (2)].Sim_server_fifo); APPEND_G_FIFO((yyval.Sim_server_fifo), (yyvsp[(2) - (2)].Sim_server)); @@ -3627,7 +3633,7 @@ yyreduce: case 293: /* Line 1806 of yacc.c */ -#line 1508 "ntp_parser.y" +#line 1514 "ntp_parser.y" { (yyval.Sim_server_fifo) = NULL; APPEND_G_FIFO((yyval.Sim_server_fifo), (yyvsp[(1) - (1)].Sim_server)); @@ -3637,28 +3643,28 @@ yyreduce: case 294: /* Line 1806 of yacc.c */ -#line 1516 "ntp_parser.y" - { (yyval.Sim_server) = create_sim_server((yyvsp[(1) - (5)].Address_node), (yyvsp[(3) - (5)].Double), (yyvsp[(4) - (5)].Sim_script_fifo)); } +#line 1522 "ntp_parser.y" + { (yyval.Sim_server) = ONLY_SIM(create_sim_server((yyvsp[(1) - (5)].Address_node), (yyvsp[(3) - (5)].Double), (yyvsp[(4) - (5)].Sim_script_fifo))); } break; case 295: /* Line 1806 of yacc.c */ -#line 1521 "ntp_parser.y" +#line 1527 "ntp_parser.y" { (yyval.Double) = (yyvsp[(3) - (4)].Double); } break; case 296: /* Line 1806 of yacc.c */ -#line 1526 "ntp_parser.y" +#line 1532 "ntp_parser.y" { (yyval.Address_node) = (yyvsp[(3) - (3)].Address_node); } break; case 297: /* Line 1806 of yacc.c */ -#line 1531 "ntp_parser.y" +#line 1537 "ntp_parser.y" { (yyval.Sim_script_fifo) = (yyvsp[(1) - (2)].Sim_script_fifo); APPEND_G_FIFO((yyval.Sim_script_fifo), (yyvsp[(2) - (2)].Sim_script)); @@ -3668,7 +3674,7 @@ yyreduce: case 298: /* Line 1806 of yacc.c */ -#line 1536 "ntp_parser.y" +#line 1542 "ntp_parser.y" { (yyval.Sim_script_fifo) = NULL; APPEND_G_FIFO((yyval.Sim_script_fifo), (yyvsp[(1) - (1)].Sim_script)); @@ -3678,14 +3684,14 @@ yyreduce: case 299: /* Line 1806 of yacc.c */ -#line 1544 "ntp_parser.y" - { (yyval.Sim_script) = create_sim_script_info((yyvsp[(3) - (6)].Double), (yyvsp[(5) - (6)].Attr_val_fifo)); } +#line 1550 "ntp_parser.y" + { (yyval.Sim_script) = ONLY_SIM(create_sim_script_info((yyvsp[(3) - (6)].Double), (yyvsp[(5) - (6)].Attr_val_fifo))); } break; case 300: /* Line 1806 of yacc.c */ -#line 1549 "ntp_parser.y" +#line 1555 "ntp_parser.y" { (yyval.Attr_val_fifo) = (yyvsp[(1) - (3)].Attr_val_fifo); APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[(2) - (3)].Attr_val)); @@ -3695,7 +3701,7 @@ yyreduce: case 301: /* Line 1806 of yacc.c */ -#line 1554 "ntp_parser.y" +#line 1560 "ntp_parser.y" { (yyval.Attr_val_fifo) = NULL; APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[(1) - (2)].Attr_val)); @@ -3705,14 +3711,14 @@ yyreduce: case 302: /* Line 1806 of yacc.c */ -#line 1562 "ntp_parser.y" +#line 1568 "ntp_parser.y" { (yyval.Attr_val) = create_attr_dval((yyvsp[(1) - (3)].Integer), (yyvsp[(3) - (3)].Double)); } break; /* Line 1806 of yacc.c */ -#line 3716 "ntp_parser.c" +#line 3722 "ntp_parser.c" default: break; } /* User semantic actions sometimes alter yychar, and that requires @@ -3943,7 +3949,7 @@ yyreturn: /* Line 2067 of yacc.c */ -#line 1573 "ntp_parser.y" +#line 1579 "ntp_parser.y" void diff --git a/ntpd/ntp_parser.h b/ntpd/ntp_parser.h index 45b857c71..6eb54fc34 100644 --- a/ntpd/ntp_parser.h +++ b/ntpd/ntp_parser.h @@ -421,7 +421,7 @@ typedef union YYSTYPE { /* Line 2068 of yacc.c */ -#line 48 "ntp_parser.y" +#line 54 "ntp_parser.y" char * String; double Double; diff --git a/ntpd/ntp_parser.y b/ntpd/ntp_parser.y index edf01f14d..e75bffe4f 100644 --- a/ntpd/ntp_parser.y +++ b/ntpd/ntp_parser.y @@ -37,6 +37,12 @@ #define YYERROR_VERBOSE #define YYMAXDEPTH 1000 /* stop the madness sooner */ void yyerror(struct FILE_INFO *ip_file, const char *msg); + + #ifdef SIM + # define ONLY_SIM(a) (a) + #else + # define ONLY_SIM(a) NULL + #endif %} /* @@ -1513,7 +1519,7 @@ sim_server_list sim_server : sim_server_name '{' sim_server_offset sim_act_list '}' - { $$ = create_sim_server($1, $3, $4); } + { $$ = ONLY_SIM(create_sim_server($1, $3, $4)); } ; sim_server_offset @@ -1541,7 +1547,7 @@ sim_act_list sim_act : T_Duration '=' number '{' sim_act_stmt_list '}' - { $$ = create_sim_script_info($3, $5); } + { $$ = ONLY_SIM(create_sim_script_info($3, $5)); } ; sim_act_stmt_list diff --git a/ntpd/ntp_proto.c b/ntpd/ntp_proto.c index 4a5ac45fc..81c976b7f 100644 --- a/ntpd/ntp_proto.c +++ b/ntpd/ntp_proto.c @@ -2125,7 +2125,7 @@ peer_clear( /* * Clear all values, including the optional crypto values above. */ - memset(CLEAR_TO_ZERO(peer), 0, LEN_CLEAR_TO_ZERO); + memset(CLEAR_TO_ZERO(peer), 0, LEN_CLEAR_TO_ZERO(peer)); peer->ppoll = peer->maxpoll; peer->hpoll = peer->minpoll; peer->disp = MAXDISPERSE;