Bug Summary

File:src/usr.sbin/nsd/obj/configparser.c
Warning:line 920, column 13
Attempt to free released memory

Annotated Source Code

Press '?' to see keyboard shortcuts

clang -cc1 -cc1 -triple amd64-unknown-openbsd7.0 -analyze -disable-free -disable-llvm-verifier -discard-value-names -main-file-name configparser.c -analyzer-store=region -analyzer-opt-analyze-nested-blocks -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -setup-static-analyzer -mrelocation-model pic -pic-level 1 -pic-is-pie -mframe-pointer=all -relaxed-aliasing -fno-rounding-math -mconstructor-aliases -munwind-tables -target-cpu x86-64 -target-feature +retpoline-indirect-calls -target-feature +retpoline-indirect-branches -tune-cpu generic -debugger-tuning=gdb -fcoverage-compilation-dir=/usr/src/usr.sbin/nsd/obj -resource-dir /usr/local/lib/clang/13.0.0 -I . -I /usr/src/usr.sbin/nsd -internal-isystem /usr/local/lib/clang/13.0.0/include -internal-externc-isystem /usr/include -O2 -fdebug-compilation-dir=/usr/src/usr.sbin/nsd/obj -ferror-limit 19 -fwrapv -D_RET_PROTECTOR -ret-protector -fgnuc-version=4.2.1 -vectorize-loops -vectorize-slp -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-valloc -fno-builtin-free -fno-builtin-strdup -fno-builtin-strndup -analyzer-output=html -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /home/ben/Projects/vmm/scan-build/2022-01-12-194120-40624-1 -x c configparser.c
1#include <stdlib.h>
2#include <string.h>
3#define YYBYACC1 1
4#define YYMAJOR1 1
5#define YYMINOR9 9
6#define YYLEXc_lex() yylexc_lex()
7#define YYEMPTY-1 -1
8#define yyclearin(c_char=(-1)) (yycharc_char=(YYEMPTY-1))
9#define yyerrok(c_errflag=0) (yyerrflagc_errflag=0)
10#define YYRECOVERING()(c_errflag!=0) (yyerrflagc_errflag!=0)
11#define yyparsec_parse c_parse
12#define yylexc_lex c_lex
13#define yyerrorc_error c_error
14#define yycharc_char c_char
15#define yyvalc_val c_val
16#define yylvalc_lval c_lval
17#define yydebugc_debug c_debug
18#define yynerrsc_nerrs c_nerrs
19#define yyerrflagc_errflag c_errflag
20#define yyssc_ss c_ss
21#define yysslimc_sslim c_sslim
22#define yysspc_ssp c_ssp
23#define yyvsc_vs c_vs
24#define yyvspc_vsp c_vsp
25#define yystacksizec_stacksize c_stacksize
26#define yylhsc_lhs c_lhs
27#define yylenc_len c_len
28#define yydefredc_defred c_defred
29#define yydgotoc_dgoto c_dgoto
30#define yysindexc_sindex c_sindex
31#define yyrindexc_rindex c_rindex
32#define yygindexc_gindex c_gindex
33#define yytablec_table c_table
34#define yycheckc_check c_check
35#define yynamec_name c_name
36#define yyrulec_rule c_rule
37#define YYPREFIX"c_" "c_"
38#line 11 "/usr/src/usr.sbin/nsd/configparser.y"
39#include "config.h"
40
41#include <assert.h>
42#include <errno(*__errno()).h>
43#include <stdio.h>
44#include <string.h>
45
46#include "options.h"
47#include "util.h"
48#include "dname.h"
49#include "tsig.h"
50#include "rrl.h"
51
52int yylexc_lex(void);
53
54#ifdef __cplusplus
55extern "C"
56#endif
57
58/* these need to be global, otherwise they cannot be used inside yacc */
59extern config_parser_state_type *cfg_parser;
60
61static void append_acl(struct acl_options **list, struct acl_options *acl);
62static void add_to_last_acl(struct acl_options **list, char *ac);
63static int parse_boolean(const char *str, int *bln);
64static int parse_expire_expr(const char *str, long long *num, uint8_t *expr);
65static int parse_number(const char *str, long long *num);
66static int parse_range(const char *str, long long *low, long long *high);
67#line 41 "/usr/src/usr.sbin/nsd/configparser.y"
68#ifndef YYSTYPE_DEFINED
69#define YYSTYPE_DEFINED
70typedef union {
71 char *str;
72 long long llng;
73 int bln;
74 struct ip_address_option *ip;
75 struct range_option *range;
76 struct cpu_option *cpu;
77} YYSTYPE;
78#endif /* YYSTYPE_DEFINED */
79#line 80 "configparser.c"
80#define STRING257 257
81#define VAR_SERVER258 258
82#define VAR_SERVER_COUNT259 259
83#define VAR_IP_ADDRESS260 260
84#define VAR_IP_TRANSPARENT261 261
85#define VAR_IP_FREEBIND262 262
86#define VAR_REUSEPORT263 263
87#define VAR_SEND_BUFFER_SIZE264 264
88#define VAR_RECEIVE_BUFFER_SIZE265 265
89#define VAR_DEBUG_MODE266 266
90#define VAR_IP4_ONLY267 267
91#define VAR_IP6_ONLY268 268
92#define VAR_DO_IP4269 269
93#define VAR_DO_IP6270 270
94#define VAR_PORT271 271
95#define VAR_USE_SYSTEMD272 272
96#define VAR_VERBOSITY273 273
97#define VAR_USERNAME274 274
98#define VAR_CHROOT275 275
99#define VAR_ZONESDIR276 276
100#define VAR_ZONELISTFILE277 277
101#define VAR_DATABASE278 278
102#define VAR_LOGFILE279 279
103#define VAR_LOG_ONLY_SYSLOG280 280
104#define VAR_PIDFILE281 281
105#define VAR_DIFFFILE282 282
106#define VAR_XFRDFILE283 283
107#define VAR_XFRDIR284 284
108#define VAR_HIDE_VERSION285 285
109#define VAR_HIDE_IDENTITY286 286
110#define VAR_VERSION287 287
111#define VAR_IDENTITY288 288
112#define VAR_NSID289 289
113#define VAR_TCP_COUNT290 290
114#define VAR_TCP_REJECT_OVERFLOW291 291
115#define VAR_TCP_QUERY_COUNT292 292
116#define VAR_TCP_TIMEOUT293 293
117#define VAR_TCP_MSS294 294
118#define VAR_OUTGOING_TCP_MSS295 295
119#define VAR_IPV4_EDNS_SIZE296 296
120#define VAR_IPV6_EDNS_SIZE297 297
121#define VAR_STATISTICS298 298
122#define VAR_XFRD_RELOAD_TIMEOUT299 299
123#define VAR_LOG_TIME_ASCII300 300
124#define VAR_ROUND_ROBIN301 301
125#define VAR_MINIMAL_RESPONSES302 302
126#define VAR_CONFINE_TO_ZONE303 303
127#define VAR_REFUSE_ANY304 304
128#define VAR_ZONEFILES_CHECK305 305
129#define VAR_ZONEFILES_WRITE306 306
130#define VAR_RRL_SIZE307 307
131#define VAR_RRL_RATELIMIT308 308
132#define VAR_RRL_SLIP309 309
133#define VAR_RRL_IPV4_PREFIX_LENGTH310 310
134#define VAR_RRL_IPV6_PREFIX_LENGTH311 311
135#define VAR_RRL_WHITELIST_RATELIMIT312 312
136#define VAR_TLS_SERVICE_KEY313 313
137#define VAR_TLS_SERVICE_PEM314 314
138#define VAR_TLS_SERVICE_OCSP315 315
139#define VAR_TLS_PORT316 316
140#define VAR_TLS_CERT_BUNDLE317 317
141#define VAR_CPU_AFFINITY318 318
142#define VAR_XFRD_CPU_AFFINITY319 319
143#define VAR_SERVER_CPU_AFFINITY320 320
144#define VAR_DROP_UPDATES321 321
145#define VAR_DNSTAP322 322
146#define VAR_DNSTAP_ENABLE323 323
147#define VAR_DNSTAP_SOCKET_PATH324 324
148#define VAR_DNSTAP_SEND_IDENTITY325 325
149#define VAR_DNSTAP_SEND_VERSION326 326
150#define VAR_DNSTAP_IDENTITY327 327
151#define VAR_DNSTAP_VERSION328 328
152#define VAR_DNSTAP_LOG_AUTH_QUERY_MESSAGES329 329
153#define VAR_DNSTAP_LOG_AUTH_RESPONSE_MESSAGES330 330
154#define VAR_REMOTE_CONTROL331 331
155#define VAR_CONTROL_ENABLE332 332
156#define VAR_CONTROL_INTERFACE333 333
157#define VAR_CONTROL_PORT334 334
158#define VAR_SERVER_KEY_FILE335 335
159#define VAR_SERVER_CERT_FILE336 336
160#define VAR_CONTROL_KEY_FILE337 337
161#define VAR_CONTROL_CERT_FILE338 338
162#define VAR_KEY339 339
163#define VAR_ALGORITHM340 340
164#define VAR_SECRET341 341
165#define VAR_TLS_AUTH342 342
166#define VAR_TLS_AUTH_DOMAIN_NAME343 343
167#define VAR_TLS_AUTH_CLIENT_CERT344 344
168#define VAR_TLS_AUTH_CLIENT_KEY345 345
169#define VAR_TLS_AUTH_CLIENT_KEY_PW346 346
170#define VAR_PATTERN347 347
171#define VAR_NAME348 348
172#define VAR_ZONEFILE349 349
173#define VAR_NOTIFY350 350
174#define VAR_PROVIDE_XFR351 351
175#define VAR_ALLOW_QUERY352 352
176#define VAR_AXFR353 353
177#define VAR_UDP354 354
178#define VAR_NOTIFY_RETRY355 355
179#define VAR_ALLOW_NOTIFY356 356
180#define VAR_REQUEST_XFR357 357
181#define VAR_ALLOW_AXFR_FALLBACK358 358
182#define VAR_OUTGOING_INTERFACE359 359
183#define VAR_ANSWER_COOKIE360 360
184#define VAR_COOKIE_SECRET361 361
185#define VAR_COOKIE_SECRET_FILE362 362
186#define VAR_MAX_REFRESH_TIME363 363
187#define VAR_MIN_REFRESH_TIME364 364
188#define VAR_MAX_RETRY_TIME365 365
189#define VAR_MIN_RETRY_TIME366 366
190#define VAR_MIN_EXPIRE_TIME367 367
191#define VAR_MULTI_MASTER_CHECK368 368
192#define VAR_SIZE_LIMIT_XFR369 369
193#define VAR_ZONESTATS370 370
194#define VAR_INCLUDE_PATTERN371 371
195#define VAR_ZONE372 372
196#define VAR_RRL_WHITELIST373 373
197#define VAR_SERVERS374 374
198#define VAR_BINDTODEVICE375 375
199#define VAR_SETFIB376 376
200#define YYERRCODE256 256
201const short c_lhs[] =
202 { -1,
203 0, 0, 6, 6, 6, 6, 6, 6, 6, 7,
204 14, 14, 17, 15, 15, 15, 15, 15, 15, 15,
205 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
206 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
207 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
208 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
209 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
210 15, 15, 15, 15, 15, 15, 15, 15, 16, 16,
211 18, 18, 18, 5, 5, 4, 4, 8, 19, 19,
212 20, 20, 20, 20, 20, 20, 20, 20, 9, 21,
213 21, 22, 22, 22, 22, 22, 22, 22, 24, 11,
214 23, 23, 25, 25, 25, 25, 25, 27, 10, 26,
215 26, 28, 28, 28, 30, 13, 29, 29, 31, 31,
216 34, 12, 33, 33, 35, 35, 32, 32, 32, 32,
217 32, 32, 37, 32, 38, 32, 32, 32, 32, 32,
218 32, 32, 32, 32, 32, 32, 32, 32, 32, 3,
219 1, 2, 36, 36,
220};
221const short c_len[] =
222 { 2,
223 0, 2, 1, 1, 1, 1, 1, 1, 1, 2,
224 2, 0, 0, 4, 2, 2, 2, 2, 2, 2,
225 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
226 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
227 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
228 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
229 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
230 2, 2, 2, 2, 2, 2, 2, 2, 0, 2,
231 2, 2, 2, 0, 2, 1, 1, 2, 2, 0,
232 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
233 0, 2, 2, 2, 2, 2, 2, 2, 0, 3,
234 2, 0, 2, 2, 2, 2, 2, 0, 3, 2,
235 0, 2, 2, 2, 0, 3, 2, 0, 2, 1,
236 0, 3, 2, 0, 2, 1, 2, 2, 2, 2,
237 2, 2, 0, 5, 0, 6, 4, 3, 3, 3,
238 3, 2, 2, 2, 2, 2, 2, 2, 2, 1,
239 1, 1, 0, 1,
240};
241const short c_defred[] =
242 { 1,
243 0, 12, 90, 101, 118, 109, 131, 125, 2, 3,
244 4, 5, 6, 7, 8, 9, 0, 0, 0, 121,
245 112, 134, 128, 0, 0, 0, 0, 0, 0, 0,
246 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
247 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
248 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
249 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
250 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
251 0, 0, 84, 86, 87, 0, 0, 0, 0, 0,
252 11, 0, 0, 0, 0, 0, 0, 0, 0, 89,
253 0, 0, 0, 0, 0, 0, 0, 100, 0, 0,
254 0, 0, 161, 15, 160, 13, 162, 16, 17, 45,
255 18, 19, 20, 25, 26, 27, 28, 44, 21, 55,
256 48, 47, 49, 50, 29, 33, 34, 43, 51, 52,
257 53, 22, 23, 31, 30, 32, 35, 36, 37, 38,
258 39, 40, 41, 42, 46, 54, 64, 65, 66, 67,
259 68, 62, 63, 56, 57, 58, 59, 60, 61, 69,
260 71, 70, 72, 73, 0, 24, 74, 75, 76, 78,
261 91, 92, 93, 94, 95, 96, 97, 98, 102, 103,
262 104, 105, 106, 107, 108, 0, 0, 0, 120, 0,
263 0, 0, 0, 0, 111, 0, 0, 0, 0, 0,
264 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
265 0, 0, 0, 0, 0, 136, 133, 0, 127, 130,
266 79, 85, 123, 124, 122, 114, 115, 116, 117, 113,
267 135, 138, 0, 0, 0, 154, 0, 0, 0, 0,
268 153, 152, 155, 156, 157, 158, 159, 141, 140, 139,
269 142, 137, 129, 0, 149, 150, 151, 148, 143, 0,
270 0, 0, 0, 0, 80, 0, 145, 147, 81, 82,
271 83, 164, 144, 0, 146,
272};
273const short c_dgoto[] =
274 { 1,
275 114, 118, 116, 90, 175, 9, 10, 11, 12, 13,
276 14, 15, 16, 17, 91, 264, 231, 275, 18, 100,
277 19, 108, 110, 21, 205, 109, 20, 199, 112, 23,
278 229, 226, 111, 22, 227, 283, 276, 284,
279};
280const short c_sindex[] =
281 { 0,
282 -223, 0, 0, 0, 0, 0, 0, 0, 0, 0,
283 0, 0, 0, 0, 0, 0, 440, -198, -135, 0,
284 0, 0, 0, -257, -253, -252, -252, -252, -257, -257,
285 -252, -252, -252, -252, -252, -257, -252, -257, -246, -238,
286 -235, -234, -233, -224, -252, -221, -220, -219, -218, -252,
287 -252, -211, -210, -209, -257, -252, -257, -257, -257, -257,
288 -257, -257, -257, -257, -252, -252, -252, -252, -252, -252,
289 -257, -257, -257, -257, -257, -257, -257, -206, -205, -204,
290 -257, -203, 0, 0, 0, -252, -252, -202, -200, -257,
291 0, -252, -197, -252, -252, -194, -193, -252, -252, 0,
292 -252, -253, -257, -192, -191, -189, -186, 0, -327, -316,
293 -213, -187, 0, 0, 0, 0, 0, 0, 0, 0,
294 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
295 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
296 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
297 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
298 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
299 0, 0, 0, 0, -185, 0, 0, 0, 0, 0,
300 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
301 0, 0, 0, 0, 0, -172, -171, -170, 0, -169,
302 -168, -167, -159, -157, 0, -155, -154, -153, -152, -151,
303 -257, -150, -242, -252, -148, -257, -257, -257, -257, -144,
304 -252, -257, -143, -142, -139, 0, 0, -137, 0, 0,
305 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
306 0, 0, -136, -124, -123, 0, -117, -116, -110, -109,
307 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
308 0, 0, 0, -358, 0, 0, 0, 0, 0, -98,
309 -91, -90, -252, -257, 0, -84, 0, 0, 0, 0,
310 0, 0, 0, -84, 0,};
311const short c_rindex[] =
312 { 0,
313 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
314 0, 0, 0, 0, 0, 0, 297, 298, 299, 0,
315 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
316 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
317 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
318 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
319 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
320 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
321 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
322 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
323 0, 0, 0, 0, 0, 0, 0, 0, 311, 312,
324 325, 326, 0, 0, 0, 0, 0, 0, 0, 0,
325 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
326 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
327 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
328 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
329 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
330 0, 0, 0, 0, 117, 0, 0, 0, 0, 0,
331 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
332 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
333 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
334 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
335 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
336 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
337 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
338 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
339 0, 0, 0, 232, 0, 0, 0, 0, 0, 0,
340 0, 0, 0, 0, 0, 1, 0, 0, 0, 0,
341 0, 0, 0, 1, 0,};
342const short c_gindex[] =
343 { 0,
344 20, -25, -68, 0, 0, 0, 0, 0, 0, 0,
345 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
346 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
347 0, -53, 0, 0, 0, -162, 0, 0,
348};
349#define YYTABLESIZE802 802
350const short c_table[] =
351 { 113,
352 163, 119, 120, 115, 117, 123, 124, 125, 126, 127,
353 131, 129, 196, 197, 248, 272, 273, 274, 132, 137,
354 198, 133, 134, 135, 142, 143, 200, 201, 202, 203,
355 148, 204, 136, 190, 2, 138, 139, 140, 141, 157,
356 158, 159, 160, 161, 162, 144, 145, 146, 121, 122,
357 170, 171, 172, 174, 178, 128, 179, 130, 230, 182,
358 176, 177, 185, 186, 192, 193, 181, 194, 183, 184,
359 195, 232, 187, 188, 147, 189, 149, 150, 151, 152,
360 153, 154, 155, 156, 233, 234, 235, 236, 237, 238,
361 163, 164, 165, 166, 167, 168, 169, 239, 3, 240,
362 173, 241, 242, 243, 244, 245, 247, 4, 252, 180,
363 249, 250, 257, 260, 261, 5, 77, 262, 6, 263,
364 265, 285, 191, 7, 92, 93, 94, 95, 96, 97,
365 98, 99, 266, 267, 206, 207, 208, 209, 210, 268,
366 269, 211, 212, 213, 214, 215, 270, 271, 8, 216,
367 217, 218, 219, 220, 221, 222, 223, 224, 277, 225,
368 228, 207, 208, 209, 210, 278, 279, 211, 212, 213,
369 214, 215, 282, 0, 0, 216, 217, 218, 219, 220,
370 221, 222, 223, 224, 0, 225, 0, 0, 251, 0,
371 0, 0, 0, 0, 0, 258, 101, 102, 103, 104,
372 105, 106, 107, 0, 0, 0, 0, 0, 0, 0,
373 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
374 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
375 246, 14, 0, 0, 0, 253, 254, 255, 256, 0,
376 0, 259, 0, 0, 0, 0, 0, 280, 0, 0,
377 0, 0, 0, 0, 0, 0, 0, 0, 163, 0,
378 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
379 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
380 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
381 0, 0, 0, 281, 0, 0, 10, 88, 99, 0,
382 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
383 119, 110, 0, 0, 0, 0, 0, 0, 0, 0,
384 0, 0, 163, 0, 132, 126, 0, 0, 0, 0,
385 0, 163, 0, 0, 0, 0, 0, 0, 0, 163,
386 0, 0, 163, 0, 0, 0, 0, 163, 163, 163,
387 163, 163, 163, 0, 0, 163, 163, 163, 163, 163,
388 0, 0, 0, 163, 163, 163, 163, 163, 163, 163,
389 163, 163, 163, 163, 77, 77, 77, 77, 77, 77,
390 77, 77, 77, 77, 77, 77, 77, 77, 77, 77,
391 77, 77, 77, 77, 77, 77, 77, 77, 77, 77,
392 77, 77, 77, 77, 77, 77, 77, 77, 77, 77,
393 77, 77, 77, 77, 77, 77, 77, 77, 77, 77,
394 77, 77, 77, 77, 77, 77, 77, 77, 77, 77,
395 77, 77, 77, 77, 77, 77, 77, 77, 77, 0,
396 0, 0, 0, 0, 0, 0, 0, 77, 0, 0,
397 0, 0, 0, 0, 0, 77, 0, 0, 77, 0,
398 0, 0, 0, 77, 0, 0, 0, 0, 0, 0,
399 0, 0, 0, 0, 0, 0, 77, 77, 77, 0,
400 0, 0, 0, 0, 0, 0, 0, 0, 77, 14,
401 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
402 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
403 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
404 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
405 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
406 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
407 14, 14, 14, 14, 10, 88, 99, 0, 0, 0,
408 0, 0, 14, 0, 0, 0, 0, 0, 119, 110,
409 14, 0, 0, 14, 0, 0, 0, 0, 14, 0,
410 0, 0, 132, 126, 0, 0, 0, 0, 0, 0,
411 0, 14, 14, 14, 0, 0, 0, 0, 0, 0,
412 0, 0, 0, 14, 0, 0, 0, 0, 0, 0,
413 0, 0, 0, 0, 0, 0, 0, 0, 10, 88,
414 99, 0, 0, 0, 0, 0, 0, 10, 88, 99,
415 0, 0, 119, 110, 0, 10, 88, 99, 10, 88,
416 99, 119, 110, 10, 88, 99, 132, 126, 0, 119,
417 110, 0, 119, 110, 0, 132, 126, 119, 110, 0,
418 0, 0, 0, 132, 126, 0, 132, 126, 10, 88,
419 99, 132, 126, 0, 0, 0, 0, 0, 0, 0,
420 0, 0, 119, 110, 0, 0, 0, 0, 0, 0,
421 0, 0, 0, 0, 0, 0, 132, 126, 24, 25,
422 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
423 36, 37, 38, 39, 40, 41, 42, 43, 44, 45,
424 46, 47, 48, 49, 50, 51, 52, 53, 54, 55,
425 56, 57, 58, 59, 60, 61, 62, 63, 64, 65,
426 66, 67, 68, 69, 70, 71, 72, 73, 74, 75,
427 76, 77, 78, 79, 80, 81, 82, 83, 84, 85,
428 86, 0, 0, 0, 0, 0, 0, 0, 0, 0,
429 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
430 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
431 0, 0, 0, 0, 0, 0, 0, 0, 0, 87,
432 88, 89,
433};
434const short c_check[] =
435 { 257,
436 0, 27, 28, 257, 257, 31, 32, 33, 34, 35,
437 257, 37, 340, 341, 257, 374, 375, 376, 257, 45,
438 348, 257, 257, 257, 50, 51, 343, 344, 345, 346,
439 56, 348, 257, 102, 258, 257, 257, 257, 257, 65,
440 66, 67, 68, 69, 70, 257, 257, 257, 29, 30,
441 257, 257, 257, 257, 257, 36, 257, 38, 112, 257,
442 86, 87, 257, 257, 257, 257, 92, 257, 94, 95,
443 257, 257, 98, 99, 55, 101, 57, 58, 59, 60,
444 61, 62, 63, 64, 257, 257, 257, 257, 257, 257,
445 71, 72, 73, 74, 75, 76, 77, 257, 322, 257,
446 81, 257, 257, 257, 257, 257, 257, 331, 257, 90,
447 353, 354, 257, 257, 257, 339, 0, 257, 342, 257,
448 257, 284, 103, 347, 323, 324, 325, 326, 327, 328,
449 329, 330, 257, 257, 348, 349, 350, 351, 352, 257,
450 257, 355, 356, 357, 358, 359, 257, 257, 372, 363,
451 364, 365, 366, 367, 368, 369, 370, 371, 257, 373,
452 348, 349, 350, 351, 352, 257, 257, 355, 356, 357,
453 358, 359, 257, -1, -1, 363, 364, 365, 366, 367,
454 368, 369, 370, 371, -1, 373, -1, -1, 214, -1,
455 -1, -1, -1, -1, -1, 221, 332, 333, 334, 335,
456 336, 337, 338, -1, -1, -1, -1, -1, -1, -1,
457 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
458 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
459 211, 0, -1, -1, -1, 216, 217, 218, 219, -1,
460 -1, 222, -1, -1, -1, -1, -1, 273, -1, -1,
461 -1, -1, -1, -1, -1, -1, -1, -1, 258, -1,
462 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
463 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
464 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
465 -1, -1, -1, 274, -1, -1, 0, 0, 0, -1,
466 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
467 0, 0, -1, -1, -1, -1, -1, -1, -1, -1,
468 -1, -1, 322, -1, 0, 0, -1, -1, -1, -1,
469 -1, 331, -1, -1, -1, -1, -1, -1, -1, 339,
470 -1, -1, 342, -1, -1, -1, -1, 347, 348, 349,
471 350, 351, 352, -1, -1, 355, 356, 357, 358, 359,
472 -1, -1, -1, 363, 364, 365, 366, 367, 368, 369,
473 370, 371, 372, 373, 258, 259, 260, 261, 262, 263,
474 264, 265, 266, 267, 268, 269, 270, 271, 272, 273,
475 274, 275, 276, 277, 278, 279, 280, 281, 282, 283,
476 284, 285, 286, 287, 288, 289, 290, 291, 292, 293,
477 294, 295, 296, 297, 298, 299, 300, 301, 302, 303,
478 304, 305, 306, 307, 308, 309, 310, 311, 312, 313,
479 314, 315, 316, 317, 318, 319, 320, 321, 322, -1,
480 -1, -1, -1, -1, -1, -1, -1, 331, -1, -1,
481 -1, -1, -1, -1, -1, 339, -1, -1, 342, -1,
482 -1, -1, -1, 347, -1, -1, -1, -1, -1, -1,
483 -1, -1, -1, -1, -1, -1, 360, 361, 362, -1,
484 -1, -1, -1, -1, -1, -1, -1, -1, 372, 258,
485 259, 260, 261, 262, 263, 264, 265, 266, 267, 268,
486 269, 270, 271, 272, 273, 274, 275, 276, 277, 278,
487 279, 280, 281, 282, 283, 284, 285, 286, 287, 288,
488 289, 290, 291, 292, 293, 294, 295, 296, 297, 298,
489 299, 300, 301, 302, 303, 304, 305, 306, 307, 308,
490 309, 310, 311, 312, 313, 314, 315, 316, 317, 318,
491 319, 320, 321, 322, 258, 258, 258, -1, -1, -1,
492 -1, -1, 331, -1, -1, -1, -1, -1, 258, 258,
493 339, -1, -1, 342, -1, -1, -1, -1, 347, -1,
494 -1, -1, 258, 258, -1, -1, -1, -1, -1, -1,
495 -1, 360, 361, 362, -1, -1, -1, -1, -1, -1,
496 -1, -1, -1, 372, -1, -1, -1, -1, -1, -1,
497 -1, -1, -1, -1, -1, -1, -1, -1, 322, 322,
498 322, -1, -1, -1, -1, -1, -1, 331, 331, 331,
499 -1, -1, 322, 322, -1, 339, 339, 339, 342, 342,
500 342, 331, 331, 347, 347, 347, 322, 322, -1, 339,
501 339, -1, 342, 342, -1, 331, 331, 347, 347, -1,
502 -1, -1, -1, 339, 339, -1, 342, 342, 372, 372,
503 372, 347, 347, -1, -1, -1, -1, -1, -1, -1,
504 -1, -1, 372, 372, -1, -1, -1, -1, -1, -1,
505 -1, -1, -1, -1, -1, -1, 372, 372, 259, 260,
506 261, 262, 263, 264, 265, 266, 267, 268, 269, 270,
507 271, 272, 273, 274, 275, 276, 277, 278, 279, 280,
508 281, 282, 283, 284, 285, 286, 287, 288, 289, 290,
509 291, 292, 293, 294, 295, 296, 297, 298, 299, 300,
510 301, 302, 303, 304, 305, 306, 307, 308, 309, 310,
511 311, 312, 313, 314, 315, 316, 317, 318, 319, 320,
512 321, -1, -1, -1, -1, -1, -1, -1, -1, -1,
513 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
514 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
515 -1, -1, -1, -1, -1, -1, -1, -1, -1, 360,
516 361, 362,
517};
518#define YYFINAL1 1
519#ifndef YYDEBUG0
520#define YYDEBUG0 0
521#endif
522#define YYMAXTOKEN376 376
523#if YYDEBUG0
524const char * const c_name[] =
525 {
526"end-of-file",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
5270,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
5280,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
5290,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
5300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
5310,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
5320,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"STRING","VAR_SERVER",
533"VAR_SERVER_COUNT","VAR_IP_ADDRESS","VAR_IP_TRANSPARENT","VAR_IP_FREEBIND",
534"VAR_REUSEPORT","VAR_SEND_BUFFER_SIZE","VAR_RECEIVE_BUFFER_SIZE",
535"VAR_DEBUG_MODE","VAR_IP4_ONLY","VAR_IP6_ONLY","VAR_DO_IP4","VAR_DO_IP6",
536"VAR_PORT","VAR_USE_SYSTEMD","VAR_VERBOSITY","VAR_USERNAME","VAR_CHROOT",
537"VAR_ZONESDIR","VAR_ZONELISTFILE","VAR_DATABASE","VAR_LOGFILE",
538"VAR_LOG_ONLY_SYSLOG","VAR_PIDFILE","VAR_DIFFFILE","VAR_XFRDFILE","VAR_XFRDIR",
539"VAR_HIDE_VERSION","VAR_HIDE_IDENTITY","VAR_VERSION","VAR_IDENTITY","VAR_NSID",
540"VAR_TCP_COUNT","VAR_TCP_REJECT_OVERFLOW","VAR_TCP_QUERY_COUNT",
541"VAR_TCP_TIMEOUT","VAR_TCP_MSS","VAR_OUTGOING_TCP_MSS","VAR_IPV4_EDNS_SIZE",
542"VAR_IPV6_EDNS_SIZE","VAR_STATISTICS","VAR_XFRD_RELOAD_TIMEOUT",
543"VAR_LOG_TIME_ASCII","VAR_ROUND_ROBIN","VAR_MINIMAL_RESPONSES",
544"VAR_CONFINE_TO_ZONE","VAR_REFUSE_ANY","VAR_ZONEFILES_CHECK",
545"VAR_ZONEFILES_WRITE","VAR_RRL_SIZE","VAR_RRL_RATELIMIT","VAR_RRL_SLIP",
546"VAR_RRL_IPV4_PREFIX_LENGTH","VAR_RRL_IPV6_PREFIX_LENGTH",
547"VAR_RRL_WHITELIST_RATELIMIT","VAR_TLS_SERVICE_KEY","VAR_TLS_SERVICE_PEM",
548"VAR_TLS_SERVICE_OCSP","VAR_TLS_PORT","VAR_TLS_CERT_BUNDLE","VAR_CPU_AFFINITY",
549"VAR_XFRD_CPU_AFFINITY","VAR_SERVER_CPU_AFFINITY","VAR_DROP_UPDATES",
550"VAR_DNSTAP","VAR_DNSTAP_ENABLE","VAR_DNSTAP_SOCKET_PATH",
551"VAR_DNSTAP_SEND_IDENTITY","VAR_DNSTAP_SEND_VERSION","VAR_DNSTAP_IDENTITY",
552"VAR_DNSTAP_VERSION","VAR_DNSTAP_LOG_AUTH_QUERY_MESSAGES",
553"VAR_DNSTAP_LOG_AUTH_RESPONSE_MESSAGES","VAR_REMOTE_CONTROL",
554"VAR_CONTROL_ENABLE","VAR_CONTROL_INTERFACE","VAR_CONTROL_PORT",
555"VAR_SERVER_KEY_FILE","VAR_SERVER_CERT_FILE","VAR_CONTROL_KEY_FILE",
556"VAR_CONTROL_CERT_FILE","VAR_KEY","VAR_ALGORITHM","VAR_SECRET","VAR_TLS_AUTH",
557"VAR_TLS_AUTH_DOMAIN_NAME","VAR_TLS_AUTH_CLIENT_CERT","VAR_TLS_AUTH_CLIENT_KEY",
558"VAR_TLS_AUTH_CLIENT_KEY_PW","VAR_PATTERN","VAR_NAME","VAR_ZONEFILE",
559"VAR_NOTIFY","VAR_PROVIDE_XFR","VAR_ALLOW_QUERY","VAR_AXFR","VAR_UDP",
560"VAR_NOTIFY_RETRY","VAR_ALLOW_NOTIFY","VAR_REQUEST_XFR",
561"VAR_ALLOW_AXFR_FALLBACK","VAR_OUTGOING_INTERFACE","VAR_ANSWER_COOKIE",
562"VAR_COOKIE_SECRET","VAR_COOKIE_SECRET_FILE","VAR_MAX_REFRESH_TIME",
563"VAR_MIN_REFRESH_TIME","VAR_MAX_RETRY_TIME","VAR_MIN_RETRY_TIME",
564"VAR_MIN_EXPIRE_TIME","VAR_MULTI_MASTER_CHECK","VAR_SIZE_LIMIT_XFR",
565"VAR_ZONESTATS","VAR_INCLUDE_PATTERN","VAR_ZONE","VAR_RRL_WHITELIST",
566"VAR_SERVERS","VAR_BINDTODEVICE","VAR_SETFIB",
567};
568const char * const c_rule[] =
569 {"$accept : blocks",
570"blocks :",
571"blocks : blocks block",
572"block : server",
573"block : dnstap",
574"block : remote_control",
575"block : key",
576"block : tls_auth",
577"block : pattern",
578"block : zone",
579"server : VAR_SERVER server_block",
580"server_block : server_block server_option",
581"server_block :",
582"$$1 :",
583"server_option : VAR_IP_ADDRESS ip_address $$1 socket_options",
584"server_option : VAR_SERVER_COUNT number",
585"server_option : VAR_IP_TRANSPARENT boolean",
586"server_option : VAR_IP_FREEBIND boolean",
587"server_option : VAR_SEND_BUFFER_SIZE number",
588"server_option : VAR_RECEIVE_BUFFER_SIZE number",
589"server_option : VAR_DEBUG_MODE boolean",
590"server_option : VAR_USE_SYSTEMD boolean",
591"server_option : VAR_HIDE_VERSION boolean",
592"server_option : VAR_HIDE_IDENTITY boolean",
593"server_option : VAR_DROP_UPDATES boolean",
594"server_option : VAR_IP4_ONLY boolean",
595"server_option : VAR_IP6_ONLY boolean",
596"server_option : VAR_DO_IP4 boolean",
597"server_option : VAR_DO_IP6 boolean",
598"server_option : VAR_DATABASE STRING",
599"server_option : VAR_IDENTITY STRING",
600"server_option : VAR_VERSION STRING",
601"server_option : VAR_NSID STRING",
602"server_option : VAR_LOGFILE STRING",
603"server_option : VAR_LOG_ONLY_SYSLOG boolean",
604"server_option : VAR_TCP_COUNT number",
605"server_option : VAR_TCP_REJECT_OVERFLOW boolean",
606"server_option : VAR_TCP_QUERY_COUNT number",
607"server_option : VAR_TCP_TIMEOUT number",
608"server_option : VAR_TCP_MSS number",
609"server_option : VAR_OUTGOING_TCP_MSS number",
610"server_option : VAR_IPV4_EDNS_SIZE number",
611"server_option : VAR_IPV6_EDNS_SIZE number",
612"server_option : VAR_PIDFILE STRING",
613"server_option : VAR_PORT number",
614"server_option : VAR_REUSEPORT boolean",
615"server_option : VAR_STATISTICS number",
616"server_option : VAR_CHROOT STRING",
617"server_option : VAR_USERNAME STRING",
618"server_option : VAR_ZONESDIR STRING",
619"server_option : VAR_ZONELISTFILE STRING",
620"server_option : VAR_DIFFFILE STRING",
621"server_option : VAR_XFRDFILE STRING",
622"server_option : VAR_XFRDIR STRING",
623"server_option : VAR_XFRD_RELOAD_TIMEOUT number",
624"server_option : VAR_VERBOSITY number",
625"server_option : VAR_RRL_SIZE number",
626"server_option : VAR_RRL_RATELIMIT number",
627"server_option : VAR_RRL_SLIP number",
628"server_option : VAR_RRL_IPV4_PREFIX_LENGTH number",
629"server_option : VAR_RRL_IPV6_PREFIX_LENGTH number",
630"server_option : VAR_RRL_WHITELIST_RATELIMIT number",
631"server_option : VAR_ZONEFILES_CHECK boolean",
632"server_option : VAR_ZONEFILES_WRITE number",
633"server_option : VAR_LOG_TIME_ASCII boolean",
634"server_option : VAR_ROUND_ROBIN boolean",
635"server_option : VAR_MINIMAL_RESPONSES boolean",
636"server_option : VAR_CONFINE_TO_ZONE boolean",
637"server_option : VAR_REFUSE_ANY boolean",
638"server_option : VAR_TLS_SERVICE_KEY STRING",
639"server_option : VAR_TLS_SERVICE_OCSP STRING",
640"server_option : VAR_TLS_SERVICE_PEM STRING",
641"server_option : VAR_TLS_PORT number",
642"server_option : VAR_TLS_CERT_BUNDLE STRING",
643"server_option : VAR_ANSWER_COOKIE boolean",
644"server_option : VAR_COOKIE_SECRET STRING",
645"server_option : VAR_COOKIE_SECRET_FILE STRING",
646"server_option : VAR_CPU_AFFINITY cpus",
647"server_option : service_cpu_affinity number",
648"socket_options :",
649"socket_options : socket_options socket_option",
650"socket_option : VAR_SERVERS STRING",
651"socket_option : VAR_BINDTODEVICE boolean",
652"socket_option : VAR_SETFIB number",
653"cpus :",
654"cpus : cpus STRING",
655"service_cpu_affinity : VAR_XFRD_CPU_AFFINITY",
656"service_cpu_affinity : VAR_SERVER_CPU_AFFINITY",
657"dnstap : VAR_DNSTAP dnstap_block",
658"dnstap_block : dnstap_block dnstap_option",
659"dnstap_block :",
660"dnstap_option : VAR_DNSTAP_ENABLE boolean",
661"dnstap_option : VAR_DNSTAP_SOCKET_PATH STRING",
662"dnstap_option : VAR_DNSTAP_SEND_IDENTITY boolean",
663"dnstap_option : VAR_DNSTAP_SEND_VERSION boolean",
664"dnstap_option : VAR_DNSTAP_IDENTITY STRING",
665"dnstap_option : VAR_DNSTAP_VERSION STRING",
666"dnstap_option : VAR_DNSTAP_LOG_AUTH_QUERY_MESSAGES boolean",
667"dnstap_option : VAR_DNSTAP_LOG_AUTH_RESPONSE_MESSAGES boolean",
668"remote_control : VAR_REMOTE_CONTROL remote_control_block",
669"remote_control_block : remote_control_block remote_control_option",
670"remote_control_block :",
671"remote_control_option : VAR_CONTROL_ENABLE boolean",
672"remote_control_option : VAR_CONTROL_INTERFACE ip_address",
673"remote_control_option : VAR_CONTROL_PORT number",
674"remote_control_option : VAR_SERVER_KEY_FILE STRING",
675"remote_control_option : VAR_SERVER_CERT_FILE STRING",
676"remote_control_option : VAR_CONTROL_KEY_FILE STRING",
677"remote_control_option : VAR_CONTROL_CERT_FILE STRING",
678"$$2 :",
679"tls_auth : VAR_TLS_AUTH $$2 tls_auth_block",
680"tls_auth_block : tls_auth_block tls_auth_option",
681"tls_auth_block :",
682"tls_auth_option : VAR_NAME STRING",
683"tls_auth_option : VAR_TLS_AUTH_DOMAIN_NAME STRING",
684"tls_auth_option : VAR_TLS_AUTH_CLIENT_CERT STRING",
685"tls_auth_option : VAR_TLS_AUTH_CLIENT_KEY STRING",
686"tls_auth_option : VAR_TLS_AUTH_CLIENT_KEY_PW STRING",
687"$$3 :",
688"key : VAR_KEY $$3 key_block",
689"key_block : key_block key_option",
690"key_block :",
691"key_option : VAR_NAME STRING",
692"key_option : VAR_ALGORITHM STRING",
693"key_option : VAR_SECRET STRING",
694"$$4 :",
695"zone : VAR_ZONE $$4 zone_block",
696"zone_block : zone_block zone_option",
697"zone_block :",
698"zone_option : VAR_NAME STRING",
699"zone_option : pattern_or_zone_option",
700"$$5 :",
701"pattern : VAR_PATTERN $$5 pattern_block",
702"pattern_block : pattern_block pattern_option",
703"pattern_block :",
704"pattern_option : VAR_NAME STRING",
705"pattern_option : pattern_or_zone_option",
706"pattern_or_zone_option : VAR_RRL_WHITELIST STRING",
707"pattern_or_zone_option : VAR_ZONEFILE STRING",
708"pattern_or_zone_option : VAR_ZONESTATS STRING",
709"pattern_or_zone_option : VAR_SIZE_LIMIT_XFR number",
710"pattern_or_zone_option : VAR_MULTI_MASTER_CHECK boolean",
711"pattern_or_zone_option : VAR_INCLUDE_PATTERN STRING",
712"$$6 :",
713"pattern_or_zone_option : VAR_REQUEST_XFR STRING STRING $$6 tlsauth_option",
714"$$7 :",
715"pattern_or_zone_option : VAR_REQUEST_XFR VAR_AXFR STRING STRING $$7 tlsauth_option",
716"pattern_or_zone_option : VAR_REQUEST_XFR VAR_UDP STRING STRING",
717"pattern_or_zone_option : VAR_ALLOW_NOTIFY STRING STRING",
718"pattern_or_zone_option : VAR_NOTIFY STRING STRING",
719"pattern_or_zone_option : VAR_PROVIDE_XFR STRING STRING",
720"pattern_or_zone_option : VAR_ALLOW_QUERY STRING STRING",
721"pattern_or_zone_option : VAR_OUTGOING_INTERFACE STRING",
722"pattern_or_zone_option : VAR_ALLOW_AXFR_FALLBACK boolean",
723"pattern_or_zone_option : VAR_NOTIFY_RETRY number",
724"pattern_or_zone_option : VAR_MAX_REFRESH_TIME number",
725"pattern_or_zone_option : VAR_MIN_REFRESH_TIME number",
726"pattern_or_zone_option : VAR_MAX_RETRY_TIME number",
727"pattern_or_zone_option : VAR_MIN_RETRY_TIME number",
728"pattern_or_zone_option : VAR_MIN_EXPIRE_TIME STRING",
729"ip_address : STRING",
730"number : STRING",
731"boolean : STRING",
732"tlsauth_option :",
733"tlsauth_option : STRING",
734};
735#endif
736#ifdef YYSTACKSIZE10000
737#undef YYMAXDEPTH10000
738#define YYMAXDEPTH10000 YYSTACKSIZE10000
739#else
740#ifdef YYMAXDEPTH10000
741#define YYSTACKSIZE10000 YYMAXDEPTH10000
742#else
743#define YYSTACKSIZE10000 10000
744#define YYMAXDEPTH10000 10000
745#endif
746#endif
747#define YYINITSTACKSIZE200 200
748/* LINTUSED */
749int yydebugc_debug;
750int yynerrsc_nerrs;
751int yyerrflagc_errflag;
752int yycharc_char;
753short *yysspc_ssp;
754YYSTYPE *yyvspc_vsp;
755YYSTYPE yyvalc_val;
756YYSTYPE yylvalc_lval;
757short *yyssc_ss;
758short *yysslimc_sslim;
759YYSTYPE *yyvsc_vs;
760unsigned int yystacksizec_stacksize;
761int yyparsec_parse(void);
762#line 995 "/usr/src/usr.sbin/nsd/configparser.y"
763
764static void
765append_acl(struct acl_options **list, struct acl_options *acl)
766{
767 assert(list != NULL)((void)0);
768
769 if(*list == NULL((void*)0)) {
770 *list = acl;
771 } else {
772 struct acl_options *tail = *list;
773 while(tail->next != NULL((void*)0))
774 tail = tail->next;
775 tail->next = acl;
776 }
777}
778
779static void
780add_to_last_acl(struct acl_options **list, char *tls_auth_name)
781{
782 struct acl_options *tail = *list;
783 assert(list != NULL)((void)0);
784 assert(*list != NULL)((void)0);
785 while(tail->next != NULL((void*)0))
786 tail = tail->next;
787 tail->tls_auth_name = tls_auth_name;
788}
789
790static int
791parse_boolean(const char *str, int *bln)
792{
793 if(strcmp(str, "yes") == 0) {
794 *bln = 1;
795 } else if(strcmp(str, "no") == 0) {
796 *bln = 0;
797 } else {
798 return 0;
799 }
800
801 return 1;
802}
803
804static int
805parse_expire_expr(const char *str, long long *num, uint8_t *expr)
806{
807 if(parse_number(str, num)) {
808 *expr = EXPIRE_TIME_HAS_VALUE0;
809 return 1;
810 }
811 if(strcmp(str, REFRESHPLUSRETRYPLUS1_STR"refresh+retry+1") == 0) {
812 *num = 0;
813 *expr = REFRESHPLUSRETRYPLUS12;
814 return 1;
815 }
816 return 0;
817}
818
819static int
820parse_number(const char *str, long long *num)
821{
822 /* ensure string consists entirely of digits */
823 size_t pos = 0;
824 while(str[pos] >= '0' && str[pos] <= '9') {
825 pos++;
826 }
827
828 if(pos != 0 && str[pos] == '\0') {
829 *num = strtoll(str, NULL((void*)0), 10);
830 return 1;
831 }
832
833 return 0;
834}
835
836static int
837parse_range(const char *str, long long *low, long long *high)
838{
839 const char *ptr = str;
840 long long num[2];
841
842 /* require range to begin with a number */
843 if(*ptr < '0' || *ptr > '9') {
844 return 0;
845 }
846
847 num[0] = strtoll(ptr, (char **)&ptr, 10);
848
849 /* require number to be followed by nothing at all or a dash */
850 if(*ptr == '\0') {
851 *low = num[0];
852 *high = num[0];
853 return 1;
854 } else if(*ptr != '-') {
855 return 0;
856 }
857
858 ++ptr;
859 /* require dash to be followed by a number */
860 if(*ptr < '0' || *ptr > '9') {
861 return 0;
862 }
863
864 num[1] = strtoll(ptr, (char **)&ptr, 10);
865
866 /* require number to be followed by nothing at all */
867 if(*ptr == '\0') {
868 if(num[0] < num[1]) {
869 *low = num[0];
870 *high = num[1];
871 } else {
872 *low = num[1];
873 *high = num[0];
874 }
875 return 1;
876 }
877
878 return 0;
879}
880#line 873 "configparser.c"
881/* allocate initial stack or double stack size, up to YYMAXDEPTH */
882static int yygrowstack(void)
883{
884 unsigned int newsize;
885 long sslen;
886 short *newss;
887 YYSTYPE *newvs;
888
889 if ((newsize = yystacksizec_stacksize) == 0)
22
Assuming the condition is false
23
Taking false branch
890 newsize = YYINITSTACKSIZE200;
891 else if (newsize >= YYMAXDEPTH10000)
24
Assuming 'newsize' is < YYMAXDEPTH
25
Taking false branch
892 return -1;
893 else if ((newsize *= 2) > YYMAXDEPTH10000)
26
Assuming the condition is false
27
Taking false branch
894 newsize = YYMAXDEPTH10000;
895 sslen = yysspc_ssp - yyssc_ss;
896#ifdef SIZE_MAX0xffffffffffffffffUL
897#define YY_SIZE_MAX0xffffffffffffffffUL SIZE_MAX0xffffffffffffffffUL
898#else
899#define YY_SIZE_MAX0xffffffffffffffffUL 0xffffffffU
900#endif
901 if (newsize && YY_SIZE_MAX0xffffffffffffffffUL / newsize < sizeof *newss)
28
Assuming 'newsize' is 0
902 goto bail;
903 newss = (short *)realloc(yyssc_ss, newsize * sizeof *newss);
29
Memory is released
904 if (newss == NULL((void*)0))
30
Assuming 'newss' is equal to NULL
31
Taking true branch
905 goto bail;
32
Control jumps to line 919
906 yyssc_ss = newss;
907 yysspc_ssp = newss + sslen;
908 if (newsize && YY_SIZE_MAX0xffffffffffffffffUL / newsize < sizeof *newvs)
909 goto bail;
910 newvs = (YYSTYPE *)realloc(yyvsc_vs, newsize * sizeof *newvs);
911 if (newvs == NULL((void*)0))
912 goto bail;
913 yyvsc_vs = newvs;
914 yyvspc_vsp = newvs + sslen;
915 yystacksizec_stacksize = newsize;
916 yysslimc_sslim = yyssc_ss + newsize - 1;
917 return 0;
918bail:
919 if (yyssc_ss)
33
Assuming 'c_ss' is non-null
34
Taking true branch
920 free(yyssc_ss);
35
Attempt to free released memory
921 if (yyvsc_vs)
922 free(yyvsc_vs);
923 yyssc_ss = yysspc_ssp = NULL((void*)0);
924 yyvsc_vs = yyvspc_vsp = NULL((void*)0);
925 yystacksizec_stacksize = 0;
926 return -1;
927}
928
929#define YYABORTgoto yyabort goto yyabort
930#define YYREJECTgoto yyabort goto yyabort
931#define YYACCEPTgoto yyaccept goto yyaccept
932#define YYERRORgoto yyerrlab goto yyerrlab
933int
934yyparsec_parse(void)
935{
936 int yym, yyn, yystate;
937#if YYDEBUG0
938 const char *yys;
939
940 if ((yys = getenv("YYDEBUG")))
941 {
942 yyn = *yys;
943 if (yyn >= '0' && yyn <= '9')
944 yydebugc_debug = yyn - '0';
945 }
946#endif /* YYDEBUG */
947
948 yynerrsc_nerrs = 0;
949 yyerrflagc_errflag = 0;
950 yycharc_char = (-1);
951
952 if (yyssc_ss == NULL((void*)0) && yygrowstack()) goto yyoverflow;
1
Assuming 'c_ss' is not equal to NULL
953 yysspc_ssp = yyssc_ss;
954 yyvspc_vsp = yyvsc_vs;
955 *yysspc_ssp = yystate = 0;
956
957yyloop:
958 if ((yyn = yydefredc_defred[yystate]) != 0) goto yyreduce;
2
Taking true branch
3
Control jumps to line 1065
13
Taking false branch
959 if (yycharc_char < 0)
14
Taking false branch
960 {
961 if ((yycharc_char = yylexc_lex()) < 0) yycharc_char = 0;
962#if YYDEBUG0
963 if (yydebugc_debug)
964 {
965 yys = 0;
966 if (yycharc_char <= YYMAXTOKEN376) yys = yynamec_name[yycharc_char];
967 if (!yys) yys = "illegal-symbol";
968 printf("%sdebug: state %d, reading %d (%s)\n",
969 YYPREFIX"c_", yystate, yycharc_char, yys);
970 }
971#endif
972 }
973 if ((yyn = yysindexc_sindex[yystate]) && (yyn += yycharc_char) >= 0 &&
15
Assuming 'yyn' is not equal to 0
16
Assuming the condition is true
19
Taking true branch
974 yyn <= YYTABLESIZE802 && yycheckc_check[yyn] == yycharc_char)
17
Assuming 'yyn' is <= YYTABLESIZE
18
Assuming the condition is true
975 {
976#if YYDEBUG0
977 if (yydebugc_debug)
978 printf("%sdebug: state %d, shifting to state %d\n",
979 YYPREFIX"c_", yystate, yytablec_table[yyn]);
980#endif
981 if (yysspc_ssp >= yysslimc_sslim && yygrowstack())
20
Assuming 'c_ssp' is >= 'c_sslim'
21
Calling 'yygrowstack'
982 {
983 goto yyoverflow;
984 }
985 *++yysspc_ssp = yystate = yytablec_table[yyn];
986 *++yyvspc_vsp = yylvalc_lval;
987 yycharc_char = (-1);
988 if (yyerrflagc_errflag > 0) --yyerrflagc_errflag;
989 goto yyloop;
990 }
991 if ((yyn = yyrindexc_rindex[yystate]) && (yyn += yycharc_char) >= 0 &&
992 yyn <= YYTABLESIZE802 && yycheckc_check[yyn] == yycharc_char)
993 {
994 yyn = yytablec_table[yyn];
995 goto yyreduce;
996 }
997 if (yyerrflagc_errflag) goto yyinrecovery;
998#if defined(__GNUC__4)
999 goto yynewerror;
1000#endif
1001yynewerror:
1002 yyerrorc_error("syntax error");
1003#if defined(__GNUC__4)
1004 goto yyerrlab;
1005#endif
1006yyerrlab:
1007 ++yynerrsc_nerrs;
1008yyinrecovery:
1009 if (yyerrflagc_errflag < 3)
1010 {
1011 yyerrflagc_errflag = 3;
1012 for (;;)
1013 {
1014 if ((yyn = yysindexc_sindex[*yysspc_ssp]) && (yyn += YYERRCODE256) >= 0 &&
1015 yyn <= YYTABLESIZE802 && yycheckc_check[yyn] == YYERRCODE256)
1016 {
1017#if YYDEBUG0
1018 if (yydebugc_debug)
1019 printf("%sdebug: state %d, error recovery shifting\
1020 to state %d\n", YYPREFIX"c_", *yysspc_ssp, yytablec_table[yyn]);
1021#endif
1022 if (yysspc_ssp >= yysslimc_sslim && yygrowstack())
1023 {
1024 goto yyoverflow;
1025 }
1026 *++yysspc_ssp = yystate = yytablec_table[yyn];
1027 *++yyvspc_vsp = yylvalc_lval;
1028 goto yyloop;
1029 }
1030 else
1031 {
1032#if YYDEBUG0
1033 if (yydebugc_debug)
1034 printf("%sdebug: error recovery discarding state %d\n",
1035 YYPREFIX"c_", *yysspc_ssp);
1036#endif
1037 if (yysspc_ssp <= yyssc_ss) goto yyabort;
1038 --yysspc_ssp;
1039 --yyvspc_vsp;
1040 }
1041 }
1042 }
1043 else
1044 {
1045 if (yycharc_char == 0) goto yyabort;
1046#if YYDEBUG0
1047 if (yydebugc_debug)
1048 {
1049 yys = 0;
1050 if (yycharc_char <= YYMAXTOKEN376) yys = yynamec_name[yycharc_char];
1051 if (!yys) yys = "illegal-symbol";
1052 printf("%sdebug: state %d, error recovery discards token %d (%s)\n",
1053 YYPREFIX"c_", yystate, yycharc_char, yys);
1054 }
1055#endif
1056 yycharc_char = (-1);
1057 goto yyloop;
1058 }
1059yyreduce:
1060#if YYDEBUG0
1061 if (yydebugc_debug)
1062 printf("%sdebug: state %d, reducing by rule %d (%s)\n",
1063 YYPREFIX"c_", yystate, yyn, yyrulec_rule[yyn]);
1064#endif
1065 yym = yylenc_len[yyn];
1066 if (yym
3.1
'yym' is 0
)
4
Taking false branch
1067 yyvalc_val = yyvspc_vsp[1-yym];
1068 else
1069 memset(&yyvalc_val, 0, sizeof yyvalc_val);
1070 switch (yyn)
5
'Default' branch taken. Execution continues on line 2047
1071 {
1072case 13:
1073#line 215 "/usr/src/usr.sbin/nsd/configparser.y"
1074{
1075 struct ip_address_option *ip = cfg_parser->opt->ip_addresses;
1076
1077 if(ip == NULL((void*)0)) {
1078 cfg_parser->opt->ip_addresses = yyvspc_vsp[0].ip;
1079 } else {
1080 while(ip->next) { ip = ip->next; }
1081 ip->next = yyvspc_vsp[0].ip;
1082 }
1083
1084 cfg_parser->ip = yyvspc_vsp[0].ip;
1085 }
1086break;
1087case 14:
1088#line 228 "/usr/src/usr.sbin/nsd/configparser.y"
1089{
1090 cfg_parser->ip = NULL((void*)0);
1091 }
1092break;
1093case 15:
1094#line 232 "/usr/src/usr.sbin/nsd/configparser.y"
1095{
1096 if (yyvspc_vsp[0].llng > 0) {
1097 cfg_parser->opt->server_count = (int)yyvspc_vsp[0].llng;
1098 } else {
1099 yyerrorc_error("expected a number greater than zero");
1100 }
1101 }
1102break;
1103case 16:
1104#line 240 "/usr/src/usr.sbin/nsd/configparser.y"
1105{ cfg_parser->opt->ip_transparent = yyvspc_vsp[0].bln; }
1106break;
1107case 17:
1108#line 242 "/usr/src/usr.sbin/nsd/configparser.y"
1109{ cfg_parser->opt->ip_freebind = yyvspc_vsp[0].bln; }
1110break;
1111case 18:
1112#line 244 "/usr/src/usr.sbin/nsd/configparser.y"
1113{ cfg_parser->opt->send_buffer_size = (int)yyvspc_vsp[0].llng; }
1114break;
1115case 19:
1116#line 246 "/usr/src/usr.sbin/nsd/configparser.y"
1117{ cfg_parser->opt->receive_buffer_size = (int)yyvspc_vsp[0].llng; }
1118break;
1119case 20:
1120#line 248 "/usr/src/usr.sbin/nsd/configparser.y"
1121{ cfg_parser->opt->debug_mode = yyvspc_vsp[0].bln; }
1122break;
1123case 21:
1124#line 250 "/usr/src/usr.sbin/nsd/configparser.y"
1125{ /* ignored, deprecated */ }
1126break;
1127case 22:
1128#line 252 "/usr/src/usr.sbin/nsd/configparser.y"
1129{ cfg_parser->opt->hide_version = yyvspc_vsp[0].bln; }
1130break;
1131case 23:
1132#line 254 "/usr/src/usr.sbin/nsd/configparser.y"
1133{ cfg_parser->opt->hide_identity = yyvspc_vsp[0].bln; }
1134break;
1135case 24:
1136#line 256 "/usr/src/usr.sbin/nsd/configparser.y"
1137{ cfg_parser->opt->drop_updates = yyvspc_vsp[0].bln; }
1138break;
1139case 25:
1140#line 258 "/usr/src/usr.sbin/nsd/configparser.y"
1141{ if(yyvspc_vsp[0].bln) { cfg_parser->opt->do_ip4 = 1; cfg_parser->opt->do_ip6 = 0; } }
1142break;
1143case 26:
1144#line 260 "/usr/src/usr.sbin/nsd/configparser.y"
1145{ if(yyvspc_vsp[0].bln) { cfg_parser->opt->do_ip4 = 0; cfg_parser->opt->do_ip6 = 1; } }
1146break;
1147case 27:
1148#line 262 "/usr/src/usr.sbin/nsd/configparser.y"
1149{ cfg_parser->opt->do_ip4 = yyvspc_vsp[0].bln; }
1150break;
1151case 28:
1152#line 264 "/usr/src/usr.sbin/nsd/configparser.y"
1153{ cfg_parser->opt->do_ip6 = yyvspc_vsp[0].bln; }
1154break;
1155case 29:
1156#line 266 "/usr/src/usr.sbin/nsd/configparser.y"
1157{
1158 cfg_parser->opt->database = region_strdup(cfg_parser->opt->region, yyvspc_vsp[0].str);
1159 if(cfg_parser->opt->database[0] == 0 &&
1160 cfg_parser->opt->zonefiles_write == 0)
1161 {
1162 cfg_parser->opt->zonefiles_write = ZONEFILES_WRITE_INTERVAL3600;
1163 }
1164 }
1165break;
1166case 30:
1167#line 275 "/usr/src/usr.sbin/nsd/configparser.y"
1168{ cfg_parser->opt->identity = region_strdup(cfg_parser->opt->region, yyvspc_vsp[0].str); }
1169break;
1170case 31:
1171#line 277 "/usr/src/usr.sbin/nsd/configparser.y"
1172{ cfg_parser->opt->version = region_strdup(cfg_parser->opt->region, yyvspc_vsp[0].str); }
1173break;
1174case 32:
1175#line 279 "/usr/src/usr.sbin/nsd/configparser.y"
1176{
1177 unsigned char* nsid = 0;
1178 size_t nsid_len = strlen(yyvspc_vsp[0].str);
1179
1180 if (strncasecmp(yyvspc_vsp[0].str, "ascii_", 6) == 0) {
1181 nsid_len -= 6; /* discard "ascii_" */
1182 if(nsid_len < 65535) {
1183 cfg_parser->opt->nsid = region_alloc(cfg_parser->opt->region, nsid_len*2+1);
1184 hex_ntop((uint8_t*)yyvspc_vsp[0].str+6, nsid_len, (char*)cfg_parser->opt->nsid, nsid_len*2+1);
1185 } else {
1186 yyerrorc_error("NSID too long");
1187 }
1188 } else if (nsid_len % 2 != 0) {
1189 yyerrorc_error("the NSID must be a hex string of an even length.");
1190 } else {
1191 nsid_len = nsid_len / 2;
1192 if(nsid_len < 65535) {
1193 nsid = xalloc(nsid_len);
1194 if (hex_pton(yyvspc_vsp[0].str, nsid, nsid_len) == -1) {
1195 yyerrorc_error("hex string cannot be parsed in NSID.");
1196 } else {
1197 cfg_parser->opt->nsid = region_strdup(cfg_parser->opt->region, yyvspc_vsp[0].str);
1198 }
1199 free(nsid);
1200 } else {
1201 yyerrorc_error("NSID too long");
1202 }
1203 }
1204 }
1205break;
1206case 33:
1207#line 309 "/usr/src/usr.sbin/nsd/configparser.y"
1208{ cfg_parser->opt->logfile = region_strdup(cfg_parser->opt->region, yyvspc_vsp[0].str); }
1209break;
1210case 34:
1211#line 311 "/usr/src/usr.sbin/nsd/configparser.y"
1212{ cfg_parser->opt->log_only_syslog = yyvspc_vsp[0].bln; }
1213break;
1214case 35:
1215#line 313 "/usr/src/usr.sbin/nsd/configparser.y"
1216{
1217 if (yyvspc_vsp[0].llng > 0) {
1218 cfg_parser->opt->tcp_count = (int)yyvspc_vsp[0].llng;
1219 } else {
1220 yyerrorc_error("expected a number greater than zero");
1221 }
1222 }
1223break;
1224case 36:
1225#line 321 "/usr/src/usr.sbin/nsd/configparser.y"
1226{ cfg_parser->opt->tcp_reject_overflow = yyvspc_vsp[0].bln; }
1227break;
1228case 37:
1229#line 323 "/usr/src/usr.sbin/nsd/configparser.y"
1230{ cfg_parser->opt->tcp_query_count = (int)yyvspc_vsp[0].llng; }
1231break;
1232case 38:
1233#line 325 "/usr/src/usr.sbin/nsd/configparser.y"
1234{ cfg_parser->opt->tcp_timeout = (int)yyvspc_vsp[0].llng; }
1235break;
1236case 39:
1237#line 327 "/usr/src/usr.sbin/nsd/configparser.y"
1238{ cfg_parser->opt->tcp_mss = (int)yyvspc_vsp[0].llng; }
1239break;
1240case 40:
1241#line 329 "/usr/src/usr.sbin/nsd/configparser.y"
1242{ cfg_parser->opt->outgoing_tcp_mss = (int)yyvspc_vsp[0].llng; }
1243break;
1244case 41:
1245#line 331 "/usr/src/usr.sbin/nsd/configparser.y"
1246{ cfg_parser->opt->ipv4_edns_size = (size_t)yyvspc_vsp[0].llng; }
1247break;
1248case 42:
1249#line 333 "/usr/src/usr.sbin/nsd/configparser.y"
1250{ cfg_parser->opt->ipv6_edns_size = (size_t)yyvspc_vsp[0].llng; }
1251break;
1252case 43:
1253#line 335 "/usr/src/usr.sbin/nsd/configparser.y"
1254{ cfg_parser->opt->pidfile = region_strdup(cfg_parser->opt->region, yyvspc_vsp[0].str); }
1255break;
1256case 44:
1257#line 337 "/usr/src/usr.sbin/nsd/configparser.y"
1258{
1259 /* port number, stored as a string */
1260 char buf[16];
1261 (void)snprintf(buf, sizeof(buf), "%lld", yyvspc_vsp[0].llng);
1262 cfg_parser->opt->port = region_strdup(cfg_parser->opt->region, buf);
1263 }
1264break;
1265case 45:
1266#line 344 "/usr/src/usr.sbin/nsd/configparser.y"
1267{ cfg_parser->opt->reuseport = yyvspc_vsp[0].bln; }
1268break;
1269case 46:
1270#line 346 "/usr/src/usr.sbin/nsd/configparser.y"
1271{ cfg_parser->opt->statistics = (int)yyvspc_vsp[0].llng; }
1272break;
1273case 47:
1274#line 348 "/usr/src/usr.sbin/nsd/configparser.y"
1275{ cfg_parser->opt->chroot = region_strdup(cfg_parser->opt->region, yyvspc_vsp[0].str); }
1276break;
1277case 48:
1278#line 350 "/usr/src/usr.sbin/nsd/configparser.y"
1279{ cfg_parser->opt->username = region_strdup(cfg_parser->opt->region, yyvspc_vsp[0].str); }
1280break;
1281case 49:
1282#line 352 "/usr/src/usr.sbin/nsd/configparser.y"
1283{ cfg_parser->opt->zonesdir = region_strdup(cfg_parser->opt->region, yyvspc_vsp[0].str); }
1284break;
1285case 50:
1286#line 354 "/usr/src/usr.sbin/nsd/configparser.y"
1287{ cfg_parser->opt->zonelistfile = region_strdup(cfg_parser->opt->region, yyvspc_vsp[0].str); }
1288break;
1289case 51:
1290#line 356 "/usr/src/usr.sbin/nsd/configparser.y"
1291{ /* ignored, deprecated */ }
1292break;
1293case 52:
1294#line 358 "/usr/src/usr.sbin/nsd/configparser.y"
1295{ cfg_parser->opt->xfrdfile = region_strdup(cfg_parser->opt->region, yyvspc_vsp[0].str); }
1296break;
1297case 53:
1298#line 360 "/usr/src/usr.sbin/nsd/configparser.y"
1299{ cfg_parser->opt->xfrdir = region_strdup(cfg_parser->opt->region, yyvspc_vsp[0].str); }
1300break;
1301case 54:
1302#line 362 "/usr/src/usr.sbin/nsd/configparser.y"
1303{ cfg_parser->opt->xfrd_reload_timeout = (int)yyvspc_vsp[0].llng; }
1304break;
1305case 55:
1306#line 364 "/usr/src/usr.sbin/nsd/configparser.y"
1307{ cfg_parser->opt->verbosity = (int)yyvspc_vsp[0].llng; }
1308break;
1309case 56:
1310#line 366 "/usr/src/usr.sbin/nsd/configparser.y"
1311{
1312#ifdef RATELIMIT
1313 if (yyvspc_vsp[0].llng > 0) {
1314 cfg_parser->opt->rrl_size = (size_t)yyvspc_vsp[0].llng;
1315 } else {
1316 yyerrorc_error("expected a number greater than zero");
1317 }
1318#endif
1319 }
1320break;
1321case 57:
1322#line 376 "/usr/src/usr.sbin/nsd/configparser.y"
1323{
1324#ifdef RATELIMIT
1325 cfg_parser->opt->rrl_ratelimit = (size_t)yyvspc_vsp[0].llng;
1326#endif
1327 }
1328break;
1329case 58:
1330#line 382 "/usr/src/usr.sbin/nsd/configparser.y"
1331{
1332#ifdef RATELIMIT
1333 cfg_parser->opt->rrl_slip = (size_t)yyvspc_vsp[0].llng;
1334#endif
1335 }
1336break;
1337case 59:
1338#line 388 "/usr/src/usr.sbin/nsd/configparser.y"
1339{
1340#ifdef RATELIMIT
1341 if (yyvspc_vsp[0].llng > 32) {
1342 yyerrorc_error("invalid IPv4 prefix length");
1343 } else {
1344 cfg_parser->opt->rrl_ipv4_prefix_length = (size_t)yyvspc_vsp[0].llng;
1345 }
1346#endif
1347 }
1348break;
1349case 60:
1350#line 398 "/usr/src/usr.sbin/nsd/configparser.y"
1351{
1352#ifdef RATELIMIT
1353 if (yyvspc_vsp[0].llng > 64) {
1354 yyerrorc_error("invalid IPv6 prefix length");
1355 } else {
1356 cfg_parser->opt->rrl_ipv6_prefix_length = (size_t)yyvspc_vsp[0].llng;
1357 }
1358#endif
1359 }
1360break;
1361case 61:
1362#line 408 "/usr/src/usr.sbin/nsd/configparser.y"
1363{
1364#ifdef RATELIMIT
1365 cfg_parser->opt->rrl_whitelist_ratelimit = (size_t)yyvspc_vsp[0].llng;
1366#endif
1367 }
1368break;
1369case 62:
1370#line 414 "/usr/src/usr.sbin/nsd/configparser.y"
1371{ cfg_parser->opt->zonefiles_check = yyvspc_vsp[0].bln; }
1372break;
1373case 63:
1374#line 416 "/usr/src/usr.sbin/nsd/configparser.y"
1375{ cfg_parser->opt->zonefiles_write = (int)yyvspc_vsp[0].llng; }
1376break;
1377case 64:
1378#line 418 "/usr/src/usr.sbin/nsd/configparser.y"
1379{
1380 cfg_parser->opt->log_time_ascii = yyvspc_vsp[0].bln;
1381 log_time_asc = cfg_parser->opt->log_time_ascii;
1382 }
1383break;
1384case 65:
1385#line 423 "/usr/src/usr.sbin/nsd/configparser.y"
1386{
1387 cfg_parser->opt->round_robin = yyvspc_vsp[0].bln;
1388 round_robin = cfg_parser->opt->round_robin;
1389 }
1390break;
1391case 66:
1392#line 428 "/usr/src/usr.sbin/nsd/configparser.y"
1393{
1394 cfg_parser->opt->minimal_responses = yyvspc_vsp[0].bln;
1395 minimal_responses = cfg_parser->opt->minimal_responses;
1396 }
1397break;
1398case 67:
1399#line 433 "/usr/src/usr.sbin/nsd/configparser.y"
1400{ cfg_parser->opt->confine_to_zone = yyvspc_vsp[0].bln; }
1401break;
1402case 68:
1403#line 435 "/usr/src/usr.sbin/nsd/configparser.y"
1404{ cfg_parser->opt->refuse_any = yyvspc_vsp[0].bln; }
1405break;
1406case 69:
1407#line 437 "/usr/src/usr.sbin/nsd/configparser.y"
1408{ cfg_parser->opt->tls_service_key = region_strdup(cfg_parser->opt->region, yyvspc_vsp[0].str); }
1409break;
1410case 70:
1411#line 439 "/usr/src/usr.sbin/nsd/configparser.y"
1412{ cfg_parser->opt->tls_service_ocsp = region_strdup(cfg_parser->opt->region, yyvspc_vsp[0].str); }
1413break;
1414case 71:
1415#line 441 "/usr/src/usr.sbin/nsd/configparser.y"
1416{ cfg_parser->opt->tls_service_pem = region_strdup(cfg_parser->opt->region, yyvspc_vsp[0].str); }
1417break;
1418case 72:
1419#line 443 "/usr/src/usr.sbin/nsd/configparser.y"
1420{
1421 /* port number, stored as string */
1422 char buf[16];
1423 (void)snprintf(buf, sizeof(buf), "%lld", yyvspc_vsp[0].llng);
1424 cfg_parser->opt->tls_port = region_strdup(cfg_parser->opt->region, buf);
1425 }
1426break;
1427case 73:
1428#line 450 "/usr/src/usr.sbin/nsd/configparser.y"
1429{ cfg_parser->opt->tls_cert_bundle = region_strdup(cfg_parser->opt->region, yyvspc_vsp[0].str); }
1430break;
1431case 74:
1432#line 452 "/usr/src/usr.sbin/nsd/configparser.y"
1433{ cfg_parser->opt->answer_cookie = yyvspc_vsp[0].bln; }
1434break;
1435case 75:
1436#line 454 "/usr/src/usr.sbin/nsd/configparser.y"
1437{ cfg_parser->opt->cookie_secret = region_strdup(cfg_parser->opt->region, yyvspc_vsp[0].str); }
1438break;
1439case 76:
1440#line 456 "/usr/src/usr.sbin/nsd/configparser.y"
1441{ cfg_parser->opt->cookie_secret_file = region_strdup(cfg_parser->opt->region, yyvspc_vsp[0].str); }
1442break;
1443case 77:
1444#line 458 "/usr/src/usr.sbin/nsd/configparser.y"
1445{
1446 cfg_parser->opt->cpu_affinity = yyvspc_vsp[0].cpu;
1447 }
1448break;
1449case 78:
1450#line 462 "/usr/src/usr.sbin/nsd/configparser.y"
1451{
1452 if(yyvspc_vsp[0].llng < 0) {
1453 yyerrorc_error("expected a non-negative number");
1454 YYABORTgoto yyabort;
1455 } else {
1456 struct cpu_map_option *opt, *tail;
1457
1458 opt = cfg_parser->opt->service_cpu_affinity;
1459 while(opt && opt->service != yyvspc_vsp[-1].llng) { opt = opt->next; }
1460
1461 if(opt) {
1462 opt->cpu = yyvspc_vsp[0].llng;
1463 } else {
1464 opt = region_alloc_zero(cfg_parser->opt->region, sizeof(*opt));
1465 opt->service = (int)yyvspc_vsp[-1].llng;
1466 opt->cpu = (int)yyvspc_vsp[0].llng;
1467
1468 tail = cfg_parser->opt->service_cpu_affinity;
1469 if(tail) {
1470 while(tail->next) { tail = tail->next; }
1471 tail->next = opt;
1472 } else {
1473 cfg_parser->opt->service_cpu_affinity = opt;
1474 }
1475 }
1476 }
1477 }
1478break;
1479case 81:
1480#line 496 "/usr/src/usr.sbin/nsd/configparser.y"
1481{
1482 char *tok, *ptr, *str;
1483 struct range_option *servers = NULL((void*)0);
1484 long long first, last;
1485
1486 /* user may specify "0 1", "0" "1", 0 1 or a combination thereof */
1487 for(str = yyvspc_vsp[0].str; (tok = strtok_r(str, " \t", &ptr)); str = NULL((void*)0)) {
1488 struct range_option *opt =
1489 region_alloc(cfg_parser->opt->region, sizeof(*opt));
1490 first = last = 0;
1491 if(!parse_range(tok, &first, &last)) {
1492 yyerrorc_error("invalid server range '%s'", tok);
1493 YYABORTgoto yyabort;
1494 }
1495 assert(first >= 0)((void)0);
1496 assert(last >= 0)((void)0);
1497 opt->next = NULL((void*)0);
1498 opt->first = (int)first;
1499 opt->last = (int)last;
1500 if(servers) {
1501 servers = servers->next = opt;
1502 } else {
1503 servers = cfg_parser->ip->servers = opt;
1504 }
1505 }
1506 }
1507break;
1508case 82:
1509#line 523 "/usr/src/usr.sbin/nsd/configparser.y"
1510{ cfg_parser->ip->dev = yyvspc_vsp[0].bln; }
1511break;
1512case 83:
1513#line 525 "/usr/src/usr.sbin/nsd/configparser.y"
1514{ cfg_parser->ip->fib = yyvspc_vsp[0].llng; }
1515break;
1516case 84:
1517#line 529 "/usr/src/usr.sbin/nsd/configparser.y"
1518{ yyvalc_val.cpu = NULL((void*)0); }
1519break;
1520case 85:
1521#line 531 "/usr/src/usr.sbin/nsd/configparser.y"
1522{
1523 char *tok, *ptr, *str;
1524 struct cpu_option *tail;
1525 long long cpu;
1526
1527 str = yyvspc_vsp[0].str;
1528 yyvalc_val.cpu = tail = yyvspc_vsp[-1].cpu;
1529 if(tail) {
1530 while(tail->next) { tail = tail->next; }
1531 }
1532
1533 /* Users may specify "0 1", "0" "1", 0 1 or a combination thereof. */
1534 for(str = yyvspc_vsp[0].str; (tok = strtok_r(str, " \t", &ptr)); str = NULL((void*)0)) {
1535 struct cpu_option *opt =
1536 region_alloc_zero(cfg_parser->opt->region, sizeof(*opt));
1537 cpu = 0;
1538 if(!parse_number(tok, &cpu) || cpu < 0) {
1539 yyerrorc_error("expected a positive number");
1540 YYABORTgoto yyabort;
1541 }
1542 assert(cpu >=0)((void)0);
1543 opt->cpu = (int)cpu;
1544 if(tail) {
1545 tail->next = opt;
1546 tail = opt;
1547 } else {
1548 yyvalc_val.cpu = tail = opt;
1549 }
1550 }
1551 }
1552break;
1553case 86:
1554#line 565 "/usr/src/usr.sbin/nsd/configparser.y"
1555{ yyvalc_val.llng = -1; }
1556break;
1557case 87:
1558#line 567 "/usr/src/usr.sbin/nsd/configparser.y"
1559{
1560 if(yyvspc_vsp[0].llng <= 0) {
1561 yyerrorc_error("invalid server identifier");
1562 YYABORTgoto yyabort;
1563 }
1564 yyvalc_val.llng = yyvspc_vsp[0].llng;
1565 }
1566break;
1567case 91:
1568#line 584 "/usr/src/usr.sbin/nsd/configparser.y"
1569{ cfg_parser->opt->dnstap_enable = yyvspc_vsp[0].bln; }
1570break;
1571case 92:
1572#line 586 "/usr/src/usr.sbin/nsd/configparser.y"
1573{ cfg_parser->opt->dnstap_socket_path = region_strdup(cfg_parser->opt->region, yyvspc_vsp[0].str); }
1574break;
1575case 93:
1576#line 588 "/usr/src/usr.sbin/nsd/configparser.y"
1577{ cfg_parser->opt->dnstap_send_identity = yyvspc_vsp[0].bln; }
1578break;
1579case 94:
1580#line 590 "/usr/src/usr.sbin/nsd/configparser.y"
1581{ cfg_parser->opt->dnstap_send_version = yyvspc_vsp[0].bln; }
1582break;
1583case 95:
1584#line 592 "/usr/src/usr.sbin/nsd/configparser.y"
1585{ cfg_parser->opt->dnstap_identity = region_strdup(cfg_parser->opt->region, yyvspc_vsp[0].str); }
1586break;
1587case 96:
1588#line 594 "/usr/src/usr.sbin/nsd/configparser.y"
1589{ cfg_parser->opt->dnstap_version = region_strdup(cfg_parser->opt->region, yyvspc_vsp[0].str); }
1590break;
1591case 97:
1592#line 596 "/usr/src/usr.sbin/nsd/configparser.y"
1593{ cfg_parser->opt->dnstap_log_auth_query_messages = yyvspc_vsp[0].bln; }
1594break;
1595case 98:
1596#line 598 "/usr/src/usr.sbin/nsd/configparser.y"
1597{ cfg_parser->opt->dnstap_log_auth_response_messages = yyvspc_vsp[0].bln; }
1598break;
1599case 102:
1600#line 609 "/usr/src/usr.sbin/nsd/configparser.y"
1601{ cfg_parser->opt->control_enable = yyvspc_vsp[0].bln; }
1602break;
1603case 103:
1604#line 611 "/usr/src/usr.sbin/nsd/configparser.y"
1605{
1606 struct ip_address_option *ip = cfg_parser->opt->control_interface;
1607 if(ip == NULL((void*)0)) {
1608 cfg_parser->opt->control_interface = yyvspc_vsp[0].ip;
1609 } else {
1610 while(ip->next != NULL((void*)0)) { ip = ip->next; }
1611 ip->next = yyvspc_vsp[0].ip;
1612 }
1613 }
1614break;
1615case 104:
1616#line 621 "/usr/src/usr.sbin/nsd/configparser.y"
1617{
1618 if(yyvspc_vsp[0].llng == 0) {
1619 yyerrorc_error("control port number expected");
1620 } else {
1621 cfg_parser->opt->control_port = (int)yyvspc_vsp[0].llng;
1622 }
1623 }
1624break;
1625case 105:
1626#line 629 "/usr/src/usr.sbin/nsd/configparser.y"
1627{ cfg_parser->opt->server_key_file = region_strdup(cfg_parser->opt->region, yyvspc_vsp[0].str); }
1628break;
1629case 106:
1630#line 631 "/usr/src/usr.sbin/nsd/configparser.y"
1631{ cfg_parser->opt->server_cert_file = region_strdup(cfg_parser->opt->region, yyvspc_vsp[0].str); }
1632break;
1633case 107:
1634#line 633 "/usr/src/usr.sbin/nsd/configparser.y"
1635{ cfg_parser->opt->control_key_file = region_strdup(cfg_parser->opt->region, yyvspc_vsp[0].str); }
1636break;
1637case 108:
1638#line 635 "/usr/src/usr.sbin/nsd/configparser.y"
1639{ cfg_parser->opt->control_cert_file = region_strdup(cfg_parser->opt->region, yyvspc_vsp[0].str); }
1640break;
1641case 109:
1642#line 640 "/usr/src/usr.sbin/nsd/configparser.y"
1643{
1644 tls_auth_options_type *tls_auth = tls_auth_options_create(cfg_parser->opt->region);
1645 assert(cfg_parser->tls_auth == NULL)((void)0);
1646 cfg_parser->tls_auth = tls_auth;
1647 }
1648break;
1649case 110:
1650#line 646 "/usr/src/usr.sbin/nsd/configparser.y"
1651{
1652 struct tls_auth_options *tls_auth = cfg_parser->tls_auth;
1653 if(tls_auth->name == NULL((void*)0)) {
1654 yyerrorc_error("tls-auth has no name");
1655 } else if(tls_auth->auth_domain_name == NULL((void*)0)) {
1656 yyerrorc_error("tls-auth %s has no auth-domain-name", tls_auth->name);
1657 } else if(tls_auth_options_find(cfg_parser->opt, tls_auth->name)) {
1658 yyerrorc_error("duplicate tls-auth %s", tls_auth->name);
1659 } else {
1660 tls_auth_options_insert(cfg_parser->opt, tls_auth);
1661 cfg_parser->tls_auth = NULL((void*)0);
1662 }
1663 }
1664break;
1665case 113:
1666#line 665 "/usr/src/usr.sbin/nsd/configparser.y"
1667{
1668 dname_type *dname;
1669 dname = (dname_type *)dname_parse(cfg_parser->opt->region, yyvspc_vsp[0].str);
1670 cfg_parser->tls_auth->name = region_strdup(cfg_parser->opt->region, yyvspc_vsp[0].str);
1671 if(dname == NULL((void*)0)) {
1672 yyerrorc_error("bad tls-auth name %s", yyvspc_vsp[0].str);
1673 } else {
1674 region_recycle(cfg_parser->opt->region, dname, dname_total_size(dname));
1675 }
1676 }
1677break;
1678case 114:
1679#line 676 "/usr/src/usr.sbin/nsd/configparser.y"
1680{
1681 cfg_parser->tls_auth->auth_domain_name = region_strdup(cfg_parser->opt->region, yyvspc_vsp[0].str);
1682 }
1683break;
1684case 115:
1685#line 680 "/usr/src/usr.sbin/nsd/configparser.y"
1686{
1687 cfg_parser->tls_auth->client_cert = region_strdup(cfg_parser->opt->region, yyvspc_vsp[0].str);
1688 }
1689break;
1690case 116:
1691#line 684 "/usr/src/usr.sbin/nsd/configparser.y"
1692{
1693 cfg_parser->tls_auth->client_key = region_strdup(cfg_parser->opt->region, yyvspc_vsp[0].str);
1694 }
1695break;
1696case 117:
1697#line 688 "/usr/src/usr.sbin/nsd/configparser.y"
1698{
1699 cfg_parser->tls_auth->client_key_pw = region_strdup(cfg_parser->opt->region, yyvspc_vsp[0].str);
1700 }
1701break;
1702case 118:
1703#line 695 "/usr/src/usr.sbin/nsd/configparser.y"
1704{
1705 key_options_type *key = key_options_create(cfg_parser->opt->region);
1706 key->algorithm = region_strdup(cfg_parser->opt->region, "sha256");
1707 assert(cfg_parser->key == NULL)((void)0);
1708 cfg_parser->key = key;
1709 }
1710break;
1711case 119:
1712#line 702 "/usr/src/usr.sbin/nsd/configparser.y"
1713{
1714 struct key_options *key = cfg_parser->key;
1715 if(key->name == NULL((void*)0)) {
1716 yyerrorc_error("tsig key has no name");
1717 } else if(key->algorithm == NULL((void*)0)) {
1718 yyerrorc_error("tsig key %s has no algorithm", key->name);
1719 } else if(key->secret == NULL((void*)0)) {
1720 yyerrorc_error("tsig key %s has no secret blob", key->name);
1721 } else if(key_options_find(cfg_parser->opt, key->name)) {
1722 yyerrorc_error("duplicate tsig key %s", key->name);
1723 } else {
1724 key_options_insert(cfg_parser->opt, key);
1725 cfg_parser->key = NULL((void*)0);
1726 }
1727 }
1728break;
1729case 122:
1730#line 723 "/usr/src/usr.sbin/nsd/configparser.y"
1731{
1732 dname_type *dname;
1733
1734 dname = (dname_type *)dname_parse(cfg_parser->opt->region, yyvspc_vsp[0].str);
1735 cfg_parser->key->name = region_strdup(cfg_parser->opt->region, yyvspc_vsp[0].str);
1736 if(dname == NULL((void*)0)) {
1737 yyerrorc_error("bad tsig key name %s", yyvspc_vsp[0].str);
1738 } else {
1739 region_recycle(cfg_parser->opt->region, dname, dname_total_size(dname));
1740 }
1741 }
1742break;
1743case 123:
1744#line 735 "/usr/src/usr.sbin/nsd/configparser.y"
1745{
1746 if(tsig_get_algorithm_by_name(yyvspc_vsp[0].str) == NULL((void*)0)) {
1747 yyerrorc_error("bad tsig key algorithm %s", yyvspc_vsp[0].str);
1748 } else {
1749 cfg_parser->key->algorithm = region_strdup(cfg_parser->opt->region, yyvspc_vsp[0].str);
1750 }
1751 }
1752break;
1753case 124:
1754#line 743 "/usr/src/usr.sbin/nsd/configparser.y"
1755{
1756 uint8_t data[16384];
1757 int size;
1758
1759 cfg_parser->key->secret = region_strdup(cfg_parser->opt->region, yyvspc_vsp[0].str);
1760 size = __b64_pton(yyvspc_vsp[0].str, data, sizeof(data));
1761 if(size == -1) {
1762 yyerrorc_error("cannot base64 decode tsig secret %s",
1763 cfg_parser->key->name?
1764 cfg_parser->key->name:"");
1765 } else if(size != 0) {
1766 memset(data, 0xdd, size); /* wipe secret */
1767 }
1768 }
1769break;
1770case 125:
1771#line 761 "/usr/src/usr.sbin/nsd/configparser.y"
1772{
1773 assert(cfg_parser->pattern == NULL)((void)0);
1774 assert(cfg_parser->zone == NULL)((void)0);
1775 cfg_parser->zone = zone_options_create(cfg_parser->opt->region);
1776 cfg_parser->zone->part_of_config = 1;
1777 cfg_parser->zone->pattern = cfg_parser->pattern =
1778 pattern_options_create(cfg_parser->opt->region);
1779 cfg_parser->zone->pattern->implicit = 1;
1780 }
1781break;
1782case 126:
1783#line 771 "/usr/src/usr.sbin/nsd/configparser.y"
1784{
1785 assert(cfg_parser->zone != NULL)((void)0);
1786 if(cfg_parser->zone->name == NULL((void*)0)) {
1787 yyerrorc_error("zone has no name");
1788 } else if(!nsd_options_insert_zone(cfg_parser->opt, cfg_parser->zone)) {
1789 yyerrorc_error("duplicate zone %s", cfg_parser->zone->name);
1790 } else if(!nsd_options_insert_pattern(cfg_parser->opt, cfg_parser->zone->pattern)) {
1791 yyerrorc_error("duplicate pattern %s", cfg_parser->zone->pattern->pname);
1792 }
1793 cfg_parser->pattern = NULL((void*)0);
1794 cfg_parser->zone = NULL((void*)0);
1795 }
1796break;
1797case 129:
1798#line 789 "/usr/src/usr.sbin/nsd/configparser.y"
1799{
1800 const char *marker = PATTERN_IMPLICIT_MARKER"_implicit_";
1801 char *pname = region_alloc(cfg_parser->opt->region, strlen(yyvspc_vsp[0].str) + strlen(marker) + 1);
1802 memmove(pname, marker, strlen(marker));
1803 memmove(pname + strlen(marker), yyvspc_vsp[0].str, strlen(yyvspc_vsp[0].str) + 1);
1804 cfg_parser->zone->pattern->pname = pname;
1805 cfg_parser->zone->name = region_strdup(cfg_parser->opt->region, yyvspc_vsp[0].str);
1806 if(pattern_options_find(cfg_parser->opt, pname)) {
1807 yyerrorc_error("zone %s cannot be created because implicit pattern %s "
1808 "already exists", yyvspc_vsp[0].str, pname);
1809 }
1810 }
1811break;
1812case 131:
1813#line 805 "/usr/src/usr.sbin/nsd/configparser.y"
1814{
1815 assert(cfg_parser->pattern == NULL)((void)0);
1816 cfg_parser->pattern = pattern_options_create(cfg_parser->opt->region);
1817 }
1818break;
1819case 132:
1820#line 810 "/usr/src/usr.sbin/nsd/configparser.y"
1821{
1822 pattern_options_type *pattern = cfg_parser->pattern;
1823 if(pattern->pname == NULL((void*)0)) {
1824 yyerrorc_error("pattern has no name");
1825 } else if(!nsd_options_insert_pattern(cfg_parser->opt, pattern)) {
1826 yyerrorc_error("duplicate pattern %s", pattern->pname);
1827 }
1828 cfg_parser->pattern = NULL((void*)0);
1829 }
1830break;
1831case 135:
1832#line 825 "/usr/src/usr.sbin/nsd/configparser.y"
1833{
1834 if(strchr(yyvspc_vsp[0].str, ' ')) {
1835 yyerrorc_error("space is not allowed in pattern name: '%s'", yyvspc_vsp[0].str);
1836 }
1837 cfg_parser->pattern->pname = region_strdup(cfg_parser->opt->region, yyvspc_vsp[0].str);
1838 }
1839break;
1840case 137:
1841#line 835 "/usr/src/usr.sbin/nsd/configparser.y"
1842{
1843#ifdef RATELIMIT
1844 cfg_parser->pattern->rrl_whitelist |= rrlstr2type(yyvspc_vsp[0].str);
1845#endif
1846 }
1847break;
1848case 138:
1849#line 841 "/usr/src/usr.sbin/nsd/configparser.y"
1850{ cfg_parser->pattern->zonefile = region_strdup(cfg_parser->opt->region, yyvspc_vsp[0].str); }
1851break;
1852case 139:
1853#line 843 "/usr/src/usr.sbin/nsd/configparser.y"
1854{ cfg_parser->pattern->zonestats = region_strdup(cfg_parser->opt->region, yyvspc_vsp[0].str); }
1855break;
1856case 140:
1857#line 845 "/usr/src/usr.sbin/nsd/configparser.y"
1858{
1859 if(yyvspc_vsp[0].llng > 0) {
1860 cfg_parser->pattern->size_limit_xfr = (int)yyvspc_vsp[0].llng;
1861 } else {
1862 yyerrorc_error("expected a number greater than zero");
1863 }
1864 }
1865break;
1866case 141:
1867#line 853 "/usr/src/usr.sbin/nsd/configparser.y"
1868{ cfg_parser->pattern->multi_master_check = (int)yyvspc_vsp[0].bln; }
1869break;
1870case 142:
1871#line 855 "/usr/src/usr.sbin/nsd/configparser.y"
1872{ config_apply_pattern(cfg_parser->pattern, yyvspc_vsp[0].str); }
1873break;
1874case 143:
1875#line 857 "/usr/src/usr.sbin/nsd/configparser.y"
1876{
1877 acl_options_type *acl = parse_acl_info(cfg_parser->opt->region, yyvspc_vsp[-1].str, yyvspc_vsp[0].str);
1878 if(acl->blocked)
1879 yyerrorc_error("blocked address used for request-xfr");
1880 if(acl->rangetype != acl_range_single)
1881 yyerrorc_error("address range used for request-xfr");
1882 append_acl(&cfg_parser->pattern->request_xfr, acl);
1883 }
1884break;
1885case 144:
1886#line 866 "/usr/src/usr.sbin/nsd/configparser.y"
1887{ }
1888break;
1889case 145:
1890#line 868 "/usr/src/usr.sbin/nsd/configparser.y"
1891{
1892 acl_options_type *acl = parse_acl_info(cfg_parser->opt->region, yyvspc_vsp[-1].str, yyvspc_vsp[0].str);
1893 acl->use_axfr_only = 1;
1894 if(acl->blocked)
1895 yyerrorc_error("blocked address used for request-xfr");
1896 if(acl->rangetype != acl_range_single)
1897 yyerrorc_error("address range used for request-xfr");
1898 append_acl(&cfg_parser->pattern->request_xfr, acl);
1899 }
1900break;
1901case 146:
1902#line 878 "/usr/src/usr.sbin/nsd/configparser.y"
1903{ }
1904break;
1905case 147:
1906#line 880 "/usr/src/usr.sbin/nsd/configparser.y"
1907{
1908 acl_options_type *acl = parse_acl_info(cfg_parser->opt->region, yyvspc_vsp[-1].str, yyvspc_vsp[0].str);
1909 acl->allow_udp = 1;
1910 if(acl->blocked)
1911 yyerrorc_error("blocked address used for request-xfr");
1912 if(acl->rangetype != acl_range_single)
1913 yyerrorc_error("address range used for request-xfr");
1914 append_acl(&cfg_parser->pattern->request_xfr, acl);
1915 }
1916break;
1917case 148:
1918#line 890 "/usr/src/usr.sbin/nsd/configparser.y"
1919{
1920 acl_options_type *acl = parse_acl_info(cfg_parser->opt->region, yyvspc_vsp[-1].str, yyvspc_vsp[0].str);
1921 append_acl(&cfg_parser->pattern->allow_notify, acl);
1922 }
1923break;
1924case 149:
1925#line 895 "/usr/src/usr.sbin/nsd/configparser.y"
1926{
1927 acl_options_type *acl = parse_acl_info(cfg_parser->opt->region, yyvspc_vsp[-1].str, yyvspc_vsp[0].str);
1928 if(acl->blocked)
1929 yyerrorc_error("blocked address used for notify");
1930 if(acl->rangetype != acl_range_single)
1931 yyerrorc_error("address range used for notify");
1932 append_acl(&cfg_parser->pattern->notify, acl);
1933 }
1934break;
1935case 150:
1936#line 904 "/usr/src/usr.sbin/nsd/configparser.y"
1937{
1938 acl_options_type *acl = parse_acl_info(cfg_parser->opt->region, yyvspc_vsp[-1].str, yyvspc_vsp[0].str);
1939 append_acl(&cfg_parser->pattern->provide_xfr, acl);
1940 }
1941break;
1942case 151:
1943#line 909 "/usr/src/usr.sbin/nsd/configparser.y"
1944{
1945 acl_options_type *acl = parse_acl_info(cfg_parser->opt->region, yyvspc_vsp[-1].str, yyvspc_vsp[0].str);
1946 append_acl(&cfg_parser->pattern->allow_query, acl);
1947 }
1948break;
1949case 152:
1950#line 914 "/usr/src/usr.sbin/nsd/configparser.y"
1951{
1952 acl_options_type *acl = parse_acl_info(cfg_parser->opt->region, yyvspc_vsp[0].str, "NOKEY");
1953 append_acl(&cfg_parser->pattern->outgoing_interface, acl);
1954 }
1955break;
1956case 153:
1957#line 919 "/usr/src/usr.sbin/nsd/configparser.y"
1958{
1959 cfg_parser->pattern->allow_axfr_fallback = yyvspc_vsp[0].bln;
1960 cfg_parser->pattern->allow_axfr_fallback_is_default = 0;
1961 }
1962break;
1963case 154:
1964#line 924 "/usr/src/usr.sbin/nsd/configparser.y"
1965{
1966 cfg_parser->pattern->notify_retry = yyvspc_vsp[0].llng;
1967 cfg_parser->pattern->notify_retry_is_default = 0;
1968 }
1969break;
1970case 155:
1971#line 929 "/usr/src/usr.sbin/nsd/configparser.y"
1972{
1973 cfg_parser->pattern->max_refresh_time = yyvspc_vsp[0].llng;
1974 cfg_parser->pattern->max_refresh_time_is_default = 0;
1975 }
1976break;
1977case 156:
1978#line 934 "/usr/src/usr.sbin/nsd/configparser.y"
1979{
1980 cfg_parser->pattern->min_refresh_time = yyvspc_vsp[0].llng;
1981 cfg_parser->pattern->min_refresh_time_is_default = 0;
1982 }
1983break;
1984case 157:
1985#line 939 "/usr/src/usr.sbin/nsd/configparser.y"
1986{
1987 cfg_parser->pattern->max_retry_time = yyvspc_vsp[0].llng;
1988 cfg_parser->pattern->max_retry_time_is_default = 0;
1989 }
1990break;
1991case 158:
1992#line 944 "/usr/src/usr.sbin/nsd/configparser.y"
1993{
1994 cfg_parser->pattern->min_retry_time = yyvspc_vsp[0].llng;
1995 cfg_parser->pattern->min_retry_time_is_default = 0;
1996 }
1997break;
1998case 159:
1999#line 949 "/usr/src/usr.sbin/nsd/configparser.y"
2000{
2001 long long num;
2002 uint8_t expr;
2003
2004 if (!parse_expire_expr(yyvspc_vsp[0].str, &num, &expr)) {
2005 yyerrorc_error("expected an expire time in seconds or \"refresh+retry+1\"");
2006 YYABORTgoto yyabort; /* trigger a parser error */
2007 }
2008 cfg_parser->pattern->min_expire_time = num;
2009 cfg_parser->pattern->min_expire_time_expr = expr;
2010 }
2011break;
2012case 160:
2013#line 963 "/usr/src/usr.sbin/nsd/configparser.y"
2014{
2015 struct ip_address_option *ip = region_alloc_zero(
2016 cfg_parser->opt->region, sizeof(*ip));
2017 ip->address = region_strdup(cfg_parser->opt->region, yyvspc_vsp[0].str);
2018 ip->fib = -1;
2019 yyvalc_val.ip = ip;
2020 }
2021break;
2022case 161:
2023#line 973 "/usr/src/usr.sbin/nsd/configparser.y"
2024{
2025 if(!parse_number(yyvspc_vsp[0].str, &yyvalc_val.llng)) {
2026 yyerrorc_error("expected a number");
2027 YYABORTgoto yyabort; /* trigger a parser error */
2028 }
2029 }
2030break;
2031case 162:
2032#line 982 "/usr/src/usr.sbin/nsd/configparser.y"
2033{
2034 if(!parse_boolean(yyvspc_vsp[0].str, &yyvalc_val.bln)) {
2035 yyerrorc_error("expected yes or no");
2036 YYABORTgoto yyabort; /* trigger a parser error */
2037 }
2038 }
2039break;
2040case 164:
2041#line 991 "/usr/src/usr.sbin/nsd/configparser.y"
2042{ char *tls_auth_name = region_strdup(cfg_parser->opt->region, yyvspc_vsp[0].str);
2043 add_to_last_acl(&cfg_parser->pattern->request_xfr, tls_auth_name);}
2044break;
2045#line 2038 "configparser.c"
2046 }
2047 yysspc_ssp -= yym;
2048 yystate = *yysspc_ssp;
2049 yyvspc_vsp -= yym;
2050 yym = yylhsc_lhs[yyn];
2051 if (yystate
5.1
'yystate' is equal to 0
== 0 && yym
5.2
'yym' is equal to 0
== 0)
6
Taking true branch
2052 {
2053#if YYDEBUG0
2054 if (yydebugc_debug)
2055 printf("%sdebug: after reduction, shifting from state 0 to\
2056 state %d\n", YYPREFIX"c_", YYFINAL1);
2057#endif
2058 yystate = YYFINAL1;
2059 *++yysspc_ssp = YYFINAL1;
2060 *++yyvspc_vsp = yyvalc_val;
2061 if (yycharc_char < 0)
7
Taking true branch
2062 {
2063 if ((yycharc_char = yylexc_lex()) < 0) yycharc_char = 0;
8
Assuming the condition is false
9
Taking false branch
2064#if YYDEBUG0
2065 if (yydebugc_debug)
2066 {
2067 yys = 0;
2068 if (yycharc_char <= YYMAXTOKEN376) yys = yynamec_name[yycharc_char];
2069 if (!yys) yys = "illegal-symbol";
2070 printf("%sdebug: state %d, reading %d (%s)\n",
2071 YYPREFIX"c_", YYFINAL1, yycharc_char, yys);
2072 }
2073#endif
2074 }
2075 if (yycharc_char == 0) goto yyaccept;
10
Assuming 'c_char' is not equal to 0
11
Taking false branch
2076 goto yyloop;
12
Control jumps to line 958
2077 }
2078 if ((yyn = yygindexc_gindex[yym]) && (yyn += yystate) >= 0 &&
2079 yyn <= YYTABLESIZE802 && yycheckc_check[yyn] == yystate)
2080 yystate = yytablec_table[yyn];
2081 else
2082 yystate = yydgotoc_dgoto[yym];
2083#if YYDEBUG0
2084 if (yydebugc_debug)
2085 printf("%sdebug: after reduction, shifting from state %d \
2086to state %d\n", YYPREFIX"c_", *yysspc_ssp, yystate);
2087#endif
2088 if (yysspc_ssp >= yysslimc_sslim && yygrowstack())
2089 {
2090 goto yyoverflow;
2091 }
2092 *++yysspc_ssp = yystate;
2093 *++yyvspc_vsp = yyvalc_val;
2094 goto yyloop;
2095yyoverflow:
2096 yyerrorc_error("yacc stack overflow");
2097yyabort:
2098 if (yyssc_ss)
2099 free(yyssc_ss);
2100 if (yyvsc_vs)
2101 free(yyvsc_vs);
2102 yyssc_ss = yysspc_ssp = NULL((void*)0);
2103 yyvsc_vs = yyvspc_vsp = NULL((void*)0);
2104 yystacksizec_stacksize = 0;
2105 return (1);
2106yyaccept:
2107 if (yyssc_ss)
2108 free(yyssc_ss);
2109 if (yyvsc_vs)
2110 free(yyvsc_vs);
2111 yyssc_ss = yysspc_ssp = NULL((void*)0);
2112 yyvsc_vs = yyvspc_vsp = NULL((void*)0);
2113 yystacksizec_stacksize = 0;
2114 return (0);
2115}