diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/bin/ntpd/Makefile /cur/src/external/bsd/ntp/bin/ntpd/Makefile
--- external/bsd/ntp/bin/ntpd/Makefile	2014-12-24 18:27:52.000000000 -0800
+++ /cur/src/external/bsd/ntp/bin/ntpd/Makefile	2015-03-17 11:25:13.000000000 -0700
@@ -15,7 +15,7 @@
 	ntp_leapsec.c				\
 	ntp_loopfilter.c			\
 	ntp_monitor.c				\
-	ntp_parser.c				\
+	ntp_parser.y				\
 	ntp_peer.c				\
 	ntp_prio_q.c				\
 	ntp_proto.c				\
@@ -80,12 +80,9 @@
 
 DIST=${IDIST}/ntpd
 
-CPPFLAGS+=-I${IDIST}/include -I${IDIST}/sntp/libopts -I${IDIST}/ntpd -I${.CURDIR}
+CPPFLAGS+=-I${IDIST}/include -I${IDIST}/sntp/libopts -I${IDIST}/ntpd -I.
 
 .PATH: ${DIST}
+YHEADER=1
 
 .include <bsd.prog.mk>
-
-# kill default .y.c rule - to rebuild ntp_parser.c we need bison which is not part of the toolchain
-.y.c:
-
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/bin/ntpd/ntp_parser.c /cur/src/external/bsd/ntp/bin/ntpd/ntp_parser.c
--- external/bsd/ntp/bin/ntpd/ntp_parser.c	2014-12-24 16:31:20.000000000 -0800
+++ /cur/src/external/bsd/ntp/bin/ntpd/ntp_parser.c	1969-12-31 16:00:00.000000000 -0800
@@ -1,2322 +0,0 @@
-#ifndef lint
-#if __GNUC__ - 0 >= 4 || (__GNUC__ - 0 == 3 && __GNUC_MINOR__ >= 1)
-__attribute__((__used__))
-#endif
-static const char yysccsid[] = "@(#)yaccpar	1.9 (Berkeley) 02/21/93";
-#endif
-
-#ifdef _LIBC
-#include "namespace.h"
-#endif
-#include <stdlib.h>
-#include <string.h>
-
-#define YYBYACC 1
-#define YYMAJOR 1
-#define YYMINOR 9
-
-#define YYEMPTY        (-1)
-#define yyclearin      (yychar = YYEMPTY)
-#define yyerrok        (yyerrflag = 0)
-#define YYRECOVERING() (yyerrflag != 0)
-
-#define YYPREFIX "yy"
-
-#define YYPURE 0
-
-#line 17 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-  #ifdef HAVE_CONFIG_H
-  # include <config.h>
-  #endif
-
-  #include "ntp.h"
-  #include "ntpd.h"
-  #include "ntp_machine.h"
-  #include "ntp_stdlib.h"
-  #include "ntp_filegen.h"
-  #include "ntp_scanner.h"
-  #include "ntp_config.h"
-  #include "ntp_crypto.h"
-
-  #include "ntpsim.h"		/* HMS: Do we really want this all the time? */
-				/* SK: It might be a good idea to always
-				   include the simulator code. That way
-				   someone can use the same configuration file
-				   for both the simulator and the daemon
-				*/
-
-  #define YYMALLOC	emalloc
-  #define YYFREE	free
-  #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
-#line 56 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-#ifdef YYSTYPE
-#undef  YYSTYPE_IS_DECLARED
-#define YYSTYPE_IS_DECLARED 1
-#endif
-#ifndef YYSTYPE_IS_DECLARED
-#define YYSTYPE_IS_DECLARED 1
-typedef union {
-	char *			String;
-	double			Double;
-	int			Integer;
-	unsigned		U_int;
-	gen_fifo *		Generic_fifo;
-	attr_val *		Attr_val;
-	attr_val_fifo *		Attr_val_fifo;
-	int_fifo *		Int_fifo;
-	string_fifo *		String_fifo;
-	address_node *		Address_node;
-	address_fifo *		Address_fifo;
-	setvar_node *		Set_var;
-	server_info *		Sim_server;
-	server_info_fifo *	Sim_server_fifo;
-	script_info *		Sim_script;
-	script_info_fifo *	Sim_script_fifo;
-} YYSTYPE;
-#endif /* !YYSTYPE_IS_DECLARED */
-#line 85 "ntp_parser.c"
-
-/* compatibility with bison */
-#ifdef YYPARSE_PARAM
-/* compatibility with FreeBSD */
-# ifdef YYPARSE_PARAM_TYPE
-#  define YYPARSE_DECL() yyparse(YYPARSE_PARAM_TYPE YYPARSE_PARAM)
-# else
-#  define YYPARSE_DECL() yyparse(void *YYPARSE_PARAM)
-# endif
-#else
-# define YYPARSE_DECL() yyparse(struct FILE_INFO * ip_file)
-#endif
-
-/* Parameters sent to lex. */
-#ifdef YYLEX_PARAM
-# define YYLEX_DECL() yylex(void *YYLEX_PARAM)
-# define YYLEX yylex(YYLEX_PARAM)
-#else
-# define YYLEX_DECL() yylex(struct FILE_INFO * ip_file)
-# define YYLEX yylex(ip_file)
-#endif
-
-/* Parameters sent to yyerror. */
-#ifndef YYERROR_DECL
-#define YYERROR_DECL() yyerror(struct FILE_INFO * ip_file, const char *s)
-#endif
-#ifndef YYERROR_CALL
-#define YYERROR_CALL(msg) yyerror(ip_file, msg)
-#endif
-
-extern int YYPARSE_DECL();
-
-
-#define T_Abbrev 257
-#define T_Age 258
-#define T_All 259
-#define T_Allan 260
-#define T_Allpeers 261
-#define T_Auth 262
-#define T_Autokey 263
-#define T_Automax 264
-#define T_Average 265
-#define T_Bclient 266
-#define T_Beacon 267
-#define T_Broadcast 268
-#define T_Broadcastclient 269
-#define T_Broadcastdelay 270
-#define T_Burst 271
-#define T_Calibrate 272
-#define T_Ceiling 273
-#define T_Clockstats 274
-#define T_Cohort 275
-#define T_ControlKey 276
-#define T_Crypto 277
-#define T_Cryptostats 278
-#define T_Ctl 279
-#define T_Day 280
-#define T_Default 281
-#define T_Digest 282
-#define T_Disable 283
-#define T_Discard 284
-#define T_Dispersion 285
-#define T_Double 286
-#define T_Driftfile 287
-#define T_Drop 288
-#define T_Ellipsis 289
-#define T_Enable 290
-#define T_End 291
-#define T_False 292
-#define T_File 293
-#define T_Filegen 294
-#define T_Filenum 295
-#define T_Flag1 296
-#define T_Flag2 297
-#define T_Flag3 298
-#define T_Flag4 299
-#define T_Flake 300
-#define T_Floor 301
-#define T_Freq 302
-#define T_Fudge 303
-#define T_Host 304
-#define T_Huffpuff 305
-#define T_Iburst 306
-#define T_Ident 307
-#define T_Ignore 308
-#define T_Incalloc 309
-#define T_Incmem 310
-#define T_Initalloc 311
-#define T_Initmem 312
-#define T_Includefile 313
-#define T_Integer 314
-#define T_Interface 315
-#define T_Intrange 316
-#define T_Io 317
-#define T_Ipv4 318
-#define T_Ipv4_flag 319
-#define T_Ipv6 320
-#define T_Ipv6_flag 321
-#define T_Kernel 322
-#define T_Key 323
-#define T_Keys 324
-#define T_Keysdir 325
-#define T_Kod 326
-#define T_Mssntp 327
-#define T_Leapfile 328
-#define T_Limited 329
-#define T_Link 330
-#define T_Listen 331
-#define T_Logconfig 332
-#define T_Logfile 333
-#define T_Loopstats 334
-#define T_Lowpriotrap 335
-#define T_Manycastclient 336
-#define T_Manycastserver 337
-#define T_Mask 338
-#define T_Maxage 339
-#define T_Maxclock 340
-#define T_Maxdepth 341
-#define T_Maxdist 342
-#define T_Maxmem 343
-#define T_Maxpoll 344
-#define T_Mdnstries 345
-#define T_Mem 346
-#define T_Memlock 347
-#define T_Minclock 348
-#define T_Mindepth 349
-#define T_Mindist 350
-#define T_Minimum 351
-#define T_Minpoll 352
-#define T_Minsane 353
-#define T_Mode 354
-#define T_Mode7 355
-#define T_Monitor 356
-#define T_Month 357
-#define T_Mru 358
-#define T_Multicastclient 359
-#define T_Nic 360
-#define T_Nolink 361
-#define T_Nomodify 362
-#define T_Nomrulist 363
-#define T_None 364
-#define T_Nonvolatile 365
-#define T_Nopeer 366
-#define T_Noquery 367
-#define T_Noselect 368
-#define T_Noserve 369
-#define T_Notrap 370
-#define T_Notrust 371
-#define T_Ntp 372
-#define T_Ntpport 373
-#define T_NtpSignDsocket 374
-#define T_Orphan 375
-#define T_Orphanwait 376
-#define T_Panic 377
-#define T_Peer 378
-#define T_Peerstats 379
-#define T_Phone 380
-#define T_Pid 381
-#define T_Pidfile 382
-#define T_Pool 383
-#define T_Port 384
-#define T_Preempt 385
-#define T_Prefer 386
-#define T_Protostats 387
-#define T_Pw 388
-#define T_Randfile 389
-#define T_Rawstats 390
-#define T_Refid 391
-#define T_Requestkey 392
-#define T_Reset 393
-#define T_Restrict 394
-#define T_Revoke 395
-#define T_Rlimit 396
-#define T_Saveconfigdir 397
-#define T_Server 398
-#define T_Setvar 399
-#define T_Source 400
-#define T_Stacksize 401
-#define T_Statistics 402
-#define T_Stats 403
-#define T_Statsdir 404
-#define T_Step 405
-#define T_Stepout 406
-#define T_Stratum 407
-#define T_String 408
-#define T_Sys 409
-#define T_Sysstats 410
-#define T_Tick 411
-#define T_Time1 412
-#define T_Time2 413
-#define T_Timer 414
-#define T_Timingstats 415
-#define T_Tinker 416
-#define T_Tos 417
-#define T_Trap 418
-#define T_True 419
-#define T_Trustedkey 420
-#define T_Ttl 421
-#define T_Type 422
-#define T_U_int 423
-#define T_Unconfig 424
-#define T_Unpeer 425
-#define T_Version 426
-#define T_WanderThreshold 427
-#define T_Week 428
-#define T_Wildcard 429
-#define T_Xleave 430
-#define T_Year 431
-#define T_Flag 432
-#define T_EOC 433
-#define T_Simulate 434
-#define T_Beep_Delay 435
-#define T_Sim_Duration 436
-#define T_Server_Offset 437
-#define T_Duration 438
-#define T_Freq_Offset 439
-#define T_Wander 440
-#define T_Jitter 441
-#define T_Prop_Delay 442
-#define T_Proc_Delay 443
-#define YYERRCODE 256
-static const short yylhs[] = {                           -1,
-    0,   86,   86,   86,   87,   87,   87,   87,   87,   87,
-   87,   87,   87,   87,   87,   87,   87,   87,   88,    7,
-    7,    7,    7,    7,    3,    3,   31,    4,    4,   46,
-   46,   43,   43,   43,   44,   45,   45,   45,   45,   45,
-   45,   45,   45,   47,   47,   48,   48,   48,   48,   48,
-   48,   49,   50,   89,   72,   72,   90,   90,   90,   90,
-   91,   91,   91,   91,   91,   91,   91,   91,   91,   11,
-   11,   10,   10,   12,   12,   12,   12,   12,   94,   69,
-   69,   66,   66,   66,   68,   68,   68,   68,   68,   68,
-   67,   67,   67,   67,   92,   92,   92,   56,   56,   55,
-   55,   55,   55,   55,   55,   55,   55,   18,   18,   17,
-   17,   17,   17,   32,   32,   16,   16,   19,   19,   19,
-   19,   19,   19,   19,   93,   93,   93,   93,   93,   93,
-   93,   93,    2,    2,    1,    1,    1,    1,    1,    1,
-    1,    1,    1,    1,    1,    1,    1,    1,    1,   15,
-   15,   13,   14,   14,   14,   40,   40,   38,   39,   39,
-   39,   39,   39,   39,   39,   39,   95,   23,   23,   20,
-   20,   20,   20,   20,   22,   22,   21,   21,   21,   21,
-   96,   54,   54,   53,   52,   52,   52,   97,   97,   61,
-   61,   58,   58,   59,   59,   59,   59,   59,   59,   60,
-   60,   98,   65,   65,   64,   63,   63,   63,   63,   63,
-   63,   63,   63,   99,   99,   99,   99,   99,   99,   99,
-   99,   99,   99,   99,   99,   99,   35,   35,   35,   36,
-   36,   36,   37,   37,  101,  101,  101,   73,   62,   62,
-   71,   71,   70,   70,   34,   34,   33,   29,   29,   30,
-   30,   41,   41,   41,   41,   28,   28,   28,   51,    9,
-    9,    8,    8,    8,    8,    8,    8,    8,   24,   24,
-   25,   25,   26,   26,   27,   57,   57,    5,    5,    6,
-    6,    6,   42,   42,  100,  102,   75,   75,   74,   76,
-   76,   77,   77,   78,   79,   80,   82,   82,   81,   84,
-   84,   85,   83,   83,   83,   83,   83,
-};
-static const short yylen[] = {                            2,
-    1,    3,    2,    2,    0,    1,    1,    1,    1,    1,
-    1,    1,    1,    1,    1,    1,    1,    1,    3,    1,
-    1,    1,    1,    1,    1,    2,    1,    1,    1,    0,
-    2,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-    1,    1,    1,    2,    2,    1,    1,    1,    1,    1,
-    1,    2,    1,    2,    1,    1,    1,    2,    2,    2,
-    2,    2,    2,    2,    2,    2,    2,    2,    2,    0,
-    2,    2,    2,    1,    1,    1,    1,    1,    2,    2,
-    1,    2,    2,    2,    1,    1,    1,    1,    1,    1,
-    1,    1,    1,    1,    2,    2,    3,    2,    1,    1,
-    1,    1,    1,    1,    1,    1,    1,    0,    2,    2,
-    2,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-    1,    1,    1,    1,    2,    2,    3,    5,    3,    4,
-    4,    3,    0,    2,    1,    1,    1,    1,    1,    1,
-    1,    1,    1,    1,    1,    1,    1,    1,    1,    2,
-    1,    2,    1,    1,    1,    2,    1,    2,    1,    1,
-    1,    1,    1,    1,    1,    1,    3,    2,    1,    2,
-    2,    2,    2,    2,    1,    1,    1,    1,    1,    1,
-    2,    2,    1,    2,    1,    1,    1,    2,    2,    2,
-    1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-    1,    2,    2,    1,    2,    1,    1,    1,    1,    1,
-    1,    1,    1,    1,    1,    2,    2,    2,    3,    1,
-    2,    2,    2,    2,    3,    2,    1,    1,    1,    1,
-    1,    1,    1,    1,    1,    2,    0,    4,    1,    0,
-    0,    2,    2,    2,    2,    1,    1,    3,    3,    1,
-    1,    1,    1,    1,    1,    1,    1,    1,    2,    2,
-    1,    1,    1,    1,    1,    1,    1,    1,    2,    1,
-    2,    1,    1,    1,    5,    2,    1,    2,    1,    1,
-    1,    1,    1,    1,    5,    1,    3,    2,    3,    1,
-    1,    2,    1,    5,    4,    3,    2,    1,    6,    3,
-    2,    3,    1,    1,    1,    1,    1,
-};
-static const short yydefred[] = {                         0,
-    0,    0,   23,   57,  227,    0,   70,    0,    0,    0,
-    0,  220,    0,    0,  230,    0,  250,    0,    0,  231,
-    0,  233,   24,    0,    0,    0,    0,  251,  228,    0,
-   22,    0,  232,   21,    0,    0,    0,    0,    0,  234,
-   20,    0,    0,    0,  229,    0,    0,    0,    0,    0,
-   55,   56,  286,    0,    0,  214,    0,    0,    0,    0,
-  215,    0,    0,    0,    6,    7,    8,    9,   10,   11,
-   12,   13,   14,   15,   16,   17,   18,    0,    4,   61,
-   62,    0,  194,  195,  196,  197,  200,  198,  199,  201,
-  191,  192,  193,    0,  153,  154,  155,  151,    0,    0,
-    0,  221,    0,  100,  101,  102,  103,  107,  104,  105,
-  106,  108,   28,   29,   27,    0,    0,   25,    0,   64,
-   65,  247,  246,    0,  279,    0,   60,  159,  160,  161,
-  162,  163,  164,  165,  166,  157,    0,    0,    0,   69,
-  277,    0,   66,  262,  263,  264,  265,  266,  267,  268,
-  261,    0,  133,    0,    0,  133,  133,    0,   67,  187,
-  185,  186,    0,  183,    0,    0,  224,   99,    0,   96,
-  206,  207,  208,  209,  210,  211,  212,  213,    0,  204,
-    0,   90,   85,    0,   86,   94,   92,   93,   91,   89,
-   87,   88,   81,    0,    0,    0,  241,  273,    0,    0,
-  272,  274,  270,    0,   30,  258,  257,  256,    0,  284,
-  283,  216,  217,  218,   54,    0,    3,    0,   78,   74,
-   75,   76,   77,    0,   71,    0,  190,  152,  150,  236,
-    0,    0,  177,  178,  179,  180,    0,    0,  175,  176,
-  169,    0,    0,    0,   26,  219,  245,  278,  158,  156,
-  276,  260,    0,  133,  133,    0,    0,    0,  184,  182,
-    0,   98,  205,  203,  282,  280,  281,   84,   83,   82,
-   80,    0,    0,  271,  269,    0,  252,  253,  254,  249,
-  255,  248,    2,  290,  291,    0,    0,    0,   73,   72,
-  117,  116,    0,  114,  115,    0,  113,  109,  112,  173,
-  174,  172,  171,  170,  168,  135,  136,  137,  138,  139,
-  140,  141,  142,  143,  144,  145,  146,  147,  148,  149,
-  134,    0,    0,  133,    0,    0,    0,  242,    0,   36,
-   37,   38,   53,   46,   48,   47,   50,   39,   40,   41,
-   42,   49,   51,   43,   31,   32,   35,   33,    0,   34,
-    0,  288,    0,    0,    0,  293,    0,    0,  110,  124,
-  120,  122,  118,  119,  121,  123,  111,    0,  239,  238,
-  244,  243,    0,   44,   45,   52,    0,  287,  285,  292,
-    0,  289,  275,  296,    0,    0,    0,    0,  298,    0,
-    0,    0,  294,  297,  295,    0,    0,  303,  304,  305,
-  306,  307,    0,    0,    0,    0,  299,    0,  301,  302,
-  300,
-};
-static const short yydgoto[] = {                         54,
-  321,  253,  125,  117,  126,  268,   55,  151,  152,  225,
-   82,  226,   98,   99,  100,  297,  298,  231,  367,  241,
-  242,  243,  244,  204,  200,  201,  202,  209,   56,   57,
-  118,  299,  123,  124,   58,   59,   60,  136,  137,  138,
-  282,  212,  345,  346,  347,  276,  348,  349,  350,  351,
-   61,  163,  164,  165,  112,  169,  142,   91,   92,   93,
-   94,  370,  179,  180,  181,  193,  194,  195,  196,  328,
-  272,   62,  167,  286,  287,  288,  355,  356,  386,  357,
-  389,  390,  403,  404,  405,   63,   64,   65,   66,   67,
-   68,   69,   70,   71,   72,   73,   74,   75,   76,   77,
-  102,   78,
-};
-static const short yysindex[] = {                      -231,
- -399, -279,    0,    0,    0, -278,    0, -127, -225, -354,
- -127,    0, -257, -297,    0, -353,    0, -351, -350,    0,
- -344,    0,    0, -297, -241,  -59, -297,    0,    0, -343,
-    0, -333,    0,    0, -236, -200, -177, -234, -280,    0,
-    0, -327, -257, -325,    0, -189,  155, -322,  -36, -227,
-    0,    0,    0,    0, -297,    0, -261, -270, -316, -310,
-    0, -297,  -22, -334,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,  -23,    0,    0,
-    0, -197,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0, -127,    0,    0,    0,    0, -211, -225,
- -168,    0, -127,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0, -208, -299,    0,  -22,    0,
-    0,    0,    0, -344,    0, -297,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0, -195,  -59, -297,    0,
-    0, -285,    0,    0,    0,    0,    0,    0,    0,    0,
-    0, -200,    0, -157, -145,    0,    0, -190,    0,    0,
-    0,    0, -164,    0, -280,   93,    0,    0, -257,    0,
-    0,    0,    0,    0,    0,    0,    0,    0, -270,    0,
- -189,    0,    0, -282,    0,    0,    0,    0,    0,    0,
-    0,    0,    0, -270, -159,  155,    0,    0, -155,  -36,
-    0,    0,    0, -154,    0,    0,    0,    0, -252,    0,
-    0,    0,    0,    0,    0, -276,    0, -406,    0,    0,
-    0,    0,    0, -144,    0, -239,    0,    0,    0,    0,
-  -63, -233,    0,    0,    0,    0, -232, -142,    0,    0,
-    0, -282, -270, -208,    0,    0,    0,    0,    0,    0,
-    0,    0,  106,    0,    0,  106,  106, -322,    0,    0,
- -230,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0, -289, -115,    0,    0,   61,    0,    0,    0,    0,
-    0,    0,    0,    0,    0, -237, -385,  120,    0,    0,
-    0,    0, -207,    0,    0, -249,    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,  106,  106,    0,  -84, -322, -112,    0, -108,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0, -303,    0,
- -201,    0,  139, -222, -119,    0,   85, -270,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,  106,    0,    0,
-    0,    0,  171,    0,    0,    0, -297,    0,    0,    0,
- -218,    0,    0,    0,  154, -217, -270,  164,    0, -117,
- -194, -270,    0,    0,    0,  103, -206,    0,    0,    0,
-    0,    0,  177, -123, -193, -270,    0, -192,    0,    0,
-    0,
-};
-static const short yyrindex[] = {                      -184,
-    0,    0,    0,    0,    0,    0,    0,    0,    0, -176,
-    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,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    1,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0, -175,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0, -173,    0,    0,    0,    0,    0, -170,
- -169,    0, -167,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0, -184,    0,
-    0,    0,    0, -163,    0, -162,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0, -160, -158,    0,
-    0, -156,    0,    0,    0,    0,    0,    0,    0,    0,
-    0, -150,    0, -165, -152,    0,    0,   92,    0,    0,
-    0,    0,    0,    0, -147,    0,    0,    0, -146,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
- -139,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0, -399,    0,    0,    0, -138,
-    0,    0,    0, -137,    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,
- -136,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0, -134,    0,    0,    0,    0,    0,    0,
-    0,    0, -133,    0,    0, -132, -129,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0, -128,    0,    0,    0, -126,    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,    0,    0,    0,    0,    0,
-    0, -125, -124,    0, -121,    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,    0,    0,    0, -120,    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,    0,    0,    0,
-    0,
-};
-static const short yygindex[] = {                         0,
-    0, -114,  -14,    0,  217,   17,    0,  122,    0,    0,
-    0,    0,  188,    0,    0,    0,    0,    0,    0,   45,
-    0,    0,    0,    0,    0,  125,    0,    0,    0,    0,
-  -34,    0,  198,    0,    0,    0,    0,  189,    0,    0,
-    0, -174,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,  161,    0,  -31,    0,    0,  -75,    0,    0,
-  317,    0,    0,  148,    0,  134,    0,    0,    0,    0,
-    0,    0,    0,   44,    0,    0,    0,  -21,    0,    0,
-  -57,    0,    0,    0,  -69,    0,  -45,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,
-};
-#define YYTABLESIZE 532
-static const short yytable[] = {                        116,
-    1,  407,  158,  199,  263,  379,  277,  393,  360,  265,
-  374,  168,  353,  197,  160,  210,  104,  216,  227,  269,
-  105,  113,  157,  114,    1,  326,  206,  227,  284,  285,
-  361,  266,    2,   79,   80,   81,    3,    4,    5,   95,
-  205,  256,  257,  211,    6,    7,  207,  215,  232,  284,
-  285,    8,    9,  101,  119,   10,  120,  121,   11,   12,
-  144,  145,   13,  122,  140,  278,  161,  279,  304,  208,
-  171,   14,  127,  246,  141,   15,  106,  143,  146,  159,
-  166,   16,  170,   17,  219,  115,  203,  233,  234,  235,
-  236,  213,   18,   19,  327,  172,   20,  214,  217,  218,
-   21,   22,  228,  153,   23,   24,  220,  362,  245,  221,
-  115,  248,  173,   25,  363,  174,  147,  230,  249,  375,
-  162,  107,  251,  254,  248,   96,   26,   27,   28,  108,
-   97,  364,  109,   29,   83,  255,  267,  262,   84,  322,
-  323,  154,   30,  155,   85,  148,   31,  258,   32,  259,
-   33,   34,  110,  261,  270,  280,  283,  111,  273,  275,
-   35,   36,   37,   38,   39,   40,   41,   42,  290,  289,
-   43,  302,   44,  329,  300,  301,  281,  325,  365,   45,
-  358,  366,  237,  382,   46,   47,   48,  175,   49,   50,
-  222,  223,   51,   52,   86,  352,  369,  224,  238,  377,
-  359,  372,   53,  239,  240,  373,  376,  381,  149,  368,
-  378,  383,  391,  150,  387,  176,  177,  396,  385,  291,
-  388,  178,  156,  324,  392,  397,  292,   87,   88,  293,
-  115,  410,  398,  399,  400,  401,  402,  406,  395,  409,
-  411,    2,   28,  139,   89,    3,    4,    5,    5,  128,
-  129,  130,  131,    6,    7,   29,  237,   63,  303,  189,
-    8,    9,  125,  235,   10,  188,  294,   11,   12,  222,
-   58,   13,  126,  252,   59,   90,  223,  198,  353,  132,
-   14,  133,  259,  134,   15,  181,   95,  229,  305,  135,
-   16,  371,   17,  202,   68,  226,   97,  295,  167,  129,
-  132,   18,   19,  127,  225,   20,   19,  130,  131,   21,
-   22,  240,  128,   23,   24,  398,  399,  400,  401,  402,
-  388,  247,   25,  330,  274,  260,  250,  103,  264,  271,
-  354,  331,  394,  380,  408,   26,   27,   28,    0,    0,
-    0,    0,   29,    0,    0,    0,    0,    0,    0,    0,
-    0,   30,    0,    0,    0,   31,    0,   32,  296,   33,
-   34,    0,  384,    0,    0,    0,  332,  333,    0,   35,
-   36,   37,   38,   39,   40,   41,   42,    0,    0,   43,
-    0,   44,    0,  334,    0,    0,    0,    0,   45,    0,
-    0,   25,    0,   46,   47,   48,    0,   49,   50,   25,
-    0,   51,   52,    0,  335,  306,    0,    0,    0,    0,
-    0,   53,  336,  307,  337,    0,    0,   25,   25,    0,
-   25,  182,    0,    0,    0,    0,   25,  183,  338,  184,
-    0,  308,  309,    5,  310,    0,    0,    0,    0,    0,
-  311,    0,    0,    0,    0,  339,  340,    0,    0,    0,
-    0,    0,    0,   25,   25,  185,    0,   25,   25,    0,
-   25,   25,   25,    0,   25,    0,    0,  312,  313,    0,
-    0,  314,  315,    0,  316,  317,  318,    0,  319,  341,
-    0,  342,    0,    0,    0,    0,  343,    0,    0,    0,
-  344,    0,    0,    0,  186,    0,  187,    0,    0,    0,
-    0,    0,  188,    0,  189,    0,    0,  190,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,   25,    0,    0,
-    0,    0,    0,    0,   25,    0,    0,    0,    0,  191,
-  192,  320,
-};
-static const short yycheck[] = {                         14,
-    0,  125,   37,   40,  179,  125,  259,  125,  258,  292,
-  314,   43,  398,   48,  295,  286,  274,   63,   94,  194,
-  278,  319,   37,  321,  256,  315,  288,  103,  435,  436,
-  280,  314,  264,  433,  314,  314,  268,  269,  270,  265,
-   55,  156,  157,  314,  276,  277,  308,   62,  257,  435,
-  436,  283,  284,  408,  408,  287,  408,  408,  290,  291,
-  261,  262,  294,  408,  408,  318,  347,  320,  243,  331,
-  260,  303,  314,  119,  408,  307,  334,  314,  279,  314,
-  408,  313,  408,  315,  282,  408,  314,  296,  297,  298,
-  299,  408,  324,  325,  384,  285,  328,  408,  433,  123,
-  332,  333,  314,  281,  336,  337,  304,  357,  408,  307,
-  408,  126,  302,  345,  364,  305,  317,  286,  314,  423,
-  401,  379,  408,  281,  139,  351,  358,  359,  360,  387,
-  356,  381,  390,  365,  262,  281,  419,  169,  266,  254,
-  255,  319,  374,  321,  272,  346,  378,  338,  380,  314,
-  382,  383,  410,   61,  314,  408,  433,  415,  314,  314,
-  392,  393,  394,  395,  396,  397,  398,  399,  408,  314,
-  402,  314,  404,  289,  408,  408,  429,  408,  428,  411,
-   61,  431,  391,  358,  416,  417,  418,  377,  420,  421,
-  388,  389,  424,  425,  322,  433,  281,  395,  407,   61,
-  408,  314,  434,  412,  413,  314,  408,  123,  409,  324,
-  433,   41,  387,  414,   61,  405,  406,  392,  437,  283,
-  438,  411,  400,  258,   61,  123,  290,  355,  356,  293,
-  408,  406,  439,  440,  441,  442,  443,   61,  433,  433,
-  433,  264,  408,   27,  372,  268,  269,  270,  433,  309,
-  310,  311,  312,  276,  277,  408,  433,  433,  242,  433,
-  283,  284,  433,  433,  287,  433,  330,  290,  291,  433,
-  433,  294,  433,  152,  433,  403,  433,  314,  398,  339,
-  303,  341,  433,  343,  307,  433,  433,  100,  244,  349,
-  313,  326,  315,  433,  433,  433,  433,  361,  433,  433,
-  433,  324,  325,  433,  433,  328,  433,  433,  433,  332,
-  333,  433,  433,  336,  337,  439,  440,  441,  442,  443,
-  438,  124,  345,  263,  200,  165,  138,   11,  181,  196,
-  287,  271,  390,  355,  404,  358,  359,  360,   -1,   -1,
-   -1,   -1,  365,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,  374,   -1,   -1,   -1,  378,   -1,  380,  422,  382,
-  383,   -1,  377,   -1,   -1,   -1,  306,  307,   -1,  392,
-  393,  394,  395,  396,  397,  398,  399,   -1,   -1,  402,
-   -1,  404,   -1,  323,   -1,   -1,   -1,   -1,  411,   -1,
-   -1,  300,   -1,  416,  417,  418,   -1,  420,  421,  308,
-   -1,  424,  425,   -1,  344,  300,   -1,   -1,   -1,   -1,
-   -1,  434,  352,  308,  354,   -1,   -1,  326,  327,   -1,
-  329,  267,   -1,   -1,   -1,   -1,  335,  273,  368,  275,
-   -1,  326,  327,  433,  329,   -1,   -1,   -1,   -1,   -1,
-  335,   -1,   -1,   -1,   -1,  385,  386,   -1,   -1,   -1,
-   -1,   -1,   -1,  362,  363,  301,   -1,  366,  367,   -1,
-  369,  370,  371,   -1,  373,   -1,   -1,  362,  363,   -1,
-   -1,  366,  367,   -1,  369,  370,  371,   -1,  373,  419,
-   -1,  421,   -1,   -1,   -1,   -1,  426,   -1,   -1,   -1,
-  430,   -1,   -1,   -1,  340,   -1,  342,   -1,   -1,   -1,
-   -1,   -1,  348,   -1,  350,   -1,   -1,  353,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,  426,   -1,   -1,
-   -1,   -1,   -1,   -1,  433,   -1,   -1,   -1,   -1,  375,
-  376,  426,
-};
-#define YYFINAL 54
-#ifndef YYDEBUG
-#define YYDEBUG 0
-#endif
-#define YYMAXTOKEN 443
-#define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? (YYMAXTOKEN + 1) : (a))
-static const char *yytname[] = {
-
-"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,
-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,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,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,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,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"T_Abbrev",
-"T_Age","T_All","T_Allan","T_Allpeers","T_Auth","T_Autokey","T_Automax",
-"T_Average","T_Bclient","T_Beacon","T_Broadcast","T_Broadcastclient",
-"T_Broadcastdelay","T_Burst","T_Calibrate","T_Ceiling","T_Clockstats",
-"T_Cohort","T_ControlKey","T_Crypto","T_Cryptostats","T_Ctl","T_Day",
-"T_Default","T_Digest","T_Disable","T_Discard","T_Dispersion","T_Double",
-"T_Driftfile","T_Drop","T_Ellipsis","T_Enable","T_End","T_False","T_File",
-"T_Filegen","T_Filenum","T_Flag1","T_Flag2","T_Flag3","T_Flag4","T_Flake",
-"T_Floor","T_Freq","T_Fudge","T_Host","T_Huffpuff","T_Iburst","T_Ident",
-"T_Ignore","T_Incalloc","T_Incmem","T_Initalloc","T_Initmem","T_Includefile",
-"T_Integer","T_Interface","T_Intrange","T_Io","T_Ipv4","T_Ipv4_flag","T_Ipv6",
-"T_Ipv6_flag","T_Kernel","T_Key","T_Keys","T_Keysdir","T_Kod","T_Mssntp",
-"T_Leapfile","T_Limited","T_Link","T_Listen","T_Logconfig","T_Logfile",
-"T_Loopstats","T_Lowpriotrap","T_Manycastclient","T_Manycastserver","T_Mask",
-"T_Maxage","T_Maxclock","T_Maxdepth","T_Maxdist","T_Maxmem","T_Maxpoll",
-"T_Mdnstries","T_Mem","T_Memlock","T_Minclock","T_Mindepth","T_Mindist",
-"T_Minimum","T_Minpoll","T_Minsane","T_Mode","T_Mode7","T_Monitor","T_Month",
-"T_Mru","T_Multicastclient","T_Nic","T_Nolink","T_Nomodify","T_Nomrulist",
-"T_None","T_Nonvolatile","T_Nopeer","T_Noquery","T_Noselect","T_Noserve",
-"T_Notrap","T_Notrust","T_Ntp","T_Ntpport","T_NtpSignDsocket","T_Orphan",
-"T_Orphanwait","T_Panic","T_Peer","T_Peerstats","T_Phone","T_Pid","T_Pidfile",
-"T_Pool","T_Port","T_Preempt","T_Prefer","T_Protostats","T_Pw","T_Randfile",
-"T_Rawstats","T_Refid","T_Requestkey","T_Reset","T_Restrict","T_Revoke",
-"T_Rlimit","T_Saveconfigdir","T_Server","T_Setvar","T_Source","T_Stacksize",
-"T_Statistics","T_Stats","T_Statsdir","T_Step","T_Stepout","T_Stratum",
-"T_String","T_Sys","T_Sysstats","T_Tick","T_Time1","T_Time2","T_Timer",
-"T_Timingstats","T_Tinker","T_Tos","T_Trap","T_True","T_Trustedkey","T_Ttl",
-"T_Type","T_U_int","T_Unconfig","T_Unpeer","T_Version","T_WanderThreshold",
-"T_Week","T_Wildcard","T_Xleave","T_Year","T_Flag","T_EOC","T_Simulate",
-"T_Beep_Delay","T_Sim_Duration","T_Server_Offset","T_Duration","T_Freq_Offset",
-"T_Wander","T_Jitter","T_Prop_Delay","T_Proc_Delay","illegal-token",
-};
-#if YYDEBUG
-static const char *yyrule[] = {
-"$accept : configuration",
-"configuration : command_list",
-"command_list : command_list command T_EOC",
-"command_list : command T_EOC",
-"command_list : error T_EOC",
-"command :",
-"command : server_command",
-"command : unpeer_command",
-"command : other_mode_command",
-"command : authentication_command",
-"command : monitoring_command",
-"command : access_control_command",
-"command : orphan_mode_command",
-"command : fudge_command",
-"command : rlimit_command",
-"command : system_option_command",
-"command : tinker_command",
-"command : miscellaneous_command",
-"command : simulate_command",
-"server_command : client_type address option_list",
-"client_type : T_Server",
-"client_type : T_Pool",
-"client_type : T_Peer",
-"client_type : T_Broadcast",
-"client_type : T_Manycastclient",
-"address : ip_address",
-"address : address_fam T_String",
-"ip_address : T_String",
-"address_fam : T_Ipv4_flag",
-"address_fam : T_Ipv6_flag",
-"option_list :",
-"option_list : option_list option",
-"option : option_flag",
-"option : option_int",
-"option : option_str",
-"option_flag : option_flag_keyword",
-"option_flag_keyword : T_Autokey",
-"option_flag_keyword : T_Burst",
-"option_flag_keyword : T_Iburst",
-"option_flag_keyword : T_Noselect",
-"option_flag_keyword : T_Preempt",
-"option_flag_keyword : T_Prefer",
-"option_flag_keyword : T_True",
-"option_flag_keyword : T_Xleave",
-"option_int : option_int_keyword T_Integer",
-"option_int : option_int_keyword T_U_int",
-"option_int_keyword : T_Key",
-"option_int_keyword : T_Minpoll",
-"option_int_keyword : T_Maxpoll",
-"option_int_keyword : T_Ttl",
-"option_int_keyword : T_Mode",
-"option_int_keyword : T_Version",
-"option_str : option_str_keyword T_String",
-"option_str_keyword : T_Ident",
-"unpeer_command : unpeer_keyword address",
-"unpeer_keyword : T_Unconfig",
-"unpeer_keyword : T_Unpeer",
-"other_mode_command : T_Broadcastclient",
-"other_mode_command : T_Manycastserver address_list",
-"other_mode_command : T_Multicastclient address_list",
-"other_mode_command : T_Mdnstries T_Integer",
-"authentication_command : T_Automax T_Integer",
-"authentication_command : T_ControlKey T_Integer",
-"authentication_command : T_Crypto crypto_command_list",
-"authentication_command : T_Keys T_String",
-"authentication_command : T_Keysdir T_String",
-"authentication_command : T_Requestkey T_Integer",
-"authentication_command : T_Revoke T_Integer",
-"authentication_command : T_Trustedkey integer_list_range",
-"authentication_command : T_NtpSignDsocket T_String",
-"crypto_command_list :",
-"crypto_command_list : crypto_command_list crypto_command",
-"crypto_command : crypto_str_keyword T_String",
-"crypto_command : T_Revoke T_Integer",
-"crypto_str_keyword : T_Host",
-"crypto_str_keyword : T_Ident",
-"crypto_str_keyword : T_Pw",
-"crypto_str_keyword : T_Randfile",
-"crypto_str_keyword : T_Digest",
-"orphan_mode_command : T_Tos tos_option_list",
-"tos_option_list : tos_option_list tos_option",
-"tos_option_list : tos_option",
-"tos_option : tos_option_int_keyword T_Integer",
-"tos_option : tos_option_dbl_keyword number",
-"tos_option : T_Cohort boolean",
-"tos_option_int_keyword : T_Ceiling",
-"tos_option_int_keyword : T_Floor",
-"tos_option_int_keyword : T_Orphan",
-"tos_option_int_keyword : T_Orphanwait",
-"tos_option_int_keyword : T_Minsane",
-"tos_option_int_keyword : T_Beacon",
-"tos_option_dbl_keyword : T_Mindist",
-"tos_option_dbl_keyword : T_Maxdist",
-"tos_option_dbl_keyword : T_Minclock",
-"tos_option_dbl_keyword : T_Maxclock",
-"monitoring_command : T_Statistics stats_list",
-"monitoring_command : T_Statsdir T_String",
-"monitoring_command : T_Filegen stat filegen_option_list",
-"stats_list : stats_list stat",
-"stats_list : stat",
-"stat : T_Clockstats",
-"stat : T_Cryptostats",
-"stat : T_Loopstats",
-"stat : T_Peerstats",
-"stat : T_Rawstats",
-"stat : T_Sysstats",
-"stat : T_Timingstats",
-"stat : T_Protostats",
-"filegen_option_list :",
-"filegen_option_list : filegen_option_list filegen_option",
-"filegen_option : T_File T_String",
-"filegen_option : T_Type filegen_type",
-"filegen_option : link_nolink",
-"filegen_option : enable_disable",
-"link_nolink : T_Link",
-"link_nolink : T_Nolink",
-"enable_disable : T_Enable",
-"enable_disable : T_Disable",
-"filegen_type : T_None",
-"filegen_type : T_Pid",
-"filegen_type : T_Day",
-"filegen_type : T_Week",
-"filegen_type : T_Month",
-"filegen_type : T_Year",
-"filegen_type : T_Age",
-"access_control_command : T_Discard discard_option_list",
-"access_control_command : T_Mru mru_option_list",
-"access_control_command : T_Restrict address ac_flag_list",
-"access_control_command : T_Restrict ip_address T_Mask ip_address ac_flag_list",
-"access_control_command : T_Restrict T_Default ac_flag_list",
-"access_control_command : T_Restrict T_Ipv4_flag T_Default ac_flag_list",
-"access_control_command : T_Restrict T_Ipv6_flag T_Default ac_flag_list",
-"access_control_command : T_Restrict T_Source ac_flag_list",
-"ac_flag_list :",
-"ac_flag_list : ac_flag_list access_control_flag",
-"access_control_flag : T_Flake",
-"access_control_flag : T_Ignore",
-"access_control_flag : T_Kod",
-"access_control_flag : T_Mssntp",
-"access_control_flag : T_Limited",
-"access_control_flag : T_Lowpriotrap",
-"access_control_flag : T_Nomodify",
-"access_control_flag : T_Nomrulist",
-"access_control_flag : T_Nopeer",
-"access_control_flag : T_Noquery",
-"access_control_flag : T_Noserve",
-"access_control_flag : T_Notrap",
-"access_control_flag : T_Notrust",
-"access_control_flag : T_Ntpport",
-"access_control_flag : T_Version",
-"discard_option_list : discard_option_list discard_option",
-"discard_option_list : discard_option",
-"discard_option : discard_option_keyword T_Integer",
-"discard_option_keyword : T_Average",
-"discard_option_keyword : T_Minimum",
-"discard_option_keyword : T_Monitor",
-"mru_option_list : mru_option_list mru_option",
-"mru_option_list : mru_option",
-"mru_option : mru_option_keyword T_Integer",
-"mru_option_keyword : T_Incalloc",
-"mru_option_keyword : T_Incmem",
-"mru_option_keyword : T_Initalloc",
-"mru_option_keyword : T_Initmem",
-"mru_option_keyword : T_Maxage",
-"mru_option_keyword : T_Maxdepth",
-"mru_option_keyword : T_Maxmem",
-"mru_option_keyword : T_Mindepth",
-"fudge_command : T_Fudge address fudge_factor_list",
-"fudge_factor_list : fudge_factor_list fudge_factor",
-"fudge_factor_list : fudge_factor",
-"fudge_factor : fudge_factor_dbl_keyword number",
-"fudge_factor : fudge_factor_bool_keyword boolean",
-"fudge_factor : T_Stratum T_Integer",
-"fudge_factor : T_Abbrev T_String",
-"fudge_factor : T_Refid T_String",
-"fudge_factor_dbl_keyword : T_Time1",
-"fudge_factor_dbl_keyword : T_Time2",
-"fudge_factor_bool_keyword : T_Flag1",
-"fudge_factor_bool_keyword : T_Flag2",
-"fudge_factor_bool_keyword : T_Flag3",
-"fudge_factor_bool_keyword : T_Flag4",
-"rlimit_command : T_Rlimit rlimit_option_list",
-"rlimit_option_list : rlimit_option_list rlimit_option",
-"rlimit_option_list : rlimit_option",
-"rlimit_option : rlimit_option_keyword T_Integer",
-"rlimit_option_keyword : T_Memlock",
-"rlimit_option_keyword : T_Stacksize",
-"rlimit_option_keyword : T_Filenum",
-"system_option_command : T_Enable system_option_list",
-"system_option_command : T_Disable system_option_list",
-"system_option_list : system_option_list system_option",
-"system_option_list : system_option",
-"system_option : system_option_flag_keyword",
-"system_option : system_option_local_flag_keyword",
-"system_option_flag_keyword : T_Auth",
-"system_option_flag_keyword : T_Bclient",
-"system_option_flag_keyword : T_Calibrate",
-"system_option_flag_keyword : T_Kernel",
-"system_option_flag_keyword : T_Monitor",
-"system_option_flag_keyword : T_Ntp",
-"system_option_local_flag_keyword : T_Mode7",
-"system_option_local_flag_keyword : T_Stats",
-"tinker_command : T_Tinker tinker_option_list",
-"tinker_option_list : tinker_option_list tinker_option",
-"tinker_option_list : tinker_option",
-"tinker_option : tinker_option_keyword number",
-"tinker_option_keyword : T_Allan",
-"tinker_option_keyword : T_Dispersion",
-"tinker_option_keyword : T_Freq",
-"tinker_option_keyword : T_Huffpuff",
-"tinker_option_keyword : T_Panic",
-"tinker_option_keyword : T_Step",
-"tinker_option_keyword : T_Stepout",
-"tinker_option_keyword : T_Tick",
-"miscellaneous_command : interface_command",
-"miscellaneous_command : reset_command",
-"miscellaneous_command : misc_cmd_dbl_keyword number",
-"miscellaneous_command : misc_cmd_str_keyword T_String",
-"miscellaneous_command : misc_cmd_str_lcl_keyword T_String",
-"miscellaneous_command : T_Includefile T_String command",
-"miscellaneous_command : T_End",
-"miscellaneous_command : T_Driftfile drift_parm",
-"miscellaneous_command : T_Logconfig log_config_list",
-"miscellaneous_command : T_Phone string_list",
-"miscellaneous_command : T_Setvar variable_assign",
-"miscellaneous_command : T_Trap ip_address trap_option_list",
-"miscellaneous_command : T_Ttl integer_list",
-"misc_cmd_dbl_keyword : T_Broadcastdelay",
-"misc_cmd_dbl_keyword : T_Nonvolatile",
-"misc_cmd_dbl_keyword : T_Tick",
-"misc_cmd_str_keyword : T_Ident",
-"misc_cmd_str_keyword : T_Leapfile",
-"misc_cmd_str_keyword : T_Pidfile",
-"misc_cmd_str_lcl_keyword : T_Logfile",
-"misc_cmd_str_lcl_keyword : T_Saveconfigdir",
-"drift_parm : T_String",
-"drift_parm : T_String T_Double",
-"drift_parm :",
-"variable_assign : T_String '=' T_String t_default_or_zero",
-"t_default_or_zero : T_Default",
-"t_default_or_zero :",
-"trap_option_list :",
-"trap_option_list : trap_option_list trap_option",
-"trap_option : T_Port T_Integer",
-"trap_option : T_Interface ip_address",
-"log_config_list : log_config_list log_config_command",
-"log_config_list : log_config_command",
-"log_config_command : T_String",
-"interface_command : interface_nic nic_rule_action nic_rule_class",
-"interface_command : interface_nic nic_rule_action T_String",
-"interface_nic : T_Interface",
-"interface_nic : T_Nic",
-"nic_rule_class : T_All",
-"nic_rule_class : T_Ipv4",
-"nic_rule_class : T_Ipv6",
-"nic_rule_class : T_Wildcard",
-"nic_rule_action : T_Listen",
-"nic_rule_action : T_Ignore",
-"nic_rule_action : T_Drop",
-"reset_command : T_Reset counter_set_list",
-"counter_set_list : counter_set_list counter_set_keyword",
-"counter_set_list : counter_set_keyword",
-"counter_set_keyword : T_Allpeers",
-"counter_set_keyword : T_Auth",
-"counter_set_keyword : T_Ctl",
-"counter_set_keyword : T_Io",
-"counter_set_keyword : T_Mem",
-"counter_set_keyword : T_Sys",
-"counter_set_keyword : T_Timer",
-"integer_list : integer_list T_Integer",
-"integer_list : T_Integer",
-"integer_list_range : integer_list_range integer_list_range_elt",
-"integer_list_range : integer_list_range_elt",
-"integer_list_range_elt : T_Integer",
-"integer_list_range_elt : integer_range",
-"integer_range : '(' T_Integer T_Ellipsis T_Integer ')'",
-"string_list : string_list T_String",
-"string_list : T_String",
-"address_list : address_list address",
-"address_list : address",
-"boolean : T_Integer",
-"boolean : T_True",
-"boolean : T_False",
-"number : T_Integer",
-"number : T_Double",
-"simulate_command : sim_conf_start '{' sim_init_statement_list sim_server_list '}'",
-"sim_conf_start : T_Simulate",
-"sim_init_statement_list : sim_init_statement_list sim_init_statement T_EOC",
-"sim_init_statement_list : sim_init_statement T_EOC",
-"sim_init_statement : sim_init_keyword '=' number",
-"sim_init_keyword : T_Beep_Delay",
-"sim_init_keyword : T_Sim_Duration",
-"sim_server_list : sim_server_list sim_server",
-"sim_server_list : sim_server",
-"sim_server : sim_server_name '{' sim_server_offset sim_act_list '}'",
-"sim_server_offset : T_Server_Offset '=' number T_EOC",
-"sim_server_name : T_Server '=' address",
-"sim_act_list : sim_act_list sim_act",
-"sim_act_list : sim_act",
-"sim_act : T_Duration '=' number '{' sim_act_stmt_list '}'",
-"sim_act_stmt_list : sim_act_stmt_list sim_act_stmt T_EOC",
-"sim_act_stmt_list : sim_act_stmt T_EOC",
-"sim_act_stmt : sim_act_keyword '=' number",
-"sim_act_keyword : T_Freq_Offset",
-"sim_act_keyword : T_Wander",
-"sim_act_keyword : T_Jitter",
-"sim_act_keyword : T_Prop_Delay",
-"sim_act_keyword : T_Proc_Delay",
-
-};
-#endif
-
-int      yydebug;
-int      yynerrs;
-
-int      yyerrflag;
-int      yychar;
-YYSTYPE  yyval;
-YYSTYPE  yylval;
-
-/* define the initial stack-sizes */
-#ifdef YYSTACKSIZE
-#undef YYMAXDEPTH
-#define YYMAXDEPTH  YYSTACKSIZE
-#else
-#ifdef YYMAXDEPTH
-#define YYSTACKSIZE YYMAXDEPTH
-#else
-#define YYSTACKSIZE 500
-#define YYMAXDEPTH  500
-#endif
-#endif
-
-#define YYINITSTACKSIZE 500
-
-typedef struct {
-    unsigned stacksize;
-    short    *s_base;
-    short    *s_mark;
-    short    *s_last;
-    YYSTYPE  *l_base;
-    YYSTYPE  *l_mark;
-} YYSTACKDATA;
-/* variables for the parser stack */
-static YYSTACKDATA yystack;
-#line 1585 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-
-void 
-yyerror(
-	struct FILE_INFO *ip_file,
-	const char *msg
-	)
-{
-	int retval;
-
-	ip_file->err_line_no = ip_file->prev_token_line_no;
-	ip_file->err_col_no = ip_file->prev_token_col_no;
-	
-	msyslog(LOG_ERR, 
-		"line %d column %d %s", 
-		ip_file->err_line_no,
-		ip_file->err_col_no,
-		msg);
-	if (!input_from_file) {
-		/* Save the error message in the correct buffer */
-		retval = snprintf(remote_config.err_msg + remote_config.err_pos,
-				  MAXLINE - remote_config.err_pos,
-				  "column %d %s",
-				  ip_file->err_col_no, msg);
-
-		/* Increment the value of err_pos */
-		if (retval > 0)
-			remote_config.err_pos += retval;
-
-		/* Increment the number of errors */
-		++remote_config.no_errors;
-	}
-}
-
-
-/*
- * token_name - convert T_ token integers to text
- *		example: token_name(T_Server) returns "T_Server"
- */
-const char *
-token_name(
-	int token
-	)
-{
-	return yytname[YYTRANSLATE(token)];
-}
-
-
-/* Initial Testing function -- ignore */
-#if 0
-int main(int argc, char *argv[])
-{
-	ip_file = FOPEN(argv[1], "r");
-	if (!ip_file)
-		fprintf(stderr, "ERROR!! Could not open file: %s\n", argv[1]);
-	yyparse();
-	return 0;
-}
-#endif
-
-#line 1096 "ntp_parser.c"
-
-#if YYDEBUG
-#include <stdio.h>		/* needed for printf */
-#endif
-
-#include <stdlib.h>	/* needed for malloc, etc */
-#include <string.h>	/* needed for memset */
-
-/* allocate initial stack or double stack size, up to YYMAXDEPTH */
-static int yygrowstack(YYSTACKDATA *data)
-{
-    int i;
-    unsigned newsize;
-    short *newss;
-    YYSTYPE *newvs;
-
-    if ((newsize = data->stacksize) == 0)
-        newsize = YYINITSTACKSIZE;
-    else if (newsize >= YYMAXDEPTH)
-        return -1;
-    else if ((newsize *= 2) > YYMAXDEPTH)
-        newsize = YYMAXDEPTH;
-
-    i = (int) (data->s_mark - data->s_base);
-    newss = (short *)realloc(data->s_base, newsize * sizeof(*newss));
-    if (newss == 0)
-        return -1;
-
-    data->s_base = newss;
-    data->s_mark = newss + i;
-
-    newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs));
-    if (newvs == 0)
-        return -1;
-
-    data->l_base = newvs;
-    data->l_mark = newvs + i;
-
-    data->stacksize = newsize;
-    data->s_last = data->s_base + newsize - 1;
-    return 0;
-}
-
-#if YYPURE || defined(YY_NO_LEAKS)
-static void yyfreestack(YYSTACKDATA *data)
-{
-    free(data->s_base);
-    free(data->l_base);
-    memset(data, 0, sizeof(*data));
-}
-#else
-#define yyfreestack(data) /* nothing */
-#endif
-
-#define YYABORT  goto yyabort
-#define YYREJECT goto yyabort
-#define YYACCEPT goto yyaccept
-#define YYERROR  goto yyerrlab
-
-int
-YYPARSE_DECL()
-{
-    int yym, yyn, yystate;
-#if YYDEBUG
-    const char *yys;
-
-    if ((yys = getenv("YYDEBUG")) != 0)
-    {
-        yyn = *yys;
-        if (yyn >= '0' && yyn <= '9')
-            yydebug = yyn - '0';
-    }
-#endif
-
-    yynerrs = 0;
-    yyerrflag = 0;
-    yychar = YYEMPTY;
-    yystate = 0;
-
-#if YYPURE
-    memset(&yystack, 0, sizeof(yystack));
-#endif
-
-    if (yystack.s_base == NULL && yygrowstack(&yystack)) goto yyoverflow;
-    yystack.s_mark = yystack.s_base;
-    yystack.l_mark = yystack.l_base;
-    yystate = 0;
-    *yystack.s_mark = 0;
-
-yyloop:
-    if ((yyn = yydefred[yystate]) != 0) goto yyreduce;
-    if (yychar < 0)
-    {
-        if ((yychar = YYLEX) < 0) yychar = 0;
-#if YYDEBUG
-        if (yydebug)
-        {
-            yys = yytname[YYTRANSLATE(yychar)];
-            printf("%sdebug: state %d, reading %d (%s)\n",
-                    YYPREFIX, yystate, yychar, yys);
-        }
-#endif
-    }
-    if ((yyn = yysindex[yystate]) && (yyn += yychar) >= 0 &&
-            yyn <= YYTABLESIZE && yycheck[yyn] == yychar)
-    {
-#if YYDEBUG
-        if (yydebug)
-            printf("%sdebug: state %d, shifting to state %d\n",
-                    YYPREFIX, yystate, yytable[yyn]);
-#endif
-        if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack))
-        {
-            goto yyoverflow;
-        }
-        yystate = yytable[yyn];
-        *++yystack.s_mark = yytable[yyn];
-        *++yystack.l_mark = yylval;
-        yychar = YYEMPTY;
-        if (yyerrflag > 0)  --yyerrflag;
-        goto yyloop;
-    }
-    if ((yyn = yyrindex[yystate]) && (yyn += yychar) >= 0 &&
-            yyn <= YYTABLESIZE && yycheck[yyn] == yychar)
-    {
-        yyn = yytable[yyn];
-        goto yyreduce;
-    }
-    if (yyerrflag) goto yyinrecovery;
-
-    yyerror(ip_file, "syntax error");
-
-    goto yyerrlab;
-
-yyerrlab:
-    ++yynerrs;
-
-yyinrecovery:
-    if (yyerrflag < 3)
-    {
-        yyerrflag = 3;
-        for (;;)
-        {
-            if ((yyn = yysindex[*yystack.s_mark]) && (yyn += YYERRCODE) >= 0 &&
-                    yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE)
-            {
-#if YYDEBUG
-                if (yydebug)
-                    printf("%sdebug: state %d, error recovery shifting\
- to state %d\n", YYPREFIX, *yystack.s_mark, yytable[yyn]);
-#endif
-                if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack))
-                {
-                    goto yyoverflow;
-                }
-                yystate = yytable[yyn];
-                *++yystack.s_mark = yytable[yyn];
-                *++yystack.l_mark = yylval;
-                goto yyloop;
-            }
-            else
-            {
-#if YYDEBUG
-                if (yydebug)
-                    printf("%sdebug: error recovery discarding state %d\n",
-                            YYPREFIX, *yystack.s_mark);
-#endif
-                if (yystack.s_mark <= yystack.s_base) goto yyabort;
-                --yystack.s_mark;
-                --yystack.l_mark;
-            }
-        }
-    }
-    else
-    {
-        if (yychar == 0) goto yyabort;
-#if YYDEBUG
-        if (yydebug)
-        {
-            yys = yytname[YYTRANSLATE(yychar)];
-            printf("%sdebug: state %d, error recovery discards token %d (%s)\n",
-                    YYPREFIX, yystate, yychar, yys);
-        }
-#endif
-        yychar = YYEMPTY;
-        goto yyloop;
-    }
-
-yyreduce:
-#if YYDEBUG
-    if (yydebug)
-        printf("%sdebug: state %d, reducing by rule %d (%s)\n",
-                YYPREFIX, yystate, yyn, yyrule[yyn]);
-#endif
-    yym = yylen[yyn];
-    if (yym)
-        yyval = yystack.l_mark[1-yym];
-    else
-        memset(&yyval, 0, sizeof yyval);
-    switch (yyn)
-    {
-case 4:
-#line 373 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{
-			/* I will need to incorporate much more fine grained
-			 * error messages. The following should suffice for
-			 * the time being.
-			 */
-			msyslog(LOG_ERR, 
-				"syntax error in %s line %d, column %d",
-				ip_file->fname,
-				ip_file->err_line_no,
-				ip_file->err_col_no);
-		}
-break;
-case 19:
-#line 408 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{
-			peer_node *my_node;
-
-			my_node = create_peer_node(yystack.l_mark[-2].Integer, yystack.l_mark[-1].Address_node, yystack.l_mark[0].Attr_val_fifo);
-			APPEND_G_FIFO(cfgt.peers, my_node);
-		}
-break;
-case 26:
-#line 427 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{ yyval.Address_node = create_address_node(yystack.l_mark[0].String, yystack.l_mark[-1].Integer); }
-break;
-case 27:
-#line 432 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{ yyval.Address_node = create_address_node(yystack.l_mark[0].String, AF_UNSPEC); }
-break;
-case 28:
-#line 437 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{ yyval.Integer = AF_INET; }
-break;
-case 29:
-#line 439 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{ yyval.Integer = AF_INET6; }
-break;
-case 30:
-#line 444 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{ yyval.Attr_val_fifo = NULL; }
-break;
-case 31:
-#line 446 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{
-			yyval.Attr_val_fifo = yystack.l_mark[-1].Attr_val_fifo;
-			APPEND_G_FIFO(yyval.Attr_val_fifo, yystack.l_mark[0].Attr_val);
-		}
-break;
-case 35:
-#line 460 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{ yyval.Attr_val = create_attr_ival(T_Flag, yystack.l_mark[0].Integer); }
-break;
-case 44:
-#line 476 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{ yyval.Attr_val = create_attr_ival(yystack.l_mark[-1].Integer, yystack.l_mark[0].Integer); }
-break;
-case 45:
-#line 478 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{ yyval.Attr_val = create_attr_uval(yystack.l_mark[-1].Integer, yystack.l_mark[0].Integer); }
-break;
-case 52:
-#line 492 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{ yyval.Attr_val = create_attr_sval(yystack.l_mark[-1].Integer, yystack.l_mark[0].String); }
-break;
-case 54:
-#line 506 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{
-			unpeer_node *my_node;
-			
-			my_node = create_unpeer_node(yystack.l_mark[0].Address_node);
-			if (my_node)
-				APPEND_G_FIFO(cfgt.unpeers, my_node);
-		}
-break;
-case 57:
-#line 527 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{ cfgt.broadcastclient = 1; }
-break;
-case 58:
-#line 529 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{ CONCAT_G_FIFOS(cfgt.manycastserver, yystack.l_mark[0].Address_fifo); }
-break;
-case 59:
-#line 531 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{ CONCAT_G_FIFOS(cfgt.multicastclient, yystack.l_mark[0].Address_fifo); }
-break;
-case 60:
-#line 533 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{ cfgt.mdnstries = yystack.l_mark[0].Integer; }
-break;
-case 61:
-#line 544 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{
-			attr_val *atrv;
-			
-			atrv = create_attr_ival(yystack.l_mark[-1].Integer, yystack.l_mark[0].Integer);
-			APPEND_G_FIFO(cfgt.vars, atrv);
-		}
-break;
-case 62:
-#line 551 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{ cfgt.auth.control_key = yystack.l_mark[0].Integer; }
-break;
-case 63:
-#line 553 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{ 
-			cfgt.auth.cryptosw++;
-			CONCAT_G_FIFOS(cfgt.auth.crypto_cmd_list, yystack.l_mark[0].Attr_val_fifo);
-		}
-break;
-case 64:
-#line 558 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{ cfgt.auth.keys = yystack.l_mark[0].String; }
-break;
-case 65:
-#line 560 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{ cfgt.auth.keysdir = yystack.l_mark[0].String; }
-break;
-case 66:
-#line 562 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{ cfgt.auth.request_key = yystack.l_mark[0].Integer; }
-break;
-case 67:
-#line 564 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{ cfgt.auth.revoke = yystack.l_mark[0].Integer; }
-break;
-case 68:
-#line 566 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{
-			cfgt.auth.trusted_key_list = yystack.l_mark[0].Attr_val_fifo;
-
-			/* if (!cfgt.auth.trusted_key_list)*/
-			/* 	cfgt.auth.trusted_key_list = $2;*/
-			/* else*/
-			/* 	LINK_SLIST(cfgt.auth.trusted_key_list, $2, link);*/
-		}
-break;
-case 69:
-#line 575 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{ cfgt.auth.ntp_signd_socket = yystack.l_mark[0].String; }
-break;
-case 70:
-#line 580 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{ yyval.Attr_val_fifo = NULL; }
-break;
-case 71:
-#line 582 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{
-			yyval.Attr_val_fifo = yystack.l_mark[-1].Attr_val_fifo;
-			APPEND_G_FIFO(yyval.Attr_val_fifo, yystack.l_mark[0].Attr_val);
-		}
-break;
-case 72:
-#line 590 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{ yyval.Attr_val = create_attr_sval(yystack.l_mark[-1].Integer, yystack.l_mark[0].String); }
-break;
-case 73:
-#line 592 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{
-			yyval.Attr_val = NULL;
-			cfgt.auth.revoke = yystack.l_mark[0].Integer;
-			msyslog(LOG_WARNING,
-				"'crypto revoke %d' is deprecated, "
-				"please use 'revoke %d' instead.",
-				cfgt.auth.revoke, cfgt.auth.revoke);
-		}
-break;
-case 79:
-#line 617 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{ CONCAT_G_FIFOS(cfgt.orphan_cmds, yystack.l_mark[0].Attr_val_fifo); }
-break;
-case 80:
-#line 622 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{
-			yyval.Attr_val_fifo = yystack.l_mark[-1].Attr_val_fifo;
-			APPEND_G_FIFO(yyval.Attr_val_fifo, yystack.l_mark[0].Attr_val);
-		}
-break;
-case 81:
-#line 627 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{	
-			yyval.Attr_val_fifo = NULL;
-			APPEND_G_FIFO(yyval.Attr_val_fifo, yystack.l_mark[0].Attr_val);
-		}
-break;
-case 82:
-#line 635 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{ yyval.Attr_val = create_attr_dval(yystack.l_mark[-1].Integer, (double)yystack.l_mark[0].Integer); }
-break;
-case 83:
-#line 637 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{ yyval.Attr_val = create_attr_dval(yystack.l_mark[-1].Integer, yystack.l_mark[0].Double); }
-break;
-case 84:
-#line 639 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{ yyval.Attr_val = create_attr_dval(yystack.l_mark[-1].Integer, (double)yystack.l_mark[0].Integer); }
-break;
-case 95:
-#line 665 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{ CONCAT_G_FIFOS(cfgt.stats_list, yystack.l_mark[0].Int_fifo); }
-break;
-case 96:
-#line 667 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{
-			if (input_from_file) {
-				cfgt.stats_dir = yystack.l_mark[0].String;
-			} else {
-				YYFREE(yystack.l_mark[0].String);
-				yyerror(ip_file, "statsdir remote configuration ignored");
-			}
-		}
-break;
-case 97:
-#line 676 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{
-			filegen_node *fgn;
-			
-			fgn = create_filegen_node(yystack.l_mark[-1].Integer, yystack.l_mark[0].Attr_val_fifo);
-			APPEND_G_FIFO(cfgt.filegen_opts, fgn);
-		}
-break;
-case 98:
-#line 686 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{
-			yyval.Int_fifo = yystack.l_mark[-1].Int_fifo;
-			APPEND_G_FIFO(yyval.Int_fifo, create_int_node(yystack.l_mark[0].Integer));
-		}
-break;
-case 99:
-#line 691 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{
-			yyval.Int_fifo = NULL;
-			APPEND_G_FIFO(yyval.Int_fifo, create_int_node(yystack.l_mark[0].Integer));
-		}
-break;
-case 108:
-#line 710 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{ yyval.Attr_val_fifo = NULL; }
-break;
-case 109:
-#line 712 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{
-			yyval.Attr_val_fifo = yystack.l_mark[-1].Attr_val_fifo;
-			APPEND_G_FIFO(yyval.Attr_val_fifo, yystack.l_mark[0].Attr_val);
-		}
-break;
-case 110:
-#line 720 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{
-			if (input_from_file) {
-				yyval.Attr_val = create_attr_sval(yystack.l_mark[-1].Integer, yystack.l_mark[0].String);
-			} else {
-				yyval.Attr_val = NULL;
-				YYFREE(yystack.l_mark[0].String);
-				yyerror(ip_file, "filegen file remote config ignored");
-			}
-		}
-break;
-case 111:
-#line 730 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{
-			if (input_from_file) {
-				yyval.Attr_val = create_attr_ival(yystack.l_mark[-1].Integer, yystack.l_mark[0].Integer);
-			} else {
-				yyval.Attr_val = NULL;
-				yyerror(ip_file, "filegen type remote config ignored");
-			}
-		}
-break;
-case 112:
-#line 739 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{
-			const char *err;
-			
-			if (input_from_file) {
-				yyval.Attr_val = create_attr_ival(T_Flag, yystack.l_mark[0].Integer);
-			} else {
-				yyval.Attr_val = NULL;
-				if (T_Link == yystack.l_mark[0].Integer)
-					err = "filegen link remote config ignored";
-				else
-					err = "filegen nolink remote config ignored";
-				yyerror(ip_file, err);
-			}
-		}
-break;
-case 113:
-#line 754 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{ yyval.Attr_val = create_attr_ival(T_Flag, yystack.l_mark[0].Integer); }
-break;
-case 125:
-#line 784 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{
-			CONCAT_G_FIFOS(cfgt.discard_opts, yystack.l_mark[0].Attr_val_fifo);
-		}
-break;
-case 126:
-#line 788 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{
-			CONCAT_G_FIFOS(cfgt.mru_opts, yystack.l_mark[0].Attr_val_fifo);
-		}
-break;
-case 127:
-#line 792 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{
-			restrict_node *rn;
-
-			rn = create_restrict_node(yystack.l_mark[-1].Address_node, NULL, yystack.l_mark[0].Int_fifo,
-						  ip_file->line_no);
-			APPEND_G_FIFO(cfgt.restrict_opts, rn);
-		}
-break;
-case 128:
-#line 800 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{
-			restrict_node *rn;
-
-			rn = create_restrict_node(yystack.l_mark[-3].Address_node, yystack.l_mark[-1].Address_node, yystack.l_mark[0].Int_fifo,
-						  ip_file->line_no);
-			APPEND_G_FIFO(cfgt.restrict_opts, rn);
-		}
-break;
-case 129:
-#line 808 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{
-			restrict_node *rn;
-
-			rn = create_restrict_node(NULL, NULL, yystack.l_mark[0].Int_fifo,
-						  ip_file->line_no);
-			APPEND_G_FIFO(cfgt.restrict_opts, rn);
-		}
-break;
-case 130:
-#line 816 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{
-			restrict_node *rn;
-
-			rn = create_restrict_node(
-				create_address_node(
-					estrdup("0.0.0.0"), 
-					AF_INET),
-				create_address_node(
-					estrdup("0.0.0.0"), 
-					AF_INET),
-				yystack.l_mark[0].Int_fifo, 
-				ip_file->line_no);
-			APPEND_G_FIFO(cfgt.restrict_opts, rn);
-		}
-break;
-case 131:
-#line 831 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{
-			restrict_node *rn;
-			
-			rn = create_restrict_node(
-				create_address_node(
-					estrdup("::"), 
-					AF_INET6),
-				create_address_node(
-					estrdup("::"), 
-					AF_INET6),
-				yystack.l_mark[0].Int_fifo, 
-				ip_file->line_no);
-			APPEND_G_FIFO(cfgt.restrict_opts, rn);
-		}
-break;
-case 132:
-#line 846 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{
-			restrict_node *	rn;
-
-			APPEND_G_FIFO(yystack.l_mark[0].Int_fifo, create_int_node(yystack.l_mark[-1].Integer));
-			rn = create_restrict_node(
-				NULL, NULL, yystack.l_mark[0].Int_fifo, ip_file->line_no);
-			APPEND_G_FIFO(cfgt.restrict_opts, rn);
-		}
-break;
-case 133:
-#line 858 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{ yyval.Int_fifo = NULL; }
-break;
-case 134:
-#line 860 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{
-			yyval.Int_fifo = yystack.l_mark[-1].Int_fifo;
-			APPEND_G_FIFO(yyval.Int_fifo, create_int_node(yystack.l_mark[0].Integer));
-		}
-break;
-case 150:
-#line 886 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{
-			yyval.Attr_val_fifo = yystack.l_mark[-1].Attr_val_fifo;
-			APPEND_G_FIFO(yyval.Attr_val_fifo, yystack.l_mark[0].Attr_val);
-		}
-break;
-case 151:
-#line 891 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{
-			yyval.Attr_val_fifo = NULL;
-			APPEND_G_FIFO(yyval.Attr_val_fifo, yystack.l_mark[0].Attr_val);
-		}
-break;
-case 152:
-#line 899 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{ yyval.Attr_val = create_attr_ival(yystack.l_mark[-1].Integer, yystack.l_mark[0].Integer); }
-break;
-case 156:
-#line 910 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{
-			yyval.Attr_val_fifo = yystack.l_mark[-1].Attr_val_fifo;
-			APPEND_G_FIFO(yyval.Attr_val_fifo, yystack.l_mark[0].Attr_val);
-		}
-break;
-case 157:
-#line 915 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{
-			yyval.Attr_val_fifo = NULL;
-			APPEND_G_FIFO(yyval.Attr_val_fifo, yystack.l_mark[0].Attr_val);
-		}
-break;
-case 158:
-#line 923 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{ yyval.Attr_val = create_attr_ival(yystack.l_mark[-1].Integer, yystack.l_mark[0].Integer); }
-break;
-case 167:
-#line 943 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{
-			addr_opts_node *aon;
-			
-			aon = create_addr_opts_node(yystack.l_mark[-1].Address_node, yystack.l_mark[0].Attr_val_fifo);
-			APPEND_G_FIFO(cfgt.fudge, aon);
-		}
-break;
-case 168:
-#line 953 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{
-			yyval.Attr_val_fifo = yystack.l_mark[-1].Attr_val_fifo;
-			APPEND_G_FIFO(yyval.Attr_val_fifo, yystack.l_mark[0].Attr_val);
-		}
-break;
-case 169:
-#line 958 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{
-			yyval.Attr_val_fifo = NULL;
-			APPEND_G_FIFO(yyval.Attr_val_fifo, yystack.l_mark[0].Attr_val);
-		}
-break;
-case 170:
-#line 966 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{ yyval.Attr_val = create_attr_dval(yystack.l_mark[-1].Integer, yystack.l_mark[0].Double); }
-break;
-case 171:
-#line 968 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{ yyval.Attr_val = create_attr_ival(yystack.l_mark[-1].Integer, yystack.l_mark[0].Integer); }
-break;
-case 172:
-#line 970 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{ yyval.Attr_val = create_attr_ival(yystack.l_mark[-1].Integer, yystack.l_mark[0].Integer); }
-break;
-case 173:
-#line 972 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{ yyval.Attr_val = create_attr_sval(yystack.l_mark[-1].Integer, yystack.l_mark[0].String); }
-break;
-case 174:
-#line 974 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{ yyval.Attr_val = create_attr_sval(yystack.l_mark[-1].Integer, yystack.l_mark[0].String); }
-break;
-case 181:
-#line 995 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{ CONCAT_G_FIFOS(cfgt.rlimit, yystack.l_mark[0].Attr_val_fifo); }
-break;
-case 182:
-#line 1000 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{
-			yyval.Attr_val_fifo = yystack.l_mark[-1].Attr_val_fifo;
-			APPEND_G_FIFO(yyval.Attr_val_fifo, yystack.l_mark[0].Attr_val);
-		}
-break;
-case 183:
-#line 1005 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{
-			yyval.Attr_val_fifo = NULL;
-			APPEND_G_FIFO(yyval.Attr_val_fifo, yystack.l_mark[0].Attr_val);
-		}
-break;
-case 184:
-#line 1013 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{ yyval.Attr_val = create_attr_ival(yystack.l_mark[-1].Integer, yystack.l_mark[0].Integer); }
-break;
-case 188:
-#line 1029 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{ CONCAT_G_FIFOS(cfgt.enable_opts, yystack.l_mark[0].Attr_val_fifo); }
-break;
-case 189:
-#line 1031 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{ CONCAT_G_FIFOS(cfgt.disable_opts, yystack.l_mark[0].Attr_val_fifo); }
-break;
-case 190:
-#line 1036 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{
-			yyval.Attr_val_fifo = yystack.l_mark[-1].Attr_val_fifo;
-			APPEND_G_FIFO(yyval.Attr_val_fifo, yystack.l_mark[0].Attr_val);
-		}
-break;
-case 191:
-#line 1041 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{
-			yyval.Attr_val_fifo = NULL;
-			APPEND_G_FIFO(yyval.Attr_val_fifo, yystack.l_mark[0].Attr_val);
-		}
-break;
-case 192:
-#line 1049 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{ yyval.Attr_val = create_attr_ival(T_Flag, yystack.l_mark[0].Integer); }
-break;
-case 193:
-#line 1051 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{ 
-			if (input_from_file) {
-				yyval.Attr_val = create_attr_ival(T_Flag, yystack.l_mark[0].Integer);
-			} else {
-				char err_str[128];
-				
-				yyval.Attr_val = NULL;
-				snprintf(err_str, sizeof(err_str),
-					 "enable/disable %s remote configuration ignored",
-					 keyword(yystack.l_mark[0].Integer));
-				yyerror(ip_file, err_str);
-			}
-		}
-break;
-case 202:
-#line 1086 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{ CONCAT_G_FIFOS(cfgt.tinker, yystack.l_mark[0].Attr_val_fifo); }
-break;
-case 203:
-#line 1091 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{
-			yyval.Attr_val_fifo = yystack.l_mark[-1].Attr_val_fifo;
-			APPEND_G_FIFO(yyval.Attr_val_fifo, yystack.l_mark[0].Attr_val);
-		}
-break;
-case 204:
-#line 1096 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{
-			yyval.Attr_val_fifo = NULL;
-			APPEND_G_FIFO(yyval.Attr_val_fifo, yystack.l_mark[0].Attr_val);
-		}
-break;
-case 205:
-#line 1104 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{ yyval.Attr_val = create_attr_dval(yystack.l_mark[-1].Integer, yystack.l_mark[0].Double); }
-break;
-case 216:
-#line 1127 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{
-			attr_val *av;
-			
-			av = create_attr_dval(yystack.l_mark[-1].Integer, yystack.l_mark[0].Double);
-			APPEND_G_FIFO(cfgt.vars, av);
-		}
-break;
-case 217:
-#line 1134 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{
-			attr_val *av;
-			
-			av = create_attr_sval(yystack.l_mark[-1].Integer, yystack.l_mark[0].String);
-			APPEND_G_FIFO(cfgt.vars, av);
-		}
-break;
-case 218:
-#line 1141 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{
-			char error_text[64];
-			attr_val *av;
-
-			if (input_from_file) {
-				av = create_attr_sval(yystack.l_mark[-1].Integer, yystack.l_mark[0].String);
-				APPEND_G_FIFO(cfgt.vars, av);
-			} else {
-				YYFREE(yystack.l_mark[0].String);
-				snprintf(error_text, sizeof(error_text),
-					 "%s remote config ignored",
-					 keyword(yystack.l_mark[-1].Integer));
-				yyerror(ip_file, error_text);
-			}
-		}
-break;
-case 219:
-#line 1157 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{
-			if (!input_from_file) {
-				yyerror(ip_file, "remote includefile ignored");
-				break;
-			}
-			if (curr_include_level >= MAXINCLUDELEVEL) {
-				fprintf(stderr, "getconfig: Maximum include file level exceeded.\n");
-				msyslog(LOG_ERR, "getconfig: Maximum include file level exceeded.");
-			} else {
-				fp[curr_include_level + 1] = F_OPEN(FindConfig(yystack.l_mark[-1].String), "r");
-				if (fp[curr_include_level + 1] == NULL) {
-					fprintf(stderr, "getconfig: Couldn't open <%s>\n", FindConfig(yystack.l_mark[-1].String));
-					msyslog(LOG_ERR, "getconfig: Couldn't open <%s>", FindConfig(yystack.l_mark[-1].String));
-				} else {
-					ip_file = fp[++curr_include_level];
-				}
-			}
-		}
-break;
-case 220:
-#line 1176 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{
-			while (curr_include_level != -1)
-				FCLOSE(fp[curr_include_level--]);
-		}
-break;
-case 221:
-#line 1181 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{ /* see drift_parm below for actions */ }
-break;
-case 222:
-#line 1183 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{ CONCAT_G_FIFOS(cfgt.logconfig, yystack.l_mark[0].Attr_val_fifo); }
-break;
-case 223:
-#line 1185 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{ CONCAT_G_FIFOS(cfgt.phone, yystack.l_mark[0].String_fifo); }
-break;
-case 224:
-#line 1187 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{ APPEND_G_FIFO(cfgt.setvar, yystack.l_mark[0].Set_var); }
-break;
-case 225:
-#line 1189 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{
-			addr_opts_node *aon;
-			
-			aon = create_addr_opts_node(yystack.l_mark[-1].Address_node, yystack.l_mark[0].Attr_val_fifo);
-			APPEND_G_FIFO(cfgt.trap, aon);
-		}
-break;
-case 226:
-#line 1196 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{ CONCAT_G_FIFOS(cfgt.ttl, yystack.l_mark[0].Attr_val_fifo); }
-break;
-case 235:
-#line 1218 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{
-			attr_val *av;
-			
-			av = create_attr_sval(T_Driftfile, yystack.l_mark[0].String);
-			APPEND_G_FIFO(cfgt.vars, av);
-		}
-break;
-case 236:
-#line 1225 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{
-			attr_val *av;
-			
-			av = create_attr_sval(T_Driftfile, yystack.l_mark[-1].String);
-			APPEND_G_FIFO(cfgt.vars, av);
-			av = create_attr_dval(T_WanderThreshold, yystack.l_mark[0].Double);
-			APPEND_G_FIFO(cfgt.vars, av);
-		}
-break;
-case 237:
-#line 1234 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{
-			attr_val *av;
-			
-			av = create_attr_sval(T_Driftfile, "");
-			APPEND_G_FIFO(cfgt.vars, av);
-		}
-break;
-case 238:
-#line 1244 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{ yyval.Set_var = create_setvar_node(yystack.l_mark[-3].String, yystack.l_mark[-1].String, yystack.l_mark[0].Integer); }
-break;
-case 240:
-#line 1250 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{ yyval.Integer = 0; }
-break;
-case 241:
-#line 1255 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{ yyval.Attr_val_fifo = NULL; }
-break;
-case 242:
-#line 1257 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{
-			yyval.Attr_val_fifo = yystack.l_mark[-1].Attr_val_fifo;
-			APPEND_G_FIFO(yyval.Attr_val_fifo, yystack.l_mark[0].Attr_val);
-		}
-break;
-case 243:
-#line 1265 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{ yyval.Attr_val = create_attr_ival(yystack.l_mark[-1].Integer, yystack.l_mark[0].Integer); }
-break;
-case 244:
-#line 1267 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{
-			yyval.Attr_val = create_attr_sval(yystack.l_mark[-1].Integer, estrdup(yystack.l_mark[0].Address_node->address));
-			destroy_address_node(yystack.l_mark[0].Address_node);
-		}
-break;
-case 245:
-#line 1275 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{
-			yyval.Attr_val_fifo = yystack.l_mark[-1].Attr_val_fifo;
-			APPEND_G_FIFO(yyval.Attr_val_fifo, yystack.l_mark[0].Attr_val);
-		}
-break;
-case 246:
-#line 1280 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{
-			yyval.Attr_val_fifo = NULL;
-			APPEND_G_FIFO(yyval.Attr_val_fifo, yystack.l_mark[0].Attr_val);
-		}
-break;
-case 247:
-#line 1288 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{
-			char	prefix;
-			char *	type;
-			
-			switch (yystack.l_mark[0].String[0]) {
-			
-			case '+':
-			case '-':
-			case '=':
-				prefix = yystack.l_mark[0].String[0];
-				type = yystack.l_mark[0].String + 1;
-				break;
-				
-			default:
-				prefix = '=';
-				type = yystack.l_mark[0].String;
-			}	
-			
-			yyval.Attr_val = create_attr_sval(prefix, estrdup(type));
-			YYFREE(yystack.l_mark[0].String);
-		}
-break;
-case 248:
-#line 1313 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{
-			nic_rule_node *nrn;
-			
-			nrn = create_nic_rule_node(yystack.l_mark[0].Integer, NULL, yystack.l_mark[-1].Integer);
-			APPEND_G_FIFO(cfgt.nic_rules, nrn);
-		}
-break;
-case 249:
-#line 1320 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{
-			nic_rule_node *nrn;
-			
-			nrn = create_nic_rule_node(0, yystack.l_mark[0].String, yystack.l_mark[-1].Integer);
-			APPEND_G_FIFO(cfgt.nic_rules, nrn);
-		}
-break;
-case 259:
-#line 1348 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{ CONCAT_G_FIFOS(cfgt.reset_counters, yystack.l_mark[0].Int_fifo); }
-break;
-case 260:
-#line 1353 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{
-			yyval.Int_fifo = yystack.l_mark[-1].Int_fifo;
-			APPEND_G_FIFO(yyval.Int_fifo, create_int_node(yystack.l_mark[0].Integer));
-		}
-break;
-case 261:
-#line 1358 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{
-			yyval.Int_fifo = NULL;
-			APPEND_G_FIFO(yyval.Int_fifo, create_int_node(yystack.l_mark[0].Integer));
-		}
-break;
-case 269:
-#line 1382 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{
-			yyval.Attr_val_fifo = yystack.l_mark[-1].Attr_val_fifo;
-			APPEND_G_FIFO(yyval.Attr_val_fifo, create_int_node(yystack.l_mark[0].Integer));
-		}
-break;
-case 270:
-#line 1387 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{
-			yyval.Attr_val_fifo = NULL;
-			APPEND_G_FIFO(yyval.Attr_val_fifo, create_int_node(yystack.l_mark[0].Integer));
-		}
-break;
-case 271:
-#line 1395 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{
-			yyval.Attr_val_fifo = yystack.l_mark[-1].Attr_val_fifo;
-			APPEND_G_FIFO(yyval.Attr_val_fifo, yystack.l_mark[0].Attr_val);
-		}
-break;
-case 272:
-#line 1400 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{
-			yyval.Attr_val_fifo = NULL;
-			APPEND_G_FIFO(yyval.Attr_val_fifo, yystack.l_mark[0].Attr_val);
-		}
-break;
-case 273:
-#line 1408 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{ yyval.Attr_val = create_attr_ival('i', yystack.l_mark[0].Integer); }
-break;
-case 275:
-#line 1414 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{ yyval.Attr_val = create_attr_rangeval('-', yystack.l_mark[-3].Integer, yystack.l_mark[-1].Integer); }
-break;
-case 276:
-#line 1419 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{
-			yyval.String_fifo = yystack.l_mark[-1].String_fifo;
-			APPEND_G_FIFO(yyval.String_fifo, create_string_node(yystack.l_mark[0].String));
-		}
-break;
-case 277:
-#line 1424 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{
-			yyval.String_fifo = NULL;
-			APPEND_G_FIFO(yyval.String_fifo, create_string_node(yystack.l_mark[0].String));
-		}
-break;
-case 278:
-#line 1432 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{
-			yyval.Address_fifo = yystack.l_mark[-1].Address_fifo;
-			APPEND_G_FIFO(yyval.Address_fifo, yystack.l_mark[0].Address_node);
-		}
-break;
-case 279:
-#line 1437 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{
-			yyval.Address_fifo = NULL;
-			APPEND_G_FIFO(yyval.Address_fifo, yystack.l_mark[0].Address_node);
-		}
-break;
-case 280:
-#line 1445 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{
-			if (yystack.l_mark[0].Integer != 0 && yystack.l_mark[0].Integer != 1) {
-				yyerror(ip_file, "Integer value is not boolean (0 or 1). Assuming 1");
-				yyval.Integer = 1;
-			} else {
-				yyval.Integer = yystack.l_mark[0].Integer;
-			}
-		}
-break;
-case 281:
-#line 1453 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{ yyval.Integer = 1; }
-break;
-case 282:
-#line 1454 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{ yyval.Integer = 0; }
-break;
-case 283:
-#line 1458 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{ yyval.Double = (double)yystack.l_mark[0].Integer; }
-break;
-case 285:
-#line 1469 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{
-			sim_node *sn;
-			
-			sn =  create_sim_node(yystack.l_mark[-2].Attr_val_fifo, yystack.l_mark[-1].Sim_server_fifo);
-			APPEND_G_FIFO(cfgt.sim_details, sn);
-
-			/* Revert from ; to \n for end-of-command */
-			old_config_style = 1;
-		}
-break;
-case 286:
-#line 1486 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{ old_config_style = 0; }
-break;
-case 287:
-#line 1491 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{
-			yyval.Attr_val_fifo = yystack.l_mark[-2].Attr_val_fifo;
-			APPEND_G_FIFO(yyval.Attr_val_fifo, yystack.l_mark[-1].Attr_val);
-		}
-break;
-case 288:
-#line 1496 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{
-			yyval.Attr_val_fifo = NULL;
-			APPEND_G_FIFO(yyval.Attr_val_fifo, yystack.l_mark[-1].Attr_val);
-		}
-break;
-case 289:
-#line 1504 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{ yyval.Attr_val = create_attr_dval(yystack.l_mark[-2].Integer, yystack.l_mark[0].Double); }
-break;
-case 292:
-#line 1514 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{
-			yyval.Sim_server_fifo = yystack.l_mark[-1].Sim_server_fifo;
-			APPEND_G_FIFO(yyval.Sim_server_fifo, yystack.l_mark[0].Sim_server);
-		}
-break;
-case 293:
-#line 1519 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{
-			yyval.Sim_server_fifo = NULL;
-			APPEND_G_FIFO(yyval.Sim_server_fifo, yystack.l_mark[0].Sim_server);
-		}
-break;
-case 294:
-#line 1527 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{ yyval.Sim_server = ONLY_SIM(create_sim_server(yystack.l_mark[-4].Address_node, yystack.l_mark[-2].Double, yystack.l_mark[-1].Sim_script_fifo)); }
-break;
-case 295:
-#line 1532 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{ yyval.Double = yystack.l_mark[-1].Double; }
-break;
-case 296:
-#line 1537 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{ yyval.Address_node = yystack.l_mark[0].Address_node; }
-break;
-case 297:
-#line 1542 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{
-			yyval.Sim_script_fifo = yystack.l_mark[-1].Sim_script_fifo;
-			APPEND_G_FIFO(yyval.Sim_script_fifo, yystack.l_mark[0].Sim_script);
-		}
-break;
-case 298:
-#line 1547 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{
-			yyval.Sim_script_fifo = NULL;
-			APPEND_G_FIFO(yyval.Sim_script_fifo, yystack.l_mark[0].Sim_script);
-		}
-break;
-case 299:
-#line 1555 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{ yyval.Sim_script = ONLY_SIM(create_sim_script_info(yystack.l_mark[-3].Double, yystack.l_mark[-1].Attr_val_fifo)); }
-break;
-case 300:
-#line 1560 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{
-			yyval.Attr_val_fifo = yystack.l_mark[-2].Attr_val_fifo;
-			APPEND_G_FIFO(yyval.Attr_val_fifo, yystack.l_mark[-1].Attr_val);
-		}
-break;
-case 301:
-#line 1565 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{
-			yyval.Attr_val_fifo = NULL;
-			APPEND_G_FIFO(yyval.Attr_val_fifo, yystack.l_mark[-1].Attr_val);
-		}
-break;
-case 302:
-#line 1573 "/net/quasar/src-5/NetBSD/src/external/bsd/ntp/dist/ntpd/ntp_parser.y"
-	{ yyval.Attr_val = create_attr_dval(yystack.l_mark[-2].Integer, yystack.l_mark[0].Double); }
-break;
-#line 2262 "ntp_parser.c"
-    }
-    yystack.s_mark -= yym;
-    yystate = *yystack.s_mark;
-    yystack.l_mark -= yym;
-    yym = yylhs[yyn];
-    if (yystate == 0 && yym == 0)
-    {
-#if YYDEBUG
-        if (yydebug)
-            printf("%sdebug: after reduction, shifting from state 0 to\
- state %d\n", YYPREFIX, YYFINAL);
-#endif
-        yystate = YYFINAL;
-        *++yystack.s_mark = YYFINAL;
-        *++yystack.l_mark = yyval;
-        if (yychar < 0)
-        {
-            if ((yychar = YYLEX) < 0) yychar = 0;
-#if YYDEBUG
-            if (yydebug)
-            {
-                yys = yytname[YYTRANSLATE(yychar)];
-                printf("%sdebug: state %d, reading %d (%s)\n",
-                        YYPREFIX, YYFINAL, yychar, yys);
-            }
-#endif
-        }
-        if (yychar == 0) goto yyaccept;
-        goto yyloop;
-    }
-    if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 &&
-            yyn <= YYTABLESIZE && yycheck[yyn] == yystate)
-        yystate = yytable[yyn];
-    else
-        yystate = yydgoto[yym];
-#if YYDEBUG
-    if (yydebug)
-        printf("%sdebug: after reduction, shifting from state %d \
-to state %d\n", YYPREFIX, *yystack.s_mark, yystate);
-#endif
-    if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack))
-    {
-        goto yyoverflow;
-    }
-    *++yystack.s_mark = (short) yystate;
-    *++yystack.l_mark = yyval;
-    goto yyloop;
-
-yyoverflow:
-    yyerror(ip_file, "yacc stack overflow");
-
-yyabort:
-    yyfreestack(&yystack);
-    return (1);
-
-yyaccept:
-    yyfreestack(&yystack);
-    return (0);
-}
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/bin/ntpd/ntp_parser.h /cur/src/external/bsd/ntp/bin/ntpd/ntp_parser.h
--- external/bsd/ntp/bin/ntpd/ntp_parser.h	2014-12-24 16:31:20.000000000 -0800
+++ /cur/src/external/bsd/ntp/bin/ntpd/ntp_parser.h	1969-12-31 16:00:00.000000000 -0800
@@ -1,213 +0,0 @@
-#define T_Abbrev 257
-#define T_Age 258
-#define T_All 259
-#define T_Allan 260
-#define T_Allpeers 261
-#define T_Auth 262
-#define T_Autokey 263
-#define T_Automax 264
-#define T_Average 265
-#define T_Bclient 266
-#define T_Beacon 267
-#define T_Broadcast 268
-#define T_Broadcastclient 269
-#define T_Broadcastdelay 270
-#define T_Burst 271
-#define T_Calibrate 272
-#define T_Ceiling 273
-#define T_Clockstats 274
-#define T_Cohort 275
-#define T_ControlKey 276
-#define T_Crypto 277
-#define T_Cryptostats 278
-#define T_Ctl 279
-#define T_Day 280
-#define T_Default 281
-#define T_Digest 282
-#define T_Disable 283
-#define T_Discard 284
-#define T_Dispersion 285
-#define T_Double 286
-#define T_Driftfile 287
-#define T_Drop 288
-#define T_Ellipsis 289
-#define T_Enable 290
-#define T_End 291
-#define T_False 292
-#define T_File 293
-#define T_Filegen 294
-#define T_Filenum 295
-#define T_Flag1 296
-#define T_Flag2 297
-#define T_Flag3 298
-#define T_Flag4 299
-#define T_Flake 300
-#define T_Floor 301
-#define T_Freq 302
-#define T_Fudge 303
-#define T_Host 304
-#define T_Huffpuff 305
-#define T_Iburst 306
-#define T_Ident 307
-#define T_Ignore 308
-#define T_Incalloc 309
-#define T_Incmem 310
-#define T_Initalloc 311
-#define T_Initmem 312
-#define T_Includefile 313
-#define T_Integer 314
-#define T_Interface 315
-#define T_Intrange 316
-#define T_Io 317
-#define T_Ipv4 318
-#define T_Ipv4_flag 319
-#define T_Ipv6 320
-#define T_Ipv6_flag 321
-#define T_Kernel 322
-#define T_Key 323
-#define T_Keys 324
-#define T_Keysdir 325
-#define T_Kod 326
-#define T_Mssntp 327
-#define T_Leapfile 328
-#define T_Limited 329
-#define T_Link 330
-#define T_Listen 331
-#define T_Logconfig 332
-#define T_Logfile 333
-#define T_Loopstats 334
-#define T_Lowpriotrap 335
-#define T_Manycastclient 336
-#define T_Manycastserver 337
-#define T_Mask 338
-#define T_Maxage 339
-#define T_Maxclock 340
-#define T_Maxdepth 341
-#define T_Maxdist 342
-#define T_Maxmem 343
-#define T_Maxpoll 344
-#define T_Mdnstries 345
-#define T_Mem 346
-#define T_Memlock 347
-#define T_Minclock 348
-#define T_Mindepth 349
-#define T_Mindist 350
-#define T_Minimum 351
-#define T_Minpoll 352
-#define T_Minsane 353
-#define T_Mode 354
-#define T_Mode7 355
-#define T_Monitor 356
-#define T_Month 357
-#define T_Mru 358
-#define T_Multicastclient 359
-#define T_Nic 360
-#define T_Nolink 361
-#define T_Nomodify 362
-#define T_Nomrulist 363
-#define T_None 364
-#define T_Nonvolatile 365
-#define T_Nopeer 366
-#define T_Noquery 367
-#define T_Noselect 368
-#define T_Noserve 369
-#define T_Notrap 370
-#define T_Notrust 371
-#define T_Ntp 372
-#define T_Ntpport 373
-#define T_NtpSignDsocket 374
-#define T_Orphan 375
-#define T_Orphanwait 376
-#define T_Panic 377
-#define T_Peer 378
-#define T_Peerstats 379
-#define T_Phone 380
-#define T_Pid 381
-#define T_Pidfile 382
-#define T_Pool 383
-#define T_Port 384
-#define T_Preempt 385
-#define T_Prefer 386
-#define T_Protostats 387
-#define T_Pw 388
-#define T_Randfile 389
-#define T_Rawstats 390
-#define T_Refid 391
-#define T_Requestkey 392
-#define T_Reset 393
-#define T_Restrict 394
-#define T_Revoke 395
-#define T_Rlimit 396
-#define T_Saveconfigdir 397
-#define T_Server 398
-#define T_Setvar 399
-#define T_Source 400
-#define T_Stacksize 401
-#define T_Statistics 402
-#define T_Stats 403
-#define T_Statsdir 404
-#define T_Step 405
-#define T_Stepout 406
-#define T_Stratum 407
-#define T_String 408
-#define T_Sys 409
-#define T_Sysstats 410
-#define T_Tick 411
-#define T_Time1 412
-#define T_Time2 413
-#define T_Timer 414
-#define T_Timingstats 415
-#define T_Tinker 416
-#define T_Tos 417
-#define T_Trap 418
-#define T_True 419
-#define T_Trustedkey 420
-#define T_Ttl 421
-#define T_Type 422
-#define T_U_int 423
-#define T_Unconfig 424
-#define T_Unpeer 425
-#define T_Version 426
-#define T_WanderThreshold 427
-#define T_Week 428
-#define T_Wildcard 429
-#define T_Xleave 430
-#define T_Year 431
-#define T_Flag 432
-#define T_EOC 433
-#define T_Simulate 434
-#define T_Beep_Delay 435
-#define T_Sim_Duration 436
-#define T_Server_Offset 437
-#define T_Duration 438
-#define T_Freq_Offset 439
-#define T_Wander 440
-#define T_Jitter 441
-#define T_Prop_Delay 442
-#define T_Proc_Delay 443
-#ifdef YYSTYPE
-#undef  YYSTYPE_IS_DECLARED
-#define YYSTYPE_IS_DECLARED 1
-#endif
-#ifndef YYSTYPE_IS_DECLARED
-#define YYSTYPE_IS_DECLARED 1
-typedef union {
-	char *			String;
-	double			Double;
-	int			Integer;
-	unsigned		U_int;
-	gen_fifo *		Generic_fifo;
-	attr_val *		Attr_val;
-	attr_val_fifo *		Attr_val_fifo;
-	int_fifo *		Int_fifo;
-	string_fifo *		String_fifo;
-	address_node *		Address_node;
-	address_fifo *		Address_fifo;
-	setvar_node *		Set_var;
-	server_info *		Sim_server;
-	server_info_fifo *	Sim_server_fifo;
-	script_info *		Sim_script;
-	script_info_fifo *	Sim_script_fifo;
-} YYSTYPE;
-#endif /* !YYSTYPE_IS_DECLARED */
-extern YYSTYPE yylval;
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/bin/sntp/Makefile /cur/src/external/bsd/ntp/bin/sntp/Makefile
--- external/bsd/ntp/bin/sntp/Makefile	2014-12-24 18:27:53.000000000 -0800
+++ /cur/src/external/bsd/ntp/bin/sntp/Makefile	2013-12-27 19:19:43.000000000 -0800
@@ -31,19 +31,4 @@
 LDADD+= -L${LIBISC} -liscntp -levent -lm
 DPADD+=	${LIBM} ${LIBEVENT}
 
-WARNS=1
-LIBEVENTDIR=${.CURDIR}/../../dist/sntp/libevent
-CPPFLAGS+=-I${LIBEVENTDIR}/include -I${.CURDIR}
-.PATH: ${LIBEVENTDIR}
-SRCS+=	\
-	event.c \
-	evmap.c \
-	evthread.c \
-	evutil.c \
-	evutil_rand.c \
-	evutil_time.c \
-	evlog.c \
-	kqueue.c \
-	signal.c \
-
 .include <bsd.prog.mk>
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/bin/sntp/event2/event-config.h /cur/src/external/bsd/ntp/bin/sntp/event2/event-config.h
--- external/bsd/ntp/bin/sntp/event2/event-config.h	2014-12-24 16:32:04.000000000 -0800
+++ /cur/src/external/bsd/ntp/bin/sntp/event2/event-config.h	1969-12-31 16:00:00.000000000 -0800
@@ -1,664 +0,0 @@
-/* event2/event-config.h
- *
- * This file was generated by autoconf when libevent was built, and post-
- * processed by Libevent so that its macros would have a uniform prefix.
- *
- * DO NOT EDIT THIS FILE.
- *
- * Do not rely on macros in this file existing in later versions.
- */
-
-#ifndef EVENT2_EVENT_CONFIG_H_INCLUDED_
-#define EVENT2_EVENT_CONFIG_H_INCLUDED_
-
-/* config.h.  Generated from config.h.in by configure.  */
-/* config.h.in.  Generated from configure.ac by autoheader.  */
-
-/* Define if libevent should build without support for a debug mode */
-/* #undef EVENT__DISABLE_DEBUG_MODE */
-
-/* Define if libevent should not allow replacing the mm functions */
-/* #undef EVENT__DISABLE_MM_REPLACEMENT */
-
-/* Define if libevent should not be compiled with thread support */
-/* #undef EVENT__DISABLE_THREAD_SUPPORT */
-
-/* Define to 1 if you have the `accept4' function. */
-/* #undef EVENT__HAVE_ACCEPT4 */
-
-/* Define to 1 if you have the `arc4random' function. */
-#define EVENT__HAVE_ARC4RANDOM 1
-
-/* Define to 1 if you have the `arc4random_buf' function. */
-#define EVENT__HAVE_ARC4RANDOM_BUF 1
-
-/* Define to 1 if you have the <arpa/inet.h> header file. */
-#define EVENT__HAVE_ARPA_INET_H 1
-
-/* Define to 1 if you have the `clock_gettime' function. */
-#define EVENT__HAVE_CLOCK_GETTIME 1
-
-/* Define to 1 if you have the <cthreads.h> header file. */
-/* #undef EVENT__HAVE_CTHREADS_H */
-
-/* Define to 1 if you have the declaration of `CTL_KERN', and to 0 if you
-   don't. */
-#define EVENT__HAVE_DECL_CTL_KERN 1
-
-/* Define to 1 if you have the declaration of `KERN_ARND', and to 0 if you
-   don't. */
-#define EVENT__HAVE_DECL_KERN_ARND 1
-
-/* Define to 1 if you have the declaration of `KERN_RANDOM', and to 0 if you
-   don't. */
-#define EVENT__HAVE_DECL_KERN_RANDOM 0
-
-/* Define to 1 if you have the declaration of `RANDOM_UUID', and to 0 if you
-   don't. */
-#define EVENT__HAVE_DECL_RANDOM_UUID 0
-
-/* Define if /dev/poll is available */
-/* #undef EVENT__HAVE_DEVPOLL */
-
-/* Define to 1 if you have the <dlfcn.h> header file. */
-#define EVENT__HAVE_DLFCN_H 1
-
-/* Define if your system supports the epoll system calls */
-/* #undef EVENT__HAVE_EPOLL */
-
-/* Define to 1 if you have the `epoll_create1' function. */
-/* #undef EVENT__HAVE_EPOLL_CREATE1 */
-
-/* Define to 1 if you have the `epoll_ctl' function. */
-/* #undef EVENT__HAVE_EPOLL_CTL */
-
-/* Define to 1 if you have the `eventfd' function. */
-/* #undef EVENT__HAVE_EVENTFD */
-
-/* Define if your system supports event ports */
-/* #undef EVENT__HAVE_EVENT_PORTS */
-
-/* Define to 1 if you have the `fcntl' function. */
-#define EVENT__HAVE_FCNTL 1
-
-/* Define to 1 if you have the <fcntl.h> header file. */
-#define EVENT__HAVE_FCNTL_H 1
-
-/* Define to 1 if the system has the type `fd_mask'. */
-#define EVENT__HAVE_FD_MASK 1
-
-/* Do we have getaddrinfo()? */
-#define EVENT__HAVE_GETADDRINFO 1
-
-/* Define to 1 if you have the `getegid' function. */
-#define EVENT__HAVE_GETEGID 1
-
-/* Define to 1 if you have the `geteuid' function. */
-#define EVENT__HAVE_GETEUID 1
-
-/* Define this if you have any gethostbyname_r() */
-/* #undef EVENT__HAVE_GETHOSTBYNAME_R */
-
-/* Define this if gethostbyname_r takes 3 arguments */
-/* #undef EVENT__HAVE_GETHOSTBYNAME_R_3_ARG */
-
-/* Define this if gethostbyname_r takes 5 arguments */
-/* #undef EVENT__HAVE_GETHOSTBYNAME_R_5_ARG */
-
-/* Define this if gethostbyname_r takes 6 arguments */
-/* #undef EVENT__HAVE_GETHOSTBYNAME_R_6_ARG */
-
-/* Define to 1 if you have the `getifaddrs' function. */
-#define EVENT__HAVE_GETIFADDRS 1
-
-/* Define to 1 if you have the `getnameinfo' function. */
-#define EVENT__HAVE_GETNAMEINFO 1
-
-/* Define to 1 if you have the `getprotobynumber' function. */
-#define EVENT__HAVE_GETPROTOBYNUMBER 1
-
-/* Define to 1 if you have the `getservbyname' function. */
-/* #undef EVENT__HAVE_GETSERVBYNAME */
-
-/* Define to 1 if you have the `gettimeofday' function. */
-#define EVENT__HAVE_GETTIMEOFDAY 1
-
-/* if you have GNU Pth */
-/* #undef EVENT__HAVE_GNU_PTH */
-
-/* Define to 1 if you have the <ifaddrs.h> header file. */
-#define EVENT__HAVE_IFADDRS_H 1
-
-/* Define to 1 if you have the `inet_ntop' function. */
-#define EVENT__HAVE_INET_NTOP 1
-
-/* Define to 1 if you have the `inet_pton' function. */
-#define EVENT__HAVE_INET_PTON 1
-
-/* Define to 1 if you have the <inttypes.h> header file. */
-#define EVENT__HAVE_INTTYPES_H 1
-
-/* Define to 1 if you have the `issetugid' function. */
-#define EVENT__HAVE_ISSETUGID 1
-
-/* Define to 1 if you have the `kqueue' function. */
-#define EVENT__HAVE_KQUEUE 1
-
-/* Define if the system has zlib */
-#define EVENT__HAVE_LIBZ 1
-
-/* if you have LinuxThreads */
-/* #undef EVENT__HAVE_LINUX_THREADS */
-
-/* if you have SunOS LWP package */
-/* #undef EVENT__HAVE_LWP */
-
-/* Define to 1 if you have the <lwp/lwp.h> header file. */
-/* #undef EVENT__HAVE_LWP_LWP_H */
-
-/* Define to 1 if you have the `mach_absolute_time' function. */
-/* #undef EVENT__HAVE_MACH_ABSOLUTE_TIME */
-
-/* define if you have Mach Cthreads */
-/* #undef EVENT__HAVE_MACH_CTHREADS */
-
-/* Define to 1 if you have the <mach/cthreads.h> header file. */
-/* #undef EVENT__HAVE_MACH_CTHREADS_H */
-
-/* Define to 1 if you have the <mach/mach_time.h> header file. */
-/* #undef EVENT__HAVE_MACH_MACH_TIME_H */
-
-/* Define to 1 if you have the <memory.h> header file. */
-#define EVENT__HAVE_MEMORY_H 1
-
-/* Define to 1 if you have the `mmap' function. */
-#define EVENT__HAVE_MMAP 1
-
-/* Define to 1 if you have the `nanosleep' function. */
-#define EVENT__HAVE_NANOSLEEP 1
-
-/* Define to 1 if you have the <netdb.h> header file. */
-#define EVENT__HAVE_NETDB_H 1
-
-/* Define to 1 if you have the <netinet/in6.h> header file. */
-/* #undef EVENT__HAVE_NETINET_IN6_H */
-
-/* Define to 1 if you have the <netinet/in.h> header file. */
-#define EVENT__HAVE_NETINET_IN_H 1
-
-/* Define to 1 if you have the <netinet/tcp.h> header file. */
-#define EVENT__HAVE_NETINET_TCP_H 1
-
-/* if you have NT Event Log */
-/* #undef EVENT__HAVE_NT_EVENT_LOG */
-
-/* if you have NT Service Manager */
-/* #undef EVENT__HAVE_NT_SERVICE_MANAGER */
-
-/* if you have NT Threads */
-/* #undef EVENT__HAVE_NT_THREADS */
-
-/* Define if the system has openssl */
-#define EVENT__HAVE_OPENSSL 1
-
-/* Define to 1 if you have the `pipe' function. */
-#define EVENT__HAVE_PIPE 1
-
-/* Define to 1 if you have the `pipe2' function. */
-#define EVENT__HAVE_PIPE2 1
-
-/* Define to 1 if you have the `poll' function. */
-#define EVENT__HAVE_POLL 1
-
-/* Define to 1 if you have the <poll.h> header file. */
-#define EVENT__HAVE_POLL_H 1
-
-/* Define to 1 if you have the `port_create' function. */
-/* #undef EVENT__HAVE_PORT_CREATE */
-
-/* Define to 1 if you have the <port.h> header file. */
-/* #undef EVENT__HAVE_PORT_H */
-
-/* Define if you have POSIX threads libraries and header files. */
-/* #undef EVENT__HAVE_PTHREAD */
-
-/* define to pthreads API spec revision */
-#define EVENT__HAVE_PTHREADS 10
-
-/* define if you have pthread_detach function */
-#define EVENT__HAVE_PTHREAD_DETACH 1
-
-/* Define to 1 if you have the `pthread_getconcurrency' function. */
-/* #undef EVENT__HAVE_PTHREAD_GETCONCURRENCY */
-
-/* Define to 1 if you have the <pthread.h> header file. */
-#define EVENT__HAVE_PTHREAD_H 1
-
-/* Define to 1 if you have the `pthread_kill' function. */
-#define EVENT__HAVE_PTHREAD_KILL 1
-
-/* Define to 1 if you have the `pthread_kill_other_threads_np' function. */
-/* #undef EVENT__HAVE_PTHREAD_KILL_OTHER_THREADS_NP */
-
-/* define if you have pthread_rwlock_destroy function */
-#define EVENT__HAVE_PTHREAD_RWLOCK_DESTROY 1
-
-/* Define to 1 if you have the `pthread_setconcurrency' function. */
-/* #undef EVENT__HAVE_PTHREAD_SETCONCURRENCY */
-
-/* Define to 1 if you have the `pthread_yield' function. */
-/* #undef EVENT__HAVE_PTHREAD_YIELD */
-
-/* Define to 1 if you have the <pth.h> header file. */
-/* #undef EVENT__HAVE_PTH_H */
-
-/* Define to 1 if you have the `putenv' function. */
-#define EVENT__HAVE_PUTENV 1
-
-/* Define to 1 if the system has the type `sa_family_t'. */
-#define EVENT__HAVE_SA_FAMILY_T 1
-
-/* Define to 1 if you have the <sched.h> header file. */
-#define EVENT__HAVE_SCHED_H 1
-
-/* Define to 1 if you have the `sched_yield' function. */
-#define EVENT__HAVE_SCHED_YIELD 1
-
-/* Define to 1 if you have the `select' function. */
-#define EVENT__HAVE_SELECT 1
-
-/* Define to 1 if you have the `sendfile' function. */
-/* #undef EVENT__HAVE_SENDFILE */
-
-/* Define to 1 if you have the `setenv' function. */
-#define EVENT__HAVE_SETENV 1
-
-/* Define if F_SETFD is defined in <fcntl.h> */
-#define EVENT__HAVE_SETFD 1
-
-/* Define to 1 if you have the `setrlimit' function. */
-#define EVENT__HAVE_SETRLIMIT 1
-
-/* Define to 1 if you have the `sigaction' function. */
-#define EVENT__HAVE_SIGACTION 1
-
-/* Define to 1 if you have the `signal' function. */
-#define EVENT__HAVE_SIGNAL 1
-
-/* Define to 1 if you have the `splice' function. */
-/* #undef EVENT__HAVE_SPLICE */
-
-/* Define to 1 if you have the <stdarg.h> header file. */
-#define EVENT__HAVE_STDARG_H 1
-
-/* Define to 1 if you have the <stddef.h> header file. */
-#define EVENT__HAVE_STDDEF_H 1
-
-/* Define to 1 if you have the <stdint.h> header file. */
-#define EVENT__HAVE_STDINT_H 1
-
-/* Define to 1 if you have the <stdlib.h> header file. */
-#define EVENT__HAVE_STDLIB_H 1
-
-/* Define to 1 if you have the <strings.h> header file. */
-#define EVENT__HAVE_STRINGS_H 1
-
-/* Define to 1 if you have the <string.h> header file. */
-#define EVENT__HAVE_STRING_H 1
-
-/* Define to 1 if you have the `strlcpy' function. */
-#define EVENT__HAVE_STRLCPY 1
-
-/* Define to 1 if you have the `strsep' function. */
-#define EVENT__HAVE_STRSEP 1
-
-/* Define to 1 if you have the `strtok_r' function. */
-#define EVENT__HAVE_STRTOK_R 1
-
-/* Define to 1 if you have the `strtoll' function. */
-#define EVENT__HAVE_STRTOLL 1
-
-/* Define to 1 if the system has the type `struct addrinfo'. */
-#define EVENT__HAVE_STRUCT_ADDRINFO 1
-
-/* Define to 1 if the system has the type `struct in6_addr'. */
-#define EVENT__HAVE_STRUCT_IN6_ADDR 1
-
-/* Define to 1 if `s6_addr16' is a member of `struct in6_addr'. */
-/* #undef EVENT__HAVE_STRUCT_IN6_ADDR_S6_ADDR16 */
-
-/* Define to 1 if `s6_addr32' is a member of `struct in6_addr'. */
-/* #undef EVENT__HAVE_STRUCT_IN6_ADDR_S6_ADDR32 */
-
-/* Define to 1 if the system has the type `struct sockaddr_in6'. */
-#define EVENT__HAVE_STRUCT_SOCKADDR_IN6 1
-
-/* Define to 1 if `sin6_len' is a member of `struct sockaddr_in6'. */
-#define EVENT__HAVE_STRUCT_SOCKADDR_IN6_SIN6_LEN 1
-
-/* Define to 1 if `sin_len' is a member of `struct sockaddr_in'. */
-#define EVENT__HAVE_STRUCT_SOCKADDR_IN_SIN_LEN 1
-
-/* Define to 1 if the system has the type `struct sockaddr_storage'. */
-#define EVENT__HAVE_STRUCT_SOCKADDR_STORAGE 1
-
-/* Define to 1 if `ss_family' is a member of `struct sockaddr_storage'. */
-#define EVENT__HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY 1
-
-/* Define to 1 if `__ss_family' is a member of `struct sockaddr_storage'. */
-/* #undef EVENT__HAVE_STRUCT_SOCKADDR_STORAGE___SS_FAMILY */
-
-/* Define to 1 if the system has the type `struct so_linger'. */
-/* #undef EVENT__HAVE_STRUCT_SO_LINGER */
-
-/* Define to 1 if you have the <synch.h> header file. */
-/* #undef EVENT__HAVE_SYNCH_H */
-
-/* Define to 1 if you have the `sysctl' function. */
-#define EVENT__HAVE_SYSCTL 1
-
-/* Define to 1 if you have the <sys/devpoll.h> header file. */
-/* #undef EVENT__HAVE_SYS_DEVPOLL_H */
-
-/* Define to 1 if you have the <sys/epoll.h> header file. */
-/* #undef EVENT__HAVE_SYS_EPOLL_H */
-
-/* Define to 1 if you have the <sys/eventfd.h> header file. */
-/* #undef EVENT__HAVE_SYS_EVENTFD_H */
-
-/* Define to 1 if you have the <sys/event.h> header file. */
-#define EVENT__HAVE_SYS_EVENT_H 1
-
-/* Define to 1 if you have the <sys/ioctl.h> header file. */
-#define EVENT__HAVE_SYS_IOCTL_H 1
-
-/* Define to 1 if you have the <sys/mman.h> header file. */
-#define EVENT__HAVE_SYS_MMAN_H 1
-
-/* Define to 1 if you have the <sys/param.h> header file. */
-#define EVENT__HAVE_SYS_PARAM_H 1
-
-/* Define to 1 if you have the <sys/queue.h> header file. */
-#define EVENT__HAVE_SYS_QUEUE_H 1
-
-/* Define to 1 if you have the <sys/resource.h> header file. */
-#define EVENT__HAVE_SYS_RESOURCE_H 1
-
-/* Define to 1 if you have the <sys/select.h> header file. */
-#define EVENT__HAVE_SYS_SELECT_H 1
-
-/* Define to 1 if you have the <sys/sendfile.h> header file. */
-/* #undef EVENT__HAVE_SYS_SENDFILE_H */
-
-/* Define to 1 if you have the <sys/socket.h> header file. */
-#define EVENT__HAVE_SYS_SOCKET_H 1
-
-/* Define to 1 if you have the <sys/stat.h> header file. */
-#define EVENT__HAVE_SYS_STAT_H 1
-
-/* Define to 1 if you have the <sys/sysctl.h> header file. */
-#define EVENT__HAVE_SYS_SYSCTL_H 1
-
-/* Define to 1 if you have the <sys/timerfd.h> header file. */
-/* #undef EVENT__HAVE_SYS_TIMERFD_H */
-
-/* Define to 1 if you have the <sys/time.h> header file. */
-#define EVENT__HAVE_SYS_TIME_H 1
-
-/* Define to 1 if you have the <sys/types.h> header file. */
-#define EVENT__HAVE_SYS_TYPES_H 1
-
-/* Define to 1 if you have the <sys/uio.h> header file. */
-#define EVENT__HAVE_SYS_UIO_H 1
-
-/* Define to 1 if you have the <sys/wait.h> header file. */
-#define EVENT__HAVE_SYS_WAIT_H 1
-
-/* Define if TAILQ_FOREACH is defined in <sys/queue.h> */
-#define EVENT__HAVE_TAILQFOREACH 1
-
-/* if you have Solaris LWP (thr) package */
-/* #undef EVENT__HAVE_THR */
-
-/* Define to 1 if you have the <thread.h> header file. */
-/* #undef EVENT__HAVE_THREAD_H */
-
-/* Define to 1 if you have the `thr_getconcurrency' function. */
-/* #undef EVENT__HAVE_THR_GETCONCURRENCY */
-
-/* Define to 1 if you have the `thr_setconcurrency' function. */
-/* #undef EVENT__HAVE_THR_SETCONCURRENCY */
-
-/* Define to 1 if you have the `thr_yield' function. */
-/* #undef EVENT__HAVE_THR_YIELD */
-
-/* Define if timeradd is defined in <sys/time.h> */
-#define EVENT__HAVE_TIMERADD 1
-
-/* Define if timerclear is defined in <sys/time.h> */
-#define EVENT__HAVE_TIMERCLEAR 1
-
-/* Define if timercmp is defined in <sys/time.h> */
-#define EVENT__HAVE_TIMERCMP 1
-
-/* Define to 1 if you have the `timerfd_create' function. */
-/* #undef EVENT__HAVE_TIMERFD_CREATE */
-
-/* Define if timerisset is defined in <sys/time.h> */
-#define EVENT__HAVE_TIMERISSET 1
-
-/* Define to 1 if the system has the type `uint16_t'. */
-#define EVENT__HAVE_UINT16_T 1
-
-/* Define to 1 if the system has the type `uint32_t'. */
-#define EVENT__HAVE_UINT32_T 1
-
-/* Define to 1 if the system has the type `uint64_t'. */
-#define EVENT__HAVE_UINT64_T 1
-
-/* Define to 1 if the system has the type `uint8_t'. */
-#define EVENT__HAVE_UINT8_T 1
-
-/* Define to 1 if the system has the type `uintptr_t'. */
-#define EVENT__HAVE_UINTPTR_T 1
-
-/* Define to 1 if you have the `umask' function. */
-#define EVENT__HAVE_UMASK 1
-
-/* Define to 1 if you have the <unistd.h> header file. */
-#define EVENT__HAVE_UNISTD_H 1
-
-/* Define to 1 if you have the `unsetenv' function. */
-#define EVENT__HAVE_UNSETENV 1
-
-/* Define to 1 if you have the `usleep' function. */
-#define EVENT__HAVE_USLEEP 1
-
-/* Define to 1 if you have the `vasprintf' function. */
-#define EVENT__HAVE_VASPRINTF 1
-
-/* Define if kqueue works correctly with pipes */
-#define EVENT__HAVE_WORKING_KQUEUE 1
-
-/* define if select implicitly yields */
-#define EVENT__HAVE_YIELDING_SELECT 1
-
-/* Define to 1 if you have the <zlib.h> header file. */
-#define EVENT__HAVE_ZLIB_H 1
-
-/* define to 1 if library is thread safe */
-#define EVENT__LDAP_API_FEATURE_X_OPENLDAP_THREAD_SAFE 1
-
-/* Define to the sub-directory in which libtool stores uninstalled libraries.
-   */
-#define EVENT__LT_OBJDIR ".libs/"
-
-/* Define to 1 if your C compiler doesn't accept -c and -o together. */
-/* #undef EVENT__NO_MINUS_C_MINUS_O */
-
-/* define if you have (or want) no threads */
-/* #undef EVENT__NO_THREADS */
-
-/* Numeric representation of the version */
-#define EVENT__NUMERIC_VERSION 0x02010301
-
-/* Name of package */
-#define EVENT__PACKAGE "libevent"
-
-/* Define to the address where bug reports for this package should be sent. */
-#define EVENT__PACKAGE_BUGREPORT ""
-
-/* Define to the full name of this package. */
-#define EVENT__PACKAGE_NAME "libevent"
-
-/* Define to the full name and version of this package. */
-#define EVENT__PACKAGE_STRING "libevent 2.1.3-alpha-dev"
-
-/* Define to the one symbol short name of this package. */
-#define EVENT__PACKAGE_TARNAME "libevent"
-
-/* Define to the home page for this package. */
-#define EVENT__PACKAGE_URL ""
-
-/* Define to the version of this package. */
-#define EVENT__PACKAGE_VERSION "2.1.3-alpha-dev"
-
-/* enable thread safety */
-#define EVENT__REENTRANT 1
-
-/* define if sched_yield yields the entire process */
-/* #undef EVENT__REPLACE_BROKEN_YIELD */
-
-/* The size of `int', as computed by sizeof. */
-#define EVENT__SIZEOF_INT 4
-
-#ifdef _LP64
-/* The size of `long', as computed by sizeof. */
-#define EVENT__SIZEOF_LONG 8
-#else
-#define EVENT__SIZEOF_LONG 4
-#endif
-
-/* The size of `long long', as computed by sizeof. */
-#define EVENT__SIZEOF_LONG_LONG 8
-
-/* The size of `off_t', as computed by sizeof. */
-#define EVENT__SIZEOF_OFF_T 8
-
-#ifdef _LP64
-/* The size of `pthread_t', as computed by sizeof. */
-#define EVENT__SIZEOF_PTHREAD_T 8
-#else
-#define EVENT__SIZEOF_PTHREAD_T 4
-#endif
-
-/* The size of `short', as computed by sizeof. */
-#define EVENT__SIZEOF_SHORT 2
-
-#ifdef _LP64
-/* The size of `size_t', as computed by sizeof. */
-#define EVENT__SIZEOF_SIZE_T 8
-#else
-#define EVENT__SIZEOF_SIZE_T 4
-#endif
-
-#ifdef _LP64
-/* The size of `void *', as computed by sizeof. */
-#define EVENT__SIZEOF_VOID_P 8
-#else
-#define EVENT__SIZEOF_VOID_P 4
-#endif
-
-/* Define to 1 if you have the ANSI C header files. */
-#define EVENT__STDC_HEADERS 1
-
-/* enable thread safety */
-#define EVENT__THREADSAFE 1
-
-/* enable thread safety */
-#define EVENT__THREAD_SAFE 1
-
-/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
-#define EVENT__TIME_WITH_SYS_TIME 1
-
-/* Version number of package */
-#define EVENT__VERSION "2.1.3-alpha-dev"
-
-/* Number of bits in a file offset, on hosts where this is settable. */
-/* #undef EVENT___FILE_OFFSET_BITS */
-
-/* Define for large files, on AIX-style hosts. */
-/* #undef EVENT___LARGE_FILES */
-
-/* Define to 1 if on MINIX. */
-/* #undef EVENT___MINIX */
-
-/* Define to 2 if the system does not provide POSIX.1 features except with
-   this defined. */
-/* #undef EVENT___POSIX_1_SOURCE */
-
-/* Define to 1 if you need to in order for `stat' and other things to work. */
-/* #undef EVENT___POSIX_SOURCE */
-
-/* enable thread safety */
-#define EVENT___REENTRANT 1
-
-/* enable thread safety */
-#define EVENT___SGI_MP_SOURCE 1
-
-/* enable thread safety */
-#define EVENT___THREADSAFE 1
-
-/* enable thread safety */
-#define EVENT___THREAD_SAFE 1
-
-/* Define to 500 only on HP-UX. */
-/* #undef EVENT___XOPEN_SOURCE */
-
-/* Enable extensions on AIX 3, Interix.  */
-#ifndef EVENT___ALL_SOURCE
-# define EVENT___ALL_SOURCE 1
-#endif
-/* Enable GNU extensions on systems that have them.  */
-#ifndef EVENT___GNU_SOURCE
-# define EVENT___GNU_SOURCE 1
-#endif
-/* Enable threading extensions on Solaris.  */
-#ifndef EVENT___POSIX_PTHREAD_SEMANTICS
-# define EVENT___POSIX_PTHREAD_SEMANTICS 1
-#endif
-/* Enable extensions on HP NonStop.  */
-#ifndef EVENT___TANDEM_SOURCE
-# define EVENT___TANDEM_SOURCE 1
-#endif
-/* Enable general extensions on Solaris.  */
-#ifndef EVENT____EXTENSIONS__
-# define EVENT____EXTENSIONS__ 1
-#endif
-
-
-/* Define to appropriate substitue if compiler doesnt have __func__ */
-/* #undef EVENT____func__ */
-
-/* Define to empty if `const' does not conform to ANSI C. */
-/* #undef EVENT__const */
-
-/* Define to `__inline__' or `__inline' if that's what the C compiler
-   calls it, or to nothing if 'inline' is not supported under any name.  */
-#ifndef EVENT____cplusplus
-/* #undef EVENT__inline */
-#endif
-
-/* Define to `int' if <sys/types.h> does not define. */
-/* #undef EVENT__pid_t */
-
-/* Define to `unsigned int' if <sys/types.h> does not define. */
-/* #undef EVENT__size_t */
-
-/* Define to unsigned int if you dont have it */
-/* #undef EVENT__socklen_t */
-
-/* Define to `int' if <sys/types.h> does not define. */
-/* #undef EVENT__ssize_t */
-
-#endif /* event2/event-config.h */
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/bin/sntp/evlog.c /cur/src/external/bsd/ntp/bin/sntp/evlog.c
--- external/bsd/ntp/bin/sntp/evlog.c	2014-12-24 16:31:49.000000000 -0800
+++ /cur/src/external/bsd/ntp/bin/sntp/evlog.c	1969-12-31 16:00:00.000000000 -0800
@@ -1 +0,0 @@
-#include "libevent/log.c"
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/COPYRIGHT /cur/src/external/bsd/ntp/dist/COPYRIGHT
--- external/bsd/ntp/dist/COPYRIGHT	2014-12-19 12:37:31.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/COPYRIGHT	2015-04-07 19:51:10.000000000 -0700
@@ -4,16 +4,16 @@
   
    jpg "Clone me," says Dolly sheepishly.
    
-   Last update: 9-Aug-2014 07:56 UTC
+   Last update: 17-Jan-2015 00:16 UTC
      _________________________________________________________________
    
    The following copyright notice applies to all files collectively
    called the Network Time Protocol Version 4 Distribution. Unless
-   specifically declared otherwise in an individual file, this notice
-   applies as if the text was explicitly included in the file.
+   specifically declared otherwise in an individual file, this entire
+   notice applies as if the text was explicitly included in the file.
 ***********************************************************************
 *                                                                     *
-* Copyright (c) University of Delaware 1992-2014                      *
+* Copyright (c) University of Delaware 1992-2015                      *
 *                                                                     *
 * Permission to use, copy, modify, and distribute this software and   *
 * its documentation for any purpose with or without fee is hereby     *
@@ -29,6 +29,38 @@
 *                                                                     *
 ***********************************************************************
 
+   Content starting in 2011 from Harlan Stenn, Danny Mayer, and Martin
+   Burnicki is:
+***********************************************************************
+*                                                                     *
+* Copyright (c) Network Time Foundation 2011-2015                     *
+*                                                                     *
+* All Rights Reserved                                                 *
+*                                                                     *
+* Redistribution and use in source and binary forms, with or without  *
+* modification, are permitted provided that the following conditions  *
+* are met:                                                            *
+* 1. Redistributions of source code must retain the above copyright   *
+*    notice, this list of conditions and the following disclaimer.    *
+* 2. Redistributions in binary form must reproduce the above          *
+*    copyright notice, this list of conditions and the following      *
+*    disclaimer in the documentation and/or other materials provided  *
+*    with the distribution.                                           *
+*                                                                     *
+* THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS  *
+* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED   *
+* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE  *
+* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE    *
+* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR *
+* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT   *
+* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR  *
+* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF          *
+* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT           *
+* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE   *
+* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH    *
+* DAMAGE.                                                             *
+***********************************************************************
+
    The following individuals contributed in part to the Network Time
    Protocol Distribution Version 4 and are acknowledged as authors of
    this work.
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/ChangeLog /cur/src/external/bsd/ntp/dist/ChangeLog
--- external/bsd/ntp/dist/ChangeLog	2014-12-19 12:37:31.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/ChangeLog	2015-04-07 19:51:10.000000000 -0700
@@ -1,4 +1,152 @@
 ---
+(4.2.8p2) 2015/04/07 Released by Harlan Stenn <stenn@ntp.org>
+(4.2.8p2-RC3) 2015/04/03 Released by Harlan Stenn <stenn@ntp.org>
+
+* [Bug 2763] Fix for different thresholds for forward and backward steps.
+---
+(4.2.8p2-RC2) 2015/04/03 Released by Harlan Stenn <stenn@ntp.org>
+
+* [Bug 2592] FLAG_TSTAMP_PPS cleanup for refclock_parse.c.
+* [Bug 2769] New script: update-leap
+* [Bug 2769] cleannup for update-leap
+* [Bug 2788] New flag -G (force_step_once).
+* [Bug 2794] Clean up kernel clock status reports.
+* [Bug 2795] Cannot build without OpenSLL (on Win32).
+  Provided a Win32 specific wrapper around libevent/arc4random.c.
+  fixed some minor warnings.
+* [Bug 2796] ntp-keygen crashes in 'getclock()' on Win32.
+* [Bug 2797] ntp-keygen trapped in endless loop for MD5 keys
+  on big-endian machines.
+* [Bug 2798] sntp should decode and display the leap indicator.
+* Simple cleanup to html/build.html
+---
+(4.2.8p2-RC1) 2015/03/30 Released by Harlan Stenn <stenn@ntp.org>
+
+* [Bug 2794] Don't let reports on normal kernel status changes
+  look like errors.
+* [Bug 2788] New flag -G (force_step_once).
+* [Bug 2592] Account for PPS sources which can provide an accurate
+  absolute time stamp, and status information.
+  Fixed indention and removed trailing whitespace.
+* [Bug 1787] DCF77's formerly "antenna" bit is "call bit" since 2003.
+* [Bug 1960] setsockopt IPV6_MULTICAST_IF: Invalid argument.
+* [Bug 2346] "graceful termination" signals do not do peer cleanup.
+* [Bug 2728] See if C99-style structure initialization works.
+* [Bug 2747] Upgrade libevent to 2.1.5-beta.
+* [Bug 2749] ntp/lib/NTP/Util.pm needs update for ntpq -w, IPv6, .POOL. .
+* [Bug 2751] jitter.h has stale copies of l_fp macros.
+* [Bug 2756] ntpd hangs in startup with gcc 3.3.5 on ARM.
+* [Bug 2757] Quiet compiler warnings.
+* [Bug 2759] Expose nonvolatile/clk_wander_threshold to ntpq.
+* [Bug 2763] Allow different thresholds for forward and backward steps.
+* [Bug 2766] ntp-keygen output files should not be world-readable.
+* [Bug 2767] ntp-keygen -M should symlink to ntp.keys.
+* [Bug 2771] nonvolatile value is documented in wrong units.
+* [Bug 2773] Early leap announcement from Palisade/Thunderbolt
+* [Bug 2774] Unreasonably verbose printout - leap pending/warning
+* [Bug 2775] ntp-keygen.c fails to compile under Windows.
+* [Bug 2777] Fixed loops and decoding of Meinberg GPS satellite info.
+  Removed non-ASCII characters from some copyright comments.
+  Removed trailing whitespace.
+  Updated definitions for Meinberg clocks from current Meinberg header files.
+  Now use C99 fixed-width types and avoid non-ASCII characters in comments.
+  Account for updated definitions pulled from Meinberg header files.
+  Updated comments on Meinberg GPS receivers which are not only called GPS16x.
+  Replaced some constant numbers by defines from ntp_calendar.h
+  Modified creation of parse-specific variables for Meinberg devices
+  in gps16x_message().
+  Reworked mk_utcinfo() to avoid printing of ambiguous leap second dates.
+  Modified mbg_tm_str() which now expexts an additional parameter controlling
+  if the time status shall be printed.
+* [Sec 2779] ntpd accepts unauthenticated packets with symmetric key crypto.
+* [Sec 2781] Authentication doesn't protect symmetric associations against
+  DoS attacks.
+* [Bug 2783] Quiet autoconf warnings about missing AC_LANG_SOURCE.
+* [Bug 2789] Quiet compiler warnings from libevent.
+* [Bug 2790] If ntpd sets the Windows MM timer highest resolution
+  pause briefly before measuring system clock precision to yield
+  correct results.
+* Comment from Juergen Perlinger in ntp_calendar.c to make the code clearer.
+* Use predefined function types for parse driver functions
+  used to set up function pointers.
+  Account for changed prototype of parse_inp_fnc_t functions.
+  Cast parse conversion results to appropriate types to avoid
+  compiler warnings.
+  Let ioctl() for Windows accept a (void *) to avoid compiler warnings
+  when called with pointers to different types.
+---
+(4.2.8p1) 2015/02/04 Released by Harlan Stenn <stenn@ntp.org>
+
+* Update the NEWS file.
+* [Sec 2671] vallen in extension fields are not validated.
+---
+(4.2.8p1-RC2) 2015/01/29 Released by Harlan Stenn <stenn@ntp.org>
+
+* [Bug 2627] shm refclock allows only two units with owner-only access
+  rework: reverted sense of mode bit (so default reflects previous
+  behaviour) and updated ducumentation.
+* [Bug 2732] - Leap second not handled correctly on Windows 8
+  use 'GetTickCount()' to get the true elapsed time of slew
+  (This should work for all versions of Windows >= W2K)
+* [Bug 2738] Missing buffer initialization in refclocK_parse.c::parsestate().
+* [Bug 2739] Parse driver with PPS enabled occasionally evaluates
+  PPS timestamp with wrong sign.
+  Removed some German umlauts.
+* [Bug 2740] Removed some obsolete code from the parse driver.
+* [Bug 2741] Incorrect buffer check in refclocK_parse.c::parsestatus().
+---
+(4.2.8p1-RC1) 2015/01/24 Released by Harlan Stenn <stenn@ntp.org>
+
+* Start the RC for 4.2.8p1.
+* [Bug 2187] Update version number generation scripts.
+* [Bug 2617] Fix sntp Usage documentation section.
+* [Sec 2672] Code cleanup: On some OSes ::1 can be spoofed...
+* [Bug 2736] Show error message if we cannot open the config file.
+* Copyright update.
+* Fix the package name.
+---
+(4.2.8p1-beta5) 2015/01/07 Released by Harlan Stenn <stenn@ntp.org>
+
+* [Bug 2695] Windows build: __func__ not supported under Windows.
+* [Bug 2728] Work around C99-style structure initialization code
+  for older compilers, specifically Visual Studio prior to VS2013.
+---
+(4.2.8p1-beta4) 2015/01/04 Released by Harlan Stenn <stenn@ntp.org>
+
+* [Bug 1084] PPSAPI for ntpd on Windows with DLL backends
+* [Bug 2695] Build problem on Windows (sys/socket.h).
+* [Bug 2715] mdnstries option for ntp.conf from NetBSD.
+* Fix a regression introduced to timepps-Solaris.h as part of:
+  [Bug 1206] Required compiler changes for Windows
+  (4.2.5p181) 2009/06/06
+---
+(4.2.8p1-beta3) 2015/01/02 Released by Harlan Stenn <stenn@ntp.org>
+
+* [Bug 2627] shm refclock allows only two units with owner-only access
+  Use mode bit 0 to select public access for units >= 2 (units 0 & 1 are
+  always private.
+* [Bug 2681] Fix display of certificate EOValidity dates on 32-bit systems.
+* [Bug 2695] 4.2.8 does not build on Windows.
+* [bug 2700] mrulist stopped working in 4.2.8.
+* [Bug 2706] libparse/info_trimble.c build dependencies are broken.
+* [Bug 2713] variable type/cast, parameter name, general cleanup from NetBSD.
+* [Bug 2714] libevent may need to be built independently of any build of sntp.
+* [Bug 2715] mdnstries option for ntp.conf from NetBSD.
+---
+(4.2.8p1-beta2) 2014/12/27 Released by Harlan Stenn <stenn@ntp.org>
+
+* [Bug 2674] Install sntp in sbin on NetBSD.
+* [Bug 2693] ntp-keygen doesn't build without OpenSSL and sntp.
+* [Bug 2707] Avoid a C90 extension in libjsmn/jsmn.c.
+* [Bug 2709] see if we have a C99 compiler (not yet required).
+---
+(4.2.8p1-beta1) 2014/12/23 Released by Harlan Stenn <stenn@ntp.org>
+
+* [Sec 2672] On some OSes ::1 can be spoofed, bypassing source IP ACLs.
+* [Bug 2693] ntp-keygen doesn't build without OpenSSL.
+* [Bug 2697] IN6_IS_ADDR_LOOPBACK build problems on some OSes.
+* [Bug 2699] HAVE_SYS_SELECT_H is misspelled in refclock_gpsdjson.c.
+---
 (4.2.8) 2014/12/19 Released by Harlan Stenn <stenn@ntp.org>
 
 * [Sec 730] Increase RSA_generate_key modulus.
@@ -22,10 +170,10 @@
 * [Bug 2678] nmea_control() now checks 'refclock_params()' result.
 (4.2.7p481) 2014/11/22 Released by Harlan Stenn <stenn@ntp.org>
 * [Bug 2314] Only enable PPS if kernel consumer binding succeeds.
-* [Bug 2314] Kernel PPS binding EOPNOTSUPP is a failure condition. 
+* [Bug 2314] Kernel PPS binding EOPNOTSUPP is a failure condition.
 * Rename pps_enable to hardpps_enable.
 (4.2.7p480) 2014/11/21 Released by Harlan Stenn <stenn@ntp.org>
-* [Bug 2677] PATH_MAX isn't #define'd  under Windows.
+* [Bug 2677] PATH_MAX isn't #define'd under Windows.
   Regression from the patch fixing Bug 2639.
 (4.2.7p479) 2014/11/15 Released by Harlan Stenn <stenn@ntp.org>
 * [Bug 2651] Certificates with ASN timestamps w/ 4-digit years mis-parsed.
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/CommitLog /cur/src/external/bsd/ntp/dist/CommitLog
--- external/bsd/ntp/dist/CommitLog	2014-12-19 12:37:34.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/CommitLog	2015-04-07 19:51:17.000000000 -0700
@@ -1,3 +1,6116 @@
+ChangeSet@1.3320, 2015-04-07 04:28:16-04:00, stenn@deacon.udel.edu
+  NTP_4_2_8P2
+  TAG: NTP_4_2_8P2
+
+  ChangeLog@1.1633 +1 -0
+    NTP_4_2_8P2
+
+  ntpd/invoke-ntp.conf.texi@1.182 +1 -1
+    NTP_4_2_8P2
+
+  ntpd/invoke-ntp.keys.texi@1.178 +1 -1
+    NTP_4_2_8P2
+
+  ntpd/invoke-ntpd.texi@1.495 +2 -2
+    NTP_4_2_8P2
+
+  ntpd/ntp.conf.5man@1.216 +3 -3
+    NTP_4_2_8P2
+
+  ntpd/ntp.conf.5mdoc@1.216 +2 -2
+    NTP_4_2_8P2
+
+  ntpd/ntp.conf.html@1.173 +1 -1
+    NTP_4_2_8P2
+
+  ntpd/ntp.conf.man.in@1.216 +3 -3
+    NTP_4_2_8P2
+
+  ntpd/ntp.conf.mdoc.in@1.216 +2 -2
+    NTP_4_2_8P2
+
+  ntpd/ntp.keys.5man@1.212 +2 -2
+    NTP_4_2_8P2
+
+  ntpd/ntp.keys.5mdoc@1.212 +2 -2
+    NTP_4_2_8P2
+
+  ntpd/ntp.keys.html@1.174 +1 -1
+    NTP_4_2_8P2
+
+  ntpd/ntp.keys.man.in@1.212 +2 -2
+    NTP_4_2_8P2
+
+  ntpd/ntp.keys.mdoc.in@1.212 +2 -2
+    NTP_4_2_8P2
+
+  ntpd/ntpd-opts.c@1.517 +245 -245
+    NTP_4_2_8P2
+
+  ntpd/ntpd-opts.h@1.516 +3 -3
+    NTP_4_2_8P2
+
+  ntpd/ntpd.1ntpdman@1.324 +3 -3
+    NTP_4_2_8P2
+
+  ntpd/ntpd.1ntpdmdoc@1.324 +2 -2
+    NTP_4_2_8P2
+
+  ntpd/ntpd.html@1.168 +2 -2
+    NTP_4_2_8P2
+
+  ntpd/ntpd.man.in@1.324 +3 -3
+    NTP_4_2_8P2
+
+  ntpd/ntpd.mdoc.in@1.324 +2 -2
+    NTP_4_2_8P2
+
+  ntpdc/invoke-ntpdc.texi@1.492 +2 -2
+    NTP_4_2_8P2
+
+  ntpdc/ntpdc-opts.c@1.510 +107 -107
+    NTP_4_2_8P2
+
+  ntpdc/ntpdc-opts.h@1.509 +3 -3
+    NTP_4_2_8P2
+
+  ntpdc/ntpdc.1ntpdcman@1.323 +3 -3
+    NTP_4_2_8P2
+
+  ntpdc/ntpdc.1ntpdcmdoc@1.323 +2 -2
+    NTP_4_2_8P2
+
+  ntpdc/ntpdc.html@1.336 +2 -2
+    NTP_4_2_8P2
+
+  ntpdc/ntpdc.man.in@1.323 +3 -3
+    NTP_4_2_8P2
+
+  ntpdc/ntpdc.mdoc.in@1.323 +2 -2
+    NTP_4_2_8P2
+
+  ntpq/invoke-ntpq.texi@1.498 +2 -2
+    NTP_4_2_8P2
+
+  ntpq/ntpq-opts.c@1.515 +106 -106
+    NTP_4_2_8P2
+
+  ntpq/ntpq-opts.h@1.513 +3 -3
+    NTP_4_2_8P2
+
+  ntpq/ntpq.1ntpqman@1.326 +3 -3
+    NTP_4_2_8P2
+
+  ntpq/ntpq.1ntpqmdoc@1.326 +2 -2
+    NTP_4_2_8P2
+
+  ntpq/ntpq.html@1.165 +2 -2
+    NTP_4_2_8P2
+
+  ntpq/ntpq.man.in@1.326 +3 -3
+    NTP_4_2_8P2
+
+  ntpq/ntpq.mdoc.in@1.326 +2 -2
+    NTP_4_2_8P2
+
+  ntpsnmpd/invoke-ntpsnmpd.texi@1.494 +2 -2
+    NTP_4_2_8P2
+
+  ntpsnmpd/ntpsnmpd-opts.c@1.512 +68 -68
+    NTP_4_2_8P2
+
+  ntpsnmpd/ntpsnmpd-opts.h@1.511 +3 -3
+    NTP_4_2_8P2
+
+  ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.323 +3 -3
+    NTP_4_2_8P2
+
+  ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.323 +2 -2
+    NTP_4_2_8P2
+
+  ntpsnmpd/ntpsnmpd.html@1.163 +1 -1
+    NTP_4_2_8P2
+
+  ntpsnmpd/ntpsnmpd.man.in@1.323 +3 -3
+    NTP_4_2_8P2
+
+  ntpsnmpd/ntpsnmpd.mdoc.in@1.323 +2 -2
+    NTP_4_2_8P2
+
+  packageinfo.sh@1.509 +2 -2
+    NTP_4_2_8P2
+
+  scripts/calc_tickadj/calc_tickadj.1calc_tickadjman@1.84 +3 -3
+    NTP_4_2_8P2
+
+  scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc@1.85 +2 -2
+    NTP_4_2_8P2
+
+  scripts/calc_tickadj/calc_tickadj.html@1.86 +1 -1
+    NTP_4_2_8P2
+
+  scripts/calc_tickadj/calc_tickadj.man.in@1.83 +3 -3
+    NTP_4_2_8P2
+
+  scripts/calc_tickadj/calc_tickadj.mdoc.in@1.85 +2 -2
+    NTP_4_2_8P2
+
+  scripts/calc_tickadj/invoke-calc_tickadj.texi@1.88 +1 -1
+    NTP_4_2_8P2
+
+  scripts/invoke-plot_summary.texi@1.105 +2 -2
+    NTP_4_2_8P2
+
+  scripts/invoke-summary.texi@1.105 +2 -2
+    NTP_4_2_8P2
+
+  scripts/ntp-wait/invoke-ntp-wait.texi@1.315 +2 -2
+    NTP_4_2_8P2
+
+  scripts/ntp-wait/ntp-wait-opts@1.51 +2 -2
+    NTP_4_2_8P2
+
+  scripts/ntp-wait/ntp-wait.1ntp-waitman@1.312 +3 -3
+    NTP_4_2_8P2
+
+  scripts/ntp-wait/ntp-wait.1ntp-waitmdoc@1.313 +2 -2
+    NTP_4_2_8P2
+
+  scripts/ntp-wait/ntp-wait.html@1.332 +2 -2
+    NTP_4_2_8P2
+
+  scripts/ntp-wait/ntp-wait.man.in@1.312 +3 -3
+    NTP_4_2_8P2
+
+  scripts/ntp-wait/ntp-wait.mdoc.in@1.313 +2 -2
+    NTP_4_2_8P2
+
+  scripts/ntpsweep/invoke-ntpsweep.texi@1.103 +2 -2
+    NTP_4_2_8P2
+
+  scripts/ntpsweep/ntpsweep-opts@1.53 +2 -2
+    NTP_4_2_8P2
+
+  scripts/ntpsweep/ntpsweep.1ntpsweepman@1.91 +3 -3
+    NTP_4_2_8P2
+
+  scripts/ntpsweep/ntpsweep.1ntpsweepmdoc@1.91 +2 -2
+    NTP_4_2_8P2
+
+  scripts/ntpsweep/ntpsweep.html@1.104 +2 -2
+    NTP_4_2_8P2
+
+  scripts/ntpsweep/ntpsweep.man.in@1.91 +3 -3
+    NTP_4_2_8P2
+
+  scripts/ntpsweep/ntpsweep.mdoc.in@1.92 +2 -2
+    NTP_4_2_8P2
+
+  scripts/ntptrace/invoke-ntptrace.texi@1.104 +2 -2
+    NTP_4_2_8P2
+
+  scripts/ntptrace/ntptrace-opts@1.53 +2 -2
+    NTP_4_2_8P2
+
+  scripts/ntptrace/ntptrace.1ntptraceman@1.91 +3 -3
+    NTP_4_2_8P2
+
+  scripts/ntptrace/ntptrace.1ntptracemdoc@1.92 +2 -2
+    NTP_4_2_8P2
+
+  scripts/ntptrace/ntptrace.html@1.105 +2 -2
+    NTP_4_2_8P2
+
+  scripts/ntptrace/ntptrace.man.in@1.91 +3 -3
+    NTP_4_2_8P2
+
+  scripts/ntptrace/ntptrace.mdoc.in@1.93 +2 -2
+    NTP_4_2_8P2
+
+  scripts/plot_summary-opts@1.53 +2 -2
+    NTP_4_2_8P2
+
+  scripts/plot_summary.1plot_summaryman@1.103 +3 -3
+    NTP_4_2_8P2
+
+  scripts/plot_summary.1plot_summarymdoc@1.103 +2 -2
+    NTP_4_2_8P2
+
+  scripts/plot_summary.html@1.106 +2 -2
+    NTP_4_2_8P2
+
+  scripts/plot_summary.man.in@1.103 +3 -3
+    NTP_4_2_8P2
+
+  scripts/plot_summary.mdoc.in@1.103 +2 -2
+    NTP_4_2_8P2
+
+  scripts/summary-opts@1.53 +2 -2
+    NTP_4_2_8P2
+
+  scripts/summary.1summaryman@1.103 +3 -3
+    NTP_4_2_8P2
+
+  scripts/summary.1summarymdoc@1.103 +2 -2
+    NTP_4_2_8P2
+
+  scripts/summary.html@1.106 +2 -2
+    NTP_4_2_8P2
+
+  scripts/summary.man.in@1.103 +3 -3
+    NTP_4_2_8P2
+
+  scripts/summary.mdoc.in@1.103 +2 -2
+    NTP_4_2_8P2
+
+  scripts/update-leap/invoke-update-leap.texi@1.4 +1 -1
+    NTP_4_2_8P2
+
+  scripts/update-leap/update-leap-opts@1.4 +2 -2
+    NTP_4_2_8P2
+
+  scripts/update-leap/update-leap.1update-leapman@1.4 +3 -3
+    NTP_4_2_8P2
+
+  scripts/update-leap/update-leap.1update-leapmdoc@1.4 +2 -2
+    NTP_4_2_8P2
+
+  scripts/update-leap/update-leap.html@1.4 +1 -1
+    NTP_4_2_8P2
+
+  scripts/update-leap/update-leap.man.in@1.4 +3 -3
+    NTP_4_2_8P2
+
+  scripts/update-leap/update-leap.mdoc.in@1.4 +2 -2
+    NTP_4_2_8P2
+
+  sntp/invoke-sntp.texi@1.492 +2 -2
+    NTP_4_2_8P2
+
+  sntp/sntp-opts.c@1.511 +159 -159
+    NTP_4_2_8P2
+
+  sntp/sntp-opts.h@1.509 +3 -3
+    NTP_4_2_8P2
+
+  sntp/sntp.1sntpman@1.327 +3 -3
+    NTP_4_2_8P2
+
+  sntp/sntp.1sntpmdoc@1.327 +2 -2
+    NTP_4_2_8P2
+
+  sntp/sntp.html@1.507 +2 -2
+    NTP_4_2_8P2
+
+  sntp/sntp.man.in@1.327 +3 -3
+    NTP_4_2_8P2
+
+  sntp/sntp.mdoc.in@1.327 +2 -2
+    NTP_4_2_8P2
+
+  util/invoke-ntp-keygen.texi@1.495 +2 -2
+    NTP_4_2_8P2
+
+  util/ntp-keygen-opts.c@1.513 +173 -173
+    NTP_4_2_8P2
+
+  util/ntp-keygen-opts.h@1.511 +3 -3
+    NTP_4_2_8P2
+
+  util/ntp-keygen.1ntp-keygenman@1.323 +3 -3
+    NTP_4_2_8P2
+
+  util/ntp-keygen.1ntp-keygenmdoc@1.323 +2 -2
+    NTP_4_2_8P2
+
+  util/ntp-keygen.html@1.169 +2 -2
+    NTP_4_2_8P2
+
+  util/ntp-keygen.man.in@1.323 +3 -3
+    NTP_4_2_8P2
+
+  util/ntp-keygen.mdoc.in@1.323 +2 -2
+    NTP_4_2_8P2
+
+ChangeSet@1.3319, 2015-04-07 04:05:46-04:00, stenn@deacon.udel.edu
+  ntp-4.2.8p2
+
+  packageinfo.sh@1.508 +2 -2
+    ntp-4.2.8p2
+
+ChangeSet@1.3318, 2015-04-07 07:57:32+00:00, stenn@psp-fb1.ntp.org
+  NEWS update
+
+  NEWS@1.135 +4 -2
+    NEWS update
+
+ChangeSet@1.3314.1.3, 2015-04-03 03:56:38-04:00, stenn@deacon.udel.edu
+  NTP_4_2_8P2_RC3
+  TAG: NTP_4_2_8P2_RC3
+
+  ChangeLog@1.1629.1.3 +1 -0
+    NTP_4_2_8P2_RC3
+
+  ntpd/invoke-ntp.conf.texi@1.181 +1 -1
+    NTP_4_2_8P2_RC3
+
+  ntpd/invoke-ntp.keys.texi@1.177 +1 -1
+    NTP_4_2_8P2_RC3
+
+  ntpd/invoke-ntpd.texi@1.494 +2 -2
+    NTP_4_2_8P2_RC3
+
+  ntpd/ntp.conf.5man@1.215 +3 -3
+    NTP_4_2_8P2_RC3
+
+  ntpd/ntp.conf.5mdoc@1.215 +1 -1
+    NTP_4_2_8P2_RC3
+
+  ntpd/ntp.conf.html@1.172 +1 -1
+    NTP_4_2_8P2_RC3
+
+  ntpd/ntp.conf.man.in@1.215 +3 -3
+    NTP_4_2_8P2_RC3
+
+  ntpd/ntp.conf.mdoc.in@1.215 +1 -1
+    NTP_4_2_8P2_RC3
+
+  ntpd/ntp.keys.5man@1.211 +2 -2
+    NTP_4_2_8P2_RC3
+
+  ntpd/ntp.keys.5mdoc@1.211 +1 -1
+    NTP_4_2_8P2_RC3
+
+  ntpd/ntp.keys.html@1.173 +1 -1
+    NTP_4_2_8P2_RC3
+
+  ntpd/ntp.keys.man.in@1.211 +2 -2
+    NTP_4_2_8P2_RC3
+
+  ntpd/ntp.keys.mdoc.in@1.211 +1 -1
+    NTP_4_2_8P2_RC3
+
+  ntpd/ntpd-opts.c@1.516 +7 -7
+    NTP_4_2_8P2_RC3
+
+  ntpd/ntpd-opts.h@1.515 +3 -3
+    NTP_4_2_8P2_RC3
+
+  ntpd/ntpd.1ntpdman@1.323 +3 -3
+    NTP_4_2_8P2_RC3
+
+  ntpd/ntpd.1ntpdmdoc@1.323 +1 -1
+    NTP_4_2_8P2_RC3
+
+  ntpd/ntpd.html@1.167 +2 -2
+    NTP_4_2_8P2_RC3
+
+  ntpd/ntpd.man.in@1.323 +3 -3
+    NTP_4_2_8P2_RC3
+
+  ntpd/ntpd.mdoc.in@1.323 +1 -1
+    NTP_4_2_8P2_RC3
+
+  ntpdc/invoke-ntpdc.texi@1.491 +2 -2
+    NTP_4_2_8P2_RC3
+
+  ntpdc/ntpdc-opts.c@1.509 +7 -7
+    NTP_4_2_8P2_RC3
+
+  ntpdc/ntpdc-opts.h@1.508 +3 -3
+    NTP_4_2_8P2_RC3
+
+  ntpdc/ntpdc.1ntpdcman@1.322 +3 -3
+    NTP_4_2_8P2_RC3
+
+  ntpdc/ntpdc.1ntpdcmdoc@1.322 +1 -1
+    NTP_4_2_8P2_RC3
+
+  ntpdc/ntpdc.html@1.335 +2 -2
+    NTP_4_2_8P2_RC3
+
+  ntpdc/ntpdc.man.in@1.322 +3 -3
+    NTP_4_2_8P2_RC3
+
+  ntpdc/ntpdc.mdoc.in@1.322 +1 -1
+    NTP_4_2_8P2_RC3
+
+  ntpq/invoke-ntpq.texi@1.497 +2 -2
+    NTP_4_2_8P2_RC3
+
+  ntpq/ntpq-opts.c@1.514 +7 -7
+    NTP_4_2_8P2_RC3
+
+  ntpq/ntpq-opts.h@1.512 +3 -3
+    NTP_4_2_8P2_RC3
+
+  ntpq/ntpq.1ntpqman@1.325 +3 -3
+    NTP_4_2_8P2_RC3
+
+  ntpq/ntpq.1ntpqmdoc@1.325 +1 -1
+    NTP_4_2_8P2_RC3
+
+  ntpq/ntpq.html@1.164 +2 -2
+    NTP_4_2_8P2_RC3
+
+  ntpq/ntpq.man.in@1.325 +3 -3
+    NTP_4_2_8P2_RC3
+
+  ntpq/ntpq.mdoc.in@1.325 +1 -1
+    NTP_4_2_8P2_RC3
+
+  ntpsnmpd/invoke-ntpsnmpd.texi@1.493 +2 -2
+    NTP_4_2_8P2_RC3
+
+  ntpsnmpd/ntpsnmpd-opts.c@1.511 +7 -7
+    NTP_4_2_8P2_RC3
+
+  ntpsnmpd/ntpsnmpd-opts.h@1.510 +3 -3
+    NTP_4_2_8P2_RC3
+
+  ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.322 +3 -3
+    NTP_4_2_8P2_RC3
+
+  ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.322 +1 -1
+    NTP_4_2_8P2_RC3
+
+  ntpsnmpd/ntpsnmpd.html@1.162 +1 -1
+    NTP_4_2_8P2_RC3
+
+  ntpsnmpd/ntpsnmpd.man.in@1.322 +3 -3
+    NTP_4_2_8P2_RC3
+
+  ntpsnmpd/ntpsnmpd.mdoc.in@1.322 +1 -1
+    NTP_4_2_8P2_RC3
+
+  packageinfo.sh@1.507 +1 -1
+    NTP_4_2_8P2_RC3
+
+  scripts/calc_tickadj/calc_tickadj.1calc_tickadjman@1.83 +3 -3
+    NTP_4_2_8P2_RC3
+
+  scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc@1.84 +1 -1
+    NTP_4_2_8P2_RC3
+
+  scripts/calc_tickadj/calc_tickadj.html@1.85 +1 -1
+    NTP_4_2_8P2_RC3
+
+  scripts/calc_tickadj/calc_tickadj.man.in@1.82 +3 -3
+    NTP_4_2_8P2_RC3
+
+  scripts/calc_tickadj/calc_tickadj.mdoc.in@1.84 +1 -1
+    NTP_4_2_8P2_RC3
+
+  scripts/calc_tickadj/invoke-calc_tickadj.texi@1.87 +1 -1
+    NTP_4_2_8P2_RC3
+
+  scripts/invoke-plot_summary.texi@1.104 +2 -2
+    NTP_4_2_8P2_RC3
+
+  scripts/invoke-summary.texi@1.104 +2 -2
+    NTP_4_2_8P2_RC3
+
+  scripts/ntp-wait/invoke-ntp-wait.texi@1.314 +2 -2
+    NTP_4_2_8P2_RC3
+
+  scripts/ntp-wait/ntp-wait-opts@1.50 +2 -2
+    NTP_4_2_8P2_RC3
+
+  scripts/ntp-wait/ntp-wait.1ntp-waitman@1.311 +3 -3
+    NTP_4_2_8P2_RC3
+
+  scripts/ntp-wait/ntp-wait.1ntp-waitmdoc@1.312 +1 -1
+    NTP_4_2_8P2_RC3
+
+  scripts/ntp-wait/ntp-wait.html@1.331 +2 -2
+    NTP_4_2_8P2_RC3
+
+  scripts/ntp-wait/ntp-wait.man.in@1.311 +3 -3
+    NTP_4_2_8P2_RC3
+
+  scripts/ntp-wait/ntp-wait.mdoc.in@1.312 +1 -1
+    NTP_4_2_8P2_RC3
+
+  scripts/ntpsweep/invoke-ntpsweep.texi@1.102 +2 -2
+    NTP_4_2_8P2_RC3
+
+  scripts/ntpsweep/ntpsweep-opts@1.52 +2 -2
+    NTP_4_2_8P2_RC3
+
+  scripts/ntpsweep/ntpsweep.1ntpsweepman@1.90 +3 -3
+    NTP_4_2_8P2_RC3
+
+  scripts/ntpsweep/ntpsweep.1ntpsweepmdoc@1.90 +1 -1
+    NTP_4_2_8P2_RC3
+
+  scripts/ntpsweep/ntpsweep.html@1.103 +2 -2
+    NTP_4_2_8P2_RC3
+
+  scripts/ntpsweep/ntpsweep.man.in@1.90 +3 -3
+    NTP_4_2_8P2_RC3
+
+  scripts/ntpsweep/ntpsweep.mdoc.in@1.91 +1 -1
+    NTP_4_2_8P2_RC3
+
+  scripts/ntptrace/invoke-ntptrace.texi@1.103 +2 -2
+    NTP_4_2_8P2_RC3
+
+  scripts/ntptrace/ntptrace-opts@1.52 +2 -2
+    NTP_4_2_8P2_RC3
+
+  scripts/ntptrace/ntptrace.1ntptraceman@1.90 +3 -3
+    NTP_4_2_8P2_RC3
+
+  scripts/ntptrace/ntptrace.1ntptracemdoc@1.91 +1 -1
+    NTP_4_2_8P2_RC3
+
+  scripts/ntptrace/ntptrace.html@1.104 +2 -2
+    NTP_4_2_8P2_RC3
+
+  scripts/ntptrace/ntptrace.man.in@1.90 +3 -3
+    NTP_4_2_8P2_RC3
+
+  scripts/ntptrace/ntptrace.mdoc.in@1.92 +1 -1
+    NTP_4_2_8P2_RC3
+
+  scripts/plot_summary-opts@1.52 +2 -2
+    NTP_4_2_8P2_RC3
+
+  scripts/plot_summary.1plot_summaryman@1.102 +3 -3
+    NTP_4_2_8P2_RC3
+
+  scripts/plot_summary.1plot_summarymdoc@1.102 +1 -1
+    NTP_4_2_8P2_RC3
+
+  scripts/plot_summary.html@1.105 +2 -2
+    NTP_4_2_8P2_RC3
+
+  scripts/plot_summary.man.in@1.102 +3 -3
+    NTP_4_2_8P2_RC3
+
+  scripts/plot_summary.mdoc.in@1.102 +1 -1
+    NTP_4_2_8P2_RC3
+
+  scripts/summary-opts@1.52 +2 -2
+    NTP_4_2_8P2_RC3
+
+  scripts/summary.1summaryman@1.102 +3 -3
+    NTP_4_2_8P2_RC3
+
+  scripts/summary.1summarymdoc@1.102 +1 -1
+    NTP_4_2_8P2_RC3
+
+  scripts/summary.html@1.105 +2 -2
+    NTP_4_2_8P2_RC3
+
+  scripts/summary.man.in@1.102 +3 -3
+    NTP_4_2_8P2_RC3
+
+  scripts/summary.mdoc.in@1.102 +1 -1
+    NTP_4_2_8P2_RC3
+
+  scripts/update-leap/invoke-update-leap.texi@1.3 +1 -1
+    NTP_4_2_8P2_RC3
+
+  scripts/update-leap/update-leap-opts@1.3 +2 -2
+    NTP_4_2_8P2_RC3
+
+  scripts/update-leap/update-leap.1update-leapman@1.3 +3 -3
+    NTP_4_2_8P2_RC3
+
+  scripts/update-leap/update-leap.1update-leapmdoc@1.3 +1 -1
+    NTP_4_2_8P2_RC3
+
+  scripts/update-leap/update-leap.html@1.3 +6 -5
+    NTP_4_2_8P2_RC3
+
+  scripts/update-leap/update-leap.man.in@1.3 +3 -3
+    NTP_4_2_8P2_RC3
+
+  scripts/update-leap/update-leap.mdoc.in@1.3 +1 -1
+    NTP_4_2_8P2_RC3
+
+  sntp/invoke-sntp.texi@1.491 +2 -2
+    NTP_4_2_8P2_RC3
+
+  sntp/sntp-opts.c@1.510 +7 -7
+    NTP_4_2_8P2_RC3
+
+  sntp/sntp-opts.h@1.508 +3 -3
+    NTP_4_2_8P2_RC3
+
+  sntp/sntp.1sntpman@1.326 +3 -3
+    NTP_4_2_8P2_RC3
+
+  sntp/sntp.1sntpmdoc@1.326 +1 -1
+    NTP_4_2_8P2_RC3
+
+  sntp/sntp.html@1.506 +2 -2
+    NTP_4_2_8P2_RC3
+
+  sntp/sntp.man.in@1.326 +3 -3
+    NTP_4_2_8P2_RC3
+
+  sntp/sntp.mdoc.in@1.326 +1 -1
+    NTP_4_2_8P2_RC3
+
+  util/invoke-ntp-keygen.texi@1.494 +2 -2
+    NTP_4_2_8P2_RC3
+
+  util/ntp-keygen-opts.c@1.512 +7 -7
+    NTP_4_2_8P2_RC3
+
+  util/ntp-keygen-opts.h@1.510 +3 -3
+    NTP_4_2_8P2_RC3
+
+  util/ntp-keygen.1ntp-keygenman@1.322 +3 -3
+    NTP_4_2_8P2_RC3
+
+  util/ntp-keygen.1ntp-keygenmdoc@1.322 +1 -1
+    NTP_4_2_8P2_RC3
+
+  util/ntp-keygen.html@1.168 +2 -2
+    NTP_4_2_8P2_RC3
+
+  util/ntp-keygen.man.in@1.322 +3 -3
+    NTP_4_2_8P2_RC3
+
+  util/ntp-keygen.mdoc.in@1.322 +1 -1
+    NTP_4_2_8P2_RC3
+
+ChangeSet@1.3314.1.2, 2015-04-03 03:35:54-04:00, stenn@deacon.udel.edu
+  [Bug 2763] Fix for different thresholds for forward and backward steps
+
+  ChangeLog@1.1629.1.2 +3 -0
+    [Bug 2763] Fix for different thresholds for forward and backward steps
+
+  ntpd/ntp_loopfilter.c@1.183 +2 -2
+    [Bug 2763] Fix for different thresholds for forward and backward steps
+
+ChangeSet@1.3314.1.1, 2015-04-03 01:16:34-04:00, stenn@deacon.udel.edu
+  NTP_4_2_8P2_RC2
+  TAG: NTP_4_2_8P2_RC2
+
+  ChangeLog@1.1629.1.1 +1 -0
+    NTP_4_2_8P2_RC2
+
+  ntpd/invoke-ntp.conf.texi@1.180 +1 -1
+    NTP_4_2_8P2_RC2
+
+  ntpd/invoke-ntp.keys.texi@1.176 +1 -1
+    NTP_4_2_8P2_RC2
+
+  ntpd/invoke-ntpd.texi@1.493 +2 -2
+    NTP_4_2_8P2_RC2
+
+  ntpd/ntp.conf.5man@1.214 +3 -3
+    NTP_4_2_8P2_RC2
+
+  ntpd/ntp.conf.5mdoc@1.214 +2 -2
+    NTP_4_2_8P2_RC2
+
+  ntpd/ntp.conf.html@1.171 +1 -1
+    NTP_4_2_8P2_RC2
+
+  ntpd/ntp.conf.man.in@1.214 +3 -3
+    NTP_4_2_8P2_RC2
+
+  ntpd/ntp.conf.mdoc.in@1.214 +2 -2
+    NTP_4_2_8P2_RC2
+
+  ntpd/ntp.keys.5man@1.210 +2 -2
+    NTP_4_2_8P2_RC2
+
+  ntpd/ntp.keys.5mdoc@1.210 +2 -2
+    NTP_4_2_8P2_RC2
+
+  ntpd/ntp.keys.html@1.172 +1 -1
+    NTP_4_2_8P2_RC2
+
+  ntpd/ntp.keys.man.in@1.210 +2 -2
+    NTP_4_2_8P2_RC2
+
+  ntpd/ntp.keys.mdoc.in@1.210 +2 -2
+    NTP_4_2_8P2_RC2
+
+  ntpd/ntpd-opts.c@1.515 +7 -7
+    NTP_4_2_8P2_RC2
+
+  ntpd/ntpd-opts.h@1.514 +3 -3
+    NTP_4_2_8P2_RC2
+
+  ntpd/ntpd.1ntpdman@1.322 +3 -3
+    NTP_4_2_8P2_RC2
+
+  ntpd/ntpd.1ntpdmdoc@1.322 +2 -2
+    NTP_4_2_8P2_RC2
+
+  ntpd/ntpd.html@1.166 +50 -26
+    NTP_4_2_8P2_RC2
+
+  ntpd/ntpd.man.in@1.322 +3 -3
+    NTP_4_2_8P2_RC2
+
+  ntpd/ntpd.mdoc.in@1.322 +2 -2
+    NTP_4_2_8P2_RC2
+
+  ntpdc/invoke-ntpdc.texi@1.490 +2 -2
+    NTP_4_2_8P2_RC2
+
+  ntpdc/ntpdc-opts.c@1.508 +7 -7
+    NTP_4_2_8P2_RC2
+
+  ntpdc/ntpdc-opts.h@1.507 +3 -3
+    NTP_4_2_8P2_RC2
+
+  ntpdc/ntpdc.1ntpdcman@1.321 +3 -3
+    NTP_4_2_8P2_RC2
+
+  ntpdc/ntpdc.1ntpdcmdoc@1.321 +2 -2
+    NTP_4_2_8P2_RC2
+
+  ntpdc/ntpdc.html@1.334 +2 -2
+    NTP_4_2_8P2_RC2
+
+  ntpdc/ntpdc.man.in@1.321 +3 -3
+    NTP_4_2_8P2_RC2
+
+  ntpdc/ntpdc.mdoc.in@1.321 +2 -2
+    NTP_4_2_8P2_RC2
+
+  ntpq/invoke-ntpq.texi@1.496 +2 -2
+    NTP_4_2_8P2_RC2
+
+  ntpq/ntpq-opts.c@1.513 +7 -7
+    NTP_4_2_8P2_RC2
+
+  ntpq/ntpq-opts.h@1.511 +3 -3
+    NTP_4_2_8P2_RC2
+
+  ntpq/ntpq.1ntpqman@1.324 +3 -3
+    NTP_4_2_8P2_RC2
+
+  ntpq/ntpq.1ntpqmdoc@1.324 +2 -2
+    NTP_4_2_8P2_RC2
+
+  ntpq/ntpq.html@1.163 +2 -2
+    NTP_4_2_8P2_RC2
+
+  ntpq/ntpq.man.in@1.324 +3 -3
+    NTP_4_2_8P2_RC2
+
+  ntpq/ntpq.mdoc.in@1.324 +2 -2
+    NTP_4_2_8P2_RC2
+
+  ntpsnmpd/invoke-ntpsnmpd.texi@1.492 +2 -2
+    NTP_4_2_8P2_RC2
+
+  ntpsnmpd/ntpsnmpd-opts.c@1.510 +7 -7
+    NTP_4_2_8P2_RC2
+
+  ntpsnmpd/ntpsnmpd-opts.h@1.509 +3 -3
+    NTP_4_2_8P2_RC2
+
+  ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.321 +3 -3
+    NTP_4_2_8P2_RC2
+
+  ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.321 +2 -2
+    NTP_4_2_8P2_RC2
+
+  ntpsnmpd/ntpsnmpd.html@1.161 +1 -1
+    NTP_4_2_8P2_RC2
+
+  ntpsnmpd/ntpsnmpd.man.in@1.321 +3 -3
+    NTP_4_2_8P2_RC2
+
+  ntpsnmpd/ntpsnmpd.mdoc.in@1.321 +2 -2
+    NTP_4_2_8P2_RC2
+
+  packageinfo.sh@1.506 +1 -1
+    NTP_4_2_8P2_RC2
+
+  scripts/calc_tickadj/calc_tickadj.1calc_tickadjman@1.82 +3 -3
+    NTP_4_2_8P2_RC2
+
+  scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc@1.83 +2 -2
+    NTP_4_2_8P2_RC2
+
+  scripts/calc_tickadj/calc_tickadj.html@1.84 +1 -1
+    NTP_4_2_8P2_RC2
+
+  scripts/calc_tickadj/calc_tickadj.man.in@1.81 +3 -3
+    NTP_4_2_8P2_RC2
+
+  scripts/calc_tickadj/calc_tickadj.mdoc.in@1.83 +2 -2
+    NTP_4_2_8P2_RC2
+
+  scripts/calc_tickadj/invoke-calc_tickadj.texi@1.86 +1 -1
+    NTP_4_2_8P2_RC2
+
+  scripts/invoke-plot_summary.texi@1.103 +2 -2
+    NTP_4_2_8P2_RC2
+
+  scripts/invoke-summary.texi@1.103 +2 -2
+    NTP_4_2_8P2_RC2
+
+  scripts/ntp-wait/invoke-ntp-wait.texi@1.313 +2 -2
+    NTP_4_2_8P2_RC2
+
+  scripts/ntp-wait/ntp-wait-opts@1.49 +2 -2
+    NTP_4_2_8P2_RC2
+
+  scripts/ntp-wait/ntp-wait.1ntp-waitman@1.310 +3 -3
+    NTP_4_2_8P2_RC2
+
+  scripts/ntp-wait/ntp-wait.1ntp-waitmdoc@1.311 +2 -2
+    NTP_4_2_8P2_RC2
+
+  scripts/ntp-wait/ntp-wait.html@1.330 +2 -2
+    NTP_4_2_8P2_RC2
+
+  scripts/ntp-wait/ntp-wait.man.in@1.310 +3 -3
+    NTP_4_2_8P2_RC2
+
+  scripts/ntp-wait/ntp-wait.mdoc.in@1.311 +2 -2
+    NTP_4_2_8P2_RC2
+
+  scripts/ntpsweep/invoke-ntpsweep.texi@1.101 +2 -2
+    NTP_4_2_8P2_RC2
+
+  scripts/ntpsweep/ntpsweep-opts@1.51 +2 -2
+    NTP_4_2_8P2_RC2
+
+  scripts/ntpsweep/ntpsweep.1ntpsweepman@1.89 +3 -3
+    NTP_4_2_8P2_RC2
+
+  scripts/ntpsweep/ntpsweep.1ntpsweepmdoc@1.89 +2 -2
+    NTP_4_2_8P2_RC2
+
+  scripts/ntpsweep/ntpsweep.html@1.102 +2 -2
+    NTP_4_2_8P2_RC2
+
+  scripts/ntpsweep/ntpsweep.man.in@1.89 +3 -3
+    NTP_4_2_8P2_RC2
+
+  scripts/ntpsweep/ntpsweep.mdoc.in@1.90 +2 -2
+    NTP_4_2_8P2_RC2
+
+  scripts/ntptrace/invoke-ntptrace.texi@1.102 +2 -2
+    NTP_4_2_8P2_RC2
+
+  scripts/ntptrace/ntptrace-opts@1.51 +2 -2
+    NTP_4_2_8P2_RC2
+
+  scripts/ntptrace/ntptrace.1ntptraceman@1.89 +3 -3
+    NTP_4_2_8P2_RC2
+
+  scripts/ntptrace/ntptrace.1ntptracemdoc@1.90 +2 -2
+    NTP_4_2_8P2_RC2
+
+  scripts/ntptrace/ntptrace.html@1.103 +2 -2
+    NTP_4_2_8P2_RC2
+
+  scripts/ntptrace/ntptrace.man.in@1.89 +3 -3
+    NTP_4_2_8P2_RC2
+
+  scripts/ntptrace/ntptrace.mdoc.in@1.91 +2 -2
+    NTP_4_2_8P2_RC2
+
+  scripts/plot_summary-opts@1.51 +2 -2
+    NTP_4_2_8P2_RC2
+
+  scripts/plot_summary.1plot_summaryman@1.101 +3 -3
+    NTP_4_2_8P2_RC2
+
+  scripts/plot_summary.1plot_summarymdoc@1.101 +2 -2
+    NTP_4_2_8P2_RC2
+
+  scripts/plot_summary.html@1.104 +2 -2
+    NTP_4_2_8P2_RC2
+
+  scripts/plot_summary.man.in@1.101 +3 -3
+    NTP_4_2_8P2_RC2
+
+  scripts/plot_summary.mdoc.in@1.101 +2 -2
+    NTP_4_2_8P2_RC2
+
+  scripts/summary-opts@1.51 +2 -2
+    NTP_4_2_8P2_RC2
+
+  scripts/summary.1summaryman@1.101 +3 -3
+    NTP_4_2_8P2_RC2
+
+  scripts/summary.1summarymdoc@1.101 +2 -2
+    NTP_4_2_8P2_RC2
+
+  scripts/summary.html@1.104 +2 -2
+    NTP_4_2_8P2_RC2
+
+  scripts/summary.man.in@1.101 +3 -3
+    NTP_4_2_8P2_RC2
+
+  scripts/summary.mdoc.in@1.101 +2 -2
+    NTP_4_2_8P2_RC2
+
+  scripts/update-leap/invoke-update-leap.texi@1.2 +6 -5
+    NTP_4_2_8P2_RC2
+
+  scripts/update-leap/update-leap-opts@1.2 +2 -2
+    NTP_4_2_8P2_RC2
+
+  scripts/update-leap/update-leap.1update-leapman@1.2 +7 -6
+    NTP_4_2_8P2_RC2
+
+  scripts/update-leap/update-leap.1update-leapmdoc@1.2 +6 -5
+    NTP_4_2_8P2_RC2
+
+  scripts/update-leap/update-leap.html@1.2 +48 -72
+    NTP_4_2_8P2_RC2
+
+  scripts/update-leap/update-leap.man.in@1.2 +7 -6
+    NTP_4_2_8P2_RC2
+
+  scripts/update-leap/update-leap.mdoc.in@1.2 +6 -5
+    NTP_4_2_8P2_RC2
+
+  sntp/invoke-sntp.texi@1.490 +2 -2
+    NTP_4_2_8P2_RC2
+
+  sntp/sntp-opts.c@1.509 +7 -7
+    NTP_4_2_8P2_RC2
+
+  sntp/sntp-opts.h@1.507 +3 -3
+    NTP_4_2_8P2_RC2
+
+  sntp/sntp.1sntpman@1.325 +3 -3
+    NTP_4_2_8P2_RC2
+
+  sntp/sntp.1sntpmdoc@1.325 +2 -2
+    NTP_4_2_8P2_RC2
+
+  sntp/sntp.html@1.505 +111 -135
+    NTP_4_2_8P2_RC2
+
+  sntp/sntp.man.in@1.325 +3 -3
+    NTP_4_2_8P2_RC2
+
+  sntp/sntp.mdoc.in@1.325 +2 -2
+    NTP_4_2_8P2_RC2
+
+  util/invoke-ntp-keygen.texi@1.493 +2 -2
+    NTP_4_2_8P2_RC2
+
+  util/ntp-keygen-opts.c@1.511 +7 -7
+    NTP_4_2_8P2_RC2
+
+  util/ntp-keygen-opts.h@1.509 +3 -3
+    NTP_4_2_8P2_RC2
+
+  util/ntp-keygen.1ntp-keygenman@1.321 +3 -3
+    NTP_4_2_8P2_RC2
+
+  util/ntp-keygen.1ntp-keygenmdoc@1.321 +2 -2
+    NTP_4_2_8P2_RC2
+
+  util/ntp-keygen.html@1.167 +2 -2
+    NTP_4_2_8P2_RC2
+
+  util/ntp-keygen.man.in@1.321 +3 -3
+    NTP_4_2_8P2_RC2
+
+  util/ntp-keygen.mdoc.in@1.321 +2 -2
+    NTP_4_2_8P2_RC2
+
+ChangeSet@1.3314, 2015-04-03 02:36:18+00:00, stenn@psp-fb1.ntp.org
+  merge cleanup
+
+  NEWS@1.133 +6 -5
+    merge cleanup
+
+ChangeSet@1.3313, 2015-04-03 02:31:18+00:00, stenn@psp-fb1.ntp.org
+  merge cleanup
+
+  ChangeLog@1.1629 +3 -3
+    merge cleanup
+
+ChangeSet@1.3308.2.11, 2015-04-02 21:42:37+00:00, stenn@psp-deb1.ntp.org
+  [Bug 2592] FLAG_TSTAMP_PPS cleanup for refclock_parse.c
+
+  ChangeLog@1.1625.2.9 +1 -0
+    [Bug 2592] FLAG_TSTAMP_PPS cleanup for refclock_parse.c
+
+ChangeSet@1.3308.2.10, 2015-04-02 20:17:55+00:00, stenn@psp-deb1.ntp.org
+  merge cleanup
+
+  ChangeLog@1.1625.2.8 +1 -3
+    merge cleanup
+
+ChangeSet@1.3308.2.9, 2015-04-02 21:41:22+02:00, jnperlin@nemesis.localnet
+  [Bug 2795] Cannot build without OpenSLL (on Win32).
+    fixed minor warning
+
+  ChangeLog@1.1625.2.7 +3 -0
+    [Bug 2795] Cannot build without OpenSLL (on Win32).
+      fixed minor warning
+
+  include/ntp_md5.h@1.10 +1 -1
+    [Bug 2795] Cannot build without OpenSLL (on Win32).
+      OpenSSL declares EVP_md5() as function without arguments; surrogate should do the same.
+
+ChangeSet@1.3308.6.2, 2015-04-02 07:45:04+00:00, stenn@psp-deb1.ntp.org
+  cleanup
+
+  ChangeLog@1.1625.6.3 +0 -2
+    cleanup
+
+  ChangeLog@1.1625.6.2 +6 -0
+
+  ntpd/invoke-ntpd.texi@1.492 +20 -3
+    [Bug 2788] New -G flag (force step once) cleanup.
+
+  ntpd/ntp_loopfilter.c@1.182 +17 -6
+    [Bug 2794] Clean up kernel clock status reports.
+    Trailing whitespace cleanup.
+
+  ntpd/ntpd-opts.c@1.514 +249 -249
+    Autogenerated file.
+
+  ntpd/ntpd-opts.h@1.513 +3 -3
+    Autogenerated file.
+
+  ntpd/ntpd.1ntpdman@1.321 +19 -5
+    Autogenerated file.
+
+  ntpd/ntpd.1ntpdmdoc@1.321 +17 -4
+    Autogenerated file.
+
+  ntpd/ntpd.man.in@1.321 +19 -5
+    Autogenerated file.
+
+  ntpd/ntpd.mdoc.in@1.321 +17 -4
+    Autogenerated file.
+
+  ntpd/ntpdbase-opts.def@1.29 +9 -6
+    [Bug 2788] New flag -G (force_step_once) - documentation cleanup.
+
+ChangeSet@1.3308.2.7, 2015-04-02 07:34:40+00:00, stenn@psp-deb1.ntp.org
+  Simple cleanup to html/build.html
+
+  ChangeLog@1.1625.2.5 +1 -0
+    Simple cleanup to html/build.html
+
+  html/build.html@1.28 +2 -2
+    Simple cleanup to html/build.html
+
+ChangeSet@1.3308.2.6, 2015-04-02 03:15:42+00:00, stenn@psp-fb1.ntp.org
+  typos
+
+  ChangeLog@1.1625.2.4 +4 -4
+    typos
+
+ChangeSet@1.3308.5.2, 2015-04-01 11:08:14+00:00, stenn@psp-deb1.ntp.org
+  [Bug 2798] sntp should decode and display the leap indicator
+
+  html/sntp.html@1.12 +3 -3
+    [Bug 2798] sntp should decode and display the leap indicator
+
+  sntp/invoke-sntp.texi@1.489 +4 -3
+    [Bug 2798] sntp should decode and display the leap indicator
+
+  sntp/sntp-opts.c@1.508 +1 -1
+    [Bug 2798] sntp should decode and display the leap indicator
+
+  sntp/sntp-opts.def@1.47 +2 -1
+    [Bug 2798] sntp should decode and display the leap indicator
+
+  sntp/sntp-opts.h@1.506 +1 -1
+    [Bug 2798] sntp should decode and display the leap indicator
+
+  sntp/sntp.1sntpman@1.324 +5 -4
+    [Bug 2798] sntp should decode and display the leap indicator
+
+  sntp/sntp.1sntpmdoc@1.324 +4 -3
+    [Bug 2798] sntp should decode and display the leap indicator
+
+  sntp/sntp.html@1.504 +136 -111
+    [Bug 2798] sntp should decode and display the leap indicator
+
+  sntp/sntp.man.in@1.324 +5 -4
+    [Bug 2798] sntp should decode and display the leap indicator
+
+  sntp/sntp.mdoc.in@1.324 +4 -3
+    [Bug 2798] sntp should decode and display the leap indicator
+
+ChangeSet@1.3308.5.1, 2015-04-01 10:44:24+00:00, stenn@psp-fb1.ntp.org
+  [Bug 2798] sntp should decode and display the leap indicator
+
+  ChangeLog@1.1625.5.1 +3 -0
+    [Bug 2798] sntp should decode and display the leap indicator
+
+  sntp/main.c@1.95 +21 -1
+    [Bug 2798] sntp should decode and display the leap indicator
+
+ChangeSet@1.3308.4.1, 2015-03-30 20:14:46+02:00, jnperlin@hydra.(none)
+  [Bug 2797] ntp-keygen trapped in endless loop for MD5 keys on big-endian machines
+
+  ChangeLog@1.1625.4.1 +3 -0
+    [Bug 2797] ntp-keygen trapped in endless loop for MD5 keys on big-endian machines
+
+  util/ntp-keygen.c@1.104 +4 -4
+    [Bug 2797] ntp-keygen trapped in endless loop for MD5 keys on big-endian machines
+
+ChangeSet@1.3308.3.1, 2015-03-30 19:39:17+02:00, jnperlin@nemesis.localnet
+  [Bug 2796] ntp-keygen crashes in 'getclock()' on Win32
+
+  ChangeLog@1.1625.3.1 +2 -0
+    [Bug 2796] ntp-keygen crashes in 'getclock()' on Win32
+
+  ports/winnt/libntp/getclock.c@1.5 +2 -0
+    [Bug 2796] ntp-keygen crashes in 'getclock()' on Win32
+      make sure 'init_win_precise_time()' gets called
+
+ChangeSet@1.3308.2.4, 2015-03-30 19:10:12+02:00, jnperlin@nemesis.localnet
+  [Bug 2795] Cannot build without OpenSLL (on Win32)
+   Provided a Win32 specific wrapper around libevent/arc4random.c
+
+  ChangeLog@1.1625.2.2 +3 -0
+    [Bug 2795] Cannot build without OpenSLL (on Win32)
+     Provided a Win32 specific wrapper around libevent/arc4random.c
+
+  ports/winnt/libntp/arc4wrap.c@1.1 +84 -0
+    [Bug 2795] Cannot build without OpenSLL (on Win32)
+     Provided a Win32 specific wrapper around libevent/arc4random.c
+
+  ports/winnt/libntp/arc4wrap.c@1.0 +0 -0
+
+  ports/winnt/vs2005/libntp.vcproj@1.24 +4 -0
+    [Bug 2795] Cannot build without OpenSLL (on Win32)
+     Provided a Win32 specific wrapper around libevent/arc4random.c
+
+  ports/winnt/vs2008/libntp/libntp.vcproj@1.52 +6 -2
+    [Bug 2795] Cannot build without OpenSLL (on Win32)
+     Provided a Win32 specific wrapper around libevent/arc4random.c
+
+  ports/winnt/vs2013/libntp/libntp.vcxproj@1.6 +1 -0
+    [Bug 2795] Cannot build without OpenSLL (on Win32)
+     Provided a Win32 specific wrapper around libevent/arc4random.c
+
+  ports/winnt/vs2013/libntp/libntp.vcxproj.filters@1.4 +6 -0
+    [Bug 2795] Cannot build without OpenSLL (on Win32)
+     Provided a Win32 specific wrapper around libevent/arc4random.c
+
+ChangeSet@1.3305.3.8, 2015-03-30 15:55:43+02:00, martin@pc-martin.(none)
+  [Bug 2794] Don't let reports on normal kernel status changes look like errors.
+
+  ChangeLog@1.1622.3.8 +2 -0
+    [Bug 2794] Don't let reports on normal kernel status changes look like errors.
+
+  ntpd/ntp_loopfilter.c@1.181 +30 -19
+    [Bug 2794] Don't let reports on normal kernel status changes look like errors.
+
+ChangeSet@1.3305.3.7, 2015-03-30 11:23:48+02:00, martin@pc-martin.(none)
+  [Bug 2788] New flag -G (force_step_once)
+
+  ChangeLog@1.1622.3.7 +1 -0
+    [Bug 2788] New flag -G (force_step_once)
+
+  include/ntpd.h@1.185.1.1 +4 -3
+    [Bug 2788] Support new flag -G (force_step_once)
+    Removed trailing whitespace.
+
+  ntpd/cmd_args.c@1.62 +6 -3
+    [Bug 2788] New flag -G (force_step_once)
+    Removed trailing whitespace.
+
+  ntpd/ntp_loopfilter.c@1.180 +21 -15
+    [Bug 2788] New flag -G (force_step_once)
+    Removed trailing whitespace.
+
+  ntpd/ntpd-opts.c@1.511.1.1 +255 -225
+    [Bug 2788] New flag -G (force_step_once)
+
+  ntpd/ntpd-opts.h@1.510.1.1 +36 -29
+    [Bug 2788] New flag -G (force_step_once)
+
+  ntpd/ntpdbase-opts.def@1.28 +17 -2
+    [Bug 2788] New flag -G (force_step_once)
+    Removed trailing whitespace.
+
+ChangeSet@1.3308.1.3, 2015-03-30 09:11:33+00:00, stenn@psp-fb1.ntp.org
+  Start the RC cycle for ntp-4.2.8p2
+
+  NEWS@1.130.1.2 +82 -1
+    Start the RC cycle for ntp-4.2.8p2
+
+ChangeSet@1.3308.2.3, 2015-03-30 04:48:27-04:00, stenn@deacon.udel.edu
+  NTP_4_2_8P2_RC1
+  TAG: NTP_4_2_8P2_RC1
+
+  ChangeLog@1.1625.2.1 +1 -0
+    NTP_4_2_8P2_RC1
+
+  ntpd/invoke-ntp.conf.texi@1.179 +1 -1
+    NTP_4_2_8P2_RC1
+
+  ntpd/invoke-ntp.keys.texi@1.175 +1 -1
+    NTP_4_2_8P2_RC1
+
+  ntpd/invoke-ntpd.texi@1.491 +2 -2
+    NTP_4_2_8P2_RC1
+
+  ntpd/ntp.conf.5man@1.213 +3 -3
+    NTP_4_2_8P2_RC1
+
+  ntpd/ntp.conf.5mdoc@1.213 +2 -2
+    NTP_4_2_8P2_RC1
+
+  ntpd/ntp.conf.html@1.170 +13 -2
+    NTP_4_2_8P2_RC1
+
+  ntpd/ntp.conf.man.in@1.213 +3 -3
+    NTP_4_2_8P2_RC1
+
+  ntpd/ntp.conf.mdoc.in@1.213 +2 -2
+    NTP_4_2_8P2_RC1
+
+  ntpd/ntp.keys.5man@1.209 +2 -2
+    NTP_4_2_8P2_RC1
+
+  ntpd/ntp.keys.5mdoc@1.209 +2 -2
+    NTP_4_2_8P2_RC1
+
+  ntpd/ntp.keys.html@1.171 +1 -1
+    NTP_4_2_8P2_RC1
+
+  ntpd/ntp.keys.man.in@1.209 +2 -2
+    NTP_4_2_8P2_RC1
+
+  ntpd/ntp.keys.mdoc.in@1.209 +2 -2
+    NTP_4_2_8P2_RC1
+
+  ntpd/ntpd-opts.c@1.512 +239 -239
+    NTP_4_2_8P2_RC1
+
+  ntpd/ntpd-opts.h@1.511 +3 -3
+    NTP_4_2_8P2_RC1
+
+  ntpd/ntpd.1ntpdman@1.320 +3 -3
+    NTP_4_2_8P2_RC1
+
+  ntpd/ntpd.1ntpdmdoc@1.320 +2 -2
+    NTP_4_2_8P2_RC1
+
+  ntpd/ntpd.html@1.165 +2 -2
+    NTP_4_2_8P2_RC1
+
+  ntpd/ntpd.man.in@1.320 +3 -3
+    NTP_4_2_8P2_RC1
+
+  ntpd/ntpd.mdoc.in@1.320 +2 -2
+    NTP_4_2_8P2_RC1
+
+  ntpdc/invoke-ntpdc.texi@1.489 +2 -2
+    NTP_4_2_8P2_RC1
+
+  ntpdc/ntpdc-opts.c@1.507 +107 -107
+    NTP_4_2_8P2_RC1
+
+  ntpdc/ntpdc-opts.h@1.506 +3 -3
+    NTP_4_2_8P2_RC1
+
+  ntpdc/ntpdc.1ntpdcman@1.320 +3 -3
+    NTP_4_2_8P2_RC1
+
+  ntpdc/ntpdc.1ntpdcmdoc@1.320 +2 -2
+    NTP_4_2_8P2_RC1
+
+  ntpdc/ntpdc.html@1.333 +2 -2
+    NTP_4_2_8P2_RC1
+
+  ntpdc/ntpdc.man.in@1.320 +3 -3
+    NTP_4_2_8P2_RC1
+
+  ntpdc/ntpdc.mdoc.in@1.320 +2 -2
+    NTP_4_2_8P2_RC1
+
+  ntpq/invoke-ntpq.texi@1.495 +2 -2
+    NTP_4_2_8P2_RC1
+
+  ntpq/ntpq-opts.c@1.512 +106 -106
+    NTP_4_2_8P2_RC1
+
+  ntpq/ntpq-opts.h@1.510 +3 -3
+    NTP_4_2_8P2_RC1
+
+  ntpq/ntpq.1ntpqman@1.323 +3 -3
+    NTP_4_2_8P2_RC1
+
+  ntpq/ntpq.1ntpqmdoc@1.323 +2 -2
+    NTP_4_2_8P2_RC1
+
+  ntpq/ntpq.html@1.162 +2 -2
+    NTP_4_2_8P2_RC1
+
+  ntpq/ntpq.man.in@1.323 +3 -3
+    NTP_4_2_8P2_RC1
+
+  ntpq/ntpq.mdoc.in@1.323 +2 -2
+    NTP_4_2_8P2_RC1
+
+  ntpsnmpd/invoke-ntpsnmpd.texi@1.491 +2 -2
+    NTP_4_2_8P2_RC1
+
+  ntpsnmpd/ntpsnmpd-opts.c@1.509 +68 -68
+    NTP_4_2_8P2_RC1
+
+  ntpsnmpd/ntpsnmpd-opts.h@1.508 +3 -3
+    NTP_4_2_8P2_RC1
+
+  ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.320 +3 -3
+    NTP_4_2_8P2_RC1
+
+  ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.320 +2 -2
+    NTP_4_2_8P2_RC1
+
+  ntpsnmpd/ntpsnmpd.html@1.160 +1 -1
+    NTP_4_2_8P2_RC1
+
+  ntpsnmpd/ntpsnmpd.man.in@1.320 +3 -3
+    NTP_4_2_8P2_RC1
+
+  ntpsnmpd/ntpsnmpd.mdoc.in@1.320 +2 -2
+    NTP_4_2_8P2_RC1
+
+  packageinfo.sh@1.505 +2 -2
+    NTP_4_2_8P2_RC1
+
+  scripts/calc_tickadj/calc_tickadj.1calc_tickadjman@1.81 +3 -3
+    NTP_4_2_8P2_RC1
+
+  scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc@1.82 +2 -2
+    NTP_4_2_8P2_RC1
+
+  scripts/calc_tickadj/calc_tickadj.html@1.83 +1 -1
+    NTP_4_2_8P2_RC1
+
+  scripts/calc_tickadj/calc_tickadj.man.in@1.80 +3 -3
+    NTP_4_2_8P2_RC1
+
+  scripts/calc_tickadj/calc_tickadj.mdoc.in@1.82 +2 -2
+    NTP_4_2_8P2_RC1
+
+  scripts/calc_tickadj/invoke-calc_tickadj.texi@1.85 +1 -1
+    NTP_4_2_8P2_RC1
+
+  scripts/invoke-plot_summary.texi@1.102 +2 -2
+    NTP_4_2_8P2_RC1
+
+  scripts/invoke-summary.texi@1.102 +2 -2
+    NTP_4_2_8P2_RC1
+
+  scripts/ntp-wait/invoke-ntp-wait.texi@1.312 +2 -2
+    NTP_4_2_8P2_RC1
+
+  scripts/ntp-wait/ntp-wait-opts@1.48 +2 -2
+    NTP_4_2_8P2_RC1
+
+  scripts/ntp-wait/ntp-wait.1ntp-waitman@1.309 +3 -3
+    NTP_4_2_8P2_RC1
+
+  scripts/ntp-wait/ntp-wait.1ntp-waitmdoc@1.310 +2 -2
+    NTP_4_2_8P2_RC1
+
+  scripts/ntp-wait/ntp-wait.html@1.329 +2 -2
+    NTP_4_2_8P2_RC1
+
+  scripts/ntp-wait/ntp-wait.man.in@1.309 +3 -3
+    NTP_4_2_8P2_RC1
+
+  scripts/ntp-wait/ntp-wait.mdoc.in@1.310 +2 -2
+    NTP_4_2_8P2_RC1
+
+  scripts/ntpsweep/invoke-ntpsweep.texi@1.100 +2 -2
+    NTP_4_2_8P2_RC1
+
+  scripts/ntpsweep/ntpsweep-opts@1.50 +2 -2
+    NTP_4_2_8P2_RC1
+
+  scripts/ntpsweep/ntpsweep.1ntpsweepman@1.88 +3 -3
+    NTP_4_2_8P2_RC1
+
+  scripts/ntpsweep/ntpsweep.1ntpsweepmdoc@1.88 +2 -2
+    NTP_4_2_8P2_RC1
+
+  scripts/ntpsweep/ntpsweep.html@1.101 +2 -2
+    NTP_4_2_8P2_RC1
+
+  scripts/ntpsweep/ntpsweep.man.in@1.88 +3 -3
+    NTP_4_2_8P2_RC1
+
+  scripts/ntpsweep/ntpsweep.mdoc.in@1.89 +2 -2
+    NTP_4_2_8P2_RC1
+
+  scripts/ntptrace/invoke-ntptrace.texi@1.101 +2 -2
+    NTP_4_2_8P2_RC1
+
+  scripts/ntptrace/ntptrace-opts@1.50 +2 -2
+    NTP_4_2_8P2_RC1
+
+  scripts/ntptrace/ntptrace.1ntptraceman@1.88 +3 -3
+    NTP_4_2_8P2_RC1
+
+  scripts/ntptrace/ntptrace.1ntptracemdoc@1.89 +2 -2
+    NTP_4_2_8P2_RC1
+
+  scripts/ntptrace/ntptrace.html@1.102 +2 -2
+    NTP_4_2_8P2_RC1
+
+  scripts/ntptrace/ntptrace.man.in@1.88 +3 -3
+    NTP_4_2_8P2_RC1
+
+  scripts/ntptrace/ntptrace.mdoc.in@1.90 +2 -2
+    NTP_4_2_8P2_RC1
+
+  scripts/plot_summary-opts@1.50 +2 -2
+    NTP_4_2_8P2_RC1
+
+  scripts/plot_summary.1plot_summaryman@1.100 +3 -3
+    NTP_4_2_8P2_RC1
+
+  scripts/plot_summary.1plot_summarymdoc@1.100 +2 -2
+    NTP_4_2_8P2_RC1
+
+  scripts/plot_summary.html@1.103 +2 -2
+    NTP_4_2_8P2_RC1
+
+  scripts/plot_summary.man.in@1.100 +3 -3
+    NTP_4_2_8P2_RC1
+
+  scripts/plot_summary.mdoc.in@1.100 +2 -2
+    NTP_4_2_8P2_RC1
+
+  scripts/summary-opts@1.50 +2 -2
+    NTP_4_2_8P2_RC1
+
+  scripts/summary.1summaryman@1.100 +3 -3
+    NTP_4_2_8P2_RC1
+
+  scripts/summary.1summarymdoc@1.100 +2 -2
+    NTP_4_2_8P2_RC1
+
+  scripts/summary.html@1.103 +2 -2
+    NTP_4_2_8P2_RC1
+
+  scripts/summary.man.in@1.100 +3 -3
+    NTP_4_2_8P2_RC1
+
+  scripts/summary.mdoc.in@1.100 +2 -2
+    NTP_4_2_8P2_RC1
+
+  sntp/invoke-sntp.texi@1.488 +2 -2
+    NTP_4_2_8P2_RC1
+
+  sntp/sntp-opts.c@1.507 +159 -159
+    NTP_4_2_8P2_RC1
+
+  sntp/sntp-opts.h@1.505 +3 -3
+    NTP_4_2_8P2_RC1
+
+  sntp/sntp.1sntpman@1.323 +3 -3
+    NTP_4_2_8P2_RC1
+
+  sntp/sntp.1sntpmdoc@1.323 +2 -2
+    NTP_4_2_8P2_RC1
+
+  sntp/sntp.html@1.503 +2 -2
+    NTP_4_2_8P2_RC1
+
+  sntp/sntp.man.in@1.323 +3 -3
+    NTP_4_2_8P2_RC1
+
+  sntp/sntp.mdoc.in@1.323 +2 -2
+    NTP_4_2_8P2_RC1
+
+  util/invoke-ntp-keygen.texi@1.492 +2 -2
+    NTP_4_2_8P2_RC1
+
+  util/ntp-keygen-opts.c@1.510 +173 -173
+    NTP_4_2_8P2_RC1
+
+  util/ntp-keygen-opts.h@1.508 +3 -3
+    NTP_4_2_8P2_RC1
+
+  util/ntp-keygen.1ntp-keygenman@1.320 +3 -3
+    NTP_4_2_8P2_RC1
+
+  util/ntp-keygen.1ntp-keygenmdoc@1.320 +2 -2
+    NTP_4_2_8P2_RC1
+
+  util/ntp-keygen.html@1.166 +2 -2
+    NTP_4_2_8P2_RC1
+
+  util/ntp-keygen.man.in@1.320 +3 -3
+    NTP_4_2_8P2_RC1
+
+  util/ntp-keygen.mdoc.in@1.320 +2 -2
+    NTP_4_2_8P2_RC1
+
+ChangeSet@1.3308.2.2, 2015-03-30 04:25:58-04:00, stenn@deacon.udel.edu
+  Begin 4.2.8p2-RC1
+
+  packageinfo.sh@1.504 +1 -1
+    Begin 4.2.8p2-RC1
+
+ChangeSet@1.3308.2.1, 2015-03-30 08:18:35+00:00, stenn@psp-fb1.ntp.org
+  Start the RC cycle for ntp-4.2.8p2
+
+  NEWS@1.130.1.1 +49 -0
+    Start the RC cycle for ntp-4.2.8p2
+
+ChangeSet@1.3311, 2015-03-29 05:05:41+00:00, stenn@psp-fb1.ntp.org
+  [Bug 2769] cleannup for update-leap
+
+  ChangeLog@1.1627 +1 -0
+    [Bug 2769] cleannup for update-leap
+
+ChangeSet@1.3310, 2015-03-29 04:10:31+00:00, stenn@psp-fb1.ntp.org
+  [Bug 2769] cleannup for update-leap
+
+  NEWS@1.131 +8 -0
+    [Bug 2769] cleannup for update-leap
+
+  scripts/update-leap/Makefile.am@1.3 +1 -0
+    [Bug 2769] cleannup for update-leap
+
+  scripts/update-leap/update-leap-opts.def@1.2 +4 -3
+    [Bug 2769] cleannup for update-leap
+
+ChangeSet@1.3308, 2015-03-29 01:49:10+00:00, stenn@psp-deb1.ntp.org
+  [Bug 2346] "graceful termination" signals do not do peer cleanup
+
+  ChangeLog@1.1625 +1 -0
+    [Bug 2346] "graceful termination" signals do not do peer cleanup
+
+  include/ntpd.h@1.186 +1 -0
+    [Bug 2346] "graceful termination" signals do not do peer cleanup
+
+  ntpd/ntp_peer.c@1.154 +20 -0
+    [Bug 2346] "graceful termination" signals do not do peer cleanup
+
+  ntpd/ntpd.c@1.159 +1 -0
+    [Bug 2346] "graceful termination" signals do not do peer cleanup
+
+ChangeSet@1.3305.3.6, 2015-03-25 17:32:25+01:00, martin@pc-martin.(none)
+  [Bug 2592] Account for PPS sources which can provide an accurate absolute time stamp, and status information.
+
+  ChangeLog@1.1622.3.6 +2 -0
+    [Bug 2592] Account for PPS sources which can provide an accurate absolute time stamp, and status information.
+
+  include/ntp.h@1.213 +2 -1
+    New flag FLAG_TSTAMP_PPS.
+
+  ntpd/ntp_proto.c@1.353.1.2 +2 -1
+    [Bug 2592] Account for PPS sources which can provide an accurate absolute time stamp, and status information.
+
+  ntpd/refclock_parse.c@1.78 +2 -2
+    [Bug 2592] Parse driver can return absolute timestamp with PPS, and status information.
+
+ChangeSet@1.3305.3.5, 2015-03-25 17:24:59+01:00, martin@pc-martin.(none)
+  Fixed indention and removed trailing whitespace.
+
+  ChangeLog@1.1622.3.5 +1 -0
+    Fixed indention and removed trailing whitespace.
+
+  include/ntp.h@1.212 +4 -4
+    Fixed indention.
+
+  include/parse_conf.h@1.7 +6 -6
+    Fixed indention.
+
+  ntpd/ntp_proto.c@1.353.1.1 +27 -27
+    Removed trailing whitespace.
+
+  ntpd/refclock_parse.c@1.77 +16 -16
+    Fixed indention.
+
+ChangeSet@1.3305.3.4, 2015-03-22 07:59:12+00:00, stenn@psp-fb1.ntp.org
+  merge cleanup
+
+  ChangeLog@1.1622.3.4 +0 -1
+    merge cleanup
+
+ChangeSet@1.3305.5.3, 2015-03-22 07:24:07+00:00, stenn@psp-fb1.ntp.org
+  Bug 2791 -> Bug 2789
+
+  ChangeLog@1.1622.5.3 +1 -1
+    Bug 2791 -> Bug 2789
+
+ChangeSet@1.3305.5.2, 2015-03-22 06:59:06+00:00, stenn@psp-fb1.ntp.org
+  Merge cleanup
+
+  ChangeLog@1.1622.5.2 +22 -22
+    Merge cleanup
+
+ChangeSet@1.3305.4.2, 2015-03-22 03:48:52+00:00, stenn@psp-fb1.ntp.org
+  [Bug 2769] New script: update-leap
+
+  .point-changed-filelist@1.26 +7 -0
+    [Bug 2769] New script: update-leap
+
+  scripts/update-leap/Makefile.am@1.2 +2 -1
+    [Bug 2769] New script: update-leap
+
+ChangeSet@1.3305.4.1, 2015-03-22 03:01:33+00:00, stenn@psp-fb1.ntp.org
+  [Bug 2769] New script: update-leap
+
+  BitKeeper/etc/ignore@1.86 +1 -0
+    added Makefile.in
+
+  ChangeLog@1.1622.4.1 +1 -0
+    [Bug 2769] New script: update-leap
+
+  configure.ac@1.585 +8 -7
+    [Bug 2769] New script: update-leap
+
+  scripts/Makefile.am@1.40 +1 -0
+    [Bug 2769] New script: update-leap
+
+  scripts/update-leap/Makefile.am@1.1 +95 -0
+    BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/stenn/ntp-stable-2769/scripts/update-leap/Makefile.am
+
+  scripts/update-leap/Makefile.am@1.0 +0 -0
+
+  scripts/update-leap/invoke-update-leap.menu@1.1 +1 -0
+    BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/stenn/ntp-stable-2769/scripts/update-leap/invoke-update-leap.menu
+
+  scripts/update-leap/invoke-update-leap.menu@1.0 +0 -0
+
+  scripts/update-leap/invoke-update-leap.texi@1.1 +169 -0
+    BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/stenn/ntp-stable-2769/scripts/update-leap/invoke-update-leap.texi
+
+  scripts/update-leap/invoke-update-leap.texi@1.0 +0 -0
+
+  scripts/update-leap/update-leap@1.1 +434 -0
+    BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/stenn/ntp-stable-2769/scripts/update-leap/update-leap
+
+  scripts/update-leap/update-leap@1.0 +0 -0
+
+  scripts/update-leap/update-leap-opts@1.1 +72 -0
+    BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/stenn/ntp-stable-2769/scripts/update-leap/update-leap-opts
+
+  scripts/update-leap/update-leap-opts@1.0 +0 -0
+
+  scripts/update-leap/update-leap-opts.def@1.1 +162 -0
+    BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/stenn/ntp-stable-2769/scripts/update-leap/update-leap-opts.def
+
+  scripts/update-leap/update-leap-opts.def@1.0 +0 -0
+
+  scripts/update-leap/update-leap.1update-leapman@1.1 +168 -0
+    BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/stenn/ntp-stable-2769/scripts/update-leap/update-leap.1update-leapman
+
+  scripts/update-leap/update-leap.1update-leapman@1.0 +0 -0
+
+  scripts/update-leap/update-leap.1update-leapmdoc@1.1 +133 -0
+    BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/stenn/ntp-stable-2769/scripts/update-leap/update-leap.1update-leapmdoc
+
+  scripts/update-leap/update-leap.1update-leapmdoc@1.0 +0 -0
+
+  scripts/update-leap/update-leap.html@1.1 +297 -0
+    BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/stenn/ntp-stable-2769/scripts/update-leap/update-leap.html
+
+  scripts/update-leap/update-leap.html@1.0 +0 -0
+
+  scripts/update-leap/update-leap.man.in@1.1 +168 -0
+    BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/stenn/ntp-stable-2769/scripts/update-leap/update-leap.man.in
+
+  scripts/update-leap/update-leap.man.in@1.0 +0 -0
+
+  scripts/update-leap/update-leap.mdoc.in@1.1 +133 -0
+    BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/stenn/ntp-stable-2769/scripts/update-leap/update-leap.mdoc.in
+
+  scripts/update-leap/update-leap.mdoc.in@1.0 +0 -0
+
+  scripts/update-leap/update-leap.texi@1.1 +43 -0
+    BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/stenn/ntp-stable-2769/scripts/update-leap/update-leap.texi
+
+  scripts/update-leap/update-leap.texi@1.0 +0 -0
+
+  sntp/loc/darwin@1.3 +1 -0
+    [Bug 2769] New script: update-leap
+
+  sntp/loc/debian@1.4 +1 -0
+    [Bug 2769] New script: update-leap
+
+  sntp/loc/freebsd@1.6 +1 -0
+    [Bug 2769] New script: update-leap
+
+  sntp/loc/legacy@1.7 +1 -0
+    [Bug 2769] New script: update-leap
+
+  sntp/loc/netbsd@1.4 +1 -0
+    [Bug 2769] New script: update-leap
+
+  sntp/loc/solaris@1.7 +1 -0
+    [Bug 2769] New script: update-leap
+
+  sntp/m4/ntp_locinfo.m4@1.18 +6 -0
+    [Bug 2769] New script: update-leap
+
+ChangeSet@1.3305.3.1, 2015-03-20 13:03:38+01:00, burnicki@pc-martin4.
+  [Bug 2790] If ntpd sets the Windows MM timer highest resolution then pause
+  briefly before measuring system clock precision to yield correct results.
+
+  ChangeLog@1.1622.3.1 +3 -1
+    [Bug 2790] If ntpd sets the Windows MM timer highest resolution then pause
+    briefly before measuring system clock precision to yield correct results.
+
+  ports/winnt/ntpd/nt_clockstuff.c@1.65 +4 -0
+    [Bug 2790] If ntpd sets the Windows MM timer highest resolution then pause
+    briefly before measuring system clock precision to yield correct results.
+
+ChangeSet@1.3305.2.6, 2015-03-20 11:47:15+01:00, martin@pc-martin.(none)
+  [Bug 2791] Quiet compiler warnings from libevent.
+
+  ChangeLog@1.1622.2.6 +1 -0
+    [Bug 2791] Quiet compiler warnings from libevent.
+
+  sntp/libevent/evthread-internal.h@1.8 +2 -2
+    [Bug 2791] Fixed function prototypes to quiet compiler warnings.
+
+ChangeSet@1.3305.2.5, 2015-03-20 11:36:15+01:00, martin@pc-martin.(none)
+  [Bug 1787] DCF77's formerly "antenna" bit is "call bit" since 2003.
+
+  ChangeLog@1.1622.2.5 +4 -3
+    [Bug 1787] DCF77's formerly "antenna" bit is "call bit" since 2003.
+
+  include/parse.h@1.12 +3 -3
+    [Bug 1787] DCF77's formerly "antenna" bit is "call bit" since 2003.
+
+  libparse/clk_meinberg.c@1.14 +7 -4
+    [Bug 1787] DCF77's formerly "antenna" bit is "call bit" since 2003.
+
+  libparse/clk_rawdcf.c@1.20 +3 -2
+    [Bug 1787] DCF77's formerly "antenna" bit is "call bit" since 2003.
+
+  libparse/clk_schmid.c@1.13 +3 -3
+    [Bug 1787] DCF77's formerly "antenna" bit is "call bit" since 2003.
+
+  libparse/parse.c@1.19 +1 -1
+    Quiet compiler warning.
+
+  ntpd/refclock_parse.c@1.76 +1 -1
+    [Bug 1787] DCF77's formerly "antenna" bit is "call bit" since 2003.
+
+  parseutil/dcfd.c@1.28 +26 -25
+    [Bug 1787] DCF77's formerly "antenna" bit is "call bit" since 2003.
+    Removed trailing whitespace.
+
+  parseutil/testdcf.c@1.10 +11 -10
+    [Bug 1787] DCF77's formerly "antenna" bit is "call bit" since 2003.
+    Removed trailing whitespace and fixed indention.
+
+ChangeSet@1.3305.2.4, 2015-03-19 17:00:30+01:00, martin@pc-martin.(none)
+  Added a comment from Juergen Perlinger in ntp_date.c to make the code clearer.
+
+  ChangeLog@1.1622.2.4 +1 -0
+    Added a comment from Juergen Perlinger in ntp_date.c to make the code clearer.
+
+  libntp/ntp_calendar.c@1.15 +40 -34
+    Added a comment from Juergen Perlinger to make the code clearer.
+    Removed trailing whitespace.
+
+ChangeSet@1.3305.2.3, 2015-03-19 16:52:05+01:00, martin@pc-martin.(none)
+  Use predefined function types for parse driver functions used to set up function pointers.
+  Account for changed prototype of parse_inp_fnc_t functions.
+  Cast parse conversion results to appropriate types to avoid compiler warnings.
+  Let ioctl() for Windows accept a (void *) to avoid compiler warnings when called with pointers to different types.
+
+  ChangeLog@1.1622.2.3 +7 -0
+    Use predefined function types for parse driver functions used to set up function pointers.
+    Account for changed prototype of parse_inp_fnc_t functions.
+    Cast parse conversion results to appropriate types to avoid compiler warnings.
+    Let ioctl() for Windows accept a (void *) to avoid compiler warnings when called with pointers to different types.
+
+  include/binio.h@1.6 +10 -0
+    Added macros casting the result of the conversion function to a dedicated with to avoid compiler warnings.
+
+  include/mbg_gps166.h@1.13 +1 -1
+    Use specific data type with mbg_csum() to avoid compiler warnings.
+
+  include/parse.h@1.11 +15 -11
+    Introduced some dedicated function types simplifying use with function pointers.
+    Let parse input functions expect a char instead of an unsigned int since chars are used anyway.
+    This helps to avoid compiler warnings.
+
+  libparse/clk_computime.c@1.12 +10 -10
+    Use predefined function types for functions used to set up function pointers.
+    Account for changed prototype of parse_inp_fnc_t functions.
+
+  libparse/clk_dcf7000.c@1.12 +8 -7
+    Use predefined function types for functions used to set up function pointers.
+    Account for changed prototype of parse_inp_fnc_t functions.
+
+  libparse/clk_hopf6021.c@1.11 +21 -20
+    Use predefined function types for functions used to set up function pointers.
+    Account for changed prototype of parse_inp_fnc_t functions.
+
+  libparse/clk_meinberg.c@1.13 +20 -19
+    Use predefined function types for functions used to set up function pointers.
+    Account for changed prototype of parse_inp_fnc_t functions.
+    Cast conversion results to appropriate types to avoid compiler warnings.
+
+  libparse/clk_rawdcf.c@1.19 +8 -7
+    Use predefined function types for functions used to set up function pointers.
+    Account for changed prototype of parse_inp_fnc_t functions.
+    Cast to appropriate types to avoid compiler warnings.
+
+  libparse/clk_rcc8000.c@1.11 +17 -16
+    Use predefined function types for functions used to set up function pointers.
+    Account for changed prototype of parse_inp_fnc_t functions.
+
+  libparse/clk_schmid.c@1.12 +9 -9
+    Use predefined function types for functions used to set up function pointers.
+    Account for changed prototype of parse_inp_fnc_t functions.
+
+  libparse/clk_sel240x.c@1.4 +5 -11
+    Use predefined function types for functions used to set up function pointers.
+    Account for changed prototype of parse_inp_fnc_t functions.
+    Cast to appropriate types to avoid compiler warnings.
+
+  libparse/clk_trimtaip.c@1.12 +8 -7
+    Use predefined function types for functions used to set up function pointers.
+    Account for changed prototype of parse_inp_fnc_t functions.
+
+  libparse/clk_trimtsip.c@1.13 +18 -18
+    Use predefined function types for functions used to set up function pointers.
+    Account for changed prototype of parse_inp_fnc_t functions.
+    Cast conversion results to appropriate types to avoid compiler warnings.
+    Use commonly defined constants to handle GPS week number wraparounds.
+
+  libparse/clk_varitext.c@1.11 +6 -5
+    Use predefined function types for functions used to set up function pointers.
+    Account for changed prototype of parse_inp_fnc_t functions.
+
+  libparse/clk_wharton.c@1.10 +7 -4
+    Use predefined function types for functions used to set up function pointers.
+    Account for changed prototype of parse_inp_fnc_t functions.
+
+  libparse/data_mbg.c@1.15 +36 -36
+    Cast conversion results to appropriate types to avoid compiler warnings.
+
+  libparse/gpstolfp.c@1.12 +1 -1
+    Type cast to avoid compiler warning.
+
+  libparse/parse.c@1.18 +14 -14
+    Use predefined function types for functions used to set up function pointers.
+    Account for changed prototype of parse_inp_fnc_t functions.
+    Cast conversion results to appropriate types to avoid compiler warnings.
+
+  ntpd/refclock_parse.c@1.75 +49 -48
+    Cast conversion results to appropriate types to avoid compiler warnings.
+
+  ports/winnt/include/termios.h@1.17 +1 -1
+    Changed the prototype for ioctl() to accept a (void *) to avoid compiler warnings when called with pointers to different types.
+
+  ports/winnt/libntp/termios.c@1.30 +2 -1
+    Let ioctl() accept a (void *) to avoid compiler warnings when called with pointers to different types.
+
+ChangeSet@1.3305.1.19, 2015-03-19 07:54:24+00:00, stenn@psp-deb1.ntp.org
+  ntp_proto.c, ChangeLog:
+    [Sec 2779] ntpd accepts unauthenticated packets with symmetric key crypto.
+    [Sec 2781] Authentication doesn't protect symmetric associations against DoS attacks.
+
+  ChangeLog@1.1622.1.16 +3 -0
+    [Sec 2779] ntpd accepts unauthenticated packets with symmetric key crypto.
+    [Sec 2781] Authentication doesn't protect symmetric associations against DoS attacks.
+
+  ntpd/ntp_proto.c@1.354 +16 -14
+    [Sec 2779] ntpd accepts unauthenticated packets with symmetric key crypto.
+    [Sec 2781] Authentication doesn't protect symmetric associations against DoS attacks.
+
+ChangeSet@1.3305.1.18, 2015-03-16 09:17:42+00:00, stenn@psp-fb1.ntp.org
+  [Bug 2763] Allow different thresholds for forward and backward steps
+
+  ChangeLog@1.1622.1.15 +1 -0
+    [Bug 2763] Allow different thresholds for forward and backward steps
+
+  include/ntp.h@1.211 +13 -11
+    [Bug 2763] Allow different thresholds for forward and backward steps
+
+  include/ntpd.h@1.185 +2 -1
+    [Bug 2763] Allow different thresholds for forward and backward steps
+
+  ntpd/invoke-ntp.conf.texi@1.178 +15 -2
+    [Bug 2763] Allow different thresholds for forward and backward steps
+
+  ntpd/keyword-gen-utd@1.22 +1 -1
+    [Bug 2763] Allow different thresholds for forward and backward steps
+
+  ntpd/keyword-gen.c@1.27 +2 -0
+    [Bug 2763] Allow different thresholds for forward and backward steps
+
+  ntpd/ntp.conf.5man@1.212 +19 -4
+    [Bug 2763] Allow different thresholds for forward and backward steps
+
+  ntpd/ntp.conf.5mdoc@1.212 +18 -3
+    [Bug 2763] Allow different thresholds for forward and backward steps
+
+  ntpd/ntp.conf.def@1.15 +16 -1
+    [Bug 2763] Allow different thresholds for forward and backward steps
+
+  ntpd/ntp.conf.man.in@1.212 +19 -4
+    [Bug 2763] Allow different thresholds for forward and backward steps
+
+  ntpd/ntp.conf.mdoc.in@1.212 +18 -3
+    [Bug 2763] Allow different thresholds for forward and backward steps
+
+  ntpd/ntp_config.c@1.323 +8 -0
+    [Bug 2763] Allow different thresholds for forward and backward steps
+
+  ntpd/ntp_keyword.h@1.24 +492 -483
+    [Bug 2763] Allow different thresholds for forward and backward steps
+
+  ntpd/ntp_loopfilter.c@1.179 +27 -5
+    [Bug 2763] Allow different thresholds for forward and backward steps
+
+  ntpd/ntp_parser.c@1.90 +803 -797
+    [Bug 2763] Allow different thresholds for forward and backward steps
+
+  ntpd/ntp_parser.h@1.56 +81 -77
+    [Bug 2763] Allow different thresholds for forward and backward steps
+
+  ntpd/ntp_parser.y@1.83 +4 -0
+    [Bug 2763] Allow different thresholds for forward and backward steps
+
+ChangeSet@1.3305.2.2, 2015-03-13 10:28:32+01:00, martin@pc-martin.(none)
+  Removed non-ASCII characters from some copyright comments.
+  Removed trailing whitespace.
+  Updated definitions for Meinberg clocks from current Meinberg header files. Now use C99 fixed-width types and avoid non-ASCII characters in comments.
+  Account for updated definitions pulled from Meinberg header files.
+  Updated comments on Meinberg GPS receivers which are not only called GPS16x.
+  Replaced some constant numbers by defines from ntp_calendar.h
+  Modified creation of parse-specific variables for Meinberg devices in gps16x_message().
+  Reworked mk_utcinfo() to avoid printing of ambiguous leap second dates.
+  Modified mbg_tm_str() which now expexts an additional parameter controlling if the time status shall be printed.
+
+  ChangeLog@1.1622.2.2 +12 -0
+    Removed non-ASCII characters from some copyright comments.
+    Removed trailing whitespace.
+    Updated definitions for Meinberg clocks from current Meinberg header files. Now use C99 fixed-width types and avoid non-ASCII characters in comments.
+    Account for updated definitions pulled from Meinberg header files.
+    Updated comments on Meinberg GPS receivers which are not only called GPS16x.
+    Replaced some constant numbers by defines from ntp_calendar.h
+    Modified creation of parse-specific variables for Meinberg devices in gps16x_message().
+    Reworked mk_utcinfo() to avoid printing of ambiguous leap second dates.
+    Modified mbg_tm_str() which now expexts an additional parameter controlling if the time status shall be printed.
+
+  include/mbg_gps166.h@1.12 +841 -408
+    Updated definitions for Meinberg clocks from current Meinberg header files. Now use C99 fixed-width types and avoid non-ASCII characters in comments.
+    Updated prototype for mbg_tm_str() which now takes one more parameter.
+
+  include/ntp_calendar.h@1.17 +4 -2
+    Added definitions for DAYSPERWEEK and SECSPERWEEK.
+
+  include/parse.h@1.10 +14 -7
+    Removed non-ASCII characters from copyright comment.
+    Removed trailing whitespace.
+    Moved a few definitions from gpstolfp.c here so they can also be used in other c modules.
+
+  include/parse_conf.h@1.6 +1 -1
+    Removed non-ASCII characters from copyright comment.
+
+  kernel/sys/parsestreams.h@1.8 +1 -1
+    Removed non-ASCII characters from copyright comment.
+
+  libparse/clk_computime.c@1.11 +23 -23
+    Removed non-ASCII characters from copyright comment.
+    Removed trailing whitespace.
+
+  libparse/clk_dcf7000.c@1.11 +7 -7
+    Removed non-ASCII characters from copyright comment.
+    Removed trailing whitespace.
+
+  libparse/clk_meinberg.c@1.12 +71 -70
+    Updated comments on Meinberg GPS receivers which are not only called GPS16x.
+    Removed non-ASCII characters from copyright comment.
+    Removed trailing whitespace.
+
+  libparse/clk_rawdcf.c@1.18 +12 -12
+    Removed non-ASCII characters from copyright comment.
+    Removed trailing whitespace.
+
+  libparse/clk_schmid.c@1.11 +7 -7
+    Removed non-ASCII characters from copyright comment.
+    Removed trailing whitespace.
+
+  libparse/clk_trimtaip.c@1.11 +5 -5
+    Removed non-ASCII characters from copyright comment.
+    Removed trailing whitespace.
+
+  libparse/clk_trimtsip.c@1.12 +13 -13
+    Removed non-ASCII characters from copyright comment.
+    Removed trailing whitespace.
+
+  libparse/clk_varitext.c@1.10 +38 -38
+    Removed non-ASCII characters from copyright comment.
+    Removed trailing whitespace.
+
+  libparse/clk_wharton.c@1.9 +1 -1
+    Fixed a typo.
+
+  libparse/data_mbg.c@1.14 +39 -36
+    Account for updated definitions pulled from Meinberg header files.
+    Updated definitions for Meinberg clocks from current Meinberg header files. Now use C99 fixed-width types and avoid non-ASCII characters in comments.
+    Replaced some constant numbers by defines from ntp_calendar.h.
+    Modified mbg_tm_str() which now expexts an additional parameter controlling if the time status shall be printed.
+
+  libparse/gpstolfp.c@1.11 +4 -6
+    Moved some commonly used constants to parse.h.
+    Removed duplicate defines and use those in ntp_calendar.h.
+    Also replaced some constant numbers by defines from ntp_calendar.h.
+
+  libparse/parse.c@1.17 +46 -46
+    Removed non-ASCII characters from copyright comment.
+    Removed trailing whitespace.
+
+  libparse/parse_conf.c@1.11 +2 -2
+    Removed non-ASCII characters from copyright comment.
+
+  libparse/parsesolaris.c@1.12 +55 -55
+    Removed non-ASCII characters from copyright comment.
+    Removed trailing whitespace.
+
+  libparse/parsestreams.c@1.8 +63 -63
+    Removed non-ASCII characters from copyright comment.
+    Removed trailing whitespace.
+
+  libparse/trim_info.c@1.6 +1 -1
+    Removed non-ASCII characters from copyright comment.
+
+  ntpd/refclock_parse.c@1.74 +326 -295
+    Removed non-ASCII characters from copyright comment.
+    Removed trailing whitespace.
+    Reworked mk_utcinfo() to avoid printing of ambiguous leap second dates.
+    Modified creation of parse-specific variables for Meinberg devices in gps16x_message().
+
+  parseutil/dcfd.c@1.27 +2 -2
+    Removed non-ASCII characters from copyright comment.
+
+  parseutil/testdcf.c@1.9 +2 -2
+    Removed non-ASCII characters from copyright comment.
+
+ChangeSet@1.3305.1.17, 2015-03-10 11:21:46+00:00, stenn@psp-fb1.ntp.org
+  merge cleanup
+
+  ChangeLog@1.1622.1.14 +1 -3
+    merge cleanup
+
+  ntpd/ntp_loopfilter.c@1.178 +5 -2
+    merge cleanup
+
+ChangeSet@1.3305.2.1, 2015-03-10 10:48:25+01:00, martin@pc-martin.(none)
+  Fixed loops and decoding of Meinberg GPS satellite info.
+
+  ChangeLog@1.1622.2.1 +1 -0
+    Fixed loops and decoding of Meinberg GPS satellite info.
+
+  libparse/data_mbg.c@1.13 +3 -3
+    Fixed loops handling Meinberg GPS satellite info.
+
+  ntpd/refclock_parse.c@1.73 +44 -68
+    Fixed loops and decoding of Meinberg GPS satellite info.
+
+ChangeSet@1.3305.1.16, 2015-03-09 06:36:19-04:00, murray@pogo.udel.edu
+  ChangeLog, ntp_loopfilter.c:
+    Fix for bug 2774
+
+  ChangeLog@1.1622.1.13 +3 -0
+    Fix for bug 2774
+
+  ntpd/ntp_loopfilter.c@1.177 +4 -1
+    Fix for bug 2774
+
+ChangeSet@1.3305.1.15, 2015-03-05 10:17:02+00:00, stenn@psp-fb1.ntp.org
+  [Bug 2783] Quiet autoconf warnings about missing AC_LANG_SOURCE
+
+  ChangeLog@1.1622.1.12 +1 -0
+    [Bug 2783] Quiet autoconf warnings about missing AC_LANG_SOURCE
+
+  configure.ac@1.584 +24 -22
+    [Bug 2783] Quiet autoconf warnings about missing AC_LANG_SOURCE
+
+  sntp/libopts/m4/libopts.m4@1.33 +12 -12
+    [Bug 2783] Quiet autoconf warnings about missing AC_LANG_SOURCE
+
+  sntp/m4/ntp_libntp.m4@1.29 +4 -4
+    [Bug 2783] Quiet autoconf warnings about missing AC_LANG_SOURCE
+
+ChangeSet@1.3305.1.14, 2015-03-04 11:16:31+00:00, stenn@psp-fb1.ntp.org
+  [Bug 2775] ntp-keygen.c fails to compile under Windows
+
+  ChangeLog@1.1622.1.11 +1 -0
+    [Bug 2775] ntp-keygen.c fails to compile under Windows.
+
+  util/ntp-keygen.c@1.103 +7 -1
+    [Bug 2775] ntp-keygen.c fails to compile under Windows
+
+ChangeSet@1.3305.1.13, 2015-03-01 21:46:56-05:00, stenn@pogo.udel.edu
+  cleanup
+
+  ChangeLog@1.1622.1.10 +1 -2
+    cleanup
+
+ChangeSet@1.3305.1.12, 2015-03-01 02:50:18-05:00, murray@pogo.udel.edu
+  refclock_palisade.h, ChangeLog, refclock_palisade.c:
+    Fix bug 2773 - early leap from Palisade/Thunderbolt
+
+  ChangeLog@1.1622.1.9 +2 -0
+    Fix bug 2773 - early leap from Palisade/Thunderbolt
+
+  ntpd/refclock_palisade.c@1.42 +8 -2
+    Fix bug 2773 - early leap from Palisade/Thunderbolt
+
+  ntpd/refclock_palisade.h@1.15 +1 -0
+    Fix bug 2773 - early leap from Palisade/Thunderbolt
+
+ChangeSet@1.3305.1.11, 2015-02-28 12:12:13+00:00, stenn@psp-fb1.ntp.org
+  [Bug 2751] jitter.h has stale copies of l_fp macros
+
+  util/Makefile.am@1.78 +1 -1
+    [Bug 2751] jitter.h has stale copies of l_fp macros
+
+ChangeSet@1.3305.1.10, 2015-02-28 12:04:02+00:00, stenn@psp-fb1.ntp.org
+  [Bug 2771] nonvolatile value is documented in wrong units
+
+  ChangeLog@1.1622.1.8 +1 -0
+    [Bug 2771] nonvolatile value is documented in wrong units
+
+  html/miscopt.html@1.80 +2 -2
+    [Bug 2771] nonvolatile value is documented in wrong units
+
+ChangeSet@1.3305.1.9, 2015-02-28 11:34:24+00:00, stenn@psp-fb1.ntp.org
+  [Bug 2767] ntp-keygen -M should symlink to ntp.keys
+
+  ChangeLog@1.1622.1.7 +1 -0
+    [Bug 2767] ntp-keygen -M should symlink to ntp.keys
+
+  util/ntp-keygen.c@1.102 +6 -2
+    [Bug 2767] ntp-keygen -M should symlink to ntp.keys
+
+ChangeSet@1.3305.1.8, 2015-02-28 11:28:04+00:00, stenn@psp-fb1.ntp.org
+  [Bug 2766] ntp-keygen output files should not be world-readable
+
+  ChangeLog@1.1622.1.6 +1 -0
+    [Bug 2766] ntp-keygen output files should not be world-readable
+
+  util/ntp-keygen.c@1.101 +5 -1
+    [Bug 2766] ntp-keygen output files should not be world-readable
+
+ChangeSet@1.3305.1.7, 2015-02-28 11:18:57+00:00, stenn@psp-fb1.ntp.org
+  [Bug 2759] Expose nonvolatile/clk_wander_threshold to ntpq
+
+  ChangeLog@1.1622.1.5 +1 -0
+    [Bug 2759] Expose nonvolatile/clk_wander_threshold to ntpq
+
+  ntpd/ntp_control.c@1.196 +56 -51
+    [Bug 2759] Expose nonvolatile/clk_wander_threshold to ntpq
+
+ChangeSet@1.3305.1.6, 2015-02-28 09:47:20+00:00, stenn@psp-fb1.ntp.org
+  [Bug 2757] Quiet compiler warnings.
+
+  lib/isc/inet_ntop.c@1.14 +1 -0
+    [Bug 2757] Quiet compiler warnings.
+
+  lib/isc/log.c@1.8 +12 -12
+    [Bug 2757] Quiet compiler warnings.
+
+  ntpd/ntp_leapsec.c@1.16 +6 -6
+    [Bug 2757] Quiet compiler warnings.
+
+  parseutil/dcfd.c@1.26 +7 -0
+    [Bug 2757] Quiet compiler warnings.
+
+  sntp/libevent/include/event2/event.h@1.11 +4 -0
+    [Bug 2757] Quiet compiler warnings.
+
+ChangeSet@1.3305.1.5, 2015-02-28 09:11:24+00:00, stenn@psp-fb1.ntp.org
+  [Bug 2756] ntpd hangs in startup with gcc 3.3.5 on ARM
+
+  ChangeLog@1.1622.1.4 +1 -0
+    [Bug 2756] ntpd hangs in startup with gcc 3.3.5 on ARM
+
+  configure.ac@1.583 +0 -2
+    [Bug 2756] ntpd hangs in startup with gcc 3.3.5 on ARM
+
+  include/ntp_fp.h@1.32 +4 -1
+    [Bug 2756] ntpd hangs in startup with gcc 3.3.5 on ARM
+
+ChangeSet@1.3305.1.4, 2015-02-25 07:58:47+00:00, stenn@psp-fb1.ntp.org
+  [Bug 2751] jitter.h has stale copies of l_fp macros
+
+  BitKeeper/deleted/fd/jitter.h~11d7c056cb18e28@1.5 +0 -0
+    Delete: util/jitter.h
+
+  ChangeLog@1.1622.1.3 +1 -0
+    [Bug 2751] jitter.h has stale copies of l_fp macros
+
+  util/jitter.c@1.11 +1 -2
+    [Bug 2751] jitter.h has stale copies of l_fp macros
+
+ChangeSet@1.3305.1.3, 2015-02-21 05:56:16-05:00, stenn@deacon.udel.edu
+  Update triggers for bk-6
+
+  BitKeeper/triggers/post-incoming.license-warn@1.9 +3 -0
+    Update triggers for bk-6
+
+  BitKeeper/triggers/pre-resolve.license-chk@1.10 +3 -0
+    Update triggers for bk-6
+
+  BitKeeper/triggers/send@1.16 +2 -2
+    Update triggers for bk-6
+
+ChangeSet@1.3305.1.2, 2015-02-21 10:35:38+00:00, stenn@psp-fb1.ntp.org
+  [Bug 2757] Quiet compiler warnings
+
+  ChangeLog@1.1622.1.2 +1 -0
+    [Bug 2757] Quiet compiler warnings
+
+  lib/isc/result.c@1.4 +6 -6
+    [Bug 2757] Quiet compiler warnings
+
+  lib/isc/unix/file.c@1.7 +3 -3
+    [Bug 2757] Quiet compiler warnings
+
+  lib/isc/unix/ifiter_ioctl.c@1.32.1.1 +4 -0
+    [Bug 2757] Quiet compiler warnings
+
+  lib/isc/unix/net.c@1.19 +2 -1
+    [Bug 2757] Quiet compiler warnings
+
+  libntp/work_fork.c@1.13 +1 -1
+    [Bug 2757] Quiet compiler warnings
+
+  ntpd/ntp_crypto.c@1.174 +1 -1
+    [Bug 2757] Quiet compiler warnings
+
+ChangeSet@1.3305.1.1, 2015-02-21 09:51:32+00:00, stenn@psp-deb1.ntp.org
+  [Bug 2749] ntp/lib/NTP/Util.pm needs update for ntpq -w, IPv6, .POOL.
+
+  ChangeLog@1.1622.1.1 +1 -0
+    [Bug 2749] ntp/lib/NTP/Util.pm needs update for ntpq -w, IPv6, .POOL.
+
+  scripts/lib/NTP/Util.pm@1.3 +15 -4
+    [Bug 2749] ntp/lib/NTP/Util.pm needs update for ntpq -w, IPv6, .POOL.
+
+ChangeSet@1.3306, 2015-02-21 09:28:08+00:00, stenn@psp-fb1.ntp.org
+  [Bug 1960] setsockopt IPV6_MULTICAST_IF: Invalid argument
+
+  ChangeLog@1.1623 +1 -0
+    [Bug 1960] setsockopt IPV6_MULTICAST_IF: Invalid argument
+
+  lib/isc/unix/ifiter_getifaddrs.c@1.14 +3 -0
+    [Bug 1960] setsockopt IPV6_MULTICAST_IF: Invalid argument
+
+  lib/isc/unix/ifiter_ioctl.c@1.33 +12 -2
+    [Bug 1960] setsockopt IPV6_MULTICAST_IF: Invalid argument
+
+ChangeSet@1.3302.1.1, 2015-02-21 07:15:54+00:00, stenn@psp-deb1.ntp.org
+  [Bug 2728] See if C99-style structure initialization works
+
+  ChangeLog@1.1620.1.1 +3 -0
+    [Bug 2728] See if C99-style structure initialization works
+
+  configure.ac@1.582 +1 -0
+    [Bug 2728] See if C99-style structure initialization works
+
+  ntpq/ntpq-subs.c@1.104 +1 -1
+    [Bug 2728] See if C99-style structure initialization works
+
+  ports/winnt/include/config.h@1.111 +1 -1
+    [Bug 2728] See if C99-style structure initialization works
+
+  sntp/m4/ax_c99_struct_init.m4@1.1 +59 -0
+    BitKeeper file /home/stenn/ntp-stable-2728/sntp/m4/ax_c99_struct_init.m4
+
+  sntp/m4/ax_c99_struct_init.m4@1.0 +0 -0
+
+ChangeSet@1.3304, 2015-02-11 09:08:51+00:00, stenn@psp-fb1.ntp.org
+  [Bug 2747] Upgrade libevent to 2.1.5-beta
+
+  ChangeLog@1.1621 +3 -0
+    [Bug 2747] Upgrade libevent to 2.1.5-beta
+
+ChangeSet@1.3303, 2015-02-11 09:05:59+00:00, stenn@psp-fb1.ntp.org
+  [Bug 2747] Upgrade libevent to 2.1.5-beta
+
+  BitKeeper/deleted/5b/README~3a69bb76c676898e@1.7 +0 -0
+    Delete: sntp/libevent/README
+
+  sntp/libevent/ChangeLog@1.9 +726 -60
+    [Bug 2747] Upgrade libevent to 2.1.5-beta
+
+  sntp/libevent/Makefile.am@1.13 +3 -1
+    [Bug 2747] Upgrade libevent to 2.1.5-beta
+
+  sntp/libevent/README.md@1.1 +318 -0
+    BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/stenn/ntp-stable-2747/sntp/libevent/README.md
+
+  sntp/libevent/README.md@1.0 +0 -0
+
+  sntp/libevent/WIN32-Code/getopt.c@1.1 +149 -0
+    BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/stenn/ntp-stable-2747/sntp/libevent/WIN32-Code/getopt.c
+
+  sntp/libevent/WIN32-Code/getopt.c@1.0 +0 -0
+
+  sntp/libevent/WIN32-Code/getopt.h@1.1 +33 -0
+    BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/stenn/ntp-stable-2747/sntp/libevent/WIN32-Code/getopt.h
+
+  sntp/libevent/WIN32-Code/getopt.h@1.0 +0 -0
+
+  sntp/libevent/WIN32-Code/getopt_long.c@1.1 +233 -0
+    BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/stenn/ntp-stable-2747/sntp/libevent/WIN32-Code/getopt_long.c
+
+  sntp/libevent/WIN32-Code/getopt_long.c@1.0 +0 -0
+
+  sntp/libevent/WIN32-Code/nmake/event2/event-config.h@1.2 +2 -2
+    [Bug 2747] Upgrade libevent to 2.1.5-beta
+
+  sntp/libevent/WIN32-Code/tree.h@1.2 +0 -677
+    [Bug 2747] Upgrade libevent to 2.1.5-beta
+
+  sntp/libevent/buffer.c@1.10 +74 -10
+    [Bug 2747] Upgrade libevent to 2.1.5-beta
+
+  sntp/libevent/bufferevent.c@1.8 +9 -4
+    [Bug 2747] Upgrade libevent to 2.1.5-beta
+
+  sntp/libevent/bufferevent_async.c@1.7 +6 -4
+    [Bug 2747] Upgrade libevent to 2.1.5-beta
+
+  sntp/libevent/bufferevent_filter.c@1.7 +50 -23
+    [Bug 2747] Upgrade libevent to 2.1.5-beta
+
+  sntp/libevent/bufferevent_openssl.c@1.9 +2 -0
+    [Bug 2747] Upgrade libevent to 2.1.5-beta
+
+  sntp/libevent/bufferevent_pair.c@1.8 +32 -1
+    [Bug 2747] Upgrade libevent to 2.1.5-beta
+
+  sntp/libevent/configure.ac@1.17 +15 -18
+    [Bug 2747] Upgrade libevent to 2.1.5-beta
+
+  sntp/libevent/evbuffer-internal.h@1.8 +13 -1
+    [Bug 2747] Upgrade libevent to 2.1.5-beta
+
+  sntp/libevent/evdns.c@1.10 +80 -33
+    [Bug 2747] Upgrade libevent to 2.1.5-beta
+
+  sntp/libevent/event.c@1.13 +38 -10
+    [Bug 2747] Upgrade libevent to 2.1.5-beta
+
+  sntp/libevent/event_tagging.c@1.5 +14 -1
+    [Bug 2747] Upgrade libevent to 2.1.5-beta
+
+  sntp/libevent/evrpc-internal.h@1.3 +1 -0
+    [Bug 2747] Upgrade libevent to 2.1.5-beta
+
+  sntp/libevent/evthread-internal.h@1.7 +7 -0
+    [Bug 2747] Upgrade libevent to 2.1.5-beta
+
+  sntp/libevent/evthread.c@1.8 +17 -6
+    [Bug 2747] Upgrade libevent to 2.1.5-beta
+
+  sntp/libevent/evutil.c@1.10 +28 -14
+    [Bug 2747] Upgrade libevent to 2.1.5-beta
+
+  sntp/libevent/evutil_time.c@1.5 +50 -0
+    [Bug 2747] Upgrade libevent to 2.1.5-beta
+
+  sntp/libevent/ht-internal.h@1.4 +0 -1
+    [Bug 2747] Upgrade libevent to 2.1.5-beta
+
+  sntp/libevent/http-internal.h@1.6 +2 -0
+    [Bug 2747] Upgrade libevent to 2.1.5-beta
+
+  sntp/libevent/http.c@1.10 +45 -2
+    [Bug 2747] Upgrade libevent to 2.1.5-beta
+
+  sntp/libevent/include/event2/buffer.h@1.7 +3 -8
+    [Bug 2747] Upgrade libevent to 2.1.5-beta
+
+  sntp/libevent/include/event2/bufferevent.h@1.6 +5 -4
+    [Bug 2747] Upgrade libevent to 2.1.5-beta
+
+  sntp/libevent/include/event2/dns.h@1.7 +17 -1
+    [Bug 2747] Upgrade libevent to 2.1.5-beta
+
+  sntp/libevent/include/event2/event.h@1.10 +6 -0
+    [Bug 2747] Upgrade libevent to 2.1.5-beta
+
+  sntp/libevent/include/event2/http.h@1.7 +14 -0
+    [Bug 2747] Upgrade libevent to 2.1.5-beta
+
+  sntp/libevent/include/event2/listener.h@1.4 +9 -0
+    [Bug 2747] Upgrade libevent to 2.1.5-beta
+
+  sntp/libevent/include/event2/util.h@1.7 +69 -0
+    [Bug 2747] Upgrade libevent to 2.1.5-beta
+
+  sntp/libevent/kqueue.c@1.7 +17 -0
+    [Bug 2747] Upgrade libevent to 2.1.5-beta
+
+  sntp/libevent/listener.c@1.7 +5 -0
+    [Bug 2747] Upgrade libevent to 2.1.5-beta
+
+  sntp/libevent/sample/http-server.c@1.10 +5 -2
+    [Bug 2747] Upgrade libevent to 2.1.5-beta
+
+  sntp/libevent/sample/https-client.c@1.2 +15 -2
+    [Bug 2747] Upgrade libevent to 2.1.5-beta
+
+  sntp/libevent/sample/include.am@1.3 +2 -0
+    [Bug 2747] Upgrade libevent to 2.1.5-beta
+
+  sntp/libevent/test/include.am@1.4 +2 -1
+    [Bug 2747] Upgrade libevent to 2.1.5-beta
+
+  sntp/libevent/test/print-winsock-errors.c@1.1 +84 -0
+    BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/stenn/ntp-stable-2747/sntp/libevent/test/print-winsock-errors.c
+
+  sntp/libevent/test/print-winsock-errors.c@1.0 +0 -0
+
+  sntp/libevent/test/regress.c@1.6 +29 -8
+    [Bug 2747] Upgrade libevent to 2.1.5-beta
+
+  sntp/libevent/test/regress.h@1.5 +5 -1
+    [Bug 2747] Upgrade libevent to 2.1.5-beta
+
+  sntp/libevent/test/regress_buffer.c@1.8 +47 -6
+    [Bug 2747] Upgrade libevent to 2.1.5-beta
+
+  sntp/libevent/test/regress_bufferevent.c@1.6 +150 -2
+    [Bug 2747] Upgrade libevent to 2.1.5-beta
+
+  sntp/libevent/test/regress_dns.c@1.8 +141 -14
+    [Bug 2747] Upgrade libevent to 2.1.5-beta
+
+  sntp/libevent/test/regress_finalize.c@1.2 +1 -0
+    [Bug 2747] Upgrade libevent to 2.1.5-beta
+
+  sntp/libevent/test/regress_http.c@1.8 +107 -9
+    [Bug 2747] Upgrade libevent to 2.1.5-beta
+
+  sntp/libevent/test/regress_main.c@1.7 +4 -0
+    [Bug 2747] Upgrade libevent to 2.1.5-beta
+
+  sntp/libevent/test/regress_minheap.c@1.3 +3 -2
+    [Bug 2747] Upgrade libevent to 2.1.5-beta
+
+  sntp/libevent/test/regress_ssl.c@1.7 +1 -0
+    [Bug 2747] Upgrade libevent to 2.1.5-beta
+
+  sntp/libevent/test/regress_thread.c@1.6 +3 -2
+    [Bug 2747] Upgrade libevent to 2.1.5-beta
+
+  sntp/libevent/test/regress_util.c@1.7 +19 -17
+    [Bug 2747] Upgrade libevent to 2.1.5-beta
+
+  sntp/libevent/test/regress_zlib.c@1.5 +10 -7
+    [Bug 2747] Upgrade libevent to 2.1.5-beta
+
+  sntp/libevent/test/test-fdleak.c@1.2 +10 -10
+    [Bug 2747] Upgrade libevent to 2.1.5-beta
+
+  sntp/libevent/test/test-ratelim.c@1.9 +5 -6
+    [Bug 2747] Upgrade libevent to 2.1.5-beta
+
+  sntp/libevent/test/test-ratelim.sh@1.1 +88 -0
+    BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/stenn/ntp-stable-2747/sntp/libevent/test/test-ratelim.sh
+
+  sntp/libevent/test/test-ratelim.sh@1.0 +0 -0
+
+  sntp/libevent/test/test-time.c@1.5 +9 -6
+    [Bug 2747] Upgrade libevent to 2.1.5-beta
+
+  sntp/libevent/test/tinytest.c@1.6 +33 -0
+    [Bug 2747] Upgrade libevent to 2.1.5-beta
+
+  sntp/libevent/test/tinytest.h@1.4 +2 -0
+    [Bug 2747] Upgrade libevent to 2.1.5-beta
+
+  sntp/libevent/test/tinytest_demo.c@1.1 +260 -0
+    BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/stenn/ntp-stable-2747/sntp/libevent/test/tinytest_demo.c
+
+  sntp/libevent/test/tinytest_demo.c@1.0 +0 -0
+
+  sntp/libevent/test/tinytest_macros.h@1.3 +21 -6
+    [Bug 2747] Upgrade libevent to 2.1.5-beta
+
+  sntp/libevent/time-internal.h@1.2 +0 -3
+    [Bug 2747] Upgrade libevent to 2.1.5-beta
+
+  sntp/libevent/util-internal.h@1.10 +1 -1
+    [Bug 2747] Upgrade libevent to 2.1.5-beta
+
+  sntp/libevent/whatsnew-2.1.txt@1.4 +52 -1
+    [Bug 2747] Upgrade libevent to 2.1.5-beta
+
+  sntp/m4/LICENSE-OPENLDAP@1.2 +0 -0
+    Rename: sntp/libevent/m4/LICENSE-OPENLDAP -> sntp/m4/LICENSE-OPENLDAP
+
+  sntp/m4/openldap-thread-check.m4@1.5 +0 -0
+    Rename: sntp/libevent/m4/openldap-thread-check.m4 -> sntp/m4/openldap-thread-check.m4
+
+  sntp/m4/openldap.m4@1.2 +0 -0
+    Rename: sntp/libevent/m4/openldap.m4 -> sntp/m4/openldap.m4
+
+ChangeSet@1.3302, 2015-02-04 02:44:25-05:00, stenn@deacon.udel.edu
+  NTP_4_2_8P1
+  TAG: NTP_4_2_8P1
+
+  ChangeLog@1.1620 +1 -0
+    NTP_4_2_8P1
+
+  ntpd/invoke-ntp.conf.texi@1.177 +1 -1
+    NTP_4_2_8P1
+
+  ntpd/invoke-ntp.keys.texi@1.174 +1 -1
+    NTP_4_2_8P1
+
+  ntpd/invoke-ntpd.texi@1.490 +2 -2
+    NTP_4_2_8P1
+
+  ntpd/ntp.conf.5man@1.211 +3 -3
+    NTP_4_2_8P1
+
+  ntpd/ntp.conf.5mdoc@1.211 +2 -2
+    NTP_4_2_8P1
+
+  ntpd/ntp.conf.html@1.169 +1 -1
+    NTP_4_2_8P1
+
+  ntpd/ntp.conf.man.in@1.211 +3 -3
+    NTP_4_2_8P1
+
+  ntpd/ntp.conf.mdoc.in@1.211 +2 -2
+    NTP_4_2_8P1
+
+  ntpd/ntp.keys.5man@1.208 +2 -2
+    NTP_4_2_8P1
+
+  ntpd/ntp.keys.5mdoc@1.208 +2 -2
+    NTP_4_2_8P1
+
+  ntpd/ntp.keys.html@1.170 +1 -1
+    NTP_4_2_8P1
+
+  ntpd/ntp.keys.man.in@1.208 +2 -2
+    NTP_4_2_8P1
+
+  ntpd/ntp.keys.mdoc.in@1.208 +2 -2
+    NTP_4_2_8P1
+
+  ntpd/ntpd-opts.c@1.511 +239 -239
+    NTP_4_2_8P1
+
+  ntpd/ntpd-opts.h@1.510 +3 -3
+    NTP_4_2_8P1
+
+  ntpd/ntpd.1ntpdman@1.319 +3 -3
+    NTP_4_2_8P1
+
+  ntpd/ntpd.1ntpdmdoc@1.319 +2 -2
+    NTP_4_2_8P1
+
+  ntpd/ntpd.html@1.164 +2 -2
+    NTP_4_2_8P1
+
+  ntpd/ntpd.man.in@1.319 +3 -3
+    NTP_4_2_8P1
+
+  ntpd/ntpd.mdoc.in@1.319 +2 -2
+    NTP_4_2_8P1
+
+  ntpdc/invoke-ntpdc.texi@1.488 +2 -2
+    NTP_4_2_8P1
+
+  ntpdc/ntpdc-opts.c@1.506 +107 -107
+    NTP_4_2_8P1
+
+  ntpdc/ntpdc-opts.h@1.505 +3 -3
+    NTP_4_2_8P1
+
+  ntpdc/ntpdc.1ntpdcman@1.319 +3 -3
+    NTP_4_2_8P1
+
+  ntpdc/ntpdc.1ntpdcmdoc@1.319 +2 -2
+    NTP_4_2_8P1
+
+  ntpdc/ntpdc.html@1.332 +2 -2
+    NTP_4_2_8P1
+
+  ntpdc/ntpdc.man.in@1.319 +3 -3
+    NTP_4_2_8P1
+
+  ntpdc/ntpdc.mdoc.in@1.319 +2 -2
+    NTP_4_2_8P1
+
+  ntpq/invoke-ntpq.texi@1.494 +2 -2
+    NTP_4_2_8P1
+
+  ntpq/ntpq-opts.c@1.511 +106 -106
+    NTP_4_2_8P1
+
+  ntpq/ntpq-opts.h@1.509 +3 -3
+    NTP_4_2_8P1
+
+  ntpq/ntpq.1ntpqman@1.322 +3 -3
+    NTP_4_2_8P1
+
+  ntpq/ntpq.1ntpqmdoc@1.322 +2 -2
+    NTP_4_2_8P1
+
+  ntpq/ntpq.html@1.161 +2 -2
+    NTP_4_2_8P1
+
+  ntpq/ntpq.man.in@1.322 +3 -3
+    NTP_4_2_8P1
+
+  ntpq/ntpq.mdoc.in@1.322 +2 -2
+    NTP_4_2_8P1
+
+  ntpsnmpd/invoke-ntpsnmpd.texi@1.490 +2 -2
+    NTP_4_2_8P1
+
+  ntpsnmpd/ntpsnmpd-opts.c@1.508 +68 -68
+    NTP_4_2_8P1
+
+  ntpsnmpd/ntpsnmpd-opts.h@1.507 +3 -3
+    NTP_4_2_8P1
+
+  ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.319 +3 -3
+    NTP_4_2_8P1
+
+  ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.319 +2 -2
+    NTP_4_2_8P1
+
+  ntpsnmpd/ntpsnmpd.html@1.159 +1 -1
+    NTP_4_2_8P1
+
+  ntpsnmpd/ntpsnmpd.man.in@1.319 +3 -3
+    NTP_4_2_8P1
+
+  ntpsnmpd/ntpsnmpd.mdoc.in@1.319 +2 -2
+    NTP_4_2_8P1
+
+  packageinfo.sh@1.503 +3 -3
+    NTP_4_2_8P1
+
+  scripts/calc_tickadj/calc_tickadj.1calc_tickadjman@1.80 +3 -3
+    NTP_4_2_8P1
+
+  scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc@1.81 +2 -2
+    NTP_4_2_8P1
+
+  scripts/calc_tickadj/calc_tickadj.html@1.82 +1 -1
+    NTP_4_2_8P1
+
+  scripts/calc_tickadj/calc_tickadj.man.in@1.79 +3 -3
+    NTP_4_2_8P1
+
+  scripts/calc_tickadj/calc_tickadj.mdoc.in@1.81 +2 -2
+    NTP_4_2_8P1
+
+  scripts/calc_tickadj/invoke-calc_tickadj.texi@1.84 +1 -1
+    NTP_4_2_8P1
+
+  scripts/invoke-plot_summary.texi@1.101 +2 -2
+    NTP_4_2_8P1
+
+  scripts/invoke-summary.texi@1.101 +2 -2
+    NTP_4_2_8P1
+
+  scripts/ntp-wait/invoke-ntp-wait.texi@1.311 +2 -2
+    NTP_4_2_8P1
+
+  scripts/ntp-wait/ntp-wait-opts@1.47 +2 -2
+    NTP_4_2_8P1
+
+  scripts/ntp-wait/ntp-wait.1ntp-waitman@1.308 +3 -3
+    NTP_4_2_8P1
+
+  scripts/ntp-wait/ntp-wait.1ntp-waitmdoc@1.309 +2 -2
+    NTP_4_2_8P1
+
+  scripts/ntp-wait/ntp-wait.html@1.328 +2 -2
+    NTP_4_2_8P1
+
+  scripts/ntp-wait/ntp-wait.man.in@1.308 +3 -3
+    NTP_4_2_8P1
+
+  scripts/ntp-wait/ntp-wait.mdoc.in@1.309 +2 -2
+    NTP_4_2_8P1
+
+  scripts/ntpsweep/invoke-ntpsweep.texi@1.99 +2 -2
+    NTP_4_2_8P1
+
+  scripts/ntpsweep/ntpsweep-opts@1.49 +2 -2
+    NTP_4_2_8P1
+
+  scripts/ntpsweep/ntpsweep.1ntpsweepman@1.87 +3 -3
+    NTP_4_2_8P1
+
+  scripts/ntpsweep/ntpsweep.1ntpsweepmdoc@1.87 +2 -2
+    NTP_4_2_8P1
+
+  scripts/ntpsweep/ntpsweep.html@1.100 +2 -2
+    NTP_4_2_8P1
+
+  scripts/ntpsweep/ntpsweep.man.in@1.87 +3 -3
+    NTP_4_2_8P1
+
+  scripts/ntpsweep/ntpsweep.mdoc.in@1.88 +2 -2
+    NTP_4_2_8P1
+
+  scripts/ntptrace/invoke-ntptrace.texi@1.100 +2 -2
+    NTP_4_2_8P1
+
+  scripts/ntptrace/ntptrace-opts@1.49 +2 -2
+    NTP_4_2_8P1
+
+  scripts/ntptrace/ntptrace.1ntptraceman@1.87 +3 -3
+    NTP_4_2_8P1
+
+  scripts/ntptrace/ntptrace.1ntptracemdoc@1.88 +2 -2
+    NTP_4_2_8P1
+
+  scripts/ntptrace/ntptrace.html@1.101 +2 -2
+    NTP_4_2_8P1
+
+  scripts/ntptrace/ntptrace.man.in@1.87 +3 -3
+    NTP_4_2_8P1
+
+  scripts/ntptrace/ntptrace.mdoc.in@1.89 +2 -2
+    NTP_4_2_8P1
+
+  scripts/plot_summary-opts@1.49 +2 -2
+    NTP_4_2_8P1
+
+  scripts/plot_summary.1plot_summaryman@1.99 +3 -3
+    NTP_4_2_8P1
+
+  scripts/plot_summary.1plot_summarymdoc@1.99 +2 -2
+    NTP_4_2_8P1
+
+  scripts/plot_summary.html@1.102 +2 -2
+    NTP_4_2_8P1
+
+  scripts/plot_summary.man.in@1.99 +3 -3
+    NTP_4_2_8P1
+
+  scripts/plot_summary.mdoc.in@1.99 +2 -2
+    NTP_4_2_8P1
+
+  scripts/summary-opts@1.49 +2 -2
+    NTP_4_2_8P1
+
+  scripts/summary.1summaryman@1.99 +3 -3
+    NTP_4_2_8P1
+
+  scripts/summary.1summarymdoc@1.99 +2 -2
+    NTP_4_2_8P1
+
+  scripts/summary.html@1.102 +2 -2
+    NTP_4_2_8P1
+
+  scripts/summary.man.in@1.99 +3 -3
+    NTP_4_2_8P1
+
+  scripts/summary.mdoc.in@1.99 +2 -2
+    NTP_4_2_8P1
+
+  sntp/invoke-sntp.texi@1.487 +2 -2
+    NTP_4_2_8P1
+
+  sntp/sntp-opts.c@1.506 +159 -159
+    NTP_4_2_8P1
+
+  sntp/sntp-opts.h@1.504 +3 -3
+    NTP_4_2_8P1
+
+  sntp/sntp.1sntpman@1.322 +3 -3
+    NTP_4_2_8P1
+
+  sntp/sntp.1sntpmdoc@1.322 +2 -2
+    NTP_4_2_8P1
+
+  sntp/sntp.html@1.502 +2 -2
+    NTP_4_2_8P1
+
+  sntp/sntp.man.in@1.322 +3 -3
+    NTP_4_2_8P1
+
+  sntp/sntp.mdoc.in@1.322 +2 -2
+    NTP_4_2_8P1
+
+  util/invoke-ntp-keygen.texi@1.491 +2 -2
+    NTP_4_2_8P1
+
+  util/ntp-keygen-opts.c@1.509 +173 -173
+    NTP_4_2_8P1
+
+  util/ntp-keygen-opts.h@1.507 +3 -3
+    NTP_4_2_8P1
+
+  util/ntp-keygen.1ntp-keygenman@1.319 +3 -3
+    NTP_4_2_8P1
+
+  util/ntp-keygen.1ntp-keygenmdoc@1.319 +2 -2
+    NTP_4_2_8P1
+
+  util/ntp-keygen.html@1.165 +2 -2
+    NTP_4_2_8P1
+
+  util/ntp-keygen.man.in@1.319 +3 -3
+    NTP_4_2_8P1
+
+  util/ntp-keygen.mdoc.in@1.319 +2 -2
+    NTP_4_2_8P1
+
+ChangeSet@1.3301, 2015-02-04 02:22:55-05:00, stenn@deacon.udel.edu
+  ntp-4.2.8p1
+
+  packageinfo.sh@1.502 +1 -1
+    ntp-4.2.8p1
+
+ChangeSet@1.3300, 2015-02-04 07:16:30+00:00, stenn@psp-deb1.ntp.org
+  Update the ChangeLog and NEWS files
+
+  ChangeLog@1.1619 +4 -1
+    Update the ChangeLog and NEWS files
+
+  NEWS@1.130 +60 -0
+    Update the ChangeLog and NEWS files
+
+ChangeSet@1.3292.1.20, 2015-01-29 19:14:37-05:00, stenn@deacon.udel.edu
+  NTP_4_2_8P1_RC2
+  TAG: NTP_4_2_8P1_RC2
+
+  ChangeLog@1.1613.1.18 +1 -0
+    NTP_4_2_8P1_RC2
+
+  ntpd/invoke-ntp.conf.texi@1.176 +1 -1
+    NTP_4_2_8P1_RC2
+
+  ntpd/invoke-ntp.keys.texi@1.173 +1 -1
+    NTP_4_2_8P1_RC2
+
+  ntpd/invoke-ntpd.texi@1.489 +2 -2
+    NTP_4_2_8P1_RC2
+
+  ntpd/ntp.conf.5man@1.210 +3 -3
+    NTP_4_2_8P1_RC2
+
+  ntpd/ntp.conf.5mdoc@1.210 +2 -2
+    NTP_4_2_8P1_RC2
+
+  ntpd/ntp.conf.html@1.168 +1 -1
+    NTP_4_2_8P1_RC2
+
+  ntpd/ntp.conf.man.in@1.210 +3 -3
+    NTP_4_2_8P1_RC2
+
+  ntpd/ntp.conf.mdoc.in@1.210 +2 -2
+    NTP_4_2_8P1_RC2
+
+  ntpd/ntp.keys.5man@1.207 +2 -2
+    NTP_4_2_8P1_RC2
+
+  ntpd/ntp.keys.5mdoc@1.207 +2 -2
+    NTP_4_2_8P1_RC2
+
+  ntpd/ntp.keys.html@1.169 +1 -1
+    NTP_4_2_8P1_RC2
+
+  ntpd/ntp.keys.man.in@1.207 +2 -2
+    NTP_4_2_8P1_RC2
+
+  ntpd/ntp.keys.mdoc.in@1.207 +2 -2
+    NTP_4_2_8P1_RC2
+
+  ntpd/ntpd-opts.c@1.510 +7 -7
+    NTP_4_2_8P1_RC2
+
+  ntpd/ntpd-opts.h@1.509 +3 -3
+    NTP_4_2_8P1_RC2
+
+  ntpd/ntpd.1ntpdman@1.318 +3 -3
+    NTP_4_2_8P1_RC2
+
+  ntpd/ntpd.1ntpdmdoc@1.318 +2 -2
+    NTP_4_2_8P1_RC2
+
+  ntpd/ntpd.html@1.163 +2 -2
+    NTP_4_2_8P1_RC2
+
+  ntpd/ntpd.man.in@1.318 +3 -3
+    NTP_4_2_8P1_RC2
+
+  ntpd/ntpd.mdoc.in@1.318 +2 -2
+    NTP_4_2_8P1_RC2
+
+  ntpdc/invoke-ntpdc.texi@1.487 +2 -2
+    NTP_4_2_8P1_RC2
+
+  ntpdc/ntpdc-opts.c@1.505 +7 -7
+    NTP_4_2_8P1_RC2
+
+  ntpdc/ntpdc-opts.h@1.504 +3 -3
+    NTP_4_2_8P1_RC2
+
+  ntpdc/ntpdc.1ntpdcman@1.318 +3 -3
+    NTP_4_2_8P1_RC2
+
+  ntpdc/ntpdc.1ntpdcmdoc@1.318 +2 -2
+    NTP_4_2_8P1_RC2
+
+  ntpdc/ntpdc.html@1.331 +2 -2
+    NTP_4_2_8P1_RC2
+
+  ntpdc/ntpdc.man.in@1.318 +3 -3
+    NTP_4_2_8P1_RC2
+
+  ntpdc/ntpdc.mdoc.in@1.318 +2 -2
+    NTP_4_2_8P1_RC2
+
+  ntpq/invoke-ntpq.texi@1.493 +2 -2
+    NTP_4_2_8P1_RC2
+
+  ntpq/ntpq-opts.c@1.510 +7 -7
+    NTP_4_2_8P1_RC2
+
+  ntpq/ntpq-opts.h@1.508 +3 -3
+    NTP_4_2_8P1_RC2
+
+  ntpq/ntpq.1ntpqman@1.321 +3 -3
+    NTP_4_2_8P1_RC2
+
+  ntpq/ntpq.1ntpqmdoc@1.321 +2 -2
+    NTP_4_2_8P1_RC2
+
+  ntpq/ntpq.html@1.160 +2 -2
+    NTP_4_2_8P1_RC2
+
+  ntpq/ntpq.man.in@1.321 +3 -3
+    NTP_4_2_8P1_RC2
+
+  ntpq/ntpq.mdoc.in@1.321 +2 -2
+    NTP_4_2_8P1_RC2
+
+  ntpsnmpd/invoke-ntpsnmpd.texi@1.489 +2 -2
+    NTP_4_2_8P1_RC2
+
+  ntpsnmpd/ntpsnmpd-opts.c@1.507 +7 -7
+    NTP_4_2_8P1_RC2
+
+  ntpsnmpd/ntpsnmpd-opts.h@1.506 +3 -3
+    NTP_4_2_8P1_RC2
+
+  ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.318 +3 -3
+    NTP_4_2_8P1_RC2
+
+  ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.318 +2 -2
+    NTP_4_2_8P1_RC2
+
+  ntpsnmpd/ntpsnmpd.html@1.158 +1 -1
+    NTP_4_2_8P1_RC2
+
+  ntpsnmpd/ntpsnmpd.man.in@1.318 +3 -3
+    NTP_4_2_8P1_RC2
+
+  ntpsnmpd/ntpsnmpd.mdoc.in@1.318 +2 -2
+    NTP_4_2_8P1_RC2
+
+  packageinfo.sh@1.501 +1 -1
+    NTP_4_2_8P1_RC2
+
+  scripts/calc_tickadj/calc_tickadj.1calc_tickadjman@1.79 +3 -3
+    NTP_4_2_8P1_RC2
+
+  scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc@1.80 +2 -2
+    NTP_4_2_8P1_RC2
+
+  scripts/calc_tickadj/calc_tickadj.html@1.81 +1 -1
+    NTP_4_2_8P1_RC2
+
+  scripts/calc_tickadj/calc_tickadj.man.in@1.78 +3 -3
+    NTP_4_2_8P1_RC2
+
+  scripts/calc_tickadj/calc_tickadj.mdoc.in@1.80 +2 -2
+    NTP_4_2_8P1_RC2
+
+  scripts/calc_tickadj/invoke-calc_tickadj.texi@1.83 +1 -1
+    NTP_4_2_8P1_RC2
+
+  scripts/invoke-plot_summary.texi@1.100 +2 -2
+    NTP_4_2_8P1_RC2
+
+  scripts/invoke-summary.texi@1.100 +2 -2
+    NTP_4_2_8P1_RC2
+
+  scripts/ntp-wait/invoke-ntp-wait.texi@1.310 +2 -2
+    NTP_4_2_8P1_RC2
+
+  scripts/ntp-wait/ntp-wait-opts@1.46 +2 -2
+    NTP_4_2_8P1_RC2
+
+  scripts/ntp-wait/ntp-wait.1ntp-waitman@1.307 +3 -3
+    NTP_4_2_8P1_RC2
+
+  scripts/ntp-wait/ntp-wait.1ntp-waitmdoc@1.308 +2 -2
+    NTP_4_2_8P1_RC2
+
+  scripts/ntp-wait/ntp-wait.html@1.327 +2 -2
+    NTP_4_2_8P1_RC2
+
+  scripts/ntp-wait/ntp-wait.man.in@1.307 +3 -3
+    NTP_4_2_8P1_RC2
+
+  scripts/ntp-wait/ntp-wait.mdoc.in@1.308 +2 -2
+    NTP_4_2_8P1_RC2
+
+  scripts/ntpsweep/invoke-ntpsweep.texi@1.98 +2 -2
+    NTP_4_2_8P1_RC2
+
+  scripts/ntpsweep/ntpsweep-opts@1.48 +2 -2
+    NTP_4_2_8P1_RC2
+
+  scripts/ntpsweep/ntpsweep.1ntpsweepman@1.86 +3 -3
+    NTP_4_2_8P1_RC2
+
+  scripts/ntpsweep/ntpsweep.1ntpsweepmdoc@1.86 +2 -2
+    NTP_4_2_8P1_RC2
+
+  scripts/ntpsweep/ntpsweep.html@1.99 +2 -2
+    NTP_4_2_8P1_RC2
+
+  scripts/ntpsweep/ntpsweep.man.in@1.86 +3 -3
+    NTP_4_2_8P1_RC2
+
+  scripts/ntpsweep/ntpsweep.mdoc.in@1.87 +2 -2
+    NTP_4_2_8P1_RC2
+
+  scripts/ntptrace/invoke-ntptrace.texi@1.99 +2 -2
+    NTP_4_2_8P1_RC2
+
+  scripts/ntptrace/ntptrace-opts@1.48 +2 -2
+    NTP_4_2_8P1_RC2
+
+  scripts/ntptrace/ntptrace.1ntptraceman@1.86 +3 -3
+    NTP_4_2_8P1_RC2
+
+  scripts/ntptrace/ntptrace.1ntptracemdoc@1.87 +2 -2
+    NTP_4_2_8P1_RC2
+
+  scripts/ntptrace/ntptrace.html@1.100 +2 -2
+    NTP_4_2_8P1_RC2
+
+  scripts/ntptrace/ntptrace.man.in@1.86 +3 -3
+    NTP_4_2_8P1_RC2
+
+  scripts/ntptrace/ntptrace.mdoc.in@1.88 +2 -2
+    NTP_4_2_8P1_RC2
+
+  scripts/plot_summary-opts@1.48 +2 -2
+    NTP_4_2_8P1_RC2
+
+  scripts/plot_summary.1plot_summaryman@1.98 +3 -3
+    NTP_4_2_8P1_RC2
+
+  scripts/plot_summary.1plot_summarymdoc@1.98 +2 -2
+    NTP_4_2_8P1_RC2
+
+  scripts/plot_summary.html@1.101 +2 -2
+    NTP_4_2_8P1_RC2
+
+  scripts/plot_summary.man.in@1.98 +3 -3
+    NTP_4_2_8P1_RC2
+
+  scripts/plot_summary.mdoc.in@1.98 +2 -2
+    NTP_4_2_8P1_RC2
+
+  scripts/summary-opts@1.48 +2 -2
+    NTP_4_2_8P1_RC2
+
+  scripts/summary.1summaryman@1.98 +3 -3
+    NTP_4_2_8P1_RC2
+
+  scripts/summary.1summarymdoc@1.98 +2 -2
+    NTP_4_2_8P1_RC2
+
+  scripts/summary.html@1.101 +2 -2
+    NTP_4_2_8P1_RC2
+
+  scripts/summary.man.in@1.98 +3 -3
+    NTP_4_2_8P1_RC2
+
+  scripts/summary.mdoc.in@1.98 +2 -2
+    NTP_4_2_8P1_RC2
+
+  sntp/invoke-sntp.texi@1.486 +2 -2
+    NTP_4_2_8P1_RC2
+
+  sntp/sntp-opts.c@1.505 +7 -7
+    NTP_4_2_8P1_RC2
+
+  sntp/sntp-opts.h@1.503 +3 -3
+    NTP_4_2_8P1_RC2
+
+  sntp/sntp.1sntpman@1.321 +3 -3
+    NTP_4_2_8P1_RC2
+
+  sntp/sntp.1sntpmdoc@1.321 +2 -2
+    NTP_4_2_8P1_RC2
+
+  sntp/sntp.html@1.501 +2 -2
+    NTP_4_2_8P1_RC2
+
+  sntp/sntp.man.in@1.321 +3 -3
+    NTP_4_2_8P1_RC2
+
+  sntp/sntp.mdoc.in@1.321 +2 -2
+    NTP_4_2_8P1_RC2
+
+  util/invoke-ntp-keygen.texi@1.490 +2 -2
+    NTP_4_2_8P1_RC2
+
+  util/ntp-keygen-opts.c@1.508 +7 -7
+    NTP_4_2_8P1_RC2
+
+  util/ntp-keygen-opts.h@1.506 +3 -3
+    NTP_4_2_8P1_RC2
+
+  util/ntp-keygen.1ntp-keygenman@1.318 +3 -3
+    NTP_4_2_8P1_RC2
+
+  util/ntp-keygen.1ntp-keygenmdoc@1.318 +2 -2
+    NTP_4_2_8P1_RC2
+
+  util/ntp-keygen.html@1.164 +2 -2
+    NTP_4_2_8P1_RC2
+
+  util/ntp-keygen.man.in@1.318 +3 -3
+    NTP_4_2_8P1_RC2
+
+  util/ntp-keygen.mdoc.in@1.318 +2 -2
+    NTP_4_2_8P1_RC2
+
+ChangeSet@1.3292.5.2, 2015-01-29 00:34:07+00:00, stenn@psp-deb1.ntp.org
+  typo
+
+  ChangeLog@1.1613.5.2 +2 -0
+    typo
+
+ChangeSet@1.3292.4.3, 2015-01-29 00:23:57+00:00, stenn@psp-deb1.ntp.org
+  typos
+
+  ChangeLog@1.1613.4.3 +5 -3
+    typos
+
+ChangeSet@1.3292.4.2, 2015-01-28 23:39:54+01:00, martin@pc-martin.fritz.box
+  Bug 2741 - Incorrect buffer check in parsestatus()
+
+  ChangeLog@1.1613.4.2 +2 -1
+    Bug 2741 - Incorrect buffer check in parsestatus()
+
+  ntpd/refclock_parse.c@1.71 +1 -1
+    Bug 2741 - Incorrect buffer check in parsestatus()
+
+ChangeSet@1.3292.2.3, 2015-01-28 22:06:47+01:00, jnperlin@nemesis.localnet
+  [bug 2732] Bug 2732 - Leap second not handled correctly on Windows 8
+   Guard against slewing twice. Something weird is happening under Win8/8.1. 
+
+  ports/winnt/ntpd/nt_clockstuff.c@1.64 +2 -2
+    [bug 2732] Bug 2732 - Leap second not handled correctly on Windows 8
+     Guard against slewing twice. Something weird is happening under Win8/8.1. 
+
+ChangeSet@1.3292.5.1, 2015-01-28 17:04:07+01:00, martin@pc-martin.(none)
+  [Bug 2740] Removed some obsolete code from the parse driver.
+
+  ChangeLog@1.1613.5.1 +1 -0
+    [Bug 2740] Removed some obsolete code from the parse driver.
+
+  ntpd/refclock_parse.c@1.69.1.1 +1 -14
+    [Bug 2740] Removed some obsolete code from the parse driver, as discussed with Frank Kardel.
+
+ChangeSet@1.3292.4.1, 2015-01-27 16:33:33+01:00, martin@pc-martin.(none)
+  [Bug 2738] Missing buffer initialisation in parsestate().
+  [Bug 2739] Parse driver with PPS enabled occasionaly evaluates PPS timestamp with wrong sign.
+  Removed some German umlauts.
+
+  ChangeLog@1.1613.4.1 +4 -0
+    [Bug 2738] Missing buffer initialisation in parsestate().
+    [Bug 2739] Parse driver with PPS enabled occasionaly evaluates PPS timestamp with wrong sign.
+    Removed some German umlauts.
+    
+
+  ntpd/refclock_parse.c@1.70 +3 -2
+    [Bug 2738] Missing buffer initialisation in parsestate().
+    [Bug 2739] Parse driver with PPS enabled occasionaly evaluates PPS timestamp with wrong sign. 
+    Removed some German umlauts.
+
+ChangeSet@1.3292.1.16, 2015-01-27 00:26:25+01:00, jnperlin@hydra.(none)
+  * [Bug 2627] rework: reverted sense of mode bit (so default reflects previous behaviour) and updated ducumentation.
+
+  ChangeLog@1.1613.1.14 +4 -0
+    * [Bug 2627] rework: reverted sense of mode bit (so default reflects previous behaviour) and updated ducumentation.
+
+  html/drivers/driver28.html@1.18 +3 -2
+    * [Bug 2627] rework: updated documentation
+
+  ntpd/refclock_shm.c@1.31 +2 -7
+    * [Bug 2627] rework: reverted sense of mode bit (so default reflects previous behaviour).
+
+ChangeSet@1.3292.2.2, 2015-01-26 23:42:37+01:00, jnperlin@nemesis.localnet
+  [Bug 2732] - Leap second not handled correctly on Windows 8
+    use 'GetTickCount()' to get the true elapsed time of slew
+   (This should work for all versions of Windows >= W2K)
+
+  ChangeLog@1.1613.3.1 +4 -0
+    [Bug 2732] - Leap second not handled correctly on Windows 8
+      use 'GetTickCount()' to get the true elapsed time of slew
+     (This should work for all versions of Windows >= W2K)
+
+  ports/winnt/ntpd/nt_clockstuff.c@1.63 +1 -1
+    [Bug 2732] - Leap second not handled correctly on Windows 8
+      use 'GetTickCount()' to get the true elapsed time of slew
+      (This should work for all versions of Windows >= W2K)
+      Start 1.5 secs before schedule to minimise phase shift errors
+
+ChangeSet@1.3292.1.15, 2015-01-24 20:47:20-05:00, stenn@deacon.udel.edu
+  NTP_4_2_8P1_RC1
+  TAG: NTP_4_2_8P1_RC1
+
+  ChangeLog@1.1613.1.13 +1 -0
+    NTP_4_2_8P1_RC1
+
+  ntpd/invoke-ntp.conf.texi@1.175 +1 -1
+    NTP_4_2_8P1_RC1
+
+  ntpd/invoke-ntp.keys.texi@1.172 +1 -1
+    NTP_4_2_8P1_RC1
+
+  ntpd/invoke-ntpd.texi@1.488 +2 -2
+    NTP_4_2_8P1_RC1
+
+  ntpd/ntp.conf.5man@1.209 +5 -5
+    NTP_4_2_8P1_RC1
+
+  ntpd/ntp.conf.5mdoc@1.209 +4 -4
+    NTP_4_2_8P1_RC1
+
+  ntpd/ntp.conf.html@1.167 +1 -1
+    NTP_4_2_8P1_RC1
+
+  ntpd/ntp.conf.man.in@1.209 +5 -5
+    NTP_4_2_8P1_RC1
+
+  ntpd/ntp.conf.mdoc.in@1.209 +4 -4
+    NTP_4_2_8P1_RC1
+
+  ntpd/ntp.keys.5man@1.206 +4 -4
+    NTP_4_2_8P1_RC1
+
+  ntpd/ntp.keys.5mdoc@1.206 +4 -4
+    NTP_4_2_8P1_RC1
+
+  ntpd/ntp.keys.html@1.168 +1 -1
+    NTP_4_2_8P1_RC1
+
+  ntpd/ntp.keys.man.in@1.206 +4 -4
+    NTP_4_2_8P1_RC1
+
+  ntpd/ntp.keys.mdoc.in@1.206 +4 -4
+    NTP_4_2_8P1_RC1
+
+  ntpd/ntpd-opts.c@1.509 +251 -249
+    NTP_4_2_8P1_RC1
+
+  ntpd/ntpd-opts.h@1.508 +5 -5
+    NTP_4_2_8P1_RC1
+
+  ntpd/ntpd.1ntpdman@1.317 +5 -5
+    NTP_4_2_8P1_RC1
+
+  ntpd/ntpd.1ntpdmdoc@1.317 +4 -4
+    NTP_4_2_8P1_RC1
+
+  ntpd/ntpd.html@1.162 +2 -2
+    NTP_4_2_8P1_RC1
+
+  ntpd/ntpd.man.in@1.317 +5 -5
+    NTP_4_2_8P1_RC1
+
+  ntpd/ntpd.mdoc.in@1.317 +4 -4
+    NTP_4_2_8P1_RC1
+
+  ntpdc/invoke-ntpdc.texi@1.486 +2 -2
+    NTP_4_2_8P1_RC1
+
+  ntpdc/ntpdc-opts.c@1.504 +119 -117
+    NTP_4_2_8P1_RC1
+
+  ntpdc/ntpdc-opts.h@1.503 +5 -5
+    NTP_4_2_8P1_RC1
+
+  ntpdc/ntpdc.1ntpdcman@1.317 +4 -4
+    NTP_4_2_8P1_RC1
+
+  ntpdc/ntpdc.1ntpdcmdoc@1.317 +3 -3
+    NTP_4_2_8P1_RC1
+
+  ntpdc/ntpdc.html@1.330 +58 -88
+    NTP_4_2_8P1_RC1
+
+  ntpdc/ntpdc.man.in@1.317 +4 -4
+    NTP_4_2_8P1_RC1
+
+  ntpdc/ntpdc.mdoc.in@1.317 +3 -3
+    NTP_4_2_8P1_RC1
+
+  ntpq/invoke-ntpq.texi@1.492 +2 -2
+    NTP_4_2_8P1_RC1
+
+  ntpq/ntpq-opts.c@1.509 +118 -116
+    NTP_4_2_8P1_RC1
+
+  ntpq/ntpq-opts.h@1.507 +5 -5
+    NTP_4_2_8P1_RC1
+
+  ntpq/ntpq.1ntpqman@1.320 +5 -5
+    NTP_4_2_8P1_RC1
+
+  ntpq/ntpq.1ntpqmdoc@1.320 +4 -4
+    NTP_4_2_8P1_RC1
+
+  ntpq/ntpq.html@1.159 +2 -2
+    NTP_4_2_8P1_RC1
+
+  ntpq/ntpq.man.in@1.320 +5 -5
+    NTP_4_2_8P1_RC1
+
+  ntpq/ntpq.mdoc.in@1.320 +4 -4
+    NTP_4_2_8P1_RC1
+
+  ntpsnmpd/invoke-ntpsnmpd.texi@1.488 +2 -2
+    NTP_4_2_8P1_RC1
+
+  ntpsnmpd/ntpsnmpd-opts.c@1.506 +80 -78
+    NTP_4_2_8P1_RC1
+
+  ntpsnmpd/ntpsnmpd-opts.h@1.505 +5 -5
+    NTP_4_2_8P1_RC1
+
+  ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.317 +4 -4
+    NTP_4_2_8P1_RC1
+
+  ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.317 +3 -3
+    NTP_4_2_8P1_RC1
+
+  ntpsnmpd/ntpsnmpd.html@1.157 +1 -1
+    NTP_4_2_8P1_RC1
+
+  ntpsnmpd/ntpsnmpd.man.in@1.317 +4 -4
+    NTP_4_2_8P1_RC1
+
+  ntpsnmpd/ntpsnmpd.mdoc.in@1.317 +3 -3
+    NTP_4_2_8P1_RC1
+
+  packageinfo.sh@1.500 +1 -1
+    NTP_4_2_8P1_RC1
+
+  scripts/calc_tickadj/calc_tickadj.1calc_tickadjman@1.78 +3 -3
+    NTP_4_2_8P1_RC1
+
+  scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc@1.79 +2 -2
+    NTP_4_2_8P1_RC1
+
+  scripts/calc_tickadj/calc_tickadj.html@1.80 +1 -1
+    NTP_4_2_8P1_RC1
+
+  scripts/calc_tickadj/calc_tickadj.man.in@1.77 +3 -3
+    NTP_4_2_8P1_RC1
+
+  scripts/calc_tickadj/calc_tickadj.mdoc.in@1.79 +2 -2
+    NTP_4_2_8P1_RC1
+
+  scripts/calc_tickadj/invoke-calc_tickadj.texi@1.82 +1 -1
+    NTP_4_2_8P1_RC1
+
+  scripts/invoke-plot_summary.texi@1.99 +2 -2
+    NTP_4_2_8P1_RC1
+
+  scripts/invoke-summary.texi@1.99 +2 -2
+    NTP_4_2_8P1_RC1
+
+  scripts/ntp-wait/invoke-ntp-wait.texi@1.309 +2 -2
+    NTP_4_2_8P1_RC1
+
+  scripts/ntp-wait/ntp-wait-opts@1.45 +2 -2
+    NTP_4_2_8P1_RC1
+
+  scripts/ntp-wait/ntp-wait.1ntp-waitman@1.306 +3 -3
+    NTP_4_2_8P1_RC1
+
+  scripts/ntp-wait/ntp-wait.1ntp-waitmdoc@1.307 +2 -2
+    NTP_4_2_8P1_RC1
+
+  scripts/ntp-wait/ntp-wait.html@1.326 +31 -49
+    NTP_4_2_8P1_RC1
+
+  scripts/ntp-wait/ntp-wait.man.in@1.306 +3 -3
+    NTP_4_2_8P1_RC1
+
+  scripts/ntp-wait/ntp-wait.mdoc.in@1.307 +2 -2
+    NTP_4_2_8P1_RC1
+
+  scripts/ntpsweep/invoke-ntpsweep.texi@1.97 +2 -2
+    NTP_4_2_8P1_RC1
+
+  scripts/ntpsweep/ntpsweep-opts@1.47 +2 -2
+    NTP_4_2_8P1_RC1
+
+  scripts/ntpsweep/ntpsweep.1ntpsweepman@1.85 +3 -3
+    NTP_4_2_8P1_RC1
+
+  scripts/ntpsweep/ntpsweep.1ntpsweepmdoc@1.85 +2 -2
+    NTP_4_2_8P1_RC1
+
+  scripts/ntpsweep/ntpsweep.html@1.98 +2 -2
+    NTP_4_2_8P1_RC1
+
+  scripts/ntpsweep/ntpsweep.man.in@1.85 +3 -3
+    NTP_4_2_8P1_RC1
+
+  scripts/ntpsweep/ntpsweep.mdoc.in@1.86 +2 -2
+    NTP_4_2_8P1_RC1
+
+  scripts/ntptrace/invoke-ntptrace.texi@1.98 +2 -2
+    NTP_4_2_8P1_RC1
+
+  scripts/ntptrace/ntptrace-opts@1.47 +2 -2
+    NTP_4_2_8P1_RC1
+
+  scripts/ntptrace/ntptrace.1ntptraceman@1.85 +3 -3
+    NTP_4_2_8P1_RC1
+
+  scripts/ntptrace/ntptrace.1ntptracemdoc@1.86 +2 -2
+    NTP_4_2_8P1_RC1
+
+  scripts/ntptrace/ntptrace.html@1.99 +27 -36
+    NTP_4_2_8P1_RC1
+
+  scripts/ntptrace/ntptrace.man.in@1.85 +3 -3
+    NTP_4_2_8P1_RC1
+
+  scripts/ntptrace/ntptrace.mdoc.in@1.87 +2 -2
+    NTP_4_2_8P1_RC1
+
+  scripts/plot_summary-opts@1.47 +2 -2
+    NTP_4_2_8P1_RC1
+
+  scripts/plot_summary.1plot_summaryman@1.97 +3 -3
+    NTP_4_2_8P1_RC1
+
+  scripts/plot_summary.1plot_summarymdoc@1.97 +2 -2
+    NTP_4_2_8P1_RC1
+
+  scripts/plot_summary.html@1.100 +2 -2
+    NTP_4_2_8P1_RC1
+
+  scripts/plot_summary.man.in@1.97 +3 -3
+    NTP_4_2_8P1_RC1
+
+  scripts/plot_summary.mdoc.in@1.97 +2 -2
+    NTP_4_2_8P1_RC1
+
+  scripts/summary-opts@1.47 +2 -2
+    NTP_4_2_8P1_RC1
+
+  scripts/summary.1summaryman@1.97 +3 -3
+    NTP_4_2_8P1_RC1
+
+  scripts/summary.1summarymdoc@1.97 +2 -2
+    NTP_4_2_8P1_RC1
+
+  scripts/summary.html@1.100 +2 -2
+    NTP_4_2_8P1_RC1
+
+  scripts/summary.man.in@1.97 +3 -3
+    NTP_4_2_8P1_RC1
+
+  scripts/summary.mdoc.in@1.97 +2 -2
+    NTP_4_2_8P1_RC1
+
+  sntp/invoke-sntp.texi@1.485 +5 -3
+    NTP_4_2_8P1_RC1
+
+  sntp/sntp-opts.c@1.504 +174 -170
+    NTP_4_2_8P1_RC1
+
+  sntp/sntp-opts.h@1.502 +5 -5
+    NTP_4_2_8P1_RC1
+
+  sntp/sntp.1sntpman@1.320 +24 -8
+    NTP_4_2_8P1_RC1
+
+  sntp/sntp.1sntpmdoc@1.320 +22 -7
+    NTP_4_2_8P1_RC1
+
+  sntp/sntp.html@1.500 +88 -120
+    NTP_4_2_8P1_RC1
+
+  sntp/sntp.man.in@1.320 +24 -8
+    NTP_4_2_8P1_RC1
+
+  sntp/sntp.mdoc.in@1.320 +22 -7
+    NTP_4_2_8P1_RC1
+
+  util/invoke-ntp-keygen.texi@1.489 +2 -2
+    NTP_4_2_8P1_RC1
+
+  util/ntp-keygen-opts.c@1.507 +185 -183
+    NTP_4_2_8P1_RC1
+
+  util/ntp-keygen-opts.h@1.505 +5 -5
+    NTP_4_2_8P1_RC1
+
+  util/ntp-keygen.1ntp-keygenman@1.317 +5 -5
+    NTP_4_2_8P1_RC1
+
+  util/ntp-keygen.1ntp-keygenmdoc@1.317 +4 -4
+    NTP_4_2_8P1_RC1
+
+  util/ntp-keygen.html@1.163 +2 -2
+    NTP_4_2_8P1_RC1
+
+  util/ntp-keygen.man.in@1.317 +5 -5
+    NTP_4_2_8P1_RC1
+
+  util/ntp-keygen.mdoc.in@1.317 +4 -4
+    NTP_4_2_8P1_RC1
+
+ChangeSet@1.3292.1.14, 2015-01-24 10:44:12+00:00, stenn@psp-fb1.ntp.org
+  [Bug 2736] Show error message if we cannot open the config file
+
+  ChangeLog@1.1613.1.12 +1 -0
+    [Bug 2736] Show error message if we cannot open the config file
+
+  ntpd/ntp_config.c@1.322 +2 -2
+    [Bug 2736] Show error message if we cannot open the config file
+
+ChangeSet@1.3292.1.12, 2015-01-24 04:02:10+00:00, stenn@psp-deb1.ntp.org
+  Copyright update
+
+  html/copyright.html@1.67 +2 -2
+    Copyright update
+
+ChangeSet@1.3292.1.11, 2015-01-24 03:09:26+00:00, stenn@psp-fb1.ntp.org
+  typo fix
+
+  sntp/include/ntp.lic@1.8 +1 -3
+    typo fix
+
+ChangeSet@1.3292.3.5, 2015-01-24 02:27:46+00:00, stenn@psp-fb1.ntp.org
+  Start the RC for 4.2.8p1
+
+  ChangeLog@1.1613.2.5 +1 -0
+
+  packageinfo.sh@1.499 +1 -1
+
+ChangeSet@1.3292.3.4, 2015-01-24 01:54:36+00:00, stenn@psp-fb1.ntp.org
+  [Bug 2187] Update version number generation scripts
+
+  ChangeLog@1.1613.2.4 +1 -0
+    [Bug 2187] Update version number generation scripts
+
+  scripts/build/UpdatePoint@1.7 +12 -6
+    [Bug 2187] Update version number generation scripts
+
+  scripts/build/VersionName@1.9 +12 -3
+    [Bug 2187] Update version number generation scripts
+
+ChangeSet@1.3292.3.3, 2015-01-24 01:52:52+00:00, stenn@psp-fb1.ntp.org
+  Fix the package name
+
+  ChangeLog@1.1613.2.3 +1 -0
+    Fix the package name
+
+  configure.ac@1.579.1.1 +1 -1
+    Fix the package name
+
+ChangeSet@1.3292.3.2, 2015-01-23 10:29:31+00:00, stenn@psp-fb1.ntp.org
+  [Sec 2672] Code cleanup: On some OSes ::1 can be spoofed...
+
+  ChangeLog@1.1613.2.2 +1 -0
+    [Sec 2672] Code cleanup: On some OSes ::1 can be spoofed...
+
+  ntpd/ntp_io.c@1.399 +10 -12
+    [Sec 2672] Code cleanup: On some OSes ::1 can be spoofed...
+
+ChangeSet@1.3292.3.1, 2015-01-23 10:16:23+00:00, stenn@psp-fb1.ntp.org
+  [Bug 2617] Fix sntp Usage documentation section
+
+  ChangeLog@1.1613.2.1 +3 -0
+    [Bug 2617] Fix sntp Usage documentation section
+
+  sntp/sntp-opts.def@1.46 +19 -4
+    [Bug 2617] Fix sntp Usage documentation section
+
+ChangeSet@1.3292.2.1, 2015-01-21 19:16:29+01:00, jnperlin@nemesis.localnet
+  [bug 2732] leapsecond processing buggy with win8
+
+  ports/winnt/ntpd/nt_clockstuff.c@1.62 +19 -14
+    [bug 2732] leapsecond processing buggy with win8
+
+ChangeSet@1.3281.1.3, 2015-01-14 10:52:55+00:00, stenn@psp-fb1.ntp.org
+  Copyright update
+
+  ChangeLog@1.1604.1.3 +1 -0
+    Copyright update
+
+  html/copyright.html@1.66 +35 -3
+    Copyright update
+
+  ntpd/invoke-ntp.conf.texi@1.170.1.1 +12 -2
+    update
+
+  ntpd/invoke-ntp.keys.texi@1.167.1.1 +12 -2
+    update
+
+  ntpd/invoke-ntpd.texi@1.483.1.1 +14 -4
+    update
+
+  ntpd/ntp.conf.5man@1.204.1.1 +15 -6
+    update
+
+  ntpd/ntp.conf.5mdoc@1.204.1.1 +14 -5
+    update
+
+  ntpd/ntp.conf.man.in@1.204.1.1 +15 -6
+    update
+
+  ntpd/ntp.conf.mdoc.in@1.204.1.1 +14 -5
+    update
+
+  ntpd/ntp.keys.5man@1.201.1.1 +14 -5
+    update
+
+  ntpd/ntp.keys.5mdoc@1.201.1.1 +15 -6
+    update
+
+  ntpd/ntp.keys.man.in@1.201.1.1 +14 -5
+    update
+
+  ntpd/ntp.keys.mdoc.in@1.201.1.1 +15 -6
+    update
+
+  ntpd/ntpd-opts.c@1.504.1.1 +240 -264
+    update
+
+  ntpd/ntpd-opts.h@1.503.1.1 +3 -11
+    update
+
+  ntpd/ntpd.1ntpdman@1.312.1.1 +15 -6
+    update
+
+  ntpd/ntpd.1ntpdmdoc@1.312.1.1 +14 -5
+    update
+
+  ntpd/ntpd.man.in@1.312.1.1 +15 -6
+    update
+
+  ntpd/ntpd.mdoc.in@1.312.1.1 +14 -5
+    update
+
+  ntpdc/invoke-ntpdc.texi@1.481.1.1 +12 -2
+    update
+
+  ntpdc/ntpdc-opts.c@1.499.1.1 +108 -132
+    update
+
+  ntpdc/ntpdc-opts.h@1.498.1.1 +3 -11
+    update
+
+  ntpdc/ntpdc.1ntpdcman@1.312.1.1 +14 -5
+    update
+
+  ntpdc/ntpdc.1ntpdcmdoc@1.312.1.1 +13 -4
+    update
+
+  ntpdc/ntpdc.html@1.325.1.1 +86 -56
+    update
+
+  ntpdc/ntpdc.man.in@1.312.1.1 +14 -5
+    update
+
+  ntpdc/ntpdc.mdoc.in@1.312.1.1 +13 -4
+    update
+
+  ntpq/invoke-ntpq.texi@1.487.1.1 +12 -2
+    update
+
+  ntpq/ntpq-opts.c@1.504.1.1 +107 -131
+    update
+
+  ntpq/ntpq-opts.h@1.502.1.1 +3 -11
+    update
+
+  ntpq/ntpq.1ntpqman@1.315.1.1 +15 -6
+    update
+
+  ntpq/ntpq.1ntpqmdoc@1.315.1.1 +14 -5
+    update
+
+  ntpq/ntpq.man.in@1.315.1.1 +15 -6
+    update
+
+  ntpq/ntpq.mdoc.in@1.315.1.1 +14 -5
+    update
+
+  ntpsnmpd/invoke-ntpsnmpd.texi@1.483.1.1 +12 -2
+    update
+
+  ntpsnmpd/ntpsnmpd-opts.c@1.501.1.1 +69 -93
+    update
+
+  ntpsnmpd/ntpsnmpd-opts.h@1.500.1.1 +3 -11
+    update
+
+  ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.312.1.1 +14 -5
+    update
+
+  ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.312.1.1 +13 -4
+    update
+
+  ntpsnmpd/ntpsnmpd.man.in@1.312.1.1 +14 -5
+    update
+
+  ntpsnmpd/ntpsnmpd.mdoc.in@1.312.1.1 +13 -4
+    update
+
+  scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc@1.74.1.1 +2 -2
+    update
+
+  scripts/calc_tickadj/calc_tickadj.mdoc.in@1.74.1.1 +2 -2
+    update
+
+  scripts/ntp-wait/invoke-ntp-wait.texi@1.304.1.1 +1 -1
+    update
+
+  scripts/ntp-wait/ntp-wait-opts@1.40.1.1 +1 -1
+    update
+
+  scripts/ntp-wait/ntp-wait.1ntp-waitmdoc@1.302.1.1 +2 -2
+    update
+
+  scripts/ntp-wait/ntp-wait.html@1.321.1.1 +47 -29
+    update
+
+  scripts/ntp-wait/ntp-wait.mdoc.in@1.302.1.1 +2 -2
+    update
+
+  scripts/ntpsweep/ntpsweep-opts@1.42.1.1 +1 -1
+    update
+
+  scripts/ntptrace/invoke-ntptrace.texi@1.93.1.1 +1 -1
+    update
+
+  scripts/ntptrace/ntptrace-opts@1.42.1.1 +1 -1
+    update
+
+  scripts/ntptrace/ntptrace.1ntptracemdoc@1.81.1.1 +2 -2
+    update
+
+  scripts/ntptrace/ntptrace.html@1.94.1.1 +34 -25
+    update
+
+  scripts/ntptrace/ntptrace.mdoc.in@1.82.1.1 +2 -2
+    update
+
+  scripts/plot_summary-opts@1.42.1.1 +1 -1
+    update
+
+  scripts/summary-opts@1.42.1.1 +1 -1
+    update
+
+  sntp/include/copyright.def@1.25 +2 -2
+    Copyright update
+
+  sntp/include/ntp.lic@1.7 +3 -1
+    Copyright update
+
+  sntp/invoke-sntp.texi@1.480.1.1 +12 -2
+    update
+
+  sntp/sntp-opts.c@1.498.1.1 +160 -184
+    update
+
+  sntp/sntp-opts.h@1.497.1.1 +3 -11
+    update
+
+  sntp/sntp.1sntpman@1.315.1.1 +14 -5
+    update
+
+  sntp/sntp.1sntpmdoc@1.315.1.1 +13 -4
+    update
+
+  sntp/sntp.html@1.495.1.1 +118 -84
+    update
+
+  sntp/sntp.man.in@1.315.1.1 +14 -5
+    update
+
+  sntp/sntp.mdoc.in@1.315.1.1 +13 -4
+    update
+
+  util/invoke-ntp-keygen.texi@1.484.1.1 +12 -2
+    update
+
+  util/ntp-keygen-opts.c@1.501.1.1 +174 -198
+    update
+
+  util/ntp-keygen-opts.h@1.500.1.1 +3 -11
+    update
+
+  util/ntp-keygen.1ntp-keygenman@1.312.1.1 +15 -6
+    update
+
+  util/ntp-keygen.1ntp-keygenmdoc@1.312.1.1 +14 -5
+    update
+
+  util/ntp-keygen.man.in@1.312.1.1 +15 -6
+    update
+
+  util/ntp-keygen.mdoc.in@1.312.1.1 +14 -5
+    update
+
+ChangeSet@1.3292.1.8, 2015-01-07 03:05:51-05:00, stenn@deacon.udel.edu
+  NTP_4_2_8P1_BETA5
+  TAG: NTP_4_2_8P1_BETA5
+
+  ChangeLog@1.1613.1.8 +1 -0
+    NTP_4_2_8P1_BETA5
+
+  ntpd/invoke-ntp.conf.texi@1.173 +1 -1
+    NTP_4_2_8P1_BETA5
+
+  ntpd/invoke-ntp.keys.texi@1.170 +1 -1
+    NTP_4_2_8P1_BETA5
+
+  ntpd/invoke-ntpd.texi@1.486 +2 -2
+    NTP_4_2_8P1_BETA5
+
+  ntpd/ntp.conf.5man@1.207 +3 -3
+    NTP_4_2_8P1_BETA5
+
+  ntpd/ntp.conf.5mdoc@1.207 +2 -2
+    NTP_4_2_8P1_BETA5
+
+  ntpd/ntp.conf.html@1.166 +1 -1
+    NTP_4_2_8P1_BETA5
+
+  ntpd/ntp.conf.man.in@1.207 +3 -3
+    NTP_4_2_8P1_BETA5
+
+  ntpd/ntp.conf.mdoc.in@1.207 +2 -2
+    NTP_4_2_8P1_BETA5
+
+  ntpd/ntp.keys.5man@1.204 +2 -2
+    NTP_4_2_8P1_BETA5
+
+  ntpd/ntp.keys.5mdoc@1.204 +2 -2
+    NTP_4_2_8P1_BETA5
+
+  ntpd/ntp.keys.html@1.167 +1 -1
+    NTP_4_2_8P1_BETA5
+
+  ntpd/ntp.keys.man.in@1.204 +2 -2
+    NTP_4_2_8P1_BETA5
+
+  ntpd/ntp.keys.mdoc.in@1.204 +2 -2
+    NTP_4_2_8P1_BETA5
+
+  ntpd/ntpd-opts.c@1.507 +7 -7
+    NTP_4_2_8P1_BETA5
+
+  ntpd/ntpd-opts.h@1.506 +3 -3
+    NTP_4_2_8P1_BETA5
+
+  ntpd/ntpd.1ntpdman@1.315 +3 -3
+    NTP_4_2_8P1_BETA5
+
+  ntpd/ntpd.1ntpdmdoc@1.315 +2 -2
+    NTP_4_2_8P1_BETA5
+
+  ntpd/ntpd.html@1.161 +2 -2
+    NTP_4_2_8P1_BETA5
+
+  ntpd/ntpd.man.in@1.315 +3 -3
+    NTP_4_2_8P1_BETA5
+
+  ntpd/ntpd.mdoc.in@1.315 +2 -2
+    NTP_4_2_8P1_BETA5
+
+  ntpdc/invoke-ntpdc.texi@1.484 +26 -2
+    NTP_4_2_8P1_BETA5
+
+  ntpdc/ntpdc-opts.c@1.502 +7 -7
+    NTP_4_2_8P1_BETA5
+
+  ntpdc/ntpdc-opts.h@1.501 +3 -3
+    NTP_4_2_8P1_BETA5
+
+  ntpdc/ntpdc.1ntpdcman@1.315 +3 -3
+    NTP_4_2_8P1_BETA5
+
+  ntpdc/ntpdc.1ntpdcmdoc@1.315 +2 -2
+    NTP_4_2_8P1_BETA5
+
+  ntpdc/ntpdc.html@1.328 +27 -2
+    NTP_4_2_8P1_BETA5
+
+  ntpdc/ntpdc.man.in@1.315 +3 -3
+    NTP_4_2_8P1_BETA5
+
+  ntpdc/ntpdc.mdoc.in@1.315 +2 -2
+    NTP_4_2_8P1_BETA5
+
+  ntpq/invoke-ntpq.texi@1.490 +2 -2
+    NTP_4_2_8P1_BETA5
+
+  ntpq/ntpq-opts.c@1.507 +7 -7
+    NTP_4_2_8P1_BETA5
+
+  ntpq/ntpq-opts.h@1.505 +3 -3
+    NTP_4_2_8P1_BETA5
+
+  ntpq/ntpq.1ntpqman@1.318 +3 -3
+    NTP_4_2_8P1_BETA5
+
+  ntpq/ntpq.1ntpqmdoc@1.318 +2 -2
+    NTP_4_2_8P1_BETA5
+
+  ntpq/ntpq.html@1.158 +2 -2
+    NTP_4_2_8P1_BETA5
+
+  ntpq/ntpq.man.in@1.318 +3 -3
+    NTP_4_2_8P1_BETA5
+
+  ntpq/ntpq.mdoc.in@1.318 +2 -2
+    NTP_4_2_8P1_BETA5
+
+  ntpsnmpd/invoke-ntpsnmpd.texi@1.486 +2 -2
+    NTP_4_2_8P1_BETA5
+
+  ntpsnmpd/ntpsnmpd-opts.c@1.504 +7 -7
+    NTP_4_2_8P1_BETA5
+
+  ntpsnmpd/ntpsnmpd-opts.h@1.503 +3 -3
+    NTP_4_2_8P1_BETA5
+
+  ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.315 +3 -3
+    NTP_4_2_8P1_BETA5
+
+  ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.315 +2 -2
+    NTP_4_2_8P1_BETA5
+
+  ntpsnmpd/ntpsnmpd.html@1.156 +1 -1
+    NTP_4_2_8P1_BETA5
+
+  ntpsnmpd/ntpsnmpd.man.in@1.315 +3 -3
+    NTP_4_2_8P1_BETA5
+
+  ntpsnmpd/ntpsnmpd.mdoc.in@1.315 +2 -2
+    NTP_4_2_8P1_BETA5
+
+  packageinfo.sh@1.498 +1 -1
+    NTP_4_2_8P1_BETA5
+
+  scripts/calc_tickadj/calc_tickadj.1calc_tickadjman@1.77 +3 -3
+    NTP_4_2_8P1_BETA5
+
+  scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc@1.77 +2 -2
+    NTP_4_2_8P1_BETA5
+
+  scripts/calc_tickadj/calc_tickadj.html@1.79 +1 -1
+    NTP_4_2_8P1_BETA5
+
+  scripts/calc_tickadj/calc_tickadj.man.in@1.76 +3 -3
+    NTP_4_2_8P1_BETA5
+
+  scripts/calc_tickadj/calc_tickadj.mdoc.in@1.77 +2 -2
+    NTP_4_2_8P1_BETA5
+
+  scripts/calc_tickadj/invoke-calc_tickadj.texi@1.81 +1 -1
+    NTP_4_2_8P1_BETA5
+
+  scripts/invoke-plot_summary.texi@1.98 +2 -2
+    NTP_4_2_8P1_BETA5
+
+  scripts/invoke-summary.texi@1.98 +2 -2
+    NTP_4_2_8P1_BETA5
+
+  scripts/ntp-wait/invoke-ntp-wait.texi@1.307 +2 -2
+    NTP_4_2_8P1_BETA5
+
+  scripts/ntp-wait/ntp-wait-opts@1.43 +2 -2
+    NTP_4_2_8P1_BETA5
+
+  scripts/ntp-wait/ntp-wait.1ntp-waitman@1.305 +3 -3
+    NTP_4_2_8P1_BETA5
+
+  scripts/ntp-wait/ntp-wait.1ntp-waitmdoc@1.305 +2 -2
+    NTP_4_2_8P1_BETA5
+
+  scripts/ntp-wait/ntp-wait.html@1.324 +2 -2
+    NTP_4_2_8P1_BETA5
+
+  scripts/ntp-wait/ntp-wait.man.in@1.305 +3 -3
+    NTP_4_2_8P1_BETA5
+
+  scripts/ntp-wait/ntp-wait.mdoc.in@1.305 +2 -2
+    NTP_4_2_8P1_BETA5
+
+  scripts/ntpsweep/invoke-ntpsweep.texi@1.96 +2 -2
+    NTP_4_2_8P1_BETA5
+
+  scripts/ntpsweep/ntpsweep-opts@1.45 +2 -2
+    NTP_4_2_8P1_BETA5
+
+  scripts/ntpsweep/ntpsweep.1ntpsweepman@1.84 +3 -3
+    NTP_4_2_8P1_BETA5
+
+  scripts/ntpsweep/ntpsweep.1ntpsweepmdoc@1.84 +2 -2
+    NTP_4_2_8P1_BETA5
+
+  scripts/ntpsweep/ntpsweep.html@1.97 +2 -2
+    NTP_4_2_8P1_BETA5
+
+  scripts/ntpsweep/ntpsweep.man.in@1.84 +3 -3
+    NTP_4_2_8P1_BETA5
+
+  scripts/ntpsweep/ntpsweep.mdoc.in@1.85 +2 -2
+    NTP_4_2_8P1_BETA5
+
+  scripts/ntptrace/invoke-ntptrace.texi@1.96 +2 -2
+    NTP_4_2_8P1_BETA5
+
+  scripts/ntptrace/ntptrace-opts@1.45 +2 -2
+    NTP_4_2_8P1_BETA5
+
+  scripts/ntptrace/ntptrace.1ntptraceman@1.84 +3 -3
+    NTP_4_2_8P1_BETA5
+
+  scripts/ntptrace/ntptrace.1ntptracemdoc@1.84 +2 -2
+    NTP_4_2_8P1_BETA5
+
+  scripts/ntptrace/ntptrace.html@1.97 +2 -2
+    NTP_4_2_8P1_BETA5
+
+  scripts/ntptrace/ntptrace.man.in@1.84 +3 -3
+    NTP_4_2_8P1_BETA5
+
+  scripts/ntptrace/ntptrace.mdoc.in@1.85 +2 -2
+    NTP_4_2_8P1_BETA5
+
+  scripts/plot_summary-opts@1.45 +2 -2
+    NTP_4_2_8P1_BETA5
+
+  scripts/plot_summary.1plot_summaryman@1.96 +3 -3
+    NTP_4_2_8P1_BETA5
+
+  scripts/plot_summary.1plot_summarymdoc@1.96 +2 -2
+    NTP_4_2_8P1_BETA5
+
+  scripts/plot_summary.html@1.99 +2 -2
+    NTP_4_2_8P1_BETA5
+
+  scripts/plot_summary.man.in@1.96 +3 -3
+    NTP_4_2_8P1_BETA5
+
+  scripts/plot_summary.mdoc.in@1.96 +2 -2
+    NTP_4_2_8P1_BETA5
+
+  scripts/summary-opts@1.45 +2 -2
+    NTP_4_2_8P1_BETA5
+
+  scripts/summary.1summaryman@1.96 +3 -3
+    NTP_4_2_8P1_BETA5
+
+  scripts/summary.1summarymdoc@1.96 +2 -2
+    NTP_4_2_8P1_BETA5
+
+  scripts/summary.html@1.99 +2 -2
+    NTP_4_2_8P1_BETA5
+
+  scripts/summary.man.in@1.96 +3 -3
+    NTP_4_2_8P1_BETA5
+
+  scripts/summary.mdoc.in@1.96 +2 -2
+    NTP_4_2_8P1_BETA5
+
+  sntp/invoke-sntp.texi@1.483 +2 -2
+    NTP_4_2_8P1_BETA5
+
+  sntp/sntp-opts.c@1.502 +7 -7
+    NTP_4_2_8P1_BETA5
+
+  sntp/sntp-opts.h@1.500 +3 -3
+    NTP_4_2_8P1_BETA5
+
+  sntp/sntp.1sntpman@1.318 +3 -3
+    NTP_4_2_8P1_BETA5
+
+  sntp/sntp.1sntpmdoc@1.318 +2 -2
+    NTP_4_2_8P1_BETA5
+
+  sntp/sntp.html@1.498 +2 -2
+    NTP_4_2_8P1_BETA5
+
+  sntp/sntp.man.in@1.318 +3 -3
+    NTP_4_2_8P1_BETA5
+
+  sntp/sntp.mdoc.in@1.318 +2 -2
+    NTP_4_2_8P1_BETA5
+
+  util/invoke-ntp-keygen.texi@1.487 +2 -2
+    NTP_4_2_8P1_BETA5
+
+  util/ntp-keygen-opts.c@1.505 +7 -7
+    NTP_4_2_8P1_BETA5
+
+  util/ntp-keygen-opts.h@1.503 +3 -3
+    NTP_4_2_8P1_BETA5
+
+  util/ntp-keygen.1ntp-keygenman@1.315 +3 -3
+    NTP_4_2_8P1_BETA5
+
+  util/ntp-keygen.1ntp-keygenmdoc@1.315 +2 -2
+    NTP_4_2_8P1_BETA5
+
+  util/ntp-keygen.html@1.162 +2 -2
+    NTP_4_2_8P1_BETA5
+
+  util/ntp-keygen.man.in@1.315 +3 -3
+    NTP_4_2_8P1_BETA5
+
+  util/ntp-keygen.mdoc.in@1.315 +2 -2
+    NTP_4_2_8P1_BETA5
+
+ChangeSet@1.3292.1.7, 2015-01-07 07:35:11+00:00, burnicki@psp-deb1.ntp.org
+  cleanup
+
+  ChangeLog@1.1613.1.7 +2 -0
+    cleanup
+
+ChangeSet@1.3292.1.6, 2015-01-06 15:14:03+01:00, burnicki@pc-martin4.
+  [Bug 2728] Work around C99-style structure initialization code for older compilers, specifically Visual Studio prior to VS2013.
+
+  ChangeLog@1.1613.1.6 +2 -0
+    [Bug 2728] Work around C99-style structure initialization code for older compilers, specifically Visual Studio prior to VS2013.
+
+  ntpq/ntpq-subs.c@1.103 +5 -2
+    [Bug 2728] Fix for build environments where C99 style structure initialization is not supported.
+
+  ports/winnt/include/config.h@1.110 +1 -0
+    [Bug 2728] Define MISSING_C99_STYLE_INIT for VS versions prior to VS2013 to indicate C99-style structure initialization is not supported.
+
+  sntp/libopts/autoopts.h@1.20 +1 -1
+    [Bug 2728] Zero out whole structure, avoiding C99-style code zeroing out only specific fields.
+
+  sntp/libopts/enum.c@1.12 +1 -1
+    [Bug 2728] Zero out whole structure, avoiding C99-style code zeroing out only specific fields.
+
+ChangeSet@1.3292.1.5, 2015-01-06 14:29:51+01:00, burnicki@pc-martin4.
+  [Bug 2695] Windows build: __func__ not supported under Windows.
+
+  ChangeLog@1.1613.1.5 +1 -0
+    [Bug 2695] Windows build: __func__ not supported under Windows.
+
+  ports/winnt/include/config.h@1.109 +5 -1
+    [Bug 2695] Windows build: __func__ not supported under Windows.
+
+ChangeSet@1.3295, 2015-01-06 10:52:26+00:00, stenn@psp-deb1.ntp.org
+  Fix the package name
+
+  configure.ac@1.580 +1 -1
+    Fix the package name
+
+ChangeSet@1.3294, 2015-01-06 10:01:10+00:00, stenn@psp-deb1.ntp.org
+  [Sec 2671] vallen in extension fields are not validated
+
+  ntpd/ntp_crypto.c@1.173 +65 -35
+    [Sec 2671] vallen in extension fields are not validated
+
+ChangeSet@1.3292.1.4, 2015-01-04 06:17:14-05:00, stenn@deacon.udel.edu
+  NTP_4_2_8P1_BETA4
+  TAG: NTP_4_2_8P1_BETA4
+
+  ChangeLog@1.1613.1.4 +1 -0
+    NTP_4_2_8P1_BETA4
+
+  ntpd/invoke-ntp.conf.texi@1.172 +1 -1
+    NTP_4_2_8P1_BETA4
+
+  ntpd/invoke-ntp.keys.texi@1.169 +1 -1
+    NTP_4_2_8P1_BETA4
+
+  ntpd/invoke-ntpd.texi@1.485 +2 -2
+    NTP_4_2_8P1_BETA4
+
+  ntpd/ntp.conf.5man@1.206 +3 -3
+    NTP_4_2_8P1_BETA4
+
+  ntpd/ntp.conf.5mdoc@1.206 +2 -2
+    NTP_4_2_8P1_BETA4
+
+  ntpd/ntp.conf.html@1.165 +14 -1
+    NTP_4_2_8P1_BETA4
+
+  ntpd/ntp.conf.man.in@1.206 +3 -3
+    NTP_4_2_8P1_BETA4
+
+  ntpd/ntp.conf.mdoc.in@1.206 +2 -2
+    NTP_4_2_8P1_BETA4
+
+  ntpd/ntp.keys.5man@1.203 +2 -2
+    NTP_4_2_8P1_BETA4
+
+  ntpd/ntp.keys.5mdoc@1.203 +2 -2
+    NTP_4_2_8P1_BETA4
+
+  ntpd/ntp.keys.html@1.166 +1 -1
+    NTP_4_2_8P1_BETA4
+
+  ntpd/ntp.keys.man.in@1.203 +2 -2
+    NTP_4_2_8P1_BETA4
+
+  ntpd/ntp.keys.mdoc.in@1.203 +2 -2
+    NTP_4_2_8P1_BETA4
+
+  ntpd/ntpd-opts.c@1.506 +7 -7
+    NTP_4_2_8P1_BETA4
+
+  ntpd/ntpd-opts.h@1.505 +3 -3
+    NTP_4_2_8P1_BETA4
+
+  ntpd/ntpd.1ntpdman@1.314 +3 -3
+    NTP_4_2_8P1_BETA4
+
+  ntpd/ntpd.1ntpdmdoc@1.314 +2 -2
+    NTP_4_2_8P1_BETA4
+
+  ntpd/ntpd.html@1.160 +2 -2
+    NTP_4_2_8P1_BETA4
+
+  ntpd/ntpd.man.in@1.314 +3 -3
+    NTP_4_2_8P1_BETA4
+
+  ntpd/ntpd.mdoc.in@1.314 +2 -2
+    NTP_4_2_8P1_BETA4
+
+  ntpdc/invoke-ntpdc.texi@1.483 +2 -26
+    NTP_4_2_8P1_BETA4
+
+  ntpdc/ntpdc-opts.c@1.501 +7 -7
+    NTP_4_2_8P1_BETA4
+
+  ntpdc/ntpdc-opts.h@1.500 +3 -3
+    NTP_4_2_8P1_BETA4
+
+  ntpdc/ntpdc.1ntpdcman@1.314 +3 -3
+    NTP_4_2_8P1_BETA4
+
+  ntpdc/ntpdc.1ntpdcmdoc@1.314 +2 -2
+    NTP_4_2_8P1_BETA4
+
+  ntpdc/ntpdc.html@1.327 +2 -27
+    NTP_4_2_8P1_BETA4
+
+  ntpdc/ntpdc.man.in@1.314 +3 -3
+    NTP_4_2_8P1_BETA4
+
+  ntpdc/ntpdc.mdoc.in@1.314 +2 -2
+    NTP_4_2_8P1_BETA4
+
+  ntpq/invoke-ntpq.texi@1.489 +2 -2
+    NTP_4_2_8P1_BETA4
+
+  ntpq/ntpq-opts.c@1.506 +7 -7
+    NTP_4_2_8P1_BETA4
+
+  ntpq/ntpq-opts.h@1.504 +3 -3
+    NTP_4_2_8P1_BETA4
+
+  ntpq/ntpq.1ntpqman@1.317 +3 -3
+    NTP_4_2_8P1_BETA4
+
+  ntpq/ntpq.1ntpqmdoc@1.317 +2 -2
+    NTP_4_2_8P1_BETA4
+
+  ntpq/ntpq.html@1.157 +2 -2
+    NTP_4_2_8P1_BETA4
+
+  ntpq/ntpq.man.in@1.317 +3 -3
+    NTP_4_2_8P1_BETA4
+
+  ntpq/ntpq.mdoc.in@1.317 +2 -2
+    NTP_4_2_8P1_BETA4
+
+  ntpsnmpd/invoke-ntpsnmpd.texi@1.485 +2 -2
+    NTP_4_2_8P1_BETA4
+
+  ntpsnmpd/ntpsnmpd-opts.c@1.503 +7 -7
+    NTP_4_2_8P1_BETA4
+
+  ntpsnmpd/ntpsnmpd-opts.h@1.502 +3 -3
+    NTP_4_2_8P1_BETA4
+
+  ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.314 +3 -3
+    NTP_4_2_8P1_BETA4
+
+  ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.314 +2 -2
+    NTP_4_2_8P1_BETA4
+
+  ntpsnmpd/ntpsnmpd.html@1.155 +1 -1
+    NTP_4_2_8P1_BETA4
+
+  ntpsnmpd/ntpsnmpd.man.in@1.314 +3 -3
+    NTP_4_2_8P1_BETA4
+
+  ntpsnmpd/ntpsnmpd.mdoc.in@1.314 +2 -2
+    NTP_4_2_8P1_BETA4
+
+  packageinfo.sh@1.497 +1 -1
+    NTP_4_2_8P1_BETA4
+
+  scripts/calc_tickadj/calc_tickadj.1calc_tickadjman@1.76 +3 -3
+    NTP_4_2_8P1_BETA4
+
+  scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc@1.76 +2 -2
+    NTP_4_2_8P1_BETA4
+
+  scripts/calc_tickadj/calc_tickadj.html@1.78 +1 -1
+    NTP_4_2_8P1_BETA4
+
+  scripts/calc_tickadj/calc_tickadj.man.in@1.75 +3 -3
+    NTP_4_2_8P1_BETA4
+
+  scripts/calc_tickadj/calc_tickadj.mdoc.in@1.76 +2 -2
+    NTP_4_2_8P1_BETA4
+
+  scripts/calc_tickadj/invoke-calc_tickadj.texi@1.80 +1 -1
+    NTP_4_2_8P1_BETA4
+
+  scripts/invoke-plot_summary.texi@1.97 +2 -2
+    NTP_4_2_8P1_BETA4
+
+  scripts/invoke-summary.texi@1.97 +2 -2
+    NTP_4_2_8P1_BETA4
+
+  scripts/ntp-wait/invoke-ntp-wait.texi@1.306 +2 -2
+    NTP_4_2_8P1_BETA4
+
+  scripts/ntp-wait/ntp-wait-opts@1.42 +2 -2
+    NTP_4_2_8P1_BETA4
+
+  scripts/ntp-wait/ntp-wait.1ntp-waitman@1.304 +3 -3
+    NTP_4_2_8P1_BETA4
+
+  scripts/ntp-wait/ntp-wait.1ntp-waitmdoc@1.304 +2 -2
+    NTP_4_2_8P1_BETA4
+
+  scripts/ntp-wait/ntp-wait.html@1.323 +2 -2
+    NTP_4_2_8P1_BETA4
+
+  scripts/ntp-wait/ntp-wait.man.in@1.304 +3 -3
+    NTP_4_2_8P1_BETA4
+
+  scripts/ntp-wait/ntp-wait.mdoc.in@1.304 +2 -2
+    NTP_4_2_8P1_BETA4
+
+  scripts/ntpsweep/invoke-ntpsweep.texi@1.95 +2 -2
+    NTP_4_2_8P1_BETA4
+
+  scripts/ntpsweep/ntpsweep-opts@1.44 +2 -2
+    NTP_4_2_8P1_BETA4
+
+  scripts/ntpsweep/ntpsweep.1ntpsweepman@1.83 +3 -3
+    NTP_4_2_8P1_BETA4
+
+  scripts/ntpsweep/ntpsweep.1ntpsweepmdoc@1.83 +2 -2
+    NTP_4_2_8P1_BETA4
+
+  scripts/ntpsweep/ntpsweep.html@1.96 +2 -2
+    NTP_4_2_8P1_BETA4
+
+  scripts/ntpsweep/ntpsweep.man.in@1.83 +3 -3
+    NTP_4_2_8P1_BETA4
+
+  scripts/ntpsweep/ntpsweep.mdoc.in@1.84 +2 -2
+    NTP_4_2_8P1_BETA4
+
+  scripts/ntptrace/invoke-ntptrace.texi@1.95 +2 -2
+    NTP_4_2_8P1_BETA4
+
+  scripts/ntptrace/ntptrace-opts@1.44 +2 -2
+    NTP_4_2_8P1_BETA4
+
+  scripts/ntptrace/ntptrace.1ntptraceman@1.83 +3 -3
+    NTP_4_2_8P1_BETA4
+
+  scripts/ntptrace/ntptrace.1ntptracemdoc@1.83 +2 -2
+    NTP_4_2_8P1_BETA4
+
+  scripts/ntptrace/ntptrace.html@1.96 +2 -2
+    NTP_4_2_8P1_BETA4
+
+  scripts/ntptrace/ntptrace.man.in@1.83 +3 -3
+    NTP_4_2_8P1_BETA4
+
+  scripts/ntptrace/ntptrace.mdoc.in@1.84 +2 -2
+    NTP_4_2_8P1_BETA4
+
+  scripts/plot_summary-opts@1.44 +2 -2
+    NTP_4_2_8P1_BETA4
+
+  scripts/plot_summary.1plot_summaryman@1.95 +3 -3
+    NTP_4_2_8P1_BETA4
+
+  scripts/plot_summary.1plot_summarymdoc@1.95 +2 -2
+    NTP_4_2_8P1_BETA4
+
+  scripts/plot_summary.html@1.98 +2 -2
+    NTP_4_2_8P1_BETA4
+
+  scripts/plot_summary.man.in@1.95 +3 -3
+    NTP_4_2_8P1_BETA4
+
+  scripts/plot_summary.mdoc.in@1.95 +2 -2
+    NTP_4_2_8P1_BETA4
+
+  scripts/summary-opts@1.44 +2 -2
+    NTP_4_2_8P1_BETA4
+
+  scripts/summary.1summaryman@1.95 +3 -3
+    NTP_4_2_8P1_BETA4
+
+  scripts/summary.1summarymdoc@1.95 +2 -2
+    NTP_4_2_8P1_BETA4
+
+  scripts/summary.html@1.98 +2 -2
+    NTP_4_2_8P1_BETA4
+
+  scripts/summary.man.in@1.95 +3 -3
+    NTP_4_2_8P1_BETA4
+
+  scripts/summary.mdoc.in@1.95 +2 -2
+    NTP_4_2_8P1_BETA4
+
+  sntp/invoke-sntp.texi@1.482 +2 -2
+    NTP_4_2_8P1_BETA4
+
+  sntp/sntp-opts.c@1.501 +7 -7
+    NTP_4_2_8P1_BETA4
+
+  sntp/sntp-opts.h@1.499 +3 -3
+    NTP_4_2_8P1_BETA4
+
+  sntp/sntp.1sntpman@1.317 +3 -3
+    NTP_4_2_8P1_BETA4
+
+  sntp/sntp.1sntpmdoc@1.317 +2 -2
+    NTP_4_2_8P1_BETA4
+
+  sntp/sntp.html@1.497 +2 -2
+    NTP_4_2_8P1_BETA4
+
+  sntp/sntp.man.in@1.317 +3 -3
+    NTP_4_2_8P1_BETA4
+
+  sntp/sntp.mdoc.in@1.317 +2 -2
+    NTP_4_2_8P1_BETA4
+
+  util/invoke-ntp-keygen.texi@1.486 +2 -2
+    NTP_4_2_8P1_BETA4
+
+  util/ntp-keygen-opts.c@1.504 +7 -7
+    NTP_4_2_8P1_BETA4
+
+  util/ntp-keygen-opts.h@1.502 +3 -3
+    NTP_4_2_8P1_BETA4
+
+  util/ntp-keygen.1ntp-keygenman@1.314 +3 -3
+    NTP_4_2_8P1_BETA4
+
+  util/ntp-keygen.1ntp-keygenmdoc@1.314 +2 -2
+    NTP_4_2_8P1_BETA4
+
+  util/ntp-keygen.html@1.161 +2 -2
+    NTP_4_2_8P1_BETA4
+
+  util/ntp-keygen.man.in@1.314 +3 -3
+    NTP_4_2_8P1_BETA4
+
+  util/ntp-keygen.mdoc.in@1.314 +2 -2
+    NTP_4_2_8P1_BETA4
+
+ChangeSet@1.3292.1.3, 2015-01-04 04:48:35-05:00, stenn@deacon.udel.edu
+  Fix a regression introduced to timepps-Solaris.h
+
+  ChangeLog@1.1613.1.3 +4 -0
+    Fix a regression introduced to timepps-Solaris.h
+
+  include/timepps-Solaris.h@1.8 +1 -1
+    Fix a regression introduced to timepps-Solaris.h
+
+ChangeSet@1.3292.1.2, 2015-01-04 09:08:36+00:00, stenn@psp-fb1.ntp.org
+  [Bug 2695] Build problem on Windows (sys/socket.h)
+
+  ChangeLog@1.1613.1.2 +4 -3
+    [Bug 2695] Build problem on Windows (sys/socket.h)
+
+  ntpd/refclock_nmea.c@1.77 +2 -0
+    [Bug 2695] Build problem on Windows (sys/socket.h)
+
+ChangeSet@1.3292.1.1, 2015-01-04 00:20:52+00:00, stenn@psp-fb1.ntp.org
+  [Bug 2715]  mdnstries option for ntp.conf from NetBSD
+
+  ChangeLog@1.1613.1.1 +3 -0
+    [Bug 2715]  mdnstries option for ntp.conf from NetBSD
+
+  ntpd/keyword-gen-utd@1.21 +1 -1
+    [Bug 2715]  mdnstries option for ntp.conf from NetBSD
+
+  ntpd/ntp_keyword.h@1.23 +596 -587
+    [Bug 2715]  mdnstries option for ntp.conf from NetBSD
+
+  ntpd/ntp_parser.c@1.89 +1006 -1001
+    [Bug 2715]  mdnstries option for ntp.conf from NetBSD
+
+  ntpd/ntp_parser.h@1.55 +202 -200
+    [Bug 2715]  mdnstries option for ntp.conf from NetBSD
+
+ChangeSet@1.3293, 2015-01-03 10:33:57+00:00, stenn@psp-deb1.ntp.org
+  [Sec 2671] vallen in extension fields are not validated
+
+  ChangeLog@1.1614 +3 -0
+    [Sec 2671] vallen in extension fields are not validated
+
+  ntpd/ntp_crypto.c@1.172 +19 -12
+    [Sec 2671] vallen in extension fields are not validated
+
+ChangeSet@1.3292, 2015-01-02 23:07:47-05:00, stenn@deacon.udel.edu
+  NTP_4_2_8P1_BETA3
+  TAG: NTP_4_2_8P1_BETA3
+
+  ChangeLog@1.1613 +1 -0
+    NTP_4_2_8P1_BETA3
+
+  ntpd/invoke-ntp.conf.texi@1.171 +15 -1
+    NTP_4_2_8P1_BETA3
+
+  ntpd/invoke-ntp.keys.texi@1.168 +1 -1
+    NTP_4_2_8P1_BETA3
+
+  ntpd/invoke-ntpd.texi@1.484 +2 -2
+    NTP_4_2_8P1_BETA3
+
+  ntpd/ntp.conf.5man@1.205 +18 -3
+    NTP_4_2_8P1_BETA3
+
+  ntpd/ntp.conf.5mdoc@1.205 +16 -2
+    NTP_4_2_8P1_BETA3
+
+  ntpd/ntp.conf.html@1.164 +1 -1
+    NTP_4_2_8P1_BETA3
+
+  ntpd/ntp.conf.man.in@1.205 +18 -3
+    NTP_4_2_8P1_BETA3
+
+  ntpd/ntp.conf.mdoc.in@1.205 +16 -2
+    NTP_4_2_8P1_BETA3
+
+  ntpd/ntp.keys.5man@1.202 +2 -2
+    NTP_4_2_8P1_BETA3
+
+  ntpd/ntp.keys.5mdoc@1.202 +2 -2
+    NTP_4_2_8P1_BETA3
+
+  ntpd/ntp.keys.html@1.165 +1 -1
+    NTP_4_2_8P1_BETA3
+
+  ntpd/ntp.keys.man.in@1.202 +2 -2
+    NTP_4_2_8P1_BETA3
+
+  ntpd/ntp.keys.mdoc.in@1.202 +2 -2
+    NTP_4_2_8P1_BETA3
+
+  ntpd/ntpd-opts.c@1.505 +7 -7
+    NTP_4_2_8P1_BETA3
+
+  ntpd/ntpd-opts.h@1.504 +3 -3
+    NTP_4_2_8P1_BETA3
+
+  ntpd/ntpd.1ntpdman@1.313 +3 -3
+    NTP_4_2_8P1_BETA3
+
+  ntpd/ntpd.1ntpdmdoc@1.313 +2 -2
+    NTP_4_2_8P1_BETA3
+
+  ntpd/ntpd.html@1.159 +2 -2
+    NTP_4_2_8P1_BETA3
+
+  ntpd/ntpd.man.in@1.313 +3 -3
+    NTP_4_2_8P1_BETA3
+
+  ntpd/ntpd.mdoc.in@1.313 +2 -2
+    NTP_4_2_8P1_BETA3
+
+  ntpdc/invoke-ntpdc.texi@1.482 +2 -2
+    NTP_4_2_8P1_BETA3
+
+  ntpdc/ntpdc-opts.c@1.500 +7 -7
+    NTP_4_2_8P1_BETA3
+
+  ntpdc/ntpdc-opts.h@1.499 +3 -3
+    NTP_4_2_8P1_BETA3
+
+  ntpdc/ntpdc.1ntpdcman@1.313 +3 -3
+    NTP_4_2_8P1_BETA3
+
+  ntpdc/ntpdc.1ntpdcmdoc@1.313 +2 -2
+    NTP_4_2_8P1_BETA3
+
+  ntpdc/ntpdc.html@1.326 +2 -2
+    NTP_4_2_8P1_BETA3
+
+  ntpdc/ntpdc.man.in@1.313 +3 -3
+    NTP_4_2_8P1_BETA3
+
+  ntpdc/ntpdc.mdoc.in@1.313 +2 -2
+    NTP_4_2_8P1_BETA3
+
+  ntpq/invoke-ntpq.texi@1.488 +2 -2
+    NTP_4_2_8P1_BETA3
+
+  ntpq/ntpq-opts.c@1.505 +7 -7
+    NTP_4_2_8P1_BETA3
+
+  ntpq/ntpq-opts.h@1.503 +3 -3
+    NTP_4_2_8P1_BETA3
+
+  ntpq/ntpq.1ntpqman@1.316 +3 -3
+    NTP_4_2_8P1_BETA3
+
+  ntpq/ntpq.1ntpqmdoc@1.316 +2 -2
+    NTP_4_2_8P1_BETA3
+
+  ntpq/ntpq.html@1.156 +2 -2
+    NTP_4_2_8P1_BETA3
+
+  ntpq/ntpq.man.in@1.316 +3 -3
+    NTP_4_2_8P1_BETA3
+
+  ntpq/ntpq.mdoc.in@1.316 +2 -2
+    NTP_4_2_8P1_BETA3
+
+  ntpsnmpd/invoke-ntpsnmpd.texi@1.484 +2 -2
+    NTP_4_2_8P1_BETA3
+
+  ntpsnmpd/ntpsnmpd-opts.c@1.502 +7 -7
+    NTP_4_2_8P1_BETA3
+
+  ntpsnmpd/ntpsnmpd-opts.h@1.501 +3 -3
+    NTP_4_2_8P1_BETA3
+
+  ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.313 +3 -3
+    NTP_4_2_8P1_BETA3
+
+  ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.313 +2 -2
+    NTP_4_2_8P1_BETA3
+
+  ntpsnmpd/ntpsnmpd.html@1.154 +1 -1
+    NTP_4_2_8P1_BETA3
+
+  ntpsnmpd/ntpsnmpd.man.in@1.313 +3 -3
+    NTP_4_2_8P1_BETA3
+
+  ntpsnmpd/ntpsnmpd.mdoc.in@1.313 +2 -2
+    NTP_4_2_8P1_BETA3
+
+  packageinfo.sh@1.496 +1 -1
+    NTP_4_2_8P1_BETA3
+
+  scripts/calc_tickadj/calc_tickadj.1calc_tickadjman@1.75 +3 -3
+    NTP_4_2_8P1_BETA3
+
+  scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc@1.75 +2 -2
+    NTP_4_2_8P1_BETA3
+
+  scripts/calc_tickadj/calc_tickadj.html@1.77 +1 -1
+    NTP_4_2_8P1_BETA3
+
+  scripts/calc_tickadj/calc_tickadj.man.in@1.74 +3 -3
+    NTP_4_2_8P1_BETA3
+
+  scripts/calc_tickadj/calc_tickadj.mdoc.in@1.75 +2 -2
+    NTP_4_2_8P1_BETA3
+
+  scripts/calc_tickadj/invoke-calc_tickadj.texi@1.79 +1 -1
+    NTP_4_2_8P1_BETA3
+
+  scripts/invoke-plot_summary.texi@1.96 +2 -2
+    NTP_4_2_8P1_BETA3
+
+  scripts/invoke-summary.texi@1.96 +2 -2
+    NTP_4_2_8P1_BETA3
+
+  scripts/ntp-wait/invoke-ntp-wait.texi@1.305 +2 -2
+    NTP_4_2_8P1_BETA3
+
+  scripts/ntp-wait/ntp-wait-opts@1.41 +2 -2
+    NTP_4_2_8P1_BETA3
+
+  scripts/ntp-wait/ntp-wait.1ntp-waitman@1.303 +3 -3
+    NTP_4_2_8P1_BETA3
+
+  scripts/ntp-wait/ntp-wait.1ntp-waitmdoc@1.303 +2 -2
+    NTP_4_2_8P1_BETA3
+
+  scripts/ntp-wait/ntp-wait.html@1.322 +2 -2
+    NTP_4_2_8P1_BETA3
+
+  scripts/ntp-wait/ntp-wait.man.in@1.303 +3 -3
+    NTP_4_2_8P1_BETA3
+
+  scripts/ntp-wait/ntp-wait.mdoc.in@1.303 +2 -2
+    NTP_4_2_8P1_BETA3
+
+  scripts/ntpsweep/invoke-ntpsweep.texi@1.94 +2 -2
+    NTP_4_2_8P1_BETA3
+
+  scripts/ntpsweep/ntpsweep-opts@1.43 +2 -2
+    NTP_4_2_8P1_BETA3
+
+  scripts/ntpsweep/ntpsweep.1ntpsweepman@1.82 +3 -3
+    NTP_4_2_8P1_BETA3
+
+  scripts/ntpsweep/ntpsweep.1ntpsweepmdoc@1.82 +2 -2
+    NTP_4_2_8P1_BETA3
+
+  scripts/ntpsweep/ntpsweep.html@1.95 +2 -2
+    NTP_4_2_8P1_BETA3
+
+  scripts/ntpsweep/ntpsweep.man.in@1.82 +3 -3
+    NTP_4_2_8P1_BETA3
+
+  scripts/ntpsweep/ntpsweep.mdoc.in@1.83 +2 -2
+    NTP_4_2_8P1_BETA3
+
+  scripts/ntptrace/invoke-ntptrace.texi@1.94 +2 -2
+    NTP_4_2_8P1_BETA3
+
+  scripts/ntptrace/ntptrace-opts@1.43 +2 -2
+    NTP_4_2_8P1_BETA3
+
+  scripts/ntptrace/ntptrace.1ntptraceman@1.82 +3 -3
+    NTP_4_2_8P1_BETA3
+
+  scripts/ntptrace/ntptrace.1ntptracemdoc@1.82 +2 -2
+    NTP_4_2_8P1_BETA3
+
+  scripts/ntptrace/ntptrace.html@1.95 +2 -2
+    NTP_4_2_8P1_BETA3
+
+  scripts/ntptrace/ntptrace.man.in@1.82 +3 -3
+    NTP_4_2_8P1_BETA3
+
+  scripts/ntptrace/ntptrace.mdoc.in@1.83 +2 -2
+    NTP_4_2_8P1_BETA3
+
+  scripts/plot_summary-opts@1.43 +2 -2
+    NTP_4_2_8P1_BETA3
+
+  scripts/plot_summary.1plot_summaryman@1.94 +3 -3
+    NTP_4_2_8P1_BETA3
+
+  scripts/plot_summary.1plot_summarymdoc@1.94 +2 -2
+    NTP_4_2_8P1_BETA3
+
+  scripts/plot_summary.html@1.97 +2 -2
+    NTP_4_2_8P1_BETA3
+
+  scripts/plot_summary.man.in@1.94 +3 -3
+    NTP_4_2_8P1_BETA3
+
+  scripts/plot_summary.mdoc.in@1.94 +2 -2
+    NTP_4_2_8P1_BETA3
+
+  scripts/summary-opts@1.43 +2 -2
+    NTP_4_2_8P1_BETA3
+
+  scripts/summary.1summaryman@1.94 +3 -3
+    NTP_4_2_8P1_BETA3
+
+  scripts/summary.1summarymdoc@1.94 +2 -2
+    NTP_4_2_8P1_BETA3
+
+  scripts/summary.html@1.97 +2 -2
+    NTP_4_2_8P1_BETA3
+
+  scripts/summary.man.in@1.94 +3 -3
+    NTP_4_2_8P1_BETA3
+
+  scripts/summary.mdoc.in@1.94 +2 -2
+    NTP_4_2_8P1_BETA3
+
+  sntp/invoke-sntp.texi@1.481 +2 -2
+    NTP_4_2_8P1_BETA3
+
+  sntp/sntp-opts.c@1.500 +9 -9
+    NTP_4_2_8P1_BETA3
+
+  sntp/sntp-opts.h@1.498 +3 -3
+    NTP_4_2_8P1_BETA3
+
+  sntp/sntp.1sntpman@1.316 +3 -3
+    NTP_4_2_8P1_BETA3
+
+  sntp/sntp.1sntpmdoc@1.316 +2 -2
+    NTP_4_2_8P1_BETA3
+
+  sntp/sntp.html@1.496 +2 -2
+    NTP_4_2_8P1_BETA3
+
+  sntp/sntp.man.in@1.316 +3 -3
+    NTP_4_2_8P1_BETA3
+
+  sntp/sntp.mdoc.in@1.316 +2 -2
+    NTP_4_2_8P1_BETA3
+
+  util/invoke-ntp-keygen.texi@1.485 +2 -2
+    NTP_4_2_8P1_BETA3
+
+  util/ntp-keygen-opts.c@1.503 +9 -9
+    NTP_4_2_8P1_BETA3
+
+  util/ntp-keygen-opts.h@1.501 +3 -3
+    NTP_4_2_8P1_BETA3
+
+  util/ntp-keygen.1ntp-keygenman@1.313 +3 -3
+    NTP_4_2_8P1_BETA3
+
+  util/ntp-keygen.1ntp-keygenmdoc@1.313 +2 -2
+    NTP_4_2_8P1_BETA3
+
+  util/ntp-keygen.html@1.160 +2 -2
+    NTP_4_2_8P1_BETA3
+
+  util/ntp-keygen.man.in@1.313 +3 -3
+    NTP_4_2_8P1_BETA3
+
+  util/ntp-keygen.mdoc.in@1.313 +2 -2
+    NTP_4_2_8P1_BETA3
+
+ChangeSet@1.3281.3.3, 2015-01-02 17:37:39+01:00, jnperlin@hydra.(none)
+  [Bug 2627] changelog file syntax
+
+  ChangeLog@1.1604.3.2 +1 -0
+    [Bug 2627] changelog file syntax
+
+ChangeSet@1.3281.3.2, 2015-01-02 17:23:21+01:00, jnperlin@nemesis.localnet
+  [Bug 2627] sidekick: avoid runtime conversion trap on MSVC builds
+
+  ntpd/ntp_leapsec.c@1.13.1.1 +2 -1
+    [Bug 2627] sidekick: avoid runtime conversion trap on MSVC builds
+
+ChangeSet@1.3273.1.1, 2015-01-02 13:45:05+01:00, jnperlin@hydra.(none)
+  [Bug 2627] shm refclock allows only two units with owner-only access
+
+  ChangeLog@1.1597.1.1 +3 -0
+    [Bug 2627] shm refclock allows only two units with owner-only access
+
+  html/drivers/driver28.html@1.17 +122 -17
+    [Bug 2627] shm refclock allows only two units with owner-only access
+      update docu
+
+  ntpd/refclock_shm.c@1.30 +111 -114
+    [Bug 2627] shm refclock allows only two units with owner-only access
+      use mode bit 0 to select public access for units >= 2 (default is private for all now)
+
+ChangeSet@1.3288, 2015-01-02 07:59:13+00:00, stenn@psp-fb1.ntp.org
+  [Bug 2713] variable type/cast, parameter name, general cleanup from NetBSD
+
+  ntpd/Makefile.am@1.132 +1 -1
+    [Bug 2713] variable type/cast, parameter name, general cleanup from NetBSD
+
+  ntpd/ntp_loopfilter.c@1.176 +44 -8
+    [Bug 2713] variable type/cast, parameter name, general cleanup from NetBSD
+
+  sntp/m4/hms_search_lib.m4@1.2 +2 -2
+    [Bug 2713] variable type/cast, parameter name, general cleanup from NetBSD
+
+  sntp/m4/ntp_libntp.m4@1.28 +6 -0
+    [Bug 2713] variable type/cast, parameter name, general cleanup from NetBSD
+
+ChangeSet@1.3281.1.2, 2015-01-01 07:31:57+00:00, stenn@psp-deb1.ntp.org
+  [Bug 2681] Fix display of certificate EOValidity dates on 32-bit systems
+
+  ChangeLog@1.1604.1.2 +1 -0
+    [Bug 2681] Fix display of certificate EOValidity dates on 32-bit systems
+
+  ntpd/ntp_control.c@1.192.2.1 +28 -4
+    [Bug 2681] Fix display of certificate EOValidity dates on 32-bit systems
+
+ChangeSet@1.3281.2.2, 2014-12-30 05:48:04-05:00, murray@pogo.udel.edu
+  ChangeLog:
+    add --- to top of ChangeLog
+
+  ChangeLog@1.1604.2.2 +1 -1
+    add --- to top of ChangeLog
+
+ChangeSet@1.3281.2.1, 2014-12-30 04:55:11-05:00, murray@pogo.udel.edu
+  ChangeLog, ntp_control.c:
+    Fix for bug 2700
+
+  ChangeLog@1.1604.2.1 +2 -0
+    Fix for bug 2700
+
+  ntpd/ntp_control.c@1.192.1.1 +4 -1
+    Fix for bug 2700
+
+ChangeSet@1.3287, 2014-12-30 01:28:39+00:00, stenn@psp-fb1.ntp.org
+  [Bug 2715]  mdnstries option for ntp.conf from NetBSD
+
+  html/confopt.html@1.63 +3 -1
+    [Bug 2715]  mdnstries option for ntp.conf from NetBSD
+
+  ntpd/ntp.conf.def@1.14 +14 -0
+    [Bug 2715]  mdnstries option for ntp.conf from NetBSD
+
+ChangeSet@1.3286, 2014-12-30 00:29:47+00:00, stenn@psp-fb1.ntp.org
+  [Bug 2713] variable type/cast, parameter name, general cleanup from NetBSD
+
+  ntpd/refclock_wwvb.c@1.35 +1 -2
+    [Bug 2713] variable type/cast, parameter name, general cleanup from NetBSD
+
+ChangeSet@1.3285, 2014-12-30 00:28:06+00:00, stenn@psp-fb1.ntp.org
+  [Bug 2715]  mdnstries option for ntp.conf from NetBSD
+
+  ChangeLog@1.1609 +1 -0
+    [Bug 2715]  mdnstries option for ntp.conf from NetBSD
+
+  ntpd/keyword-gen.c@1.26 +2 -1
+    [Bug 2715]  mdnstries option for ntp.conf from NetBSD
+
+  ntpd/ntp_config.c@1.321 +29 -13
+    [Bug 2715]  mdnstries option for ntp.conf from NetBSD
+
+  ntpd/ntp_parser.y@1.82 +3 -0
+    [Bug 2715]  mdnstries option for ntp.conf from NetBSD
+
+ChangeSet@1.3278.1.1, 2014-12-29 08:47:40+00:00, stenn@psp-fb1.ntp.org
+  [Bug 2695] 4.2.8 does not build on Windows
+
+  ChangeLog@1.1601.1.1 +1 -0
+    [Bug 2695] 4.2.8 does not build on Windows
+
+  ports/winnt/include/config.h@1.108 +1 -0
+    [Bug 2695] 4.2.8 does not build on Windows
+
+  ports/winnt/vs2008/libntp/libntp.vcproj@1.51 +6 -2
+    [Bug 2695] 4.2.8 does not build on Windows
+
+  ports/winnt/vs2013/libntp/libntp.vcxproj@1.5 +1 -0
+    [Bug 2695] 4.2.8 does not build on Windows
+
+ChangeSet@1.3284, 2014-12-29 06:57:50+00:00, stenn@psp-fb1.ntp.org
+  [Bug 2714] libevent may need to be built independently of any build of sntp
+
+  ChangeLog@1.1608 +1 -0
+    [Bug 2714] libevent may need to be built independently of any build of sntp
+
+  sntp/Makefile.am@1.78 +7 -7
+    [Bug 2714] libevent may need to be built independently of any build of sntp
+
+ChangeSet@1.3283, 2014-12-29 06:42:07+00:00, stenn@psp-fb1.ntp.org
+  [Bug 2706] libparse/info_trimble.c build dependencies are broken
+
+  ChangeLog@1.1607 +1 -0
+    [Bug 2706] libparse/info_trimble.c build dependencies are broken
+
+  libparse/Makefile.am@1.31 +30 -2
+    [Bug 2706] libparse/info_trimble.c build dependencies are broken
+
+  libparse/info_trimble.c@1.6 +2 -2
+    [Bug 2706] libparse/info_trimble.c build dependencies are broken
+
+  libparse/mkinfo_rcmd.sed@1.4 +1 -1
+    [Bug 2706] libparse/info_trimble.c build dependencies are broken
+
+  libparse/mkinfo_scmd.sed@1.4 +1 -1
+    [Bug 2706] libparse/info_trimble.c build dependencies are broken
+
+ChangeSet@1.3282, 2014-12-29 06:39:40+00:00, stenn@psp-fb1.ntp.org
+  [Bug 2713] variable type/cast, parameter name, general cleanup from NetBSD
+
+  ChangeLog@1.1606 +1 -1
+    [Bug 2713] variable type/cast, parameter name, general cleanup from NetBSD
+
+  ChangeLog@1.1605 +3 -0
+    [Bug 2713] variable type/cast cleanup from NetBSD
+
+  include/audio.h@1.8 +1 -1
+    [Bug 2713] variable type/cast cleanup from NetBSD
+
+  include/icom.h@1.6 +1 -1
+    [Bug 2713] variable type/cast cleanup from NetBSD
+
+  include/ntp_config.h@1.82 +3 -2
+    [Bug 2713] variable type/cast cleanup from NetBSD
+
+  include/ntp_filegen.h@1.11 +1 -1
+    [Bug 2713] variable type/cast cleanup from NetBSD
+
+  include/ntp_stdlib.h@1.77 +5 -5
+    [Bug 2713] variable type/cast cleanup from NetBSD
+
+  include/ntpd.h@1.184 +3 -3
+    [Bug 2713] variable type/cast cleanup from NetBSD
+
+  lib/isc/backtrace.c@1.2 +4 -4
+    [Bug 2713] variable type/cast, parameter name, general cleanup from NetBSD
+
+  lib/isc/event.c@1.2 +1 -3
+    [Bug 2713] variable type/cast, parameter name, general cleanup from NetBSD
+
+  lib/isc/include/isc/backtrace.h@1.2 +2 -2
+    [Bug 2713] variable type/cast, parameter name cleanup from NetBSD
+
+  lib/isc/include/isc/socket.h@1.3 +7 -7
+    [Bug 2713] variable type/cast, parameter name cleanup from NetBSD
+
+  lib/isc/log.c@1.7 +2 -1
+    [Bug 2713] variable type/cast, parameter name, general cleanup from NetBSD
+
+  lib/isc/netaddr.c@1.13 +2 -1
+    [Bug 2713] variable type/cast, parameter name, general cleanup from NetBSD
+
+  lib/isc/sockaddr.c@1.12 +8 -4
+    [Bug 2713] variable type/cast, parameter name, general cleanup from NetBSD
+
+  lib/isc/unix/ifiter_getifaddrs.c@1.13 +7 -3
+    [Bug 2713] variable type/cast, parameter name, general cleanup from NetBSD
+
+  libjsmn/jsmn.c@1.3 +3 -3
+    [Bug 2713] variable type/cast, parameter name, general cleanup from NetBSD
+
+  libntp/atoint.c@1.4 +1 -1
+    [Bug 2713] variable type/cast, parameter name, general cleanup from NetBSD
+
+  libntp/atolfp.c@1.5 +5 -5
+    [Bug 2713] variable type/cast, parameter name, general cleanup from NetBSD
+
+  libntp/atouint.c@1.5 +1 -1
+    [Bug 2713] variable type/cast, parameter name, general cleanup from NetBSD
+
+  libntp/audio.c@1.35 +12 -12
+    [Bug 2713] variable type/cast, parameter name, general cleanup from NetBSD
+
+  libntp/authkeys.c@1.25 +1 -2
+    [Bug 2713] variable type/cast, parameter name, general cleanup from NetBSD
+
+  libntp/authreadkeys.c@1.20 +4 -4
+    [Bug 2713] variable type/cast, parameter name, general cleanup from NetBSD
+
+  libntp/emalloc.c@1.17 +2 -0
+    [Bug 2713] variable type/cast, parameter name, general cleanup from NetBSD
+
+  libntp/hextoint.c@1.5 +1 -1
+    [Bug 2713] variable type/cast, parameter name, general cleanup from NetBSD
+
+  libntp/hextolfp.c@1.4 +2 -2
+    [Bug 2713] variable type/cast, parameter name, general cleanup from NetBSD
+
+  libntp/humandate.c@1.12 +2 -2
+    [Bug 2713] variable type/cast, parameter name, general cleanup from NetBSD
+
+  libntp/icom.c@1.18 +1 -3
+    [Bug 2713] variable type/cast, parameter name, general cleanup from NetBSD
+
+  libntp/modetoa.c@1.6 +3 -3
+    [Bug 2713] variable type/cast, parameter name, general cleanup from NetBSD
+
+  libntp/mstolfp.c@1.4 +5 -5
+    [Bug 2713] variable type/cast, parameter name, general cleanup from NetBSD
+
+  libntp/ntp_calendar.c@1.14 +5 -1
+    [Bug 2713] variable type/cast, parameter name, general cleanup from NetBSD
+
+  libntp/ntp_crypto_rnd.c@1.3 +4 -2
+    [Bug 2713] variable type/cast, parameter name, general cleanup from NetBSD
+
+  libntp/ntp_intres.c@1.98 +2 -17
+    [Bug 2713] variable type/cast, parameter name, general cleanup from NetBSD
+
+  libntp/ntp_lineedit.c@1.12 +6 -7
+    [Bug 2713] variable type/cast, parameter name, general cleanup from NetBSD
+
+  libntp/octtoint.c@1.4 +1 -1
+    [Bug 2713] variable type/cast, parameter name, general cleanup from NetBSD
+
+  libntp/prettydate.c@1.19 +7 -7
+    [Bug 2713] variable type/cast, parameter name, general cleanup from NetBSD
+
+  libntp/ssl_init.c@1.17 +2 -2
+    [Bug 2713] variable type/cast, parameter name, general cleanup from NetBSD
+
+  libntp/timetoa.c@1.5 +3 -6
+    [Bug 2713] variable type/cast, parameter name, general cleanup from NetBSD
+
+  libparse/clk_meinberg.c@1.11 +1 -1
+    [Bug 2713] variable type/cast, parameter name, general cleanup from NetBSD
+
+  libparse/clk_rawdcf.c@1.17 +10 -10
+    [Bug 2713] variable type/cast, parameter name, general cleanup from NetBSD
+
+  libparse/data_mbg.c@1.12 +3 -3
+    [Bug 2713] variable type/cast, parameter name, general cleanup from NetBSD
+
+  ntpd/ntp_control.c@1.193 +60 -62
+    [Bug 2713] variable type/cast, parameter name, general cleanup from NetBSD
+
+  ntpd/ntp_crypto.c@1.171 +8 -10
+    [Bug 2713] variable type/cast, parameter name, general cleanup from NetBSD
+
+  ntpd/ntp_filegen.c@1.25 +1 -1
+    [Bug 2713] variable type/cast, parameter name, general cleanup from NetBSD
+
+  ntpd/ntp_io.c@1.398 +63 -30
+    [Bug 2713] variable type/cast, parameter name, general cleanup from NetBSD
+
+  ntpd/ntp_leapsec.c@1.14 +1 -1
+    [Bug 2713] variable type/cast, parameter name, general cleanup from NetBSD
+
+  ntpd/ntp_proto.c@1.353 +13 -14
+    [Bug 2713] variable type/cast, parameter name, general cleanup from NetBSD
+
+  ntpd/ntp_request.c@1.113 +8 -9
+    [Bug 2713] variable type/cast, parameter name, general cleanup from NetBSD
+
+  ntpd/ntp_restrict.c@1.36 +2 -2
+    [Bug 2713] variable type/cast, parameter name, general cleanup from NetBSD
+
+  ntpd/ntp_scanner.c@1.46 +14 -14
+    [Bug 2713] variable type/cast, parameter name, general cleanup from NetBSD
+
+  ntpd/ntp_util.c@1.116 +2 -2
+    [Bug 2713] variable type/cast, parameter name, general cleanup from NetBSD
+
+  ntpd/ntpd.c@1.158 +6 -2
+    [Bug 2713] variable type/cast, parameter name, general cleanup from NetBSD
+
+  ntpd/refclock_acts.c@1.54 +2 -2
+    [Bug 2713] variable type/cast, parameter name, general cleanup from NetBSD
+
+  ntpd/refclock_arc.c@1.32 +3 -3
+    [Bug 2713] variable type/cast, parameter name, general cleanup from NetBSD
+
+  ntpd/refclock_chu.c@1.56 +0 -4
+    [Bug 2713] variable type/cast, parameter name, general cleanup from NetBSD
+
+  ntpd/refclock_gpsdjson.c@1.16 +6 -6
+    [Bug 2713] variable type/cast, parameter name, general cleanup from NetBSD
+
+  ntpd/refclock_heath.c@1.19 +1 -1
+    [Bug 2713] variable type/cast, parameter name, general cleanup from NetBSD
+
+  ntpd/refclock_irig.c@1.37 +1 -3
+    [Bug 2713] variable type/cast, parameter name, general cleanup from NetBSD
+
+  ntpd/refclock_jjy.c@1.26 +22 -23
+    [Bug 2713] variable type/cast, parameter name, general cleanup from NetBSD
+
+  ntpd/refclock_jupiter.c@1.29 +54 -55
+    [Bug 2713] variable type/cast, parameter name, general cleanup from NetBSD
+
+  ntpd/refclock_neoclock4x.c@1.23 +7 -7
+    [Bug 2713] variable type/cast, parameter name, general cleanup from NetBSD
+
+  ntpd/refclock_nmea.c@1.76 +7 -6
+    [Bug 2713] variable type/cast, parameter name, general cleanup from NetBSD
+
+  ntpd/refclock_oncore.c@1.102 +80 -80
+    [Bug 2713] variable type/cast, parameter name, general cleanup from NetBSD
+
+  ntpd/refclock_parse.c@1.69 +228 -214
+    [Bug 2713] variable type/cast, parameter name, general cleanup from NetBSD
+
+  ntpd/refclock_pcf.c@1.13 +1 -1
+    [Bug 2713] variable type/cast, parameter name, general cleanup from NetBSD
+
+  ntpd/refclock_true.c@1.23 +1 -0
+    [Bug 2713] variable type/cast, parameter name, general cleanup from NetBSD
+
+  ntpd/refclock_wwv.c@1.79 +3 -3
+    [Bug 2713] variable type/cast, parameter name, general cleanup from NetBSD
+
+  ntpd/refclock_wwvb.c@1.34 +2 -1
+    [Bug 2713] variable type/cast, parameter name, general cleanup from NetBSD
+
+  ntpdate/ntpdate.c@1.93 +1 -1
+    [Bug 2713] variable type/cast, parameter name, general cleanup from NetBSD
+
+  ntpdc/ntpdc.c@1.102 +42 -30
+    [Bug 2713] variable type/cast, parameter name, general cleanup from NetBSD
+
+  ntpdc/ntpdc.h@1.11 +1 -1
+    [Bug 2713] variable type/cast, parameter name, general cleanup from NetBSD
+
+  ntpdc/ntpdc_ops.c@1.80 +6 -6
+    [Bug 2713] variable type/cast, parameter name, general cleanup from NetBSD
+
+  ntpq/ntpq-subs.c@1.102 +103 -107
+    [Bug 2713] variable type/cast, parameter name, general cleanup from NetBSD
+
+  ntpq/ntpq.c@1.154 +43 -32
+    [Bug 2713] variable type/cast, parameter name, general cleanup from NetBSD
+
+  ntpq/ntpq.h@1.29 +1 -1
+    [Bug 2713] variable type/cast, parameter name, general cleanup from NetBSD
+
+  ntpsnmpd/netsnmp_daemonize.c@1.5 +1 -0
+    [Bug 2713] variable type/cast, parameter name, general cleanup from NetBSD
+
+  ntpsnmpd/ntp_snmp.h@1.2 +3 -0
+    [Bug 2713] variable type/cast, parameter name, general cleanup from NetBSD
+
+  sntp/crypto.c@1.18 +2 -2
+    [Bug 2713] variable type/cast, parameter name, general cleanup from NetBSD
+
+  sntp/libopts/autoopts.h@1.19 +2 -2
+    [Bug 2713] variable type/cast, parameter name, general cleanup from NetBSD
+
+  sntp/libopts/autoopts/options.h@1.29 +9 -1
+    [Bug 2713] variable type/cast, parameter name, general cleanup from NetBSD
+
+  sntp/libopts/configfile.c@1.22 +6 -6
+    [Bug 2713] variable type/cast, parameter name, general cleanup from NetBSD
+
+  sntp/libopts/enum.c@1.11 +5 -5
+    [Bug 2713] variable type/cast, parameter name, general cleanup from NetBSD
+
+  sntp/libopts/file.c@1.15 +2 -2
+    [Bug 2713] variable type/cast, parameter name, general cleanup from NetBSD
+
+  sntp/libopts/find.c@1.11 +2 -2
+    [Bug 2713] variable type/cast, parameter name, general cleanup from NetBSD
+
+  sntp/libopts/init.c@1.7 +5 -8
+    [Bug 2713] variable type/cast, parameter name, general cleanup from NetBSD
+
+  sntp/libopts/load.c@1.20 +1 -1
+    [Bug 2713] variable type/cast, parameter name, general cleanup from NetBSD
+
+  sntp/libopts/makeshell.c@1.19 +8 -8
+    [Bug 2713] variable type/cast, parameter name, general cleanup from NetBSD
+
+  sntp/libopts/nested.c@1.15 +7 -7
+    [Bug 2713] variable type/cast, parameter name, general cleanup from NetBSD
+
+  sntp/libopts/numeric.c@1.14 +1 -1
+    [Bug 2713] variable type/cast, parameter name, general cleanup from NetBSD
+
+  sntp/libopts/parse-duration.c@1.13 +2 -2
+    [Bug 2713] variable type/cast, parameter name, general cleanup from NetBSD
+
+  sntp/libopts/pgusage.c@1.17 +1 -1
+    [Bug 2713] variable type/cast, parameter name, general cleanup from NetBSD
+
+  sntp/libopts/reset.c@1.16 +1 -1
+    [Bug 2713] variable type/cast, parameter name, general cleanup from NetBSD
+
+  sntp/libopts/save.c@1.17 +10 -10
+    [Bug 2713] variable type/cast, parameter name, general cleanup from NetBSD
+
+  sntp/libopts/tokenize.c@1.12 +1 -1
+    [Bug 2713] variable type/cast, parameter name, general cleanup from NetBSD
+
+  sntp/libopts/usage.c@1.20 +2 -2
+    [Bug 2713] variable type/cast, parameter name, general cleanup from NetBSD
+
+  sntp/main.c@1.94 +7 -6
+    [Bug 2713] variable type/cast, parameter name, general cleanup from NetBSD
+
+  sntp/networking.c@1.65 +16 -7
+    [Bug 2713] variable type/cast, parameter name, general cleanup from NetBSD
+
+  sntp/sntp-opts.c@1.499 +2 -2
+    [Bug 2713] variable type/cast, parameter name, general cleanup from NetBSD
+
+  util/jitter.h@1.4 +3 -3
+    [Bug 2713] variable type/cast, parameter name, general cleanup from NetBSD
+
+  util/ntp-keygen-opts.c@1.502 +2 -2
+    [Bug 2713] variable type/cast, parameter name, general cleanup from NetBSD
+
+  util/ntp-keygen.c@1.100 +26 -25
+    [Bug 2713] variable type/cast, parameter name, general cleanup from NetBSD
+
+  util/ntptime.c@1.25 +5 -4
+    [Bug 2713] variable type/cast, parameter name, general cleanup from NetBSD
+
+ChangeSet@1.3281, 2014-12-27 06:33:35-05:00, stenn@deacon.udel.edu
+  NTP_4_2_8P1_BETA2
+  TAG: NTP_4_2_8P1_BETA2
+
+  ChangeLog@1.1604 +1 -0
+    NTP_4_2_8P1_BETA2
+
+  ntpd/invoke-ntp.conf.texi@1.170 +1 -1
+    NTP_4_2_8P1_BETA2
+
+  ntpd/invoke-ntp.keys.texi@1.167 +1 -1
+    NTP_4_2_8P1_BETA2
+
+  ntpd/invoke-ntpd.texi@1.483 +2 -2
+    NTP_4_2_8P1_BETA2
+
+  ntpd/ntp.conf.5man@1.204 +3 -3
+    NTP_4_2_8P1_BETA2
+
+  ntpd/ntp.conf.5mdoc@1.204 +2 -2
+    NTP_4_2_8P1_BETA2
+
+  ntpd/ntp.conf.html@1.163 +1 -1
+    NTP_4_2_8P1_BETA2
+
+  ntpd/ntp.conf.man.in@1.204 +3 -3
+    NTP_4_2_8P1_BETA2
+
+  ntpd/ntp.conf.mdoc.in@1.204 +2 -2
+    NTP_4_2_8P1_BETA2
+
+  ntpd/ntp.keys.5man@1.201 +2 -2
+    NTP_4_2_8P1_BETA2
+
+  ntpd/ntp.keys.5mdoc@1.201 +2 -2
+    NTP_4_2_8P1_BETA2
+
+  ntpd/ntp.keys.html@1.164 +1 -1
+    NTP_4_2_8P1_BETA2
+
+  ntpd/ntp.keys.man.in@1.201 +2 -2
+    NTP_4_2_8P1_BETA2
+
+  ntpd/ntp.keys.mdoc.in@1.201 +2 -2
+    NTP_4_2_8P1_BETA2
+
+  ntpd/ntpd-opts.c@1.504 +7 -7
+    NTP_4_2_8P1_BETA2
+
+  ntpd/ntpd-opts.h@1.503 +3 -3
+    NTP_4_2_8P1_BETA2
+
+  ntpd/ntpd.1ntpdman@1.312 +3 -3
+    NTP_4_2_8P1_BETA2
+
+  ntpd/ntpd.1ntpdmdoc@1.312 +2 -2
+    NTP_4_2_8P1_BETA2
+
+  ntpd/ntpd.html@1.158 +2 -2
+    NTP_4_2_8P1_BETA2
+
+  ntpd/ntpd.man.in@1.312 +3 -3
+    NTP_4_2_8P1_BETA2
+
+  ntpd/ntpd.mdoc.in@1.312 +2 -2
+    NTP_4_2_8P1_BETA2
+
+  ntpdc/invoke-ntpdc.texi@1.481 +2 -2
+    NTP_4_2_8P1_BETA2
+
+  ntpdc/ntpdc-opts.c@1.499 +7 -7
+    NTP_4_2_8P1_BETA2
+
+  ntpdc/ntpdc-opts.h@1.498 +3 -3
+    NTP_4_2_8P1_BETA2
+
+  ntpdc/ntpdc.1ntpdcman@1.312 +3 -3
+    NTP_4_2_8P1_BETA2
+
+  ntpdc/ntpdc.1ntpdcmdoc@1.312 +2 -2
+    NTP_4_2_8P1_BETA2
+
+  ntpdc/ntpdc.html@1.325 +2 -2
+    NTP_4_2_8P1_BETA2
+
+  ntpdc/ntpdc.man.in@1.312 +3 -3
+    NTP_4_2_8P1_BETA2
+
+  ntpdc/ntpdc.mdoc.in@1.312 +2 -2
+    NTP_4_2_8P1_BETA2
+
+  ntpq/invoke-ntpq.texi@1.487 +2 -2
+    NTP_4_2_8P1_BETA2
+
+  ntpq/ntpq-opts.c@1.504 +7 -7
+    NTP_4_2_8P1_BETA2
+
+  ntpq/ntpq-opts.h@1.502 +3 -3
+    NTP_4_2_8P1_BETA2
+
+  ntpq/ntpq.1ntpqman@1.315 +3 -3
+    NTP_4_2_8P1_BETA2
+
+  ntpq/ntpq.1ntpqmdoc@1.315 +2 -2
+    NTP_4_2_8P1_BETA2
+
+  ntpq/ntpq.html@1.155 +2 -2
+    NTP_4_2_8P1_BETA2
+
+  ntpq/ntpq.man.in@1.315 +3 -3
+    NTP_4_2_8P1_BETA2
+
+  ntpq/ntpq.mdoc.in@1.315 +2 -2
+    NTP_4_2_8P1_BETA2
+
+  ntpsnmpd/invoke-ntpsnmpd.texi@1.483 +2 -2
+    NTP_4_2_8P1_BETA2
+
+  ntpsnmpd/ntpsnmpd-opts.c@1.501 +7 -7
+    NTP_4_2_8P1_BETA2
+
+  ntpsnmpd/ntpsnmpd-opts.h@1.500 +3 -3
+    NTP_4_2_8P1_BETA2
+
+  ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.312 +3 -3
+    NTP_4_2_8P1_BETA2
+
+  ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.312 +2 -2
+    NTP_4_2_8P1_BETA2
+
+  ntpsnmpd/ntpsnmpd.html@1.153 +1 -1
+    NTP_4_2_8P1_BETA2
+
+  ntpsnmpd/ntpsnmpd.man.in@1.312 +3 -3
+    NTP_4_2_8P1_BETA2
+
+  ntpsnmpd/ntpsnmpd.mdoc.in@1.312 +2 -2
+    NTP_4_2_8P1_BETA2
+
+  packageinfo.sh@1.495 +1 -1
+    NTP_4_2_8P1_BETA2
+
+  scripts/calc_tickadj/calc_tickadj.1calc_tickadjman@1.74 +3 -3
+    NTP_4_2_8P1_BETA2
+
+  scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc@1.74 +2 -2
+    NTP_4_2_8P1_BETA2
+
+  scripts/calc_tickadj/calc_tickadj.html@1.76 +1 -1
+    NTP_4_2_8P1_BETA2
+
+  scripts/calc_tickadj/calc_tickadj.man.in@1.73 +3 -3
+    NTP_4_2_8P1_BETA2
+
+  scripts/calc_tickadj/calc_tickadj.mdoc.in@1.74 +2 -2
+    NTP_4_2_8P1_BETA2
+
+  scripts/calc_tickadj/invoke-calc_tickadj.texi@1.78 +1 -1
+    NTP_4_2_8P1_BETA2
+
+  scripts/invoke-plot_summary.texi@1.95 +2 -2
+    NTP_4_2_8P1_BETA2
+
+  scripts/invoke-summary.texi@1.95 +2 -2
+    NTP_4_2_8P1_BETA2
+
+  scripts/ntp-wait/invoke-ntp-wait.texi@1.304 +2 -2
+    NTP_4_2_8P1_BETA2
+
+  scripts/ntp-wait/ntp-wait-opts@1.40 +2 -2
+    NTP_4_2_8P1_BETA2
+
+  scripts/ntp-wait/ntp-wait.1ntp-waitman@1.302 +3 -3
+    NTP_4_2_8P1_BETA2
+
+  scripts/ntp-wait/ntp-wait.1ntp-waitmdoc@1.302 +2 -2
+    NTP_4_2_8P1_BETA2
+
+  scripts/ntp-wait/ntp-wait.html@1.321 +2 -2
+    NTP_4_2_8P1_BETA2
+
+  scripts/ntp-wait/ntp-wait.man.in@1.302 +3 -3
+    NTP_4_2_8P1_BETA2
+
+  scripts/ntp-wait/ntp-wait.mdoc.in@1.302 +2 -2
+    NTP_4_2_8P1_BETA2
+
+  scripts/ntpsweep/invoke-ntpsweep.texi@1.93 +2 -2
+    NTP_4_2_8P1_BETA2
+
+  scripts/ntpsweep/ntpsweep-opts@1.42 +2 -2
+    NTP_4_2_8P1_BETA2
+
+  scripts/ntpsweep/ntpsweep.1ntpsweepman@1.81 +3 -3
+    NTP_4_2_8P1_BETA2
+
+  scripts/ntpsweep/ntpsweep.1ntpsweepmdoc@1.81 +2 -2
+    NTP_4_2_8P1_BETA2
+
+  scripts/ntpsweep/ntpsweep.html@1.94 +2 -2
+    NTP_4_2_8P1_BETA2
+
+  scripts/ntpsweep/ntpsweep.man.in@1.81 +3 -3
+    NTP_4_2_8P1_BETA2
+
+  scripts/ntpsweep/ntpsweep.mdoc.in@1.82 +2 -2
+    NTP_4_2_8P1_BETA2
+
+  scripts/ntptrace/invoke-ntptrace.texi@1.93 +2 -2
+    NTP_4_2_8P1_BETA2
+
+  scripts/ntptrace/ntptrace-opts@1.42 +2 -2
+    NTP_4_2_8P1_BETA2
+
+  scripts/ntptrace/ntptrace.1ntptraceman@1.81 +3 -3
+    NTP_4_2_8P1_BETA2
+
+  scripts/ntptrace/ntptrace.1ntptracemdoc@1.81 +2 -2
+    NTP_4_2_8P1_BETA2
+
+  scripts/ntptrace/ntptrace.html@1.94 +2 -2
+    NTP_4_2_8P1_BETA2
+
+  scripts/ntptrace/ntptrace.man.in@1.81 +3 -3
+    NTP_4_2_8P1_BETA2
+
+  scripts/ntptrace/ntptrace.mdoc.in@1.82 +2 -2
+    NTP_4_2_8P1_BETA2
+
+  scripts/plot_summary-opts@1.42 +2 -2
+    NTP_4_2_8P1_BETA2
+
+  scripts/plot_summary.1plot_summaryman@1.93 +3 -3
+    NTP_4_2_8P1_BETA2
+
+  scripts/plot_summary.1plot_summarymdoc@1.93 +2 -2
+    NTP_4_2_8P1_BETA2
+
+  scripts/plot_summary.html@1.96 +2 -2
+    NTP_4_2_8P1_BETA2
+
+  scripts/plot_summary.man.in@1.93 +3 -3
+    NTP_4_2_8P1_BETA2
+
+  scripts/plot_summary.mdoc.in@1.93 +2 -2
+    NTP_4_2_8P1_BETA2
+
+  scripts/summary-opts@1.42 +2 -2
+    NTP_4_2_8P1_BETA2
+
+  scripts/summary.1summaryman@1.93 +3 -3
+    NTP_4_2_8P1_BETA2
+
+  scripts/summary.1summarymdoc@1.93 +2 -2
+    NTP_4_2_8P1_BETA2
+
+  scripts/summary.html@1.96 +2 -2
+    NTP_4_2_8P1_BETA2
+
+  scripts/summary.man.in@1.93 +3 -3
+    NTP_4_2_8P1_BETA2
+
+  scripts/summary.mdoc.in@1.93 +2 -2
+    NTP_4_2_8P1_BETA2
+
+  sntp/invoke-sntp.texi@1.480 +2 -2
+    NTP_4_2_8P1_BETA2
+
+  sntp/sntp-opts.c@1.498 +7 -7
+    NTP_4_2_8P1_BETA2
+
+  sntp/sntp-opts.h@1.497 +3 -3
+    NTP_4_2_8P1_BETA2
+
+  sntp/sntp.1sntpman@1.315 +3 -3
+    NTP_4_2_8P1_BETA2
+
+  sntp/sntp.1sntpmdoc@1.315 +2 -2
+    NTP_4_2_8P1_BETA2
+
+  sntp/sntp.html@1.495 +2 -2
+    NTP_4_2_8P1_BETA2
+
+  sntp/sntp.man.in@1.315 +3 -3
+    NTP_4_2_8P1_BETA2
+
+  sntp/sntp.mdoc.in@1.315 +2 -2
+    NTP_4_2_8P1_BETA2
+
+  util/invoke-ntp-keygen.texi@1.484 +2 -2
+    NTP_4_2_8P1_BETA2
+
+  util/ntp-keygen-opts.c@1.501 +7 -7
+    NTP_4_2_8P1_BETA2
+
+  util/ntp-keygen-opts.h@1.500 +3 -3
+    NTP_4_2_8P1_BETA2
+
+  util/ntp-keygen.1ntp-keygenman@1.312 +3 -3
+    NTP_4_2_8P1_BETA2
+
+  util/ntp-keygen.1ntp-keygenmdoc@1.312 +2 -2
+    NTP_4_2_8P1_BETA2
+
+  util/ntp-keygen.html@1.159 +2 -2
+    NTP_4_2_8P1_BETA2
+
+  util/ntp-keygen.man.in@1.312 +3 -3
+    NTP_4_2_8P1_BETA2
+
+  util/ntp-keygen.mdoc.in@1.312 +2 -2
+    NTP_4_2_8P1_BETA2
+
+ChangeSet@1.3280, 2014-12-26 22:21:06-05:00, stenn@deacon.udel.edu
+  [Bug 2674] Install sntp in sbin on NetBSD
+
+  ChangeLog@1.1603 +1 -0
+    [Bug 2674] Install sntp in sbin on NetBSD
+
+  sntp/loc/netbsd@1.3 +1 -1
+    [Bug 2674] Install sntp in sbin on NetBSD
+
+ChangeSet@1.3279, 2014-12-26 22:11:56-05:00, stenn@deacon.udel.edu
+  [Bug 2707] Avoid a C90 extension in libjsmn/jsmn.c
+
+  ChangeLog@1.1602 +1 -0
+    [Bug 2707] Avoid a C90 extension in libjsmn/jsmn.c
+
+  libjsmn/jsmn.c@1.2 +2 -1
+    [Bug 2707] Avoid a C90 extension in libjsmn/jsmn.c
+
+ChangeSet@1.3278, 2014-12-26 23:56:33+00:00, stenn@psp-deb1.ntp.org
+  [Bug 2693] ntp-keygen doesn't build without OpenSSL and sntp
+
+  ChangeLog@1.1601 +1 -0
+    [Bug 2693] ntp-keygen doesn't build without OpenSSL and sntp
+
+  sntp/Makefile.am@1.77 +5 -4
+    [Bug 2693] ntp-keygen doesn't build without OpenSSL and sntp
+
+ChangeSet@1.3277, 2014-12-26 23:50:15+00:00, stenn@psp-deb1.ntp.org
+  [Bug 2709] see if we have a C99 compiler (not yet required)
+
+  ChangeLog@1.1600 +1 -1
+    [Bug 2709] see if we have a C99 compiler (not yet required)
+
+ChangeSet@1.3276, 2014-12-26 23:48:57+00:00, stenn@psp-deb1.ntp.org
+  build: see if we have a C99 compiler (not yet required)
+
+  ChangeLog@1.1599 +3 -0
+    build: see if we have a C99 compiler (not yet required)
+
+  sntp/m4/ntp_compiler.m4@1.5 +1 -0
+    build: see if we have a C99 compiler (not yet required)
+
+ChangeSet@1.3275, 2014-12-23 16:59:55-05:00, stenn@deacon.udel.edu
+  NTP_4_2_8P1_BETA1
+  TAG: NTP_4_2_8P1_BETA1
+
+  ChangeLog@1.1598 +1 -0
+    NTP_4_2_8P1_BETA1
+
+  ntpd/invoke-ntp.conf.texi@1.169 +1 -1
+    NTP_4_2_8P1_BETA1
+
+  ntpd/invoke-ntp.keys.texi@1.166 +1 -1
+    NTP_4_2_8P1_BETA1
+
+  ntpd/invoke-ntpd.texi@1.482 +2 -2
+    NTP_4_2_8P1_BETA1
+
+  ntpd/ntp.conf.5man@1.203 +3 -3
+    NTP_4_2_8P1_BETA1
+
+  ntpd/ntp.conf.5mdoc@1.203 +2 -2
+    NTP_4_2_8P1_BETA1
+
+  ntpd/ntp.conf.html@1.162 +1 -1
+    NTP_4_2_8P1_BETA1
+
+  ntpd/ntp.conf.man.in@1.203 +3 -3
+    NTP_4_2_8P1_BETA1
+
+  ntpd/ntp.conf.mdoc.in@1.203 +2 -2
+    NTP_4_2_8P1_BETA1
+
+  ntpd/ntp.keys.5man@1.200 +2 -2
+    NTP_4_2_8P1_BETA1
+
+  ntpd/ntp.keys.5mdoc@1.200 +2 -2
+    NTP_4_2_8P1_BETA1
+
+  ntpd/ntp.keys.html@1.163 +1 -1
+    NTP_4_2_8P1_BETA1
+
+  ntpd/ntp.keys.man.in@1.200 +2 -2
+    NTP_4_2_8P1_BETA1
+
+  ntpd/ntp.keys.mdoc.in@1.200 +2 -2
+    NTP_4_2_8P1_BETA1
+
+  ntpd/ntpd-opts.c@1.503 +239 -239
+    NTP_4_2_8P1_BETA1
+
+  ntpd/ntpd-opts.h@1.502 +3 -3
+    NTP_4_2_8P1_BETA1
+
+  ntpd/ntpd.1ntpdman@1.311 +3 -3
+    NTP_4_2_8P1_BETA1
+
+  ntpd/ntpd.1ntpdmdoc@1.311 +2 -2
+    NTP_4_2_8P1_BETA1
+
+  ntpd/ntpd.html@1.157 +2 -2
+    NTP_4_2_8P1_BETA1
+
+  ntpd/ntpd.man.in@1.311 +3 -3
+    NTP_4_2_8P1_BETA1
+
+  ntpd/ntpd.mdoc.in@1.311 +2 -2
+    NTP_4_2_8P1_BETA1
+
+  ntpdc/invoke-ntpdc.texi@1.480 +2 -2
+    NTP_4_2_8P1_BETA1
+
+  ntpdc/ntpdc-opts.c@1.498 +107 -107
+    NTP_4_2_8P1_BETA1
+
+  ntpdc/ntpdc-opts.h@1.497 +3 -3
+    NTP_4_2_8P1_BETA1
+
+  ntpdc/ntpdc.1ntpdcman@1.311 +3 -3
+    NTP_4_2_8P1_BETA1
+
+  ntpdc/ntpdc.1ntpdcmdoc@1.311 +2 -2
+    NTP_4_2_8P1_BETA1
+
+  ntpdc/ntpdc.html@1.324 +2 -2
+    NTP_4_2_8P1_BETA1
+
+  ntpdc/ntpdc.man.in@1.311 +3 -3
+    NTP_4_2_8P1_BETA1
+
+  ntpdc/ntpdc.mdoc.in@1.311 +2 -2
+    NTP_4_2_8P1_BETA1
+
+  ntpq/invoke-ntpq.texi@1.486 +2 -2
+    NTP_4_2_8P1_BETA1
+
+  ntpq/ntpq-opts.c@1.503 +106 -106
+    NTP_4_2_8P1_BETA1
+
+  ntpq/ntpq-opts.h@1.501 +3 -3
+    NTP_4_2_8P1_BETA1
+
+  ntpq/ntpq.1ntpqman@1.314 +3 -3
+    NTP_4_2_8P1_BETA1
+
+  ntpq/ntpq.1ntpqmdoc@1.314 +2 -2
+    NTP_4_2_8P1_BETA1
+
+  ntpq/ntpq.html@1.154 +2 -2
+    NTP_4_2_8P1_BETA1
+
+  ntpq/ntpq.man.in@1.314 +3 -3
+    NTP_4_2_8P1_BETA1
+
+  ntpq/ntpq.mdoc.in@1.314 +2 -2
+    NTP_4_2_8P1_BETA1
+
+  ntpsnmpd/invoke-ntpsnmpd.texi@1.482 +2 -2
+    NTP_4_2_8P1_BETA1
+
+  ntpsnmpd/ntpsnmpd-opts.c@1.500 +68 -68
+    NTP_4_2_8P1_BETA1
+
+  ntpsnmpd/ntpsnmpd-opts.h@1.499 +3 -3
+    NTP_4_2_8P1_BETA1
+
+  ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.311 +3 -3
+    NTP_4_2_8P1_BETA1
+
+  ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.311 +2 -2
+    NTP_4_2_8P1_BETA1
+
+  ntpsnmpd/ntpsnmpd.html@1.152 +1 -1
+    NTP_4_2_8P1_BETA1
+
+  ntpsnmpd/ntpsnmpd.man.in@1.311 +3 -3
+    NTP_4_2_8P1_BETA1
+
+  ntpsnmpd/ntpsnmpd.mdoc.in@1.311 +2 -2
+    NTP_4_2_8P1_BETA1
+
+  packageinfo.sh@1.494 +3 -3
+    NTP_4_2_8P1_BETA1
+
+  scripts/calc_tickadj/calc_tickadj.1calc_tickadjman@1.73 +3 -3
+    NTP_4_2_8P1_BETA1
+
+  scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc@1.73 +2 -2
+    NTP_4_2_8P1_BETA1
+
+  scripts/calc_tickadj/calc_tickadj.html@1.75 +1 -1
+    NTP_4_2_8P1_BETA1
+
+  scripts/calc_tickadj/calc_tickadj.man.in@1.72 +3 -3
+    NTP_4_2_8P1_BETA1
+
+  scripts/calc_tickadj/calc_tickadj.mdoc.in@1.73 +2 -2
+    NTP_4_2_8P1_BETA1
+
+  scripts/calc_tickadj/invoke-calc_tickadj.texi@1.77 +1 -1
+    NTP_4_2_8P1_BETA1
+
+  scripts/invoke-plot_summary.texi@1.94 +2 -2
+    NTP_4_2_8P1_BETA1
+
+  scripts/invoke-summary.texi@1.94 +2 -2
+    NTP_4_2_8P1_BETA1
+
+  scripts/ntp-wait/invoke-ntp-wait.texi@1.303 +2 -2
+    NTP_4_2_8P1_BETA1
+
+  scripts/ntp-wait/ntp-wait-opts@1.39 +2 -2
+    NTP_4_2_8P1_BETA1
+
+  scripts/ntp-wait/ntp-wait.1ntp-waitman@1.301 +3 -3
+    NTP_4_2_8P1_BETA1
+
+  scripts/ntp-wait/ntp-wait.1ntp-waitmdoc@1.301 +2 -2
+    NTP_4_2_8P1_BETA1
+
+  scripts/ntp-wait/ntp-wait.html@1.320 +2 -2
+    NTP_4_2_8P1_BETA1
+
+  scripts/ntp-wait/ntp-wait.man.in@1.301 +3 -3
+    NTP_4_2_8P1_BETA1
+
+  scripts/ntp-wait/ntp-wait.mdoc.in@1.301 +2 -2
+    NTP_4_2_8P1_BETA1
+
+  scripts/ntpsweep/invoke-ntpsweep.texi@1.92 +2 -2
+    NTP_4_2_8P1_BETA1
+
+  scripts/ntpsweep/ntpsweep-opts@1.41 +2 -2
+    NTP_4_2_8P1_BETA1
+
+  scripts/ntpsweep/ntpsweep.1ntpsweepman@1.80 +3 -3
+    NTP_4_2_8P1_BETA1
+
+  scripts/ntpsweep/ntpsweep.1ntpsweepmdoc@1.80 +2 -2
+    NTP_4_2_8P1_BETA1
+
+  scripts/ntpsweep/ntpsweep.html@1.93 +2 -2
+    NTP_4_2_8P1_BETA1
+
+  scripts/ntpsweep/ntpsweep.man.in@1.80 +3 -3
+    NTP_4_2_8P1_BETA1
+
+  scripts/ntpsweep/ntpsweep.mdoc.in@1.81 +2 -2
+    NTP_4_2_8P1_BETA1
+
+  scripts/ntptrace/invoke-ntptrace.texi@1.92 +2 -2
+    NTP_4_2_8P1_BETA1
+
+  scripts/ntptrace/ntptrace-opts@1.41 +2 -2
+    NTP_4_2_8P1_BETA1
+
+  scripts/ntptrace/ntptrace.1ntptraceman@1.80 +3 -3
+    NTP_4_2_8P1_BETA1
+
+  scripts/ntptrace/ntptrace.1ntptracemdoc@1.80 +2 -2
+    NTP_4_2_8P1_BETA1
+
+  scripts/ntptrace/ntptrace.html@1.93 +2 -2
+    NTP_4_2_8P1_BETA1
+
+  scripts/ntptrace/ntptrace.man.in@1.80 +3 -3
+    NTP_4_2_8P1_BETA1
+
+  scripts/ntptrace/ntptrace.mdoc.in@1.81 +2 -2
+    NTP_4_2_8P1_BETA1
+
+  scripts/plot_summary-opts@1.41 +2 -2
+    NTP_4_2_8P1_BETA1
+
+  scripts/plot_summary.1plot_summaryman@1.92 +3 -3
+    NTP_4_2_8P1_BETA1
+
+  scripts/plot_summary.1plot_summarymdoc@1.92 +2 -2
+    NTP_4_2_8P1_BETA1
+
+  scripts/plot_summary.html@1.95 +2 -2
+    NTP_4_2_8P1_BETA1
+
+  scripts/plot_summary.man.in@1.92 +3 -3
+    NTP_4_2_8P1_BETA1
+
+  scripts/plot_summary.mdoc.in@1.92 +2 -2
+    NTP_4_2_8P1_BETA1
+
+  scripts/summary-opts@1.41 +2 -2
+    NTP_4_2_8P1_BETA1
+
+  scripts/summary.1summaryman@1.92 +3 -3
+    NTP_4_2_8P1_BETA1
+
+  scripts/summary.1summarymdoc@1.92 +2 -2
+    NTP_4_2_8P1_BETA1
+
+  scripts/summary.html@1.95 +2 -2
+    NTP_4_2_8P1_BETA1
+
+  scripts/summary.man.in@1.92 +3 -3
+    NTP_4_2_8P1_BETA1
+
+  scripts/summary.mdoc.in@1.92 +2 -2
+    NTP_4_2_8P1_BETA1
+
+  sntp/invoke-sntp.texi@1.479 +2 -2
+    NTP_4_2_8P1_BETA1
+
+  sntp/sntp-opts.c@1.497 +159 -159
+    NTP_4_2_8P1_BETA1
+
+  sntp/sntp-opts.h@1.496 +3 -3
+    NTP_4_2_8P1_BETA1
+
+  sntp/sntp.1sntpman@1.314 +3 -3
+    NTP_4_2_8P1_BETA1
+
+  sntp/sntp.1sntpmdoc@1.314 +2 -2
+    NTP_4_2_8P1_BETA1
+
+  sntp/sntp.html@1.494 +2 -2
+    NTP_4_2_8P1_BETA1
+
+  sntp/sntp.man.in@1.314 +3 -3
+    NTP_4_2_8P1_BETA1
+
+  sntp/sntp.mdoc.in@1.314 +2 -2
+    NTP_4_2_8P1_BETA1
+
+  util/invoke-ntp-keygen.texi@1.483 +2 -2
+    NTP_4_2_8P1_BETA1
+
+  util/ntp-keygen-opts.c@1.500 +173 -173
+    NTP_4_2_8P1_BETA1
+
+  util/ntp-keygen-opts.h@1.499 +3 -3
+    NTP_4_2_8P1_BETA1
+
+  util/ntp-keygen.1ntp-keygenman@1.311 +3 -3
+    NTP_4_2_8P1_BETA1
+
+  util/ntp-keygen.1ntp-keygenmdoc@1.311 +2 -2
+    NTP_4_2_8P1_BETA1
+
+  util/ntp-keygen.html@1.158 +2 -2
+    NTP_4_2_8P1_BETA1
+
+  util/ntp-keygen.man.in@1.311 +3 -3
+    NTP_4_2_8P1_BETA1
+
+  util/ntp-keygen.mdoc.in@1.311 +2 -2
+    NTP_4_2_8P1_BETA1
+
+ChangeSet@1.3274, 2014-12-23 21:36:47+00:00, stenn@psp-deb1.ntp.org
+  Disable config.cache-* files for now
+
+  build@1.49 +5 -1
+    Disable config.cache-* files for now
+
+ChangeSet@1.3273, 2014-12-23 04:34:37+00:00, stenn@psp-deb1.ntp.org
+  Update cvo.sh for new CentOS version format
+
+  sntp/scripts/cvo.sh@1.8 +7 -1
+    Update cvo.sh for new CentOS version format
+
+ChangeSet@1.3272, 2014-12-22 05:59:33+00:00, stenn@psp-fb1.ntp.org
+  [Bug 2693] ntp-keygen doesn't build without OpenSSL
+
+  ChangeLog@1.1597 +2 -1
+    [Bug 2693] ntp-keygen doesn't build without OpenSSL
+
+  Makefile.am@1.124 +3 -2
+    [Bug 2693] ntp-keygen doesn't build without OpenSSL
+
+  configure.ac@1.579 +5 -1
+    [Bug 2693] ntp-keygen doesn't build without OpenSSL
+
+  libntp/ntp_crypto_rnd.c@1.2 +15 -0
+    [Bug 2693] ntp-keygen doesn't build without OpenSSL
+
+  sntp/configure.ac@1.77 +8 -5
+    [Bug 2693] ntp-keygen doesn't build without OpenSSL
+
+  sntp/m4/ntp_libevent.m4@1.12 +23 -2
+    [Bug 2693] ntp-keygen doesn't build without OpenSSL
+
+  util/Makefile.am@1.77 +1 -0
+    [Bug 2693] ntp-keygen doesn't build without OpenSSL
+
+ChangeSet@1.3271, 2014-12-22 05:51:47+00:00, stenn@psp-fb1.ntp.org
+  [Bug 2699] IN6_IS_ADDR_LOOPBACK build problems on some OSes
+
+  ChangeLog@1.1596 +1 -0
+    [Bug 2699] IN6_IS_ADDR_LOOPBACK build problems on some OSes
+
+ChangeSet@1.3270, 2014-12-22 02:55:14+00:00, stenn@psp-deb1.ntp.org
+  [Bug 2699] HAVE_SYS_SELECT_H is misspelled in refclock_gpsdjson.c
+
+  ChangeLog@1.1595 +3 -0
+    [Bug 2699] HAVE_SYS_SELECT_H is misspelled in refclock_gpsdjson.c
+
+  ntpd/refclock_gpsdjson.c@1.15 +1 -1
+    [Bug 2699] HAVE_SYS_SELECT_H is misspelled in refclock_gpsdjson.c
+
+ChangeSet@1.3269, 2014-12-22 02:52:42+00:00, stenn@psp-deb1.ntp.org
+  NEWS file update
+
+  NEWS@1.129 +39 -12
+
+ChangeSet@1.3268, 2014-12-21 01:24:15+00:00, stenn@psp-deb1.ntp.org
+  [Sec 2672] On some OSes ::1 can be spoofed, bypassing source IP ACLs
+
+  ChangeLog@1.1594 +1 -0
+    [Sec 2672] On some OSes ::1 can be spoofed, bypassing source IP ACLs
+
+  ntpd/ntp_io.c@1.397 +4 -6
+    [Sec 2672] On some OSes ::1 can be spoofed, bypassing source IP ACLs
+
+ChangeSet@1.3267, 2014-12-21 00:35:39+00:00, stenn@psp-deb1.ntp.org
+  typo
+
+  build@1.48 +1 -1
+    typo
+
 ChangeSet@1.3266, 2014-12-19 07:53:07-05:00, stenn@deacon.udel.edu
   NTP_4_2_8
   TAG: NTP_4_2_8
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/Makefile.am /cur/src/external/bsd/ntp/dist/Makefile.am
--- external/bsd/ntp/dist/Makefile.am	2014-12-19 12:37:34.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/Makefile.am	2015-04-07 19:51:17.000000000 -0700
@@ -2,7 +2,10 @@
 
 NULL =
 
+# moved sntp first to get libtool and libevent built.
+
 SUBDIRS =		\
+	sntp		\
 	scripts		\
 	include		\
 	libntp		\
@@ -17,7 +20,6 @@
 	clockstuff	\
 	kernel		\
 	util		\
-	sntp		\
 	tests		\
 	$(NULL)
 
@@ -64,7 +66,6 @@
 	.gcc-warning			\
 	libtool				\
 	html/.datecheck			\
-	sntp/built-sources-only		\
 	$(srcdir)/COPYRIGHT		\
 	$(srcdir)/.checkChangeLog	\
 	$(NULL)
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/Makefile.in /cur/src/external/bsd/ntp/dist/Makefile.in
--- external/bsd/ntp/dist/Makefile.in	2014-12-19 12:37:34.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/Makefile.in	2015-04-07 19:51:17.000000000 -0700
@@ -49,8 +49,7 @@
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
 	$(top_srcdir)/sntp/libopts/m4/stdnoreturn.m4 \
-	$(top_srcdir)/sntp/libevent/m4/openldap-thread-check.m4 \
-	$(top_srcdir)/sntp/libevent/m4/openldap.m4 \
+	$(top_srcdir)/sntp/m4/ax_c99_struct_init.m4 \
 	$(top_srcdir)/sntp/m4/define_dir.m4 \
 	$(top_srcdir)/sntp/m4/hms_search_lib.m4 \
 	$(top_srcdir)/sntp/m4/libtool.m4 \
@@ -79,6 +78,8 @@
 	$(top_srcdir)/sntp/m4/ntp_sntp.m4 \
 	$(top_srcdir)/sntp/m4/ntp_ver_suffix.m4 \
 	$(top_srcdir)/sntp/m4/ntp_vpathhack.m4 \
+	$(top_srcdir)/sntp/m4/openldap-thread-check.m4 \
+	$(top_srcdir)/sntp/m4/openldap.m4 \
 	$(top_srcdir)/sntp/m4/os_cflags.m4 \
 	$(top_srcdir)/sntp/m4/snprintf.m4 \
 	$(top_srcdir)/sntp/m4/version.m4 $(top_srcdir)/configure.ac
@@ -171,6 +172,7 @@
 CONFIG_SHELL = @CONFIG_SHELL@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
+CPPFLAGS_LIBEVENT = @CPPFLAGS_LIBEVENT@
 CPPFLAGS_NTP = @CPPFLAGS_NTP@
 CXX = @CXX@
 CXXCPP = @CXXCPP@
@@ -205,7 +207,9 @@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 LD = @LD@
+LDADD_LIBEVENT = @LDADD_LIBEVENT@
 LDADD_LIBNTP = @LDADD_LIBNTP@
+LDADD_LIBUTIL = @LDADD_LIBUTIL@
 LDADD_NLIST = @LDADD_NLIST@
 LDADD_NTP = @LDADD_NTP@
 LDFLAGS = @LDFLAGS@
@@ -344,6 +348,11 @@
 TIMETRIM_DS = @TIMETRIM_DS@
 TIMETRIM_MS = @TIMETRIM_MS@
 TIMETRIM_NI = @TIMETRIM_NI@
+UPDATE_LEAP_DB = @UPDATE_LEAP_DB@
+UPDATE_LEAP_DL = @UPDATE_LEAP_DL@
+UPDATE_LEAP_DS = @UPDATE_LEAP_DS@
+UPDATE_LEAP_MS = @UPDATE_LEAP_MS@
+UPDATE_LEAP_NI = @UPDATE_LEAP_NI@
 VERSION = @VERSION@
 VER_SUFFIX = @VER_SUFFIX@
 YACC = @YACC@
@@ -404,7 +413,10 @@
 top_srcdir = @top_srcdir@
 ACLOCAL_AMFLAGS = -I sntp/m4 -I sntp/libevent/m4 -I sntp/libopts/m4
 NULL = 
+
+# moved sntp first to get libtool and libevent built.
 SUBDIRS = \
+	sntp		\
 	scripts		\
 	include		\
 	libntp		\
@@ -419,7 +431,6 @@
 	clockstuff	\
 	kernel		\
 	util		\
-	sntp		\
 	tests		\
 	$(NULL)
 
@@ -465,7 +476,6 @@
 	.gcc-warning			\
 	libtool				\
 	html/.datecheck			\
-	sntp/built-sources-only		\
 	$(srcdir)/COPYRIGHT		\
 	$(srcdir)/.checkChangeLog	\
 	$(NULL)
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/NEWS /cur/src/external/bsd/ntp/dist/NEWS
--- external/bsd/ntp/dist/NEWS	2014-12-19 12:37:34.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/NEWS	2015-04-07 19:51:17.000000000 -0700
@@ -1,4 +1,205 @@
 ---
+NTP 4.2.8p2 (Harlan Stenn <stenn@ntp.org>, 2015/04/xx) 
+
+Focus: Security and Bug fixes, enhancements.
+
+Severity: MEDIUM
+ 
+In addition to bug fixes and enhancements, this release fixes the
+following medium-severity vulnerabilities involving private key
+authentication:
+
+* [Sec 2779] ntpd accepts unauthenticated packets with symmetric key crypto.
+
+    References: Sec 2779 / CVE-2015-1798 / VU#374268
+    Affects: All NTP4 releases starting with ntp-4.2.5p99 up to but not
+	including ntp-4.2.8p2 where the installation uses symmetric keys
+	to authenticate remote associations.
+    CVSS: (AV:A/AC:M/Au:N/C:P/I:P/A:P) Base Score: 5.4
+    Date Resolved: Stable (4.2.8p2) 07 Apr 2015
+    Summary: When ntpd is configured to use a symmetric key to authenticate
+	a remote NTP server/peer, it checks if the NTP message
+	authentication code (MAC) in received packets is valid, but not if
+	there actually is any MAC included. Packets without a MAC are
+	accepted as if they had a valid MAC. This allows a MITM attacker to
+	send false packets that are accepted by the client/peer without
+	having to know the symmetric key. The attacker needs to know the
+	transmit timestamp of the client to match it in the forged reply
+	and the false reply needs to reach the client before the genuine
+	reply from the server. The attacker doesn't necessarily need to be
+	relaying the packets between the client and the server.
+
+	Authentication using autokey doesn't have this problem as there is
+	a check that requires the key ID to be larger than NTP_MAXKEY,
+	which fails for packets without a MAC.
+    Mitigation:
+        Upgrade to 4.2.8p2, or later, from the NTP Project Download Page
+	or the NTP Public Services Project Download Page
+        Configure ntpd with enough time sources and monitor it properly. 
+    Credit: This issue was discovered by Miroslav Lichvar, of Red Hat. 
+
+* [Sec 2781] Authentication doesn't protect symmetric associations against
+  DoS attacks.
+
+    References: Sec 2781 / CVE-2015-1799 / VU#374268
+    Affects: All NTP releases starting with at least xntp3.3wy up to but
+	not including ntp-4.2.8p2 where the installation uses symmetric
+	key authentication.
+    CVSS: (AV:A/AC:M/Au:N/C:P/I:P/A:P) Base Score: 5.4
+    Note: the CVSS base Score for this issue could be 4.3 or lower, and
+	it could be higher than 5.4.
+    Date Resolved: Stable (4.2.8p2) 07 Apr 2015
+    Summary: An attacker knowing that NTP hosts A and B are peering with
+	each other (symmetric association) can send a packet to host A
+	with source address of B which will set the NTP state variables
+	on A to the values sent by the attacker. Host A will then send
+	on its next poll to B a packet with originate timestamp that
+	doesn't match the transmit timestamp of B and the packet will
+	be dropped. If the attacker does this periodically for both
+	hosts, they won't be able to synchronize to each other. This is
+	a known denial-of-service attack, described at
+	https://www.eecis.udel.edu/~mills/onwire.html .
+
+	According to the document the NTP authentication is supposed to
+	protect symmetric associations against this attack, but that
+	doesn't seem to be the case. The state variables are updated even
+	when authentication fails and the peers are sending packets with
+	originate timestamps that don't match the transmit timestamps on
+	the receiving side.
+
+	This seems to be a very old problem, dating back to at least
+	xntp3.3wy. It's also in the NTPv3 (RFC 1305) and NTPv4 (RFC 5905)
+	specifications, so other NTP implementations with support for
+	symmetric associations and authentication may be vulnerable too.
+	An update to the NTP RFC to correct this error is in-process.
+    Mitigation:
+        Upgrade to 4.2.8p2, or later, from the NTP Project Download Page
+	or the NTP Public Services Project Download Page
+        Note that for users of autokey, this specific style of MITM attack
+	is simply a long-known potential problem.
+        Configure ntpd with appropriate time sources and monitor ntpd.
+	Alert your staff if problems are detected. 
+    Credit: This issue was discovered by Miroslav Lichvar, of Red Hat. 
+
+* New script: update-leap
+The update-leap script will verify and if necessary, update the
+leap-second definition file.
+It requires the following commands in order to work:
+
+	wget logger tr sed shasum
+
+Some may choose to run this from cron.  It needs more portability testing.
+
+Bug Fixes and Improvements:
+
+* [Bug 1787] DCF77's formerly "antenna" bit is "call bit" since 2003.
+* [Bug 1960] setsockopt IPV6_MULTICAST_IF: Invalid argument.
+* [Bug 2346] "graceful termination" signals do not do peer cleanup.
+* [Bug 2728] See if C99-style structure initialization works.
+* [Bug 2747] Upgrade libevent to 2.1.5-beta.
+* [Bug 2749] ntp/lib/NTP/Util.pm needs update for ntpq -w, IPv6, .POOL. .
+* [Bug 2751] jitter.h has stale copies of l_fp macros.
+* [Bug 2756] ntpd hangs in startup with gcc 3.3.5 on ARM.
+* [Bug 2757] Quiet compiler warnings.
+* [Bug 2759] Expose nonvolatile/clk_wander_threshold to ntpq.
+* [Bug 2763] Allow different thresholds for forward and backward steps.
+* [Bug 2766] ntp-keygen output files should not be world-readable.
+* [Bug 2767] ntp-keygen -M should symlink to ntp.keys.
+* [Bug 2771] nonvolatile value is documented in wrong units.
+* [Bug 2773] Early leap announcement from Palisade/Thunderbolt
+* [Bug 2774] Unreasonably verbose printout - leap pending/warning
+* [Bug 2775] ntp-keygen.c fails to compile under Windows.
+* [Bug 2777] Fixed loops and decoding of Meinberg GPS satellite info.
+  Removed non-ASCII characters from some copyright comments.
+  Removed trailing whitespace.
+  Updated definitions for Meinberg clocks from current Meinberg header files.
+  Now use C99 fixed-width types and avoid non-ASCII characters in comments.
+  Account for updated definitions pulled from Meinberg header files.
+  Updated comments on Meinberg GPS receivers which are not only called GPS16x.
+  Replaced some constant numbers by defines from ntp_calendar.h
+  Modified creation of parse-specific variables for Meinberg devices
+  in gps16x_message().
+  Reworked mk_utcinfo() to avoid printing of ambiguous leap second dates.
+  Modified mbg_tm_str() which now expexts an additional parameter controlling
+  if the time status shall be printed.
+* [Sec 2779] ntpd accepts unauthenticated packets with symmetric key crypto.
+* [Sec 2781] Authentication doesn't protect symmetric associations against
+  DoS attacks.
+* [Bug 2783] Quiet autoconf warnings about missing AC_LANG_SOURCE.
+* [Bug 2789] Quiet compiler warnings from libevent.
+* [Bug 2790] If ntpd sets the Windows MM timer highest resolution
+  pause briefly before measuring system clock precision to yield
+  correct results.
+* Comment from Juergen Perlinger in ntp_calendar.c to make the code clearer.
+* Use predefined function types for parse driver functions
+  used to set up function pointers.
+  Account for changed prototype of parse_inp_fnc_t functions.
+  Cast parse conversion results to appropriate types to avoid
+  compiler warnings.
+  Let ioctl() for Windows accept a (void *) to avoid compiler warnings
+  when called with pointers to different types.
+
+---
+NTP 4.2.8p1 (Harlan Stenn <stenn@ntp.org>, 2015/02/04) 
+
+Focus: Security and Bug fixes, enhancements.
+
+Severity: HIGH
+ 
+In addition to bug fixes and enhancements, this release fixes the
+following high-severity vulnerabilities:
+
+* vallen is not validated in several places in ntp_crypto.c, leading
+  to a potential information leak or possibly a crash
+
+    References: Sec 2671 / CVE-2014-9297 / VU#852879
+    Affects: All NTP4 releases before 4.2.8p1 that are running autokey.
+    CVSS: (AV:N/AC:L/Au:N/C:P/I:P/A:P) Base Score: 7.5
+    Date Resolved: Stable (4.2.8p1) 04 Feb 2015
+    Summary: The vallen packet value is not validated in several code
+             paths in ntp_crypto.c which can lead to information leakage
+	     or perhaps a crash of the ntpd process.
+    Mitigation - any of:
+	Upgrade to 4.2.8p1, or later, from the NTP Project Download Page
+		or the NTP Public Services Project Download Page.
+	Disable Autokey Authentication by removing, or commenting out,
+		all configuration directives beginning with the "crypto"
+		keyword in your ntp.conf file. 
+    Credit: This vulnerability was discovered by Stephen Roettger of the
+    	Google Security Team, with additional cases found by Sebastian
+	Krahmer of the SUSE Security Team and Harlan Stenn of Network
+	Time Foundation. 
+
+* ::1 can be spoofed on some OSes, so ACLs based on IPv6 ::1 addresses
+  can be bypassed.
+
+    References: Sec 2672 / CVE-2014-9298 / VU#852879
+    Affects: All NTP4 releases before 4.2.8p1, under at least some
+	versions of MacOS and Linux. *BSD has not been seen to be vulnerable.
+    CVSS: (AV:N/AC:L/Au:N/C:P/I:P/A:C) Base Score: 9
+    Date Resolved: Stable (4.2.8p1) 04 Feb 2014
+    Summary: While available kernels will prevent 127.0.0.1 addresses
+	from "appearing" on non-localhost IPv4 interfaces, some kernels
+	do not offer the same protection for ::1 source addresses on
+	IPv6 interfaces. Since NTP's access control is based on source
+	address and localhost addresses generally have no restrictions,
+	an attacker can send malicious control and configuration packets
+	by spoofing ::1 addresses from the outside. Note Well: This is
+	not really a bug in NTP, it's a problem with some OSes. If you
+	have one of these OSes where ::1 can be spoofed, ALL ::1 -based
+	ACL restrictions on any application can be bypassed!
+    Mitigation:
+        Upgrade to 4.2.8p1, or later, from the NTP Project Download Page
+	or the NTP Public Services Project Download Page
+        Install firewall rules to block packets claiming to come from
+	::1 from inappropriate network interfaces. 
+    Credit: This vulnerability was discovered by Stephen Roettger of
+	the Google Security Team. 
+
+Additionally, over 30 bugfixes and improvements were made to the codebase.
+See the ChangeLog for more information.
+
+---
 NTP 4.2.8 (Harlan Stenn <stenn@ntp.org>, 2014/12/18) 
  
 Focus: Security and Bug fixes, enhancements.
@@ -8,6 +209,24 @@
 In addition to bug fixes and enhancements, this release fixes the
 following high-severity vulnerabilities:
 
+************************** vv NOTE WELL vv *****************************
+
+The vulnerabilities listed below can be significantly mitigated by
+following the BCP of putting
+
+ restrict default ... noquery
+
+in the ntp.conf file.  With the exception of:
+
+   receive(): missing return on error
+   References: Sec 2670 / CVE-2014-9296 / VU#852879
+
+below (which is a limited-risk vulnerability), none of the recent
+vulnerabilities listed below can be exploited if the source IP is
+restricted from sending a 'query'-class packet by your ntp.conf file.
+
+************************** ^^ NOTE WELL ^^ *****************************
+
 * Weak default key in config_auth().
 
   References: [Sec 2665] / CVE-2014-9293 / VU#852879
@@ -23,7 +242,9 @@
 	entropy.  This was sufficient back in the late 1990s when the
 	code was written.  Not today.
 
-  Mitigation: Upgrade to 4.2.7p11 or later.
+  Mitigation - any of:
+	- Upgrade to 4.2.7p11 or later.
+	- Follow BCP and put 'restrict ... noquery' in your ntp.conf file.
 
   Credit: This vulnerability was noticed in ntp-4.2.6 by Neel Mehta
   	of the Google Security Team.
@@ -43,7 +264,9 @@
 	cryptographic random number generator, either RAND_bytes from
 	OpenSSL, or arc4random(). 
 
-  Mitigation: Upgrade to 4.2.7p230 or later.
+  Mitigation - any of:
+  	- Upgrade to 4.2.7p230 or later.
+	- Follow BCP and put 'restrict ... noquery' in your ntp.conf file.
 
   Credit:  This vulnerability was discovered in ntp-4.2.6 by
   	Stephen Roettger of the Google Security Team.
@@ -61,10 +284,11 @@
 	buffer and potentially allow malicious code to be executed
 	with the privilege level of the ntpd process.
 
-  Mitigation: Upgrade to 4.2.8, or later, or
-	Disable Autokey Authentication by removing, or commenting out,
-	all configuration directives beginning with the crypto keyword
-	in your ntp.conf file. 
+  Mitigation - any of:
+  	- Upgrade to 4.2.8, or later, or
+	- Disable Autokey Authentication by removing, or commenting out,
+	  all configuration directives beginning with the crypto keyword
+	  in your ntp.conf file. 
 
   Credit: This vulnerability was discovered by Stephen Roettger of the
   	Google Security Team. 
@@ -80,7 +304,9 @@
   	can overflow a stack buffer and potentially allow malicious
 	code to be executed with the privilege level of the ntpd process.
 
-  Mitigation: Upgrade to 4.2.8, or later.
+  Mitigation - any of:
+  	- Upgrade to 4.2.8, or later.
+	- Follow BCP and put 'restrict ... noquery' in your ntp.conf file.
 
   Credit: This vulnerability was discovered by Stephen Roettger of the
   	Google Security Team. 
@@ -96,7 +322,9 @@
 	can overflow a stack buffer and potentially allow malicious
 	code to be executed with the privilege level of the ntpd process.
 
-  Mitigation: Upgrade to 4.2.8, or later.
+  Mitigation - any of:
+  	- Upgrade to 4.2.8, or later.
+	- Follow BCP and put 'restrict ... noquery' in your ntp.conf file.
 
   Credit: This vulnerability was discovered by Stephen Roettger of the
 	Google Security Team. 
@@ -118,10 +346,10 @@
 	becomes a 5. If system integrity can be partially affected
 	via all three integrity metrics, the CVSS base score become 7.5.
 
-  Mitigation:
-        Upgrade to 4.2.8, or later,
-        or Remove or comment out all configuration directives
-	beginning with the crypto keyword in your ntp.conf file. 
+  Mitigation - any of:
+        - Upgrade to 4.2.8, or later,
+        - Remove or comment out all configuration directives
+	  beginning with the crypto keyword in your ntp.conf file. 
 
   Credit: This vulnerability was discovered by Stephen Roettger of the
   	Google Security Team. 
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/aclocal.m4 /cur/src/external/bsd/ntp/dist/aclocal.m4
--- external/bsd/ntp/dist/aclocal.m4	2014-12-19 12:37:34.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/aclocal.m4	2015-04-07 19:51:17.000000000 -0700
@@ -1132,8 +1132,7 @@
 
 m4_include([sntp/libopts/m4/libopts.m4])
 m4_include([sntp/libopts/m4/stdnoreturn.m4])
-m4_include([sntp/libevent/m4/openldap-thread-check.m4])
-m4_include([sntp/libevent/m4/openldap.m4])
+m4_include([sntp/m4/ax_c99_struct_init.m4])
 m4_include([sntp/m4/define_dir.m4])
 m4_include([sntp/m4/hms_search_lib.m4])
 m4_include([sntp/m4/libtool.m4])
@@ -1162,5 +1161,7 @@
 m4_include([sntp/m4/ntp_sntp.m4])
 m4_include([sntp/m4/ntp_ver_suffix.m4])
 m4_include([sntp/m4/ntp_vpathhack.m4])
+m4_include([sntp/m4/openldap-thread-check.m4])
+m4_include([sntp/m4/openldap.m4])
 m4_include([sntp/m4/os_cflags.m4])
 m4_include([sntp/m4/snprintf.m4])
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/adjtimed/Makefile.in /cur/src/external/bsd/ntp/dist/adjtimed/Makefile.in
--- external/bsd/ntp/dist/adjtimed/Makefile.in	2014-12-19 12:37:36.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/adjtimed/Makefile.in	2015-04-07 19:51:17.000000000 -0700
@@ -49,8 +49,7 @@
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
 	$(top_srcdir)/sntp/libopts/m4/stdnoreturn.m4 \
-	$(top_srcdir)/sntp/libevent/m4/openldap-thread-check.m4 \
-	$(top_srcdir)/sntp/libevent/m4/openldap.m4 \
+	$(top_srcdir)/sntp/m4/ax_c99_struct_init.m4 \
 	$(top_srcdir)/sntp/m4/define_dir.m4 \
 	$(top_srcdir)/sntp/m4/hms_search_lib.m4 \
 	$(top_srcdir)/sntp/m4/libtool.m4 \
@@ -79,6 +78,8 @@
 	$(top_srcdir)/sntp/m4/ntp_sntp.m4 \
 	$(top_srcdir)/sntp/m4/ntp_ver_suffix.m4 \
 	$(top_srcdir)/sntp/m4/ntp_vpathhack.m4 \
+	$(top_srcdir)/sntp/m4/openldap-thread-check.m4 \
+	$(top_srcdir)/sntp/m4/openldap.m4 \
 	$(top_srcdir)/sntp/m4/os_cflags.m4 \
 	$(top_srcdir)/sntp/m4/snprintf.m4 \
 	$(top_srcdir)/sntp/m4/version.m4 $(top_srcdir)/configure.ac
@@ -153,6 +154,7 @@
 CONFIG_SHELL = @CONFIG_SHELL@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
+CPPFLAGS_LIBEVENT = @CPPFLAGS_LIBEVENT@
 CPPFLAGS_NTP = @CPPFLAGS_NTP@
 CXX = @CXX@
 CXXCPP = @CXXCPP@
@@ -187,7 +189,9 @@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 LD = @LD@
+LDADD_LIBEVENT = @LDADD_LIBEVENT@
 LDADD_LIBNTP = @LDADD_LIBNTP@
+LDADD_LIBUTIL = @LDADD_LIBUTIL@
 LDADD_NLIST = @LDADD_NLIST@
 LDADD_NTP = @LDADD_NTP@
 LDFLAGS = @LDFLAGS@
@@ -326,6 +330,11 @@
 TIMETRIM_DS = @TIMETRIM_DS@
 TIMETRIM_MS = @TIMETRIM_MS@
 TIMETRIM_NI = @TIMETRIM_NI@
+UPDATE_LEAP_DB = @UPDATE_LEAP_DB@
+UPDATE_LEAP_DL = @UPDATE_LEAP_DL@
+UPDATE_LEAP_DS = @UPDATE_LEAP_DS@
+UPDATE_LEAP_MS = @UPDATE_LEAP_MS@
+UPDATE_LEAP_NI = @UPDATE_LEAP_NI@
 VERSION = @VERSION@
 VER_SUFFIX = @VER_SUFFIX@
 YACC = @YACC@
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/build /cur/src/external/bsd/ntp/dist/build
--- external/bsd/ntp/dist/build	2014-12-19 12:37:34.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/build	2015-04-07 19:51:17.000000000 -0700
@@ -117,7 +117,7 @@
     ;;
 esac
 
-	BDIR="$BASEDIR$KEYSUF$CCSUF"
+BDIR="$BASEDIR$KEYSUF$CCSUF"
 
 [ -d "$BDIR" ] || mkdir $BDIR
 [ -f "$BDIR/.buildcvo" ] || echo $CVO > $BDIR/.buildcvo
@@ -162,7 +162,11 @@
     fi
 fi
 
-CONFIGURE="../configure --cache-file=../config.cache-$IAM$KEYSUF$CCSUF $CONFIG_ARGS"
+CONFIGURE="../configure"
+# We need KEYSUF because of RAND_ and others, and -noopenssl"
+#CONFIGURE="$CONFIGURE --cache-file=../config.cache-$IAM$KEYSUF$CCSUF"
+CONFIGURE="$CONFIGURE $CONFIG_ARGS"
+
 
 (	# This sequence of commands is logged to make.log.
 	# If config.status is newer than ../configure, and the same
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/clockstuff/Makefile.in /cur/src/external/bsd/ntp/dist/clockstuff/Makefile.in
--- external/bsd/ntp/dist/clockstuff/Makefile.in	2014-12-19 12:37:36.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/clockstuff/Makefile.in	2015-04-07 19:51:17.000000000 -0700
@@ -42,8 +42,7 @@
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
 	$(top_srcdir)/sntp/libopts/m4/stdnoreturn.m4 \
-	$(top_srcdir)/sntp/libevent/m4/openldap-thread-check.m4 \
-	$(top_srcdir)/sntp/libevent/m4/openldap.m4 \
+	$(top_srcdir)/sntp/m4/ax_c99_struct_init.m4 \
 	$(top_srcdir)/sntp/m4/define_dir.m4 \
 	$(top_srcdir)/sntp/m4/hms_search_lib.m4 \
 	$(top_srcdir)/sntp/m4/libtool.m4 \
@@ -72,6 +71,8 @@
 	$(top_srcdir)/sntp/m4/ntp_sntp.m4 \
 	$(top_srcdir)/sntp/m4/ntp_ver_suffix.m4 \
 	$(top_srcdir)/sntp/m4/ntp_vpathhack.m4 \
+	$(top_srcdir)/sntp/m4/openldap-thread-check.m4 \
+	$(top_srcdir)/sntp/m4/openldap.m4 \
 	$(top_srcdir)/sntp/m4/os_cflags.m4 \
 	$(top_srcdir)/sntp/m4/snprintf.m4 \
 	$(top_srcdir)/sntp/m4/version.m4 $(top_srcdir)/configure.ac
@@ -149,6 +150,7 @@
 CONFIG_SHELL = @CONFIG_SHELL@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
+CPPFLAGS_LIBEVENT = @CPPFLAGS_LIBEVENT@
 CPPFLAGS_NTP = @CPPFLAGS_NTP@
 CXX = @CXX@
 CXXCPP = @CXXCPP@
@@ -183,7 +185,9 @@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 LD = @LD@
+LDADD_LIBEVENT = @LDADD_LIBEVENT@
 LDADD_LIBNTP = @LDADD_LIBNTP@
+LDADD_LIBUTIL = @LDADD_LIBUTIL@
 LDADD_NLIST = @LDADD_NLIST@
 LDADD_NTP = @LDADD_NTP@
 LDFLAGS = @LDFLAGS@
@@ -322,6 +326,11 @@
 TIMETRIM_DS = @TIMETRIM_DS@
 TIMETRIM_MS = @TIMETRIM_MS@
 TIMETRIM_NI = @TIMETRIM_NI@
+UPDATE_LEAP_DB = @UPDATE_LEAP_DB@
+UPDATE_LEAP_DL = @UPDATE_LEAP_DL@
+UPDATE_LEAP_DS = @UPDATE_LEAP_DS@
+UPDATE_LEAP_MS = @UPDATE_LEAP_MS@
+UPDATE_LEAP_NI = @UPDATE_LEAP_NI@
 VERSION = @VERSION@
 VER_SUFFIX = @VER_SUFFIX@
 YACC = @YACC@
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/config.h.in /cur/src/external/bsd/ntp/dist/config.h.in
--- external/bsd/ntp/dist/config.h.in	2014-12-19 12:37:35.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/config.h.in	2015-04-07 19:51:17.000000000 -0700
@@ -327,6 +327,9 @@
    */
 #undef HAVE_ALLOCA_H
 
+/* Define to 1 if you have the `arc4random_buf' function. */
+#undef HAVE_ARC4RANDOM_BUF
+
 /* Define to 1 if you have the <arpa/nameser.h> header file. */
 #undef HAVE_ARPA_NAMESER_H
 
@@ -1328,6 +1331,10 @@
 /* Should we recommend a minimum value for tickadj? */
 #undef MIN_REC_TICKADJ
 
+/* Define to 1 if the compiler does not support C99's structure
+   initialization. */
+#undef MISSING_C99_STRUCT_INIT
+
 /* Do we need HPUX adjtime() library support? */
 #undef NEED_HPUX_ADJTIME
 
@@ -1558,6 +1565,9 @@
 /* Use OpenSSL's crypto random functions */
 #undef USE_OPENSSL_CRYPTO_RAND
 
+/* OK to use snprintb()? */
+#undef USE_SNPRINTB
+
 /* Can we use SIGPOLL for tty IO? */
 #undef USE_TTY_SIGPOLL
 
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/configure /cur/src/external/bsd/ntp/dist/configure
--- external/bsd/ntp/dist/configure	2014-12-19 12:37:35.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/configure	2015-04-07 19:51:17.000000000 -0700
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.68 for ntp4 4.2.8.
+# Generated by GNU Autoconf 2.68 for ntp 4.2.8p2.
 #
 # Report bugs to <http://bugs.ntp.org./>.
 #
@@ -568,10 +568,10 @@
 MAKEFLAGS=
 
 # Identity of this package.
-PACKAGE_NAME='ntp4'
-PACKAGE_TARNAME='ntp4'
-PACKAGE_VERSION='4.2.8'
-PACKAGE_STRING='ntp4 4.2.8'
+PACKAGE_NAME='ntp'
+PACKAGE_TARNAME='ntp'
+PACKAGE_VERSION='4.2.8p2'
+PACKAGE_STRING='ntp 4.2.8p2'
 PACKAGE_BUGREPORT='http://bugs.ntp.org./'
 PACKAGE_URL='http://www.ntp.org./'
 
@@ -649,7 +649,6 @@
 TESTDCF
 MAKE_CHECK_LAYOUT
 VER_SUFFIX
-PKG_CONFIG
 MAKE_CHECK_Y2K
 MAKE_LIBPARSE_KERNEL
 MAKE_LIBPARSE
@@ -667,12 +666,18 @@
 LIBISC_PTHREADS_NOTHREADS
 PTHREAD_LIBS
 HAVE_INLINE
+LDADD_LIBUTIL
 ALLOCA
 LIBM
 EDITLINE_LIBS
 LDADD_LIBNTP
 NTP_CROSSCOMPILE_FALSE
 NTP_CROSSCOMPILE_TRUE
+BUILD_LIBEVENT_FALSE
+BUILD_LIBEVENT_TRUE
+LDADD_LIBEVENT
+CPPFLAGS_LIBEVENT
+PKG_CONFIG
 LIBOPTS_DIR
 LIBOPTS_CFLAGS
 LIBOPTS_LDADD
@@ -705,6 +710,13 @@
 FGREP
 SED
 LIBTOOL
+INSTALL_UPDATE_LEAP_FALSE
+INSTALL_UPDATE_LEAP_TRUE
+UPDATE_LEAP_NI
+UPDATE_LEAP_MS
+UPDATE_LEAP_DS
+UPDATE_LEAP_DL
+UPDATE_LEAP_DB
 TIMETRIM_NI
 TIMETRIM_MS
 TIMETRIM_DS
@@ -1568,7 +1580,7 @@
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures ntp4 4.2.8 to adapt to many kinds of systems.
+\`configure' configures ntp 4.2.8p2 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1616,7 +1628,7 @@
   --infodir=DIR           info documentation [DATAROOTDIR/info]
   --localedir=DIR         locale-dependent data [DATAROOTDIR/locale]
   --mandir=DIR            man documentation [DATAROOTDIR/man]
-  --docdir=DIR            documentation root [DATAROOTDIR/doc/ntp4]
+  --docdir=DIR            documentation root [DATAROOTDIR/doc/ntp]
   --htmldir=DIR           html documentation [DOCDIR]
   --dvidir=DIR            dvi documentation [DOCDIR]
   --pdfdir=DIR            pdf documentation [DOCDIR]
@@ -1638,7 +1650,7 @@
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of ntp4 4.2.8:";;
+     short | recursive ) echo "Configuration of ntp 4.2.8p2:";;
    esac
   cat <<\_ACEOF
 
@@ -1804,7 +1816,7 @@
 it to find libraries and programs with nonstandard names/locations.
 
 Report bugs to <http://bugs.ntp.org./>.
-ntp4 home page: <http://www.ntp.org./>.
+ntp home page: <http://www.ntp.org./>.
 _ACEOF
 ac_status=$?
 fi
@@ -1867,7 +1879,7 @@
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-ntp4 configure 4.2.8
+ntp configure 4.2.8p2
 generated by GNU Autoconf 2.68
 
 Copyright (C) 2010 Free Software Foundation, Inc.
@@ -2692,7 +2704,7 @@
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by ntp4 $as_me 4.2.8, which was
+It was created by ntp $as_me 4.2.8p2, which was
 generated by GNU Autoconf 2.68.  Invocation command line was
 
   $ $0 $@
@@ -3638,8 +3650,8 @@
 
 
 # Define the identity of the package.
- PACKAGE='ntp4'
- VERSION='4.2.8'
+ PACKAGE='ntp'
+ VERSION='4.2.8p2'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -5429,6 +5441,183 @@
 fi
 
 
+   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C99" >&5
+$as_echo_n "checking for $CC option to accept ISO C99... " >&6; }
+if ${ac_cv_prog_cc_c99+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_prog_cc_c99=no
+ac_save_CC=$CC
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdarg.h>
+#include <stdbool.h>
+#include <stdlib.h>
+#include <wchar.h>
+#include <stdio.h>
+
+// Check varargs macros.  These examples are taken from C99 6.10.3.5.
+#define debug(...) fprintf (stderr, __VA_ARGS__)
+#define showlist(...) puts (#__VA_ARGS__)
+#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__))
+static void
+test_varargs_macros (void)
+{
+  int x = 1234;
+  int y = 5678;
+  debug ("Flag");
+  debug ("X = %d\n", x);
+  showlist (The first, second, and third items.);
+  report (x>y, "x is %d but y is %d", x, y);
+}
+
+// Check long long types.
+#define BIG64 18446744073709551615ull
+#define BIG32 4294967295ul
+#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0)
+#if !BIG_OK
+  your preprocessor is broken;
+#endif
+#if BIG_OK
+#else
+  your preprocessor is broken;
+#endif
+static long long int bignum = -9223372036854775807LL;
+static unsigned long long int ubignum = BIG64;
+
+struct incomplete_array
+{
+  int datasize;
+  double data[];
+};
+
+struct named_init {
+  int number;
+  const wchar_t *name;
+  double average;
+};
+
+typedef const char *ccp;
+
+static inline int
+test_restrict (ccp restrict text)
+{
+  // See if C++-style comments work.
+  // Iterate through items via the restricted pointer.
+  // Also check for declarations in for loops.
+  for (unsigned int i = 0; *(text+i) != '\0'; ++i)
+    continue;
+  return 0;
+}
+
+// Check varargs and va_copy.
+static void
+test_varargs (const char *format, ...)
+{
+  va_list args;
+  va_start (args, format);
+  va_list args_copy;
+  va_copy (args_copy, args);
+
+  const char *str;
+  int number;
+  float fnumber;
+
+  while (*format)
+    {
+      switch (*format++)
+	{
+	case 's': // string
+	  str = va_arg (args_copy, const char *);
+	  break;
+	case 'd': // int
+	  number = va_arg (args_copy, int);
+	  break;
+	case 'f': // float
+	  fnumber = va_arg (args_copy, double);
+	  break;
+	default:
+	  break;
+	}
+    }
+  va_end (args_copy);
+  va_end (args);
+}
+
+int
+main ()
+{
+
+  // Check bool.
+  _Bool success = false;
+
+  // Check restrict.
+  if (test_restrict ("String literal") == 0)
+    success = true;
+  char *restrict newvar = "Another string";
+
+  // Check varargs.
+  test_varargs ("s, d' f .", "string", 65, 34.234);
+  test_varargs_macros ();
+
+  // Check flexible array members.
+  struct incomplete_array *ia =
+    malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10));
+  ia->datasize = 10;
+  for (int i = 0; i < ia->datasize; ++i)
+    ia->data[i] = i * 1.234;
+
+  // Check named initializers.
+  struct named_init ni = {
+    .number = 34,
+    .name = L"Test wide string",
+    .average = 543.34343,
+  };
+
+  ni.number = 58;
+
+  int dynamic_array[ni.number];
+  dynamic_array[ni.number - 1] = 543;
+
+  // work around unused variable warnings
+  return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x'
+	  || dynamic_array[ni.number - 1] != 543);
+
+  ;
+  return 0;
+}
+_ACEOF
+for ac_arg in '' -std=gnu99 -std=c99 -c99 -AC99 -xc99=all -qlanglvl=extc99
+do
+  CC="$ac_save_CC $ac_arg"
+  if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_c99=$ac_arg
+fi
+rm -f core conftest.err conftest.$ac_objext
+  test "x$ac_cv_prog_cc_c99" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c99" in
+  x)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+  xno)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+  *)
+    CC="$CC $ac_cv_prog_cc_c99"
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5
+$as_echo "$ac_cv_prog_cc_c99" >&6; } ;;
+esac
+if test "x$ac_cv_prog_cc_c99" != xno; then :
+
+fi
+
+
 
 
 
@@ -6162,6 +6351,7 @@
 
 
 
+
 CFLAGS_NTP=
 CPPFLAGS_NTP=
 LDADD_NTP=
@@ -7597,6 +7787,44 @@
 fi
 
 
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports C99 structure initialization" >&5
+$as_echo_n "checking whether the compiler supports C99 structure initialization... " >&6; }
+
+
+	ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+		cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+			struct foo_s {int i1; int i2;};
+			int main() { struct foo_s foo[] = { { .i1 = 1, .i2 = 1 }, { .i1 = 2, .i2 = 2 }, { .i1 = 0, .i2 = 0 } }; }
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+$as_echo "#define MISSING_C99_STRUCT_INIT 1" >>confdefs.h
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+	ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking to see if we need ylwrap VPATH hack" >&5
 $as_echo_n "checking to see if we need ylwrap VPATH hack... " >&6; }
@@ -7763,6 +7991,19 @@
 
 
 
+
+ if test -z "$UPDATE_LEAP_NI" ; then
+  INSTALL_UPDATE_LEAP_TRUE=
+  INSTALL_UPDATE_LEAP_FALSE='#'
+else
+  INSTALL_UPDATE_LEAP_TRUE='#'
+  INSTALL_UPDATE_LEAP_FALSE=
+fi
+
+
+
+
+
 # So far, the only shared library we might use is libopts.
 # It's a small library - we might as well use a static version of it.
 # Check whether --enable-shared was given.
@@ -19237,6 +19478,126 @@
 
 
 
+ntp_pkgconfig_min_version='0.15.0'
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
+set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_PKG_CONFIG+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $PKG_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+PKG_CONFIG=$ac_cv_path_PKG_CONFIG
+if test -n "$PKG_CONFIG"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
+$as_echo "$PKG_CONFIG" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_PKG_CONFIG"; then
+  ac_pt_PKG_CONFIG=$PKG_CONFIG
+  # Extract the first word of "pkg-config", so it can be a program name with args.
+set dummy pkg-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $ac_pt_PKG_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
+if test -n "$ac_pt_PKG_CONFIG"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
+$as_echo "$ac_pt_PKG_CONFIG" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_PKG_CONFIG" = x; then
+    PKG_CONFIG=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    PKG_CONFIG=$ac_pt_PKG_CONFIG
+  fi
+else
+  PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
+fi
+
+{ ac_cv_path_PKG_CONFIG=; unset ac_cv_path_PKG_CONFIG;}
+{ ac_cv_path_ac_pt_PKG_CONFIG=; unset ac_cv_path_ac_pt_PKG_CONFIG;}
+
+case "$PKG_CONFIG" in
+ /*)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking if pkg-config is at least version $ntp_pkgconfig_min_version" >&5
+$as_echo_n "checking if pkg-config is at least version $ntp_pkgconfig_min_version... " >&6; }
+    if $PKG_CONFIG --atleast-pkgconfig-version $ntp_pkgconfig_min_version; then
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+    else
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+	PKG_CONFIG=""
+    fi
+    ;;
+esac
+
+
+
+
 # Check whether --enable-local-libevent was given.
 if test "${enable_local_libevent+set}" = set; then :
   enableval=$enable_local_libevent; ntp_use_local_libevent=$enableval
@@ -19249,6 +19610,91 @@
 
 
 
+ntp_libevent_min_version=2
+ntp_libevent_tearoff=sntp/libevent
+
+
+
+
+case "$ntp_use_local_libevent" in
+ yes)
+    ;;
+ *) # If we have (a good enough) pkg-config, see if it can find libevent
+    case "$PKG_CONFIG" in
+     /*)
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if libevent $ntp_libevent_min_version or later is installed" >&5
+$as_echo_n "checking if libevent $ntp_libevent_min_version or later is installed... " >&6; }
+	if $PKG_CONFIG --atleast-version=$ntp_libevent_min_version libevent
+	then
+	    ntp_use_local_libevent=no
+	    { $as_echo "$as_me:${as_lineno-$LINENO}: Using the installed libevent" >&5
+$as_echo "$as_me: Using the installed libevent" >&6;}
+	    CPPFLAGS_LIBEVENT=`$PKG_CONFIG --cflags-only-I libevent`
+	    # HMS: I hope the following is accurate.
+	    # We don't need -levent, we only need  -levent_core.
+	    # While we could grab only the -L stuff, there *might* be
+	    # other flags there we want.  Originally we just removed -levent
+	    # but then somebody decided to install -levent-2.0
+	    # LDADD_LIBEVENT=`$PKG_CONFIG --libs libevent | sed 's:-levent::'`
+	    # So now we dance...
+	    LDADD_LIBEVENT=
+	    for i in `$PKG_CONFIG --libs libevent`
+	    do
+		case "$i" in
+		 -levent*) ;;
+		 *) case "$LDADD_LIBEVENT" in
+		     '') LDADD_LIBEVENT="$i" ;;
+		     *) LDADD_LIBEVENT="$LDADD_LIBEVENT $i" ;;
+		    esac
+		    ;;
+		esac
+	    done
+	    case "$LIBISC_PTHREADS_NOTHREADS" in
+	     pthreads)
+		LDADD_LIBEVENT="$LDADD_LIBEVENT -levent_pthreads"
+	    esac
+	    LDADD_LIBEVENT="$LDADD_LIBEVENT -levent_core"
+	    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+	else
+	    ntp_use_local_libevent=yes
+	    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+	fi
+	;;
+     *)
+	ntp_use_local_libevent=yes
+	;;
+    esac
+    ;;
+esac
+
+case "$ntp_use_local_libevent" in
+ yes)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: Using libevent tearoff" >&5
+$as_echo "$as_me: Using libevent tearoff" >&6;}
+    CPPFLAGS_LIBEVENT="-I\$(top_builddir)/$ntp_libevent_tearoff/include -I\$(top_srcdir)/$ntp_libevent_tearoff/include"
+    case "$LIBISC_PTHREADS_NOTHREADS" in
+     pthreads)
+	LDADD_LIBEVENT="\$(top_builddir)/$ntp_libevent_tearoff/libevent_pthreads.la \$(top_builddir)/$ntp_libevent_tearoff/libevent_core.la"
+	;;
+     *)
+	LDADD_LIBEVENT="\$(top_builddir)/$ntp_libevent_tearoff/libevent_core.la"
+    esac
+esac
+
+ if test "x$ntp_use_local_libevent" = "xyes"; then
+  BUILD_LIBEVENT_TRUE=
+  BUILD_LIBEVENT_FALSE='#'
+else
+  BUILD_LIBEVENT_TRUE='#'
+  BUILD_LIBEVENT_FALSE=
+fi
+
+
+
+
+
 
 # Expose a cross-compilation indicator to makefiles
  if test $build != $host; then
@@ -21078,6 +21524,73 @@
 done
 
 
+# Bug 2713
+LDADD_LIBUTIL=
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing snprintb" >&5
+$as_echo_n "checking for library containing snprintb... " >&6; }
+if ${ac_cv_search_snprintb+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char snprintb ();
+int
+main ()
+{
+return snprintb ();
+  ;
+  return 0;
+}
+_ACEOF
+for ac_lib in '' util; do
+  if test -z "$ac_lib"; then
+    ac_res="none required"
+  else
+    ac_res=-l$ac_lib
+    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+  fi
+  if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_search_snprintb=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext
+  if ${ac_cv_search_snprintb+:} false; then :
+  break
+fi
+done
+if ${ac_cv_search_snprintb+:} false; then :
+
+else
+  ac_cv_search_snprintb=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_snprintb" >&5
+$as_echo "$ac_cv_search_snprintb" >&6; }
+ac_res=$ac_cv_search_snprintb
+if test "$ac_res" != no; then :
+  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+  case "$ac_cv_search_snprintb" in
+ 'none required') ;;
+ no) ;;
+ *) LDADD_LIBUTIL="$ac_cv_search_snprintb $LDADD_LIBUTIL" ;;
+ esac
+
+$as_echo "#define USE_SNPRINTB 1" >>confdefs.h
+
+fi
+
+
 #
 for ac_header in errno.h sys/socket.h sys/types.h time.h
 do :
@@ -29952,6 +30465,20 @@
 
 ####
 
+for ac_func in arc4random_buf
+do :
+  ac_fn_c_check_func "$LINENO" "arc4random_buf" "ac_cv_func_arc4random_buf"
+if test "x$ac_cv_func_arc4random_buf" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_ARC4RANDOM_BUF 1
+_ACEOF
+
+fi
+done
+
+
+####
+
 saved_LIBS="$LIBS"
 LIBS="$LIBS $LDADD_LIBNTP"
 for ac_func in daemon
@@ -31240,10 +31767,10 @@
 	    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
-		    #include <sys/syscall.h>
-		    #if !defined(SYS_ntp_gettime) || !defined(SYS_ntp_adjtime)
-		    # error
-		    #endif
+			#include <sys/syscall.h>
+			#if !defined(SYS_ntp_gettime) || !defined(SYS_ntp_adjtime)
+			# error
+			#endif
 
 _ACEOF
 if ac_fn_c_try_cpp "$LINENO"; then :
@@ -31279,10 +31806,10 @@
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
-	    #include <sys/timex.h>
-	    #ifndef STA_FLL
-	    # error
-	    #endif
+		#include <sys/timex.h>
+		#ifndef STA_FLL
+		# error
+		#endif
 
 _ACEOF
 if ac_fn_c_try_cpp "$LINENO"; then :
@@ -33046,126 +33573,6 @@
 
 
 
-ntp_pkgconfig_min_version='0.15.0'
-if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
-set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_PKG_CONFIG+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  case $PKG_CONFIG in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-  ;;
-esac
-fi
-PKG_CONFIG=$ac_cv_path_PKG_CONFIG
-if test -n "$PKG_CONFIG"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
-$as_echo "$PKG_CONFIG" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_path_PKG_CONFIG"; then
-  ac_pt_PKG_CONFIG=$PKG_CONFIG
-  # Extract the first word of "pkg-config", so it can be a program name with args.
-set dummy pkg-config; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  case $ac_pt_PKG_CONFIG in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-  ;;
-esac
-fi
-ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
-if test -n "$ac_pt_PKG_CONFIG"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
-$as_echo "$ac_pt_PKG_CONFIG" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-  if test "x$ac_pt_PKG_CONFIG" = x; then
-    PKG_CONFIG=""
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    PKG_CONFIG=$ac_pt_PKG_CONFIG
-  fi
-else
-  PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
-fi
-
-{ ac_cv_path_PKG_CONFIG=; unset ac_cv_path_PKG_CONFIG;}
-{ ac_cv_path_ac_pt_PKG_CONFIG=; unset ac_cv_path_ac_pt_PKG_CONFIG;}
-
-case "$PKG_CONFIG" in
- /*)
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking if pkg-config is at least version $ntp_pkgconfig_min_version" >&5
-$as_echo_n "checking if pkg-config is at least version $ntp_pkgconfig_min_version... " >&6; }
-    if $PKG_CONFIG --atleast-pkgconfig-version $ntp_pkgconfig_min_version; then
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-    else
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-	PKG_CONFIG=""
-    fi
-    ;;
-esac
-
-
-
-
 
 VER_SUFFIX=
 
@@ -34977,7 +35384,6 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we should enable NIST lockclock scheme" >&5
 $as_echo_n "checking if we should enable NIST lockclock scheme... " >&6; }
-
 # Check whether --enable-nist was given.
 if test "${enable_nist+set}" = set; then :
   enableval=$enable_nist; ans=$enableval
@@ -34999,7 +35405,6 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we want support for Samba's signing daemon" >&5
 $as_echo_n "checking if we want support for Samba's signing daemon... " >&6; }
-
 # Check whether --enable-ntp-signd was given.
 if test "${enable_ntp_signd+set}" = set; then :
   enableval=$enable_ntp_signd; ans=$enableval
@@ -36095,33 +36500,35 @@
 
 ac_config_files="$ac_config_files scripts/Makefile"
 
-ac_config_files="$ac_config_files scripts/lib/Makefile"
+ac_config_files="$ac_config_files scripts/build/Makefile"
 
-ac_config_files="$ac_config_files scripts/calc_tickadj/calc_tickadj"
+ac_config_files="$ac_config_files scripts/build/mkver"
 
 ac_config_files="$ac_config_files scripts/calc_tickadj/Makefile"
 
-ac_config_files="$ac_config_files scripts/build/mkver"
+ac_config_files="$ac_config_files scripts/calc_tickadj/calc_tickadj"
 
-ac_config_files="$ac_config_files scripts/ntp-wait/ntp-wait"
+ac_config_files="$ac_config_files scripts/lib/Makefile"
 
 ac_config_files="$ac_config_files scripts/ntp-wait/Makefile"
 
-ac_config_files="$ac_config_files scripts/ntpsweep/ntpsweep"
+ac_config_files="$ac_config_files scripts/ntp-wait/ntp-wait"
 
 ac_config_files="$ac_config_files scripts/ntpsweep/Makefile"
 
-ac_config_files="$ac_config_files scripts/ntptrace/ntptrace"
+ac_config_files="$ac_config_files scripts/ntpsweep/ntpsweep"
 
 ac_config_files="$ac_config_files scripts/ntptrace/Makefile"
 
+ac_config_files="$ac_config_files scripts/ntptrace/ntptrace"
+
 ac_config_files="$ac_config_files scripts/ntpver"
 
 ac_config_files="$ac_config_files scripts/plot_summary"
 
 ac_config_files="$ac_config_files scripts/summary"
 
-ac_config_files="$ac_config_files scripts/build/Makefile"
+ac_config_files="$ac_config_files scripts/update-leap/Makefile"
 
 ac_config_files="$ac_config_files tests/Makefile"
 
@@ -36315,6 +36722,10 @@
   as_fn_error $? "conditional \"INSTALL_NTPSWEEP\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
+if test -z "${INSTALL_UPDATE_LEAP_TRUE}" && test -z "${INSTALL_UPDATE_LEAP_FALSE}"; then
+  as_fn_error $? "conditional \"INSTALL_UPDATE_LEAP\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
 if test -z "${GL_GENERATE_STDNORETURN_H_TRUE}" && test -z "${GL_GENERATE_STDNORETURN_H_FALSE}"; then
   as_fn_error $? "conditional \"GL_GENERATE_STDNORETURN_H\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
@@ -36327,6 +36738,10 @@
   as_fn_error $? "conditional \"NEED_LIBOPTS\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
+if test -z "${BUILD_LIBEVENT_TRUE}" && test -z "${BUILD_LIBEVENT_FALSE}"; then
+  as_fn_error $? "conditional \"BUILD_LIBEVENT\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
 if test -z "${NTP_CROSSCOMPILE_TRUE}" && test -z "${NTP_CROSSCOMPILE_FALSE}"; then
   as_fn_error $? "conditional \"NTP_CROSSCOMPILE\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
@@ -36756,7 +37171,7 @@
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by ntp4 $as_me 4.2.8, which was
+This file was extended by ntp $as_me 4.2.8p2, which was
 generated by GNU Autoconf 2.68.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -36817,13 +37232,13 @@
 $config_commands
 
 Report bugs to <http://bugs.ntp.org./>.
-ntp4 home page: <http://www.ntp.org./>."
+ntp home page: <http://www.ntp.org./>."
 
 _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-ntp4 config.status 4.2.8
+ntp config.status 4.2.8p2
 configured by $0, generated by GNU Autoconf 2.68,
   with options \\"\$ac_cs_config\\"
 
@@ -37350,20 +37765,21 @@
     "ntpsnmpd/Makefile") CONFIG_FILES="$CONFIG_FILES ntpsnmpd/Makefile" ;;
     "parseutil/Makefile") CONFIG_FILES="$CONFIG_FILES parseutil/Makefile" ;;
     "scripts/Makefile") CONFIG_FILES="$CONFIG_FILES scripts/Makefile" ;;
-    "scripts/lib/Makefile") CONFIG_FILES="$CONFIG_FILES scripts/lib/Makefile" ;;
-    "scripts/calc_tickadj/calc_tickadj") CONFIG_FILES="$CONFIG_FILES scripts/calc_tickadj/calc_tickadj" ;;
-    "scripts/calc_tickadj/Makefile") CONFIG_FILES="$CONFIG_FILES scripts/calc_tickadj/Makefile" ;;
+    "scripts/build/Makefile") CONFIG_FILES="$CONFIG_FILES scripts/build/Makefile" ;;
     "scripts/build/mkver") CONFIG_FILES="$CONFIG_FILES scripts/build/mkver" ;;
-    "scripts/ntp-wait/ntp-wait") CONFIG_FILES="$CONFIG_FILES scripts/ntp-wait/ntp-wait" ;;
+    "scripts/calc_tickadj/Makefile") CONFIG_FILES="$CONFIG_FILES scripts/calc_tickadj/Makefile" ;;
+    "scripts/calc_tickadj/calc_tickadj") CONFIG_FILES="$CONFIG_FILES scripts/calc_tickadj/calc_tickadj" ;;
+    "scripts/lib/Makefile") CONFIG_FILES="$CONFIG_FILES scripts/lib/Makefile" ;;
     "scripts/ntp-wait/Makefile") CONFIG_FILES="$CONFIG_FILES scripts/ntp-wait/Makefile" ;;
-    "scripts/ntpsweep/ntpsweep") CONFIG_FILES="$CONFIG_FILES scripts/ntpsweep/ntpsweep" ;;
+    "scripts/ntp-wait/ntp-wait") CONFIG_FILES="$CONFIG_FILES scripts/ntp-wait/ntp-wait" ;;
     "scripts/ntpsweep/Makefile") CONFIG_FILES="$CONFIG_FILES scripts/ntpsweep/Makefile" ;;
-    "scripts/ntptrace/ntptrace") CONFIG_FILES="$CONFIG_FILES scripts/ntptrace/ntptrace" ;;
+    "scripts/ntpsweep/ntpsweep") CONFIG_FILES="$CONFIG_FILES scripts/ntpsweep/ntpsweep" ;;
     "scripts/ntptrace/Makefile") CONFIG_FILES="$CONFIG_FILES scripts/ntptrace/Makefile" ;;
+    "scripts/ntptrace/ntptrace") CONFIG_FILES="$CONFIG_FILES scripts/ntptrace/ntptrace" ;;
     "scripts/ntpver") CONFIG_FILES="$CONFIG_FILES scripts/ntpver" ;;
     "scripts/plot_summary") CONFIG_FILES="$CONFIG_FILES scripts/plot_summary" ;;
     "scripts/summary") CONFIG_FILES="$CONFIG_FILES scripts/summary" ;;
-    "scripts/build/Makefile") CONFIG_FILES="$CONFIG_FILES scripts/build/Makefile" ;;
+    "scripts/update-leap/Makefile") CONFIG_FILES="$CONFIG_FILES scripts/update-leap/Makefile" ;;
     "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;;
     "tests/libntp/Makefile") CONFIG_FILES="$CONFIG_FILES tests/libntp/Makefile" ;;
     "tests/ntpd/Makefile") CONFIG_FILES="$CONFIG_FILES tests/ntpd/Makefile" ;;
@@ -38901,8 +39317,8 @@
  ;;
     "ntpd/complete.conf":F) sed -e '/^rlimit$/d' < ntpd/complete.conf > ntpd/complete.conf.new && mv ntpd/complete.conf.new ntpd/complete.conf ;;
     "ntpdc/nl.pl":F) chmod +x ntpdc/nl.pl ;;
-    "scripts/calc_tickadj/calc_tickadj":F) chmod +x scripts/calc_tickadj/calc_tickadj ;;
     "scripts/build/mkver":F) chmod +x scripts/build/mkver ;;
+    "scripts/calc_tickadj/calc_tickadj":F) chmod +x scripts/calc_tickadj/calc_tickadj ;;
     "scripts/ntp-wait/ntp-wait":F) chmod +x scripts/ntp-wait/ntp-wait ;;
     "scripts/ntpsweep/ntpsweep":F) chmod +x scripts/ntpsweep/ntpsweep ;;
     "scripts/ntptrace/ntptrace":F) chmod +x scripts/ntptrace/ntptrace ;;
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/configure.ac /cur/src/external/bsd/ntp/dist/configure.ac
--- external/bsd/ntp/dist/configure.ac	2014-12-19 12:37:35.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/configure.ac	2015-04-07 19:51:17.000000000 -0700
@@ -3,7 +3,7 @@
 m4_include([sntp/m4/version.m4])
 AC_PREREQ([2.61])
 AC_INIT(
-    [ntp4],
+    [ntp],
     [VERSION_NUMBER],
     [http://bugs.ntp.org./],
     [],
@@ -68,6 +68,7 @@
 AC_PROG_CXX
 AC_PROG_YACC
 AC_PROG_CC_C_O
+AX_C99_STRUCT_INIT
 
 NTP_VPATH_HACK		dnl used only by ntpd/Makefile.am
 
@@ -102,7 +103,7 @@
 enable_nls=no
 LIBOPTS_CHECK_NOBUILD([sntp/libopts])
 
-NTP_ENABLE_LOCAL_LIBEVENT
+NTP_LIBEVENT_CHECK_NOBUILD([2], [sntp/libevent])
 
 NTP_LIBNTP
 
@@ -771,6 +772,10 @@
 
 #### 
 
+AC_CHECK_FUNCS([arc4random_buf])
+
+#### 
+
 saved_LIBS="$LIBS"
 LIBS="$LIBS $LDADD_LIBNTP"
 AC_CHECK_FUNCS([daemon])
@@ -1495,12 +1500,13 @@
 	    ;;
 	 *)
 	    AC_PREPROC_IFELSE(
-		[
-		    #include <sys/syscall.h>
-		    #if !defined(SYS_ntp_gettime) || !defined(SYS_ntp_adjtime)
-		    # error
-		    #endif
-		],
+		[AC_LANG_SOURCE(
+		    [
+			#include <sys/syscall.h>
+			#if !defined(SYS_ntp_gettime) || !defined(SYS_ntp_adjtime)
+			# error
+			#endif
+		    ])],
 		[ntp_cv_var_ntp_syscalls=kernel]
 	    )
 	    ;;
@@ -1522,12 +1528,13 @@
     [if sys/timex.h has STA_FLL],
     [ntp_cv_var_sta_fll],
     [AC_PREPROC_IFELSE(
-	[
-	    #include <sys/timex.h>
-	    #ifndef STA_FLL
-	    # error
-	    #endif
-	],
+	[AC_LANG_SOURCE(
+	    [
+		#include <sys/timex.h>
+		#ifndef STA_FLL
+		# error
+		#endif
+	    ])],
 	[ntp_cv_var_sta_fll=yes],
 	[ntp_cv_var_sta_fll=no]
     )]
@@ -1582,12 +1589,12 @@
 case "$ac_cv_header_termios_h" in
  yes)
     AC_PREPROC_IFELSE(
-	[
+	[AC_LANG_SOURCE([
 	    #include <termios.h>
 	    #ifndef TIOCGPPSEV
 	    # error
 	    #endif
-	],
+	])],
 	[ntp_ok=yes],
 	[ntp_ok=no]
     )
@@ -1608,12 +1615,12 @@
 case "$ac_cv_header_termios_h" in
  yes)
     AC_PREPROC_IFELSE(
-	[
+	[AC_LANG_SOURCE([
 	    #include <termios.h>
 	    #ifndef TIOCSPPS
 	    # error
 	    #endif
-	 ],
+	 ])],
 	 [ntp_ok=yes],
 	 [ntp_ok=no]
     )
@@ -1634,12 +1641,12 @@
 case "$ac_cv_header_sys_ppsclock_h" in
  yes)
     AC_PREPROC_IFELSE(
-	[
+	[AC_LANG_SOURCE([
 	    #include <sys/ppsclock.h>
 	    #ifndef CIOGETEV
 	    # error
 	    #endif
-	],
+	])],
 	[ntp_ok=yes],
 	[ntp_ok=no]
     )
@@ -1685,7 +1692,7 @@
   yesyes)
     AC_MSG_CHECKING([ioctl TIOCGSERIAL, TIOCSSERIAL, ASYNC_PPS_CD_POS, ASYNC_PPS_CD_NEG])
     AC_PREPROC_IFELSE(
-	[
+	[AC_LANG_SOURCE([
 	    #include <sys/time.h>
 	    typedef int u_int;
 	    #include <sys/ppsclock.h>
@@ -1706,7 +1713,7 @@
 	    #ifndef CIOGETEV
 	    # error
 	    #endif
-	],
+	])],
 	[ntp_ok=yes],
 	[ntp_ok=no]
     )
@@ -4189,7 +4196,6 @@
 esac
 
 AC_MSG_CHECKING([if we should enable NIST lockclock scheme])
-
 AC_ARG_ENABLE(
 	[nist],
 	[AS_HELP_STRING(
@@ -4209,7 +4215,6 @@
 esac
 
 AC_MSG_CHECKING([if we want support for Samba's signing daemon])
-
 AC_ARG_ENABLE(
     [ntp-signd],
     [AS_HELP_STRING(
@@ -4262,14 +4267,14 @@
     [for interface list sysctl],
     [ntp_cv_iflist_sysctl],
     [AC_PREPROC_IFELSE(
-	[
+	[AC_LANG_SOURCE([
 	    #include <sys/param.h>
 	    #include <sys/sysctl.h>
 	    #include <sys/socket.h>
 	    #ifndef NET_RT_IFLIST
 	    # error
 	    #endif
-	],
+	])],
 	[ntp_cv_iflist_sysctl=yes],
 	[ntp_cv_iflist_sysctl=no]
     )]
@@ -4329,20 +4334,21 @@
 AC_CONFIG_FILES([ntpsnmpd/Makefile])
 AC_CONFIG_FILES([parseutil/Makefile])
 AC_CONFIG_FILES([scripts/Makefile])
-AC_CONFIG_FILES([scripts/lib/Makefile])
-AC_CONFIG_FILES([scripts/calc_tickadj/calc_tickadj], [chmod +x scripts/calc_tickadj/calc_tickadj])
-AC_CONFIG_FILES([scripts/calc_tickadj/Makefile])
+AC_CONFIG_FILES([scripts/build/Makefile])
 AC_CONFIG_FILES([scripts/build/mkver],	[chmod +x scripts/build/mkver])
-AC_CONFIG_FILES([scripts/ntp-wait/ntp-wait],	[chmod +x scripts/ntp-wait/ntp-wait])
+AC_CONFIG_FILES([scripts/calc_tickadj/Makefile])
+AC_CONFIG_FILES([scripts/calc_tickadj/calc_tickadj], [chmod +x scripts/calc_tickadj/calc_tickadj])
+AC_CONFIG_FILES([scripts/lib/Makefile])
 AC_CONFIG_FILES([scripts/ntp-wait/Makefile])
-AC_CONFIG_FILES([scripts/ntpsweep/ntpsweep],	[chmod +x scripts/ntpsweep/ntpsweep])
+AC_CONFIG_FILES([scripts/ntp-wait/ntp-wait],	[chmod +x scripts/ntp-wait/ntp-wait])
 AC_CONFIG_FILES([scripts/ntpsweep/Makefile])
-AC_CONFIG_FILES([scripts/ntptrace/ntptrace],	[chmod +x scripts/ntptrace/ntptrace])
+AC_CONFIG_FILES([scripts/ntpsweep/ntpsweep],	[chmod +x scripts/ntpsweep/ntpsweep])
 AC_CONFIG_FILES([scripts/ntptrace/Makefile])
+AC_CONFIG_FILES([scripts/ntptrace/ntptrace],	[chmod +x scripts/ntptrace/ntptrace])
 AC_CONFIG_FILES([scripts/ntpver],	[chmod +x scripts/ntpver])
 AC_CONFIG_FILES([scripts/plot_summary],	[chmod +x scripts/plot_summary])
 AC_CONFIG_FILES([scripts/summary],	[chmod +x scripts/summary])
-AC_CONFIG_FILES([scripts/build/Makefile])
+AC_CONFIG_FILES([scripts/update-leap/Makefile])
 AC_CONFIG_FILES([tests/Makefile])
 AC_CONFIG_FILES([tests/libntp/Makefile])
 AC_CONFIG_FILES([tests/ntpd/Makefile])
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/html/build.html /cur/src/external/bsd/ntp/dist/html/build.html
--- external/bsd/ntp/dist/html/build.html	2014-12-19 12:37:36.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/html/build.html	2015-04-07 19:51:17.000000000 -0700
@@ -11,7 +11,7 @@
 <img src="pic/beaver.gif" alt="gif" align="left"><a href="http://www.eecis.udel.edu/%7emills/pictures.html">from <i>Pogo</i>, Walt Kelly</a>
 <p>For putting out compiler fires.</p>
 <p>Last update:
-  <!-- #BeginDate format:En2m -->31-Mar-2014  05:39<!-- #EndDate -->
+  <!-- #BeginDate format:En2m -->1-Apr-2015  02:57<!-- #EndDate -->
 </p>
 <br clear="left">
 <h4>Related Links</h4>
@@ -27,7 +27,7 @@
 </ul>
 <hr>
 <h4 id="build">Building and Installing the Distribution</h4>
-<p>It is not possible in a software distribution such as this to support every individual computer and operating system with a common executable, even with the same system but different versions and options. Therefore, it is necessary to configure, build and install for each system and version. In almost all cases, these procedures are completely automatic, The user types <tt>./configure</tt>, <tt>make</tt> and <tt>install</tt> in that order and the autoconfigure system does the rest. There are some exceptions, as noted below and on the <a href="hints.html">Hints and Kinks</a> pages.</p>
+<p>It is not possible in a software distribution such as this to support every individual computer and operating system with a common executable, even with the same system but different versions and options. Therefore, it is necessary to configure, build and install for each system and version. In almost all cases, these procedures are completely automatic, The user types <tt>./configure</tt>, and <tt>make install</tt> in that order and the autoconfigure system does the rest. There are some exceptions, as noted below and on the <a href="hints.html">Hints and Kinks</a> pages.</p>
 <p>If available, the OpenSSL library from <a href="http://www.openssl.org">http://www.openssl.org</a> is used to support public key cryptography. The library must be built and installed prior to building NTP. The procedures for doing that are included in the OpenSSL documentation. The library is found during the normal NTP configure phase and the interface routines compiled automatically. Only the <tt>libcrypto.a</tt> library file and <tt>openssl</tt> header files are needed. If the library is not available or disabled, this step is not required.</p>
 <p>The <a href="config.html">Build Options</a> page describes a number of options that determine whether debug support is included, whether and which reference clock drivers are included and the locations of the executables and library files, if not the default. By default debugging options and all reference clock drivers are included.</p>
 <h4 id="unix">Building and Installing for Unix</h4>
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/html/confopt.html /cur/src/external/bsd/ntp/dist/html/confopt.html
--- external/bsd/ntp/dist/html/confopt.html	2014-12-19 12:37:36.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/html/confopt.html	2015-04-07 19:51:17.000000000 -0700
@@ -91,11 +91,13 @@
 <h4 id="aux">Auxiliary Commands</h4>
 <dl>
 	<dt id="broadcastclient"><tt>broadcastclient</tt></dt>
-	<dd>Enable reception of broadcast server messages to any local interface (type	b address). Ordinarily, upon receiving a broadcast message for the first time, the broadcast client measures the nominal server propagation delay using a brief client/server exchange, after which it continues in listen-only mode. If a nonzero value is specified in the <tt>broadcastdelay</tt> command, the value becomes the delay and the volley is not executed. Note: the <tt>novolley</tt> option has been deprecated for future enhancements. Note that, in order to avoid accidental or malicious disruption in this mode, both the server and client should operate using symmetric key or public key authentication as described in the <a href="authopt.html">Authentication Options</a> page. Note that the volley is required with public key authentication in order to run the Autokey protocol..</dd>
+	<dd>Enable reception of broadcast server messages to any local interface (type	b address). Ordinarily, upon receiving a broadcast message for the first time, the broadcast client measures the nominal server propagation delay using a brief client/server exchange, after which it continues in listen-only mode. If a nonzero value is specified in the <tt>broadcastdelay</tt> command, the value becomes the delay and the volley is not executed. Note: the <tt>novolley</tt> option has been deprecated for future enhancements. Note that, in order to avoid accidental or malicious disruption in this mode, both the server and client should operate using symmetric key or public key authentication as described in the <a href="authopt.html">Authentication Options</a> page. Note that the volley is required with public key authentication in order to run the Autokey protocol.</dd>
   <dt id="manycastserver"><tt>manycastserver <i>address</i> [...]</tt></dt>
 	<dd>Enable reception of manycast client messages (type m) to the multicasts group address(es) (type m) specified. At least one address is required. Note that, in order to avoid accidental or malicious disruption, both the server and client should operate using symmetric key or public key authentication as described in the <a href="authopt.html">Authentication Options</a> page.</dd>
 	<dt id="multicastclient"><tt>multicastclient <i>address</i> [...]</tt></dt>
 	<dd>Enable reception of multicast server messages to the multicast group address(es) (type m) specified. Upon receiving a message for the first time, the multicast client measures the nominal server propagation delay using a brief client/server exchange with the server, then enters the broadcast client mode, in which it synchronizes to succeeding multicast messages. Note that, in order to avoid accidental or malicious disruption in this mode, both the server and client should operate using symmetric key or public key authentication as described in the <a href="authopt.html">Authentication Options</a> page.</dd>
+	<dt id="mdnstries"><tt>mdnstries</tt> <i>number</i></dt>
+	<dd>If we are participating in mDNS, after we have synched for the first time we attempt to register with the mDNS system.  If that registration attempt fails, we try again at one minute intervals for up to <tt>mdnstries</tt> times.  After all, <tt>ntpd</tt> may be starting before mDNS.  The default value for <tt>mdnstries</tt> is 5.</dd>
 </dl>
 <hr>
 <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script>
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/html/copyright.html /cur/src/external/bsd/ntp/dist/html/copyright.html
--- external/bsd/ntp/dist/html/copyright.html	2014-12-19 12:37:36.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/html/copyright.html	2015-04-07 19:51:17.000000000 -0700
@@ -10,16 +10,16 @@
 <h3>Copyright Notice</h3>
 <img src="pic/sheepb.jpg" alt="jpg" align="left"> "Clone me," says Dolly sheepishly.
 <p>Last update:
-  <!-- #BeginDate format:En2m -->9-Aug-2014  07:56<!-- #EndDate -->
+  <!-- #BeginDate format:En2m -->17-Jan-2015  00:16<!-- #EndDate -->
     UTC</p>
 <br clear="left">
 </p>
 <hr>
-<p>The following copyright notice applies to all files collectively  called the Network Time Protocol Version 4 Distribution. Unless  specifically declared otherwise in an individual file, this notice  applies as if the text was explicitly included in the file.</p>
+<p>The following copyright notice applies to all files collectively  called the Network Time Protocol Version 4 Distribution. Unless  specifically declared otherwise in an individual file, this entire notice  applies as if the text was explicitly included in the file.</p>
 <pre>
 ***********************************************************************
 *                                                                     *
-* Copyright (c) University of Delaware 1992-2014                      *
+* Copyright (c) University of Delaware 1992-2015                      *
 *                                                                     *
 * Permission to use, copy, modify, and distribute this software and   *
 * its documentation for any purpose with or without fee is hereby     *
@@ -35,6 +35,38 @@
 *                                                                     *
 ***********************************************************************
 </pre>
+<p>Content starting in 2011 from Harlan Stenn, Danny Mayer, and Martin Burnicki is:</p>
+<pre>
+***********************************************************************
+*                                                                     *
+* Copyright (c) Network Time Foundation 2011-2015                     *
+*                                                                     *
+* All Rights Reserved                                                 *
+*                                                                     *
+* Redistribution and use in source and binary forms, with or without  *
+* modification, are permitted provided that the following conditions  *
+* are met:                                                            *
+* 1. Redistributions of source code must retain the above copyright   *
+*    notice, this list of conditions and the following disclaimer.    *
+* 2. Redistributions in binary form must reproduce the above          *
+*    copyright notice, this list of conditions and the following      *
+*    disclaimer in the documentation and/or other materials provided  *
+*    with the distribution.                                           *
+*                                                                     *
+* THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS  *
+* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED   *
+* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE  *
+* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE    *
+* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR *
+* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT   *
+* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR  *
+* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF          *
+* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT           *
+* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE   *
+* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH    *
+* DAMAGE.                                                             *
+***********************************************************************
+</pre>
 <p>The following individuals contributed in part to the Network Time  Protocol Distribution Version 4 and are acknowledged as authors of this  work.</p>
 <ol>
   <li><a href="mailto:%20takao_abe@xurb.jp">Takao Abe &lt;takao_abe@xurb.jp&gt;</a> Clock driver for JJY receivers</li>
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/html/drivers/driver28.html /cur/src/external/bsd/ntp/dist/html/drivers/driver28.html
--- external/bsd/ntp/dist/html/drivers/driver28.html	2014-12-19 12:37:36.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/html/drivers/driver28.html	2015-04-07 19:51:17.000000000 -0700
@@ -7,6 +7,10 @@
         <meta name="GENERATOR" content="Mozilla/4.01 [en] (Win95; I) [Netscape]">
         <title>Shared Memory Driver</title>
         <link href="scripts/style.css" type="text/css" rel="stylesheet">
+	<style type="text/css">
+	  table.dlstable { font-size:85%; }
+	  td.ttf{ font-family:Courier; font-weight:bold; }
+	</style>
     </head>
 
     <body>
@@ -21,7 +25,13 @@
             Driver ID: <tt>SHM</tt></p>
 
         <h4>Description</h4>
-        <p>This driver receives its reference clock info from a shared memory-segment. The shared memory-segment is created with owner-only access for unit 0 and 1, and world access for unit 2 and 3</p>
+        <p>This driver receives its reference clock info from a shared
+        memory-segment. The shared memory-segment is created with owner-only
+        access by default, unless otherwise requested by the mode word for units
+        &ge;2. Units 0 and 1 are always created with owner-only access for
+        backward compatibility.
+	</p>
+
 
         <h4>Structure of shared memory-segment</h4>
         <pre>struct shmTime {
@@ -49,14 +59,14 @@
 
         <h4>Operation mode=0</h4>
         <p>Each second, the value of <code>valid</code> of the shared memory-segment is checked:</p>
-        <p>If set, the values in the record (clockTimeStampSec, clockTimeStampUSec, receiveTimeStampSec, receiveTimeStampUSec, leap, precision) are passed to ntp, and <code>valid</code> is cleared and <code>count</code> is bumped.</p>
+        <p>If set, the values in the record (clockTimeStampSec, clockTimeStampUSec, receiveTimeStampSec, receiveTimeStampUSec, leap, precision) are passed to <i>NTPD</i>, and <code>valid</code> is cleared and <code>count</code> is bumped.</p>
         <p>If not set, <code>count</code> is bumped.</p>
         <h4>Operation mode=1</h4>
         <p>Each second, <code>valid</code> in the shared memory-segment is checked:</p>
-        <p>If set, the <code>count</code> field of the record is remembered, and the values in the record (clockTimeStampSec, clockTimeStampUSec, receiveTimeStampSec, receiveTimeStampUSec, leap, precision) are read. Then, the remembered <code>count</code> is compared to current value of <code>count</code> now in the record. If both are equal, the values read from the record are passed to ntp. If they differ, another process has modified the record while it was read out (was not able to produce this case), and failure is reported to ntp. The <code>valid</code> flag is cleared and <code>count</code> is bumped.</p>
+        <p>If set, the <code>count</code> field of the record is remembered, and the values in the record (clockTimeStampSec, clockTimeStampUSec, receiveTimeStampSec, receiveTimeStampUSec, leap, precision) are read. Then, the remembered <code>count</code> is compared to current value of <code>count</code> now in the record. If both are equal, the values read from the record are passed to <i>NTPD</i>. If they differ, another process has modified the record while it was read out (was not able to produce this case), and failure is reported to <i>NTPD</i>. The <code>valid</code> flag is cleared and <code>count</code> is bumped.</p>
         <p>If not set, <code>count</code> is bumped</p>
 
-<h4>Mode-independent postprocessing</h4>
+<h4>Mode-independent post-processing</h4>
 After the time stamps have been successfully plucked from the SHM
 segment, some sanity checks take place:
 <ul>
@@ -69,30 +79,38 @@
   set to 1.
 </ul>
 
-<h4>gpsd</h4>
+<h4>GPSD</h4>
 
-<a href="http://gpsd.berlios.de/"><i>gpsd</i></a>
+<a href="http://gpsd.berlios.de/"><i>GPSD</i></a>
 knows how to talk to many GPS devices.
-It can work with <i>ntpd</i> through the SHM driver.
+It can work with <i>NTPD</i> through the SHM driver.
 <P>
-The <i>gpsd</i> man page suggests setting minpoll and maxpoll to 4.
+The <i>GPSD</i> man page suggests setting minpoll and maxpoll to 4.
 That was an attempt to reduce jitter.
 The SHM driver was fixed (ntp-4.2.5p138) to collect data each second rather than
 once per polling interval so that suggestion is no longer reasonable.
 <P>
-  <b>Note:</b> The GPSD client driver (type 46) uses the <i>gpsd</i>
-  client protocol to connect and talk to <i>gpsd</i>, but using the
-  SHM driver is the ancient way to have <i>gpsd</i> talk to <i>ntpd</i>.
+  <b>Note:</b> The <i>GPSD</i> client driver (type 46) uses the <i>GPSD</i>
+  client protocol to connect and talk to <i>GPSD</i>, but using the
+  SHM driver is the ancient way to have <i>GPSD</i> talk to <i>NTPD</i>. There
+  are some tricky points when using the SHM interface to interface
+  with <i>GPSD</i>, because <i>GPSD</i> will use two SHM clocks, one for the
+  serial data stream and one for the PPS information when
+  available. Receivers with a loose/sloppy timing between PPS and serial data
+  can easily cause trouble here because <i>NTPD</i> has no way to join the two
+  data streams and correlate the serial data with the PPS events.
+</p>
+<p>
 
 <h4>Clockstats</h4>
 If flag4 is set when the driver is polled, a clockstats record is written.
 The first 3 fields are the normal date, time, and IP address common to all clockstats records.
 <P>
 The 4th field is the number of second ticks since the last poll.
-The 5th field is the number of good data samples found.  The last 64 will be used by ntpd.
+The 5th field is the number of good data samples found.  The last 64 will be used by <i>NTPD</i>.
 The 6th field is the number of sample that didn't have valid data ready.
 The 7th field is the number of bad samples.
-The 8th field is the number of times the the mode 1 info was update while nptd was trying to grab a sample.
+The 8th field is the number of times the the mode 1 info was update while <i>NTPD</i> was trying to grab a sample.
 <P>
 
 Here is a sample showing the GPS reception fading out:
@@ -112,6 +130,39 @@
 54364 85700.160 127.127.28.0  65   0  65   0   0
 </pre>
 
+    <h4>The 'mode' word</h4>
+    
+    <p>
+      Some aspects of the driver behavior can be adjusted by setting bits of
+      the 'mode' word in the server configuration line:<br>
+      &nbsp;&nbsp;<tt>server 127.127.28.</tt><i>x</i><tt> mode </tt><i>Y</i>
+    </p>
+
+    <table border="1" width="100%">
+      <caption>mode word bits and bit groups</caption>
+      <tbody><tr>
+	<th align="center">Bit</th>
+	<th align="center">Dec</th>
+	<th align="center">Hex</th>
+	<th align="left">Meaning</th>
+      </tr>
+      
+      <tr>
+	<td align="center">0</td>
+	<td align="center">1</td>
+	<td align="center">1</td>
+	<td>The SHM segment is private (mode 0600). This is the fixed
+	default for clock units 0 and 1; clock units &gt;1 are mode
+	0666 unless this bit is set for the specific unit.</td>
+      </tr><tr>
+	<td align="center">1-31</td>
+	<td align="center">-</td>
+	<td align="center">-</td>
+	<td><i>reserved -- do not use</i></td>
+	</tr>
+      </tbody>
+      </table>
+    
 	<h4>Fudge Factors</h4>
         <dl>
             <dt><tt>time1 <i>time</i></tt>
@@ -136,9 +187,64 @@
             <dd>Not used by this driver.
             <dt><tt>flag4 0 | 1</tt>
             <dd>If flag4 is set, clockstats records will be written when the driver is polled.
-            <h4>Additional Information</h4>
-            <p><a href="../refclock.html">Reference Clock Drivers</a></p>
         </dl>
+
+	<h4>Public vs. Private SHM segments</h4>
+
+	<p>The driver attempts to create a shared memory segment with an
+	  identifier depending on the unit number. This identifier (which can be
+	  a numeric value or a string) clearly depends on the method used, which
+	  in turn depends on the host operating system:</p>
+
+	<ul>
+	  <li><p>
+	      <tt>Windows</tt> uses a file mapping to the page file with the
+	      name '<tt>Global\NTP</tt><i>u</i>' for public accessible
+	      mappings, where <i>u</i> is the clock unit. Private /
+	      non-public mappings are created as
+	      '<tt>Local\NTP</tt><i>u</i>'.
+	    </p><p>
+	      Public access assigns a NULL DACL to the memory mapping, while
+	      private access just uses the default DACL of the process creating
+	      the mapping.
+	    </p> 
+	  </li>
+	  <li><p>
+	      <tt>SYSV IPC</tt> creates a shared memory segment with a key value
+	      of <tt>0x4E545030</tt> + <i>u</i>, where <i>u</i> is again
+	      the clock unit. (This value could be hex-decoded as 'NTP0',
+	      'NTP1',..., with funny characters for units &gt; 9.)
+	    </p><p>
+	      Public access means a permission set of 0666, while private access
+	      creates the mapping with a permission set of 0600.
+	    </p>
+	  </li>
+	</ul>
+	
+	<p>There's no support for POSIX shared memory yet.</p>
+
+	<p><i>NTPD</i> is started as root on most POSIX-like operating systems
+	and uses the setuid/setgid system API to run under reduced rights once
+	the initial setup of the process is done. One consequence out of this
+	is that the allocation of SHM segments must be done early during the
+	clock setup. The actual polling of the clock is done as the run-time
+	user; deferring the creation of the SHM segment to this point will
+	create a SHM segment owned by the runtime-user account. The internal
+	structure of <i>NTPD</i> does not permit the use of a fudge flag if
+	this is to be avoided; this is the reason why a mode bit is used for
+	the configuration of a public segment.
+	</p>
+	
+	<p>When running under Windows, the chosen user account must be able to
+	create a SHM segment in the global object name space for SHM clocks with
+	public access. Otherwise the session isolation used by Windows kernels
+	after WinXP will get into the way if the client program does not run in
+	the same session.
+	</p>
+
+        <h4>Additional Information</h4>
+        <p><a href="../refclock.html">Reference Clock Drivers</a></p>
+
         <hr>
         <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script>
     </body>
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/html/miscopt.html /cur/src/external/bsd/ntp/dist/html/miscopt.html
--- external/bsd/ntp/dist/html/miscopt.html	2014-12-19 12:37:36.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/html/miscopt.html	2015-04-07 19:51:17.000000000 -0700
@@ -10,7 +10,7 @@
 <img src="pic/boom3.gif" alt="gif" align="left"><a href="http://www.eecis.udel.edu/~mills/pictures.html">from <i>Pogo</i>, Walt Kelly</a>
 <p>We have three, now looking for more.</p>
 <p>Last update:
-  <!-- #BeginDate format:En2m -->31-Jan-2014  06:54<!-- #EndDate -->
+  <!-- #BeginDate format:En2m -->28-Feb-2015  12:01<!-- #EndDate -->
     UTC</p>
 <br clear="left">
 <h4>Related Links</h4>
@@ -90,7 +90,7 @@
     </dl>
   </dd>
   <dt id="nonvolatile"><tt>nonvolatile <i>threshold</i></tt></dt>
-  <dd>Specify the <i><tt>threshold</tt></i> in PPM to write the frequency file, with default 0.1 PPM. The frequency file is inspected each hour. If the difference between the current frequency  and the last value written exceeds the threshold, the file is written and the <tt><em>threshold</em></tt>  becomes the new threshold value. If the threshold is not exceeded, it is reduced by half. This is intended to reduce the frequency of unnecessary file writes for embedded systems with nonvolatile memory.</dd>
+  <dd>Specify the <i><tt>threshold</tt></i> in seconds to write the frequency file, with default of 1e-7 (0.1 PPM). The frequency file is inspected each hour. If the difference between the current frequency  and the last value written exceeds the threshold, the file is written and the <tt><em>threshold</em></tt>  becomes the new threshold value. If the threshold is not exceeded, it is reduced by half. This is intended to reduce the frequency of unnecessary file writes for embedded systems with nonvolatile memory.</dd>
   <dt id="phone"><tt>phone <i>dial</i> ...</tt></dt>
   <dd>This command is used in conjunction with the ACTS modem driver (type 18). The arguments consist of a maximum of 10 telephone numbers used to dial USNO, NIST or European time services. The Hayes command ATDT&nbsp;is normally prepended to the number, which can contain other modem control codes as well.</dd>
   <dt id="reset"><tt>reset [allpeers] [auth] [ctl] [io] [mem] [sys] [timer]</tt></dt>
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/html/sntp.html /cur/src/external/bsd/ntp/dist/html/sntp.html
--- external/bsd/ntp/dist/html/sntp.html	2014-12-19 12:37:36.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/html/sntp.html	2015-04-07 19:51:17.000000000 -0700
@@ -11,7 +11,7 @@
 <img src="pic/dogsnake.gif" alt="gif" align="left"><a href="http://www.eecis.udel.edu/~mills/pictures.html">from <i>Alice's Adventures in Wonderland</i>, Lewis Carroll</a>
 <p>S is for snakeoil.</p>
 <p>Last update:
-  <!-- #BeginDate format:En2m -->7-Dec-2014  11:09<!-- #EndDate -->
+  <!-- #BeginDate format:En2m -->1-Apr-2015  11:05<!-- #EndDate -->
   UTC</p>
 <br clear="left">
 <hr>
@@ -20,8 +20,8 @@
 <h4>Description</h4>
 <p>This program is a Simple Network Time Protocol (SNTP) client that can be used to query a Network Time Protocol (NTP) server and display the time offset of the system clock relative to the server clock. Run as root it can correct the system clock to this offset as well. It can be run as an interactive command or from a script by a <tt>cron</tt> job. The program implements the SNTP client protocol defined in RFC 5905, including the full on-wire protocol but does not provide the sanity checks, access controls, security functions and mitigation algorithms as in the full NTP version 4 specification, also defined in RFC 5905.</p>
 <p>By default, <tt>sntp</tt> writes the local date and time (i.e., not UTC) to the standard output in the format</p>
-<p><tt>2011-08-04 00:40:36.642222 (+0000) +0.006611 +/- 0.041061  psp-os1 149.20.68.26</tt></p>
-<p>where the <tt>+0.006611 +/- 0.041061</tt> indicates the time offset and error bound of the system clock relative to the server clock, in seconds.</p>
+<p><tt>2011-08-04 00:40:36.642222 (+0000) +0.006611 +/- 0.041061  psp-os1 149.20.68.26 s3 no-leap</tt></p>
+<p>where the <tt>+0.006611 +/- 0.041061</tt> indicates the time offset and error bound of the system clock relative to the server clock, in seconds.  The hostname and/or the IP is displayed, as is the stratum of the server.  Finally, the leap indicator status is displayed.</p>
 <p>If -b <i>bcaddress</i> is not specified, the program sends a single message to each address and waits up to <i>uctimeout</i> (default 5) seconds for a unicast server response. Otherwise, it sends no message and waits up to <i>bctimeout</i> (default 68) seconds for a broadcast NTP message.</p>
 <h4>Options</h4>
 <p><tt>sntp</tt> recognizes the following options:</p>
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/include/Makefile.in /cur/src/external/bsd/ntp/dist/include/Makefile.in
--- external/bsd/ntp/dist/include/Makefile.in	2014-12-19 12:37:38.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/include/Makefile.in	2015-04-07 19:51:17.000000000 -0700
@@ -40,8 +40,7 @@
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
 	$(top_srcdir)/sntp/libopts/m4/stdnoreturn.m4 \
-	$(top_srcdir)/sntp/libevent/m4/openldap-thread-check.m4 \
-	$(top_srcdir)/sntp/libevent/m4/openldap.m4 \
+	$(top_srcdir)/sntp/m4/ax_c99_struct_init.m4 \
 	$(top_srcdir)/sntp/m4/define_dir.m4 \
 	$(top_srcdir)/sntp/m4/hms_search_lib.m4 \
 	$(top_srcdir)/sntp/m4/libtool.m4 \
@@ -70,6 +69,8 @@
 	$(top_srcdir)/sntp/m4/ntp_sntp.m4 \
 	$(top_srcdir)/sntp/m4/ntp_ver_suffix.m4 \
 	$(top_srcdir)/sntp/m4/ntp_vpathhack.m4 \
+	$(top_srcdir)/sntp/m4/openldap-thread-check.m4 \
+	$(top_srcdir)/sntp/m4/openldap.m4 \
 	$(top_srcdir)/sntp/m4/os_cflags.m4 \
 	$(top_srcdir)/sntp/m4/snprintf.m4 \
 	$(top_srcdir)/sntp/m4/version.m4 $(top_srcdir)/configure.ac
@@ -151,6 +152,7 @@
 CONFIG_SHELL = @CONFIG_SHELL@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
+CPPFLAGS_LIBEVENT = @CPPFLAGS_LIBEVENT@
 CPPFLAGS_NTP = @CPPFLAGS_NTP@
 CXX = @CXX@
 CXXCPP = @CXXCPP@
@@ -185,7 +187,9 @@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 LD = @LD@
+LDADD_LIBEVENT = @LDADD_LIBEVENT@
 LDADD_LIBNTP = @LDADD_LIBNTP@
+LDADD_LIBUTIL = @LDADD_LIBUTIL@
 LDADD_NLIST = @LDADD_NLIST@
 LDADD_NTP = @LDADD_NTP@
 LDFLAGS = @LDFLAGS@
@@ -324,6 +328,11 @@
 TIMETRIM_DS = @TIMETRIM_DS@
 TIMETRIM_MS = @TIMETRIM_MS@
 TIMETRIM_NI = @TIMETRIM_NI@
+UPDATE_LEAP_DB = @UPDATE_LEAP_DB@
+UPDATE_LEAP_DL = @UPDATE_LEAP_DL@
+UPDATE_LEAP_DS = @UPDATE_LEAP_DS@
+UPDATE_LEAP_MS = @UPDATE_LEAP_MS@
+UPDATE_LEAP_NI = @UPDATE_LEAP_NI@
 VERSION = @VERSION@
 VER_SUFFIX = @VER_SUFFIX@
 YACC = @YACC@
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/include/binio.h /cur/src/external/bsd/ntp/dist/include/binio.h
--- external/bsd/ntp/dist/include/binio.h	2014-12-24 18:28:04.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/include/binio.h	2015-04-07 19:51:17.000000000 -0700
@@ -44,11 +44,21 @@
 long get_lsb_long (unsigned char **);
 void put_lsb_long (unsigned char **, long);
 
+#define get_lsb_int16( _x_ )   ((int16_t) get_lsb_short( _x_ ))
+#define get_lsb_uint16( _x_ )  ((uint16_t) get_lsb_short( _x_ ))
+#define get_lsb_int32( _x_ )   ((int32_t) get_lsb_long( _x_ ))
+#define get_lsb_uint32( _x_ )  ((uint32_t) get_lsb_long( _x_ ))
+
 long get_msb_short (unsigned char **);
 void put_msb_short (unsigned char **, long);
 long get_msb_long (unsigned char **);
 void put_msb_long (unsigned char **, long);
 
+#define get_msb_int16( _x_ )   ((int16_t) get_msb_short( _x_ ))
+#define get_msb_uint16( _x_ )  ((uint16_t) get_msb_short( _x_ ))
+#define get_msb_int32( _x_ )   ((int32_t) get_msb_long( _x_ ))
+#define get_msb_uint32( _x_ )  ((uint32_t) get_msb_long( _x_ ))
+
 #endif
 /*
  * History:
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/include/isc/Makefile.in /cur/src/external/bsd/ntp/dist/include/isc/Makefile.in
--- external/bsd/ntp/dist/include/isc/Makefile.in	2014-12-19 12:37:38.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/include/isc/Makefile.in	2015-04-07 19:51:17.000000000 -0700
@@ -40,8 +40,7 @@
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
 	$(top_srcdir)/sntp/libopts/m4/stdnoreturn.m4 \
-	$(top_srcdir)/sntp/libevent/m4/openldap-thread-check.m4 \
-	$(top_srcdir)/sntp/libevent/m4/openldap.m4 \
+	$(top_srcdir)/sntp/m4/ax_c99_struct_init.m4 \
 	$(top_srcdir)/sntp/m4/define_dir.m4 \
 	$(top_srcdir)/sntp/m4/hms_search_lib.m4 \
 	$(top_srcdir)/sntp/m4/libtool.m4 \
@@ -70,6 +69,8 @@
 	$(top_srcdir)/sntp/m4/ntp_sntp.m4 \
 	$(top_srcdir)/sntp/m4/ntp_ver_suffix.m4 \
 	$(top_srcdir)/sntp/m4/ntp_vpathhack.m4 \
+	$(top_srcdir)/sntp/m4/openldap-thread-check.m4 \
+	$(top_srcdir)/sntp/m4/openldap.m4 \
 	$(top_srcdir)/sntp/m4/os_cflags.m4 \
 	$(top_srcdir)/sntp/m4/snprintf.m4 \
 	$(top_srcdir)/sntp/m4/version.m4 $(top_srcdir)/configure.ac
@@ -113,6 +114,7 @@
 CONFIG_SHELL = @CONFIG_SHELL@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
+CPPFLAGS_LIBEVENT = @CPPFLAGS_LIBEVENT@
 CPPFLAGS_NTP = @CPPFLAGS_NTP@
 CXX = @CXX@
 CXXCPP = @CXXCPP@
@@ -147,7 +149,9 @@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 LD = @LD@
+LDADD_LIBEVENT = @LDADD_LIBEVENT@
 LDADD_LIBNTP = @LDADD_LIBNTP@
+LDADD_LIBUTIL = @LDADD_LIBUTIL@
 LDADD_NLIST = @LDADD_NLIST@
 LDADD_NTP = @LDADD_NTP@
 LDFLAGS = @LDFLAGS@
@@ -286,6 +290,11 @@
 TIMETRIM_DS = @TIMETRIM_DS@
 TIMETRIM_MS = @TIMETRIM_MS@
 TIMETRIM_NI = @TIMETRIM_NI@
+UPDATE_LEAP_DB = @UPDATE_LEAP_DB@
+UPDATE_LEAP_DL = @UPDATE_LEAP_DL@
+UPDATE_LEAP_DS = @UPDATE_LEAP_DS@
+UPDATE_LEAP_MS = @UPDATE_LEAP_MS@
+UPDATE_LEAP_NI = @UPDATE_LEAP_NI@
 VERSION = @VERSION@
 VER_SUFFIX = @VER_SUFFIX@
 YACC = @YACC@
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/include/mbg_gps166.h /cur/src/external/bsd/ntp/dist/include/mbg_gps166.h
--- external/bsd/ntp/dist/include/mbg_gps166.h	2014-12-24 18:28:04.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/include/mbg_gps166.h	2015-04-07 19:51:17.000000000 -0700
@@ -41,206 +41,459 @@
 #define MBG_GPS166_H
 
 
-/***************************************************************************/
-/*                                                                         */
-/*   File:         GPSSERIO.H                    4.1                       */
-/*                                                                         */
-/*   Project:      Common C Library                                        */
-/*                                                                         */
-/*   Compiler:     Borland C++                                             */
-/*                                                                         */
-/*   Author:       M. Burnicki,  Meinberg Funkuhren                        */
-/*                                                                         */
-/*                                                                         */
-/*   Description:                                                          */
-/*     This file defines structures and codes to be used to access GPS166  */
-/*     via its serial interface COM0. COM0 should be set to a high baud    */
-/*     rate, default is 19200.                                             */
-/*                                                                         */
-/*     Standard GPS166 serial operation is to send a time string that is   */
-/*     compatible with Meinberg UA31 or PZF535 DCF77 radio remote clocks.  */
-/*     That string can be transmitted automatically once per second, once  */
-/*     per minute or on request per ASCII '?'.                             */
-/*                                                                         */
-/*     Parameter setup or parameter readout works using blocks of binary   */
-/*     data which have to be isolated from the standard string. A block of */
-/*     data starts with a SOH code (ASCII Start Of Header, 0x01) followed  */
-/*     by a message header with constant length and a data portion with    */
-/*     variable length. The first field (cmd) of the message header holds  */
-/*     the command code rsp. the type of data to be transmitted. The next  */
-/*     field (len) gives the number of data bytes that are transmitted     */
-/*     after the header. This number ranges from 0 to sizeof( MSG_DATA ).  */
-/*     The third field (data_csum) holds a checksum of all data bytes and  */
-/*     the last field of the header finally holds the checksum of the.     */
-/*     header.                                                             */
-/*                                                                         */
-/***************************************************************************/
-
-/* the control codes defined below are to be or'ed with a command/type code */
-
-#define GPS_REQACK    0x8000   /* to GPS166: request acknowledge */
-#define GPS_ACK       0x4000   /* from GPS166: acknowledge a command */
-#define GPS_NACK      0x2000   /* from GPS166: error receiving command */
-
-#define GPS_CTRL_MSK  0xF000   /* masks control code from command */
-
-
-/* The codes below specify commands/types of data to be supplied to GPS166: */
-
-/*                            GPS166 auto-message to host            */
-/*                            þ   host request, GPS166 response      */
-/*                            þ   þ   host download to GPS166        */
-/*                            þ   þ   þ                              */
-enum {  /*                    þ   þ   þ                              */
-  /* system data */
-  GPS_AUTO_ON = 0x000,   /* þ   þ   þ X þ enable auto-messages from GPS166 */
-  GPS_AUTO_OFF,          /* þ   þ   þ X þ disable auto-messages from GPS166 */
-  GPS_SW_REV,            /* þ   þ X þ   þ request software revision */
-  GPS_STAT,              /* þ   þ X þ   þ request status of buffered variables */
-  GPS_TIME,              /* þ X þ   þ X þ current time or capture or init board time */
-  GPS_POS_XYZ,           /* þ   þ X þ X þ current position in ECEF coords */
-  GPS_POS_LLA,           /* þ   þ X þ X þ current position in geographic coords */
-  GPS_TZDL,              /* þ   þ X þ X þ time zone / daylight saving */
-  GPS_PORT_PARM,         /* þ   þ X þ X þ parameters of the serial ports */
-  GPS_SYNTH,             /* þ   þ X þ X þ synthesizer's frequency and phase */
-  GPS_ANT_INFO,          /* þ X þ X þ   þ time diff after antenna disconnect */
-  GPS_UCAP,              /* þ X þ X þ   þ user capture */
+/***************************************************************************
+ *
+ *  Definitions taken from Meinberg's gpsserio.h and gpsdefs.h files.
+ *
+ *  Author:  Martin Burnicki, Meinberg Funkuhren
+ *
+ *  Copyright (c) Meinberg Funkuhren, Bad Pyrmont, Germany
+ *
+ *  Description:
+ *    Structures and codes to be used to access Meinberg GPS clocks via
+ *    their serial interface COM0. COM0 should be set to a high baud rate,
+ *    default is 19200.
+ *
+ *    Standard Meinberg GPS serial operation is to send the Meinberg
+ *    standard time string automatically once per second, once per
+ *    minute, or on request per ASCII '?'.
+ *
+ *    GPS parameter setup or parameter readout uses blocks of binary
+ *    data which have to be isolated from the standard string. A block
+ *    of data starts with a SOH code (ASCII Start Of Header, 0x01)
+ *    followed by a message header with constant length and a block of
+ *    data with variable length.
+ *
+ *    The first field (cmd) of the message header holds the command
+ *    code resp. the type of data to be transmitted. The next field (len)
+ *    gives the number of data bytes that follow the header. This number
+ *    ranges from 0 to sizeof( MSG_DATA ). The third field (data_csum)
+ *    holds a checksum of all data bytes and the last field of the header
+ *    finally holds the checksum of the header itself.
+ *
+ ***************************************************************************/
 
-  /* GPS data */
-  GPS_CFGH = 0x100,      /* þ   þ X þ X þ SVs' configuration and health codes */
-  GPS_ALM,               /* þ   þ X þ X þ one SV's almanac */
-  GPS_EPH,               /* þ   þ X þ X þ one SV's ephemeris */
-  GPS_UTC,               /* þ   þ X þ X þ UTC correction parameters */
-  GPS_IONO,              /* þ   þ X þ X þ ionospheric correction parameters */
-  GPS_ASCII_MSG          /* þ   þ X þ   þ the GPS ASCII message */
+/**
+ * @brief GPS epoch bias from ordinary time_t epoch
+ *
+ * The Unix time_t epoch is usually 1970-01-01 00:00 whereas
+ * the GPS epoch is 1980-01-06 00:00, so the difference is 10 years,
+ * plus 2 days due to leap years (1972 and 1976), plus the difference
+ * of the day-of-month (6 - 1), so:<br>
+ *
+ * time_t t = ( gps_week * ::SECS_PER_WEEK ) + sec_of_week + ::GPS_SEC_BIAS
+ */
+#define GPS_SEC_BIAS   315964800UL     // ( ( ( 10UL * 365UL ) + 2 + 5 ) * SECS_PER_DAY )
+
+
+#ifndef _COM_HS_DEFINED
+  /**
+   * @brief Enumeration of handshake modes
+   */
+  enum COM_HANSHAKE_MODES { HS_NONE, HS_XONXOFF, HS_RTSCTS, N_COM_HS };
+  #define _COM_HS_DEFINED
+#endif
+
+#ifndef _COM_PARM_DEFINED
+  /**
+   * @brief A data type to configure a serial port's baud rate
+   *
+   * @see ::MBG_BAUD_RATES
+   */
+  typedef int32_t BAUD_RATE;
+
+  /**
+   * @brief Indices used to identify a parameter in the framing string
+   *
+   * @see ::MBG_FRAMING_STRS
+   */
+  enum MBG_FRAMING_STR_IDXS { F_DBITS, F_PRTY, F_STBITS };
+
+  /**
+   * @brief A structure to store the configuration of a serial port
+   */
+  typedef struct
+  {
+    BAUD_RATE baud_rate;  ///< transmission speed, e.g. 19200L, see ::MBG_BAUD_RATES
+    char framing[4];      ///< ASCIIZ framing string, e.g. "8N1" or "7E2", see ::MBG_FRAMING_STRS
+    int16_t handshake;    ///< handshake mode, yet only ::HS_NONE supported
+
+  } COM_PARM;
+
+  #define _COM_PARM_DEFINED
+#endif
+
+
+/**
+ * @brief Enumeration of modes supported for time string transmission
+ *
+ * This determines e.g. at which point in time a string starts
+ * to be transmitted via the serial port.
+ * Used with ::PORT_SETTINGS::mode.
+ *
+ * @see ::STR_MODE_MASKS
+ */
+enum STR_MODES
+{
+  STR_ON_REQ,     ///< transmission on request by received '?' character only
+  STR_PER_SEC,    ///< transmission automatically if second changes
+  STR_PER_MIN,    ///< transmission automatically if minute changes
+  STR_AUTO,       ///< transmission automatically if required, e.g. on capture event
+  STR_ON_REQ_SEC, ///< transmission if second changes and a request has been received before
+  N_STR_MODE      ///< the number of known modes
 };
 
-/*
- * modelled after GPSDEFS.H Revision 1.5
+
+/**
+ * The number of serial ports which are at least available
+ * even with very old GPS receiver models. For devices providing
+ * a ::RECEIVER_INFO structure the number of provided COM ports
+ * is available in ::RECEIVER_INFO::n_com_ports.
+ */
+#define DEFAULT_N_COM   2
+
+
+/**
+ * @brief A The structure used to store the configuration of two serial ports
+ *
+ * @deprecated This structure is deprecated, ::PORT_SETTINGS and related structures
+ * should be used instead, if supported by the device.
+ */
+typedef struct
+{
+  COM_PARM com[DEFAULT_N_COM];    ///< COM0 and COM1 settings
+  uint8_t mode[DEFAULT_N_COM];    ///< COM0 and COM1 output mode
+
+} PORT_PARM;
+
+
+/**
+ * @brief The type of a GPS command code
+ *
+ * @see ::GPS_CMD_CODES
  */
-/***************************************************************************/
-/*                                                                         */
-/*   File:         GPSDEFS.H                     4.1          */
-/*                                                                         */
-/*   Project:      Common C Library                                        */
-/*                                                                         */
-/*   Compiler:     Borland C++                                             */
-/*                                                                         */
-/*   Author:       M. Burnicki,  Meinberg Funkuhren                        */
-/*                                                                         */
-/*                                                                         */
-/*   Description:                                                          */
-/*     General definitions to be used with GPS166                          */
-/*     GPS166 Rev. 1.23 or above                                           */
-/*                                                                         */
-/*   Modifications: see file GPSLIB.TXT                                    */
-/*                                                                         */
-/***************************************************************************/
-#define _GPSDEFS_H
-/* the type of various checksums */
+typedef uint16_t GPS_CMD;
+
+
+/**
+ * @brief Control codes to be or'ed with a particular command/type code
+ */
+enum GPS_CMD_CTRL_CODES
+{
+  GPS_REQACK = 0x8000,   ///< to device: request acknowledge
+  GPS_ACK    = 0x4000,   ///< from device: acknowledge a command
+  GPS_NACK   = 0x2000,   ///< from device: error evaluating a command
+};
+
+#define GPS_CTRL_MSK  0xF000   ///< bit mask of all ::GPS_CMD_CTRL_CODES
+
+
+/**
+ * @brief Command codes for the binary protocol
+ *
+ * These codes specify commands and associated data types used by Meinberg's
+ * binary protocol to exchange data with a device via serial port, direct USB,
+ * or socket I/O.
+ *
+ * Some commands and associated data structures can be read (r) from a device, others
+ * can be written (w) to the device, and some can also be sent automatically (a) by
+ * a device after a ::GPS_AUTO_ON command has been sent to the device.
+ * The individual command codes are marked with (rwa) accordingly, where '-' is used
+ * to indicate that a particular mode is not supported.
+ *
+ * @note Not all command code are supported by all devices.
+ * See the hints for a particular command.
+ *
+ * @note If ::GPS_ALM, ::GPS_EPH or a code named ..._IDX is sent to retrieve
+ * some data from a device then an uint16_t parameter must be also supplied
+ * in order to specify the index number of the data set to be returned.
+ * The valid index range depends on the command code.
+ * For ::GPS_ALM and ::GPS_EPH the index is the SV number which may be 0 or
+ * ::MIN_SVNO_GPS to ::MAX_SVNO_GPS. If the number is 0 then all ::N_SVNO_GPS
+ * almanacs or ephemeris data structures are returned.
+ *
+ * @see ::GPS_CMD_CODES_TABLE
+ */
+enum GPS_CMD_CODES
+{ /* system data */
+  GPS_AUTO_ON = 0x000,  ///< (-w-) no data, enable auto-msgs from device
+  GPS_AUTO_OFF,         ///< (-w-) no data, disable auto-msgs from device
+  GPS_SW_REV,           ///< (r--) deprecated, ::SW_REV, software revision, use only if ::GPS_RECEIVER_INFO not supp.
+  GPS_BVAR_STAT,        ///< (r--) ::BVAR_STAT, status of buffered variables, only if ::GPS_MODEL_HAS_BVAR_STAT
+  GPS_TIME,             ///< (-wa) ::TTM, current time or capture, or init board time
+  GPS_POS_XYZ,          ///< (rw-) ::XYZ, current position in ECEF coordinates, only if ::GPS_MODEL_HAS_POS_XYZ
+  GPS_POS_LLA,          ///< (rw-) ::LLA, current position in geographic coordinates, only if ::GPS_MODEL_HAS_POS_LLA
+  GPS_TZDL,             ///< (rw-) ::TZDL, time zone / daylight saving, only if ::GPS_MODEL_HAS_TZDL
+  GPS_PORT_PARM,        ///< (rw-) deprecated, ::PORT_PARM, use ::PORT_SETTINGS etc. if ::GPS_RECEIVER_INFO supported
+  GPS_SYNTH,            ///< (rw-) ::SYNTH, synthesizer settings, only if ::GPS_HAS_SYNTH
+  GPS_ANT_INFO,         ///< (r-a) ::ANT_INFO, time diff after antenna disconnect, only if ::GPS_MODEL_HAS_ANT_INFO
+  GPS_UCAP,             ///< (r-a) ::TTM, user capture events, only if ::RECEIVER_INFO::n_ucaps > 0
+
+  /* GPS data */
+  GPS_CFGH = 0x100,     ///< (rw-) ::CFGH, SVs' configuration and health codes
+  GPS_ALM,              ///< (rw-) req: uint16_t SV num, ::SV_ALM, one SV's almanac
+  GPS_EPH,              ///< (rw-) req: uint16_t SV num, ::SV_EPH, one SV's ephemeris
+  GPS_UTC,              ///< (rw-) ::UTC, GPS %UTC correction parameters
+  GPS_IONO,             ///< (rw-) ::IONO, GPS ionospheric correction parameters
+  GPS_ASCII_MSG         ///< (r--) ::ASCII_MSG, the GPS ASCII message
+};
+
 
 #ifndef _CSUM_DEFINED
-  typedef unsigned short CSUM;
-#  define _CSUM_DEFINED
+  typedef uint16_t CSUM;  /* checksum used by some structures stored in non-volatile memory */
+  #define _CSUM_DEFINED
 #endif
 
-/* the message header */
 
-typedef struct {
-  unsigned short gps_cmd;
-  unsigned short gps_len;
-  unsigned short gps_data_csum;
-  unsigned short gps_hdr_csum;
+/**
+ * @brief The header of a binary message.
+ */
+typedef struct
+{
+  GPS_CMD cmd;      ///< see ::GPS_CMD_CODES
+  uint16_t len;     ///< length of the data portion appended after the header
+  CSUM data_csum;   ///< checksum of the data portion appended after the header
+  CSUM hdr_csum;    ///< checksum of the preceding header bytes
+
 } GPS_MSG_HDR;
 
-/* a struct used to hold the software revision information */
 
-typedef struct {
-  unsigned short code;       /* e.g. 0x0120 means rev. 1.20 */
-  unsigned char name[17];     /* used to identify customized versions */
+#define GPS_ID_STR_LEN      16
+#define GPS_ID_STR_SIZE     ( GPS_ID_STR_LEN + 1 )
+
+/**
+ * @brief Software revision information
+ *
+ * Contains a software revision code, plus an optional
+ * identifier for a customized version.
+ */
+typedef struct
+{
+  uint16_t code;               ///< Version number, e.g. 0x0120 means v1.20
+  char name[GPS_ID_STR_SIZE];  ///< Optional string identifying a customized version
+  uint8_t reserved;            ///< Reserved field to yield even structure size
+
 } SW_REV;
 
-/* GPS ASCII message */
 
-typedef struct {
-  CSUM csum;       /* checksum of the remaining bytes */
-  short valid;     /* flag data are valid */
-  char s[23];      /* 22 chars GPS ASCII message plus trailing zero */
-} ASCII_MSG;
+/**
+ * @brief GNSS satellite numbers
+ *
+ * @todo: Check if MAX_SVNO_GLN is 94 instead of 95, and thus
+ *        N_SVNO_GLN is 30 instead of 31, as reported by Wikipedia.
+ */
+enum GNSS_SVNOS
+{
+  MIN_SVNO_GPS = 1,       ///< min. GPS satellite PRN number
+  MAX_SVNO_GPS = 32,      ///< max. GPS satellite PRN number
+  N_SVNO_GPS = 32,        ///< max. number of active GPS satellites
+
+  MIN_SVNO_WAAS = 33,     ///< min. WAAS satellite number
+  MAX_SVNO_WAAS = 64,     ///< max. WAAS satellite number
+  N_SVNO_WAAS = 32,       ///< max. number of active WAAS satellites
+
+  MIN_SVNO_GLONASS = 65,  ///< min. Glonass satellite number (64 + sat slot ID)
+  MAX_SVNO_GLONASS = 95,  ///< max. Glonass satellite number (64 + sat slot ID)
+  N_SVNO_GLONASS = 31     ///< max. number of active Glonass satellites
+};
+
+
+typedef uint16_t SVNO;    ///< the number of an SV (Space Vehicle, i.e. satellite)
+typedef uint16_t HEALTH;  ///< an SV's 6 bit health code
+typedef uint16_t CFG;     ///< an SV's 4 bit configuration code
+typedef uint16_t IOD;     ///< Issue-Of-Data code
+
+
+/**
+ * @brief Status flags of battery buffered data
+ *
+ * Related to data received from the satellites, or data derived thereof.
+ *
+ * All '0' means OK, single bits set to '1' indicate
+ * the associated type of GPS data is not available.
+ *
+ * @see ::BVAR_FLAGS
+ */
+typedef uint16_t BVAR_STAT;
+
+#define _mbg_swab_bvar_stat( _p )  _mbg_swab16( (_p) )
+
+
+/**
+ * @brief Enumeration of flag bits used to define ::BVAR_FLAGS
+ *
+ * For each bit which is set this means the associated data set in
+ * non-volatile memory is not available, or incomplete.
+ * Most data sets will just be re-collected from the data streams sent
+ * by the satellites. However, the receiver position has usually been
+ * computed earlier during normal operation, and will be re-computed
+ * when a sufficient number of satellites can be received.
+ *
+ * @see ::BVAR_STAT
+ * @see ::BVAR_FLAGS
+ * @see ::BVAR_FLAG_NAMES
+ */
+enum BVAR_FLAG_BITS
+{
+  BVAR_BIT_CFGH_INVALID,      ///< Satellite configuration and health parameters incomplete
+  BVAR_BIT_ALM_NOT_COMPLETE,  ///< Almanac parameters incomplete
+  BVAR_BIT_UTC_INVALID,       ///< %UTC offset parameters incomplete
+  BVAR_BIT_IONO_INVALID,      ///< Ionospheric correction parameters incomplete
+  BVAR_BIT_RCVR_POS_INVALID,  ///< No valid receiver position available
+  N_BVAR_BIT                  ///< number of defined ::BVAR_STAT bits
+};
+
+
+/**
+ * @brief Bit masks associated with ::BVAR_FLAG_BITS
+ *
+ * Used with ::BVAR_STAT.
+ *
+ * @see ::BVAR_STAT
+ * @see ::BVAR_FLAG_BITS
+ * @see ::BVAR_FLAG_NAMES
+ */
+enum BVAR_FLAGS
+{
+  BVAR_CFGH_INVALID     = ( 1UL << BVAR_BIT_CFGH_INVALID ),      ///< see ::BVAR_BIT_CFGH_INVALID
+  BVAR_ALM_NOT_COMPLETE = ( 1UL << BVAR_BIT_ALM_NOT_COMPLETE ),  ///< see ::BVAR_BIT_ALM_NOT_COMPLETE
+  BVAR_UTC_INVALID      = ( 1UL << BVAR_BIT_UTC_INVALID ),       ///< see ::BVAR_BIT_UTC_INVALID
+  BVAR_IONO_INVALID     = ( 1UL << BVAR_BIT_IONO_INVALID ),      ///< see ::BVAR_BIT_IONO_INVALID
+  BVAR_RCVR_POS_INVALID = ( 1UL << BVAR_BIT_RCVR_POS_INVALID ),  ///< see ::BVAR_BIT_RCVR_POS_INVALID
+};
+
+
+/**
+ * @brief A structure used to hold time in GPS format
+ *
+ * Date and time refer to the linear time scale defined by GPS, with
+ * the epoch starting at %UTC midnight at the beginning of January 6, 1980.
+ *
+ * GPS time is counted by the week numbers since the epoch, plus second
+ * of the week, plus fraction of the second. The week number transmitted
+ * by the satellites rolls over from 1023 to 0, but Meinberg devices
+ * just continue to count the weeks beyond the 1024 week limit to keep
+ * the receiver's internal time.
+ *
+ * %UTC time differs from GPS time since a number of leap seconds have
+ * been inserted in the %UTC time scale after the GPS epoche. The number
+ * of leap seconds is disseminated by the satellites using the ::UTC
+ * parameter set, which also provides info on pending leap seconds.
+ */
+typedef struct
+{
+  uint16_t wn;     ///< the week number since GPS has been installed
+  uint32_t sec;    ///< the second of that week
+  uint32_t tick;   ///< fractions of a second, 1/::RECEIVER_INFO::ticks_per_sec units
 
-#define MIN_SVNO         1                  /* min. SV number */
-#define MAX_SVNO        32                  /* max. SV number */
-#define N_SVNO ( MAX_SVNO - MIN_SVNO + 1)   /* number of possibly active SVs */
-
-
-typedef short          SVNO;     /* the number of a SV */
-typedef unsigned short HEALTH;  /* a SV's health code */
-typedef unsigned short CFG;     /* a SV's configuration code */
-typedef unsigned short IOD;     /* Issue-Of-Data code */
-
-/* Date and time referred to the linear time scale defined by GPS. */
-/* GPS time is defined by the number of weeks since midnight from */
-/* January 5, 1980 to January 6, 1980 plus the number of seconds of */
-/* the current week plus fractions of a second. GPS time differs from */
-/* UTC because UTC is corrected with leap seconds while GPS time scale */
-/* is continuous. */
-
-typedef struct {
-  unsigned short wn;     /* the week number since GPS has been installed */
-  unsigned long sec;     /* the second of that week */
-  unsigned long tick;    /* fractions of a second; scale: 1E-7 */
 } T_GPS;
 
 
-/* Local date and time computed from GPS time. The current number */
-/* of leap seconds have to be added to get UTC from GPS time. */
-/* Additional corrections could have been made according to the */
-/* time zone/daylight saving parameters (TZDL, see below) defined */
-/* by the user. The status field can be checked to see which corrections */
-/* have been applied. */
-
-#ifndef GPS166_TM_DEFINED
-  typedef struct {
-    short year;          /* 0..9999 */
-    char month;          /* 1..12 */
-    char mday;           /* 1..31 */
-    short yday;          /* 1..366 */
-    char wday;           /* 0..6 == Sun..Sat */
-    char hour;           /* 0..23 */
-    char minute;         /* 0..59 */
-    char second;         /* 0..59 */
-    long frac;           /* fractions of a second, scale 1E-7 */
-    long offs_from_utc;  /* local time's offset from UTC */
-    unsigned short status;       /* flags */
-  } TM;
-
-  /* status flags used with conversion from GPS time to local time */
-
-#  define TM_UTC        0x01   /* UTC correction has been made */
-#  define TM_LOCAL      0x02   /* UTC has been converted to local time */
-#  define TM_DL_ANN     0x04   /* state of daylight saving is going to change */
-#  define TM_DL_ENB     0x08   /* daylight saving is enabled */
-#  define TM_LS_ANN     0x10   /* leap second will be inserted */
-#  define TM_LS_ENB     0x20   /* current second is leap second */
+/**
+ * @brief Local date and time computed from GPS time
+ *
+ * The current number of leap seconds have to be added to get %UTC
+ * from GPS time. Additional corrections could have been made according
+ * to the time zone/daylight saving parameters ::TZDL defined by the user.
+ * The status field can be checked to see which corrections
+ * have actually been applied.
+ *
+ * @note Conversion from GPS time to %UTC and/or local time can only be
+ * done if some valid ::UTC correction parameters are available in the
+ * receiver's non-volatile memory.
+ */
+typedef struct
+{
+  int16_t year;           ///< year number, 0..9999
+  int8_t month;           ///< month, 1..12
+  int8_t mday;            ///< day of month, 1..31
+  int16_t yday;           ///< day of year, 1..365, or 366 in case of leap year
+  int8_t wday;            ///< day of week, 0..6 == Sun..Sat
+  int8_t hour;            ///< hours, 0..23
+  int8_t min;             ///< minutes, 0..59
+  int8_t sec;             ///< seconds, 0..59, or 60 in case of inserted leap second
+  int32_t frac;           ///< fractions of a second, 1/::RECEIVER_INFO::ticks_per_sec units
+  int32_t offs_from_utc;  ///< local time offset from %UTC [sec]
+  uint16_t status;        ///< status flags, see ::TM_GPS_STATUS_BIT_MASKS
+
+} TM_GPS;
+
 
-#  define GPS166_TM_DEFINED
-#endif
 
+/**
+ * @brief Status flag bits used to define ::TM_GPS_STATUS_BIT_MASKS
+ *
+ * These bits report info on the time conversion from GPS time to %UTC
+ * and/or local time as well as device status info.
+ *
+ * @see ::TM_GPS_STATUS_BIT_MASKS
+ */
+enum TM_GPS_STATUS_BITS
+{
+  TM_BIT_UTC,          ///< %UTC correction has been made
+  TM_BIT_LOCAL,        ///< %UTC has been converted to local time according to ::TZDL settings
+  TM_BIT_DL_ANN,       ///< state of daylight saving is going to change
+  TM_BIT_DL_ENB,       ///< daylight saving is in effect
+  TM_BIT_LS_ANN,       ///< leap second pending
+  TM_BIT_LS_ENB,       ///< current second is leap second
+  TM_BIT_LS_ANN_NEG,   ///< set in addition to ::TM_BIT_LS_ANN if leap sec is negative
+  TM_BIT_INVT,         ///< invalid time, e.g. if RTC battery bas been empty
+
+  TM_BIT_EXT_SYNC,     ///< synchronized externally
+  TM_BIT_HOLDOVER,     ///< in holdover mode after previous synchronization
+  TM_BIT_ANT_SHORT,    ///< antenna cable short circuited
+  TM_BIT_NO_WARM,      ///< OCXO has not warmed up
+  TM_BIT_ANT_DISCONN,  ///< antenna currently disconnected
+  TM_BIT_SYN_FLAG,     ///< TIME_SYN output is low
+  TM_BIT_NO_SYNC,      ///< time sync actually not verified
+  TM_BIT_NO_POS        ///< position actually not verified, LOCK LED off
+};
 
-/* the status flags below are defined starting with rev. 1.32 */
 
-#define TM_ANT_DISCONN  0x1000  /* antenna currently disconnected */
-#define TM_SYN_FLAG     0x2000  /* TIME_SYN output is low */
-#define TM_NO_SYNC      0x4000  /* not sync'ed after reset */
-#define TM_NO_POS       0x8000  /* position not computed after reset, */
-                                /*   LOCK LED off */
-
-/* a struct used to transmit information on date and time */
-
-typedef struct {
-  short channel;        /* -1: the current time; 0, 1: capture 0, 1 */
-  T_GPS t;              /* time in GPS format */
-  TM tm;                /* that time converted to local time */
+/**
+ * @brief Status flag masks used with ::TM_GPS::status
+ *
+ * These bits report info on the time conversion from GPS time to %UTC
+ * and/or local time as well as device status info.
+ *
+ * @see ::TM_GPS_STATUS_BITS
+ */
+enum TM_GPS_STATUS_BIT_MASKS
+{
+  TM_UTC         = ( 1UL << TM_BIT_UTC ),          ///< see ::TM_BIT_UTC
+  TM_LOCAL       = ( 1UL << TM_BIT_LOCAL ),        ///< see ::TM_BIT_LOCAL
+  TM_DL_ANN      = ( 1UL << TM_BIT_DL_ANN ),       ///< see ::TM_BIT_DL_ANN
+  TM_DL_ENB      = ( 1UL << TM_BIT_DL_ENB ),       ///< see ::TM_BIT_DL_ENB
+  TM_LS_ANN      = ( 1UL << TM_BIT_LS_ANN ),       ///< see ::TM_BIT_LS_ANN
+  TM_LS_ENB      = ( 1UL << TM_BIT_LS_ENB ),       ///< see ::TM_BIT_LS_ENB
+  TM_LS_ANN_NEG  = ( 1UL << TM_BIT_LS_ANN_NEG ),   ///< see ::TM_BIT_LS_ANN_NEG
+  TM_INVT        = ( 1UL << TM_BIT_INVT ),         ///< see ::TM_BIT_INVT
+
+  TM_EXT_SYNC    = ( 1UL << TM_BIT_EXT_SYNC ),     ///< see ::TM_BIT_EXT_SYNC
+  TM_HOLDOVER    = ( 1UL << TM_BIT_HOLDOVER ),     ///< see ::TM_BIT_HOLDOVER
+  TM_ANT_SHORT   = ( 1UL << TM_BIT_ANT_SHORT ),    ///< see ::TM_BIT_ANT_SHORT
+  TM_NO_WARM     = ( 1UL << TM_BIT_NO_WARM ),      ///< see ::TM_BIT_NO_WARM
+  TM_ANT_DISCONN = ( 1UL << TM_BIT_ANT_DISCONN ),  ///< see ::TM_BIT_ANT_DISCONN
+  TM_SYN_FLAG    = ( 1UL << TM_BIT_SYN_FLAG ),     ///< see ::TM_BIT_SYN_FLAG
+  TM_NO_SYNC     = ( 1UL << TM_BIT_NO_SYNC ),      ///< see ::TM_BIT_NO_SYNC
+  TM_NO_POS      = ( 1UL << TM_BIT_NO_POS )        ///< see ::TM_BIT_NO_POS
+};
+
+
+/**
+ * @brief A structure used to transmit information on date and time
+ *
+ * This structure can be used to transfer the current time, in which
+ * case the channel field has to be set to -1, or an event capture time
+ * retrieved from the on-board FIFO, in which case the channel field
+ * contains the index of the time capture input, e.g. 0 or 1.
+ */
+typedef struct
+{
+  int16_t channel;  ///< -1: the current on-board time; >= 0 the capture channel number
+  T_GPS t;          ///< time in GPS scale and format
+  TM_GPS tm;        ///< time converted to %UTC and/or local time according to ::TZDL settings
+
 } TTM;
 
 
@@ -251,282 +504,462 @@
 /* to geographic coordinates as defined by WGS84 (World Geodetic */
 /* System from 1984). */
 
-#ifndef _XYZ_DEFINED
-  /* sequence and number of components of a cartesian position */
-  enum { XP, YP, ZP, N_XYZ };
-
-  /* a type of array holding a cartesian position */
-  typedef l_fp XYZ[N_XYZ];      /* values are in [m] */
-
-#  define _XYZ_DEFINED
-#endif
+/**
+ * @brief Sequence and number of components of a cartesian position
+ */
+enum XYZ_FIELDS { XP, YP, ZP, N_XYZ };  // x, y, z
 
+/**
+ * @brief A position in cartesian coordinates
+ *
+ * Usually earth centered, earth fixed (ECEF) coordinates,
+ * in [m].
+ *
+ * @note In the original code this is an array of double.
+ *
+ * @see ::XYZ_FIELDS
+ */
+typedef l_fp XYZ[N_XYZ];
 
-#ifndef _LLA_DEFINED
-  /* sequence and number of components of a geographic position */
-  enum { LAT, LON, ALT, N_LLA };  /* latitude, longitude, altitude */
 
-  /* a type of array holding a geographic position */
-  typedef l_fp LLA[N_LLA];      /* lon, lat in [rad], alt in [m] */
+/**
+ * @brief Sequence and number of components of a geographic position
+ */
+enum LLA_FIELDS { LAT, LON, ALT, N_LLA };  /* latitude, longitude, altitude */
 
-#  define _LLA_DEFINED
-#endif
+/**
+ * @brief A geographic position based on latitude, longitude, and altitude
+ *
+ * The geographic position associated to specific cartesian coordinates
+ * depends on the characteristics of the ellipsoid used for the computation,
+ * the so-called geographic datum. GPS uses the WGS84 (World Geodetic System
+ * from 1984) ellipsoid by default.
+ *
+ * lon, lat in [rad], alt in [m]
+ *
+ * @note In the original code this is an array of double.
+ *
+ * @see ::LLA_FIELDS
+ */
+typedef l_fp LLA[N_LLA];
 
-/* Synthesizer parameters. Synthesizer frequency is expressed as a */
-/* four digit decimal number (freq) to be multiplied by 0.1 Hz and an */
-/* base 10 exponent (range). If the effective frequency is less than */
-/* 10 kHz its phase is synchronized corresponding to the variable phase. */
-/* Phase may be in a range from -360° to +360° with a resolution of 0.1°, */
-/* so the resulting numbers to be stored are in a range of -3600 to +3600. */
-
-/* Example: */
-/* Assume the value of freq is 2345 (decimal) and the value of phase is 900. */
-/* If range == 0 the effective frequency is 234.5 Hz with a phase of +90°. */
-/* If range == 1 the synthesizer will generate a 2345 Hz output frequency */
-/* and so on. */
-
-/* Limitations: */
-/* If freq == 0 the synthesizer is disabled. If range == 0 the least */
-/* significant digit of freq is limited to 0, 3, 5 or 6. The resulting */
-/* frequency is shown in the examples below: */
-/*     freq == 1230  -->  123.0 Hz */
-/*     freq == 1233  -->  123 1/3 Hz (real 1/3 Hz, NOT 123.3 Hz) */
-/*     freq == 1235  -->  123.5 Hz */
-/*     freq == 1236  -->  123 2/3 Hz (real 2/3 Hz, NOT 123.6 Hz) */
 
-/* If range == MAX_RANGE the value of freq must not exceed 1200, so the */
-/* output frequency is limited to 12 MHz. */
+/**
+ * @defgroup group_synth Synthesizer parameters
+ *
+ * Synthesizer frequency is expressed as a
+ * four digit decimal number (freq) to be multiplied by 0.1 Hz and an
+ * base 10 exponent (range). If the effective frequency is less than
+ * 10 kHz its phase is synchronized corresponding to the variable phase.
+ * Phase may be in a range from -360 deg to +360 deg with a resolution
+ * of 0.1 deg, so the resulting numbers to be stored are in a range of
+ * -3600 to +3600.
+ *
+ * Example:<br>
+ * Assume the value of freq is 2345 (decimal) and the value of phase is 900.
+ * If range == 0 the effective frequency is 234.5 Hz with a phase of +90 deg.
+ * If range == 1 the synthesizer will generate a 2345 Hz output frequency
+ * and so on.
+ *
+ * Limitations:<br>
+ * If freq == 0 the synthesizer is disabled. If range == 0 the least
+ * significant digit of freq is limited to 0, 3, 5 or 6. The resulting
+ * frequency is shown in the examples below:
+ *    - freq == 1230  -->  123.0 Hz
+ *    - freq == 1233  -->  123 1/3 Hz (real 1/3 Hz, NOT 123.3 Hz)
+ *    - freq == 1235  -->  123.5 Hz
+ *    - freq == 1236  -->  123 2/3 Hz (real 2/3 Hz, NOT 123.6 Hz)
+ *
+ * If range == ::MAX_SYNTH_RANGE the value of freq must not exceed 1000, so
+ * the output frequency is limited to 10 MHz (see ::MAX_SYNTH_FREQ_VAL).
+ *
+ * @{ */
 
-/* Phase will be ignored if the resulting frequency is greater or equal */
-/* to 10 kHz. */
+#define N_SYNTH_FREQ_DIGIT  4    ///< number of digits to edit
+#define MAX_SYNTH_FREQ   1000    ///< if range == ::MAX_SYNTH_RANGE
 
-#define MAX_SYNTH_FREQ   1200    /* if range == MAX_SYNTH_RANGE */
 #define MIN_SYNTH_RANGE     0
 #define MAX_SYNTH_RANGE     5
-#define MAX_SYNTH_PHASE  3600
+#define N_SYNTH_RANGE       ( MAX_SYNTH_RANGE - MIN_SYNTH_RANGE + 1 )
 
-typedef struct {
-  short freq;      /* four digits used; scale: 0.1; e.g. 1234 -> 123.4 Hz */
-  short range;     /* scale factor for freq; 0..MAX_SYNTH_RANGE */
-  short phase;     /* -MAX_SYNTH_PHASE..+MAX_SYNTH_PHASE; >0 -> pulses later */
-} SYNTH;
+#define N_SYNTH_PHASE_DIGIT  4
+#define MAX_SYNTH_PHASE      3600
 
 
+#define MAX_SYNTH_FREQ_EDIT  9999  ///< max sequence of digits when editing
 
-/* Time zone/daylight saving parameters. */
 
-/* the name of a time zone, 5 characters plus trailing zero */
-typedef char TZ_NAME[6];
-
-typedef struct {
-  long offs;         /* offset from UTC to local time [sec] */
-  long offs_dl;      /* additional offset if daylight saving enabled [sec] */
-  TM tm_on;          /* date/time when daylight saving starts */
-  TM tm_off;         /* date/time when daylight saving ends */
-  TZ_NAME name[2];   /* names without and with daylight saving enabled */
-} TZDL;
+/**
+ * @brief The maximum frequency that can be configured for the synthesizer
+ */
+#define MAX_SYNTH_FREQ_VAL   10000000UL     ///< 10 MHz
+/*   == MAX_SYNTH_FREQ * 10^(MAX_SYNTH_RANGE-1) */
 
-/* The constant below is defined beginning with software rev. 1.29. */
-/* If the year in tzdl.tmon and tzdl.tm_off is or'ed with that constant, */
-/* the receiver automatically generates daylight saving year by year. */
-/* See GPSLIB.TXT for more information. */
+/**
+ * @brief The synthesizer's phase is only be synchronized if the frequency is below this limit
+ */
+#define SYNTH_PHASE_SYNC_LIMIT   10000UL    ///< 10 kHz
 
-#define DL_AUTO_FLAG  0x8000
+/**
+ * A Macro used to determine the position of the decimal point
+ * when printing the synthesizer frequency as 4 digit value
+ */
+#define _synth_dp_pos_from_range( _r ) \
+  ( ( ( N_SYNTH_RANGE - (_r) ) % ( N_SYNTH_FREQ_DIGIT - 1 ) ) + 1 )
 
-/* Example: */
-/* for automatic daylight saving enable/disable in Central Europe, */
-/* the variables are to be set as shown below: */
-/*   offs = 3600L           one hour from UTC */
-/*   offs_dl = 3600L        one additional hour if daylight saving enabled */
-/*   tm_on = first Sunday from March 25, 02:00:00h ( year |= DL_AUTO_FLAG ) */
-/*   tm_off = first Sunday from Sept 24, 03:00:00h ( year |= DL_AUTO_FLAG ) */
-/*   name[0] == "MEZ  "     name if daylight saving not enabled */
-/*   name[1] == "MESZ "     name if daylight saving is enabled */
+/**
+ * @brief Synthesizer frequency units
+ *
+ * An initializer for commonly displayed synthesizer frequency units
+ * (::N_SYNTH_RANGE strings)
+ */
+#define DEFAULT_FREQ_RANGES \
+{                           \
+  "Hz",                     \
+  "kHz",                    \
+  "kHz",                    \
+  "kHz",                    \
+  "MHz",                    \
+  "MHz",                    \
+}
 
 
 
+/**
+ * @brief Synthesizer configuration parameters
+ */
+typedef struct
+{
+  int16_t freq;    ///< four digits used; scale: 0.1 Hz; e.g. 1234 -> 123.4 Hz
+  int16_t range;   ///< scale factor for freq; 0..::MAX_SYNTH_RANGE
+  int16_t phase;   ///< -::MAX_SYNTH_PHASE..+::MAX_SYNTH_PHASE; >0 -> pulses later
 
-/* the structure below was defined in rev. 1.31. It reflects the status */
-/* of the antenna, the times of last disconnect/reconnect and the boards */
-/* clock offset after the phase of disconnection. */
-
-typedef struct {
-  short status;    /* current status of antenna */
-  TM tm_disconn;   /* time of antenna disconnect */
-  TM tm_reconn;    /* time of antenna reconnect */
-  long delta_t;    /* clock offset at reconnect time, units: TICKS_PER_SEC */
-} ANT_INFO;
+} SYNTH;
 
+#define _mbg_swab_synth( _p )   \
+{                               \
+  _mbg_swab16( &(_p)->freq );   \
+  _mbg_swab16( &(_p)->range );  \
+  _mbg_swab16( &(_p)->phase );  \
+}
 
-/* the status field may be set to one of the values below: */
 
-enum {
-  ANT_INVALID,   /* struct not set yet because ant. has not been disconn. */
-  ANT_DISCONN,   /* ant. now disconn., tm_reconn and delta_t not set */
-  ANT_RECONN     /* ant. has been disconn. and reconn., all fields valid */
+/**
+ * @brief Enumeration of synthesizer states
+ */
+enum SYNTH_STATES
+{
+  SYNTH_DISABLED,   ///< disbled by cfg, i.e. freq == 0.0
+  SYNTH_OFF,        ///< not enabled after power-up
+  SYNTH_FREE,       ///< enabled, but not synchronized
+  SYNTH_DRIFTING,   ///< has initially been sync'd, but now running free
+  SYNTH_SYNC,       ///< fully synchronized
+  N_SYNTH_STATE     ///< the number of known states
 };
 
 
-/* Summary of configuration and health data of all SVs. */
+/**
+ * @brief A structure used to report the synthesizer state
+ */
+typedef struct
+{
+  uint8_t state;     ///< state code as enumerated in ::SYNTH_STATES
+  uint8_t flags;     ///< reserved, currently always 0
 
-typedef struct {
-  CSUM csum;               /* checksum of the remaining bytes */
-  short valid;             /* flag data are valid */
-
-  T_GPS tot_51;            /* time of transmission, page 51 */
-  T_GPS tot_63;            /* time of transmission, page 63 */
-  T_GPS t0a;               /* complete reference time almanac */
+} SYNTH_STATE;
 
-  CFG cfg[N_SVNO];         /* SV configuration from page 63 */
-  HEALTH health[N_SVNO];   /* SV health from pages 51, 63 */
-} CFGH;
+#define _mbg_swab_synth_state( _p )  _nop_macro_fnc()
 
+#define SYNTH_FLAG_PHASE_IGNORED  0x01
 
+/** @} defgroup group_synth */
 
-/* UTC correction parameters */
 
-typedef struct {
-  CSUM csum;       /*    checksum of the remaining bytes                  */
-  short valid;     /*    flag data are valid                              */
-
-  T_GPS t0t;       /*    Reference Time UTC Parameters              [sec] */
-  l_fp A0;         /*  ± Clock Correction Coefficient 0             [sec] */
-  l_fp A1;         /*  ± Clock Correction Coefficient 1         [sec/sec] */
-
-  u_short WNlsf;   /*  week number of nearest leap second                 */
-  short DNt;       /*  the day number at the end of which LS is inserted  */
-  char delta_tls;  /*                                                     */
-  char delta_tlsf; /*                                                     */
 
-} UTC;
+/**
+ * @defgroup group_tzdl Time zone / daylight saving parameters
+ *
+ * Example: <br>
+ * For automatic daylight saving enable/disable in Central Europe,
+ * the variables are to be set as shown below: <br>
+ *   - offs = 3600L           one hour from %UTC
+ *   - offs_dl = 3600L        one additional hour if daylight saving enabled
+ *   - tm_on = first Sunday from March 25, 02:00:00h ( year |= ::DL_AUTO_FLAG )
+ *   - tm_off = first Sunday from October 25, 03:00:00h ( year |= ::DL_AUTO_FLAG )
+ *   - name[0] == "CET  "     name if daylight saving not enabled
+ *   - name[1] == "CEST "     name if daylight saving is enabled
+ *
+ * @{ */
 
-/* a struct used to hold the settings of a serial port */
+/**
+ * @brief The name of a time zone
+ *
+ * @note Up to 5 printable characters, plus trailing zero
+ */
+typedef char TZ_NAME[6];
 
-#ifndef _COM_PARM_DEFINED
-  typedef long BAUD_RATE;
+/**
+ * @brief Time zone / daylight saving parameters
+ *
+ * This structure is used to specify how a device converts on-board %UTC
+ * to local time, including computation of beginning and end of daylight
+ * saving time (DST), if required.
+ *
+ * @note The ::TZDL structure contains members of type ::TM_GPS to specify
+ * the times for beginning and end of DST. However, the ::TM_GPS::frac,
+ * ::TM_GPS::offs_from_utc, and ::TM_GPS::status fields of these ::TZDL::tm_on
+ * and ::TZDL::tm_off members are ignored for the conversion to local time,
+ * and thus should be 0.
+ */
+typedef struct
+{
+  int32_t offs;      ///< standard offset from %UTC to local time [sec]
+  int32_t offs_dl;   ///< additional offset if daylight saving enabled [sec]
+  TM_GPS tm_on;      ///< date/time when daylight saving starts
+  TM_GPS tm_off;     ///< date/time when daylight saving ends
+  TZ_NAME name[2];   ///< names without and with daylight saving enabled
 
-  /* indices used to identify a parameter in the framing string */
-  enum { F_DBITS, F_PRTY, F_STBITS };
+} TZDL;
 
-  /* types of handshake */
-  enum { HS_NONE, HS_XONXOFF, HS_RTSCTS };
+/**
+ * @brief A flag indicating automatic computation of DST
+ *
+ * If this flag is or'ed to the year numbers in ::TZDL::tm_on and ::TZDL::tm_off
+ * then daylight saving is computed automatically year by year.
+ */
+#define DL_AUTO_FLAG  0x8000
 
-  typedef struct {
-    BAUD_RATE baud_rate;    /* e.g. 19200L */
-    char framing[4];        /* e.g. "8N1" */
-    short handshake;        /* a numeric value, only HS_NONE supported yet */
-  } COM_PARM;
+/** @} defgroup group_tzdl */
 
-#define _COM_PARM_DEFINED
-#endif
 
 
+/**
+ * @brief Antenna status and error at reconnect information
+ *
+ * The structure below reflects the status of the antenna,
+ * the times of last disconnect/reconnect, and the board's
+ * clock offset when it has synchronized again after the
+ * disconnection interval.
+ *
+ * @note ::ANT_INFO::status changes back to ::ANT_RECONN only
+ * after the antenna has been reconnected <b>and</b> the
+ * receiver has re-synchronized to the satellite signal.
+ * In this case ::ANT_INFO::delta_t reports the time offset
+ * before resynchronization, i.e. how much the internal
+ * time has drifted while the antenna was disconnected.
+ */
+typedef struct
+{
+  int16_t status;      ///< current status of antenna, see ::ANT_STATUS_CODES
+  TM_GPS tm_disconn;   ///< time of antenna disconnect
+  TM_GPS tm_reconn;    ///< time of antenna reconnect
+  int32_t delta_t;     ///< clock offs at reconn. time in 1/::RECEIVER_INFO::ticks_per_sec units
 
-/* the codes below define what has to comes out of the serial ports */
+} ANT_INFO;
 
-enum { STR_ON_REQ, STR_PER_SEC,
-       STR_PER_MIN, N_STR_MODE_0,      /* COM0 and COM1 */
-       STR_UCAP = N_STR_MODE_0,
-       STR_UCAP_REQ, N_STR_MODE_1      /* COM1 only */
-     };
 
+/**
+ * @brief Status code used with ::ANT_INFO::status
+ */
+enum ANT_STATUS_CODES
+{
+  ANT_INVALID,   ///< No other fields valid since antenna has not yet been disconnected
+  ANT_DISCONN,   ///< Antenna is disconnected, tm_reconn and delta_t not yet set
+  ANT_RECONN,    ///< Antenna has been disconnect, and receiver sync. after reconnect, so all fields valid
+  N_ANT_STATUS_CODES  ///< the number of known status codes
+};
 
-#define N_COM   2  /* the number of serial ports */
 
-/* the structure used to store the modes of both serial ports */
 
-typedef struct {
-  COM_PARM com[N_COM];    /* COM0 and COM1 settings */
-  u_char mode[N_COM];      /* COM0 and COM1 output mode */
-} PORT_PARM;
+/**
+ * @brief Summary of configuration and health data of all satellites
+ */
+typedef struct
+{
+  CSUM csum;                  ///< checksum of the remaining bytes
+  int16_t valid;              ///< flag data are valid
+
+  T_GPS tot_51;               ///< time of transmission, page 51
+  T_GPS tot_63;               ///< time of transmission, page 63
+  T_GPS t0a;                  ///< complete reference time almanac
+
+  CFG cfg[N_SVNO_GPS];        ///< 4 bit SV configuration code from page 63
+  HEALTH health[N_SVNO_GPS];  ///< 6 bit SV health codes from pages 51, 63
 
-/* Ephemeris parameters of one specific SV. Needed to compute the position */
-/* of a satellite at a given time with high precision. Valid for an */
-/* interval of 4 to 6 hours from start of transmission. */
-
-typedef struct {
-  CSUM csum;       /*    checksum of the remaining bytes                  */
-  short valid;     /*    flag data are valid                              */
-
-  HEALTH health;   /*    health indication of transmitting SV      [---]  */
-  IOD IODC;        /*    Issue Of Data, Clock                             */
-  IOD IODE2;       /*    Issue of Data, Ephemeris (Subframe 2)            */
-  IOD IODE3;       /*    Issue of Data, Ephemeris (Subframe 3)            */
-  T_GPS tt;        /*    time of transmission                             */
-  T_GPS t0c;       /*    Reference Time Clock                      [---]  */
-  T_GPS t0e;       /*    Reference Time Ephemeris                  [---]  */
-
-  l_fp   sqrt_A;   /*    Square Root of semi-major Axis        [sqrt(m)]  */
-  l_fp   e;        /*    Eccentricity                              [---]  */
-  l_fp   M0;       /*  ± Mean Anomaly at Ref. Time                 [rad]  */
-  l_fp   omega;    /*  ± Argument of Perigee                       [rad]  */
-  l_fp   OMEGA0;   /*  ± Longit. of Asc. Node of orbit plane       [rad]  */
-  l_fp   OMEGADOT; /*  ± Rate of Right Ascension               [rad/sec]  */
-  l_fp   deltan;   /*  ± Mean Motion Diff. from computed value [rad/sec]  */
-  l_fp   i0;       /*  ± Inclination Angle                         [rad]  */
-  l_fp   idot;     /*  ± Rate of Inclination Angle             [rad/sec]  */
-  l_fp   crc;      /*  ± Cosine Corr. Term to Orbit Radius           [m]  */
-  l_fp   crs;      /*  ± Sine Corr. Term to Orbit Radius             [m]  */
-  l_fp   cuc;      /*  ± Cosine Corr. Term to Arg. of Latitude     [rad]  */
-  l_fp   cus;      /*  ± Sine Corr. Term to Arg. of Latitude       [rad]  */
-  l_fp   cic;      /*  ± Cosine Corr. Term to Inclination Angle    [rad]  */
-  l_fp   cis;      /*  ± Sine Corr. Term to Inclination Angle      [rad]  */
-
-  l_fp   af0;      /*  ± Clock Correction Coefficient 0            [sec]  */
-  l_fp   af1;      /*  ± Clock Correction Coefficient 1        [sec/sec]  */
-  l_fp   af2;      /*  ± Clock Correction Coefficient 2       [sec/sec²]  */
-  l_fp   tgd;      /*  ± estimated group delay differential        [sec]  */
+} CFGH;
 
-  u_short URA;      /*    predicted User Range Accuracy                    */
 
-  u_char L2code;    /*    code on L2 channel                         [---] */
-  u_char L2flag;    /*    L2 P data flag                             [---] */
+
+/**
+ * @brief GPS %UTC correction parameters
+ *
+ * %UTC correction parameters basically as sent by the GPS satellites.
+ *
+ * The csum field is only used by the card's firmware to check the
+ * consistency of the structure in non-volatile memory.
+ *
+ * The field labeled valid indicates if the parameter set is valid, i.e.
+ * if it contains data received from the satellites.
+ *
+ * t0t, A0 and A1 contain fractional correction parameters for the current
+ * GPS-%UTC time offset in addition to the whole seconds. This is evaluated
+ * by the receivers' firmware to convert GPS time to %UTC time.
+ *
+ * The delta_tls field contains the current full seconds offset between
+ * GPS time and %UTC, which corresponds to the number of leap seconds inserted
+ * into the %UTC time scale since GPS was put into operation in January 1980.
+ *
+ * delta_tlfs holds the number of "future" leap seconds, i.e. the %UTC offset
+ * after the next leap second event defined by WNlsf and DNt.
+ *
+ * The fields WNlsf and DNt specify the GPS week number and the day number
+ * in that week for the end of which a leap second has been scheduled.
+ *
+ * @note: The satellites transmit WNlsf only as a signed 8 bit value, so it
+ * can only define a point in time which is +/- 127 weeks off the current time.
+ * The firmware tries to expand this based on the current week number, but
+ * the result is ambiguous if the leap second occurs or occurred more
+ * than 127 weeks in the future or past.
+ *
+ * So the leap second date should <b>only</b> be evaluated and displayed
+ * in a user interface if the fields delta_tls and delta_tlsf have
+ * different values, in which case there is indeed a leap second announcement
+ * inside the +/- 127 week range.
+ *
+ * @note In the original code the type of A0 and A1 is double.
+ */
+typedef struct
+{
+  CSUM csum;          ///<  Checksum of the remaining bytes
+  int16_t valid;      ///<  Flag indicating %UTC parameters are valid
+
+  T_GPS t0t;          ///<  Reference Time %UTC Parameters [wn|sec]
+  l_fp A0;            ///<  +- Clock Correction Coefficient 0 [sec]
+  l_fp A1;            ///<  +- Clock Correction Coefficient 1 [sec/sec]
+
+  uint16_t WNlsf;     ///<  Week number of nearest leap second
+  int16_t DNt;        ///<  The day number at the end of which a leap second occurs
+  int8_t delta_tls;   ///<  Current %UTC offset to GPS system time [sec]
+  int8_t delta_tlsf;  ///<  Future %UTC offset to GPS system time after next leap second transition [sec]
+
+} UTC;
+
+
+/**
+ * @brief GPS ASCII message
+ */
+typedef struct
+{
+  CSUM csum;       ///< checksum of the remaining bytes */
+  int16_t valid;   ///< flag data are valid
+  char s[23];      ///< 22 chars GPS ASCII message plus trailing zero
+
+} ASCII_MSG;
+
+
+/**
+ * @brief Ephemeris parameters of one specific satellite
+ *
+ * Needed to compute the position of a satellite at a given time with
+ * high precision. Valid for an interval of 4 to 6 hours from start
+ * of transmission.
+ */
+typedef struct
+{
+  CSUM csum;       ///<    checksum of the remaining bytes
+  int16_t valid;   ///<    flag data are valid
+
+  HEALTH health;   ///<    health indication of transmitting SV      [---]
+  IOD IODC;        ///<    Issue Of Data, Clock
+  IOD IODE2;       ///<    Issue of Data, Ephemeris (Subframe 2)
+  IOD IODE3;       ///<    Issue of Data, Ephemeris (Subframe 3)
+  T_GPS tt;        ///<    time of transmission
+  T_GPS t0c;       ///<    Reference Time Clock                      [---]
+  T_GPS t0e;       ///<    Reference Time Ephemeris                  [---]
+
+  l_fp sqrt_A;     ///<    Square Root of semi-major Axis        [sqrt(m)]
+  l_fp e;          ///<    Eccentricity                              [---]
+  l_fp M0;         ///< +- Mean Anomaly at Ref. Time                 [rad]
+  l_fp omega;      ///< +- Argument of Perigee                       [rad]
+  l_fp OMEGA0;     ///< +- Longit. of Asc. Node of orbit plane       [rad]
+  l_fp OMEGADOT;   ///< +- Rate of Right Ascension               [rad/sec]
+  l_fp deltan;     ///< +- Mean Motion Diff. from computed value [rad/sec]
+  l_fp i0;         ///< +- Inclination Angle                         [rad]
+  l_fp idot;       ///< +- Rate of Inclination Angle             [rad/sec]
+  l_fp crc;        ///< +- Cosine Corr. Term to Orbit Radius           [m]
+  l_fp crs;        ///< +- Sine Corr. Term to Orbit Radius             [m]
+  l_fp cuc;        ///< +- Cosine Corr. Term to Arg. of Latitude     [rad]
+  l_fp cus;        ///< +- Sine Corr. Term to Arg. of Latitude       [rad]
+  l_fp cic;        ///< +- Cosine Corr. Term to Inclination Angle    [rad]
+  l_fp cis;        ///< +- Sine Corr. Term to Inclination Angle      [rad]
+
+  l_fp af0;        ///< +- Clock Correction Coefficient 0            [sec]
+  l_fp af1;        ///< +- Clock Correction Coefficient 1        [sec/sec]
+  l_fp af2;        ///< +- Clock Correction Coefficient 2      [sec/sec^2]
+  l_fp tgd;        ///< +- estimated group delay differential        [sec]
+
+  uint16_t URA;    ///<    predicted User Range Accuracy
+
+  uint8_t L2code;  ///<    code on L2 channel                         [---]
+  uint8_t L2flag;  ///<    L2 P data flag                             [---]
 
 } EPH;
 
-/* Almanac parameters of one specific SV. A reduced precision set of */
-/* parameters used to check if a satellite is in view at a given time. */
-/* Valid for an interval of more than 7 days from start of transmission. */
-
-typedef struct {
-  CSUM csum;       /*    checksum of the remaining bytes                  */
-  short valid;     /*    flag data are valid                              */
-
-  HEALTH health;   /*                                               [---] */
-  T_GPS t0a;       /*    Reference Time Almanac                     [sec] */
-
-  l_fp   sqrt_A;   /*    Square Root of semi-major Axis         [sqrt(m)] */
-  l_fp   e;        /*    Eccentricity                               [---] */
-
-  l_fp   M0;       /*  ± Mean Anomaly at Ref. Time                  [rad] */
-  l_fp   omega;    /*  ± Argument of Perigee                        [rad] */
-  l_fp   OMEGA0;   /*  ± Longit. of Asc. Node of orbit plane        [rad] */
-  l_fp   OMEGADOT; /*  ± Rate of Right Ascension                [rad/sec] */
-  l_fp   deltai;   /*  ±                                            [rad] */
-  l_fp   af0;      /*  ± Clock Correction Coefficient 0             [sec] */
-  l_fp   af1;      /*  ± Clock Correction Coefficient 1         [sec/sec] */
+
+
+/**
+ * @brief Almanac parameters of one specific satellite
+ *
+ * A reduced precision set of parameters used to check if a satellite
+ * is in view at a given time. Valid for an interval of more than 7 days
+ * from start of transmission.
+ */
+typedef struct
+{
+  CSUM csum;       ///<    checksum of the remaining bytes
+  int16_t valid;   ///<    flag data are valid
+
+  HEALTH health;   ///<                                               [---]
+  T_GPS t0a;       ///<    Reference Time Almanac                     [sec]
+
+  l_fp sqrt_A;     ///<    Square Root of semi-major Axis         [sqrt(m)]
+  l_fp e;          ///<    Eccentricity                               [---]
+
+  l_fp M0;         ///< +- Mean Anomaly at Ref. Time                  [rad]
+  l_fp omega;      ///< +- Argument of Perigee                        [rad]
+  l_fp OMEGA0;     ///< +- Longit. of Asc. Node of orbit plane        [rad]
+  l_fp OMEGADOT;   ///< +- Rate of Right Ascension                [rad/sec]
+  l_fp deltai;     ///< +-                                            [rad]
+  l_fp af0;        ///< +- Clock Correction Coefficient 0             [sec]
+  l_fp af1;        ///< +- Clock Correction Coefficient 1         [sec/sec]
+
 } ALM;
 
 
-/* ionospheric correction parameters */
 
-typedef struct {
-  CSUM csum;       /*    checksum of the remaining bytes                  */
-  short valid;     /*    flag data are valid                              */
-
-  l_fp   alpha_0;  /*    Ionosph. Corr. Coeff. Alpha 0              [sec] */
-  l_fp   alpha_1;  /*    Ionosph. Corr. Coeff. Alpha 1          [sec/deg] */
-  l_fp   alpha_2;  /*    Ionosph. Corr. Coeff. Alpha 2        [sec/deg^2] */
-  l_fp   alpha_3;  /*    Ionosph. Corr. Coeff. Alpha 3        [sec/deg^3] */
-
-  l_fp   beta_0;   /*    Ionosph. Corr. Coeff. Beta 0               [sec] */
-  l_fp   beta_1;   /*    Ionosph. Corr. Coeff. Beta 1           [sec/deg] */
-  l_fp   beta_2;   /*    Ionosph. Corr. Coeff. Beta 2         [sec/deg^2] */
-  l_fp   beta_3;   /*    Ionosph. Corr. Coeff. Beta 3         [sec/deg^3] */
+/**
+ * @brief Ionospheric correction parameters
+ */
+typedef struct
+{
+  CSUM csum;       ///<    checksum of the remaining bytes
+  int16_t valid;   ///<    flag data are valid
+
+  l_fp alpha_0;    ///<    Ionosph. Corr. Coeff. Alpha 0              [sec]
+  l_fp alpha_1;    ///<    Ionosph. Corr. Coeff. Alpha 1          [sec/deg]
+  l_fp alpha_2;    ///<    Ionosph. Corr. Coeff. Alpha 2        [sec/deg^2]
+  l_fp alpha_3;    ///<    Ionosph. Corr. Coeff. Alpha 3        [sec/deg^3]
+
+  l_fp beta_0;     ///<    Ionosph. Corr. Coeff. Beta 0               [sec]
+  l_fp beta_1;     ///<    Ionosph. Corr. Coeff. Beta 1           [sec/deg]
+  l_fp beta_2;     ///<    Ionosph. Corr. Coeff. Beta 2         [sec/deg^2]
+  l_fp beta_3;     ///<    Ionosph. Corr. Coeff. Beta 3         [sec/deg^3]
 
 } IONO;
 
-void mbg_tm_str (char **, TM *, int);
+
+
+void mbg_tm_str (char **, TM_GPS *, int, int);
 void mbg_tgps_str (char **, T_GPS *, int);
 void get_mbg_header (unsigned char **, GPS_MSG_HDR *);
 void put_mbg_header (unsigned char **, GPS_MSG_HDR *);
@@ -536,7 +969,7 @@
 void get_mbg_health (unsigned char **, HEALTH *);
 void get_mbg_cfg (unsigned char **, CFG *);
 void get_mbg_tgps (unsigned char **, T_GPS *);
-void get_mbg_tm (unsigned char **, TM *);
+void get_mbg_tm (unsigned char **, TM_GPS *);
 void get_mbg_ttm (unsigned char **, TTM *);
 void get_mbg_synth (unsigned char **, SYNTH *);
 void get_mbg_tzdl (unsigned char **, TZDL *);
@@ -550,7 +983,7 @@
 void get_mbg_alm (unsigned char **, ALM *);
 void get_mbg_iono (unsigned char **, IONO *);
 
-unsigned long mbg_csum (unsigned char *, unsigned int);
+CSUM mbg_csum (unsigned char *, unsigned int);
 
 #endif
 /*
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/include/ntp.h /cur/src/external/bsd/ntp/dist/include/ntp.h
--- external/bsd/ntp/dist/include/ntp.h	2014-12-24 18:28:04.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/include/ntp.h	2015-04-07 19:51:17.000000000 -0700
@@ -437,7 +437,7 @@
 #define	STRATUM_UNSPEC	((u_char)16) /* unspecified */
 
 /*
- * Values for peer.flags
+ * Values for peer.flags (u_int)
  */
 #define	FLAG_CONFIG	0x0001	/* association was configured */
 #define	FLAG_PREEMPT	0x0002	/* preemptable association */
@@ -455,8 +455,9 @@
 #define	FLAG_XB		0x2000	/* interleaved broadcast */
 #define	FLAG_XBOGUS	0x4000	/* interleaved bogus packet */
 #ifdef	OPENSSL
-#define FLAG_ASSOC	0x8000	/* autokey request */
+# define FLAG_ASSOC	0x8000	/* autokey request */
 #endif /* OPENSSL */
+#define FLAG_TSTAMP_PPS	0x10000	/* PPS source provides absolute timestamp */
 
 /*
  * Definitions for the clear() routine.  We use memset() to clear
@@ -715,17 +716,19 @@
  */
 #define	LOOP_DRIFTINIT		1	/* iniitialize frequency */
 #define	LOOP_KERN_CLEAR		2	/* set initial frequency offset */
-#define LOOP_MAX		3	/* set step offset */
-#define LOOP_PANIC		4	/* set panic offseet */
-#define LOOP_PHI		5	/* set dispersion rate */
-#define LOOP_MINSTEP		6	/* set step timeout */
-#define LOOP_MINPOLL		7	/* set min poll interval (log2 s) */
-#define LOOP_ALLAN		8	/* set minimum Allan intercept */
-#define LOOP_HUFFPUFF		9	/* set huff-n'-puff filter length */
-#define LOOP_FREQ		10	/* set initial frequency */
-#define LOOP_CODEC		11	/* set audio codec frequency */
-#define	LOOP_LEAP		12	/* insert leap after second 23:59 */
-#define	LOOP_TICK		13	/* sim. low precision clock */
+#define LOOP_MAX		3	/* set both step offsets */
+#define LOOP_MAX_BACK		4	/* set bacward-step offset */
+#define LOOP_MAX_FWD		5	/* set forward-step offset */
+#define LOOP_PANIC		6	/* set panic offseet */
+#define LOOP_PHI		7	/* set dispersion rate */
+#define LOOP_MINSTEP		8	/* set step timeout */
+#define LOOP_MINPOLL		9	/* set min poll interval (log2 s) */
+#define LOOP_ALLAN		10	/* set minimum Allan intercept */
+#define LOOP_HUFFPUFF		11	/* set huff-n'-puff filter length */
+#define LOOP_FREQ		12	/* set initial frequency */
+#define LOOP_CODEC		13	/* set audio codec frequency */
+#define	LOOP_LEAP		14	/* insert leap after second 23:59 */
+#define	LOOP_TICK		15	/* sim. low precision clock */
 
 /*
  * Configuration items for the stats printer
@@ -877,13 +880,13 @@
  */
 #define AM_ERR		-1		/* error */
 #define AM_NOMATCH	0		/* no match */
-#define AM_PROCPKT	1		/* server/symmetric packet */	
-#define AM_BCST		2		/* broadcast packet */	
+#define AM_PROCPKT	1		/* server/symmetric packet */
+#define AM_BCST		2		/* broadcast packet */
 #define AM_FXMIT	3		/* client packet */
 #define AM_MANYCAST	4		/* manycast or pool */
 #define AM_NEWPASS	5		/* new passive */
 #define AM_NEWBCL	6		/* new broadcast */
-#define	AM_POSSBCL	7		/* discard broadcast */
+#define AM_POSSBCL	7		/* discard broadcast */
 
 /* NetInfo configuration locations */
 #ifdef HAVE_NETINFO
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/include/ntp_calendar.h /cur/src/external/bsd/ntp/dist/include/ntp_calendar.h
--- external/bsd/ntp/dist/include/ntp_calendar.h	2014-12-24 18:28:04.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/include/ntp_calendar.h	2015-04-07 19:51:17.000000000 -0700
@@ -85,13 +85,15 @@
 #define	SECSPERMIN	(60)			/* seconds per minute */
 #define	MINSPERHR	(60)			/* minutes per hour */
 #define	HRSPERDAY	(24)			/* hours per day */
+#define	DAYSPERWEEK	(7)			/* days per week */
 #define	DAYSPERYEAR	(365)			/* days per year */
 
 #define	SECSPERHR	(SECSPERMIN * MINSPERHR)
 #define	SECSPERDAY	(SECSPERHR * HRSPERDAY)
+#define	SECSPERWEEK	(DAYSPERWEEK * SECSPERDAY)
 #define	SECSPERYEAR	(365 * SECSPERDAY)	/* regular year */
 #define	SECSPERLEAPYEAR	(366 * SECSPERDAY)	/* leap year */
-#define SECSPERAVGYEAR	31556952		/* mean year length over 400yrs */
+#define	SECSPERAVGYEAR	31556952		/* mean year length over 400yrs */
 
 /*
  * Gross hacks.	 I have illicit knowlege that there won't be overflows
@@ -115,7 +117,7 @@
  * Convert between 'time_t' and 'vint64'
  */
 extern vint64 time_to_vint64(const time_t *);
-extern time_t vint64_to_time(const vint64 *); 
+extern time_t vint64_to_time(const vint64 *);
 
 /*
  * Get the build date & time. ATTENTION: The time zone is not specified!
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/include/ntp_fp.h /cur/src/external/bsd/ntp/dist/include/ntp_fp.h
--- external/bsd/ntp/dist/include/ntp_fp.h	2014-12-24 18:28:04.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/include/ntp_fp.h	2015-04-07 19:51:17.000000000 -0700
@@ -266,10 +266,13 @@
  * headers.  So far the problem has only been seen with gcc, but it
  * may also affect Sun compilers, in which case the defined(__GNUC__)
  * term should be removed.
+ * XSCALE also generates bad code for these, at least with GCC 3.3.5.
+ * This is unrelated to math.h, but the same solution applies.
  */
 #if defined(HAVE_U_INT64) && \
     !(defined(__SVR4) && defined(__sun) && \
-      defined(sparc) && defined(__GNUC__))
+      defined(sparc) && defined(__GNUC__) || \
+      defined(__arm__) && defined(__XSCALE__) && defined(__GNUC__)) 
 
 #include <math.h>	/* ldexp() */
 
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/include/ntp_md5.h /cur/src/external/bsd/ntp/dist/include/ntp_md5.h
--- external/bsd/ntp/dist/include/ntp_md5.h	2014-12-24 18:28:04.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/include/ntp_md5.h	2015-04-07 19:51:17.000000000 -0700
@@ -26,7 +26,7 @@
 
   typedef MD5_CTX			EVP_MD_CTX;
 # define EVP_get_digestbynid(t)		NULL
-# define EVP_md5(v)			NULL
+# define EVP_md5()			NULL
 # define EVP_MD_CTX_init(c)
 # define EVP_MD_CTX_set_flags(c, f)
 # define EVP_DigestInit(c, dt)		(MD5Init(c), 1)
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/include/ntpd.h /cur/src/external/bsd/ntp/dist/include/ntpd.h
--- external/bsd/ntp/dist/include/ntpd.h	2014-12-24 18:28:04.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/include/ntpd.h	2015-04-07 19:51:17.000000000 -0700
@@ -190,6 +190,7 @@
 extern	void	clear_all	(void);
 extern	int	score_all	(struct peer *);
 extern	struct peer *findmanycastpeer(struct recvbuf *);
+extern	void	peer_cleanup	(void);
 
 /* ntp_crypto.c */
 #ifdef AUTOKEY
@@ -287,7 +288,7 @@
 extern	void	record_clock_stats (sockaddr_u *, const char *);
 extern	int	mprintf_clock_stats(sockaddr_u *, const char *, ...)
 			NTP_PRINTF(2, 3);
-extern	void	record_raw_stats (sockaddr_u *srcadr, sockaddr_u *dstadr, l_fp *t1, l_fp *t2, l_fp *t3, l_fp *t4, int leap, int version, int mode, int stratum, int poll, int precision, double root_delay, double root_dispersion, u_int32 refid);
+extern	void	record_raw_stats (sockaddr_u *srcadr, sockaddr_u *dstadr, l_fp *t1, l_fp *t2, l_fp *t3, l_fp *t4, int leap, int version, int mode, int stratum, int ppoll, int precision, double root_delay, double root_dispersion, u_int32 refid);
 extern	void	check_leap_file	(int is_daily_check, u_int32 ntptime, const time_t * systime);
 extern	void	record_crypto_stats (sockaddr_u *, const char *);
 #ifdef DEBUG
@@ -387,7 +388,8 @@
 /* ntp_loopfilter.c */
 extern double	drift_comp;		/* clock frequency (s/s) */
 extern double	clock_stability;	/* clock stability (s/s) */
-extern double	clock_max;		/* max offset before step (s) */
+extern double	clock_max_back;		/* max backward offset before step (s) */
+extern double	clock_max_fwd;		/* max forward offset before step (s) */
 extern double	clock_panic;		/* max offset before panic (s) */
 extern double	clock_phi;		/* dispersion rate (s/s) */
 extern double	clock_minstep;		/* step timeout (s) */
@@ -405,8 +407,9 @@
 extern int	hardpps_enable;		/* kernel PPS discipline enabled */
 extern int	ext_enable;		/* external clock enabled */
 extern int	cal_enable;		/* refclock calibrate enable */
-extern int	allow_panic;		/* allow panic correction */
-extern int	mode_ntpdate;		/* exit on first clock set */
+extern int	allow_panic;		/* allow panic correction (-g) */
+extern int	force_step_once;	/* always step time once at startup (-G) */
+extern int	mode_ntpdate;		/* exit on first clock set (-q) */
 extern int	peer_ntpdate;		/* count of ntpdate peers */
 
 /*
@@ -520,7 +523,7 @@
 
 /* ntp_signd.c */
 #ifdef HAVE_NTP_SIGND
-extern void send_via_ntp_signd(struct recvbuf *, int, keyid_t, int, 
+extern void send_via_ntp_signd(struct recvbuf *, int, keyid_t, int,
 			       struct pkt *);
 #endif
 
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/include/parse.h /cur/src/external/bsd/ntp/dist/include/parse.h
--- external/bsd/ntp/dist/include/parse.h	2014-12-24 18:28:04.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/include/parse.h	2015-04-07 19:51:17.000000000 -0700
@@ -6,7 +6,7 @@
  * parse.h,v 4.12 2007/01/14 08:36:03 kardel RELEASE_20070114_A
  *
  * Copyright (c) 1995-2005 by Frank Kardel <kardel <AT> ntp.org>
- * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universität Erlangen-Nürnberg, Germany
+ * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universitaet Erlangen-Nuernberg, Germany
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -107,6 +107,13 @@
 #endif
 
 /*
+ * some constants useful for GPS time conversion
+ */
+#define GPSORIGIN       2524953600UL                /* NTP origin - GPS origin in seconds */
+#define GPSWRAP         990U                        /* assume week count less than this in the previous epoch */
+#define GPSWEEKS        1024U                       /* number of weeks until the GPS epch rolls over */
+
+/*
  * state flags
  */
 #define PARSEB_POWERUP            0x00000001 /* no synchronisation */
@@ -129,7 +136,7 @@
 /*
  * optional status information
  */
-#define PARSEB_ALTERNATE	  0x00001000 /* alternate antenna used */
+#define PARSEB_CALLBIT		  0x00001000 /* "call bit" used to signalize irregularities in the control facilities */
 #define PARSEB_POSITION		  0x00002000 /* position available */
 #define PARSEB_MESSAGE            0x00004000 /* addtitional message data */
 /*
@@ -147,7 +154,7 @@
 #define PARSEB_PPS		  0x20000000 /* valid PPS sample */
 
 #define PARSE_TCINFO		(PARSEB_ANNOUNCE|PARSEB_POWERUP|PARSEB_NOSYNC|PARSEB_DST|\
-				 PARSEB_UTC|PARSEB_LEAPS|PARSEB_ALTERNATE|PARSEB_S_LEAP|\
+				 PARSEB_UTC|PARSEB_LEAPS|PARSEB_CALLBIT|PARSEB_S_LEAP|\
 				 PARSEB_S_LOCATION|PARSEB_TIMECODE|PARSEB_MESSAGE)
 
 #define PARSE_POWERUP(x)        ((x) & PARSEB_POWERUP)
@@ -158,7 +165,7 @@
 #define PARSE_UTC(x)		((x) & PARSEB_UTC)
 #define PARSE_LEAPADD(x)	(PARSE_SYNC(x) && (((x) & PARSEB_LEAPS) == PARSEB_LEAPADD))
 #define PARSE_LEAPDEL(x)	(PARSE_SYNC(x) && (((x) & PARSEB_LEAPS) == PARSEB_LEAPDEL))
-#define PARSE_ALTERNATE(x)	((x) & PARSEB_ALTERNATE)
+#define PARSE_CALLBIT(x)	((x) & PARSEB_CALLBIT)
 #define PARSE_LEAPSECOND(x)	(PARSE_SYNC(x) && ((x) & PARSEB_LEAP_SECOND))
 
 #define PARSE_S_LEAP(x)		((x) & PARSEB_S_LEAP)
@@ -231,13 +238,13 @@
 #define PARSE_IO_CSIZE	0x00000003
 #define PARSE_IO_CS5	0x00000000
 #define PARSE_IO_CS6	0x00000001
-#define PARSE_IO_CS7	0x00000002 
-#define PARSE_IO_CS8	0x00000003 
+#define PARSE_IO_CS7	0x00000002
+#define PARSE_IO_CS8	0x00000003
 
 /*
  * ioctl structure
  */
-union parsectl 
+union parsectl
 {
   struct parsegettc
     {
@@ -260,7 +267,7 @@
       u_long         parse_cs;	/* character size (needed for stripping) */
     } parsesetcs;
 };
-  
+
 typedef union parsectl parsectl_t;
 
 /*------ for conversion routines --------*/
@@ -268,7 +275,7 @@
 struct parse			/* parse module local data */
 {
   int            parse_flags;	/* operation and current status flags */
-  
+
   int		 parse_ioflags;	   /* io handling flags (5-8 Bit control currently) */
 
   /*
@@ -288,7 +295,7 @@
   char          *parse_ldata;	/* last data buffer */
   unsigned short parse_ldsize;	/* last data buffer length */
   u_long         parse_badformat;	/* number of unparsable pakets */
-  
+
   timestamp_t    parse_lastchar; /* last time a character was received */
   parsetime_t    parse_dtime;	/* external data prototype */
 };
@@ -339,15 +346,19 @@
 #define SYNC_ZERO	0x00
 #define SYNC_ONE	0x01
 
+typedef u_long parse_inp_fnc_t(parse_t *, char, timestamp_t *);
+typedef u_long parse_cvt_fnc_t(unsigned char *, int, struct format *, clocktime_t *, void *);
+typedef u_long parse_pps_fnc_t(parse_t *, int, timestamp_t *);
+
 struct clockformat
 {
   /* special input protocol - implies fixed format */
-  u_long	(*input)   (parse_t *, unsigned int, timestamp_t *);
+  parse_inp_fnc_t *input;
   /* conversion routine */
-  u_long        (*convert) (unsigned char *, int, struct format *, clocktime_t *, void *);
+  parse_cvt_fnc_t *convert;
   /* routine for handling RS232 sync events (time stamps) */
   /* PPS input routine */
-  u_long        (*syncpps) (parse_t *, int, timestamp_t *);
+  parse_pps_fnc_t *syncpps;
   /* time code synthesizer */
 
   void           *data;		/* local parameters */
@@ -363,7 +374,7 @@
  */
 extern int  parse_ioinit (parse_t *);
 extern void parse_ioend (parse_t *);
-extern int  parse_ioread (parse_t *, unsigned int, timestamp_t *);
+extern int  parse_ioread (parse_t *, char, timestamp_t *);
 extern int  parse_iopps (parse_t *, int, timestamp_t *);
 extern void parse_iodone (parse_t *);
 extern int  parse_timecode (parsectl_t *, parse_t *);
@@ -371,8 +382,8 @@
 extern int  parse_setfmt (parsectl_t *, parse_t *);
 extern int  parse_setcs (parsectl_t *, parse_t *);
 
-extern unsigned int parse_restart (parse_t *, unsigned int);
-extern unsigned int parse_addchar (parse_t *, unsigned int);
+extern unsigned int parse_restart (parse_t *, char);
+extern unsigned int parse_addchar (parse_t *, char);
 extern unsigned int parse_end (parse_t *);
 
 extern int Strok (const unsigned char *, const unsigned char *);
@@ -381,9 +392,9 @@
 extern time_t parse_to_unixtime (clocktime_t *, u_long *);
 extern u_long updatetimeinfo (parse_t *, u_long);
 extern void syn_simple (parse_t *, timestamp_t *, struct format *, u_long);
-extern u_long pps_simple (parse_t *, int, timestamp_t *);
-extern u_long pps_one (parse_t *, int, timestamp_t *);
-extern u_long pps_zero (parse_t *, int, timestamp_t *);
+extern parse_pps_fnc_t pps_simple;
+extern parse_pps_fnc_t pps_one;
+extern parse_pps_fnc_t pps_zero;
 extern int parse_timedout (parse_t *, timestamp_t *, struct timeval *);
 
 #endif
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/include/parse_conf.h /cur/src/external/bsd/ntp/dist/include/parse_conf.h
--- external/bsd/ntp/dist/include/parse_conf.h	2014-12-24 18:28:04.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/include/parse_conf.h	2015-04-07 19:51:17.000000000 -0700
@@ -6,7 +6,7 @@
  * parse_conf.h,v 4.7 2005/06/25 10:58:45 kardel RELEASE_20050625_A
  *
  * Copyright (c) 1995-2005 by Frank Kardel <kardel <AT> ntp.org>
- * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universität Erlangen-Nürnberg, Germany
+ * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universitaet Erlangen-Nuernberg, Germany
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -43,13 +43,13 @@
 /*
  * field location structure
  */
-#define O_DAY	0
+#define O_DAY   0
 #define O_MONTH 1
-#define O_YEAR	2
-#define O_HOUR	3
-#define O_MIN	4
-#define	O_SEC	5
-#define O_WDAY	6
+#define O_YEAR  2
+#define O_HOUR  3
+#define O_MIN   4
+#define O_SEC   5
+#define O_WDAY  6
 #define O_FLAGS 7
 #define O_ZONE  8
 #define O_UTCHOFFSET 9
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/include/timepps-Solaris.h /cur/src/external/bsd/ntp/dist/include/timepps-Solaris.h
--- external/bsd/ntp/dist/include/timepps-Solaris.h	2014-12-24 18:28:04.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/include/timepps-Solaris.h	2015-04-07 19:51:17.000000000 -0700
@@ -415,7 +415,7 @@
 	}
 
 	punit = (pps_unit_t *)handle;
-	memcpy(params, &punit->params, sizeof(params));
+	memcpy(params, &punit->params, sizeof(*params));
 	return (0);
 }
 
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/kernel/Makefile.in /cur/src/external/bsd/ntp/dist/kernel/Makefile.in
--- external/bsd/ntp/dist/kernel/Makefile.in	2014-12-19 12:37:38.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/kernel/Makefile.in	2015-04-07 19:51:17.000000000 -0700
@@ -38,8 +38,7 @@
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
 	$(top_srcdir)/sntp/libopts/m4/stdnoreturn.m4 \
-	$(top_srcdir)/sntp/libevent/m4/openldap-thread-check.m4 \
-	$(top_srcdir)/sntp/libevent/m4/openldap.m4 \
+	$(top_srcdir)/sntp/m4/ax_c99_struct_init.m4 \
 	$(top_srcdir)/sntp/m4/define_dir.m4 \
 	$(top_srcdir)/sntp/m4/hms_search_lib.m4 \
 	$(top_srcdir)/sntp/m4/libtool.m4 \
@@ -68,6 +67,8 @@
 	$(top_srcdir)/sntp/m4/ntp_sntp.m4 \
 	$(top_srcdir)/sntp/m4/ntp_ver_suffix.m4 \
 	$(top_srcdir)/sntp/m4/ntp_vpathhack.m4 \
+	$(top_srcdir)/sntp/m4/openldap-thread-check.m4 \
+	$(top_srcdir)/sntp/m4/openldap.m4 \
 	$(top_srcdir)/sntp/m4/os_cflags.m4 \
 	$(top_srcdir)/sntp/m4/snprintf.m4 \
 	$(top_srcdir)/sntp/m4/version.m4 $(top_srcdir)/configure.ac
@@ -148,6 +149,7 @@
 CONFIG_SHELL = @CONFIG_SHELL@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
+CPPFLAGS_LIBEVENT = @CPPFLAGS_LIBEVENT@
 CPPFLAGS_NTP = @CPPFLAGS_NTP@
 CXX = @CXX@
 CXXCPP = @CXXCPP@
@@ -182,7 +184,9 @@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 LD = @LD@
+LDADD_LIBEVENT = @LDADD_LIBEVENT@
 LDADD_LIBNTP = @LDADD_LIBNTP@
+LDADD_LIBUTIL = @LDADD_LIBUTIL@
 LDADD_NLIST = @LDADD_NLIST@
 LDADD_NTP = @LDADD_NTP@
 LDFLAGS = @LDFLAGS@
@@ -321,6 +325,11 @@
 TIMETRIM_DS = @TIMETRIM_DS@
 TIMETRIM_MS = @TIMETRIM_MS@
 TIMETRIM_NI = @TIMETRIM_NI@
+UPDATE_LEAP_DB = @UPDATE_LEAP_DB@
+UPDATE_LEAP_DL = @UPDATE_LEAP_DL@
+UPDATE_LEAP_DS = @UPDATE_LEAP_DS@
+UPDATE_LEAP_MS = @UPDATE_LEAP_MS@
+UPDATE_LEAP_NI = @UPDATE_LEAP_NI@
 VERSION = @VERSION@
 VER_SUFFIX = @VER_SUFFIX@
 YACC = @YACC@
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/kernel/sys/Makefile.in /cur/src/external/bsd/ntp/dist/kernel/sys/Makefile.in
--- external/bsd/ntp/dist/kernel/sys/Makefile.in	2014-12-19 12:37:38.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/kernel/sys/Makefile.in	2015-04-07 19:51:17.000000000 -0700
@@ -40,8 +40,7 @@
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
 	$(top_srcdir)/sntp/libopts/m4/stdnoreturn.m4 \
-	$(top_srcdir)/sntp/libevent/m4/openldap-thread-check.m4 \
-	$(top_srcdir)/sntp/libevent/m4/openldap.m4 \
+	$(top_srcdir)/sntp/m4/ax_c99_struct_init.m4 \
 	$(top_srcdir)/sntp/m4/define_dir.m4 \
 	$(top_srcdir)/sntp/m4/hms_search_lib.m4 \
 	$(top_srcdir)/sntp/m4/libtool.m4 \
@@ -70,6 +69,8 @@
 	$(top_srcdir)/sntp/m4/ntp_sntp.m4 \
 	$(top_srcdir)/sntp/m4/ntp_ver_suffix.m4 \
 	$(top_srcdir)/sntp/m4/ntp_vpathhack.m4 \
+	$(top_srcdir)/sntp/m4/openldap-thread-check.m4 \
+	$(top_srcdir)/sntp/m4/openldap.m4 \
 	$(top_srcdir)/sntp/m4/os_cflags.m4 \
 	$(top_srcdir)/sntp/m4/snprintf.m4 \
 	$(top_srcdir)/sntp/m4/version.m4 $(top_srcdir)/configure.ac
@@ -113,6 +114,7 @@
 CONFIG_SHELL = @CONFIG_SHELL@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
+CPPFLAGS_LIBEVENT = @CPPFLAGS_LIBEVENT@
 CPPFLAGS_NTP = @CPPFLAGS_NTP@
 CXX = @CXX@
 CXXCPP = @CXXCPP@
@@ -147,7 +149,9 @@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 LD = @LD@
+LDADD_LIBEVENT = @LDADD_LIBEVENT@
 LDADD_LIBNTP = @LDADD_LIBNTP@
+LDADD_LIBUTIL = @LDADD_LIBUTIL@
 LDADD_NLIST = @LDADD_NLIST@
 LDADD_NTP = @LDADD_NTP@
 LDFLAGS = @LDFLAGS@
@@ -286,6 +290,11 @@
 TIMETRIM_DS = @TIMETRIM_DS@
 TIMETRIM_MS = @TIMETRIM_MS@
 TIMETRIM_NI = @TIMETRIM_NI@
+UPDATE_LEAP_DB = @UPDATE_LEAP_DB@
+UPDATE_LEAP_DL = @UPDATE_LEAP_DL@
+UPDATE_LEAP_DS = @UPDATE_LEAP_DS@
+UPDATE_LEAP_MS = @UPDATE_LEAP_MS@
+UPDATE_LEAP_NI = @UPDATE_LEAP_NI@
 VERSION = @VERSION@
 VER_SUFFIX = @VER_SUFFIX@
 YACC = @YACC@
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/kernel/sys/parsestreams.h /cur/src/external/bsd/ntp/dist/kernel/sys/parsestreams.h
--- external/bsd/ntp/dist/kernel/sys/parsestreams.h	2014-12-24 18:28:04.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/kernel/sys/parsestreams.h	2015-04-07 19:51:17.000000000 -0700
@@ -6,7 +6,7 @@
  * parsestreams.h,v 4.5 2005/06/25 10:52:47 kardel RELEASE_20050625_A
  *
  * Copyright (c) 1995-2005 by Frank Kardel <kardel <AT> ntp.org>
- * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universität Erlangen-Nürnberg, Germany
+ * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universitaet Erlangen-Nuernberg, Germany
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/lib/isc/include/isc/backtrace.h /cur/src/external/bsd/ntp/dist/lib/isc/include/isc/backtrace.h
--- external/bsd/ntp/dist/lib/isc/include/isc/backtrace.h	2014-12-24 18:28:05.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/lib/isc/include/isc/backtrace.h	2015-04-07 19:51:17.000000000 -0700
@@ -87,12 +87,12 @@
  */
 
 isc_result_t
-isc_backtrace_getsymbolfromindex(int index, const void **addrp,
+isc_backtrace_getsymbolfromindex(int idx, const void **addrp,
 				 const char **symbolp);
 /*%<
  * Returns the content of the internal symbol table of the given index.
  * On success, *addrsp and *symbolp point to the address and the symbol of
- * the 'index'th entry of the table, respectively.  If 'index' is not in the
+ * the 'index'th entry of the table, respectively.  If 'idx' is not in the
  * range of the symbol table, ISC_R_RANGE will be returned.
  *
  * Requires
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/lib/isc/include/isc/socket.h /cur/src/external/bsd/ntp/dist/lib/isc/include/isc/socket.h
--- external/bsd/ntp/dist/lib/isc/include/isc/socket.h	2014-12-24 18:28:05.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/lib/isc/include/isc/socket.h	2015-04-07 19:51:17.000000000 -0700
@@ -276,7 +276,7 @@
 } isc_socketmgrmethods_t;
 
 typedef struct isc_socketmethods {
-	void		(*attach)(isc_socket_t *socket,
+	void		(*attach)(isc_socket_t *sock,
 				  isc_socket_t **socketp);
 	void		(*detach)(isc_socket_t **socketp);
 	isc_result_t	(*bind)(isc_socket_t *sock, isc_sockaddr_t *sockaddr,
@@ -298,9 +298,9 @@
 	isc_sockettype_t (*gettype)(isc_socket_t *sock);
 	void		(*ipv6only)(isc_socket_t *sock, isc_boolean_t yes);
 	isc_result_t    (*fdwatchpoke)(isc_socket_t *sock, int flags);
-	isc_result_t		(*dup)(isc_socket_t *socket,
+	isc_result_t		(*dup)(isc_socket_t *sock,
 				  isc_socket_t **socketp);
-	int 		(*getfd)(isc_socket_t *socket);
+	int 		(*getfd)(isc_socket_t *sock);
 } isc_socketmethods_t;
 
 /*%
@@ -1096,24 +1096,24 @@
  * \li	#ISC_R_FAILURE
  */
 
-void isc_socket_setname(isc_socket_t *socket, const char *name, void *tag);
+void isc_socket_setname(isc_socket_t *sock, const char *name, void *tag);
 /*%<
  * Set the name and optional tag for a socket.  This allows tracking of the
  * owner or purpose for this socket, and is useful for tracing and statistics
  * reporting.
  */
 
-const char *isc_socket_getname(isc_socket_t *socket);
+const char *isc_socket_getname(isc_socket_t *sock);
 /*%<
  * Get the name associated with a socket, if any.
  */
 
-void *isc_socket_gettag(isc_socket_t *socket);
+void *isc_socket_gettag(isc_socket_t *sock);
 /*%<
  * Get the tag associated with a socket, if any.
  */
 
-int isc_socket_getfd(isc_socket_t *socket);
+int isc_socket_getfd(isc_socket_t *sock);
 /*%<
  * Get the file descriptor associated with a socket
  */
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/lib/isc/inet_ntop.c /cur/src/external/bsd/ntp/dist/lib/isc/inet_ntop.c
--- external/bsd/ntp/dist/lib/isc/inet_ntop.c	2014-12-24 18:28:04.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/lib/isc/inet_ntop.c	2015-04-07 19:51:17.000000000 -0700
@@ -140,6 +140,7 @@
 		words[i / 2] |= (src[i] << ((1 - (i % 2)) << 3));
 	best.base = -1;
 	cur.base = -1;
+	best.len = cur.len = 0;
 	for (i = 0; i < (NS_IN6ADDRSZ / NS_INT16SZ); i++) {
 		if (words[i] == 0) {
 			if (cur.base == -1)
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/lib/isc/log.c /cur/src/external/bsd/ntp/dist/lib/isc/log.c
--- external/bsd/ntp/dist/lib/isc/log.c	2014-12-24 18:28:04.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/lib/isc/log.c	2015-04-07 19:51:17.000000000 -0700
@@ -1145,7 +1145,7 @@
 static isc_result_t
 greatest_version(isc_logchannel_t *channel, int *greatestp) {
 	/* XXXDCL HIGHLY NT */
-	char *basename, *digit_end;
+	char *basenam, *digit_end;
 	const char *dirname;
 	int version, greatest = -1;
 	unsigned int basenamelen;
@@ -1162,23 +1162,23 @@
 	 * It is safe to DE_CONST the file.name because it was copied
 	 * with isc_mem_strdup in isc_log_createchannel.
 	 */
-	basename = strrchr(FILE_NAME(channel), sep);
+	basenam = strrchr(FILE_NAME(channel), sep);
 #ifdef _WIN32
 	basename2 = strrchr(FILE_NAME(channel), '\\');
-	if ((basename != NULL && basename2 != NULL && basename2 > basename) ||
-	    (basename == NULL && basename2 != NULL)) {
-		basename = basename2;
+	if ((basenam != NULL && basename2 != NULL && basename2 > basenam) ||
+	    (basenam == NULL && basename2 != NULL)) {
+		basenam = basename2;
 		sep = '\\';
 	}
 #endif
-	if (basename != NULL) {
-		*basename++ = '\0';
+	if (basenam != NULL) {
+		*basenam++ = '\0';
 		dirname = FILE_NAME(channel);
 	} else {
-		DE_CONST(FILE_NAME(channel), basename);
+		DE_CONST(FILE_NAME(channel), basenam);
 		dirname = ".";
 	}
-	basenamelen = strlen(basename);
+	basenamelen = strlen(basenam);
 
 	isc_dir_init(&dir);
 	result = isc_dir_open(&dir, dirname);
@@ -1186,8 +1186,8 @@
 	/*
 	 * Replace the file separator if it was taken out.
 	 */
-	if (basename != FILE_NAME(channel))
-		*(basename - 1) = sep;
+	if (basenam != FILE_NAME(channel))
+		*(basenam - 1) = sep;
 
 	/*
 	 * Return if the directory open failed.
@@ -1197,7 +1197,7 @@
 
 	while (isc_dir_read(&dir) == ISC_R_SUCCESS) {
 		if (dir.entry.length > basenamelen &&
-		    strncmp(dir.entry.name, basename, basenamelen) == 0 &&
+		    strncmp(dir.entry.name, basenam, basenamelen) == 0 &&
 		    dir.entry.name[basenamelen] == '.') {
 
 			version = strtol(&dir.entry.name[basenamelen + 1],
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/lib/isc/result.c /cur/src/external/bsd/ntp/dist/lib/isc/result.c
--- external/bsd/ntp/dist/lib/isc/result.c	2014-12-24 18:28:04.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/lib/isc/result.c	2015-04-07 19:51:17.000000000 -0700
@@ -174,7 +174,7 @@
 isc_result_totext(isc_result_t result) {
 	resulttable *table;
 	const char *txt, *default_text;
-	int index;
+	int idx;
 
 	initialize();
 
@@ -185,15 +185,15 @@
 	     table != NULL;
 	     table = ISC_LIST_NEXT(table, link)) {
 		if (result >= table->base && result <= table->last) {
-			index = (int)(result - table->base);
-			default_text = table->text[index];
+			idx = (int)(result - table->base);
+			default_text = table->text[idx];
 			/*
-			 * Note: we use 'index + 1' as the message number
-			 * instead of index because isc_msgcat_get() requires
+			 * Note: we use 'idx + 1' as the message number
+			 * instead of idx because isc_msgcat_get() requires
 			 * the message number to be > 0.
 			 */
 			txt = isc_msgcat_get(table->msgcat, table->set,
-					     index + 1, default_text);
+					     idx + 1, default_text);
 			break;
 		}
 	}
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/lib/isc/unix/file.c /cur/src/external/bsd/ntp/dist/lib/isc/unix/file.c
--- external/bsd/ntp/dist/lib/isc/unix/file.c	2014-12-24 18:28:07.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/lib/isc/unix/file.c	2015-04-07 19:51:17.000000000 -0700
@@ -510,7 +510,7 @@
 }
 
 isc_result_t
-isc_file_splitpath(isc_mem_t *mctx, char *path, char **dirname, char **basename)
+isc_file_splitpath(isc_mem_t *mctx, char *path, char **dirnam, char **basenam)
 {
 	char *dir, *file, *slash;
 
@@ -539,8 +539,8 @@
 		return (ISC_R_INVALIDFILE);
 	}
 
-	*dirname = dir;
-	*basename = file;
+	*dirnam = dir;
+	*basenam = file;
 
 	return (ISC_R_SUCCESS);
 }
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/lib/isc/unix/ifiter_getifaddrs.c /cur/src/external/bsd/ntp/dist/lib/isc/unix/ifiter_getifaddrs.c
--- external/bsd/ntp/dist/lib/isc/unix/ifiter_getifaddrs.c	2014-12-24 18:28:07.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/lib/isc/unix/ifiter_getifaddrs.c	2015-04-07 19:51:17.000000000 -0700
@@ -214,6 +214,9 @@
 		get_addr(family, &iter->current.broadcast, ifa->ifa_broadaddr,
 			 ifa->ifa_name);
 
+#ifdef ISC_PLATFORM_HAVEIFNAMETOINDEX
+	iter->current.ifindex = if_nametoindex(iter->current.name);
+#endif
 	return (ISC_R_SUCCESS);
 }
 
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/lib/isc/unix/ifiter_ioctl.c /cur/src/external/bsd/ntp/dist/lib/isc/unix/ifiter_ioctl.c
--- external/bsd/ntp/dist/lib/isc/unix/ifiter_ioctl.c	2014-12-24 18:28:07.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/lib/isc/unix/ifiter_ioctl.c	2015-04-07 19:51:17.000000000 -0700
@@ -111,6 +111,10 @@
 #endif
 #endif
 
+/* Silence a warning when this file is #included */
+int
+isc_ioctl(int fildes, int req, char *arg);
+
 int
 isc_ioctl(int fildes, int req, char *arg) {
 	int trys;
@@ -590,6 +594,9 @@
 		}
 		iter->current.netmask.type.in6.s6_addr[i] = (~0 << bits) & 0xff;
 	}
+#ifdef ISC_PLATFORM_HAVEIFNAMETOINDEX
+	iter->current.ifindex = if_nametoindex(iter->current.name);
+#endif
 	return (ISC_R_SUCCESS);
 
  inet:
@@ -666,6 +673,9 @@
 	}
 	get_addr(family, &iter->current.netmask,
 		 (struct sockaddr *)&ifreq.ifr_addr, ifreq.ifr_name);
+#ifdef ISC_PLATFORM_HAVEIFNAMETOINDEX
+	iter->current.ifindex = if_nametoindex(iter->current.name);
+#endif
 	return (ISC_R_SUCCESS);
 }
 
@@ -706,7 +716,6 @@
 	get_addr(family, &iter->current.address,
 		 (struct sockaddr *)&lifreq.lifr_addr, lifreq.lifr_name);
 
-	iter->current.ifindex = lifreq.lifr_index;
 	if (isc_netaddr_islinklocal(&iter->current.address))
 		isc_netaddr_setzone(&iter->current.address, 
 				    (isc_uint32_t)lifreq.lifr_index);
@@ -846,7 +855,9 @@
 			iter->current.netmask.type.in6.s6_addr[i / 8] =
 				(~0 << bits) & 0xff;
 		}
-
+#ifdef ISC_PLATFORM_HAVEIFNAMETOINDEX
+		iter->current.ifindex = if_nametoindex(iter->current.name);
+#endif
 		return (ISC_R_SUCCESS);
 	}
 #endif
@@ -869,6 +880,9 @@
 	get_addr(family, &iter->current.netmask,
 		 (struct sockaddr *)&lifreq.lifr_addr, lifreq.lifr_name);
 
+#ifdef ISC_PLATFORM_HAVEIFNAMETOINDEX
+	iter->current.ifindex = if_nametoindex(iter->current.name);
+#endif
 	return (ISC_R_SUCCESS);
 }
 #endif
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/lib/isc/unix/net.c /cur/src/external/bsd/ntp/dist/lib/isc/unix/net.c
--- external/bsd/ntp/dist/lib/isc/unix/net.c	2014-12-24 18:28:07.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/lib/isc/unix/net.c	2015-04-07 19:51:17.000000000 -0700
@@ -107,7 +107,8 @@
 # if defined(WANT_IPV6)
 static isc_once_t 	once_ipv6only = ISC_ONCE_INIT;
 
-# if defined(ISC_PLATFORM_HAVEIN6PKTINFO)
+# if defined(ISC_PLATFORM_HAVEIPV6) && \
+     defined(WANT_IPV6) && defined(ISC_PLATFORM_HAVEIN6PKTINFO)
 static isc_once_t 	once_ipv6pktinfo = ISC_ONCE_INIT;
 # endif
 # endif
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/libjsmn/jsmn.c /cur/src/external/bsd/ntp/dist/libjsmn/jsmn.c
--- external/bsd/ntp/dist/libjsmn/jsmn.c	2014-12-24 18:28:08.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/libjsmn/jsmn.c	2015-04-07 19:51:17.000000000 -0700
@@ -110,6 +110,8 @@
 
 		/* Backslash: Quoted symbol expected */
 		if (c == '\\') {
+			int i = 0;
+
 			parser->pos++;
 			switch (js[parser->pos]) {
 				/* Allowed escaped symbols */
@@ -119,7 +121,6 @@
 				/* Allows escaped symbol \uXXXX */
 				case 'u':
 					parser->pos++;
-					int i = 0;
 					for(; i < 4 && js[parser->pos] != '\0'; i++) {
 						/* If it isn't a hex character we have an error */
 						if(!((js[parser->pos] >= 48 && js[parser->pos] <= 57) || /* 0-9 */
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/libntp/Makefile.in /cur/src/external/bsd/ntp/dist/libntp/Makefile.in
--- external/bsd/ntp/dist/libntp/Makefile.in	2014-12-19 12:37:39.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/libntp/Makefile.in	2015-04-07 19:51:17.000000000 -0700
@@ -41,8 +41,7 @@
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
 	$(top_srcdir)/sntp/libopts/m4/stdnoreturn.m4 \
-	$(top_srcdir)/sntp/libevent/m4/openldap-thread-check.m4 \
-	$(top_srcdir)/sntp/libevent/m4/openldap.m4 \
+	$(top_srcdir)/sntp/m4/ax_c99_struct_init.m4 \
 	$(top_srcdir)/sntp/m4/define_dir.m4 \
 	$(top_srcdir)/sntp/m4/hms_search_lib.m4 \
 	$(top_srcdir)/sntp/m4/libtool.m4 \
@@ -71,6 +70,8 @@
 	$(top_srcdir)/sntp/m4/ntp_sntp.m4 \
 	$(top_srcdir)/sntp/m4/ntp_ver_suffix.m4 \
 	$(top_srcdir)/sntp/m4/ntp_vpathhack.m4 \
+	$(top_srcdir)/sntp/m4/openldap-thread-check.m4 \
+	$(top_srcdir)/sntp/m4/openldap.m4 \
 	$(top_srcdir)/sntp/m4/os_cflags.m4 \
 	$(top_srcdir)/sntp/m4/snprintf.m4 \
 	$(top_srcdir)/sntp/m4/version.m4 $(top_srcdir)/configure.ac
@@ -268,6 +269,7 @@
 CONFIG_SHELL = @CONFIG_SHELL@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
+CPPFLAGS_LIBEVENT = @CPPFLAGS_LIBEVENT@
 CPPFLAGS_NTP = @CPPFLAGS_NTP@
 CXX = @CXX@
 CXXCPP = @CXXCPP@
@@ -302,7 +304,9 @@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 LD = @LD@
+LDADD_LIBEVENT = @LDADD_LIBEVENT@
 LDADD_LIBNTP = @LDADD_LIBNTP@
+LDADD_LIBUTIL = @LDADD_LIBUTIL@
 LDADD_NLIST = @LDADD_NLIST@
 LDADD_NTP = @LDADD_NTP@
 LDFLAGS = @LDFLAGS@
@@ -441,6 +445,11 @@
 TIMETRIM_DS = @TIMETRIM_DS@
 TIMETRIM_MS = @TIMETRIM_MS@
 TIMETRIM_NI = @TIMETRIM_NI@
+UPDATE_LEAP_DB = @UPDATE_LEAP_DB@
+UPDATE_LEAP_DL = @UPDATE_LEAP_DL@
+UPDATE_LEAP_DS = @UPDATE_LEAP_DS@
+UPDATE_LEAP_MS = @UPDATE_LEAP_MS@
+UPDATE_LEAP_NI = @UPDATE_LEAP_NI@
 VERSION = @VERSION@
 VER_SUFFIX = @VER_SUFFIX@
 YACC = @YACC@
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/libntp/audio.c /cur/src/external/bsd/ntp/dist/libntp/audio.c
--- external/bsd/ntp/dist/libntp/audio.c	2014-12-24 18:28:08.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/libntp/audio.c	2015-04-07 19:51:17.000000000 -0700
@@ -69,7 +69,7 @@
 static int ctl_fd;		/* audio control file descriptor */
 
 #ifdef PCM_STYLE_SOUND
-static void audio_config_read (int, char **, char **);
+static void audio_config_read (int, const char **, const char **);
 static int  mixer_name (const char *, int);
 
 
@@ -116,8 +116,8 @@
 static void
 audio_config_read(
 	int unit,
-	char **c_dev,	/* Control device */
-	char **i_dev	/* input device */
+	const char **c_dev,	/* Control device */
+	const char **i_dev	/* input device */
 	)
 {
 	FILE *fd;
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/libntp/ntp_calendar.c /cur/src/external/bsd/ntp/dist/libntp/ntp_calendar.c
--- external/bsd/ntp/dist/libntp/ntp_calendar.c	2014-12-24 18:28:08.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/libntp/ntp_calendar.c	2015-04-07 19:51:17.000000000 -0700
@@ -31,7 +31,7 @@
 	)
 {
 	systime_func_ptr res;
-	
+
 	res = systime_func;
 	if (NULL == nfunc)
 		nfunc = &time;
@@ -120,7 +120,7 @@
 #endif
 
 	return res;
-} 
+}
 
 /*
  *---------------------------------------------------------------------
@@ -172,7 +172,7 @@
 #ifdef DEBUG
 	static int        ignore  = 0;
 #endif
-	
+
 	ZERO(*jd);
 	jd->year     = 1970;
 	jd->month    = 1;
@@ -257,7 +257,7 @@
  * in the proleptic Gregorian calendar. The begin of the Christian Era
  * (0001-01-01) is RD(1).
  *
- * 
+ *
  * Some notes on the implementation:
  *
  * Calendar algorithms thrive on the division operation, which is one of
@@ -353,7 +353,7 @@
 	char	 cpl = 0; /* modulo complement flag */
 	char	 neg = 0; /* sign change flag	    */
 
-	/* make the cycle positive and adjust the flags */ 
+	/* make the cycle positive and adjust the flags */
 	if (cycle < 0) {
 		cycle = - cycle;
 		neg ^= 1;
@@ -409,21 +409,21 @@
 
 #ifdef HAVE_INT64
 
-	res.q_s = (pivot != NULL) 
+	res.q_s = (pivot != NULL)
 		      ? *pivot
-		      : now();	
+		      : now();
 	res.Q_s -= 0x80000000;		/* unshift of half range */
 	ntp	-= (uint32_t)JAN_1970;	/* warp into UN*X domain */
 	ntp	-= res.D_s.lo;		/* cycle difference	 */
 	res.Q_s += (uint64_t)ntp;	/* get expanded time	 */
 
 #else /* no 64bit scalars */
-	
+
 	time_t tmp;
-	
-	tmp = (pivot != NULL) 
+
+	tmp = (pivot != NULL)
 		  ? *pivot
-		  : now();	
+		  : now();
 	res = time_to_vint64(&tmp);
 	M_SUB(res.D_s.hi, res.D_s.lo, 0, 0x80000000);
 	ntp -= (uint32_t)JAN_1970;	/* warp into UN*X domain */
@@ -467,9 +467,9 @@
 	res.Q_s += (uint64_t)ntp;	/* get expanded time	 */
 
 #else /* no 64bit scalars */
-	
+
 	time_t tmp;
-	
+
 	tmp = (pivot)
 		  ? *pivot
 		  : now();
@@ -494,7 +494,7 @@
  */
 
 /*
- *------------------------------------------------------------------- 
+ *-------------------------------------------------------------------
  * Split a 64bit seconds value into elapsed days in 'res.hi' and
  * elapsed seconds since midnight in 'res.lo' using explicit floor
  * division. This function happily accepts negative time values as
@@ -534,7 +534,7 @@
 	isneg = M_ISNEG(op.D_s.hi);
 	if (isneg)
 		M_NEG(op.D_s.hi, op.D_s.lo);
-		
+
 	/* save remainder of DIV 128, shift for divide */
 	r  = op.D_s.lo & 127; /* save remainder bits */
 	op.D_s.lo = (op.D_s.lo >> 7) | (op.D_s.hi << 25);
@@ -574,16 +574,16 @@
 		} else
 			q = ~q + 1;
 	}
-	
+
 	res.hi = q;
 	res.lo = r;
 
-#endif	
+#endif
 	return res;
 }
 
 /*
- *------------------------------------------------------------------- 
+ *-------------------------------------------------------------------
  * Split a 32bit seconds value into h/m/s and excessive days.  This
  * function happily accepts negative time values as timestamps before
  * midnight.
@@ -634,7 +634,7 @@
 {
 	ntpcal_split res;
 	int32_t	     n400, n100, n004, n001, yday; /* calendar year cycles */
-	
+
 	/*
 	 * Split off calendar cycles, using floor division in the first
 	 * step. After that first step, simple division does it because
@@ -654,7 +654,7 @@
 	yday = yday % GREGORIAN_NORMAL_LEAP_CYCLE_DAYS;
 	n001 = yday / DAYSPERYEAR;
 	yday = yday % DAYSPERYEAR;
-	
+
 	/*
 	 * check for leap cycle overflows and calculate the leap flag
 	 * if needed
@@ -667,11 +667,11 @@
 			*isleapyear = 1;
 	} else if (isleapyear)
 		*isleapyear = (n001 == 3) && ((n004 != 24) || (n100 == 3));
-	
+
 	/* now merge the cycles to elapsed years, using horner scheme */
 	res.hi = ((4*n400 + n100)*25 + n004)*4 + n001;
 	res.lo = yday;
-	
+
 	return res;
 }
 
@@ -726,7 +726,13 @@
 
 	leaps = 0;
 	retv = 0;
-	/* get day-of-week first */
+	/* Get day-of-week first. Since rd is signed, the remainder can
+	 * be in the range [-6..+6], but the assignment to an unsigned
+	 * variable maps the negative values to positive values >=7.
+	 * This makes the sign correction look strange, but adding 7
+	 * causes the needed wrap-around into the desired value range of
+	 * zero to six, both inclusive.
+	 */
 	jd->weekday = rd % 7;
 	if (jd->weekday >= 7)	/* unsigned! */
 		jd->weekday += 7;
@@ -796,7 +802,7 @@
 {
 	int32_t days;
 	int   ts[3];
-	
+
 	days = priv_timesplit(ts, sec);
 	jd->hour   = (uint8_t)ts[0];
 	jd->minute = (uint8_t)ts[1];
@@ -819,7 +825,7 @@
 {
 	int32_t days;
 	int32_t ts[3];
-	
+
 	days = priv_timesplit(ts, sec);
 	utm->tm_hour = ts[0];
 	utm->tm_min  = ts[1];
@@ -948,7 +954,7 @@
 	/* fix sign */
 	if (isneg)
 		M_NEG(res.D_s.hi, res.D_s.lo);
-	
+
 	/* properly add seconds */
 	p2 = 0;
 	if (secs < 0) {
@@ -959,7 +965,7 @@
 	}
 	M_ADD(res.D_s.hi, res.D_s.lo, p2, p1);
 
-#endif	
+#endif
 
 	return res;
 }
@@ -1281,7 +1287,7 @@
 	)
 {
 	ntpcal_split ds;
-	
+
 	ds = ntpcal_daysplit(ntp);
 	ds.hi += ntpcal_daysec_to_date(jd, ds.lo);
 
@@ -1296,7 +1302,7 @@
 	)
 {
 	vint64	ntp64;
-	
+
 	/*
 	 * Unfold ntp time around current time into NTP domain. Split
 	 * into days and seconds, shift days into CE domain and
@@ -1518,12 +1524,12 @@
 	res.lo += (res.lo >= 10435);
 	cents	= res.lo / 5218;
 	res.lo %= 5218;		/* res.lo is weeks in century now */
-	
+
 	/* convert elapsed weeks in century to elapsed years and weeks */
 	res.lo	= res.lo * 157 + bctab[cents];
 	res.hi += cents * 100 + res.lo / 8192;
-	res.lo	= (res.lo % 8192) / 157;	
-	
+	res.lo	= (res.lo % 8192) / 157;
+
 	return res;
 }
 
@@ -1540,7 +1546,7 @@
 {
 	ntpcal_split ds;
 	int32_t      ts[3];
-	
+
 	/*
 	 * Split NTP time into days and seconds, shift days into CE
 	 * domain and process the parts.
@@ -1578,7 +1584,7 @@
 	)
 {
 	vint64	ntp64;
-	
+
 	/*
 	 * Unfold ntp time around current time into NTP domain, then
 	 * convert the full time stamp.
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/libntp/ntp_crypto_rnd.c /cur/src/external/bsd/ntp/dist/libntp/ntp_crypto_rnd.c
--- external/bsd/ntp/dist/libntp/ntp_crypto_rnd.c	2014-12-24 18:28:08.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/libntp/ntp_crypto_rnd.c	2015-04-07 19:51:17.000000000 -0700
@@ -24,6 +24,22 @@
 #include <openssl/rand.h>
 
 int crypto_rand_init = 0;
+#else
+
+# ifndef HAVE_ARC4RANDOM_BUF
+static void
+arc4random_buf(void *buf, size_t nbytes);
+
+void
+evutil_secure_rng_get_bytes(void *buf, size_t nbytes);
+
+static void
+arc4random_buf(void *buf, size_t nbytes)
+{
+	evutil_secure_rng_get_bytes(buf, nbytes);
+	return;
+}
+# endif
 #endif
 
 /*
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/libntp/work_fork.c /cur/src/external/bsd/ntp/dist/libntp/work_fork.c
--- external/bsd/ntp/dist/libntp/work_fork.c	2014-12-24 18:28:08.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/libntp/work_fork.c	2015-04-07 19:51:17.000000000 -0700
@@ -384,7 +384,7 @@
 	int		rc;
 	int		was_pipe;
 	int		is_pipe;
-	int		saved_errno;
+	int		saved_errno = 0;
 	int		childpid;
 	int		keep_fd;
 	int		fd;
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/libparse/Makefile.am /cur/src/external/bsd/ntp/dist/libparse/Makefile.am
--- external/bsd/ntp/dist/libparse/Makefile.am	2013-12-27 15:30:49.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/libparse/Makefile.am	2015-04-07 19:51:17.000000000 -0700
@@ -1,5 +1,5 @@
 NULL=
-BUILT_SOURCES =
+BUILT_SOURCES = $(VPHACK) info_trimble.c $(VPHACK_AFTER)
 CLEANFILES =
 noinst_LIBRARIES = @MAKE_LIBPARSE@ @MAKE_LIBPARSE_KERNEL@
 EXTRA_LIBRARIES = libparse.a libparse_kernel.a
@@ -12,6 +12,29 @@
 # previously.  It is located in $(srcdir) and any updates must
 # end up there.
 
+#
+# VPHACK and VPHACK_AFTER are enabled on non-GNU makes (such as
+# BSD make) to work around build/dependency issues where we want
+# built source files to live in srcdir, as opposed to builddir.
+#
+
+if VPATH_HACK
+VPHACK=	vphack
+VPHACK_AFTER= vphack_after
+else
+VPHACK=
+VPHACK_AFTER=
+endif
+
+vphack:
+	test -e info_trimble.c || ln -s $(srcdir)/info_trimble.c .
+
+vphack_after:
+	test -L info_trimble.c || ( \
+		mv info_trimble.c $(srcdir)/info_trimble.c && \
+		ln -s $(srcdir)/info_trimble.c . \
+		)
+
 libparse_a_SOURCES = parse.c \
 		     parse_conf.c \
 		     clk_meinberg.c \
@@ -65,11 +88,16 @@
 
 EXTRA_DIST = parsesolaris.c parsestreams.c mkinfo_scmd.sed mkinfo_rcmd.sed info_trimble.c
 
-$(srcdir)/info_trimble.c: $(top_srcdir)/include/trimble.h $(srcdir)/Makefile.am $(srcdir)/mkinfo_scmd.sed $(srcdir)/mkinfo_rcmd.sed
+info_trimble.c: $(top_srcdir)/include/trimble.h $(srcdir)/Makefile.am $(srcdir)/mkinfo_scmd.sed $(srcdir)/mkinfo_rcmd.sed
 	sed -n -f $(srcdir)/mkinfo_scmd.sed $(top_srcdir)/include/trimble.h  > info_trimble.new
 	sed -n -f $(srcdir)/mkinfo_rcmd.sed $(top_srcdir)/include/trimble.h >> info_trimble.new
 	mv -f info_trimble.new $@
 
+#$(srcdir)/info_trimble.c: $(top_srcdir)/include/trimble.h $(srcdir)/Makefile.am $(srcdir)/mkinfo_scmd.sed $(srcdir)/mkinfo_rcmd.sed
+#	sed -n -f $(srcdir)/mkinfo_scmd.sed $(top_srcdir)/include/trimble.h  > info_trimble.new
+#	sed -n -f $(srcdir)/mkinfo_rcmd.sed $(top_srcdir)/include/trimble.h >> info_trimble.new
+#	mv -f info_trimble.new $@
+
 kieee754io.o: $(srcdir)/ieee754io.c
 	 $(COMPILE) $(K_CFLAGS) -c $(srcdir)/ieee754io.c -o $@
 
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/libparse/Makefile.in /cur/src/external/bsd/ntp/dist/libparse/Makefile.in
--- external/bsd/ntp/dist/libparse/Makefile.in	2014-12-19 12:37:39.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/libparse/Makefile.in	2015-04-07 19:51:17.000000000 -0700
@@ -43,8 +43,7 @@
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
 	$(top_srcdir)/sntp/libopts/m4/stdnoreturn.m4 \
-	$(top_srcdir)/sntp/libevent/m4/openldap-thread-check.m4 \
-	$(top_srcdir)/sntp/libevent/m4/openldap.m4 \
+	$(top_srcdir)/sntp/m4/ax_c99_struct_init.m4 \
 	$(top_srcdir)/sntp/m4/define_dir.m4 \
 	$(top_srcdir)/sntp/m4/hms_search_lib.m4 \
 	$(top_srcdir)/sntp/m4/libtool.m4 \
@@ -73,6 +72,8 @@
 	$(top_srcdir)/sntp/m4/ntp_sntp.m4 \
 	$(top_srcdir)/sntp/m4/ntp_ver_suffix.m4 \
 	$(top_srcdir)/sntp/m4/ntp_vpathhack.m4 \
+	$(top_srcdir)/sntp/m4/openldap-thread-check.m4 \
+	$(top_srcdir)/sntp/m4/openldap.m4 \
 	$(top_srcdir)/sntp/m4/os_cflags.m4 \
 	$(top_srcdir)/sntp/m4/snprintf.m4 \
 	$(top_srcdir)/sntp/m4/version.m4 $(top_srcdir)/configure.ac
@@ -176,6 +177,7 @@
 CONFIG_SHELL = @CONFIG_SHELL@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
+CPPFLAGS_LIBEVENT = @CPPFLAGS_LIBEVENT@
 CPPFLAGS_NTP = @CPPFLAGS_NTP@
 CXX = @CXX@
 CXXCPP = @CXXCPP@
@@ -210,7 +212,9 @@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 LD = @LD@
+LDADD_LIBEVENT = @LDADD_LIBEVENT@
 LDADD_LIBNTP = @LDADD_LIBNTP@
+LDADD_LIBUTIL = @LDADD_LIBUTIL@
 LDADD_NLIST = @LDADD_NLIST@
 LDADD_NTP = @LDADD_NTP@
 LDFLAGS = @LDFLAGS@
@@ -349,6 +353,11 @@
 TIMETRIM_DS = @TIMETRIM_DS@
 TIMETRIM_MS = @TIMETRIM_MS@
 TIMETRIM_NI = @TIMETRIM_NI@
+UPDATE_LEAP_DB = @UPDATE_LEAP_DB@
+UPDATE_LEAP_DL = @UPDATE_LEAP_DL@
+UPDATE_LEAP_DS = @UPDATE_LEAP_DS@
+UPDATE_LEAP_MS = @UPDATE_LEAP_MS@
+UPDATE_LEAP_NI = @UPDATE_LEAP_NI@
 VERSION = @VERSION@
 VER_SUFFIX = @VER_SUFFIX@
 YACC = @YACC@
@@ -408,16 +417,27 @@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 NULL = 
-BUILT_SOURCES = check-libntp .deps-ver
+BUILT_SOURCES = $(VPHACK) info_trimble.c $(VPHACK_AFTER) check-libntp \
+	.deps-ver
 CLEANFILES = check-libntp .deps-ver
 noinst_LIBRARIES = @MAKE_LIBPARSE@ @MAKE_LIBPARSE_KERNEL@
 EXTRA_LIBRARIES = libparse.a libparse_kernel.a
 noinst_PROGRAMS = @MAKE_PARSEKMODULE@
 K_CFLAGS = -DPARSESTREAM -DNTP_NEED_BOPS
+@VPATH_HACK_FALSE@VPHACK = 
 
 # info_trimble.c was mistakenly created in the build directory
 # previously.  It is located in $(srcdir) and any updates must
 # end up there.
+
+#
+# VPHACK and VPHACK_AFTER are enabled on non-GNU makes (such as
+# BSD make) to work around build/dependency issues where we want
+# built source files to live in srcdir, as opposed to builddir.
+#
+@VPATH_HACK_TRUE@VPHACK = vphack
+@VPATH_HACK_FALSE@VPHACK_AFTER = 
+@VPATH_HACK_TRUE@VPHACK_AFTER = vphack_after
 libparse_a_SOURCES = parse.c \
 		     parse_conf.c \
 		     clk_meinberg.c \
@@ -794,11 +814,25 @@
 	tags uninstall uninstall-am
 
 
-$(srcdir)/info_trimble.c: $(top_srcdir)/include/trimble.h $(srcdir)/Makefile.am $(srcdir)/mkinfo_scmd.sed $(srcdir)/mkinfo_rcmd.sed
+vphack:
+	test -e info_trimble.c || ln -s $(srcdir)/info_trimble.c .
+
+vphack_after:
+	test -L info_trimble.c || ( \
+		mv info_trimble.c $(srcdir)/info_trimble.c && \
+		ln -s $(srcdir)/info_trimble.c . \
+		)
+
+info_trimble.c: $(top_srcdir)/include/trimble.h $(srcdir)/Makefile.am $(srcdir)/mkinfo_scmd.sed $(srcdir)/mkinfo_rcmd.sed
 	sed -n -f $(srcdir)/mkinfo_scmd.sed $(top_srcdir)/include/trimble.h  > info_trimble.new
 	sed -n -f $(srcdir)/mkinfo_rcmd.sed $(top_srcdir)/include/trimble.h >> info_trimble.new
 	mv -f info_trimble.new $@
 
+#$(srcdir)/info_trimble.c: $(top_srcdir)/include/trimble.h $(srcdir)/Makefile.am $(srcdir)/mkinfo_scmd.sed $(srcdir)/mkinfo_rcmd.sed
+#	sed -n -f $(srcdir)/mkinfo_scmd.sed $(top_srcdir)/include/trimble.h  > info_trimble.new
+#	sed -n -f $(srcdir)/mkinfo_rcmd.sed $(top_srcdir)/include/trimble.h >> info_trimble.new
+#	mv -f info_trimble.new $@
+
 kieee754io.o: $(srcdir)/ieee754io.c
 	 $(COMPILE) $(K_CFLAGS) -c $(srcdir)/ieee754io.c -o $@
 
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/libparse/clk_computime.c /cur/src/external/bsd/ntp/dist/libparse/clk_computime.c
--- external/bsd/ntp/dist/libparse/clk_computime.c	2014-12-24 18:28:09.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/libparse/clk_computime.c	2015-04-07 19:51:17.000000000 -0700
@@ -9,15 +9,15 @@
  * /src/NTP/ntp4-dev/libparse/clk_computime.c,v 4.10 2005/04/16 17:32:10 kardel RELEASE_20050508_A
  *
  * clk_computime.c,v 4.10 2005/04/16 17:32:10 kardel RELEASE_20050508_A
- * 
+ *
  * Supports Diem's Computime Radio Clock
- * 
+ *
  * Used the Meinberg clock as a template for Diem's Computime Radio Clock
  *
  * adapted by Alois Camenzind <alois.camenzind@ubs.ch>
- * 
+ *
  * Copyright (c) 1995-2005 by Frank Kardel <kardel <AT> ntp.org>
- * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universität Erlangen-Nürnberg, Germany
+ * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universitaet Erlangen-Nuernberg, Germany
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -61,22 +61,22 @@
 
 /*
  * The Computime receiver sends a datagram in the following format every minute
- * 
- * Timestamp	T:YY:MM:MD:WD:HH:MM:SSCRLF 
+ *
+ * Timestamp	T:YY:MM:MD:WD:HH:MM:SSCRLF
  * Pos          0123456789012345678901 2 3
  *              0000000000111111111122 2 2
  * Parse        T:  :  :  :  :  :  :  rn
- * 
- * T	Startcharacter "T" specifies start of the timestamp 
- * YY	Year MM	Month 1-12 
- * MD	Day of the month 
- * WD	Day of week 
- * HH	Hour 
- * MM   Minute 
+ *
+ * T	Startcharacter "T" specifies start of the timestamp
+ * YY	Year MM	Month 1-12
+ * MD	Day of the month
+ * WD	Day of week
+ * HH	Hour
+ * MM   Minute
  * SS   Second
- * CR   Carriage return 
+ * CR   Carriage return
  * LF   Linefeed
- * 
+ *
  */
 
 static struct format computime_fmt =
@@ -90,10 +90,10 @@
 	0
 };
 
-static u_long cvt_computime (unsigned char *, int, struct format *, clocktime_t *, void *);
-static unsigned long inp_computime (parse_t *, unsigned int, timestamp_t *);
+static parse_cvt_fnc_t cvt_computime;
+static parse_inp_fnc_t inp_computime;
 
-clockformat_t   clock_computime =
+clockformat_t clock_computime =
 {
 	inp_computime,		/* Computime input handling */
 	cvt_computime,		/* Computime conversion */
@@ -101,15 +101,15 @@
 	(void *)&computime_fmt,	/* conversion configuration */
 	"Diem's Computime Radio Clock",	/* Computime Radio Clock */
 	24,			/* string buffer */
-	0			/* no private data (complete pakets) */
+	0			/* no private data (complete packets) */
 };
 
 /*
- * cvt_computime
- * 
+ * parse_cvt_fnc_t cvt_computime
+ *
  * convert simple type format
  */
-static          u_long
+static u_long
 cvt_computime(
 	unsigned char *buffer,
 	int            size,
@@ -119,7 +119,7 @@
 	)
 {
 
-	if (!Strok(buffer, format->fixed_string)) { 
+	if (!Strok(buffer, format->fixed_string)) {
 		return CVT_NONE;
 	} else {
 		if (Stoi(&buffer[format->field_offsets[O_DAY].offset], &clock_time->day,
@@ -133,7 +133,7 @@
 		    Stoi(&buffer[format->field_offsets[O_MIN].offset], &clock_time->minute,
 			 format->field_offsets[O_MIN].length) ||
 		    Stoi(&buffer[format->field_offsets[O_SEC].offset], &clock_time->second,
-			 format->field_offsets[O_SEC].length)) { 
+			 format->field_offsets[O_SEC].length)) {
 			return CVT_FAIL | CVT_BADFMT;
 		} else {
 
@@ -146,31 +146,31 @@
 }
 
 /*
- * inp_computime
+ * parse_inp_fnc_t inp_computime
  *
- * grep data from input stream
+ * grab data from input stream
  */
 static u_long
 inp_computime(
 	      parse_t      *parseio,
-	      unsigned int  ch,
+	      char         ch,
 	      timestamp_t  *tstamp
 	      )
 {
 	unsigned int rtc;
-	
+
 	parseprintf(DD_PARSE, ("inp_computime(0x%lx, 0x%x, ...)\n", (long)parseio, ch));
-	
+
 	switch (ch)
 	{
 	case 'T':
 		parseprintf(DD_PARSE, ("inp_computime: START seen\n"));
-		
+
 		parseio->parse_index = 1;
 		parseio->parse_data[0] = ch;
 		parseio->parse_dtime.parse_stime = *tstamp; /* collect timestamp */
 		return PARSE_INP_SKIP;
-	  
+
 	case '\n':
 		parseprintf(DD_PARSE, ("inp_computime: END seen\n"));
 		if ((rtc = parse_addchar(parseio, ch)) == PARSE_INP_SKIP)
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/libparse/clk_dcf7000.c /cur/src/external/bsd/ntp/dist/libparse/clk_dcf7000.c
--- external/bsd/ntp/dist/libparse/clk_dcf7000.c	2014-12-24 18:28:09.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/libparse/clk_dcf7000.c	2015-04-07 19:51:17.000000000 -0700
@@ -2,13 +2,13 @@
 
 /*
  * /src/NTP/ntp4-dev/libparse/clk_dcf7000.c,v 4.10 2005/04/16 17:32:10 kardel RELEASE_20050508_A
- *  
+ *
  * clk_dcf7000.c,v 4.10 2005/04/16 17:32:10 kardel RELEASE_20050508_A
  *
  * ELV DCF7000 module
  *
  * Copyright (c) 1995-2005 by Frank Kardel <kardel <AT> ntp.org>
- * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universität Erlangen-Nürnberg, Germany
+ * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universitaet Erlangen-Nuernberg, Germany
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -65,9 +65,10 @@
 	},
 	(const unsigned char *)"  -  -  -  -  -  -  -  \r",
 	0
-};    
-static u_long cvt_dcf7000 (unsigned char *, int, struct format *, clocktime_t *, void *);
-static unsigned long inp_dcf7000 (parse_t *, unsigned int, timestamp_t *);
+};
+
+static parse_cvt_fnc_t cvt_dcf7000;
+static parse_inp_fnc_t inp_dcf7000;
 
 clockformat_t clock_dcf7000 =
 {
@@ -77,11 +78,11 @@
   (void *)&dcf7000_fmt,		/* conversion configuration */
   "ELV DCF7000",		/* ELV clock */
   24,				/* string buffer */
-  0				/* no private data (complete pakets) */
+  0				/* no private data (complete packets) */
 };
 
 /*
- * cvt_dcf7000
+ * parse_cvt_fnc_t cvt_dcf7000
  *
  * convert dcf7000 type format
  */
@@ -119,7 +120,7 @@
 		{
 			unsigned char *f = &buffer[format->field_offsets[O_FLAGS].offset];
 			long flags;
-	  
+
 			clock_time->flags = 0;
 			clock_time->usecond = 0;
 
@@ -146,21 +147,21 @@
 }
 
 /*
- * inp_dcf700
+ * parse_inp_fnc_t inp_dcf700
  *
- * grep data from input stream
+ * grab data from input stream
  */
 static u_long
 inp_dcf7000(
 	  parse_t      *parseio,
-	  unsigned int  ch,
+	  char         ch,
 	  timestamp_t  *tstamp
 	  )
 {
 	unsigned int rtc;
-	
+
 	parseprintf(DD_PARSE, ("inp_dcf7000(0x%lx, 0x%x, ...)\n", (long)parseio, ch));
-	
+
 	switch (ch)
 	{
 	case '\r':
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/libparse/clk_hopf6021.c /cur/src/external/bsd/ntp/dist/libparse/clk_hopf6021.c
--- external/bsd/ntp/dist/libparse/clk_hopf6021.c	2014-12-24 18:28:09.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/libparse/clk_hopf6021.c	2015-04-07 19:51:17.000000000 -0700
@@ -39,10 +39,10 @@
 extern int printf (const char *, ...);
 #endif
 
-/* 
- * hopf Funkuhr 6021 
+/*
+ * hopf Funkuhr 6021
  *      used with 9600,8N1,
- *      UTC ueber serielle Schnittstelle 
+ *      UTC ueber serielle Schnittstelle
  *      Sekundenvorlauf ON
  *      ETX zum Sekundenvorlauf ON
  *      Datenstring 6021
@@ -73,7 +73,7 @@
  *      x x 0 x  - Wintertime
  *      x x 1 x  - Summertime
  *      0 0 x x  - Time/Date invalid
- *      0 1 x x  - Internal clock used 
+ *      0 1 x x  - Internal clock used
  *      1 0 x x  - Radio clock
  *      1 1 x x  - Radio clock highprecision
  *
@@ -92,10 +92,10 @@
 #define HOPF_DSTWARN	0x01	/* DST switch warning */
 #define HOPF_DST	0x02	/* DST in effect */
 
-#define HOPF_MODE	0x0C	/* operation mode mask */	
+#define HOPF_MODE	0x0C	/* operation mode mask */
 #define  HOPF_INVALID	0x00	/* no time code available */
 #define  HOPF_INTERNAL	0x04	/* internal clock */
-#define  HOPF_RADIO	0x08	/* radio clock */	
+#define  HOPF_RADIO	0x08	/* radio clock */
 #define  HOPF_RADIOHP	0x0C	/* high precision radio clock */
 
 #define HOPF_UTC	0x08	/* time code in UTC */
@@ -104,13 +104,13 @@
 static struct format hopf6021_fmt =
 {
 	{
-		{  9, 2 }, {11, 2}, { 13, 2}, /* Day, Month, Year */ 
-		{  3, 2 }, { 5, 2}, {  7, 2}, /* Hour, Minute, Second */ 
+		{  9, 2 }, {11, 2}, { 13, 2}, /* Day, Month, Year */
+		{  3, 2 }, { 5, 2}, {  7, 2}, /* Hour, Minute, Second */
 		{  2, 1 }, { 1, 1}, {  0, 0}, /* Weekday, Flags, Zone */
 		/* ... */
 	},
 	(const unsigned char *)"\002              \n\r\003",
-	0 
+	0
 };
 
 #define OFFS(x) format->field_offsets[(x)].offset
@@ -120,8 +120,8 @@
 		   ('A' <= (x) && (x) <= 'F') ? (x) - 'A' + 10 : \
 		   -1)
 
-static unsigned long cvt_hopf6021 (unsigned char *, int, struct format *, clocktime_t *, void *);
-static unsigned long inp_hopf6021 (parse_t *, unsigned int, timestamp_t *);
+static parse_cvt_fnc_t cvt_hopf6021;
+static parse_inp_fnc_t inp_hopf6021;
 
 clockformat_t clock_hopf6021 =
 {
@@ -134,7 +134,8 @@
   0                            /* private data length, no private data */
 };
 
-static unsigned long
+/* parse_cvt_fnc_t cvt_hopf6021 */
+static u_long
 cvt_hopf6021(
 	     unsigned char *buffer,
 	     int            size,
@@ -164,8 +165,8 @@
 	clock_time->usecond   = 0;
 	clock_time->utcoffset = 0;
 
-	status = hexval(buffer[OFFS(O_FLAGS)]);
-	weekday= hexval(buffer[OFFS(O_WDAY)]);
+	status = (u_char) hexval(buffer[OFFS(O_FLAGS)]);
+	weekday= (u_char) hexval(buffer[OFFS(O_WDAY)]);
 
 	if ((status == 0xFF) || (weekday == 0xFF))
 	{
@@ -215,21 +216,21 @@
 }
 
 /*
- * inp_hopf6021
+ * parse_inp_fnc_t inp_hopf6021
  *
- * grep data from input stream
+ * grab data from input stream
  */
 static u_long
 inp_hopf6021(
 	     parse_t      *parseio,
-	     unsigned int  ch,
+	     char         ch,
 	     timestamp_t  *tstamp
 	  )
 {
 	unsigned int rtc;
-	
+
 	parseprintf(DD_PARSE, ("inp_hopf6021(0x%lx, 0x%x, ...)\n", (long)parseio, ch));
-	
+
 	switch (ch)
 	{
 	case ETX:
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/libparse/clk_meinberg.c /cur/src/external/bsd/ntp/dist/libparse/clk_meinberg.c
--- external/bsd/ntp/dist/libparse/clk_meinberg.c	2014-12-24 18:28:09.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/libparse/clk_meinberg.c	2015-04-07 19:51:17.000000000 -0700
@@ -2,13 +2,13 @@
 
 /*
  * /src/NTP/REPOSITORY/ntp4-dev/libparse/clk_meinberg.c,v 4.12.2.1 2005/09/25 10:22:35 kardel RELEASE_20050925_A
- *  
+ *
  * clk_meinberg.c,v 4.12.2.1 2005/09/25 10:22:35 kardel RELEASE_20050925_A
  *
  * Meinberg clock support
  *
  * Copyright (c) 1995-2005 by Frank Kardel <kardel <AT> ntp.org>
- * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universität Erlangen-Nürnberg, Germany
+ * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universitaet Erlangen-Nuernberg, Germany
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -67,7 +67,7 @@
 /*
  * The Meinberg receiver every second sends a datagram of the following form
  * (Standard Format)
- * 
+ *
  *     <STX>D:<dd>.<mm>.<yy>;T:<w>;U:<hh>:<mm>:<ss>;<S><F><D><A><ETX>
  * pos:  0  00 00 0 00 0 11 111 1 111 12 2 22 2 22 2 2  2  3  3   3
  *       1  23 45 6 78 9 01 234 5 678 90 1 23 4 56 7 8  9  0  1   2
@@ -107,12 +107,14 @@
  * <A>             = '!' during the hour preceeding an daylight saving time
  *                       start/end change
  * <L>             = 'A' LEAP second announcement
- * <R>             = 'R' alternate antenna
+ * <R>             = 'R' "call bit" used to signalize irregularities in the control facilities,
+ *                   usually ' ', until 2003 indicated transmission via alternate antenna
  *
- * Meinberg GPS166 receiver
+ * Meinberg GPS receivers
  *
- * You must get the Uni-Erlangen firmware for the GPS receiver support
+ * For very old devices you must get the Uni-Erlangen firmware for the GPS receiver support
  * to work to full satisfaction !
+ * With newer GPS receiver types the Uni Erlangen string format can be configured at the device.
  *
  *     <STX><dd>.<mm>.<yy>; <w>; <hh>:<mm>:<ss>; <+/-><00:00>; <U><S><F><D><A><L><R><L>; <position...><ETX>
  *
@@ -120,7 +122,7 @@
  *        123456789012345678901234567890123456789012345678901234567890123456
  *     \x0209.07.93; 5; 08:48:26; +00:00; #*S!A L; 49.5736N  11.0280E  373m\x03
  *
- * 
+ *
  * <STX>           = '\002' ASCII start of text
  * <ETX>           = '\003' ASCII end of text
  * <dd>,<mm>,<yy>  = day, month, year(2 digits!!)
@@ -133,8 +135,10 @@
  * <A>             = '!' during the hour preceeding an daylight saving time
  *                       start/end change
  * <L>             = 'A' LEAP second announcement
- * <R>             = 'R' alternate antenna (reminiscent of PZF535) usually ' '
- * <L>		   = 'L' on 23:59:60
+ * <R>             = 'R' "call bit" used to signalize irregularities in the control facilities,
+ *                   usually ' ', until 2003 indicated transmission via alternate antenna
+ *                   (reminiscent of PZF receivers)
+ * <L>             = 'L' on 23:59:60
  *
  * Binary messages have a lead in for a fixed header of SOH
  */
@@ -152,19 +156,20 @@
 /* Ret val:      the checksum                                   */
 /*+-------------------------------------------------------------*/
 
-unsigned long
+CSUM
 mbg_csum(
 	 unsigned char *p,
 	 unsigned int n
 	 )
 {
-  unsigned long sum = 0;
+  unsigned int sum = 0;
   unsigned int i;
-  
+
   for ( i = 0; i < n; i++ )
     sum += *p++;
-  
-  return( sum );
+
+  return (CSUM) sum;
+
 }  /* csum */
 
 void
@@ -173,10 +178,10 @@
 	       GPS_MSG_HDR *headerp
 	       )
 {
-  headerp->gps_cmd = get_lsb_short(bufpp);
-  headerp->gps_len = get_lsb_short(bufpp);
-  headerp->gps_data_csum = get_lsb_short(bufpp);
-  headerp->gps_hdr_csum  = get_lsb_short(bufpp);
+  headerp->cmd = (GPS_CMD) get_lsb_short(bufpp);
+  headerp->len = get_lsb_uint16(bufpp);
+  headerp->data_csum = (CSUM) get_lsb_short(bufpp);
+  headerp->hdr_csum  = (CSUM) get_lsb_short(bufpp);
 }
 
 static struct format meinberg_fmt[] =
@@ -211,10 +216,10 @@
 	}
 };
 
-static u_long cvt_meinberg (unsigned char *, int, struct format *, clocktime_t *, void *);
-static u_long cvt_mgps     (unsigned char *, int, struct format *, clocktime_t *, void *);
-static u_long mbg_input    (parse_t *, unsigned int, timestamp_t *);
-static u_long gps_input    (parse_t *, unsigned int, timestamp_t *);
+static parse_cvt_fnc_t cvt_meinberg;
+static parse_cvt_fnc_t cvt_mgps;
+static parse_inp_fnc_t mbg_input;
+static parse_inp_fnc_t gps_input;
 
 struct msg_buf
 {
@@ -226,7 +231,7 @@
 #define MBG_HEADER	1	/* receiving header */
 #define MBG_DATA	2	/* receiving data */
 #define MBG_STRING      3	/* receiving standard data message */
-  
+
 clockformat_t clock_meinberg[] =
 {
 	{
@@ -236,7 +241,7 @@
 		0,		/* conversion configuration */
 		"Meinberg Standard", /* Meinberg simple format - beware */
 		32,				/* string buffer */
-		0		/* no private data (complete pakets) */
+		0		/* no private data (complete packets) */
 	},
 	{
 		mbg_input,	/* normal input handling */
@@ -245,21 +250,21 @@
 		0,		/* conversion configuration */
 		"Meinberg Extended", /* Meinberg enhanced format */
 		32,		/* string buffer */
-		0		/* no private data (complete pakets) */
+		0		/* no private data (complete packets) */
 	},
 	{
 		gps_input,	/* no input handling */
-		cvt_mgps,	/* Meinberg GPS166 conversion */
+		cvt_mgps,	/* Meinberg GPS receiver conversion */
 		pps_one,	/* easy PPS monitoring */
 		(void *)&meinberg_fmt[2], /* conversion configuration */
-		"Meinberg GPS Extended", /* Meinberg FAU GPS format */
+		"Meinberg GPS Extended",  /* Meinberg FAU GPS format */
 		512,		/* string buffer */
-		sizeof(struct msg_buf)	/* no private data (complete pakets) */
+		sizeof(struct msg_buf)	/* no private data (complete packets) */
 	}
 };
 
 /*
- * cvt_meinberg
+ * parse_cvt_fnc_t cvt_meinberg
  *
  * convert simple type format
  */
@@ -273,7 +278,7 @@
 	     )
 {
 	struct format *format;
-	
+
 	/*
 	 * select automagically correct data format
 	 */
@@ -314,7 +319,7 @@
 	else
 	{
 		unsigned char *f = &buffer[format->field_offsets[O_FLAGS].offset];
-		
+
 		clock_time->usecond = 0;
 		clock_time->flags   = PARSEB_S_LEAP;
 
@@ -350,7 +355,7 @@
 			case ' ':
 				clock_time->utcoffset = -1*60*60; /* MET */
 				break;
-				
+
 			case 'S':
 				clock_time->utcoffset = -2*60*60; /* MED */
 				break;
@@ -362,27 +367,27 @@
 				clock_time->utcoffset = 0;        /* UTC */
 				clock_time->flags    |= PARSEB_UTC;
 				break;
-				
+
 			default:
 				return CVT_FAIL|CVT_BADFMT;
 			}
 		}
-		
+
 		/*
 		 * gather status flags
 		 */
 		if (buffer[format->field_offsets[O_ZONE].offset] == 'S')
 			clock_time->flags    |= PARSEB_DST;
-		
+
 		if (f[0] == '#')
 			clock_time->flags |= PARSEB_POWERUP;
-		
+
 		if (f[1] == '*')
 			clock_time->flags |= PARSEB_NOSYNC;
-		
+
 		if (f[3] == '!')
 			clock_time->flags |= PARSEB_ANNOUNCE;
-		
+
 		/*
 		 * oncoming leap second
 		 * 'a' code not confirmed - earth is not
@@ -390,27 +395,27 @@
 		 */
 		if (f[3] == 'A')
 			clock_time->flags |= PARSEB_LEAPADD;
-		
+
 		if (f[3] == 'a')
 			clock_time->flags |= PARSEB_LEAPDEL;
-		
-		
+
+
 		if (format->flags & MBG_EXTENDED)
 		{
 			clock_time->flags |= PARSEB_S_ANTENNA;
-			
+
 			/*
 			 * DCF77 does not encode the direction -
 			 * so we take the current default -
 			 * earth slowing down
 			 */
 			clock_time->flags &= ~PARSEB_LEAPDEL;
-			
+
 			if (f[4] == 'A')
 				clock_time->flags |= PARSEB_LEAPADD;
-			
+
 			if (f[5] == 'R')
-				clock_time->flags |= PARSEB_ALTERNATE;
+				clock_time->flags |= PARSEB_CALLBIT;
 		}
 		return CVT_OK;
 	}
@@ -418,31 +423,31 @@
 
 
 /*
- * mbg_input
+ * parse_inp_fnc_t mbg_input
  *
- * grep data from input stream
+ * grab data from input stream
  */
 static u_long
 mbg_input(
 	  parse_t      *parseio,
-	  unsigned int  ch,
+	  char         ch,
 	  timestamp_t  *tstamp
 	  )
 {
 	unsigned int rtc;
-	
+
 	parseprintf(DD_PARSE, ("mbg_input(0x%lx, 0x%x, ...)\n", (long)parseio, ch));
-	
+
 	switch (ch)
 	{
 	case STX:
 		parseprintf(DD_PARSE, ("mbg_input: STX seen\n"));
-		
+
 		parseio->parse_index = 1;
 		parseio->parse_data[0] = ch;
 		parseio->parse_dtime.parse_stime = *tstamp; /* collect timestamp */
 		return PARSE_INP_SKIP;
-	  
+
 	case ETX:
 		parseprintf(DD_PARSE, ("mbg_input: ETX seen\n"));
 		if ((rtc = parse_addchar(parseio, ch)) == PARSE_INP_SKIP)
@@ -457,7 +462,7 @@
 
 
 /*
- * cvt_mgps
+ * parse_cvt_fnc_t cvt_mgps
  *
  * convert Meinberg GPS format
  */
@@ -495,9 +500,9 @@
 		{
 			long h;
 			unsigned char *f = &buffer[format->field_offsets[O_FLAGS].offset];
-	  
+
 			clock_time->flags = PARSEB_S_LEAP|PARSEB_S_POSITION;
-	      
+
 			clock_time->usecond = 0;
 
 			/*
@@ -524,22 +529,22 @@
 					clock_time->utcoffset = -clock_time->utcoffset;
 				}
 			}
-	  
+
 			/*
 			 * gather status flags
 			 */
 			if (buffer[format->field_offsets[O_ZONE].offset] == 'S')
 			    clock_time->flags    |= PARSEB_DST;
-	  
+
 			if (clock_time->utcoffset == 0)
 			    clock_time->flags |= PARSEB_UTC;
-	  
+
 			/*
 			 * no sv's seen - no time & position
 			 */
 			if (f[0] == '#')
 			    clock_time->flags |= PARSEB_POWERUP;
-	  
+
 			/*
 			 * at least one sv seen - time (for last position)
 			 */
@@ -548,13 +553,13 @@
 			else
 			    if (!(clock_time->flags & PARSEB_POWERUP))
 				clock_time->flags |= PARSEB_POSITION;
-	  
+
 			/*
 			 * oncoming zone switch
 			 */
 			if (f[3] == '!')
 			    clock_time->flags |= PARSEB_ANNOUNCE;
-	  
+
 			/*
 			 * oncoming leap second
 			 * 'a' code not confirmed - earth is not
@@ -562,14 +567,14 @@
 			 */
 			if (f[4] == 'A')
 			    clock_time->flags |= PARSEB_LEAPADD;
-	  
+
 			if (f[4] == 'a')
 			    clock_time->flags |= PARSEB_LEAPDEL;
 
 			/*
 			 * f[5] == ' '
 			 */
-	  
+
 			/*
 			 * this is the leap second
 			 */
@@ -582,35 +587,35 @@
 }
 
 /*
- * gps_input
+ * parse_inp_fnc_t gps_input
  *
  * grep binary data from input stream
  */
 static u_long
 gps_input(
 	  parse_t      *parseio,
-	  unsigned int  ch,
+	  char ch,
 	  timestamp_t  *tstamp
 	  )
 {
   CSUM calc_csum;                    /* used to compare the incoming csums */
   GPS_MSG_HDR header;
   struct msg_buf *msg_buf;
-  
+
   msg_buf = (struct msg_buf *)parseio->parse_pdata;
 
   parseprintf(DD_PARSE, ("gps_input(0x%lx, 0x%x, ...)\n", (long)parseio, ch));
 
   if (!msg_buf)
     return PARSE_INP_SKIP;
-  
+
   if ( msg_buf->phase == MBG_NONE )
     {                  /* not receiving yet */
       switch (ch)
 	{
 	case SOH:
 	  parseprintf(DD_PARSE, ("gps_input: SOH seen\n"));
-	  
+
 	  msg_buf->len = sizeof( header ); /* prepare to receive msg header */
 	  msg_buf->phase = MBG_HEADER; /* receiving header */
 	  break;
@@ -623,7 +628,7 @@
 	  parseio->parse_index = 1;
 	  parseio->parse_data[0] = ch;
 	  break;
-	  
+
 	default:
 	  return PARSE_INP_SKIP;	/* keep searching */
 	}
@@ -640,7 +645,7 @@
   if ((msg_buf->phase == MBG_STRING) &&
       (parseio->parse_index < parseio->parse_dsize))
     parseio->parse_data[parseio->parse_index++] = ch;
-  
+
   parseio->parse_dtime.parse_msg[parseio->parse_dtime.parse_msglen++] = ch;
 
   if (parseio->parse_dtime.parse_msglen > sizeof(parseio->parse_dtime.parse_msg))
@@ -651,7 +656,7 @@
       parseio->parse_ldsize = parseio->parse_index;
       return PARSE_INP_DATA;
     }
-  
+
   switch (msg_buf->phase)
     {
     case MBG_HEADER:
@@ -687,41 +692,41 @@
   if ( msg_buf->phase == MBG_HEADER )
     {         /* header complete now */
       unsigned char *datap = parseio->parse_dtime.parse_msg + 1;
-      
+
       get_mbg_header(&datap, &header);
-      
+
       parseprintf(DD_PARSE, ("gps_input: header: cmd 0x%x, len %d, dcsum 0x%x, hcsum 0x%x\n",
-			     (int)header.gps_cmd, (int)header.gps_len, (int)header.gps_data_csum,
-			     (int)header.gps_hdr_csum));
-      
+			     (int)header.cmd, (int)header.len, (int)header.data_csum,
+			     (int)header.hdr_csum));
+
 
       calc_csum = mbg_csum( (unsigned char *) parseio->parse_dtime.parse_msg + 1, (unsigned short)6 );
 
-      if ( calc_csum != header.gps_hdr_csum )
+      if ( calc_csum != header.hdr_csum )
 	{
 	  parseprintf(DD_PARSE, ("gps_input: header checksum mismatch expected 0x%x, got 0x%x\n",
 				 (int)calc_csum, (int)mbg_csum( (unsigned char *) parseio->parse_dtime.parse_msg, (unsigned short)6 )));
-	  
+
 	  msg_buf->phase = MBG_NONE;  /* back to hunting mode */
 	  return PARSE_INP_DATA;      /* invalid header checksum received - pass up for detection */
 	}
 
-      if ((header.gps_len == 0)  ||       /* no data to wait for */
-	  (header.gps_len >= (sizeof (parseio->parse_dtime.parse_msg) - sizeof(header) - 1)))	/* blows anything we have space for */
+      if ((header.len == 0)  ||       /* no data to wait for */
+	  (header.len >= (sizeof (parseio->parse_dtime.parse_msg) - sizeof(header) - 1)))	/* blows anything we have space for */
 	{
 	  msg_buf->phase = MBG_NONE;  /* back to hunting mode */
-	  return (header.gps_len == 0) ? PARSE_INP_DATA : PARSE_INP_SKIP; /* message complete/throwaway */
+	  return (header.len == 0) ? PARSE_INP_DATA : PARSE_INP_SKIP; /* message complete/throwaway */
 	}
-    
-      parseprintf(DD_PARSE, ("gps_input: expecting %d bytes of data message\n", (int)header.gps_len));
-      
-      msg_buf->len   = header.gps_len;/* save number of bytes to wait for */
+
+      parseprintf(DD_PARSE, ("gps_input: expecting %d bytes of data message\n", (int)header.len));
+
+      msg_buf->len   = header.len;/* save number of bytes to wait for */
       msg_buf->phase = MBG_DATA;      /* flag header already complete */
       return PARSE_INP_SKIP;
     }
 
   parseprintf(DD_PARSE, ("gps_input: message data complete\n"));
-  
+
   /* Header and data have been received. The header checksum has been */
   /* checked */
 
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/libparse/clk_rawdcf.c /cur/src/external/bsd/ntp/dist/libparse/clk_rawdcf.c
--- external/bsd/ntp/dist/libparse/clk_rawdcf.c	2014-12-24 18:28:09.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/libparse/clk_rawdcf.c	2015-04-07 19:51:17.000000000 -0700
@@ -2,13 +2,13 @@
 
 /*
  * /src/NTP/REPOSITORY/ntp4-dev/libparse/clk_rawdcf.c,v 4.18 2006/06/22 18:40:01 kardel RELEASE_20060622_A
- *  
+ *
  * clk_rawdcf.c,v 4.18 2006/06/22 18:40:01 kardel RELEASE_20060622_A
  *
  * Raw DCF77 pulse clock support
  *
  * Copyright (c) 1995-2006 by Frank Kardel <kardel <AT> ntp.org>
- * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universität Erlangen-Nürnberg, Germany
+ * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universitaet Erlangen-Nuernberg, Germany
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -77,7 +77,8 @@
  * Second	Contents
  * 0  - 10	AM: free, FM: 0
  * 11 - 14	free
- * 15		R     - alternate antenna
+ * 15		R     - "call bit" used to signalize irregularities in the control facilities
+ *		        (until 2003 indicated transmission via alternate antenna)
  * 16		A1    - expect zone change (1 hour before)
  * 17 - 18	Z1,Z2 - time zone
  *		 0  0 illegal
@@ -103,9 +104,9 @@
  * 59		      - usually missing (minute indication), except for leap insertion
  */
 
-static u_long pps_rawdcf (parse_t *, int, timestamp_t *);
-static u_long cvt_rawdcf (unsigned char *, int, struct format *, clocktime_t *, void *);
-static u_long inp_rawdcf (parse_t *, unsigned int, timestamp_t  *);
+static parse_pps_fnc_t pps_rawdcf;
+static parse_cvt_fnc_t cvt_rawdcf;
+static parse_inp_fnc_t inp_rawdcf;
 
 typedef struct last_tcode {
 	time_t tcode;	/* last converted time code */
@@ -129,13 +130,13 @@
 {
 	const unsigned char *onebits;
 	const unsigned char *zerobits;
-} dcfparameter = 
+} dcfparameter =
 {
 	(const unsigned char *)"###############RADMLS1248124P124812P1248121241248112481248P??", /* 'ONE' representation */
 	(const unsigned char *)"--------------------s-------p------p----------------------p__"  /* 'ZERO' representation */
 };
 
-static struct rawdcfcode 
+static struct rawdcfcode
 {
 	char offset;			/* start bit */
 } rawdcfcode[] =
@@ -191,7 +192,7 @@
 	int i, first;
 
 	first = rawdcfcode[idx].offset;
-  
+
 	for (i = rawdcfcode[idx+1].offset - 1; i >= first; i--)
 	{
 		sum <<= 1;
@@ -240,7 +241,7 @@
 #endif
 		return CVT_NONE;
 	}
-  
+
 	for (i = 0; i < size; i++)
 	{
 		if ((*s != *b) && (*s != *c))
@@ -309,7 +310,7 @@
 		    clock_time->flags |= PARSEB_LEAPADD; /* default: DCF77 data format deficiency */
 
 		if (ext_bf(buffer, DCF_R, dcfprm->zerobits))
-		    clock_time->flags |= PARSEB_ALTERNATE;
+		    clock_time->flags |= PARSEB_CALLBIT;
 
 		parseprintf(DD_RAWDCF,("parse: convert_rawdcf: TIME CODE OK: %d:%d, %d.%d.%d, flags 0x%lx\n",
 				       (int)clock_time->hour, (int)clock_time->minute, (int)clock_time->day, (int)clock_time->month,(int) clock_time->year,
@@ -329,6 +330,7 @@
 }
 
 /*
+ * parse_cvt_fnc_t cvt_rawdcf
  * raw dcf input routine - needs to fix up 50 baud
  * characters for 1/0 decision
  */
@@ -381,7 +383,7 @@
 				ch >>= 1;
 			}
 
-			*s = i;
+			*s = (unsigned char) i;
 			histbuf[i]++;
 			cutoff += i;
 			lowmax++;
@@ -506,12 +508,12 @@
 			}
 	       }
         }
-	 
+
     	return rtc;
 }
 
 /*
- * pps_rawdcf
+ * parse_pps_fnc_t pps_rawdcf
  *
  * currently a very stupid version - should be extended to decode
  * also ones and zeros (which is easy)
@@ -548,30 +550,30 @@
 #else
 		parseio->parse_dtime.parse_time.fp.l_ui++;
 #endif
-		
+
 		parseprintf(DD_RAWDCF,("parse: snt_rawdcf: time stamp synthesized offset %d seconds\n", parseio->parse_index - 1));
-		
+
 		return updatetimeinfo(parseio, parseio->parse_lstate);
 	}
 	return CVT_NONE;
 }
 
 /*
- * inp_rawdcf
+ * parse_inp_fnc_t inp_rawdcf
  *
  * grab DCF77 data from input stream
  */
 static u_long
 inp_rawdcf(
 	  parse_t      *parseio,
-	  unsigned int  ch,
+	  char         ch,
 	  timestamp_t  *tstamp
 	  )
 {
 	static struct timeval timeout = { 1, 500000 }; /* 1.5 secongs denote second #60 */
-	
+
 	parseprintf(DD_PARSE, ("inp_rawdcf(0x%lx, 0x%x, ...)\n", (long)parseio, ch));
-	
+
 	parseio->parse_dtime.parse_stime = *tstamp; /* collect timestamp */
 
 	if (parse_timedout(parseio, tstamp, &timeout))
@@ -585,7 +587,7 @@
 	else
 	{
 		unsigned int rtc;
-		
+
 		rtc = parse_addchar(parseio, ch);
 		if (rtc == PARSE_INP_SKIP)
 		{
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/libparse/clk_rcc8000.c /cur/src/external/bsd/ntp/dist/libparse/clk_rcc8000.c
--- external/bsd/ntp/dist/libparse/clk_rcc8000.c	2014-12-24 18:28:09.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/libparse/clk_rcc8000.c	2015-04-07 19:51:17.000000000 -0700
@@ -2,7 +2,7 @@
 
 /*
  * /src/NTP/ntp4-dev/libparse/clk_rcc8000.c,v 4.9 2004/11/14 15:29:41 kardel RELEASE_20050508_A
- *  
+ *
  * clk_rcc8000.c,v 4.9 2004/11/14 15:29:41 kardel RELEASE_20050508_A
  *
  * Radiocode Clocks Ltd RCC 8000 Intelligent Off-Air Master Clock support
@@ -51,16 +51,16 @@
 
 #define	O_USEC		O_WDAY
 static struct format rcc8000_fmt =
-{ { { 13, 2 }, {16, 2}, { 19, 2}, /* Day, Month, Year */ 
-    {  0, 2 }, { 3, 2}, {  6, 2}, /* Hour, Minute, Second */ 
+{ { { 13, 2 }, {16, 2}, { 19, 2}, /* Day, Month, Year */
+    {  0, 2 }, { 3, 2}, {  6, 2}, /* Hour, Minute, Second */
     {  9, 3 }, {28, 1}, {  0, 0}, /* uSec, Status (Valid,Reject,BST,Leapyear) */  },
-  (const unsigned char *)"  :  :  .      /  /          \r\n", 
+  (const unsigned char *)"  :  :  .      /  /          \r\n",
   /*"15:50:36.534 30/09/94 273 5 A\x0d\x0a" */
-  0 
+  0
 };
 
-static unsigned long cvt_rcc8000 (unsigned char *, int, struct format *, clocktime_t *, void *);
-static unsigned long inp_rcc8000 (parse_t *, unsigned int, timestamp_t *);
+static parse_cvt_fnc_t cvt_rcc8000;
+static parse_inp_fnc_t inp_rcc8000;
 
 clockformat_t clock_rcc8000 =
 {
@@ -73,7 +73,8 @@
   0				/* no private data */
 };
 
-static unsigned long
+/* parse_cvt_fnc_t cvt_rcc8000 */
+static u_long
 cvt_rcc8000(
 	    unsigned char *buffer,
 	    int            size,
@@ -123,27 +124,27 @@
 		    clock_time->flags |= PARSEB_POWERUP;
 
 		clock_time->flags |= PARSEB_UTC; /* British special - guess why 8-) */
-    
+
 		/* other flags not used */
 	}
 	return CVT_OK;
 }
 /*
- * inp_rcc8000
+ * parse_inp_fnc_t inp_rcc8000
  *
- * grep data from input stream
+ * grab data from input stream
  */
 static u_long
 inp_rcc8000(
 	    parse_t      *parseio,
-	    unsigned int  ch,
+	    char         ch,
 	    timestamp_t  *tstamp
 	  )
 {
 	unsigned int rtc;
-	
+
 	parseprintf(DD_PARSE, ("inp_rcc8000(0x%lx, 0x%x, ...)\n", (long)parseio, ch));
-	
+
 	switch (ch)
 	{
 	case '\n':
@@ -152,7 +153,7 @@
 			return parse_end(parseio);
 		else
 			return rtc;
-		
+
 
 	default:
 		if (parseio->parse_index == 0) /* take sample at start of message */
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/libparse/clk_schmid.c /cur/src/external/bsd/ntp/dist/libparse/clk_schmid.c
--- external/bsd/ntp/dist/libparse/clk_schmid.c	2014-12-24 18:28:09.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/libparse/clk_schmid.c	2015-04-07 19:51:17.000000000 -0700
@@ -2,14 +2,14 @@
 
 /*
  * /src/NTP/ntp4-dev/libparse/clk_schmid.c,v 4.9 2005/04/16 17:32:10 kardel RELEASE_20050508_A
- *  
+ *
  * clk_schmid.c,v 4.9 2005/04/16 17:32:10 kardel RELEASE_20050508_A
  *
  * Schmid clock support
  * based on information and testing from Adam W. Feigin et. al (Swisstime iis.ethz.ch)
  *
  * Copyright (c) 1995-2005 by Frank Kardel <kardel <AT> ntp.org>
- * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universität Erlangen-Nürnberg, Germany
+ * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universitaet Erlangen-Nuernberg, Germany
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -63,7 +63,7 @@
  * The command to Schmid's DCF77 clock is a single byte; each bit
  * allows the user to select some part of the time string, as follows (the
  * output for the lsb is sent first).
- * 
+ *
  * Bit 0:	time in MEZ, 4 bytes *binary, not BCD*; hh.mm.ss.tenths
  * Bit 1:	date 3 bytes *binary, not BCD: dd.mm.yy
  * Bit 2:	week day, 1 byte (unused here)
@@ -84,15 +84,15 @@
 #define WS_TIME		0x01
 #define WS_SIGNAL	0x02
 
-#define WS_ALTERNATE	0x01
+#define WS_CALLBIT	0x01  /* "call bit" used to signalize irregularities in the control facilities */
 #define WS_ANNOUNCE	0x02
 #define WS_TZ		0x0c
 #define   WS_MET	0x08
 #define   WS_MEST	0x04
 #define WS_LEAP		0x10
 
-static u_long cvt_schmid (unsigned char *, int, struct format *, clocktime_t *, void *);
-static unsigned long inp_schmid (parse_t *, unsigned int, timestamp_t *);
+static parse_cvt_fnc_t cvt_schmid;
+static parse_inp_fnc_t inp_schmid;
 
 clockformat_t clock_schmid =
 {
@@ -105,7 +105,7 @@
   0,				/* no private data (complete messages) */
 };
 
-
+/* parse_cvt_fnc_t */
 static u_long
 cvt_schmid(
 	   unsigned char *buffer,
@@ -157,7 +157,7 @@
 				default:
 				    return CVT_FAIL|CVT_BADFMT;
 			    }
-	  
+
 			    if (!(buffer[7] & WS_TIME))
 			    {
 				    clock_time->flags |= PARSEB_POWERUP;
@@ -170,9 +170,9 @@
 
 			    if (buffer[7] & WS_SIGNAL)
 			    {
-				    if (buffer[8] & WS_ALTERNATE)
+				    if (buffer[8] & WS_CALLBIT)
 				    {
-					    clock_time->flags |= PARSEB_ALTERNATE;
+					    clock_time->flags |= PARSEB_CALLBIT;
 				    }
 
 				    if (buffer[8] & WS_ANNOUNCE)
@@ -187,32 +187,32 @@
 			    }
 
 			    clock_time->flags |= PARSEB_S_LEAP|PARSEB_S_ANTENNA;
-	  
+
 			    return CVT_OK;
 		    }
 	}
 }
 
 /*
- * inp_schmid
+ * parse_inp_fnc_t inp_schmid
  *
- * grep data from input stream
+ * grab data from input stream
  */
 static u_long
 inp_schmid(
 	  parse_t      *parseio,
-	  unsigned int  ch,
+	  char         ch,
 	  timestamp_t  *tstamp
 	  )
 {
 	unsigned int rtc;
-	
+
 	parseprintf(DD_PARSE, ("inp_schmid(0x%lx, 0x%x, ...)\n", (long)parseio, ch));
-	
-	switch (ch)
+
+	switch ((uint8_t)ch)
 	{
 	case 0xFD:		/*  */
-		parseprintf(DD_PARSE, ("mbg_input: ETX seen\n"));
+		parseprintf(DD_PARSE, ("inp_schmid: 0xFD seen\n"));
 		if ((rtc = parse_addchar(parseio, ch)) == PARSE_INP_SKIP)
 			return parse_end(parseio);
 		else
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/libparse/clk_sel240x.c /cur/src/external/bsd/ntp/dist/libparse/clk_sel240x.c
--- external/bsd/ntp/dist/libparse/clk_sel240x.c	2014-12-24 18:28:09.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/libparse/clk_sel240x.c	2015-04-07 19:51:17.000000000 -0700
@@ -5,7 +5,7 @@
 //        Schweitzer Engineering Laboratories, Inc. <opensource@selinc.com>
 //////////////////////////////////////////////////////////////////////////////
 
-// Need to have _XOPEN_SOURCE defined for time.h to give the 
+// Need to have _XOPEN_SOURCE defined for time.h to give the
 // correct strptime signature.  As per feature_test_macros(7),
 // define this before including any header files.
 
@@ -53,14 +53,8 @@
 // a '?'.  But we are only going to call it synced when we receive a ' '
 //////////////////////////////////////////////////////////////////////////////
 
-static unsigned long inp_sel240x( parse_t *parseio,
-		                  unsigned int ch,
-				  timestamp_t *tstamp);
-static unsigned long cvt_sel240x( unsigned char *buffer,
-		                  int size,
-				  struct format *format,
-				  clocktime_t *clock_time,
-				  void *local );
+static parse_inp_fnc_t inp_sel240x;
+static parse_cvt_fnc_t cvt_sel240x;
 
 // Parse clock format structure describing the message above
 static struct format sel240x_fmt =
@@ -96,7 +90,7 @@
 //////////////////////////////////////////////////////////////////////////////
 static unsigned long
 inp_sel240x( parse_t      *parseio,
-	     unsigned int ch,
+	     char         ch,
 	     timestamp_t  *tstamp
 	   )
 {
@@ -141,7 +135,7 @@
 	{
 		struct tm ptime;
 		buffer++;
-		buffer = (unsigned char *) strptime( 
+		buffer = (unsigned char *) strptime(
 			(const char *)buffer, "%Y:%j:%H:%M:%S", &ptime );
 		if( *(buffer+1) != '\x0d' )
 		{
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/libparse/clk_trimtaip.c /cur/src/external/bsd/ntp/dist/libparse/clk_trimtaip.c
--- external/bsd/ntp/dist/libparse/clk_trimtaip.c	2014-12-24 18:28:09.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/libparse/clk_trimtaip.c	2015-04-07 19:51:17.000000000 -0700
@@ -8,7 +8,7 @@
  * Trimble SV6 clock support - several collected codepieces
  *
  * Copyright (c) 1995-2005 by Frank Kardel <kardel <AT> ntp.org>
- * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universität Erlangen-Nürnberg, Germany
+ * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universitaet Erlangen-Nuernberg, Germany
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -80,8 +80,8 @@
   0
 };
 
-static unsigned long cvt_trimtaip (unsigned char *, int, struct format *, clocktime_t *, void *);
-static unsigned long inp_trimtaip (parse_t *, unsigned int, timestamp_t *);
+static parse_cvt_fnc_t cvt_trimtaip;
+static parse_inp_fnc_t inp_trimtaip;
 
 clockformat_t clock_trimtaip =
 {
@@ -94,7 +94,8 @@
   0				/* no private data */
 };
 
-static unsigned long
+/* parse_cvt_fnc_t cvt_trimtaip */
+static u_long
 cvt_trimtaip(
 	     unsigned char *buffer,
 	     int            size,
@@ -143,31 +144,31 @@
 }
 
 /*
- * inp_trimtaip
+ * parse_inp_fnc_t inp_trimtaip
  *
- * grep data from input stream
+ * grab data from input stream
  */
 static u_long
 inp_trimtaip(
 	     parse_t      *parseio,
-	     unsigned int  ch,
+	     char         ch,
 	     timestamp_t  *tstamp
 	  )
 {
 	unsigned int rtc;
-	
+
 	parseprintf(DD_PARSE, ("inp_trimtaip(0x%lx, 0x%x, ...)\n", (long)parseio, ch));
-	
+
 	switch (ch)
 	{
 	case '>':
 		parseprintf(DD_PARSE, ("inp_trimptaip: START seen\n"));
-		
+
 		parseio->parse_index = 1;
 		parseio->parse_data[0] = ch;
 		parseio->parse_dtime.parse_stime = *tstamp; /* collect timestamp */
 		return PARSE_INP_SKIP;
-	  
+
 	case '<':
 		parseprintf(DD_PARSE, ("inp_trimtaip: END seen\n"));
 		if ((rtc = parse_addchar(parseio, ch)) == PARSE_INP_SKIP)
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/libparse/clk_trimtsip.c /cur/src/external/bsd/ntp/dist/libparse/clk_trimtsip.c
--- external/bsd/ntp/dist/libparse/clk_trimtsip.c	2014-12-24 18:28:09.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/libparse/clk_trimtsip.c	2015-04-07 19:51:17.000000000 -0700
@@ -9,7 +9,7 @@
  * Thanks to Sven Dietrich for providing test hardware
  *
  * Copyright (c) 1995-2009 by Frank Kardel <kardel <AT> ntp.org>
- * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universität Erlangen-Nürnberg, Germany
+ * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universitaet Erlangen-Nuernberg, Germany
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -118,7 +118,7 @@
 #define STATUS_UNSAFE 1		/* not enough receivers for full precision */
 #define STATUS_SYNC   2		/* enough information for good operation */
 
-static unsigned long inp_tsip (parse_t *, unsigned int, timestamp_t *);
+static unsigned long inp_tsip (parse_t *, char, timestamp_t *);
 static unsigned long cvt_trimtsip (unsigned char *, int, struct format *, clocktime_t *, void *);
 
 struct clockformat clock_trimtsip =
@@ -138,7 +138,7 @@
 static unsigned long
 inp_tsip(
 	 parse_t      *parseio,
-	 unsigned int ch,
+	 char         ch,
 	 timestamp_t  *tstamp
 	)
 {
@@ -185,7 +185,7 @@
 			/* DLE,ETX -> end of packet */
 			parseio->parse_data[parseio->parse_index++] = DLE;
 			parseio->parse_data[parseio->parse_index] = ch;
-			parseio->parse_ldsize = parseio->parse_index+1;
+			parseio->parse_ldsize = (u_short) (parseio->parse_index + 1);
 			memcpy(parseio->parse_ldata, parseio->parse_data, parseio->parse_ldsize);
 			parseio->parse_dtime.parse_msg[parseio->parse_dtime.parse_msglen++] = DLE;
 			parseio->parse_dtime.parse_msg[parseio->parse_dtime.parse_msglen++] = ch;
@@ -202,13 +202,13 @@
 
   return PARSE_INP_SKIP;
 }
-     
-static int
+
+static short
 getshort(
 	 unsigned char *p
 	 )
 {
-	return get_msb_short(&p);
+	return (short) get_msb_short(&p);
 }
 
 /*
@@ -247,28 +247,28 @@
 	{
 		unsigned char *bp;
 		cmd = buffer[1];
-      
+
 		    switch(cmd)
 		    {
 		    case CMD_RCURTIME:
 			    {			/* GPS time */
 				    l_fp secs;
-				    int   week = getshort((unsigned char *)&mb(4));
+				    unsigned int   week = getshort((unsigned char *)&mb(4));
 				    l_fp utcoffset;
 				    l_fp gpstime;
 
 				    bp = &mb(0);
 				    if (fetch_ieee754(&bp, IEEE_SINGLE, &secs, trim_offsets) != IEEE_OK)
 					    return CVT_FAIL|CVT_BADFMT;
-				    
+
 				    if ((secs.l_i <= 0) ||
 					(t->t_utcknown == 0))
 				    {
 					    clock_time->flags = PARSEB_POWERUP;
 					    return CVT_OK;
 				    }
-				    if (week < 990) {
-					    week += 1024;
+				    if (week < GPSWRAP) {
+					    week += GPSWEEKS;
 				    }
 
 				    /* time OK */
@@ -277,7 +277,7 @@
 				    bp = &mb(6);
 				    if (fetch_ieee754(&bp, IEEE_SINGLE, &utcoffset, trim_offsets) != IEEE_OK)
 					    return CVT_FAIL|CVT_BADFMT;
-				    
+
 				    L_SUB(&secs, &utcoffset); /* adjust GPS time to UTC time */
 
 				    gpstolfp((unsigned short)week, (unsigned short)0,
@@ -291,10 +291,10 @@
 
 				    if (t->t_leap == ADDSECOND)
 					clock_time->flags |= PARSEB_LEAPADD;
-		      
+
 				    if (t->t_leap == DELSECOND)
 					clock_time->flags |= PARSEB_LEAPDEL;
-	
+
 				    switch (t->t_operable)
 				      {
 				      case STATUS_SYNC:
@@ -309,12 +309,12 @@
 					clock_time->flags |= PARSEB_NOSYNC|PARSEB_POWERUP;
 					break;
 				      }
-					
+
 				    if (t->t_mode == 0)
 					    clock_time->flags |= PARSEB_POSITION;
-				    
+
 				    clock_time->flags |= PARSEB_S_LEAP|PARSEB_S_POSITION;
-				    
+
 				    return CVT_OK;
 
 			    } /* case 0x41 */
@@ -348,26 +348,26 @@
 			    {
 			            l_fp t0t;
 				    unsigned char *lbp;
-				    
+
 				    /* UTC correction data - derive a leap warning */
-				    int tls   = t->t_gpsutc     = getshort((unsigned char *)&mb(12)); /* current leap correction (GPS-UTC) */
-				    int tlsf  = t->t_gpsutcleap = getshort((unsigned char *)&mb(24)); /* new leap correction */
+				    int tls   = t->t_gpsutc     = (u_short) getshort((unsigned char *)&mb(12)); /* current leap correction (GPS-UTC) */
+				    int tlsf  = t->t_gpsutcleap = (u_short) getshort((unsigned char *)&mb(24)); /* new leap correction */
+
+				    t->t_weekleap   = (u_short) getshort((unsigned char *)&mb(20)); /* week no of leap correction */
+				    if (t->t_weekleap < GPSWRAP)
+				      t->t_weekleap = (u_short)(t->t_weekleap + GPSWEEKS);
+
+				    t->t_dayleap    = (u_short) getshort((unsigned char *)&mb(22)); /* day in week of leap correction */
+				    t->t_week = (u_short) getshort((unsigned char *)&mb(18)); /* current week no */
+				    if (t->t_week < GPSWRAP)
+				      t->t_week = (u_short)(t->t_weekleap + GPSWEEKS);
 
-				    t->t_weekleap   = getshort((unsigned char *)&mb(20)); /* week no of leap correction */
-				    if (t->t_weekleap < 990)
-				      t->t_weekleap += 1024;
-
-				    t->t_dayleap    = getshort((unsigned char *)&mb(22)); /* day in week of leap correction */
-				    t->t_week = getshort((unsigned char *)&mb(18)); /* current week no */
-				    if (t->t_week < 990)
-				      t->t_week += 1024;
-				    
 				    lbp = (unsigned char *)&mb(14); /* last update time */
 				    if (fetch_ieee754(&lbp, IEEE_SINGLE, &t0t, trim_offsets) != IEEE_OK)
 					    return CVT_FAIL|CVT_BADFMT;
 
 				    t->t_utcknown = t0t.l_ui != 0;
-				      
+
 				    if ((t->t_utcknown) && /* got UTC information */
 					(tlsf != tls)   && /* something will change */
 					((t->t_weekleap - t->t_week) < 5)) /* and close in the future */
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/libparse/clk_varitext.c /cur/src/external/bsd/ntp/dist/libparse/clk_varitext.c
--- external/bsd/ntp/dist/libparse/clk_varitext.c	2014-12-24 18:28:09.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/libparse/clk_varitext.c	2015-04-07 19:51:17.000000000 -0700
@@ -11,14 +11,14 @@
  * clk_varitext.c,v 1.5 2005/04/16 17:32:10 kardel RELEASE_20050508_A
  *
  * Varitext code variant by A.McConnell 1997/01/19
- * 
+ *
  * Supports Varitext's Radio Clock
- * 
+ *
  * Used the Meinberg/Computime clock as a template for Varitext Radio Clock
  *
  * Codebase:
  * Copyright (c) 1995-2005 by Frank Kardel <kardel <AT> ntp.org>
- * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universität Erlangen-Nürnberg, Germany
+ * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universitaet Erlangen-Nuernberg, Germany
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -69,31 +69,31 @@
 
 /*
  * The Varitext receiver sends a datagram in the following format every minute
- * 
- * Timestamp	T:YY:MM:MD:WD:HH:MM:SSCRLFSTXXX 
+ *
+ * Timestamp	T:YY:MM:MD:WD:HH:MM:SSCRLFSTXXX
  * Pos          0123456789012345678901 2 3 4567
  *              0000000000111111111122 2 2 2222
- * Parse        T:  :  :  :  :  :  :  \r\n    
- * 
- * T	Startcharacter "T" specifies start of the timestamp 
- * YY	Year MM	Month 1-12 
- * MD	Day of the month 
- * WD	Day of week 
- * HH	Hour 
- * MM   Minute 
- * SS   Second
- * CR   Carriage return 
- * LF   Linefeed
+ * Parse        T:  :  :  :  :  :  :  \r\n
+ *
+ * T	Startcharacter "T" specifies start of the timestamp
+ * YY	Year MM	Month 1-12
+ * MD	Day of the month
+ * WD	Day of week
+ * HH	Hour
+ * MM	Minute
+ * SS	Second
+ * CR	Carriage return
+ * LF	Linefeed
  * ST	Status character
  *	Bit 0 - Set= Initialised; Reset=Time Invalid (DO NOT USE)
- *	Bit 1 - Set= Synchronised; Reset= Unsynchronised 
- * 	Bit 2 - Set= Alarm state; Reset= No alarm
- * 	Bit 3 - Set= BST; Reset= GMT
- * 	Bit 4 - Set= Seasonal change in approx hour; Reset= No seasonal change expected
+ *	Bit 1 - Set= Synchronised; Reset= Unsynchronised
+ *	Bit 2 - Set= Alarm state; Reset= No alarm
+ *	Bit 3 - Set= BST; Reset= GMT
+ *	Bit 4 - Set= Seasonal change in approx hour; Reset= No seasonal change expected
  *	Bit 5 - Set= Last MSF telegram was OK; Reset= Last telegram was in error;
- * 	Bit 6 - Always set
+ *	Bit 6 - Always set
  *	Bit 7 - Unused
- * XXX	Checksum calculated using Fletcher's method (ignored for now). 
+ * XXX	Checksum calculated using Fletcher's method (ignored for now).
  */
 
 static struct format varitext_fmt =
@@ -107,8 +107,8 @@
   0
 };
 
-static u_long   cvt_varitext (unsigned char *, int, struct format *, clocktime_t *, void *);
-static u_long   inp_varitext (parse_t *, unsigned int, timestamp_t *);
+static parse_cvt_fnc_t cvt_varitext;
+static parse_inp_fnc_t inp_varitext;
 
 struct varitext {
   unsigned char start_found;
@@ -130,11 +130,11 @@
 };
 
 /*
- * cvt_varitext
- * 
+ * parse_cvt_fnc_t cvt_varitext
+ *
  * convert simple type format
  */
-static          u_long
+static u_long
 cvt_varitext(
 	     unsigned char	*buffer,
 	     int    		size,
@@ -144,7 +144,7 @@
 	     )
 {
 
-  if (!Strok(buffer, format->fixed_string)) { 
+  if (!Strok(buffer, format->fixed_string)) {
     return CVT_NONE;
   } else {
     if (Stoi(&buffer[format->field_offsets[O_DAY].offset], &clock_time->day,
@@ -158,7 +158,7 @@
 	Stoi(&buffer[format->field_offsets[O_MIN].offset], &clock_time->minute,
 	     format->field_offsets[O_MIN].length) ||
 	Stoi(&buffer[format->field_offsets[O_SEC].offset], &clock_time->second,
-	     format->field_offsets[O_SEC].length)) { 
+	     format->field_offsets[O_SEC].length)) {
       return CVT_FAIL | CVT_BADFMT;
     } else {
       u_char *f = (u_char*) &buffer[format->field_offsets[O_FLAGS].offset];
@@ -172,24 +172,25 @@
 	  clock_time->flags |= PARSEB_DST;
 	}
       /*
-	 if (!((*f) & VT_INITIALISED))  Clock not initialised 
+	 if (!((*f) & VT_INITIALISED))  Clock not initialised
 	 clock_time->flags |= PARSEB_POWERUP;
-	 
-	 if (!((*f) & VT_SYNCHRONISED))   Clock not synchronised 
+
+	 if (!((*f) & VT_SYNCHRONISED))   Clock not synchronised
 	 clock_time->flags |= PARSEB_NOSYNC;
-	 
-	 if (((*f) & VT_SEASON_CHANGE))  Seasonal change expected in the next hour 
+
+	 if (((*f) & VT_SEASON_CHANGE))  Seasonal change expected in the next hour
 	 clock_time->flags |= PARSEB_ANNOUNCE;
 	 */
-      return CVT_OK; 
+      return CVT_OK;
     }
   }
 }
 
-static u_long 
+/* parse_inp_fnc_t inp_varitext */
+static u_long
 inp_varitext(
 	     parse_t	 *parseio,
-	     unsigned int ch,
+	     char ch,
 	     timestamp_t *tstamp
 	     )
 {
@@ -198,10 +199,10 @@
 
   parseprintf(DD_PARSE, ("inp_varitext(0x%lx, 0x%x, ...)\n", (long)parseio, ch));
 
-  if (!t) 
+  if (!t)
     return PARSE_INP_SKIP;	/* local data not allocated - sigh! */
 
-  if (ch == 'T') 
+  if (ch == 'T')
     t->tstamp = *tstamp;
 
   if ((t->previous_ch == 'T') && (ch == ':'))
@@ -226,7 +227,7 @@
 	  return rtc;
 	}
 
-      if (t->end_found) 
+      if (t->end_found)
 	{
 	  if (++(t->end_count) == 4) /* Finally found the end of the message */
 	    {
@@ -237,16 +238,16 @@
 		return parse_end(parseio);
 	      else
 		return rtc;
-	    }	
+	    }
 	}
 
-      if ((t->previous_ch == '\r') && (ch == '\n')) 
+      if ((t->previous_ch == '\r') && (ch == '\n'))
 	{
 	  t->end_found = 1;
 	}
 
     }
- 
+
   t->previous_ch = ch;
 
   return PARSE_INP_SKIP;
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/libparse/clk_wharton.c /cur/src/external/bsd/ntp/dist/libparse/clk_wharton.c
--- external/bsd/ntp/dist/libparse/clk_wharton.c	2014-12-24 18:28:09.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/libparse/clk_wharton.c	2015-04-07 19:51:17.000000000 -0700
@@ -76,8 +76,11 @@
  * 
  */
 
+static parse_cvt_fnc_t cvt_wharton_400a;
+static parse_inp_fnc_t inp_wharton_400a;
+
 /*
- * cvt_wharton_400a
+ * parse_cvt_fnc_t cvt_wharton_400a
  * 
  * convert simple type format
  */
@@ -123,14 +126,14 @@
 }
 
 /*
- * inp_wharton_400a
+ * parse_inp_fnc_t inp_wharton_400a
  *
- * grep data from input stream
+ * grab data from input stream
  */
 static u_long
 inp_wharton_400a(
 	      parse_t      *parseio,
-	      unsigned int  ch,
+	      char         ch,
 	      timestamp_t  *tstamp
 	      )
 {
@@ -168,7 +171,7 @@
 	0,			/* conversion configuration */
 	"WHARTON 400A Series clock Output Format 1",	/* String format name */
 	15,			/* string buffer */
-	0			/* no private data (complete pakets) */
+	0			/* no private data (complete packets) */
 };
 
 #else /* not (REFCLOCK && CLOCK_PARSE && CLOCK_WHARTON_400A) */
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/libparse/data_mbg.c /cur/src/external/bsd/ntp/dist/libparse/data_mbg.c
--- external/bsd/ntp/dist/libparse/data_mbg.c	2014-12-24 18:28:09.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/libparse/data_mbg.c	2015-04-07 19:51:17.000000000 -0700
@@ -45,6 +45,7 @@
 #include "ntp_types.h"
 #include "ntp_stdlib.h"
 #include "ntp_fp.h"
+#include "ntp_calendar.h"
 #include "mbg_gps166.h"
 #include "binio.h"
 #include "ieee754io.h"
@@ -65,10 +66,10 @@
 	GPS_MSG_HDR *headerp
 	)
 {
-  put_lsb_short(bufpp, headerp->gps_cmd);
-  put_lsb_short(bufpp, headerp->gps_len);
-  put_lsb_short(bufpp, headerp->gps_data_csum);
-  put_lsb_short(bufpp, headerp->gps_hdr_csum);
+  put_lsb_short(bufpp, headerp->cmd);
+  put_lsb_short(bufpp, headerp->len);
+  put_lsb_short(bufpp, headerp->data_csum);
+  put_lsb_short(bufpp, headerp->hdr_csum);
 }
 
 void
@@ -77,7 +78,7 @@
 	SW_REV *sw_revp
 	)
 {
-  sw_revp->code = get_lsb_short(bufpp);
+  sw_revp->code = get_lsb_uint16(bufpp);
   memcpy(sw_revp->name, *bufpp, sizeof(sw_revp->name));
   *bufpp += sizeof(sw_revp->name);
 }
@@ -88,8 +89,8 @@
 	ASCII_MSG *ascii_msgp
 	)
 {
-  ascii_msgp->csum  = get_lsb_short(bufpp);
-  ascii_msgp->valid = get_lsb_short(bufpp);
+  ascii_msgp->csum  = (CSUM) get_lsb_short(bufpp);
+  ascii_msgp->valid = get_lsb_int16(bufpp);
   memcpy(ascii_msgp->s, *bufpp, sizeof(ascii_msgp->s));
   *bufpp += sizeof(ascii_msgp->s);
 }
@@ -100,7 +101,7 @@
 	SVNO *svnop
 	)
 {
-  *svnop = get_lsb_short(bufpp);
+  *svnop = (SVNO) get_lsb_short(bufpp);
 }
 
 void
@@ -109,7 +110,7 @@
 	HEALTH *healthp
 	)
 {
-  *healthp = get_lsb_short(bufpp);
+  *healthp = (HEALTH) get_lsb_short(bufpp);
 }
 
 void
@@ -118,7 +119,7 @@
 	CFG *cfgp
 	)
 {
-  *cfgp = get_lsb_short(bufpp);
+  *cfgp = (CFG) get_lsb_short(bufpp);
 }
 
 void
@@ -127,7 +128,7 @@
 	T_GPS *tgpsp
 	)
 {
-  tgpsp->wn = get_lsb_short(bufpp);
+  tgpsp->wn = get_lsb_uint16(bufpp);
   tgpsp->sec = get_lsb_long(bufpp);
   tgpsp->tick = get_lsb_long(bufpp);
 }
@@ -135,20 +136,20 @@
 void
 get_mbg_tm(
 	unsigned char **buffpp,
-	TM *tmp
+	TM_GPS *tmp
 	)
 {
-  tmp->year = get_lsb_short(buffpp);
+  tmp->year = get_lsb_int16(buffpp);
   tmp->month = *(*buffpp)++;
-  tmp->mday  = *(*buffpp)++;
-  tmp->yday  = get_lsb_short(buffpp);
-  tmp->wday  = *(*buffpp)++;
-  tmp->hour  = *(*buffpp)++;
-  tmp->minute = *(*buffpp)++;
-  tmp->second = *(*buffpp)++;
-  tmp->frac  = get_lsb_long(buffpp);
+  tmp->mday = *(*buffpp)++;
+  tmp->yday = get_lsb_int16(buffpp);
+  tmp->wday = *(*buffpp)++;
+  tmp->hour = *(*buffpp)++;
+  tmp->min = *(*buffpp)++;
+  tmp->sec = *(*buffpp)++;
+  tmp->frac = get_lsb_long(buffpp);
   tmp->offs_from_utc = get_lsb_long(buffpp);
-  tmp->status= get_lsb_short(buffpp);
+  tmp->status = get_lsb_uint16(buffpp);
 }
 
 void
@@ -157,7 +158,7 @@
 	TTM *ttmp
 	)
 {
-  ttmp->channel = get_lsb_short(buffpp);
+  ttmp->channel = get_lsb_int16(buffpp);
   get_mbg_tgps(buffpp, &ttmp->t);
   get_mbg_tm(buffpp, &ttmp->tm);
 }
@@ -168,9 +169,9 @@
 	SYNTH *synthp
 	)
 {
-  synthp->freq  = get_lsb_short(buffpp);
-  synthp->range = get_lsb_short(buffpp);
-  synthp->phase = get_lsb_short(buffpp);
+  synthp->freq  = get_lsb_int16(buffpp);
+  synthp->range = get_lsb_int16(buffpp);
+  synthp->phase = get_lsb_int16(buffpp);
 }
 
 static void
@@ -203,7 +204,7 @@
 	ANT_INFO *antinfop
 	)
 {
-  antinfop->status = get_lsb_short(buffpp);
+  antinfop->status = get_lsb_int16(buffpp);
   get_mbg_tm(buffpp, &antinfop->tm_disconn);
   get_mbg_tm(buffpp, &antinfop->tm_reconn);
   antinfop->delta_t = get_lsb_long(buffpp);
@@ -218,8 +219,8 @@
 {
 	static struct state
 	{
-		int         flag;		/* bit flag */
-		const char *string;	/* bit name */
+		int         flag;       /* bit flag */
+		const char *string;     /* bit name */
 	} states[] =
 		  {
 			  { TM_UTC,    "UTC CORR" },
@@ -235,7 +236,7 @@
 	{
 		char *start, *p;
 		struct state *s;
-	
+
 		start = p = *buffpp;
 
 		for (s = states; s->flag; s++)
@@ -254,25 +255,27 @@
 		*buffpp = p;
 	}
 }
-      
+
 void
 mbg_tm_str(
 	char **buffpp,
-	TM *tmp,
-	int size
+	TM_GPS *tmp,
+	int size,
+	int print_status
 	)
 {
 	char *s = *buffpp;
 
 	snprintf(*buffpp, size, "%04d-%02d-%02d %02d:%02d:%02d.%07ld (%c%02d%02d) ",
 		 tmp->year, tmp->month, tmp->mday,
-		 tmp->hour, tmp->minute, tmp->second, tmp->frac,
+		 tmp->hour, tmp->min, tmp->sec, (long) tmp->frac,
 		 (tmp->offs_from_utc < 0) ? '-' : '+',
 		 abs((int)tmp->offs_from_utc) / 3600,
 		 (abs((int)tmp->offs_from_utc) / 60) % 60);
 	*buffpp += strlen(*buffpp);
 
-	mbg_time_status_str(buffpp, tmp->status, size - (*buffpp - s));
+	if (print_status)
+		mbg_time_status_str(buffpp, tmp->status, size - (*buffpp - s));
 }
 
 void
@@ -283,8 +286,8 @@
 	)
 {
 	snprintf(*buffpp, size, "week %d + %ld days + %ld.%07ld sec",
-		 tgpsp->wn, tgpsp->sec / 86400,
-		 tgpsp->sec % 86400, tgpsp->tick);
+		 tgpsp->wn, (long) tgpsp->sec / SECSPERDAY,
+		 (long) tgpsp->sec % SECSPERDAY, (long) tgpsp->tick);
 	*buffpp += strlen(*buffpp);
 }
 
@@ -295,19 +298,19 @@
 	)
 {
   int i;
-  
-  cfghp->csum = get_lsb_short(buffpp);
-  cfghp->valid = get_lsb_short(buffpp);
+
+  cfghp->csum = (CSUM) get_lsb_short(buffpp);
+  cfghp->valid = get_lsb_int16(buffpp);
   get_mbg_tgps(buffpp, &cfghp->tot_51);
   get_mbg_tgps(buffpp, &cfghp->tot_63);
   get_mbg_tgps(buffpp, &cfghp->t0a);
 
-  for (i = MIN_SVNO; i <= MAX_SVNO; i++)
+  for (i = 0; i < N_SVNO_GPS; i++)
     {
       get_mbg_cfg(buffpp, &cfghp->cfg[i]);
     }
-  
-  for (i = MIN_SVNO; i <= MAX_SVNO; i++)
+
+  for (i = 0; i < N_SVNO_GPS; i++)
     {
       get_mbg_health(buffpp, &cfghp->health[i]);
     }
@@ -319,23 +322,23 @@
 	UTC *utcp
 	)
 {
-  utcp->csum  = get_lsb_short(buffpp);
-  utcp->valid = get_lsb_short(buffpp);
+  utcp->csum  = (CSUM) get_lsb_short(buffpp);
+  utcp->valid = get_lsb_int16(buffpp);
 
   get_mbg_tgps(buffpp, &utcp->t0t);
-  
+
   if (fetch_ieee754(buffpp, IEEE_DOUBLE, &utcp->A0, mbg_double) != IEEE_OK)
     {
       L_CLR(&utcp->A0);
     }
-  
+
   if (fetch_ieee754(buffpp, IEEE_DOUBLE, &utcp->A1, mbg_double) != IEEE_OK)
     {
       L_CLR(&utcp->A1);
     }
 
-  utcp->WNlsf      = get_lsb_short(buffpp);
-  utcp->DNt        = get_lsb_short(buffpp);
+  utcp->WNlsf      = get_lsb_uint16(buffpp);
+  utcp->DNt        = get_lsb_int16(buffpp);
   utcp->delta_tls  = *(*buffpp)++;
   utcp->delta_tlsf = *(*buffpp)++;
 }
@@ -347,7 +350,7 @@
 	)
 {
   int i;
-  
+
   for (i = LAT; i <= ALT; i++)
     {
       if  (fetch_ieee754(buffpp, IEEE_DOUBLE, &lla[i], mbg_double) != IEEE_OK)
@@ -369,7 +372,7 @@
 	)
 {
   int i;
-  
+
   for (i = XP; i <= ZP; i++)
     {
       if  (fetch_ieee754(buffpp, IEEE_DOUBLE, &xyz[i], mbg_double) != IEEE_OK)
@@ -386,13 +389,13 @@
 	)
 {
   size_t i;
-  
+
   comparamp->baud_rate = get_lsb_long(buffpp);
   for (i = 0; i < sizeof(comparamp->framing); i++)
     {
       comparamp->framing[i] = *(*buffpp)++;
     }
-  comparamp->handshake = get_lsb_short(buffpp);
+  comparamp->handshake = get_lsb_int16(buffpp);
 }
 
 void
@@ -402,12 +405,12 @@
 	)
 {
   int i;
-  
-  for (i = 0; i < N_COM; i++)
+
+  for (i = 0; i < DEFAULT_N_COM; i++)
     {
       get_mbg_comparam(buffpp, &portparamp->com[i]);
     }
-  for (i = 0; i < N_COM; i++)
+  for (i = 0; i < DEFAULT_N_COM; i++)
     {
       portparamp->mode[i] = *(*buffpp)++;
     }
@@ -418,20 +421,20 @@
 	{									\
 	  L_CLR(addr);								\
 	}
-	
+
 void
 get_mbg_eph(
 	unsigned char ** buffpp,
 	EPH *ephp
 	)
 {
-  ephp->csum   = get_lsb_short(buffpp);
-  ephp->valid  = get_lsb_short(buffpp);
-  
-  ephp->health = get_lsb_short(buffpp);
-  ephp->IODC   = get_lsb_short(buffpp);
-  ephp->IODE2  = get_lsb_short(buffpp);
-  ephp->IODE3  = get_lsb_short(buffpp);
+  ephp->csum   = (CSUM) get_lsb_short(buffpp);
+  ephp->valid  = get_lsb_int16(buffpp);
+
+  ephp->health = (HEALTH) get_lsb_short(buffpp);
+  ephp->IODC   = (IOD) get_lsb_short(buffpp);
+  ephp->IODE2  = (IOD) get_lsb_short(buffpp);
+  ephp->IODE3  = (IOD) get_lsb_short(buffpp);
 
   get_mbg_tgps(buffpp, &ephp->tt);
   get_mbg_tgps(buffpp, &ephp->t0c);
@@ -458,7 +461,7 @@
   FETCH_DOUBLE(buffpp, &ephp->af2);
   FETCH_DOUBLE(buffpp, &ephp->tgd);
 
-  ephp->URA = get_lsb_short(buffpp);
+  ephp->URA = get_lsb_uint16(buffpp);
 
   ephp->L2code = *(*buffpp)++;
   ephp->L2flag = *(*buffpp)++;
@@ -470,10 +473,10 @@
 	ALM *almp
 	)
 {
-  almp->csum   = get_lsb_short(buffpp);
-  almp->valid  = get_lsb_short(buffpp);
-  
-  almp->health = get_lsb_short(buffpp);
+  almp->csum   = (CSUM) get_lsb_short(buffpp);
+  almp->valid  = get_lsb_int16(buffpp);
+
+  almp->health = (HEALTH) get_lsb_short(buffpp);
   get_mbg_tgps(buffpp, &almp->t0a);
 
 
@@ -495,8 +498,8 @@
 	IONO *ionop
 	)
 {
-  ionop->csum   = get_lsb_short(buffpp);
-  ionop->valid  = get_lsb_short(buffpp);
+  ionop->csum   = (CSUM) get_lsb_short(buffpp);
+  ionop->valid  = get_lsb_int16(buffpp);
 
   FETCH_DOUBLE(buffpp, &ionop->alpha_0);
   FETCH_DOUBLE(buffpp, &ionop->alpha_1);
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/libparse/gpstolfp.c /cur/src/external/bsd/ntp/dist/libparse/gpstolfp.c
--- external/bsd/ntp/dist/libparse/gpstolfp.c	2014-12-24 18:28:09.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/libparse/gpstolfp.c	2015-04-07 19:51:17.000000000 -0700
@@ -36,25 +36,24 @@
  */
 #include <config.h>
 #include "ntp_fp.h"
-
-#define GPSORIGIN	2524953600UL	/* NTP origin - GPS origin in seconds */
-#define SECSPERWEEK	(unsigned)(604800)	/* seconds per week - GPS tells us about weeks */
-#define GPSWRAP		990	/* assume week count less than this in the previous epoch */
+#include "ntp_calendar.h"
+#include "parse.h"
 
 void
 gpstolfp(
-	 int weeks,
+	 int sweeks,
 	 int days,
 	 unsigned long  seconds,
 	 l_fp * lfp
 	 )
 {
+  unsigned int weeks = sweeks;
   if (weeks < GPSWRAP)
     {
-      weeks += 1024;
+      weeks += GPSWEEKS;
     }
 
-  lfp->l_ui = weeks * SECSPERWEEK + days * 86400 + seconds + GPSORIGIN; /* convert to NTP time */
+  lfp->l_ui = (uint32_t)(weeks * SECSPERWEEK + days * SECSPERDAY + seconds + GPSORIGIN); /* convert to NTP time */
   lfp->l_uf = 0;
 }
 
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/libparse/info_trimble.c /cur/src/external/bsd/ntp/dist/libparse/info_trimble.c
--- external/bsd/ntp/dist/libparse/info_trimble.c	2014-12-24 18:28:09.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/libparse/info_trimble.c	2015-04-07 19:51:17.000000000 -0700
@@ -3,7 +3,8 @@
 /*
  * Automatically generated - do not modify
  */
-#include "config.h"
+
+#include <config.h>
 #include "ntp_types.h"
 #include "ntpd.h"
 #include "trimble.h"
@@ -93,4 +94,3 @@
 	{ CMD_RSUPER, "CMD_RSUPER", "super paket (0x8F)", "", 0 },
 	{ 0xFF, "", "", "", 0 }
 };
-
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/libparse/mkinfo_rcmd.sed /cur/src/external/bsd/ntp/dist/libparse/mkinfo_rcmd.sed
--- external/bsd/ntp/dist/libparse/mkinfo_rcmd.sed	2013-12-27 15:30:50.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/libparse/mkinfo_rcmd.sed	2015-04-07 19:51:17.000000000 -0700
@@ -4,5 +4,5 @@
 cmd_info_t trimble_rcmds[] = {
 s!^#define[ \	][ \	]*\(CMD_R[^ \	]*\)[ \	][ \	]*\([^ \	]*\)[ \	][ \	]*/\*[ \	][ \	]*\(.*\)[ \	]*:\([^:]*\):\([^:]*\)[ \	][ \	]*\*/!\	{ \1, "\1", "\3 (\2)", "\4", \5 },!p
 $a\
-\	{ 0xFF, "", "" }\
+\	{ 0xFF, "", "", "", 0 }\
 };
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/libparse/mkinfo_scmd.sed /cur/src/external/bsd/ntp/dist/libparse/mkinfo_scmd.sed
--- external/bsd/ntp/dist/libparse/mkinfo_scmd.sed	2013-12-27 15:30:49.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/libparse/mkinfo_scmd.sed	2015-04-07 19:51:17.000000000 -0700
@@ -11,5 +11,5 @@
 cmd_info_t trimble_scmds[] = {
 s!^#define[ 	][ 	]*\(CMD_C[^ 	]*\)[ 	][ 	]*\([^ 	]*\)[ 	][ 	]*/\*[ 	][ 	]*\(.*\)[ 	][ 	]*\*/!	{ \1, "\1", "\3 (\2)", "", 0 },!p
 $a\
-\	{ 0xFF, "", "" }\
+\	{ 0xFF, "", "", "", 0 }\
 };
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/libparse/parse.c /cur/src/external/bsd/ntp/dist/libparse/parse.c
--- external/bsd/ntp/dist/libparse/parse.c	2014-12-24 18:28:09.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/libparse/parse.c	2015-04-07 19:51:17.000000000 -0700
@@ -2,7 +2,7 @@
 
 /*
  * /src/NTP/ntp4-dev/libparse/parse.c,v 4.20 2005/08/06 17:39:40 kardel RELEASE_20050806_A
- *  
+ *
  * parse.c,v 4.20 2005/08/06 17:39:40 kardel RELEASE_20050806_A
  *
  * Parser module for reference clock
@@ -14,7 +14,7 @@
  * when PARSEKERNEL is not defined NTP time stamps will be used.
  *
  * Copyright (c) 1995-2005 by Frank Kardel <kardel <AT> ntp.org>
- * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universität Erlangen-Nürnberg, Germany
+ * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universitaet Erlangen-Nuernberg, Germany
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -108,7 +108,7 @@
 
 	while (!(c = *s++ - *t++) && *s && *t)
 	    /* empty loop */;
-  
+
 	return c;
 }
 
@@ -156,10 +156,10 @@
 	)
 {
 	parseprintf(DD_PARSE, ("parse_iostart\n"));
-  
+
 	parseio->parse_plen = 0;
 	parseio->parse_pdata = (void *)0;
-  
+
 	parseio->parse_data = 0;
 	parseio->parse_ldata = 0;
 	parseio->parse_dsize = 0;
@@ -168,7 +168,7 @@
 	parseio->parse_ioflags   = PARSE_IO_CS7;	/* usual unix default */
 	parseio->parse_index     = 0;
 	parseio->parse_ldsize    = 0;
-  
+
 	return 1;
 }
 
@@ -190,15 +190,15 @@
 unsigned int
 parse_restart(
 	      parse_t *parseio,
-	      unsigned int ch
+	      char ch
 	      )
 {
 	unsigned int updated = PARSE_INP_SKIP;
-	
+
 	/*
 	 * re-start packet - timeout - overflow - start symbol
 	 */
-	
+
 	if (parseio->parse_index)
 	{
 		/*
@@ -210,17 +210,17 @@
 		parseio->parse_ldsize = parseio->parse_index;
 		updated = PARSE_INP_TIME;
 	}
-		
+
 	parseio->parse_index = 1;
 	parseio->parse_data[0] = ch;
 	parseprintf(DD_PARSE, ("parse: parse_restart: buffer start (updated = %x)\n", updated));
 	return updated;
 }
-	
+
 unsigned int
 parse_addchar(
 	      parse_t *parseio,
-	      unsigned int ch
+	      char ch
 	      )
 {
 	/*
@@ -241,7 +241,7 @@
 		 */
 		return parse_restart(parseio, ch);
 }
-	
+
 unsigned int
 parse_end(
 	  parse_t *parseio
@@ -262,11 +262,11 @@
 int
 parse_ioread(
 	register parse_t *parseio,
-	register unsigned int ch,
+	register char ch,
 	register timestamp_t *tstamp
 	)
 {
-	register unsigned updated = CVT_NONE;
+	register u_int updated = CVT_NONE;
 	/*
 	 * within STREAMS CSx (x < 8) chars still have the upper bits set
 	 * so we normalize the characters by masking unecessary bits off.
@@ -284,9 +284,9 @@
 	    case PARSE_IO_CS7:
 		ch &= 0x7F;
 		break;
-      
+
 	    case PARSE_IO_CS8:
-		ch &= 0xFF;
+		ch &= (char) 0xFFU;
 		break;
 	}
 
@@ -308,18 +308,18 @@
 		{
 			updated = CVT_OK;
 		}
-		
+
 		if (input_status & PARSE_INP_TIME)	/* time sample is available */
 		{
-			updated = timepacket(parseio);
+			updated = (u_int) timepacket(parseio);
 		}
-		  
+
 		if (input_status & PARSE_INP_DATA) /* got additional data */
 		{
 			updated |= CVT_ADDITIONAL;
 		}
 	}
-	
+
 
 	/*
 	 * remember last character time
@@ -355,7 +355,7 @@
 	register timestamp_t *ptime
 	)
 {
-	register unsigned updated = CVT_NONE;
+	register u_int updated = CVT_NONE;
 
 	/*
 	 * PPS pulse information will only be delivered to ONE clock format
@@ -366,7 +366,7 @@
 
 	if (clockformats[parseio->parse_lformat]->syncpps)
 	{
-		updated = clockformats[parseio->parse_lformat]->syncpps(parseio, status == SYNC_ONE, ptime);
+		updated = (u_int) clockformats[parseio->parse_lformat]->syncpps(parseio, status == SYNC_ONE, ptime);
 		parseprintf(DD_PARSE, ("parse_iopps: updated = 0x%x\n", updated));
 	}
 
@@ -405,13 +405,13 @@
 	)
 {
 #define SETRTC(_X_)	{ if (cvtrtc) *cvtrtc = (_X_); }
-	static int days_of_month[] = 
+	static int days_of_month[] =
 	{
 		0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31
 	};
 	register int i;
 	time_t t;
-  
+
 	if (clock_time->utctime)
 	    return clock_time->utctime;	/* if the conversion routine gets it right away - why not */
 
@@ -425,12 +425,12 @@
 		SETRTC(CVT_FAIL|CVT_BADDATE);
 		return -1;
 	}
-  
+
 	/*
 	 * sorry, slow section here - but it's not time critical anyway
 	 */
 	t = julian0(clock_time->year) - julian0(1970);		/* Y2kFixes */
-  				/* month */
+				/* month */
 	if (clock_time->month <= 0 || clock_time->month > 12)
 	{
 		SETRTC(CVT_FAIL|CVT_BADDATE);
@@ -468,7 +468,7 @@
 
 	t = TIMES24(t) + clock_time->hour;
 
-  				/* min */
+				/* min */
 	if (clock_time->minute < 0 || clock_time->minute > 59)
 	{
 		SETRTC(CVT_FAIL|CVT_BADTIME);
@@ -477,7 +477,7 @@
 
 	t = TIMES60(t) + clock_time->minute;
 				/* sec */
-  
+
 	if (clock_time->second < 0 || clock_time->second > 60)	/* allow for LEAPs */
 	{
 		SETRTC(CVT_FAIL|CVT_BADTIME);
@@ -512,7 +512,7 @@
 
 	while(*s == ' ')
 	    s++;
-  
+
 	if (*s == '-')
 	{
 		s++;
@@ -521,7 +521,7 @@
 	else
 	    if (*s == '+')
 		s++;
-  
+
 	for(;;)
 	{
 		c = *s++;
@@ -575,16 +575,16 @@
 	{
 		int s = splhigh();
 #endif
-  
+
 		parseio->parse_lstate          = parseio->parse_dtime.parse_state | flags | PARSEB_TIMECODE;
-    
+
 		parseio->parse_dtime.parse_state = parseio->parse_lstate;
 
 #ifdef PARSEKERNEL
 		(void)splx((unsigned int)s);
 	}
 #endif
-  
+
 
 #ifdef PARSEKERNEL
 	parseprintf(DD_PARSE, ("updatetimeinfo status=0x%x, time=%x\n", parseio->parse_dtime.parse_state,
@@ -593,7 +593,7 @@
 	parseprintf(DD_PARSE, ("updatetimeinfo status=0x%lx, time=%x\n", (long)parseio->parse_dtime.parse_state,
 	                       parseio->parse_dtime.parse_time.fp.l_ui));
 #endif
-	
+
 	return CVT_OK;		/* everything fine and dandy... */
 }
 
@@ -616,7 +616,7 @@
 }
 
 /*
- * pps_simple
+ * parse_pps_fnc_t pps_simple
  *
  * handle a pps time stamp
  */
@@ -630,12 +630,12 @@
 {
 	parseio->parse_dtime.parse_ptime  = *ptime;
 	parseio->parse_dtime.parse_state |= PARSEB_PPS|PARSEB_S_PPS;
-  
+
 	return CVT_NONE;
 }
 
 /*
- * pps_one
+ * parse_pps_fnc_t pps_one
  *
  * handle a pps time stamp in ONE edge
  */
@@ -649,12 +649,12 @@
 {
 	if (status)
 		return pps_simple(parseio, status, ptime);
-	
+
 	return CVT_NONE;
 }
 
 /*
- * pps_zero
+ * parse_pps_fnc_t pps_zero
  *
  * handle a pps time stamp in ZERO edge
  */
@@ -668,7 +668,7 @@
 {
 	if (!status)
 		return pps_simple(parseio, status, ptime);
-	
+
 	return CVT_NONE;
 }
 
@@ -686,13 +686,13 @@
 	register time_t t;
 	u_long cvtrtc;		/* current conversion result */
 	clocktime_t clock_time;
-  
+
 	memset((char *)&clock_time, 0, sizeof clock_time);
 	format = parseio->parse_lformat;
 
 	if (format == (unsigned short)~0)
 		return CVT_NONE;
-	
+
 	switch ((cvtrtc = clockformats[format]->convert ?
 		 clockformats[format]->convert((unsigned char *)parseio->parse_ldata, parseio->parse_ldsize, (struct format *)(clockformats[format]->data), &clock_time, parseio->parse_pdata) :
 		 CVT_NONE) & CVT_MASK)
@@ -700,17 +700,17 @@
 	case CVT_FAIL:
 		parseio->parse_badformat++;
 		break;
-		
+
 	case CVT_NONE:
 		/*
 		 * too bad - pretend bad format
 		 */
 		parseio->parse_badformat++;
 		break;
-		
+
 	case CVT_OK:
 		break;
-		
+
 	case CVT_SKIP:
 		return CVT_NONE;
 
@@ -718,7 +718,7 @@
 		/* shouldn't happen */
 #ifndef PARSEKERNEL
 		msyslog(LOG_WARNING, "parse: INTERNAL error: bad return code of convert routine \"%s\"", clockformats[format]->name);
-#endif	  
+#endif
 		return CVT_FAIL|cvtrtc;
 	}
 
@@ -726,7 +726,7 @@
 	{
 		return CVT_FAIL|cvtrtc;
 	}
-  
+
 	/*
 	 * time stamp
 	 */
@@ -734,7 +734,7 @@
 	parseio->parse_dtime.parse_time.tv.tv_sec  = t;
 	parseio->parse_dtime.parse_time.tv.tv_usec = clock_time.usecond;
 #else
-	parseio->parse_dtime.parse_time.fp.l_ui = t + JAN_1970;
+	parseio->parse_dtime.parse_time.fp.l_ui = (uint32_t) (t + JAN_1970);
 	TVUTOTSF(clock_time.usecond, parseio->parse_dtime.parse_time.fp.l_uf);
 #endif
 
@@ -760,7 +760,7 @@
 	 */
 	dct->parsegettc.parse_badformat = parse->parse_badformat;
 	parse->parse_badformat = 0;
-		  
+
 	if (parse->parse_ldsize <= PARSE_TCMAX)
 	{
 		dct->parsegettc.parse_count = parse->parse_ldsize;
@@ -773,7 +773,7 @@
 	}
 }
 
-		  
+
 /*ARGSUSED*/
 int
 parse_setfmt(
@@ -794,7 +794,7 @@
 					if (parse->parse_pdata)
 						FREE(parse->parse_pdata, parse->parse_plen);
 					parse->parse_pdata = 0;
-					
+
 					parse->parse_plen = clockformats[i]->plen;
 
 					if (parse->parse_plen)
@@ -811,9 +811,9 @@
 					if (parse->parse_data)
 						FREE(parse->parse_data, (unsigned)(parse->parse_dsize * 2 + 2));
 					parse->parse_ldata = parse->parse_data = 0;
-					
+
 					parse->parse_dsize = clockformats[i]->length;
-					
+
 					if (parse->parse_dsize)
 					{
 						parse->parse_data = (char*)MALLOC((unsigned)(parse->parse_dsize * 2 + 2));
@@ -822,20 +822,20 @@
 							if (parse->parse_pdata)
 								FREE(parse->parse_pdata, parse->parse_plen);
 							parse->parse_pdata = 0;
-							
+
 							parseprintf(DD_PARSE, ("init failed: malloc for data area failed\n"));
 							return 0;
 						}
 					}
-					
+
 
 					/*
 					 * leave room for '\0'
 					 */
 					parse->parse_ldata     = parse->parse_data + parse->parse_dsize + 1;
-					
+
 					parse->parse_lformat  = i;
-					
+
 					return 1;
 				}
 			}
@@ -854,7 +854,7 @@
 	if (dct->parseformat.parse_format < nformats &&
 	    Strlen(clockformats[dct->parseformat.parse_format]->name) <= PARSE_TCMAX)
 	{
-		dct->parseformat.parse_count = Strlen(clockformats[dct->parseformat.parse_format]->name)+1;
+		dct->parseformat.parse_count = (unsigned short) (Strlen(clockformats[dct->parseformat.parse_format]->name) + 1);
 		memcpy(dct->parseformat.parse_buffer, clockformats[dct->parseformat.parse_format]->name, dct->parseformat.parse_count);
 		return 1;
 	}
@@ -872,7 +872,7 @@
 	)
 {
 	parse->parse_ioflags &= ~PARSE_IO_CSIZE;
-	parse->parse_ioflags |= dct->parsesetcs.parse_cs & PARSE_IO_CSIZE;
+	parse->parse_ioflags |= (int) (dct->parsesetcs.parse_cs & PARSE_IO_CSIZE);
 	return 1;
 }
 
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/libparse/parse_conf.c /cur/src/external/bsd/ntp/dist/libparse/parse_conf.c
--- external/bsd/ntp/dist/libparse/parse_conf.c	2014-12-24 18:28:09.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/libparse/parse_conf.c	2015-04-07 19:51:17.000000000 -0700
@@ -2,7 +2,7 @@
 
 /*
  * /src/NTP/ntp4-dev/libparse/parse_conf.c,v 4.9 2005/04/16 17:32:10 kardel RELEASE_20050508_A
- *  
+ *
  * parse_conf.c,v 4.9 2005/04/16 17:32:10 kardel RELEASE_20050508_A
  *
  * Parser configuration module for reference clocks
@@ -14,7 +14,7 @@
  * when STREAM is not defined NTP time stamps will be used.
  *
  * Copyright (c) 1995-2005 by Frank Kardel <kardel <AT> ntp.org>
- * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universität Erlangen-Nürnberg, Germany
+ * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universitaet Erlangen-Nuernberg, Germany
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/libparse/parsesolaris.c /cur/src/external/bsd/ntp/dist/libparse/parsesolaris.c
--- external/bsd/ntp/dist/libparse/parsesolaris.c	2014-12-24 18:28:09.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/libparse/parsesolaris.c	2015-04-07 19:51:17.000000000 -0700
@@ -2,13 +2,13 @@
 
 /*
  * /src/NTP/ntp4-dev/libparse/parsesolaris.c,v 4.11 2005/04/16 17:32:10 kardel RELEASE_20050508_A
- *  
+ *
  * parsesolaris.c,v 4.11 2005/04/16 17:32:10 kardel RELEASE_20050508_A
  *
  * STREAMS module for reference clocks
  *
  * Copyright (c) 1995-2005 by Frank Kardel <kardel <AT> ntp.org>
- * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universität Erlangen-Nürnberg, Germany
+ * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universitaet Erlangen-Nuernberg, Germany
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -76,7 +76,7 @@
 
 extern struct mod_ops mod_strmodops;
 
-static struct modlstrmod modlstrmod = 
+static struct modlstrmod modlstrmod =
 {
 	&mod_strmodops,		/* a STREAMS module */
 	"PARSE      - NTP reference",	/* name this baby - keep room for revision number */
@@ -102,13 +102,13 @@
      )
 {
 	static char revision[] = "4.6";
-	char *s, *S; 
+	char *s, *S;
 	char *t;
-  
+
 #ifndef lint
 	t = rcsid;
 #endif
-	
+
 	/*
 	 * copy RCS revision into Drv_name
 	 *
@@ -127,20 +127,20 @@
 		}
 		if (*s == ' ') s++;
 	}
-	  
-	t = modlstrmod.strmod_linkinfo; 
+
+	t = modlstrmod.strmod_linkinfo;
 	while (*t && (*t != ' '))
 	{
 		t++;
 	}
 	if (*t == ' ') t++;
-	  
+
 	S = s;
 	while (*S && (((*S >= '0') && (*S <= '9')) || (*S == '.')))
 	{
 		S++;
 	}
-	  
+
 	if (*s && *t && (S > s))
 	{
 		if (strlen(t) >= (S - s))
@@ -310,7 +310,7 @@
 	}
 	else
 	{
-		pprintf(DD_OPEN, "parse: setup_stream - FAILED - no MEMORY for allocb\n"); 
+		pprintf(DD_OPEN, "parse: setup_stream - FAILED - no MEMORY for allocb\n");
 		return 0;
 	}
 }
@@ -327,18 +327,18 @@
 {
 	register parsestream_t *parse;
 	static int notice = 0;
-  
-	pprintf(DD_OPEN, "parse: OPEN - q=%x\n", q); 
-  
+
+	pprintf(DD_OPEN, "parse: OPEN - q=%x\n", q);
+
 	if (sflag != MODOPEN)
 	{			/* open only for modules */
-		pprintf(DD_OPEN, "parse: OPEN - FAILED - not MODOPEN\n"); 
+		pprintf(DD_OPEN, "parse: OPEN - FAILED - not MODOPEN\n");
 		return EIO;
 	}
 
 	if (q->q_ptr != (caddr_t)NULL)
 	{
-		pprintf(DD_OPEN, "parse: OPEN - FAILED - EXCLUSIVE ONLY\n"); 
+		pprintf(DD_OPEN, "parse: OPEN - FAILED - EXCLUSIVE ONLY\n");
 		return EBUSY;
 	}
 
@@ -348,10 +348,10 @@
 		return ENOMEM;
 	}
 
-	pprintf(DD_OPEN, "parse: OPEN - parse area q=%x, q->q_ptr=%x\n", q, q->q_ptr); 
+	pprintf(DD_OPEN, "parse: OPEN - parse area q=%x, q->q_ptr=%x\n", q, q->q_ptr);
 	WR(q)->q_ptr = q->q_ptr;
-	pprintf(DD_OPEN, "parse: OPEN - WQ parse area q=%x, q->q_ptr=%x\n", WR(q), WR(q)->q_ptr); 
-  
+	pprintf(DD_OPEN, "parse: OPEN - WQ parse area q=%x, q->q_ptr=%x\n", WR(q), WR(q)->q_ptr);
+
 	parse = (parsestream_t *) q->q_ptr;
 	bzero((caddr_t)parse, sizeof(*parse));
 	parse->parse_queue     = q;
@@ -362,7 +362,7 @@
 
 	qprocson(q);
 
-	pprintf(DD_OPEN, "parse: OPEN - initializing io subsystem q=%x\n", q); 
+	pprintf(DD_OPEN, "parse: OPEN - initializing io subsystem q=%x\n", q);
 
 	if (!parse_ioinit(&parse->parse_io))
 	{
@@ -376,12 +376,12 @@
 		return EIO;
 	}
 
-	pprintf(DD_OPEN, "parse: OPEN - initializing stream q=%x\n", q); 
+	pprintf(DD_OPEN, "parse: OPEN - initializing stream q=%x\n", q);
 
 	if (setup_stream(q, M_PARSE))
 	{
 		(void) init_linemon(q);	/* hook up PPS ISR routines if possible */
-		pprintf(DD_OPEN, "parse: OPEN - SUCCEEDED\n"); 
+		pprintf(DD_OPEN, "parse: OPEN - SUCCEEDED\n");
 
 		/*
 		 * I know that you know the delete key, but you didn't write this
@@ -414,19 +414,19 @@
 {
 	register parsestream_t *parse = (parsestream_t *)q->q_ptr;
 	register unsigned long s;
-  
+
 	pprintf(DD_CLOSE, "parse: CLOSE\n");
-  
+
 	qprocsoff(q);
 
 	s = splhigh();
-  
+
 	if (parse->parse_dqueue)
 	    close_linemon(parse->parse_dqueue, q);
 	parse->parse_dqueue = (queue_t *)0;
 
 	(void) splx(s);
-      
+
 	parse_ioend(&parse->parse_io);
 
 	kmem_free((caddr_t)parse, sizeof(parsestream_t));
@@ -446,7 +446,7 @@
 	  )
 {
 	mblk_t *mp;
-  
+
 	while ((mp = getq(q)))
 	{
 		if (canputnext(q) || (mp->b_datap->db_type > QPCTL))
@@ -479,15 +479,15 @@
 	register mblk_t *datap;
 	register struct iocblk *iocp;
 	parsestream_t         *parse = (parsestream_t *)q->q_ptr;
-  
+
 	pprintf(DD_WPUT, "parse: parsewput\n");
-  
+
 	switch (mp->b_datap->db_type)
 	{
 	    default:
 		putnext(q, mp);
 		break;
-      
+
 	    case M_IOCTL:
 		iocp = (void *)mp->b_rptr;
 		switch (iocp->ioc_cmd)
@@ -521,7 +521,7 @@
 			iocp->ioc_count = sizeof(struct ppsclockev);
 			qreply(q, mp);
 			break;
-	  
+
 		    case PARSEIOC_ENABLE:
 		    case PARSEIOC_DISABLE:
 			    {
@@ -539,7 +539,7 @@
 				    }
 				    qreply(q, mp);
 				    break;
-			    }	    
+			    }
 
 		    case PARSEIOC_TIMECODE:
 		    case PARSEIOC_SETFMT:
@@ -555,7 +555,7 @@
 					pprintf(DD_WPUT, "parse: parsewput - PARSEIOC_TIMECODE\n");
 					ok = parse_timecode(dct, &parse->parse_io);
 					break;
-		  
+
 				    case PARSEIOC_SETFMT:
 					pprintf(DD_WPUT, "parse: parsewput - PARSEIOC_SETFMT\n");
 					ok = parse_setfmt(dct, &parse->parse_io);
@@ -602,7 +602,7 @@
 		else
 		{
 			register mblk_t *mmp = *mp;
-	  
+
 			*mp = (*mp)->b_cont;
 			freeb(mmp);
 		}
@@ -621,7 +621,7 @@
 {
 	register unsigned char type;
 	mblk_t *mp = imp;
-  
+
 	switch (type = mp->b_datap->db_type)
 	{
 	    default:
@@ -638,7 +638,7 @@
 		else
 		    putq(q, mp);
 		break;
-      
+
 	    case M_BREAK:
 	    case M_DATA:
 		    {
@@ -693,7 +693,7 @@
 								if (nmp) freemsg(nmp);
 							    parse_iodone(&parse->parse_io);
 						    }
-					    }	
+					    }
 				    }
 				    else
 				    {
@@ -735,7 +735,7 @@
 			    gethrestime(&hres_time);
 			    c_time.tv.tv_sec  = hres_time.tv_sec;
 			    c_time.tv.tv_usec = hres_time.tv_nsec / 1000;
-	
+
 			    pprintf(DD_RPUT, "parse: parserput - M_%sHANGUP\n", (type == M_HANGUP) ? "" : "UN");
 
 			    if ((parse->parse_status & PARSE_ENABLE) &&
@@ -760,7 +760,7 @@
 				}
 				else
 				    putq(q, mp);
-	
+
 			    if (status)
 			    {
 				    parse->parse_ppsclockev.tv = c_time.tv;
@@ -782,7 +782,7 @@
 	     )
 {
 	register queue_t *dq;
-  
+
 	dq = WR(q);
 	/*
 	 * we ARE doing very bad things down here (basically stealing ISR
@@ -918,14 +918,14 @@
 			szs->zsops.zsop_xsint = (void (*) (struct zscom *))zs_xsisr; /* place our bastard */
 			szs->oldzsops         = zs->zs_ops;
 			emergencyzs           = zs->zs_ops;
-	  
+
 			zs->zs_ops = &szs->zsops; /* hook it up */
 			/*
-			 * XXX: this is usually done via zsopinit() 
+			 * XXX: this is usually done via zsopinit()
 			 * - have yet to find a way to call that routine
 			 */
 			zs->zs_xsint          = (void (*) (struct zscom *))zs_xsisr;
-	  
+
 			mutex_exit(zs->zs_excl);
 
 			pprintf(DD_INSTALL, "init_zs_linemon: CD monitor installed\n");
@@ -936,7 +936,7 @@
 }
 
 /*
- * unregister our ISR routine - must call under splhigh() (or 
+ * unregister our ISR routine - must call under splhigh() (or
  * whatever block ZS status interrupts)
  */
 static void
@@ -972,7 +972,7 @@
 		mutex_exit(zs->zs_excl);
 
 		kmem_free((caddr_t)szs, sizeof (struct savedzsops));
-      
+
 		pprintf(DD_INSTALL, "close_zs_linemon: CD monitor deleted\n");
 		return;
 	}
@@ -1007,7 +1007,7 @@
 	{
 		timestamp_t cdevent;
 		register int status;
-      
+
 		/*
 		 * time stamp
 		 */
@@ -1026,7 +1026,7 @@
 		 * ok - now the hard part - find ourself
 		 */
 		loopcheck = MAXDEPTH;
-      
+
 		while (q)
 		{
 			if (q->q_qinfo && q->q_qinfo->qi_minfo)
@@ -1054,7 +1054,7 @@
 						 */
 						parse_iodone(&((parsestream_t *)q->q_ptr)->parse_io);
 					}
-		  
+
 					if (status)
 					{
 						((parsestream_t *)q->q_ptr)->parse_ppsclockev.tv = cdevent.tv;
@@ -1093,9 +1093,9 @@
 			SCC_WRITE0(ZSWR0_RESET_STATUS); /* might kill other conditions here */
 			return;
 		}
-	}      
+	}
 
-	pprintf(DD_ISR, "zs_xsisr: non CD event 0x%x for \"%s\"\n", 
+	pprintf(DD_ISR, "zs_xsisr: non CD event 0x%x for \"%s\"\n",
 		(za->za_rr0 ^ zsstatus) & ~ZSRR0_CD,dname);
 	/*
 	 * we are now gathered here to process some unusual external status
@@ -1110,7 +1110,7 @@
 	q = za->za_ttycommon.t_readq;
 
 	loopcheck = MAXDEPTH;
-      
+
 	/*
 	 * the real thing for everything else ...
 	 */
@@ -1122,7 +1122,7 @@
 			if (!strcmp(dname, parseinfo.st_rdinit->qi_minfo->mi_idname))
 			{
 				register void (*zsisr) (struct zscom *);
-		  
+
 				/*
 				 * back home - phew (hopping along stream queues might
 				 * prove dangerous to your health)
@@ -1131,7 +1131,7 @@
 				    zsisr(zs);
 				else
 				    panic("zs_xsisr: unable to locate original ISR");
-		  
+
 				pprintf(DD_ISR, "zs_xsisr: non CD event was processed for \"%s\"\n", dname);
 				/*
 				 * now back to our program ...
@@ -1153,7 +1153,7 @@
 	 * corrupted TTY structures
 	 */
 	printf("zs_zsisr: looking for \"%s\" - found \"%s\" - taking EMERGENCY path\n", parseinfo.st_rdinit->qi_minfo->mi_idname, dname ? dname : "-NIL-");
-      
+
 	if (emergencyzs && emergencyzs->zsop_xsint)
 	    emergencyzs->zsop_xsint(zs);
 	else
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/libparse/parsestreams.c /cur/src/external/bsd/ntp/dist/libparse/parsestreams.c
--- external/bsd/ntp/dist/libparse/parsestreams.c	2014-12-24 18:28:09.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/libparse/parsestreams.c	2015-04-07 19:51:17.000000000 -0700
@@ -2,14 +2,14 @@
 
 /*
  * /src/NTP/ntp4-dev/libparse/parsestreams.c,v 4.11 2005/04/16 17:32:10 kardel RELEASE_20050508_A
- *  
+ *
  * parsestreams.c,v 4.11 2005/04/16 17:32:10 kardel RELEASE_20050508_A
  *
  * STREAMS module for reference clocks
  * (SunOS4.x)
  *
  * Copyright (c) 1995-2005 by Frank Kardel <kardel <AT> ntp.org>
- * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universität Erlangen-Nürnberg, Germany
+ * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universitaet Erlangen-Nuernberg, Germany
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -112,7 +112,7 @@
 #else
 static char mnam[] = "PARSE        ";	/* name this baby - keep room for revision number */
 #endif
-struct vdldrv parsesync_vd = 
+struct vdldrv parsesync_vd =
 {
 	VDMAGIC_PSEUDO,		/* nothing like a real driver - a STREAMS module */
 	mnam,
@@ -168,7 +168,7 @@
 
 	while (!(c = *s++ - *t++) && *s && *t)
 	    /* empty loop */;
-  
+
 	return c;
 }
 
@@ -188,10 +188,10 @@
 
 	while (n-- && !(c = *s++ - *t++) && *s && *t)
 	    /* empty loop */;
-  
+
 	return c;
 }
- 
+
 void
 ntp_memset(
 	char *a,
@@ -219,12 +219,12 @@
 {
 	extern struct fmodsw fmodsw[];
 	extern int fmodcnt;
-  
+
 	struct fmodsw *fm    = fmodsw;
 	struct fmodsw *fmend = &fmodsw[fmodcnt];
 	struct fmodsw *ifm   = (struct fmodsw *)0;
 	char *mname          = parseinfo.st_rdinit->qi_minfo->mi_idname;
-  
+
 	switch (fc)
 	{
 	    case VDLOAD:
@@ -235,13 +235,13 @@
 		 */
 		while (fm <= fmend)
 		{
-	  if (!Strncmp(fm->f_name, mname, FMNAMESZ))
+			if (!Strncmp(fm->f_name, mname, FMNAMESZ))
 			{
 				printf("vddrinit[%s]: STREAMS module already loaded.\n", mname);
 				return(EBUSY);
 			}
 			else
-			    if ((ifm == (struct fmodsw *)0) && 
+			    if ((ifm == (struct fmodsw *)0) &&
 				(fm->f_name[0] == '\0') &&
 				(fm->f_str == (struct streamtab *)0))
 			    {
@@ -263,7 +263,7 @@
 		{
 			static char revision[] = "4.7";
 			char *s, *S, *t;
-	  
+
 			s = rcsid;		/* NOOP - keep compilers happy */
 
 			Strncpy(ifm->f_name, mname, FMNAMESZ);
@@ -287,20 +287,20 @@
 				}
 				if (*s == ' ') s++;
 			}
-	  
-			t = parsesync_vd.Drv_name; 
+
+			t = parsesync_vd.Drv_name;
 			while (*t && (*t != ' '))
 			{
 				t++;
 			}
 			if (*t == ' ') t++;
-	  
+
 			S = s;
 			while (*S && (((*S >= '0') && (*S <= '9')) || (*S == '.')))
 			{
 				S++;
 			}
-	  
+
 			if (*s && *t && (S > s))
 			{
 				if (Strlen(t) >= (S - s))
@@ -309,9 +309,9 @@
 				}
 			}
 			return (0);
-		} 
+		}
 		break;
-      
+
 	    case VDUNLOAD:
 		if (parsebusy > 0)
 		{
@@ -330,7 +330,7 @@
 					fm->f_name[0] = '\0';
 					fm->f_str = (struct streamtab *)0;
 					fm++;
-		  
+
 					break;
 				}
 				fm++;
@@ -343,14 +343,14 @@
 			else
 			    return (0);
 		}
-      
+
 
 	    case VDSTAT:
 		return (0);
 
 	    default:
 		return (EIO);
-      
+
 	}
 	return EIO;
 }
@@ -462,7 +462,7 @@
 	}
 	else
 	{
-		parseprintf(DD_OPEN,("parse: setup_stream - FAILED - no MEMORY for allocb\n")); 
+		parseprintf(DD_OPEN,("parse: setup_stream - FAILED - no MEMORY for allocb\n"));
 		return 0;
 	}
 }
@@ -478,37 +478,37 @@
 {
 	register parsestream_t *parse;
 	static int notice = 0;
-  
-	parseprintf(DD_OPEN,("parse: OPEN\n")); 
-  
+
+	parseprintf(DD_OPEN,("parse: OPEN\n"));
+
 	if (sflag != MODOPEN)
 	{			/* open only for modules */
-		parseprintf(DD_OPEN,("parse: OPEN - FAILED - not MODOPEN\n")); 
+		parseprintf(DD_OPEN,("parse: OPEN - FAILED - not MODOPEN\n"));
 		return OPENFAIL;
 	}
 
 	if (q->q_ptr != (caddr_t)NULL)
 	{
 		u.u_error = EBUSY;
-		parseprintf(DD_OPEN,("parse: OPEN - FAILED - EXCLUSIVE ONLY\n")); 
+		parseprintf(DD_OPEN,("parse: OPEN - FAILED - EXCLUSIVE ONLY\n"));
 		return OPENFAIL;
 	}
 
 #ifdef VDDRV
 	parsebusy++;
 #endif
-  
+
 	q->q_ptr = (caddr_t)kmem_alloc(sizeof(parsestream_t));
 	if (q->q_ptr == (caddr_t)0)
 	{
-		parseprintf(DD_OPEN,("parse: OPEN - FAILED - no memory\n")); 
+		parseprintf(DD_OPEN,("parse: OPEN - FAILED - no memory\n"));
 #ifdef VDDRV
 		parsebusy--;
 #endif
 		return OPENFAIL;
 	}
 	WR(q)->q_ptr = q->q_ptr;
-  
+
 	parse = (parsestream_t *)(void *)q->q_ptr;
 	bzero((caddr_t)parse, sizeof(*parse));
 	parse->parse_queue     = q;
@@ -533,7 +533,7 @@
 	{
 		(void) init_linemon(q);	/* hook up PPS ISR routines if possible */
 
-		parseprintf(DD_OPEN,("parse: OPEN - SUCCEEDED\n")); 
+		parseprintf(DD_OPEN,("parse: OPEN - SUCCEEDED\n"));
 
 		/*
 		 * I know that you know the delete key, but you didn't write this
@@ -571,17 +571,17 @@
 {
 	register parsestream_t *parse = (parsestream_t *)(void *)q->q_ptr;
 	register unsigned long s;
-  
+
 	parseprintf(DD_CLOSE,("parse: CLOSE\n"));
-  
+
 	s = splhigh();
-  
+
 	if (parse->parse_dqueue)
 	    close_linemon(parse->parse_dqueue, q);
 	parse->parse_dqueue = (queue_t *)0;
 
 	(void) splx(s);
-      
+
 	parse_ioend(&parse->parse_io);
 
 	kmem_free((caddr_t)parse, sizeof(parsestream_t));
@@ -604,7 +604,7 @@
 	)
 {
 	mblk_t *mp;
-  
+
 	while ((mp = getq(q)))
 	{
 		if (canput(q->q_next) || (mp->b_datap->db_type > QPCTL))
@@ -637,15 +637,15 @@
 	register mblk_t *datap;
 	register struct iocblk *iocp;
 	parsestream_t         *parse = (parsestream_t *)(void *)q->q_ptr;
-  
+
 	parseprintf(DD_WPUT,("parse: parsewput\n"));
-  
+
 	switch (mp->b_datap->db_type)
 	{
 	    default:
 		putnext(q, mp);
 		break;
-      
+
 	    case M_IOCTL:
 		    iocp = (struct iocblk *)(void *)mp->b_rptr;
 		switch (iocp->ioc_cmd)
@@ -678,7 +678,7 @@
 			iocp->ioc_count = sizeof(struct ppsclockev);
 			qreply(q, mp);
 			break;
-	  
+
 		    case PARSEIOC_ENABLE:
 		    case PARSEIOC_DISABLE:
 			    {
@@ -696,7 +696,7 @@
 				    }
 				    qreply(q, mp);
 				    break;
-			    }	    
+			    }
 
 		    case PARSEIOC_TIMECODE:
 		    case PARSEIOC_SETFMT:
@@ -712,7 +712,7 @@
 					parseprintf(DD_WPUT,("parse: parsewput - PARSEIOC_TIMECODE\n"));
 					ok = parse_timecode(dct, &parse->parse_io);
 					break;
-		  
+
 				    case PARSEIOC_SETFMT:
 					parseprintf(DD_WPUT,("parse: parsewput - PARSEIOC_SETFMT\n"));
 					ok = parse_setfmt(dct, &parse->parse_io);
@@ -759,7 +759,7 @@
 		else
 		{
 			register mblk_t *mmp = *mp;
-	  
+
 			*mp = (*mp)->b_cont;
 			freeb(mmp);
 		}
@@ -777,7 +777,7 @@
 	)
 {
 	unsigned char type;
-  
+
 	switch (type = mp->b_datap->db_type)
 	{
 	    default:
@@ -793,7 +793,7 @@
 		else
 		    putq(q, mp);
 		break;
-      
+
 	    case M_BREAK:
 	    case M_DATA:
 		    {
@@ -846,7 +846,7 @@
 								if (nmp) freemsg(nmp);
 							    parse_iodone(&parse->parse_io);
 						    }
-					    }	
+					    }
 				    }
 				    else
 				    {
@@ -885,7 +885,7 @@
 			    register int status = cd_invert ^ (type == M_UNHANGUP);
 
 			    uniqtime(&ctime.tv);
-	
+
 			    parseprintf(DD_RPUT,("parse: parserput - M_%sHANGUP\n", (type == M_HANGUP) ? "" : "UN"));
 
 			    if ((parse->parse_status & PARSE_ENABLE) &&
@@ -910,7 +910,7 @@
 				}
 				else
 				    putq(q, mp);
-	
+
 			    if (status)
 			    {
 				    parse->parse_ppsclockev.tv = ctime.tv;
@@ -932,7 +932,7 @@
 	)
 {
 	register queue_t *dq;
-  
+
 	dq = WR(q);
 	/*
 	 * we ARE doing very bad things down here (basically stealing ISR
@@ -1040,7 +1040,7 @@
 	else
 	{
 		unsigned long s;
-      
+
 		/*
 		 * we do a direct replacement, in case others fiddle also
 		 * if somebody else grabs our hook and we disconnect
@@ -1066,9 +1066,9 @@
 			szs->zsops.zsop_xsint = zs_xsisr; /* place our bastard */
 			szs->oldzsops         = zs->zs_ops;
 			emergencyzs           = zs->zs_ops;
-	  
+
 			zsopinit(zs, &szs->zsops); /* hook it up */
-	  
+
 			(void) splx(s);
 
 			parseprintf(DD_INSTALL, ("init_zs_linemon: CD monitor installed\n"));
@@ -1101,11 +1101,11 @@
 	else
 	{
 		register struct savedzsops *szs = (struct savedzsops *)parsestream->parse_data;
-      
+
 		zsopinit(zs, szs->oldzsops); /* reset to previous handler functions */
 
 		kmem_free((caddr_t)szs, sizeof (struct savedzsops));
-      
+
 		parseprintf(DD_INSTALL, ("close_zs_linemon: CD monitor deleted\n"));
 		return;
 	}
@@ -1150,7 +1150,7 @@
 	{
 		timestamp_t cdevent;
 		register int status;
-      
+
 		za->za_rr0 = (za->za_rr0 & ~(cdmask)) | (zsstatus & (cdmask));
 
 #ifdef PPS_SYNC
@@ -1165,7 +1165,7 @@
 		 * time stamp
 		 */
 		uniqtime(&cdevent.tv);
-      
+
 #ifdef PPS_SYNC
 		(void)splx(s);
 #endif
@@ -1192,7 +1192,7 @@
 		 * ok - now the hard part - find ourself
 		 */
 		loopcheck = MAXDEPTH;
-      
+
 		while (q)
 		{
 			if (q->q_qinfo && q->q_qinfo->qi_minfo)
@@ -1220,7 +1220,7 @@
 						 */
 						parse_iodone(&((parsestream_t *)(void *)q->q_ptr)->parse_io);
 					}
-		  
+
 					if (status)
 					{
 						((parsestream_t *)(void *)q->q_ptr)->parse_ppsclockev.tv = cdevent.tv;
@@ -1253,13 +1253,13 @@
 			zsaddr->zscc_control = ZSWR0_RESET_STATUS; /* might kill other conditions here */
 			return 0;
 		}
-	}      
+	}
 
 	if (zsstatus & cdmask)	/* fake CARRIER status */
 		za->za_flags |= ZAS_CARR_ON;
 	else
 		za->za_flags &= ~ZAS_CARR_ON;
-	
+
 	/*
 	 * we are now gathered here to process some unusual external status
 	 * interrupts.
@@ -1273,7 +1273,7 @@
 	q = za->za_ttycommon.t_readq;
 
 	loopcheck = MAXDEPTH;
-      
+
 	/*
 	 * the real thing for everything else ...
 	 */
@@ -1285,7 +1285,7 @@
 			if (!Strcmp(dname, parseinfo.st_rdinit->qi_minfo->mi_idname))
 			{
 				register int (*zsisr) (struct zscom *);
-		  
+
 				/*
 				 * back home - phew (hopping along stream queues might
 				 * prove dangerous to your health)
@@ -1294,7 +1294,7 @@
 					return zsisr(zs);
 				else
 				    panic("zs_xsisr: unable to locate original ISR");
-		  
+
 				parseprintf(DD_ISR, ("zs_xsisr: non CD event was processed for \"%s\"\n", dname));
 				/*
 				 * now back to our program ...
@@ -1316,7 +1316,7 @@
 	 * corrupted TTY structures
 	 */
 	printf("zs_zsisr: looking for \"%s\" - found \"%s\" - taking EMERGENCY path\n", parseinfo.st_rdinit->qi_minfo->mi_idname, dname ? dname : "-NIL-");
-      
+
 	if (emergencyzs && emergencyzs->zsop_xsint)
 	    emergencyzs->zsop_xsint(zs);
 	else
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/libparse/trim_info.c /cur/src/external/bsd/ntp/dist/libparse/trim_info.c
--- external/bsd/ntp/dist/libparse/trim_info.c	2014-12-24 18:28:09.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/libparse/trim_info.c	2015-04-07 19:51:17.000000000 -0700
@@ -8,7 +8,7 @@
  * $Created: Sun Aug  2 20:20:34 1998 $
  *
  * Copyright (c) 1995-2005 by Frank Kardel <kardel <AT> ntp.org>
- * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universität Erlangen-Nürnberg, Germany
+ * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universitaet Erlangen-Nuernberg, Germany
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/ntpd/Makefile.am /cur/src/external/bsd/ntp/dist/ntpd/Makefile.am
--- external/bsd/ntp/dist/ntpd/Makefile.am	2014-12-19 12:37:39.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/ntpd/Makefile.am	2015-04-07 19:51:17.000000000 -0700
@@ -90,7 +90,7 @@
 
 LDADD_NTPD_COMMON  = $(LDADD_LIBNTP) $(LIBOPTS_LDADD) $(PTHREAD_LIBS)
 LDADD_NTPD_COMMON += $(LIBM) $(LDADD_NTP) $(LSCF)
-ntpd_LDADD = $(LDADD) ../libntp/libntp.a $(LDADD_LIBNTP) $(LIBM) $(LDADD_NTPD_COMMON)
+ntpd_LDADD = $(LDADD) ../libntp/libntp.a $(LDADD_NTPD_COMMON) $(LDADD_LIBUTIL)
 ntpdsim_LDADD = $(LDADD) ../libntp/libntpsim.a $(LDADD_NTPD_COMMON)
 ntpdsim_CPPFLAGS = $(AM_CPPFLAGS) -DSIM
 check_y2k_LDADD = $(LDADD) ../libntp/libntp.a $(LDADD_LIBNTP) $(LIBM) $(LDADD_LIBNTP) $(PTHREAD_LIBS)
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/ntpd/Makefile.in /cur/src/external/bsd/ntp/dist/ntpd/Makefile.in
--- external/bsd/ntp/dist/ntpd/Makefile.in	2014-12-19 12:37:40.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/ntpd/Makefile.in	2015-04-07 19:51:17.000000000 -0700
@@ -52,8 +52,7 @@
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
 	$(top_srcdir)/sntp/libopts/m4/stdnoreturn.m4 \
-	$(top_srcdir)/sntp/libevent/m4/openldap-thread-check.m4 \
-	$(top_srcdir)/sntp/libevent/m4/openldap.m4 \
+	$(top_srcdir)/sntp/m4/ax_c99_struct_init.m4 \
 	$(top_srcdir)/sntp/m4/define_dir.m4 \
 	$(top_srcdir)/sntp/m4/hms_search_lib.m4 \
 	$(top_srcdir)/sntp/m4/libtool.m4 \
@@ -82,6 +81,8 @@
 	$(top_srcdir)/sntp/m4/ntp_sntp.m4 \
 	$(top_srcdir)/sntp/m4/ntp_ver_suffix.m4 \
 	$(top_srcdir)/sntp/m4/ntp_vpathhack.m4 \
+	$(top_srcdir)/sntp/m4/openldap-thread-check.m4 \
+	$(top_srcdir)/sntp/m4/openldap.m4 \
 	$(top_srcdir)/sntp/m4/os_cflags.m4 \
 	$(top_srcdir)/sntp/m4/snprintf.m4 \
 	$(top_srcdir)/sntp/m4/version.m4 $(top_srcdir)/configure.ac
@@ -158,8 +159,7 @@
 	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
 	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
 ntpd_DEPENDENCIES = $(am__DEPENDENCIES_2) ../libntp/libntp.a \
-	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
-	$(am__DEPENDENCIES_3)
+	$(am__DEPENDENCIES_3) $(am__DEPENDENCIES_1)
 am__objects_2 = ntpdsim-ntp_config.$(OBJEXT) ntpdsim-ntp_io.$(OBJEXT) \
 	ntpdsim-ntp_parser.$(OBJEXT) ntpdsim-ntp_scanner.$(OBJEXT) \
 	ntpdsim-ntpd.$(OBJEXT) ntpdsim-ntpd-opts.$(OBJEXT) \
@@ -256,6 +256,7 @@
 CONFIG_SHELL = @CONFIG_SHELL@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
+CPPFLAGS_LIBEVENT = @CPPFLAGS_LIBEVENT@
 CPPFLAGS_NTP = @CPPFLAGS_NTP@
 CXX = @CXX@
 CXXCPP = @CXXCPP@
@@ -290,7 +291,9 @@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 LD = @LD@
+LDADD_LIBEVENT = @LDADD_LIBEVENT@
 LDADD_LIBNTP = @LDADD_LIBNTP@
+LDADD_LIBUTIL = @LDADD_LIBUTIL@
 LDADD_NLIST = @LDADD_NLIST@
 LDADD_NTP = @LDADD_NTP@
 LDFLAGS = @LDFLAGS@
@@ -429,6 +432,11 @@
 TIMETRIM_DS = @TIMETRIM_DS@
 TIMETRIM_MS = @TIMETRIM_MS@
 TIMETRIM_NI = @TIMETRIM_NI@
+UPDATE_LEAP_DB = @UPDATE_LEAP_DB@
+UPDATE_LEAP_DL = @UPDATE_LEAP_DL@
+UPDATE_LEAP_DS = @UPDATE_LEAP_DS@
+UPDATE_LEAP_MS = @UPDATE_LEAP_MS@
+UPDATE_LEAP_NI = @UPDATE_LEAP_NI@
 VERSION = @VERSION@
 VER_SUFFIX = @VER_SUFFIX@
 YACC = @YACC@
@@ -537,7 +545,7 @@
 # longer a reason to have ntpdbase-opts.def split off of ntpd-opts.def.
 LDADD_NTPD_COMMON = $(LDADD_LIBNTP) $(LIBOPTS_LDADD) $(PTHREAD_LIBS) \
 	$(LIBM) $(LDADD_NTP) $(LSCF)
-ntpd_LDADD = $(LDADD) ../libntp/libntp.a $(LDADD_LIBNTP) $(LIBM) $(LDADD_NTPD_COMMON)
+ntpd_LDADD = $(LDADD) ../libntp/libntp.a $(LDADD_NTPD_COMMON) $(LDADD_LIBUTIL)
 ntpdsim_LDADD = $(LDADD) ../libntp/libntpsim.a $(LDADD_NTPD_COMMON)
 ntpdsim_CPPFLAGS = $(AM_CPPFLAGS) -DSIM
 check_y2k_LDADD = $(LDADD) ../libntp/libntp.a $(LDADD_LIBNTP) $(LIBM) $(LDADD_LIBNTP) $(PTHREAD_LIBS)
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/ntpd/cmd_args.c /cur/src/external/bsd/ntp/dist/ntpd/cmd_args.c
--- external/bsd/ntp/dist/ntpd/cmd_args.c	2014-12-24 18:28:09.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/ntpd/cmd_args.c	2015-04-07 19:51:17.000000000 -0700
@@ -78,6 +78,9 @@
 	if (HAVE_OPT( PANICGATE ))
 		allow_panic = TRUE;
 
+	if (HAVE_OPT( FORCE_STEP_ONCE ))
+		force_step_once = TRUE;
+
 #ifdef HAVE_DROPROOT
 	if (HAVE_OPT( JAILDIR )) {
 		droproot = 1;
@@ -177,14 +180,14 @@
 
 	if (HAVE_OPT( UPDATEINTERVAL )) {
 		long val = OPT_VALUE_UPDATEINTERVAL;
-			  
+
 		if (val >= 0)
 			interface_interval = val;
 		else {
-			fprintf(stderr, 
+			fprintf(stderr,
 				"command line interface update interval %ld must not be negative\n",
 				val);
-			msyslog(LOG_ERR, 
+			msyslog(LOG_ERR,
 				"command line interface update interval %ld must not be negative",
 				val);
 			errflg++;
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/ntpd/invoke-ntp.conf.texi /cur/src/external/bsd/ntp/dist/ntpd/invoke-ntp.conf.texi
--- external/bsd/ntp/dist/ntpd/invoke-ntp.conf.texi	2014-12-19 12:37:41.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/ntpd/invoke-ntp.conf.texi	2015-04-07 19:51:17.000000000 -0700
@@ -6,7 +6,7 @@
 #
 # EDIT THIS FILE WITH CAUTION  (invoke-ntp.conf.texi)
 #
-# It has been AutoGen-ed  December 19, 2014 at 07:49:02 AM by AutoGen 5.18.5pre4
+# It has been AutoGen-ed  April  7, 2015 at 04:25:50 AM by AutoGen 5.18.5pre4
 # From the definitions    ntp.conf.def
 # and the template file   agtexi-file.tpl
 @end ignore
@@ -365,6 +365,20 @@
 both the server and client should operate using symmetric-key or
 public-key authentication as described in
 @ref{Authentication Options}.
+@item @code{mdnstries} @kbd{number}
+If we are participating in mDNS,
+after we have synched for the first time
+we attempt to register with the mDNS system.
+If that registration attempt fails,
+we try again at one minute intervals for up to
+@code{mdnstries}
+times.
+After all,
+@code{ntpd}
+may be starting before mDNS.
+The default value for
+@code{mdnstries}
+is 5.
 @end table
 @node Authentication Support
 @subsection Authentication Support
@@ -2468,7 +2482,7 @@
 the names of all peer variables and the
 @code{clock_var_list}
 holds the names of the reference clock variables.
-@item @code{tinker} @code{[@code{allan} @kbd{allan} | @code{dispersion} @kbd{dispersion} | @code{freq} @kbd{freq} | @code{huffpuff} @kbd{huffpuff} | @code{panic} @kbd{panic} | @code{step} @kbd{srep} | @code{stepout} @kbd{stepout}]}
+@item @code{tinker} @code{[@code{allan} @kbd{allan} | @code{dispersion} @kbd{dispersion} | @code{freq} @kbd{freq} | @code{huffpuff} @kbd{huffpuff} | @code{panic} @kbd{panic} | @code{step} @kbd{step} | @code{stepback} @kbd{stepback} | @code{stepfwd} @kbd{stepfwd} | @code{stepout} @kbd{stepout}]}
 This command can be used to alter several system variables in
 very exceptional circumstances.
 It should occur in the
@@ -2525,6 +2539,19 @@
 Note: The kernel time discipline is
 disabled if the step threshold is set to zero or greater than the
 default.
+@item @code{stepback} @kbd{stepback}
+The argument is the step threshold for the backward direction,
+which by default is 0.128 s.
+It can
+be set to any positive number in seconds.
+If both the forward and backward step thresholds are set to zero, step
+adjustments will never occur.
+Note: The kernel time discipline is
+disabled if
+each direction of step threshold are either
+set to zero or greater than .5 second.
+@item @code{stepfwd} @kbd{stepfwd}
+As for stepback, but for the forward direction.
 @item @code{stepout} @kbd{stepout}
 The argument is the stepout timeout, which by default is 900 s.
 It can
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/ntpd/invoke-ntp.keys.texi /cur/src/external/bsd/ntp/dist/ntpd/invoke-ntp.keys.texi
--- external/bsd/ntp/dist/ntpd/invoke-ntp.keys.texi	2014-12-19 12:37:40.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/ntpd/invoke-ntp.keys.texi	2015-04-07 19:51:17.000000000 -0700
@@ -6,7 +6,7 @@
 #
 # EDIT THIS FILE WITH CAUTION  (invoke-ntp.keys.texi)
 #
-# It has been AutoGen-ed  December 19, 2014 at 07:49:05 AM by AutoGen 5.18.5pre4
+# It has been AutoGen-ed  April  7, 2015 at 04:25:52 AM by AutoGen 5.18.5pre4
 # From the definitions    ntp.keys.def
 # and the template file   agtexi-file.tpl
 @end ignore
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/ntpd/invoke-ntpd.texi /cur/src/external/bsd/ntp/dist/ntpd/invoke-ntpd.texi
--- external/bsd/ntp/dist/ntpd/invoke-ntpd.texi	2014-12-19 12:37:40.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/ntpd/invoke-ntpd.texi	2015-04-07 19:51:17.000000000 -0700
@@ -6,7 +6,7 @@
 #
 # EDIT THIS FILE WITH CAUTION  (invoke-ntpd.texi)
 #
-# It has been AutoGen-ed  December 19, 2014 at 07:49:06 AM by AutoGen 5.18.5pre4
+# It has been AutoGen-ed  April  7, 2015 at 04:25:54 AM by AutoGen 5.18.5pre4
 # From the definitions    ntpd-opts.def
 # and the template file   agtexi-cmd.tpl
 @end ignore
@@ -95,6 +95,7 @@
 * ntpd configfile::             configfile option (-c)
 * ntpd driftfile::              driftfile option (-f)
 * ntpd panicgate::              panicgate option (-g)
+* ntpd force-step-once::        force-step-once option (-G)
 * ntpd jaildir::                jaildir option (-i)
 * ntpd interface::              interface option (-I)
 * ntpd keyfile::                keyfile option (-k)
@@ -141,7 +142,7 @@
 
 @exampleindent 0
 @example
-ntpd - NTP daemon program - Ver. 4.2.8
+ntpd - NTP daemon program - Ver. 4.2.8p2
 Usage:  ntpd [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]... \
                 [ <server1> ... <serverN> ]
   Flg Arg Option-Name    Description
@@ -162,6 +163,7 @@
    -f Str driftfile      frequency drift file name
    -g no  panicgate      Allow the first adjustment to be Big
                                 - may appear multiple times
+   -G no  force-step-once Step any initial offset correction.
    -i Str jaildir        Jail directory
    -I Str interface      Listen on an interface name or address
                                 - may appear multiple times
@@ -298,7 +300,7 @@
 by default.
 This is the same operation as the
 @code{driftfile} @kbd{driftfile}
-configuration specification in the 
+configuration specification in the
 @file{/etc/ntp.conf}
 file.
 @node ntpd panicgate
@@ -326,6 +328,21 @@
 See the
 @code{tinker}
 configuration file directive for other options.
+@node ntpd force-step-once
+@subsection force-step-once option (-G)
+@cindex ntpd-force-step-once
+
+This is the ``step any initial offset correction.'' option.
+Normally,
+@code{ntpd}
+steps the time if the time offset exceeds the step threshold,
+which is 128 ms by default, and otherwise slews the time.
+This option forces the initial offset correction to be stepped,
+so the highest time accuracy can be achieved quickly.
+However, this may also cause the time to be stepped back
+so this option must not be used if
+applications requiring monotonic time are running.
+See the @code{tinker} configuration file directive for other options.
 @node ntpd jaildir
 @subsection jaildir option (-i)
 @cindex ntpd-jaildir
@@ -370,7 +387,7 @@
 given interface name.  This option may appear multiple times.  This option
 also implies not opening other addresses, except wildcard and localhost.
 This option is deprecated. Please consider using the configuration file
-@code{interface} command, which is more versatile. 
+@code{interface} command, which is more versatile.
 @node ntpd keyfile
 @subsection keyfile option (-k)
 @cindex ntpd-keyfile
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/ntpd/keyword-gen-utd /cur/src/external/bsd/ntp/dist/ntpd/keyword-gen-utd
--- external/bsd/ntp/dist/ntpd/keyword-gen-utd	2013-12-27 15:30:54.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/ntpd/keyword-gen-utd	2015-04-07 19:51:17.000000000 -0700
@@ -1 +1 @@
- *	 Generated 2013-08-04 04:56:14 UTC	  diff_ignore_line
+ *	 Generated 2015-03-16 09:05:44 UTC	  diff_ignore_line
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/ntpd/keyword-gen.c /cur/src/external/bsd/ntp/dist/ntpd/keyword-gen.c
--- external/bsd/ntp/dist/ntpd/keyword-gen.c	2014-12-24 18:28:09.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/ntpd/keyword-gen.c	2015-04-07 19:51:17.000000000 -0700
@@ -208,6 +208,8 @@
 { "filenum",		T_Filenum,		FOLLBY_TOKEN },
 /* tinker_option */
 { "step",		T_Step,			FOLLBY_TOKEN },
+{ "stepback",		T_Stepback,		FOLLBY_TOKEN },
+{ "stepfwd",		T_Stepfwd,		FOLLBY_TOKEN },
 { "panic",		T_Panic,		FOLLBY_TOKEN },
 { "dispersion",		T_Dispersion,		FOLLBY_TOKEN },
 { "stepout",		T_Stepout,		FOLLBY_TOKEN },
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/ntpd/ntp.conf.5man /cur/src/external/bsd/ntp/dist/ntpd/ntp.conf.5man
--- external/bsd/ntp/dist/ntpd/ntp.conf.5man	2014-12-19 12:37:42.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/ntpd/ntp.conf.5man	2015-04-07 19:51:17.000000000 -0700
@@ -10,11 +10,11 @@
 .ds B-Font B
 .ds I-Font I
 .ds R-Font R
-.TH ntp.conf 5man "19 Dec 2014" "4.2.8" "File Formats"
+.TH ntp.conf 5man "07 Apr 2015" "4.2.8p2" "File Formats"
 .\"
-.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-eCaa6b/ag-rCai4b)
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-gKaW.1/ag-tKaO91)
 .\"
-.\" It has been AutoGen-ed December 19, 2014 at 07:48:49 AM by AutoGen 5.18.5pre4
+.\" It has been AutoGen-ed April 7, 2015 at 04:25:37 AM by AutoGen 5.18.5pre4
 .\" From the definitions ntp.conf.def
 .\" and the template file agman-cmd.tpl
 .SH NAME
@@ -415,6 +415,21 @@
 both the server and client should operate using symmetric-key or
 public-key authentication as described in
 \fIAuthentication\f[] \fIOptions\f[].
+.TP 7
+.NOP \f\*[B-Font]mdnstries\f[] \f\*[I-Font]number\f[]
+If we are participating in mDNS,
+after we have synched for the first time
+we attempt to register with the mDNS system.
+If that registration attempt fails,
+we try again at one minute intervals for up to
+\f\*[B-Font]mdnstries\f[]
+times.
+After all,
+\f\*[B-Font]ntpd\f[]
+may be starting before mDNS.
+The default value for
+\f\*[B-Font]mdnstries\f[]
+is 5.
 .PP
 .SH Authentication Support
 Authentication support allows the NTP client to verify that the
@@ -2771,7 +2786,7 @@
 \fIclock_var_list\f[]
 holds the names of the reference clock variables.
 .TP 7
-.NOP \f\*[B-Font]tinker\f[] [\f\*[B-Font]allan\f[] \f\*[I-Font]allan\f[] | \f\*[B-Font]dispersion\f[] \f\*[I-Font]dispersion\f[] | \f\*[B-Font]freq\f[] \f\*[I-Font]freq\f[] | \f\*[B-Font]huffpuff\f[] \f\*[I-Font]huffpuff\f[] | \f\*[B-Font]panic\f[] \f\*[I-Font]panic\f[] | \f\*[B-Font]step\f[] \f\*[I-Font]srep\f[] | \f\*[B-Font]stepout\f[] \f\*[I-Font]stepout\f[]]
+.NOP \f\*[B-Font]tinker\f[] [\f\*[B-Font]allan\f[] \f\*[I-Font]allan\f[] | \f\*[B-Font]dispersion\f[] \f\*[I-Font]dispersion\f[] | \f\*[B-Font]freq\f[] \f\*[I-Font]freq\f[] | \f\*[B-Font]huffpuff\f[] \f\*[I-Font]huffpuff\f[] | \f\*[B-Font]panic\f[] \f\*[I-Font]panic\f[] | \f\*[B-Font]step\f[] \f\*[I-Font]step\f[] | \f\*[B-Font]stepback\f[] \f\*[I-Font]stepback\f[] | \f\*[B-Font]stepfwd\f[] \f\*[I-Font]stepfwd\f[] | \f\*[B-Font]stepout\f[] \f\*[I-Font]stepout\f[]]
 This command can be used to alter several system variables in
 very exceptional circumstances.
 It should occur in the
@@ -2837,6 +2852,21 @@
 disabled if the step threshold is set to zero or greater than the
 default.
 .TP 7
+.NOP \f\*[B-Font]stepback\f[] \f\*[I-Font]stepback\f[]
+The argument is the step threshold for the backward direction,
+which by default is 0.128 s.
+It can
+be set to any positive number in seconds.
+If both the forward and backward step thresholds are set to zero, step
+adjustments will never occur.
+Note: The kernel time discipline is
+disabled if
+each direction of step threshold are either
+set to zero or greater than .5 second.
+.TP 7
+.NOP \f\*[B-Font]stepfwd\f[] \f\*[I-Font]stepfwd\f[]
+As for stepback, but for the forward direction.
+.TP 7
 .NOP \f\*[B-Font]stepout\f[] \f\*[I-Font]stepout\f[]
 The argument is the stepout timeout, which by default is 900 s.
 It can
@@ -2974,9 +3004,9 @@
 .PP
 
 .SH "AUTHORS"
-The University of Delaware
+The University of Delaware and Network Time Foundation
 .SH "COPYRIGHT"
-Copyright (C) 1970-2014 The University of Delaware all rights reserved.
+Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation all rights reserved.
 This program is released under the terms of the NTP license, <http://ntp.org/license>.
 .SH BUGS
 The syntax checking is not picky; some combinations of
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/ntpd/ntp.conf.5mdoc /cur/src/external/bsd/ntp/dist/ntpd/ntp.conf.5mdoc
--- external/bsd/ntp/dist/ntpd/ntp.conf.5mdoc	2014-12-19 12:37:42.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/ntpd/ntp.conf.5mdoc	2015-04-07 19:51:17.000000000 -0700
@@ -1,9 +1,9 @@
-.Dd December 19 2014
+.Dd April 7 2015
 .Dt NTP_CONF 5mdoc File Formats
 .Os
 .\"  EDIT THIS FILE WITH CAUTION  (ntp.mdoc)
 .\"
-.\"  It has been AutoGen-ed  December 19, 2014 at 07:49:09 AM by AutoGen 5.18.5pre4
+.\"  It has been AutoGen-ed  April  7, 2015 at 04:25:57 AM by AutoGen 5.18.5pre4
 .\"  From the definitions    ntp.conf.def
 .\"  and the template file   agmdoc-cmd.tpl
 .Sh NAME
@@ -402,6 +402,20 @@
 both the server and client should operate using symmetric\-key or
 public\-key authentication as described in
 .Sx Authentication Options .
+.It Ic mdnstries Ar number
+If we are participating in mDNS,
+after we have synched for the first time
+we attempt to register with the mDNS system.
+If that registration attempt fails,
+we try again at one minute intervals for up to
+.Ic mdnstries
+times.
+After all,
+.Ic ntpd
+may be starting before mDNS.
+The default value for
+.Ic mdnstries
+is 5.
 .El
 .Sh Authentication Support
 Authentication support allows the NTP client to verify that the
@@ -2604,7 +2618,9 @@
 .Cm freq Ar freq |
 .Cm huffpuff Ar huffpuff |
 .Cm panic Ar panic |
-.Cm step Ar srep |
+.Cm step Ar step |
+.Cm stepback Ar stepback |
+.Cm stepfwd Ar stepfwd |
 .Cm stepout Ar stepout
 .Oc
 .Xc
@@ -2664,6 +2680,19 @@
 Note: The kernel time discipline is
 disabled if the step threshold is set to zero or greater than the
 default.
+.It Cm stepback Ar stepback
+The argument is the step threshold for the backward direction,
+which by default is 0.128 s.
+It can
+be set to any positive number in seconds.
+If both the forward and backward step thresholds are set to zero, step
+adjustments will never occur.
+Note: The kernel time discipline is
+disabled if
+each direction of step threshold are either
+set to zero or greater than .5 second.
+.It Cm stepfwd Ar stepfwd
+As for stepback, but for the forward direction.
 .It Cm stepout Ar stepout
 The argument is the stepout timeout, which by default is 900 s.
 It can
@@ -2784,9 +2813,9 @@
 .%O RFC5905
 .Re
 .Sh "AUTHORS"
-The University of Delaware
+The University of Delaware and Network Time Foundation
 .Sh "COPYRIGHT"
-Copyright (C) 1970\-2014 The University of Delaware all rights reserved.
+Copyright (C) 1992\-2015 The University of Delaware and Network Time Foundation all rights reserved.
 This program is released under the terms of the NTP license, <http://ntp.org/license>.
 .Sh BUGS
 The syntax checking is not picky; some combinations of
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/ntpd/ntp.conf.def /cur/src/external/bsd/ntp/dist/ntpd/ntp.conf.def
--- external/bsd/ntp/dist/ntpd/ntp.conf.def	2014-12-19 12:37:42.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/ntpd/ntp.conf.def	2015-04-07 19:51:17.000000000 -0700
@@ -404,6 +404,20 @@
 both the server and client should operate using symmetric-key or
 public-key authentication as described in
 .Sx Authentication Options .
+.It Ic mdnstries Ar number
+If we are participating in mDNS,
+after we have synched for the first time
+we attempt to register with the mDNS system.
+If that registration attempt fails,
+we try again at one minute intervals for up to
+.Ic mdnstries
+times.
+After all,
+.Ic ntpd
+may be starting before mDNS.
+The default value for
+.Ic mdnstries
+is 5.
 .El
 .Sh Authentication Support
 Authentication support allows the NTP client to verify that the
@@ -2606,7 +2620,9 @@
 .Cm freq Ar freq |
 .Cm huffpuff Ar huffpuff |
 .Cm panic Ar panic |
-.Cm step Ar srep |
+.Cm step Ar step |
+.Cm stepback Ar stepback |
+.Cm stepfwd Ar stepfwd |
 .Cm stepout Ar stepout
 .Oc
 .Xc
@@ -2666,6 +2682,19 @@
 Note: The kernel time discipline is
 disabled if the step threshold is set to zero or greater than the
 default.
+.It Cm stepback Ar stepback
+The argument is the step threshold for the backward direction,
+which by default is 0.128 s.
+It can
+be set to any positive number in seconds.
+If both the forward and backward step thresholds are set to zero, step
+adjustments will never occur.
+Note: The kernel time discipline is
+disabled if
+each direction of step threshold are either
+set to zero or greater than .5 second.
+.It Cm stepfwd Ar stepfwd
+As for stepback, but for the forward direction.
 .It Cm stepout Ar stepout
 The argument is the stepout timeout, which by default is 900 s.
 It can
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/ntpd/ntp.conf.html /cur/src/external/bsd/ntp/dist/ntpd/ntp.conf.html
--- external/bsd/ntp/dist/ntpd/ntp.conf.html	2014-12-19 12:37:40.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/ntpd/ntp.conf.html	2015-04-07 19:51:17.000000000 -0700
@@ -33,7 +33,7 @@
 <p>This document describes the configuration file for the NTP Project's
 <code>ntpd</code> program.
 
-  <p>This document applies to version 4.2.8 of <code>ntp.conf</code>.
+  <p>This document applies to version 4.2.8p2 of <code>ntp.conf</code>.
 
   <div class="shortcontents">
 <h2>Short Contents</h2>
@@ -403,6 +403,19 @@
 both the server and client should operate using symmetric-key or
 public-key authentication as described in
 <a href="#Authentication-Options">Authentication Options</a>. 
+<br><dt><code>mdnstries</code> <kbd>number</kbd><dd>If we are participating in mDNS,
+after we have synched for the first time
+we attempt to register with the mDNS system. 
+If that registration attempt fails,
+we try again at one minute intervals for up to
+<code>mdnstries</code>
+times. 
+After all,
+<code>ntpd</code>
+may be starting before mDNS. 
+The default value for
+<code>mdnstries</code>
+is 5. 
 </dl>
 <div class="node">
 <p><hr>
@@ -2450,7 +2463,7 @@
 the names of all peer variables and the
 <code>clock_var_list</code>
 holds the names of the reference clock variables. 
-<br><dt><code>tinker</code> <code>[allan </code><kbd>allan</kbd><code> | dispersion </code><kbd>dispersion</kbd><code> | freq </code><kbd>freq</kbd><code> | huffpuff </code><kbd>huffpuff</kbd><code> | panic </code><kbd>panic</kbd><code> | step </code><kbd>srep</kbd><code> | stepout </code><kbd>stepout</kbd><code>]</code><dd>This command can be used to alter several system variables in
+<br><dt><code>tinker</code> <code>[allan </code><kbd>allan</kbd><code> | dispersion </code><kbd>dispersion</kbd><code> | freq </code><kbd>freq</kbd><code> | huffpuff </code><kbd>huffpuff</kbd><code> | panic </code><kbd>panic</kbd><code> | step </code><kbd>step</kbd><code> | stepback </code><kbd>stepback</kbd><code> | stepfwd </code><kbd>stepfwd</kbd><code> | stepout </code><kbd>stepout</kbd><code>]</code><dd>This command can be used to alter several system variables in
 very exceptional circumstances. 
 It should occur in the
 configuration file before any other configuration options. 
@@ -2500,6 +2513,17 @@
 Note: The kernel time discipline is
 disabled if the step threshold is set to zero or greater than the
 default. 
+<br><dt><code>stepback</code> <kbd>stepback</kbd><dd>The argument is the step threshold for the backward direction,
+which by default is 0.128 s. 
+It can
+be set to any positive number in seconds. 
+If both the forward and backward step thresholds are set to zero, step
+adjustments will never occur. 
+Note: The kernel time discipline is
+disabled if
+each direction of step threshold are either
+set to zero or greater than .5 second. 
+<br><dt><code>stepfwd</code> <kbd>stepfwd</kbd><dd>As for stepback, but for the forward direction. 
 <br><dt><code>stepout</code> <kbd>stepout</kbd><dd>The argument is the stepout timeout, which by default is 900 s. 
 It can
 be set to any positive number in seconds. 
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/ntpd/ntp.conf.man.in /cur/src/external/bsd/ntp/dist/ntpd/ntp.conf.man.in
--- external/bsd/ntp/dist/ntpd/ntp.conf.man.in	2014-12-19 12:37:39.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/ntpd/ntp.conf.man.in	2015-04-07 19:51:17.000000000 -0700
@@ -10,11 +10,11 @@
 .ds B-Font B
 .ds I-Font I
 .ds R-Font R
-.TH ntp.conf 5 "19 Dec 2014" "4.2.8" "File Formats"
+.TH ntp.conf 5 "07 Apr 2015" "4.2.8p2" "File Formats"
 .\"
-.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-eCaa6b/ag-rCai4b)
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-gKaW.1/ag-tKaO91)
 .\"
-.\" It has been AutoGen-ed December 19, 2014 at 07:48:49 AM by AutoGen 5.18.5pre4
+.\" It has been AutoGen-ed April 7, 2015 at 04:25:37 AM by AutoGen 5.18.5pre4
 .\" From the definitions ntp.conf.def
 .\" and the template file agman-cmd.tpl
 .SH NAME
@@ -415,6 +415,21 @@
 both the server and client should operate using symmetric-key or
 public-key authentication as described in
 \fIAuthentication\f[] \fIOptions\f[].
+.TP 7
+.NOP \f\*[B-Font]mdnstries\f[] \f\*[I-Font]number\f[]
+If we are participating in mDNS,
+after we have synched for the first time
+we attempt to register with the mDNS system.
+If that registration attempt fails,
+we try again at one minute intervals for up to
+\f\*[B-Font]mdnstries\f[]
+times.
+After all,
+\f\*[B-Font]ntpd\f[]
+may be starting before mDNS.
+The default value for
+\f\*[B-Font]mdnstries\f[]
+is 5.
 .PP
 .SH Authentication Support
 Authentication support allows the NTP client to verify that the
@@ -2771,7 +2786,7 @@
 \fIclock_var_list\f[]
 holds the names of the reference clock variables.
 .TP 7
-.NOP \f\*[B-Font]tinker\f[] [\f\*[B-Font]allan\f[] \f\*[I-Font]allan\f[] | \f\*[B-Font]dispersion\f[] \f\*[I-Font]dispersion\f[] | \f\*[B-Font]freq\f[] \f\*[I-Font]freq\f[] | \f\*[B-Font]huffpuff\f[] \f\*[I-Font]huffpuff\f[] | \f\*[B-Font]panic\f[] \f\*[I-Font]panic\f[] | \f\*[B-Font]step\f[] \f\*[I-Font]srep\f[] | \f\*[B-Font]stepout\f[] \f\*[I-Font]stepout\f[]]
+.NOP \f\*[B-Font]tinker\f[] [\f\*[B-Font]allan\f[] \f\*[I-Font]allan\f[] | \f\*[B-Font]dispersion\f[] \f\*[I-Font]dispersion\f[] | \f\*[B-Font]freq\f[] \f\*[I-Font]freq\f[] | \f\*[B-Font]huffpuff\f[] \f\*[I-Font]huffpuff\f[] | \f\*[B-Font]panic\f[] \f\*[I-Font]panic\f[] | \f\*[B-Font]step\f[] \f\*[I-Font]step\f[] | \f\*[B-Font]stepback\f[] \f\*[I-Font]stepback\f[] | \f\*[B-Font]stepfwd\f[] \f\*[I-Font]stepfwd\f[] | \f\*[B-Font]stepout\f[] \f\*[I-Font]stepout\f[]]
 This command can be used to alter several system variables in
 very exceptional circumstances.
 It should occur in the
@@ -2837,6 +2852,21 @@
 disabled if the step threshold is set to zero or greater than the
 default.
 .TP 7
+.NOP \f\*[B-Font]stepback\f[] \f\*[I-Font]stepback\f[]
+The argument is the step threshold for the backward direction,
+which by default is 0.128 s.
+It can
+be set to any positive number in seconds.
+If both the forward and backward step thresholds are set to zero, step
+adjustments will never occur.
+Note: The kernel time discipline is
+disabled if
+each direction of step threshold are either
+set to zero or greater than .5 second.
+.TP 7
+.NOP \f\*[B-Font]stepfwd\f[] \f\*[I-Font]stepfwd\f[]
+As for stepback, but for the forward direction.
+.TP 7
 .NOP \f\*[B-Font]stepout\f[] \f\*[I-Font]stepout\f[]
 The argument is the stepout timeout, which by default is 900 s.
 It can
@@ -2974,9 +3004,9 @@
 .PP
 
 .SH "AUTHORS"
-The University of Delaware
+The University of Delaware and Network Time Foundation
 .SH "COPYRIGHT"
-Copyright (C) 1970-2014 The University of Delaware all rights reserved.
+Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation all rights reserved.
 This program is released under the terms of the NTP license, <http://ntp.org/license>.
 .SH BUGS
 The syntax checking is not picky; some combinations of
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/ntpd/ntp.conf.mdoc.in /cur/src/external/bsd/ntp/dist/ntpd/ntp.conf.mdoc.in
--- external/bsd/ntp/dist/ntpd/ntp.conf.mdoc.in	2014-12-19 12:37:40.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/ntpd/ntp.conf.mdoc.in	2015-04-07 19:51:17.000000000 -0700
@@ -1,9 +1,9 @@
-.Dd December 19 2014
+.Dd April 7 2015
 .Dt NTP_CONF 5 File Formats
 .Os
 .\"  EDIT THIS FILE WITH CAUTION  (ntp.mdoc)
 .\"
-.\"  It has been AutoGen-ed  December 19, 2014 at 07:49:09 AM by AutoGen 5.18.5pre4
+.\"  It has been AutoGen-ed  April  7, 2015 at 04:25:57 AM by AutoGen 5.18.5pre4
 .\"  From the definitions    ntp.conf.def
 .\"  and the template file   agmdoc-cmd.tpl
 .Sh NAME
@@ -402,6 +402,20 @@
 both the server and client should operate using symmetric\-key or
 public\-key authentication as described in
 .Sx Authentication Options .
+.It Ic mdnstries Ar number
+If we are participating in mDNS,
+after we have synched for the first time
+we attempt to register with the mDNS system.
+If that registration attempt fails,
+we try again at one minute intervals for up to
+.Ic mdnstries
+times.
+After all,
+.Ic ntpd
+may be starting before mDNS.
+The default value for
+.Ic mdnstries
+is 5.
 .El
 .Sh Authentication Support
 Authentication support allows the NTP client to verify that the
@@ -2604,7 +2618,9 @@
 .Cm freq Ar freq |
 .Cm huffpuff Ar huffpuff |
 .Cm panic Ar panic |
-.Cm step Ar srep |
+.Cm step Ar step |
+.Cm stepback Ar stepback |
+.Cm stepfwd Ar stepfwd |
 .Cm stepout Ar stepout
 .Oc
 .Xc
@@ -2664,6 +2680,19 @@
 Note: The kernel time discipline is
 disabled if the step threshold is set to zero or greater than the
 default.
+.It Cm stepback Ar stepback
+The argument is the step threshold for the backward direction,
+which by default is 0.128 s.
+It can
+be set to any positive number in seconds.
+If both the forward and backward step thresholds are set to zero, step
+adjustments will never occur.
+Note: The kernel time discipline is
+disabled if
+each direction of step threshold are either
+set to zero or greater than .5 second.
+.It Cm stepfwd Ar stepfwd
+As for stepback, but for the forward direction.
 .It Cm stepout Ar stepout
 The argument is the stepout timeout, which by default is 900 s.
 It can
@@ -2784,9 +2813,9 @@
 .%O RFC5905
 .Re
 .Sh "AUTHORS"
-The University of Delaware
+The University of Delaware and Network Time Foundation
 .Sh "COPYRIGHT"
-Copyright (C) 1970\-2014 The University of Delaware all rights reserved.
+Copyright (C) 1992\-2015 The University of Delaware and Network Time Foundation all rights reserved.
 This program is released under the terms of the NTP license, <http://ntp.org/license>.
 .Sh BUGS
 The syntax checking is not picky; some combinations of
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/ntpd/ntp.keys.5man /cur/src/external/bsd/ntp/dist/ntpd/ntp.keys.5man
--- external/bsd/ntp/dist/ntpd/ntp.keys.5man	2014-12-19 12:37:39.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/ntpd/ntp.keys.5man	2015-04-07 19:51:17.000000000 -0700
@@ -1,8 +1,8 @@
-.TH ntp.keys 5man "19 Dec 2014" "4.2.8" "File Formats"
+.TH ntp.keys 5man "07 Apr 2015" "4.2.8p2" "File Formats"
 .\"
 .\"  EDIT THIS FILE WITH CAUTION  (ntp.man)
 .\"
-.\"  It has been AutoGen-ed  December 19, 2014 at 07:48:54 AM by AutoGen 5.18.5pre4
+.\"  It has been AutoGen-ed  April  7, 2015 at 04:25:42 AM by AutoGen 5.18.5pre4
 .\"  From the definitions    ntp.keys.def
 .\"  and the template file   agman-file.tpl
 .Sh NAME
@@ -158,9 +158,9 @@
 \fCntpdc\fR(1ntpdcmdoc)\f[],
 \fCsntp\fR(1sntpmdoc)\f[]
 .SH "AUTHORS"
-The University of Delaware
+The University of Delaware and Network Time Foundation
 .SH "COPYRIGHT"
-Copyright (C) 1970-2014 The University of Delaware all rights reserved.
+Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation all rights reserved.
 This program is released under the terms of the NTP license, <http://ntp.org/license>.
 .SH "BUGS"
 Please send bug reports to: http://bugs.ntp.org, bugs@ntp.org
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/ntpd/ntp.keys.5mdoc /cur/src/external/bsd/ntp/dist/ntpd/ntp.keys.5mdoc
--- external/bsd/ntp/dist/ntpd/ntp.keys.5mdoc	2014-12-19 12:37:40.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/ntpd/ntp.keys.5mdoc	2015-04-07 19:51:17.000000000 -0700
@@ -1,9 +1,9 @@
-.Dd December 19 2014
+.Dd April 7 2015
 .Dt NTP_KEYS 5mdoc File Formats
 .Os SunOS 5.10
 .\"  EDIT THIS FILE WITH CAUTION  (ntp.mdoc)
 .\"
-.\"  It has been AutoGen-ed  December 19, 2014 at 07:49:12 AM by AutoGen 5.18.5pre4
+.\"  It has been AutoGen-ed  April  7, 2015 at 04:26:00 AM by AutoGen 5.18.5pre4
 .\"  From the definitions    ntp.keys.def
 .\"  and the template file   agmdoc-file.tpl
 .Sh NAME
@@ -145,9 +145,9 @@
 .Xr ntpdc 1ntpdcmdoc ,
 .Xr sntp 1sntpmdoc
 .Sh "AUTHORS"
-The University of Delaware
+The University of Delaware and Network Time Foundation
 .Sh "COPYRIGHT"
-Copyright (C) 1970\-2014 The University of Delaware all rights reserved.
+Copyright (C) 1992\-2015 The University of Delaware and Network Time Foundation all rights reserved.
 This program is released under the terms of the NTP license, <http://ntp.org/license>.
 .Sh "BUGS"
 Please send bug reports to: http://bugs.ntp.org, bugs@ntp.org
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/ntpd/ntp.keys.html /cur/src/external/bsd/ntp/dist/ntpd/ntp.keys.html
--- external/bsd/ntp/dist/ntpd/ntp.keys.html	2014-12-19 12:37:41.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/ntpd/ntp.keys.html	2015-04-07 19:51:17.000000000 -0700
@@ -33,7 +33,7 @@
 <p>This document describes the symmetric key file for the NTP Project's
 <code>ntpd</code> program.
 
-  <p>This document applies to version 4.2.8 of <code>ntp.keys</code>.
+  <p>This document applies to version 4.2.8p2 of <code>ntp.keys</code>.
 
   <div class="shortcontents">
 <h2>Short Contents</h2>
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/ntpd/ntp.keys.man.in /cur/src/external/bsd/ntp/dist/ntpd/ntp.keys.man.in
--- external/bsd/ntp/dist/ntpd/ntp.keys.man.in	2014-12-19 12:37:40.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/ntpd/ntp.keys.man.in	2015-04-07 19:51:17.000000000 -0700
@@ -1,8 +1,8 @@
-.TH ntp.keys 5 "19 Dec 2014" "4.2.8" "File Formats"
+.TH ntp.keys 5 "07 Apr 2015" "4.2.8p2" "File Formats"
 .\"
 .\"  EDIT THIS FILE WITH CAUTION  (ntp.man)
 .\"
-.\"  It has been AutoGen-ed  December 19, 2014 at 07:48:54 AM by AutoGen 5.18.5pre4
+.\"  It has been AutoGen-ed  April  7, 2015 at 04:25:42 AM by AutoGen 5.18.5pre4
 .\"  From the definitions    ntp.keys.def
 .\"  and the template file   agman-file.tpl
 .Sh NAME
@@ -158,9 +158,9 @@
 \fCntpdc\fR(@NTPDC_MS@)\f[],
 \fCsntp\fR(@SNTP_MS@)\f[]
 .SH "AUTHORS"
-The University of Delaware
+The University of Delaware and Network Time Foundation
 .SH "COPYRIGHT"
-Copyright (C) 1970-2014 The University of Delaware all rights reserved.
+Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation all rights reserved.
 This program is released under the terms of the NTP license, <http://ntp.org/license>.
 .SH "BUGS"
 Please send bug reports to: http://bugs.ntp.org, bugs@ntp.org
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/ntpd/ntp.keys.mdoc.in /cur/src/external/bsd/ntp/dist/ntpd/ntp.keys.mdoc.in
--- external/bsd/ntp/dist/ntpd/ntp.keys.mdoc.in	2014-12-19 12:37:41.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/ntpd/ntp.keys.mdoc.in	2015-04-07 19:51:17.000000000 -0700
@@ -1,9 +1,9 @@
-.Dd December 19 2014
+.Dd April 7 2015
 .Dt NTP_KEYS 5 File Formats
 .Os SunOS 5.10
 .\"  EDIT THIS FILE WITH CAUTION  (ntp.mdoc)
 .\"
-.\"  It has been AutoGen-ed  December 19, 2014 at 07:49:12 AM by AutoGen 5.18.5pre4
+.\"  It has been AutoGen-ed  April  7, 2015 at 04:26:00 AM by AutoGen 5.18.5pre4
 .\"  From the definitions    ntp.keys.def
 .\"  and the template file   agmdoc-file.tpl
 .Sh NAME
@@ -145,9 +145,9 @@
 .Xr ntpdc @NTPDC_MS@ ,
 .Xr sntp @SNTP_MS@
 .Sh "AUTHORS"
-The University of Delaware
+The University of Delaware and Network Time Foundation
 .Sh "COPYRIGHT"
-Copyright (C) 1970\-2014 The University of Delaware all rights reserved.
+Copyright (C) 1992\-2015 The University of Delaware and Network Time Foundation all rights reserved.
 This program is released under the terms of the NTP license, <http://ntp.org/license>.
 .Sh "BUGS"
 Please send bug reports to: http://bugs.ntp.org, bugs@ntp.org
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/ntpd/ntp_config.c /cur/src/external/bsd/ntp/dist/ntpd/ntp_config.c
--- external/bsd/ntp/dist/ntpd/ntp_config.c	2014-12-24 18:28:09.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/ntpd/ntp_config.c	2015-04-07 19:51:17.000000000 -0700
@@ -130,6 +130,8 @@
 #define ISEOL(c)	((c) == '#' || (c) == '\n' || (c) == '\0')
 #define ISSPACE(c)	((c) == ' ' || (c) == '\t')
 
+#define _UC(str)	((char *)(intptr_t)(str))
+
 /*
  * Definitions of things either imported from or exported to outside
  */
@@ -927,7 +929,7 @@
 	for ( ; setv_node != NULL; setv_node = setv_node->link) {
 		s1 = quote_if_needed(setv_node->var);
 		s2 = quote_if_needed(setv_node->val);
-		fprintf(df, "setvar %s = %s", s, s2);
+		fprintf(df, "setvar %s = %s", s1, s2);
 		free(s1);
 		free(s2);
 		if (setv_node->isdefault)
@@ -1119,7 +1121,7 @@
 	my_val->attr = attr;
 	if (NULL == s)			/* free() hates NULL */
 		s = estrdup("");
-	my_val->value.s = __UNCONST(s);
+	my_val->value.s = _UC(s);
 	my_val->type = T_String;
 
 	return my_val;
@@ -2705,6 +2707,14 @@
 			item = LOOP_MAX;
 			break;
 
+		case T_Stepback:
+			item = LOOP_MAX_BACK;
+			break;
+
+		case T_Stepfwd:
+			item = LOOP_MAX_FWD;
+			break;
+
 		case T_Stepout:
 			item = LOOP_MINSTEP;
 			break;
@@ -3136,8 +3146,6 @@
 			msyslog(LOG_INFO,
 				"ttl: Number of TTL entries exceeds %zu. Ignoring TTL %d...",
 				COUNTOF(sys_ttl), curr_ttl->i);
-
-		curr_ttl = next_node(curr_ttl);
 	}
 	sys_ttlmax = i - 1;
 }
@@ -4445,7 +4453,7 @@
 		&& check_netinfo && !(config_netinfo = get_netinfo_config())
 #endif /* HAVE_NETINFO */
 		) {
-		msyslog(LOG_INFO, "getconfig: Couldn't open <%s>", FindConfig(config_file));
+		msyslog(LOG_INFO, "getconfig: Couldn't open <%s>: %m", FindConfig(config_file));
 #ifndef SYS_WINNT
 		io_open_sockets();
 
@@ -4459,7 +4467,7 @@
 			 * Broadcast clients can sometimes run without
 			 * a configuration file.
 			 */
-			msyslog(LOG_INFO, "getconfig: Couldn't open <%s>", FindConfig(alt_config_file));
+			msyslog(LOG_INFO, "getconfig: Couldn't open <%s>: %m", FindConfig(alt_config_file));
 			io_open_sockets();
 
 			return;
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/ntpd/ntp_control.c /cur/src/external/bsd/ntp/dist/ntpd/ntp_control.c
--- external/bsd/ntp/dist/ntpd/ntp_control.c	2014-12-24 18:28:09.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/ntpd/ntp_control.c	2015-04-07 19:51:17.000000000 -0700
@@ -222,7 +222,8 @@
 #define	CS_TIMER_OVERRUNS	86
 #define	CS_TIMER_XMTS		87
 #define	CS_FUZZ			88
-#define	CS_MAX_NOAUTOKEY	CS_FUZZ
+#define	CS_WANDER_THRESH	89
+#define	CS_MAX_NOAUTOKEY	CS_WANDER_THRESH
 #ifdef AUTOKEY
 #define	CS_FLAGS		(1 + CS_MAX_NOAUTOKEY)
 #define	CS_HOST			(2 + CS_MAX_NOAUTOKEY)
@@ -417,6 +418,7 @@
 	{ CS_TIMER_OVERRUNS,	RO, "timer_overruns" },	/* 86 */
 	{ CS_TIMER_XMTS,	RO, "timer_xmts" },	/* 87 */
 	{ CS_FUZZ,		RO, "fuzz" },		/* 88 */
+	{ CS_WANDER_THRESH,	RO, "clk_wander_threshold" }, /* 89 */
 #ifdef AUTOKEY
 	{ CS_FLAGS,	RO, "flags" },		/* 1 + CS_MAX_NOAUTOKEY */
 	{ CS_HOST,	RO, "host" },		/* 2 + CS_MAX_NOAUTOKEY */
@@ -479,7 +481,7 @@
 	{ 0,		PADDING, "" },		/* 0 */
 	{ CP_CONFIG,	RO, "config" },		/* 1 */
 	{ CP_AUTHENABLE, RO,	"authenable" },	/* 2 */
-	{ CP_AUTHENTIC, RO, "authentic" }, 	/* 3 */
+	{ CP_AUTHENTIC, RO, "authentic" },	/* 3 */
 	{ CP_SRCADR,	RO, "srcadr" },		/* 4 */
 	{ CP_SRCPORT,	RO, "srcport" },	/* 5 */
 	{ CP_DSTADR,	RO, "dstadr" },		/* 6 */
@@ -531,7 +533,7 @@
 	{ CP_FLAGS,	RO, "flags" },		/* 1 + CP_MAX_NOAUTOKEY */
 	{ CP_HOST,	RO, "host" },		/* 2 + CP_MAX_NOAUTOKEY */
 	{ CP_VALID,	RO, "valid" },		/* 3 + CP_MAX_NOAUTOKEY */
-	{ CP_INITSEQ,	RO, "initsequence" },   /* 4 + CP_MAX_NOAUTOKEY */
+	{ CP_INITSEQ,	RO, "initsequence" },	/* 4 + CP_MAX_NOAUTOKEY */
 	{ CP_INITKEY,	RO, "initkey" },	/* 5 + CP_MAX_NOAUTOKEY */
 	{ CP_INITTSP,	RO, "timestamp" },	/* 6 + CP_MAX_NOAUTOKEY */
 	{ CP_SIGNATURE,	RO, "signature" },	/* 7 + CP_MAX_NOAUTOKEY */
@@ -684,37 +686,37 @@
  */
 #ifdef REFCLOCK
 static const u_char clocktypes[] = {
-	CTL_SST_TS_NTP, 	/* REFCLK_NONE (0) */
+	CTL_SST_TS_NTP,		/* REFCLK_NONE (0) */
 	CTL_SST_TS_LOCAL,	/* REFCLK_LOCALCLOCK (1) */
-	CTL_SST_TS_UHF, 	/* deprecated REFCLK_GPS_TRAK (2) */
+	CTL_SST_TS_UHF,		/* deprecated REFCLK_GPS_TRAK (2) */
 	CTL_SST_TS_HF,		/* REFCLK_WWV_PST (3) */
 	CTL_SST_TS_LF,		/* REFCLK_WWVB_SPECTRACOM (4) */
-	CTL_SST_TS_UHF, 	/* REFCLK_TRUETIME (5) */
-	CTL_SST_TS_UHF, 	/* REFCLK_IRIG_AUDIO (6) */
+	CTL_SST_TS_UHF,		/* REFCLK_TRUETIME (5) */
+	CTL_SST_TS_UHF,		/* REFCLK_IRIG_AUDIO (6) */
 	CTL_SST_TS_HF,		/* REFCLK_CHU (7) */
 	CTL_SST_TS_LF,		/* REFCLOCK_PARSE (default) (8) */
 	CTL_SST_TS_LF,		/* REFCLK_GPS_MX4200 (9) */
-	CTL_SST_TS_UHF, 	/* REFCLK_GPS_AS2201 (10) */
-	CTL_SST_TS_UHF, 	/* REFCLK_GPS_ARBITER (11) */
-	CTL_SST_TS_UHF, 	/* REFCLK_IRIG_TPRO (12) */
+	CTL_SST_TS_UHF,		/* REFCLK_GPS_AS2201 (10) */
+	CTL_SST_TS_UHF,		/* REFCLK_GPS_ARBITER (11) */
+	CTL_SST_TS_UHF,		/* REFCLK_IRIG_TPRO (12) */
 	CTL_SST_TS_ATOM,	/* REFCLK_ATOM_LEITCH (13) */
 	CTL_SST_TS_LF,		/* deprecated REFCLK_MSF_EES (14) */
-	CTL_SST_TS_NTP, 	/* not used (15) */
-	CTL_SST_TS_UHF, 	/* REFCLK_IRIG_BANCOMM (16) */
-	CTL_SST_TS_UHF, 	/* REFCLK_GPS_DATU (17) */
+	CTL_SST_TS_NTP,		/* not used (15) */
+	CTL_SST_TS_UHF,		/* REFCLK_IRIG_BANCOMM (16) */
+	CTL_SST_TS_UHF,		/* REFCLK_GPS_DATU (17) */
 	CTL_SST_TS_TELEPHONE,	/* REFCLK_NIST_ACTS (18) */
 	CTL_SST_TS_HF,		/* REFCLK_WWV_HEATH (19) */
-	CTL_SST_TS_UHF, 	/* REFCLK_GPS_NMEA (20) */
-	CTL_SST_TS_UHF, 	/* REFCLK_GPS_VME (21) */
+	CTL_SST_TS_UHF,		/* REFCLK_GPS_NMEA (20) */
+	CTL_SST_TS_UHF,		/* REFCLK_GPS_VME (21) */
 	CTL_SST_TS_ATOM,	/* REFCLK_ATOM_PPS (22) */
 	CTL_SST_TS_NTP,		/* not used (23) */
 	CTL_SST_TS_NTP,		/* not used (24) */
-	CTL_SST_TS_NTP, 	/* not used (25) */
-	CTL_SST_TS_UHF, 	/* REFCLK_GPS_HP (26) */
+	CTL_SST_TS_NTP,		/* not used (25) */
+	CTL_SST_TS_UHF,		/* REFCLK_GPS_HP (26) */
 	CTL_SST_TS_LF,		/* REFCLK_ARCRON_MSF (27) */
 	CTL_SST_TS_UHF,		/* REFCLK_SHM (28) */
-	CTL_SST_TS_UHF, 	/* REFCLK_PALISADE (29) */
-	CTL_SST_TS_UHF, 	/* REFCLK_ONCORE (30) */
+	CTL_SST_TS_UHF,		/* REFCLK_PALISADE (29) */
+	CTL_SST_TS_UHF,		/* REFCLK_ONCORE (30) */
 	CTL_SST_TS_UHF,		/* REFCLK_JUPITER (31) */
 	CTL_SST_TS_LF,		/* REFCLK_CHRONOLOG (32) */
 	CTL_SST_TS_LF,		/* REFCLK_DUMBCLOCK (33) */
@@ -722,7 +724,7 @@
 	CTL_SST_TS_LF,		/* REFCLK_PCF (35) */
 	CTL_SST_TS_HF,		/* REFCLK_WWV (36) */
 	CTL_SST_TS_LF,		/* REFCLK_FG (37) */
-	CTL_SST_TS_UHF, 	/* REFCLK_HOPF_SERIAL (38) */
+	CTL_SST_TS_UHF,		/* REFCLK_HOPF_SERIAL (38) */
 	CTL_SST_TS_UHF,		/* REFCLK_HOPF_PCI (39) */
 	CTL_SST_TS_LF,		/* REFCLK_JJY (40) */
 	CTL_SST_TS_UHF,		/* REFCLK_TT560 (41) */
@@ -753,17 +755,17 @@
 u_long ctltimereset;		/* time stats reset */
 u_long numctlreq;		/* number of requests we've received */
 u_long numctlbadpkts;		/* number of bad control packets */
-u_long numctlresponses; 	/* number of resp packets sent with data */
-u_long numctlfrags; 		/* number of fragments sent */
+u_long numctlresponses;		/* number of resp packets sent with data */
+u_long numctlfrags;		/* number of fragments sent */
 u_long numctlerrors;		/* number of error responses sent */
 u_long numctltooshort;		/* number of too short input packets */
-u_long numctlinputresp; 	/* number of responses on input */
-u_long numctlinputfrag; 	/* number of fragments on input */
+u_long numctlinputresp;		/* number of responses on input */
+u_long numctlinputfrag;		/* number of fragments on input */
 u_long numctlinputerr;		/* number of input pkts with err bit set */
-u_long numctlbadoffset; 	/* number of input pkts with nonzero offset */
+u_long numctlbadoffset;		/* number of input pkts with nonzero offset */
 u_long numctlbadversion;	/* number of input pkts with unknown version */
 u_long numctldatatooshort;	/* data too short for count */
-u_long numctlbadop; 		/* bad op code found in packet */
+u_long numctlbadop;		/* bad op code found in packet */
 u_long numasyncmsgs;		/* number of async messages we've sent */
 
 /*
@@ -782,6 +784,7 @@
 static u_char * datapt;
 static u_char * dataend;
 static int	datalinelen;
+static int	datasent;	/* flag to avoid initial ", " */
 static int	datanotbinflag;
 static sockaddr_u *rmt_addr;
 static struct interface *lcl_inter;
@@ -845,7 +848,7 @@
 	 * Fill in the fields. We assume rpkt.sequence and rpkt.associd
 	 * have already been filled in.
 	 */
-	rpkt.r_m_e_op = (u_char)CTL_RESPONSE | CTL_ERROR | 
+	rpkt.r_m_e_op = (u_char)CTL_RESPONSE | CTL_ERROR |
 			(res_opcode & CTL_OP_MASK);
 	rpkt.status = htons((u_short)(errcode << 8) & 0xff00);
 	rpkt.count = 0;
@@ -863,7 +866,7 @@
 			CTL_HEADER_LEN);
 }
 
-/* 
+/*
  * save_config - Implements ntpq -c "saveconfig <filename>"
  *		 Writes current configuration including any runtime
  *		 changes by ntpq's :config or config-from-file
@@ -927,7 +930,7 @@
 	if (0 == strftime(filename, sizeof(filename), filespec,
 			       localtime(&now)))
 		strlcpy(filename, filespec, sizeof(filename));
-	
+
 	/*
 	 * Conceptually we should be searching for DIRSEP in filename,
 	 * however Windows actually recognizes both forward and
@@ -1067,6 +1070,7 @@
 	req_count = (int)ntohs(pkt->count);
 	datanotbinflag = FALSE;
 	datalinelen = 0;
+	datasent = 0;
 	datapt = rpkt.u.data;
 	dataend = &rpkt.u.data[CTL_MAX_DATA_LEN];
 
@@ -1316,7 +1320,7 @@
 ctl_putdata(
 	const char *dp,
 	unsigned int dlen,
-	int bin 		/* set to 1 when data is binary */
+	int bin			/* set to 1 when data is binary */
 	)
 {
 	int overhead;
@@ -1326,7 +1330,7 @@
 	if (!bin) {
 		datanotbinflag = TRUE;
 		overhead = 3;
-		if (datapt != rpkt.u.data) {
+		if (datasent) {
 			*datapt++ = ',';
 			datalinelen++;
 			if ((dlen + datalinelen + 1) >= MAXDATALINELEN) {
@@ -1362,6 +1366,7 @@
 	memcpy(datapt, dp, dlen);
 	datapt += dlen;
 	datalinelen += dlen;
+	datasent = TRUE;
 }
 
 
@@ -1486,6 +1491,33 @@
 }
 
 /*
+ * ctl_putcal - write a decoded calendar data into the response
+ */
+static void
+ctl_putcal(
+	const char *tag,
+	const struct calendar *pcal
+	)
+{
+	char buffer[100];
+	unsigned numch;
+
+	numch = snprintf(buffer, sizeof(buffer),
+			"%s=%04d%02d%02d%02d%02d",
+			tag,
+			pcal->year,
+			pcal->month,
+			pcal->monthday,
+			pcal->hour,
+			pcal->minute
+			);
+	NTP_INSIST(numch < sizeof(buffer));
+	ctl_putdata(buffer, numch, 0);
+
+	return;
+}
+
+/*
  * ctl_putfs - write a decoded filestamp into the response
  */
 static void
@@ -1658,7 +1690,7 @@
 		return;
 	iptr = (char *)&refid;
 	iplim = iptr + sizeof(refid);
-	for ( ; optr < oplim && iptr < iplim && '\0' != *iptr; 
+	for ( ; optr < oplim && iptr < iplim && '\0' != *iptr;
 	     iptr++, optr++)
 		if (isprint((int)*iptr))
 			*optr = *iptr;
@@ -1726,7 +1758,7 @@
 
 	static const double to_ms =
 # ifdef STA_NANO
-	    	1.0e-6; /* nsec to msec */
+		1.0e-6; /* nsec to msec */
 # else
 		1.0e-3; /* usec to msec */
 # endif
@@ -1918,12 +1950,12 @@
 		ctl_putdata(buf, (unsigned)( buffp - buf ), 0);
 		break;
 	}
-    
+
 	case CS_TAI:
 		if (sys_tai > 0)
 			ctl_putuint(sys_var[CS_TAI].text, sys_tai);
 		break;
-		
+
 	case CS_LEAPTAB:
 	{
 		leap_signature_t lsig;
@@ -1932,7 +1964,7 @@
 			ctl_putfs(sys_var[CS_LEAPTAB].text, lsig.ttime);
 		break;
 	}
-		
+
 	case CS_LEAPEND:
 	{
 		leap_signature_t lsig;
@@ -2077,7 +2109,7 @@
 		break;
 
 	case CS_AUTHRESET:
-		ctl_putuint(sys_var[varid].text, 
+		ctl_putuint(sys_var[varid].text,
 			    current_time - auth_timereset);
 		break;
 
@@ -2111,7 +2143,7 @@
 
 	case CS_K_OFFSET:
 		CTL_IF_KERNLOOP(
-			ctl_putdblf, 
+			ctl_putdblf,
 			(sys_var[varid].text, 0, -1, to_ms * ntx.offset)
 		);
 		break;
@@ -2291,6 +2323,9 @@
 	case CS_FUZZ:
 		ctl_putdbl(sys_var[varid].text, sys_fuzz * 1e3);
 		break;
+	case CS_WANDER_THRESH:
+		ctl_putdbl(sys_var[varid].text, wander_threshold * 1e6);
+		break;
 #ifdef AUTOKEY
 	case CS_FLAGS:
 		if (crypto_flags)
@@ -2333,14 +2368,11 @@
 
 	case CS_CERTIF:
 		for (cp = cinfo; cp != NULL; cp = cp->link) {
-			tstamp_t tstamp;
-
 			snprintf(str, sizeof(str), "%s %s 0x%x",
 			    cp->subject, cp->issuer, cp->flags);
 			ctl_putstr(sys_var[CS_CERTIF].text, str,
 			    strlen(str));
-			tstamp = caltontp(&(cp->last)); /* XXX too small to hold some values, but that's what ctl_putfs requires */
-			ctl_putfs(sys_var[CS_REVTIME].text, tstamp);
+			ctl_putcal(sys_var[CS_REVTIME].text, &(cp->last));
 		}
 		break;
 
@@ -2600,7 +2632,7 @@
 			memcpy(s, k->text, i);
 			s += i;
 		}
-		if (s + 2 < be) { 
+		if (s + 2 < be) {
 			*s++ = '"';
 			*s = '\0';
 			ctl_putdata(buf, (u_int)(s - buf), 0);
@@ -2679,7 +2711,7 @@
 			    strlen(p->ident));
 		break;
 
-		
+
 #endif	/* AUTOKEY */
 	}
 }
@@ -2788,7 +2820,7 @@
 		    sizeof(buf))
 			break;	/* really long var name */
 
-		snprintf(s, sizeof(buf), "%s=\"", 
+		snprintf(s, sizeof(buf), "%s=\"",
 			 clock_var[CC_VARLIST].text);
 		s += strlen(s);
 		t = s;
@@ -3276,7 +3308,7 @@
 		snprintf(remote_config.err_msg,
 			 sizeof(remote_config.err_msg),
 			 "runtime configuration prohibited by restrict ... nomodify");
-		ctl_putdata(remote_config.err_msg, 
+		ctl_putdata(remote_config.err_msg,
 			    strlen(remote_config.err_msg), 0);
 		ctl_flushpkt(0);
 		NLOG(NLOG_SYSINFO)
@@ -3332,7 +3364,7 @@
 
 	config_remotely(&rbufp->recv_srcadr);
 
-	/* 
+	/*
 	 * Check if errors were reported. If not, output 'Config
 	 * Succeeded'.  Else output the error count.  It would be nice
 	 * to output any parser error messages.
@@ -3341,10 +3373,10 @@
 		retval = snprintf(remote_config.err_msg,
 				  sizeof(remote_config.err_msg),
 				  "Config Succeeded");
-		if (retval > 0) 
+		if (retval > 0)
 			remote_config.err_pos += retval;
 	}
-	
+
 	ctl_putdata(remote_config.err_msg, remote_config.err_pos, 0);
 	ctl_flushpkt(0);
 
@@ -3757,7 +3789,7 @@
 
 	while (NULL != (v = ctl_getitem(in_parms, &val)) &&
 	       !(EOV & v->flags)) {
-	        int si;
+		int si;
 
 		if (!strcmp(nonce_text, v->text)) {
 			if (NULL != pnonce)
@@ -3854,7 +3886,7 @@
 		pch = sptoa(&mon->rmtadr);
 		ctl_putunqstr("addr.older", pch, strlen(pch));
 
-		/* 
+		/*
 		 * Move on to the first entry the client doesn't have,
 		 * except in the special case of a limit of one.  In
 		 * that case return the starting point entry.
@@ -3864,7 +3896,7 @@
 	} else {	/* start with the oldest */
 		mon = TAIL_DLIST(mon_mru_list, mru);
 	}
-	
+
 	/*
 	 * send up to limit= entries in up to frags= datagrams
 	 */
@@ -4623,7 +4655,7 @@
 	for (n = 0; n < COUNTOF(ctl_traps); n++)
 		if ((ctl_traps[n].tr_flags & TRAP_INUSE)
 		    && ADDR_PORT_EQ(raddr, &ctl_traps[n].tr_addr)
-	 	    && (linter == ctl_traps[n].tr_localaddr))
+		    && (linter == ctl_traps[n].tr_localaddr))
 			return &ctl_traps[n];
 
 	return NULL;
@@ -4680,7 +4712,7 @@
 		const char *	src;
 		u_char		errlast;
 
-		errlast = (u_char)err & ~PEER_EVENT; 
+		errlast = (u_char)err & ~PEER_EVENT;
 		if (peer->last_event == errlast)
 			peer->num_events = 0;
 		if (peer->num_events >= CTL_PEER_MAXEVENTS)
@@ -4952,7 +4984,7 @@
 			}
 		}
 	}
-	
+
 	return val;
 }
 
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/ntpd/ntp_crypto.c /cur/src/external/bsd/ntp/dist/ntpd/ntp_crypto.c
--- external/bsd/ntp/dist/ntpd/ntp_crypto.c	2014-12-24 18:28:09.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/ntpd/ntp_crypto.c	2015-04-07 19:51:17.000000000 -0700
@@ -141,6 +141,7 @@
 #define TAI_1972	10	/* initial TAI offset (s) */
 #define MAX_LEAP	100	/* max UTC leapseconds (s) */
 #define VALUE_LEN	(6 * 4) /* min response field length */
+#define MAX_VALLEN	(65535 - VALUE_LEN)
 #define YEAR		(60 * 60 * 24 * 365) /* seconds in year */
 
 /*
@@ -181,8 +182,8 @@
  */
 static	int	crypto_verify	(struct exten *, struct value *,
 				    struct peer *);
-static	int	crypto_encrypt	(struct exten *, struct value *,
-				    keyid_t *);
+static	int	crypto_encrypt	(const u_char *, u_int, keyid_t *,
+				    struct value *);
 static	int	crypto_alice	(struct peer *, struct value *);
 static	int	crypto_alice2	(struct peer *, struct value *);
 static	int	crypto_alice3	(struct peer *, struct value *);
@@ -477,6 +478,12 @@
 		if (len >= VALUE_LEN) {
 			fstamp = ntohl(ep->fstamp);
 			vallen = ntohl(ep->vallen);
+			/*
+			 * Bug 2761: I hope this isn't too early...
+			 */
+			if (   vallen == 0
+			    || len - VALUE_LEN < vallen)
+				return XEVNT_LEN;
 		}
 		switch (code) {
 
@@ -527,8 +534,9 @@
 					rval = XEVNT_ERR;
 				break;
 			}
+			INSIST(len >= VALUE_LEN);
 			if (vallen == 0 || vallen > MAXHOSTNAME ||
-			    len < VALUE_LEN + vallen) {
+			    len - VALUE_LEN < vallen) {
 				rval = XEVNT_LEN;
 				break;
 			}
@@ -1195,8 +1203,9 @@
 	 * choice. 
 	 */
 	case CRYPTO_CERT | CRYPTO_RESP:
-		vallen = ntohl(ep->vallen);
-		if (vallen == 0 || vallen > MAXHOSTNAME) {
+		vallen = ntohl(ep->vallen);	/* Must be <64k */
+		if (vallen == 0 || vallen > MAXHOSTNAME ||
+		    (u_int)(len - VALUE_LEN) < vallen) {
 			rval = XEVNT_LEN;
 			break;
 		}
@@ -1346,7 +1355,10 @@
 	 * anything goes wrong.
 	 */
 	case CRYPTO_COOK | CRYPTO_RESP:
-		if ((opcode & 0xffff) < VALUE_LEN) {
+		vallen = ntohl(ep->vallen);	/* Must be <64k */
+		if (   vallen == 0
+		    || (vallen >= MAX_VALLEN)
+		    || (opcode & 0x0000ffff)  < VALUE_LEN + vallen) {
 			rval = XEVNT_LEN;
 			break;
 		}
@@ -1354,8 +1366,8 @@
 			tcookie = cookie;
 		else
 			tcookie = peer->hcookie;
-		if ((rval = crypto_encrypt(ep, &vtemp, &tcookie)) ==
-		    XEVNT_OK) {
+		if ((rval = crypto_encrypt((const u_char *)ep->pkt, vallen, &tcookie, &vtemp))
+		    == XEVNT_OK) {
 			len = crypto_send(fp, &vtemp, start);
 			value_free(&vtemp);
 		}
@@ -1495,13 +1507,16 @@
 	 * up to the next word (4 octets).
 	 */
 	vallen = ntohl(ep->vallen);
-	if (vallen == 0)
+	if (   vallen == 0
+	    || vallen > MAX_VALLEN)
 		return (XEVNT_LEN);
 
 	i = (vallen + 3) / 4;
 	siglen = ntohl(ep->pkt[i++]);
-	if (len < VALUE_LEN + ((vallen + 3) / 4) * 4 + ((siglen + 3) /
-	    4) * 4)
+	if (   siglen > MAX_VALLEN
+	    || len - VALUE_LEN < ((vallen + 3) / 4) * 4
+	    || len - VALUE_LEN - ((vallen + 3) / 4) * 4
+	      < ((siglen + 3) / 4) * 4)
 		return (XEVNT_LEN);
 
 	/*
@@ -1559,6 +1574,7 @@
 	 * proventic bit. What a relief.
 	 */
 	EVP_VerifyInit(&ctx, peer->digest);
+	/* XXX: the "+ 12" needs to be at least documented... */
 	EVP_VerifyUpdate(&ctx, (u_char *)&ep->tstamp, vallen + 12);
 	if (EVP_VerifyFinal(&ctx, (u_char *)&ep->pkt[i], siglen,
 	    pkey) <= 0)
@@ -1571,35 +1587,32 @@
 
 
 /*
- * crypto_encrypt - construct encrypted cookie and signature from
- * extension field and cookie
+ * crypto_encrypt - construct vp (encrypted cookie and signature) from
+ * the public key and cookie.
  *
- * Returns
+ * Returns:
  * XEVNT_OK	success
  * XEVNT_CKY	bad or missing cookie
  * XEVNT_PUB	bad or missing public key
  */
 static int
 crypto_encrypt(
-	struct exten *ep,	/* extension pointer */
-	struct value *vp,	/* value pointer */
-	keyid_t	*cookie		/* server cookie */
+	const u_char *ptr,	/* Public Key */
+	u_int	vallen,		/* Length of Public Key */
+	keyid_t	*cookie,	/* server cookie */
+	struct value *vp	/* value pointer */
 	)
 {
 	EVP_PKEY *pkey;		/* public key */
 	EVP_MD_CTX ctx;		/* signature context */
 	tstamp_t tstamp;	/* NTP timestamp */
 	u_int32	temp32;
-	u_int	len;
-	const u_char *ptr;
 	u_char *puch;
 
 	/*
 	 * Extract the public key from the request.
 	 */
-	len = ntohl(ep->vallen);
-	ptr = (void *)ep->pkt;
-	pkey = d2i_PublicKey(EVP_PKEY_RSA, NULL, &ptr, len);
+	pkey = d2i_PublicKey(EVP_PKEY_RSA, NULL, &ptr, vallen);
 	if (pkey == NULL) {
 		msyslog(LOG_ERR, "crypto_encrypt: %s",
 		    ERR_error_string(ERR_get_error(), NULL));
@@ -1613,9 +1626,9 @@
 	tstamp = crypto_time();
 	vp->tstamp = htonl(tstamp);
 	vp->fstamp = hostval.tstamp;
-	len = EVP_PKEY_size(pkey);
-	vp->vallen = htonl(len);
-	vp->ptr = emalloc(len);
+	vallen = EVP_PKEY_size(pkey);
+	vp->vallen = htonl(vallen);
+	vp->ptr = emalloc(vallen);
 	puch = vp->ptr;
 	temp32 = htonl(*cookie);
 	if (RSA_public_encrypt(4, (u_char *)&temp32, puch,
@@ -1633,8 +1646,8 @@
 	vp->sig = emalloc(sign_siglen);
 	EVP_SignInit(&ctx, sign_digest);
 	EVP_SignUpdate(&ctx, (u_char *)&vp->tstamp, 12);
-	EVP_SignUpdate(&ctx, vp->ptr, len);
-	if (EVP_SignFinal(&ctx, vp->sig, &len, sign_pkey))
+	EVP_SignUpdate(&ctx, vp->ptr, vallen);
+	if (EVP_SignFinal(&ctx, vp->sig, &vallen, sign_pkey))
 		vp->siglen = htonl(sign_siglen);
 	return (XEVNT_OK);
 }
@@ -1705,6 +1718,9 @@
  * call in the protocol module.
  *
  * Returns extension field pointer (no errors)
+ *
+ * XXX: opcode and len should really be 32-bit quantities and
+ * we should make sure that str is not too big.
  */
 struct exten *
 crypto_args(
@@ -1717,23 +1733,30 @@
 	tstamp_t tstamp;	/* NTP timestamp */
 	struct exten *ep;	/* extension field pointer */
 	u_int	len;		/* extension field length */
+	size_t	slen = 0;
 
 	tstamp = crypto_time();
 	len = sizeof(struct exten);
-	if (str != NULL)
-		len += strlen(str);
+	if (str != NULL) {
+		slen = strlen(str);
+		INSIST(slen < MAX_VALLEN);
+		len += slen;
+	}
 	ep = emalloc_zero(len);
 	if (opcode == 0)
 		return (ep);
 
+	REQUIRE(0 == (len    & ~0x0000ffff));
+	REQUIRE(0 == (opcode & ~0xffff0000));
+
 	ep->opcode = htonl(opcode + len);
 	ep->associd = htonl(associd);
 	ep->tstamp = htonl(tstamp);
 	ep->fstamp = hostval.tstamp;
 	ep->vallen = 0;
 	if (str != NULL) {
-		ep->vallen = htonl(strlen(str));
-		memcpy((char *)ep->pkt, str, strlen(str));
+		ep->vallen = htonl(slen);
+		memcpy((char *)ep->pkt, str, slen);
 	}
 	return (ep);
 }
@@ -1746,6 +1769,8 @@
  * Note: it is not polite to send a nonempty signature with zero
  * timestamp or a nonzero timestamp with an empty signature, but those
  * rules are not enforced here.
+ *
+ * XXX This code won't work on a box with 16-bit ints.
  */
 int
 crypto_send(
@@ -1761,8 +1786,9 @@
 	 * Calculate extension field length and check for buffer
 	 * overflow. Leave room for the MAC.
 	 */
-	len = 16;
+	len = 16;				/* XXX Document! */
 	vallen = ntohl(vp->vallen);
+	INSIST(vallen <= MAX_VALLEN);
 	len += ((vallen + 3) / 4 + 1) * 4; 
 	siglen = ntohl(vp->siglen);
 	len += ((siglen + 3) / 4 + 1) * 4; 
@@ -1803,6 +1829,7 @@
 	}
 	opcode = ntohl(ep->opcode);
 	ep->opcode = htonl((opcode & 0xffff0000) | len); 
+	ENSURE(len <= MAX_VALLEN);
 	return (len);
 }
 
@@ -1839,7 +1866,6 @@
 	if (hostval.tstamp == 0)
 		return;
 
-
 	/*
 	 * Sign public key and timestamps. The filestamp is derived from
 	 * the host key file extension from wherever the file was
@@ -2167,7 +2193,8 @@
 	tstamp_t tstamp;	/* NTP timestamp */
 	BIGNUM	*bn, *bk, *r;
 	u_char	*ptr;
-	u_int	len;
+	u_int	len;		/* extension field length */
+	u_int	vallen = 0;	/* value length */
 
 	/*
 	 * If the IFF parameters are not valid, something awful
@@ -2182,8 +2209,11 @@
 	/*
 	 * Extract r from the challenge.
 	 */
-	len = ntohl(ep->vallen);
-	if ((r = BN_bin2bn((u_char *)ep->pkt, len, NULL)) == NULL) {
+	vallen = ntohl(ep->vallen);
+	len = ntohl(ep->opcode) & 0x0000ffff;
+	if (vallen == 0 || len < VALUE_LEN || len - VALUE_LEN < vallen)
+		return XEVNT_LEN;
+	if ((r = BN_bin2bn((u_char *)ep->pkt, vallen, NULL)) == NULL) {
 		msyslog(LOG_ERR, "crypto_bob: %s",
 		    ERR_error_string(ERR_get_error(), NULL));
 		return (XEVNT_ERR);
@@ -2195,7 +2225,7 @@
 	 */
 	bctx = BN_CTX_new(); bk = BN_new(); bn = BN_new();
 	sdsa = DSA_SIG_new();
-	BN_rand(bk, len * 8, -1, 1);		/* k */
+	BN_rand(bk, vallen * 8, -1, 1);		/* k */
 	BN_mod_mul(bn, dsa->priv_key, r, dsa->q, bctx); /* b r mod q */
 	BN_add(bn, bn, bk);
 	BN_mod(bn, bn, dsa->q, bctx);		/* k + b r mod q */
@@ -2214,30 +2244,37 @@
 	 * Encode the values in ASN.1 and sign. The filestamp is from
 	 * the local file.
 	 */
-	len = i2d_DSA_SIG(sdsa, NULL);
-	if (len == 0) {
+	vallen = i2d_DSA_SIG(sdsa, NULL);
+	if (vallen == 0) {
 		msyslog(LOG_ERR, "crypto_bob: %s",
 		    ERR_error_string(ERR_get_error(), NULL));
 		DSA_SIG_free(sdsa);
 		return (XEVNT_ERR);
 	}
+	if (vallen > MAX_VALLEN) {
+		msyslog(LOG_ERR, "crypto_bob: signature is too big: %d",
+		    vallen);
+		DSA_SIG_free(sdsa);
+		return (XEVNT_LEN);
+	}
 	memset(vp, 0, sizeof(struct value));
 	tstamp = crypto_time();
 	vp->tstamp = htonl(tstamp);
 	vp->fstamp = htonl(iffkey_info->fstamp);
-	vp->vallen = htonl(len);
-	ptr = emalloc(len);
+	vp->vallen = htonl(vallen);
+	ptr = emalloc(vallen);
 	vp->ptr = ptr;
 	i2d_DSA_SIG(sdsa, &ptr);
 	DSA_SIG_free(sdsa);
 	if (tstamp == 0)
 		return (XEVNT_OK);
 
+	/* XXX: more validation to make sure the sign fits... */
 	vp->sig = emalloc(sign_siglen);
 	EVP_SignInit(&ctx, sign_digest);
 	EVP_SignUpdate(&ctx, (u_char *)&vp->tstamp, 12);
-	EVP_SignUpdate(&ctx, vp->ptr, len);
-	if (EVP_SignFinal(&ctx, vp->sig, &len, sign_pkey))
+	EVP_SignUpdate(&ctx, vp->ptr, vallen);
+	if (EVP_SignFinal(&ctx, vp->sig, &vallen, sign_pkey))
 		vp->siglen = htonl(sign_siglen);
 	return (XEVNT_OK);
 }
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/ntpd/ntp_io.c /cur/src/external/bsd/ntp/dist/ntpd/ntp_io.c
--- external/bsd/ntp/dist/ntpd/ntp_io.c	2014-12-24 18:28:09.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/ntpd/ntp_io.c	2015-05-05 19:01:55.000000000 -0700
@@ -1647,6 +1647,34 @@
 }
 #endif /* OS_NEEDS_REUSEADDR_FOR_IFADDRBIND */
 
+static isc_boolean_t
+check_flags(
+	sockaddr_u *psau,
+	const char *name,
+	u_int32 flags
+	)
+{
+#if defined(SIOCGIFAFLAG_IN)
+	struct ifreq ifr;
+	int fd;
+
+	if (psau->sa.sa_family != AF_INET)
+		return ISC_FALSE;
+	if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0)
+		return ISC_FALSE;
+	ZERO(ifr);
+	memcpy(&ifr.ifr_addr, &psau->sa, sizeof(ifr.ifr_addr));
+	strlcpy(ifr.ifr_name, name, sizeof(ifr.ifr_name));
+	if (ioctl(fd, SIOCGIFAFLAG_IN, &ifr) < 0) {
+		close(fd);
+		return ISC_FALSE;
+	}
+	close(fd);
+	if ((ifr.ifr_addrflags & flags) != 0)
+		return ISC_TRUE;
+#endif	/* SIOCGIFAFLAG_IN */
+	return ISC_FALSE;
+}
 
 static isc_boolean_t
 check_flags6(
@@ -1696,19 +1724,32 @@
 	const char *name
 	)
 {
-	u_int32 flags6;
+	u_int32 flags;
 
-	flags6 = 0;
+	flags = 0;
+	switch (psau->sa.sa_family) {
+	case AF_INET:
+#ifdef IN_IFF_DETACHED
+		flags |= IN_IFF_DETACHED;
+#endif
+#ifdef IN_IFF_TENTATIVE
+		flags |= IN_IFF_TENTATIVE;
+#endif
+		return check_flags(psau, name, flags) ? ISC_FALSE : ISC_TRUE;
+	case AF_INET6:
 #ifdef IN6_IFF_DEPARTED
-	flags6 |= IN6_IFF_DEPARTED;
+		flags |= IN6_IFF_DEPARTED;
 #endif
 #ifdef IN6_IFF_DETACHED
-	flags6 |= IN6_IFF_DETACHED;
+		flags |= IN6_IFF_DETACHED;
 #endif
 #ifdef IN6_IFF_TENTATIVE
-	flags6 |= IN6_IFF_TENTATIVE;
+		flags |= IN6_IFF_TENTATIVE;
 #endif
-	return check_flags6(psau, name, flags6) ? ISC_FALSE : ISC_TRUE;
+		return check_flags6(psau, name, flags) ? ISC_FALSE : ISC_TRUE;
+	default:
+		return ISC_FALSE;
+	}
 }
 
 /*
@@ -3484,28 +3525,24 @@
 	** Bug 2672: Some OSes (MacOSX and Linux) don't block spoofed ::1
 	*/
 
-	// temporary hack...
-#ifndef HAVE_SOLARIS_PRIVS
 	if (AF_INET6 == itf->family) {
-		DPRINTF(1, ("Got an IPv6 packet, from <%s> (%d) to <%s> (%d)\n",
+		DPRINTF(2, ("Got an IPv6 packet, from <%s> (%d) to <%s> (%d)\n",
 			stoa(&rb->recv_srcadr),
-			IN6_IS_ADDR_LOOPBACK(&SOCK_ADDR6(&rb->recv_srcadr)),
+			IN6_IS_ADDR_LOOPBACK(PSOCK_ADDR6(&rb->recv_srcadr)),
 			stoa(&itf->sin),
-			!IN6_IS_ADDR_LOOPBACK(&SOCK_ADDR6(&itf->sin))
+			!IN6_IS_ADDR_LOOPBACK(PSOCK_ADDR6(&itf->sin))
 			));
-	}
 
-	if (   AF_INET6 == itf->family
-	    && IN6_IS_ADDR_LOOPBACK(&SOCK_ADDR6(&rb->recv_srcadr))
-	    && !IN6_IS_ADDR_LOOPBACK(&SOCK_ADDR6(&itf->sin))
-	   ) {
-		packets_dropped++;
-		DPRINTF(1, ("DROPPING that packet\n"));
-		freerecvbuf(rb);
-		return buflen;
+		if (   IN6_IS_ADDR_LOOPBACK(PSOCK_ADDR6(&rb->recv_srcadr))
+		    && !IN6_IS_ADDR_LOOPBACK(PSOCK_ADDR6(&itf->sin))
+		   ) {
+			packets_dropped++;
+			DPRINTF(2, ("DROPPING that packet\n"));
+			freerecvbuf(rb);
+			return buflen;
+		}
+		DPRINTF(2, ("processing that packet\n"));
 	}
-	DPRINTF(1, ("processing that packet\n"));
-#endif
 
 	/*
 	 * Got one.  Mark how and when it got here,
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/ntpd/ntp_keyword.h /cur/src/external/bsd/ntp/dist/ntpd/ntp_keyword.h
--- external/bsd/ntp/dist/ntpd/ntp_keyword.h	2013-12-30 11:06:45.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/ntpd/ntp_keyword.h	2015-04-07 19:51:17.000000000 -0700
@@ -1,8 +1,10 @@
+/*	$NetBSD: ntp_keyword.h,v 1.7 2015/04/07 17:34:19 christos Exp $	*/
+
 /*
  * ntp_keyword.h
  * 
  * NOTE: edit this file with caution, it is generated by keyword-gen.c
- *	 Generated 2013-12-30 19:01:20 UTC	  diff_ignore_line
+ *	 Generated 2015-04-07 17:30:04 UTC	  diff_ignore_line
  *
  */
 #include "ntp_scanner.h"
@@ -10,7 +12,7 @@
 
 #define LOWEST_KEYWORD_ID 257
 
-const char * const keyword_text[187] = {
+const char * const keyword_text[189] = {
 	/* 0       257                  257 */	"abbrev",
 	/* 1       258                  258 */	"age",
 	/* 2       259                  259 */	"all",
@@ -160,49 +162,51 @@
 	/* 146     403                  403 */	"stats",
 	/* 147     404                  404 */	"statsdir",
 	/* 148     405                  405 */	"step",
-	/* 149     406                  406 */	"stepout",
-	/* 150     407                  407 */	"stratum",
-	/* 151     408                  408 */	NULL,
-	/* 152     409                  409 */	"sys",
-	/* 153     410                  410 */	"sysstats",
-	/* 154     411                  411 */	"tick",
-	/* 155     412                  412 */	"time1",
-	/* 156     413                  413 */	"time2",
-	/* 157     414                  414 */	"timer",
-	/* 158     415                  415 */	"timingstats",
-	/* 159     416                  416 */	"tinker",
-	/* 160     417                  417 */	"tos",
-	/* 161     418                  418 */	"trap",
-	/* 162     419                  419 */	"true",
-	/* 163     420                  420 */	"trustedkey",
-	/* 164     421                  421 */	"ttl",
-	/* 165     422                  422 */	"type",
-	/* 166     423                  423 */	NULL,
-	/* 167     424                  424 */	"unconfig",
-	/* 168     425                  425 */	"unpeer",
-	/* 169     426                  426 */	"version",
-	/* 170     427                  427 */	NULL,
-	/* 171     428                  428 */	"week",
-	/* 172     429                  429 */	"wildcard",
-	/* 173     430                  430 */	"xleave",
-	/* 174     431                  431 */	"year",
-	/* 175     432                  432 */	NULL,
-	/* 176     433                  433 */	NULL,
-	/* 177     434                  434 */	"simulate",
-	/* 178     435                  435 */	"beep_delay",
-	/* 179     436                  436 */	"simulation_duration",
-	/* 180     437                  437 */	"server_offset",
-	/* 181     438                  438 */	"duration",
-	/* 182     439                  439 */	"freq_offset",
-	/* 183     440                  440 */	"wander",
-	/* 184     441                  441 */	"jitter",
-	/* 185     442                  442 */	"prop_delay",
-	/* 186     443                  443 */	"proc_delay"
+	/* 149     406                  406 */	"stepback",
+	/* 150     407                  407 */	"stepfwd",
+	/* 151     408                  408 */	"stepout",
+	/* 152     409                  409 */	"stratum",
+	/* 153     410                  410 */	NULL,
+	/* 154     411                  411 */	"sys",
+	/* 155     412                  412 */	"sysstats",
+	/* 156     413                  413 */	"tick",
+	/* 157     414                  414 */	"time1",
+	/* 158     415                  415 */	"time2",
+	/* 159     416                  416 */	"timer",
+	/* 160     417                  417 */	"timingstats",
+	/* 161     418                  418 */	"tinker",
+	/* 162     419                  419 */	"tos",
+	/* 163     420                  420 */	"trap",
+	/* 164     421                  421 */	"true",
+	/* 165     422                  422 */	"trustedkey",
+	/* 166     423                  423 */	"ttl",
+	/* 167     424                  424 */	"type",
+	/* 168     425                  425 */	NULL,
+	/* 169     426                  426 */	"unconfig",
+	/* 170     427                  427 */	"unpeer",
+	/* 171     428                  428 */	"version",
+	/* 172     429                  429 */	NULL,
+	/* 173     430                  430 */	"week",
+	/* 174     431                  431 */	"wildcard",
+	/* 175     432                  432 */	"xleave",
+	/* 176     433                  433 */	"year",
+	/* 177     434                  434 */	NULL,
+	/* 178     435                  435 */	NULL,
+	/* 179     436                  436 */	"simulate",
+	/* 180     437                  437 */	"beep_delay",
+	/* 181     438                  438 */	"simulation_duration",
+	/* 182     439                  439 */	"server_offset",
+	/* 183     440                  440 */	"duration",
+	/* 184     441                  441 */	"freq_offset",
+	/* 185     442                  442 */	"wander",
+	/* 186     443                  443 */	"jitter",
+	/* 187     444                  444 */	"prop_delay",
+	/* 188     445                  445 */	"proc_delay"
 };
 
-#define SCANNER_INIT_S 830
+#define SCANNER_INIT_S 837
 
-const scan_state sst[833] = {
+const scan_state sst[840] = {
 /*SS_T( ch,	f-by, match, other ),				 */
   0,				      /*     0                   */
   S_ST( '-',	3,      321,     0 ), /*     1                   */
@@ -248,7 +252,7 @@
   S_ST( 'd',	3,       42,     0 ), /*    41 beep_             */
   S_ST( 'e',	3,       43,     0 ), /*    42 beep_d            */
   S_ST( 'l',	3,       44,     0 ), /*    43 beep_de           */
-  S_ST( 'a',	3,      435,     0 ), /*    44 beep_del          */
+  S_ST( 'a',	3,      437,     0 ), /*    44 beep_del          */
   S_ST( 'r',	3,       46,    34 ), /*    45 b                 */
   S_ST( 'o',	3,       47,     0 ), /*    46 br                */
   S_ST( 'a',	3,       48,     0 ), /*    47 bro               */
@@ -346,7 +350,7 @@
   S_ST( 'a',	3,      140,     0 ), /*   139 dur               */
   S_ST( 't',	3,      141,     0 ), /*   140 dura              */
   S_ST( 'i',	3,      142,     0 ), /*   141 durat             */
-  S_ST( 'o',	3,      438,     0 ), /*   142 durati            */
+  S_ST( 'o',	3,      440,     0 ), /*   142 durati            */
   S_ST( 'e',	3,      144,   105 ), /*   143                   */
   S_ST( 'n',	3,      291,     0 ), /*   144 e                 */
   S_ST( 'a',	3,      146,     0 ), /*   145 en                */
@@ -372,7 +376,7 @@
   S_ST( 'f',	3,      166,     0 ), /*   165 freq_o            */
   S_ST( 'f',	3,      167,     0 ), /*   166 freq_of           */
   S_ST( 's',	3,      168,     0 ), /*   167 freq_off          */
-  S_ST( 'e',	3,      439,     0 ), /*   168 freq_offs         */
+  S_ST( 'e',	3,      441,     0 ), /*   168 freq_offs         */
   S_ST( 'u',	3,      170,   161 ), /*   169 f                 */
   S_ST( 'd',	3,      171,     0 ), /*   170 fu                */
   S_ST( 'g',	3,      303,     0 ), /*   171 fud               */
@@ -432,7 +436,7 @@
   S_ST( 'i',	3,      226,     0 ), /*   225 j                 */
   S_ST( 't',	3,      227,     0 ), /*   226 ji                */
   S_ST( 't',	3,      228,     0 ), /*   227 jit               */
-  S_ST( 'e',	3,      441,     0 ), /*   228 jitt              */
+  S_ST( 'e',	3,      443,     0 ), /*   228 jitt              */
   S_ST( 'k',	3,      236,   224 ), /*   229                   */
   S_ST( 'e',	3,      323,     0 ), /*   230 k                 */
   S_ST( 'r',	3,      232,     0 ), /*   231 ke                */
@@ -457,7 +461,7 @@
   S_ST( 's',	3,      251,   249 ), /*   250 li                */
   S_ST( 't',	3,      252,     0 ), /*   251 lis               */
   S_ST( 'e',	3,      331,     0 ), /*   252 list              */
-  S_ST( 'o',	3,      447,   244 ), /*   253 l                 */
+  S_ST( 'o',	3,      449,   244 ), /*   253 l                 */
   S_ST( 'g',	3,      316,     0 ), /*   254 lo                */
   S_ST( 'c',	3,      256,     0 ), /*   255 log               */
   S_ST( 'o',	3,      286,     0 ), /*   256 logc              */
@@ -520,7 +524,7 @@
   S_ST( 'e',	1,        0,     0 ), /*   313 313               */
   S_ST( 'i',	3,      332,     0 ), /*   314 logconf           */
   S_ST( 'e',	0,        0,     0 ), /*   315 315               */
-  S_ST( 'f',	3,      408,   255 ), /*   316 log               */
+  S_ST( 'f',	3,      410,   255 ), /*   316 log               */
   S_ST( 'o',	0,        0,   193 ), /*   317 317               */
   S_ST( '4',	0,        0,     0 ), /*   318 318               */
   S_ST( '4',	0,        0,     0 ), /*   319 319               */
@@ -550,7 +554,7 @@
   S_ST( 'm',	0,        0,     0 ), /*   343 343               */
   S_ST( 'l',	0,        0,     0 ), /*   344 344               */
   S_ST( 's',	0,        0,     0 ), /*   345 345               */
-  S_ST( 'm',	0,      500,     0 ), /*   346 346               */
+  S_ST( 'm',	0,      502,     0 ), /*   346 346               */
   S_ST( 'k',	0,        0,     0 ), /*   347 347               */
   S_ST( 'k',	0,        0,     0 ), /*   348 348               */
   S_ST( 'h',	0,        0,     0 ), /*   349 349               */
@@ -576,23 +580,23 @@
   S_ST( 'e',	0,        0,     0 ), /*   369 369               */
   S_ST( 'p',	0,        0,     0 ), /*   370 370               */
   S_ST( 't',	0,        0,     0 ), /*   371 371               */
-  S_ST( 'p',	0,      596,     0 ), /*   372 372               */
+  S_ST( 'p',	0,      598,     0 ), /*   372 372               */
   S_ST( 't',	0,        0,     0 ), /*   373 373               */
   S_ST( 't',	1,        0,     0 ), /*   374 374               */
-  S_ST( 'n',	0,      611,     0 ), /*   375 375               */
+  S_ST( 'n',	0,      613,     0 ), /*   375 375               */
   S_ST( 't',	0,        0,     0 ), /*   376 376               */
   S_ST( 'c',	0,        0,     0 ), /*   377 377               */
-  S_ST( 'r',	1,      620,     0 ), /*   378 378               */
+  S_ST( 'r',	1,      622,     0 ), /*   378 378               */
   S_ST( 's',	0,        0,     0 ), /*   379 379               */
   S_ST( 'e',	2,        0,     0 ), /*   380 380               */
-  S_ST( 'd',	0,      628,     0 ), /*   381 381               */
+  S_ST( 'd',	0,      630,     0 ), /*   381 381               */
   S_ST( 'e',	1,        0,     0 ), /*   382 382               */
   S_ST( 'l',	1,        0,     0 ), /*   383 383               */
   S_ST( 't',	0,        0,     0 ), /*   384 384               */
   S_ST( 't',	0,        0,     0 ), /*   385 385               */
   S_ST( 'r',	0,        0,     0 ), /*   386 386               */
   S_ST( 's',	0,        0,     0 ), /*   387 387               */
-  S_ST( 'w',	1,        0,   634 ), /*   388 388               */
+  S_ST( 'w',	1,        0,   636 ), /*   388 388               */
   S_ST( 'e',	1,        0,     0 ), /*   389 389               */
   S_ST( 's',	0,        0,     0 ), /*   390 390               */
   S_ST( 'd',	1,        0,     0 ), /*   391 391               */
@@ -602,440 +606,447 @@
   S_ST( 'e',	0,        0,     0 ), /*   395 395               */
   S_ST( 't',	0,        0,     0 ), /*   396 396               */
   S_ST( 'r',	1,        0,     0 ), /*   397 397               */
-  S_ST( 'r',	1,      711,     0 ), /*   398 398               */
+  S_ST( 'r',	1,      713,     0 ), /*   398 398               */
   S_ST( 'r',	1,        0,     0 ), /*   399 399               */
   S_ST( 'e',	0,        0,     0 ), /*   400 400               */
   S_ST( 'e',	0,        0,     0 ), /*   401 401               */
   S_ST( 's',	0,        0,     0 ), /*   402 402               */
-  S_ST( 's',	0,      754,   749 ), /*   403 403               */
+  S_ST( 's',	0,      756,   751 ), /*   403 403               */
   S_ST( 'r',	1,        0,     0 ), /*   404 404               */
-  S_ST( 'p',	0,      757,     0 ), /*   405 405               */
-  S_ST( 't',	0,        0,     0 ), /*   406 406               */
-  S_ST( 'm',	0,        0,     0 ), /*   407 407               */
-  S_ST( 'i',	3,      423,     0 ), /*   408 logf              */
-  S_ST( 's',	0,      764,     0 ), /*   409 409               */
-  S_ST( 's',	0,        0,     0 ), /*   410 410               */
-  S_ST( 'k',	0,        0,     0 ), /*   411 411               */
-  S_ST( '1',	0,        0,     0 ), /*   412 412               */
-  S_ST( '2',	0,        0,   412 ), /*   413 413               */
-  S_ST( 'r',	0,        0,   413 ), /*   414 414               */
-  S_ST( 's',	0,        0,     0 ), /*   415 415               */
-  S_ST( 'r',	0,        0,     0 ), /*   416 416               */
+  S_ST( 'p',	0,      764,     0 ), /*   405 405               */
+  S_ST( 'k',	0,        0,     0 ), /*   406 406               */
+  S_ST( 'd',	0,        0,     0 ), /*   407 407               */
+  S_ST( 't',	0,        0,     0 ), /*   408 408               */
+  S_ST( 'm',	0,        0,     0 ), /*   409 409               */
+  S_ST( 'i',	3,      425,     0 ), /*   410 logf              */
+  S_ST( 's',	0,      771,     0 ), /*   411 411               */
+  S_ST( 's',	0,        0,     0 ), /*   412 412               */
+  S_ST( 'k',	0,        0,     0 ), /*   413 413               */
+  S_ST( '1',	0,        0,     0 ), /*   414 414               */
+  S_ST( '2',	0,        0,   414 ), /*   415 415               */
+  S_ST( 'r',	0,        0,   415 ), /*   416 416               */
   S_ST( 's',	0,        0,     0 ), /*   417 417               */
-  S_ST( 'p',	1,        0,     0 ), /*   418 418               */
-  S_ST( 'e',	0,        0,     0 ), /*   419 419               */
-  S_ST( 'y',	0,        0,     0 ), /*   420 420               */
-  S_ST( 'l',	0,        0,     0 ), /*   421 421               */
-  S_ST( 'e',	0,        0,     0 ), /*   422 422               */
-  S_ST( 'l',	3,      333,     0 ), /*   423 logfi             */
-  S_ST( 'g',	1,        0,     0 ), /*   424 424               */
-  S_ST( 'r',	1,        0,     0 ), /*   425 425               */
-  S_ST( 'n',	0,        0,     0 ), /*   426 426               */
-  S_ST( 'o',	3,      432,   254 ), /*   427 lo                */
-  S_ST( 'k',	0,        0,     0 ), /*   428 428               */
-  S_ST( 'd',	0,        0,     0 ), /*   429 429               */
-  S_ST( 'e',	0,        0,     0 ), /*   430 430               */
-  S_ST( 'r',	0,        0,     0 ), /*   431 431               */
-  S_ST( 'p',	3,      433,     0 ), /*   432 loo               */
-  S_ST( 's',	3,      444,     0 ), /*   433 loop              */
-  S_ST( 'e',	0,        0,     0 ), /*   434 434               */
-  S_ST( 'y',	0,        0,     0 ), /*   435 435               */
-  S_ST( 'n',	0,        0,     0 ), /*   436 436               */
-  S_ST( 't',	0,        0,     0 ), /*   437 437               */
+  S_ST( 'r',	0,        0,     0 ), /*   418 418               */
+  S_ST( 's',	0,        0,     0 ), /*   419 419               */
+  S_ST( 'p',	1,        0,     0 ), /*   420 420               */
+  S_ST( 'e',	0,        0,     0 ), /*   421 421               */
+  S_ST( 'y',	0,        0,     0 ), /*   422 422               */
+  S_ST( 'l',	0,        0,     0 ), /*   423 423               */
+  S_ST( 'e',	0,        0,     0 ), /*   424 424               */
+  S_ST( 'l',	3,      333,     0 ), /*   425 logfi             */
+  S_ST( 'g',	1,        0,     0 ), /*   426 426               */
+  S_ST( 'r',	1,        0,     0 ), /*   427 427               */
+  S_ST( 'n',	0,        0,     0 ), /*   428 428               */
+  S_ST( 'o',	3,      434,   254 ), /*   429 lo                */
+  S_ST( 'k',	0,        0,     0 ), /*   430 430               */
+  S_ST( 'd',	0,        0,     0 ), /*   431 431               */
+  S_ST( 'e',	0,        0,     0 ), /*   432 432               */
+  S_ST( 'r',	0,        0,     0 ), /*   433 433               */
+  S_ST( 'p',	3,      435,     0 ), /*   434 loo               */
+  S_ST( 's',	3,      446,     0 ), /*   435 loop              */
+  S_ST( 'e',	0,        0,     0 ), /*   436 436               */
+  S_ST( 'y',	0,        0,     0 ), /*   437 437               */
   S_ST( 'n',	0,        0,     0 ), /*   438 438               */
   S_ST( 't',	0,        0,     0 ), /*   439 439               */
-  S_ST( 'r',	0,        0,     0 ), /*   440 440               */
-  S_ST( 'r',	0,        0,     0 ), /*   441 441               */
-  S_ST( 'y',	0,        0,     0 ), /*   442 442               */
-  S_ST( 'y',	0,        0,     0 ), /*   443 443               */
-  S_ST( 't',	3,      445,     0 ), /*   444 loops             */
-  S_ST( 'a',	3,      446,     0 ), /*   445 loopst            */
-  S_ST( 't',	3,      334,     0 ), /*   446 loopsta           */
-  S_ST( 'w',	3,      448,   427 ), /*   447 lo                */
-  S_ST( 'p',	3,      449,     0 ), /*   448 low               */
-  S_ST( 'r',	3,      450,     0 ), /*   449 lowp              */
-  S_ST( 'i',	3,      451,     0 ), /*   450 lowpr             */
-  S_ST( 'o',	3,      452,     0 ), /*   451 lowpri            */
-  S_ST( 't',	3,      453,     0 ), /*   452 lowprio           */
-  S_ST( 'r',	3,      454,     0 ), /*   453 lowpriot          */
-  S_ST( 'a',	3,      335,     0 ), /*   454 lowpriotr         */
-  S_ST( 'm',	3,      536,   237 ), /*   455                   */
-  S_ST( 'a',	3,      474,     0 ), /*   456 m                 */
-  S_ST( 'n',	3,      458,     0 ), /*   457 ma                */
-  S_ST( 'y',	3,      459,     0 ), /*   458 man               */
-  S_ST( 'c',	3,      460,     0 ), /*   459 many              */
-  S_ST( 'a',	3,      461,     0 ), /*   460 manyc             */
-  S_ST( 's',	3,      462,     0 ), /*   461 manyca            */
-  S_ST( 't',	3,      468,     0 ), /*   462 manycas           */
-  S_ST( 'c',	3,      464,     0 ), /*   463 manycast          */
-  S_ST( 'l',	3,      465,     0 ), /*   464 manycastc         */
-  S_ST( 'i',	3,      466,     0 ), /*   465 manycastcl        */
-  S_ST( 'e',	3,      467,     0 ), /*   466 manycastcli       */
-  S_ST( 'n',	3,      336,     0 ), /*   467 manycastclie      */
-  S_ST( 's',	3,      469,   463 ), /*   468 manycast          */
-  S_ST( 'e',	3,      470,     0 ), /*   469 manycasts         */
-  S_ST( 'r',	3,      471,     0 ), /*   470 manycastse        */
-  S_ST( 'v',	3,      472,     0 ), /*   471 manycastser       */
-  S_ST( 'e',	3,      337,     0 ), /*   472 manycastserv      */
-  S_ST( 's',	3,      338,   457 ), /*   473 ma                */
-  S_ST( 'x',	3,      489,   473 ), /*   474 ma                */
-  S_ST( 'a',	3,      476,     0 ), /*   475 max               */
-  S_ST( 'g',	3,      339,     0 ), /*   476 maxa              */
-  S_ST( 'c',	3,      478,   475 ), /*   477 max               */
-  S_ST( 'l',	3,      479,     0 ), /*   478 maxc              */
-  S_ST( 'o',	3,      480,     0 ), /*   479 maxcl             */
-  S_ST( 'c',	3,      340,     0 ), /*   480 maxclo            */
-  S_ST( 'd',	3,      485,   477 ), /*   481 max               */
-  S_ST( 'e',	3,      483,     0 ), /*   482 maxd              */
-  S_ST( 'p',	3,      484,     0 ), /*   483 maxde             */
-  S_ST( 't',	3,      341,     0 ), /*   484 maxdep            */
-  S_ST( 'i',	3,      486,   482 ), /*   485 maxd              */
-  S_ST( 's',	3,      342,     0 ), /*   486 maxdi             */
-  S_ST( 'm',	3,      488,   481 ), /*   487 max               */
-  S_ST( 'e',	3,      343,     0 ), /*   488 maxm              */
-  S_ST( 'p',	3,      490,   487 ), /*   489 max               */
-  S_ST( 'o',	3,      491,     0 ), /*   490 maxp              */
-  S_ST( 'l',	3,      344,     0 ), /*   491 maxpo             */
-  S_ST( 'd',	3,      493,   456 ), /*   492 m                 */
-  S_ST( 'n',	3,      494,     0 ), /*   493 md                */
-  S_ST( 's',	3,      495,     0 ), /*   494 mdn               */
-  S_ST( 't',	3,      496,     0 ), /*   495 mdns              */
-  S_ST( 'r',	3,      497,     0 ), /*   496 mdnst             */
-  S_ST( 'i',	3,      498,     0 ), /*   497 mdnstr            */
-  S_ST( 'e',	3,      345,     0 ), /*   498 mdnstri           */
-  S_ST( 'e',	3,      346,   492 ), /*   499 m                 */
-  S_ST( 'l',	3,      501,     0 ), /*   500 mem               */
-  S_ST( 'o',	3,      502,     0 ), /*   501 meml              */
-  S_ST( 'c',	3,      347,     0 ), /*   502 memlo             */
-  S_ST( 'i',	3,      504,   499 ), /*   503 m                 */
-  S_ST( 'n',	3,      521,     0 ), /*   504 mi                */
-  S_ST( 'c',	3,      506,     0 ), /*   505 min               */
-  S_ST( 'l',	3,      507,     0 ), /*   506 minc              */
-  S_ST( 'o',	3,      508,     0 ), /*   507 mincl             */
-  S_ST( 'c',	3,      348,     0 ), /*   508 minclo            */
-  S_ST( 'd',	3,      513,   505 ), /*   509 min               */
-  S_ST( 'e',	3,      511,     0 ), /*   510 mind              */
-  S_ST( 'p',	3,      512,     0 ), /*   511 minde             */
-  S_ST( 't',	3,      349,     0 ), /*   512 mindep            */
-  S_ST( 'i',	3,      514,   510 ), /*   513 mind              */
-  S_ST( 's',	3,      350,     0 ), /*   514 mindi             */
-  S_ST( 'i',	3,      516,   509 ), /*   515 min               */
-  S_ST( 'm',	3,      517,     0 ), /*   516 mini              */
-  S_ST( 'u',	3,      351,     0 ), /*   517 minim             */
-  S_ST( 'p',	3,      519,   515 ), /*   518 min               */
-  S_ST( 'o',	3,      520,     0 ), /*   519 minp              */
-  S_ST( 'l',	3,      352,     0 ), /*   520 minpo             */
-  S_ST( 's',	3,      522,   518 ), /*   521 min               */
-  S_ST( 'a',	3,      523,     0 ), /*   522 mins              */
-  S_ST( 'n',	3,      353,     0 ), /*   523 minsa             */
-  S_ST( 'o',	3,      526,   503 ), /*   524 m                 */
-  S_ST( 'd',	3,      354,     0 ), /*   525 mo                */
-  S_ST( 'n',	3,      530,   525 ), /*   526 mo                */
-  S_ST( 'i',	3,      528,     0 ), /*   527 mon               */
-  S_ST( 't',	3,      529,     0 ), /*   528 moni              */
-  S_ST( 'o',	3,      356,     0 ), /*   529 monit             */
-  S_ST( 't',	3,      357,   527 ), /*   530 mon               */
-  S_ST( 'r',	3,      358,   524 ), /*   531 m                 */
-  S_ST( 's',	3,      533,   531 ), /*   532 m                 */
-  S_ST( 's',	3,      534,     0 ), /*   533 ms                */
-  S_ST( 'n',	3,      535,     0 ), /*   534 mss               */
-  S_ST( 't',	3,      327,     0 ), /*   535 mssn              */
-  S_ST( 'u',	3,      537,   532 ), /*   536 m                 */
-  S_ST( 'l',	3,      538,     0 ), /*   537 mu                */
-  S_ST( 't',	3,      539,     0 ), /*   538 mul               */
-  S_ST( 'i',	3,      540,     0 ), /*   539 mult              */
-  S_ST( 'c',	3,      541,     0 ), /*   540 multi             */
-  S_ST( 'a',	3,      542,     0 ), /*   541 multic            */
-  S_ST( 's',	3,      543,     0 ), /*   542 multica           */
-  S_ST( 't',	3,      544,     0 ), /*   543 multicas          */
-  S_ST( 'c',	3,      545,     0 ), /*   544 multicast         */
-  S_ST( 'l',	3,      546,     0 ), /*   545 multicastc        */
-  S_ST( 'i',	3,      547,     0 ), /*   546 multicastcl       */
-  S_ST( 'e',	3,      548,     0 ), /*   547 multicastcli      */
-  S_ST( 'n',	3,      359,     0 ), /*   548 multicastclie     */
-  S_ST( 'n',	3,      592,   455 ), /*   549                   */
-  S_ST( 'i',	3,      360,     0 ), /*   550 n                 */
-  S_ST( 'o',	3,      587,   550 ), /*   551 n                 */
-  S_ST( 'l',	3,      553,     0 ), /*   552 no                */
-  S_ST( 'i',	3,      554,     0 ), /*   553 nol               */
-  S_ST( 'n',	3,      361,     0 ), /*   554 noli              */
-  S_ST( 'm',	3,      560,   552 ), /*   555 no                */
-  S_ST( 'o',	3,      557,     0 ), /*   556 nom               */
-  S_ST( 'd',	3,      558,     0 ), /*   557 nomo              */
-  S_ST( 'i',	3,      559,     0 ), /*   558 nomod             */
-  S_ST( 'f',	3,      362,     0 ), /*   559 nomodi            */
-  S_ST( 'r',	3,      561,   556 ), /*   560 nom               */
-  S_ST( 'u',	3,      562,     0 ), /*   561 nomr              */
-  S_ST( 'l',	3,      563,     0 ), /*   562 nomru             */
-  S_ST( 'i',	3,      564,     0 ), /*   563 nomrul            */
-  S_ST( 's',	3,      363,     0 ), /*   564 nomruli           */
-  S_ST( 'n',	3,      566,   555 ), /*   565 no                */
-  S_ST( 'v',	3,      567,   364 ), /*   566 non               */
-  S_ST( 'o',	3,      568,     0 ), /*   567 nonv              */
-  S_ST( 'l',	3,      569,     0 ), /*   568 nonvo             */
-  S_ST( 'a',	3,      570,     0 ), /*   569 nonvol            */
-  S_ST( 't',	3,      571,     0 ), /*   570 nonvola           */
-  S_ST( 'i',	3,      572,     0 ), /*   571 nonvolat          */
-  S_ST( 'l',	3,      365,     0 ), /*   572 nonvolati         */
-  S_ST( 'p',	3,      574,   565 ), /*   573 no                */
-  S_ST( 'e',	3,      575,     0 ), /*   574 nop               */
-  S_ST( 'e',	3,      366,     0 ), /*   575 nope              */
-  S_ST( 'q',	3,      577,   573 ), /*   576 no                */
-  S_ST( 'u',	3,      578,     0 ), /*   577 noq               */
-  S_ST( 'e',	3,      579,     0 ), /*   578 noqu              */
-  S_ST( 'r',	3,      367,     0 ), /*   579 noque             */
-  S_ST( 's',	3,      581,   576 ), /*   580 no                */
-  S_ST( 'e',	3,      585,     0 ), /*   581 nos               */
-  S_ST( 'l',	3,      583,     0 ), /*   582 nose              */
-  S_ST( 'e',	3,      584,     0 ), /*   583 nosel             */
-  S_ST( 'c',	3,      368,     0 ), /*   584 nosele            */
-  S_ST( 'r',	3,      586,   582 ), /*   585 nose              */
-  S_ST( 'v',	3,      369,     0 ), /*   586 noser             */
-  S_ST( 't',	3,      588,   580 ), /*   587 no                */
-  S_ST( 'r',	3,      590,     0 ), /*   588 not               */
-  S_ST( 'a',	3,      370,     0 ), /*   589 notr              */
-  S_ST( 'u',	3,      591,   589 ), /*   590 notr              */
-  S_ST( 's',	3,      371,     0 ), /*   591 notru             */
-  S_ST( 't',	3,      372,   551 ), /*   592 n                 */
-  S_ST( 'p',	3,      594,     0 ), /*   593 ntp               */
-  S_ST( 'o',	3,      595,     0 ), /*   594 ntpp              */
-  S_ST( 'r',	3,      373,     0 ), /*   595 ntppo             */
-  S_ST( 's',	3,      597,   593 ), /*   596 ntp               */
-  S_ST( 'i',	3,      598,     0 ), /*   597 ntps              */
-  S_ST( 'g',	3,      599,     0 ), /*   598 ntpsi             */
-  S_ST( 'n',	3,      600,     0 ), /*   599 ntpsig            */
-  S_ST( 'd',	3,      601,     0 ), /*   600 ntpsign           */
-  S_ST( 's',	3,      602,     0 ), /*   601 ntpsignd          */
-  S_ST( 'o',	3,      603,     0 ), /*   602 ntpsignds         */
-  S_ST( 'c',	3,      604,     0 ), /*   603 ntpsigndso        */
-  S_ST( 'k',	3,      605,     0 ), /*   604 ntpsigndsoc       */
-  S_ST( 'e',	3,      374,     0 ), /*   605 ntpsigndsock      */
-  S_ST( 'o',	3,      607,   549 ), /*   606                   */
-  S_ST( 'r',	3,      608,     0 ), /*   607 o                 */
-  S_ST( 'p',	3,      609,     0 ), /*   608 or                */
-  S_ST( 'h',	3,      610,     0 ), /*   609 orp               */
-  S_ST( 'a',	3,      375,     0 ), /*   610 orph              */
-  S_ST( 'w',	3,      612,     0 ), /*   611 orphan            */
-  S_ST( 'a',	3,      613,     0 ), /*   612 orphanw           */
-  S_ST( 'i',	3,      376,     0 ), /*   613 orphanwa          */
-  S_ST( 'p',	3,      388,   606 ), /*   614                   */
-  S_ST( 'a',	3,      616,     0 ), /*   615 p                 */
-  S_ST( 'n',	3,      617,     0 ), /*   616 pa                */
-  S_ST( 'i',	3,      377,     0 ), /*   617 pan               */
-  S_ST( 'e',	3,      619,   615 ), /*   618 p                 */
-  S_ST( 'e',	3,      378,     0 ), /*   619 pe                */
-  S_ST( 's',	3,      621,     0 ), /*   620 peer              */
-  S_ST( 't',	3,      622,     0 ), /*   621 peers             */
-  S_ST( 'a',	3,      623,     0 ), /*   622 peerst            */
-  S_ST( 't',	3,      379,     0 ), /*   623 peersta           */
-  S_ST( 'h',	3,      625,   618 ), /*   624 p                 */
-  S_ST( 'o',	3,      626,     0 ), /*   625 ph                */
-  S_ST( 'n',	3,      380,     0 ), /*   626 pho               */
-  S_ST( 'i',	3,      381,   624 ), /*   627 p                 */
-  S_ST( 'f',	3,      629,     0 ), /*   628 pid               */
-  S_ST( 'i',	3,      630,     0 ), /*   629 pidf              */
-  S_ST( 'l',	3,      382,     0 ), /*   630 pidfi             */
-  S_ST( 'o',	3,      633,   627 ), /*   631 p                 */
-  S_ST( 'o',	3,      383,     0 ), /*   632 po                */
-  S_ST( 'r',	3,      384,   632 ), /*   633 po                */
-  S_ST( 'r',	3,      641,   631 ), /*   634 p                 */
-  S_ST( 'e',	3,      639,     0 ), /*   635 pr                */
-  S_ST( 'e',	3,      637,     0 ), /*   636 pre               */
-  S_ST( 'm',	3,      638,     0 ), /*   637 pree              */
-  S_ST( 'p',	3,      385,     0 ), /*   638 preem             */
-  S_ST( 'f',	3,      640,   636 ), /*   639 pre               */
-  S_ST( 'e',	3,      386,     0 ), /*   640 pref              */
-  S_ST( 'o',	3,      654,   635 ), /*   641 pr                */
-  S_ST( 'c',	3,      643,     0 ), /*   642 pro               */
-  S_ST( '_',	3,      644,     0 ), /*   643 proc              */
-  S_ST( 'd',	3,      645,     0 ), /*   644 proc_             */
-  S_ST( 'e',	3,      646,     0 ), /*   645 proc_d            */
-  S_ST( 'l',	3,      647,     0 ), /*   646 proc_de           */
-  S_ST( 'a',	3,      443,     0 ), /*   647 proc_del          */
-  S_ST( 'p',	3,      649,   642 ), /*   648 pro               */
-  S_ST( '_',	3,      650,     0 ), /*   649 prop              */
-  S_ST( 'd',	3,      651,     0 ), /*   650 prop_             */
-  S_ST( 'e',	3,      652,     0 ), /*   651 prop_d            */
-  S_ST( 'l',	3,      653,     0 ), /*   652 prop_de           */
-  S_ST( 'a',	3,      442,     0 ), /*   653 prop_del          */
-  S_ST( 't',	3,      655,   648 ), /*   654 pro               */
-  S_ST( 'o',	3,      656,     0 ), /*   655 prot              */
-  S_ST( 's',	3,      657,     0 ), /*   656 proto             */
-  S_ST( 't',	3,      658,     0 ), /*   657 protos            */
-  S_ST( 'a',	3,      659,     0 ), /*   658 protost           */
-  S_ST( 't',	3,      387,     0 ), /*   659 protosta          */
-  S_ST( 'r',	3,      691,   614 ), /*   660                   */
-  S_ST( 'a',	3,      667,     0 ), /*   661 r                 */
-  S_ST( 'n',	3,      663,     0 ), /*   662 ra                */
-  S_ST( 'd',	3,      664,     0 ), /*   663 ran               */
-  S_ST( 'f',	3,      665,     0 ), /*   664 rand              */
-  S_ST( 'i',	3,      666,     0 ), /*   665 randf             */
-  S_ST( 'l',	3,      389,     0 ), /*   666 randfi            */
-  S_ST( 'w',	3,      668,   662 ), /*   667 ra                */
-  S_ST( 's',	3,      669,     0 ), /*   668 raw               */
-  S_ST( 't',	3,      670,     0 ), /*   669 raws              */
-  S_ST( 'a',	3,      671,     0 ), /*   670 rawst             */
-  S_ST( 't',	3,      390,     0 ), /*   671 rawsta            */
-  S_ST( 'e',	3,      688,   661 ), /*   672 r                 */
-  S_ST( 'f',	3,      674,     0 ), /*   673 re                */
-  S_ST( 'i',	3,      391,     0 ), /*   674 ref               */
-  S_ST( 'q',	3,      676,   673 ), /*   675 re                */
-  S_ST( 'u',	3,      677,     0 ), /*   676 req               */
-  S_ST( 'e',	3,      678,     0 ), /*   677 requ              */
-  S_ST( 's',	3,      679,     0 ), /*   678 reque             */
-  S_ST( 't',	3,      680,     0 ), /*   679 reques            */
-  S_ST( 'k',	3,      681,     0 ), /*   680 request           */
-  S_ST( 'e',	3,      392,     0 ), /*   681 requestk          */
-  S_ST( 's',	3,      684,   675 ), /*   682 re                */
-  S_ST( 'e',	3,      393,     0 ), /*   683 res               */
-  S_ST( 't',	3,      685,   683 ), /*   684 res               */
-  S_ST( 'r',	3,      686,     0 ), /*   685 rest              */
-  S_ST( 'i',	3,      687,     0 ), /*   686 restr             */
-  S_ST( 'c',	3,      394,     0 ), /*   687 restri            */
-  S_ST( 'v',	3,      689,   682 ), /*   688 re                */
-  S_ST( 'o',	3,      690,     0 ), /*   689 rev               */
-  S_ST( 'k',	3,      395,     0 ), /*   690 revo              */
-  S_ST( 'l',	3,      692,   672 ), /*   691 r                 */
-  S_ST( 'i',	3,      693,     0 ), /*   692 rl                */
-  S_ST( 'm',	3,      694,     0 ), /*   693 rli               */
-  S_ST( 'i',	3,      396,     0 ), /*   694 rlim              */
-  S_ST( 's',	3,      763,   660 ), /*   695                   */
-  S_ST( 'a',	3,      697,     0 ), /*   696 s                 */
-  S_ST( 'v',	3,      698,     0 ), /*   697 sa                */
-  S_ST( 'e',	3,      699,     0 ), /*   698 sav               */
-  S_ST( 'c',	3,      700,     0 ), /*   699 save              */
-  S_ST( 'o',	3,      701,     0 ), /*   700 savec             */
-  S_ST( 'n',	3,      702,     0 ), /*   701 saveco            */
-  S_ST( 'f',	3,      703,     0 ), /*   702 savecon           */
-  S_ST( 'i',	3,      704,     0 ), /*   703 saveconf          */
-  S_ST( 'g',	3,      705,     0 ), /*   704 saveconfi         */
-  S_ST( 'd',	3,      706,     0 ), /*   705 saveconfig        */
-  S_ST( 'i',	3,      397,     0 ), /*   706 saveconfigd       */
-  S_ST( 'e',	3,      717,   696 ), /*   707 s                 */
-  S_ST( 'r',	3,      709,     0 ), /*   708 se                */
-  S_ST( 'v',	3,      710,     0 ), /*   709 ser               */
-  S_ST( 'e',	3,      398,     0 ), /*   710 serv              */
-  S_ST( '_',	3,      712,     0 ), /*   711 server            */
-  S_ST( 'o',	3,      713,     0 ), /*   712 server_           */
-  S_ST( 'f',	3,      714,     0 ), /*   713 server_o          */
-  S_ST( 'f',	3,      715,     0 ), /*   714 server_of         */
-  S_ST( 's',	3,      716,     0 ), /*   715 server_off        */
-  S_ST( 'e',	3,      437,     0 ), /*   716 server_offs       */
-  S_ST( 't',	3,      718,   708 ), /*   717 se                */
-  S_ST( 'v',	3,      719,     0 ), /*   718 set               */
-  S_ST( 'a',	3,      399,     0 ), /*   719 setv              */
-  S_ST( 'i',	3,      721,   707 ), /*   720 s                 */
-  S_ST( 'm',	3,      722,     0 ), /*   721 si                */
-  S_ST( 'u',	3,      723,     0 ), /*   722 sim               */
-  S_ST( 'l',	3,      724,     0 ), /*   723 simu              */
-  S_ST( 'a',	3,      725,     0 ), /*   724 simul             */
-  S_ST( 't',	3,      726,     0 ), /*   725 simula            */
-  S_ST( 'i',	3,      727,   434 ), /*   726 simulat           */
-  S_ST( 'o',	3,      728,     0 ), /*   727 simulati          */
-  S_ST( 'n',	3,      729,     0 ), /*   728 simulatio         */
-  S_ST( '_',	3,      730,     0 ), /*   729 simulation        */
-  S_ST( 'd',	3,      731,     0 ), /*   730 simulation_       */
-  S_ST( 'u',	3,      732,     0 ), /*   731 simulation_d      */
-  S_ST( 'r',	3,      733,     0 ), /*   732 simulation_du     */
-  S_ST( 'a',	3,      734,     0 ), /*   733 simulation_dur    */
-  S_ST( 't',	3,      735,     0 ), /*   734 simulation_dura   */
-  S_ST( 'i',	3,      736,     0 ), /*   735 simulation_durat  */
-  S_ST( 'o',	3,      436,     0 ), /*   736 simulation_durati */
-  S_ST( 'o',	3,      738,   720 ), /*   737 s                 */
-  S_ST( 'u',	3,      739,     0 ), /*   738 so                */
-  S_ST( 'r',	3,      740,     0 ), /*   739 sou               */
-  S_ST( 'c',	3,      400,     0 ), /*   740 sour              */
-  S_ST( 't',	3,      759,   737 ), /*   741 s                 */
-  S_ST( 'a',	3,      748,     0 ), /*   742 st                */
-  S_ST( 'c',	3,      744,     0 ), /*   743 sta               */
-  S_ST( 'k',	3,      745,     0 ), /*   744 stac              */
-  S_ST( 's',	3,      746,     0 ), /*   745 stack             */
-  S_ST( 'i',	3,      747,     0 ), /*   746 stacks            */
-  S_ST( 'z',	3,      401,     0 ), /*   747 stacksi           */
-  S_ST( 't',	3,      403,   743 ), /*   748 sta               */
-  S_ST( 'i',	3,      750,     0 ), /*   749 stat              */
-  S_ST( 's',	3,      751,     0 ), /*   750 stati             */
-  S_ST( 't',	3,      752,     0 ), /*   751 statis            */
-  S_ST( 'i',	3,      753,     0 ), /*   752 statist           */
-  S_ST( 'c',	3,      402,     0 ), /*   753 statisti          */
-  S_ST( 'd',	3,      755,     0 ), /*   754 stats             */
-  S_ST( 'i',	3,      404,     0 ), /*   755 statsd            */
-  S_ST( 'e',	3,      405,   742 ), /*   756 st                */
-  S_ST( 'o',	3,      758,     0 ), /*   757 step              */
-  S_ST( 'u',	3,      406,     0 ), /*   758 stepo             */
-  S_ST( 'r',	3,      760,   756 ), /*   759 st                */
-  S_ST( 'a',	3,      761,     0 ), /*   760 str               */
-  S_ST( 't',	3,      762,     0 ), /*   761 stra              */
-  S_ST( 'u',	3,      407,     0 ), /*   762 strat             */
-  S_ST( 'y',	3,      409,   741 ), /*   763 s                 */
-  S_ST( 's',	3,      765,     0 ), /*   764 sys               */
-  S_ST( 't',	3,      766,     0 ), /*   765 syss              */
-  S_ST( 'a',	3,      767,     0 ), /*   766 sysst             */
-  S_ST( 't',	3,      410,     0 ), /*   767 syssta            */
-  S_ST( 't',	3,      794,   695 ), /*   768                   */
-  S_ST( 'i',	3,      780,     0 ), /*   769 t                 */
-  S_ST( 'c',	3,      411,     0 ), /*   770 ti                */
-  S_ST( 'm',	3,      773,   770 ), /*   771 ti                */
-  S_ST( 'e',	3,      414,     0 ), /*   772 tim               */
-  S_ST( 'i',	3,      774,   772 ), /*   773 tim               */
-  S_ST( 'n',	3,      775,     0 ), /*   774 timi              */
-  S_ST( 'g',	3,      776,     0 ), /*   775 timin             */
-  S_ST( 's',	3,      777,     0 ), /*   776 timing            */
-  S_ST( 't',	3,      778,     0 ), /*   777 timings           */
-  S_ST( 'a',	3,      779,     0 ), /*   778 timingst          */
-  S_ST( 't',	3,      415,     0 ), /*   779 timingsta         */
-  S_ST( 'n',	3,      781,   771 ), /*   780 ti                */
-  S_ST( 'k',	3,      782,     0 ), /*   781 tin               */
-  S_ST( 'e',	3,      416,     0 ), /*   782 tink              */
-  S_ST( 'o',	3,      417,   769 ), /*   783 t                 */
-  S_ST( 'r',	3,      786,   783 ), /*   784 t                 */
-  S_ST( 'a',	3,      418,     0 ), /*   785 tr                */
-  S_ST( 'u',	3,      787,   785 ), /*   786 tr                */
-  S_ST( 's',	3,      788,   419 ), /*   787 tru               */
-  S_ST( 't',	3,      789,     0 ), /*   788 trus              */
-  S_ST( 'e',	3,      790,     0 ), /*   789 trust             */
-  S_ST( 'd',	3,      791,     0 ), /*   790 truste            */
-  S_ST( 'k',	3,      792,     0 ), /*   791 trusted           */
-  S_ST( 'e',	3,      420,     0 ), /*   792 trustedk          */
-  S_ST( 't',	3,      421,   784 ), /*   793 t                 */
-  S_ST( 'y',	3,      795,   793 ), /*   794 t                 */
-  S_ST( 'p',	3,      422,     0 ), /*   795 ty                */
-  S_ST( 'u',	3,      797,   768 ), /*   796                   */
-  S_ST( 'n',	3,      803,     0 ), /*   797 u                 */
-  S_ST( 'c',	3,      799,     0 ), /*   798 un                */
-  S_ST( 'o',	3,      800,     0 ), /*   799 unc               */
-  S_ST( 'n',	3,      801,     0 ), /*   800 unco              */
-  S_ST( 'f',	3,      802,     0 ), /*   801 uncon             */
-  S_ST( 'i',	3,      424,     0 ), /*   802 unconf            */
-  S_ST( 'p',	3,      804,   798 ), /*   803 un                */
-  S_ST( 'e',	3,      805,     0 ), /*   804 unp               */
-  S_ST( 'e',	3,      425,     0 ), /*   805 unpe              */
-  S_ST( 'v',	3,      807,   796 ), /*   806                   */
-  S_ST( 'e',	3,      808,     0 ), /*   807 v                 */
-  S_ST( 'r',	3,      809,     0 ), /*   808 ve                */
-  S_ST( 's',	3,      810,     0 ), /*   809 ver               */
-  S_ST( 'i',	3,      811,     0 ), /*   810 vers              */
-  S_ST( 'o',	3,      426,     0 ), /*   811 versi             */
-  S_ST( 'w',	3,      819,   806 ), /*   812                   */
-  S_ST( 'a',	3,      814,     0 ), /*   813 w                 */
-  S_ST( 'n',	3,      815,     0 ), /*   814 wa                */
-  S_ST( 'd',	3,      816,     0 ), /*   815 wan               */
-  S_ST( 'e',	3,      440,     0 ), /*   816 wand              */
-  S_ST( 'e',	3,      818,   813 ), /*   817 w                 */
-  S_ST( 'e',	3,      428,     0 ), /*   818 we                */
-  S_ST( 'i',	3,      820,   817 ), /*   819 w                 */
-  S_ST( 'l',	3,      821,     0 ), /*   820 wi                */
-  S_ST( 'd',	3,      822,     0 ), /*   821 wil               */
-  S_ST( 'c',	3,      823,     0 ), /*   822 wild              */
-  S_ST( 'a',	3,      824,     0 ), /*   823 wildc             */
-  S_ST( 'r',	3,      429,     0 ), /*   824 wildca            */
-  S_ST( 'x',	3,      826,   812 ), /*   825                   */
-  S_ST( 'l',	3,      827,     0 ), /*   826 x                 */
-  S_ST( 'e',	3,      828,     0 ), /*   827 xl                */
-  S_ST( 'a',	3,      829,     0 ), /*   828 xle               */
-  S_ST( 'v',	3,      430,     0 ), /*   829 xlea              */
-  S_ST( 'y',	3,      831,   825 ), /*   830 [initial state]   */
-  S_ST( 'e',	3,      832,     0 ), /*   831 y                 */
-  S_ST( 'a',	3,      431,     0 )  /*   832 ye                */
+  S_ST( 'n',	0,        0,     0 ), /*   440 440               */
+  S_ST( 't',	0,        0,     0 ), /*   441 441               */
+  S_ST( 'r',	0,        0,     0 ), /*   442 442               */
+  S_ST( 'r',	0,        0,     0 ), /*   443 443               */
+  S_ST( 'y',	0,        0,     0 ), /*   444 444               */
+  S_ST( 'y',	0,        0,     0 ), /*   445 445               */
+  S_ST( 't',	3,      447,     0 ), /*   446 loops             */
+  S_ST( 'a',	3,      448,     0 ), /*   447 loopst            */
+  S_ST( 't',	3,      334,     0 ), /*   448 loopsta           */
+  S_ST( 'w',	3,      450,   429 ), /*   449 lo                */
+  S_ST( 'p',	3,      451,     0 ), /*   450 low               */
+  S_ST( 'r',	3,      452,     0 ), /*   451 lowp              */
+  S_ST( 'i',	3,      453,     0 ), /*   452 lowpr             */
+  S_ST( 'o',	3,      454,     0 ), /*   453 lowpri            */
+  S_ST( 't',	3,      455,     0 ), /*   454 lowprio           */
+  S_ST( 'r',	3,      456,     0 ), /*   455 lowpriot          */
+  S_ST( 'a',	3,      335,     0 ), /*   456 lowpriotr         */
+  S_ST( 'm',	3,      538,   237 ), /*   457                   */
+  S_ST( 'a',	3,      476,     0 ), /*   458 m                 */
+  S_ST( 'n',	3,      460,     0 ), /*   459 ma                */
+  S_ST( 'y',	3,      461,     0 ), /*   460 man               */
+  S_ST( 'c',	3,      462,     0 ), /*   461 many              */
+  S_ST( 'a',	3,      463,     0 ), /*   462 manyc             */
+  S_ST( 's',	3,      464,     0 ), /*   463 manyca            */
+  S_ST( 't',	3,      470,     0 ), /*   464 manycas           */
+  S_ST( 'c',	3,      466,     0 ), /*   465 manycast          */
+  S_ST( 'l',	3,      467,     0 ), /*   466 manycastc         */
+  S_ST( 'i',	3,      468,     0 ), /*   467 manycastcl        */
+  S_ST( 'e',	3,      469,     0 ), /*   468 manycastcli       */
+  S_ST( 'n',	3,      336,     0 ), /*   469 manycastclie      */
+  S_ST( 's',	3,      471,   465 ), /*   470 manycast          */
+  S_ST( 'e',	3,      472,     0 ), /*   471 manycasts         */
+  S_ST( 'r',	3,      473,     0 ), /*   472 manycastse        */
+  S_ST( 'v',	3,      474,     0 ), /*   473 manycastser       */
+  S_ST( 'e',	3,      337,     0 ), /*   474 manycastserv      */
+  S_ST( 's',	3,      338,   459 ), /*   475 ma                */
+  S_ST( 'x',	3,      491,   475 ), /*   476 ma                */
+  S_ST( 'a',	3,      478,     0 ), /*   477 max               */
+  S_ST( 'g',	3,      339,     0 ), /*   478 maxa              */
+  S_ST( 'c',	3,      480,   477 ), /*   479 max               */
+  S_ST( 'l',	3,      481,     0 ), /*   480 maxc              */
+  S_ST( 'o',	3,      482,     0 ), /*   481 maxcl             */
+  S_ST( 'c',	3,      340,     0 ), /*   482 maxclo            */
+  S_ST( 'd',	3,      487,   479 ), /*   483 max               */
+  S_ST( 'e',	3,      485,     0 ), /*   484 maxd              */
+  S_ST( 'p',	3,      486,     0 ), /*   485 maxde             */
+  S_ST( 't',	3,      341,     0 ), /*   486 maxdep            */
+  S_ST( 'i',	3,      488,   484 ), /*   487 maxd              */
+  S_ST( 's',	3,      342,     0 ), /*   488 maxdi             */
+  S_ST( 'm',	3,      490,   483 ), /*   489 max               */
+  S_ST( 'e',	3,      343,     0 ), /*   490 maxm              */
+  S_ST( 'p',	3,      492,   489 ), /*   491 max               */
+  S_ST( 'o',	3,      493,     0 ), /*   492 maxp              */
+  S_ST( 'l',	3,      344,     0 ), /*   493 maxpo             */
+  S_ST( 'd',	3,      495,   458 ), /*   494 m                 */
+  S_ST( 'n',	3,      496,     0 ), /*   495 md                */
+  S_ST( 's',	3,      497,     0 ), /*   496 mdn               */
+  S_ST( 't',	3,      498,     0 ), /*   497 mdns              */
+  S_ST( 'r',	3,      499,     0 ), /*   498 mdnst             */
+  S_ST( 'i',	3,      500,     0 ), /*   499 mdnstr            */
+  S_ST( 'e',	3,      345,     0 ), /*   500 mdnstri           */
+  S_ST( 'e',	3,      346,   494 ), /*   501 m                 */
+  S_ST( 'l',	3,      503,     0 ), /*   502 mem               */
+  S_ST( 'o',	3,      504,     0 ), /*   503 meml              */
+  S_ST( 'c',	3,      347,     0 ), /*   504 memlo             */
+  S_ST( 'i',	3,      506,   501 ), /*   505 m                 */
+  S_ST( 'n',	3,      523,     0 ), /*   506 mi                */
+  S_ST( 'c',	3,      508,     0 ), /*   507 min               */
+  S_ST( 'l',	3,      509,     0 ), /*   508 minc              */
+  S_ST( 'o',	3,      510,     0 ), /*   509 mincl             */
+  S_ST( 'c',	3,      348,     0 ), /*   510 minclo            */
+  S_ST( 'd',	3,      515,   507 ), /*   511 min               */
+  S_ST( 'e',	3,      513,     0 ), /*   512 mind              */
+  S_ST( 'p',	3,      514,     0 ), /*   513 minde             */
+  S_ST( 't',	3,      349,     0 ), /*   514 mindep            */
+  S_ST( 'i',	3,      516,   512 ), /*   515 mind              */
+  S_ST( 's',	3,      350,     0 ), /*   516 mindi             */
+  S_ST( 'i',	3,      518,   511 ), /*   517 min               */
+  S_ST( 'm',	3,      519,     0 ), /*   518 mini              */
+  S_ST( 'u',	3,      351,     0 ), /*   519 minim             */
+  S_ST( 'p',	3,      521,   517 ), /*   520 min               */
+  S_ST( 'o',	3,      522,     0 ), /*   521 minp              */
+  S_ST( 'l',	3,      352,     0 ), /*   522 minpo             */
+  S_ST( 's',	3,      524,   520 ), /*   523 min               */
+  S_ST( 'a',	3,      525,     0 ), /*   524 mins              */
+  S_ST( 'n',	3,      353,     0 ), /*   525 minsa             */
+  S_ST( 'o',	3,      528,   505 ), /*   526 m                 */
+  S_ST( 'd',	3,      354,     0 ), /*   527 mo                */
+  S_ST( 'n',	3,      532,   527 ), /*   528 mo                */
+  S_ST( 'i',	3,      530,     0 ), /*   529 mon               */
+  S_ST( 't',	3,      531,     0 ), /*   530 moni              */
+  S_ST( 'o',	3,      356,     0 ), /*   531 monit             */
+  S_ST( 't',	3,      357,   529 ), /*   532 mon               */
+  S_ST( 'r',	3,      358,   526 ), /*   533 m                 */
+  S_ST( 's',	3,      535,   533 ), /*   534 m                 */
+  S_ST( 's',	3,      536,     0 ), /*   535 ms                */
+  S_ST( 'n',	3,      537,     0 ), /*   536 mss               */
+  S_ST( 't',	3,      327,     0 ), /*   537 mssn              */
+  S_ST( 'u',	3,      539,   534 ), /*   538 m                 */
+  S_ST( 'l',	3,      540,     0 ), /*   539 mu                */
+  S_ST( 't',	3,      541,     0 ), /*   540 mul               */
+  S_ST( 'i',	3,      542,     0 ), /*   541 mult              */
+  S_ST( 'c',	3,      543,     0 ), /*   542 multi             */
+  S_ST( 'a',	3,      544,     0 ), /*   543 multic            */
+  S_ST( 's',	3,      545,     0 ), /*   544 multica           */
+  S_ST( 't',	3,      546,     0 ), /*   545 multicas          */
+  S_ST( 'c',	3,      547,     0 ), /*   546 multicast         */
+  S_ST( 'l',	3,      548,     0 ), /*   547 multicastc        */
+  S_ST( 'i',	3,      549,     0 ), /*   548 multicastcl       */
+  S_ST( 'e',	3,      550,     0 ), /*   549 multicastcli      */
+  S_ST( 'n',	3,      359,     0 ), /*   550 multicastclie     */
+  S_ST( 'n',	3,      594,   457 ), /*   551                   */
+  S_ST( 'i',	3,      360,     0 ), /*   552 n                 */
+  S_ST( 'o',	3,      589,   552 ), /*   553 n                 */
+  S_ST( 'l',	3,      555,     0 ), /*   554 no                */
+  S_ST( 'i',	3,      556,     0 ), /*   555 nol               */
+  S_ST( 'n',	3,      361,     0 ), /*   556 noli              */
+  S_ST( 'm',	3,      562,   554 ), /*   557 no                */
+  S_ST( 'o',	3,      559,     0 ), /*   558 nom               */
+  S_ST( 'd',	3,      560,     0 ), /*   559 nomo              */
+  S_ST( 'i',	3,      561,     0 ), /*   560 nomod             */
+  S_ST( 'f',	3,      362,     0 ), /*   561 nomodi            */
+  S_ST( 'r',	3,      563,   558 ), /*   562 nom               */
+  S_ST( 'u',	3,      564,     0 ), /*   563 nomr              */
+  S_ST( 'l',	3,      565,     0 ), /*   564 nomru             */
+  S_ST( 'i',	3,      566,     0 ), /*   565 nomrul            */
+  S_ST( 's',	3,      363,     0 ), /*   566 nomruli           */
+  S_ST( 'n',	3,      568,   557 ), /*   567 no                */
+  S_ST( 'v',	3,      569,   364 ), /*   568 non               */
+  S_ST( 'o',	3,      570,     0 ), /*   569 nonv              */
+  S_ST( 'l',	3,      571,     0 ), /*   570 nonvo             */
+  S_ST( 'a',	3,      572,     0 ), /*   571 nonvol            */
+  S_ST( 't',	3,      573,     0 ), /*   572 nonvola           */
+  S_ST( 'i',	3,      574,     0 ), /*   573 nonvolat          */
+  S_ST( 'l',	3,      365,     0 ), /*   574 nonvolati         */
+  S_ST( 'p',	3,      576,   567 ), /*   575 no                */
+  S_ST( 'e',	3,      577,     0 ), /*   576 nop               */
+  S_ST( 'e',	3,      366,     0 ), /*   577 nope              */
+  S_ST( 'q',	3,      579,   575 ), /*   578 no                */
+  S_ST( 'u',	3,      580,     0 ), /*   579 noq               */
+  S_ST( 'e',	3,      581,     0 ), /*   580 noqu              */
+  S_ST( 'r',	3,      367,     0 ), /*   581 noque             */
+  S_ST( 's',	3,      583,   578 ), /*   582 no                */
+  S_ST( 'e',	3,      587,     0 ), /*   583 nos               */
+  S_ST( 'l',	3,      585,     0 ), /*   584 nose              */
+  S_ST( 'e',	3,      586,     0 ), /*   585 nosel             */
+  S_ST( 'c',	3,      368,     0 ), /*   586 nosele            */
+  S_ST( 'r',	3,      588,   584 ), /*   587 nose              */
+  S_ST( 'v',	3,      369,     0 ), /*   588 noser             */
+  S_ST( 't',	3,      590,   582 ), /*   589 no                */
+  S_ST( 'r',	3,      592,     0 ), /*   590 not               */
+  S_ST( 'a',	3,      370,     0 ), /*   591 notr              */
+  S_ST( 'u',	3,      593,   591 ), /*   592 notr              */
+  S_ST( 's',	3,      371,     0 ), /*   593 notru             */
+  S_ST( 't',	3,      372,   553 ), /*   594 n                 */
+  S_ST( 'p',	3,      596,     0 ), /*   595 ntp               */
+  S_ST( 'o',	3,      597,     0 ), /*   596 ntpp              */
+  S_ST( 'r',	3,      373,     0 ), /*   597 ntppo             */
+  S_ST( 's',	3,      599,   595 ), /*   598 ntp               */
+  S_ST( 'i',	3,      600,     0 ), /*   599 ntps              */
+  S_ST( 'g',	3,      601,     0 ), /*   600 ntpsi             */
+  S_ST( 'n',	3,      602,     0 ), /*   601 ntpsig            */
+  S_ST( 'd',	3,      603,     0 ), /*   602 ntpsign           */
+  S_ST( 's',	3,      604,     0 ), /*   603 ntpsignd          */
+  S_ST( 'o',	3,      605,     0 ), /*   604 ntpsignds         */
+  S_ST( 'c',	3,      606,     0 ), /*   605 ntpsigndso        */
+  S_ST( 'k',	3,      607,     0 ), /*   606 ntpsigndsoc       */
+  S_ST( 'e',	3,      374,     0 ), /*   607 ntpsigndsock      */
+  S_ST( 'o',	3,      609,   551 ), /*   608                   */
+  S_ST( 'r',	3,      610,     0 ), /*   609 o                 */
+  S_ST( 'p',	3,      611,     0 ), /*   610 or                */
+  S_ST( 'h',	3,      612,     0 ), /*   611 orp               */
+  S_ST( 'a',	3,      375,     0 ), /*   612 orph              */
+  S_ST( 'w',	3,      614,     0 ), /*   613 orphan            */
+  S_ST( 'a',	3,      615,     0 ), /*   614 orphanw           */
+  S_ST( 'i',	3,      376,     0 ), /*   615 orphanwa          */
+  S_ST( 'p',	3,      388,   608 ), /*   616                   */
+  S_ST( 'a',	3,      618,     0 ), /*   617 p                 */
+  S_ST( 'n',	3,      619,     0 ), /*   618 pa                */
+  S_ST( 'i',	3,      377,     0 ), /*   619 pan               */
+  S_ST( 'e',	3,      621,   617 ), /*   620 p                 */
+  S_ST( 'e',	3,      378,     0 ), /*   621 pe                */
+  S_ST( 's',	3,      623,     0 ), /*   622 peer              */
+  S_ST( 't',	3,      624,     0 ), /*   623 peers             */
+  S_ST( 'a',	3,      625,     0 ), /*   624 peerst            */
+  S_ST( 't',	3,      379,     0 ), /*   625 peersta           */
+  S_ST( 'h',	3,      627,   620 ), /*   626 p                 */
+  S_ST( 'o',	3,      628,     0 ), /*   627 ph                */
+  S_ST( 'n',	3,      380,     0 ), /*   628 pho               */
+  S_ST( 'i',	3,      381,   626 ), /*   629 p                 */
+  S_ST( 'f',	3,      631,     0 ), /*   630 pid               */
+  S_ST( 'i',	3,      632,     0 ), /*   631 pidf              */
+  S_ST( 'l',	3,      382,     0 ), /*   632 pidfi             */
+  S_ST( 'o',	3,      635,   629 ), /*   633 p                 */
+  S_ST( 'o',	3,      383,     0 ), /*   634 po                */
+  S_ST( 'r',	3,      384,   634 ), /*   635 po                */
+  S_ST( 'r',	3,      643,   633 ), /*   636 p                 */
+  S_ST( 'e',	3,      641,     0 ), /*   637 pr                */
+  S_ST( 'e',	3,      639,     0 ), /*   638 pre               */
+  S_ST( 'm',	3,      640,     0 ), /*   639 pree              */
+  S_ST( 'p',	3,      385,     0 ), /*   640 preem             */
+  S_ST( 'f',	3,      642,   638 ), /*   641 pre               */
+  S_ST( 'e',	3,      386,     0 ), /*   642 pref              */
+  S_ST( 'o',	3,      656,   637 ), /*   643 pr                */
+  S_ST( 'c',	3,      645,     0 ), /*   644 pro               */
+  S_ST( '_',	3,      646,     0 ), /*   645 proc              */
+  S_ST( 'd',	3,      647,     0 ), /*   646 proc_             */
+  S_ST( 'e',	3,      648,     0 ), /*   647 proc_d            */
+  S_ST( 'l',	3,      649,     0 ), /*   648 proc_de           */
+  S_ST( 'a',	3,      445,     0 ), /*   649 proc_del          */
+  S_ST( 'p',	3,      651,   644 ), /*   650 pro               */
+  S_ST( '_',	3,      652,     0 ), /*   651 prop              */
+  S_ST( 'd',	3,      653,     0 ), /*   652 prop_             */
+  S_ST( 'e',	3,      654,     0 ), /*   653 prop_d            */
+  S_ST( 'l',	3,      655,     0 ), /*   654 prop_de           */
+  S_ST( 'a',	3,      444,     0 ), /*   655 prop_del          */
+  S_ST( 't',	3,      657,   650 ), /*   656 pro               */
+  S_ST( 'o',	3,      658,     0 ), /*   657 prot              */
+  S_ST( 's',	3,      659,     0 ), /*   658 proto             */
+  S_ST( 't',	3,      660,     0 ), /*   659 protos            */
+  S_ST( 'a',	3,      661,     0 ), /*   660 protost           */
+  S_ST( 't',	3,      387,     0 ), /*   661 protosta          */
+  S_ST( 'r',	3,      693,   616 ), /*   662                   */
+  S_ST( 'a',	3,      669,     0 ), /*   663 r                 */
+  S_ST( 'n',	3,      665,     0 ), /*   664 ra                */
+  S_ST( 'd',	3,      666,     0 ), /*   665 ran               */
+  S_ST( 'f',	3,      667,     0 ), /*   666 rand              */
+  S_ST( 'i',	3,      668,     0 ), /*   667 randf             */
+  S_ST( 'l',	3,      389,     0 ), /*   668 randfi            */
+  S_ST( 'w',	3,      670,   664 ), /*   669 ra                */
+  S_ST( 's',	3,      671,     0 ), /*   670 raw               */
+  S_ST( 't',	3,      672,     0 ), /*   671 raws              */
+  S_ST( 'a',	3,      673,     0 ), /*   672 rawst             */
+  S_ST( 't',	3,      390,     0 ), /*   673 rawsta            */
+  S_ST( 'e',	3,      690,   663 ), /*   674 r                 */
+  S_ST( 'f',	3,      676,     0 ), /*   675 re                */
+  S_ST( 'i',	3,      391,     0 ), /*   676 ref               */
+  S_ST( 'q',	3,      678,   675 ), /*   677 re                */
+  S_ST( 'u',	3,      679,     0 ), /*   678 req               */
+  S_ST( 'e',	3,      680,     0 ), /*   679 requ              */
+  S_ST( 's',	3,      681,     0 ), /*   680 reque             */
+  S_ST( 't',	3,      682,     0 ), /*   681 reques            */
+  S_ST( 'k',	3,      683,     0 ), /*   682 request           */
+  S_ST( 'e',	3,      392,     0 ), /*   683 requestk          */
+  S_ST( 's',	3,      686,   677 ), /*   684 re                */
+  S_ST( 'e',	3,      393,     0 ), /*   685 res               */
+  S_ST( 't',	3,      687,   685 ), /*   686 res               */
+  S_ST( 'r',	3,      688,     0 ), /*   687 rest              */
+  S_ST( 'i',	3,      689,     0 ), /*   688 restr             */
+  S_ST( 'c',	3,      394,     0 ), /*   689 restri            */
+  S_ST( 'v',	3,      691,   684 ), /*   690 re                */
+  S_ST( 'o',	3,      692,     0 ), /*   691 rev               */
+  S_ST( 'k',	3,      395,     0 ), /*   692 revo              */
+  S_ST( 'l',	3,      694,   674 ), /*   693 r                 */
+  S_ST( 'i',	3,      695,     0 ), /*   694 rl                */
+  S_ST( 'm',	3,      696,     0 ), /*   695 rli               */
+  S_ST( 'i',	3,      396,     0 ), /*   696 rlim              */
+  S_ST( 's',	3,      770,   662 ), /*   697                   */
+  S_ST( 'a',	3,      699,     0 ), /*   698 s                 */
+  S_ST( 'v',	3,      700,     0 ), /*   699 sa                */
+  S_ST( 'e',	3,      701,     0 ), /*   700 sav               */
+  S_ST( 'c',	3,      702,     0 ), /*   701 save              */
+  S_ST( 'o',	3,      703,     0 ), /*   702 savec             */
+  S_ST( 'n',	3,      704,     0 ), /*   703 saveco            */
+  S_ST( 'f',	3,      705,     0 ), /*   704 savecon           */
+  S_ST( 'i',	3,      706,     0 ), /*   705 saveconf          */
+  S_ST( 'g',	3,      707,     0 ), /*   706 saveconfi         */
+  S_ST( 'd',	3,      708,     0 ), /*   707 saveconfig        */
+  S_ST( 'i',	3,      397,     0 ), /*   708 saveconfigd       */
+  S_ST( 'e',	3,      719,   698 ), /*   709 s                 */
+  S_ST( 'r',	3,      711,     0 ), /*   710 se                */
+  S_ST( 'v',	3,      712,     0 ), /*   711 ser               */
+  S_ST( 'e',	3,      398,     0 ), /*   712 serv              */
+  S_ST( '_',	3,      714,     0 ), /*   713 server            */
+  S_ST( 'o',	3,      715,     0 ), /*   714 server_           */
+  S_ST( 'f',	3,      716,     0 ), /*   715 server_o          */
+  S_ST( 'f',	3,      717,     0 ), /*   716 server_of         */
+  S_ST( 's',	3,      718,     0 ), /*   717 server_off        */
+  S_ST( 'e',	3,      439,     0 ), /*   718 server_offs       */
+  S_ST( 't',	3,      720,   710 ), /*   719 se                */
+  S_ST( 'v',	3,      721,     0 ), /*   720 set               */
+  S_ST( 'a',	3,      399,     0 ), /*   721 setv              */
+  S_ST( 'i',	3,      723,   709 ), /*   722 s                 */
+  S_ST( 'm',	3,      724,     0 ), /*   723 si                */
+  S_ST( 'u',	3,      725,     0 ), /*   724 sim               */
+  S_ST( 'l',	3,      726,     0 ), /*   725 simu              */
+  S_ST( 'a',	3,      727,     0 ), /*   726 simul             */
+  S_ST( 't',	3,      728,     0 ), /*   727 simula            */
+  S_ST( 'i',	3,      729,   436 ), /*   728 simulat           */
+  S_ST( 'o',	3,      730,     0 ), /*   729 simulati          */
+  S_ST( 'n',	3,      731,     0 ), /*   730 simulatio         */
+  S_ST( '_',	3,      732,     0 ), /*   731 simulation        */
+  S_ST( 'd',	3,      733,     0 ), /*   732 simulation_       */
+  S_ST( 'u',	3,      734,     0 ), /*   733 simulation_d      */
+  S_ST( 'r',	3,      735,     0 ), /*   734 simulation_du     */
+  S_ST( 'a',	3,      736,     0 ), /*   735 simulation_dur    */
+  S_ST( 't',	3,      737,     0 ), /*   736 simulation_dura   */
+  S_ST( 'i',	3,      738,     0 ), /*   737 simulation_durat  */
+  S_ST( 'o',	3,      438,     0 ), /*   738 simulation_durati */
+  S_ST( 'o',	3,      740,   722 ), /*   739 s                 */
+  S_ST( 'u',	3,      741,     0 ), /*   740 so                */
+  S_ST( 'r',	3,      742,     0 ), /*   741 sou               */
+  S_ST( 'c',	3,      400,     0 ), /*   742 sour              */
+  S_ST( 't',	3,      766,   739 ), /*   743 s                 */
+  S_ST( 'a',	3,      750,     0 ), /*   744 st                */
+  S_ST( 'c',	3,      746,     0 ), /*   745 sta               */
+  S_ST( 'k',	3,      747,     0 ), /*   746 stac              */
+  S_ST( 's',	3,      748,     0 ), /*   747 stack             */
+  S_ST( 'i',	3,      749,     0 ), /*   748 stacks            */
+  S_ST( 'z',	3,      401,     0 ), /*   749 stacksi           */
+  S_ST( 't',	3,      403,   745 ), /*   750 sta               */
+  S_ST( 'i',	3,      752,     0 ), /*   751 stat              */
+  S_ST( 's',	3,      753,     0 ), /*   752 stati             */
+  S_ST( 't',	3,      754,     0 ), /*   753 statis            */
+  S_ST( 'i',	3,      755,     0 ), /*   754 statist           */
+  S_ST( 'c',	3,      402,     0 ), /*   755 statisti          */
+  S_ST( 'd',	3,      757,     0 ), /*   756 stats             */
+  S_ST( 'i',	3,      404,     0 ), /*   757 statsd            */
+  S_ST( 'e',	3,      405,   744 ), /*   758 st                */
+  S_ST( 'b',	3,      760,     0 ), /*   759 step              */
+  S_ST( 'a',	3,      761,     0 ), /*   760 stepb             */
+  S_ST( 'c',	3,      406,     0 ), /*   761 stepba            */
+  S_ST( 'f',	3,      763,   759 ), /*   762 step              */
+  S_ST( 'w',	3,      407,     0 ), /*   763 stepf             */
+  S_ST( 'o',	3,      765,   762 ), /*   764 step              */
+  S_ST( 'u',	3,      408,     0 ), /*   765 stepo             */
+  S_ST( 'r',	3,      767,   758 ), /*   766 st                */
+  S_ST( 'a',	3,      768,     0 ), /*   767 str               */
+  S_ST( 't',	3,      769,     0 ), /*   768 stra              */
+  S_ST( 'u',	3,      409,     0 ), /*   769 strat             */
+  S_ST( 'y',	3,      411,   743 ), /*   770 s                 */
+  S_ST( 's',	3,      772,     0 ), /*   771 sys               */
+  S_ST( 't',	3,      773,     0 ), /*   772 syss              */
+  S_ST( 'a',	3,      774,     0 ), /*   773 sysst             */
+  S_ST( 't',	3,      412,     0 ), /*   774 syssta            */
+  S_ST( 't',	3,      801,   697 ), /*   775                   */
+  S_ST( 'i',	3,      787,     0 ), /*   776 t                 */
+  S_ST( 'c',	3,      413,     0 ), /*   777 ti                */
+  S_ST( 'm',	3,      780,   777 ), /*   778 ti                */
+  S_ST( 'e',	3,      416,     0 ), /*   779 tim               */
+  S_ST( 'i',	3,      781,   779 ), /*   780 tim               */
+  S_ST( 'n',	3,      782,     0 ), /*   781 timi              */
+  S_ST( 'g',	3,      783,     0 ), /*   782 timin             */
+  S_ST( 's',	3,      784,     0 ), /*   783 timing            */
+  S_ST( 't',	3,      785,     0 ), /*   784 timings           */
+  S_ST( 'a',	3,      786,     0 ), /*   785 timingst          */
+  S_ST( 't',	3,      417,     0 ), /*   786 timingsta         */
+  S_ST( 'n',	3,      788,   778 ), /*   787 ti                */
+  S_ST( 'k',	3,      789,     0 ), /*   788 tin               */
+  S_ST( 'e',	3,      418,     0 ), /*   789 tink              */
+  S_ST( 'o',	3,      419,   776 ), /*   790 t                 */
+  S_ST( 'r',	3,      793,   790 ), /*   791 t                 */
+  S_ST( 'a',	3,      420,     0 ), /*   792 tr                */
+  S_ST( 'u',	3,      794,   792 ), /*   793 tr                */
+  S_ST( 's',	3,      795,   421 ), /*   794 tru               */
+  S_ST( 't',	3,      796,     0 ), /*   795 trus              */
+  S_ST( 'e',	3,      797,     0 ), /*   796 trust             */
+  S_ST( 'd',	3,      798,     0 ), /*   797 truste            */
+  S_ST( 'k',	3,      799,     0 ), /*   798 trusted           */
+  S_ST( 'e',	3,      422,     0 ), /*   799 trustedk          */
+  S_ST( 't',	3,      423,   791 ), /*   800 t                 */
+  S_ST( 'y',	3,      802,   800 ), /*   801 t                 */
+  S_ST( 'p',	3,      424,     0 ), /*   802 ty                */
+  S_ST( 'u',	3,      804,   775 ), /*   803                   */
+  S_ST( 'n',	3,      810,     0 ), /*   804 u                 */
+  S_ST( 'c',	3,      806,     0 ), /*   805 un                */
+  S_ST( 'o',	3,      807,     0 ), /*   806 unc               */
+  S_ST( 'n',	3,      808,     0 ), /*   807 unco              */
+  S_ST( 'f',	3,      809,     0 ), /*   808 uncon             */
+  S_ST( 'i',	3,      426,     0 ), /*   809 unconf            */
+  S_ST( 'p',	3,      811,   805 ), /*   810 un                */
+  S_ST( 'e',	3,      812,     0 ), /*   811 unp               */
+  S_ST( 'e',	3,      427,     0 ), /*   812 unpe              */
+  S_ST( 'v',	3,      814,   803 ), /*   813                   */
+  S_ST( 'e',	3,      815,     0 ), /*   814 v                 */
+  S_ST( 'r',	3,      816,     0 ), /*   815 ve                */
+  S_ST( 's',	3,      817,     0 ), /*   816 ver               */
+  S_ST( 'i',	3,      818,     0 ), /*   817 vers              */
+  S_ST( 'o',	3,      428,     0 ), /*   818 versi             */
+  S_ST( 'w',	3,      826,   813 ), /*   819                   */
+  S_ST( 'a',	3,      821,     0 ), /*   820 w                 */
+  S_ST( 'n',	3,      822,     0 ), /*   821 wa                */
+  S_ST( 'd',	3,      823,     0 ), /*   822 wan               */
+  S_ST( 'e',	3,      442,     0 ), /*   823 wand              */
+  S_ST( 'e',	3,      825,   820 ), /*   824 w                 */
+  S_ST( 'e',	3,      430,     0 ), /*   825 we                */
+  S_ST( 'i',	3,      827,   824 ), /*   826 w                 */
+  S_ST( 'l',	3,      828,     0 ), /*   827 wi                */
+  S_ST( 'd',	3,      829,     0 ), /*   828 wil               */
+  S_ST( 'c',	3,      830,     0 ), /*   829 wild              */
+  S_ST( 'a',	3,      831,     0 ), /*   830 wildc             */
+  S_ST( 'r',	3,      431,     0 ), /*   831 wildca            */
+  S_ST( 'x',	3,      833,   819 ), /*   832                   */
+  S_ST( 'l',	3,      834,     0 ), /*   833 x                 */
+  S_ST( 'e',	3,      835,     0 ), /*   834 xl                */
+  S_ST( 'a',	3,      836,     0 ), /*   835 xle               */
+  S_ST( 'v',	3,      432,     0 ), /*   836 xlea              */
+  S_ST( 'y',	3,      838,   832 ), /*   837 [initial state]   */
+  S_ST( 'e',	3,      839,     0 ), /*   838 y                 */
+  S_ST( 'a',	3,      433,     0 )  /*   839 ye                */
 };
 
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/ntpd/ntp_leapsec.c /cur/src/external/bsd/ntp/dist/ntpd/ntp_leapsec.c
--- external/bsd/ntp/dist/ntpd/ntp_leapsec.c	2014-12-24 18:28:09.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/ntpd/ntp_leapsec.c	2015-04-07 19:51:17.000000000 -0700
@@ -789,7 +789,7 @@
 	const vint64 * now64 ,
 	int            insert)
 {
-	vint64		ttime, stime;
+	vint64		ttime, starttime;
 	struct calendar	fts;
 	leap_info_t	li;
 
@@ -817,12 +817,12 @@
 	fts.hour     = 0;
 	fts.minute   = 0;
 	fts.second   = 0;
-	stime = ntpcal_date_to_ntp64(&fts);
+	starttime = ntpcal_date_to_ntp64(&fts);
 	fts.month++;
 	ttime = ntpcal_date_to_ntp64(&fts);
 
 	li.ttime = ttime;
-	li.stime = ttime.D_s.lo - stime.D_s.lo;
+	li.stime = ttime.D_s.lo - starttime.D_s.lo;
 	li.taiof = (pt->head.size ? pt->info[0].taiof : pt->head.base_tai)
 	         + (insert ? 1 : -1);
 	li.dynls = 1;
@@ -841,7 +841,7 @@
 	int            taiof,
 	int            dynls)
 {
-	vint64		stime;
+	vint64		starttime;
 	struct calendar	fts;
 	leap_info_t	li;
 
@@ -858,9 +858,9 @@
 		return FALSE;
 	}
 	fts.month--; /* was in range 1..12, no overflow here! */
-	stime    = ntpcal_date_to_ntp64(&fts);
+	starttime    = ntpcal_date_to_ntp64(&fts);
 	li.ttime = *ttime;
-	li.stime = ttime->D_s.lo - stime.D_s.lo;
+	li.stime = ttime->D_s.lo - starttime.D_s.lo;
 	li.taiof = (int16_t)taiof;
 	li.dynls = (dynls != 0);
 	return add_range(pt, &li);
@@ -922,7 +922,8 @@
 	/* now do the byte twiddle */
 	for (wi=0; wi < 5; ++wi)
 		for (di=3; di >= 0; --di) {
-			mac->hv[wi*4 + di] = (unsigned char)tmp[wi];
+			mac->hv[wi*4 + di] =
+				(unsigned char)(tmp[wi] & 0x0FF);
 			tmp[wi] >>= 8;
 		}
 	return TRUE;
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/ntpd/ntp_loopfilter.c /cur/src/external/bsd/ntp/dist/ntpd/ntp_loopfilter.c
--- external/bsd/ntp/dist/ntpd/ntp_loopfilter.c	2014-12-24 18:28:09.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/ntpd/ntp_loopfilter.c	2015-04-07 19:51:17.000000000 -0700
@@ -10,8 +10,8 @@
 # include <config.h>
 #endif
 
-#ifdef __NetBSD__
-#include <util.h>
+#ifdef USE_SNPRINTB
+# include <util.h>
 #endif
 #include "ntpd.h"
 #include "ntp_io.h"
@@ -48,7 +48,7 @@
 #define CLOCK_LIMIT	30	/* poll-adjust threshold */
 #define CLOCK_PGATE	4.	/* poll-adjust gate */
 #define PPS_MAXAGE	120	/* kernel pps signal timeout (s) */
-#define	FREQTOD(x)	((x) / 65536e6) /* NTP to double */ 
+#define	FREQTOD(x)	((x) / 65536e6) /* NTP to double */
 #define	DTOFREQ(x)	((int32)((x) * 65536e6)) /* double to NTP */
 
 /*
@@ -108,7 +108,8 @@
 /*
  * Program variables that can be tinkered.
  */
-double	clock_max = CLOCK_MAX;	/* step threshold */
+double	clock_max_back = CLOCK_MAX;	/* step threshold */
+double	clock_max_fwd =  CLOCK_MAX;	/* step threshold */
 double	clock_minstep = CLOCK_MINSTEP; /* stepout threshold */
 double	clock_panic = CLOCK_PANIC; /* panic threshold */
 double	clock_phi = CLOCK_PHI;	/* dispersion rate (s/s) */
@@ -154,8 +155,10 @@
 int	hardpps_enable;		/* kernel PPS discipline enabled */
 int	ext_enable;		/* external clock enabled */
 int	pps_stratum;		/* pps stratum */
-int	allow_panic = FALSE;	/* allow panic correction */
-int	mode_ntpdate = FALSE;	/* exit on first clock set */
+int	kernel_status;		/* from ntp_adjtime */
+int	allow_panic = FALSE;	/* allow panic correction (-g) */
+int	force_step_once = FALSE; /* always step time once at startup (-G) */
+int	mode_ntpdate = FALSE;	/* exit on first clock set (-q) */
 int	freq_cnt;		/* initial frequency clamp */
 int	freq_set;		/* initial set frequency switch */
 
@@ -188,15 +191,17 @@
 #endif /* KERNEL_PLL */
 
 static void
-sync_status(const char *what, int status)
+sync_status(const char *what, int ostatus, int nstatus)
 {
-	char buf[256], tbuf[1024];
-#ifdef STA_FMT
-	snprintb(buf, sizeof(buf), STA_FMT, status);
+	char obuf[256], nbuf[256], tbuf[1024];
+#if defined(USE_SNPRINTB) && defined (STA_FMT)
+	snprintb(obuf, sizeof(obuf), STA_FMT, ostatus);
+	snprintb(nbuf, sizeof(nbuf), STA_FMT, nstatus);
 #else
-	snprintf(buf, sizeof(buf), "%04x", status);
+	snprintf(obuf, sizeof(obuf), "%04x", ostatus);
+	snprintf(nbuf, sizeof(nbuf), "%04x", nstatus);
 #endif
-	snprintf(tbuf, sizeof(tbuf), "%s status=%s", what, buf);
+	snprintf(tbuf, sizeof(tbuf), "%s status: %s -> %s", what, obuf, nbuf);
 	report_event(EVNT_KERN, NULL, tbuf);
 }
 
@@ -207,8 +212,9 @@
 {
 	if (this_file == NULL) {
 	    (void)strncpy(relative_path, __FILE__, PATH_MAX);
-	    for (this_file=relative_path; *this_file &&
-		! isalnum((unsigned char)*this_file); this_file++) ;
+	    for (this_file=relative_path;
+		*this_file && ! isalnum((unsigned char)*this_file);
+		this_file++) ;
 	}
 	return this_file;
 }
@@ -278,47 +284,69 @@
 		}
 	    break;
 #ifdef TIME_OK
-	    case TIME_OK: /* 0 no leap second warning */
-		/* OK means OK */
+	    case TIME_OK: /* 0: synchronized, no leap second warning */
+		/* msyslog(LOG_INFO, "kernel reports time is synchronized normally"); */
 	    break;
+#else
+# warning TIME_OK is not defined
 #endif
 #ifdef TIME_INS
-	    case TIME_INS: /* 1 positive leap second warning */
-		msyslog(LOG_INFO, "%s: %s line %d: kernel reports positive leap second warning state",
-		    caller, file_name(), line
-		);
+	    case TIME_INS: /* 1: positive leap second warning */
+		msyslog(LOG_INFO, "kernel reports leap second insertion scheduled");
 	    break;
+#else
+# warning TIME_INS is not defined
 #endif
 #ifdef TIME_DEL
-	    case TIME_DEL: /* 2 negative leap second warning */
-		msyslog(LOG_INFO, "%s: %s line %d: kernel reports negative leap second warning state",
-		    caller, file_name(), line
-		);
+	    case TIME_DEL: /* 2: negative leap second warning */
+		msyslog(LOG_INFO, "kernel reports leap second deletion scheduled");
 	    break;
+#else
+# warning TIME_DEL is not defined
 #endif
 #ifdef TIME_OOP
-	    case TIME_OOP: /* 3 leap second in progress */
-		msyslog(LOG_INFO, "%s: %s line %d: kernel reports leap second in progress",
-		    caller, file_name(), line
-		);
+	    case TIME_OOP: /* 3: leap second in progress */
+		msyslog(LOG_INFO, "kernel reports leap second in progress");
 	    break;
+#else
+# warning TIME_OOP is not defined
 #endif
 #ifdef TIME_WAIT
-	    case TIME_WAIT: /* 4 leap second has occured */
-		msyslog(LOG_INFO, "%s: %s line %d: kernel reports leap second has occured",
-		    caller, file_name(), line
-		);
+	    case TIME_WAIT: /* 4: leap second has occured */
+		msyslog(LOG_INFO, "kernel reports leap second has occurred");
 	    break;
+#else
+# warning TIME_WAIT is not defined
 #endif
 #ifdef TIME_ERROR
-	    case TIME_ERROR: /* loss of synchronization */
+	    case TIME_ERROR: /* 5: unsynchronized, or loss of synchronization */
+				/* error (see status word) */
 		if (pps_call && !(ptimex->status & STA_PPSSIGNAL))
 			report_event(EVNT_KERN, NULL,
 			    "PPS no signal");
 		errno = saved_errno;
 		DPRINTF(1, ("kernel loop status (%s) %d %m\n",
 			k_st_flags(ptimex->status), errno));
+		/*
+		 * This code may be returned when ntp_adjtime() has just
+		 * been called for the first time, quite a while after
+		 * startup, when ntpd just starts to discipline the kernel
+		 * time. In this case the occurrence of this message
+		 * can be pretty confusing.
+		 *
+		 * HMS: How about a message when we begin kernel processing:
+		 *    Determining kernel clock state...
+		 * so an initial TIME_ERROR message is less confising,
+		 * or skipping the first message (ugh),
+		 * or ???
+		 * msyslog(LOG_INFO, "kernel reports time synchronization lost");
+		 */
+		errno = saved_errno;	/* may not be needed */
+		msyslog(LOG_INFO, "kernel reports TIME_ERROR: %#x: %s %m",
+			ptimex->status, k_st_flags(ptimex->status));
 	    break;
+#else
+# warning TIME_ERROR is not defined
 #endif
 	    default:
 		msyslog(LOG_NOTICE, "%s: %s line %d: unhandled return value %d from ntp_adjtime in %s at line %d",
@@ -402,7 +430,8 @@
 	 * directly to the terminal.
 	 */
 	if (mode_ntpdate) {
-		if (fabs(fp_offset) > clock_max && clock_max > 0) {
+		if (  ( fp_offset > clock_max_fwd  && clock_max_fwd  > 0)
+		   || (-fp_offset > clock_max_back && clock_max_back > 0)) {
 			step_systime(fp_offset);
 			msyslog(LOG_NOTICE, "ntpd: time set %+.6f s",
 			    fp_offset);
@@ -451,10 +480,10 @@
 	 * threshold (128 ms) and when it does not. Under certain
 	 * conditions updates are suspended until the stepout theshold
 	 * (900 s) is exceeded. See the documentation on how these
-	 * thresholds interact with commands and command line options. 
+	 * thresholds interact with commands and command line options.
 	 *
 	 * Note the kernel is disabled if step is disabled or greater
-	 * than 0.5 s or in ntpdate mode. 
+	 * than 0.5 s or in ntpdate mode.
 	 */
 	osys_poll = sys_poll;
 	if (sys_poll < peer->minpoll)
@@ -464,7 +493,14 @@
 	mu = current_time - clock_epoch;
 	clock_frequency = drift_comp;
 	rval = 1;
-	if (fabs(fp_offset) > clock_max && clock_max > 0) {
+	if (  ( fp_offset > clock_max_fwd  && clock_max_fwd  > 0)
+	   || (-fp_offset > clock_max_back && clock_max_back > 0)
+	   || force_step_once ) {
+		if (force_step_once) {
+			force_step_once = FALSE;  /* we want this only once after startup */
+			msyslog(LOG_NOTICE, "Doing intital time step" );
+		}
+
 		switch (state) {
 
 		/*
@@ -524,7 +560,7 @@
 		 * threshold. Note that a single spike greater than the
 		 * step threshold is always suppressed, even with a
 		 * long time constant.
-		 */ 
+		 */
 		default:
 			snprintf(tbuf, sizeof(tbuf), "%+.6f s",
 			    fp_offset);
@@ -542,7 +578,6 @@
 		}
 		rstclock(EVNT_SYNC, 0);
 	} else {
-
 		/*
 		 * The offset is less than the step threshold. Calculate
 		 * the jitter as the exponentially weighted offset
@@ -604,9 +639,9 @@
 				/*
 				 * The PLL frequency gain (numerator) depends on
 				 * the minimum of the update interval and Allan
-				 * intercept. This reduces the PLL gain when the 
+				 * intercept. This reduces the PLL gain when the
 				 * FLL becomes effective.
-				 */ 
+				 */
 				etemp = min(ULOGTOD(allan_xpt), mu);
 				dtemp = 4 * CLOCK_PLL * ULOGTOD(sys_poll);
 				clock_frequency += fp_offset * etemp / (dtemp *
@@ -682,12 +717,17 @@
 			 * Enable/disable the PPS if requested.
 			 */
 			if (hardpps_enable) {
+				ntv.status |= (STA_PPSTIME | STA_PPSFREQ);
 				if (!(pll_status & STA_PPSTIME))
-					sync_status("PPS enbled", ntv.status);
+					sync_status("PPS enabled",
+						pll_status,
+						ntv.status);
 			} else {
 				ntv.status &= ~(STA_PPSTIME | STA_PPSFREQ);
 				if (pll_status & STA_PPSTIME)
-					sync_status("PPS disabled", ntv.status);
+					sync_status("PPS disabled",
+						pll_status,
+						ntv.status);
 			}
 			if (sys_leap == LEAP_ADDSECOND)
 				ntv.status |= STA_INS;
@@ -700,8 +740,13 @@
 		 * the pps. In any case, fetch the kernel offset,
 		 * frequency and jitter.
 		 */
-		if ((ntp_adj_ret = ntp_adjtime(&ntv)) != 0) {
-		    ntp_adjtime_error_handler(__func__, &ntv, ntp_adj_ret, errno, hardpps_enable, 0, __LINE__ - 1);
+		ntp_adj_ret = ntp_adjtime(&ntv);
+		/*
+		 * A squeal is a return status < 0, or a state change.
+		 */
+		if ((0 > ntp_adj_ret) || (ntp_adj_ret != kernel_status)) {
+			kernel_status = ntp_adj_ret;
+			ntp_adjtime_error_handler(__func__, &ntv, ntp_adj_ret, errno, hardpps_enable, 0, __LINE__ - 1);
 		}
 		pll_status = ntv.status;
 #ifdef STA_NANO
@@ -882,7 +927,7 @@
 	clock_offset -= offset_adj;
 	/*
 	 * Windows port adj_systime() must be called each second,
-	 * even if the argument is zero, to ease emulation of 
+	 * even if the argument is zero, to ease emulation of
 	 * adjtime() using Windows' slew API which controls the rate
 	 * but does not automatically stop slewing when an offset
 	 * has decayed to zero.
@@ -911,7 +956,7 @@
 		report_event(trans, NULL, NULL);
 	state = trans;
 	last_offset = clock_offset = offset;
-	clock_epoch = current_time; 
+	clock_epoch = current_time;
 }
 
 
@@ -1157,17 +1202,21 @@
 		break;
 
 	case LOOP_KERN_CLEAR:
+#if 0		/* XXX: needs more review, and how can we get here? */
 #ifndef LOCKCLOCK
-#ifdef KERNEL_PLL
+# ifdef KERNEL_PLL
 		if (pll_control && kern_enable) {
 			memset((char *)&ntv, 0, sizeof(ntv));
 			ntv.modes = MOD_STATUS;
 			ntv.status = STA_UNSYNC;
 			ntp_adjtime(&ntv);
-			sync_status("kernel time sync disabled", ntv.status);
+			sync_status("kernel time sync disabled",
+				pll_status,
+				ntv.status);
 		   }
-#endif /* KERNEL_PLL */
+# endif /* KERNEL_PLL */
 #endif /* LOCKCLOCK */
+#endif
 		break;
 
 	/*
@@ -1180,12 +1229,12 @@
 	case LOOP_CODEC:	/* audio codec frequency (codec) */
 		clock_codec = freq / 1e6;
 		break;
-	
+
 	case LOOP_PHI:		/* dispersion threshold (dispersion) */
 		clock_phi = freq / 1e6;
 		break;
 
-	case LOOP_FREQ:		/* initial frequency (freq) */	
+	case LOOP_FREQ:		/* initial frequency (freq) */
 		init_drift_comp = freq;
 		freq_set++;
 		break;
@@ -1206,8 +1255,27 @@
 		break;
 
 	case LOOP_MAX:		/* step threshold (step) */
-		clock_max = freq;
-		if (clock_max == 0 || clock_max > 0.5)
+		clock_max_fwd = clock_max_back = freq;
+		if (freq == 0 || freq > 0.5)
+			select_loop(FALSE);
+		break;
+
+	case LOOP_MAX_BACK:	/* step threshold (step) */
+		clock_max_back = freq;
+		/*
+		 * Leave using the kernel discipline code unless both
+		 * limits are massive.  This assumes the reason to stop
+		 * using it is that it's pointless, not that it goes wrong.
+		 */
+		if (  (clock_max_back == 0 || clock_max_back > 0.5)
+		   || (clock_max_fwd  == 0 || clock_max_fwd  > 0.5))
+			select_loop(FALSE);
+		break;
+
+	case LOOP_MAX_FWD:	/* step threshold (step) */
+		clock_max_fwd = freq;
+		if (  (clock_max_back == 0 || clock_max_back > 0.5)
+		   || (clock_max_fwd  == 0 || clock_max_fwd  > 0.5))
 			select_loop(FALSE);
 		break;
 
@@ -1215,7 +1283,7 @@
 		if (freq < CLOCK_MINSTEP)
 			clock_minstep = CLOCK_MINSTEP;
 		else
-			clock_minstep = freq; 
+			clock_minstep = freq;
 		break;
 
 	case LOOP_TICK:		/* tick increment (tick) */
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/ntpd/ntp_parser.y /cur/src/external/bsd/ntp/dist/ntpd/ntp_parser.y
--- external/bsd/ntp/dist/ntpd/ntp_parser.y	2014-12-24 18:28:09.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/ntpd/ntp_parser.y	2015-04-07 19:51:17.000000000 -0700
@@ -222,6 +222,8 @@
 %token	<Integer>	T_Stats
 %token	<Integer>	T_Statsdir
 %token	<Integer>	T_Step
+%token	<Integer>	T_Stepback
+%token	<Integer>	T_Stepfwd
 %token	<Integer>	T_Stepout
 %token	<Integer>	T_Stratum
 %token	<String>	T_String		/* not a token */
@@ -1111,6 +1113,8 @@
 	|	T_Huffpuff
 	|	T_Panic
 	|	T_Step
+	|	T_Stepback
+	|	T_Stepfwd
 	|	T_Stepout
 	|	T_Tick
 	;
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/ntpd/ntp_peer.c /cur/src/external/bsd/ntp/dist/ntpd/ntp_peer.c
--- external/bsd/ntp/dist/ntpd/ntp_peer.c	2014-12-24 18:28:09.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/ntpd/ntp_peer.c	2015-04-07 19:51:17.000000000 -0700
@@ -94,6 +94,7 @@
  * value every time an association is mobilized.
  */
 static associd_t current_association_ID; /* association ID */
+static associd_t initial_association_ID; /* association ID */
 
 /*
  * Memory allocation watermarks.
@@ -149,6 +150,7 @@
 	do
 		current_association_ID = ntp_random() & ASSOCID_MAX;
 	while (!current_association_ID);
+	initial_association_ID = current_association_ID;
 }
 
 
@@ -1038,3 +1040,21 @@
 
 	return peer;
 }
+
+/* peer_cleanup - clean peer list prior to shutdown */
+void peer_cleanup(void)
+{
+        struct peer *peer;
+        associd_t assoc;
+
+        for (assoc = initial_association_ID; assoc != current_association_ID; assoc++) {
+            if (assoc != 0U) {
+                peer = findpeerbyassoc(assoc);
+                if (peer != NULL)
+                    unpeer(peer);
+            }
+        }
+        peer = findpeerbyassoc(current_association_ID);
+        if (peer != NULL)
+            unpeer(peer);
+}
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/ntpd/ntp_proto.c /cur/src/external/bsd/ntp/dist/ntpd/ntp_proto.c
--- external/bsd/ntp/dist/ntpd/ntp_proto.c	2014-12-24 18:28:09.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/ntpd/ntp_proto.c	2015-04-07 19:51:17.000000000 -0700
@@ -247,7 +247,7 @@
 		/*
 		 * Update the reachability status. If not heard for
 		 * three consecutive polls, stuff infinity in the clock
-		 * filter. 
+		 * filter.
 		 */
 		oreach = peer->reach;
 		peer->outdate = current_time;
@@ -292,7 +292,7 @@
 		 * If preemptible and we have more peers than maxclock,
 		 * and this peer has the minimum score of preemptibles,
 		 * demobilize.
-		 */ 
+		 */
 		if (peer->unreach >= NTP_UNREACH) {
 			hpoll++;
 			/* ephemeral: no FLAG_CONFIG nor FLAG_PREEMPT */
@@ -337,7 +337,7 @@
 		peer->retry--;
 
 	/*
-	 * Do not transmit if in broadcast client mode. 
+	 * Do not transmit if in broadcast client mode.
 	 */
 	if (peer->hmode != MODE_BCLIENT)
 		peer_xmit(peer);
@@ -444,7 +444,7 @@
 			return;			/* no flakeway */
 		}
 	}
-	
+
 	/*
 	 * Version check must be after the query packets, since they
 	 * intentionally use an early version.
@@ -661,7 +661,7 @@
 		 * If the signature is 20 bytes long, the last 16 of
 		 * which are zero, then this is a Microsoft client
 		 * wanting AD-style authentication of the server's
-		 * reply.  
+		 * reply.
 		 *
 		 * This is described in Microsoft's WSPP docs, in MS-SNTP:
 		 * http://msdn.microsoft.com/en-us/library/cc212930.aspx
@@ -682,7 +682,7 @@
 		 * broadcast or unicast address as appropriate.
 		 */
 		if (crypto_flags && skeyid > NTP_MAXKEY) {
-		
+
 			/*
 			 * More on the autokey dance (AKD). A cookie is
 			 * constructed from public and private values.
@@ -876,7 +876,7 @@
 	 * curious and could be an intruder attempting to clog, so we
 	 * just ignore it.
 	 *
-	 * If the packet is authentic and the manycastclient or pool 
+	 * If the packet is authentic and the manycastclient or pool
 	 * association is found, we mobilize a client association and
 	 * copy pertinent variables from the manycastclient or pool
 	 * association to the new client association. If not, just
@@ -1258,16 +1258,6 @@
 	}
 
 	/*
-	 * Update the state variables.
-	 */
-	if (peer->flip == 0) {
-		if (hismode != MODE_BROADCAST)
-			peer->rec = p_xmt;
-		peer->dst = rbufp->recv_time;
-	}
-	peer->xmt = p_xmt;
-
-	/*
 	 * If this is a crypto_NAK, the server cannot authenticate a
 	 * client packet. The server might have just changed keys. Clear
 	 * the association and restart the protocol.
@@ -1286,19 +1276,21 @@
 #endif	/* AUTOKEY */
 		return;
 
-	/* 
-	 * If the digest fails, the client cannot authenticate a server
+	/*
+	 * If the digest fails or it's missing for authenticated
+	 * associations, the client cannot authenticate a server
 	 * reply to a client packet previously sent. The loopback check
 	 * is designed to avoid a bait-and-switch attack, which was
 	 * possible in past versions. If symmetric modes, return a
 	 * crypto-NAK. The peer should restart the protocol.
 	 */
-	} else if (!AUTH(has_mac || (restrict_mask & RES_DONTTRUST),
-	    is_authentic)) {
+	} else if (!AUTH(peer->keyid || has_mac ||
+			 (restrict_mask & RES_DONTTRUST), is_authentic)) {
 		report_event(PEVNT_AUTH, peer, "digest");
 		peer->flash |= TEST5;		/* bad auth */
 		peer->badauth++;
-		if (hismode == MODE_ACTIVE || hismode == MODE_PASSIVE)
+		if (has_mac &&
+		    (hismode == MODE_ACTIVE || hismode == MODE_PASSIVE))
 			fast_xmit(rbufp, MODE_ACTIVE, 0, restrict_mask);
 		if (peer->flags & FLAG_PREEMPT) {
 			unpeer(peer);
@@ -1312,6 +1304,16 @@
 	}
 
 	/*
+	 * Update the state variables.
+	 */
+	if (peer->flip == 0) {
+		if (hismode != MODE_BROADCAST)
+			peer->rec = p_xmt;
+		peer->dst = rbufp->recv_time;
+	}
+	peer->xmt = p_xmt;
+
+	/*
 	 * Set the peer ppoll to the maximum of the packet ppoll and the
 	 * peer minpoll. If a kiss-o'-death, set the peer minpoll to
 	 * this maximum and advance the headway to give the sender some
@@ -1579,7 +1581,7 @@
 	/*
 	 * If the peer was previously unreachable, raise a trap. In any
 	 * case, mark it reachable.
-	 */ 
+	 */
 	if (!peer->reach) {
 		report_event(PEVNT_REACH, peer, NULL);
 		peer->timereachable = current_time;
@@ -1646,8 +1648,8 @@
 		 * Interleaved broadcast mode. Use interleaved timestamps.
 		 * t1 = peer->borg, t2 = p_org, t3 = p_org, t4 = aorg
 		 */
-		if (peer->flags & FLAG_XB) { 
-			ci = p_org;			/* delay */ 
+		if (peer->flags & FLAG_XB) {
+			ci = p_org;			/* delay */
 			L_SUB(&ci, &peer->aorg);
 			LFPTOD(&ci, t34);
 			ci = p_org;			/* t2 - t1 */
@@ -1776,7 +1778,7 @@
 			    p_del, peer->r21 / 1e3, peer->r34 / 1e3,
 			    td);
 #endif
-	} 
+	}
 #endif /* ASSYM */
 
 	/*
@@ -2242,7 +2244,7 @@
 	for (i = NTP_SHIFT - 1; i >= 0; i--) {
 		if (i != 0)
 			peer->filter_disp[j] += dtemp;
-		if (peer->filter_disp[j] >= MAXDISPERSE) { 
+		if (peer->filter_disp[j] >= MAXDISPERSE) {
 			peer->filter_disp[j] = MAXDISPERSE;
 			dst[i] = MAXDISPERSE;
 		} else if (peer->update - peer->filter_epoch[j] >
@@ -2257,7 +2259,7 @@
 	}
 
 	/*
-	 * If the clock has stabilized, sort the samples by distance.  
+	 * If the clock has stabilized, sort the samples by distance.
 	 */
 	if (freq_cnt == 0) {
 		for (i = 1; i < NTP_SHIFT; i++) {
@@ -2291,7 +2293,7 @@
 			continue;
 		m++;
 	}
-	
+
 	/*
 	 * Compute the dispersion and jitter. The dispersion is weighted
 	 * exponentially by NTP_FWEIGHT (0.5) so it is normalized close
@@ -2495,9 +2497,9 @@
 		/*
 		 * If this peer could have the orphan parent
 		 * as a synchronization ancestor, exclude it
-		 * from selection to avoid forming a 
+		 * from selection to avoid forming a
 		 * synchronization loop within the orphan mesh,
-		 * triggering stratum climb to infinity 
+		 * triggering stratum climb to infinity
 		 * instability.  Peers at stratum higher than
 		 * the orphan stratum could have the orphan
 		 * parent in ancestry so are excluded.
@@ -2605,7 +2607,7 @@
 	for (allow = 0; 2 * allow < nlist; allow++) {
 
 		/*
-		 * Bound the interval (low, high) as the smallest 
+		 * Bound the interval (low, high) as the smallest
 		 * interval containing points from the most sources.
 		 */
 		n = 0;
@@ -2641,7 +2643,7 @@
 	 * We assert the correct time is contained in the interval, but
 	 * the best offset estimate for the interval might not be
 	 * contained in the interval. For this purpose, a truechimer is
-	 * defined as the midpoint of an interval that overlaps the 
+	 * defined as the midpoint of an interval that overlaps the
 	 * intersection interval.
 	 */
 	j = 0;
@@ -2661,9 +2663,10 @@
 		 * include any of them in the cluster population.
 		 */
 		if (peer->flags & FLAG_PPS) {
-			if (typepps == NULL) 
+			if (typepps == NULL)
 				typepps = peer;
-			continue;
+			if (!(peer->flags & FLAG_TSTAMP_PPS))
+				continue;
 		}
 #endif /* REFCLOCK */
 
@@ -2674,7 +2677,7 @@
 	nlist = j;
 
 	/*
-	 * If no survivors remain at this point, check if the modem 
+	 * If no survivors remain at this point, check if the modem
 	 * driver, local driver or orphan parent in that order. If so,
 	 * nominate the first one found as the only survivor.
 	 * Otherwise, give up and leave the island to the rats.
@@ -2711,7 +2714,7 @@
 	 * by root distance. Continue voting as long as there are more
 	 * than sys_minclock survivors and the select jitter of the peer
 	 * with the worst metric is greater than the minimum peer
-	 * jitter. Stop if we are about to discard a TRUE or PREFER 
+	 * jitter. Stop if we are about to discard a TRUE or PREFER
 	 * peer, who of course have the immunity idol.
 	 */
 	while (1) {
@@ -2817,7 +2820,7 @@
 
 		typesystem = peers[speer].peer;
 		if (osys_peer == NULL || osys_peer == typesystem) {
-			sys_clockhop = 0; 
+			sys_clockhop = 0;
 		} else if ((x = fabs(typesystem->offset -
 		    osys_peer->offset)) < sys_mindisp) {
 			if (sys_clockhop == 0)
@@ -3115,7 +3118,7 @@
 		 * the session key is generated.
 		 */
 		while (1) {
-		
+
 			/*
 			 * Allocate and initialize a keylist if not
 			 * already done. Then, use the list in inverse
@@ -3167,7 +3170,7 @@
 			break;
 
 		/*
-		 * In symmetric modes the parameter, certificate, 
+		 * In symmetric modes the parameter, certificate,
 		 * identity, cookie and autokey exchanges are
 		 * required. The leapsecond exchange is optional. But, a
 		 * peer will not believe the other peer until the other
@@ -3326,7 +3329,7 @@
 			session_key(&peer->dstadr->sin, &peer->srcadr,
 			    xkeyid, 0, 2);
 		}
-	} 
+	}
 #endif	/* AUTOKEY */
 
 	/*
@@ -3621,7 +3624,7 @@
 		return;	/* out of addresses, re-query DNS next poll */
 	restrict_mask = restrictions(rmtadr);
 	if (RES_FLAGS & restrict_mask)
-		restrict_source(rmtadr, 0, 
+		restrict_source(rmtadr, 0,
 				current_time + POOL_SOLICIT_WINDOW + 1);
 	lcladr = findinterface(rmtadr);
 	memset(&xpkt, 0, sizeof(xpkt));
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/ntpd/ntp_util.c /cur/src/external/bsd/ntp/dist/ntpd/ntp_util.c
--- external/bsd/ntp/dist/ntpd/ntp_util.c	2014-12-24 18:28:09.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/ntpd/ntp_util.c	2015-04-07 19:51:17.000000000 -0700
@@ -681,7 +681,7 @@
 	int	version,
 	int	mode,
 	int	stratum,
-	int	poll,
+	int	ppoll,
 	int	precision,
 	double	root_delay,	/* seconds */
 	double	root_dispersion,/* seconds */
@@ -704,7 +704,7 @@
 		    stoa(srcadr), dstadr ?  stoa(dstadr) : "-",
 		    ulfptoa(t1, 9), ulfptoa(t2, 9),
 		    ulfptoa(t3, 9), ulfptoa(t4, 9),
-		    leap, version, mode, stratum, poll, precision,
+		    leap, version, mode, stratum, ppoll, precision,
 		    root_delay, root_dispersion, refid_str(refid, stratum));
 		fflush(rawstats.fp);
 	}
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/ntpd/ntpd-opts.c /cur/src/external/bsd/ntp/dist/ntpd/ntpd-opts.c
--- external/bsd/ntp/dist/ntpd/ntpd-opts.c	2014-12-24 18:28:09.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/ntpd/ntpd-opts.c	2015-04-07 19:51:17.000000000 -0700
@@ -3,7 +3,7 @@
 /*
  *  EDIT THIS FILE WITH CAUTION  (ntpd-opts.c)
  *
- *  It has been AutoGen-ed  December 19, 2014 at 07:46:33 AM by AutoGen 5.18.5pre4
+ *  It has been AutoGen-ed  April  7, 2015 at 04:23:14 AM by AutoGen 5.18.5pre4
  *  From the definitions    ntpd-opts.def
  *  and the template file   options
  *
@@ -20,7 +20,7 @@
  * The ntpd program is copyrighted and licensed
  * under the following terms:
  *
- *  Copyright (C) 1970-2014 The University of Delaware, all rights reserved.
+ *  Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation, all rights reserved.
  *  This is free software. It is licensed for use, modification and
  *  redistribution under the terms of the NTP License, copies of which
  *  can be seen at:
@@ -33,7 +33,7 @@
  *  both the copyright notice and this permission notice appear in
  *  supporting documentation, and that the name The University of Delaware not be used in
  *  advertising or publicity pertaining to distribution of the software
- *  without specific, written prior permission. The University of Delaware makes no
+ *  without specific, written prior permission. The University of Delaware and Network Time Foundation makes no
  *  representations about the suitability this software for any purpose. It
  *  is provided "as is" without express or implied warranty.
  */
@@ -52,7 +52,7 @@
 #endif
 extern FILE * option_usage_fp;
 #define zCopyright      (ntpd_opt_strs+0)
-#define zLicenseDescrip (ntpd_opt_strs+310)
+#define zLicenseDescrip (ntpd_opt_strs+340)
 
 /*
  *  global included definitions
@@ -76,150 +76,154 @@
 /**
  *  static const strings for ntpd options
  */
-static char const ntpd_opt_strs[2999] =
-/*     0 */ "ntpd 4.2.8\n"
-            "Copyright (C) 1970-2014 The University of Delaware, all rights reserved.\n"
+static char const ntpd_opt_strs[3129] =
+/*     0 */ "ntpd 4.2.8p2\n"
+            "Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation, all rights reserved.\n"
             "This is free software. It is licensed for use, modification and\n"
             "redistribution under the terms of the NTP License, copies of which\n"
             "can be seen at:\n"
             "  <http://ntp.org/license>\n"
             "  <http://opensource.org/licenses/ntp-license.php>\n\0"
-/*   310 */ "Permission to use, copy, modify, and distribute this software and its\n"
+/*   340 */ "Permission to use, copy, modify, and distribute this software and its\n"
             "documentation for any purpose with or without fee is hereby granted,\n"
             "provided that the above copyright notice appears in all copies and that\n"
             "both the copyright notice and this permission notice appear in supporting\n"
             "documentation, and that the name The University of Delaware not be used in\n"
             "advertising or publicity pertaining to distribution of the software without\n"
-            "specific, written prior permission.  The University of Delaware makes no\n"
-            "representations about the suitability this software for any purpose.  It is\n"
-            "provided \"as is\" without express or implied warranty.\n\0"
-/*   950 */ "Force IPv4 DNS name resolution\0"
-/*   981 */ "IPV4\0"
-/*   986 */ "ipv4\0"
-/*   991 */ "Force IPv6 DNS name resolution\0"
-/*  1022 */ "IPV6\0"
-/*  1027 */ "ipv6\0"
-/*  1032 */ "Require crypto authentication\0"
-/*  1062 */ "AUTHREQ\0"
-/*  1070 */ "authreq\0"
-/*  1078 */ "Do not require crypto authentication\0"
-/*  1115 */ "AUTHNOREQ\0"
-/*  1125 */ "authnoreq\0"
-/*  1135 */ "Allow us to sync to broadcast servers\0"
-/*  1173 */ "BCASTSYNC\0"
-/*  1183 */ "bcastsync\0"
-/*  1193 */ "configuration file name\0"
-/*  1217 */ "CONFIGFILE\0"
-/*  1228 */ "configfile\0"
-/*  1239 */ "Increase debug verbosity level\0"
-/*  1270 */ "DEBUG_LEVEL\0"
-/*  1282 */ "debug-level\0"
-/*  1294 */ "Set the debug verbosity level\0"
-/*  1324 */ "SET_DEBUG_LEVEL\0"
-/*  1340 */ "set-debug-level\0"
-/*  1356 */ "frequency drift file name\0"
-/*  1382 */ "DRIFTFILE\0"
-/*  1392 */ "driftfile\0"
-/*  1402 */ "Allow the first adjustment to be Big\0"
-/*  1439 */ "PANICGATE\0"
-/*  1449 */ "panicgate\0"
-/*  1459 */ "Jail directory\0"
-/*  1474 */ "JAILDIR\0"
-/*  1482 */ "jaildir\0"
-/*  1490 */ "built without --enable-clockctl or --enable-linuxcaps or --enable-solarisprivs\0"
-/*  1569 */ "Listen on an interface name or address\0"
-/*  1608 */ "INTERFACE\0"
-/*  1618 */ "interface\0"
-/*  1628 */ "path to symmetric keys\0"
-/*  1651 */ "KEYFILE\0"
-/*  1659 */ "keyfile\0"
-/*  1667 */ "path to the log file\0"
-/*  1688 */ "LOGFILE\0"
-/*  1696 */ "logfile\0"
-/*  1704 */ "Do not listen to virtual interfaces\0"
-/*  1740 */ "NOVIRTUALIPS\0"
-/*  1753 */ "novirtualips\0"
-/*  1766 */ "Modify Multimedia Timer (Windows only)\0"
-/*  1805 */ "MODIFYMMTIMER\0"
-/*  1819 */ "modifymmtimer\0"
-/*  1833 */ "Do not fork\0"
-/*  1845 */ "NOFORK\0"
-/*  1852 */ "nofork\0"
-/*  1859 */ "Run at high priority\0"
-/*  1880 */ "NICE\0"
-/*  1885 */ "nice\0"
-/*  1890 */ "path to the PID file\0"
-/*  1911 */ "PIDFILE\0"
-/*  1919 */ "pidfile\0"
-/*  1927 */ "Process priority\0"
-/*  1944 */ "PRIORITY\0"
-/*  1953 */ "priority\0"
-/*  1962 */ "Set the time and quit\0"
-/*  1984 */ "QUIT\0"
-/*  1989 */ "quit\0"
-/*  1994 */ "Broadcast/propagation delay\0"
-/*  2022 */ "PROPAGATIONDELAY\0"
-/*  2039 */ "propagationdelay\0"
-/*  2056 */ "Save parsed configuration and quit\0"
-/*  2091 */ "SAVECONFIGQUIT\0"
-/*  2106 */ "saveconfigquit\0"
-/*  2121 */ "Statistics file location\0"
-/*  2146 */ "STATSDIR\0"
-/*  2155 */ "statsdir\0"
-/*  2164 */ "Trusted key number\0"
-/*  2183 */ "TRUSTEDKEY\0"
-/*  2194 */ "trustedkey\0"
-/*  2205 */ "Run as userid (or userid:groupid)\0"
-/*  2239 */ "USER\0"
-/*  2244 */ "user\0"
-/*  2249 */ "interval in seconds between scans for new or dropped interfaces\0"
-/*  2313 */ "UPDATEINTERVAL\0"
-/*  2328 */ "updateinterval\0"
-/*  2343 */ "make ARG an ntp variable (RW)\0"
-/*  2373 */ "VAR\0"
-/*  2377 */ "var\0"
-/*  2381 */ "make ARG an ntp variable (RW|DEF)\0"
-/*  2415 */ "DVAR\0"
-/*  2420 */ "dvar\0"
-/*  2425 */ "Seconds to wait for first clock sync\0"
-/*  2462 */ "WAIT_SYNC\0"
-/*  2472 */ "wait-sync\0"
-/*  2482 */ "Slew up to 600 seconds\0"
-/*  2505 */ "SLEW\0"
-/*  2510 */ "slew\0"
-/*  2515 */ "Use CPU cycle counter (Windows only)\0"
-/*  2552 */ "USEPCC\0"
-/*  2559 */ "usepcc\0"
-/*  2566 */ "Force CPU cycle counter use (Windows only)\0"
-/*  2609 */ "PCCFREQ\0"
-/*  2617 */ "pccfreq\0"
-/*  2625 */ "Register with mDNS as a NTP server\0"
-/*  2660 */ "MDNS\0"
-/*  2665 */ "mdns\0"
-/*  2670 */ "display extended usage information and exit\0"
-/*  2714 */ "help\0"
-/*  2719 */ "extended usage information passed thru pager\0"
-/*  2764 */ "more-help\0"
-/*  2774 */ "output version information and exit\0"
-/*  2810 */ "version\0"
-/*  2818 */ "NTPD\0"
-/*  2823 */ "ntpd - NTP daemon program - Ver. 4.2.8\n"
+            "specific, written prior permission.  The University of Delaware and Network\n"
+            "Time Foundation makes no representations about the suitability this\n"
+            "software for any purpose.  It is provided \"as is\" without express or\n"
+            "implied warranty.\n\0"
+/*  1008 */ "Force IPv4 DNS name resolution\0"
+/*  1039 */ "IPV4\0"
+/*  1044 */ "ipv4\0"
+/*  1049 */ "Force IPv6 DNS name resolution\0"
+/*  1080 */ "IPV6\0"
+/*  1085 */ "ipv6\0"
+/*  1090 */ "Require crypto authentication\0"
+/*  1120 */ "AUTHREQ\0"
+/*  1128 */ "authreq\0"
+/*  1136 */ "Do not require crypto authentication\0"
+/*  1173 */ "AUTHNOREQ\0"
+/*  1183 */ "authnoreq\0"
+/*  1193 */ "Allow us to sync to broadcast servers\0"
+/*  1231 */ "BCASTSYNC\0"
+/*  1241 */ "bcastsync\0"
+/*  1251 */ "configuration file name\0"
+/*  1275 */ "CONFIGFILE\0"
+/*  1286 */ "configfile\0"
+/*  1297 */ "Increase debug verbosity level\0"
+/*  1328 */ "DEBUG_LEVEL\0"
+/*  1340 */ "debug-level\0"
+/*  1352 */ "Set the debug verbosity level\0"
+/*  1382 */ "SET_DEBUG_LEVEL\0"
+/*  1398 */ "set-debug-level\0"
+/*  1414 */ "frequency drift file name\0"
+/*  1440 */ "DRIFTFILE\0"
+/*  1450 */ "driftfile\0"
+/*  1460 */ "Allow the first adjustment to be Big\0"
+/*  1497 */ "PANICGATE\0"
+/*  1507 */ "panicgate\0"
+/*  1517 */ "Step any initial offset correction.\0"
+/*  1553 */ "FORCE_STEP_ONCE\0"
+/*  1569 */ "force-step-once\0"
+/*  1585 */ "Jail directory\0"
+/*  1600 */ "JAILDIR\0"
+/*  1608 */ "jaildir\0"
+/*  1616 */ "built without --enable-clockctl or --enable-linuxcaps or --enable-solarisprivs\0"
+/*  1695 */ "Listen on an interface name or address\0"
+/*  1734 */ "INTERFACE\0"
+/*  1744 */ "interface\0"
+/*  1754 */ "path to symmetric keys\0"
+/*  1777 */ "KEYFILE\0"
+/*  1785 */ "keyfile\0"
+/*  1793 */ "path to the log file\0"
+/*  1814 */ "LOGFILE\0"
+/*  1822 */ "logfile\0"
+/*  1830 */ "Do not listen to virtual interfaces\0"
+/*  1866 */ "NOVIRTUALIPS\0"
+/*  1879 */ "novirtualips\0"
+/*  1892 */ "Modify Multimedia Timer (Windows only)\0"
+/*  1931 */ "MODIFYMMTIMER\0"
+/*  1945 */ "modifymmtimer\0"
+/*  1959 */ "Do not fork\0"
+/*  1971 */ "NOFORK\0"
+/*  1978 */ "nofork\0"
+/*  1985 */ "Run at high priority\0"
+/*  2006 */ "NICE\0"
+/*  2011 */ "nice\0"
+/*  2016 */ "path to the PID file\0"
+/*  2037 */ "PIDFILE\0"
+/*  2045 */ "pidfile\0"
+/*  2053 */ "Process priority\0"
+/*  2070 */ "PRIORITY\0"
+/*  2079 */ "priority\0"
+/*  2088 */ "Set the time and quit\0"
+/*  2110 */ "QUIT\0"
+/*  2115 */ "quit\0"
+/*  2120 */ "Broadcast/propagation delay\0"
+/*  2148 */ "PROPAGATIONDELAY\0"
+/*  2165 */ "propagationdelay\0"
+/*  2182 */ "Save parsed configuration and quit\0"
+/*  2217 */ "SAVECONFIGQUIT\0"
+/*  2232 */ "saveconfigquit\0"
+/*  2247 */ "Statistics file location\0"
+/*  2272 */ "STATSDIR\0"
+/*  2281 */ "statsdir\0"
+/*  2290 */ "Trusted key number\0"
+/*  2309 */ "TRUSTEDKEY\0"
+/*  2320 */ "trustedkey\0"
+/*  2331 */ "Run as userid (or userid:groupid)\0"
+/*  2365 */ "USER\0"
+/*  2370 */ "user\0"
+/*  2375 */ "interval in seconds between scans for new or dropped interfaces\0"
+/*  2439 */ "UPDATEINTERVAL\0"
+/*  2454 */ "updateinterval\0"
+/*  2469 */ "make ARG an ntp variable (RW)\0"
+/*  2499 */ "VAR\0"
+/*  2503 */ "var\0"
+/*  2507 */ "make ARG an ntp variable (RW|DEF)\0"
+/*  2541 */ "DVAR\0"
+/*  2546 */ "dvar\0"
+/*  2551 */ "Seconds to wait for first clock sync\0"
+/*  2588 */ "WAIT_SYNC\0"
+/*  2598 */ "wait-sync\0"
+/*  2608 */ "Slew up to 600 seconds\0"
+/*  2631 */ "SLEW\0"
+/*  2636 */ "slew\0"
+/*  2641 */ "Use CPU cycle counter (Windows only)\0"
+/*  2678 */ "USEPCC\0"
+/*  2685 */ "usepcc\0"
+/*  2692 */ "Force CPU cycle counter use (Windows only)\0"
+/*  2735 */ "PCCFREQ\0"
+/*  2743 */ "pccfreq\0"
+/*  2751 */ "Register with mDNS as a NTP server\0"
+/*  2786 */ "MDNS\0"
+/*  2791 */ "mdns\0"
+/*  2796 */ "display extended usage information and exit\0"
+/*  2840 */ "help\0"
+/*  2845 */ "extended usage information passed thru pager\0"
+/*  2890 */ "more-help\0"
+/*  2900 */ "output version information and exit\0"
+/*  2936 */ "version\0"
+/*  2944 */ "NTPD\0"
+/*  2949 */ "ntpd - NTP daemon program - Ver. 4.2.8p2\n"
             "Usage:  %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... \\\n"
             "\t\t[ <server1> ... <serverN> ]\n\0"
-/*  2952 */ "http://bugs.ntp.org, bugs@ntp.org\0"
-/*  2986 */ "\n\0"
-/*  2988 */ "ntpd 4.2.8";
+/*  3080 */ "http://bugs.ntp.org, bugs@ntp.org\0"
+/*  3114 */ "\n\0"
+/*  3116 */ "ntpd 4.2.8p2";
 
 /**
  *  ipv4 option description with
  *  "Must also have options" and "Incompatible options":
  */
 /** Descriptive text for the ipv4 option */
-#define IPV4_DESC      (ntpd_opt_strs+950)
+#define IPV4_DESC      (ntpd_opt_strs+1008)
 /** Upper-cased name for the ipv4 option */
-#define IPV4_NAME      (ntpd_opt_strs+981)
+#define IPV4_NAME      (ntpd_opt_strs+1039)
 /** Name string for the ipv4 option */
-#define IPV4_name      (ntpd_opt_strs+986)
+#define IPV4_name      (ntpd_opt_strs+1044)
 /** Other options that appear in conjunction with the ipv4 option */
 static int const aIpv4CantList[] = {
     INDEX_OPT_IPV6, NO_EQUIVALENT };
@@ -231,11 +235,11 @@
  *  "Must also have options" and "Incompatible options":
  */
 /** Descriptive text for the ipv6 option */
-#define IPV6_DESC      (ntpd_opt_strs+991)
+#define IPV6_DESC      (ntpd_opt_strs+1049)
 /** Upper-cased name for the ipv6 option */
-#define IPV6_NAME      (ntpd_opt_strs+1022)
+#define IPV6_NAME      (ntpd_opt_strs+1080)
 /** Name string for the ipv6 option */
-#define IPV6_name      (ntpd_opt_strs+1027)
+#define IPV6_name      (ntpd_opt_strs+1085)
 /** Other options that appear in conjunction with the ipv6 option */
 static int const aIpv6CantList[] = {
     INDEX_OPT_IPV4, NO_EQUIVALENT };
@@ -247,11 +251,11 @@
  *  "Must also have options" and "Incompatible options":
  */
 /** Descriptive text for the authreq option */
-#define AUTHREQ_DESC      (ntpd_opt_strs+1032)
+#define AUTHREQ_DESC      (ntpd_opt_strs+1090)
 /** Upper-cased name for the authreq option */
-#define AUTHREQ_NAME      (ntpd_opt_strs+1062)
+#define AUTHREQ_NAME      (ntpd_opt_strs+1120)
 /** Name string for the authreq option */
-#define AUTHREQ_name      (ntpd_opt_strs+1070)
+#define AUTHREQ_name      (ntpd_opt_strs+1128)
 /** Other options that appear in conjunction with the authreq option */
 static int const aAuthreqCantList[] = {
     INDEX_OPT_AUTHNOREQ, NO_EQUIVALENT };
@@ -263,11 +267,11 @@
  *  "Must also have options" and "Incompatible options":
  */
 /** Descriptive text for the authnoreq option */
-#define AUTHNOREQ_DESC      (ntpd_opt_strs+1078)
+#define AUTHNOREQ_DESC      (ntpd_opt_strs+1136)
 /** Upper-cased name for the authnoreq option */
-#define AUTHNOREQ_NAME      (ntpd_opt_strs+1115)
+#define AUTHNOREQ_NAME      (ntpd_opt_strs+1173)
 /** Name string for the authnoreq option */
-#define AUTHNOREQ_name      (ntpd_opt_strs+1125)
+#define AUTHNOREQ_name      (ntpd_opt_strs+1183)
 /** Other options that appear in conjunction with the authnoreq option */
 static int const aAuthnoreqCantList[] = {
     INDEX_OPT_AUTHREQ, NO_EQUIVALENT };
@@ -278,11 +282,11 @@
  *  bcastsync option description:
  */
 /** Descriptive text for the bcastsync option */
-#define BCASTSYNC_DESC      (ntpd_opt_strs+1135)
+#define BCASTSYNC_DESC      (ntpd_opt_strs+1193)
 /** Upper-cased name for the bcastsync option */
-#define BCASTSYNC_NAME      (ntpd_opt_strs+1173)
+#define BCASTSYNC_NAME      (ntpd_opt_strs+1231)
 /** Name string for the bcastsync option */
-#define BCASTSYNC_name      (ntpd_opt_strs+1183)
+#define BCASTSYNC_name      (ntpd_opt_strs+1241)
 /** Compiled in flag settings for the bcastsync option */
 #define BCASTSYNC_FLAGS     (OPTST_DISABLED)
 
@@ -290,11 +294,11 @@
  *  configfile option description:
  */
 /** Descriptive text for the configfile option */
-#define CONFIGFILE_DESC      (ntpd_opt_strs+1193)
+#define CONFIGFILE_DESC      (ntpd_opt_strs+1251)
 /** Upper-cased name for the configfile option */
-#define CONFIGFILE_NAME      (ntpd_opt_strs+1217)
+#define CONFIGFILE_NAME      (ntpd_opt_strs+1275)
 /** Name string for the configfile option */
-#define CONFIGFILE_name      (ntpd_opt_strs+1228)
+#define CONFIGFILE_name      (ntpd_opt_strs+1286)
 /** Compiled in flag settings for the configfile option */
 #define CONFIGFILE_FLAGS     (OPTST_DISABLED \
         | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
@@ -303,11 +307,11 @@
  *  debug-level option description:
  */
 /** Descriptive text for the debug-level option */
-#define DEBUG_LEVEL_DESC      (ntpd_opt_strs+1239)
+#define DEBUG_LEVEL_DESC      (ntpd_opt_strs+1297)
 /** Upper-cased name for the debug-level option */
-#define DEBUG_LEVEL_NAME      (ntpd_opt_strs+1270)
+#define DEBUG_LEVEL_NAME      (ntpd_opt_strs+1328)
 /** Name string for the debug-level option */
-#define DEBUG_LEVEL_name      (ntpd_opt_strs+1282)
+#define DEBUG_LEVEL_name      (ntpd_opt_strs+1340)
 /** Compiled in flag settings for the debug-level option */
 #define DEBUG_LEVEL_FLAGS     (OPTST_DISABLED)
 
@@ -315,11 +319,11 @@
  *  set-debug-level option description:
  */
 /** Descriptive text for the set-debug-level option */
-#define SET_DEBUG_LEVEL_DESC      (ntpd_opt_strs+1294)
+#define SET_DEBUG_LEVEL_DESC      (ntpd_opt_strs+1352)
 /** Upper-cased name for the set-debug-level option */
-#define SET_DEBUG_LEVEL_NAME      (ntpd_opt_strs+1324)
+#define SET_DEBUG_LEVEL_NAME      (ntpd_opt_strs+1382)
 /** Name string for the set-debug-level option */
-#define SET_DEBUG_LEVEL_name      (ntpd_opt_strs+1340)
+#define SET_DEBUG_LEVEL_name      (ntpd_opt_strs+1398)
 /** Compiled in flag settings for the set-debug-level option */
 #define SET_DEBUG_LEVEL_FLAGS     (OPTST_DISABLED \
         | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
@@ -328,11 +332,11 @@
  *  driftfile option description:
  */
 /** Descriptive text for the driftfile option */
-#define DRIFTFILE_DESC      (ntpd_opt_strs+1356)
+#define DRIFTFILE_DESC      (ntpd_opt_strs+1414)
 /** Upper-cased name for the driftfile option */
-#define DRIFTFILE_NAME      (ntpd_opt_strs+1382)
+#define DRIFTFILE_NAME      (ntpd_opt_strs+1440)
 /** Name string for the driftfile option */
-#define DRIFTFILE_name      (ntpd_opt_strs+1392)
+#define DRIFTFILE_name      (ntpd_opt_strs+1450)
 /** Compiled in flag settings for the driftfile option */
 #define DRIFTFILE_FLAGS     (OPTST_DISABLED \
         | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
@@ -341,24 +345,36 @@
  *  panicgate option description:
  */
 /** Descriptive text for the panicgate option */
-#define PANICGATE_DESC      (ntpd_opt_strs+1402)
+#define PANICGATE_DESC      (ntpd_opt_strs+1460)
 /** Upper-cased name for the panicgate option */
-#define PANICGATE_NAME      (ntpd_opt_strs+1439)
+#define PANICGATE_NAME      (ntpd_opt_strs+1497)
 /** Name string for the panicgate option */
-#define PANICGATE_name      (ntpd_opt_strs+1449)
+#define PANICGATE_name      (ntpd_opt_strs+1507)
 /** Compiled in flag settings for the panicgate option */
 #define PANICGATE_FLAGS     (OPTST_DISABLED)
 
 /**
+ *  force_step_once option description:
+ */
+/** Descriptive text for the force_step_once option */
+#define FORCE_STEP_ONCE_DESC      (ntpd_opt_strs+1517)
+/** Upper-cased name for the force_step_once option */
+#define FORCE_STEP_ONCE_NAME      (ntpd_opt_strs+1553)
+/** Name string for the force_step_once option */
+#define FORCE_STEP_ONCE_name      (ntpd_opt_strs+1569)
+/** Compiled in flag settings for the force_step_once option */
+#define FORCE_STEP_ONCE_FLAGS     (OPTST_DISABLED)
+
+/**
  *  jaildir option description:
  */
 #ifdef HAVE_DROPROOT
 /** Descriptive text for the jaildir option */
-#define JAILDIR_DESC      (ntpd_opt_strs+1459)
+#define JAILDIR_DESC      (ntpd_opt_strs+1585)
 /** Upper-cased name for the jaildir option */
-#define JAILDIR_NAME      (ntpd_opt_strs+1474)
+#define JAILDIR_NAME      (ntpd_opt_strs+1600)
 /** Name string for the jaildir option */
-#define JAILDIR_name      (ntpd_opt_strs+1482)
+#define JAILDIR_name      (ntpd_opt_strs+1608)
 /** Compiled in flag settings for the jaildir option */
 #define JAILDIR_FLAGS     (OPTST_DISABLED \
         | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
@@ -367,19 +383,19 @@
 #define JAILDIR_FLAGS     (OPTST_OMITTED | OPTST_NO_INIT)
 #define JAILDIR_NAME      NULL
 /** Descriptive text for the jaildir option */
-#define JAILDIR_DESC      (ntpd_opt_strs+1490)
-#define JAILDIR_name      (ntpd_opt_strs+1482)
+#define JAILDIR_DESC      (ntpd_opt_strs+1616)
+#define JAILDIR_name      (ntpd_opt_strs+1608)
 #endif  /* HAVE_DROPROOT */
 
 /**
  *  interface option description:
  */
 /** Descriptive text for the interface option */
-#define INTERFACE_DESC      (ntpd_opt_strs+1569)
+#define INTERFACE_DESC      (ntpd_opt_strs+1695)
 /** Upper-cased name for the interface option */
-#define INTERFACE_NAME      (ntpd_opt_strs+1608)
+#define INTERFACE_NAME      (ntpd_opt_strs+1734)
 /** Name string for the interface option */
-#define INTERFACE_name      (ntpd_opt_strs+1618)
+#define INTERFACE_name      (ntpd_opt_strs+1744)
 /** Compiled in flag settings for the interface option */
 #define INTERFACE_FLAGS     (OPTST_DISABLED | OPTST_STACKED \
         | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
@@ -388,11 +404,11 @@
  *  keyfile option description:
  */
 /** Descriptive text for the keyfile option */
-#define KEYFILE_DESC      (ntpd_opt_strs+1628)
+#define KEYFILE_DESC      (ntpd_opt_strs+1754)
 /** Upper-cased name for the keyfile option */
-#define KEYFILE_NAME      (ntpd_opt_strs+1651)
+#define KEYFILE_NAME      (ntpd_opt_strs+1777)
 /** Name string for the keyfile option */
-#define KEYFILE_name      (ntpd_opt_strs+1659)
+#define KEYFILE_name      (ntpd_opt_strs+1785)
 /** Compiled in flag settings for the keyfile option */
 #define KEYFILE_FLAGS     (OPTST_DISABLED \
         | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
@@ -401,11 +417,11 @@
  *  logfile option description:
  */
 /** Descriptive text for the logfile option */
-#define LOGFILE_DESC      (ntpd_opt_strs+1667)
+#define LOGFILE_DESC      (ntpd_opt_strs+1793)
 /** Upper-cased name for the logfile option */
-#define LOGFILE_NAME      (ntpd_opt_strs+1688)
+#define LOGFILE_NAME      (ntpd_opt_strs+1814)
 /** Name string for the logfile option */
-#define LOGFILE_name      (ntpd_opt_strs+1696)
+#define LOGFILE_name      (ntpd_opt_strs+1822)
 /** Compiled in flag settings for the logfile option */
 #define LOGFILE_FLAGS     (OPTST_DISABLED \
         | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
@@ -414,11 +430,11 @@
  *  novirtualips option description:
  */
 /** Descriptive text for the novirtualips option */
-#define NOVIRTUALIPS_DESC      (ntpd_opt_strs+1704)
+#define NOVIRTUALIPS_DESC      (ntpd_opt_strs+1830)
 /** Upper-cased name for the novirtualips option */
-#define NOVIRTUALIPS_NAME      (ntpd_opt_strs+1740)
+#define NOVIRTUALIPS_NAME      (ntpd_opt_strs+1866)
 /** Name string for the novirtualips option */
-#define NOVIRTUALIPS_name      (ntpd_opt_strs+1753)
+#define NOVIRTUALIPS_name      (ntpd_opt_strs+1879)
 /** Compiled in flag settings for the novirtualips option */
 #define NOVIRTUALIPS_FLAGS     (OPTST_DISABLED)
 
@@ -427,11 +443,11 @@
  */
 #ifdef SYS_WINNT
 /** Descriptive text for the modifymmtimer option */
-#define MODIFYMMTIMER_DESC      (ntpd_opt_strs+1766)
+#define MODIFYMMTIMER_DESC      (ntpd_opt_strs+1892)
 /** Upper-cased name for the modifymmtimer option */
-#define MODIFYMMTIMER_NAME      (ntpd_opt_strs+1805)
+#define MODIFYMMTIMER_NAME      (ntpd_opt_strs+1931)
 /** Name string for the modifymmtimer option */
-#define MODIFYMMTIMER_name      (ntpd_opt_strs+1819)
+#define MODIFYMMTIMER_name      (ntpd_opt_strs+1945)
 /** Compiled in flag settings for the modifymmtimer option */
 #define MODIFYMMTIMER_FLAGS     (OPTST_DISABLED)
 
@@ -447,11 +463,11 @@
  *  "Must also have options" and "Incompatible options":
  */
 /** Descriptive text for the nofork option */
-#define NOFORK_DESC      (ntpd_opt_strs+1833)
+#define NOFORK_DESC      (ntpd_opt_strs+1959)
 /** Upper-cased name for the nofork option */
-#define NOFORK_NAME      (ntpd_opt_strs+1845)
+#define NOFORK_NAME      (ntpd_opt_strs+1971)
 /** Name string for the nofork option */
-#define NOFORK_name      (ntpd_opt_strs+1852)
+#define NOFORK_name      (ntpd_opt_strs+1978)
 /** Other options that appear in conjunction with the nofork option */
 static int const aNoforkCantList[] = {
     INDEX_OPT_WAIT_SYNC, NO_EQUIVALENT };
@@ -462,11 +478,11 @@
  *  nice option description:
  */
 /** Descriptive text for the nice option */
-#define NICE_DESC      (ntpd_opt_strs+1859)
+#define NICE_DESC      (ntpd_opt_strs+1985)
 /** Upper-cased name for the nice option */
-#define NICE_NAME      (ntpd_opt_strs+1880)
+#define NICE_NAME      (ntpd_opt_strs+2006)
 /** Name string for the nice option */
-#define NICE_name      (ntpd_opt_strs+1885)
+#define NICE_name      (ntpd_opt_strs+2011)
 /** Compiled in flag settings for the nice option */
 #define NICE_FLAGS     (OPTST_DISABLED)
 
@@ -474,11 +490,11 @@
  *  pidfile option description:
  */
 /** Descriptive text for the pidfile option */
-#define PIDFILE_DESC      (ntpd_opt_strs+1890)
+#define PIDFILE_DESC      (ntpd_opt_strs+2016)
 /** Upper-cased name for the pidfile option */
-#define PIDFILE_NAME      (ntpd_opt_strs+1911)
+#define PIDFILE_NAME      (ntpd_opt_strs+2037)
 /** Name string for the pidfile option */
-#define PIDFILE_name      (ntpd_opt_strs+1919)
+#define PIDFILE_name      (ntpd_opt_strs+2045)
 /** Compiled in flag settings for the pidfile option */
 #define PIDFILE_FLAGS     (OPTST_DISABLED \
         | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
@@ -487,11 +503,11 @@
  *  priority option description:
  */
 /** Descriptive text for the priority option */
-#define PRIORITY_DESC      (ntpd_opt_strs+1927)
+#define PRIORITY_DESC      (ntpd_opt_strs+2053)
 /** Upper-cased name for the priority option */
-#define PRIORITY_NAME      (ntpd_opt_strs+1944)
+#define PRIORITY_NAME      (ntpd_opt_strs+2070)
 /** Name string for the priority option */
-#define PRIORITY_name      (ntpd_opt_strs+1953)
+#define PRIORITY_name      (ntpd_opt_strs+2079)
 /** Compiled in flag settings for the priority option */
 #define PRIORITY_FLAGS     (OPTST_DISABLED \
         | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
@@ -501,11 +517,11 @@
  *  "Must also have options" and "Incompatible options":
  */
 /** Descriptive text for the quit option */
-#define QUIT_DESC      (ntpd_opt_strs+1962)
+#define QUIT_DESC      (ntpd_opt_strs+2088)
 /** Upper-cased name for the quit option */
-#define QUIT_NAME      (ntpd_opt_strs+1984)
+#define QUIT_NAME      (ntpd_opt_strs+2110)
 /** Name string for the quit option */
-#define QUIT_name      (ntpd_opt_strs+1989)
+#define QUIT_name      (ntpd_opt_strs+2115)
 /** Other options that appear in conjunction with the quit option */
 static int const aQuitCantList[] = {
     INDEX_OPT_SAVECONFIGQUIT,
@@ -517,11 +533,11 @@
  *  propagationdelay option description:
  */
 /** Descriptive text for the propagationdelay option */
-#define PROPAGATIONDELAY_DESC      (ntpd_opt_strs+1994)
+#define PROPAGATIONDELAY_DESC      (ntpd_opt_strs+2120)
 /** Upper-cased name for the propagationdelay option */
-#define PROPAGATIONDELAY_NAME      (ntpd_opt_strs+2022)
+#define PROPAGATIONDELAY_NAME      (ntpd_opt_strs+2148)
 /** Name string for the propagationdelay option */
-#define PROPAGATIONDELAY_name      (ntpd_opt_strs+2039)
+#define PROPAGATIONDELAY_name      (ntpd_opt_strs+2165)
 /** Compiled in flag settings for the propagationdelay option */
 #define PROPAGATIONDELAY_FLAGS     (OPTST_DISABLED \
         | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
@@ -532,11 +548,11 @@
  */
 #ifdef SAVECONFIG
 /** Descriptive text for the saveconfigquit option */
-#define SAVECONFIGQUIT_DESC      (ntpd_opt_strs+2056)
+#define SAVECONFIGQUIT_DESC      (ntpd_opt_strs+2182)
 /** Upper-cased name for the saveconfigquit option */
-#define SAVECONFIGQUIT_NAME      (ntpd_opt_strs+2091)
+#define SAVECONFIGQUIT_NAME      (ntpd_opt_strs+2217)
 /** Name string for the saveconfigquit option */
-#define SAVECONFIGQUIT_name      (ntpd_opt_strs+2106)
+#define SAVECONFIGQUIT_name      (ntpd_opt_strs+2232)
 /** Other options that appear in conjunction with the saveconfigquit option */
 static int const aSaveconfigquitCantList[] = {
     INDEX_OPT_QUIT,
@@ -557,11 +573,11 @@
  *  statsdir option description:
  */
 /** Descriptive text for the statsdir option */
-#define STATSDIR_DESC      (ntpd_opt_strs+2121)
+#define STATSDIR_DESC      (ntpd_opt_strs+2247)
 /** Upper-cased name for the statsdir option */
-#define STATSDIR_NAME      (ntpd_opt_strs+2146)
+#define STATSDIR_NAME      (ntpd_opt_strs+2272)
 /** Name string for the statsdir option */
-#define STATSDIR_name      (ntpd_opt_strs+2155)
+#define STATSDIR_name      (ntpd_opt_strs+2281)
 /** Compiled in flag settings for the statsdir option */
 #define STATSDIR_FLAGS     (OPTST_DISABLED \
         | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
@@ -570,11 +586,11 @@
  *  trustedkey option description:
  */
 /** Descriptive text for the trustedkey option */
-#define TRUSTEDKEY_DESC      (ntpd_opt_strs+2164)
+#define TRUSTEDKEY_DESC      (ntpd_opt_strs+2290)
 /** Upper-cased name for the trustedkey option */
-#define TRUSTEDKEY_NAME      (ntpd_opt_strs+2183)
+#define TRUSTEDKEY_NAME      (ntpd_opt_strs+2309)
 /** Name string for the trustedkey option */
-#define TRUSTEDKEY_name      (ntpd_opt_strs+2194)
+#define TRUSTEDKEY_name      (ntpd_opt_strs+2320)
 /** Compiled in flag settings for the trustedkey option */
 #define TRUSTEDKEY_FLAGS     (OPTST_DISABLED | OPTST_STACKED \
         | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
@@ -584,11 +600,11 @@
  */
 #ifdef HAVE_DROPROOT
 /** Descriptive text for the user option */
-#define USER_DESC      (ntpd_opt_strs+2205)
+#define USER_DESC      (ntpd_opt_strs+2331)
 /** Upper-cased name for the user option */
-#define USER_NAME      (ntpd_opt_strs+2239)
+#define USER_NAME      (ntpd_opt_strs+2365)
 /** Name string for the user option */
-#define USER_name      (ntpd_opt_strs+2244)
+#define USER_name      (ntpd_opt_strs+2370)
 /** Compiled in flag settings for the user option */
 #define USER_FLAGS     (OPTST_DISABLED \
         | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
@@ -597,19 +613,19 @@
 #define USER_FLAGS     (OPTST_OMITTED | OPTST_NO_INIT)
 #define USER_NAME      NULL
 /** Descriptive text for the user option */
-#define USER_DESC      (ntpd_opt_strs+1490)
-#define USER_name      (ntpd_opt_strs+2244)
+#define USER_DESC      (ntpd_opt_strs+1616)
+#define USER_name      (ntpd_opt_strs+2370)
 #endif  /* HAVE_DROPROOT */
 
 /**
  *  updateinterval option description:
  */
 /** Descriptive text for the updateinterval option */
-#define UPDATEINTERVAL_DESC      (ntpd_opt_strs+2249)
+#define UPDATEINTERVAL_DESC      (ntpd_opt_strs+2375)
 /** Upper-cased name for the updateinterval option */
-#define UPDATEINTERVAL_NAME      (ntpd_opt_strs+2313)
+#define UPDATEINTERVAL_NAME      (ntpd_opt_strs+2439)
 /** Name string for the updateinterval option */
-#define UPDATEINTERVAL_name      (ntpd_opt_strs+2328)
+#define UPDATEINTERVAL_name      (ntpd_opt_strs+2454)
 /** Compiled in flag settings for the updateinterval option */
 #define UPDATEINTERVAL_FLAGS     (OPTST_DISABLED \
         | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
@@ -618,11 +634,11 @@
  *  var option description:
  */
 /** Descriptive text for the var option */
-#define VAR_DESC      (ntpd_opt_strs+2343)
+#define VAR_DESC      (ntpd_opt_strs+2469)
 /** Upper-cased name for the var option */
-#define VAR_NAME      (ntpd_opt_strs+2373)
+#define VAR_NAME      (ntpd_opt_strs+2499)
 /** Name string for the var option */
-#define VAR_name      (ntpd_opt_strs+2377)
+#define VAR_name      (ntpd_opt_strs+2503)
 /** Compiled in flag settings for the var option */
 #define VAR_FLAGS     (OPTST_DISABLED | OPTST_STACKED \
         | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
@@ -631,11 +647,11 @@
  *  dvar option description:
  */
 /** Descriptive text for the dvar option */
-#define DVAR_DESC      (ntpd_opt_strs+2381)
+#define DVAR_DESC      (ntpd_opt_strs+2507)
 /** Upper-cased name for the dvar option */
-#define DVAR_NAME      (ntpd_opt_strs+2415)
+#define DVAR_NAME      (ntpd_opt_strs+2541)
 /** Name string for the dvar option */
-#define DVAR_name      (ntpd_opt_strs+2420)
+#define DVAR_name      (ntpd_opt_strs+2546)
 /** Compiled in flag settings for the dvar option */
 #define DVAR_FLAGS     (OPTST_DISABLED | OPTST_STACKED \
         | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
@@ -646,11 +662,11 @@
  */
 #ifdef HAVE_WORKING_FORK
 /** Descriptive text for the wait-sync option */
-#define WAIT_SYNC_DESC      (ntpd_opt_strs+2425)
+#define WAIT_SYNC_DESC      (ntpd_opt_strs+2551)
 /** Upper-cased name for the wait-sync option */
-#define WAIT_SYNC_NAME      (ntpd_opt_strs+2462)
+#define WAIT_SYNC_NAME      (ntpd_opt_strs+2588)
 /** Name string for the wait-sync option */
-#define WAIT_SYNC_name      (ntpd_opt_strs+2472)
+#define WAIT_SYNC_name      (ntpd_opt_strs+2598)
 /** Other options that appear in conjunction with the wait-sync option */
 static int const aWait_SyncCantList[] = {
     INDEX_OPT_NOFORK,
@@ -672,11 +688,11 @@
  *  slew option description:
  */
 /** Descriptive text for the slew option */
-#define SLEW_DESC      (ntpd_opt_strs+2482)
+#define SLEW_DESC      (ntpd_opt_strs+2608)
 /** Upper-cased name for the slew option */
-#define SLEW_NAME      (ntpd_opt_strs+2505)
+#define SLEW_NAME      (ntpd_opt_strs+2631)
 /** Name string for the slew option */
-#define SLEW_name      (ntpd_opt_strs+2510)
+#define SLEW_name      (ntpd_opt_strs+2636)
 /** Compiled in flag settings for the slew option */
 #define SLEW_FLAGS     (OPTST_DISABLED)
 
@@ -685,11 +701,11 @@
  */
 #ifdef SYS_WINNT
 /** Descriptive text for the usepcc option */
-#define USEPCC_DESC      (ntpd_opt_strs+2515)
+#define USEPCC_DESC      (ntpd_opt_strs+2641)
 /** Upper-cased name for the usepcc option */
-#define USEPCC_NAME      (ntpd_opt_strs+2552)
+#define USEPCC_NAME      (ntpd_opt_strs+2678)
 /** Name string for the usepcc option */
-#define USEPCC_name      (ntpd_opt_strs+2559)
+#define USEPCC_name      (ntpd_opt_strs+2685)
 /** Compiled in flag settings for the usepcc option */
 #define USEPCC_FLAGS     (OPTST_DISABLED)
 
@@ -705,11 +721,11 @@
  */
 #ifdef SYS_WINNT
 /** Descriptive text for the pccfreq option */
-#define PCCFREQ_DESC      (ntpd_opt_strs+2566)
+#define PCCFREQ_DESC      (ntpd_opt_strs+2692)
 /** Upper-cased name for the pccfreq option */
-#define PCCFREQ_NAME      (ntpd_opt_strs+2609)
+#define PCCFREQ_NAME      (ntpd_opt_strs+2735)
 /** Name string for the pccfreq option */
-#define PCCFREQ_name      (ntpd_opt_strs+2617)
+#define PCCFREQ_name      (ntpd_opt_strs+2743)
 /** Compiled in flag settings for the pccfreq option */
 #define PCCFREQ_FLAGS     (OPTST_DISABLED \
         | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
@@ -726,11 +742,11 @@
  */
 #ifdef HAVE_DNSREGISTRATION
 /** Descriptive text for the mdns option */
-#define MDNS_DESC      (ntpd_opt_strs+2625)
+#define MDNS_DESC      (ntpd_opt_strs+2751)
 /** Upper-cased name for the mdns option */
-#define MDNS_NAME      (ntpd_opt_strs+2660)
+#define MDNS_NAME      (ntpd_opt_strs+2786)
 /** Name string for the mdns option */
-#define MDNS_name      (ntpd_opt_strs+2665)
+#define MDNS_name      (ntpd_opt_strs+2791)
 /** Compiled in flag settings for the mdns option */
 #define MDNS_FLAGS     (OPTST_DISABLED)
 
@@ -744,11 +760,11 @@
 /*
  *  Help/More_Help/Version option descriptions:
  */
-#define HELP_DESC       (ntpd_opt_strs+2670)
-#define HELP_name       (ntpd_opt_strs+2714)
+#define HELP_DESC       (ntpd_opt_strs+2796)
+#define HELP_name       (ntpd_opt_strs+2840)
 #ifdef HAVE_WORKING_FORK
-#define MORE_HELP_DESC  (ntpd_opt_strs+2719)
-#define MORE_HELP_name  (ntpd_opt_strs+2764)
+#define MORE_HELP_DESC  (ntpd_opt_strs+2845)
+#define MORE_HELP_name  (ntpd_opt_strs+2890)
 #define MORE_HELP_FLAGS (OPTST_IMM | OPTST_NO_INIT)
 #else
 #define MORE_HELP_DESC  HELP_DESC
@@ -761,8 +777,8 @@
 #  define VER_FLAGS     (OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) | \
                          OPTST_ARG_OPTIONAL | OPTST_IMM | OPTST_NO_INIT)
 #endif
-#define VER_DESC        (ntpd_opt_strs+2774)
-#define VER_name        (ntpd_opt_strs+2810)
+#define VER_DESC        (ntpd_opt_strs+2900)
+#define VER_name        (ntpd_opt_strs+2936)
 /**
  *  Declare option callback procedures
  */
@@ -902,8 +918,20 @@
      /* desc, NAME, name */ PANICGATE_DESC, PANICGATE_NAME, PANICGATE_name,
      /* disablement strs */ NULL, NULL },
 
-  {  /* entry idx, value */ 10, VALUE_OPT_JAILDIR,
-     /* equiv idx, value */ 10, VALUE_OPT_JAILDIR,
+  {  /* entry idx, value */ 10, VALUE_OPT_FORCE_STEP_ONCE,
+     /* equiv idx, value */ 10, VALUE_OPT_FORCE_STEP_ONCE,
+     /* equivalenced to  */ NO_EQUIVALENT,
+     /* min, max, act ct */ 0, 1, 0,
+     /* opt state flags  */ FORCE_STEP_ONCE_FLAGS, 0,
+     /* last opt argumnt */ { NULL }, /* --force_step_once */
+     /* arg list/cookie  */ NULL,
+     /* must/cannot opts */ NULL, NULL,
+     /* option proc      */ NULL,
+     /* desc, NAME, name */ FORCE_STEP_ONCE_DESC, FORCE_STEP_ONCE_NAME, FORCE_STEP_ONCE_name,
+     /* disablement strs */ NULL, NULL },
+
+  {  /* entry idx, value */ 11, VALUE_OPT_JAILDIR,
+     /* equiv idx, value */ 11, VALUE_OPT_JAILDIR,
      /* equivalenced to  */ NO_EQUIVALENT,
      /* min, max, act ct */ 0, 1, 0,
      /* opt state flags  */ JAILDIR_FLAGS, 0,
@@ -914,8 +942,8 @@
      /* desc, NAME, name */ JAILDIR_DESC, JAILDIR_NAME, JAILDIR_name,
      /* disablement strs */ NULL, NULL },
 
-  {  /* entry idx, value */ 11, VALUE_OPT_INTERFACE,
-     /* equiv idx, value */ 11, VALUE_OPT_INTERFACE,
+  {  /* entry idx, value */ 12, VALUE_OPT_INTERFACE,
+     /* equiv idx, value */ 12, VALUE_OPT_INTERFACE,
      /* equivalenced to  */ NO_EQUIVALENT,
      /* min, max, act ct */ 0, NOLIMIT, 0,
      /* opt state flags  */ INTERFACE_FLAGS, 0,
@@ -926,8 +954,8 @@
      /* desc, NAME, name */ INTERFACE_DESC, INTERFACE_NAME, INTERFACE_name,
      /* disablement strs */ NULL, NULL },
 
-  {  /* entry idx, value */ 12, VALUE_OPT_KEYFILE,
-     /* equiv idx, value */ 12, VALUE_OPT_KEYFILE,
+  {  /* entry idx, value */ 13, VALUE_OPT_KEYFILE,
+     /* equiv idx, value */ 13, VALUE_OPT_KEYFILE,
      /* equivalenced to  */ NO_EQUIVALENT,
      /* min, max, act ct */ 0, 1, 0,
      /* opt state flags  */ KEYFILE_FLAGS, 0,
@@ -938,8 +966,8 @@
      /* desc, NAME, name */ KEYFILE_DESC, KEYFILE_NAME, KEYFILE_name,
      /* disablement strs */ NULL, NULL },
 
-  {  /* entry idx, value */ 13, VALUE_OPT_LOGFILE,
-     /* equiv idx, value */ 13, VALUE_OPT_LOGFILE,
+  {  /* entry idx, value */ 14, VALUE_OPT_LOGFILE,
+     /* equiv idx, value */ 14, VALUE_OPT_LOGFILE,
      /* equivalenced to  */ NO_EQUIVALENT,
      /* min, max, act ct */ 0, 1, 0,
      /* opt state flags  */ LOGFILE_FLAGS, 0,
@@ -950,8 +978,8 @@
      /* desc, NAME, name */ LOGFILE_DESC, LOGFILE_NAME, LOGFILE_name,
      /* disablement strs */ NULL, NULL },
 
-  {  /* entry idx, value */ 14, VALUE_OPT_NOVIRTUALIPS,
-     /* equiv idx, value */ 14, VALUE_OPT_NOVIRTUALIPS,
+  {  /* entry idx, value */ 15, VALUE_OPT_NOVIRTUALIPS,
+     /* equiv idx, value */ 15, VALUE_OPT_NOVIRTUALIPS,
      /* equivalenced to  */ NO_EQUIVALENT,
      /* min, max, act ct */ 0, 1, 0,
      /* opt state flags  */ NOVIRTUALIPS_FLAGS, 0,
@@ -962,8 +990,8 @@
      /* desc, NAME, name */ NOVIRTUALIPS_DESC, NOVIRTUALIPS_NAME, NOVIRTUALIPS_name,
      /* disablement strs */ NULL, NULL },
 
-  {  /* entry idx, value */ 15, VALUE_OPT_MODIFYMMTIMER,
-     /* equiv idx, value */ 15, VALUE_OPT_MODIFYMMTIMER,
+  {  /* entry idx, value */ 16, VALUE_OPT_MODIFYMMTIMER,
+     /* equiv idx, value */ 16, VALUE_OPT_MODIFYMMTIMER,
      /* equivalenced to  */ NO_EQUIVALENT,
      /* min, max, act ct */ 0, 1, 0,
      /* opt state flags  */ MODIFYMMTIMER_FLAGS, 0,
@@ -974,8 +1002,8 @@
      /* desc, NAME, name */ MODIFYMMTIMER_DESC, MODIFYMMTIMER_NAME, MODIFYMMTIMER_name,
      /* disablement strs */ NULL, NULL },
 
-  {  /* entry idx, value */ 16, VALUE_OPT_NOFORK,
-     /* equiv idx, value */ 16, VALUE_OPT_NOFORK,
+  {  /* entry idx, value */ 17, VALUE_OPT_NOFORK,
+     /* equiv idx, value */ 17, VALUE_OPT_NOFORK,
      /* equivalenced to  */ NO_EQUIVALENT,
      /* min, max, act ct */ 0, 1, 0,
      /* opt state flags  */ NOFORK_FLAGS, 0,
@@ -986,8 +1014,8 @@
      /* desc, NAME, name */ NOFORK_DESC, NOFORK_NAME, NOFORK_name,
      /* disablement strs */ NULL, NULL },
 
-  {  /* entry idx, value */ 17, VALUE_OPT_NICE,
-     /* equiv idx, value */ 17, VALUE_OPT_NICE,
+  {  /* entry idx, value */ 18, VALUE_OPT_NICE,
+     /* equiv idx, value */ 18, VALUE_OPT_NICE,
      /* equivalenced to  */ NO_EQUIVALENT,
      /* min, max, act ct */ 0, 1, 0,
      /* opt state flags  */ NICE_FLAGS, 0,
@@ -998,8 +1026,8 @@
      /* desc, NAME, name */ NICE_DESC, NICE_NAME, NICE_name,
      /* disablement strs */ NULL, NULL },
 
-  {  /* entry idx, value */ 18, VALUE_OPT_PIDFILE,
-     /* equiv idx, value */ 18, VALUE_OPT_PIDFILE,
+  {  /* entry idx, value */ 19, VALUE_OPT_PIDFILE,
+     /* equiv idx, value */ 19, VALUE_OPT_PIDFILE,
      /* equivalenced to  */ NO_EQUIVALENT,
      /* min, max, act ct */ 0, 1, 0,
      /* opt state flags  */ PIDFILE_FLAGS, 0,
@@ -1010,8 +1038,8 @@
      /* desc, NAME, name */ PIDFILE_DESC, PIDFILE_NAME, PIDFILE_name,
      /* disablement strs */ NULL, NULL },
 
-  {  /* entry idx, value */ 19, VALUE_OPT_PRIORITY,
-     /* equiv idx, value */ 19, VALUE_OPT_PRIORITY,
+  {  /* entry idx, value */ 20, VALUE_OPT_PRIORITY,
+     /* equiv idx, value */ 20, VALUE_OPT_PRIORITY,
      /* equivalenced to  */ NO_EQUIVALENT,
      /* min, max, act ct */ 0, 1, 0,
      /* opt state flags  */ PRIORITY_FLAGS, 0,
@@ -1022,8 +1050,8 @@
      /* desc, NAME, name */ PRIORITY_DESC, PRIORITY_NAME, PRIORITY_name,
      /* disablement strs */ NULL, NULL },
 
-  {  /* entry idx, value */ 20, VALUE_OPT_QUIT,
-     /* equiv idx, value */ 20, VALUE_OPT_QUIT,
+  {  /* entry idx, value */ 21, VALUE_OPT_QUIT,
+     /* equiv idx, value */ 21, VALUE_OPT_QUIT,
      /* equivalenced to  */ NO_EQUIVALENT,
      /* min, max, act ct */ 0, 1, 0,
      /* opt state flags  */ QUIT_FLAGS, 0,
@@ -1034,8 +1062,8 @@
      /* desc, NAME, name */ QUIT_DESC, QUIT_NAME, QUIT_name,
      /* disablement strs */ NULL, NULL },
 
-  {  /* entry idx, value */ 21, VALUE_OPT_PROPAGATIONDELAY,
-     /* equiv idx, value */ 21, VALUE_OPT_PROPAGATIONDELAY,
+  {  /* entry idx, value */ 22, VALUE_OPT_PROPAGATIONDELAY,
+     /* equiv idx, value */ 22, VALUE_OPT_PROPAGATIONDELAY,
      /* equivalenced to  */ NO_EQUIVALENT,
      /* min, max, act ct */ 0, 1, 0,
      /* opt state flags  */ PROPAGATIONDELAY_FLAGS, 0,
@@ -1046,8 +1074,8 @@
      /* desc, NAME, name */ PROPAGATIONDELAY_DESC, PROPAGATIONDELAY_NAME, PROPAGATIONDELAY_name,
      /* disablement strs */ NULL, NULL },
 
-  {  /* entry idx, value */ 22, VALUE_OPT_SAVECONFIGQUIT,
-     /* equiv idx, value */ 22, VALUE_OPT_SAVECONFIGQUIT,
+  {  /* entry idx, value */ 23, VALUE_OPT_SAVECONFIGQUIT,
+     /* equiv idx, value */ 23, VALUE_OPT_SAVECONFIGQUIT,
      /* equivalenced to  */ NO_EQUIVALENT,
      /* min, max, act ct */ 0, 1, 0,
      /* opt state flags  */ SAVECONFIGQUIT_FLAGS, 0,
@@ -1058,8 +1086,8 @@
      /* desc, NAME, name */ SAVECONFIGQUIT_DESC, SAVECONFIGQUIT_NAME, SAVECONFIGQUIT_name,
      /* disablement strs */ NULL, NULL },
 
-  {  /* entry idx, value */ 23, VALUE_OPT_STATSDIR,
-     /* equiv idx, value */ 23, VALUE_OPT_STATSDIR,
+  {  /* entry idx, value */ 24, VALUE_OPT_STATSDIR,
+     /* equiv idx, value */ 24, VALUE_OPT_STATSDIR,
      /* equivalenced to  */ NO_EQUIVALENT,
      /* min, max, act ct */ 0, 1, 0,
      /* opt state flags  */ STATSDIR_FLAGS, 0,
@@ -1070,8 +1098,8 @@
      /* desc, NAME, name */ STATSDIR_DESC, STATSDIR_NAME, STATSDIR_name,
      /* disablement strs */ NULL, NULL },
 
-  {  /* entry idx, value */ 24, VALUE_OPT_TRUSTEDKEY,
-     /* equiv idx, value */ 24, VALUE_OPT_TRUSTEDKEY,
+  {  /* entry idx, value */ 25, VALUE_OPT_TRUSTEDKEY,
+     /* equiv idx, value */ 25, VALUE_OPT_TRUSTEDKEY,
      /* equivalenced to  */ NO_EQUIVALENT,
      /* min, max, act ct */ 0, NOLIMIT, 0,
      /* opt state flags  */ TRUSTEDKEY_FLAGS, 0,
@@ -1082,8 +1110,8 @@
      /* desc, NAME, name */ TRUSTEDKEY_DESC, TRUSTEDKEY_NAME, TRUSTEDKEY_name,
      /* disablement strs */ NULL, NULL },
 
-  {  /* entry idx, value */ 25, VALUE_OPT_USER,
-     /* equiv idx, value */ 25, VALUE_OPT_USER,
+  {  /* entry idx, value */ 26, VALUE_OPT_USER,
+     /* equiv idx, value */ 26, VALUE_OPT_USER,
      /* equivalenced to  */ NO_EQUIVALENT,
      /* min, max, act ct */ 0, 1, 0,
      /* opt state flags  */ USER_FLAGS, 0,
@@ -1094,8 +1122,8 @@
      /* desc, NAME, name */ USER_DESC, USER_NAME, USER_name,
      /* disablement strs */ NULL, NULL },
 
-  {  /* entry idx, value */ 26, VALUE_OPT_UPDATEINTERVAL,
-     /* equiv idx, value */ 26, VALUE_OPT_UPDATEINTERVAL,
+  {  /* entry idx, value */ 27, VALUE_OPT_UPDATEINTERVAL,
+     /* equiv idx, value */ 27, VALUE_OPT_UPDATEINTERVAL,
      /* equivalenced to  */ NO_EQUIVALENT,
      /* min, max, act ct */ 0, 1, 0,
      /* opt state flags  */ UPDATEINTERVAL_FLAGS, 0,
@@ -1106,8 +1134,8 @@
      /* desc, NAME, name */ UPDATEINTERVAL_DESC, UPDATEINTERVAL_NAME, UPDATEINTERVAL_name,
      /* disablement strs */ NULL, NULL },
 
-  {  /* entry idx, value */ 27, VALUE_OPT_VAR,
-     /* equiv idx, value */ 27, VALUE_OPT_VAR,
+  {  /* entry idx, value */ 28, VALUE_OPT_VAR,
+     /* equiv idx, value */ 28, VALUE_OPT_VAR,
      /* equivalenced to  */ NO_EQUIVALENT,
      /* min, max, act ct */ 0, NOLIMIT, 0,
      /* opt state flags  */ VAR_FLAGS, 0,
@@ -1118,8 +1146,8 @@
      /* desc, NAME, name */ VAR_DESC, VAR_NAME, VAR_name,
      /* disablement strs */ NULL, NULL },
 
-  {  /* entry idx, value */ 28, VALUE_OPT_DVAR,
-     /* equiv idx, value */ 28, VALUE_OPT_DVAR,
+  {  /* entry idx, value */ 29, VALUE_OPT_DVAR,
+     /* equiv idx, value */ 29, VALUE_OPT_DVAR,
      /* equivalenced to  */ NO_EQUIVALENT,
      /* min, max, act ct */ 0, NOLIMIT, 0,
      /* opt state flags  */ DVAR_FLAGS, 0,
@@ -1130,8 +1158,8 @@
      /* desc, NAME, name */ DVAR_DESC, DVAR_NAME, DVAR_name,
      /* disablement strs */ NULL, NULL },
 
-  {  /* entry idx, value */ 29, VALUE_OPT_WAIT_SYNC,
-     /* equiv idx, value */ 29, VALUE_OPT_WAIT_SYNC,
+  {  /* entry idx, value */ 30, VALUE_OPT_WAIT_SYNC,
+     /* equiv idx, value */ 30, VALUE_OPT_WAIT_SYNC,
      /* equivalenced to  */ NO_EQUIVALENT,
      /* min, max, act ct */ 0, 1, 0,
      /* opt state flags  */ WAIT_SYNC_FLAGS, 0,
@@ -1142,8 +1170,8 @@
      /* desc, NAME, name */ WAIT_SYNC_DESC, WAIT_SYNC_NAME, WAIT_SYNC_name,
      /* disablement strs */ NULL, NULL },
 
-  {  /* entry idx, value */ 30, VALUE_OPT_SLEW,
-     /* equiv idx, value */ 30, VALUE_OPT_SLEW,
+  {  /* entry idx, value */ 31, VALUE_OPT_SLEW,
+     /* equiv idx, value */ 31, VALUE_OPT_SLEW,
      /* equivalenced to  */ NO_EQUIVALENT,
      /* min, max, act ct */ 0, 1, 0,
      /* opt state flags  */ SLEW_FLAGS, 0,
@@ -1154,8 +1182,8 @@
      /* desc, NAME, name */ SLEW_DESC, SLEW_NAME, SLEW_name,
      /* disablement strs */ NULL, NULL },
 
-  {  /* entry idx, value */ 31, VALUE_OPT_USEPCC,
-     /* equiv idx, value */ 31, VALUE_OPT_USEPCC,
+  {  /* entry idx, value */ 32, VALUE_OPT_USEPCC,
+     /* equiv idx, value */ 32, VALUE_OPT_USEPCC,
      /* equivalenced to  */ NO_EQUIVALENT,
      /* min, max, act ct */ 0, 1, 0,
      /* opt state flags  */ USEPCC_FLAGS, 0,
@@ -1166,8 +1194,8 @@
      /* desc, NAME, name */ USEPCC_DESC, USEPCC_NAME, USEPCC_name,
      /* disablement strs */ NULL, NULL },
 
-  {  /* entry idx, value */ 32, VALUE_OPT_PCCFREQ,
-     /* equiv idx, value */ 32, VALUE_OPT_PCCFREQ,
+  {  /* entry idx, value */ 33, VALUE_OPT_PCCFREQ,
+     /* equiv idx, value */ 33, VALUE_OPT_PCCFREQ,
      /* equivalenced to  */ NO_EQUIVALENT,
      /* min, max, act ct */ 0, 1, 0,
      /* opt state flags  */ PCCFREQ_FLAGS, 0,
@@ -1178,8 +1206,8 @@
      /* desc, NAME, name */ PCCFREQ_DESC, PCCFREQ_NAME, PCCFREQ_name,
      /* disablement strs */ NULL, NULL },
 
-  {  /* entry idx, value */ 33, VALUE_OPT_MDNS,
-     /* equiv idx, value */ 33, VALUE_OPT_MDNS,
+  {  /* entry idx, value */ 34, VALUE_OPT_MDNS,
+     /* equiv idx, value */ 34, VALUE_OPT_MDNS,
      /* equivalenced to  */ NO_EQUIVALENT,
      /* min, max, act ct */ 0, 1, 0,
      /* opt state flags  */ MDNS_FLAGS, 0,
@@ -1232,21 +1260,21 @@
 
 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
 /** Reference to the upper cased version of ntpd. */
-#define zPROGNAME       (ntpd_opt_strs+2818)
+#define zPROGNAME       (ntpd_opt_strs+2944)
 /** Reference to the title line for ntpd usage. */
-#define zUsageTitle     (ntpd_opt_strs+2823)
+#define zUsageTitle     (ntpd_opt_strs+2949)
 /** There is no ntpd configuration file. */
 #define zRcName         NULL
 /** There are no directories to search for ntpd config files. */
 #define apzHomeList     NULL
 /** The ntpd program bug email address. */
-#define zBugsAddr       (ntpd_opt_strs+2952)
+#define zBugsAddr       (ntpd_opt_strs+3080)
 /** Clarification/explanation of what ntpd does. */
-#define zExplain        (ntpd_opt_strs+2986)
+#define zExplain        (ntpd_opt_strs+3114)
 /** Extra detail explaining what ntpd does. */
 #define zDetail         (NULL)
 /** The full version string for ntpd. */
-#define zFullVersion    (ntpd_opt_strs+2988)
+#define zFullVersion    (ntpd_opt_strs+3116)
 /* extracted from optcode.tlib near line 364 */
 
 #if defined(ENABLE_NLS)
@@ -1368,7 +1396,7 @@
       NO_EQUIVALENT, /* '-#' option index */
       NO_EQUIVALENT /* index of default opt */
     },
-    37 /* full option count */, 34 /* user option count */,
+    38 /* full option count */, 35 /* user option count */,
     ntpd_full_usage, ntpd_short_usage,
     NULL, NULL,
     PKGDATADIR, ntpd_packager_info
@@ -1503,8 +1531,8 @@
      translate option names.
    */
   /* referenced via ntpdOptions.pzCopyright */
-  puts(_("ntpd 4.2.8\n\
-Copyright (C) 1970-2014 The University of Delaware, all rights reserved.\n\
+  puts(_("ntpd 4.2.8p2\n\
+Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation, all rights reserved.\n\
 This is free software. It is licensed for use, modification and\n\
 redistribution under the terms of the NTP License, copies of which\n\
 can be seen at:\n"));
@@ -1518,9 +1546,10 @@
 both the copyright notice and this permission notice appear in supporting\n\
 documentation, and that the name The University of Delaware not be used in\n\
 advertising or publicity pertaining to distribution of the software without\n\
-specific, written prior permission.  The University of Delaware makes no\n\
-representations about the suitability this software for any purpose.  It is\n\
-provided \"as is\" without express or implied warranty.\n"));
+specific, written prior permission.  The University of Delaware and Network\n\
+Time Foundation makes no representations about the suitability this\n\
+software for any purpose.  It is provided \"as is\" without express or\n\
+implied warranty.\n"));
 
   /* referenced via ntpdOptions.pOptDesc->pzText */
   puts(_("Force IPv4 DNS name resolution"));
@@ -1553,6 +1582,9 @@
   puts(_("Allow the first adjustment to be Big"));
 
   /* referenced via ntpdOptions.pOptDesc->pzText */
+  puts(_("Step any initial offset correction."));
+
+  /* referenced via ntpdOptions.pOptDesc->pzText */
   puts(_("Jail directory"));
 
   /* referenced via ntpdOptions.pOptDesc->pzText */
@@ -1640,7 +1672,7 @@
   puts(_("output version information and exit"));
 
   /* referenced via ntpdOptions.pzUsageTitle */
-  puts(_("ntpd - NTP daemon program - Ver. 4.2.8\n\
+  puts(_("ntpd - NTP daemon program - Ver. 4.2.8p2\n\
 Usage:  %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... \\\n\
 \t\t[ <server1> ... <serverN> ]\n"));
 
@@ -1648,7 +1680,7 @@
   puts(_("\n"));
 
   /* referenced via ntpdOptions.pzFullVersion */
-  puts(_("ntpd 4.2.8"));
+  puts(_("ntpd 4.2.8p2"));
 
   /* referenced via ntpdOptions.pzFullUsage */
   puts(_("<<<NOT-FOUND>>>"));
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/ntpd/ntpd-opts.h /cur/src/external/bsd/ntp/dist/ntpd/ntpd-opts.h
--- external/bsd/ntp/dist/ntpd/ntpd-opts.h	2014-12-24 18:28:09.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/ntpd/ntpd-opts.h	2015-04-07 19:51:17.000000000 -0700
@@ -3,7 +3,7 @@
 /*
  *  EDIT THIS FILE WITH CAUTION  (ntpd-opts.h)
  *
- *  It has been AutoGen-ed  December 19, 2014 at 07:46:32 AM by AutoGen 5.18.5pre4
+ *  It has been AutoGen-ed  April  7, 2015 at 04:23:13 AM by AutoGen 5.18.5pre4
  *  From the definitions    ntpd-opts.def
  *  and the template file   options
  *
@@ -20,7 +20,7 @@
  * The ntpd program is copyrighted and licensed
  * under the following terms:
  *
- *  Copyright (C) 1970-2014 The University of Delaware, all rights reserved.
+ *  Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation, all rights reserved.
  *  This is free software. It is licensed for use, modification and
  *  redistribution under the terms of the NTP License, copies of which
  *  can be seen at:
@@ -33,7 +33,7 @@
  *  both the copyright notice and this permission notice appear in
  *  supporting documentation, and that the name The University of Delaware not be used in
  *  advertising or publicity pertaining to distribution of the software
- *  without specific, written prior permission. The University of Delaware makes no
+ *  without specific, written prior permission. The University of Delaware and Network Time Foundation makes no
  *  representations about the suitability this software for any purpose. It
  *  is provided "as is" without express or implied warranty.
  */
@@ -76,40 +76,41 @@
     INDEX_OPT_SET_DEBUG_LEVEL   =  7,
     INDEX_OPT_DRIFTFILE         =  8,
     INDEX_OPT_PANICGATE         =  9,
-    INDEX_OPT_JAILDIR           = 10,
-    INDEX_OPT_INTERFACE         = 11,
-    INDEX_OPT_KEYFILE           = 12,
-    INDEX_OPT_LOGFILE           = 13,
-    INDEX_OPT_NOVIRTUALIPS      = 14,
-    INDEX_OPT_MODIFYMMTIMER     = 15,
-    INDEX_OPT_NOFORK            = 16,
-    INDEX_OPT_NICE              = 17,
-    INDEX_OPT_PIDFILE           = 18,
-    INDEX_OPT_PRIORITY          = 19,
-    INDEX_OPT_QUIT              = 20,
-    INDEX_OPT_PROPAGATIONDELAY  = 21,
-    INDEX_OPT_SAVECONFIGQUIT    = 22,
-    INDEX_OPT_STATSDIR          = 23,
-    INDEX_OPT_TRUSTEDKEY        = 24,
-    INDEX_OPT_USER              = 25,
-    INDEX_OPT_UPDATEINTERVAL    = 26,
-    INDEX_OPT_VAR               = 27,
-    INDEX_OPT_DVAR              = 28,
-    INDEX_OPT_WAIT_SYNC         = 29,
-    INDEX_OPT_SLEW              = 30,
-    INDEX_OPT_USEPCC            = 31,
-    INDEX_OPT_PCCFREQ           = 32,
-    INDEX_OPT_MDNS              = 33,
-    INDEX_OPT_VERSION           = 34,
-    INDEX_OPT_HELP              = 35,
-    INDEX_OPT_MORE_HELP         = 36
+    INDEX_OPT_FORCE_STEP_ONCE   = 10,
+    INDEX_OPT_JAILDIR           = 11,
+    INDEX_OPT_INTERFACE         = 12,
+    INDEX_OPT_KEYFILE           = 13,
+    INDEX_OPT_LOGFILE           = 14,
+    INDEX_OPT_NOVIRTUALIPS      = 15,
+    INDEX_OPT_MODIFYMMTIMER     = 16,
+    INDEX_OPT_NOFORK            = 17,
+    INDEX_OPT_NICE              = 18,
+    INDEX_OPT_PIDFILE           = 19,
+    INDEX_OPT_PRIORITY          = 20,
+    INDEX_OPT_QUIT              = 21,
+    INDEX_OPT_PROPAGATIONDELAY  = 22,
+    INDEX_OPT_SAVECONFIGQUIT    = 23,
+    INDEX_OPT_STATSDIR          = 24,
+    INDEX_OPT_TRUSTEDKEY        = 25,
+    INDEX_OPT_USER              = 26,
+    INDEX_OPT_UPDATEINTERVAL    = 27,
+    INDEX_OPT_VAR               = 28,
+    INDEX_OPT_DVAR              = 29,
+    INDEX_OPT_WAIT_SYNC         = 30,
+    INDEX_OPT_SLEW              = 31,
+    INDEX_OPT_USEPCC            = 32,
+    INDEX_OPT_PCCFREQ           = 33,
+    INDEX_OPT_MDNS              = 34,
+    INDEX_OPT_VERSION           = 35,
+    INDEX_OPT_HELP              = 36,
+    INDEX_OPT_MORE_HELP         = 37
 } teOptIndex;
 /** count of all options for ntpd */
-#define OPTION_CT    37
+#define OPTION_CT    38
 /** ntpd version */
-#define NTPD_VERSION       "4.2.8"
+#define NTPD_VERSION       "4.2.8p2"
 /** Full ntpd version text */
-#define NTPD_FULL_VERSION  "ntpd 4.2.8"
+#define NTPD_FULL_VERSION  "ntpd 4.2.8p2"
 
 /**
  *  Interface defines for all options.  Replace "n" with the UPPER_CASED
@@ -201,6 +202,10 @@
 #  warning undefining PANICGATE due to option name conflict
 #  undef   PANICGATE
 # endif
+# ifdef    FORCE_STEP_ONCE
+#  warning undefining FORCE_STEP_ONCE due to option name conflict
+#  undef   FORCE_STEP_ONCE
+# endif
 # ifdef    JAILDIR
 #  warning undefining JAILDIR due to option name conflict
 #  undef   JAILDIR
@@ -309,6 +314,7 @@
 # undef SET_DEBUG_LEVEL
 # undef DRIFTFILE
 # undef PANICGATE
+# undef FORCE_STEP_ONCE
 # undef JAILDIR
 # undef INTERFACE
 # undef KEYFILE
@@ -351,6 +357,7 @@
 #define OPT_VALUE_SET_DEBUG_LEVEL (DESC(SET_DEBUG_LEVEL).optArg.argInt)
 #define VALUE_OPT_DRIFTFILE      'f'
 #define VALUE_OPT_PANICGATE      'g'
+#define VALUE_OPT_FORCE_STEP_ONCE 'G'
 #define VALUE_OPT_JAILDIR        'i'
 #define VALUE_OPT_INTERFACE      'I'
 #define VALUE_OPT_KEYFILE        'k'
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/ntpd/ntpd.1ntpdman /cur/src/external/bsd/ntp/dist/ntpd/ntpd.1ntpdman
--- external/bsd/ntp/dist/ntpd/ntpd.1ntpdman	2014-12-19 12:37:40.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/ntpd/ntpd.1ntpdman	2015-04-07 19:51:17.000000000 -0700
@@ -10,11 +10,11 @@
 .ds B-Font B
 .ds I-Font I
 .ds R-Font R
-.TH ntpd 1ntpdman "19 Dec 2014" "4.2.8" "User Commands"
+.TH ntpd 1ntpdman "07 Apr 2015" "4.2.8p2" "User Commands"
 .\"
-.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-WBaqpd/ag-9Baiod)
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-TQays3/ag-5Qaqr3)
 .\"
-.\" It has been AutoGen-ed December 19, 2014 at 07:48:58 AM by AutoGen 5.18.5pre4
+.\" It has been AutoGen-ed April 7, 2015 at 04:25:45 AM by AutoGen 5.18.5pre4
 .\" From the definitions ntpd-opts.def
 .\" and the template file agman-cmd.tpl
 .SH NAME
@@ -175,7 +175,7 @@
 by default.
 This is the same operation as the
 \fBdriftfile\fP \fIdriftfile\fP
-configuration specification in the 
+configuration specification in the
 \fI/etc/ntp.conf\fP
 file.
 .TP
@@ -196,6 +196,20 @@
 \fBtinker\fP
 configuration file directive for other options.
 .TP
+.NOP \f\*[B-Font]\-G\f[], \f\*[B-Font]\-\-force\-step\-once\f[]
+Step any initial offset correction..
+.sp
+Normally,
+\fBntpd\fP
+steps the time if the time offset exceeds the step threshold,
+which is 128 ms by default, and otherwise slews the time.
+This option forces the initial offset correction to be stepped,
+so the highest time accuracy can be achieved quickly.
+However, this may also cause the time to be stepped back
+so this option must not be used if
+applications requiring monotonic time are running.
+See the \fBtinker\fP configuration file directive for other options.
+.TP
 .NOP \f\*[B-Font]\-i\f[] \f\*[I-Font]string\f[], \f\*[B-Font]\-\-jaildir\f[]=\f\*[I-Font]string\f[]
 Jail directory.
 .sp
@@ -220,7 +234,7 @@
 given interface name.  This option may appear multiple times.  This option
 also implies not opening other addresses, except wildcard and localhost.
 This option is deprecated. Please consider using the configuration file
-\fBinterface\fP command, which is more versatile. 
+\fBinterface\fP command, which is more versatile.
 .TP
 .NOP \f\*[B-Font]\-k\f[] \f\*[I-Font]string\f[], \f\*[B-Font]\-\-keyfile\f[]=\f\*[I-Font]string\f[]
 path to symmetric keys.
@@ -959,9 +973,9 @@
 .PP
 
 .SH "AUTHORS"
-The University of Delaware
+The University of Delaware and Network Time Foundation
 .SH "COPYRIGHT"
-Copyright (C) 1970-2014 The University of Delaware all rights reserved.
+Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation all rights reserved.
 This program is released under the terms of the NTP license, <http://ntp.org/license>.
 .SH BUGS
 The
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/ntpd/ntpd.1ntpdmdoc /cur/src/external/bsd/ntp/dist/ntpd/ntpd.1ntpdmdoc
--- external/bsd/ntp/dist/ntpd/ntpd.1ntpdmdoc	2014-12-19 12:37:41.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/ntpd/ntpd.1ntpdmdoc	2015-04-07 19:51:17.000000000 -0700
@@ -1,9 +1,9 @@
-.Dd December 19 2014
+.Dd April 7 2015
 .Dt NTPD 1ntpdmdoc User Commands
 .Os
 .\"  EDIT THIS FILE WITH CAUTION  (ntpd-opts.mdoc)
 .\"
-.\"  It has been AutoGen-ed  December 19, 2014 at 07:49:14 AM by AutoGen 5.18.5pre4
+.\"  It has been AutoGen-ed  April  7, 2015 at 04:26:02 AM by AutoGen 5.18.5pre4
 .\"  From the definitions    ntpd-opts.def
 .\"  and the template file   agmdoc-cmd.tpl
 .Sh NAME
@@ -144,7 +144,7 @@
 by default.
 This is the same operation as the
 \fBdriftfile\fP \fIdriftfile\fP
-configuration specification in the 
+configuration specification in the
 \fI/etc/ntp.conf\fP
 file.
 .It  Fl g , Fl \-panicgate 
@@ -163,6 +163,19 @@
 See the
 \fBtinker\fP
 configuration file directive for other options.
+.It  Fl G , Fl \-force\-step\-once 
+Step any initial offset correction..
+.sp
+Normally,
+\fBntpd\fP
+steps the time if the time offset exceeds the step threshold,
+which is 128 ms by default, and otherwise slews the time.
+This option forces the initial offset correction to be stepped,
+so the highest time accuracy can be achieved quickly.
+However, this may also cause the time to be stepped back
+so this option must not be used if
+applications requiring monotonic time are running.
+See the \fBtinker\fP configuration file directive for other options.
 .It  Fl i Ar string , Fl \-jaildir Ns = Ns Ar string 
 Jail directory.
 .sp
@@ -186,7 +199,7 @@
 given interface name.  This option may appear multiple times.  This option
 also implies not opening other addresses, except wildcard and localhost.
 This option is deprecated. Please consider using the configuration file
-\fBinterface\fP command, which is more versatile. 
+\fBinterface\fP command, which is more versatile.
 .It  Fl k Ar string , Fl \-keyfile Ns = Ns Ar string 
 path to symmetric keys.
 .sp
@@ -867,9 +880,9 @@
 .%O RFC5908
 .Re
 .Sh "AUTHORS"
-The University of Delaware
+The University of Delaware and Network Time Foundation
 .Sh "COPYRIGHT"
-Copyright (C) 1970\-2014 The University of Delaware all rights reserved.
+Copyright (C) 1992\-2015 The University of Delaware and Network Time Foundation all rights reserved.
 This program is released under the terms of the NTP license, <http://ntp.org/license>.
 .Sh BUGS
 The
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/ntpd/ntpd.c /cur/src/external/bsd/ntp/dist/ntpd/ntpd.c
--- external/bsd/ntp/dist/ntpd/ntpd.c	2014-12-24 18:28:10.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/ntpd/ntpd.c	2015-04-07 19:51:17.000000000 -0700
@@ -1264,6 +1264,7 @@
 	if (mdns != NULL)
 		DNSServiceRefDeallocate(mdns);
 # endif
+	peer_cleanup();
 	exit(0);
 }
 #endif	/* !SIM && SIGDIE1 */
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/ntpd/ntpd.html /cur/src/external/bsd/ntp/dist/ntpd/ntpd.html
--- external/bsd/ntp/dist/ntpd/ntpd.html	2014-12-19 12:37:40.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/ntpd/ntpd.html	2015-04-07 19:51:17.000000000 -0700
@@ -39,7 +39,7 @@
 symmetric and broadcast modes, and with both symmetric-key and public-key
 cryptography.
 
-  <p>This document applies to version 4.2.8 of <code>ntpd</code>.
+  <p>This document applies to version 4.2.8p2 of <code>ntpd</code>.
 
 <ul class="menu">
 <li><a accesskey="1" href="#ntpd-Description">ntpd Description</a>:             Description
@@ -169,7 +169,8 @@
 <li><a accesskey="6" href="#ntpd-configfile">ntpd configfile</a>:              configfile option (-c)
 <li><a accesskey="7" href="#ntpd-driftfile">ntpd driftfile</a>:               driftfile option (-f)
 <li><a accesskey="8" href="#ntpd-panicgate">ntpd panicgate</a>:               panicgate option (-g)
-<li><a accesskey="9" href="#ntpd-jaildir">ntpd jaildir</a>:                 jaildir option (-i)
+<li><a accesskey="9" href="#ntpd-force_002dstep_002donce">ntpd force-step-once</a>:         force-step-once option (-G)
+<li><a href="#ntpd-jaildir">ntpd jaildir</a>:                 jaildir option (-i)
 <li><a href="#ntpd-interface">ntpd interface</a>:               interface option (-I)
 <li><a href="#ntpd-keyfile">ntpd keyfile</a>:                 keyfile option (-k)
 <li><a href="#ntpd-logfile">ntpd logfile</a>:                 logfile option (-l)
@@ -219,7 +220,7 @@
 used to select the program, defaulting to <span class="file">more</span>.  Both will exit
 with a status code of 0.
 
-<pre class="example">ntpd - NTP daemon program - Ver. 4.2.8-x
+<pre class="example">ntpd - NTP daemon program - Ver. 4.2.8p2-RC3
 Usage:  ntpd [ -&lt;flag&gt; [&lt;val&gt;] | --&lt;name&gt;[{=| }&lt;val&gt;] ]... \
                 [ &lt;server1&gt; ... &lt;serverN&gt; ]
   Flg Arg Option-Name    Description
@@ -240,6 +241,7 @@
    -f Str driftfile      frequency drift file name
    -g no  panicgate      Allow the first adjustment to be Big
                                 - may appear multiple times
+   -G no  force-step-once Step any initial offset correction.
    -i Str jaildir        Jail directory
    -I Str interface      Listen on an interface name or address
                                 - may appear multiple times
@@ -413,7 +415,7 @@
 file. 
 <div class="node">
 <p><hr>
-<a name="ntpd-panicgate"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-jaildir">ntpd jaildir</a>,
+<a name="ntpd-panicgate"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-force_002dstep_002donce">ntpd force-step-once</a>,
 Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-driftfile">ntpd driftfile</a>,
 Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
 <br>
@@ -443,15 +445,37 @@
 configuration file directive for other options. 
 <div class="node">
 <p><hr>
-<a name="ntpd-jaildir"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-interface">ntpd interface</a>,
+<a name="ntpd-force_002dstep_002donce"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-jaildir">ntpd jaildir</a>,
 Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-panicgate">ntpd panicgate</a>,
 Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
 <br>
 </div>
 
+<h4 class="subsection">force-step-once option (-G)</h4>
+
+<p><a name="index-ntpd_002dforce_002dstep_002donce-11"></a>
+This is the &ldquo;step any initial offset correction.&rdquo; option. 
+Normally,
+<code>ntpd</code>
+steps the time if the time offset exceeds the step threshold,
+which is 128 ms by default, and otherwise slews the time. 
+This option forces the initial offset correction to be stepped,
+so the highest time accuracy can be achieved quickly. 
+However, this may also cause the time to be stepped back
+so this option must not be used if
+applications requiring monotonic time are running. 
+See the <code>tinker</code> configuration file directive for other options. 
+<div class="node">
+<p><hr>
+<a name="ntpd-jaildir"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-interface">ntpd interface</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-force_002dstep_002donce">ntpd force-step-once</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
+<br>
+</div>
+
 <h4 class="subsection">jaildir option (-i)</h4>
 
-<p><a name="index-ntpd_002djaildir-11"></a>
+<p><a name="index-ntpd_002djaildir-12"></a>
 This is the &ldquo;jail directory&rdquo; option. 
 This option takes a string argument.
 
@@ -482,7 +506,7 @@
 
 <h4 class="subsection">interface option (-I)</h4>
 
-<p><a name="index-ntpd_002dinterface-12"></a>
+<p><a name="index-ntpd_002dinterface-13"></a>
 This is the &ldquo;listen on an interface name or address&rdquo; option. 
 This option takes a string argument <span class="file">iface</span>.
 
@@ -506,7 +530,7 @@
 
 <h4 class="subsection">keyfile option (-k)</h4>
 
-<p><a name="index-ntpd_002dkeyfile-13"></a>
+<p><a name="index-ntpd_002dkeyfile-14"></a>
 This is the &ldquo;path to symmetric keys&rdquo; option. 
 This option takes a string argument. 
 Specify the name and path of the symmetric key file. 
@@ -525,7 +549,7 @@
 
 <h4 class="subsection">logfile option (-l)</h4>
 
-<p><a name="index-ntpd_002dlogfile-14"></a>
+<p><a name="index-ntpd_002dlogfile-15"></a>
 This is the &ldquo;path to the log file&rdquo; option. 
 This option takes a string argument. 
 Specify the name and path of the log file. 
@@ -543,7 +567,7 @@
 
 <h4 class="subsection">novirtualips option (-L)</h4>
 
-<p><a name="index-ntpd_002dnovirtualips-15"></a>
+<p><a name="index-ntpd_002dnovirtualips-16"></a>
 This is the &ldquo;do not listen to virtual interfaces&rdquo; option. 
 Do not listen to virtual interfaces, defined as those with
 names containing a colon.  This option is deprecated.  Please
@@ -559,7 +583,7 @@
 
 <h4 class="subsection">modifymmtimer option (-M)</h4>
 
-<p><a name="index-ntpd_002dmodifymmtimer-16"></a>
+<p><a name="index-ntpd_002dmodifymmtimer-17"></a>
 This is the &ldquo;modify multimedia timer (windows only)&rdquo; option.
 
 <p class="noindent">This option has some usage constraints.  It:
@@ -580,7 +604,7 @@
 
 <h4 class="subsection">nice option (-N)</h4>
 
-<p><a name="index-ntpd_002dnice-17"></a>
+<p><a name="index-ntpd_002dnice-18"></a>
 This is the &ldquo;run at high priority&rdquo; option. 
 To the extent permitted by the operating system, run
 <code>ntpd</code>
@@ -595,7 +619,7 @@
 
 <h4 class="subsection">pidfile option (-p)</h4>
 
-<p><a name="index-ntpd_002dpidfile-18"></a>
+<p><a name="index-ntpd_002dpidfile-19"></a>
 This is the &ldquo;path to the pid file&rdquo; option. 
 This option takes a string argument. 
 Specify the name and path of the file used to record
@@ -614,7 +638,7 @@
 
 <h4 class="subsection">priority option (-P)</h4>
 
-<p><a name="index-ntpd_002dpriority-19"></a>
+<p><a name="index-ntpd_002dpriority-20"></a>
 This is the &ldquo;process priority&rdquo; option. 
 This option takes a number argument. 
 To the extent permitted by the operating system, run
@@ -632,7 +656,7 @@
 
 <h4 class="subsection">quit option (-q)</h4>
 
-<p><a name="index-ntpd_002dquit-20"></a>
+<p><a name="index-ntpd_002dquit-21"></a>
 This is the &ldquo;set the time and quit&rdquo; option.
 
 <p class="noindent">This option has some usage constraints.  It:
@@ -662,7 +686,7 @@
 
 <h4 class="subsection">propagationdelay option (-r)</h4>
 
-<p><a name="index-ntpd_002dpropagationdelay-21"></a>
+<p><a name="index-ntpd_002dpropagationdelay-22"></a>
 This is the &ldquo;broadcast/propagation delay&rdquo; option. 
 This option takes a string argument. 
 Specify the default propagation delay from the broadcast/multicast server to this client. This is necessary only if the delay cannot be computed automatically by the protocol. 
@@ -676,7 +700,7 @@
 
 <h4 class="subsection">saveconfigquit option</h4>
 
-<p><a name="index-ntpd_002dsaveconfigquit-22"></a>
+<p><a name="index-ntpd_002dsaveconfigquit-23"></a>
 This is the &ldquo;save parsed configuration and quit&rdquo; option. 
 This option takes a string argument.
 
@@ -700,7 +724,7 @@
 
 <h4 class="subsection">statsdir option (-s)</h4>
 
-<p><a name="index-ntpd_002dstatsdir-23"></a>
+<p><a name="index-ntpd_002dstatsdir-24"></a>
 This is the &ldquo;statistics file location&rdquo; option. 
 This option takes a string argument. 
 Specify the directory path for files created by the statistics facility. 
@@ -717,7 +741,7 @@
 
 <h4 class="subsection">trustedkey option (-t)</h4>
 
-<p><a name="index-ntpd_002dtrustedkey-24"></a>
+<p><a name="index-ntpd_002dtrustedkey-25"></a>
 This is the &ldquo;trusted key number&rdquo; option. 
 This option takes a string argument <span class="file">tkey</span>.
 
@@ -737,7 +761,7 @@
 
 <h4 class="subsection">user option (-u)</h4>
 
-<p><a name="index-ntpd_002duser-25"></a>
+<p><a name="index-ntpd_002duser-26"></a>
 This is the &ldquo;run as userid (or userid:groupid)&rdquo; option. 
 This option takes a string argument.
 
@@ -762,7 +786,7 @@
 
 <h4 class="subsection">updateinterval option (-U)</h4>
 
-<p><a name="index-ntpd_002dupdateinterval-26"></a>
+<p><a name="index-ntpd_002dupdateinterval-27"></a>
 This is the &ldquo;interval in seconds between scans for new or dropped interfaces&rdquo; option. 
 This option takes a number argument. 
 Give the time in seconds between two scans for new or dropped interfaces. 
@@ -779,7 +803,7 @@
 
 <h4 class="subsection">wait-sync option (-w)</h4>
 
-<p><a name="index-ntpd_002dwait_002dsync-27"></a>
+<p><a name="index-ntpd_002dwait_002dsync-28"></a>
 This is the &ldquo;seconds to wait for first clock sync&rdquo; option. 
 This option takes a number argument.
 
@@ -808,7 +832,7 @@
 
 <h4 class="subsection">slew option (-x)</h4>
 
-<p><a name="index-ntpd_002dslew-28"></a>
+<p><a name="index-ntpd_002dslew-29"></a>
 This is the &ldquo;slew up to 600 seconds&rdquo; option. 
 Normally, the time is slewed if the offset is less than the step threshold, which is 128 ms by default, and stepped if above the threshold. 
 This option sets the threshold to 600 s, which is well within the accuracy window to set the clock manually. 
@@ -833,7 +857,7 @@
 
 <h4 class="subsection">usepcc option</h4>
 
-<p><a name="index-ntpd_002dusepcc-29"></a>
+<p><a name="index-ntpd_002dusepcc-30"></a>
 This is the &ldquo;use cpu cycle counter (windows only)&rdquo; option.
 
 <p class="noindent">This option has some usage constraints.  It:
@@ -855,7 +879,7 @@
 
 <h4 class="subsection">pccfreq option</h4>
 
-<p><a name="index-ntpd_002dpccfreq-30"></a>
+<p><a name="index-ntpd_002dpccfreq-31"></a>
 This is the &ldquo;force cpu cycle counter use (windows only)&rdquo; option. 
 This option takes a string argument.
 
@@ -877,7 +901,7 @@
 
 <h4 class="subsection">mdns option (-m)</h4>
 
-<p><a name="index-ntpd_002dmdns-31"></a>
+<p><a name="index-ntpd_002dmdns-32"></a>
 This is the &ldquo;register with mdns as a ntp server&rdquo; option.
 
 <p class="noindent">This option has some usage constraints.  It:
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/ntpd/ntpd.man.in /cur/src/external/bsd/ntp/dist/ntpd/ntpd.man.in
--- external/bsd/ntp/dist/ntpd/ntpd.man.in	2014-12-19 12:37:40.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/ntpd/ntpd.man.in	2015-04-07 19:51:17.000000000 -0700
@@ -10,11 +10,11 @@
 .ds B-Font B
 .ds I-Font I
 .ds R-Font R
-.TH ntpd @NTPD_MS@ "19 Dec 2014" "4.2.8" "User Commands"
+.TH ntpd @NTPD_MS@ "07 Apr 2015" "4.2.8p2" "User Commands"
 .\"
-.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-WBaqpd/ag-9Baiod)
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-TQays3/ag-5Qaqr3)
 .\"
-.\" It has been AutoGen-ed December 19, 2014 at 07:48:58 AM by AutoGen 5.18.5pre4
+.\" It has been AutoGen-ed April 7, 2015 at 04:25:45 AM by AutoGen 5.18.5pre4
 .\" From the definitions ntpd-opts.def
 .\" and the template file agman-cmd.tpl
 .SH NAME
@@ -175,7 +175,7 @@
 by default.
 This is the same operation as the
 \fBdriftfile\fP \fIdriftfile\fP
-configuration specification in the 
+configuration specification in the
 \fI/etc/ntp.conf\fP
 file.
 .TP
@@ -196,6 +196,20 @@
 \fBtinker\fP
 configuration file directive for other options.
 .TP
+.NOP \f\*[B-Font]\-G\f[], \f\*[B-Font]\-\-force\-step\-once\f[]
+Step any initial offset correction..
+.sp
+Normally,
+\fBntpd\fP
+steps the time if the time offset exceeds the step threshold,
+which is 128 ms by default, and otherwise slews the time.
+This option forces the initial offset correction to be stepped,
+so the highest time accuracy can be achieved quickly.
+However, this may also cause the time to be stepped back
+so this option must not be used if
+applications requiring monotonic time are running.
+See the \fBtinker\fP configuration file directive for other options.
+.TP
 .NOP \f\*[B-Font]\-i\f[] \f\*[I-Font]string\f[], \f\*[B-Font]\-\-jaildir\f[]=\f\*[I-Font]string\f[]
 Jail directory.
 .sp
@@ -220,7 +234,7 @@
 given interface name.  This option may appear multiple times.  This option
 also implies not opening other addresses, except wildcard and localhost.
 This option is deprecated. Please consider using the configuration file
-\fBinterface\fP command, which is more versatile. 
+\fBinterface\fP command, which is more versatile.
 .TP
 .NOP \f\*[B-Font]\-k\f[] \f\*[I-Font]string\f[], \f\*[B-Font]\-\-keyfile\f[]=\f\*[I-Font]string\f[]
 path to symmetric keys.
@@ -959,9 +973,9 @@
 .PP
 
 .SH "AUTHORS"
-The University of Delaware
+The University of Delaware and Network Time Foundation
 .SH "COPYRIGHT"
-Copyright (C) 1970-2014 The University of Delaware all rights reserved.
+Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation all rights reserved.
 This program is released under the terms of the NTP license, <http://ntp.org/license>.
 .SH BUGS
 The
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/ntpd/ntpd.mdoc.in /cur/src/external/bsd/ntp/dist/ntpd/ntpd.mdoc.in
--- external/bsd/ntp/dist/ntpd/ntpd.mdoc.in	2014-12-19 12:37:41.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/ntpd/ntpd.mdoc.in	2015-04-07 19:51:17.000000000 -0700
@@ -1,9 +1,9 @@
-.Dd December 19 2014
+.Dd April 7 2015
 .Dt NTPD @NTPD_MS@ User Commands
 .Os
 .\"  EDIT THIS FILE WITH CAUTION  (ntpd-opts.mdoc)
 .\"
-.\"  It has been AutoGen-ed  December 19, 2014 at 07:49:14 AM by AutoGen 5.18.5pre4
+.\"  It has been AutoGen-ed  April  7, 2015 at 04:26:02 AM by AutoGen 5.18.5pre4
 .\"  From the definitions    ntpd-opts.def
 .\"  and the template file   agmdoc-cmd.tpl
 .Sh NAME
@@ -144,7 +144,7 @@
 by default.
 This is the same operation as the
 \fBdriftfile\fP \fIdriftfile\fP
-configuration specification in the 
+configuration specification in the
 \fI/etc/ntp.conf\fP
 file.
 .It  Fl g , Fl \-panicgate 
@@ -163,6 +163,19 @@
 See the
 \fBtinker\fP
 configuration file directive for other options.
+.It  Fl G , Fl \-force\-step\-once 
+Step any initial offset correction..
+.sp
+Normally,
+\fBntpd\fP
+steps the time if the time offset exceeds the step threshold,
+which is 128 ms by default, and otherwise slews the time.
+This option forces the initial offset correction to be stepped,
+so the highest time accuracy can be achieved quickly.
+However, this may also cause the time to be stepped back
+so this option must not be used if
+applications requiring monotonic time are running.
+See the \fBtinker\fP configuration file directive for other options.
 .It  Fl i Ar string , Fl \-jaildir Ns = Ns Ar string 
 Jail directory.
 .sp
@@ -186,7 +199,7 @@
 given interface name.  This option may appear multiple times.  This option
 also implies not opening other addresses, except wildcard and localhost.
 This option is deprecated. Please consider using the configuration file
-\fBinterface\fP command, which is more versatile. 
+\fBinterface\fP command, which is more versatile.
 .It  Fl k Ar string , Fl \-keyfile Ns = Ns Ar string 
 path to symmetric keys.
 .sp
@@ -867,9 +880,9 @@
 .%O RFC5908
 .Re
 .Sh "AUTHORS"
-The University of Delaware
+The University of Delaware and Network Time Foundation
 .Sh "COPYRIGHT"
-Copyright (C) 1970\-2014 The University of Delaware all rights reserved.
+Copyright (C) 1992\-2015 The University of Delaware and Network Time Foundation all rights reserved.
 This program is released under the terms of the NTP license, <http://ntp.org/license>.
 .Sh BUGS
 The
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/ntpd/ntpdbase-opts.def /cur/src/external/bsd/ntp/dist/ntpd/ntpdbase-opts.def
--- external/bsd/ntp/dist/ntpd/ntpdbase-opts.def	2014-12-19 12:37:39.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/ntpd/ntpdbase-opts.def	2015-04-07 19:51:17.000000000 -0700
@@ -87,7 +87,7 @@
 	by default.
 	This is the same operation as the
 	@code{driftfile} @kbd{driftfile}
-	configuration specification in the 
+	configuration specification in the
 	@file{/etc/ntp.conf}
 	file.
 	_EndOfDoc_;
@@ -115,6 +115,24 @@
 };
 
 flag = {
+    name      = force_step_once;
+    value     = G;
+    descrip   = "Step any initial offset correction.";
+    doc = <<-  _EndOfDoc_
+	Normally,
+	@code{ntpd}
+	steps the time if the time offset exceeds the step threshold,
+	which is 128 ms by default, and otherwise slews the time.
+	This option forces the initial offset correction to be stepped,
+	so the highest time accuracy can be achieved quickly.
+	However, this may also cause the time to be stepped back
+	so this option must not be used if
+	applications requiring monotonic time are running.
+	See the @code{tinker} configuration file directive for other options.
+	_EndOfDoc_;
+};
+
+flag = {
     ifdef     = HAVE_DROPROOT;
     name      = jaildir;
     value     = i;
@@ -150,7 +168,7 @@
 	given interface name.  This option may appear multiple times.  This option
 	also implies not opening other addresses, except wildcard and localhost.
 	This option is deprecated. Please consider using the configuration file
-	@code{interface} command, which is more versatile. 
+	@code{interface} command, which is more versatile.
 	_EndOfDoc_;
 };
 
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/ntpd/refclock_gpsdjson.c /cur/src/external/bsd/ntp/dist/ntpd/refclock_gpsdjson.c
--- external/bsd/ntp/dist/ntpd/refclock_gpsdjson.c	2014-12-24 18:28:10.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/ntpd/refclock_gpsdjson.c	2015-04-07 19:51:17.000000000 -0700
@@ -54,7 +54,7 @@
 
 #if defined(HAVE_SYS_POLL_H)
 # include <sys/poll.h>
-#elif defined(HAVE_SYS_SLECET_H)
+#elif defined(HAVE_SYS_SELECT_H)
 # include <sys/select.h>
 #else
 # error need poll() or select()
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/ntpd/refclock_nmea.c /cur/src/external/bsd/ntp/dist/ntpd/refclock_nmea.c
--- external/bsd/ntp/dist/ntpd/refclock_nmea.c	2014-12-24 18:28:10.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/ntpd/refclock_nmea.c	2015-04-07 19:51:17.000000000 -0700
@@ -31,7 +31,9 @@
 #include <sys/stat.h>
 #include <stdio.h>
 #include <ctype.h>
+#ifdef HAVE_SYS_SOCKET_H
 #include <sys/socket.h>
+#endif
 
 #include "ntpd.h"
 #include "ntp_io.h"
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/ntpd/refclock_palisade.c /cur/src/external/bsd/ntp/dist/ntpd/refclock_palisade.c
--- external/bsd/ntp/dist/ntpd/refclock_palisade.c	2014-12-24 18:28:10.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/ntpd/refclock_palisade.c	2015-04-07 19:51:17.000000000 -0700
@@ -586,7 +586,10 @@
 				break;
 			}
 
-			if (up->leap_status & PALISADE_LEAP_PENDING) {
+			up->month = mb(15);
+			if ( (up->leap_status & PALISADE_LEAP_PENDING) &&
+			/* Avoid early announce: https://bugs.ntp.org/2773 */
+				(6 == up->month || 12 == up->month) ) {
 				if (up->leap_status & PALISADE_UTC_TIME)  
 					pp->leap = LEAP_ADDSECOND;
 				else
@@ -617,6 +620,7 @@
 			pp->hour = mb(11);
 			pp->minute = mb(12);
 			pp->second = mb(13);
+			up->month = mb(14);  /* Save for LEAP check */
 
 #ifdef DEBUG
 			if (debug > 1)
@@ -647,7 +651,9 @@
 				printf("TSIP_decode: unit %d\n", up->unit);
 			}
 #endif
-			if (getint((u_char *) &mb(10)) & 0x80) 
+			if ( (getint((u_char *) &mb(10)) & 0x80) &&
+			/* Avoid early announce: https://bugs.ntp.org/2773 */
+			    (6 == up->month || 12 == up->month) )
 				pp->leap = LEAP_ADDSECOND;  /* we ASSUME addsecond */
 			else 
 				pp->leap = LEAP_NOWARNING;
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/ntpd/refclock_palisade.h /cur/src/external/bsd/ntp/dist/ntpd/refclock_palisade.h
--- external/bsd/ntp/dist/ntpd/refclock_palisade.h	2014-12-24 18:28:10.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/ntpd/refclock_palisade.h	2015-04-07 19:51:17.000000000 -0700
@@ -171,6 +171,7 @@
 	short 		rpt_cnt;	/* TSIP packet length so far */
 	char 		rpt_buf[BMAX]; 	/* packet assembly buffer */
 	int		type;		/* Clock mode type */
+	int		month;		/* for LEAP filter */
 };
 
 /*
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/ntpd/refclock_parse.c /cur/src/external/bsd/ntp/dist/ntpd/refclock_parse.c
--- external/bsd/ntp/dist/ntpd/refclock_parse.c	2014-12-24 18:28:10.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/ntpd/refclock_parse.c	2015-04-07 19:51:17.000000000 -0700
@@ -18,7 +18,7 @@
  *   SunOS 4.x and SunOS5.x.
  *
  * Copyright (c) 1995-2009 by Frank Kardel <kardel <AT> ntp.org>
- * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universität Erlangen-Nürnberg, Germany
+ * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universitaet Erlangen-Nuernberg, Germany
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -56,36 +56,36 @@
 
 /*
  * This driver currently provides the support for
- *   - Meinberg receiver DCF77 PZF 535 (TCXO version)       (DCF)
- *   - Meinberg receiver DCF77 PZF 535 (OCXO version)       (DCF)
- *   - Meinberg receiver DCF77 PZF 509                      (DCF)
+ *   - Meinberg receiver DCF77 PZF535 (TCXO version)        (DCF)
+ *   - Meinberg receiver DCF77 PZF535 (OCXO version)        (DCF)
+ *   - Meinberg receiver DCF77 PZF509                       (DCF)
  *   - Meinberg receiver DCF77 AM receivers (e.g. C51)      (DCF)
  *   - IGEL CLOCK                                           (DCF)
  *   - ELV DCF7000                                          (DCF)
  *   - Schmid clock                                         (DCF)
  *   - Conrad DCF77 receiver module                         (DCF)
  *   - FAU DCF77 NTP receiver (TimeBrick)                   (DCF)
- *   - WHARTON 400A Series clock			    (DCF)
+ *   - WHARTON 400A Series clock                            (DCF)
  *
- *   - Meinberg GPS166/GPS167                               (GPS)
+ *   - Meinberg GPS receivers                               (GPS)
  *   - Trimble (TSIP and TAIP protocol)                     (GPS)
  *
  *   - RCC8000 MSF Receiver                                 (MSF)
- *   - VARITEXT clock					    (MSF)
+ *   - VARITEXT clock                                       (MSF)
  */
 
 /*
  * Meinberg receivers are usually connected via a
- * 9600 baud serial line
+ * 9600/7E1 or 19200/8N1 serial line.
  *
  * The Meinberg GPS receivers also have a special NTP time stamp
  * format. The firmware release is Uni-Erlangen.
  *
  * Meinberg generic receiver setup:
- *	output time code every second
- *	Baud rate 9600 7E2S
+ *      output time code every second
+ *      Baud rate 9600 7E2S
  *
- * Meinberg GPS16x setup:
+ * Meinberg GPS receiver setup:
  *      output time code every second
  *      Baudrate 19200 8N1
  *
@@ -93,7 +93,9 @@
  * in Meinberg receivers.
  *
  * Special software versions are only sensible for the
- * GPS 16x family of receivers.
+ * oldest GPS receiver, GPS16x. For newer receiver types
+ * the output string format can be configured at the device,
+ * and the device name is generally GPSxxx instead of GPS16x.
  *
  * Meinberg can be reached via: http://www.meinberg.de/
  */
@@ -158,13 +160,13 @@
 # endif
 #endif
 
-#define BUFFER_SIZE(_BUF, _PTR) ((_BUF) + sizeof(_BUF) - (_PTR))
-#define BUFFER_SIZES(_BUF, _PTR, _SZ) ((_BUF) + (_SZ) - (_PTR))
+# define BUFFER_SIZE(_BUF, _PTR)       ((int)((_BUF) + sizeof(_BUF) - (_PTR)))
+# define BUFFER_SIZES(_BUF, _PTR, _SZ) ((int)((_BUF) + (_SZ) - (_PTR)))
 
 /*
  * document type of PPS interfacing - copy of ifdef mechanism in local_input()
  */
-#undef PPS_METHOD 
+#undef PPS_METHOD
 
 #ifdef HAVE_PPSAPI
 #define PPS_METHOD "PPS API"
@@ -183,6 +185,18 @@
 #endif /* TIOCDCDTIMESTAMP */
 #endif /* HAVE_PPSAPI */
 
+/*
+ * COND_DEF can be conditionally defined as DEF or 0. If defined as DEF
+ * then some more parse-specific variables are flagged to be printed with
+ * "ntpq -c cv <assid>". This can be lengthy, so by default COND_DEF
+ * should be defined as 0.
+ */
+#if 0
+# define COND_DEF   DEF   // enable this for testing
+#else
+# define COND_DEF   0     // enable this by default
+#endif
+
 #include "ntp_io.h"
 #include "ntp_stdlib.h"
 
@@ -384,7 +398,7 @@
 	 * PARSE io
 	 */
 	bind_t	     *binding;	        /* io handling binding */
-	
+
 	/*
 	 * parse state
 	 */
@@ -452,23 +466,23 @@
 #define DCF_P_ID	"DCFp"	/* psuedo random phase shift */
 #define GPS_ID		"GPS"	/* GPS receiver */
 
-#define	NOCLOCK_ROOTDELAY	0.0
-#define	NOCLOCK_BASEDELAY	0.0
-#define	NOCLOCK_DESCRIPTION	0
+#define NOCLOCK_ROOTDELAY       0.0
+#define NOCLOCK_BASEDELAY       0.0
+#define NOCLOCK_DESCRIPTION     0
 #define NOCLOCK_MAXUNSYNC       0
 #define NOCLOCK_CFLAG           0
 #define NOCLOCK_IFLAG           0
 #define NOCLOCK_OFLAG           0
 #define NOCLOCK_LFLAG           0
-#define NOCLOCK_ID		"TILT"
-#define NOCLOCK_POLL		NO_POLL
-#define NOCLOCK_INIT		NO_INIT
-#define NOCLOCK_END		NO_END
-#define NOCLOCK_DATA		NO_LCLDATA
-#define NOCLOCK_FORMAT		""
-#define NOCLOCK_TYPE		CTL_SST_TS_UNSPEC
-#define NOCLOCK_SAMPLES		0
-#define NOCLOCK_KEEP		0 
+#define NOCLOCK_ID              "TILT"
+#define NOCLOCK_POLL            NO_POLL
+#define NOCLOCK_INIT            NO_INIT
+#define NOCLOCK_END             NO_END
+#define NOCLOCK_DATA            NO_LCLDATA
+#define NOCLOCK_FORMAT          ""
+#define NOCLOCK_TYPE            CTL_SST_TS_UNSPEC
+#define NOCLOCK_SAMPLES         0
+#define NOCLOCK_KEEP            0
 
 #define DCF_TYPE		CTL_SST_TS_LF
 #define GPS_TYPE		CTL_SST_TS_UHF
@@ -538,14 +552,14 @@
 #define DCFPZF535OCXO_FORMAT	    "Meinberg Standard"
 
 /*
- * Meinberg GPS16X receiver
+ * Meinberg GPS receivers
  */
 static	void	gps16x_message	 (struct parseunit *, parsetime_t *);
 static  int     gps16x_poll_init (struct parseunit *);
 
 #define	GPS16X_ROOTDELAY	0.0         /* nothing here */
 #define	GPS16X_BASEDELAY	0.001968         /* XXX to be fixed ! 1.968ms +- 104us (oscilloscope) - relative to start (end of STX) */
-#define	GPS16X_DESCRIPTION      "Meinberg GPS16x receiver"
+#define	GPS16X_DESCRIPTION      "Meinberg GPS receiver"
 #define GPS16X_MAXUNSYNC        60*60*96       /* only trust clock for 4 days
 						* @ 5e-9df/f we have accumulated
 						* at most an error of 1.73 ms
@@ -747,9 +761,9 @@
 #define TRIMBLETAIP_INIT	    trimbletaip_init
 #define TRIMBLETSIP_INIT	    trimbletsip_init
 
-#define TRIMBLETAIP_EVENT	    trimbletaip_event   
+#define TRIMBLETAIP_EVENT	    trimbletaip_event
 
-#define TRIMBLETSIP_EVENT	    trimbletsip_event   
+#define TRIMBLETSIP_EVENT	    trimbletsip_event
 #define TRIMBLETSIP_MESSAGE	    trimbletsip_message
 
 #define TRIMBLETAIP_END		    0
@@ -806,7 +820,7 @@
 #define RCC8000_KEEP	        3
 
 /*
- * Hopf Radio clock 6021 Format 
+ * Hopf Radio clock 6021 Format
  *
  */
 #define HOPF6021_ROOTDELAY	0.0
@@ -1202,7 +1216,7 @@
 	},
 	{                             /* mode 12 */
 		HOPF6021_FLAGS,
-		NO_POLL,     
+		NO_POLL,
 		NO_INIT,
 		NO_EVENT,
 		NO_END,
@@ -1578,7 +1592,7 @@
 
 	if (do_it)
 	    err->err_cnt++;
-  
+
 	if (err->err_stage->err_count &&
 	    (err->err_cnt >= err->err_stage->err_count))
 	{
@@ -1602,7 +1616,7 @@
 			l_mktime(current_time - err->err_started));
 		err->err_suppressed = 0;
 	}
-  
+
 	return do_it;
 }
 
@@ -1717,7 +1731,7 @@
 static int  stream_timecode (struct parseunit *, parsectl_t *);
 static void stream_receive  (struct recvbuf *);
 #endif
-					 
+
 static int  local_init     (struct parseunit *);
 static void local_end      (struct parseunit *);
 static int  local_nop      (struct parseunit *);
@@ -1798,7 +1812,7 @@
 {
         static char m1[] = "ppsclocd";
 	static char m2[] = "ppsclock";
-	
+
 	/*
 	 * now push the parse streams module
 	 * it will ensure exclusive access to the device
@@ -1887,7 +1901,7 @@
 	)
 {
 	struct strioctl strioc;
-  
+
 	strioc.ic_cmd     = PARSEIOC_SETCS;
 	strioc.ic_timout  = 0;
 	strioc.ic_dp      = (char *)tcl;
@@ -1910,7 +1924,7 @@
 	)
 {
 	struct strioctl strioc;
-  
+
 	strioc.ic_cmd     = PARSEIOC_ENABLE;
 	strioc.ic_timout  = 0;
 	strioc.ic_dp      = (char *)0;
@@ -1934,7 +1948,7 @@
 	)
 {
 	struct strioctl strioc;
-  
+
 	strioc.ic_cmd     = PARSEIOC_DISABLE;
 	strioc.ic_timout  = 0;
 	strioc.ic_dp      = (char *)0;
@@ -1959,7 +1973,7 @@
 	)
 {
 	struct strioctl strioc;
-  
+
 	strioc.ic_cmd     = PARSEIOC_GETFMT;
 	strioc.ic_timout  = 0;
 	strioc.ic_dp      = (char *)tcl;
@@ -1982,7 +1996,7 @@
 	)
 {
 	struct strioctl strioc;
-  
+
 	strioc.ic_cmd     = PARSEIOC_SETFMT;
 	strioc.ic_timout  = 0;
 	strioc.ic_dp      = (char *)tcl;
@@ -2007,12 +2021,12 @@
 	)
 {
 	struct strioctl strioc;
-  
+
 	strioc.ic_cmd     = PARSEIOC_TIMECODE;
 	strioc.ic_timout  = 0;
 	strioc.ic_dp      = (char *)tcl;
 	strioc.ic_len     = sizeof (*tcl);
-	
+
 	if (ioctl(parse->generic->io.fd, I_STR, (caddr_t)&strioc) == -1)
 	{
 		ERR(ERR_INTERNAL)
@@ -2047,7 +2061,7 @@
 		return;
 	}
 	clear_err(parse, ERR_BADIO);
-  
+
 	memmove((caddr_t)&parsetime,
 		(caddr_t)rbufp->recv_buffer,
 		sizeof(parsetime_t));
@@ -2213,7 +2227,7 @@
 				{
 					struct timespec pps_timeout;
 					pps_info_t      pps_info;
-				
+
 					pps_timeout.tv_sec  = 0;
 					pps_timeout.tv_nsec = 0;
 
@@ -2234,9 +2248,9 @@
 							else
 							  pts = pps_info.assert_timestamp;
 
-							parse->parseio.parse_dtime.parse_ptime.fp.l_ui = pts.tv_sec + JAN_1970;
+							parse->parseio.parse_dtime.parse_ptime.fp.l_ui = (uint32_t) (pts.tv_sec + JAN_1970);
 
-							dtemp = pts.tv_nsec / 1e9;
+							dtemp = (double) pts.tv_nsec / 1e9;
 							if (dtemp < 0.) {
 								dtemp += 1;
 								parse->parseio.parse_dtime.parse_ptime.fp.l_ui--;
@@ -2245,9 +2259,9 @@
 								dtemp -= 1;
 								parse->parseio.parse_dtime.parse_ptime.fp.l_ui++;
 							}
-							parse->parseio.parse_dtime.parse_ptime.fp.l_uf = dtemp * FRAC;
+							parse->parseio.parse_dtime.parse_ptime.fp.l_uf = (uint32_t)(dtemp * FRAC);
 
-						        parse->parseio.parse_dtime.parse_state |= PARSEB_PPS|PARSEB_S_PPS;
+							parse->parseio.parse_dtime.parse_state |= PARSEB_PPS|PARSEB_S_PPS;
 #ifdef DEBUG
 							if (debug > 3)
 							{
@@ -2289,11 +2303,11 @@
 #else
 #ifdef TIOCDCDTIMESTAMP
 				struct timeval dcd_time;
-				
+
 				if (ioctl(parse->ppsfd, TIOCDCDTIMESTAMP, &dcd_time) != -1)
 				{
 					l_fp tstmp;
-					
+
 					TVTOTS(&dcd_time, &tstmp);
 					tstmp.l_ui += JAN_1970;
 					L_SUB(&ts.fp, &tstmp);
@@ -2415,7 +2429,7 @@
 		return;
 	}
 	clear_err(parse, ERR_BADIO);
-  
+
 	memmove((caddr_t)&parsetime,
 		(caddr_t)rbufp->recv_buffer,
 		sizeof(parsetime_t));
@@ -2464,7 +2478,7 @@
  ** support routines
  **/
 
-static __printflike(4, 5) char *
+static NTP_PRINTF(4, 5) char *
 ap(char *buffer, size_t len, char *pos, const char *fmt, ...)
 {
 	va_list va;
@@ -2513,7 +2527,7 @@
 		  { PARSEB_LEAPADD,    "LEAP ADD WARNING" },
 		  { PARSEB_LEAPDEL,    "LEAP DELETE WARNING" },
 		  { PARSEB_LEAPSECOND, "LEAP SECOND" },
-		  { PARSEB_ALTERNATE,  "ALTERNATE ANTENNA" },
+		  { PARSEB_CALLBIT,    "CALL BIT" },
 		  { PARSEB_TIMECODE,   "TIME CODE" },
 		  { PARSEB_PPS,        "PPS" },
 		  { PARSEB_POSITION,   "POSITION" },
@@ -2535,6 +2549,7 @@
 	int i;
 	char *s, *t;
 
+	*buffer = '\0';
 	s = t = buffer;
 
 	i = 0;
@@ -2567,7 +2582,7 @@
 				{
 					t = ap(buffer, size, t, "; ");
 				}
-	
+
 				t = ap(buffer, size, t, "%s",
 				    sflagstrings[i].name);
 			}
@@ -2614,7 +2629,7 @@
 	{
 		if (flagstrings[i].bit & lstate)
 		{
-			if (t == buffer)
+			if (t != buffer)
 				t = ap(buffer, size, t, "; ");
 			t = ap(buffer, size, t, "%s", flagstrings[i].name);
 		}
@@ -2809,7 +2824,7 @@
 	{
 		parse->parse_type->cl_end(parse);
 	}
-	
+
 	/*
 	 * cleanup before leaving this world
 	 */
@@ -2822,7 +2837,7 @@
 	io_closeclock(&parse->generic->io);
 
 	free_varlist(parse->kv);
-  
+
 	NLOG(NLOG_CLOCKINFO) /* conditional if clause for conditional syslog */
 		msyslog(LOG_INFO, "PARSE receiver #%d: reference clock \"%s\" removed",
 			CLK_UNIT(parse->peer), parse->parse_type->cl_description);
@@ -2848,14 +2863,14 @@
 	if (CLK_PPS(parse->peer) && (parse->flags & PARSE_PPSKERNEL)) {
 		int	i = 0;
 
-		if (mode == PARSE_HARDPPS_ENABLE) 
+		if (mode == PARSE_HARDPPS_ENABLE)
 		        {
 			        if (parse->flags & PARSE_CLEAR)
 				        i = PPS_CAPTURECLEAR;
 				else
 				        i = PPS_CAPTUREASSERT;
 			}
-		
+
 		if (time_pps_kcbind(parse->atom.handle, PPS_KC_HARDPPS, i,
 		    PPS_TSFMT_TSPEC) < 0) {
 		        msyslog(LOG_ERR, "PARSE receiver #%d: time_pps_kcbind failed: %m",
@@ -2885,8 +2900,8 @@
 {
 	int cap, mode_ppsoffset;
 	const char *cp;
-	
-	parse->flags &= ~PARSE_PPSCLOCK;
+
+	parse->flags &= (u_char) (~PARSE_PPSCLOCK);
 
 	/*
 	 * collect PPSAPI offset capability - should move into generic handling
@@ -2894,7 +2909,7 @@
 	if (time_pps_getcap(parse->atom.handle, &cap) < 0) {
 		msyslog(LOG_ERR, "PARSE receiver #%d: parse_ppsapi: time_pps_getcap failed: %m",
 			CLK_UNIT(parse->peer));
-		
+
 		return 0;
 	}
 
@@ -2928,19 +2943,19 @@
 		  CLK_UNIT(parse->peer), cp, cap);
 		mode_ppsoffset = 0;
 	} else {
-	        if (mode_ppsoffset == PPS_OFFSETCLEAR) 
-		        {
-			        parse->atom.pps_params.clear_offset.tv_sec = -parse->ppsphaseadjust;
-			        parse->atom.pps_params.clear_offset.tv_nsec = -1e9*(parse->ppsphaseadjust - (long)parse->ppsphaseadjust);
+		if (mode_ppsoffset == PPS_OFFSETCLEAR)
+			{
+				parse->atom.pps_params.clear_offset.tv_sec = (time_t)(-parse->ppsphaseadjust);
+				parse->atom.pps_params.clear_offset.tv_nsec = (long)(-1e9*(parse->ppsphaseadjust - (double)(long)parse->ppsphaseadjust));
 			}
-	  
+
 		if (mode_ppsoffset == PPS_OFFSETASSERT)
-	                {
-		                parse->atom.pps_params.assert_offset.tv_sec = -parse->ppsphaseadjust;
-				parse->atom.pps_params.assert_offset.tv_nsec = -1e9*(parse->ppsphaseadjust - (long)parse->ppsphaseadjust);
+			{
+				parse->atom.pps_params.assert_offset.tv_sec = (time_t)(-parse->ppsphaseadjust);
+				parse->atom.pps_params.assert_offset.tv_nsec = (long)(-1e9*(parse->ppsphaseadjust - (double)(long)parse->ppsphaseadjust));
 			}
 	}
-	
+
 	parse->atom.pps_params.mode |= mode_ppsoffset;
 
 	if (time_pps_setparams(parse->atom.handle, &parse->atom.pps_params) < 0) {
@@ -3044,9 +3059,9 @@
 	parse->kv             = (struct ctl_var *)0;
 
 	clear_err(parse, ERR_ALL);
-  
+
 	parse->parse_type     = &parse_clockinfo[type];
-	
+
 	parse->maxunsync      = parse->parse_type->cl_maxunsync;
 
 	parse->generic->fudgetime1 = parse->parse_type->cl_basedelay;
@@ -3059,16 +3074,16 @@
 	peer->rootdelay       = parse->parse_type->cl_rootdelay;
 	peer->sstclktype      = parse->parse_type->cl_type;
 	peer->precision       = sys_precision;
-	
+
 	peer->stratum         = STRATUM_REFCLOCK;
 
 	if (peer->stratum <= 1)
 	    memmove((char *)&parse->generic->refid, parse->parse_type->cl_id, 4);
 	else
 	    parse->generic->refid = htonl(PARSEHSREFID);
-	
+
 	parse->generic->io.fd = fd232;
-	
+
 	parse->peer = peer;		/* marks it also as busy */
 
 	/*
@@ -3111,15 +3126,15 @@
 		}
 #endif
 
-		tio.c_cflag = parse_clockinfo[type].cl_cflag;
-		tio.c_iflag = parse_clockinfo[type].cl_iflag;
-		tio.c_oflag = parse_clockinfo[type].cl_oflag;
-		tio.c_lflag = parse_clockinfo[type].cl_lflag;
-	
+		tio.c_cflag = (tcflag_t) parse_clockinfo[type].cl_cflag;
+		tio.c_iflag = (tcflag_t) parse_clockinfo[type].cl_iflag;
+		tio.c_oflag = (tcflag_t) parse_clockinfo[type].cl_oflag;
+		tio.c_lflag = (tcflag_t) parse_clockinfo[type].cl_lflag;
+
 
 #ifdef HAVE_TERMIOS
-		if ((cfsetospeed(&tio, parse_clockinfo[type].cl_speed) == -1) ||
-		    (cfsetispeed(&tio, parse_clockinfo[type].cl_speed) == -1))
+		if ((cfsetospeed(&tio, (speed_t) parse_clockinfo[type].cl_speed) == -1) ||
+		    (cfsetispeed(&tio, (speed_t) parse_clockinfo[type].cl_speed) == -1))
 		{
 			msyslog(LOG_ERR, "PARSE receiver #%d: parse_start: tcset{i,o}speed(&tio, speed): %m", unit);
 			parse_shutdown(CLK_UNIT(parse->peer), peer); /* let our cleaning staff do the work */
@@ -3179,7 +3194,7 @@
 		if (CLK_PPS(parse->peer))
 		    {
 			int i = 1;
-		    
+
 			if (ioctl(parse->ppsfd, TIOCSPPS, (caddr_t)&i) == 0)
 			    {
 				parse->flags |= PARSE_PPSCLOCK;
@@ -3218,7 +3233,7 @@
 	 */
 	parse->generic->io.srcclock = peer;
 	parse->generic->io.datalen = 0;
-	
+
 	parse->binding = init_iobinding(parse);
 
 	if (parse->binding == (bind_t *)0)
@@ -3264,9 +3279,9 @@
 		parse_shutdown(CLK_UNIT(parse->peer), peer); /* let our cleaning staff do the work */
 		return 0;			/* well, ok - special initialisation broke */
 	}
-  
+
 	strlcpy(tmp_ctl.parseformat.parse_buffer, parse->parse_type->cl_format, sizeof(tmp_ctl.parseformat.parse_buffer));
-	tmp_ctl.parseformat.parse_count = strlen(tmp_ctl.parseformat.parse_buffer);
+	tmp_ctl.parseformat.parse_count = (u_short) strlen(tmp_ctl.parseformat.parse_buffer);
 
 	if (!PARSE_SETFMT(parse, &tmp_ctl))
 	{
@@ -3274,7 +3289,7 @@
 		parse_shutdown(CLK_UNIT(parse->peer), peer); /* let our cleaning staff do the work */
 		return 0;			/* well, ok - special initialisation broke */
 	}
-  
+
 	/*
 	 * get rid of all IO accumulated so far
 	 */
@@ -3301,7 +3316,7 @@
 					return 0;		/* well, ok - special initialisation broke */
 				}
 		}
-	
+
 	/*
 	 * Insert in async io device list.
 	 */
@@ -3366,8 +3381,8 @@
 	{
 		if (in->haveflags & (CLK_HAVEFLAG1|CLK_HAVEFLAG2|CLK_HAVEFLAG3|CLK_HAVEFLAG4))
 		{
-		  parse->flags = (parse->flags & ~(CLK_FLAG1|CLK_FLAG2|CLK_FLAG3|CLK_FLAG4)) |
-		    (in->flags & (CLK_FLAG1|CLK_FLAG2|CLK_FLAG3|CLK_FLAG4));
+		  u_char mask = CLK_FLAG1|CLK_FLAG2|CLK_FLAG3|CLK_FLAG4;
+		  parse->flags = (parse->flags & (u_char)(~mask)) | (in->flags & mask);
 #if defined(HAVE_PPSAPI)
 		  if (CLK_PPS(parse->peer))
 		    {
@@ -3375,7 +3390,7 @@
 		    }
 #endif
 		}
-		
+
 		if (in->haveflags & CLK_HAVETIME1)
                 {
 		  parse->generic->fudgetime1 = in->fudgetime1;
@@ -3383,11 +3398,11 @@
 			  CLK_UNIT(parse->peer),
 			  parse->generic->fudgetime1);
 		}
-		
+
 		if (in->haveflags & CLK_HAVETIME2)
                 {
 		  parse->generic->fudgetime2 = in->fudgetime2;
-		  if (parse->flags & PARSE_TRUSTTIME) 
+		  if (parse->flags & PARSE_TRUSTTIME)
 		    {
 		      parse->maxunsync = (u_long)ABS(in->fudgetime2);
 		      msyslog(LOG_INFO, "PARSE receiver #%d: new trust time %s",
@@ -3435,7 +3450,7 @@
 	 */
 	parse->generic->polls++;
 
-	if (parse->pollneeddata && 
+	if (parse->pollneeddata &&
 	    ((int)(current_time - parse->pollneeddata) > (1<<(max(min(parse->peer->hpoll, parse->peer->ppoll), parse->peer->minpoll)))))
 	{
 		/*
@@ -3444,7 +3459,7 @@
 		 */
 		parse->lastmissed = current_time;
 		parse_event(parse, CEVNT_TIMEOUT);
-		
+
 		ERR(ERR_NODATA)
 			msyslog(LOG_WARNING, "PARSE receiver #%d: no data from device within poll interval (check receiver / wiring)", CLK_UNIT(parse->peer));
 	}
@@ -3502,7 +3517,7 @@
 	 * handle changes
 	 */
 	parse_ctl(parse, in);
-		
+
 	/*
 	 * supply data
 	 */
@@ -3588,9 +3603,9 @@
 				    tmpctl.parsegettc.parse_buffer, (unsigned)(tmpctl.parsegettc.parse_count));
 
 		}
-	
+
 		tmpctl.parseformat.parse_format = tmpctl.parsegettc.parse_format;
-	
+
 		if (!PARSE_GETFMT(parse, &tmpctl))
 		{
 			ERR(ERR_INTERNAL)
@@ -3604,7 +3619,7 @@
 			tt = ap(start, 80, tt, "refclock_format=\"");
 
 			if (count > 0) {
-				tt = ap(start, 80, tt, "%*.*s", 
+				tt = ap(start, 80, tt, "%*.*s",
 			        	count,
 			        	count,
 			        	tmpctl.parseformat.parse_buffer);
@@ -3633,7 +3648,7 @@
 				percent /= 10;
 				d       /= 10;
 			}
-	
+
 			if (d)
 			    percent = (percent * 10000) / d;
 			else
@@ -3643,14 +3658,14 @@
 			{
 				char item[80];
 				int count;
-				
+
 				snprintf(item, 80, "%s%s%s: %s (%d.%02d%%)",
 					sum ? "; " : "",
 					(parse->generic->currentstatus == i) ? "*" : "",
 					clockstatus((unsigned int)i),
 					l_mktime(s_time),
 					(int)(percent / 100), (int)(percent % 100));
-				if ((count = strlen(item)) < (LEN_STATES - 40 - (tt - start)))
+				if ((count = (int) strlen(item)) < (LEN_STATES - 40 - (tt - start)))
 					{
 						tt = ap(start, LEN_STATES, tt,
 						    "%s", item);
@@ -3658,22 +3673,22 @@
 				sum += s_time;
 			}
 		}
-		
+
 		tt = ap(start, LEN_STATES, tt,
 		    "; running time: %s\"", l_mktime(sum));
-		
+
 		tt = add_var(&out->kv_list, 32, RO);
 		snprintf(tt, 32,  "refclock_id=\"%s\"", parse->parse_type->cl_id);
-		
+
 		tt = add_var(&out->kv_list, 80, RO);
 		snprintf(tt, 80,  "refclock_iomode=\"%s\"", parse->binding->bd_description);
 
 		tt = add_var(&out->kv_list, 128, RO);
 		snprintf(tt, 128, "refclock_driver_version=\"%s\"", rcsid);
-		
+
 		{
 			struct ctl_var *k;
-			
+
 			k = parse->kv;
 			while (k && !(k->flags & EOV))
 			{
@@ -3681,8 +3696,8 @@
 				k++;
 			}
 		}
-      
-		out->lencode       = strlen(outstatus);
+
+		out->lencode       = (u_short) strlen(outstatus);
 		out->p_lastcode    = outstatus;
 	}
 }
@@ -3731,7 +3746,7 @@
 {
 	l_fp off, rectime, reftime;
 	double fudge;
-	
+
 	/* silence warning: 'off.Ul_i.Xl_i' may be used uninitialized in this function */
 	ZERO(off);
 
@@ -3744,11 +3759,11 @@
 	    (parse->timedata.parse_status != parsetime->parse_status))
 	{
 		char buffer[400];
-		
+
 		NLOG(NLOG_CLOCKINFO) /* conditional if clause for conditional syslog */
 			msyslog(LOG_WARNING, "PARSE receiver #%d: conversion status \"%s\"",
 				CLK_UNIT(parse->peer), parsestatus(parsetime->parse_status, buffer, sizeof(buffer)));
-		
+
 		if ((parsetime->parse_status & CVT_MASK) == CVT_FAIL)
 		{
 			/*
@@ -3757,7 +3772,7 @@
 			 * the time code might be overwritten by the next packet
 			 */
 			parsectl_t tmpctl;
-			
+
 			if (!PARSE_GETTIMECODE(parse, &tmpctl))
 			{
 				ERR(ERR_INTERNAL)
@@ -3795,7 +3810,7 @@
 			    parse->timedata.parse_ptime  = parsetime->parse_ptime;
 			  }
 			break; 		/* well, still waiting - timeout is handled at higher levels */
-			    
+
 		case CVT_FAIL:
 			if (parsetime->parse_status & CVT_BADFMT)
 			{
@@ -3826,7 +3841,7 @@
 	if (parse->lastformat != parsetime->parse_format)
 	{
 		parsectl_t tmpctl;
-	
+
 		tmpctl.parseformat.parse_format = parsetime->parse_format;
 
 		if (!PARSE_GETFMT(parse, &tmpctl))
@@ -3854,10 +3869,10 @@
 		/*
 		 * something happend - except for PPS events
 		 */
-	
+
 		(void) parsestate(parsetime->parse_state, tmp1, sizeof(tmp1));
 		(void) parsestate(parse->timedata.parse_state, tmp2, sizeof(tmp2));
-	
+
 		NLOG(NLOG_CLOCKINFO) /* conditional if clause for conditional syslog */
 			msyslog(LOG_INFO,"PARSE receiver #%d: STATE CHANGE: %s -> %s",
 				CLK_UNIT(parse->peer), tmp2, tmp1);
@@ -3960,12 +3975,12 @@
 	}
 
 	fudge = parse->generic->fudgetime1; /* standard RS232 Fudgefactor */
-	
+
 	if (PARSE_TIMECODE(parsetime->parse_state))
 	{
 		rectime = parsetime->parse_stime.fp;
 		off = reftime = parsetime->parse_time.fp;
-	
+
 		L_SUB(&off, &rectime); /* prepare for PPS adjustments logic */
 
 #ifdef DEBUG
@@ -4010,7 +4025,7 @@
 			    M_ISGEQ(0, 0x7fffffff, off.l_i, off.l_uf))
 			{
 				fudge = ppsphaseadjust; /* pick PPS fudge factor */
-			
+
 				/*
 				 * RS232 offsets within [-0.5..0.5[ - take PPS offsets
 				 */
@@ -4022,12 +4037,12 @@
 						reftime.l_ui++;
 					reftime.l_uf = 0;
 
-					
+
 					/*
 					 * implied on second offset
 					 */
 					off.l_uf = ~off.l_uf; /* map [0.5..1[ -> [-0.5..0[ */
-					off.l_i = (off.l_uf & 0x8000000) ? -1 : 0; /* sign extend */
+					off.l_i = (off.l_uf & 0x80000000) ? -1 : 0; /* sign extend */
 				}
 				else
 				{
@@ -4088,7 +4103,7 @@
 
 	rectime = reftime;
 	L_SUB(&rectime, &off);	/* just to keep the ntp interface happy */
-	
+
 #ifdef DEBUG
 	if (debug > 3)
 		printf("PARSE receiver #%d: calculated Reftime %s, Recvtime %s\n",
@@ -4113,14 +4128,14 @@
 	clear_err(parse, ERR_BADDATA);
 	clear_err(parse, ERR_NODATA);
 	clear_err(parse, ERR_INTERNAL);
-  
+
 	/*
 	 * and now stick it into the clock machine
 	 * samples are only valid iff lastsync is not too old and
 	 * we have seen the clock in sync at least once
 	 * after the last time we didn't see an expected data telegram
 	 * at startup being not in sync is also bad just like
-	 * POWERUP state unless PARSE_F_POWERUPTRUST is set 
+	 * POWERUP state unless PARSE_F_POWERUPTRUST is set
 	 * see the clock states section above for more reasoning
 	 */
 	if (((current_time - parse->lastsync) > parse->maxunsync)           ||
@@ -4160,9 +4175,9 @@
 		 * only good/trusted samples are interesting
 		 */
 #ifdef DEBUG
-	        if (debug > 2) 
-		        {
-			        printf("PARSE receiver #%d: refclock_process_offset(reftime=%s, rectime=%s, Fudge=%f)\n",
+	        if (debug > 2)
+			{
+				       printf("PARSE receiver #%d: refclock_process_offset(reftime=%s, rectime=%s, Fudge=%f)\n",
 				       CLK_UNIT(parse->peer),
 				       prettydate(&reftime),
 				       prettydate(&rectime),
@@ -4170,7 +4185,7 @@
 			}
 #endif
 		parse->generic->lastref = reftime;
-		
+
 		refclock_process_offset(parse->generic, reftime, rectime, fudge);
 
 #ifdef HAVE_PPSAPI
@@ -4178,31 +4193,18 @@
 		 * pass PPS information on to PPS clock
 		 */
 		if (PARSE_PPS(parsetime->parse_state) && CLK_PPS(parse->peer))
-		        {
-			  /* refclock_pps includes fudgetime1 - we keep the RS232 offset in there :-( */
-			        double savedtime1 = parse->generic->fudgetime1;
-
-				parse->generic->fudgetime1 = fudge;
-				
-				if (refclock_pps(parse->peer, &parse->atom,
-						 parse->flags & (CLK_FLAG1|CLK_FLAG2|CLK_FLAG3|CLK_FLAG4))) {
-					parse->peer->flags |= FLAG_PPS;
-				} else {
-					parse->peer->flags &= ~FLAG_PPS;
-				}
-
-				parse->generic->fudgetime1 = savedtime1;
-
+			{
+				parse->peer->flags |= (FLAG_PPS | FLAG_TSTAMP_PPS);
 				parse_hardpps(parse, PARSE_HARDPPS_ENABLE);
 			}
 #endif
 	} else {
-	        parse_hardpps(parse, PARSE_HARDPPS_DISABLE);
-		parse->peer->flags &= ~FLAG_PPS;
+		parse_hardpps(parse, PARSE_HARDPPS_DISABLE);
+		parse->peer->flags &= ~(FLAG_PPS | FLAG_TSTAMP_PPS);
 	}
 
 	/*
-	 * ready, unless the machine wants a sample or 
+	 * ready, unless the machine wants a sample or
 	 * we are in fast startup mode (peer->dist > MAXDISTANCE)
 	 */
 	if (!parse->pollneeddata && parse->peer->disp <= MAXDISTANCE)
@@ -4214,56 +4216,73 @@
 
 	refclock_receive(parse->peer);
 }
-
+
 /**===========================================================================
  ** special code for special clocks
  **/
 
 static void
 mk_utcinfo(
-	   char *t,
-	   int wnt,
-	   int wnlsf,
+	   char *t,  // pointer to the output string buffer
+	   int swnt,
+	   int swnlsf,
 	   int dn,
 	   int dtls,
 	   int dtlsf,
-	   int size
+	   int size  // size of the output string buffer
 	   )
 {
-  l_fp leapdate;
-  char *start = t;
-  
-  snprintf(t, size, "current correction %d sec", dtls);
-  t += strlen(t);
-  
-  if (wnlsf < 990)
-    wnlsf += 1024;
-  
-  if (wnt < 990)
-    wnt += 1024;
-  
-  gpstolfp((unsigned short)wnlsf, (unsigned short)dn, 0, &leapdate);
-  
-  if ((dtlsf != dtls) &&
-      ((wnlsf - wnt) < 52))
-    {
-	    snprintf(t, BUFFER_SIZES(start, t, size), ", next correction %d sec on %s, new GPS-UTC offset %d",
-	      dtlsf - dtls, gmprettydate(&leapdate), dtlsf);
-    }
-  else
-    {
-	    snprintf(t, BUFFER_SIZES(start, t, size), ", last correction on %s",
-	      gmprettydate(&leapdate));
-    }
+	unsigned int wnt = swnt;
+	unsigned int wnlsf = swnlsf;
+	/*
+	 * The week number transmitted by the GPS satellites for the leap date
+	 * is truncated to 8 bits only. If the nearest leap second date is off
+	 * the current date by more than +/- 128 weeks then conversion to a
+	 * calendar date is ambiguous. On the other hand, if a leap second is
+	 * currently being announced (i.e. dtlsf != dtls) then the week number
+	 * wnlsf is close enough, and we can unambiguously determine the date
+	 * for which the leap second is scheduled.
+	 */
+	if ( dtlsf != dtls )
+	{
+		time_t t_ls;
+		struct tm *tm;
+		int n = 0;
+
+		if (wnlsf < GPSWRAP)
+			wnlsf += GPSWEEKS;
+
+		if (wnt < GPSWRAP)
+			wnt += GPSWEEKS;
+
+		t_ls = (time_t) wnlsf * SECSPERWEEK
+			+ (time_t) dn * SECSPERDAY
+			+ GPS_SEC_BIAS - 1;
+
+		tm = gmtime( &t_ls );
+		if (tm == NULL)  // gmtime() failed
+		{
+			snprintf( t, size, "** (gmtime() failed in mk_utcinfo())" );
+			return;
+		}
+
+		n += snprintf( t, size, "UTC offset transition from %is to %is due to leap second %s",
+				dtls, dtlsf, ( dtls < dtlsf ) ? "insertion" : "deletion" );
+		n += snprintf( t + n, size - n, " at UTC midnight at the end of %s, %04i-%02i-%02i",
+				daynames[tm->tm_wday], tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday );
+	}
+	else
+		snprintf( t, size, "UTC offset parameter: %is, no leap second announced.\n", dtls );
+
 }
 
 #ifdef CLOCK_MEINBERG
 /**===========================================================================
- ** Meinberg GPS166/GPS167 support
+ ** Meinberg GPS receiver support
  **/
 
 /*------------------------------------------------------------
- * gps16x_message - process GPS16x messages
+ * gps16x_message - process messages from Meinberg GPS receiver
  */
 static void
 gps16x_message(
@@ -4275,12 +4294,12 @@
 	{
 		GPS_MSG_HDR header;
 		unsigned char *bufp = (unsigned char *)parsetime->parse_msg + 1;
-		
+
 #ifdef DEBUG
 		if (debug > 2)
 		{
 			char msgbuffer[600];
-			
+
 			mkreadable(msgbuffer, sizeof(msgbuffer), (char *)parsetime->parse_msg, parsetime->parse_msglen, 1);
 			printf("PARSE receiver #%d: received message (%d bytes) >%s<\n",
 				CLK_UNIT(parse->peer),
@@ -4289,21 +4308,21 @@
 		}
 #endif
 		get_mbg_header(&bufp, &header);
-		if (header.gps_hdr_csum == mbg_csum(parsetime->parse_msg + 1, 6) &&
-		    (header.gps_len == 0 ||
-		     (header.gps_len < sizeof(parsetime->parse_msg) &&
-		      header.gps_data_csum == mbg_csum(bufp, header.gps_len))))
+		if (header.hdr_csum == mbg_csum(parsetime->parse_msg + 1, 6) &&
+		    (header.len == 0 ||
+		     (header.len < sizeof(parsetime->parse_msg) &&
+		      header.data_csum == mbg_csum(bufp, header.len))))
 		{
 			/*
 			 * clean message
 			 */
-			switch (header.gps_cmd)
+			switch (header.cmd)
 			{
 			case GPS_SW_REV:
 				{
 					char buffer[64];
 					SW_REV gps_sw_rev;
-					
+
 					get_mbg_sw_rev(&bufp, &gps_sw_rev);
 					snprintf(buffer, sizeof(buffer), "meinberg_gps_version=\"%x.%02x%s%s\"",
 						(gps_sw_rev.code >> 8) & 0xFF,
@@ -4314,33 +4333,35 @@
 				}
 			break;
 
-			case GPS_STAT:
+			case GPS_BVAR_STAT:
 				{
 					static struct state
 					{
-						unsigned short flag; /* status flag */
-						unsigned const char *string; /* bit name */
+						BVAR_STAT flag; /* status flag */
+						const char *string; /* bit name */
 					} states[] =
 					  {
-						  { TM_ANT_DISCONN, (const unsigned char *)"ANTENNA FAULTY" },
-						  { TM_SYN_FLAG,    (const unsigned char *)"NO SYNC SIGNAL" },
-						  { TM_NO_SYNC,     (const unsigned char *)"NO SYNC POWERUP" },
-						  { TM_NO_POS,      (const unsigned char *)"NO POSITION" },
-						  { 0, (const unsigned char *)"" }
+						  { BVAR_CFGH_INVALID,     "Configuration/Health" },
+						  { BVAR_ALM_NOT_COMPLETE, "Almanachs" },
+						  { BVAR_UTC_INVALID,      "UTC Correction" },
+						  { BVAR_IONO_INVALID,     "Ionospheric Correction" },
+						  { BVAR_RCVR_POS_INVALID, "Receiver Position" },
+						  { 0, "" }
 					  };
-					unsigned short status;
+					BVAR_STAT status;
 					struct state *s = states;
 					char buffer[512];
 					char *p, *b;
-					
-					status = get_lsb_short(&bufp);
+
+					status = (BVAR_STAT) get_lsb_short(&bufp);
 					p = b = buffer;
 					p = ap(buffer, sizeof(buffer), p,
 					    "meinberg_gps_status=\"[0x%04x] ",
 					    status);
-					
+
 					if (status)
 					{
+						p = ap(buffer, sizeof(buffer), p, "incomplete buffered data: ");
 						b = p;
 						while (s->flag)
 						{
@@ -4350,7 +4371,7 @@
 								{
 									p = ap(buffer, sizeof(buffer), p, ", ");
 								}
-								
+
 								p = ap(buffer, sizeof(buffer), p, "%s", (const char *)s->string);
 							}
 							s++;
@@ -4359,9 +4380,9 @@
 					}
 					else
 					{
-						p = ap(buffer, sizeof(buffer), p, "<OK>\"");
+						p = ap(buffer, sizeof(buffer), p, "<all buffered data complete>\"");
 					}
-		
+
 					set_var(&parse->kv, buffer, strlen(buffer)+1, RO|DEF);
 				}
 			break;
@@ -4370,228 +4391,204 @@
 				{
 					XYZ xyz;
 					char buffer[256];
-					
+
 					get_mbg_xyz(&bufp, xyz);
 					snprintf(buffer, sizeof(buffer), "gps_position(XYZ)=\"%s m, %s m, %s m\"",
 						mfptoa(xyz[XP].l_ui, xyz[XP].l_uf, 1),
 						mfptoa(xyz[YP].l_ui, xyz[YP].l_uf, 1),
 						mfptoa(xyz[ZP].l_ui, xyz[ZP].l_uf, 1));
-					
+
 					set_var(&parse->kv, buffer, sizeof(buffer), RO|DEF);
 				}
 			break;
-	      
+
 			case GPS_POS_LLA:
 				{
 					LLA lla;
 					char buffer[256];
-					
+
 					get_mbg_lla(&bufp, lla);
-					
+
 					snprintf(buffer, sizeof(buffer), "gps_position(LLA)=\"%s deg, %s deg, %s m\"",
 						mfptoa(lla[LAT].l_ui, lla[LAT].l_uf, 4),
-						mfptoa(lla[LON].l_ui, lla[LON].l_uf, 4), 
+						mfptoa(lla[LON].l_ui, lla[LON].l_uf, 4),
 						mfptoa(lla[ALT].l_ui, lla[ALT].l_uf, 1));
-					
+
 					set_var(&parse->kv, buffer, sizeof(buffer), RO|DEF);
 				}
 			break;
-	      
+
 			case GPS_TZDL:
 				break;
-	      
+
 			case GPS_PORT_PARM:
 				break;
-	      
+
 			case GPS_SYNTH:
 				break;
-				
+
 			case GPS_ANT_INFO:
 				{
 					ANT_INFO antinfo;
 					char buffer[512];
 					char *p, *q;
-					
+
 					get_mbg_antinfo(&bufp, &antinfo);
 					p = buffer;
 					p = ap(buffer, sizeof(buffer), p, "meinberg_antenna_status=\"");
 					switch (antinfo.status)
 					{
-					case ANT_INVALID:
+					case ANT_INVALID: // No other fields valid since antenna has not yet been disconnected
 						p = ap(buffer, sizeof(buffer),
 						    p, "<OK>");
 						break;
-						
-					case ANT_DISCONN:
+
+					case ANT_DISCONN: // Antenna is disconnected, tm_reconn and delta_t not yet set
 						q = ap(buffer, sizeof(buffer),
 						    p, "DISCONNECTED since ");
 						NLOG(NLOG_CLOCKSTATUS)
 							ERR(ERR_BADSTATUS)
 							msyslog(LOG_ERR,"PARSE receiver #%d: ANTENNA FAILURE: %s",
 								CLK_UNIT(parse->peer), p);
-						
+
 						p = q;
-						mbg_tm_str(&p, &antinfo.tm_disconn, BUFFER_SIZE(buffer, p));
+						mbg_tm_str(&p, &antinfo.tm_disconn, BUFFER_SIZE(buffer, p), 0);
 						*p = '\0';
 						break;
-		    
-					case ANT_RECONN:
+
+					case ANT_RECONN: // Antenna had been disconnect, but receiver sync. after reconnect, so all fields valid
 						p = ap(buffer, sizeof(buffer),
-						    p, "RECONNECTED on ");
-						mbg_tm_str(&p, &antinfo.tm_reconn, BUFFER_SIZE(buffer, p));
+						    p, "SYNC AFTER RECONNECT on ");
+						mbg_tm_str(&p, &antinfo.tm_reconn, BUFFER_SIZE(buffer, p), 0);
 						p = ap(buffer, sizeof(buffer),
-							p, ", reconnect clockoffset %c%ld.%07ld s, disconnect time ",
+							p, ", clock offset at reconnect %c%ld.%07ld s, disconnect time ",
 							(antinfo.delta_t < 0) ? '-' : '+',
-							ABS(antinfo.delta_t) / 10000,
-							ABS(antinfo.delta_t) % 10000);
-						mbg_tm_str(&p, &antinfo.tm_disconn, BUFFER_SIZE(buffer, p));
+							(long) ABS(antinfo.delta_t) / 10000,
+							(long) ABS(antinfo.delta_t) % 10000);
+						mbg_tm_str(&p, &antinfo.tm_disconn, BUFFER_SIZE(buffer, p), 0);
 						*p = '\0';
 						break;
-		    
+
 					default:
 						p = ap(buffer, sizeof(buffer),
 						    p, "bad status 0x%04x",
 						    antinfo.status);
 						break;
 					}
-					
+
 					p = ap(buffer, sizeof(buffer), p, "\"");
-					
+
 					set_var(&parse->kv, buffer, sizeof(buffer), RO|DEF);
 				}
 			break;
-	      
+
 			case GPS_UCAP:
 				break;
-				
+
 			case GPS_CFGH:
 				{
 					CFGH cfgh;
 					char buffer[512];
 					char *p;
-					
+
 					get_mbg_cfgh(&bufp, &cfgh);
 					if (cfgh.valid)
 					{
+						const char *cp;
+						uint16_t tmp_val;
 						int i;
-						
+
 						p = buffer;
 						p = ap(buffer, sizeof(buffer),
 						    p, "gps_tot_51=\"");
 						mbg_tgps_str(&p, &cfgh.tot_51, BUFFER_SIZE(buffer, p));
 						p = ap(buffer, sizeof(buffer),
 						    p, "\"");
-						set_var(&parse->kv, buffer, sizeof(buffer), RO);
-						
+						set_var(&parse->kv, buffer, sizeof(buffer), RO|COND_DEF);
+
 						p = buffer;
 						p = ap(buffer, sizeof(buffer),
 						    p, "gps_tot_63=\"");
 						mbg_tgps_str(&p, &cfgh.tot_63, BUFFER_SIZE(buffer, p));
 						p = ap(buffer, sizeof(buffer),
 						    p, "\"");
-						set_var(&parse->kv, buffer, sizeof(buffer), RO);
-						
+						set_var(&parse->kv, buffer, sizeof(buffer), RO|COND_DEF);
+
 						p = buffer;
 						p = ap(buffer, sizeof(buffer),
 						    p, "gps_t0a=\"");
 						mbg_tgps_str(&p, &cfgh.t0a, BUFFER_SIZE(buffer, p));
 						p = ap(buffer, sizeof(buffer),
 						    p, "\"");
-						set_var(&parse->kv, buffer, sizeof(buffer), RO);
-						
-						for (i = MIN_SVNO; i < MAX_SVNO; i++)
+						set_var(&parse->kv, buffer, sizeof(buffer), RO|COND_DEF);
+
+						for (i = 0; i < N_SVNO_GPS; i++)
 						{
 							p = buffer;
-							p = ap(buffer, sizeof(buffer), p, "gps_cfg[%d]=\"[0x%x] ", i, cfgh.cfg[i]);
-							switch (cfgh.cfg[i] & 0x7)
-							{
-							case 0:
-								p = ap(buffer, sizeof(buffer), p, "BLOCK I");
-								break;
-							case 1:
-								p = ap(buffer, sizeof(buffer), p, "BLOCK II");
-								break;
-							default:
-								p = ap(buffer, sizeof(buffer), p, "bad CFG");
-								break;
-							}
-							p = ap(buffer, sizeof(buffer), p, "\"");
-							set_var(&parse->kv, buffer, sizeof(buffer), RO);
-							
-							p = buffer;
-							p = ap(buffer, sizeof(buffer), p, "gps_health[%d]=\"[0x%x] ", i, cfgh.health[i]);
-							switch ((cfgh.health[i] >> 5) & 0x7 )
-							{
-							case 0:
-								p = ap(buffer, sizeof(buffer), p, "OK;");
-								break;
-							case 1:
-								p = ap(buffer, sizeof(buffer), p, "PARITY;");
-								break;
-							case 2:
-								p = ap(buffer, sizeof(buffer), p, "TLM/HOW;");
-								break;
-							case 3:
-								p = ap(buffer, sizeof(buffer), p, "Z-COUNT;");
-								break;
-							case 4:
-								p = ap(buffer, sizeof(buffer), p, "SUBFRAME 1,2,3;");
-								break;
-							case 5:
-								p = ap(buffer, sizeof(buffer), p, "SUBFRAME 4,5;");
-								break;
-							case 6:
-								p = ap(buffer, sizeof(buffer), p, "UPLOAD BAD;");
-								break;
-							case 7:
-								p = ap(buffer, sizeof(buffer), p, "DATA BAD;");
-								break;
+							p = ap(buffer, sizeof(buffer), p, "sv_info[%d]=\"PRN%d", i, i + N_SVNO_GPS);
+
+							tmp_val = cfgh.health[i];  /* a 6 bit SV health code */
+							p = ap(buffer, sizeof(buffer), p, "; health=0x%02x (", tmp_val);
+							/* "All Ones" has a special meaning" */
+							if (tmp_val == 0x3F) /* satellite is unusable or doesn't even exist */
+								cp = "SV UNAVAILABLE";
+							else {
+								/* The MSB contains a summary of the 3 MSBs of the 8 bit health code,
+								 * indicating if the data sent by the satellite is OK or not. */
+								p = ap(buffer, sizeof(buffer), p, "DATA %s, ", (tmp_val & 0x20) ? "BAD" : "OK" );
+
+								/* The 5 LSBs contain the status of the different signals sent by the satellite. */
+								switch (tmp_val & 0x1F)
+								{
+									case 0x00: cp = "SIGNAL OK";              break;
+									/* codes 0x01 through 0x1B indicate that one or more
+									 * specific signal components are weak or dead.
+									 * We don't decode this here in detail. */
+									case 0x1C: cp = "SV IS TEMP OUT";         break;
+									case 0x1D: cp = "SV WILL BE TEMP OUT";    break;
+									default:   cp = "TRANSMISSION PROBLEMS";  break;
+								}
 							}
-							
-							switch (cfgh.health[i] & 0x1F)
+							p = ap(buffer, sizeof(buffer), p, "%s)", cp );
+
+							tmp_val = cfgh.cfg[i];  /* a 4 bit SV configuration/type code */
+							p = ap(buffer, sizeof(buffer), p, "; cfg=0x%02x (", tmp_val);
+							switch (tmp_val & 0x7)
 							{
-							case 0:
-								p = ap(buffer, sizeof(buffer), p, "SIGNAL OK");
-								break;
-							case 0x1C:
-								p = ap(buffer, sizeof(buffer), p, "SV TEMP OUT");
-								break;
-							case 0x1D:
-								p = ap(buffer, sizeof(buffer), p, "SV WILL BE TEMP OUT");
-								break;
-							case 0x1E:
-								break;
-							case 0x1F:
-								p = ap(buffer, sizeof(buffer), p, "MULTIPLE ERRS");
-								break;
-							default:
-								p = ap(buffer, sizeof(buffer), p, "TRANSMISSION PROBLEMS");
-								break;
+								case 0x00:  cp = "(reserved)";        break;
+								case 0x01:  cp = "BLOCK II/IIA/IIR";  break;
+								case 0x02:  cp = "BLOCK IIR-M";       break;
+								case 0x03:  cp = "BLOCK IIF";         break;
+								case 0x04:  cp = "BLOCK III";         break;
+								default:   cp = "unknown SV type";   break;
 							}
-							
-							p = ap(buffer, sizeof(buffer), p, "\"");
-							set_var(&parse->kv, buffer, sizeof(buffer), RO);
+							p = ap(buffer, sizeof(buffer), p, "%s", cp );
+							if (tmp_val & 0x08)  /* A-S is on, P-code is encrypted */
+								p = ap( buffer, sizeof(buffer), p, ", A-S on" );
+
+							p = ap(buffer, sizeof(buffer), p, ")\"");
+							set_var(&parse->kv, buffer, sizeof(buffer), RO|COND_DEF);
 						}
 					}
 				}
 			break;
-	      
+
 			case GPS_ALM:
 				break;
-				
+
 			case GPS_EPH:
 				break;
-				
+
 			case GPS_UTC:
 				{
 					UTC utc;
 					char buffer[512];
 					char *p;
-					
+
 					p = buffer;
-					
+
 					get_mbg_utc(&bufp, &utc);
-					
+
 					if (utc.valid)
 					{
 						p = ap(buffer, sizeof(buffer), p, "gps_utc_correction=\"");
@@ -4606,46 +4603,47 @@
 					set_var(&parse->kv, buffer, sizeof(buffer), RO|DEF);
 				}
 			break;
-			
+
 			case GPS_IONO:
 				break;
-				
+
 			case GPS_ASCII_MSG:
 				{
 					ASCII_MSG gps_ascii_msg;
 					char buffer[128];
-		
+
 					get_mbg_ascii_msg(&bufp, &gps_ascii_msg);
-					
+
 					if (gps_ascii_msg.valid)
 						{
 							char buffer1[128];
 							mkreadable(buffer1, sizeof(buffer1), gps_ascii_msg.s, strlen(gps_ascii_msg.s), (int)0);
-							
+
 							snprintf(buffer, sizeof(buffer), "gps_message=\"%s\"", buffer1);
 						}
 					else
 						snprintf(buffer, sizeof(buffer), "gps_message=<NONE>");
-					
+
 					set_var(&parse->kv, buffer, sizeof(buffer), RO|DEF);
 				}
-			
+
 			break;
-	      
+
 			default:
 				break;
 			}
 		}
 		else
 		{
-			msyslog(LOG_DEBUG, "PARSE receiver #%d: gps16x_message: message checksum error: hdr_csum = 0x%x (expected 0x%lx), data_len = %d, data_csum = 0x%x (expected 0x%lx)",
+			msyslog(LOG_DEBUG, "PARSE receiver #%d: gps16x_message: message checksum error: hdr_csum = 0x%x (expected 0x%x), "
+			                   "data_len = %d, data_csum = 0x%x (expected 0x%x)",
 				CLK_UNIT(parse->peer),
-				header.gps_hdr_csum, mbg_csum(parsetime->parse_msg + 1, 6),
-				header.gps_len,
-				header.gps_data_csum, mbg_csum(bufp, (unsigned)((header.gps_len < sizeof(parsetime->parse_msg)) ? header.gps_len : 0)));
+				header.hdr_csum, mbg_csum(parsetime->parse_msg + 1, 6),
+				header.len,
+				header.data_csum, mbg_csum(bufp, (unsigned)((header.len < sizeof(parsetime->parse_msg)) ? header.len : 0)));
 		}
 	}
-  
+
 	return;
 }
 
@@ -4658,11 +4656,11 @@
 	    )
 {
 	struct parseunit *parse = peer->procptr->unitptr;
-	
-	static GPS_MSG_HDR sequence[] = 
+
+	static GPS_MSG_HDR sequence[] =
 	{
 		{ GPS_SW_REV,          0, 0, 0 },
-		{ GPS_STAT,            0, 0, 0 },
+		{ GPS_BVAR_STAT,       0, 0, 0 },
 		{ GPS_UTC,             0, 0, 0 },
 		{ GPS_ASCII_MSG,       0, 0, 0 },
 		{ GPS_ANT_INFO,        0, 0, 0 },
@@ -4676,41 +4674,41 @@
 	unsigned char cmd_buffer[64];
 	unsigned char *outp = cmd_buffer;
 	GPS_MSG_HDR *header;
-	
+
 	if (((poll_info_t *)parse->parse_type->cl_data)->rate)
 	{
 		parse->peer->procptr->nextaction = current_time + ((poll_info_t *)parse->parse_type->cl_data)->rate;
 	}
 
-	if (sequence[parse->localstate].gps_cmd == (unsigned short)~0)
+	if (sequence[parse->localstate].cmd == (unsigned short)~0)
 		parse->localstate = 0;
-	
+
 	header = sequence + parse->localstate++;
-	
+
 	*outp++ = SOH;		/* start command */
-	
+
 	put_mbg_header(&outp, header);
 	outp = cmd_buffer + 1;
-	
-	header->gps_hdr_csum = (short)mbg_csum(outp, 6);
+
+	header->hdr_csum = (short)mbg_csum(outp, 6);
 	put_mbg_header(&outp, header);
-	
+
 #ifdef DEBUG
 	if (debug > 2)
 	{
 		char buffer[128];
-		
+
 		mkreadable(buffer, sizeof(buffer), (char *)cmd_buffer, (unsigned)(outp - cmd_buffer), 1);
 		printf("PARSE receiver #%d: transmitted message #%ld (%d bytes) >%s<\n",
 		       CLK_UNIT(parse->peer),
 		       parse->localstate - 1,
 		       (int)(outp - cmd_buffer),
-		       buffer); 
+		       buffer);
 	}
 #endif
-  
-	rtc = write(parse->generic->io.fd, cmd_buffer, (unsigned long)(outp - cmd_buffer));
-	
+
+	rtc = (int) write(parse->generic->io.fd, cmd_buffer, (unsigned long)(outp - cmd_buffer));
+
 	if (rtc < 0)
 	{
 		ERR(ERR_BADIO)
@@ -4759,7 +4757,7 @@
 	return 1;
 }
 #endif /* CLOCK_MEINBERG */
-
+
 /**===========================================================================
  ** clock polling support
  **/
@@ -4772,11 +4770,11 @@
 	struct parseunit *parse
 	)
 {
-	int rtc;
+	long rtc;
 	const char *ps = ((poll_info_t *)parse->parse_type->cl_data)->string;
-	int   ct = ((poll_info_t *)parse->parse_type->cl_data)->count;
+	long ct = ((poll_info_t *)parse->parse_type->cl_data)->count;
 
-	rtc = write(parse->generic->io.fd, ps, (unsigned long)ct);
+	rtc = write(parse->generic->io.fd, ps, ct);
 	if (rtc < 0)
 	{
 		ERR(ERR_BADIO)
@@ -4786,7 +4784,7 @@
 	    if (rtc != ct)
 	    {
 		    ERR(ERR_BADIO)
-			    msyslog(LOG_ERR, "PARSE receiver #%d: poll_dpoll: failed to send cmd incomplete (%d of %d bytes sent)", CLK_UNIT(parse->peer), rtc, ct);
+			    msyslog(LOG_ERR, "PARSE receiver #%d: poll_dpoll: failed to send cmd incomplete (%ld of %ld bytes sent)", CLK_UNIT(parse->peer), rtc, ct);
 	    }
 	clear_err(parse, ERR_BADIO);
 }
@@ -4800,7 +4798,7 @@
 	)
 {
 	struct parseunit *parse = peer->procptr->unitptr;
-	
+
 	if (parse->parse_type->cl_poll)
 		parse->parse_type->cl_poll(parse);
 
@@ -4826,7 +4824,7 @@
 
 	return 0;
 }
-
+
 /**===========================================================================
  ** Trimble support
  **/
@@ -4856,7 +4854,7 @@
 	else
 	{
 		tio.c_cc[VEOL] = TRIMBLETAIP_EOL;
-	
+
 		if (TTY_SETATTR(parse->generic->io.fd, &tio) == -1)
 		{
 			msyslog(LOG_ERR, "PARSE receiver #%d: trimbletaip_init: tcsetattr(fd, &tio): %m", CLK_UNIT(parse->peer));
@@ -4875,7 +4873,7 @@
 	">FTM00020001<",
 	(char *)0
 };
-      
+
 static void
 trimbletaip_event(
 	struct parseunit *parse,
@@ -4892,7 +4890,7 @@
 			    iv = taipinit;
 			    while (*iv)
 			    {
-				    int rtc = write(parse->generic->io.fd, *iv, strlen(*iv));
+				    int rtc = (int) write(parse->generic->io.fd, *iv, strlen(*iv));
 				    if (rtc < 0)
 				    {
 					    msyslog(LOG_ERR, "PARSE receiver #%d: trimbletaip_event: failed to send cmd to clock: %m", CLK_UNIT(parse->peer));
@@ -5020,19 +5018,19 @@
 	float   fv;
 	double  dv;
 };
-  
+
 struct txbuf
 {
 	short idx;			/* index to first unused byte */
 	u_char *txt;			/* pointer to actual data buffer */
 };
 
-void	sendcmd		(struct txbuf *buf, int c); 
-void	sendbyte	(struct txbuf *buf, int b); 
-void	sendetx		(struct txbuf *buf, struct parseunit *parse); 
-void	sendint		(struct txbuf *buf, int a); 
-void	sendflt		(struct txbuf *buf, double a); 
- 
+void	sendcmd		(struct txbuf *buf, int c);
+void	sendbyte	(struct txbuf *buf, int b);
+void	sendetx		(struct txbuf *buf, struct parseunit *parse);
+void	sendint		(struct txbuf *buf, int a);
+void	sendflt		(struct txbuf *buf, double a);
+
 void
 sendcmd(
 	struct txbuf *buf,
@@ -5044,12 +5042,12 @@
 	buf->idx = 2;
 }
 
-void	sendcmd		(struct txbuf *buf, int c); 
-void	sendbyte	(struct txbuf *buf, int b); 
-void	sendetx		(struct txbuf *buf, struct parseunit *parse); 
-void	sendint		(struct txbuf *buf, int a); 
-void	sendflt		(struct txbuf *buf, double a); 
- 
+void	sendcmd		(struct txbuf *buf, int c);
+void	sendbyte	(struct txbuf *buf, int b);
+void	sendetx		(struct txbuf *buf, struct parseunit *parse);
+void	sendint		(struct txbuf *buf, int a);
+void	sendflt		(struct txbuf *buf, double a);
+
 void
 sendbyte(
 	struct txbuf *buf,
@@ -5081,18 +5079,18 @@
 	  if (debug > 2)
 	  {
 		  char buffer[256];
-		  
+
 		  mkreadable(buffer, sizeof(buffer), (char *)buf->txt, (unsigned)buf->idx, 1);
 		  printf("PARSE receiver #%d: transmitted message (%d bytes) >%s<\n",
 			 CLK_UNIT(parse->peer),
-			 buf->idx, buffer); 
+			 buf->idx, buffer);
 	  }
 #endif
 		clear_err(parse, ERR_BADIO);
 	}
 }
 
-void  
+void
 sendint(
 	struct txbuf *buf,
 	int a
@@ -5112,7 +5110,7 @@
 	int i;
 	union uval uval;
 
-	uval.fv = a;
+	uval.fv = (float) a;
 #ifdef WORDS_BIGENDIAN
 	for (i=0; i<=3; i++)
 #else
@@ -5144,12 +5142,12 @@
 
 	if (t)
 		t->last_reset = current_time;
-			
+
 	buf.txt = buffer;
-  
+
 	sendcmd(&buf, CMD_CVERSION);	/* request software versions */
 	sendetx(&buf, parse);
-	
+
 	sendcmd(&buf, CMD_COPERPARAM);	/* set operating parameters */
 	sendbyte(&buf, 4);	/* static */
 	sendflt(&buf, 5.0*D2R);	/* elevation angle mask = 10 deg XXX */
@@ -5157,25 +5155,25 @@
 	sendflt(&buf, 12.0);	/* PDOP mask = 12 */
 	sendflt(&buf, 8.0);	/* PDOP switch level = 8 */
 	sendetx(&buf, parse);
-	
+
 	sendcmd(&buf, CMD_CMODESEL);	/* fix mode select */
 	sendbyte(&buf, 1);	/* time transfer mode */
 	sendetx(&buf, parse);
-	
+
 	sendcmd(&buf, CMD_CMESSAGE);	/* request system message */
 	sendetx(&buf, parse);
-	
+
 	sendcmd(&buf, CMD_CSUPER);	/* superpacket fix */
 	sendbyte(&buf, 0x2);	/* binary mode */
 	sendetx(&buf, parse);
-	
+
 	sendcmd(&buf, CMD_CIOOPTIONS);	/* set I/O options */
 	sendbyte(&buf, TRIM_POS_OPT);	/* position output */
 	sendbyte(&buf, 0x00);	/* no velocity output */
 	sendbyte(&buf, TRIM_TIME_OPT);	/* UTC, compute on seconds */
 	sendbyte(&buf, 0x00);	/* no raw measurements */
 	sendetx(&buf, parse);
-	
+
 	sendcmd(&buf, CMD_CUTCPARAM);	/* request UTC correction data */
 	sendetx(&buf, parse);
 
@@ -5199,7 +5197,7 @@
 	u_char buffer[256];
 	struct txbuf buf;
 	buf.txt = buffer;
-	
+
 	if (t)
 	{
 		if (current_time > t->last_msg + TRIMBLETSIP_IDLE_TIME)
@@ -5207,18 +5205,18 @@
 	}
 
 	poll_poll(parse->peer);	/* emit query string and re-arm timer */
-	
+
 	if (t && t->qtracking)
 	{
 		u_long oldsats = t->ltrack & ~t->ctrack;
-		
+
 		t->qtracking = 0;
 		t->ltrack = t->ctrack;
-		
+
 		if (oldsats)
 		{
 			int i;
-				
+
 			for (i = 0; oldsats; i++) {
 				if (oldsats & (1 << i))
 					{
@@ -5229,7 +5227,7 @@
 				oldsats &= ~(1 << i);
 			}
 		}
-						
+
 		sendcmd(&buf, CMD_CSTATTRACK);
 		sendbyte(&buf, 0x00);	/* current tracking set */
 		sendetx(&buf, parse);
@@ -5244,7 +5242,7 @@
 	      struct parseunit *parse
 	      )
 {	trimble_t *t = parse->localdata;
-	
+
 	if (t)
 	{
 		free(t);
@@ -5275,9 +5273,9 @@
 	if (!parse->localdata)
 	{
 		trimble_t *t;
-		
+
 		t = (trimble_t *)(parse->localdata = emalloc(sizeof(trimble_t)));
-		
+
 		if (t)
 		{
 			memset((char *)t, 0, sizeof(trimble_t));
@@ -5357,7 +5355,7 @@
 	)
 {
 	union uval uval;
-	
+
 #ifdef WORDS_BIGENDIAN
 	uval.bd[0] = *bp++;
 	uval.bd[1] = *bp++;
@@ -5378,7 +5376,7 @@
 	)
 {
 	union uval uval;
-	
+
 #ifdef WORDS_BIGENDIAN
 	uval.bd[0] = *bp++;
 	uval.bd[1] = *bp++;
@@ -5406,7 +5404,7 @@
 	 unsigned char *p
 	 )
 {
-	return get_msb_short(&p);
+	return (int) get_msb_short(&p);
 }
 
 /*--------------------------------------------------
@@ -5423,7 +5421,7 @@
 {
 	unsigned char *buffer = parsetime->parse_msg;
 	unsigned int   size   = parsetime->parse_msglen;
-	
+
 	if ((size < 4) ||
 	    (buffer[0]      != DLE) ||
 	    (buffer[size-1] != ETX) ||
@@ -5445,13 +5443,13 @@
 	}
 	else
 	{
-		int var_flag;
+		u_short var_flag;
 		trimble_t *tr = parse->localdata;
 		unsigned int cmd = buffer[1];
 		char pbuffer[200];
 		char *t = pbuffer;
 		cmd_info_t *s;
-		
+
 #ifdef DEBUG
 		if (debug > 3) {
 			size_t i;
@@ -5467,9 +5465,9 @@
 
 		if (tr)
 			tr->last_msg = current_time;
-		
+
 		s = trimble_convert(cmd, trimble_rcmds);
-		
+
 		if (s)
 		{
 			t = ap(pbuffer, sizeof(pbuffer), t, "%s=\"", s->varname);
@@ -5480,7 +5478,7 @@
 			return;
 		}
 
-		var_flag = s->varmode;
+		var_flag = (u_short) s->varmode;
 
 		switch(cmd)
 		{
@@ -5489,7 +5487,7 @@
 				 getflt((unsigned char *)&mb(0)), getshort((unsigned char *)&mb(4)),
 				 getflt((unsigned char *)&mb(6)));
 			break;
-			
+
 		case CMD_RBEST4:
 			t = ap(pbuffer, sizeof(pbuffer), t, "mode: ");
 			switch (mb(0) & 0xF)
@@ -5502,11 +5500,11 @@
 			case 1:
 				t = ap(pbuffer, sizeof(pbuffer), t, "0D");
 				break;
-				
+
 			case 3:
 				t = ap(pbuffer, sizeof(pbuffer), t, "2D");
 				break;
-				
+
 			case 4:
 				t = ap(pbuffer, sizeof(pbuffer), t, "3D");
 				break;
@@ -5515,7 +5513,7 @@
 				t = ap(pbuffer, sizeof(pbuffer), t, "-MANUAL, ");
 			else
 				t = ap(pbuffer, sizeof(pbuffer), t, "-AUTO, ");
-			
+
 			t = ap(pbuffer, sizeof(pbuffer), t, "satellites %02d %02d %02d %02d, PDOP %.2f, HDOP %.2f, VDOP %.2f, TDOP %.2f",
 				mb(1), mb(2), mb(3), mb(4),
 				getflt((unsigned char *)&mb(5)),
@@ -5524,12 +5522,12 @@
 				getflt((unsigned char *)&mb(17)));
 
 			break;
-			
+
 		case CMD_RVERSION:
 			t = ap(pbuffer, sizeof(pbuffer), t, "%d.%d (%d/%d/%d)",
 				mb(0)&0xff, mb(1)&0xff, 1900+(mb(4)&0xff), mb(2)&0xff, mb(3)&0xff);
 			break;
-			
+
 		case CMD_RRECVHEALTH:
 		{
 			static const char *msgs[] =
@@ -5543,9 +5541,9 @@
 				"<BIT 6>",
 				"<BIT 7>"
 			};
-			
+
 			int i, bits;
-			
+
 			switch (mb(0) & 0xFF)
 			{
 			default:
@@ -5578,7 +5576,7 @@
 			}
 
 			bits = mb(1) & 0xFF;
-			
+
 			for (i = 0; i < 8; i++)
 				if (bits & (0x1<<i))
 				{
@@ -5586,11 +5584,11 @@
 				}
 		}
 		break;
-			
+
 		case CMD_RMESSAGE:
 			mkreadable(t, (int)BUFFER_SIZE(pbuffer, t), (char *)&mb(0), (unsigned)(size - 2 - (&mb(0) - buffer)), 0);
 			break;
-			
+
 		case CMD_RMACHSTAT:
 		{
 			static const char *msgs[] =
@@ -5604,12 +5602,12 @@
 				"<BIT 6>",
 				"<BIT 7>"
 			};
-			
+
 			int i, bits;
 
 			t = ap(pbuffer, sizeof(pbuffer), t, "machine id 0x%02x", mb(0) & 0xFF);
 			bits = mb(1) & 0xFF;
-			
+
 			for (i = 0; i < 8; i++)
 				if (bits & (0x1<<i))
 				{
@@ -5619,21 +5617,21 @@
 			t = ap(pbuffer, sizeof(pbuffer), t, ", Superpackets %ssupported", (mb(2) & 0xFF) ? "" :"un" );
 		}
 		break;
-			
+
 		case CMD_ROPERPARAM:
 			t = ap(pbuffer, sizeof(pbuffer), t, "%2x %.1f %.1f %.1f %.1f",
 				mb(0), getflt((unsigned char *)&mb(1)), getflt((unsigned char *)&mb(5)),
 				getflt((unsigned char *)&mb(9)), getflt((unsigned char *)&mb(13)));
 			break;
-			
+
 		case CMD_RUTCPARAM:
 		{
 			float t0t = getflt((unsigned char *)&mb(14));
-			short wnt = getshort((unsigned char *)&mb(18));
-			short dtls = getshort((unsigned char *)&mb(12));
-			short wnlsf = getshort((unsigned char *)&mb(20));
-			short dn = getshort((unsigned char *)&mb(22));
-			short dtlsf = getshort((unsigned char *)&mb(24));
+			short wnt = (short) getshort((unsigned char *)&mb(18));
+			short dtls = (short) getshort((unsigned char *)&mb(12));
+			short wnlsf = (short) getshort((unsigned char *)&mb(20));
+			short dn = (short) getshort((unsigned char *)&mb(22));
+			short dtlsf = (short) getshort((unsigned char *)&mb(24));
 
 			if ((int)t0t != 0)
 			{
@@ -5662,14 +5660,14 @@
 			}
 		}
 		break;
-		
+
 		case CMD_RSPOSXYZ:
 		{
 			double x = getflt((unsigned char *)&mb(0));
 			double y = getflt((unsigned char *)&mb(4));
 			double z = getflt((unsigned char *)&mb(8));
 			double f = getflt((unsigned char *)&mb(12));
-			
+
 			if (f > 0.0)
 			  t = ap(pbuffer, sizeof(pbuffer), t, "x= %.1fm, y= %.1fm, z= %.1fm, time_of_fix= %f sec",
 				  x, y, z,
@@ -5684,7 +5682,7 @@
 			double lat = getflt((unsigned char *)&mb(0));
 			double lng = getflt((unsigned char *)&mb(4));
 			double f   = getflt((unsigned char *)&mb(12));
-			
+
 			if (f > 0.0)
 			  t = ap(pbuffer, sizeof(pbuffer), t, "lat %f %c, long %f %c, alt %.2fm",
 				  ((lat < 0.0) ? (-lat) : (lat))*RTOD, (lat < 0.0 ? 'S' : 'N'),
@@ -5704,7 +5702,7 @@
 				x, y, z);
 		}
 		break;
-				
+
 		case CMD_RDOUBLELLA:
 		{
 			double lat = getdbl((unsigned char *)&mb(0));
@@ -5719,7 +5717,7 @@
 		case CMD_RALLINVIEW:
 		{
 			int i, sats;
-			
+
 			t = ap(pbuffer, sizeof(pbuffer), t, "mode: ");
 			switch (mb(0) & 0x7)
 			{
@@ -5730,7 +5728,7 @@
 			case 3:
 				t = ap(pbuffer, sizeof(pbuffer), t, "2D");
 				break;
-				
+
 			case 4:
 				t = ap(pbuffer, sizeof(pbuffer), t, "3D");
 				break;
@@ -5739,9 +5737,9 @@
 				t = ap(pbuffer, sizeof(pbuffer), t, "-MANUAL, ");
 			else
 				t = ap(pbuffer, sizeof(pbuffer), t, "-AUTO, ");
-			
+
 			sats = (mb(0)>>4) & 0xF;
-			
+
 			t = ap(pbuffer, sizeof(pbuffer), t, "PDOP %.2f, HDOP %.2f, VDOP %.2f, TDOP %.2f, %d satellite%s in view: ",
 				getflt((unsigned char *)&mb(1)),
 				getflt((unsigned char *)&mb(5)),
@@ -5762,17 +5760,17 @@
 			}
 		}
 		break;
-		
+
 		case CMD_RSTATTRACK:
 		{
 			t = ap(pbuffer, sizeof(pbuffer), t-2, "[%02d]=\"", mb(0)); /* add index to var name */
 			if (getflt((unsigned char *)&mb(4)) < 0.0)
 			{
 				t = ap(pbuffer, sizeof(pbuffer), t, "<NO MEASUREMENTS>");
-				var_flag &= ~DEF;
+				var_flag &= (u_short)(~DEF);
 			}
 			else
-			{	
+			{
 				t = ap(pbuffer, sizeof(pbuffer), t, "ch=%d, acq=%s, eph=%d, signal_level= %5.2f, elevation= %5.2f, azimuth= %6.2f",
 					(mb(1) & 0xFF)>>3,
 					mb(2) ? ((mb(2) == 1) ? "ACQ" : "SRCH") : "NEVER",
@@ -5782,7 +5780,7 @@
 					getflt((unsigned char *)&mb(16)) * RTOD);
 				if (mb(20))
 				{
-					var_flag &= ~DEF;
+					var_flag &= (u_short)(~DEF);
 					t = ap(pbuffer, sizeof(pbuffer), t, ", OLD");
 				}
 				if (mb(22))
@@ -5798,18 +5796,18 @@
 			}
 		}
 		break;
-		
+
 		default:
 			t = ap(pbuffer, sizeof(pbuffer), t, "<UNDECODED>");
 			break;
 		}
 
-		t = ap(pbuffer, sizeof(pbuffer), t,"\"");
+		t = ap(pbuffer, sizeof(pbuffer), t, "\"");
 		set_var(&parse->kv, pbuffer, sizeof(pbuffer), var_flag);
 	}
 }
 
-
+
 /**============================================================
  ** RAWDCF support
  **/
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/ntpd/refclock_shm.c /cur/src/external/bsd/ntp/dist/ntpd/refclock_shm.c
--- external/bsd/ntp/dist/ntpd/refclock_shm.c	2014-12-24 18:28:10.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/ntpd/refclock_shm.c	2015-04-14 22:56:21.000000000 -0700
@@ -53,13 +53,17 @@
 #define NSAMPLES        3       /* stages of median filter */
 
 /*
+ * Mode flags
+ */
+#define SHM_MODE_PRIVATE 0x0001
+
+/*
  * Function prototypes
  */
 static  int     shm_start       (int unit, struct peer *peer);
 static  void    shm_shutdown    (int unit, struct peer *peer);
 static  void    shm_poll        (int unit, struct peer *peer);
 static  void    shm_timer       (int unit, struct peer *peer);
-static	void	shm_peek	(int unit, struct peer *peer);
 static	void	shm_clockstats  (int unit, struct peer *peer);
 static	void	shm_control	(int unit, const struct refclockstat * in_st,
 				 struct refclockstat * out_st, struct peer *peer);
@@ -102,6 +106,7 @@
 
 struct shmunit {
 	struct shmTime *shm;	/* pointer to shared memory segment */
+	int forall;		/* access for all UIDs?	*/
 
 	/* debugging/monitoring counters - reset when printed */
 	int ticks;		/* number of attempts to read data*/
@@ -114,75 +119,85 @@
 	time_t max_delay;	/* age/stale limit */
 };
 
+static struct shmTime*
+getShmTime(
+	int unit,
+	int/*BOOL*/ forall
+	)
+{
+	struct shmTime *p = NULL;
 
-struct shmTime *getShmTime(int);
-
-struct shmTime *getShmTime (int unit) {
 #ifndef SYS_WINNT
-	int shmid=0;
+
+	int shmid;
 
 	/* 0x4e545030 is NTP0.
 	 * Big units will give non-ascii but that's OK
 	 * as long as everybody does it the same way.
 	 */
-	shmid=shmget (0x4e545030 + unit, sizeof (struct shmTime),
-		      IPC_CREAT | ((unit < 2) ? 0600 : 0666));
+	shmid=shmget(0x4e545030 + unit, sizeof (struct shmTime),
+		      IPC_CREAT | (forall ? 0666 : 0600));
 	if (shmid == -1) { /* error */
 		msyslog(LOG_ERR, "SHM shmget (unit %d): %m", unit);
-		return 0;
+		return NULL;
 	}
-	else { /* no error  */
-		struct shmTime *p = (struct shmTime *)shmat (shmid, 0, 0);
-		if (p == (struct shmTime *)-1) { /* error */
-			msyslog(LOG_ERR, "SHM shmat (unit %d): %m", unit);
-			return 0;
-		}
-		return p;
+	p = (struct shmTime *)shmat (shmid, 0, 0);
+	if (p == (struct shmTime *)-1) { /* error */
+		msyslog(LOG_ERR, "SHM shmat (unit %d): %m", unit);
+		return NULL;
 	}
+	return p;
+
 #else
-	char buf[10];
+
+	static const char * nspref[2] = { "Local", "Global" };
+	char buf[20];
 	LPSECURITY_ATTRIBUTES psec = 0;
 	HANDLE shmid = 0;
 	SECURITY_DESCRIPTOR sd;
 	SECURITY_ATTRIBUTES sa;
+	unsigned int numch;
 
-	snprintf(buf, sizeof(buf), "NTP%d", unit);
-	if (unit >= 2) { /* world access */
+	numch = snprintf(buf, sizeof(buf), "%s\\NTP%d",
+			 nspref[forall != 0], (unit & 0xFF));
+	if (numch >= sizeof(buf)) {
+		msyslog(LOG_ERR, "SHM name too long (unit %d)", unit);
+		return NULL;
+	}
+	if (forall) { /* world access */
 		if (!InitializeSecurityDescriptor(&sd, SECURITY_DESCRIPTOR_REVISION)) {
 			msyslog(LOG_ERR,"SHM InitializeSecurityDescriptor (unit %d): %m", unit);
-			return 0;
+			return NULL;
 		}
-		if (!SetSecurityDescriptorDacl(&sd, 1, 0, 0)) {
+		if (!SetSecurityDescriptorDacl(&sd, TRUE, NULL, FALSE)) {
 			msyslog(LOG_ERR, "SHM SetSecurityDescriptorDacl (unit %d): %m", unit);
-			return 0;
+			return NULL;
 		}
-		sa.nLength=sizeof (SECURITY_ATTRIBUTES);
+		sa.nLength = sizeof(SECURITY_ATTRIBUTES);
 		sa.lpSecurityDescriptor = &sd;
-		sa.bInheritHandle = 0;
+		sa.bInheritHandle = FALSE;
 		psec = &sa;
 	}
 	shmid = CreateFileMapping ((HANDLE)0xffffffff, psec, PAGE_READWRITE,
-				 0, sizeof (struct shmTime), buf);
-	if (!shmid) { /*error*/
-		char buf[1000];
-
+				   0, sizeof (struct shmTime), buf);
+	if (shmid == NULL) { /*error*/
+		char buf[1000];		
 		FormatMessage (FORMAT_MESSAGE_FROM_SYSTEM,
 			       0, GetLastError (), 0, buf, sizeof (buf), 0);
 		msyslog(LOG_ERR, "SHM CreateFileMapping (unit %d): %s", unit, buf);
-		return 0;
-	} else {
-		struct shmTime *p = (struct shmTime *) MapViewOfFile (shmid,
-								    FILE_MAP_WRITE, 0, 0, sizeof (struct shmTime));
-		if (p == 0) { /*error*/
-			char buf[1000];
-
-			FormatMessage (FORMAT_MESSAGE_FROM_SYSTEM,
-				       0, GetLastError (), 0, buf, sizeof (buf), 0);
-			msyslog(LOG_ERR,"SHM MapViewOfFile (unit %d): %s", unit, buf) 
-			return 0;
-		}
-		return p;
+		return NULL;
 	}
+	p = (struct shmTime *)MapViewOfFile(shmid, FILE_MAP_WRITE, 0, 0,
+					    sizeof (struct shmTime));
+	if (p == NULL) { /*error*/
+		char buf[1000];		
+		FormatMessage (FORMAT_MESSAGE_FROM_SYSTEM,
+			       0, GetLastError (), 0, buf, sizeof (buf), 0);
+		msyslog(LOG_ERR,"SHM MapViewOfFile (unit %d): %s", unit, buf);
+		return NULL;
+	}
+
+	return p;
 #endif
 }
 /*
@@ -194,18 +209,17 @@
 	struct peer *peer
 	)
 {
-	struct refclockproc *pp;
-	struct shmunit *up;
+	struct refclockproc * const pp = peer->procptr;
+	struct shmunit *      const up = emalloc_zero(sizeof(*up));
 
-	pp = peer->procptr;
 	pp->io.clock_recv = noentry;
 	pp->io.srcclock = peer;
 	pp->io.datalen = 0;
 	pp->io.fd = -1;
 
-	up = emalloc_zero(sizeof(*up));
+	up->forall = (unit >= 2) && !(peer->ttl & SHM_MODE_PRIVATE);
 
-	up->shm = getShmTime(unit);
+	up->shm = getShmTime(unit, up->forall);
 
 	/*
 	 * Initialize miscellaneous peer variables
@@ -245,12 +259,12 @@
 	struct peer               * peer
 	)
 {
-	struct refclockproc *pp;
-	struct shmunit *up;
-
-	pp = peer->procptr;
-	up = pp->unitptr;
+	struct refclockproc * const pp = peer->procptr;
+	struct shmunit *      const up = pp->unitptr;
 
+	UNUSED_ARG(unit);
+	UNUSED_ARG(in_st);
+	UNUSED_ARG(out_st);
 	if (NULL == up)
 		return;
 	if (pp->sloppyclockflag & CLK_FLAG1)
@@ -271,31 +285,23 @@
 	struct peer *peer
 	)
 {
-	struct refclockproc *pp;
-	struct shmunit *up;
-
-	pp = peer->procptr;
-	up = pp->unitptr;
+	struct refclockproc * const pp = peer->procptr;
+	struct shmunit *      const up = pp->unitptr;
 
+	UNUSED_ARG(unit);
 	if (NULL == up)
 		return;
 #ifndef SYS_WINNT
+
 	/* HMS: shmdt() wants char* or const void * */
-	(void) shmdt ((char *)up->shm);
+	(void)shmdt((char *)up->shm);
+
 #else
-	UnmapViewOfFile (up->shm);
-#endif
-	free(up);
-}
 
+	UnmapViewOfFile(up->shm);
 
-/*
- * shm_timer - called every second
- */
-static  void
-shm_timer(int unit, struct peer *peer)
-{
-	shm_peek(unit, peer);
+#endif
+	free(up);
 }
 
 
@@ -308,13 +314,10 @@
 	struct peer *peer
 	)
 {
-	struct refclockproc *pp;
-	struct shmunit *up;
+	struct refclockproc * const pp = peer->procptr;
+	struct shmunit *      const up = pp->unitptr;
 	int major_error;
 
-	pp = peer->procptr;
-	up = pp->unitptr;
-
 	pp->polls++;
 
 	/* get dominant reason if we have no samples at all */
@@ -347,16 +350,18 @@
 }
 
 /*
- * shm_peek - try to grab a sample
+ * shm_timer - called onece every second.
+ *
+ * This tries to grab a sample from the SHM segment
  */
 static void
-shm_peek(
+shm_timer(
 	int unit,
 	struct peer *peer
 	)
 {
-	struct refclockproc *pp;
-	struct shmunit *up;
+	struct refclockproc * const pp = peer->procptr;
+	struct shmunit *      const up = pp->unitptr;
 
 	/* access order is important for lock-free SHM access; we
 	** enforce order by treating the whole structure volatile.
@@ -385,19 +390,16 @@
 	 * This is the main routine. It snatches the time from the shm
 	 * board and tacks on a local timestamp.
 	 */
-	pp = peer->procptr;
-	up = pp->unitptr;
 	up->ticks++;
-	if (up->shm == 0) {
+	if ((shm = up->shm) == NULL) {
 		/* try to map again - this may succeed if meanwhile some-
 		body has ipcrm'ed the old (unaccessible) shared mem segment */
-		up->shm = getShmTime(unit);
-	}
-	shm = up->shm;
-	if (shm == 0) {
-		DPRINTF(1, ("%s: no SHM segment\n",
-			    refnumtoa(&peer->srcadr)));
-		return;
+		shm = up->shm = getShmTime(unit, up->forall);
+		if (shm == NULL) {
+			DPRINTF(1, ("%s: no SHM segment\n",
+				    refnumtoa(&peer->srcadr)));
+			return;
+		}
 	}
 	if ( ! shm->valid) {
 		DPRINTF(1, ("%s: SHM not ready\n",
@@ -544,28 +546,17 @@
 	struct peer *peer
 	)
 {
-	struct refclockproc *pp;
-	struct shmunit *up;
-	char logbuf[64];
-	unsigned int llen;
-
-	pp = peer->procptr;
-	up = pp->unitptr;
+	struct refclockproc * const pp = peer->procptr;
+	struct shmunit *      const up = pp->unitptr;
 
+	UNUSED_ARG(unit);
 	if (pp->sloppyclockflag & CLK_FLAG4) {
-		/* if snprintf() returns a negative values on errors
-		** (some older ones do) make sure we are NUL
-		** terminated. Using an unsigned result does the trick.
-		*/
-		llen = snprintf(logbuf, sizeof(logbuf),
-				"%3d %3d %3d %3d %3d",
-				up->ticks, up->good, up->notready,
-				up->bad, up->clash);
-		logbuf[min(llen, sizeof(logbuf)-1)] = '\0';
-		record_clock_stats(&peer->srcadr, logbuf);
+		mprintf_clock_stats(
+			&peer->srcadr, "%3d %3d %3d %3d %3d",
+			up->ticks, up->good, up->notready,
+			up->bad, up->clash);
 	}
 	up->ticks = up->good = up->notready = up->bad = up->clash = 0;
-
 }
 
 #else
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/ntpdate/Makefile.in /cur/src/external/bsd/ntp/dist/ntpdate/Makefile.in
--- external/bsd/ntp/dist/ntpdate/Makefile.in	2014-12-19 12:37:42.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/ntpdate/Makefile.in	2015-04-07 19:51:17.000000000 -0700
@@ -48,8 +48,7 @@
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
 	$(top_srcdir)/sntp/libopts/m4/stdnoreturn.m4 \
-	$(top_srcdir)/sntp/libevent/m4/openldap-thread-check.m4 \
-	$(top_srcdir)/sntp/libevent/m4/openldap.m4 \
+	$(top_srcdir)/sntp/m4/ax_c99_struct_init.m4 \
 	$(top_srcdir)/sntp/m4/define_dir.m4 \
 	$(top_srcdir)/sntp/m4/hms_search_lib.m4 \
 	$(top_srcdir)/sntp/m4/libtool.m4 \
@@ -78,6 +77,8 @@
 	$(top_srcdir)/sntp/m4/ntp_sntp.m4 \
 	$(top_srcdir)/sntp/m4/ntp_ver_suffix.m4 \
 	$(top_srcdir)/sntp/m4/ntp_vpathhack.m4 \
+	$(top_srcdir)/sntp/m4/openldap-thread-check.m4 \
+	$(top_srcdir)/sntp/m4/openldap.m4 \
 	$(top_srcdir)/sntp/m4/os_cflags.m4 \
 	$(top_srcdir)/sntp/m4/snprintf.m4 \
 	$(top_srcdir)/sntp/m4/version.m4 $(top_srcdir)/configure.ac
@@ -153,6 +154,7 @@
 CONFIG_SHELL = @CONFIG_SHELL@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
+CPPFLAGS_LIBEVENT = @CPPFLAGS_LIBEVENT@
 CPPFLAGS_NTP = @CPPFLAGS_NTP@
 CXX = @CXX@
 CXXCPP = @CXXCPP@
@@ -187,7 +189,9 @@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 LD = @LD@
+LDADD_LIBEVENT = @LDADD_LIBEVENT@
 LDADD_LIBNTP = @LDADD_LIBNTP@
+LDADD_LIBUTIL = @LDADD_LIBUTIL@
 LDADD_NLIST = @LDADD_NLIST@
 LDADD_NTP = @LDADD_NTP@
 LDFLAGS = @LDFLAGS@
@@ -326,6 +330,11 @@
 TIMETRIM_DS = @TIMETRIM_DS@
 TIMETRIM_MS = @TIMETRIM_MS@
 TIMETRIM_NI = @TIMETRIM_NI@
+UPDATE_LEAP_DB = @UPDATE_LEAP_DB@
+UPDATE_LEAP_DL = @UPDATE_LEAP_DL@
+UPDATE_LEAP_DS = @UPDATE_LEAP_DS@
+UPDATE_LEAP_MS = @UPDATE_LEAP_MS@
+UPDATE_LEAP_NI = @UPDATE_LEAP_NI@
 VERSION = @VERSION@
 VER_SUFFIX = @VER_SUFFIX@
 YACC = @YACC@
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/ntpdc/Makefile.in /cur/src/external/bsd/ntp/dist/ntpdc/Makefile.in
--- external/bsd/ntp/dist/ntpdc/Makefile.in	2014-12-19 12:37:42.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/ntpdc/Makefile.in	2015-04-07 19:51:17.000000000 -0700
@@ -50,8 +50,7 @@
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
 	$(top_srcdir)/sntp/libopts/m4/stdnoreturn.m4 \
-	$(top_srcdir)/sntp/libevent/m4/openldap-thread-check.m4 \
-	$(top_srcdir)/sntp/libevent/m4/openldap.m4 \
+	$(top_srcdir)/sntp/m4/ax_c99_struct_init.m4 \
 	$(top_srcdir)/sntp/m4/define_dir.m4 \
 	$(top_srcdir)/sntp/m4/hms_search_lib.m4 \
 	$(top_srcdir)/sntp/m4/libtool.m4 \
@@ -80,6 +79,8 @@
 	$(top_srcdir)/sntp/m4/ntp_sntp.m4 \
 	$(top_srcdir)/sntp/m4/ntp_ver_suffix.m4 \
 	$(top_srcdir)/sntp/m4/ntp_vpathhack.m4 \
+	$(top_srcdir)/sntp/m4/openldap-thread-check.m4 \
+	$(top_srcdir)/sntp/m4/openldap.m4 \
 	$(top_srcdir)/sntp/m4/os_cflags.m4 \
 	$(top_srcdir)/sntp/m4/snprintf.m4 \
 	$(top_srcdir)/sntp/m4/version.m4 $(top_srcdir)/configure.ac
@@ -187,6 +188,7 @@
 CONFIG_SHELL = @CONFIG_SHELL@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
+CPPFLAGS_LIBEVENT = @CPPFLAGS_LIBEVENT@
 CPPFLAGS_NTP = @CPPFLAGS_NTP@
 CXX = @CXX@
 CXXCPP = @CXXCPP@
@@ -221,7 +223,9 @@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 LD = @LD@
+LDADD_LIBEVENT = @LDADD_LIBEVENT@
 LDADD_LIBNTP = @LDADD_LIBNTP@
+LDADD_LIBUTIL = @LDADD_LIBUTIL@
 LDADD_NLIST = @LDADD_NLIST@
 LDADD_NTP = @LDADD_NTP@
 LDFLAGS = @LDFLAGS@
@@ -360,6 +364,11 @@
 TIMETRIM_DS = @TIMETRIM_DS@
 TIMETRIM_MS = @TIMETRIM_MS@
 TIMETRIM_NI = @TIMETRIM_NI@
+UPDATE_LEAP_DB = @UPDATE_LEAP_DB@
+UPDATE_LEAP_DL = @UPDATE_LEAP_DL@
+UPDATE_LEAP_DS = @UPDATE_LEAP_DS@
+UPDATE_LEAP_MS = @UPDATE_LEAP_MS@
+UPDATE_LEAP_NI = @UPDATE_LEAP_NI@
 VERSION = @VERSION@
 VER_SUFFIX = @VER_SUFFIX@
 YACC = @YACC@
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/ntpdc/invoke-ntpdc.texi /cur/src/external/bsd/ntp/dist/ntpdc/invoke-ntpdc.texi
--- external/bsd/ntp/dist/ntpdc/invoke-ntpdc.texi	2014-12-19 12:37:42.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/ntpdc/invoke-ntpdc.texi	2015-04-07 19:51:17.000000000 -0700
@@ -6,7 +6,7 @@
 #
 # EDIT THIS FILE WITH CAUTION  (invoke-ntpdc.texi)
 #
-# It has been AutoGen-ed  December 19, 2014 at 07:49:42 AM by AutoGen 5.18.5pre4
+# It has been AutoGen-ed  April  7, 2015 at 04:26:32 AM by AutoGen 5.18.5pre4
 # From the definitions    ntpdc-opts.def
 # and the template file   agtexi-cmd.tpl
 @end ignore
@@ -76,7 +76,7 @@
 
 @exampleindent 0
 @example
-ntpdc - vendor-specific NTPD control program - Ver. 4.2.8
+ntpdc - vendor-specific NTPD control program - Ver. 4.2.8p2
 Usage:  ntpdc [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]... [ host ...]
   Flg Arg Option-Name    Description
    -4 no  ipv4           Force IPv4 DNS name resolution
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/ntpdc/ntpdc-opts.c /cur/src/external/bsd/ntp/dist/ntpdc/ntpdc-opts.c
--- external/bsd/ntp/dist/ntpdc/ntpdc-opts.c	2014-12-24 18:28:10.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/ntpdc/ntpdc-opts.c	2015-04-07 19:51:17.000000000 -0700
@@ -3,7 +3,7 @@
 /*
  *  EDIT THIS FILE WITH CAUTION  (ntpdc-opts.c)
  *
- *  It has been AutoGen-ed  December 19, 2014 at 07:49:26 AM by AutoGen 5.18.5pre4
+ *  It has been AutoGen-ed  April  7, 2015 at 04:26:14 AM by AutoGen 5.18.5pre4
  *  From the definitions    ntpdc-opts.def
  *  and the template file   options
  *
@@ -20,7 +20,7 @@
  * The ntpdc program is copyrighted and licensed
  * under the following terms:
  *
- *  Copyright (C) 1970-2014 The University of Delaware, all rights reserved.
+ *  Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation, all rights reserved.
  *  This is free software. It is licensed for use, modification and
  *  redistribution under the terms of the NTP License, copies of which
  *  can be seen at:
@@ -33,7 +33,7 @@
  *  both the copyright notice and this permission notice appear in
  *  supporting documentation, and that the name The University of Delaware not be used in
  *  advertising or publicity pertaining to distribution of the software
- *  without specific, written prior permission. The University of Delaware makes no
+ *  without specific, written prior permission. The University of Delaware and Network Time Foundation makes no
  *  representations about the suitability this software for any purpose. It
  *  is provided "as is" without express or implied warranty.
  */
@@ -52,7 +52,7 @@
 #endif
 extern FILE * option_usage_fp;
 #define zCopyright      (ntpdc_opt_strs+0)
-#define zLicenseDescrip (ntpdc_opt_strs+311)
+#define zLicenseDescrip (ntpdc_opt_strs+341)
 
 /*
  *  global included definitions
@@ -70,84 +70,85 @@
 /**
  *  static const strings for ntpdc options
  */
-static char const ntpdc_opt_strs[1849] =
-/*     0 */ "ntpdc 4.2.8\n"
-            "Copyright (C) 1970-2014 The University of Delaware, all rights reserved.\n"
+static char const ntpdc_opt_strs[1911] =
+/*     0 */ "ntpdc 4.2.8p2\n"
+            "Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation, all rights reserved.\n"
             "This is free software. It is licensed for use, modification and\n"
             "redistribution under the terms of the NTP License, copies of which\n"
             "can be seen at:\n"
             "  <http://ntp.org/license>\n"
             "  <http://opensource.org/licenses/ntp-license.php>\n\0"
-/*   311 */ "Permission to use, copy, modify, and distribute this software and its\n"
+/*   341 */ "Permission to use, copy, modify, and distribute this software and its\n"
             "documentation for any purpose with or without fee is hereby granted,\n"
             "provided that the above copyright notice appears in all copies and that\n"
             "both the copyright notice and this permission notice appear in supporting\n"
             "documentation, and that the name The University of Delaware not be used in\n"
             "advertising or publicity pertaining to distribution of the software without\n"
-            "specific, written prior permission.  The University of Delaware makes no\n"
-            "representations about the suitability this software for any purpose.  It is\n"
-            "provided \"as is\" without express or implied warranty.\n\0"
-/*   951 */ "Force IPv4 DNS name resolution\0"
-/*   982 */ "IPV4\0"
-/*   987 */ "ipv4\0"
-/*   992 */ "Force IPv6 DNS name resolution\0"
-/*  1023 */ "IPV6\0"
-/*  1028 */ "ipv6\0"
-/*  1033 */ "run a command and exit\0"
-/*  1056 */ "COMMAND\0"
-/*  1064 */ "command\0"
-/*  1072 */ "Increase debug verbosity level\0"
-/*  1103 */ "DEBUG_LEVEL\0"
-/*  1115 */ "debug-level\0"
-/*  1127 */ "Set the debug verbosity level\0"
-/*  1157 */ "SET_DEBUG_LEVEL\0"
-/*  1173 */ "set-debug-level\0"
-/*  1189 */ "Force ntpq to operate in interactive mode\0"
-/*  1231 */ "INTERACTIVE\0"
-/*  1243 */ "interactive\0"
-/*  1255 */ "Print a list of the peers\0"
-/*  1281 */ "LISTPEERS\0"
-/*  1291 */ "listpeers\0"
-/*  1301 */ "numeric host addresses\0"
-/*  1324 */ "NUMERIC\0"
-/*  1332 */ "numeric\0"
-/*  1340 */ "PEERS\0"
-/*  1346 */ "peers\0"
-/*  1352 */ "Show a list of the peers\0"
-/*  1377 */ "SHOWPEERS\0"
-/*  1387 */ "showpeers\0"
-/*  1397 */ "display extended usage information and exit\0"
-/*  1441 */ "help\0"
-/*  1446 */ "extended usage information passed thru pager\0"
-/*  1491 */ "more-help\0"
-/*  1501 */ "output version information and exit\0"
-/*  1537 */ "version\0"
-/*  1545 */ "save the option state to a config file\0"
-/*  1584 */ "save-opts\0"
-/*  1594 */ "load options from a config file\0"
-/*  1626 */ "LOAD_OPTS\0"
-/*  1636 */ "no-load-opts\0"
-/*  1649 */ "no\0"
-/*  1652 */ "NTPDC\0"
-/*  1658 */ "ntpdc - vendor-specific NTPD control program - Ver. 4.2.8\n"
+            "specific, written prior permission.  The University of Delaware and Network\n"
+            "Time Foundation makes no representations about the suitability this\n"
+            "software for any purpose.  It is provided \"as is\" without express or\n"
+            "implied warranty.\n\0"
+/*  1009 */ "Force IPv4 DNS name resolution\0"
+/*  1040 */ "IPV4\0"
+/*  1045 */ "ipv4\0"
+/*  1050 */ "Force IPv6 DNS name resolution\0"
+/*  1081 */ "IPV6\0"
+/*  1086 */ "ipv6\0"
+/*  1091 */ "run a command and exit\0"
+/*  1114 */ "COMMAND\0"
+/*  1122 */ "command\0"
+/*  1130 */ "Increase debug verbosity level\0"
+/*  1161 */ "DEBUG_LEVEL\0"
+/*  1173 */ "debug-level\0"
+/*  1185 */ "Set the debug verbosity level\0"
+/*  1215 */ "SET_DEBUG_LEVEL\0"
+/*  1231 */ "set-debug-level\0"
+/*  1247 */ "Force ntpq to operate in interactive mode\0"
+/*  1289 */ "INTERACTIVE\0"
+/*  1301 */ "interactive\0"
+/*  1313 */ "Print a list of the peers\0"
+/*  1339 */ "LISTPEERS\0"
+/*  1349 */ "listpeers\0"
+/*  1359 */ "numeric host addresses\0"
+/*  1382 */ "NUMERIC\0"
+/*  1390 */ "numeric\0"
+/*  1398 */ "PEERS\0"
+/*  1404 */ "peers\0"
+/*  1410 */ "Show a list of the peers\0"
+/*  1435 */ "SHOWPEERS\0"
+/*  1445 */ "showpeers\0"
+/*  1455 */ "display extended usage information and exit\0"
+/*  1499 */ "help\0"
+/*  1504 */ "extended usage information passed thru pager\0"
+/*  1549 */ "more-help\0"
+/*  1559 */ "output version information and exit\0"
+/*  1595 */ "version\0"
+/*  1603 */ "save the option state to a config file\0"
+/*  1642 */ "save-opts\0"
+/*  1652 */ "load options from a config file\0"
+/*  1684 */ "LOAD_OPTS\0"
+/*  1694 */ "no-load-opts\0"
+/*  1707 */ "no\0"
+/*  1710 */ "NTPDC\0"
+/*  1716 */ "ntpdc - vendor-specific NTPD control program - Ver. 4.2.8p2\n"
             "Usage:  %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... [ host ...]\n\0"
-/*  1786 */ "$HOME\0"
-/*  1792 */ ".\0"
-/*  1794 */ ".ntprc\0"
-/*  1801 */ "http://bugs.ntp.org, bugs@ntp.org\0"
-/*  1835 */ "\n\0"
-/*  1837 */ "ntpdc 4.2.8";
+/*  1846 */ "$HOME\0"
+/*  1852 */ ".\0"
+/*  1854 */ ".ntprc\0"
+/*  1861 */ "http://bugs.ntp.org, bugs@ntp.org\0"
+/*  1895 */ "\n\0"
+/*  1897 */ "ntpdc 4.2.8p2";
 
 /**
  *  ipv4 option description with
  *  "Must also have options" and "Incompatible options":
  */
 /** Descriptive text for the ipv4 option */
-#define IPV4_DESC      (ntpdc_opt_strs+951)
+#define IPV4_DESC      (ntpdc_opt_strs+1009)
 /** Upper-cased name for the ipv4 option */
-#define IPV4_NAME      (ntpdc_opt_strs+982)
+#define IPV4_NAME      (ntpdc_opt_strs+1040)
 /** Name string for the ipv4 option */
-#define IPV4_name      (ntpdc_opt_strs+987)
+#define IPV4_name      (ntpdc_opt_strs+1045)
 /** Other options that appear in conjunction with the ipv4 option */
 static int const aIpv4CantList[] = {
     INDEX_OPT_IPV6, NO_EQUIVALENT };
@@ -159,11 +160,11 @@
  *  "Must also have options" and "Incompatible options":
  */
 /** Descriptive text for the ipv6 option */
-#define IPV6_DESC      (ntpdc_opt_strs+992)
+#define IPV6_DESC      (ntpdc_opt_strs+1050)
 /** Upper-cased name for the ipv6 option */
-#define IPV6_NAME      (ntpdc_opt_strs+1023)
+#define IPV6_NAME      (ntpdc_opt_strs+1081)
 /** Name string for the ipv6 option */
-#define IPV6_name      (ntpdc_opt_strs+1028)
+#define IPV6_name      (ntpdc_opt_strs+1086)
 /** Other options that appear in conjunction with the ipv6 option */
 static int const aIpv6CantList[] = {
     INDEX_OPT_IPV4, NO_EQUIVALENT };
@@ -174,11 +175,11 @@
  *  command option description:
  */
 /** Descriptive text for the command option */
-#define COMMAND_DESC      (ntpdc_opt_strs+1033)
+#define COMMAND_DESC      (ntpdc_opt_strs+1091)
 /** Upper-cased name for the command option */
-#define COMMAND_NAME      (ntpdc_opt_strs+1056)
+#define COMMAND_NAME      (ntpdc_opt_strs+1114)
 /** Name string for the command option */
-#define COMMAND_name      (ntpdc_opt_strs+1064)
+#define COMMAND_name      (ntpdc_opt_strs+1122)
 /** Compiled in flag settings for the command option */
 #define COMMAND_FLAGS     (OPTST_DISABLED | OPTST_STACKED \
         | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
@@ -187,11 +188,11 @@
  *  debug-level option description:
  */
 /** Descriptive text for the debug-level option */
-#define DEBUG_LEVEL_DESC      (ntpdc_opt_strs+1072)
+#define DEBUG_LEVEL_DESC      (ntpdc_opt_strs+1130)
 /** Upper-cased name for the debug-level option */
-#define DEBUG_LEVEL_NAME      (ntpdc_opt_strs+1103)
+#define DEBUG_LEVEL_NAME      (ntpdc_opt_strs+1161)
 /** Name string for the debug-level option */
-#define DEBUG_LEVEL_name      (ntpdc_opt_strs+1115)
+#define DEBUG_LEVEL_name      (ntpdc_opt_strs+1173)
 /** Compiled in flag settings for the debug-level option */
 #define DEBUG_LEVEL_FLAGS     (OPTST_DISABLED)
 
@@ -199,11 +200,11 @@
  *  set-debug-level option description:
  */
 /** Descriptive text for the set-debug-level option */
-#define SET_DEBUG_LEVEL_DESC      (ntpdc_opt_strs+1127)
+#define SET_DEBUG_LEVEL_DESC      (ntpdc_opt_strs+1185)
 /** Upper-cased name for the set-debug-level option */
-#define SET_DEBUG_LEVEL_NAME      (ntpdc_opt_strs+1157)
+#define SET_DEBUG_LEVEL_NAME      (ntpdc_opt_strs+1215)
 /** Name string for the set-debug-level option */
-#define SET_DEBUG_LEVEL_name      (ntpdc_opt_strs+1173)
+#define SET_DEBUG_LEVEL_name      (ntpdc_opt_strs+1231)
 /** Compiled in flag settings for the set-debug-level option */
 #define SET_DEBUG_LEVEL_FLAGS     (OPTST_DISABLED \
         | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
@@ -213,11 +214,11 @@
  *  "Must also have options" and "Incompatible options":
  */
 /** Descriptive text for the interactive option */
-#define INTERACTIVE_DESC      (ntpdc_opt_strs+1189)
+#define INTERACTIVE_DESC      (ntpdc_opt_strs+1247)
 /** Upper-cased name for the interactive option */
-#define INTERACTIVE_NAME      (ntpdc_opt_strs+1231)
+#define INTERACTIVE_NAME      (ntpdc_opt_strs+1289)
 /** Name string for the interactive option */
-#define INTERACTIVE_name      (ntpdc_opt_strs+1243)
+#define INTERACTIVE_name      (ntpdc_opt_strs+1301)
 /** Other options that appear in conjunction with the interactive option */
 static int const aInteractiveCantList[] = {
     INDEX_OPT_COMMAND,
@@ -232,11 +233,11 @@
  *  "Must also have options" and "Incompatible options":
  */
 /** Descriptive text for the listpeers option */
-#define LISTPEERS_DESC      (ntpdc_opt_strs+1255)
+#define LISTPEERS_DESC      (ntpdc_opt_strs+1313)
 /** Upper-cased name for the listpeers option */
-#define LISTPEERS_NAME      (ntpdc_opt_strs+1281)
+#define LISTPEERS_NAME      (ntpdc_opt_strs+1339)
 /** Name string for the listpeers option */
-#define LISTPEERS_name      (ntpdc_opt_strs+1291)
+#define LISTPEERS_name      (ntpdc_opt_strs+1349)
 /** Other options that appear in conjunction with the listpeers option */
 static int const aListpeersCantList[] = {
     INDEX_OPT_COMMAND, NO_EQUIVALENT };
@@ -247,11 +248,11 @@
  *  numeric option description:
  */
 /** Descriptive text for the numeric option */
-#define NUMERIC_DESC      (ntpdc_opt_strs+1301)
+#define NUMERIC_DESC      (ntpdc_opt_strs+1359)
 /** Upper-cased name for the numeric option */
-#define NUMERIC_NAME      (ntpdc_opt_strs+1324)
+#define NUMERIC_NAME      (ntpdc_opt_strs+1382)
 /** Name string for the numeric option */
-#define NUMERIC_name      (ntpdc_opt_strs+1332)
+#define NUMERIC_name      (ntpdc_opt_strs+1390)
 /** Compiled in flag settings for the numeric option */
 #define NUMERIC_FLAGS     (OPTST_DISABLED)
 
@@ -260,11 +261,11 @@
  *  "Must also have options" and "Incompatible options":
  */
 /** Descriptive text for the peers option */
-#define PEERS_DESC      (ntpdc_opt_strs+1255)
+#define PEERS_DESC      (ntpdc_opt_strs+1313)
 /** Upper-cased name for the peers option */
-#define PEERS_NAME      (ntpdc_opt_strs+1340)
+#define PEERS_NAME      (ntpdc_opt_strs+1398)
 /** Name string for the peers option */
-#define PEERS_name      (ntpdc_opt_strs+1346)
+#define PEERS_name      (ntpdc_opt_strs+1404)
 /** Other options that appear in conjunction with the peers option */
 static int const aPeersCantList[] = {
     INDEX_OPT_COMMAND, NO_EQUIVALENT };
@@ -276,11 +277,11 @@
  *  "Must also have options" and "Incompatible options":
  */
 /** Descriptive text for the showpeers option */
-#define SHOWPEERS_DESC      (ntpdc_opt_strs+1352)
+#define SHOWPEERS_DESC      (ntpdc_opt_strs+1410)
 /** Upper-cased name for the showpeers option */
-#define SHOWPEERS_NAME      (ntpdc_opt_strs+1377)
+#define SHOWPEERS_NAME      (ntpdc_opt_strs+1435)
 /** Name string for the showpeers option */
-#define SHOWPEERS_name      (ntpdc_opt_strs+1387)
+#define SHOWPEERS_name      (ntpdc_opt_strs+1445)
 /** Other options that appear in conjunction with the showpeers option */
 static int const aShowpeersCantList[] = {
     INDEX_OPT_COMMAND, NO_EQUIVALENT };
@@ -290,11 +291,11 @@
 /*
  *  Help/More_Help/Version option descriptions:
  */
-#define HELP_DESC       (ntpdc_opt_strs+1397)
-#define HELP_name       (ntpdc_opt_strs+1441)
+#define HELP_DESC       (ntpdc_opt_strs+1455)
+#define HELP_name       (ntpdc_opt_strs+1499)
 #ifdef HAVE_WORKING_FORK
-#define MORE_HELP_DESC  (ntpdc_opt_strs+1446)
-#define MORE_HELP_name  (ntpdc_opt_strs+1491)
+#define MORE_HELP_DESC  (ntpdc_opt_strs+1504)
+#define MORE_HELP_name  (ntpdc_opt_strs+1549)
 #define MORE_HELP_FLAGS (OPTST_IMM | OPTST_NO_INIT)
 #else
 #define MORE_HELP_DESC  HELP_DESC
@@ -307,14 +308,14 @@
 #  define VER_FLAGS     (OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) | \
                          OPTST_ARG_OPTIONAL | OPTST_IMM | OPTST_NO_INIT)
 #endif
-#define VER_DESC        (ntpdc_opt_strs+1501)
-#define VER_name        (ntpdc_opt_strs+1537)
-#define SAVE_OPTS_DESC  (ntpdc_opt_strs+1545)
-#define SAVE_OPTS_name  (ntpdc_opt_strs+1584)
-#define LOAD_OPTS_DESC     (ntpdc_opt_strs+1594)
-#define LOAD_OPTS_NAME     (ntpdc_opt_strs+1626)
-#define NO_LOAD_OPTS_name  (ntpdc_opt_strs+1636)
-#define LOAD_OPTS_pfx      (ntpdc_opt_strs+1649)
+#define VER_DESC        (ntpdc_opt_strs+1559)
+#define VER_name        (ntpdc_opt_strs+1595)
+#define SAVE_OPTS_DESC  (ntpdc_opt_strs+1603)
+#define SAVE_OPTS_name  (ntpdc_opt_strs+1642)
+#define LOAD_OPTS_DESC     (ntpdc_opt_strs+1652)
+#define LOAD_OPTS_NAME     (ntpdc_opt_strs+1684)
+#define NO_LOAD_OPTS_name  (ntpdc_opt_strs+1694)
+#define LOAD_OPTS_pfx      (ntpdc_opt_strs+1707)
 #define LOAD_OPTS_name     (NO_LOAD_OPTS_name + 3)
 /**
  *  Declare option callback procedures
@@ -523,24 +524,24 @@
 
 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
 /** Reference to the upper cased version of ntpdc. */
-#define zPROGNAME       (ntpdc_opt_strs+1652)
+#define zPROGNAME       (ntpdc_opt_strs+1710)
 /** Reference to the title line for ntpdc usage. */
-#define zUsageTitle     (ntpdc_opt_strs+1658)
+#define zUsageTitle     (ntpdc_opt_strs+1716)
 /** ntpdc configuration file name. */
-#define zRcName         (ntpdc_opt_strs+1794)
+#define zRcName         (ntpdc_opt_strs+1854)
 /** Directories to search for ntpdc config files. */
 static char const * const apzHomeList[3] = {
-    ntpdc_opt_strs+1786,
-    ntpdc_opt_strs+1792,
+    ntpdc_opt_strs+1846,
+    ntpdc_opt_strs+1852,
     NULL };
 /** The ntpdc program bug email address. */
-#define zBugsAddr       (ntpdc_opt_strs+1801)
+#define zBugsAddr       (ntpdc_opt_strs+1861)
 /** Clarification/explanation of what ntpdc does. */
-#define zExplain        (ntpdc_opt_strs+1835)
+#define zExplain        (ntpdc_opt_strs+1895)
 /** Extra detail explaining what ntpdc does. */
 #define zDetail         (NULL)
 /** The full version string for ntpdc. */
-#define zFullVersion    (ntpdc_opt_strs+1837)
+#define zFullVersion    (ntpdc_opt_strs+1897)
 /* extracted from optcode.tlib near line 364 */
 
 #if defined(ENABLE_NLS)
@@ -797,8 +798,8 @@
      translate option names.
    */
   /* referenced via ntpdcOptions.pzCopyright */
-  puts(_("ntpdc 4.2.8\n\
-Copyright (C) 1970-2014 The University of Delaware, all rights reserved.\n\
+  puts(_("ntpdc 4.2.8p2\n\
+Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation, all rights reserved.\n\
 This is free software. It is licensed for use, modification and\n\
 redistribution under the terms of the NTP License, copies of which\n\
 can be seen at:\n"));
@@ -812,9 +813,10 @@
 both the copyright notice and this permission notice appear in supporting\n\
 documentation, and that the name The University of Delaware not be used in\n\
 advertising or publicity pertaining to distribution of the software without\n\
-specific, written prior permission.  The University of Delaware makes no\n\
-representations about the suitability this software for any purpose.  It is\n\
-provided \"as is\" without express or implied warranty.\n"));
+specific, written prior permission.  The University of Delaware and Network\n\
+Time Foundation makes no representations about the suitability this\n\
+software for any purpose.  It is provided \"as is\" without express or\n\
+implied warranty.\n"));
 
   /* referenced via ntpdcOptions.pOptDesc->pzText */
   puts(_("Force IPv4 DNS name resolution"));
@@ -862,14 +864,14 @@
   puts(_("load options from a config file"));
 
   /* referenced via ntpdcOptions.pzUsageTitle */
-  puts(_("ntpdc - vendor-specific NTPD control program - Ver. 4.2.8\n\
+  puts(_("ntpdc - vendor-specific NTPD control program - Ver. 4.2.8p2\n\
 Usage:  %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... [ host ...]\n"));
 
   /* referenced via ntpdcOptions.pzExplain */
   puts(_("\n"));
 
   /* referenced via ntpdcOptions.pzFullVersion */
-  puts(_("ntpdc 4.2.8"));
+  puts(_("ntpdc 4.2.8p2"));
 
   /* referenced via ntpdcOptions.pzFullUsage */
   puts(_("<<<NOT-FOUND>>>"));
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/ntpdc/ntpdc-opts.h /cur/src/external/bsd/ntp/dist/ntpdc/ntpdc-opts.h
--- external/bsd/ntp/dist/ntpdc/ntpdc-opts.h	2014-12-24 18:28:10.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/ntpdc/ntpdc-opts.h	2015-04-07 19:51:17.000000000 -0700
@@ -3,7 +3,7 @@
 /*
  *  EDIT THIS FILE WITH CAUTION  (ntpdc-opts.h)
  *
- *  It has been AutoGen-ed  December 19, 2014 at 07:49:25 AM by AutoGen 5.18.5pre4
+ *  It has been AutoGen-ed  April  7, 2015 at 04:26:14 AM by AutoGen 5.18.5pre4
  *  From the definitions    ntpdc-opts.def
  *  and the template file   options
  *
@@ -20,7 +20,7 @@
  * The ntpdc program is copyrighted and licensed
  * under the following terms:
  *
- *  Copyright (C) 1970-2014 The University of Delaware, all rights reserved.
+ *  Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation, all rights reserved.
  *  This is free software. It is licensed for use, modification and
  *  redistribution under the terms of the NTP License, copies of which
  *  can be seen at:
@@ -33,7 +33,7 @@
  *  both the copyright notice and this permission notice appear in
  *  supporting documentation, and that the name The University of Delaware not be used in
  *  advertising or publicity pertaining to distribution of the software
- *  without specific, written prior permission. The University of Delaware makes no
+ *  without specific, written prior permission. The University of Delaware and Network Time Foundation makes no
  *  representations about the suitability this software for any purpose. It
  *  is provided "as is" without express or implied warranty.
  */
@@ -85,9 +85,9 @@
 /** count of all options for ntpdc */
 #define OPTION_CT    15
 /** ntpdc version */
-#define NTPDC_VERSION       "4.2.8"
+#define NTPDC_VERSION       "4.2.8p2"
 /** Full ntpdc version text */
-#define NTPDC_FULL_VERSION  "ntpdc 4.2.8"
+#define NTPDC_FULL_VERSION  "ntpdc 4.2.8p2"
 
 /**
  *  Interface defines for all options.  Replace "n" with the UPPER_CASED
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/ntpdc/ntpdc.1ntpdcman /cur/src/external/bsd/ntp/dist/ntpdc/ntpdc.1ntpdcman
--- external/bsd/ntp/dist/ntpdc/ntpdc.1ntpdcman	2014-12-19 12:37:42.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/ntpdc/ntpdc.1ntpdcman	2015-04-07 19:51:17.000000000 -0700
@@ -10,11 +10,11 @@
 .ds B-Font B
 .ds I-Font I
 .ds R-Font R
-.TH ntpdc 1ntpdcman "19 Dec 2014" "4.2.8" "User Commands"
+.TH ntpdc 1ntpdcman "07 Apr 2015" "4.2.8p2" "User Commands"
 .\"
-.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-Fraief/ag-Rraadf)
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-dXaWh5/ag-rXaOg5)
 .\"
-.\" It has been AutoGen-ed December 19, 2014 at 07:49:38 AM by AutoGen 5.18.5pre4
+.\" It has been AutoGen-ed April 7, 2015 at 04:26:27 AM by AutoGen 5.18.5pre4
 .\" From the definitions ntpdc-opts.def
 .\" and the template file agman-cmd.tpl
 .SH NAME
@@ -848,7 +848,7 @@
 .SH AUTHORS
 The formatting directives in this document came from FreeBSD.
 .SH "COPYRIGHT"
-Copyright (C) 1970-2014 The University of Delaware all rights reserved.
+Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation all rights reserved.
 This program is released under the terms of the NTP license, <http://ntp.org/license>.
 .SH BUGS
 The
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/ntpdc/ntpdc.1ntpdcmdoc /cur/src/external/bsd/ntp/dist/ntpdc/ntpdc.1ntpdcmdoc
--- external/bsd/ntp/dist/ntpdc/ntpdc.1ntpdcmdoc	2014-12-19 12:37:42.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/ntpdc/ntpdc.1ntpdcmdoc	2015-04-07 19:51:17.000000000 -0700
@@ -1,9 +1,9 @@
-.Dd December 19 2014
+.Dd April 7 2015
 .Dt NTPDC 1ntpdcmdoc User Commands
 .Os
 .\"  EDIT THIS FILE WITH CAUTION  (ntpdc-opts.mdoc)
 .\"
-.\"  It has been AutoGen-ed  December 19, 2014 at 07:49:44 AM by AutoGen 5.18.5pre4
+.\"  It has been AutoGen-ed  April  7, 2015 at 04:26:34 AM by AutoGen 5.18.5pre4
 .\"  From the definitions    ntpdc-opts.def
 .\"  and the template file   agmdoc-cmd.tpl
 .Sh NAME
@@ -787,7 +787,7 @@
 .Sh AUTHORS
 The formatting directives in this document came from FreeBSD.
 .Sh "COPYRIGHT"
-Copyright (C) 1970\-2014 The University of Delaware all rights reserved.
+Copyright (C) 1992\-2015 The University of Delaware and Network Time Foundation all rights reserved.
 This program is released under the terms of the NTP license, <http://ntp.org/license>.
 .Sh BUGS
 The
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/ntpdc/ntpdc.html /cur/src/external/bsd/ntp/dist/ntpdc/ntpdc.html
--- external/bsd/ntp/dist/ntpdc/ntpdc.html	2014-12-19 12:37:43.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/ntpdc/ntpdc.html	2015-04-07 19:51:17.000000000 -0700
@@ -36,7 +36,7 @@
 clock.  Run as root, it can correct the system clock to this offset as
 well.  It can be run as an interactive command or from a cron job.
 
-  <p>This document applies to version 4.2.8 of <code>ntpdc</code>.
+  <p>This document applies to version 4.2.8p2 of <code>ntpdc</code>.
 
   <p>The program implements the SNTP protocol as defined by RFC 5905, the NTPv4
 IETF specification.
@@ -152,7 +152,7 @@
 used to select the program, defaulting to <span class="file">more</span>.  Both will exit
 with a status code of 0.
 
-<pre class="example">ntpdc - vendor-specific NTPD control program - Ver. 4.2.8
+<pre class="example">ntpdc - vendor-specific NTPD control program - Ver. 4.2.8p2
 Usage:  ntpdc [ -&lt;flag&gt; [&lt;val&gt;] | --&lt;name&gt;[{=| }&lt;val&gt;] ]... [ host ...]
   Flg Arg Option-Name    Description
    -4 no  ipv4           Force IPv4 DNS name resolution
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/ntpdc/ntpdc.man.in /cur/src/external/bsd/ntp/dist/ntpdc/ntpdc.man.in
--- external/bsd/ntp/dist/ntpdc/ntpdc.man.in	2014-12-19 12:37:42.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/ntpdc/ntpdc.man.in	2015-04-07 19:51:17.000000000 -0700
@@ -10,11 +10,11 @@
 .ds B-Font B
 .ds I-Font I
 .ds R-Font R
-.TH ntpdc @NTPDC_MS@ "19 Dec 2014" "4.2.8" "User Commands"
+.TH ntpdc @NTPDC_MS@ "07 Apr 2015" "4.2.8p2" "User Commands"
 .\"
-.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-Fraief/ag-Rraadf)
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-dXaWh5/ag-rXaOg5)
 .\"
-.\" It has been AutoGen-ed December 19, 2014 at 07:49:38 AM by AutoGen 5.18.5pre4
+.\" It has been AutoGen-ed April 7, 2015 at 04:26:27 AM by AutoGen 5.18.5pre4
 .\" From the definitions ntpdc-opts.def
 .\" and the template file agman-cmd.tpl
 .SH NAME
@@ -848,7 +848,7 @@
 .SH AUTHORS
 The formatting directives in this document came from FreeBSD.
 .SH "COPYRIGHT"
-Copyright (C) 1970-2014 The University of Delaware all rights reserved.
+Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation all rights reserved.
 This program is released under the terms of the NTP license, <http://ntp.org/license>.
 .SH BUGS
 The
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/ntpdc/ntpdc.mdoc.in /cur/src/external/bsd/ntp/dist/ntpdc/ntpdc.mdoc.in
--- external/bsd/ntp/dist/ntpdc/ntpdc.mdoc.in	2014-12-19 12:37:42.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/ntpdc/ntpdc.mdoc.in	2015-04-07 19:51:17.000000000 -0700
@@ -1,9 +1,9 @@
-.Dd December 19 2014
+.Dd April 7 2015
 .Dt NTPDC @NTPDC_MS@ User Commands
 .Os
 .\"  EDIT THIS FILE WITH CAUTION  (ntpdc-opts.mdoc)
 .\"
-.\"  It has been AutoGen-ed  December 19, 2014 at 07:49:44 AM by AutoGen 5.18.5pre4
+.\"  It has been AutoGen-ed  April  7, 2015 at 04:26:34 AM by AutoGen 5.18.5pre4
 .\"  From the definitions    ntpdc-opts.def
 .\"  and the template file   agmdoc-cmd.tpl
 .Sh NAME
@@ -787,7 +787,7 @@
 .Sh AUTHORS
 The formatting directives in this document came from FreeBSD.
 .Sh "COPYRIGHT"
-Copyright (C) 1970\-2014 The University of Delaware all rights reserved.
+Copyright (C) 1992\-2015 The University of Delaware and Network Time Foundation all rights reserved.
 This program is released under the terms of the NTP license, <http://ntp.org/license>.
 .Sh BUGS
 The
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/ntpq/Makefile.in /cur/src/external/bsd/ntp/dist/ntpq/Makefile.in
--- external/bsd/ntp/dist/ntpq/Makefile.in	2014-12-19 12:37:42.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/ntpq/Makefile.in	2015-04-07 19:51:17.000000000 -0700
@@ -50,8 +50,7 @@
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
 	$(top_srcdir)/sntp/libopts/m4/stdnoreturn.m4 \
-	$(top_srcdir)/sntp/libevent/m4/openldap-thread-check.m4 \
-	$(top_srcdir)/sntp/libevent/m4/openldap.m4 \
+	$(top_srcdir)/sntp/m4/ax_c99_struct_init.m4 \
 	$(top_srcdir)/sntp/m4/define_dir.m4 \
 	$(top_srcdir)/sntp/m4/hms_search_lib.m4 \
 	$(top_srcdir)/sntp/m4/libtool.m4 \
@@ -80,6 +79,8 @@
 	$(top_srcdir)/sntp/m4/ntp_sntp.m4 \
 	$(top_srcdir)/sntp/m4/ntp_ver_suffix.m4 \
 	$(top_srcdir)/sntp/m4/ntp_vpathhack.m4 \
+	$(top_srcdir)/sntp/m4/openldap-thread-check.m4 \
+	$(top_srcdir)/sntp/m4/openldap.m4 \
 	$(top_srcdir)/sntp/m4/os_cflags.m4 \
 	$(top_srcdir)/sntp/m4/snprintf.m4 \
 	$(top_srcdir)/sntp/m4/version.m4 $(top_srcdir)/configure.ac
@@ -194,6 +195,7 @@
 CONFIG_SHELL = @CONFIG_SHELL@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
+CPPFLAGS_LIBEVENT = @CPPFLAGS_LIBEVENT@
 CPPFLAGS_NTP = @CPPFLAGS_NTP@
 CXX = @CXX@
 CXXCPP = @CXXCPP@
@@ -228,7 +230,9 @@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 LD = @LD@
+LDADD_LIBEVENT = @LDADD_LIBEVENT@
 LDADD_LIBNTP = @LDADD_LIBNTP@
+LDADD_LIBUTIL = @LDADD_LIBUTIL@
 LDADD_NLIST = @LDADD_NLIST@
 LDADD_NTP = @LDADD_NTP@
 LDFLAGS = @LDFLAGS@
@@ -367,6 +371,11 @@
 TIMETRIM_DS = @TIMETRIM_DS@
 TIMETRIM_MS = @TIMETRIM_MS@
 TIMETRIM_NI = @TIMETRIM_NI@
+UPDATE_LEAP_DB = @UPDATE_LEAP_DB@
+UPDATE_LEAP_DL = @UPDATE_LEAP_DL@
+UPDATE_LEAP_DS = @UPDATE_LEAP_DS@
+UPDATE_LEAP_MS = @UPDATE_LEAP_MS@
+UPDATE_LEAP_NI = @UPDATE_LEAP_NI@
 VERSION = @VERSION@
 VER_SUFFIX = @VER_SUFFIX@
 YACC = @YACC@
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/ntpq/invoke-ntpq.texi /cur/src/external/bsd/ntp/dist/ntpq/invoke-ntpq.texi
--- external/bsd/ntp/dist/ntpq/invoke-ntpq.texi	2014-12-19 12:37:42.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/ntpq/invoke-ntpq.texi	2015-04-07 19:51:17.000000000 -0700
@@ -6,7 +6,7 @@
 #
 # EDIT THIS FILE WITH CAUTION  (invoke-ntpq.texi)
 #
-# It has been AutoGen-ed  December 19, 2014 at 07:50:17 AM by AutoGen 5.18.5pre4
+# It has been AutoGen-ed  April  7, 2015 at 04:27:07 AM by AutoGen 5.18.5pre4
 # From the definitions    ntpq-opts.def
 # and the template file   agtexi-cmd.tpl
 @end ignore
@@ -835,7 +835,7 @@
 
 @exampleindent 0
 @example
-ntpq - standard NTP query program - Ver. 4.2.8
+ntpq - standard NTP query program - Ver. 4.2.8p2
 Usage:  ntpq [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]... [ host ...]
   Flg Arg Option-Name    Description
    -4 no  ipv4           Force IPv4 DNS name resolution
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/ntpq/ntpq-opts.c /cur/src/external/bsd/ntp/dist/ntpq/ntpq-opts.c
--- external/bsd/ntp/dist/ntpq/ntpq-opts.c	2014-12-24 18:28:11.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/ntpq/ntpq-opts.c	2015-04-07 19:51:17.000000000 -0700
@@ -3,7 +3,7 @@
 /*
  *  EDIT THIS FILE WITH CAUTION  (ntpq-opts.c)
  *
- *  It has been AutoGen-ed  December 19, 2014 at 07:49:47 AM by AutoGen 5.18.5pre4
+ *  It has been AutoGen-ed  April  7, 2015 at 04:26:37 AM by AutoGen 5.18.5pre4
  *  From the definitions    ntpq-opts.def
  *  and the template file   options
  *
@@ -20,7 +20,7 @@
  * The ntpq program is copyrighted and licensed
  * under the following terms:
  *
- *  Copyright (C) 1970-2014 The University of Delaware, all rights reserved.
+ *  Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation, all rights reserved.
  *  This is free software. It is licensed for use, modification and
  *  redistribution under the terms of the NTP License, copies of which
  *  can be seen at:
@@ -33,7 +33,7 @@
  *  both the copyright notice and this permission notice appear in
  *  supporting documentation, and that the name The University of Delaware not be used in
  *  advertising or publicity pertaining to distribution of the software
- *  without specific, written prior permission. The University of Delaware makes no
+ *  without specific, written prior permission. The University of Delaware and Network Time Foundation makes no
  *  representations about the suitability this software for any purpose. It
  *  is provided "as is" without express or implied warranty.
  */
@@ -52,7 +52,7 @@
 #endif
 extern FILE * option_usage_fp;
 #define zCopyright      (ntpq_opt_strs+0)
-#define zLicenseDescrip (ntpq_opt_strs+310)
+#define zLicenseDescrip (ntpq_opt_strs+340)
 
 /*
  *  global included definitions
@@ -70,84 +70,85 @@
 /**
  *  static const strings for ntpq options
  */
-static char const ntpq_opt_strs[1863] =
-/*     0 */ "ntpq 4.2.8\n"
-            "Copyright (C) 1970-2014 The University of Delaware, all rights reserved.\n"
+static char const ntpq_opt_strs[1925] =
+/*     0 */ "ntpq 4.2.8p2\n"
+            "Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation, all rights reserved.\n"
             "This is free software. It is licensed for use, modification and\n"
             "redistribution under the terms of the NTP License, copies of which\n"
             "can be seen at:\n"
             "  <http://ntp.org/license>\n"
             "  <http://opensource.org/licenses/ntp-license.php>\n\0"
-/*   310 */ "Permission to use, copy, modify, and distribute this software and its\n"
+/*   340 */ "Permission to use, copy, modify, and distribute this software and its\n"
             "documentation for any purpose with or without fee is hereby granted,\n"
             "provided that the above copyright notice appears in all copies and that\n"
             "both the copyright notice and this permission notice appear in supporting\n"
             "documentation, and that the name The University of Delaware not be used in\n"
             "advertising or publicity pertaining to distribution of the software without\n"
-            "specific, written prior permission.  The University of Delaware makes no\n"
-            "representations about the suitability this software for any purpose.  It is\n"
-            "provided \"as is\" without express or implied warranty.\n\0"
-/*   950 */ "Force IPv4 DNS name resolution\0"
-/*   981 */ "IPV4\0"
-/*   986 */ "ipv4\0"
-/*   991 */ "Force IPv6 DNS name resolution\0"
-/*  1022 */ "IPV6\0"
-/*  1027 */ "ipv6\0"
-/*  1032 */ "run a command and exit\0"
-/*  1055 */ "COMMAND\0"
-/*  1063 */ "command\0"
-/*  1071 */ "Increase debug verbosity level\0"
-/*  1102 */ "DEBUG_LEVEL\0"
-/*  1114 */ "debug-level\0"
-/*  1126 */ "Set the debug verbosity level\0"
-/*  1156 */ "SET_DEBUG_LEVEL\0"
-/*  1172 */ "set-debug-level\0"
-/*  1188 */ "Force ntpq to operate in interactive mode\0"
-/*  1230 */ "INTERACTIVE\0"
-/*  1242 */ "interactive\0"
-/*  1254 */ "numeric host addresses\0"
-/*  1277 */ "NUMERIC\0"
-/*  1285 */ "numeric\0"
-/*  1293 */ "Always output status line with readvar\0"
-/*  1332 */ "OLD_RV\0"
-/*  1339 */ "old-rv\0"
-/*  1346 */ "Print a list of the peers\0"
-/*  1372 */ "PEERS\0"
-/*  1378 */ "peers\0"
-/*  1384 */ "Display the full 'remote' value\0"
-/*  1416 */ "WIDE\0"
-/*  1421 */ "wide\0"
-/*  1426 */ "display extended usage information and exit\0"
-/*  1470 */ "help\0"
-/*  1475 */ "extended usage information passed thru pager\0"
-/*  1520 */ "more-help\0"
-/*  1530 */ "output version information and exit\0"
-/*  1566 */ "version\0"
-/*  1574 */ "save the option state to a config file\0"
-/*  1613 */ "save-opts\0"
-/*  1623 */ "load options from a config file\0"
-/*  1655 */ "LOAD_OPTS\0"
-/*  1665 */ "no-load-opts\0"
-/*  1678 */ "no\0"
-/*  1681 */ "NTPQ\0"
-/*  1686 */ "ntpq - standard NTP query program - Ver. 4.2.8\n"
+            "specific, written prior permission.  The University of Delaware and Network\n"
+            "Time Foundation makes no representations about the suitability this\n"
+            "software for any purpose.  It is provided \"as is\" without express or\n"
+            "implied warranty.\n\0"
+/*  1008 */ "Force IPv4 DNS name resolution\0"
+/*  1039 */ "IPV4\0"
+/*  1044 */ "ipv4\0"
+/*  1049 */ "Force IPv6 DNS name resolution\0"
+/*  1080 */ "IPV6\0"
+/*  1085 */ "ipv6\0"
+/*  1090 */ "run a command and exit\0"
+/*  1113 */ "COMMAND\0"
+/*  1121 */ "command\0"
+/*  1129 */ "Increase debug verbosity level\0"
+/*  1160 */ "DEBUG_LEVEL\0"
+/*  1172 */ "debug-level\0"
+/*  1184 */ "Set the debug verbosity level\0"
+/*  1214 */ "SET_DEBUG_LEVEL\0"
+/*  1230 */ "set-debug-level\0"
+/*  1246 */ "Force ntpq to operate in interactive mode\0"
+/*  1288 */ "INTERACTIVE\0"
+/*  1300 */ "interactive\0"
+/*  1312 */ "numeric host addresses\0"
+/*  1335 */ "NUMERIC\0"
+/*  1343 */ "numeric\0"
+/*  1351 */ "Always output status line with readvar\0"
+/*  1390 */ "OLD_RV\0"
+/*  1397 */ "old-rv\0"
+/*  1404 */ "Print a list of the peers\0"
+/*  1430 */ "PEERS\0"
+/*  1436 */ "peers\0"
+/*  1442 */ "Display the full 'remote' value\0"
+/*  1474 */ "WIDE\0"
+/*  1479 */ "wide\0"
+/*  1484 */ "display extended usage information and exit\0"
+/*  1528 */ "help\0"
+/*  1533 */ "extended usage information passed thru pager\0"
+/*  1578 */ "more-help\0"
+/*  1588 */ "output version information and exit\0"
+/*  1624 */ "version\0"
+/*  1632 */ "save the option state to a config file\0"
+/*  1671 */ "save-opts\0"
+/*  1681 */ "load options from a config file\0"
+/*  1713 */ "LOAD_OPTS\0"
+/*  1723 */ "no-load-opts\0"
+/*  1736 */ "no\0"
+/*  1739 */ "NTPQ\0"
+/*  1744 */ "ntpq - standard NTP query program - Ver. 4.2.8p2\n"
             "Usage:  %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... [ host ...]\n\0"
-/*  1803 */ "$HOME\0"
-/*  1809 */ ".\0"
-/*  1811 */ ".ntprc\0"
-/*  1818 */ "http://bugs.ntp.org, bugs@ntp.org\0"
-/*  1852 */ "ntpq 4.2.8";
+/*  1863 */ "$HOME\0"
+/*  1869 */ ".\0"
+/*  1871 */ ".ntprc\0"
+/*  1878 */ "http://bugs.ntp.org, bugs@ntp.org\0"
+/*  1912 */ "ntpq 4.2.8p2";
 
 /**
  *  ipv4 option description with
  *  "Must also have options" and "Incompatible options":
  */
 /** Descriptive text for the ipv4 option */
-#define IPV4_DESC      (ntpq_opt_strs+950)
+#define IPV4_DESC      (ntpq_opt_strs+1008)
 /** Upper-cased name for the ipv4 option */
-#define IPV4_NAME      (ntpq_opt_strs+981)
+#define IPV4_NAME      (ntpq_opt_strs+1039)
 /** Name string for the ipv4 option */
-#define IPV4_name      (ntpq_opt_strs+986)
+#define IPV4_name      (ntpq_opt_strs+1044)
 /** Other options that appear in conjunction with the ipv4 option */
 static int const aIpv4CantList[] = {
     INDEX_OPT_IPV6, NO_EQUIVALENT };
@@ -159,11 +160,11 @@
  *  "Must also have options" and "Incompatible options":
  */
 /** Descriptive text for the ipv6 option */
-#define IPV6_DESC      (ntpq_opt_strs+991)
+#define IPV6_DESC      (ntpq_opt_strs+1049)
 /** Upper-cased name for the ipv6 option */
-#define IPV6_NAME      (ntpq_opt_strs+1022)
+#define IPV6_NAME      (ntpq_opt_strs+1080)
 /** Name string for the ipv6 option */
-#define IPV6_name      (ntpq_opt_strs+1027)
+#define IPV6_name      (ntpq_opt_strs+1085)
 /** Other options that appear in conjunction with the ipv6 option */
 static int const aIpv6CantList[] = {
     INDEX_OPT_IPV4, NO_EQUIVALENT };
@@ -174,11 +175,11 @@
  *  command option description:
  */
 /** Descriptive text for the command option */
-#define COMMAND_DESC      (ntpq_opt_strs+1032)
+#define COMMAND_DESC      (ntpq_opt_strs+1090)
 /** Upper-cased name for the command option */
-#define COMMAND_NAME      (ntpq_opt_strs+1055)
+#define COMMAND_NAME      (ntpq_opt_strs+1113)
 /** Name string for the command option */
-#define COMMAND_name      (ntpq_opt_strs+1063)
+#define COMMAND_name      (ntpq_opt_strs+1121)
 /** Compiled in flag settings for the command option */
 #define COMMAND_FLAGS     (OPTST_DISABLED \
         | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
@@ -187,11 +188,11 @@
  *  debug-level option description:
  */
 /** Descriptive text for the debug-level option */
-#define DEBUG_LEVEL_DESC      (ntpq_opt_strs+1071)
+#define DEBUG_LEVEL_DESC      (ntpq_opt_strs+1129)
 /** Upper-cased name for the debug-level option */
-#define DEBUG_LEVEL_NAME      (ntpq_opt_strs+1102)
+#define DEBUG_LEVEL_NAME      (ntpq_opt_strs+1160)
 /** Name string for the debug-level option */
-#define DEBUG_LEVEL_name      (ntpq_opt_strs+1114)
+#define DEBUG_LEVEL_name      (ntpq_opt_strs+1172)
 /** Compiled in flag settings for the debug-level option */
 #define DEBUG_LEVEL_FLAGS     (OPTST_DISABLED)
 
@@ -199,11 +200,11 @@
  *  set-debug-level option description:
  */
 /** Descriptive text for the set-debug-level option */
-#define SET_DEBUG_LEVEL_DESC      (ntpq_opt_strs+1126)
+#define SET_DEBUG_LEVEL_DESC      (ntpq_opt_strs+1184)
 /** Upper-cased name for the set-debug-level option */
-#define SET_DEBUG_LEVEL_NAME      (ntpq_opt_strs+1156)
+#define SET_DEBUG_LEVEL_NAME      (ntpq_opt_strs+1214)
 /** Name string for the set-debug-level option */
-#define SET_DEBUG_LEVEL_name      (ntpq_opt_strs+1172)
+#define SET_DEBUG_LEVEL_name      (ntpq_opt_strs+1230)
 /** Compiled in flag settings for the set-debug-level option */
 #define SET_DEBUG_LEVEL_FLAGS     (OPTST_DISABLED \
         | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
@@ -213,11 +214,11 @@
  *  "Must also have options" and "Incompatible options":
  */
 /** Descriptive text for the interactive option */
-#define INTERACTIVE_DESC      (ntpq_opt_strs+1188)
+#define INTERACTIVE_DESC      (ntpq_opt_strs+1246)
 /** Upper-cased name for the interactive option */
-#define INTERACTIVE_NAME      (ntpq_opt_strs+1230)
+#define INTERACTIVE_NAME      (ntpq_opt_strs+1288)
 /** Name string for the interactive option */
-#define INTERACTIVE_name      (ntpq_opt_strs+1242)
+#define INTERACTIVE_name      (ntpq_opt_strs+1300)
 /** Other options that appear in conjunction with the interactive option */
 static int const aInteractiveCantList[] = {
     INDEX_OPT_COMMAND,
@@ -229,11 +230,11 @@
  *  numeric option description:
  */
 /** Descriptive text for the numeric option */
-#define NUMERIC_DESC      (ntpq_opt_strs+1254)
+#define NUMERIC_DESC      (ntpq_opt_strs+1312)
 /** Upper-cased name for the numeric option */
-#define NUMERIC_NAME      (ntpq_opt_strs+1277)
+#define NUMERIC_NAME      (ntpq_opt_strs+1335)
 /** Name string for the numeric option */
-#define NUMERIC_name      (ntpq_opt_strs+1285)
+#define NUMERIC_name      (ntpq_opt_strs+1343)
 /** Compiled in flag settings for the numeric option */
 #define NUMERIC_FLAGS     (OPTST_DISABLED)
 
@@ -241,11 +242,11 @@
  *  old-rv option description:
  */
 /** Descriptive text for the old-rv option */
-#define OLD_RV_DESC      (ntpq_opt_strs+1293)
+#define OLD_RV_DESC      (ntpq_opt_strs+1351)
 /** Upper-cased name for the old-rv option */
-#define OLD_RV_NAME      (ntpq_opt_strs+1332)
+#define OLD_RV_NAME      (ntpq_opt_strs+1390)
 /** Name string for the old-rv option */
-#define OLD_RV_name      (ntpq_opt_strs+1339)
+#define OLD_RV_name      (ntpq_opt_strs+1397)
 /** Compiled in flag settings for the old-rv option */
 #define OLD_RV_FLAGS     (OPTST_DISABLED)
 
@@ -254,11 +255,11 @@
  *  "Must also have options" and "Incompatible options":
  */
 /** Descriptive text for the peers option */
-#define PEERS_DESC      (ntpq_opt_strs+1346)
+#define PEERS_DESC      (ntpq_opt_strs+1404)
 /** Upper-cased name for the peers option */
-#define PEERS_NAME      (ntpq_opt_strs+1372)
+#define PEERS_NAME      (ntpq_opt_strs+1430)
 /** Name string for the peers option */
-#define PEERS_name      (ntpq_opt_strs+1378)
+#define PEERS_name      (ntpq_opt_strs+1436)
 /** Other options that appear in conjunction with the peers option */
 static int const aPeersCantList[] = {
     INDEX_OPT_INTERACTIVE, NO_EQUIVALENT };
@@ -269,22 +270,22 @@
  *  wide option description:
  */
 /** Descriptive text for the wide option */
-#define WIDE_DESC      (ntpq_opt_strs+1384)
+#define WIDE_DESC      (ntpq_opt_strs+1442)
 /** Upper-cased name for the wide option */
-#define WIDE_NAME      (ntpq_opt_strs+1416)
+#define WIDE_NAME      (ntpq_opt_strs+1474)
 /** Name string for the wide option */
-#define WIDE_name      (ntpq_opt_strs+1421)
+#define WIDE_name      (ntpq_opt_strs+1479)
 /** Compiled in flag settings for the wide option */
 #define WIDE_FLAGS     (OPTST_DISABLED)
 
 /*
  *  Help/More_Help/Version option descriptions:
  */
-#define HELP_DESC       (ntpq_opt_strs+1426)
-#define HELP_name       (ntpq_opt_strs+1470)
+#define HELP_DESC       (ntpq_opt_strs+1484)
+#define HELP_name       (ntpq_opt_strs+1528)
 #ifdef HAVE_WORKING_FORK
-#define MORE_HELP_DESC  (ntpq_opt_strs+1475)
-#define MORE_HELP_name  (ntpq_opt_strs+1520)
+#define MORE_HELP_DESC  (ntpq_opt_strs+1533)
+#define MORE_HELP_name  (ntpq_opt_strs+1578)
 #define MORE_HELP_FLAGS (OPTST_IMM | OPTST_NO_INIT)
 #else
 #define MORE_HELP_DESC  HELP_DESC
@@ -297,14 +298,14 @@
 #  define VER_FLAGS     (OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) | \
                          OPTST_ARG_OPTIONAL | OPTST_IMM | OPTST_NO_INIT)
 #endif
-#define VER_DESC        (ntpq_opt_strs+1530)
-#define VER_name        (ntpq_opt_strs+1566)
-#define SAVE_OPTS_DESC  (ntpq_opt_strs+1574)
-#define SAVE_OPTS_name  (ntpq_opt_strs+1613)
-#define LOAD_OPTS_DESC     (ntpq_opt_strs+1623)
-#define LOAD_OPTS_NAME     (ntpq_opt_strs+1655)
-#define NO_LOAD_OPTS_name  (ntpq_opt_strs+1665)
-#define LOAD_OPTS_pfx      (ntpq_opt_strs+1678)
+#define VER_DESC        (ntpq_opt_strs+1588)
+#define VER_name        (ntpq_opt_strs+1624)
+#define SAVE_OPTS_DESC  (ntpq_opt_strs+1632)
+#define SAVE_OPTS_name  (ntpq_opt_strs+1671)
+#define LOAD_OPTS_DESC     (ntpq_opt_strs+1681)
+#define LOAD_OPTS_NAME     (ntpq_opt_strs+1713)
+#define NO_LOAD_OPTS_name  (ntpq_opt_strs+1723)
+#define LOAD_OPTS_pfx      (ntpq_opt_strs+1736)
 #define LOAD_OPTS_name     (NO_LOAD_OPTS_name + 3)
 /**
  *  Declare option callback procedures
@@ -513,24 +514,24 @@
 
 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
 /** Reference to the upper cased version of ntpq. */
-#define zPROGNAME       (ntpq_opt_strs+1681)
+#define zPROGNAME       (ntpq_opt_strs+1739)
 /** Reference to the title line for ntpq usage. */
-#define zUsageTitle     (ntpq_opt_strs+1686)
+#define zUsageTitle     (ntpq_opt_strs+1744)
 /** ntpq configuration file name. */
-#define zRcName         (ntpq_opt_strs+1811)
+#define zRcName         (ntpq_opt_strs+1871)
 /** Directories to search for ntpq config files. */
 static char const * const apzHomeList[3] = {
-    ntpq_opt_strs+1803,
-    ntpq_opt_strs+1809,
+    ntpq_opt_strs+1863,
+    ntpq_opt_strs+1869,
     NULL };
 /** The ntpq program bug email address. */
-#define zBugsAddr       (ntpq_opt_strs+1818)
+#define zBugsAddr       (ntpq_opt_strs+1878)
 /** Clarification/explanation of what ntpq does. */
 #define zExplain        (NULL)
 /** Extra detail explaining what ntpq does. */
 #define zDetail         (NULL)
 /** The full version string for ntpq. */
-#define zFullVersion    (ntpq_opt_strs+1852)
+#define zFullVersion    (ntpq_opt_strs+1912)
 /* extracted from optcode.tlib near line 364 */
 
 #if defined(ENABLE_NLS)
@@ -787,8 +788,8 @@
      translate option names.
    */
   /* referenced via ntpqOptions.pzCopyright */
-  puts(_("ntpq 4.2.8\n\
-Copyright (C) 1970-2014 The University of Delaware, all rights reserved.\n\
+  puts(_("ntpq 4.2.8p2\n\
+Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation, all rights reserved.\n\
 This is free software. It is licensed for use, modification and\n\
 redistribution under the terms of the NTP License, copies of which\n\
 can be seen at:\n"));
@@ -802,9 +803,10 @@
 both the copyright notice and this permission notice appear in supporting\n\
 documentation, and that the name The University of Delaware not be used in\n\
 advertising or publicity pertaining to distribution of the software without\n\
-specific, written prior permission.  The University of Delaware makes no\n\
-representations about the suitability this software for any purpose.  It is\n\
-provided \"as is\" without express or implied warranty.\n"));
+specific, written prior permission.  The University of Delaware and Network\n\
+Time Foundation makes no representations about the suitability this\n\
+software for any purpose.  It is provided \"as is\" without express or\n\
+implied warranty.\n"));
 
   /* referenced via ntpqOptions.pOptDesc->pzText */
   puts(_("Force IPv4 DNS name resolution"));
@@ -852,11 +854,11 @@
   puts(_("load options from a config file"));
 
   /* referenced via ntpqOptions.pzUsageTitle */
-  puts(_("ntpq - standard NTP query program - Ver. 4.2.8\n\
+  puts(_("ntpq - standard NTP query program - Ver. 4.2.8p2\n\
 Usage:  %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... [ host ...]\n"));
 
   /* referenced via ntpqOptions.pzFullVersion */
-  puts(_("ntpq 4.2.8"));
+  puts(_("ntpq 4.2.8p2"));
 
   /* referenced via ntpqOptions.pzFullUsage */
   puts(_("<<<NOT-FOUND>>>"));
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/ntpq/ntpq-opts.h /cur/src/external/bsd/ntp/dist/ntpq/ntpq-opts.h
--- external/bsd/ntp/dist/ntpq/ntpq-opts.h	2014-12-24 18:28:11.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/ntpq/ntpq-opts.h	2015-04-07 19:51:17.000000000 -0700
@@ -3,7 +3,7 @@
 /*
  *  EDIT THIS FILE WITH CAUTION  (ntpq-opts.h)
  *
- *  It has been AutoGen-ed  December 19, 2014 at 07:49:47 AM by AutoGen 5.18.5pre4
+ *  It has been AutoGen-ed  April  7, 2015 at 04:26:37 AM by AutoGen 5.18.5pre4
  *  From the definitions    ntpq-opts.def
  *  and the template file   options
  *
@@ -20,7 +20,7 @@
  * The ntpq program is copyrighted and licensed
  * under the following terms:
  *
- *  Copyright (C) 1970-2014 The University of Delaware, all rights reserved.
+ *  Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation, all rights reserved.
  *  This is free software. It is licensed for use, modification and
  *  redistribution under the terms of the NTP License, copies of which
  *  can be seen at:
@@ -33,7 +33,7 @@
  *  both the copyright notice and this permission notice appear in
  *  supporting documentation, and that the name The University of Delaware not be used in
  *  advertising or publicity pertaining to distribution of the software
- *  without specific, written prior permission. The University of Delaware makes no
+ *  without specific, written prior permission. The University of Delaware and Network Time Foundation makes no
  *  representations about the suitability this software for any purpose. It
  *  is provided "as is" without express or implied warranty.
  */
@@ -85,9 +85,9 @@
 /** count of all options for ntpq */
 #define OPTION_CT    15
 /** ntpq version */
-#define NTPQ_VERSION       "4.2.8"
+#define NTPQ_VERSION       "4.2.8p2"
 /** Full ntpq version text */
-#define NTPQ_FULL_VERSION  "ntpq 4.2.8"
+#define NTPQ_FULL_VERSION  "ntpq 4.2.8p2"
 
 /**
  *  Interface defines for all options.  Replace "n" with the UPPER_CASED
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/ntpq/ntpq-subs.c /cur/src/external/bsd/ntp/dist/ntpq/ntpq-subs.c
--- external/bsd/ntp/dist/ntpq/ntpq-subs.c	2014-12-24 18:28:11.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/ntpq/ntpq-subs.c	2015-04-07 19:51:17.000000000 -0700
@@ -332,8 +332,11 @@
 		l_fp		lfp;	/* NTP_LFP */
 	} v;				/* retrieved value */
 } vdc;
-#define VDC_INIT(a, b, c) { .tag = a, .display = b, .type = c }
-
+#if !defined(MISSING_C99_STRUCT_INIT)
+# define VDC_INIT(a, b, c) { .tag = a, .display = b, .type = c }
+#else
+# define VDC_INIT(a, b, c) { a, b, c }
+#endif
 /*
  * other local function prototypes
  */
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/ntpq/ntpq.1ntpqman /cur/src/external/bsd/ntp/dist/ntpq/ntpq.1ntpqman
--- external/bsd/ntp/dist/ntpq/ntpq.1ntpqman	2014-12-19 12:37:42.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/ntpq/ntpq.1ntpqman	2015-04-07 19:51:17.000000000 -0700
@@ -10,11 +10,11 @@
 .ds B-Font B
 .ds I-Font I
 .ds R-Font R
-.TH ntpq 1ntpqman "19 Dec 2014" "4.2.8" "User Commands"
+.TH ntpq 1ntpqman "07 Apr 2015" "4.2.8p2" "User Commands"
 .\"
-.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-XYaGog/ag-9Yayng)
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-SOays6/ag-4Oaqr6)
 .\"
-.\" It has been AutoGen-ed December 19, 2014 at 07:50:13 AM by AutoGen 5.18.5pre4
+.\" It has been AutoGen-ed April 7, 2015 at 04:27:03 AM by AutoGen 5.18.5pre4
 .\" From the definitions ntpq-opts.def
 .\" and the template file agman-cmd.tpl
 .SH NAME
@@ -1397,9 +1397,9 @@
 it to autogen-users@lists.sourceforge.net.  Thank you.
 .PP
 .SH "AUTHORS"
-The University of Delaware
+The University of Delaware and Network Time Foundation
 .SH "COPYRIGHT"
-Copyright (C) 1970-2014 The University of Delaware all rights reserved.
+Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation all rights reserved.
 This program is released under the terms of the NTP license, <http://ntp.org/license>.
 .SH "BUGS"
 Please send bug reports to: http://bugs.ntp.org, bugs@ntp.org
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/ntpq/ntpq.1ntpqmdoc /cur/src/external/bsd/ntp/dist/ntpq/ntpq.1ntpqmdoc
--- external/bsd/ntp/dist/ntpq/ntpq.1ntpqmdoc	2014-12-19 12:37:42.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/ntpq/ntpq.1ntpqmdoc	2015-04-07 19:51:17.000000000 -0700
@@ -1,9 +1,9 @@
-.Dd December 19 2014
+.Dd April 7 2015
 .Dt NTPQ 1ntpqmdoc User Commands
 .Os
 .\"  EDIT THIS FILE WITH CAUTION  (ntpq-opts.mdoc)
 .\"
-.\"  It has been AutoGen-ed  December 19, 2014 at 07:50:19 AM by AutoGen 5.18.5pre4
+.\"  It has been AutoGen-ed  April  7, 2015 at 04:27:09 AM by AutoGen 5.18.5pre4
 .\"  From the definitions    ntpq-opts.def
 .\"  and the template file   agmdoc-cmd.tpl
 .Sh NAME
@@ -943,9 +943,9 @@
 it to autogen\-users@lists.sourceforge.net.  Thank you.
 .El
 .Sh "AUTHORS"
-The University of Delaware
+The University of Delaware and Network Time Foundation
 .Sh "COPYRIGHT"
-Copyright (C) 1970\-2014 The University of Delaware all rights reserved.
+Copyright (C) 1992\-2015 The University of Delaware and Network Time Foundation all rights reserved.
 This program is released under the terms of the NTP license, <http://ntp.org/license>.
 .Sh "BUGS"
 Please send bug reports to: http://bugs.ntp.org, bugs@ntp.org
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/ntpq/ntpq.html /cur/src/external/bsd/ntp/dist/ntpq/ntpq.html
--- external/bsd/ntp/dist/ntpq/ntpq.html	2014-12-19 12:37:42.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/ntpq/ntpq.html	2015-04-07 19:51:17.000000000 -0700
@@ -44,7 +44,7 @@
 and determine the performance of
 <code>ntpd</code>, the NTP daemon.
 
-  <p>This document applies to version 4.2.8 of <code>ntpq</code>.
+  <p>This document applies to version 4.2.8p2 of <code>ntpq</code>.
 
 <ul class="menu">
 <li><a accesskey="1" href="#ntpq-Description">ntpq Description</a>
@@ -759,7 +759,7 @@
 used to select the program, defaulting to <span class="file">more</span>.  Both will exit
 with a status code of 0.
 
-<pre class="example">ntpq - standard NTP query program - Ver. 4.2.7p486-RC
+<pre class="example">ntpq - standard NTP query program - Ver. 4.2.8p2-RC3
 Usage:  ntpq [ -&lt;flag&gt; [&lt;val&gt;] | --&lt;name&gt;[{=| }&lt;val&gt;] ]... [ host ...]
   Flg Arg Option-Name    Description
    -4 no  ipv4           Force IPv4 DNS name resolution
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/ntpq/ntpq.man.in /cur/src/external/bsd/ntp/dist/ntpq/ntpq.man.in
--- external/bsd/ntp/dist/ntpq/ntpq.man.in	2014-12-19 12:37:42.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/ntpq/ntpq.man.in	2015-04-07 19:51:17.000000000 -0700
@@ -10,11 +10,11 @@
 .ds B-Font B
 .ds I-Font I
 .ds R-Font R
-.TH ntpq @NTPQ_MS@ "19 Dec 2014" "4.2.8" "User Commands"
+.TH ntpq @NTPQ_MS@ "07 Apr 2015" "4.2.8p2" "User Commands"
 .\"
-.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-XYaGog/ag-9Yayng)
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-SOays6/ag-4Oaqr6)
 .\"
-.\" It has been AutoGen-ed December 19, 2014 at 07:50:13 AM by AutoGen 5.18.5pre4
+.\" It has been AutoGen-ed April 7, 2015 at 04:27:03 AM by AutoGen 5.18.5pre4
 .\" From the definitions ntpq-opts.def
 .\" and the template file agman-cmd.tpl
 .SH NAME
@@ -1397,9 +1397,9 @@
 it to autogen-users@lists.sourceforge.net.  Thank you.
 .PP
 .SH "AUTHORS"
-The University of Delaware
+The University of Delaware and Network Time Foundation
 .SH "COPYRIGHT"
-Copyright (C) 1970-2014 The University of Delaware all rights reserved.
+Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation all rights reserved.
 This program is released under the terms of the NTP license, <http://ntp.org/license>.
 .SH "BUGS"
 Please send bug reports to: http://bugs.ntp.org, bugs@ntp.org
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/ntpq/ntpq.mdoc.in /cur/src/external/bsd/ntp/dist/ntpq/ntpq.mdoc.in
--- external/bsd/ntp/dist/ntpq/ntpq.mdoc.in	2014-12-19 12:37:42.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/ntpq/ntpq.mdoc.in	2015-04-07 19:51:17.000000000 -0700
@@ -1,9 +1,9 @@
-.Dd December 19 2014
+.Dd April 7 2015
 .Dt NTPQ @NTPQ_MS@ User Commands
 .Os
 .\"  EDIT THIS FILE WITH CAUTION  (ntpq-opts.mdoc)
 .\"
-.\"  It has been AutoGen-ed  December 19, 2014 at 07:50:19 AM by AutoGen 5.18.5pre4
+.\"  It has been AutoGen-ed  April  7, 2015 at 04:27:09 AM by AutoGen 5.18.5pre4
 .\"  From the definitions    ntpq-opts.def
 .\"  and the template file   agmdoc-cmd.tpl
 .Sh NAME
@@ -943,9 +943,9 @@
 it to autogen\-users@lists.sourceforge.net.  Thank you.
 .El
 .Sh "AUTHORS"
-The University of Delaware
+The University of Delaware and Network Time Foundation
 .Sh "COPYRIGHT"
-Copyright (C) 1970\-2014 The University of Delaware all rights reserved.
+Copyright (C) 1992\-2015 The University of Delaware and Network Time Foundation all rights reserved.
 This program is released under the terms of the NTP license, <http://ntp.org/license>.
 .Sh "BUGS"
 Please send bug reports to: http://bugs.ntp.org, bugs@ntp.org
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/ntpsnmpd/Makefile.in /cur/src/external/bsd/ntp/dist/ntpsnmpd/Makefile.in
--- external/bsd/ntp/dist/ntpsnmpd/Makefile.in	2014-12-19 12:37:43.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/ntpsnmpd/Makefile.in	2015-04-07 19:51:17.000000000 -0700
@@ -48,8 +48,7 @@
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
 	$(top_srcdir)/sntp/libopts/m4/stdnoreturn.m4 \
-	$(top_srcdir)/sntp/libevent/m4/openldap-thread-check.m4 \
-	$(top_srcdir)/sntp/libevent/m4/openldap.m4 \
+	$(top_srcdir)/sntp/m4/ax_c99_struct_init.m4 \
 	$(top_srcdir)/sntp/m4/define_dir.m4 \
 	$(top_srcdir)/sntp/m4/hms_search_lib.m4 \
 	$(top_srcdir)/sntp/m4/libtool.m4 \
@@ -78,6 +77,8 @@
 	$(top_srcdir)/sntp/m4/ntp_sntp.m4 \
 	$(top_srcdir)/sntp/m4/ntp_ver_suffix.m4 \
 	$(top_srcdir)/sntp/m4/ntp_vpathhack.m4 \
+	$(top_srcdir)/sntp/m4/openldap-thread-check.m4 \
+	$(top_srcdir)/sntp/m4/openldap.m4 \
 	$(top_srcdir)/sntp/m4/os_cflags.m4 \
 	$(top_srcdir)/sntp/m4/snprintf.m4 \
 	$(top_srcdir)/sntp/m4/version.m4 $(top_srcdir)/configure.ac
@@ -182,6 +183,7 @@
 CONFIG_SHELL = @CONFIG_SHELL@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
+CPPFLAGS_LIBEVENT = @CPPFLAGS_LIBEVENT@
 CPPFLAGS_NTP = @CPPFLAGS_NTP@
 CXX = @CXX@
 CXXCPP = @CXXCPP@
@@ -216,7 +218,9 @@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 LD = @LD@
+LDADD_LIBEVENT = @LDADD_LIBEVENT@
 LDADD_LIBNTP = @LDADD_LIBNTP@
+LDADD_LIBUTIL = @LDADD_LIBUTIL@
 LDADD_NLIST = @LDADD_NLIST@
 LDADD_NTP = @LDADD_NTP@
 LDFLAGS = @LDFLAGS@
@@ -355,6 +359,11 @@
 TIMETRIM_DS = @TIMETRIM_DS@
 TIMETRIM_MS = @TIMETRIM_MS@
 TIMETRIM_NI = @TIMETRIM_NI@
+UPDATE_LEAP_DB = @UPDATE_LEAP_DB@
+UPDATE_LEAP_DL = @UPDATE_LEAP_DL@
+UPDATE_LEAP_DS = @UPDATE_LEAP_DS@
+UPDATE_LEAP_MS = @UPDATE_LEAP_MS@
+UPDATE_LEAP_NI = @UPDATE_LEAP_NI@
 VERSION = @VERSION@
 VER_SUFFIX = @VER_SUFFIX@
 YACC = @YACC@
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/ntpsnmpd/invoke-ntpsnmpd.texi /cur/src/external/bsd/ntp/dist/ntpsnmpd/invoke-ntpsnmpd.texi
--- external/bsd/ntp/dist/ntpsnmpd/invoke-ntpsnmpd.texi	2014-12-19 12:37:43.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/ntpsnmpd/invoke-ntpsnmpd.texi	2015-04-07 19:51:17.000000000 -0700
@@ -6,7 +6,7 @@
 #
 # EDIT THIS FILE WITH CAUTION  (invoke-ntpsnmpd.texi)
 #
-# It has been AutoGen-ed  December 19, 2014 at 07:50:32 AM by AutoGen 5.18.5pre4
+# It has been AutoGen-ed  April  7, 2015 at 04:27:22 AM by AutoGen 5.18.5pre4
 # From the definitions    ntpsnmpd-opts.def
 # and the template file   agtexi-cmd.tpl
 @end ignore
@@ -47,7 +47,7 @@
 
 @exampleindent 0
 @example
-ntpsnmpd - NTP SNMP MIB agent - Ver. 4.2.8
+ntpsnmpd - NTP SNMP MIB agent - Ver. 4.2.8p2
 Usage:  ntpsnmpd [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]...
   Flg Arg Option-Name    Description
    -n no  nofork         Do not fork
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/ntpsnmpd/netsnmp_daemonize.c /cur/src/external/bsd/ntp/dist/ntpsnmpd/netsnmp_daemonize.c
--- external/bsd/ntp/dist/ntpsnmpd/netsnmp_daemonize.c	2014-12-24 18:28:11.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/ntpsnmpd/netsnmp_daemonize.c	2015-04-07 19:51:17.000000000 -0700
@@ -42,6 +42,7 @@
 #undef PACKAGE_NAME
 #undef PACKAGE_STRING
 #undef PACKAGE_TARNAME
+#undef PACKAGE_URL
 #undef PACKAGE_VERSION
 #include <config.h>
 
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/ntpsnmpd/ntp_snmp.h /cur/src/external/bsd/ntp/dist/ntpsnmpd/ntp_snmp.h
--- external/bsd/ntp/dist/ntpsnmpd/ntp_snmp.h	2014-12-24 18:28:11.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/ntpsnmpd/ntp_snmp.h	2015-04-07 19:51:17.000000000 -0700
@@ -28,6 +28,9 @@
 #ifdef PACKAGE_TARNAME
 # undef PACKAGE_TARNAME
 #endif
+#ifdef PACKAGE_URL
+# undef PACKAGE_URL
+#endif
 #ifdef PACKAGE_VERSION
 # undef PACKAGE_VERSION
 #endif
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/ntpsnmpd/ntpsnmpd-opts.c /cur/src/external/bsd/ntp/dist/ntpsnmpd/ntpsnmpd-opts.c
--- external/bsd/ntp/dist/ntpsnmpd/ntpsnmpd-opts.c	2014-12-24 18:28:11.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/ntpsnmpd/ntpsnmpd-opts.c	2015-04-07 19:51:17.000000000 -0700
@@ -3,7 +3,7 @@
 /*
  *  EDIT THIS FILE WITH CAUTION  (ntpsnmpd-opts.c)
  *
- *  It has been AutoGen-ed  December 19, 2014 at 07:50:22 AM by AutoGen 5.18.5pre4
+ *  It has been AutoGen-ed  April  7, 2015 at 04:27:12 AM by AutoGen 5.18.5pre4
  *  From the definitions    ntpsnmpd-opts.def
  *  and the template file   options
  *
@@ -20,7 +20,7 @@
  * The ntpsnmpd program is copyrighted and licensed
  * under the following terms:
  *
- *  Copyright (C) 1970-2014 The University of Delaware, all rights reserved.
+ *  Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation, all rights reserved.
  *  This is free software. It is licensed for use, modification and
  *  redistribution under the terms of the NTP License, copies of which
  *  can be seen at:
@@ -33,7 +33,7 @@
  *  both the copyright notice and this permission notice appear in
  *  supporting documentation, and that the name The University of Delaware not be used in
  *  advertising or publicity pertaining to distribution of the software
- *  without specific, written prior permission. The University of Delaware makes no
+ *  without specific, written prior permission. The University of Delaware and Network Time Foundation makes no
  *  representations about the suitability this software for any purpose. It
  *  is provided "as is" without express or implied warranty.
  */
@@ -52,7 +52,7 @@
 #endif
 extern FILE * option_usage_fp;
 #define zCopyright      (ntpsnmpd_opt_strs+0)
-#define zLicenseDescrip (ntpsnmpd_opt_strs+314)
+#define zLicenseDescrip (ntpsnmpd_opt_strs+344)
 
 
 #ifndef NULL
@@ -62,64 +62,65 @@
 /**
  *  static const strings for ntpsnmpd options
  */
-static char const ntpsnmpd_opt_strs[1548] =
-/*     0 */ "ntpsnmpd 4.2.8\n"
-            "Copyright (C) 1970-2014 The University of Delaware, all rights reserved.\n"
+static char const ntpsnmpd_opt_strs[1610] =
+/*     0 */ "ntpsnmpd 4.2.8p2\n"
+            "Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation, all rights reserved.\n"
             "This is free software. It is licensed for use, modification and\n"
             "redistribution under the terms of the NTP License, copies of which\n"
             "can be seen at:\n"
             "  <http://ntp.org/license>\n"
             "  <http://opensource.org/licenses/ntp-license.php>\n\0"
-/*   314 */ "Permission to use, copy, modify, and distribute this software and its\n"
+/*   344 */ "Permission to use, copy, modify, and distribute this software and its\n"
             "documentation for any purpose with or without fee is hereby granted,\n"
             "provided that the above copyright notice appears in all copies and that\n"
             "both the copyright notice and this permission notice appear in supporting\n"
             "documentation, and that the name The University of Delaware not be used in\n"
             "advertising or publicity pertaining to distribution of the software without\n"
-            "specific, written prior permission.  The University of Delaware makes no\n"
-            "representations about the suitability this software for any purpose.  It is\n"
-            "provided \"as is\" without express or implied warranty.\n\0"
-/*   954 */ "Do not fork\0"
-/*   966 */ "NOFORK\0"
-/*   973 */ "nofork\0"
-/*   980 */ "Log to syslog()\0"
-/*   996 */ "SYSLOG\0"
-/*  1003 */ "syslog\0"
-/*  1010 */ "The socket address ntpsnmpd uses to connect to net-snmpd\0"
-/*  1067 */ "AGENTXSOCKET\0"
-/*  1080 */ "agentxsocket\0"
-/*  1093 */ "unix:/var/agentx/master\0"
-/*  1117 */ "display extended usage information and exit\0"
-/*  1161 */ "help\0"
-/*  1166 */ "extended usage information passed thru pager\0"
-/*  1211 */ "more-help\0"
-/*  1221 */ "output version information and exit\0"
-/*  1257 */ "version\0"
-/*  1265 */ "save the option state to a config file\0"
-/*  1304 */ "save-opts\0"
-/*  1314 */ "load options from a config file\0"
-/*  1346 */ "LOAD_OPTS\0"
-/*  1356 */ "no-load-opts\0"
-/*  1369 */ "no\0"
-/*  1372 */ "NTPSNMPD\0"
-/*  1381 */ "ntpsnmpd - NTP SNMP MIB agent - Ver. 4.2.8\n"
+            "specific, written prior permission.  The University of Delaware and Network\n"
+            "Time Foundation makes no representations about the suitability this\n"
+            "software for any purpose.  It is provided \"as is\" without express or\n"
+            "implied warranty.\n\0"
+/*  1012 */ "Do not fork\0"
+/*  1024 */ "NOFORK\0"
+/*  1031 */ "nofork\0"
+/*  1038 */ "Log to syslog()\0"
+/*  1054 */ "SYSLOG\0"
+/*  1061 */ "syslog\0"
+/*  1068 */ "The socket address ntpsnmpd uses to connect to net-snmpd\0"
+/*  1125 */ "AGENTXSOCKET\0"
+/*  1138 */ "agentxsocket\0"
+/*  1151 */ "unix:/var/agentx/master\0"
+/*  1175 */ "display extended usage information and exit\0"
+/*  1219 */ "help\0"
+/*  1224 */ "extended usage information passed thru pager\0"
+/*  1269 */ "more-help\0"
+/*  1279 */ "output version information and exit\0"
+/*  1315 */ "version\0"
+/*  1323 */ "save the option state to a config file\0"
+/*  1362 */ "save-opts\0"
+/*  1372 */ "load options from a config file\0"
+/*  1404 */ "LOAD_OPTS\0"
+/*  1414 */ "no-load-opts\0"
+/*  1427 */ "no\0"
+/*  1430 */ "NTPSNMPD\0"
+/*  1439 */ "ntpsnmpd - NTP SNMP MIB agent - Ver. 4.2.8p2\n"
             "Usage:  %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]...\n\0"
-/*  1482 */ "$HOME\0"
-/*  1488 */ ".\0"
-/*  1490 */ ".ntprc\0"
-/*  1497 */ "http://bugs.ntp.org, bugs@ntp.org\0"
-/*  1531 */ "\n\0"
-/*  1533 */ "ntpsnmpd 4.2.8";
+/*  1542 */ "$HOME\0"
+/*  1548 */ ".\0"
+/*  1550 */ ".ntprc\0"
+/*  1557 */ "http://bugs.ntp.org, bugs@ntp.org\0"
+/*  1591 */ "\n\0"
+/*  1593 */ "ntpsnmpd 4.2.8p2";
 
 /**
  *  nofork option description:
  */
 /** Descriptive text for the nofork option */
-#define NOFORK_DESC      (ntpsnmpd_opt_strs+954)
+#define NOFORK_DESC      (ntpsnmpd_opt_strs+1012)
 /** Upper-cased name for the nofork option */
-#define NOFORK_NAME      (ntpsnmpd_opt_strs+966)
+#define NOFORK_NAME      (ntpsnmpd_opt_strs+1024)
 /** Name string for the nofork option */
-#define NOFORK_name      (ntpsnmpd_opt_strs+973)
+#define NOFORK_name      (ntpsnmpd_opt_strs+1031)
 /** Compiled in flag settings for the nofork option */
 #define NOFORK_FLAGS     (OPTST_DISABLED)
 
@@ -127,11 +128,11 @@
  *  syslog option description:
  */
 /** Descriptive text for the syslog option */
-#define SYSLOG_DESC      (ntpsnmpd_opt_strs+980)
+#define SYSLOG_DESC      (ntpsnmpd_opt_strs+1038)
 /** Upper-cased name for the syslog option */
-#define SYSLOG_NAME      (ntpsnmpd_opt_strs+996)
+#define SYSLOG_NAME      (ntpsnmpd_opt_strs+1054)
 /** Name string for the syslog option */
-#define SYSLOG_name      (ntpsnmpd_opt_strs+1003)
+#define SYSLOG_name      (ntpsnmpd_opt_strs+1061)
 /** Compiled in flag settings for the syslog option */
 #define SYSLOG_FLAGS     (OPTST_DISABLED)
 
@@ -139,13 +140,13 @@
  *  agentXSocket option description:
  */
 /** Descriptive text for the agentXSocket option */
-#define AGENTXSOCKET_DESC      (ntpsnmpd_opt_strs+1010)
+#define AGENTXSOCKET_DESC      (ntpsnmpd_opt_strs+1068)
 /** Upper-cased name for the agentXSocket option */
-#define AGENTXSOCKET_NAME      (ntpsnmpd_opt_strs+1067)
+#define AGENTXSOCKET_NAME      (ntpsnmpd_opt_strs+1125)
 /** Name string for the agentXSocket option */
-#define AGENTXSOCKET_name      (ntpsnmpd_opt_strs+1080)
+#define AGENTXSOCKET_name      (ntpsnmpd_opt_strs+1138)
 /** The compiled in default value for the agentXSocket option argument */
-#define AGENTXSOCKET_DFT_ARG   (ntpsnmpd_opt_strs+1093)
+#define AGENTXSOCKET_DFT_ARG   (ntpsnmpd_opt_strs+1151)
 /** Compiled in flag settings for the agentXSocket option */
 #define AGENTXSOCKET_FLAGS     (OPTST_DISABLED \
         | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
@@ -153,11 +154,11 @@
 /*
  *  Help/More_Help/Version option descriptions:
  */
-#define HELP_DESC       (ntpsnmpd_opt_strs+1117)
-#define HELP_name       (ntpsnmpd_opt_strs+1161)
+#define HELP_DESC       (ntpsnmpd_opt_strs+1175)
+#define HELP_name       (ntpsnmpd_opt_strs+1219)
 #ifdef HAVE_WORKING_FORK
-#define MORE_HELP_DESC  (ntpsnmpd_opt_strs+1166)
-#define MORE_HELP_name  (ntpsnmpd_opt_strs+1211)
+#define MORE_HELP_DESC  (ntpsnmpd_opt_strs+1224)
+#define MORE_HELP_name  (ntpsnmpd_opt_strs+1269)
 #define MORE_HELP_FLAGS (OPTST_IMM | OPTST_NO_INIT)
 #else
 #define MORE_HELP_DESC  HELP_DESC
@@ -170,14 +171,14 @@
 #  define VER_FLAGS     (OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) | \
                          OPTST_ARG_OPTIONAL | OPTST_IMM | OPTST_NO_INIT)
 #endif
-#define VER_DESC        (ntpsnmpd_opt_strs+1221)
-#define VER_name        (ntpsnmpd_opt_strs+1257)
-#define SAVE_OPTS_DESC  (ntpsnmpd_opt_strs+1265)
-#define SAVE_OPTS_name  (ntpsnmpd_opt_strs+1304)
-#define LOAD_OPTS_DESC     (ntpsnmpd_opt_strs+1314)
-#define LOAD_OPTS_NAME     (ntpsnmpd_opt_strs+1346)
-#define NO_LOAD_OPTS_name  (ntpsnmpd_opt_strs+1356)
-#define LOAD_OPTS_pfx      (ntpsnmpd_opt_strs+1369)
+#define VER_DESC        (ntpsnmpd_opt_strs+1279)
+#define VER_name        (ntpsnmpd_opt_strs+1315)
+#define SAVE_OPTS_DESC  (ntpsnmpd_opt_strs+1323)
+#define SAVE_OPTS_name  (ntpsnmpd_opt_strs+1362)
+#define LOAD_OPTS_DESC     (ntpsnmpd_opt_strs+1372)
+#define LOAD_OPTS_NAME     (ntpsnmpd_opt_strs+1404)
+#define NO_LOAD_OPTS_name  (ntpsnmpd_opt_strs+1414)
+#define LOAD_OPTS_pfx      (ntpsnmpd_opt_strs+1427)
 #define LOAD_OPTS_name     (NO_LOAD_OPTS_name + 3)
 /**
  *  Declare option callback procedures
@@ -302,24 +303,24 @@
 
 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
 /** Reference to the upper cased version of ntpsnmpd. */
-#define zPROGNAME       (ntpsnmpd_opt_strs+1372)
+#define zPROGNAME       (ntpsnmpd_opt_strs+1430)
 /** Reference to the title line for ntpsnmpd usage. */
-#define zUsageTitle     (ntpsnmpd_opt_strs+1381)
+#define zUsageTitle     (ntpsnmpd_opt_strs+1439)
 /** ntpsnmpd configuration file name. */
-#define zRcName         (ntpsnmpd_opt_strs+1490)
+#define zRcName         (ntpsnmpd_opt_strs+1550)
 /** Directories to search for ntpsnmpd config files. */
 static char const * const apzHomeList[3] = {
-    ntpsnmpd_opt_strs+1482,
-    ntpsnmpd_opt_strs+1488,
+    ntpsnmpd_opt_strs+1542,
+    ntpsnmpd_opt_strs+1548,
     NULL };
 /** The ntpsnmpd program bug email address. */
-#define zBugsAddr       (ntpsnmpd_opt_strs+1497)
+#define zBugsAddr       (ntpsnmpd_opt_strs+1557)
 /** Clarification/explanation of what ntpsnmpd does. */
-#define zExplain        (ntpsnmpd_opt_strs+1531)
+#define zExplain        (ntpsnmpd_opt_strs+1591)
 /** Extra detail explaining what ntpsnmpd does. */
 #define zDetail         (NULL)
 /** The full version string for ntpsnmpd. */
-#define zFullVersion    (ntpsnmpd_opt_strs+1533)
+#define zFullVersion    (ntpsnmpd_opt_strs+1593)
 /* extracted from optcode.tlib near line 364 */
 
 #if defined(ENABLE_NLS)
@@ -555,8 +556,8 @@
      translate option names.
    */
   /* referenced via ntpsnmpdOptions.pzCopyright */
-  puts(_("ntpsnmpd 4.2.8\n\
-Copyright (C) 1970-2014 The University of Delaware, all rights reserved.\n\
+  puts(_("ntpsnmpd 4.2.8p2\n\
+Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation, all rights reserved.\n\
 This is free software. It is licensed for use, modification and\n\
 redistribution under the terms of the NTP License, copies of which\n\
 can be seen at:\n"));
@@ -570,9 +571,10 @@
 both the copyright notice and this permission notice appear in supporting\n\
 documentation, and that the name The University of Delaware not be used in\n\
 advertising or publicity pertaining to distribution of the software without\n\
-specific, written prior permission.  The University of Delaware makes no\n\
-representations about the suitability this software for any purpose.  It is\n\
-provided \"as is\" without express or implied warranty.\n"));
+specific, written prior permission.  The University of Delaware and Network\n\
+Time Foundation makes no representations about the suitability this\n\
+software for any purpose.  It is provided \"as is\" without express or\n\
+implied warranty.\n"));
 
   /* referenced via ntpsnmpdOptions.pOptDesc->pzText */
   puts(_("Do not fork"));
@@ -599,14 +601,14 @@
   puts(_("load options from a config file"));
 
   /* referenced via ntpsnmpdOptions.pzUsageTitle */
-  puts(_("ntpsnmpd - NTP SNMP MIB agent - Ver. 4.2.8\n\
+  puts(_("ntpsnmpd - NTP SNMP MIB agent - Ver. 4.2.8p2\n\
 Usage:  %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]...\n"));
 
   /* referenced via ntpsnmpdOptions.pzExplain */
   puts(_("\n"));
 
   /* referenced via ntpsnmpdOptions.pzFullVersion */
-  puts(_("ntpsnmpd 4.2.8"));
+  puts(_("ntpsnmpd 4.2.8p2"));
 
   /* referenced via ntpsnmpdOptions.pzFullUsage */
   puts(_("<<<NOT-FOUND>>>"));
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/ntpsnmpd/ntpsnmpd-opts.h /cur/src/external/bsd/ntp/dist/ntpsnmpd/ntpsnmpd-opts.h
--- external/bsd/ntp/dist/ntpsnmpd/ntpsnmpd-opts.h	2014-12-24 18:28:11.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/ntpsnmpd/ntpsnmpd-opts.h	2015-04-07 19:51:17.000000000 -0700
@@ -3,7 +3,7 @@
 /*
  *  EDIT THIS FILE WITH CAUTION  (ntpsnmpd-opts.h)
  *
- *  It has been AutoGen-ed  December 19, 2014 at 07:50:21 AM by AutoGen 5.18.5pre4
+ *  It has been AutoGen-ed  April  7, 2015 at 04:27:12 AM by AutoGen 5.18.5pre4
  *  From the definitions    ntpsnmpd-opts.def
  *  and the template file   options
  *
@@ -20,7 +20,7 @@
  * The ntpsnmpd program is copyrighted and licensed
  * under the following terms:
  *
- *  Copyright (C) 1970-2014 The University of Delaware, all rights reserved.
+ *  Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation, all rights reserved.
  *  This is free software. It is licensed for use, modification and
  *  redistribution under the terms of the NTP License, copies of which
  *  can be seen at:
@@ -33,7 +33,7 @@
  *  both the copyright notice and this permission notice appear in
  *  supporting documentation, and that the name The University of Delaware not be used in
  *  advertising or publicity pertaining to distribution of the software
- *  without specific, written prior permission. The University of Delaware makes no
+ *  without specific, written prior permission. The University of Delaware and Network Time Foundation makes no
  *  representations about the suitability this software for any purpose. It
  *  is provided "as is" without express or implied warranty.
  */
@@ -78,9 +78,9 @@
 /** count of all options for ntpsnmpd */
 #define OPTION_CT    8
 /** ntpsnmpd version */
-#define NTPSNMPD_VERSION       "4.2.8"
+#define NTPSNMPD_VERSION       "4.2.8p2"
 /** Full ntpsnmpd version text */
-#define NTPSNMPD_FULL_VERSION  "ntpsnmpd 4.2.8"
+#define NTPSNMPD_FULL_VERSION  "ntpsnmpd 4.2.8p2"
 
 /**
  *  Interface defines for all options.  Replace "n" with the UPPER_CASED
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/ntpsnmpd/ntpsnmpd.1ntpsnmpdman /cur/src/external/bsd/ntp/dist/ntpsnmpd/ntpsnmpd.1ntpsnmpdman
--- external/bsd/ntp/dist/ntpsnmpd/ntpsnmpd.1ntpsnmpdman	2014-12-19 12:37:43.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/ntpsnmpd/ntpsnmpd.1ntpsnmpdman	2015-04-07 19:51:17.000000000 -0700
@@ -10,11 +10,11 @@
 .ds B-Font B
 .ds I-Font I
 .ds R-Font R
-.TH ntpsnmpd 1ntpsnmpdman "19 Dec 2014" "4.2.8" "User Commands"
+.TH ntpsnmpd 1ntpsnmpdman "07 Apr 2015" "4.2.8p2" "User Commands"
 .\"
-.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-FOaywh/ag-ROaqvh)
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-wFai4a/ag-JFaa3a)
 .\"
-.\" It has been AutoGen-ed December 19, 2014 at 07:50:29 AM by AutoGen 5.18.5pre4
+.\" It has been AutoGen-ed April 7, 2015 at 04:27:19 AM by AutoGen 5.18.5pre4
 .\" From the definitions ntpsnmpd-opts.def
 .\" and the template file agman-cmd.tpl
 .SH NAME
@@ -138,7 +138,7 @@
 .NOP  "Heiko Gerstung" 
 .br
 .SH "COPYRIGHT"
-Copyright (C) 1970-2014 The University of Delaware all rights reserved.
+Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation all rights reserved.
 This program is released under the terms of the NTP license, <http://ntp.org/license>.
 .SH "BUGS"
 Please send bug reports to: http://bugs.ntp.org, bugs@ntp.org
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc /cur/src/external/bsd/ntp/dist/ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc
--- external/bsd/ntp/dist/ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc	2014-12-19 12:37:43.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc	2015-04-07 19:51:17.000000000 -0700
@@ -1,9 +1,9 @@
-.Dd December 19 2014
+.Dd April 7 2015
 .Dt NTPSNMPD 1ntpsnmpdmdoc User Commands
 .Os
 .\"  EDIT THIS FILE WITH CAUTION  (ntpsnmpd-opts.mdoc)
 .\"
-.\"  It has been AutoGen-ed  December 19, 2014 at 07:50:34 AM by AutoGen 5.18.5pre4
+.\"  It has been AutoGen-ed  April  7, 2015 at 04:27:25 AM by AutoGen 5.18.5pre4
 .\"  From the definitions    ntpsnmpd-opts.def
 .\"  and the template file   agmdoc-cmd.tpl
 .Sh NAME
@@ -110,7 +110,7 @@
 .Sh AUTHORS
 .An "Heiko Gerstung"
 .Sh "COPYRIGHT"
-Copyright (C) 1970\-2014 The University of Delaware all rights reserved.
+Copyright (C) 1992\-2015 The University of Delaware and Network Time Foundation all rights reserved.
 This program is released under the terms of the NTP license, <http://ntp.org/license>.
 .Sh "BUGS"
 Please send bug reports to: http://bugs.ntp.org, bugs@ntp.org
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/ntpsnmpd/ntpsnmpd.html /cur/src/external/bsd/ntp/dist/ntpsnmpd/ntpsnmpd.html
--- external/bsd/ntp/dist/ntpsnmpd/ntpsnmpd.html	2014-12-19 12:37:43.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/ntpsnmpd/ntpsnmpd.html	2015-04-07 19:51:17.000000000 -0700
@@ -42,7 +42,7 @@
 <p>The <code>ntpsnmpd</code> utility program is used to monitor NTP daemon <code>ntpd</code>
 operations and determine performance.  It uses the standard NTP mode 6 control
 
-  <p>This document applies to version 4.2.8 of <code>ntpsnmpd</code>.
+  <p>This document applies to version 4.2.8p2 of <code>ntpsnmpd</code>.
 
 <ul class="menu">
 <li><a accesskey="1" href="#ntpsnmpd-Description">ntpsnmpd Description</a>:             Description
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/ntpsnmpd/ntpsnmpd.man.in /cur/src/external/bsd/ntp/dist/ntpsnmpd/ntpsnmpd.man.in
--- external/bsd/ntp/dist/ntpsnmpd/ntpsnmpd.man.in	2014-12-19 12:37:43.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/ntpsnmpd/ntpsnmpd.man.in	2015-04-07 19:51:17.000000000 -0700
@@ -10,11 +10,11 @@
 .ds B-Font B
 .ds I-Font I
 .ds R-Font R
-.TH ntpsnmpd @NTPSNMPD_MS@ "19 Dec 2014" "4.2.8" "User Commands"
+.TH ntpsnmpd @NTPSNMPD_MS@ "07 Apr 2015" "4.2.8p2" "User Commands"
 .\"
-.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-FOaywh/ag-ROaqvh)
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-wFai4a/ag-JFaa3a)
 .\"
-.\" It has been AutoGen-ed December 19, 2014 at 07:50:29 AM by AutoGen 5.18.5pre4
+.\" It has been AutoGen-ed April 7, 2015 at 04:27:19 AM by AutoGen 5.18.5pre4
 .\" From the definitions ntpsnmpd-opts.def
 .\" and the template file agman-cmd.tpl
 .SH NAME
@@ -138,7 +138,7 @@
 .NOP  "Heiko Gerstung" 
 .br
 .SH "COPYRIGHT"
-Copyright (C) 1970-2014 The University of Delaware all rights reserved.
+Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation all rights reserved.
 This program is released under the terms of the NTP license, <http://ntp.org/license>.
 .SH "BUGS"
 Please send bug reports to: http://bugs.ntp.org, bugs@ntp.org
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/ntpsnmpd/ntpsnmpd.mdoc.in /cur/src/external/bsd/ntp/dist/ntpsnmpd/ntpsnmpd.mdoc.in
--- external/bsd/ntp/dist/ntpsnmpd/ntpsnmpd.mdoc.in	2014-12-19 12:37:43.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/ntpsnmpd/ntpsnmpd.mdoc.in	2015-04-07 19:51:17.000000000 -0700
@@ -1,9 +1,9 @@
-.Dd December 19 2014
+.Dd April 7 2015
 .Dt NTPSNMPD @NTPSNMPD_MS@ User Commands
 .Os
 .\"  EDIT THIS FILE WITH CAUTION  (ntpsnmpd-opts.mdoc)
 .\"
-.\"  It has been AutoGen-ed  December 19, 2014 at 07:50:34 AM by AutoGen 5.18.5pre4
+.\"  It has been AutoGen-ed  April  7, 2015 at 04:27:25 AM by AutoGen 5.18.5pre4
 .\"  From the definitions    ntpsnmpd-opts.def
 .\"  and the template file   agmdoc-cmd.tpl
 .Sh NAME
@@ -110,7 +110,7 @@
 .Sh AUTHORS
 .An "Heiko Gerstung"
 .Sh "COPYRIGHT"
-Copyright (C) 1970\-2014 The University of Delaware all rights reserved.
+Copyright (C) 1992\-2015 The University of Delaware and Network Time Foundation all rights reserved.
 This program is released under the terms of the NTP license, <http://ntp.org/license>.
 .Sh "BUGS"
 Please send bug reports to: http://bugs.ntp.org, bugs@ntp.org
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/packageinfo.sh /cur/src/external/bsd/ntp/dist/packageinfo.sh
--- external/bsd/ntp/dist/packageinfo.sh	2014-12-19 12:37:36.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/packageinfo.sh	2015-04-07 19:51:17.000000000 -0700
@@ -41,7 +41,7 @@
 # To see what UpdatePoint will do without modifying packageinfo.sh as it
 # does by default, use the -t/--test option before the repo type:
 #
-# shell# scripts/UpdatePoint -t stable
+# shell# scripts/build/UpdatePoint -t stable
 #
 
 # repotype must be stable or dev
@@ -83,7 +83,7 @@
 # - Numeric values increment
 # - empty 'increments' to 1
 # - NEW 'increments' to empty
-point=
+point=2
 
 ### betapoint is normally modified by script.
 # ntp-stable Beta number (betapoint)
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/parseutil/Makefile.in /cur/src/external/bsd/ntp/dist/parseutil/Makefile.in
--- external/bsd/ntp/dist/parseutil/Makefile.in	2014-12-19 12:37:43.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/parseutil/Makefile.in	2015-04-07 19:51:17.000000000 -0700
@@ -41,8 +41,7 @@
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
 	$(top_srcdir)/sntp/libopts/m4/stdnoreturn.m4 \
-	$(top_srcdir)/sntp/libevent/m4/openldap-thread-check.m4 \
-	$(top_srcdir)/sntp/libevent/m4/openldap.m4 \
+	$(top_srcdir)/sntp/m4/ax_c99_struct_init.m4 \
 	$(top_srcdir)/sntp/m4/define_dir.m4 \
 	$(top_srcdir)/sntp/m4/hms_search_lib.m4 \
 	$(top_srcdir)/sntp/m4/libtool.m4 \
@@ -71,6 +70,8 @@
 	$(top_srcdir)/sntp/m4/ntp_sntp.m4 \
 	$(top_srcdir)/sntp/m4/ntp_ver_suffix.m4 \
 	$(top_srcdir)/sntp/m4/ntp_vpathhack.m4 \
+	$(top_srcdir)/sntp/m4/openldap-thread-check.m4 \
+	$(top_srcdir)/sntp/m4/openldap.m4 \
 	$(top_srcdir)/sntp/m4/os_cflags.m4 \
 	$(top_srcdir)/sntp/m4/snprintf.m4 \
 	$(top_srcdir)/sntp/m4/version.m4 $(top_srcdir)/configure.ac
@@ -148,6 +149,7 @@
 CONFIG_SHELL = @CONFIG_SHELL@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
+CPPFLAGS_LIBEVENT = @CPPFLAGS_LIBEVENT@
 CPPFLAGS_NTP = @CPPFLAGS_NTP@
 CXX = @CXX@
 CXXCPP = @CXXCPP@
@@ -182,7 +184,9 @@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 LD = @LD@
+LDADD_LIBEVENT = @LDADD_LIBEVENT@
 LDADD_LIBNTP = @LDADD_LIBNTP@
+LDADD_LIBUTIL = @LDADD_LIBUTIL@
 LDADD_NLIST = @LDADD_NLIST@
 LDADD_NTP = @LDADD_NTP@
 LDFLAGS = @LDFLAGS@
@@ -321,6 +325,11 @@
 TIMETRIM_DS = @TIMETRIM_DS@
 TIMETRIM_MS = @TIMETRIM_MS@
 TIMETRIM_NI = @TIMETRIM_NI@
+UPDATE_LEAP_DB = @UPDATE_LEAP_DB@
+UPDATE_LEAP_DL = @UPDATE_LEAP_DL@
+UPDATE_LEAP_DS = @UPDATE_LEAP_DS@
+UPDATE_LEAP_MS = @UPDATE_LEAP_MS@
+UPDATE_LEAP_NI = @UPDATE_LEAP_NI@
 VERSION = @VERSION@
 VER_SUFFIX = @VER_SUFFIX@
 YACC = @YACC@
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/parseutil/dcfd.c /cur/src/external/bsd/ntp/dist/parseutil/dcfd.c
--- external/bsd/ntp/dist/parseutil/dcfd.c	2014-12-24 18:28:11.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/parseutil/dcfd.c	2015-04-07 19:51:17.000000000 -0700
@@ -2,7 +2,7 @@
 
 /*
  * /src/NTP/REPOSITORY/ntp4-dev/parseutil/dcfd.c,v 4.18 2005/10/07 22:08:18 kardel RELEASE_20051008_A
- *  
+ *
  * dcfd.c,v 4.18 2005/10/07 22:08:18 kardel RELEASE_20051008_A
  *
  * DCF77 100/200ms pulse synchronisation daemon program (via 50Baud serial line)
@@ -16,7 +16,7 @@
  *  Leap second handling (at that level you should switch to NTP Version 4 - really!)
  *
  * Copyright (c) 1995-2005 by Frank Kardel <kardel <AT> ntp.org>
- * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universität Erlangen-Nürnberg, Germany
+ * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universitaet Erlangen-Nuernberg, Germany
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -200,7 +200,7 @@
 #define DCFB_ANNOUNCE		0x0001 /* switch time zone warning (DST switch) */
 #define DCFB_DST		0x0002 /* DST in effect */
 #define DCFB_LEAP		0x0004 /* LEAP warning (1 hour prior to occurrence) */
-#define DCFB_ALTERNATE		0x0008 /* alternate antenna used */
+#define DCFB_CALLBIT		0x0008 /* "call bit" used to signalize irregularities in the control facilities */
 
 struct clocktime		/* clock time broken up from time code */
 {
@@ -221,9 +221,16 @@
 /*
  * (usually) quick constant multiplications
  */
+#ifndef TIMES10
 #define TIMES10(_X_) (((_X_) << 3) + ((_X_) << 1))	/* *8 + *2 */
+#endif
+#ifndef TIMES24
 #define TIMES24(_X_) (((_X_) << 4) + ((_X_) << 3))      /* *16 + *8 */
+#endif
+#ifndef TIMES60
 #define TIMES60(_X_) ((((_X_) << 4)  - (_X_)) << 2)     /* *(16 - 1) *4 */
+#endif
+
 /*
  * generic l_abs() function
  */
@@ -262,7 +269,8 @@
  * Second	Contents
  * 0  - 10	AM: free, FM: 0
  * 11 - 14	free
- * 15		R     - alternate antenna
+ * 15		R     - "call bit" used to signalize irregularities in the control facilities
+ *		        (until 2003 indicated transmission via alternate antenna)
  * 16		A1    - expect zone change (1 hour before)
  * 17 - 18	Z1,Z2 - time zone
  *		 0  0 illegal
@@ -296,7 +304,7 @@
  *   while the length is given as the difference between the start index and
  *   the start index of the following field.
  */
-static struct rawdcfcode 
+static struct rawdcfcode
 {
 	char offset;			/* start bit */
 } rawdcfcode[] =
@@ -363,7 +371,7 @@
 {
 	unsigned char onebits[60];
 	unsigned char zerobits[60];
-} dcfparam = 
+} dcfparam =
 {
 	"###############RADMLS1248124P124812P1248121241248112481248P", /* 'ONE' representation */
 	"--------------------s-------p------p----------------------p"  /* 'ZERO' representation */
@@ -386,7 +394,7 @@
 	register int i, first;
 
 	first = rawdcfcode[idx].offset;
-  
+
 	for (i = rawdcfcode[idx+1].offset - 1; i >= first; i--)
 	{
 		sum <<= 1;
@@ -440,7 +448,7 @@
 		PRINTF("%-30s", "*** INCOMPLETE");
 		return CVT_NONE;
 	}
-  
+
 	/*
 	 * check Start and Parity bits
 	 */
@@ -497,7 +505,7 @@
 		    clock_time->flags |= DCFB_LEAP;
 
 		if (ext_bf(buffer, DCF_R))
-		    clock_time->flags |= DCFB_ALTERNATE;
+		    clock_time->flags |= DCFB_CALLBIT;
 
 		return CVT_OK;
 	}
@@ -741,7 +749,7 @@
 	 * if everything went well so far return the result of the symbolic
 	 * conversion routine else just the accumulated errors
 	 */
-	if (rtc != CVT_NONE) 
+	if (rtc != CVT_NONE)
 	{
 		PRINTF("%-30s", "*** BAD DATA");
 	}
@@ -760,13 +768,13 @@
 		)
 {
 #define SETRTC(_X_)	{ if (cvtrtc) *cvtrtc = (_X_); }
-	static int days_of_month[] = 
+	static int days_of_month[] =
 	{
 		0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31
 	};
 	register int i;
 	time_t t;
-  
+
 	/*
 	 * map 2 digit years to 19xx (DCF77 is a 20th century item)
 	 */
@@ -849,7 +857,7 @@
 	 */
 	t = TIMES60(t) + clock_time->minute;
 				/* sec */
-  
+
 	/*
 	 * calculate UTC in minutes
 	 */
@@ -1249,7 +1257,7 @@
  */
 static int
 check_y2k( void )
-{ 
+{
     int  year;			/* current working year */
     int  year0 = 1900;		/* sarting year for NTP time */
     int  yearend;		/* ending year we test for NTP time.
@@ -1308,7 +1316,7 @@
 		 * *a minor difference to arg2 type */
 	if ( ct.year != year )
 	{
-	    fprintf( stdout, 
+	    fprintf( stdout,
 	       "%04d: dcf_to_unixtime(,%d) CORRUPTED ct.year: was %d\n",
 	       (int)year, (int)Flag, (int)ct.year );
 	    Error(year);
@@ -1318,9 +1326,9 @@
 	Expected = t * 24 * 60 * 60;
 	if ( Observed != Expected  ||  Flag )
 	{   /* time difference */
-	    fprintf( stdout, 
+	    fprintf( stdout,
 	       "%04d: dcf_to_unixtime(,%d) FAILURE: was=%lu s/b=%lu  (%ld)\n",
-	       year, (int)Flag, 
+	       year, (int)Flag,
 	       (unsigned long)Observed, (unsigned long)Expected,
 	       ((long)Observed - (long)Expected) );
 	    Error(year);
@@ -1346,7 +1354,7 @@
 	 * Here a voltage between the DTR and the RTS line is used. Unfortunately
 	 * the name has changed from CIOCM_DTR to TIOCM_DTR recently.
 	 */
-	
+
 #ifdef TIOCM_DTR
 	int sl232 = TIOCM_DTR;	/* turn on DTR for power supply */
 #else
@@ -1440,7 +1448,7 @@
 					errs=1;
 				}
 				break;
-	      
+
 			    case 'd':
 				if (ac > 1)
 				{
@@ -1453,8 +1461,8 @@
 					errs=1;
 				}
 				break;
-	      
-			    case 'Y':	
+
+			    case 'Y':
 				errs=check_y2k();
 				exit( errs ? 1 : 0 );
 
@@ -1521,7 +1529,7 @@
 		unsigned int rtc = CVT_NONE;
 
 		rawdcf_init(fd);
-		
+
 		timeout.tv_sec  = 1;
 		timeout.tv_usec = 500000;
 
@@ -1562,7 +1570,7 @@
 		 */
 		if (!interactive)
 		    detach();
-      
+
 		/*
 		 * get syslog() initialized
 		 */
@@ -1620,7 +1628,7 @@
 			it.it_interval.tv_usec = 0;
 			it.it_value.tv_sec     = 1<<ADJINTERVAL;
 			it.it_value.tv_usec    = 0;
-	
+
 			if (setitimer(ITIMER_REAL, &it, (struct itimerval *)0) == -1)
 			{
 				syslog(LOG_ERR, "setitimer: %m");
@@ -1799,7 +1807,7 @@
 					       wday[clock_time.wday],
 					       clock_time.hour, clock_time.minute, i, clock_time.day, clock_time.month,
 					       clock_time.year,
-					       (clock_time.flags & DCFB_ALTERNATE) ? "R" : "_",
+					       (clock_time.flags & DCFB_CALLBIT) ? "R" : "_",
 					       (clock_time.flags & DCFB_ANNOUNCE) ? "A" : "_",
 					       (clock_time.flags & DCFB_DST) ? "D" : "_",
 					       (clock_time.flags & DCFB_LEAP) ? "L" : "_",
@@ -1831,7 +1839,7 @@
 				    fflush(stdout);
 			}
 		} while ((rrc == -1) && (errno == EINTR));
-      
+
 		/*
 		 * lost IO - sorry guys
 		 */
@@ -1841,7 +1849,7 @@
 	}
 
 	closelog();
-  
+
 	return 0;
 }
 
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/parseutil/testdcf.c /cur/src/external/bsd/ntp/dist/parseutil/testdcf.c
--- external/bsd/ntp/dist/parseutil/testdcf.c	2014-12-24 18:28:11.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/parseutil/testdcf.c	2015-04-07 19:51:17.000000000 -0700
@@ -4,11 +4,11 @@
  * /src/NTP/ntp4-dev/parseutil/testdcf.c,v 4.10 2005/08/06 14:18:43 kardel RELEASE_20050806_A
  *
  * testdcf.c,v 4.10 2005/08/06 14:18:43 kardel RELEASE_20050806_A
- *  
+ *
  * simple DCF77 100/200ms pulse test program (via 50Baud serial line)
  *
  * Copyright (c) 1995-2005 by Frank Kardel <kardel <AT> ntp.org>
- * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universität Erlangen-Nürnberg, Germany
+ * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universitaet Erlangen-Nuernberg, Germany
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -48,10 +48,10 @@
 /*
  * state flags
  */
-#define DCFB_ANNOUNCE           0x0001 /* switch time zone warning (DST switch) */
-#define DCFB_DST                0x0002 /* DST in effect */
-#define DCFB_LEAP		0x0004 /* LEAP warning (1 hour prior to occurrence) */
-#define DCFB_ALTERNATE		0x0008 /* alternate antenna used */
+#define DCFB_ANNOUNCE   0x0001 /* switch time zone warning (DST switch) */
+#define DCFB_DST        0x0002 /* DST in effect */
+#define DCFB_LEAP       0x0004 /* LEAP warning (1 hour prior to occurrence) */
+#define DCFB_CALLBIT    0x0008 /* "call bit" used to signalize irregularities in the control facilities */
 
 struct clocktime		/* clock time broken up from time code */
 {
@@ -104,7 +104,8 @@
  * Second	Contents
  * 0  - 10	AM: free, FM: 0
  * 11 - 14	free
- * 15		R     - alternate antenna
+ * 15		R     - "call bit" used to signalize irregularities in the control facilities
+ *		        (until 2003 indicated transmission via alternate antenna)
  * 16		A1    - expect zone change (1 hour before)
  * 17 - 18	Z1,Z2 - time zone
  *		 0  0 illegal
@@ -132,7 +133,7 @@
 
 static char revision[] = "4.10";
 
-static struct rawdcfcode 
+static struct rawdcfcode
 {
 	char offset;			/* start bit */
 } rawdcfcode[] =
@@ -187,7 +188,7 @@
 	register int i, first;
 
 	first = rawdcfcode[idx].offset;
-  
+
 	for (i = rawdcfcode[idx+1].offset - 1; i >= first; i--)
 	{
 		sum <<= 1;
@@ -225,7 +226,7 @@
 		printf("%-30s", "*** INCOMPLETE");
 		return CVT_NONE;
 	}
-  
+
 	/*
 	 * check Start and Parity bits
 	 */
@@ -276,7 +277,7 @@
 		    clock_time->flags |= DCFB_LEAP;
 
 		if (ext_bf(buffer, DCF_R))
-		    clock_time->flags |= DCFB_ALTERNATE;
+		    clock_time->flags |= DCFB_CALLBIT;
 
 		return CVT_OK;
 	}
@@ -492,7 +493,7 @@
 					       wday[clock_time.wday],
 					       (int)clock_time.hour, (int)clock_time.minute, (int)i, (int)clock_time.day, (int)clock_time.month,
 					       (int)clock_time.year,
-					       (clock_time.flags & DCFB_ALTERNATE) ? "R" : "_",
+					       (clock_time.flags & DCFB_CALLBIT) ? "R" : "_",
 					       (clock_time.flags & DCFB_ANNOUNCE) ? "A" : "_",
 					       (clock_time.flags & DCFB_DST) ? "D" : "_",
 					       (clock_time.flags & DCFB_LEAP) ? "L" : "_"
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/scripts/Makefile.am /cur/src/external/bsd/ntp/dist/scripts/Makefile.am
--- external/bsd/ntp/dist/scripts/Makefile.am	2014-12-19 12:37:43.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/scripts/Makefile.am	2015-04-07 19:51:17.000000000 -0700
@@ -6,6 +6,7 @@
 	ntpsweep	\
 	ntptrace	\
 	lib		\
+	update-leap	\
 	$(NULL)
 
 man1_MANS=
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/scripts/Makefile.in /cur/src/external/bsd/ntp/dist/scripts/Makefile.in
--- external/bsd/ntp/dist/scripts/Makefile.in	2014-12-19 12:37:43.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/scripts/Makefile.in	2015-04-07 19:51:17.000000000 -0700
@@ -42,8 +42,7 @@
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
 	$(top_srcdir)/sntp/libopts/m4/stdnoreturn.m4 \
-	$(top_srcdir)/sntp/libevent/m4/openldap-thread-check.m4 \
-	$(top_srcdir)/sntp/libevent/m4/openldap.m4 \
+	$(top_srcdir)/sntp/m4/ax_c99_struct_init.m4 \
 	$(top_srcdir)/sntp/m4/define_dir.m4 \
 	$(top_srcdir)/sntp/m4/hms_search_lib.m4 \
 	$(top_srcdir)/sntp/m4/libtool.m4 \
@@ -72,6 +71,8 @@
 	$(top_srcdir)/sntp/m4/ntp_sntp.m4 \
 	$(top_srcdir)/sntp/m4/ntp_ver_suffix.m4 \
 	$(top_srcdir)/sntp/m4/ntp_vpathhack.m4 \
+	$(top_srcdir)/sntp/m4/openldap-thread-check.m4 \
+	$(top_srcdir)/sntp/m4/openldap.m4 \
 	$(top_srcdir)/sntp/m4/os_cflags.m4 \
 	$(top_srcdir)/sntp/m4/snprintf.m4 \
 	$(top_srcdir)/sntp/m4/version.m4 $(top_srcdir)/configure.ac
@@ -180,6 +181,7 @@
 CONFIG_SHELL = @CONFIG_SHELL@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
+CPPFLAGS_LIBEVENT = @CPPFLAGS_LIBEVENT@
 CPPFLAGS_NTP = @CPPFLAGS_NTP@
 CXX = @CXX@
 CXXCPP = @CXXCPP@
@@ -214,7 +216,9 @@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 LD = @LD@
+LDADD_LIBEVENT = @LDADD_LIBEVENT@
 LDADD_LIBNTP = @LDADD_LIBNTP@
+LDADD_LIBUTIL = @LDADD_LIBUTIL@
 LDADD_NLIST = @LDADD_NLIST@
 LDADD_NTP = @LDADD_NTP@
 LDFLAGS = @LDFLAGS@
@@ -353,6 +357,11 @@
 TIMETRIM_DS = @TIMETRIM_DS@
 TIMETRIM_MS = @TIMETRIM_MS@
 TIMETRIM_NI = @TIMETRIM_NI@
+UPDATE_LEAP_DB = @UPDATE_LEAP_DB@
+UPDATE_LEAP_DL = @UPDATE_LEAP_DL@
+UPDATE_LEAP_DS = @UPDATE_LEAP_DS@
+UPDATE_LEAP_MS = @UPDATE_LEAP_MS@
+UPDATE_LEAP_NI = @UPDATE_LEAP_NI@
 VERSION = @VERSION@
 VER_SUFFIX = @VER_SUFFIX@
 YACC = @YACC@
@@ -419,6 +428,7 @@
 	ntpsweep	\
 	ntptrace	\
 	lib		\
+	update-leap	\
 	$(NULL)
 
 man1_MANS = 
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/scripts/build/Makefile.in /cur/src/external/bsd/ntp/dist/scripts/build/Makefile.in
--- external/bsd/ntp/dist/scripts/build/Makefile.in	2014-12-19 12:37:43.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/scripts/build/Makefile.in	2015-04-07 19:51:17.000000000 -0700
@@ -40,8 +40,7 @@
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
 	$(top_srcdir)/sntp/libopts/m4/stdnoreturn.m4 \
-	$(top_srcdir)/sntp/libevent/m4/openldap-thread-check.m4 \
-	$(top_srcdir)/sntp/libevent/m4/openldap.m4 \
+	$(top_srcdir)/sntp/m4/ax_c99_struct_init.m4 \
 	$(top_srcdir)/sntp/m4/define_dir.m4 \
 	$(top_srcdir)/sntp/m4/hms_search_lib.m4 \
 	$(top_srcdir)/sntp/m4/libtool.m4 \
@@ -70,6 +69,8 @@
 	$(top_srcdir)/sntp/m4/ntp_sntp.m4 \
 	$(top_srcdir)/sntp/m4/ntp_ver_suffix.m4 \
 	$(top_srcdir)/sntp/m4/ntp_vpathhack.m4 \
+	$(top_srcdir)/sntp/m4/openldap-thread-check.m4 \
+	$(top_srcdir)/sntp/m4/openldap.m4 \
 	$(top_srcdir)/sntp/m4/os_cflags.m4 \
 	$(top_srcdir)/sntp/m4/snprintf.m4 \
 	$(top_srcdir)/sntp/m4/version.m4 $(top_srcdir)/configure.ac
@@ -111,6 +112,7 @@
 CONFIG_SHELL = @CONFIG_SHELL@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
+CPPFLAGS_LIBEVENT = @CPPFLAGS_LIBEVENT@
 CPPFLAGS_NTP = @CPPFLAGS_NTP@
 CXX = @CXX@
 CXXCPP = @CXXCPP@
@@ -145,7 +147,9 @@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 LD = @LD@
+LDADD_LIBEVENT = @LDADD_LIBEVENT@
 LDADD_LIBNTP = @LDADD_LIBNTP@
+LDADD_LIBUTIL = @LDADD_LIBUTIL@
 LDADD_NLIST = @LDADD_NLIST@
 LDADD_NTP = @LDADD_NTP@
 LDFLAGS = @LDFLAGS@
@@ -284,6 +288,11 @@
 TIMETRIM_DS = @TIMETRIM_DS@
 TIMETRIM_MS = @TIMETRIM_MS@
 TIMETRIM_NI = @TIMETRIM_NI@
+UPDATE_LEAP_DB = @UPDATE_LEAP_DB@
+UPDATE_LEAP_DL = @UPDATE_LEAP_DL@
+UPDATE_LEAP_DS = @UPDATE_LEAP_DS@
+UPDATE_LEAP_MS = @UPDATE_LEAP_MS@
+UPDATE_LEAP_NI = @UPDATE_LEAP_NI@
 VERSION = @VERSION@
 VER_SUFFIX = @VER_SUFFIX@
 YACC = @YACC@
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/scripts/build/UpdatePoint /cur/src/external/bsd/ntp/dist/scripts/build/UpdatePoint
--- external/bsd/ntp/dist/scripts/build/UpdatePoint	2013-12-27 15:31:08.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/scripts/build/UpdatePoint	2015-04-07 19:51:17.000000000 -0700
@@ -217,20 +217,26 @@
     ;;
 esac
 
-case "$bp::$point" in
- 0::*)
+case "$repo::$bp::$point" in
+ *::0::*)
     newpoint=$point
     ;;
- 1::[1-9]*)
+ dev::1::0)
+    newpoint=`expr $point + 1`
+    ;;
+ *::1::[1-9]*)
     newpoint=`expr $point + 1`
     ;;
- 1::)
+ dev::1::)
+    newpoint=0
+    ;;
+ stable::1::)
     newpoint=1
     ;;
- 1::[Nn][Ee][Ww])
+ *::1::[Nn][Ee][Ww])
     newpoint=
     ;;
- *) echo "Unexpected value for 'point' <$point>!"
+ *) echo "Unexpected value for 'point' <$point>! (repo::bp::point is $repo::$bp::$point)"
     exit 1
     ;;
 esac
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/scripts/build/VersionName /cur/src/external/bsd/ntp/dist/scripts/build/VersionName
--- external/bsd/ntp/dist/scripts/build/VersionName	2014-12-19 12:37:43.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/scripts/build/VersionName	2015-04-07 19:51:17.000000000 -0700
@@ -19,8 +19,17 @@
 . "$packageinfo"
 
 NAME="$version"
-case $point in
- [1-9]*)
+case "$repotype::$point" in
+ dev::)
+    case "${proto}.${major}" in
+     4.[012])
+	NAME="${NAME}p${point}"
+        ;;
+     *) NAME="${NAME}"
+        ;;
+    esac
+    ;;
+ stable::[1-9]* | dev::[0-9]*)
     case "${proto}.${major}" in
      4.[012])
 	NAME="${NAME}p${point}"
@@ -31,7 +40,7 @@
     ;;
  NEW) ;;
  '') ;;
- *) echo "Unexpected value for 'point' <$point>!"
+ *) echo "Unexpected value for 'point' <$point>! (repotype is <$repotype>)"
     exit 1
     ;;
 esac
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/scripts/calc_tickadj/Makefile.in /cur/src/external/bsd/ntp/dist/scripts/calc_tickadj/Makefile.in
--- external/bsd/ntp/dist/scripts/calc_tickadj/Makefile.in	2014-12-19 12:37:43.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/scripts/calc_tickadj/Makefile.in	2015-04-07 19:51:17.000000000 -0700
@@ -42,8 +42,7 @@
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
 	$(top_srcdir)/sntp/libopts/m4/stdnoreturn.m4 \
-	$(top_srcdir)/sntp/libevent/m4/openldap-thread-check.m4 \
-	$(top_srcdir)/sntp/libevent/m4/openldap.m4 \
+	$(top_srcdir)/sntp/m4/ax_c99_struct_init.m4 \
 	$(top_srcdir)/sntp/m4/define_dir.m4 \
 	$(top_srcdir)/sntp/m4/hms_search_lib.m4 \
 	$(top_srcdir)/sntp/m4/libtool.m4 \
@@ -72,6 +71,8 @@
 	$(top_srcdir)/sntp/m4/ntp_sntp.m4 \
 	$(top_srcdir)/sntp/m4/ntp_ver_suffix.m4 \
 	$(top_srcdir)/sntp/m4/ntp_vpathhack.m4 \
+	$(top_srcdir)/sntp/m4/openldap-thread-check.m4 \
+	$(top_srcdir)/sntp/m4/openldap.m4 \
 	$(top_srcdir)/sntp/m4/os_cflags.m4 \
 	$(top_srcdir)/sntp/m4/snprintf.m4 \
 	$(top_srcdir)/sntp/m4/version.m4 $(top_srcdir)/configure.ac
@@ -142,6 +143,7 @@
 CONFIG_SHELL = @CONFIG_SHELL@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
+CPPFLAGS_LIBEVENT = @CPPFLAGS_LIBEVENT@
 CPPFLAGS_NTP = @CPPFLAGS_NTP@
 CXX = @CXX@
 CXXCPP = @CXXCPP@
@@ -176,7 +178,9 @@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 LD = @LD@
+LDADD_LIBEVENT = @LDADD_LIBEVENT@
 LDADD_LIBNTP = @LDADD_LIBNTP@
+LDADD_LIBUTIL = @LDADD_LIBUTIL@
 LDADD_NLIST = @LDADD_NLIST@
 LDADD_NTP = @LDADD_NTP@
 LDFLAGS = @LDFLAGS@
@@ -315,6 +319,11 @@
 TIMETRIM_DS = @TIMETRIM_DS@
 TIMETRIM_MS = @TIMETRIM_MS@
 TIMETRIM_NI = @TIMETRIM_NI@
+UPDATE_LEAP_DB = @UPDATE_LEAP_DB@
+UPDATE_LEAP_DL = @UPDATE_LEAP_DL@
+UPDATE_LEAP_DS = @UPDATE_LEAP_DS@
+UPDATE_LEAP_MS = @UPDATE_LEAP_MS@
+UPDATE_LEAP_NI = @UPDATE_LEAP_NI@
 VERSION = @VERSION@
 VER_SUFFIX = @VER_SUFFIX@
 YACC = @YACC@
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/scripts/calc_tickadj/calc_tickadj.1calc_tickadjman /cur/src/external/bsd/ntp/dist/scripts/calc_tickadj/calc_tickadj.1calc_tickadjman
--- external/bsd/ntp/dist/scripts/calc_tickadj/calc_tickadj.1calc_tickadjman	2014-12-19 12:37:43.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/scripts/calc_tickadj/calc_tickadj.1calc_tickadjman	2015-04-07 19:51:17.000000000 -0700
@@ -10,11 +10,11 @@
 .ds B-Font B
 .ds I-Font I
 .ds R-Font R
-.TH calc_tickadj 1calc_tickadjman "19 Dec 2014" "ntp (4.2.8)" "User Commands"
+.TH calc_tickadj 1calc_tickadjman "07 Apr 2015" "ntp (4.2.8p2)" "User Commands"
 .\"
-.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-4GaOOZ/ag-fHaWNZ)
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-_1aOBS/ag-n2aWAS)
 .\"
-.\" It has been AutoGen-ed December 19, 2014 at 07:44:36 AM by AutoGen 5.18.5pre4
+.\" It has been AutoGen-ed April 7, 2015 at 04:21:04 AM by AutoGen 5.18.5pre4
 .\" From the definitions calc_tickadj-opts.def
 .\" and the template file agman-cmd.tpl
 .SH NAME
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc /cur/src/external/bsd/ntp/dist/scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc
--- external/bsd/ntp/dist/scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc	2014-12-19 12:37:43.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc	2015-04-07 19:51:17.000000000 -0700
@@ -1,9 +1,9 @@
-.Dd December 19 2014
+.Dd April 7 2015
 .Dt CALC_TICKADJ 1calc_tickadjmdoc User Commands
 .Os
 .\"  EDIT THIS FILE WITH CAUTION  (calc_tickadj-opts.mdoc)
 .\"
-.\"  It has been AutoGen-ed  December 19, 2014 at 07:44:39 AM by AutoGen 5.18.5pre4
+.\"  It has been AutoGen-ed  April  7, 2015 at 04:21:08 AM by AutoGen 5.18.5pre4
 .\"  From the definitions    calc_tickadj-opts.def
 .\"  and the template file   agmdoc-cmd.tpl
 .Sh NAME
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/scripts/calc_tickadj/calc_tickadj.html /cur/src/external/bsd/ntp/dist/scripts/calc_tickadj/calc_tickadj.html
--- external/bsd/ntp/dist/scripts/calc_tickadj/calc_tickadj.html	2014-12-19 12:37:43.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/scripts/calc_tickadj/calc_tickadj.html	2015-04-07 19:51:17.000000000 -0700
@@ -31,7 +31,7 @@
 <h2 class="unnumbered">calc_tickadj User's Manual</h2>
 
 <p>This document describes the use of the NTP Project's <code>calc_tickadj</code> program. 
-This document applies to version 4.2.8 of <code>calc_tickadj</code>.
+This document applies to version 4.2.8p2 of <code>calc_tickadj</code>.
 
   <div class="shortcontents">
 <h2>Short Contents</h2>
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/scripts/calc_tickadj/calc_tickadj.man.in /cur/src/external/bsd/ntp/dist/scripts/calc_tickadj/calc_tickadj.man.in
--- external/bsd/ntp/dist/scripts/calc_tickadj/calc_tickadj.man.in	2014-12-19 12:37:43.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/scripts/calc_tickadj/calc_tickadj.man.in	2015-04-07 19:51:17.000000000 -0700
@@ -10,11 +10,11 @@
 .ds B-Font B
 .ds I-Font I
 .ds R-Font R
-.TH calc_tickadj 1calc_tickadjman "19 Dec 2014" "ntp (4.2.8)" "User Commands"
+.TH calc_tickadj 1calc_tickadjman "07 Apr 2015" "ntp (4.2.8p2)" "User Commands"
 .\"
-.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-4GaOOZ/ag-fHaWNZ)
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-_1aOBS/ag-n2aWAS)
 .\"
-.\" It has been AutoGen-ed December 19, 2014 at 07:44:36 AM by AutoGen 5.18.5pre4
+.\" It has been AutoGen-ed April 7, 2015 at 04:21:04 AM by AutoGen 5.18.5pre4
 .\" From the definitions calc_tickadj-opts.def
 .\" and the template file agman-cmd.tpl
 .SH NAME
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/scripts/calc_tickadj/calc_tickadj.mdoc.in /cur/src/external/bsd/ntp/dist/scripts/calc_tickadj/calc_tickadj.mdoc.in
--- external/bsd/ntp/dist/scripts/calc_tickadj/calc_tickadj.mdoc.in	2014-12-19 12:37:43.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/scripts/calc_tickadj/calc_tickadj.mdoc.in	2015-04-07 19:51:17.000000000 -0700
@@ -1,9 +1,9 @@
-.Dd December 19 2014
+.Dd April 7 2015
 .Dt CALC_TICKADJ 1calc_tickadjmdoc User Commands
 .Os
 .\"  EDIT THIS FILE WITH CAUTION  (calc_tickadj-opts.mdoc)
 .\"
-.\"  It has been AutoGen-ed  December 19, 2014 at 07:44:39 AM by AutoGen 5.18.5pre4
+.\"  It has been AutoGen-ed  April  7, 2015 at 04:21:08 AM by AutoGen 5.18.5pre4
 .\"  From the definitions    calc_tickadj-opts.def
 .\"  and the template file   agmdoc-cmd.tpl
 .Sh NAME
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/scripts/calc_tickadj/invoke-calc_tickadj.texi /cur/src/external/bsd/ntp/dist/scripts/calc_tickadj/invoke-calc_tickadj.texi
--- external/bsd/ntp/dist/scripts/calc_tickadj/invoke-calc_tickadj.texi	2014-12-19 12:37:43.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/scripts/calc_tickadj/invoke-calc_tickadj.texi	2015-04-07 19:51:17.000000000 -0700
@@ -6,7 +6,7 @@
 #
 # EDIT THIS FILE WITH CAUTION  (invoke-calc_tickadj.texi)
 #
-# It has been AutoGen-ed  December 19, 2014 at 07:44:41 AM by AutoGen 5.18.5pre4
+# It has been AutoGen-ed  April  7, 2015 at 04:21:09 AM by AutoGen 5.18.5pre4
 # From the definitions    calc_tickadj-opts.def
 # and the template file   agtexi-cmd.tpl
 @end ignore
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/scripts/invoke-plot_summary.texi /cur/src/external/bsd/ntp/dist/scripts/invoke-plot_summary.texi
--- external/bsd/ntp/dist/scripts/invoke-plot_summary.texi	2014-12-19 12:37:43.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/scripts/invoke-plot_summary.texi	2015-04-07 19:51:17.000000000 -0700
@@ -6,7 +6,7 @@
 #
 # EDIT THIS FILE WITH CAUTION  (invoke-plot_summary.texi)
 #
-# It has been AutoGen-ed  December 19, 2014 at 07:45:15 AM by AutoGen 5.18.5pre4
+# It has been AutoGen-ed  April  7, 2015 at 04:21:51 AM by AutoGen 5.18.5pre4
 # From the definitions    plot_summary-opts.def
 # and the template file   agtexi-cmd.tpl
 @end ignore
@@ -41,7 +41,7 @@
 
 @exampleindent 0
 @example
-plot_summary - plot statistics generated by summary script - Ver. 4.2.8
+plot_summary - plot statistics generated by summary script - Ver. 4.2.8p2
 USAGE: plot_summary [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]... 
 
         --directory=str          Where the summary files are
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/scripts/invoke-summary.texi /cur/src/external/bsd/ntp/dist/scripts/invoke-summary.texi
--- external/bsd/ntp/dist/scripts/invoke-summary.texi	2014-12-19 12:37:43.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/scripts/invoke-summary.texi	2015-04-07 19:51:17.000000000 -0700
@@ -6,7 +6,7 @@
 #
 # EDIT THIS FILE WITH CAUTION  (invoke-summary.texi)
 #
-# It has been AutoGen-ed  December 19, 2014 at 07:45:21 AM by AutoGen 5.18.5pre4
+# It has been AutoGen-ed  April  7, 2015 at 04:21:57 AM by AutoGen 5.18.5pre4
 # From the definitions    summary-opts.def
 # and the template file   agtexi-cmd.tpl
 @end ignore
@@ -42,7 +42,7 @@
 
 @exampleindent 0
 @example
-summary - compute various stastics from NTP stat files - Ver. 4.2.8
+summary - compute various stastics from NTP stat files - Ver. 4.2.8p2
 USAGE: summary [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]... 
 
         --directory=str          Directory containing stat files
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/scripts/lib/Makefile.in /cur/src/external/bsd/ntp/dist/scripts/lib/Makefile.in
--- external/bsd/ntp/dist/scripts/lib/Makefile.in	2014-12-19 12:37:43.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/scripts/lib/Makefile.in	2015-04-07 19:51:17.000000000 -0700
@@ -39,8 +39,7 @@
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
 	$(top_srcdir)/sntp/libopts/m4/stdnoreturn.m4 \
-	$(top_srcdir)/sntp/libevent/m4/openldap-thread-check.m4 \
-	$(top_srcdir)/sntp/libevent/m4/openldap.m4 \
+	$(top_srcdir)/sntp/m4/ax_c99_struct_init.m4 \
 	$(top_srcdir)/sntp/m4/define_dir.m4 \
 	$(top_srcdir)/sntp/m4/hms_search_lib.m4 \
 	$(top_srcdir)/sntp/m4/libtool.m4 \
@@ -69,6 +68,8 @@
 	$(top_srcdir)/sntp/m4/ntp_sntp.m4 \
 	$(top_srcdir)/sntp/m4/ntp_ver_suffix.m4 \
 	$(top_srcdir)/sntp/m4/ntp_vpathhack.m4 \
+	$(top_srcdir)/sntp/m4/openldap-thread-check.m4 \
+	$(top_srcdir)/sntp/m4/openldap.m4 \
 	$(top_srcdir)/sntp/m4/os_cflags.m4 \
 	$(top_srcdir)/sntp/m4/snprintf.m4 \
 	$(top_srcdir)/sntp/m4/version.m4 $(top_srcdir)/configure.ac
@@ -132,6 +133,7 @@
 CONFIG_SHELL = @CONFIG_SHELL@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
+CPPFLAGS_LIBEVENT = @CPPFLAGS_LIBEVENT@
 CPPFLAGS_NTP = @CPPFLAGS_NTP@
 CXX = @CXX@
 CXXCPP = @CXXCPP@
@@ -166,7 +168,9 @@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 LD = @LD@
+LDADD_LIBEVENT = @LDADD_LIBEVENT@
 LDADD_LIBNTP = @LDADD_LIBNTP@
+LDADD_LIBUTIL = @LDADD_LIBUTIL@
 LDADD_NLIST = @LDADD_NLIST@
 LDADD_NTP = @LDADD_NTP@
 LDFLAGS = @LDFLAGS@
@@ -305,6 +309,11 @@
 TIMETRIM_DS = @TIMETRIM_DS@
 TIMETRIM_MS = @TIMETRIM_MS@
 TIMETRIM_NI = @TIMETRIM_NI@
+UPDATE_LEAP_DB = @UPDATE_LEAP_DB@
+UPDATE_LEAP_DL = @UPDATE_LEAP_DL@
+UPDATE_LEAP_DS = @UPDATE_LEAP_DS@
+UPDATE_LEAP_MS = @UPDATE_LEAP_MS@
+UPDATE_LEAP_NI = @UPDATE_LEAP_NI@
 VERSION = @VERSION@
 VER_SUFFIX = @VER_SUFFIX@
 YACC = @YACC@
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/scripts/lib/NTP/Util.pm /cur/src/external/bsd/ntp/dist/scripts/lib/NTP/Util.pm
--- external/bsd/ntp/dist/scripts/lib/NTP/Util.pm	2014-12-19 12:37:43.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/scripts/lib/NTP/Util.pm	2015-04-07 19:51:17.000000000 -0700
@@ -93,18 +93,27 @@
 sub ntp_peers {
     my ($host) = @_;
 
-    my $cmd = "$ntpq_path -np $host |";
+    $host ||= '';
+    my $cmd = "$ntpq_path -npw $host |";
 
     open my $fh, $cmd or croak "Could not start ntpq: $!";
 
     <$fh> for 1 .. 2;
 
-    my @columns = qw(remote refid st t when poll reach delay offset jitter);
+    my @columns = qw(tally host refid st t when poll reach delay offset jitter);
     my @peers;
     while (<$fh>) {
-        if (/(?:[\w\.\*-]+\s*){10}/) {
+        if (/^([ x+#*o-])((?:[\w.*:-]+\s+){10}|([\w.*:-]+\s+))$/) {
             my $col = 0;
-            push @peers, { map {; $columns[ $col++ ] => $_ } split /(?<=.)\s+/ };
+	    my @line = ($1, split /\s+/, $2);
+	    if( @line == 2 ) {
+		defined ($_ = <$fh>) or last;
+		s/^\s+//;
+		push @line, split /\s+/;
+	    }
+	    my $r = { map {; $columns[ $col++ ] => $_ } @line };
+	    $r->{remote} = $r->{tally} . $r->{host};
+            push @peers, $r;
         }
         else {
             #TODO return error (but not needed anywhere now)
@@ -135,3 +144,5 @@
     close $fh or croak "running sntp failed: $! (exit status $?)";
     return ($offset, $stratum);
 }
+
+1;
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/scripts/ntp-wait/Makefile.in /cur/src/external/bsd/ntp/dist/scripts/ntp-wait/Makefile.in
--- external/bsd/ntp/dist/scripts/ntp-wait/Makefile.in	2014-12-19 12:37:43.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/scripts/ntp-wait/Makefile.in	2015-04-07 19:51:17.000000000 -0700
@@ -41,8 +41,7 @@
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
 	$(top_srcdir)/sntp/libopts/m4/stdnoreturn.m4 \
-	$(top_srcdir)/sntp/libevent/m4/openldap-thread-check.m4 \
-	$(top_srcdir)/sntp/libevent/m4/openldap.m4 \
+	$(top_srcdir)/sntp/m4/ax_c99_struct_init.m4 \
 	$(top_srcdir)/sntp/m4/define_dir.m4 \
 	$(top_srcdir)/sntp/m4/hms_search_lib.m4 \
 	$(top_srcdir)/sntp/m4/libtool.m4 \
@@ -71,6 +70,8 @@
 	$(top_srcdir)/sntp/m4/ntp_sntp.m4 \
 	$(top_srcdir)/sntp/m4/ntp_ver_suffix.m4 \
 	$(top_srcdir)/sntp/m4/ntp_vpathhack.m4 \
+	$(top_srcdir)/sntp/m4/openldap-thread-check.m4 \
+	$(top_srcdir)/sntp/m4/openldap.m4 \
 	$(top_srcdir)/sntp/m4/os_cflags.m4 \
 	$(top_srcdir)/sntp/m4/snprintf.m4 \
 	$(top_srcdir)/sntp/m4/version.m4 $(top_srcdir)/configure.ac
@@ -141,6 +142,7 @@
 CONFIG_SHELL = @CONFIG_SHELL@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
+CPPFLAGS_LIBEVENT = @CPPFLAGS_LIBEVENT@
 CPPFLAGS_NTP = @CPPFLAGS_NTP@
 CXX = @CXX@
 CXXCPP = @CXXCPP@
@@ -175,7 +177,9 @@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 LD = @LD@
+LDADD_LIBEVENT = @LDADD_LIBEVENT@
 LDADD_LIBNTP = @LDADD_LIBNTP@
+LDADD_LIBUTIL = @LDADD_LIBUTIL@
 LDADD_NLIST = @LDADD_NLIST@
 LDADD_NTP = @LDADD_NTP@
 LDFLAGS = @LDFLAGS@
@@ -314,6 +318,11 @@
 TIMETRIM_DS = @TIMETRIM_DS@
 TIMETRIM_MS = @TIMETRIM_MS@
 TIMETRIM_NI = @TIMETRIM_NI@
+UPDATE_LEAP_DB = @UPDATE_LEAP_DB@
+UPDATE_LEAP_DL = @UPDATE_LEAP_DL@
+UPDATE_LEAP_DS = @UPDATE_LEAP_DS@
+UPDATE_LEAP_MS = @UPDATE_LEAP_MS@
+UPDATE_LEAP_NI = @UPDATE_LEAP_NI@
 VERSION = @VERSION@
 VER_SUFFIX = @VER_SUFFIX@
 YACC = @YACC@
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/scripts/ntp-wait/invoke-ntp-wait.texi /cur/src/external/bsd/ntp/dist/scripts/ntp-wait/invoke-ntp-wait.texi
--- external/bsd/ntp/dist/scripts/ntp-wait/invoke-ntp-wait.texi	2014-12-19 12:37:43.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/scripts/ntp-wait/invoke-ntp-wait.texi	2015-04-07 19:51:17.000000000 -0700
@@ -6,7 +6,7 @@
 #
 # EDIT THIS FILE WITH CAUTION  (invoke-ntp-wait.texi)
 #
-# It has been AutoGen-ed  December 19, 2014 at 07:44:48 AM by AutoGen 5.18.5pre4
+# It has been AutoGen-ed  April  7, 2015 at 04:21:17 AM by AutoGen 5.18.5pre4
 # From the definitions    ntp-wait-opts.def
 # and the template file   agtexi-cmd.tpl
 @end ignore
@@ -61,7 +61,7 @@
 
 @exampleindent 0
 @example
-ntp-wait - Wait for ntpd to stabilize the system clock - Ver. 4.2.8
+ntp-wait - Wait for ntpd to stabilize the system clock - Ver. 4.2.8p2
 USAGE: ntp-wait [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]... 
 
     -n, --tries=num              Number of times to check ntpd
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/scripts/ntp-wait/ntp-wait-opts /cur/src/external/bsd/ntp/dist/scripts/ntp-wait/ntp-wait-opts
--- external/bsd/ntp/dist/scripts/ntp-wait/ntp-wait-opts	2014-12-19 12:37:43.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/scripts/ntp-wait/ntp-wait-opts	2015-04-07 19:51:17.000000000 -0700
@@ -1,6 +1,6 @@
 # EDIT THIS FILE WITH CAUTION  (ntp-wait-opts)
 #
-# It has been AutoGen-ed  December 19, 2014 at 07:44:43 AM by AutoGen 5.18.5pre4
+# It has been AutoGen-ed  April  7, 2015 at 04:21:11 AM by AutoGen 5.18.5pre4
 # From the definitions    ntp-wait-opts.def
 # and the template file   perlopt
 
@@ -40,7 +40,7 @@
         'help|?', 'more-help'));
 
     $usage = <<'USAGE';
-ntp-wait - Wait for ntpd to stabilize the system clock - Ver. 4.2.8
+ntp-wait - Wait for ntpd to stabilize the system clock - Ver. 4.2.8p2
 USAGE: ntp-wait [ -<flag> [<val>] | --<name>[{=| }<val>] ]... 
 
     -n, --tries=num              Number of times to check ntpd
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/scripts/ntp-wait/ntp-wait.1ntp-waitman /cur/src/external/bsd/ntp/dist/scripts/ntp-wait/ntp-wait.1ntp-waitman
--- external/bsd/ntp/dist/scripts/ntp-wait/ntp-wait.1ntp-waitman	2014-12-19 12:37:43.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/scripts/ntp-wait/ntp-wait.1ntp-waitman	2015-04-07 19:51:17.000000000 -0700
@@ -10,11 +10,11 @@
 .ds B-Font B
 .ds I-Font I
 .ds R-Font R
-.TH ntp-wait 1ntp-waitman "19 Dec 2014" "ntp (4.2.8)" "User Commands"
+.TH ntp-wait 1ntp-waitman "07 Apr 2015" "ntp (4.2.8p2)" "User Commands"
 .\"
-.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-JTaWc1/ag-WTa4b1)
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-CkaW1T/ag-Oka40T)
 .\"
-.\" It has been AutoGen-ed December 19, 2014 at 07:44:45 AM by AutoGen 5.18.5pre4
+.\" It has been AutoGen-ed April 7, 2015 at 04:21:13 AM by AutoGen 5.18.5pre4
 .\" From the definitions ntp-wait-opts.def
 .\" and the template file agman-cmd.tpl
 .SH NAME
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/scripts/ntp-wait/ntp-wait.1ntp-waitmdoc /cur/src/external/bsd/ntp/dist/scripts/ntp-wait/ntp-wait.1ntp-waitmdoc
--- external/bsd/ntp/dist/scripts/ntp-wait/ntp-wait.1ntp-waitmdoc	2014-12-19 12:37:43.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/scripts/ntp-wait/ntp-wait.1ntp-waitmdoc	2015-04-07 19:51:17.000000000 -0700
@@ -1,9 +1,9 @@
-.Dd December 19 2014
+.Dd April 7 2015
 .Dt NTP_WAIT 1ntp-waitmdoc User Commands
 .Os
 .\"  EDIT THIS FILE WITH CAUTION  (ntp-wait-opts.mdoc)
 .\"
-.\"  It has been AutoGen-ed  December 19, 2014 at 07:44:51 AM by AutoGen 5.18.5pre4
+.\"  It has been AutoGen-ed  April  7, 2015 at 04:21:20 AM by AutoGen 5.18.5pre4
 .\"  From the definitions    ntp-wait-opts.def
 .\"  and the template file   agmdoc-cmd.tpl
 .Sh NAME
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/scripts/ntp-wait/ntp-wait.html /cur/src/external/bsd/ntp/dist/scripts/ntp-wait/ntp-wait.html
--- external/bsd/ntp/dist/scripts/ntp-wait/ntp-wait.html	2014-12-19 12:37:43.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/scripts/ntp-wait/ntp-wait.html	2015-04-07 19:51:17.000000000 -0700
@@ -39,7 +39,7 @@
 and only then start any applicaitons (like database servers) that require
 accurate and stable time.
 
-  <p>This document applies to version 4.2.8 of <code>ntp-wait</code>.
+  <p>This document applies to version 4.2.8p2 of <code>ntp-wait</code>.
 
 <div class="shortcontents">
 <h2>Short Contents</h2>
@@ -114,7 +114,7 @@
 used to select the program, defaulting to <span class="file">more</span>.  Both will exit
 with a status code of 0.
 
-<pre class="example">ntp-wait - Wait for ntpd to stabilize the system clock - Ver. 4.2.8
+<pre class="example">ntp-wait - Wait for ntpd to stabilize the system clock - Ver. 4.2.8p2
 USAGE: ntp-wait [ -&lt;flag&gt; [&lt;val&gt;] | --&lt;name&gt;[{=| }&lt;val&gt;] ]...
 
     -n, --tries=num              Number of times to check ntpd
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/scripts/ntp-wait/ntp-wait.man.in /cur/src/external/bsd/ntp/dist/scripts/ntp-wait/ntp-wait.man.in
--- external/bsd/ntp/dist/scripts/ntp-wait/ntp-wait.man.in	2014-12-19 12:37:43.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/scripts/ntp-wait/ntp-wait.man.in	2015-04-07 19:51:17.000000000 -0700
@@ -10,11 +10,11 @@
 .ds B-Font B
 .ds I-Font I
 .ds R-Font R
-.TH ntp-wait @NTP_WAIT_MS@ "19 Dec 2014" "ntp (4.2.8)" "User Commands"
+.TH ntp-wait @NTP_WAIT_MS@ "07 Apr 2015" "ntp (4.2.8p2)" "User Commands"
 .\"
-.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-JTaWc1/ag-WTa4b1)
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-CkaW1T/ag-Oka40T)
 .\"
-.\" It has been AutoGen-ed December 19, 2014 at 07:44:45 AM by AutoGen 5.18.5pre4
+.\" It has been AutoGen-ed April 7, 2015 at 04:21:13 AM by AutoGen 5.18.5pre4
 .\" From the definitions ntp-wait-opts.def
 .\" and the template file agman-cmd.tpl
 .SH NAME
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/scripts/ntp-wait/ntp-wait.mdoc.in /cur/src/external/bsd/ntp/dist/scripts/ntp-wait/ntp-wait.mdoc.in
--- external/bsd/ntp/dist/scripts/ntp-wait/ntp-wait.mdoc.in	2014-12-19 12:37:43.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/scripts/ntp-wait/ntp-wait.mdoc.in	2015-04-07 19:51:17.000000000 -0700
@@ -1,9 +1,9 @@
-.Dd December 19 2014
+.Dd April 7 2015
 .Dt NTP_WAIT @NTP_WAIT_MS@ User Commands
 .Os
 .\"  EDIT THIS FILE WITH CAUTION  (ntp-wait-opts.mdoc)
 .\"
-.\"  It has been AutoGen-ed  December 19, 2014 at 07:44:51 AM by AutoGen 5.18.5pre4
+.\"  It has been AutoGen-ed  April  7, 2015 at 04:21:20 AM by AutoGen 5.18.5pre4
 .\"  From the definitions    ntp-wait-opts.def
 .\"  and the template file   agmdoc-cmd.tpl
 .Sh NAME
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/scripts/ntpsweep/Makefile.in /cur/src/external/bsd/ntp/dist/scripts/ntpsweep/Makefile.in
--- external/bsd/ntp/dist/scripts/ntpsweep/Makefile.in	2014-12-19 12:37:43.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/scripts/ntpsweep/Makefile.in	2015-04-07 19:51:17.000000000 -0700
@@ -41,8 +41,7 @@
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
 	$(top_srcdir)/sntp/libopts/m4/stdnoreturn.m4 \
-	$(top_srcdir)/sntp/libevent/m4/openldap-thread-check.m4 \
-	$(top_srcdir)/sntp/libevent/m4/openldap.m4 \
+	$(top_srcdir)/sntp/m4/ax_c99_struct_init.m4 \
 	$(top_srcdir)/sntp/m4/define_dir.m4 \
 	$(top_srcdir)/sntp/m4/hms_search_lib.m4 \
 	$(top_srcdir)/sntp/m4/libtool.m4 \
@@ -71,6 +70,8 @@
 	$(top_srcdir)/sntp/m4/ntp_sntp.m4 \
 	$(top_srcdir)/sntp/m4/ntp_ver_suffix.m4 \
 	$(top_srcdir)/sntp/m4/ntp_vpathhack.m4 \
+	$(top_srcdir)/sntp/m4/openldap-thread-check.m4 \
+	$(top_srcdir)/sntp/m4/openldap.m4 \
 	$(top_srcdir)/sntp/m4/os_cflags.m4 \
 	$(top_srcdir)/sntp/m4/snprintf.m4 \
 	$(top_srcdir)/sntp/m4/version.m4 $(top_srcdir)/configure.ac
@@ -142,6 +143,7 @@
 CONFIG_SHELL = @CONFIG_SHELL@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
+CPPFLAGS_LIBEVENT = @CPPFLAGS_LIBEVENT@
 CPPFLAGS_NTP = @CPPFLAGS_NTP@
 CXX = @CXX@
 CXXCPP = @CXXCPP@
@@ -176,7 +178,9 @@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 LD = @LD@
+LDADD_LIBEVENT = @LDADD_LIBEVENT@
 LDADD_LIBNTP = @LDADD_LIBNTP@
+LDADD_LIBUTIL = @LDADD_LIBUTIL@
 LDADD_NLIST = @LDADD_NLIST@
 LDADD_NTP = @LDADD_NTP@
 LDFLAGS = @LDFLAGS@
@@ -315,6 +319,11 @@
 TIMETRIM_DS = @TIMETRIM_DS@
 TIMETRIM_MS = @TIMETRIM_MS@
 TIMETRIM_NI = @TIMETRIM_NI@
+UPDATE_LEAP_DB = @UPDATE_LEAP_DB@
+UPDATE_LEAP_DL = @UPDATE_LEAP_DL@
+UPDATE_LEAP_DS = @UPDATE_LEAP_DS@
+UPDATE_LEAP_MS = @UPDATE_LEAP_MS@
+UPDATE_LEAP_NI = @UPDATE_LEAP_NI@
 VERSION = @VERSION@
 VER_SUFFIX = @VER_SUFFIX@
 YACC = @YACC@
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/scripts/ntpsweep/invoke-ntpsweep.texi /cur/src/external/bsd/ntp/dist/scripts/ntpsweep/invoke-ntpsweep.texi
--- external/bsd/ntp/dist/scripts/ntpsweep/invoke-ntpsweep.texi	2014-12-19 12:37:43.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/scripts/ntpsweep/invoke-ntpsweep.texi	2015-04-07 19:51:17.000000000 -0700
@@ -6,7 +6,7 @@
 #
 # EDIT THIS FILE WITH CAUTION  (invoke-ntpsweep.texi)
 #
-# It has been AutoGen-ed  December 19, 2014 at 07:44:55 AM by AutoGen 5.18.5pre4
+# It has been AutoGen-ed  April  7, 2015 at 04:21:23 AM by AutoGen 5.18.5pre4
 # From the definitions    ntpsweep-opts.def
 # and the template file   agtexi-cmd.tpl
 @end ignore
@@ -45,7 +45,7 @@
 
 @exampleindent 0
 @example
-ntpsweep - Print various informations about given ntp servers - Ver. 4.2.8
+ntpsweep - Print various informations about given ntp servers - Ver. 4.2.8p2
 USAGE: ntpsweep [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]... [hostfile]
 
     -l, --host-list=str          Host to execute actions on
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/scripts/ntpsweep/ntpsweep-opts /cur/src/external/bsd/ntp/dist/scripts/ntpsweep/ntpsweep-opts
--- external/bsd/ntp/dist/scripts/ntpsweep/ntpsweep-opts	2014-12-19 12:37:43.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/scripts/ntpsweep/ntpsweep-opts	2015-04-07 19:51:17.000000000 -0700
@@ -1,6 +1,6 @@
 # EDIT THIS FILE WITH CAUTION  (ntpsweep-opts)
 #
-# It has been AutoGen-ed  December 19, 2014 at 07:44:53 AM by AutoGen 5.18.5pre4
+# It has been AutoGen-ed  April  7, 2015 at 04:21:21 AM by AutoGen 5.18.5pre4
 # From the definitions    ntpsweep-opts.def
 # and the template file   perlopt
 
@@ -43,7 +43,7 @@
         'help|?', 'more-help'));
 
     $usage = <<'USAGE';
-ntpsweep - Print various informations about given ntp servers - Ver. 4.2.8
+ntpsweep - Print various informations about given ntp servers - Ver. 4.2.8p2
 USAGE: ntpsweep [ -<flag> [<val>] | --<name>[{=| }<val>] ]... [hostfile]
 
     -l, --host-list=str          Host to execute actions on
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/scripts/ntpsweep/ntpsweep.1ntpsweepman /cur/src/external/bsd/ntp/dist/scripts/ntpsweep/ntpsweep.1ntpsweepman
--- external/bsd/ntp/dist/scripts/ntpsweep/ntpsweep.1ntpsweepman	2014-12-19 12:37:43.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/scripts/ntpsweep/ntpsweep.1ntpsweepman	2015-04-07 19:51:17.000000000 -0700
@@ -10,11 +10,11 @@
 .ds B-Font B
 .ds I-Font I
 .ds R-Font R
-.TH ntpsweep 1ntpsweepman "19 Dec 2014" "ntp (4.2.8)" "User Commands"
+.TH ntpsweep 1ntpsweepman "07 Apr 2015" "ntp (4.2.8p2)" "User Commands"
 .\"
-.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-9Pa4E2/ag-kQaaE2)
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-pka4rV/ag-CkaarV)
 .\"
-.\" It has been AutoGen-ed December 19, 2014 at 07:44:57 AM by AutoGen 5.18.5pre4
+.\" It has been AutoGen-ed April 7, 2015 at 04:21:25 AM by AutoGen 5.18.5pre4
 .\" From the definitions ntpsweep-opts.def
 .\" and the template file agman-cmd.tpl
 .SH NAME
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/scripts/ntpsweep/ntpsweep.1ntpsweepmdoc /cur/src/external/bsd/ntp/dist/scripts/ntpsweep/ntpsweep.1ntpsweepmdoc
--- external/bsd/ntp/dist/scripts/ntpsweep/ntpsweep.1ntpsweepmdoc	2014-12-19 12:37:43.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/scripts/ntpsweep/ntpsweep.1ntpsweepmdoc	2015-04-07 19:51:17.000000000 -0700
@@ -1,9 +1,9 @@
-.Dd December 19 2014
+.Dd April 7 2015
 .Dt NTPSWEEP 1ntpsweepmdoc User Commands
 .Os
 .\"  EDIT THIS FILE WITH CAUTION  (ntpsweep-opts.mdoc)
 .\"
-.\"  It has been AutoGen-ed  December 19, 2014 at 07:45:00 AM by AutoGen 5.18.5pre4
+.\"  It has been AutoGen-ed  April  7, 2015 at 04:21:29 AM by AutoGen 5.18.5pre4
 .\"  From the definitions    ntpsweep-opts.def
 .\"  and the template file   agmdoc-cmd.tpl
 .Sh NAME
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/scripts/ntpsweep/ntpsweep.html /cur/src/external/bsd/ntp/dist/scripts/ntpsweep/ntpsweep.html
--- external/bsd/ntp/dist/scripts/ntpsweep/ntpsweep.html	2014-12-19 12:37:43.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/scripts/ntpsweep/ntpsweep.html	2015-04-07 19:51:17.000000000 -0700
@@ -30,7 +30,7 @@
 
   <p>This document describes the use of the NTP Project's <code>ntpsweep</code> program.
 
-  <p>This document applies to version 4.2.8 of <code>ntpsweep</code>.
+  <p>This document applies to version 4.2.8p2 of <code>ntpsweep</code>.
 
   <div class="shortcontents">
 <h2>Short Contents</h2>
@@ -90,7 +90,7 @@
 used to select the program, defaulting to <span class="file">more</span>.  Both will exit
 with a status code of 0.
 
-<pre class="example">ntpsweep - Print various informations about given ntp servers - Ver. 4.2.8
+<pre class="example">ntpsweep - Print various informations about given ntp servers - Ver. 4.2.8p2
 USAGE: ntpsweep [ -&lt;flag&gt; [&lt;val&gt;] | --&lt;name&gt;[{=| }&lt;val&gt;] ]... [hostfile]
 
     -l, --host-list=str          Host to execute actions on
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/scripts/ntpsweep/ntpsweep.man.in /cur/src/external/bsd/ntp/dist/scripts/ntpsweep/ntpsweep.man.in
--- external/bsd/ntp/dist/scripts/ntpsweep/ntpsweep.man.in	2014-12-19 12:37:43.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/scripts/ntpsweep/ntpsweep.man.in	2015-04-07 19:51:17.000000000 -0700
@@ -10,11 +10,11 @@
 .ds B-Font B
 .ds I-Font I
 .ds R-Font R
-.TH ntpsweep 1ntpsweepman "19 Dec 2014" "ntp (4.2.8)" "User Commands"
+.TH ntpsweep 1ntpsweepman "07 Apr 2015" "ntp (4.2.8p2)" "User Commands"
 .\"
-.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-9Pa4E2/ag-kQaaE2)
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-pka4rV/ag-CkaarV)
 .\"
-.\" It has been AutoGen-ed December 19, 2014 at 07:44:57 AM by AutoGen 5.18.5pre4
+.\" It has been AutoGen-ed April 7, 2015 at 04:21:25 AM by AutoGen 5.18.5pre4
 .\" From the definitions ntpsweep-opts.def
 .\" and the template file agman-cmd.tpl
 .SH NAME
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/scripts/ntpsweep/ntpsweep.mdoc.in /cur/src/external/bsd/ntp/dist/scripts/ntpsweep/ntpsweep.mdoc.in
--- external/bsd/ntp/dist/scripts/ntpsweep/ntpsweep.mdoc.in	2014-12-19 12:37:43.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/scripts/ntpsweep/ntpsweep.mdoc.in	2015-04-07 19:51:17.000000000 -0700
@@ -1,9 +1,9 @@
-.Dd December 19 2014
+.Dd April 7 2015
 .Dt NTPSWEEP 1ntpsweepmdoc User Commands
 .Os
 .\"  EDIT THIS FILE WITH CAUTION  (ntpsweep-opts.mdoc)
 .\"
-.\"  It has been AutoGen-ed  December 19, 2014 at 07:45:00 AM by AutoGen 5.18.5pre4
+.\"  It has been AutoGen-ed  April  7, 2015 at 04:21:29 AM by AutoGen 5.18.5pre4
 .\"  From the definitions    ntpsweep-opts.def
 .\"  and the template file   agmdoc-cmd.tpl
 .Sh NAME
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/scripts/ntptrace/Makefile.in /cur/src/external/bsd/ntp/dist/scripts/ntptrace/Makefile.in
--- external/bsd/ntp/dist/scripts/ntptrace/Makefile.in	2014-12-19 12:37:43.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/scripts/ntptrace/Makefile.in	2015-04-07 19:51:17.000000000 -0700
@@ -41,8 +41,7 @@
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
 	$(top_srcdir)/sntp/libopts/m4/stdnoreturn.m4 \
-	$(top_srcdir)/sntp/libevent/m4/openldap-thread-check.m4 \
-	$(top_srcdir)/sntp/libevent/m4/openldap.m4 \
+	$(top_srcdir)/sntp/m4/ax_c99_struct_init.m4 \
 	$(top_srcdir)/sntp/m4/define_dir.m4 \
 	$(top_srcdir)/sntp/m4/hms_search_lib.m4 \
 	$(top_srcdir)/sntp/m4/libtool.m4 \
@@ -71,6 +70,8 @@
 	$(top_srcdir)/sntp/m4/ntp_sntp.m4 \
 	$(top_srcdir)/sntp/m4/ntp_ver_suffix.m4 \
 	$(top_srcdir)/sntp/m4/ntp_vpathhack.m4 \
+	$(top_srcdir)/sntp/m4/openldap-thread-check.m4 \
+	$(top_srcdir)/sntp/m4/openldap.m4 \
 	$(top_srcdir)/sntp/m4/os_cflags.m4 \
 	$(top_srcdir)/sntp/m4/snprintf.m4 \
 	$(top_srcdir)/sntp/m4/version.m4 $(top_srcdir)/configure.ac
@@ -141,6 +142,7 @@
 CONFIG_SHELL = @CONFIG_SHELL@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
+CPPFLAGS_LIBEVENT = @CPPFLAGS_LIBEVENT@
 CPPFLAGS_NTP = @CPPFLAGS_NTP@
 CXX = @CXX@
 CXXCPP = @CXXCPP@
@@ -175,7 +177,9 @@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 LD = @LD@
+LDADD_LIBEVENT = @LDADD_LIBEVENT@
 LDADD_LIBNTP = @LDADD_LIBNTP@
+LDADD_LIBUTIL = @LDADD_LIBUTIL@
 LDADD_NLIST = @LDADD_NLIST@
 LDADD_NTP = @LDADD_NTP@
 LDFLAGS = @LDFLAGS@
@@ -314,6 +318,11 @@
 TIMETRIM_DS = @TIMETRIM_DS@
 TIMETRIM_MS = @TIMETRIM_MS@
 TIMETRIM_NI = @TIMETRIM_NI@
+UPDATE_LEAP_DB = @UPDATE_LEAP_DB@
+UPDATE_LEAP_DL = @UPDATE_LEAP_DL@
+UPDATE_LEAP_DS = @UPDATE_LEAP_DS@
+UPDATE_LEAP_MS = @UPDATE_LEAP_MS@
+UPDATE_LEAP_NI = @UPDATE_LEAP_NI@
 VERSION = @VERSION@
 VER_SUFFIX = @VER_SUFFIX@
 YACC = @YACC@
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/scripts/ntptrace/invoke-ntptrace.texi /cur/src/external/bsd/ntp/dist/scripts/ntptrace/invoke-ntptrace.texi
--- external/bsd/ntp/dist/scripts/ntptrace/invoke-ntptrace.texi	2014-12-19 12:37:43.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/scripts/ntptrace/invoke-ntptrace.texi	2015-04-07 19:51:17.000000000 -0700
@@ -6,7 +6,7 @@
 #
 # EDIT THIS FILE WITH CAUTION  (invoke-ntptrace.texi)
 #
-# It has been AutoGen-ed  December 19, 2014 at 07:45:07 AM by AutoGen 5.18.5pre4
+# It has been AutoGen-ed  April  7, 2015 at 04:21:36 AM by AutoGen 5.18.5pre4
 # From the definitions    ntptrace-opts.def
 # and the template file   agtexi-cmd.tpl
 @end ignore
@@ -62,7 +62,7 @@
 
 @exampleindent 0
 @example
-ntptrace - Trace peers of an NTP server - Ver. 4.2.8
+ntptrace - Trace peers of an NTP server - Ver. 4.2.8p2
 USAGE: ntptrace [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]... [host]
 
     -n, --numeric                Print IP addresses instead of hostnames
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/scripts/ntptrace/ntptrace-opts /cur/src/external/bsd/ntp/dist/scripts/ntptrace/ntptrace-opts
--- external/bsd/ntp/dist/scripts/ntptrace/ntptrace-opts	2014-12-19 12:37:43.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/scripts/ntptrace/ntptrace-opts	2015-04-07 19:51:17.000000000 -0700
@@ -1,6 +1,6 @@
 # EDIT THIS FILE WITH CAUTION  (ntptrace-opts)
 #
-# It has been AutoGen-ed  December 19, 2014 at 07:45:02 AM by AutoGen 5.18.5pre4
+# It has been AutoGen-ed  April  7, 2015 at 04:21:31 AM by AutoGen 5.18.5pre4
 # From the definitions    ntptrace-opts.def
 # and the template file   perlopt
 
@@ -40,7 +40,7 @@
         'help|?', 'more-help'));
 
     $usage = <<'USAGE';
-ntptrace - Trace peers of an NTP server - Ver. 4.2.8
+ntptrace - Trace peers of an NTP server - Ver. 4.2.8p2
 USAGE: ntptrace [ -<flag> [<val>] | --<name>[{=| }<val>] ]... [host]
 
     -n, --numeric                Print IP addresses instead of hostnames
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/scripts/ntptrace/ntptrace.1ntptraceman /cur/src/external/bsd/ntp/dist/scripts/ntptrace/ntptrace.1ntptraceman
--- external/bsd/ntp/dist/scripts/ntptrace/ntptrace.1ntptraceman	2014-12-19 12:37:43.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/scripts/ntptrace/ntptrace.1ntptraceman	2015-04-07 19:51:17.000000000 -0700
@@ -10,11 +10,11 @@
 .ds B-Font B
 .ds I-Font I
 .ds R-Font R
-.TH ntptrace 1ntptraceman "19 Dec 2014" "ntp (4.2.8)" "User Commands"
+.TH ntptrace 1ntptraceman "07 Apr 2015" "ntp (4.2.8p2)" "User Commands"
 .\"
-.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-ryayX3/ag-EyaGW3)
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-j_aqKW/ag-w_ayJW)
 .\"
-.\" It has been AutoGen-ed December 19, 2014 at 07:45:04 AM by AutoGen 5.18.5pre4
+.\" It has been AutoGen-ed April 7, 2015 at 04:21:33 AM by AutoGen 5.18.5pre4
 .\" From the definitions ntptrace-opts.def
 .\" and the template file agman-cmd.tpl
 .SH NAME
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/scripts/ntptrace/ntptrace.1ntptracemdoc /cur/src/external/bsd/ntp/dist/scripts/ntptrace/ntptrace.1ntptracemdoc
--- external/bsd/ntp/dist/scripts/ntptrace/ntptrace.1ntptracemdoc	2014-12-19 12:37:43.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/scripts/ntptrace/ntptrace.1ntptracemdoc	2015-04-07 19:51:17.000000000 -0700
@@ -1,9 +1,9 @@
-.Dd December 19 2014
+.Dd April 7 2015
 .Dt NTPTRACE 1ntptracemdoc User Commands
 .Os
 .\"  EDIT THIS FILE WITH CAUTION  (ntptrace-opts.mdoc)
 .\"
-.\"  It has been AutoGen-ed  December 19, 2014 at 07:45:09 AM by AutoGen 5.18.5pre4
+.\"  It has been AutoGen-ed  April  7, 2015 at 04:21:38 AM by AutoGen 5.18.5pre4
 .\"  From the definitions    ntptrace-opts.def
 .\"  and the template file   agmdoc-cmd.tpl
 .Sh NAME
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/scripts/ntptrace/ntptrace.html /cur/src/external/bsd/ntp/dist/scripts/ntptrace/ntptrace.html
--- external/bsd/ntp/dist/scripts/ntptrace/ntptrace.html	2014-12-19 12:37:43.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/scripts/ntptrace/ntptrace.html	2015-04-07 19:51:17.000000000 -0700
@@ -31,7 +31,7 @@
 <h2 class="unnumbered">Simple Network Time Protocol User Manual</h2>
 
 <p>This document describes the use of the NTP Project's <code>ntptrace</code> program. 
-This document applies to version 4.2.8 of <code>ntptrace</code>.
+This document applies to version 4.2.8p2 of <code>ntptrace</code>.
 
   <div class="shortcontents">
 <h2>Short Contents</h2>
@@ -107,7 +107,7 @@
 used to select the program, defaulting to <span class="file">more</span>.  Both will exit
 with a status code of 0.
 
-<pre class="example">ntptrace - Trace peers of an NTP server - Ver. 4.2.8
+<pre class="example">ntptrace - Trace peers of an NTP server - Ver. 4.2.8p2
 USAGE: ntptrace [ -&lt;flag&gt; [&lt;val&gt;] | --&lt;name&gt;[{=| }&lt;val&gt;] ]... [host]
 
     -n, --numeric                Print IP addresses instead of hostnames
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/scripts/ntptrace/ntptrace.man.in /cur/src/external/bsd/ntp/dist/scripts/ntptrace/ntptrace.man.in
--- external/bsd/ntp/dist/scripts/ntptrace/ntptrace.man.in	2014-12-19 12:37:43.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/scripts/ntptrace/ntptrace.man.in	2015-04-07 19:51:17.000000000 -0700
@@ -10,11 +10,11 @@
 .ds B-Font B
 .ds I-Font I
 .ds R-Font R
-.TH ntptrace @NTPTRACE_MS@ "19 Dec 2014" "ntp (4.2.8)" "User Commands"
+.TH ntptrace @NTPTRACE_MS@ "07 Apr 2015" "ntp (4.2.8p2)" "User Commands"
 .\"
-.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-ryayX3/ag-EyaGW3)
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-j_aqKW/ag-w_ayJW)
 .\"
-.\" It has been AutoGen-ed December 19, 2014 at 07:45:04 AM by AutoGen 5.18.5pre4
+.\" It has been AutoGen-ed April 7, 2015 at 04:21:33 AM by AutoGen 5.18.5pre4
 .\" From the definitions ntptrace-opts.def
 .\" and the template file agman-cmd.tpl
 .SH NAME
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/scripts/ntptrace/ntptrace.mdoc.in /cur/src/external/bsd/ntp/dist/scripts/ntptrace/ntptrace.mdoc.in
--- external/bsd/ntp/dist/scripts/ntptrace/ntptrace.mdoc.in	2014-12-19 12:37:43.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/scripts/ntptrace/ntptrace.mdoc.in	2015-04-07 19:51:17.000000000 -0700
@@ -1,9 +1,9 @@
-.Dd December 19 2014
+.Dd April 7 2015
 .Dt NTPTRACE @NTPTRACE_MS@ User Commands
 .Os
 .\"  EDIT THIS FILE WITH CAUTION  (ntptrace-opts.mdoc)
 .\"
-.\"  It has been AutoGen-ed  December 19, 2014 at 07:45:09 AM by AutoGen 5.18.5pre4
+.\"  It has been AutoGen-ed  April  7, 2015 at 04:21:38 AM by AutoGen 5.18.5pre4
 .\"  From the definitions    ntptrace-opts.def
 .\"  and the template file   agmdoc-cmd.tpl
 .Sh NAME
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/scripts/plot_summary-opts /cur/src/external/bsd/ntp/dist/scripts/plot_summary-opts
--- external/bsd/ntp/dist/scripts/plot_summary-opts	2014-12-19 12:37:43.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/scripts/plot_summary-opts	2015-04-07 19:51:17.000000000 -0700
@@ -1,6 +1,6 @@
 # EDIT THIS FILE WITH CAUTION  (plot_summary-opts)
 #
-# It has been AutoGen-ed  December 19, 2014 at 07:45:11 AM by AutoGen 5.18.5pre4
+# It has been AutoGen-ed  April  7, 2015 at 04:21:47 AM by AutoGen 5.18.5pre4
 # From the definitions    plot_summary-opts.def
 # and the template file   perlopt
 
@@ -46,7 +46,7 @@
         'help|?', 'more-help'));
 
     $usage = <<'USAGE';
-plot_summary - plot statistics generated by summary script - Ver. 4.2.8
+plot_summary - plot statistics generated by summary script - Ver. 4.2.8p2
 USAGE: plot_summary [ -<flag> [<val>] | --<name>[{=| }<val>] ]... 
 
         --directory=str          Where the summary files are
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/scripts/plot_summary.1plot_summaryman /cur/src/external/bsd/ntp/dist/scripts/plot_summary.1plot_summaryman
--- external/bsd/ntp/dist/scripts/plot_summary.1plot_summaryman	2014-12-19 12:37:43.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/scripts/plot_summary.1plot_summaryman	2015-04-07 19:51:17.000000000 -0700
@@ -10,11 +10,11 @@
 .ds B-Font B
 .ds I-Font I
 .ds R-Font R
-.TH plot_summary 1plot_summaryman "19 Dec 2014" "ntp (4.2.8)" "User Commands"
+.TH plot_summary 1plot_summaryman "07 Apr 2015" "ntp (4.2.8p2)" "User Commands"
 .\"
-.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-nJa4Z5/ag-AJaaZ5)
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-48aGzZ/ag-f9aOyZ)
 .\"
-.\" It has been AutoGen-ed December 19, 2014 at 07:45:17 AM by AutoGen 5.18.5pre4
+.\" It has been AutoGen-ed April 7, 2015 at 04:21:53 AM by AutoGen 5.18.5pre4
 .\" From the definitions plot_summary-opts.def
 .\" and the template file agman-cmd.tpl
 .SH NAME
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/scripts/plot_summary.1plot_summarymdoc /cur/src/external/bsd/ntp/dist/scripts/plot_summary.1plot_summarymdoc
--- external/bsd/ntp/dist/scripts/plot_summary.1plot_summarymdoc	2014-12-19 12:37:43.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/scripts/plot_summary.1plot_summarymdoc	2015-04-07 19:51:17.000000000 -0700
@@ -1,9 +1,9 @@
-.Dd December 19 2014
+.Dd April 7 2015
 .Dt PLOT_SUMMARY 1plot_summarymdoc User Commands
 .Os
 .\"  EDIT THIS FILE WITH CAUTION  (plot_summary-opts.mdoc)
 .\"
-.\"  It has been AutoGen-ed  December 19, 2014 at 07:45:19 AM by AutoGen 5.18.5pre4
+.\"  It has been AutoGen-ed  April  7, 2015 at 04:21:55 AM by AutoGen 5.18.5pre4
 .\"  From the definitions    plot_summary-opts.def
 .\"  and the template file   agmdoc-cmd.tpl
 .Sh NAME
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/scripts/plot_summary.html /cur/src/external/bsd/ntp/dist/scripts/plot_summary.html
--- external/bsd/ntp/dist/scripts/plot_summary.html	2014-12-19 12:37:43.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/scripts/plot_summary.html	2015-04-07 19:51:17.000000000 -0700
@@ -31,7 +31,7 @@
 <h2 class="unnumbered">Plot_summary User Manual</h2>
 
 <p>This document describes the use of the NTP Project's <code>plot_summary</code> program. 
-This document applies to version 4.2.8 of <code>plot_summary</code>.
+This document applies to version 4.2.8p2 of <code>plot_summary</code>.
 
   <div class="shortcontents">
 <h2>Short Contents</h2>
@@ -89,7 +89,7 @@
 used to select the program, defaulting to <span class="file">more</span>.  Both will exit
 with a status code of 0.
 
-<pre class="example">plot_summary - plot statistics generated by summary script - Ver. 4.2.8
+<pre class="example">plot_summary - plot statistics generated by summary script - Ver. 4.2.8p2
 USAGE: plot_summary [ -&lt;flag&gt; [&lt;val&gt;] | --&lt;name&gt;[{=| }&lt;val&gt;] ]...
 
         --directory=str          Where the summary files are
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/scripts/plot_summary.man.in /cur/src/external/bsd/ntp/dist/scripts/plot_summary.man.in
--- external/bsd/ntp/dist/scripts/plot_summary.man.in	2014-12-19 12:37:43.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/scripts/plot_summary.man.in	2015-04-07 19:51:17.000000000 -0700
@@ -10,11 +10,11 @@
 .ds B-Font B
 .ds I-Font I
 .ds R-Font R
-.TH plot_summary 1plot_summaryman "19 Dec 2014" "ntp (4.2.8)" "User Commands"
+.TH plot_summary 1plot_summaryman "07 Apr 2015" "ntp (4.2.8p2)" "User Commands"
 .\"
-.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-nJa4Z5/ag-AJaaZ5)
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-48aGzZ/ag-f9aOyZ)
 .\"
-.\" It has been AutoGen-ed December 19, 2014 at 07:45:17 AM by AutoGen 5.18.5pre4
+.\" It has been AutoGen-ed April 7, 2015 at 04:21:53 AM by AutoGen 5.18.5pre4
 .\" From the definitions plot_summary-opts.def
 .\" and the template file agman-cmd.tpl
 .SH NAME
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/scripts/plot_summary.mdoc.in /cur/src/external/bsd/ntp/dist/scripts/plot_summary.mdoc.in
--- external/bsd/ntp/dist/scripts/plot_summary.mdoc.in	2014-12-19 12:37:43.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/scripts/plot_summary.mdoc.in	2015-04-07 19:51:17.000000000 -0700
@@ -1,9 +1,9 @@
-.Dd December 19 2014
+.Dd April 7 2015
 .Dt PLOT_SUMMARY 1plot_summarymdoc User Commands
 .Os
 .\"  EDIT THIS FILE WITH CAUTION  (plot_summary-opts.mdoc)
 .\"
-.\"  It has been AutoGen-ed  December 19, 2014 at 07:45:19 AM by AutoGen 5.18.5pre4
+.\"  It has been AutoGen-ed  April  7, 2015 at 04:21:55 AM by AutoGen 5.18.5pre4
 .\"  From the definitions    plot_summary-opts.def
 .\"  and the template file   agmdoc-cmd.tpl
 .Sh NAME
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/scripts/summary-opts /cur/src/external/bsd/ntp/dist/scripts/summary-opts
--- external/bsd/ntp/dist/scripts/summary-opts	2014-12-19 12:37:43.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/scripts/summary-opts	2015-04-07 19:51:17.000000000 -0700
@@ -1,6 +1,6 @@
 # EDIT THIS FILE WITH CAUTION  (summary-opts)
 #
-# It has been AutoGen-ed  December 19, 2014 at 07:45:13 AM by AutoGen 5.18.5pre4
+# It has been AutoGen-ed  April  7, 2015 at 04:21:49 AM by AutoGen 5.18.5pre4
 # From the definitions    summary-opts.def
 # and the template file   perlopt
 
@@ -44,7 +44,7 @@
         'help|?', 'more-help'));
 
     $usage = <<'USAGE';
-summary - compute various stastics from NTP stat files - Ver. 4.2.8
+summary - compute various stastics from NTP stat files - Ver. 4.2.8p2
 USAGE: summary [ -<flag> [<val>] | --<name>[{=| }<val>] ]... 
 
         --directory=str          Directory containing stat files
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/scripts/summary.1summaryman /cur/src/external/bsd/ntp/dist/scripts/summary.1summaryman
--- external/bsd/ntp/dist/scripts/summary.1summaryman	2014-12-19 12:37:43.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/scripts/summary.1summaryman	2015-04-07 19:51:17.000000000 -0700
@@ -10,11 +10,11 @@
 .ds B-Font B
 .ds I-Font I
 .ds R-Font R
-.TH summary 1summaryman "19 Dec 2014" "ntp (4.2.8)" "User Commands"
+.TH summary 1summaryman "07 Apr 2015" "ntp (4.2.8p2)" "User Commands"
 .\"
-.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-A3aGb6/ag-M3aOa6)
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-jpaiNZ/ag-wpaqMZ)
 .\"
-.\" It has been AutoGen-ed December 19, 2014 at 07:45:22 AM by AutoGen 5.18.5pre4
+.\" It has been AutoGen-ed April 7, 2015 at 04:21:58 AM by AutoGen 5.18.5pre4
 .\" From the definitions summary-opts.def
 .\" and the template file agman-cmd.tpl
 .SH NAME
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/scripts/summary.1summarymdoc /cur/src/external/bsd/ntp/dist/scripts/summary.1summarymdoc
--- external/bsd/ntp/dist/scripts/summary.1summarymdoc	2014-12-19 12:37:43.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/scripts/summary.1summarymdoc	2015-04-07 19:51:17.000000000 -0700
@@ -1,9 +1,9 @@
-.Dd December 19 2014
+.Dd April 7 2015
 .Dt SUMMARY 1summarymdoc User Commands
 .Os
 .\"  EDIT THIS FILE WITH CAUTION  (summary-opts.mdoc)
 .\"
-.\"  It has been AutoGen-ed  December 19, 2014 at 07:45:24 AM by AutoGen 5.18.5pre4
+.\"  It has been AutoGen-ed  April  7, 2015 at 04:22:00 AM by AutoGen 5.18.5pre4
 .\"  From the definitions    summary-opts.def
 .\"  and the template file   agmdoc-cmd.tpl
 .Sh NAME
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/scripts/summary.html /cur/src/external/bsd/ntp/dist/scripts/summary.html
--- external/bsd/ntp/dist/scripts/summary.html	2014-12-19 12:37:43.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/scripts/summary.html	2015-04-07 19:51:17.000000000 -0700
@@ -31,7 +31,7 @@
 <h2 class="unnumbered">Summary User Manual</h2>
 
 <p>This document describes the use of the NTP Project's <code>summary</code> program. 
-This document applies to version 4.2.8 of <code>summary</code>.
+This document applies to version 4.2.8p2 of <code>summary</code>.
 
   <div class="shortcontents">
 <h2>Short Contents</h2>
@@ -88,7 +88,7 @@
 used to select the program, defaulting to <span class="file">more</span>.  Both will exit
 with a status code of 0.
 
-<pre class="example">summary - compute various stastics from NTP stat files - Ver. 4.2.8
+<pre class="example">summary - compute various stastics from NTP stat files - Ver. 4.2.8p2
 USAGE: summary [ -&lt;flag&gt; [&lt;val&gt;] | --&lt;name&gt;[{=| }&lt;val&gt;] ]...
 
         --directory=str          Directory containing stat files
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/scripts/summary.man.in /cur/src/external/bsd/ntp/dist/scripts/summary.man.in
--- external/bsd/ntp/dist/scripts/summary.man.in	2014-12-19 12:37:43.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/scripts/summary.man.in	2015-04-07 19:51:17.000000000 -0700
@@ -10,11 +10,11 @@
 .ds B-Font B
 .ds I-Font I
 .ds R-Font R
-.TH summary 1summaryman "19 Dec 2014" "ntp (4.2.8)" "User Commands"
+.TH summary 1summaryman "07 Apr 2015" "ntp (4.2.8p2)" "User Commands"
 .\"
-.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-A3aGb6/ag-M3aOa6)
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-jpaiNZ/ag-wpaqMZ)
 .\"
-.\" It has been AutoGen-ed December 19, 2014 at 07:45:22 AM by AutoGen 5.18.5pre4
+.\" It has been AutoGen-ed April 7, 2015 at 04:21:58 AM by AutoGen 5.18.5pre4
 .\" From the definitions summary-opts.def
 .\" and the template file agman-cmd.tpl
 .SH NAME
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/scripts/summary.mdoc.in /cur/src/external/bsd/ntp/dist/scripts/summary.mdoc.in
--- external/bsd/ntp/dist/scripts/summary.mdoc.in	2014-12-19 12:37:43.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/scripts/summary.mdoc.in	2015-04-07 19:51:17.000000000 -0700
@@ -1,9 +1,9 @@
-.Dd December 19 2014
+.Dd April 7 2015
 .Dt SUMMARY 1summarymdoc User Commands
 .Os
 .\"  EDIT THIS FILE WITH CAUTION  (summary-opts.mdoc)
 .\"
-.\"  It has been AutoGen-ed  December 19, 2014 at 07:45:24 AM by AutoGen 5.18.5pre4
+.\"  It has been AutoGen-ed  April  7, 2015 at 04:22:00 AM by AutoGen 5.18.5pre4
 .\"  From the definitions    summary-opts.def
 .\"  and the template file   agmdoc-cmd.tpl
 .Sh NAME
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/scripts/update-leap/Makefile.am /cur/src/external/bsd/ntp/dist/scripts/update-leap/Makefile.am
--- external/bsd/ntp/dist/scripts/update-leap/Makefile.am	1969-12-31 16:00:00.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/scripts/update-leap/Makefile.am	2015-04-07 09:49:11.000000000 -0700
@@ -0,0 +1,97 @@
+NULL=
+run_ag=		cd $(srcdir) &&	env PATH="$(abs_builddir):$(PATH)" PERL5LIB="$(abs_top_srcdir)/scripts/lib" AUTOGEN_DNE_DATE=-D	\
+		autogen -L ../../sntp/include -L ../../sntp/ag-tpl \
+		--writable
+std_def_list =							\
+	$(top_srcdir)/sntp/include/debug-opt.def		\
+	$(top_srcdir)/sntp/include/autogen-version.def 		\
+	$(top_srcdir)/sntp/include/copyright.def 		\
+	$(top_srcdir)/sntp/include/homerc.def 			\
+	$(top_srcdir)/sntp/include/ntp.lic 			\
+	$(top_srcdir)/sntp/include/version.def			\
+	$(NULL)
+
+bin_SCRIPTS=		$(UPDATE_LEAP_DB)
+sbin_SCRIPTS=		$(UPDATE_LEAP_DS)
+libexec_SCRIPTS=	$(UPDATE_LEAP_DL)
+noinst_SCRIPTS=		$(UPDATE_LEAP_NI)
+EXTRA_SCRIPTS=		update-leap
+
+man1_MANS=
+man8_MANS=
+if INSTALL_UPDATE_LEAP
+man_MANS=	update-leap.$(UPDATE_LEAP_MS)
+else
+noinst_MANS=	update-leap.$(UPDATE_LEAP_MS)
+endif
+
+EXTRA_DIST =				\
+	invoke-update-leap.menu		\
+	invoke-update-leap.texi		\
+	update-leap			\
+	update-leap-opts.def		\
+	update-leap-opts		\
+	update-leap.1update-leapman	\
+	update-leap.1update-leapmdoc	\
+	update-leap.man.in		\
+	update-leap.mdoc.in		\
+	update-leap.texi		\
+	update-leap.html		\
+	$(NULL)
+
+html_DATA = update-leap.html
+
+#CLEANFILES = update-leap.1
+DISTCLEANFILES = config.log $(man_MANS) $(noinst_MANS)
+
+noinst_DATA =				\
+	invoke-update-leap.menu		\
+	invoke-update-leap.texi		\
+	update-leap.man.in		\
+	update-leap.mdoc.in		\
+	update-leap-opts		\
+	$(NULL)
+
+$(srcdir)/update-leap: $(srcdir)/update-leap-opts
+	@: do-nothing action to avoid default SCCS get
+
+$(srcdir)/update-leap-opts: update-leap-opts.def $(std_def_list)
+	$(run_ag) update-leap-opts.def
+
+### Man
+
+$(srcdir)/update-leap.1update-leapman: $(srcdir)/update-leap-opts.def $(std_def_list)
+	$(run_ag) -DMAN_SECTION=1update-leapman -Tagman-cmd.tpl update-leap-opts.def
+
+$(srcdir)/update-leap.man.in: $(srcdir)/update-leap.1update-leapman $(top_srcdir)/sntp/scripts/mansec2subst.sed
+	sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/update-leap.1update-leapman > $(srcdir)/update-leap.man.in+
+	mv $(srcdir)/update-leap.man.in+ $(srcdir)/update-leap.man.in
+
+### Mdoc
+
+$(srcdir)/update-leap.1update-leapmdoc: $(srcdir)/update-leap-opts.def $(std_def_list)
+	$(run_ag) -DMAN_SECTION=1update-leapmdoc -Tagmdoc-cmd.tpl update-leap-opts.def
+
+$(srcdir)/update-leap.mdoc.in: $(srcdir)/update-leap.1update-leapmdoc $(top_srcdir)/sntp/scripts/mansec2subst.sed
+	sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/update-leap.1update-leapmdoc > $(srcdir)/update-leap.mdoc.in+
+	mv $(srcdir)/update-leap.mdoc.in+ $(srcdir)/update-leap.mdoc.in
+
+### Manpage
+
+update-leap.$(UPDATE_LEAP_MS): $(srcdir)/update-leap.$(MANTAGFMT).in $(top_builddir)/config.status
+	$(top_builddir)/config.status --file=update-leap.$(UPDATE_LEAP_MS)+:$(srcdir)/update-leap.$(MANTAGFMT).in
+	mv update-leap.$(UPDATE_LEAP_MS)+ update-leap.$(UPDATE_LEAP_MS)
+
+### Texinfo
+
+$(srcdir)/invoke-update-leap.menu: $(srcdir)/invoke-update-leap.texi
+	@: do-nothing action to avoid default SCCS get, .menu built with .texi
+
+$(srcdir)/invoke-update-leap.texi: $(srcdir)/update-leap-opts.def $(std_def_list)
+	$(run_ag) -Tagtexi-cmd.tpl -DLEVEL=section update-leap-opts.def
+	$(top_srcdir)/scripts/build/check--help $@
+
+### HTML
+
+$(srcdir)/update-leap.html: $(srcdir)/update-leap.texi $(top_srcdir)/sntp/include/version.texi
+	cd $(srcdir) && ( makeinfo --force --html --no-split -I ../sntp -o update-leap.html update-leap.texi || true )
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/scripts/update-leap/Makefile.in /cur/src/external/bsd/ntp/dist/scripts/update-leap/Makefile.in
--- external/bsd/ntp/dist/scripts/update-leap/Makefile.in	1969-12-31 16:00:00.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/scripts/update-leap/Makefile.in	2015-04-07 09:49:11.000000000 -0700
@@ -0,0 +1,887 @@
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
+# Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = scripts/update-leap
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
+	$(top_srcdir)/sntp/libopts/m4/stdnoreturn.m4 \
+	$(top_srcdir)/sntp/m4/ax_c99_struct_init.m4 \
+	$(top_srcdir)/sntp/m4/define_dir.m4 \
+	$(top_srcdir)/sntp/m4/hms_search_lib.m4 \
+	$(top_srcdir)/sntp/m4/libtool.m4 \
+	$(top_srcdir)/sntp/m4/ltoptions.m4 \
+	$(top_srcdir)/sntp/m4/ltsugar.m4 \
+	$(top_srcdir)/sntp/m4/ltversion.m4 \
+	$(top_srcdir)/sntp/m4/lt~obsolete.m4 \
+	$(top_srcdir)/sntp/m4/ntp_cacheversion.m4 \
+	$(top_srcdir)/sntp/m4/ntp_compiler.m4 \
+	$(top_srcdir)/sntp/m4/ntp_crosscompile.m4 \
+	$(top_srcdir)/sntp/m4/ntp_crypto_rand.m4 \
+	$(top_srcdir)/sntp/m4/ntp_debug.m4 \
+	$(top_srcdir)/sntp/m4/ntp_dir_sep.m4 \
+	$(top_srcdir)/sntp/m4/ntp_facilitynames.m4 \
+	$(top_srcdir)/sntp/m4/ntp_googletest.m4 \
+	$(top_srcdir)/sntp/m4/ntp_ipv6.m4 \
+	$(top_srcdir)/sntp/m4/ntp_lib_m.m4 \
+	$(top_srcdir)/sntp/m4/ntp_libevent.m4 \
+	$(top_srcdir)/sntp/m4/ntp_libntp.m4 \
+	$(top_srcdir)/sntp/m4/ntp_lineeditlibs.m4 \
+	$(top_srcdir)/sntp/m4/ntp_locinfo.m4 \
+	$(top_srcdir)/sntp/m4/ntp_openssl.m4 \
+	$(top_srcdir)/sntp/m4/ntp_pkg_config.m4 \
+	$(top_srcdir)/sntp/m4/ntp_prog_cc.m4 \
+	$(top_srcdir)/sntp/m4/ntp_rlimit.m4 \
+	$(top_srcdir)/sntp/m4/ntp_sntp.m4 \
+	$(top_srcdir)/sntp/m4/ntp_ver_suffix.m4 \
+	$(top_srcdir)/sntp/m4/ntp_vpathhack.m4 \
+	$(top_srcdir)/sntp/m4/openldap-thread-check.m4 \
+	$(top_srcdir)/sntp/m4/openldap.m4 \
+	$(top_srcdir)/sntp/m4/os_cflags.m4 \
+	$(top_srcdir)/sntp/m4/snprintf.m4 \
+	$(top_srcdir)/sntp/m4/version.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(libexecdir)" \
+	"$(DESTDIR)$(sbindir)" "$(DESTDIR)$(man1dir)" \
+	"$(DESTDIR)$(man8dir)" "$(DESTDIR)$(htmldir)"
+SCRIPTS = $(bin_SCRIPTS) $(libexec_SCRIPTS) $(noinst_SCRIPTS) \
+	$(sbin_SCRIPTS)
+AM_V_GEN = $(am__v_GEN_$(V))
+am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
+am__v_GEN_0 = @echo "  GEN   " $@;
+AM_V_at = $(am__v_at_$(V))
+am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
+am__v_at_0 = @
+SOURCES =
+DIST_SOURCES =
+man1dir = $(mandir)/man1
+man8dir = $(mandir)/man8
+NROFF = nroff
+MANS = $(man1_MANS) $(man8_MANS) $(man_MANS)
+DATA = $(html_DATA) $(noinst_DATA)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ALLOCA = @ALLOCA@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CALC_TICKADJ_DB = @CALC_TICKADJ_DB@
+CALC_TICKADJ_DL = @CALC_TICKADJ_DL@
+CALC_TICKADJ_DS = @CALC_TICKADJ_DS@
+CALC_TICKADJ_MS = @CALC_TICKADJ_MS@
+CALC_TICKADJ_NI = @CALC_TICKADJ_NI@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CFLAGS_NTP = @CFLAGS_NTP@
+CHUTEST = @CHUTEST@
+CONFIG_SHELL = @CONFIG_SHELL@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPFLAGS_LIBEVENT = @CPPFLAGS_LIBEVENT@
+CPPFLAGS_NTP = @CPPFLAGS_NTP@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DCFD = @DCFD@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EDITLINE_LIBS = @EDITLINE_LIBS@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GREP = @GREP@
+GTEST_CONFIG = @GTEST_CONFIG@
+GTEST_CPPFLAGS = @GTEST_CPPFLAGS@
+GTEST_CXXFLAGS = @GTEST_CXXFLAGS@
+GTEST_LDFLAGS = @GTEST_LDFLAGS@
+GTEST_LIBS = @GTEST_LIBS@
+HAVE_INLINE = @HAVE_INLINE@
+HAVE_RLIMIT_MEMLOCK = @HAVE_RLIMIT_MEMLOCK@
+HAVE_RLIMIT_STACK = @HAVE_RLIMIT_STACK@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDADD_LIBEVENT = @LDADD_LIBEVENT@
+LDADD_LIBNTP = @LDADD_LIBNTP@
+LDADD_LIBUTIL = @LDADD_LIBUTIL@
+LDADD_NLIST = @LDADD_NLIST@
+LDADD_NTP = @LDADD_NTP@
+LDFLAGS = @LDFLAGS@
+LDFLAGS_NTP = @LDFLAGS_NTP@
+LIBISC_PTHREADS_NOTHREADS = @LIBISC_PTHREADS_NOTHREADS@
+LIBM = @LIBM@
+LIBOBJS = @LIBOBJS@
+LIBOPTS_CFLAGS = @LIBOPTS_CFLAGS@
+LIBOPTS_DIR = @LIBOPTS_DIR@
+LIBOPTS_LDADD = @LIBOPTS_LDADD@
+LIBPARSE = @LIBPARSE@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBTOOL_DEPS = @LIBTOOL_DEPS@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LSCF = @LSCF@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MAKE_ADJTIMED = @MAKE_ADJTIMED@
+MAKE_CHECK_LAYOUT = @MAKE_CHECK_LAYOUT@
+MAKE_CHECK_Y2K = @MAKE_CHECK_Y2K@
+MAKE_LIBNTPSIM = @MAKE_LIBNTPSIM@
+MAKE_LIBPARSE = @MAKE_LIBPARSE@
+MAKE_LIBPARSE_KERNEL = @MAKE_LIBPARSE_KERNEL@
+MAKE_NTPDSIM = @MAKE_NTPDSIM@
+MAKE_NTPSNMPD = @MAKE_NTPSNMPD@
+MAKE_NTPTIME = @MAKE_NTPTIME@
+MAKE_PARSEKMODULE = @MAKE_PARSEKMODULE@
+MAKE_TICKADJ = @MAKE_TICKADJ@
+MAKE_TIMETRIM = @MAKE_TIMETRIM@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MANTAGFMT = @MANTAGFMT@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+NTPDATE_DB = @NTPDATE_DB@
+NTPDATE_DL = @NTPDATE_DL@
+NTPDATE_DS = @NTPDATE_DS@
+NTPDATE_MS = @NTPDATE_MS@
+NTPDATE_NI = @NTPDATE_NI@
+NTPDC_DB = @NTPDC_DB@
+NTPDC_DL = @NTPDC_DL@
+NTPDC_DS = @NTPDC_DS@
+NTPDC_MS = @NTPDC_MS@
+NTPDC_NI = @NTPDC_NI@
+NTPDSIM_DB = @NTPDSIM_DB@
+NTPDSIM_DL = @NTPDSIM_DL@
+NTPDSIM_DS = @NTPDSIM_DS@
+NTPDSIM_MS = @NTPDSIM_MS@
+NTPDSIM_NI = @NTPDSIM_NI@
+NTPD_DB = @NTPD_DB@
+NTPD_DL = @NTPD_DL@
+NTPD_DS = @NTPD_DS@
+NTPD_MS = @NTPD_MS@
+NTPD_NI = @NTPD_NI@
+NTPQ_DB = @NTPQ_DB@
+NTPQ_DL = @NTPQ_DL@
+NTPQ_DS = @NTPQ_DS@
+NTPQ_MS = @NTPQ_MS@
+NTPQ_NI = @NTPQ_NI@
+NTPSNMPD_DB = @NTPSNMPD_DB@
+NTPSNMPD_DL = @NTPSNMPD_DL@
+NTPSNMPD_DS = @NTPSNMPD_DS@
+NTPSNMPD_MS = @NTPSNMPD_MS@
+NTPSNMPD_NI = @NTPSNMPD_NI@
+NTPSWEEP_DB = @NTPSWEEP_DB@
+NTPSWEEP_DL = @NTPSWEEP_DL@
+NTPSWEEP_DS = @NTPSWEEP_DS@
+NTPSWEEP_MS = @NTPSWEEP_MS@
+NTPSWEEP_NI = @NTPSWEEP_NI@
+NTPTIME_DB = @NTPTIME_DB@
+NTPTIME_DL = @NTPTIME_DL@
+NTPTIME_DS = @NTPTIME_DS@
+NTPTIME_MS = @NTPTIME_MS@
+NTPTIME_NI = @NTPTIME_NI@
+NTPTRACE_DB = @NTPTRACE_DB@
+NTPTRACE_DL = @NTPTRACE_DL@
+NTPTRACE_DS = @NTPTRACE_DS@
+NTPTRACE_MS = @NTPTRACE_MS@
+NTPTRACE_NI = @NTPTRACE_NI@
+NTP_KEYGEN_DB = @NTP_KEYGEN_DB@
+NTP_KEYGEN_DL = @NTP_KEYGEN_DL@
+NTP_KEYGEN_DS = @NTP_KEYGEN_DS@
+NTP_KEYGEN_MS = @NTP_KEYGEN_MS@
+NTP_KEYGEN_NI = @NTP_KEYGEN_NI@
+NTP_KEYSDIR = @NTP_KEYSDIR@
+NTP_WAIT_DB = @NTP_WAIT_DB@
+NTP_WAIT_DL = @NTP_WAIT_DL@
+NTP_WAIT_DS = @NTP_WAIT_DS@
+NTP_WAIT_MS = @NTP_WAIT_MS@
+NTP_WAIT_NI = @NTP_WAIT_NI@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_NET_SNMP_CONFIG = @PATH_NET_SNMP_CONFIG@
+PATH_PERL = @PATH_PERL@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PATH_TEST = @PATH_TEST@
+PERLLIBDIR = @PERLLIBDIR@
+PKG_CONFIG = @PKG_CONFIG@
+POSIX_SHELL = @POSIX_SHELL@
+PROPDELAY = @PROPDELAY@
+PTHREAD_LIBS = @PTHREAD_LIBS@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SNMP_CFLAGS = @SNMP_CFLAGS@
+SNMP_CPPFLAGS = @SNMP_CPPFLAGS@
+SNMP_LIBS = @SNMP_LIBS@
+SNTP = @SNTP@
+SNTP_DB = @SNTP_DB@
+SNTP_DL = @SNTP_DL@
+SNTP_DS = @SNTP_DS@
+SNTP_MS = @SNTP_MS@
+SNTP_NI = @SNTP_NI@
+STDNORETURN_H = @STDNORETURN_H@
+STRIP = @STRIP@
+TESTDCF = @TESTDCF@
+TICKADJ_DB = @TICKADJ_DB@
+TICKADJ_DL = @TICKADJ_DL@
+TICKADJ_DS = @TICKADJ_DS@
+TICKADJ_MS = @TICKADJ_MS@
+TICKADJ_NI = @TICKADJ_NI@
+TIMETRIM_DB = @TIMETRIM_DB@
+TIMETRIM_DL = @TIMETRIM_DL@
+TIMETRIM_DS = @TIMETRIM_DS@
+TIMETRIM_MS = @TIMETRIM_MS@
+TIMETRIM_NI = @TIMETRIM_NI@
+UPDATE_LEAP_DB = @UPDATE_LEAP_DB@
+UPDATE_LEAP_DL = @UPDATE_LEAP_DL@
+UPDATE_LEAP_DS = @UPDATE_LEAP_DS@
+UPDATE_LEAP_MS = @UPDATE_LEAP_MS@
+UPDATE_LEAP_NI = @UPDATE_LEAP_NI@
+VERSION = @VERSION@
+VER_SUFFIX = @VER_SUFFIX@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+subdirs = @subdirs@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+NULL = 
+run_ag = cd $(srcdir) &&	env PATH="$(abs_builddir):$(PATH)" PERL5LIB="$(abs_top_srcdir)/scripts/lib" AUTOGEN_DNE_DATE=-D	\
+		autogen -L ../../sntp/include -L ../../sntp/ag-tpl \
+		--writable
+
+std_def_list = \
+	$(top_srcdir)/sntp/include/debug-opt.def		\
+	$(top_srcdir)/sntp/include/autogen-version.def 		\
+	$(top_srcdir)/sntp/include/copyright.def 		\
+	$(top_srcdir)/sntp/include/homerc.def 			\
+	$(top_srcdir)/sntp/include/ntp.lic 			\
+	$(top_srcdir)/sntp/include/version.def			\
+	$(NULL)
+
+bin_SCRIPTS = $(UPDATE_LEAP_DB)
+sbin_SCRIPTS = $(UPDATE_LEAP_DS)
+libexec_SCRIPTS = $(UPDATE_LEAP_DL)
+noinst_SCRIPTS = $(UPDATE_LEAP_NI)
+EXTRA_SCRIPTS = update-leap
+man1_MANS = 
+man8_MANS = 
+@INSTALL_UPDATE_LEAP_TRUE@man_MANS = update-leap.$(UPDATE_LEAP_MS)
+@INSTALL_UPDATE_LEAP_FALSE@noinst_MANS = update-leap.$(UPDATE_LEAP_MS)
+EXTRA_DIST = \
+	invoke-update-leap.menu		\
+	invoke-update-leap.texi		\
+	update-leap			\
+	update-leap-opts.def		\
+	update-leap-opts		\
+	update-leap.1update-leapman	\
+	update-leap.1update-leapmdoc	\
+	update-leap.man.in		\
+	update-leap.mdoc.in		\
+	update-leap.texi		\
+	update-leap.html		\
+	$(NULL)
+
+html_DATA = update-leap.html
+
+#CLEANFILES = update-leap.1
+DISTCLEANFILES = config.log $(man_MANS) $(noinst_MANS)
+noinst_DATA = \
+	invoke-update-leap.menu		\
+	invoke-update-leap.texi		\
+	update-leap.man.in		\
+	update-leap.mdoc.in		\
+	update-leap-opts		\
+	$(NULL)
+
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign scripts/update-leap/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign scripts/update-leap/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+install-binSCRIPTS: $(bin_SCRIPTS)
+	@$(NORMAL_INSTALL)
+	test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
+	@list='$(bin_SCRIPTS)'; test -n "$(bindir)" || list=; \
+	for p in $$list; do \
+	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+	  if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \
+	done | \
+	sed -e 'p;s,.*/,,;n' \
+	    -e 'h;s|.*|.|' \
+	    -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \
+	$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \
+	  { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+	    if ($$2 == $$4) { files[d] = files[d] " " $$1; \
+	      if (++n[d] == $(am__install_max)) { \
+		print "f", d, files[d]; n[d] = 0; files[d] = "" } } \
+	    else { print "f", d "/" $$4, $$1 } } \
+	  END { for (d in files) print "f", d, files[d] }' | \
+	while read type dir files; do \
+	     if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+	     test -z "$$files" || { \
+	       echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+	       $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+	     } \
+	; done
+
+uninstall-binSCRIPTS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \
+	files=`for p in $$list; do echo "$$p"; done | \
+	       sed -e 's,.*/,,;$(transform)'`; \
+	test -n "$$list" || exit 0; \
+	echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
+	cd "$(DESTDIR)$(bindir)" && rm -f $$files
+install-libexecSCRIPTS: $(libexec_SCRIPTS)
+	@$(NORMAL_INSTALL)
+	test -z "$(libexecdir)" || $(MKDIR_P) "$(DESTDIR)$(libexecdir)"
+	@list='$(libexec_SCRIPTS)'; test -n "$(libexecdir)" || list=; \
+	for p in $$list; do \
+	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+	  if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \
+	done | \
+	sed -e 'p;s,.*/,,;n' \
+	    -e 'h;s|.*|.|' \
+	    -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \
+	$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \
+	  { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+	    if ($$2 == $$4) { files[d] = files[d] " " $$1; \
+	      if (++n[d] == $(am__install_max)) { \
+		print "f", d, files[d]; n[d] = 0; files[d] = "" } } \
+	    else { print "f", d "/" $$4, $$1 } } \
+	  END { for (d in files) print "f", d, files[d] }' | \
+	while read type dir files; do \
+	     if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+	     test -z "$$files" || { \
+	       echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(libexecdir)$$dir'"; \
+	       $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(libexecdir)$$dir" || exit $$?; \
+	     } \
+	; done
+
+uninstall-libexecSCRIPTS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(libexec_SCRIPTS)'; test -n "$(libexecdir)" || exit 0; \
+	files=`for p in $$list; do echo "$$p"; done | \
+	       sed -e 's,.*/,,;$(transform)'`; \
+	test -n "$$list" || exit 0; \
+	echo " ( cd '$(DESTDIR)$(libexecdir)' && rm -f" $$files ")"; \
+	cd "$(DESTDIR)$(libexecdir)" && rm -f $$files
+install-sbinSCRIPTS: $(sbin_SCRIPTS)
+	@$(NORMAL_INSTALL)
+	test -z "$(sbindir)" || $(MKDIR_P) "$(DESTDIR)$(sbindir)"
+	@list='$(sbin_SCRIPTS)'; test -n "$(sbindir)" || list=; \
+	for p in $$list; do \
+	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+	  if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \
+	done | \
+	sed -e 'p;s,.*/,,;n' \
+	    -e 'h;s|.*|.|' \
+	    -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \
+	$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \
+	  { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+	    if ($$2 == $$4) { files[d] = files[d] " " $$1; \
+	      if (++n[d] == $(am__install_max)) { \
+		print "f", d, files[d]; n[d] = 0; files[d] = "" } } \
+	    else { print "f", d "/" $$4, $$1 } } \
+	  END { for (d in files) print "f", d, files[d] }' | \
+	while read type dir files; do \
+	     if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+	     test -z "$$files" || { \
+	       echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(sbindir)$$dir'"; \
+	       $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(sbindir)$$dir" || exit $$?; \
+	     } \
+	; done
+
+uninstall-sbinSCRIPTS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(sbin_SCRIPTS)'; test -n "$(sbindir)" || exit 0; \
+	files=`for p in $$list; do echo "$$p"; done | \
+	       sed -e 's,.*/,,;$(transform)'`; \
+	test -n "$$list" || exit 0; \
+	echo " ( cd '$(DESTDIR)$(sbindir)' && rm -f" $$files ")"; \
+	cd "$(DESTDIR)$(sbindir)" && rm -f $$files
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+install-man1: $(man1_MANS) $(man_MANS)
+	@$(NORMAL_INSTALL)
+	test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)"
+	@list='$(man1_MANS)'; test -n "$(man1dir)" || exit 0; \
+	{ for i in $$list; do echo "$$i"; done; \
+	l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+	  sed -n '/\.1[a-z]*$$/p'; \
+	} | while read p; do \
+	  if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
+	  echo "$$d$$p"; echo "$$p"; \
+	done | \
+	sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
+	      -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
+	sed 'N;N;s,\n, ,g' | { \
+	list=; while read file base inst; do \
+	  if test "$$base" = "$$inst"; then list="$$list $$file"; else \
+	    echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \
+	    $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \
+	  fi; \
+	done; \
+	for i in $$list; do echo "$$i"; done | $(am__base_list) | \
+	while read files; do \
+	  test -z "$$files" || { \
+	    echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \
+	    $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \
+	done; }
+
+uninstall-man1:
+	@$(NORMAL_UNINSTALL)
+	@list='$(man1_MANS)'; test -n "$(man1dir)" || exit 0; \
+	files=`{ for i in $$list; do echo "$$i"; done; \
+	l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+	  sed -n '/\.1[a-z]*$$/p'; \
+	} | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
+	      -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
+	test -z "$$files" || { \
+	  echo " ( cd '$(DESTDIR)$(man1dir)' && rm -f" $$files ")"; \
+	  cd "$(DESTDIR)$(man1dir)" && rm -f $$files; }
+install-man8: $(man8_MANS) $(man_MANS)
+	@$(NORMAL_INSTALL)
+	test -z "$(man8dir)" || $(MKDIR_P) "$(DESTDIR)$(man8dir)"
+	@list='$(man8_MANS)'; test -n "$(man8dir)" || exit 0; \
+	{ for i in $$list; do echo "$$i"; done; \
+	l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+	  sed -n '/\.8[a-z]*$$/p'; \
+	} | while read p; do \
+	  if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
+	  echo "$$d$$p"; echo "$$p"; \
+	done | \
+	sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \
+	      -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
+	sed 'N;N;s,\n, ,g' | { \
+	list=; while read file base inst; do \
+	  if test "$$base" = "$$inst"; then list="$$list $$file"; else \
+	    echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man8dir)/$$inst'"; \
+	    $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man8dir)/$$inst" || exit $$?; \
+	  fi; \
+	done; \
+	for i in $$list; do echo "$$i"; done | $(am__base_list) | \
+	while read files; do \
+	  test -z "$$files" || { \
+	    echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man8dir)'"; \
+	    $(INSTALL_DATA) $$files "$(DESTDIR)$(man8dir)" || exit $$?; }; \
+	done; }
+
+uninstall-man8:
+	@$(NORMAL_UNINSTALL)
+	@list='$(man8_MANS)'; test -n "$(man8dir)" || exit 0; \
+	files=`{ for i in $$list; do echo "$$i"; done; \
+	l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+	  sed -n '/\.8[a-z]*$$/p'; \
+	} | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \
+	      -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
+	test -z "$$files" || { \
+	  echo " ( cd '$(DESTDIR)$(man8dir)' && rm -f" $$files ")"; \
+	  cd "$(DESTDIR)$(man8dir)" && rm -f $$files; }
+install-htmlDATA: $(html_DATA)
+	@$(NORMAL_INSTALL)
+	test -z "$(htmldir)" || $(MKDIR_P) "$(DESTDIR)$(htmldir)"
+	@list='$(html_DATA)'; test -n "$(htmldir)" || list=; \
+	for p in $$list; do \
+	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+	  echo "$$d$$p"; \
+	done | $(am__base_list) | \
+	while read files; do \
+	  echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(htmldir)'"; \
+	  $(INSTALL_DATA) $$files "$(DESTDIR)$(htmldir)" || exit $$?; \
+	done
+
+uninstall-htmlDATA:
+	@$(NORMAL_UNINSTALL)
+	@list='$(html_DATA)'; test -n "$(htmldir)" || list=; \
+	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+	test -n "$$files" || exit 0; \
+	echo " ( cd '$(DESTDIR)$(htmldir)' && rm -f" $$files ")"; \
+	cd "$(DESTDIR)$(htmldir)" && rm -f $$files
+tags: TAGS
+TAGS:
+
+ctags: CTAGS
+CTAGS:
+
+
+distdir: $(DISTFILES)
+	@list='$(MANS)'; if test -n "$$list"; then \
+	  list=`for p in $$list; do \
+	    if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
+	    if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \
+	  if test -n "$$list" && \
+	    grep 'ab help2man is required to generate this page' $$list >/dev/null; then \
+	    echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \
+	    grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/         /' >&2; \
+	    echo "       to fix them, install help2man, remove and regenerate the man pages;" >&2; \
+	    echo "       typically \`make maintainer-clean' will remove them" >&2; \
+	    exit 1; \
+	  else :; fi; \
+	else :; fi
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(SCRIPTS) $(MANS) $(DATA)
+installdirs:
+	for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(libexecdir)" "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man8dir)" "$(DESTDIR)$(htmldir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+	-test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am: install-htmlDATA install-man
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-binSCRIPTS install-libexecSCRIPTS \
+	install-sbinSCRIPTS
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man: install-man1 install-man8
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-binSCRIPTS uninstall-htmlDATA \
+	uninstall-libexecSCRIPTS uninstall-man uninstall-sbinSCRIPTS
+
+uninstall-man: uninstall-man1 uninstall-man8
+
+.MAKE: install-am install-strip
+
+.PHONY: all all-am check check-am clean clean-generic clean-libtool \
+	distclean distclean-generic distclean-libtool distdir dvi \
+	dvi-am html html-am info info-am install install-am \
+	install-binSCRIPTS install-data install-data-am install-dvi \
+	install-dvi-am install-exec install-exec-am install-html \
+	install-html-am install-htmlDATA install-info install-info-am \
+	install-libexecSCRIPTS install-man install-man1 install-man8 \
+	install-pdf install-pdf-am install-ps install-ps-am \
+	install-sbinSCRIPTS install-strip installcheck installcheck-am \
+	installdirs maintainer-clean maintainer-clean-generic \
+	mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
+	ps ps-am uninstall uninstall-am uninstall-binSCRIPTS \
+	uninstall-htmlDATA uninstall-libexecSCRIPTS uninstall-man \
+	uninstall-man1 uninstall-man8 uninstall-sbinSCRIPTS
+
+
+$(srcdir)/update-leap: $(srcdir)/update-leap-opts
+	@: do-nothing action to avoid default SCCS get
+
+$(srcdir)/update-leap-opts: update-leap-opts.def $(std_def_list)
+	$(run_ag) update-leap-opts.def
+
+### Man
+
+$(srcdir)/update-leap.1update-leapman: $(srcdir)/update-leap-opts.def $(std_def_list)
+	$(run_ag) -DMAN_SECTION=1update-leapman -Tagman-cmd.tpl update-leap-opts.def
+
+$(srcdir)/update-leap.man.in: $(srcdir)/update-leap.1update-leapman $(top_srcdir)/sntp/scripts/mansec2subst.sed
+	sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/update-leap.1update-leapman > $(srcdir)/update-leap.man.in+
+	mv $(srcdir)/update-leap.man.in+ $(srcdir)/update-leap.man.in
+
+### Mdoc
+
+$(srcdir)/update-leap.1update-leapmdoc: $(srcdir)/update-leap-opts.def $(std_def_list)
+	$(run_ag) -DMAN_SECTION=1update-leapmdoc -Tagmdoc-cmd.tpl update-leap-opts.def
+
+$(srcdir)/update-leap.mdoc.in: $(srcdir)/update-leap.1update-leapmdoc $(top_srcdir)/sntp/scripts/mansec2subst.sed
+	sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/update-leap.1update-leapmdoc > $(srcdir)/update-leap.mdoc.in+
+	mv $(srcdir)/update-leap.mdoc.in+ $(srcdir)/update-leap.mdoc.in
+
+### Manpage
+
+update-leap.$(UPDATE_LEAP_MS): $(srcdir)/update-leap.$(MANTAGFMT).in $(top_builddir)/config.status
+	$(top_builddir)/config.status --file=update-leap.$(UPDATE_LEAP_MS)+:$(srcdir)/update-leap.$(MANTAGFMT).in
+	mv update-leap.$(UPDATE_LEAP_MS)+ update-leap.$(UPDATE_LEAP_MS)
+
+### Texinfo
+
+$(srcdir)/invoke-update-leap.menu: $(srcdir)/invoke-update-leap.texi
+	@: do-nothing action to avoid default SCCS get, .menu built with .texi
+
+$(srcdir)/invoke-update-leap.texi: $(srcdir)/update-leap-opts.def $(std_def_list)
+	$(run_ag) -Tagtexi-cmd.tpl -DLEVEL=section update-leap-opts.def
+	$(top_srcdir)/scripts/build/check--help $@
+
+### HTML
+
+$(srcdir)/update-leap.html: $(srcdir)/update-leap.texi $(top_srcdir)/sntp/include/version.texi
+	cd $(srcdir) && ( makeinfo --force --html --no-split -I ../sntp -o update-leap.html update-leap.texi || true )
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/scripts/update-leap/invoke-update-leap.menu /cur/src/external/bsd/ntp/dist/scripts/update-leap/invoke-update-leap.menu
--- external/bsd/ntp/dist/scripts/update-leap/invoke-update-leap.menu	1969-12-31 16:00:00.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/scripts/update-leap/invoke-update-leap.menu	2015-04-07 09:49:11.000000000 -0700
@@ -0,0 +1 @@
+* update-leap Invocation::         Invoking update-leap
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/scripts/update-leap/invoke-update-leap.texi /cur/src/external/bsd/ntp/dist/scripts/update-leap/invoke-update-leap.texi
--- external/bsd/ntp/dist/scripts/update-leap/invoke-update-leap.texi	1969-12-31 16:00:00.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/scripts/update-leap/invoke-update-leap.texi	2015-04-07 09:49:11.000000000 -0700
@@ -0,0 +1,170 @@
+@node update-leap Invocation
+@section Invoking update-leap
+@pindex update-leap
+@cindex leap-seconds file manager/updater
+@ignore
+#
+# EDIT THIS FILE WITH CAUTION  (invoke-update-leap.texi)
+#
+# It has been AutoGen-ed  April  7, 2015 at 04:21:44 AM by AutoGen 5.18.5pre4
+# From the definitions    update-leap-opts.def
+# and the template file   agtexi-cmd.tpl
+@end ignore
+
+
+
+@code{update-leap}
+will validate the file currently on the local system
+and if necessary, updates leap-second definition file.
+
+Ordinarily, the file is found using the "leapfile" directive in
+@code{ntp.conf(5)}.
+However, an alternate location can be specified on the command line.
+
+If the file does not exist, is not valid, has expired, or is expiring soon,
+a new copy will be downloaded.  If the new copy validates, it is installed and
+NTP is (optionally) restarted.
+
+If the current file is acceptable, no download or restart occurs.
+
+-c can also be used to invoke another script to perform administrative
+functions, e.g. to copy the file to other local systems.
+.PP
+This can be run as a cron job.  As the file is rarely updated, and leap
+seconds are announced at least one month in advance (usually longer), it
+need not be run more frequently than about once every three weeks.
+.PP
+For cron-friendly behavior, define CRONJOB=1 in the crontab.
+.PP
+This script depends on$REQUIREDCMDS
+
+This section was generated by @strong{AutoGen},
+using the @code{agtexi-cmd} template and the option descriptions for the @code{update-leap} program.
+
+@menu
+* update-leap usage::                  update-leap help/usage (@option{--help})
+* update-leap source-url::             source-url option (-s)
+* update-leap ipv4::                   ipv4 option (-4)
+* update-leap destination::            destination option (-d)
+* update-leap expiration::             expiration option (-e)
+* update-leap ntp-conf-file::          ntp-conf-file option (-f)
+* update-leap force-update::           force-update option (-F)
+* update-leap exit status::            exit status
+* update-leap Usage::                  Usage
+* update-leap Authors::                Authors
+@end menu
+
+@node update-leap usage
+@subsection update-leap help/usage (@option{--help})
+@cindex update-leap help
+
+This is the automatically generated usage text for update-leap.
+
+The text printed is the same whether selected with the @code{help} option
+(@option{--help}) or the @code{more-help} option (@option{--more-help}).  @code{more-help} will print
+the usage text by passing it through a pager program.
+@code{more-help} is disabled on platforms without a working
+@code{fork(2)} function.  The @code{PAGER} environment variable is
+used to select the program, defaulting to @file{more}.  Both will exit
+with a status code of 0.
+
+@exampleindent 0
+@example
+/bin/bash: line 136: ./update-leap: Permission denied
+@end example
+@exampleindent 4
+
+@node update-leap source-url
+@subsection source-url option (-s)
+@cindex update-leap-source-url
+
+This is the ``the url of the master copy of the leapseconds file'' option.
+This option takes a string argument.
+Specify the URL of the master copy to download
+$LEAPSRC
+@node update-leap ipv4
+@subsection ipv4 option (-4)
+@cindex update-leap-ipv4
+
+This is the ``use only ipv4 addresses for dns name resolution'' option.
+
+@noindent
+This option has some usage constraints.  It:
+@itemize @bullet
+@item
+must not appear in combination with any of the following options:
+ipv6.
+@end itemize
+
+        Force DNS resolution of following host names on the command line
+        to the IPv4 namespace.
+        _EndOfDoc_;
+};
+
+flag = {
+    name      = ipv6;
+    flags-cant = ipv4, prefer;
+    value     = 6;
+    descrip   = "Use only IPv6 addresses for DNS name resolution";
+    doc = <<-  _EndOfDoc_
+        Force DNS resolution of following host names on the command line
+        to the IPv6 namespace.
+        _EndOfDoc_;
+};
+
+flag = {
+    name        = prefer;
+    flags-cant	= ipv4, ipv6;
+    value	= p;
+    arg-type    = keyword;
+    keyword	= 4, 6;
+    descrip     = 'Prefer IPv4 or IPv6 (as specified) addresses, but use either';
+    doc         = <<-  _EndOfDoc_
+Prefer IPv4 or IPv6 (as specified) addresses, but use either.
+@node update-leap destination
+@subsection destination option (-d)
+@cindex update-leap-destination
+
+This is the ``filename on the local system'' option.
+This option takes a string argument @file{float}.
+The name to use to store the leapfile on the local system.
+$LEAPFILE
+@node update-leap expiration
+@subsection expiration option (-e)
+@cindex update-leap-expiration
+
+This is the ``refresh the leapfile this long before it expires'' option.
+This option takes a string argument.
+Specify how long before expiration the file is to be refreshed
+Units are required, e.g. "-e 60 days"  Note that larger values
+imply more frequent refreshes.
+"$PREFETCH"
+@node update-leap ntp-conf-file
+@subsection ntp-conf-file option (-f)
+@cindex update-leap-ntp-conf-file
+
+This is the ``location of the ntp.conf file'' option.
+This option takes a string argument.
+Specify location of ntp.conf (used to make sure leapfile directive is
+present and to default  leapfile)
+/etc/ntp.conf
+@node update-leap force-update
+@subsection force-update option (-F)
+@cindex update-leap-force-update
+
+This is the ``force update of the leapfile'' option.
+Force update even if current file is OK and not close to expiring.
+@node update-leap exit status
+@subsection update-leap exit status
+
+One of the following exit values will be returned:
+@table @samp
+@item 0 (EXIT_SUCCESS)
+Successful program execution.
+@item 1 (EXIT_FAILURE)
+The operation failed or the command syntax was not valid.
+@end table
+@node update-leap Usage
+@subsection update-leap Usage
+@node update-leap Authors
+@subsection update-leap Authors
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/scripts/update-leap/update-leap /cur/src/external/bsd/ntp/dist/scripts/update-leap/update-leap
--- external/bsd/ntp/dist/scripts/update-leap/update-leap	1969-12-31 16:00:00.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/scripts/update-leap/update-leap	2015-04-07 09:49:11.000000000 -0700
@@ -0,0 +1,434 @@
+#!/bin/bash
+
+# Copyright (C) 2014 Timothe Litt litt at acm dot org
+
+# This script may be freely copied, used and modified providing that
+# this notice and the copyright statement are included in all copies
+# and derivative works.  No warranty is offered, and use is entirely at
+# your own risk.  Bugfixes and improvements would be appreciated by the
+# author.
+
+VERSION="1.003"
+
+# leap-seconds file manager/updater
+
+# Depends on:
+#  wget sed, tr, shasum, logger
+
+# ########## Default configuration ##########
+#
+# Where to get the file
+LEAPSRC="ftp://time.nist.gov/pub/leap-seconds.list"
+
+# How many times to try to download new file
+MAXTRIES=6
+INTERVAL=10
+
+# Where to find ntp config file
+NTPCONF=/etc/ntp.conf
+
+# How long before expiration to get updated file
+PREFETCH="60 days"
+
+# How to restart NTP - older NTP: service ntpd? try-restart | condrestart
+# Recent NTP checks for new file daily, so there's nothing to do
+RESTART=
+
+# Where to put temporary copy before it's validated
+TMPFILE="/tmp/leap-seconds.$$.tmp"
+
+# Syslog facility
+LOGFAC=daemon
+# ###########################################
+
+# Places to look for commands.  Allows for CRON having path to
+# old utilities on embedded systems
+
+PATHLIST="/opt/sbin:/opt/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:"
+
+REQUIREDCMDS=" wget logger tr sed shasum"
+
+SELF="`basename $0`"
+
+function displayHelp {
+            cat <<EOF
+Usage: $SELF [options] [leapfile]
+
+Verifies and if necessary, updates leap-second definition file
+
+All arguments are optional:  Default (or current value) shown:
+    -s    Specify the URL of the master copy to download
+          $LEAPSRC
+    -4    Use only IPv4
+    -6    Use only IPv6
+    -p 4|6
+          Prefer IPv4 or IPv6 (as specified) addresses, but use either
+    -d    Specify the filename on the local system
+          $LEAPFILE
+    -e    Specify how long before expiration the file is to be refreshed
+          Units are required, e.g. "-e 60 days"  Note that larger values
+          imply more frequent refreshes.
+          "$PREFETCH"
+    -f    Specify location of ntp.conf (used to make sure leapfile directive is
+          present and to default  leapfile)
+          $NTPCONF
+    -F    Force update even if current file is OK and not close to expiring.
+    -c    Command to restart NTP after installing a new file
+          <none> - ntpd checks file daily
+    -r    Specify number of times to retry on get failure
+          $MAXTRIES
+    -i    Specify number of minutes between retries
+          $INTERVAL
+    -l    Use syslog for output (Implied if CRONJOB is set)
+    -L    Don't use syslog for output
+    -P    Specify the syslog facility for logging
+          $LOGFAC
+    -t    Name of temporary file used in validation
+          $TMPFILE
+    -q    Only report errors to stdout
+    -v    Verbose output
+    -z    Specify path for utilities
+          $PATHLIST
+    -Z    Only use system path
+
+$SELF will validate the file currently on the local system
+
+Ordinarily, the file is found using the "leapfile" directive in $NTPCONF.
+However, an alternate location can be specified on the command line.
+
+If the file does not exist, is not valid, has expired, or is expiring soon,
+a new copy will be downloaded.  If the new copy validates, it is installed and
+NTP is (optionally) restarted.
+
+If the current file is acceptable, no download or restart occurs.
+
+-c can also be used to invoke another script to perform administrative
+functions, e.g. to copy the file to other local systems.
+
+This can be run as a cron job.  As the file is rarely updated, and leap
+seconds are announced at least one month in advance (usually longer), it
+need not be run more frequently than about once every three weeks.
+
+For cron-friendly behavior, define CRONJOB=1 in the crontab.
+
+This script depends on$REQUIREDCMDS
+
+Version $VERSION
+EOF
+   return 0
+}
+
+# Default: Use syslog for logging if running under cron
+
+SYSLOG="$CRONJOB"
+
+if [ "$1" = "--help" ]; then
+    displayHelp
+    exit 0
+fi
+
+# Parse options
+
+while getopts 46p:P:s:e:f:Fc:r:i:lLt:hqvz:Z opt; do
+    case $opt in
+        4)
+            PROTO="-4"
+            ;;
+        6)
+            PROTO="-6"
+            ;;
+        p)
+            if [ "$OPTARG" = '4' -o "$OPTARG" = '6' ]; then
+                PREFER="--prefer-family=IPv$OPTARG"
+            else
+                echo "Invalid -p $OPTARG" >&2
+                exit 1;
+            fi
+            ;;
+	P)
+	    LOGFAC="$OPTARG"
+	    ;;
+        s)
+            LEAPSRC="$OPTARG"
+            ;;
+        e)
+            PREFETCH="$OPTARG"
+            ;;
+	f)
+	    NTPCONF="$OPTARG"
+	    ;;
+        F)
+            FORCE="Y"
+            ;;
+        c)
+            RESTART="$OPTARG"
+            ;;
+        r)
+            MAXTRIES="$OPTARG"
+            ;;
+        i)
+            INTERVAL="$OPTARG"
+            ;;
+        t)
+            TMPFILE="$OPTARG"
+            ;;
+	l)
+	    SYSLOG="y"
+	    ;;
+	L)
+	    SYSLOG=
+	    ;;
+        h)
+            displayHelp
+            exit 0
+            ;;
+	q)
+	    QUIET="Y"
+	    ;;
+        v)
+            VERBOSE="Y"
+            ;;
+	z)
+	    PATHLIST="$OPTARG:"
+	    ;;
+	Z)
+	    PATHLIST=
+	    ;;
+        *)
+            echo "$SELF -h for usage" >&2
+            exit 1
+            ;;
+    esac
+done
+shift $((OPTIND-1))
+
+export PATH="$PATHLIST$PATH"
+
+# Add to path to deal with embedded systems
+#
+for P in $REQUIREDCMDS ; do
+    if >/dev/null 2>&1 which "$P" ; then
+	continue
+    fi
+    [ "$P" = "logger" ] && continue
+    echo "FATAL: missing $P command, please install"
+    exit 1
+done
+
+# Handle logging
+
+if ! LOGGER="`2>/dev/null which logger`" ; then
+    LOGGER=
+fi
+
+function log {
+    # "priority" "message"
+    #
+    # Stdout unless syslog specified or logger isn't available
+    #
+    if [ -z "$SYSLOG" -o -z "$LOGGER" ]; then
+	if [ -n "$QUIET" -a \( "$1" = "info" -o "$1" = "notice" -o "$1" = "debug" \) ]; then
+	    return 0
+	fi
+	echo "`echo \"$1\" | tr a-z A-Z`: $2"
+	return 0
+    fi
+
+    # Also log to stdout if cron job && notice or higher
+    local S
+    if [ -n "$CRONJOB" -a \( "$1" != "info" \) -a \( "$1" != "debug" \) ] || [ -n "$VERBOSE" ]; then
+	S="-s"
+    fi
+    $LOGGER $S -t "$SELF[$$]" -p "$LOGFAC.$1" "$2"
+}
+
+# Verify interval
+INTERVAL=$(( $INTERVAL *1 ))
+
+# Validate a leap-seconds file checksum
+#
+# File format: (full description in files)
+# # marks comments, except:
+# #$ number : the NTP date of the last update
+# #@ number : the NTP date that the file expires
+# Date (seconds since 1900) leaps : leaps is the # of seconds to add for times >= Date
+# Date lines have comments.
+# #h hex hex hex hex hex is the SHA-1 checksum of the data & dates, excluding whitespace w/o leading zeroes
+
+function verifySHA {
+
+    if [ ! -f "$1" ]; then
+        return 1
+    fi
+
+    # Remove comments, except those that are markers for last update, expires and hash
+
+    local RAW="`sed $1 -e'/^\\([0-9]\\|#[\$@h]\)/!d' -e'/^#[\$@h]/!s/#.*\$//g'`"
+
+    # Extract just the data, removing all whitespace
+
+    local DATA="`echo \"$RAW\" | sed -e'/^#h/d' -e's/^#[\$@]//g' | tr -d '[:space:]'`"
+
+    # Compute the SHA hash of the data, removing the marker and filename
+    # Computed in binary mode, which shouldn't matter since whitespace has been removed
+    # shasum comes in several flavors; a portable one is available in Perl (with Digest::SHA)
+
+    local DSHA="`echo -n \"$DATA\" | shasum | sed -e's/[? *].*$//'`"
+
+    # Extract the file's hash. Restore any leading zeroes in hash segments.
+
+    # The sed [] includes a tab (\t) and space; #h is followed by a tab and space
+    local FSHA="`echo \"$RAW\" | sed -e'/^#h/!d' -e's/^#h//' -e's/[ 	] */ 0x/g'`"
+    FSHA=`printf '%08x%08x%08x%08x%08x' $FSHA`
+
+    if [ -n "$FSHA" -a \( "$FSHA" = "$DSHA" \) ]; then
+        if [ -n "$2" ]; then
+            log "info" "Checksum of $1 validated"
+        fi
+    else
+        log "error" "Checksum of $1 is invalid:"
+	[ -z "$FSHA" ] && FSHA="(no checksum record found in file)"
+        log "error" "EXPECTED: $FSHA"
+        log "error" "COMPUTED: $DSHA"
+        return 1
+    fi
+
+    # Check the expiration date, converting NTP epoch to Unix epoch used by date
+
+    EXPIRES="`echo \"$RAW\" | sed -e'/^#@/!d' -e's/^#@//' | tr -d '[:space:]'`"
+    EXPIRES="$(($EXPIRES - 2208988800 ))"
+
+    if [ $EXPIRES -lt `date -u +%s` ]; then
+        log "notice" "File expired on `date -u -d \"Jan 1, 1970 00:00:00 +0000 + $EXPIRES seconds\"`"
+        return 2
+    fi
+
+}
+
+# Verify ntp.conf
+
+if ! [ -f "$NTPCONF" ]; then
+    log "critical" "Missing ntp configuration $NTPCONF"
+    exit 1
+fi
+
+# Parse ntp.conf for leapfile directive
+
+LEAPFILE="`sed $NTPCONF -e'/^ *leapfile  *.*$/!d' -e's/^ *leapfile  *//'`"
+if [ -z "$LEAPFILE" ]; then
+    log "error" "$NTPCONF does not specify a leapfile"
+fi
+
+# Allow placing the file someplace else - testing
+
+if [ -n "$1" ]; then
+    if [ "$1" != "$LEAPFILE" ]; then
+	log "notice" "Requested install to $1, but $NTPCONF specifies $LEAPFILE"
+    fi
+    LEAPFILE="$1"
+fi
+
+# Verify the current file
+# If it is missing, doesn't validate or expired
+# Or is expiring soon
+#  Download a new one
+
+if [ -n "$FORCE" ] || ! verifySHA $LEAPFILE "$VERBOSE" || [ $EXPIRES -lt `date -d "NOW + $PREFETCH" +%s` ] ; then
+    TRY=0
+    while true; do
+        TRY=$(( $TRY + 1 ))
+        if [ -n "$VERBOSE" ]; then
+            log "info" "Attempting download from $LEAPSRC, try $TRY.."
+        fi
+        if wget $PROTO $PREFER -o ${TMPFILE}.log $LEAPSRC -O $TMPFILE ; then
+            log "info" "Download of $LEAPSRC succeeded"
+            if [ -n "$VERBOSE" ]; then
+                cat ${TMPFILE}.log
+            fi
+
+            if ! verifySHA $TMPFILE "$VERBOSE" ; then
+		# There is no point in retrying, as the file on the server is almost
+		# certainly corrupt.
+
+                log "warning" "Downloaded file $TMPFILE rejected -- saved for diagnosis"
+                cat ${TMPFILE}.log
+                rm -f ${TMPFILE}.log
+                exit 1
+            fi
+            rm -f ${TMPFILE}.log
+
+	    # Set correct permissions on temporary file
+
+	    REFFILE="$LEAPFILE"
+            if [ ! -f $LEAPFILE ]; then
+		log "notice" "$LEAPFILE was missing, creating new copy - check permissions"
+                touch $LEAPFILE
+		# Can't copy permissions from old file, copy from NTPCONF instead
+		REFFILE="$NTPCONF"
+            fi
+            chmod --reference $REFFILE $TMPFILE
+            chown --reference $REFFILE $TMPFILE
+	    ( which selinuxenabled && selinuxenabled && which chcon ) >/dev/null 2>&1
+            if  [ $? == 0 ] ; then
+                chcon --reference $REFFILE $TMPFILE
+            fi
+
+	    # Replace current file with validated new one
+
+            if mv -f $TMPFILE $LEAPFILE ; then
+                log "notice" "Installed new $LEAPFILE from $LEAPSRC"
+            else
+                log "error" "Install $TMPFILE => $LEAPFILE failed -- saved for diagnosis"
+                exit 1
+            fi
+
+	    # Restart NTP (or whatever else is specified)
+
+	    if [ -n "$RESTART" ]; then
+		if [ -n "$VERBOSE" ]; then
+		    log "info" "Attempting restart action: $RESTART"
+		fi
+		R="$( 2>&1 $RESTART )"
+		if [ $? -eq 0 ]; then
+		    log "notice" "Restart action succeeded"
+		    if [ -n "$VERBOSE" -a -n "$R" ]; then
+			log "info" "$R"
+		    fi
+		else
+		    log "error" "Restart action failed"
+		    if [ -n "$R" ]; then
+			log "error" "$R"
+		    fi
+		    exit 2
+		fi
+	    fi
+            exit 0
+	fi
+
+	# Failed to download.  See about trying again
+
+        rm -f $TMPFILE
+        if [ $TRY -ge $MAXTRIES ]; then
+            break;
+        fi
+        if [ -n "$VERBOSE" ]; then
+            cat ${TMPFILE}.log
+            log "info" "Waiting $INTERVAL minutes before retrying..."
+        fi
+        sleep $(( $INTERVAL * 60))
+    done
+
+    # Failed and out of retries
+
+    log "warning" "Download from $LEAPSRC failed after $TRY attempts"
+    if [ -f ${TMPFILE}.log ]; then
+        cat ${TMPFILE}.log
+        rm -f ${TMPFILE}.log $TMPFILE
+    fi
+    exit 1
+fi
+log "info" "Not time to replace $LEAPFILE"
+
+exit 0
+
+# EOF
\ No newline at end of file
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/scripts/update-leap/update-leap-opts /cur/src/external/bsd/ntp/dist/scripts/update-leap/update-leap-opts
--- external/bsd/ntp/dist/scripts/update-leap/update-leap-opts	1969-12-31 16:00:00.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/scripts/update-leap/update-leap-opts	2015-04-07 09:49:11.000000000 -0700
@@ -0,0 +1,72 @@
+# EDIT THIS FILE WITH CAUTION  (update-leap-opts)
+#
+# It has been AutoGen-ed  April  7, 2015 at 04:21:40 AM by AutoGen 5.18.5pre4
+# From the definitions    update-leap-opts.def
+# and the template file   perlopt
+
+use Getopt::Long qw(GetOptionsFromArray);
+Getopt::Long::Configure(qw(no_auto_abbrev no_ignore_case_always));
+
+my $usage;
+
+sub usage {
+    my ($ret) = @_;
+    print STDERR $usage;
+    exit $ret;
+}
+
+sub paged_usage {
+    my ($ret) = @_;
+    my $pager = $ENV{PAGER} || '(less || more)';
+
+    open STDOUT, "| $pager" or die "Can't fork a pager: $!";
+    print $usage;
+
+    exit $ret;
+}
+
+sub processOptions {
+    my $args = shift;
+
+    my $opts = {
+        'source-url' => '',
+        'ipv4' => '',
+        'destination' => '',
+        'expiration' => '',
+        'ntp-conf-file' => '',
+        'force-update' => '',
+        'dont-wait' => '',
+        'help' => '', 'more-help' => ''
+    };
+    my $argument = '';
+    my $ret = GetOptionsFromArray($args, $opts, (
+        'source-url|s=s', 'ipv4|4', 'destination|d=f',
+        'expiration|e=s', 'ntp-conf-file|f=s', 'force-update|F',
+        'dont-wait',
+        'help|?', 'more-help'));
+
+    $usage = <<'USAGE';
+update-leap - leap-seconds file manager/updater - Ver. 4.2.8p2
+USAGE: update-leap [ -<flag> [<val>] | --<name>[{=| }<val>] ]... 
+
+    -s, --source-url=str         The URL of the master copy of the leapseconds file
+    -4, --ipv4                   Use only IPv4 addresses for DNS name resolution
+    -d, --destination=float      Filename on the local system
+    -e, --expiration=str         Refresh the leapfile this long before it expires
+    -f, --ntp-conf-file=str      Location of the ntp.conf file
+    -F, --force-update           Force update of the leapfile
+        --dont-wait              Don't wait for keystroke between plots
+    -?, --help                   Display usage information and exit
+        --more-help              Pass the extended usage text through a pager
+
+Options are specified by doubled hyphens and their name or by a single
+hyphen and the flag character.
+USAGE
+
+    usage(0)       if $opts->{'help'};
+    paged_usage(0) if $opts->{'more-help'};
+    $_[0] = $opts;
+    return $ret;
+}
+
+END { close STDOUT };
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/scripts/update-leap/update-leap-opts.def /cur/src/external/bsd/ntp/dist/scripts/update-leap/update-leap-opts.def
--- external/bsd/ntp/dist/scripts/update-leap/update-leap-opts.def	1969-12-31 16:00:00.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/scripts/update-leap/update-leap-opts.def	2015-04-07 09:49:11.000000000 -0700
@@ -0,0 +1,163 @@
+/* -*- Mode: Text -*- */
+autogen definitions perlopt;
+
+#include autogen-version.def
+
+prog-name      = 'update-leap';
+prog-title     = 'leap-seconds file manager/updater';
+package		= ntp;
+#include	version.def
+
+long-opts;
+gnu-usage;
+
+flag = {
+    name        = source-url;
+    value	= s;
+    arg-type    = string;
+    descrip     = 'The URL of the master copy of the leapseconds file';
+    doc         = <<-  _EndOfDoc_
+	Specify the URL of the master copy to download
+	$LEAPSRC
+	_EndOfDoc_;
+};
+flag = {
+    name      = ipv4;
+    flags-cant = ipv6;
+    value     = 4;
+    descrip   = "Use only IPv4 addresses for DNS name resolution";
+    doc = <<-  _EndOfDoc_
+        Force DNS resolution of following host names on the command line
+        to the IPv4 namespace.
+        _EndOfDoc_;
+};
+
+flag = {
+    name      = ipv6;
+    flags-cant = ipv4, prefer;
+    value     = 6;
+    descrip   = "Use only IPv6 addresses for DNS name resolution";
+    doc = <<-  _EndOfDoc_
+        Force DNS resolution of following host names on the command line
+        to the IPv6 namespace.
+        _EndOfDoc_;
+};
+
+flag = {
+    name        = prefer;
+    flags-cant	= ipv4, ipv6;
+    value	= p;
+    arg-type    = keyword;
+    keyword	= 4, 6;
+    descrip     = 'Prefer IPv4 or IPv6 (as specified) addresses, but use either';
+    doc         = <<-  _EndOfDoc_
+	Prefer IPv4 or IPv6 (as specified) addresses, but use either.
+	_EndOfDoc_;
+};
+
+flag = {
+    name        = destination;
+    value       = d;
+    arg-type    = string;
+    arg-name    = float;
+    descrip     = 'Filename on the local system';
+    doc         = <<-  _EndOfDoc_
+	The name to use to store the leapfile on the local system.
+	$LEAPFILE
+	_EndOfDoc_;
+};
+
+flag = {
+    name        = expiration;
+    value	= e;
+    arg-type    = string;
+    descrip     = 'Refresh the leapfile this long before it expires';
+    doc         = <<-  _EndOfDoc_
+	Specify how long before expiration the file is to be refreshed
+	Units are required, e.g. "-e 60 days"  Note that larger values
+	imply more frequent refreshes.
+	"$PREFETCH"
+	_EndOfDoc_;
+};
+
+flag = {
+    name        = ntp-conf-file;
+    value	= f;
+    arg-type    = string;
+    descrip     = 'Location of the ntp.conf file';
+    doc         = <<-  _EndOfDoc_
+	Specify location of ntp.conf (used to make sure leapfile directive is
+	present and to default  leapfile)
+	/etc/ntp.conf
+	_EndOfDoc_;
+};
+
+flag = {
+    name        = force-update;
+    value	= F;
+    descrip     = 'Force update of the leapfile';
+    doc         = <<-  _EndOfDoc_
+	Force update even if current file is OK and not close to expiring.
+	_EndOfDoc_;
+};
+
+flag = {
+    name        = dont-wait;
+    descrip     = "Don't wait for keystroke between plots";
+    doc         = <<-  _EndOfDoc_
+	_EndOfDoc_;
+};
+
+/* explain: Additional information whenever the usage routine is invoked */
+explain = <<- _END_EXPLAIN
+	_END_EXPLAIN;
+
+doc-section     = {
+  ds-type       = 'DESCRIPTION';
+  ds-format     = 'mdoc';
+  ds-text       = <<- _END_PROG_MDOC_DESCRIP
+.Nm
+will validate the file currently on the local system
+and if necessary, updates leap-second definition file.
+.Pp
+Ordinarily, the file is found using the "leapfile" directive in
+.Xr ntp.conf 5 .
+However, an alternate location can be specified on the command line.
+.Pp
+If the file does not exist, is not valid, has expired, or is expiring soon,
+a new copy will be downloaded.  If the new copy validates, it is installed and
+NTP is (optionally) restarted.
+.Pp
+If the current file is acceptable, no download or restart occurs.
+.Pp
+-c can also be used to invoke another script to perform administrative
+functions, e.g. to copy the file to other local systems.
+.PP
+This can be run as a cron job.  As the file is rarely updated, and leap
+seconds are announced at least one month in advance (usually longer), it
+need not be run more frequently than about once every three weeks.
+.PP
+For cron-friendly behavior, define CRONJOB=1 in the crontab.
+.PP
+This script depends on$REQUIREDCMDS
+	_END_PROG_MDOC_DESCRIP;
+};
+
+
+doc-section     = {
+  ds-type       = 'USAGE';
+  ds-format     = 'mdoc';
+  ds-text       = <<- _END_MDOC_USAGE
+
+Usage stuff
+
+	_END_MDOC_USAGE;
+};
+
+doc-section     = {
+  ds-type       = 'AUTHORS';
+  ds-format     = 'mdoc';
+  ds-text       = <<- _END_MDOC_AUTHORS
+.An "Timothe Litt"
+	_END_MDOC_AUTHORS;
+};
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/scripts/update-leap/update-leap.1update-leapman /cur/src/external/bsd/ntp/dist/scripts/update-leap/update-leap.1update-leapman
--- external/bsd/ntp/dist/scripts/update-leap/update-leap.1update-leapman	1969-12-31 16:00:00.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/scripts/update-leap/update-leap.1update-leapman	2015-04-07 09:49:11.000000000 -0700
@@ -0,0 +1,169 @@
+.de1 NOP
+.  it 1 an-trap
+.  if \\n[.$] \,\\$*\/
+..
+.ie t \
+.ds B-Font [CB]
+.ds I-Font [CI]
+.ds R-Font [CR]
+.el \
+.ds B-Font B
+.ds I-Font I
+.ds R-Font R
+.TH update-leap 1update-leapman "07 Apr 2015" "ntp (4.2.8p2)" "User Commands"
+.\"
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-E0ayAX/ag-R0aGzX)
+.\"
+.\" It has been AutoGen-ed April 7, 2015 at 04:21:40 AM by AutoGen 5.18.5pre4
+.\" From the definitions update-leap-opts.def
+.\" and the template file agman-cmd.tpl
+.SH NAME
+\f\*[B-Font]update-leap\fP
+\- leap-seconds file manager/updater
+.SH SYNOPSIS
+\f\*[B-Font]update-leap\fP
+.\" Mixture of short (flag) options and long options
+[\f\*[B-Font]\-flags\f[]]
+[\f\*[B-Font]\-flag\f[] [\f\*[I-Font]value\f[]]]
+[\f\*[B-Font]\-\-option-name\f[][[=| ]\f\*[I-Font]value\f[]]]
+.sp \n(Ppu
+.ne 2
+
+All arguments must be options.
+.sp \n(Ppu
+.ne 2
+
+.SH DESCRIPTION
+\f\*[B-Font]update-leap\fP
+will validate the file currently on the local system
+and if necessary, updates leap-second definition file.
+.sp \n(Ppu
+.ne 2
+
+Ordinarily, the file is found using the "leapfile" directive in
+\fCntp.conf\fR(5)\f[].
+However, an alternate location can be specified on the command line.
+.sp \n(Ppu
+.ne 2
+
+If the file does not exist, is not valid, has expired, or is expiring soon,
+a new copy will be downloaded.  If the new copy validates, it is installed and
+NTP is (optionally) restarted.
+.sp \n(Ppu
+.ne 2
+
+If the current file is acceptable, no download or restart occurs.
+.sp \n(Ppu
+.ne 2
+
+-c can also be used to invoke another script to perform administrative
+functions, e.g. to copy the file to other local systems.
+.PP
+This can be run as a cron job.  As the file is rarely updated, and leap
+seconds are announced at least one month in advance (usually longer), it
+need not be run more frequently than about once every three weeks.
+.PP
+For cron-friendly behavior, define CRONJOB=1 in the crontab.
+.PP
+This script depends on$REQUIREDCMDS
+.SH "OPTIONS"
+.TP
+.NOP \f\*[B-Font]\-s\f[] \f\*[I-Font]string\f[], \f\*[B-Font]\-\-source\-url\f[]=\f\*[I-Font]string\f[]
+The URL of the master copy of the leapseconds file.
+.sp
+Specify the URL of the master copy to download
+$LEAPSRC
+.TP
+.NOP \f\*[B-Font]\-4\f[], \f\*[B-Font]\-\-ipv4\f[]
+Use only IPv4 addresses for DNS name resolution.
+This option must not appear in combination with any of the following options:
+ipv6.
+.sp
+        Force DNS resolution of following host names on the command line
+        to the IPv4 namespace.
+        _EndOfDoc_;
+};
+.sp
+flag = {
+    name      = ipv6;
+    flags-cant = ipv4, prefer;
+    value     = 6;
+    descrip   = "Use only IPv6 addresses for DNS name resolution";
+    doc = <<-  _EndOfDoc_
+        Force DNS resolution of following host names on the command line
+        to the IPv6 namespace.
+        _EndOfDoc_;
+};
+.sp
+flag = {
+    name        = prefer;
+    flags-cant	= ipv4, ipv6;
+    value	= p;
+    arg-type    = keyword;
+    keyword	= 4, 6;
+    descrip     = 'Prefer IPv4 or IPv6 (as specified) addresses, but use either';
+    doc         = <<-  _EndOfDoc_
+Prefer IPv4 or IPv6 (as specified) addresses, but use either.
+.TP
+.NOP \f\*[B-Font]\-d\f[] \f\*[I-Font]float\f[], \f\*[B-Font]\-\-destination\f[]=\f\*[I-Font]float\f[]
+Filename on the local system.
+.sp
+The name to use to store the leapfile on the local system.
+$LEAPFILE
+.TP
+.NOP \f\*[B-Font]\-e\f[] \f\*[I-Font]string\f[], \f\*[B-Font]\-\-expiration\f[]=\f\*[I-Font]string\f[]
+Refresh the leapfile this long before it expires.
+.sp
+Specify how long before expiration the file is to be refreshed
+Units are required, e.g. "-e 60 days"  Note that larger values
+imply more frequent refreshes.
+"$PREFETCH"
+.TP
+.NOP \f\*[B-Font]\-f\f[] \f\*[I-Font]string\f[], \f\*[B-Font]\-\-ntp\-conf\-file\f[]=\f\*[I-Font]string\f[]
+Location of the ntp.conf file.
+.sp
+Specify location of ntp.conf (used to make sure leapfile directive is
+present and to default  leapfile)
+/etc/ntp.conf
+.TP
+.NOP \f\*[B-Font]\-F\f[], \f\*[B-Font]\-\-force\-update\f[]
+Force update of the leapfile.
+.sp
+Force update even if current file is OK and not close to expiring.
+.TP
+.NOP \f\*[B-Font]\-\-dont\-wait\f[]
+Don't wait for keystroke between plots.
+.sp
+.TP
+.NOP \f\*[B-Font]\-\&?\f[], \f\*[B-Font]\-\-help\f[]
+Display usage information and exit.
+.TP
+.NOP \f\*[B-Font]\-\&!\f[], \f\*[B-Font]\-\-more-help\f[]
+Pass the extended usage information through a pager.
+.TP
+.NOP \f\*[B-Font]\-v\f[] [{\f\*[I-Font]v|c|n\f[] \f\*[B-Font]\-\-version\f[] [{\f\*[I-Font]v|c|n\f[]}]}]
+Output version of program and exit.  The default mode is `v', a simple
+version.  The `c' mode will print copyright information and `n' will
+print the full copyright notice.
+.PP
+.SH USAGE
+Usage stuff
+.SH "EXIT STATUS"
+One of the following exit values will be returned:
+.TP
+.NOP 0 " (EXIT_SUCCESS)"
+Successful program execution.
+.TP
+.NOP 1 " (EXIT_FAILURE)"
+The operation failed or the command syntax was not valid.
+.TP
+.NOP 70 " (EX_SOFTWARE)"
+libopts had an internal operational error.  Please report
+it to autogen-users@lists.sourceforge.net.  Thank you.
+.PP
+.SH AUTHORS
+.NOP  "Timothe Litt" 
+.br
+.SH "NOTES"
+This manual page was \fIAutoGen\fP-erated from the \fBupdate-leap\fP
+option definitions.
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/scripts/update-leap/update-leap.1update-leapmdoc /cur/src/external/bsd/ntp/dist/scripts/update-leap/update-leap.1update-leapmdoc
--- external/bsd/ntp/dist/scripts/update-leap/update-leap.1update-leapmdoc	1969-12-31 16:00:00.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/scripts/update-leap/update-leap.1update-leapmdoc	2015-04-07 09:49:11.000000000 -0700
@@ -0,0 +1,134 @@
+.Dd April 7 2015
+.Dt UPDATE_LEAP 1update-leapmdoc User Commands
+.Os
+.\"  EDIT THIS FILE WITH CAUTION  (update-leap-opts.mdoc)
+.\"
+.\"  It has been AutoGen-ed  April  7, 2015 at 04:21:46 AM by AutoGen 5.18.5pre4
+.\"  From the definitions    update-leap-opts.def
+.\"  and the template file   agmdoc-cmd.tpl
+.Sh NAME
+.Nm update-leap
+.Nd leap-seconds file manager/updater
+.Sh SYNOPSIS
+.Nm
+.\" Mixture of short (flag) options and long options
+.Op Fl flags
+.Op Fl flag Op Ar value
+.Op Fl \-option\-name Ns Oo Oo Ns "=| " Oc Ns Ar value Oc
+.Pp
+All arguments must be options.
+.Pp
+.Sh DESCRIPTION
+.Nm
+will validate the file currently on the local system
+and if necessary, updates leap\-second definition file.
+.Pp
+Ordinarily, the file is found using the "leapfile" directive in
+.Xr ntp.conf 5 .
+However, an alternate location can be specified on the command line.
+.Pp
+If the file does not exist, is not valid, has expired, or is expiring soon,
+a new copy will be downloaded.  If the new copy validates, it is installed and
+NTP is (optionally) restarted.
+.Pp
+If the current file is acceptable, no download or restart occurs.
+.Pp
+-c can also be used to invoke another script to perform administrative
+functions, e.g. to copy the file to other local systems.
+.PP
+This can be run as a cron job.  As the file is rarely updated, and leap
+seconds are announced at least one month in advance (usually longer), it
+need not be run more frequently than about once every three weeks.
+.PP
+For cron\-friendly behavior, define CRONJOB=1 in the crontab.
+.PP
+This script depends on$REQUIREDCMDS
+.Sh "OPTIONS"
+.Bl -tag
+.It  Fl s Ar string , Fl \-source\-url Ns = Ns Ar string 
+The URL of the master copy of the leapseconds file.
+.sp
+Specify the URL of the master copy to download
+$LEAPSRC
+.It  Fl 4 , Fl \-ipv4 
+Use only IPv4 addresses for DNS name resolution.
+This option must not appear in combination with any of the following options:
+ipv6.
+.sp
+        Force DNS resolution of following host names on the command line
+        to the IPv4 namespace.
+        _EndOfDoc_;
+};
+.sp
+flag = {
+    name      = ipv6;
+    flags\-cant = ipv4, prefer;
+    value     = 6;
+    descrip   = "Use only IPv6 addresses for DNS name resolution";
+    doc = <<\-  _EndOfDoc_
+        Force DNS resolution of following host names on the command line
+        to the IPv6 namespace.
+        _EndOfDoc_;
+};
+.sp
+flag = {
+    name        = prefer;
+    flags\-cant	= ipv4, ipv6;
+    value	= p;
+    arg\-type    = keyword;
+    keyword	= 4, 6;
+    descrip     = 'Prefer IPv4 or IPv6 (as specified) addresses, but use either';
+    doc         = <<\-  _EndOfDoc_
+Prefer IPv4 or IPv6 (as specified) addresses, but use either.
+.It  Fl d Ar float , Fl \-destination Ns = Ns Ar float 
+Filename on the local system.
+.sp
+The name to use to store the leapfile on the local system.
+$LEAPFILE
+.It  Fl e Ar string , Fl \-expiration Ns = Ns Ar string 
+Refresh the leapfile this long before it expires.
+.sp
+Specify how long before expiration the file is to be refreshed
+Units are required, e.g. "\-e 60 days"  Note that larger values
+imply more frequent refreshes.
+"$PREFETCH"
+.It  Fl f Ar string , Fl \-ntp\-conf\-file Ns = Ns Ar string 
+Location of the ntp.conf file.
+.sp
+Specify location of ntp.conf (used to make sure leapfile directive is
+present and to default  leapfile)
+/etc/ntp.conf
+.It  Fl F , Fl \-force\-update 
+Force update of the leapfile.
+.sp
+Force update even if current file is OK and not close to expiring.
+.It  Fl \-dont\-wait 
+Don't wait for keystroke between plots.
+.sp
+.It Fl \&? , Fl \-help
+Display usage information and exit.
+.It Fl \&! , Fl \-more\-help
+Pass the extended usage information through a pager.
+.It Fl v Op Brq Ar v|c|n  Fl \-version Op Brq Ar v|c|n
+Output version of program and exit.  The default mode is `v', a simple
+version.  The `c' mode will print copyright information and `n' will
+print the full copyright notice.
+.El
+.Sh USAGE
+Usage stuff
+.Sh "EXIT STATUS"
+One of the following exit values will be returned:
+.Bl -tag
+.It 0 " (EXIT_SUCCESS)"
+Successful program execution.
+.It 1 " (EXIT_FAILURE)"
+The operation failed or the command syntax was not valid.
+.It 70 " (EX_SOFTWARE)"
+libopts had an internal operational error.  Please report
+it to autogen\-users@lists.sourceforge.net.  Thank you.
+.El
+.Sh AUTHORS
+.An "Timothe Litt"
+.Sh "NOTES"
+This manual page was \fIAutoGen\fP\-erated from the \fBupdate\-leap\fP
+option definitions.
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/scripts/update-leap/update-leap.html /cur/src/external/bsd/ntp/dist/scripts/update-leap/update-leap.html
--- external/bsd/ntp/dist/scripts/update-leap/update-leap.html	1969-12-31 16:00:00.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/scripts/update-leap/update-leap.html	2015-04-07 09:49:11.000000000 -0700
@@ -0,0 +1,274 @@
+<html lang="en">
+<head>
+<title>update-leap User's Manual</title>
+<meta http-equiv="Content-Type" content="text/html">
+<meta name="description" content="update-leap User's Manual">
+<meta name="generator" content="makeinfo 4.7">
+<link title="Top" rel="top" href="#Top">
+<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
+<meta http-equiv="Content-Style-Type" content="text/css">
+<style type="text/css"><!--
+  pre.display { font-family:inherit }
+  pre.format  { font-family:inherit }
+  pre.smalldisplay { font-family:inherit; font-size:smaller }
+  pre.smallformat  { font-family:inherit; font-size:smaller }
+  pre.smallexample { font-size:smaller }
+  pre.smalllisp    { font-size:smaller }
+  span.sc { font-variant:small-caps }
+  span.roman { font-family: serif; font-weight: normal; } 
+--></style>
+</head>
+<body>
+<h1 class="settitle">update-leap User's Manual</h1>
+<div class="node">
+<p><hr>
+<a name="Top"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#update_002dleap-Description">update-leap Description</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#dir">(dir)</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#dir">(dir)</a>
+<br>
+</div>
+
+  <p>This document describes the use of the NTP Project's <code>update-leap</code> program.
+
+  <p>This document applies to version 4.2.8p2 of <code>update-leap</code>.
+
+<div class="shortcontents">
+<h2>Short Contents</h2>
+<ul>
+</ul>
+</div>
+
+<ul class="menu">
+<li><a accesskey="1" href="#update_002dleap-Description">update-leap Description</a>:             Description
+<li><a accesskey="2" href="#update_002dleap-Invocation">update-leap Invocation</a>: 		Invoking update-leap
+</ul>
+
+<div class="node">
+<p><hr>
+<a name="update_002dleap-Invocation"></a>
+<br>
+</div>
+
+<h3 class="section">0.1 Invoking update-leap</h3>
+
+<p><a name="index-update_002dleap-1"></a><a name="index-leap_002dseconds-file-manager_002fupdater-2"></a>
+
+  <p><code>update-leap</code>
+will validate the file currently on the local system
+and if necessary, updates leap-second definition file.
+
+  <p>Ordinarily, the file is found using the "leapfile" directive in
+<code>ntp.conf(5)</code>. 
+However, an alternate location can be specified on the command line.
+
+  <p>If the file does not exist, is not valid, has expired, or is expiring soon,
+a new copy will be downloaded.  If the new copy validates, it is installed and
+NTP is (optionally) restarted.
+
+  <p>If the current file is acceptable, no download or restart occurs.
+
+  <p>-c can also be used to invoke another script to perform administrative
+functions, e.g. to copy the file to other local systems. 
+.PP
+This can be run as a cron job.  As the file is rarely updated, and leap
+seconds are announced at least one month in advance (usually longer), it
+need not be run more frequently than about once every three weeks. 
+.PP
+For cron-friendly behavior, define CRONJOB=1 in the crontab. 
+.PP
+This script depends on$REQUIREDCMDS
+
+  <p>This section was generated by <strong>AutoGen</strong>,
+using the <code>agtexi-cmd</code> template and the option descriptions for the <code>update-leap</code> program.
+
+<ul class="menu">
+<li><a accesskey="1" href="#update_002dleap-usage">update-leap usage</a>:                   update-leap help/usage (<span class="option">--help</span>)
+<li><a accesskey="2" href="#update_002dleap-source_002durl">update-leap source-url</a>:              source-url option (-s)
+<li><a accesskey="3" href="#update_002dleap-ipv4">update-leap ipv4</a>:                    ipv4 option (-4)
+<li><a accesskey="4" href="#update_002dleap-destination">update-leap destination</a>:             destination option (-d)
+<li><a accesskey="5" href="#update_002dleap-expiration">update-leap expiration</a>:              expiration option (-e)
+<li><a accesskey="6" href="#update_002dleap-ntp_002dconf_002dfile">update-leap ntp-conf-file</a>:           ntp-conf-file option (-f)
+<li><a accesskey="7" href="#update_002dleap-force_002dupdate">update-leap force-update</a>:            force-update option (-F)
+<li><a accesskey="8" href="#update_002dleap-exit-status">update-leap exit status</a>:             exit status
+<li><a accesskey="9" href="#update_002dleap-Usage">update-leap Usage</a>:                   Usage
+<li><a href="#update_002dleap-Authors">update-leap Authors</a>:                 Authors
+</ul>
+
+<div class="node">
+<p><hr>
+<a name="update_002dleap-usage"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#update_002dleap-source_002durl">update-leap source-url</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#update_002dleap-Invocation">update-leap Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">0.1.1 update-leap help/usage (<span class="option">--help</span>)</h4>
+
+<p><a name="index-update_002dleap-help-3"></a>
+This is the automatically generated usage text for update-leap.
+
+  <p>The text printed is the same whether selected with the <code>help</code> option
+(<span class="option">--help</span>) or the <code>more-help</code> option (<span class="option">--more-help</span>).  <code>more-help</code> will print
+the usage text by passing it through a pager program. 
+<code>more-help</code> is disabled on platforms without a working
+<code>fork(2)</code> function.  The <code>PAGER</code> environment variable is
+used to select the program, defaulting to <span class="file">more</span>.  Both will exit
+with a status code of 0.
+
+<pre class="example">/bin/bash: line 136: ./update-leap: Permission denied
+</pre>
+  <div class="node">
+<p><hr>
+<a name="update_002dleap-source_002durl"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#update_002dleap-ipv4">update-leap ipv4</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#update_002dleap-usage">update-leap usage</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#update_002dleap-Invocation">update-leap Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">0.1.2 source-url option (-s)</h4>
+
+<p><a name="index-update_002dleap_002dsource_002durl-4"></a>
+This is the &ldquo;the url of the master copy of the leapseconds file&rdquo; option. 
+This option takes a string argument. 
+Specify the URL of the master copy to download
+$LEAPSRC
+<div class="node">
+<p><hr>
+<a name="update_002dleap-ipv4"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#update_002dleap-destination">update-leap destination</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#update_002dleap-source_002durl">update-leap source-url</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#update_002dleap-Invocation">update-leap Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">0.1.3 ipv4 option (-4)</h4>
+
+<p><a name="index-update_002dleap_002dipv4-5"></a>
+This is the &ldquo;use only ipv4 addresses for dns name resolution&rdquo; option.
+
+<p class="noindent">This option has some usage constraints.  It:
+     <ul>
+<li>must not appear in combination with any of the following options:
+ipv6. 
+</ul>
+
+  <p>Force DNS resolution of following host names on the command line
+        to the IPv4 namespace. 
+        _EndOfDoc_;
+;
+
+  <p>flag = 
+    name      = ipv6;
+    flags-cant = ipv4, prefer;
+    value     = 6;
+    descrip   = "Use only IPv6 addresses for DNS name resolution";
+    doc = &lt;&lt;-  _EndOfDoc_
+        Force DNS resolution of following host names on the command line
+        to the IPv6 namespace. 
+        _EndOfDoc_;
+;
+
+  <p>flag = 
+    name        = prefer;
+    flags-cant	= ipv4, ipv6;
+    value	= p;
+    arg-type    = keyword;
+    keyword	= 4, 6;
+    descrip     = 'Prefer IPv4 or IPv6 (as specified) addresses, but use either';
+    doc         = &lt;&lt;-  _EndOfDoc_
+Prefer IPv4 or IPv6 (as specified) addresses, but use either. 
+<div class="node">
+<p><hr>
+<a name="update_002dleap-destination"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#update_002dleap-expiration">update-leap expiration</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#update_002dleap-ipv4">update-leap ipv4</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#update_002dleap-Invocation">update-leap Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">0.1.4 destination option (-d)</h4>
+
+<p><a name="index-update_002dleap_002ddestination-6"></a>
+This is the &ldquo;filename on the local system&rdquo; option. 
+This option takes a string argument <span class="file">float</span>. 
+The name to use to store the leapfile on the local system. 
+$LEAPFILE
+<div class="node">
+<p><hr>
+<a name="update_002dleap-expiration"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#update_002dleap-ntp_002dconf_002dfile">update-leap ntp-conf-file</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#update_002dleap-destination">update-leap destination</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#update_002dleap-Invocation">update-leap Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">0.1.5 expiration option (-e)</h4>
+
+<p><a name="index-update_002dleap_002dexpiration-7"></a>
+This is the &ldquo;refresh the leapfile this long before it expires&rdquo; option. 
+This option takes a string argument. 
+Specify how long before expiration the file is to be refreshed
+Units are required, e.g. "-e 60 days"  Note that larger values
+imply more frequent refreshes. 
+"$PREFETCH"
+<div class="node">
+<p><hr>
+<a name="update_002dleap-ntp_002dconf_002dfile"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#update_002dleap-force_002dupdate">update-leap force-update</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#update_002dleap-expiration">update-leap expiration</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#update_002dleap-Invocation">update-leap Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">0.1.6 ntp-conf-file option (-f)</h4>
+
+<p><a name="index-update_002dleap_002dntp_002dconf_002dfile-8"></a>
+This is the &ldquo;location of the ntp.conf file&rdquo; option. 
+This option takes a string argument. 
+Specify location of ntp.conf (used to make sure leapfile directive is
+present and to default  leapfile)
+/etc/ntp.conf
+<div class="node">
+<p><hr>
+<a name="update_002dleap-force_002dupdate"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#update_002dleap-exit-status">update-leap exit status</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#update_002dleap-ntp_002dconf_002dfile">update-leap ntp-conf-file</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#update_002dleap-Invocation">update-leap Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">0.1.7 force-update option (-F)</h4>
+
+<p><a name="index-update_002dleap_002dforce_002dupdate-9"></a>
+This is the &ldquo;force update of the leapfile&rdquo; option. 
+Force update even if current file is OK and not close to expiring. 
+<div class="node">
+<p><hr>
+<a name="update_002dleap-exit-status"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#update_002dleap-Usage">update-leap Usage</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#update_002dleap-force_002dupdate">update-leap force-update</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#update_002dleap-Invocation">update-leap Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">0.1.8 update-leap exit status</h4>
+
+<p>One of the following exit values will be returned:
+     <dl>
+<dt><span class="samp">0 (EXIT_SUCCESS)</span><dd>Successful program execution. 
+<br><dt><span class="samp">1 (EXIT_FAILURE)</span><dd>The operation failed or the command syntax was not valid. 
+</dl>
+  <div class="node">
+<p><hr>
+<a name="update_002dleap-Usage"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#update_002dleap-Authors">update-leap Authors</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#update_002dleap-exit-status">update-leap exit status</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#update_002dleap-Invocation">update-leap Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">0.1.9 update-leap Usage</h4>
+
+<div class="node">
+<p><hr>
+<a name="update_002dleap-Authors"></a>Previous:&nbsp;<a rel="previous" accesskey="p" href="#update_002dleap-Usage">update-leap Usage</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#update_002dleap-Invocation">update-leap Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">0.1.10 update-leap Authors</h4>
+
+</body></html>
+
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/scripts/update-leap/update-leap.man.in /cur/src/external/bsd/ntp/dist/scripts/update-leap/update-leap.man.in
--- external/bsd/ntp/dist/scripts/update-leap/update-leap.man.in	1969-12-31 16:00:00.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/scripts/update-leap/update-leap.man.in	2015-04-07 09:49:11.000000000 -0700
@@ -0,0 +1,169 @@
+.de1 NOP
+.  it 1 an-trap
+.  if \\n[.$] \,\\$*\/
+..
+.ie t \
+.ds B-Font [CB]
+.ds I-Font [CI]
+.ds R-Font [CR]
+.el \
+.ds B-Font B
+.ds I-Font I
+.ds R-Font R
+.TH update-leap 1update-leapman "07 Apr 2015" "ntp (4.2.8p2)" "User Commands"
+.\"
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-E0ayAX/ag-R0aGzX)
+.\"
+.\" It has been AutoGen-ed April 7, 2015 at 04:21:40 AM by AutoGen 5.18.5pre4
+.\" From the definitions update-leap-opts.def
+.\" and the template file agman-cmd.tpl
+.SH NAME
+\f\*[B-Font]update-leap\fP
+\- leap-seconds file manager/updater
+.SH SYNOPSIS
+\f\*[B-Font]update-leap\fP
+.\" Mixture of short (flag) options and long options
+[\f\*[B-Font]\-flags\f[]]
+[\f\*[B-Font]\-flag\f[] [\f\*[I-Font]value\f[]]]
+[\f\*[B-Font]\-\-option-name\f[][[=| ]\f\*[I-Font]value\f[]]]
+.sp \n(Ppu
+.ne 2
+
+All arguments must be options.
+.sp \n(Ppu
+.ne 2
+
+.SH DESCRIPTION
+\f\*[B-Font]update-leap\fP
+will validate the file currently on the local system
+and if necessary, updates leap-second definition file.
+.sp \n(Ppu
+.ne 2
+
+Ordinarily, the file is found using the "leapfile" directive in
+\fCntp.conf\fR(5)\f[].
+However, an alternate location can be specified on the command line.
+.sp \n(Ppu
+.ne 2
+
+If the file does not exist, is not valid, has expired, or is expiring soon,
+a new copy will be downloaded.  If the new copy validates, it is installed and
+NTP is (optionally) restarted.
+.sp \n(Ppu
+.ne 2
+
+If the current file is acceptable, no download or restart occurs.
+.sp \n(Ppu
+.ne 2
+
+-c can also be used to invoke another script to perform administrative
+functions, e.g. to copy the file to other local systems.
+.PP
+This can be run as a cron job.  As the file is rarely updated, and leap
+seconds are announced at least one month in advance (usually longer), it
+need not be run more frequently than about once every three weeks.
+.PP
+For cron-friendly behavior, define CRONJOB=1 in the crontab.
+.PP
+This script depends on$REQUIREDCMDS
+.SH "OPTIONS"
+.TP
+.NOP \f\*[B-Font]\-s\f[] \f\*[I-Font]string\f[], \f\*[B-Font]\-\-source\-url\f[]=\f\*[I-Font]string\f[]
+The URL of the master copy of the leapseconds file.
+.sp
+Specify the URL of the master copy to download
+$LEAPSRC
+.TP
+.NOP \f\*[B-Font]\-4\f[], \f\*[B-Font]\-\-ipv4\f[]
+Use only IPv4 addresses for DNS name resolution.
+This option must not appear in combination with any of the following options:
+ipv6.
+.sp
+        Force DNS resolution of following host names on the command line
+        to the IPv4 namespace.
+        _EndOfDoc_;
+};
+.sp
+flag = {
+    name      = ipv6;
+    flags-cant = ipv4, prefer;
+    value     = 6;
+    descrip   = "Use only IPv6 addresses for DNS name resolution";
+    doc = <<-  _EndOfDoc_
+        Force DNS resolution of following host names on the command line
+        to the IPv6 namespace.
+        _EndOfDoc_;
+};
+.sp
+flag = {
+    name        = prefer;
+    flags-cant	= ipv4, ipv6;
+    value	= p;
+    arg-type    = keyword;
+    keyword	= 4, 6;
+    descrip     = 'Prefer IPv4 or IPv6 (as specified) addresses, but use either';
+    doc         = <<-  _EndOfDoc_
+Prefer IPv4 or IPv6 (as specified) addresses, but use either.
+.TP
+.NOP \f\*[B-Font]\-d\f[] \f\*[I-Font]float\f[], \f\*[B-Font]\-\-destination\f[]=\f\*[I-Font]float\f[]
+Filename on the local system.
+.sp
+The name to use to store the leapfile on the local system.
+$LEAPFILE
+.TP
+.NOP \f\*[B-Font]\-e\f[] \f\*[I-Font]string\f[], \f\*[B-Font]\-\-expiration\f[]=\f\*[I-Font]string\f[]
+Refresh the leapfile this long before it expires.
+.sp
+Specify how long before expiration the file is to be refreshed
+Units are required, e.g. "-e 60 days"  Note that larger values
+imply more frequent refreshes.
+"$PREFETCH"
+.TP
+.NOP \f\*[B-Font]\-f\f[] \f\*[I-Font]string\f[], \f\*[B-Font]\-\-ntp\-conf\-file\f[]=\f\*[I-Font]string\f[]
+Location of the ntp.conf file.
+.sp
+Specify location of ntp.conf (used to make sure leapfile directive is
+present and to default  leapfile)
+/etc/ntp.conf
+.TP
+.NOP \f\*[B-Font]\-F\f[], \f\*[B-Font]\-\-force\-update\f[]
+Force update of the leapfile.
+.sp
+Force update even if current file is OK and not close to expiring.
+.TP
+.NOP \f\*[B-Font]\-\-dont\-wait\f[]
+Don't wait for keystroke between plots.
+.sp
+.TP
+.NOP \f\*[B-Font]\-\&?\f[], \f\*[B-Font]\-\-help\f[]
+Display usage information and exit.
+.TP
+.NOP \f\*[B-Font]\-\&!\f[], \f\*[B-Font]\-\-more-help\f[]
+Pass the extended usage information through a pager.
+.TP
+.NOP \f\*[B-Font]\-v\f[] [{\f\*[I-Font]v|c|n\f[] \f\*[B-Font]\-\-version\f[] [{\f\*[I-Font]v|c|n\f[]}]}]
+Output version of program and exit.  The default mode is `v', a simple
+version.  The `c' mode will print copyright information and `n' will
+print the full copyright notice.
+.PP
+.SH USAGE
+Usage stuff
+.SH "EXIT STATUS"
+One of the following exit values will be returned:
+.TP
+.NOP 0 " (EXIT_SUCCESS)"
+Successful program execution.
+.TP
+.NOP 1 " (EXIT_FAILURE)"
+The operation failed or the command syntax was not valid.
+.TP
+.NOP 70 " (EX_SOFTWARE)"
+libopts had an internal operational error.  Please report
+it to autogen-users@lists.sourceforge.net.  Thank you.
+.PP
+.SH AUTHORS
+.NOP  "Timothe Litt" 
+.br
+.SH "NOTES"
+This manual page was \fIAutoGen\fP-erated from the \fBupdate-leap\fP
+option definitions.
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/scripts/update-leap/update-leap.mdoc.in /cur/src/external/bsd/ntp/dist/scripts/update-leap/update-leap.mdoc.in
--- external/bsd/ntp/dist/scripts/update-leap/update-leap.mdoc.in	1969-12-31 16:00:00.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/scripts/update-leap/update-leap.mdoc.in	2015-04-07 09:49:11.000000000 -0700
@@ -0,0 +1,134 @@
+.Dd April 7 2015
+.Dt UPDATE_LEAP 1update-leapmdoc User Commands
+.Os
+.\"  EDIT THIS FILE WITH CAUTION  (update-leap-opts.mdoc)
+.\"
+.\"  It has been AutoGen-ed  April  7, 2015 at 04:21:46 AM by AutoGen 5.18.5pre4
+.\"  From the definitions    update-leap-opts.def
+.\"  and the template file   agmdoc-cmd.tpl
+.Sh NAME
+.Nm update-leap
+.Nd leap-seconds file manager/updater
+.Sh SYNOPSIS
+.Nm
+.\" Mixture of short (flag) options and long options
+.Op Fl flags
+.Op Fl flag Op Ar value
+.Op Fl \-option\-name Ns Oo Oo Ns "=| " Oc Ns Ar value Oc
+.Pp
+All arguments must be options.
+.Pp
+.Sh DESCRIPTION
+.Nm
+will validate the file currently on the local system
+and if necessary, updates leap\-second definition file.
+.Pp
+Ordinarily, the file is found using the "leapfile" directive in
+.Xr ntp.conf 5 .
+However, an alternate location can be specified on the command line.
+.Pp
+If the file does not exist, is not valid, has expired, or is expiring soon,
+a new copy will be downloaded.  If the new copy validates, it is installed and
+NTP is (optionally) restarted.
+.Pp
+If the current file is acceptable, no download or restart occurs.
+.Pp
+-c can also be used to invoke another script to perform administrative
+functions, e.g. to copy the file to other local systems.
+.PP
+This can be run as a cron job.  As the file is rarely updated, and leap
+seconds are announced at least one month in advance (usually longer), it
+need not be run more frequently than about once every three weeks.
+.PP
+For cron\-friendly behavior, define CRONJOB=1 in the crontab.
+.PP
+This script depends on$REQUIREDCMDS
+.Sh "OPTIONS"
+.Bl -tag
+.It  Fl s Ar string , Fl \-source\-url Ns = Ns Ar string 
+The URL of the master copy of the leapseconds file.
+.sp
+Specify the URL of the master copy to download
+$LEAPSRC
+.It  Fl 4 , Fl \-ipv4 
+Use only IPv4 addresses for DNS name resolution.
+This option must not appear in combination with any of the following options:
+ipv6.
+.sp
+        Force DNS resolution of following host names on the command line
+        to the IPv4 namespace.
+        _EndOfDoc_;
+};
+.sp
+flag = {
+    name      = ipv6;
+    flags\-cant = ipv4, prefer;
+    value     = 6;
+    descrip   = "Use only IPv6 addresses for DNS name resolution";
+    doc = <<\-  _EndOfDoc_
+        Force DNS resolution of following host names on the command line
+        to the IPv6 namespace.
+        _EndOfDoc_;
+};
+.sp
+flag = {
+    name        = prefer;
+    flags\-cant	= ipv4, ipv6;
+    value	= p;
+    arg\-type    = keyword;
+    keyword	= 4, 6;
+    descrip     = 'Prefer IPv4 or IPv6 (as specified) addresses, but use either';
+    doc         = <<\-  _EndOfDoc_
+Prefer IPv4 or IPv6 (as specified) addresses, but use either.
+.It  Fl d Ar float , Fl \-destination Ns = Ns Ar float 
+Filename on the local system.
+.sp
+The name to use to store the leapfile on the local system.
+$LEAPFILE
+.It  Fl e Ar string , Fl \-expiration Ns = Ns Ar string 
+Refresh the leapfile this long before it expires.
+.sp
+Specify how long before expiration the file is to be refreshed
+Units are required, e.g. "\-e 60 days"  Note that larger values
+imply more frequent refreshes.
+"$PREFETCH"
+.It  Fl f Ar string , Fl \-ntp\-conf\-file Ns = Ns Ar string 
+Location of the ntp.conf file.
+.sp
+Specify location of ntp.conf (used to make sure leapfile directive is
+present and to default  leapfile)
+/etc/ntp.conf
+.It  Fl F , Fl \-force\-update 
+Force update of the leapfile.
+.sp
+Force update even if current file is OK and not close to expiring.
+.It  Fl \-dont\-wait 
+Don't wait for keystroke between plots.
+.sp
+.It Fl \&? , Fl \-help
+Display usage information and exit.
+.It Fl \&! , Fl \-more\-help
+Pass the extended usage information through a pager.
+.It Fl v Op Brq Ar v|c|n  Fl \-version Op Brq Ar v|c|n
+Output version of program and exit.  The default mode is `v', a simple
+version.  The `c' mode will print copyright information and `n' will
+print the full copyright notice.
+.El
+.Sh USAGE
+Usage stuff
+.Sh "EXIT STATUS"
+One of the following exit values will be returned:
+.Bl -tag
+.It 0 " (EXIT_SUCCESS)"
+Successful program execution.
+.It 1 " (EXIT_FAILURE)"
+The operation failed or the command syntax was not valid.
+.It 70 " (EX_SOFTWARE)"
+libopts had an internal operational error.  Please report
+it to autogen\-users@lists.sourceforge.net.  Thank you.
+.El
+.Sh AUTHORS
+.An "Timothe Litt"
+.Sh "NOTES"
+This manual page was \fIAutoGen\fP\-erated from the \fBupdate\-leap\fP
+option definitions.
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/scripts/update-leap/update-leap.texi /cur/src/external/bsd/ntp/dist/scripts/update-leap/update-leap.texi
--- external/bsd/ntp/dist/scripts/update-leap/update-leap.texi	1969-12-31 16:00:00.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/scripts/update-leap/update-leap.texi	2015-04-07 09:49:11.000000000 -0700
@@ -0,0 +1,43 @@
+\input texinfo    @c -*-texinfo-*-
+@c %**start of header
+@setfilename update-leap.info
+@settitle update-leap User's Manual
+@include ../../sntp/include/version.texi
+@paragraphindent 2
+@c %**end of header
+
+@ifinfo
+This file documents the use of @code{update-leap},
+a program from
+the NTP Project,
+that is used to wait until @code{ntpd} has been able to
+synchronize and stabilize the time on the current host.
+@end ifinfo
+
+@direntry
+* update-leap: (update-leap).                 Check the leapfile and update it if needed.
+@end direntry
+
+@titlepage
+@title update-leap User's Manual
+@subtitle update-leap, version @value{VERSION}, @value{UPDATED}
+@c @author Max @email{foo@ntp.org}
+@end titlepage
+
+@c @page
+@c @vskip 0pt plus 1filll
+
+@node Top, update-leap Description, (dir), (dir)
+
+This document describes the use of the NTP Project's @code{update-leap} program.
+
+This document applies to version @value{VERSION} of @code{update-leap}.
+
+@shortcontents
+
+@menu
+* update-leap Description::            Description
+* update-leap Invocation::		Invoking update-leap
+@end menu
+
+@include invoke-update-leap.texi
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/sntp/COPYRIGHT /cur/src/external/bsd/ntp/dist/sntp/COPYRIGHT
--- external/bsd/ntp/dist/sntp/COPYRIGHT	2014-12-19 12:37:43.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/sntp/COPYRIGHT	2015-04-07 19:51:17.000000000 -0700
@@ -4,16 +4,16 @@
   
    jpg "Clone me," says Dolly sheepishly.
    
-   Last update: 9-Aug-2014 07:56 UTC
+   Last update: 17-Jan-2015 00:16 UTC
      _________________________________________________________________
    
    The following copyright notice applies to all files collectively
    called the Network Time Protocol Version 4 Distribution. Unless
-   specifically declared otherwise in an individual file, this notice
-   applies as if the text was explicitly included in the file.
+   specifically declared otherwise in an individual file, this entire
+   notice applies as if the text was explicitly included in the file.
 ***********************************************************************
 *                                                                     *
-* Copyright (c) University of Delaware 1992-2014                      *
+* Copyright (c) University of Delaware 1992-2015                      *
 *                                                                     *
 * Permission to use, copy, modify, and distribute this software and   *
 * its documentation for any purpose with or without fee is hereby     *
@@ -29,6 +29,38 @@
 *                                                                     *
 ***********************************************************************
 
+   Content starting in 2011 from Harlan Stenn, Danny Mayer, and Martin
+   Burnicki is:
+***********************************************************************
+*                                                                     *
+* Copyright (c) Network Time Foundation 2011-2015                     *
+*                                                                     *
+* All Rights Reserved                                                 *
+*                                                                     *
+* Redistribution and use in source and binary forms, with or without  *
+* modification, are permitted provided that the following conditions  *
+* are met:                                                            *
+* 1. Redistributions of source code must retain the above copyright   *
+*    notice, this list of conditions and the following disclaimer.    *
+* 2. Redistributions in binary form must reproduce the above          *
+*    copyright notice, this list of conditions and the following      *
+*    disclaimer in the documentation and/or other materials provided  *
+*    with the distribution.                                           *
+*                                                                     *
+* THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS  *
+* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED   *
+* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE  *
+* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE    *
+* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR *
+* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT   *
+* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR  *
+* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF          *
+* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT           *
+* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE   *
+* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH    *
+* DAMAGE.                                                             *
+***********************************************************************
+
    The following individuals contributed in part to the Network Time
    Protocol Distribution Version 4 and are acknowledged as authors of
    this work.
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/sntp/Makefile.am /cur/src/external/bsd/ntp/dist/sntp/Makefile.am
--- external/bsd/ntp/dist/sntp/Makefile.am	2014-12-19 12:37:43.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/sntp/Makefile.am	2015-04-07 19:51:17.000000000 -0700
@@ -56,21 +56,22 @@
 SUBDIRS = include scripts
 DIST_SUBDIRS = include scripts
 
-if BUILD_SNTP
-noinst_LIBRARIES = libsntp.a
 if BUILD_LIBEVENT
 SUBDIRS += libevent
 DIST_SUBDIRS += libevent
 endif
-if GTEST_AVAILABLE
-SUBDIRS += tests
-endif
-endif
 
 if NEED_LIBOPTS
 SUBDIRS += libopts
 endif
 
+if BUILD_SNTP
+noinst_LIBRARIES = libsntp.a
+if GTEST_AVAILABLE
+SUBDIRS += tests
+endif
+endif
+
 DIST_SUBDIRS += libopts tests
 
 libsntp_a_SOURCES =		\
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/sntp/Makefile.in /cur/src/external/bsd/ntp/dist/sntp/Makefile.in
--- external/bsd/ntp/dist/sntp/Makefile.in	2014-12-19 12:37:44.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/sntp/Makefile.in	2015-04-07 19:51:17.000000000 -0700
@@ -42,10 +42,10 @@
 build_triplet = @build@
 host_triplet = @host@
 EXTRA_PROGRAMS = sntp$(EXEEXT)
-@BUILD_LIBEVENT_TRUE@@BUILD_SNTP_TRUE@am__append_1 = libevent
-@BUILD_LIBEVENT_TRUE@@BUILD_SNTP_TRUE@am__append_2 = libevent
-@BUILD_SNTP_TRUE@@GTEST_AVAILABLE_TRUE@am__append_3 = tests
-@NEED_LIBOPTS_TRUE@am__append_4 = libopts
+@BUILD_LIBEVENT_TRUE@am__append_1 = libevent
+@BUILD_LIBEVENT_TRUE@am__append_2 = libevent
+@NEED_LIBOPTS_TRUE@am__append_3 = libopts
+@BUILD_SNTP_TRUE@@GTEST_AVAILABLE_TRUE@am__append_4 = tests
 DIST_COMMON = $(am__configure_deps) $(noinst_HEADERS) \
 	$(srcdir)/Makefile.am $(srcdir)/Makefile.in \
 	$(srcdir)/config.h.in $(top_srcdir)/bincheck.mf \
@@ -61,8 +61,6 @@
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/libopts/m4/libopts.m4 \
 	$(top_srcdir)/libopts/m4/stdnoreturn.m4 \
-	$(top_srcdir)/libevent/m4/openldap-thread-check.m4 \
-	$(top_srcdir)/libevent/m4/openldap.m4 \
 	$(top_srcdir)/m4/hms_search_lib.m4 $(top_srcdir)/m4/libtool.m4 \
 	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
 	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
@@ -82,8 +80,10 @@
 	$(top_srcdir)/m4/ntp_prog_cc.m4 $(top_srcdir)/m4/ntp_sntp.m4 \
 	$(top_srcdir)/m4/ntp_sysexits.m4 \
 	$(top_srcdir)/m4/ntp_ver_suffix.m4 \
-	$(top_srcdir)/m4/os_cflags.m4 $(top_srcdir)/m4/snprintf.m4 \
-	$(top_srcdir)/m4/version.m4 $(top_srcdir)/configure.ac
+	$(top_srcdir)/m4/openldap-thread-check.m4 \
+	$(top_srcdir)/m4/openldap.m4 $(top_srcdir)/m4/os_cflags.m4 \
+	$(top_srcdir)/m4/snprintf.m4 $(top_srcdir)/m4/version.m4 \
+	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
 am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
@@ -278,6 +278,7 @@
 LD = @LD@
 LDADD_LIBEVENT = @LDADD_LIBEVENT@
 LDADD_LIBNTP = @LDADD_LIBNTP@
+LDADD_LIBUTIL = @LDADD_LIBUTIL@
 LDADD_NTP = @LDADD_NTP@
 LDFLAGS = @LDFLAGS@
 LDFLAGS_NTP = @LDFLAGS_NTP@
@@ -393,6 +394,11 @@
 TIMETRIM_DS = @TIMETRIM_DS@
 TIMETRIM_MS = @TIMETRIM_MS@
 TIMETRIM_NI = @TIMETRIM_NI@
+UPDATE_LEAP_DB = @UPDATE_LEAP_DB@
+UPDATE_LEAP_DL = @UPDATE_LEAP_DL@
+UPDATE_LEAP_DS = @UPDATE_LEAP_DS@
+UPDATE_LEAP_MS = @UPDATE_LEAP_MS@
+UPDATE_LEAP_NI = @UPDATE_LEAP_NI@
 VERSION = @VERSION@
 VER_SUFFIX = @VER_SUFFIX@
 abs_builddir = @abs_builddir@
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/sntp/aclocal.m4 /cur/src/external/bsd/ntp/dist/sntp/aclocal.m4
--- external/bsd/ntp/dist/sntp/aclocal.m4	2014-12-19 12:37:45.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/sntp/aclocal.m4	2015-04-07 19:51:17.000000000 -0700
@@ -1132,8 +1132,6 @@
 
 m4_include([libopts/m4/libopts.m4])
 m4_include([libopts/m4/stdnoreturn.m4])
-m4_include([libevent/m4/openldap-thread-check.m4])
-m4_include([libevent/m4/openldap.m4])
 m4_include([m4/hms_search_lib.m4])
 m4_include([m4/libtool.m4])
 m4_include([m4/ltoptions.m4])
@@ -1159,5 +1157,7 @@
 m4_include([m4/ntp_sntp.m4])
 m4_include([m4/ntp_sysexits.m4])
 m4_include([m4/ntp_ver_suffix.m4])
+m4_include([m4/openldap-thread-check.m4])
+m4_include([m4/openldap.m4])
 m4_include([m4/os_cflags.m4])
 m4_include([m4/snprintf.m4])
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/sntp/config.h.in /cur/src/external/bsd/ntp/dist/sntp/config.h.in
--- external/bsd/ntp/dist/sntp/config.h.in	2013-12-27 15:31:10.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/sntp/config.h.in	2015-04-07 19:51:17.000000000 -0700
@@ -835,6 +835,9 @@
 /* What type to use for setsockopt */
 #undef TYPEOF_IP_MULTICAST_LOOP
 
+/* OK to use snprintb()? */
+#undef USE_SNPRINTB
+
 /* Can we use SIGPOLL for tty IO? */
 #undef USE_TTY_SIGPOLL
 
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/sntp/configure /cur/src/external/bsd/ntp/dist/sntp/configure
--- external/bsd/ntp/dist/sntp/configure	2014-12-19 12:37:44.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/sntp/configure	2015-04-07 19:51:18.000000000 -0700
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.68 for sntp 4.2.8.
+# Generated by GNU Autoconf 2.68 for sntp 4.2.8p2.
 #
 # Report bugs to <http://bugs.ntp.org./>.
 #
@@ -570,8 +570,8 @@
 # Identity of this package.
 PACKAGE_NAME='sntp'
 PACKAGE_TARNAME='sntp'
-PACKAGE_VERSION='4.2.8'
-PACKAGE_STRING='sntp 4.2.8'
+PACKAGE_VERSION='4.2.8p2'
+PACKAGE_STRING='sntp 4.2.8p2'
 PACKAGE_BUGREPORT='http://bugs.ntp.org./'
 PACKAGE_URL='http://www.ntp.org./'
 
@@ -676,6 +676,7 @@
 LIBISC_PTHREADS_NOTHREADS
 PTHREAD_LIBS
 HAVE_INLINE
+LDADD_LIBUTIL
 ALLOCA
 LIBM
 EDITLINE_LIBS
@@ -685,6 +686,13 @@
 LDADD_LIBNTP
 NTP_CROSSCOMPILE_FALSE
 NTP_CROSSCOMPILE_TRUE
+INSTALL_UPDATE_LEAP_FALSE
+INSTALL_UPDATE_LEAP_TRUE
+UPDATE_LEAP_NI
+UPDATE_LEAP_MS
+UPDATE_LEAP_DS
+UPDATE_LEAP_DL
+UPDATE_LEAP_DB
 TIMETRIM_NI
 TIMETRIM_MS
 TIMETRIM_DS
@@ -1456,7 +1464,7 @@
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures sntp 4.2.8 to adapt to many kinds of systems.
+\`configure' configures sntp 4.2.8p2 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1526,7 +1534,7 @@
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of sntp 4.2.8:";;
+     short | recursive ) echo "Configuration of sntp 4.2.8p2:";;
    esac
   cat <<\_ACEOF
 
@@ -1669,7 +1677,7 @@
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-sntp configure 4.2.8
+sntp configure 4.2.8p2
 generated by GNU Autoconf 2.68
 
 Copyright (C) 2010 Free Software Foundation, Inc.
@@ -2494,7 +2502,7 @@
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by sntp $as_me 4.2.8, which was
+It was created by sntp $as_me 4.2.8p2, which was
 generated by GNU Autoconf 2.68.  Invocation command line was
 
   $ $0 $@
@@ -3437,7 +3445,7 @@
 
 # Define the identity of the package.
  PACKAGE='sntp'
- VERSION='4.2.8'
+ VERSION='4.2.8p2'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -5220,6 +5228,183 @@
 fi
 
 
+   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C99" >&5
+$as_echo_n "checking for $CC option to accept ISO C99... " >&6; }
+if ${ac_cv_prog_cc_c99+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_prog_cc_c99=no
+ac_save_CC=$CC
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdarg.h>
+#include <stdbool.h>
+#include <stdlib.h>
+#include <wchar.h>
+#include <stdio.h>
+
+// Check varargs macros.  These examples are taken from C99 6.10.3.5.
+#define debug(...) fprintf (stderr, __VA_ARGS__)
+#define showlist(...) puts (#__VA_ARGS__)
+#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__))
+static void
+test_varargs_macros (void)
+{
+  int x = 1234;
+  int y = 5678;
+  debug ("Flag");
+  debug ("X = %d\n", x);
+  showlist (The first, second, and third items.);
+  report (x>y, "x is %d but y is %d", x, y);
+}
+
+// Check long long types.
+#define BIG64 18446744073709551615ull
+#define BIG32 4294967295ul
+#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0)
+#if !BIG_OK
+  your preprocessor is broken;
+#endif
+#if BIG_OK
+#else
+  your preprocessor is broken;
+#endif
+static long long int bignum = -9223372036854775807LL;
+static unsigned long long int ubignum = BIG64;
+
+struct incomplete_array
+{
+  int datasize;
+  double data[];
+};
+
+struct named_init {
+  int number;
+  const wchar_t *name;
+  double average;
+};
+
+typedef const char *ccp;
+
+static inline int
+test_restrict (ccp restrict text)
+{
+  // See if C++-style comments work.
+  // Iterate through items via the restricted pointer.
+  // Also check for declarations in for loops.
+  for (unsigned int i = 0; *(text+i) != '\0'; ++i)
+    continue;
+  return 0;
+}
+
+// Check varargs and va_copy.
+static void
+test_varargs (const char *format, ...)
+{
+  va_list args;
+  va_start (args, format);
+  va_list args_copy;
+  va_copy (args_copy, args);
+
+  const char *str;
+  int number;
+  float fnumber;
+
+  while (*format)
+    {
+      switch (*format++)
+	{
+	case 's': // string
+	  str = va_arg (args_copy, const char *);
+	  break;
+	case 'd': // int
+	  number = va_arg (args_copy, int);
+	  break;
+	case 'f': // float
+	  fnumber = va_arg (args_copy, double);
+	  break;
+	default:
+	  break;
+	}
+    }
+  va_end (args_copy);
+  va_end (args);
+}
+
+int
+main ()
+{
+
+  // Check bool.
+  _Bool success = false;
+
+  // Check restrict.
+  if (test_restrict ("String literal") == 0)
+    success = true;
+  char *restrict newvar = "Another string";
+
+  // Check varargs.
+  test_varargs ("s, d' f .", "string", 65, 34.234);
+  test_varargs_macros ();
+
+  // Check flexible array members.
+  struct incomplete_array *ia =
+    malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10));
+  ia->datasize = 10;
+  for (int i = 0; i < ia->datasize; ++i)
+    ia->data[i] = i * 1.234;
+
+  // Check named initializers.
+  struct named_init ni = {
+    .number = 34,
+    .name = L"Test wide string",
+    .average = 543.34343,
+  };
+
+  ni.number = 58;
+
+  int dynamic_array[ni.number];
+  dynamic_array[ni.number - 1] = 543;
+
+  // work around unused variable warnings
+  return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x'
+	  || dynamic_array[ni.number - 1] != 543);
+
+  ;
+  return 0;
+}
+_ACEOF
+for ac_arg in '' -std=gnu99 -std=c99 -c99 -AC99 -xc99=all -qlanglvl=extc99
+do
+  CC="$ac_save_CC $ac_arg"
+  if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_c99=$ac_arg
+fi
+rm -f core conftest.err conftest.$ac_objext
+  test "x$ac_cv_prog_cc_c99" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c99" in
+  x)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+  xno)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+  *)
+    CC="$CC $ac_cv_prog_cc_c99"
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5
+$as_echo "$ac_cv_prog_cc_c99" >&6; } ;;
+esac
+if test "x$ac_cv_prog_cc_c99" != xno; then :
+
+fi
+
+
 
 
 
@@ -5953,6 +6138,7 @@
 
 
 
+
 CFLAGS_NTP=
 CPPFLAGS_NTP=
 LDADD_NTP=
@@ -6853,6 +7039,19 @@
 
 
 
+ if test -z "$UPDATE_LEAP_NI" ; then
+  INSTALL_UPDATE_LEAP_TRUE=
+  INSTALL_UPDATE_LEAP_FALSE='#'
+else
+  INSTALL_UPDATE_LEAP_TRUE='#'
+  INSTALL_UPDATE_LEAP_FALSE=
+fi
+
+
+
+
+
+
 
 
 # Expose a cross-compilation indicator to makefiles
@@ -8916,6 +9115,73 @@
 done
 
 
+# Bug 2713
+LDADD_LIBUTIL=
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing snprintb" >&5
+$as_echo_n "checking for library containing snprintb... " >&6; }
+if ${ac_cv_search_snprintb+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char snprintb ();
+int
+main ()
+{
+return snprintb ();
+  ;
+  return 0;
+}
+_ACEOF
+for ac_lib in '' util; do
+  if test -z "$ac_lib"; then
+    ac_res="none required"
+  else
+    ac_res=-l$ac_lib
+    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+  fi
+  if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_search_snprintb=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext
+  if ${ac_cv_search_snprintb+:} false; then :
+  break
+fi
+done
+if ${ac_cv_search_snprintb+:} false; then :
+
+else
+  ac_cv_search_snprintb=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_snprintb" >&5
+$as_echo "$ac_cv_search_snprintb" >&6; }
+ac_res=$ac_cv_search_snprintb
+if test "$ac_res" != no; then :
+  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+  case "$ac_cv_search_snprintb" in
+ 'none required') ;;
+ no) ;;
+ *) LDADD_LIBUTIL="$ac_cv_search_snprintb $LDADD_LIBUTIL" ;;
+ esac
+
+$as_echo "#define USE_SNPRINTB 1" >>confdefs.h
+
+fi
+
+
 #
 for ac_header in errno.h sys/socket.h sys/types.h time.h
 do :
@@ -24350,6 +24616,13 @@
   # end of AC_DEFUN of LIBOPTS_CHECK
 
 
+# From when we only used libevent for sntp:
+#AM_COND_IF(
+#    [BUILD_SNTP],
+#    [NTP_LIBEVENT_CHECK],
+#    [NTP_LIBEVENT_CHECK_NOBUILD]
+#)
+
 
 
 ntp_pkgconfig_min_version='0.15.0'
@@ -24485,13 +24758,11 @@
 
 
 
-    if test -z "$BUILD_SNTP_TRUE"; then :
 
 
 
 
-
-ntp_libevent_min_version=2.0.9
+ntp_libevent_min_version=2
 ntp_libevent_tearoff=libevent
 
 
@@ -24601,95 +24872,6 @@
 
 
 
-    else
-
-
-ntp_libevent_min_version=2.0.9
-ntp_libevent_tearoff=libevent
-
-
-
-
-case "$ntp_use_local_libevent" in
- yes)
-    ;;
- *) # If we have (a good enough) pkg-config, see if it can find libevent
-    case "$PKG_CONFIG" in
-     /*)
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if libevent $ntp_libevent_min_version or later is installed" >&5
-$as_echo_n "checking if libevent $ntp_libevent_min_version or later is installed... " >&6; }
-	if $PKG_CONFIG --atleast-version=$ntp_libevent_min_version libevent
-	then
-	    ntp_use_local_libevent=no
-	    { $as_echo "$as_me:${as_lineno-$LINENO}: Using the installed libevent" >&5
-$as_echo "$as_me: Using the installed libevent" >&6;}
-	    CPPFLAGS_LIBEVENT=`$PKG_CONFIG --cflags-only-I libevent`
-	    # HMS: I hope the following is accurate.
-	    # We don't need -levent, we only need  -levent_core.
-	    # While we could grab only the -L stuff, there *might* be
-	    # other flags there we want.  Originally we just removed -levent
-	    # but then somebody decided to install -levent-2.0
-	    # LDADD_LIBEVENT=`$PKG_CONFIG --libs libevent | sed 's:-levent::'`
-	    # So now we dance...
-	    LDADD_LIBEVENT=
-	    for i in `$PKG_CONFIG --libs libevent`
-	    do
-		case "$i" in
-		 -levent*) ;;
-		 *) case "$LDADD_LIBEVENT" in
-		     '') LDADD_LIBEVENT="$i" ;;
-		     *) LDADD_LIBEVENT="$LDADD_LIBEVENT $i" ;;
-		    esac
-		    ;;
-		esac
-	    done
-	    case "$LIBISC_PTHREADS_NOTHREADS" in
-	     pthreads)
-		LDADD_LIBEVENT="$LDADD_LIBEVENT -levent_pthreads"
-	    esac
-	    LDADD_LIBEVENT="$LDADD_LIBEVENT -levent_core"
-	    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-	else
-	    ntp_use_local_libevent=yes
-	    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-	fi
-	;;
-     *)
-	ntp_use_local_libevent=yes
-	;;
-    esac
-    ;;
-esac
-
-case "$ntp_use_local_libevent" in
- yes)
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Using libevent tearoff" >&5
-$as_echo "$as_me: Using libevent tearoff" >&6;}
-    CPPFLAGS_LIBEVENT="-I\$(top_builddir)/$ntp_libevent_tearoff/include -I\$(top_srcdir)/$ntp_libevent_tearoff/include"
-    case "$LIBISC_PTHREADS_NOTHREADS" in
-     pthreads)
-	LDADD_LIBEVENT="\$(top_builddir)/$ntp_libevent_tearoff/libevent_pthreads.la \$(top_builddir)/$ntp_libevent_tearoff/libevent_core.la"
-	;;
-     *)
-	LDADD_LIBEVENT="\$(top_builddir)/$ntp_libevent_tearoff/libevent_core.la"
-    esac
-esac
-
- if test "x$ntp_use_local_libevent" = "xyes"; then
-  BUILD_LIBEVENT_TRUE=
-  BUILD_LIBEVENT_FALSE='#'
-else
-  BUILD_LIBEVENT_TRUE='#'
-  BUILD_LIBEVENT_FALSE=
-fi
-
-
-
-
-        fi
-
 # Checks for libraries.
 
 
@@ -30023,6 +30205,10 @@
   as_fn_error $? "conditional \"INSTALL_NTPSWEEP\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
+if test -z "${INSTALL_UPDATE_LEAP_TRUE}" && test -z "${INSTALL_UPDATE_LEAP_FALSE}"; then
+  as_fn_error $? "conditional \"INSTALL_UPDATE_LEAP\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
 if test -z "${NTP_CROSSCOMPILE_TRUE}" && test -z "${NTP_CROSSCOMPILE_FALSE}"; then
   as_fn_error $? "conditional \"NTP_CROSSCOMPILE\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
@@ -30051,10 +30237,6 @@
   as_fn_error $? "conditional \"BUILD_LIBEVENT\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
-if test -z "${BUILD_LIBEVENT_TRUE}" && test -z "${BUILD_LIBEVENT_FALSE}"; then
-  as_fn_error $? "conditional \"BUILD_LIBEVENT\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
 if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then
   as_fn_error $? "conditional \"am__fastdepCXX\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
@@ -30472,7 +30654,7 @@
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by sntp $as_me 4.2.8, which was
+This file was extended by sntp $as_me 4.2.8p2, which was
 generated by GNU Autoconf 2.68.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -30539,7 +30721,7 @@
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-sntp config.status 4.2.8
+sntp config.status 4.2.8p2
 configured by $0, generated by GNU Autoconf 2.68,
   with options \\"\$ac_cs_config\\"
 
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/sntp/configure.ac /cur/src/external/bsd/ntp/dist/sntp/configure.ac
--- external/bsd/ntp/dist/sntp/configure.ac	2013-12-27 15:31:15.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/sntp/configure.ac	2015-04-07 19:51:18.000000000 -0700
@@ -97,11 +97,14 @@
 enable_nls=no
 LIBOPTS_CHECK
 
-AM_COND_IF(
-    [BUILD_SNTP],
-    [NTP_LIBEVENT_CHECK],
-    [NTP_LIBEVENT_CHECK_NOBUILD]
-)
+# From when we only used libevent for sntp:
+#AM_COND_IF(
+#    [BUILD_SNTP],
+#    [NTP_LIBEVENT_CHECK],
+#    [NTP_LIBEVENT_CHECK_NOBUILD]
+#)
+
+NTP_LIBEVENT_CHECK([2])
 
 # Checks for libraries.
 
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/sntp/include/Makefile.in /cur/src/external/bsd/ntp/dist/sntp/include/Makefile.in
--- external/bsd/ntp/dist/sntp/include/Makefile.in	2014-12-19 12:37:45.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/sntp/include/Makefile.in	2015-04-07 19:51:18.000000000 -0700
@@ -40,8 +40,6 @@
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/libopts/m4/libopts.m4 \
 	$(top_srcdir)/libopts/m4/stdnoreturn.m4 \
-	$(top_srcdir)/libevent/m4/openldap-thread-check.m4 \
-	$(top_srcdir)/libevent/m4/openldap.m4 \
 	$(top_srcdir)/m4/hms_search_lib.m4 $(top_srcdir)/m4/libtool.m4 \
 	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
 	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
@@ -61,8 +59,10 @@
 	$(top_srcdir)/m4/ntp_prog_cc.m4 $(top_srcdir)/m4/ntp_sntp.m4 \
 	$(top_srcdir)/m4/ntp_sysexits.m4 \
 	$(top_srcdir)/m4/ntp_ver_suffix.m4 \
-	$(top_srcdir)/m4/os_cflags.m4 $(top_srcdir)/m4/snprintf.m4 \
-	$(top_srcdir)/m4/version.m4 $(top_srcdir)/configure.ac
+	$(top_srcdir)/m4/openldap-thread-check.m4 \
+	$(top_srcdir)/m4/openldap.m4 $(top_srcdir)/m4/os_cflags.m4 \
+	$(top_srcdir)/m4/snprintf.m4 $(top_srcdir)/m4/version.m4 \
+	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
 mkinstalldirs = $(install_sh) -d
@@ -133,6 +133,7 @@
 LD = @LD@
 LDADD_LIBEVENT = @LDADD_LIBEVENT@
 LDADD_LIBNTP = @LDADD_LIBNTP@
+LDADD_LIBUTIL = @LDADD_LIBUTIL@
 LDADD_NTP = @LDADD_NTP@
 LDFLAGS = @LDFLAGS@
 LDFLAGS_NTP = @LDFLAGS_NTP@
@@ -248,6 +249,11 @@
 TIMETRIM_DS = @TIMETRIM_DS@
 TIMETRIM_MS = @TIMETRIM_MS@
 TIMETRIM_NI = @TIMETRIM_NI@
+UPDATE_LEAP_DB = @UPDATE_LEAP_DB@
+UPDATE_LEAP_DL = @UPDATE_LEAP_DL@
+UPDATE_LEAP_DS = @UPDATE_LEAP_DS@
+UPDATE_LEAP_MS = @UPDATE_LEAP_MS@
+UPDATE_LEAP_NI = @UPDATE_LEAP_NI@
 VERSION = @VERSION@
 VER_SUFFIX = @VER_SUFFIX@
 abs_builddir = @abs_builddir@
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/sntp/include/copyright.def /cur/src/external/bsd/ntp/dist/sntp/include/copyright.def
--- external/bsd/ntp/dist/sntp/include/copyright.def	2014-12-19 12:37:45.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/sntp/include/copyright.def	2015-04-07 19:51:18.000000000 -0700
@@ -1,8 +1,8 @@
 /* -*- Mode: Text -*- */
 
 copyright = {
-    date  = "1970-2014";
-    owner = "The University of Delaware";
+    date  = "1992-2015";
+    owner = "The University of Delaware and Network Time Foundation";
     eaddr = "http://bugs.ntp.org, bugs@ntp.org";
     type  = ntp;
 };
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/sntp/include/ntp.lic /cur/src/external/bsd/ntp/dist/sntp/include/ntp.lic
--- external/bsd/ntp/dist/sntp/include/ntp.lic	2013-12-27 15:31:37.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/sntp/include/ntp.lic	2015-04-07 19:51:18.000000000 -0700
@@ -9,7 +9,7 @@
 <PFX>documentation for any purpose with or without fee is hereby granted,
 <PFX>provided that the above copyright notice appears in all copies and that
 <PFX>both the copyright notice and this permission notice appear in
-<PFX>supporting documentation, and that the name <owner> not be used in
+<PFX>supporting documentation, and that the name The University of Delaware not be used in
 <PFX>advertising or publicity pertaining to distribution of the software
 <PFX>without specific, written prior permission. <owner> makes no
 <PFX>representations about the suitability this software for any purpose. It
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/sntp/include/version.def /cur/src/external/bsd/ntp/dist/sntp/include/version.def
--- external/bsd/ntp/dist/sntp/include/version.def	2014-12-19 12:37:45.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/sntp/include/version.def	2015-04-07 19:51:18.000000000 -0700
@@ -1 +1 @@
-version = '4.2.8';
+version = '4.2.8p2';
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/sntp/include/version.texi /cur/src/external/bsd/ntp/dist/sntp/include/version.texi
--- external/bsd/ntp/dist/sntp/include/version.texi	2014-12-19 12:37:45.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/sntp/include/version.texi	2015-04-07 19:51:18.000000000 -0700
@@ -1,3 +1,3 @@
-@set UPDATED 19 December 2014
-@set EDITION 4.2.8
-@set VERSION 4.2.8
+@set UPDATED 07 April 2015
+@set EDITION 4.2.8p2
+@set VERSION 4.2.8p2
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/sntp/invoke-sntp.texi /cur/src/external/bsd/ntp/dist/sntp/invoke-sntp.texi
--- external/bsd/ntp/dist/sntp/invoke-sntp.texi	2014-12-19 12:37:44.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/sntp/invoke-sntp.texi	2015-04-07 19:51:18.000000000 -0700
@@ -6,7 +6,7 @@
 #
 # EDIT THIS FILE WITH CAUTION  (invoke-sntp.texi)
 #
-# It has been AutoGen-ed  December 19, 2014 at 07:51:36 AM by AutoGen 5.18.5pre4
+# It has been AutoGen-ed  April  7, 2015 at 04:18:04 AM by AutoGen 5.18.5pre4
 # From the definitions    sntp-opts.def
 # and the template file   agtexi-cmd.tpl
 @end ignore
@@ -56,7 +56,8 @@
 is displayed.
 Finally, the
 @emph{stratum}
-of the host is reported.
+of the host is reported
+and the leap indicator is decoded and displayed.
 
 This section was generated by @strong{AutoGen},
 using the @code{agtexi-cmd} template and the option descriptions for the @code{sntp} program.
@@ -100,7 +101,7 @@
 
 @exampleindent 0
 @example
-sntp - standard Simple Network Time Protocol client program - Ver. 4.2.8
+sntp - standard Simple Network Time Protocol client program - Ver. 4.2.8p2
 Usage:  sntp [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]... \
                 [ hostname-or-IP ...]
   Flg Arg Option-Name    Description
@@ -282,7 +283,9 @@
 This option takes a number argument.
 If the time adjustment is less than @file{steplimit} milliseconds,
 slew the amount using @command{adjtime(2)}.  Otherwise, step the
-correction using @command{settimeofday(2)}. 
+correction using @command{settimeofday(2)}.  The default value is 0,
+which means all adjustments will be stepped.  This is a feature, as
+different situations demand different values.
 @node sntp ntpversion
 @subsection ntpversion option (-o)
 @cindex sntp-ntpversion
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/sntp/libevent/ChangeLog /cur/src/external/bsd/ntp/dist/sntp/libevent/ChangeLog
--- external/bsd/ntp/dist/sntp/libevent/ChangeLog	2014-12-19 12:37:46.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/sntp/libevent/ChangeLog	2015-04-07 19:51:18.000000000 -0700
@@ -1,23 +1,282 @@
-Changes in version 2.1.4-beta (?? Dec 2013)
+Changes in version 2.1.5-beta (5 January 2015)
 
- (As of 735d838b0a537ae04f1e6a2e9cbc5f3f45ebb541)
+ Security Fixes (evbuffers)
+   o Avoid integer overflow bugs in evbuffer_add() and related functions.  See CVE-2014-6272 advisory for more information. (d49bc0e88b81a5812116074dc007f1db0ca1eecd)
 
+ New APIs (evconnlistener)
+   o Provide support for SO_REUSEPORT through LEV_OPT_REUSABLE_PORT (b625361 Maciej Soltysiak)
+
+ Bugfixes (core)
+    o Fix use-after-free error in EV_CLOSURE_EVENT callback (3cc0eac John Ohl)
+    o Fix race caused by event_active (3c7d6fc vjpai)
+
+ Bugfixes (evbuffer)
+   o Fix evbuffer_peek() with len==-1 and start_at non-NULL. (ba59923)
+   o Consistently check for failure from evbuffer_pullup() (60f8f72)
+   o Fix evbuffer_peek() with len==-1 and start_at non-NULL. (fb7e76a)
+
+ Bugfixes (windows, IOCP)
+   o be async: avoid double close() (f133b86 Azat Khuzhin)
+
+ Bugfixes (bufferevents)
+   o Fix issue #127, double free for filterevents that use BEV_OPT_CLOSE_ON_FREE (2c82aa0 John Ohl)
+   o make bufferevent_getwatermark api more robust (a21e510 ufo2243)
+   o [Bugfix] fix bufferevent setwatermark suspend_read (b34e4ac ufo2243)
+   o bufferevent_openssl: reset fd_is_set when setfd with -1 is called (3da84c2 Azat Khuzhin)
+   o Fix compilation for older OpenSSL versions. (5c7282f Joakim Soderberg)
+
+ New APIs (evhttp)
+   o Add evhttp_connection_set_family() to set addrinfo->family for DNS requests (12c29b0 Azat Khuzhin)
+   o Implement interface that provides the ability to have an outbound evhttp_connection free itself once all requests have completed (2b9ec4c,10fe4f John Ohl)
+
+ New APIs (core)
+   o Implement new/free for struct evutil_monotonic_timer and export monotonic time functions (f2645f8 Andrea Shepard)
+
+ Bugfixes (evdns)
+   o Load hosts file on Windows. (a0b247c Vilmos Nebehaj)
+   o Don't truncate hosts file path on Windows. (d0dc861 Vilmos Nebehaj)
+   o Fix a crash in evdns related to shutting down evdns (9f39c88,e8fe749)
+   o evdns: avoid read-after-free in evdns_request_timeout_callback() (61262a0 Azat Khuzhin)
+   o Correctly handle allocation failures in evdns_getaddrinfo (6a53d15)
+   o evdns: fix EVDNS_BASE_DISABLE_WHEN_INACTIVE in case retransmit/retry (74d0eee Azat Khuzhin)
+   o evdns: add retry/reissue tests for EVDNS_BASE_DISABLE_WHEN_INACTIVE (3ca9d43 Azat Khuzhin)
+   o evdns: fail ns after we are failing/retrasmitting request (97c750d Azat Khuzhin)
+
+ Bugfixes (evhttp)
+   o http: reset connection before installing retry timer (fix http retries handling) (bc79cc5 Azat Khuzhin)
+
+
+ Testing
+   o regress_dns: fix leaks in getaddrinfo_async{,_cancel_stress} tests (2fdc5f2 Azat Khuzhin)
+   o test: add family argument for http_connection_test_() (177b8a7 Azat Khuzhin)
+   o test: add regress for evhttp_connection_set_family() with AF_INET and AF_UNSPEC (42aefeb Azat Khuzhin)
+   o test/http: add regress test for set family to AF_INET6 (3fbf3cc Azat Khuzhin)
+   o Update to a more recent tinytest_macros. (8da5a18)
+   o test/regress: add simplestsignal: to track reorder bugs separately (b897bef Azat Khuzhin)
+   o test/evbuffer_peek: add regress in case we have first buffer greater (e2d139d Azat Khuzhin)
+   o More evbuffer_peek() test cases (154006a)
+   o use correct tt macro for pointer compare (08c88ea)
+   o regress_buffer: fix 'memcmp' compare size (79800df Maks Naumov)
+   o Fix a use-after-free in unit tests. CID 752027 (3739057)
+   o Fix a dead-code warning in unit tests. CID 1193548 (c119f24)
+   o Use evutil_weakrand() in unit tests. (a677b72, 364c110)
+   o Use a more precise calculation for max in time-ratelim.c (ca5b5c7)
+   o Make a buffer larger in the tests to avoid a scary evbuffer_copyout_from() (fb57b8b)
+   o Fix several memory leaks in the unit tests. (89c1a3b)
+   o Add test for evhttp_connection_free_on_completion (b0e9924 John Ohl)
+   o Fix annoying heisenbug in test-time.c (cb73704)
+
+ Sample code
+   o Make http-server.c output into good html5 (6d72bdc)
+   o Use FindClose for handle from FindFirstFile in http-server.c (6466e88)
+   o https-client: add -retries argument, for connection retries (d9da844 Azat Khuzhin)
+
+ Bugfixes (build)
+   o Add missing headerfile for cmake (15d90cc Trond Norbye)
+   o ignore one more test binary (b6593aa Michael Richardson)
+   o ignore config.cache/test-driver files (c83f333 Mike Frysinger)
+   o add a --disable-samples configure flag (0c492b3 Mike Frysinger)
+   o Add a few files created by "make verify" to .gitignore. (1a8295a Pierre Phaneuf)
+   o updates in cmake build (27bd9fa Sergey Nikulov)
+   o Fix cmake error when the Module path has more than one entry. (befbd13 Acer Yang)
+   o Fix CMake shared library build (e69d910 Nobuaki Sukegawa)
+   o Fix warnings when compiling with clang 3.5 (f5b4765 John Ohl)
+   o Fix mixed declarations and code (forbidden by ISO C90) (8afbdbc Thomas Bernard)
+
+ Bugfixes (miscellaneous)
+   o tree.h: drop duplicated content of tree.h (6193187 Azat Khuzhin)
+   o evdns: disable probing with EVDNS_BASE_DISABLE_WHEN_INACTIVE (610410b,ad0493e,fea86a6,d83b337,5ca9e97 Azat Khuzhin)
+   o [Bugfix] fix grammer error (3a4d249 ufo2243)
+   o Change return type of evutil_load_windows_system_library_ to HMODULE (f691389)
+   o Fix a c90 warning (76643dd)
+   o Fix a typo in a doxygen comment. Reported by äº¦å¾—. (be1aeff)
+   o remove trailing comma from enum (b361b8a Jean-Philippe Ouellet)
+
+ Bugfixes (FreeBSD)
+   o Handle ENOTCAPABLE from FreeBSD - this is returned if an event in the changelist is for an FD that has been closed. (6fd7394 Adrian Chadd)
+
+
+
+Changes in version 2.1.4-alpha (21 Mar 2014)
+
+ Libevent 2.1.4-alpha adds a number of new miscellaneous APIs to make
+ Libevent more useful, including support for early close detection with
+ epoll via EPOLLRDHUP, triggering bufferevent callbacks, adding more
+ evhttp callbacks, and more. There are also numerous bugfixes, including
+ a number for finalize-related issues from 2.1.3-alpha; and an
+ alternative (non-primary!) cmake-based build mechanism.
+
+ New APIs (core)
+   o Added event_base_get_num_events() (0fa107d Mobai Zhang)
+   o New event_base_active_by_fd API (865a142 Greg Hazel, 5c9da9a, 87fa2b0)
+   o Add event_base_active_by_signal by analogy (4865943)
+   o Add access to max event count stats (5173bef, efbd3dc, 26230a2
+     Andrew Sweeney)
+   o Implemented EV_CLOSED event for epoll backend
+     (EPOLLRDHUP). (b1b69ac Diego Giagio, 53d2793, 43ffcf6, dfe1e52
+     Marcin Juszkiewicz, ff26633 Joakim Soderberg, 3908a5e)
+
+ New APIs (evutil_secure_rng)
+   o Add evutil_secure_rng_set_urandom_device_file (2bbb5d7)
+
+ New APIs (bufferevents)
+   o Add function to fetch underlying ratelimit cfg (4b3d5af Mark Ellzey)
+   o Pass and return const for bufferevent_get_token_bucket_cfg (1c77fbb
+     Mark Ellzey)
+   o Add watermark introspection (4ce242b OndÅ™ej KuznÃ­k)
+   o Add an option to trigger bufferevent I/O callbacks (61ee18b OndÅ™ej KuznÃ­k)
+   o Add an option to trigger bufferevent event callbacks (a7384c7
+     OndÅ™ej KuznÃ­k)
+   o Clarifications in response to merge req. comments (bd41947 OndÅ™ej
+     KuznÃ­k)
+   o Minor optimizations on bufferevent_trigger options (a3172a4)
+
+ New APIs (evhttp)
+   o Add evhttp_connection_get_server(). (a7f82a3 Maxime Henrion)
+   o add a http default content type option (5a5acd9 Nicolas Martyanoff)
+   o http: implement new evhttp_connection_get_addr() api. (0c7f040 Azat
+     Khuzhin)
+   o Add a variant of evhttp_send_reply_chunk() with a callback on
+     evhttp_write_buffer() (8d8decf Julien BLACHE)
+   o Allow registering callback for parsing HTTP headers (b0bd7fe Balint Reczey)
+   o Provide on request complete callback facility (b083ca0 Andrew Sweeney)
+   o evhttp_request_set_on_complete_cb to be more specific about what
+     the function actually does and usage (da86dda Andrew Sweeney)
+   o Update unit test to make sure that the callback happens after the
+     output data is written (b85f398 Andrew Sweeney)
+
+ Features (evdns)
+   o bug fix for issues #293 evdns_base_load_hosts doesn't remove
+     outdated addresses (954d2f9, f03d353, 45eba6f Kuldeep Gupta)
+
+ Features: (cmake build support)
+   o Initial CMake commit. (e415196 Joakim Soderberg)
+   o Add all tests and benchmarks to CMake project. (e9fc014 Joakim Soderberg)
+   o More work on adding tests to CMake project (99c1dc3 Joakim Soderberg)
+   o Generate a dummy evconfig-private.h so things build
+     properly. (ce14def Joakim Soderberg)
+   o Link libm on unix platforms. (58fcd42 Joakim Soderberg)
+   o Added some GCC specific options. (19222e5 Joakim Soderberg)
+   o Use evutil_closesocket instead. (dbf2b51 Joakim Soderberg)
+   o Add copyright and licensing files for CMake modules. (c259d53
+     Joakim Soderberg)
+   o Only include WIN32 getopt where it is used. (9bbce0b Joakim Soderberg)
+   o Fix bench_cascade program on Windows. (78da644 Joakim Soderberg)
+   o Don't segfault on no found event backend. (8f2af50 Joakim Soderberg)
+   o Only test the event backends available on the system. (7ea4159
+     Joakim Soderberg)
+   o Added a "make verify" target. (e053c4f Joakim Soderberg)
+   o Fix the make "verify" target on Windows. (67e5d74 Joakim Soderberg)
+   o Get rid of deprecation warnings for OpenSSL on OSX 10.7+ (69c3516
+     Joakim SÃ¶derberg)
+   o Fix kqueue support. (a831f2f Joakim SÃ¶derberg)
+   o Added a test for testing if kqueue works with pipes. (2799b35
+     Joakim SÃ¶derberg)
+   o Change the BSD license from 4 to 3-clause. (86df3ed Joakim Soderberg)
+   o Minimum required python version is 2.4. (968e97b Joakim Soderberg)
+   o Get rid of unknown pragma warnings. (0ef1d04 Joakim Soderberg)
+   o Add a "make verify_coverage" target generation coverage
+     info. (f2483f8 Joakim Soderberg)
+   o Fix the "make verify" target on NetBSD (4ac086a Joakim Soderberg)
+   o Only look for ZLib when it is used (if tests are
+     included). (f780593 Joakim Soderberg)
+   o Added EVENT__ENABLE_GCC_WARNINGS, turns all warnings into
+     errors. (dd413bd Joakim Soderberg)
+   o Add CMake config and install targets. (f3446ed Joakim Soderberg)
+   o Fix typo (4b754df Joakim Soderberg)
+   o Some work on making it possible to simply do add_subdirectory() on
+     the project. (49ab363 Joakim Soderberg)
+   o Set USE_DEBUG=1 on EVENT__ENABLE_VERBOSE_DEBUG (fd42e70 Joakim Soderberg)
+   o Fix so that old nmake project still builds. (24d6466 Joakim
+     Soderberg)
+   o Rename README to README.md and use markdown to format. (d2bc39a
+     Joakim Soderberg)
+   o Update README with CMake build instructions. (604b8cc Joakim Soderberg)
+   o Clean up the README some. (8d4cb35 JoakimSoderberg)
+   o Forgotten headers for old nmake project compatability. (8697b99
+     Joakim Soderberg)
+   o Change all uses of WIN32 to _WIN32 (4e14395 Joakim SoÌˆderberg)
+   o Fix include bug. (2024467 Joakim SoÌˆderberg)
+   o Check if we're on OSX before disabling deprecation in le-proxy
+     (8b40a5b Joakim SoÌˆderberg)
+   o Fix broken autotools build. (ae1bd82 Joakim SoÌˆderberg)
+   o Disclaimerize cmake a little in the README (d03b5bf)
+   o Fix CMake compile when OpenSSL is disabled. (e423d42 Joakim
+     SoÌˆderberg)
+   o CMake: Get rid of python not found warning when regress tests
+     turned off. (d38d798 Joakim SoÌˆderberg)
+   o Fix https-client compilation on Windows. (d7be788 Joakim Soderberg)
+   o Guard against EVENT_NOWIN32 being set during testing. (f1715b4
+     Joakim Soderberg)
+   o Check for OSX when checking for clang. (e212c54 Joakim Soderberg)
+   o Added a Travis-CI configuration file. (8c0f0a9 Joakim Soderberg)
+   o Added -Qunused-arguments for clang on macosx (ed99d92 Trond Norbye)
+   o Rename event_extras to event_extra (a0dd5df Trond Norbye)
+   o Add option to build shared library (4545fa9 Trond Norbye)
+   o Add -Qunused-arguments for clang on macos (b56611d Trond Norbye)
+   o Add cmake-related files to .gitignore (e061321 Trond Norbye)
+   o Export event_extra not event_extras. (2b41bcf Joakim SoÌˆderberg)
+
+ Bugfixes (core)
+   o If evsel->del() fails, don't leave the evmap in an inconsistent
+     state (9b5a527 Maxime Henrion)
+   o Move event_debug_note_teardown_ before mm_free. (69b5c64)
+   o Check CLOCK_MONOTONIC_* at runtime if needed. (911abf3)
+   o Fix reinit of fds with EV_WRITE but not EV_READ. (ebfd8a8 maksqwe)
+   o Tweaked callbacks to prevent race condition
+     (https://github.com/libevent/libevent/issues/104) (40830f1, 2ea15ed
+     John Ohl)
+   o Move assert(ev) to before we use ev in EV_CLOSURE_EVENT_FINALIZE
+     case (9805972)
+
+ Bugfixes (evhttp)
+   o Fix a double close() bug in evhttp when the underlying bufferevent uses
+     BEV_OPT_CLOSE_ON_FREE. (31db8a0 Maxime Henrion)
+   o Fix an unlikely but possible error case for http connections (f22049e)
+   o Avoid racy bufferevent activation (5eb1788 Nate Rosenblum)
+
+ Bugfixes on 2.0 (Windows)
+   o Use windows vsnprintf fixup logic on all windows environments (e826f19)
+   o libevent/win32_dealloc() : fix sizeof(pointer) vs sizeof(*pointer)
+    (b8f5980 Frank Denis)
+
+ Bugfixes (evutil_secure_rng)
+   o When we seed from /proc/sys/kernel/random/uuid, count it as success
+     (e35b540)
+   o We should return after arc4random_buf() (1ea1f26 Makoto Kato)
+   o Avoid other RNG initialization FS reads when urandom file is
+     specified (9695e9c)
+   o Really remove RNG seeds from the stack (f5ced88)
+   o Fix another arc4random_buf-related warning (e64a2b0)
+
+ Bugfixes (bufferevents)
+   o Initialize async bufferevent timeout CBs unconditionally (af9b2a7)
 
  Bugfixes (evdns)
    o Checking request nameserver for NULL, before using it. (5c710c0
      Belobrov Andrey)
-   o Fix SEGFAULT after evdns_base_resume if no nameservers installed. (14971a8
-     Azat Khuzhin)
+   o Fix SEGFAULT after evdns_base_resume if no nameservers
+     installed. (14971a8 Azat Khuzhin)
    o Actually use the log facility for reporting evdns problems. (e1766a1)
-   o Fix SEGFAULT after evdns_base_resume if no nameservers installed. (f8d7df8 Azat Khuzhin)
+   o Fix SEGFAULT after evdns_base_resume if no nameservers
+     installed. (f8d7df8 Azat Khuzhin)
+   o fix for ServFail from RIPE Atlas release (62f596b Antony Antony)
 
- Bugfixes (compilatin)
+ Bugfixes (compilation)
    o Fix test compilation with nmake: add the gdi.lib dependency (5ba8ab7)
    o Whoops. It is gdi.lib, not gdi32.lib. (github issue #61) (8ab612e)
-   o Don't use return since return type is void and build error occurs using clang (838161d Makoto Kato)
+   o Don't use return since return type is void and build error occurs
+     using clang (838161d Makoto Kato)
    o Use void casts to suppress some "unchecked return value" warns (7080d55)
-   o rpcgen: Generate regress.gen.[c,h] in build rather than src dir (243386c Ross Lagerwall)
-   o Fix a compiler warning when checking for arc4random_buf linker breakage. (5cb3865)
+   o rpcgen: Generate regress.gen.[c,h] in build rather than src dir
+     (243386c Ross Lagerwall)
+   o Fix a compiler warning when checking for arc4random_buf linker
+     breakage. (5cb3865)
+   o Fix 'make distcheck' by adding regress.gen.[ch] to DISTCLEANFILES
+    (239d834)
+
+   o Fix a c90 warning (c207682)
+   o Fix consts in WIN32-Code/getopt*.[ch] (57abb35)
 
  Bugfixes (locks, synchronization)
    o Missed lock acquire/release in event_base_cancel_single_callback_()
@@ -30,7 +289,8 @@
  Testing
    o Add tests for evdns_base_resume(). (1cd9ff5 Azat Khuzhin)
    o Fix dns/leak_resume_send_err test. (7e876df Azat Khuzhin)
-   o Add checks for evhttp_connection_get_server() in unit tests. (fbc323b Maxime Henrion)
+   o Add checks for evhttp_connection_get_server() in unit
+     tests. (fbc323b Maxime Henrion)
    o Fix a (failure-only) null dereference in the unit tests (1104d0b)
    o Fix a logic error in test_evbuffer_freeze (7765884)
    o Add missing check to test_evbuffer_file_segment_add_cleanup_cb (eba4506)
@@ -38,15 +298,12 @@
    o DNS tests: add a missing check (f314900)
    o Finalize tests: add a missing check (82b6956)
    o test_evutil_rtrim: add another missing check. (e193c95)
-   o regress_main: logging all if env EVENT_DEBUG_LOGGING_ALL isset (611e28b Azat Khuzhin)
-   o regress_http: add tests for evhttp_connection_get_addr() (4dd500c Azat Khuzhin)
-
- Bugfixes (core)
-   o If evsel->del() fails, don't leave the evmap in an inconsistent state
-     (9b5a527 Maxime Henrion)
-   o Move event_debug_note_teardown_ before mm_free. (69b5c64)
-   o Check CLOCK_MONOTONIC_* at runtime if needed. (911abf3)
-   o Fix reinit of fds with EV_WRITE but not EV_READ. (ebfd8a8 maksqwe)
+   o regress_main: logging all if env EVENT_DEBUG_LOGGING_ALL isset
+     (611e28b Azat Khuzhin)
+   o regress_http: add tests for evhttp_connection_get_addr() (4dd500c
+     Azat Khuzhin)
+   o Update to the latest version of tinytest (7a80476)
+   o Heap-allocate zlib data structure in regress_zlib tests (4947c18)
 
  Performance tweaks (core)
    o Avoid redundant syscall to make a nonblocking socket nonblocking
@@ -54,56 +311,42 @@
    o Avoid redundant syscall if making a socket cloexec twice (1f29b18)
    o Avoid redundant invocations of init_extension_functions for IOCP (3b77d62)
 
- Bugfixes (evhttp)
-   o Fix a double close() bug in evhttp when the underlying bufferevent uses
-     BEV_OPT_CLOSE_ON_FREE. (31db8a0 Maxime Henrion)
-   o Fix an unlikely but possible error case for http connections (f22049e)
-   o Avoid racy bufferevent activation (5eb1788 Nate Rosenblum)
-
- Bugfixes on 2.0 (Windows)
-   o Use windows vsnprintf fixup logic on all windows environments (e826f19)
-   o libevent/win32_dealloc() : fix sizeof(pointer) vs sizeof(*pointer) (b8f5980 Frank Denis)
-
- Bugfixes (evutil_secure_rng)
-   o When we seed from /proc/sys/kernel/random/uuid, count it as success (e35b540)
-   o We should return after arc4random_buf() (1ea1f26 Makoto Kato)
-   o Avoid other RNG initialization FS reads when urandom file is specified (9695e9c)
-   o Really remove RNG seeds from the stack (f5ced88)
-   o Fix another arc4random_buf-related warning (e64a2b0)
-
- New APIs (core)
-   o Added event_base_get_num_events() (0fa107d Mobai Zhang)
-   o Add function to fetch underlying ratelimit cfg (4b3d5af Mark Ellzey)
-   o Pass and return const for bufferevent_get_token_bucket_cfg (1c77fbb Mark Ellzey)
-
- New APIs (evhttp)
-   o Add evhttp_connection_get_server(). (a7f82a3 Maxime Henrion)
-   o add a http default content type option (5a5acd9 Nicolas Martyanoff)
-   o http: implement new evhttp_connection_get_addr() api. (0c7f040 Azat Khuzhin)
-
-
  Documentation
    o Document that arc4random is not a great cryptographic PRNG. (6e49696)
    o Small doxygen tweaks (6e67b51)
    o Try another doxygen tweak (ccf432b)
-
- New APIs (evutil_secure_rng)
-   o Add evutil_secure_rng_set_urandom_device_file (2bbb5d7)
+   o Clarify event_base_loop exit conditions (031a803)
+   o Fix a typo (be7bf2c OndÅ™ej KuznÃ­k)
+   o Document deferred eventcb behaviour (13a9a02 OndÅ™ej KuznÃ­k)
+   o Typo fixes from Linus Nordberg (cec62cb, 8cd695b)
+   o Fix duplicate paragraph in evbuffer_ptr documentation (58408ee)
+
+ Code Improvements (coverity)
+   o Fix a pile of coverity warnings in the unit tests (867f401)
+   o Fix coverity warnings in benchmark tools. (ff7f739)
+   o Whoops; fix compilation in bench.c (544cf88)
+   o Remove spurious checks in evrpc.c error cases (coverity) (991b362)
+   o Fix a couple of compilation warnings in regress_http.c (860767e)
+   o Fix even more coverity warnings. (d240328)
+   o Stop checking for inet_aton; we don't use it. (f665d5c)
+   o Add an include to evrpc-internal to fix openbsd compilation warning
+     (5e161c6)
 
  Cleanups
    o Remove an unreachable return statement in minheap-internal.h (e639a9e)
+   o Refactor evmap_{io,signal}_active_() to tolerate bad inputs (974c60e)
+   o Fix needless bufferevent includes in evdns.c (254c04e)
+   o Fix a couple of "#ifdef WIN32" instances (88ecda3)
+   o Remove unneeded declaration in bufferevent-internal.h (4c8ebcd)
 
  Sample code
-   o sample/le-proxy: Fail more gracefully if opening listener fails (44b2491)
-   o sample: drop uri_root from base_url in http-server. (6171e1c Azat Khuzhin)
-
-
-
-
-
-
-
-
+   o le-proxy: Fail more gracefully if opening listener fails (44b2491)
+   o http-server: drop uri_root from base_url in http-server. (6171e1c Azat Khuzhin)
+   o https-client: POST supported, args supported (c5887f7 Alexey Ozeritsky)
+   o https-client: code cleanup (29af65e Alexey Ozeritsky)
+   o https-client: Small tweaks to https-client.c (90786eb)
+   o https-client: Set hostname for SNI extension (by f69m) (d1976f8)
+   o https-client: add a cast to https-client.c (462e6b6)
 
 
 
@@ -377,6 +620,429 @@
    o Refactor event_persist_closure: raise and extract some common logic
      (bec22b4)
    o Remove the unused bits from EVLIST_ALL (9889a3d)
+||||||| merged common ancestors
+Changes in version 2.0.22-stable (?? Dec 2013)
+
+ (As of 3b77d62829c4393bda6f9105a5d3b73b48a64b71.)
+
+BUGFIXES (evhttp)
+ o fix #73 and fix http_connection_fail_test to catch it (crash fix) (b618204 Greg Hazel)
+ o Avoid racy bufferevent activation (5eb1788 Nate Rosenblum)
+
+BUGFIXES (compilation and portability)
+ o Fix compilation with WIN32_HAVE_CONDITION_VARIABLES enabled (7e45739)
+ o Fix missing AC_PROG_SED on older Autoconfs (9ab2b3f Tay Ray Chuan)
+ o Backport libevent to vanilla Autoconf 2.59 (as used in RHEL5) (74d4c44 Kevin Bowling)
+ o Use AC_CONFIG_HEADERS in place of AM_CONFIG_HEADERS for autmake 1.13 compat (817ea36)
+ o Rename configure.in to configure.ac to appease newer autoconfs (0c79787)
+ o Avoid using top_srcdir in TESTS: new automakes do not like this (a55514e)
+ o Use windows vsnprintf fixup logic on all windows environments (e826f19)
+ o Fix a compiler warning when checking for arc4random_buf linker breakage. (5cb3865)
+ o Fix another arc4random_buf-related warning (e64a2b0)
+
+BUGFIXES (resource leaks/lock errors on error)
+ o Avoid leaking fds on evconnlistener with no callback set (69db261)
+ o Avoid double-close on getsockname error in evutil_ersatz_socketpair (0a822a6)
+ o Fix a locking error in bufferevent_socket_get_dns_error. (0a5eb2e)
+ o libevent/win32_dealloc() : fix sizeof(pointer) vs sizeof(*pointer) (b8f5980 Frank Denis)
+
+BUGFIXES (miscellaneous)
+ o Avoid other RNG initialization FS reads when urandom file is specified (9695e9c, bb52471)
+ o Avoid redundant invocations of init_extension_functions for IOCP (3b77d62)
+
+BUFGIXES (evdns)
+ o Checking request nameserver for NULL, before using it. (5c710c0 Belobrov Andrey)
+ o Fix SEGFAULT after evdns_base_resume if no nameservers installed. (f8d7df8 Azat Khuzhin)
+
+BUGFIXES (evutil_secure_random)
+ o When we seed from /proc/sys/kernel/random/uuid, count it as success (e35b540)
+ o Document that arc4random is not a great cryptographic PRNG. (6e49696)
+ o Add evutil_secure_rng_set_urandom_device_file (2bbb5d7)
+ o Really remove RNG seeds from the stack (f5ced88)
+
+
+DOCUMENTATION FIXES
+ o Fix a mistake in evbuffer_remove() arguments in example http server code (c322c20 Gyepi Sam)
+ o Fix a typo in a comment in buffer.h. Spotted by Alt_F4 (773b0a5)
+
+
+
+Changes in version 2.0.21-stable (18 Nov 2012)
+BUGFIXES:
+ o ssl: Don't discard SSL read event when timeout and read come close together (576b29f)
+ o ssl: Stop looping in "consider_reading" if reading is suspended. (f719b8a Joachim Bauch)
+ o ssl: No need to reserve space if reading is suspended. (1acf2eb Joachim Bauch)
+ o dns: Avoid a memory-leak on OOM in evdns. (73e85dd, f2bff75 George Danchev)
+ o build: Use python2 rather than python (0eb0109 Ross Lagerwall)
+ o build: Compile without warnings on mingw64 (94866c2)
+ o build: Fix compilation on mingw64 with -DUSE_DEBUG (62bd2c4)
+ o build: Make rpcgen_wrapper.sh work on systems without a "python2" binary (f3009e4)
+ o iocp: Close IOCP listener socket on free when LEV_OPT_CLOSE_ON_FREE is set (cb853ea Juan Pablo Fernandez)
+ o core: Avoid crash when event_pending() called with no event_base set on event (e3cccf3)
+ o misc: remove stray 'x' so print_err will compile when uncommented (ac35650 Patrick Pelletier)
+ o tests: Fix renegotiation test to work around openssl 1.0.1 bug (c2f3086)
+ o tests: Warn when openssl version in unit test mismatches compiled version. (ac009f9)
+
+
+Changes in version 2.0.20-stable (23 Aug 2012)
+BUGFIXES:
+ o core: Make event_pending() threadsafe. (be7a95c Simon Liu)
+ o win32: avoid crash when waiting forever on zero fds. (160e58b)
+ o evhttp: Fix a memory leak on error in evhttp_uriencode (11c8b31)
+ o evbuffer: Avoid possible needless call to writev. Found by coverity. (6a4ec5c)
+ o evdns: memset sockaddr_in before using it. Found by coverity. (a1a0e67)
+ o evhttp: Check more setsockopt return values when binding sockets. Found by coverity (a0912e3)
+ o evdns: Avoid segfault on weird timeout during name lookup. (dc32077 Greg Hazel)
+ o bufferevent_ssl: Correctly invoke callbacks when a SSL bufferevent reads some and then blocks. (606ac43)
+
+
+PORTABILITY FIXES:
+ o check for arc4random_buf at runtime, on OS X (bff5f94 Greg Hazel)
+ o Correctly check for arc4random_buf (fcec3e8 Sebastian Hahn)
+ o Add explicit AC_PROG_SED to configure.in so all autoconfs will expose $(SED) (ca80ea6)
+
+BUILD FIXES:
+ o Add GCC annotations so that the vsprintf functions get checked properly (117e327)
+ o Fix an unused variable warning on *BSD. (c0720c1)
+
+UNIT TEST FIXES:
+ o Fix a couple of memory leaks (found with Valgrind). (3b2529a Ross Lagerwall)
+ o Remove deadcode in http regression tests. Found by coverity. (5553346)
+ o Fix possible uninitialized read in dns regression tests. Found by coverity. (2259777)
+ o Set umask before calling mkstemp in unit tests. Found by coverity (f1ce15d)
+ o Fix various check-after-dereference issues in unit tests: found by coverity (4f3732d)
+ o Fix resource leaks in the unit tests; found by coverity (270f279)
+ o Add some missing null checks to unit tests; found by coverity (f021c3d)
+ o Avoid more crashes/bad calls in unit tests; found by coverity (3cde5bf)
+ o Remove unused variable; spotted by coverity (6355b2a)
+ o Add checks to various return values in unit tests. Found by coverity (b9e7329)
+ o Move assignment outside tt_assert in ssl unit tests. Appeases coverity. (a2006c0)
+
+
+
+Changes in version 2.0.19-stable (3 May 2012)
+BUGFIXES (CORE):
+ o Refactor event_persist_closure: raise and extract some common logic (bec22b4)
+ o If time has jumped so we'd reschedule a periodic event in the past, schedule it for the future instead (dfd808c)
+ o If a higher-priority event becomes active, don't continue running events of the current priority. (2bfda40)
+
+BUGFIXES (SSL):
+ o Fixed potential double-readcb execution with openssl bufferevents. (4e62cd1 Mark Ellzey)
+
+BUGFIXES (DNS):
+ o Cancel a probe request when the server is freed, and ignore cancelled probe callbacks (94d2336 Greg Hazel)
+ o Remove redundant DNS_ERR_CANCEL check, move comment (46b8060 Greg Hazel)
+ o When retransmitting a timed-out DNS request, pick a fresh nameserver. (3d9e52a)
+
+DOCUMENTATION FIXES:
+ o Fix a typo in the bufferevent documentation (98e9119)
+ o Add missing ) to changelog; spotted by rransom (4c7ee6b)
+ o Fix the website URL in the readme (f775521)
+
+COMPILATION FIXES:
+ o Fix a compilation error with MSVC 2005 due to use of mode_t (336dcae)
+ o Configure with gcc older than 2.95 (4a6fd43 Sebastian Hahn)
+ o Generate event-config.h with a single sed script (30b6f88 Zack Weinberg)
+
+FORWARD-COMPATIBILITY:
+ o Backport: provide EVENT_LOG_* names, and deprecate _EVENT_LOG_* (d1a03b2)
+
+TESTING/DEBUGGING SUPPORT:
+ o dns-example.c can now take a resolv.conf file on the commandline (6610fa5)
+ o Make some evdns.c debug logs more verbose (d873d67)
+ o Work-around a stupid gcov-breaking bug in OSX 10.6 (b3887cd)
+
+
+
+Changes in version 2.0.18-stable (22 Mar 2012)
+BUGFIXES (core):
+ o Make uses of open() close-on-exec safe by introducing an internal evutil_open_closeonexec. (d2b5f72 Ross Lagerwall, 03dce42)
+
+BUGFIXES (kqueue):
+ o Properly zero the kevent in kq_setup_kevent() (c2c7b39 Sebastian Hahn)
+
+BUILD FIXES:
+ o Added OPENSSL_LDFLAGS env variable which is appended to SSL checks. (9278196 Mark Ellzey)
+ o Changed OPENSSL_LDFLAGS to OPENSSL_LIBADD (2d67b63 Mark Ellzey)
+ o Don't do clang version detection when disabling some flags (083296b Sebastian Hahn)
+
+BUGFIXES (dns):
+ o Stop crashing in evdns when nameserver probes give a weird error (bec5068)
+
+
+Changes in version 2.0.17-stable (10 Feb 2012)
+
+BUGFIXES (core):
+ o Be absolutely sure to clear pncalls before leaving event_signal_closure (11f36a5)
+ o check for sysctl before we use it (358c745 Mike Frysinger)
+ o Remove bogus casts of socket to int before calling ev_callback (f032516)
+ o Make evconnlistener work around bug in older Linux when getting nmapped (ecfc720)
+ o Fix a list corruption bug when using event_reinit() with signals present (6e41cdc)
+ o Fix a fd leak in event_reinit() (3f18ad1)
+ o Do a memberwise comparison of threading function tables (c94a5f2 Nate R)
+ o Use C-style comments in C source files (for compatibility with compilers such as xlc on AIX). (d84d917 Greg Hewgill)
+ o Avoid crash when freeing event_iocp and using event_set_mem_functions (19715a6)
+ o In the kqueue backend, do not report EBADF as an EV_READ (5d7bfa1 Nicholas Marriott)
+
+BUGFIXES (evbuffer and bufferevents):
+ o Fix behavior of evbuffer_peek(buf,-1,NULL,NULL,0) (c986f23 Zack Weinberg)
+ o Loop on filtering SSL reads until we are blocked or exhausted. (5b4b812)
+
+BUGFIXES (evhttp):
+ o Force strict validation of HTTP version in response. (790f6b3 Catalin Patulea)
+
+BUGFIXES (evdns):
+ o evdns: fix a bug in circular-queue implementation (d6094b1)
+
+BUILD FIXES:
+ o Fix a silly compilation error with the sun compiler (1927776 Colin Watt)
+ o Suppress a gcc warning from ignoring fwrite return in http-sample.c (7206e8c)
+
+DOCUMENTATION FIXES:
+ o Slightly clarify evbuffer_peek documentation (7bbf6ca)
+ o Update copyright notices to 2012 (e49e289)
+
+NEW APIS:
+ o Backport evhttp_connection_get_bufferevent to Libevent 2.0 (da70fa7 Arno Bakker)
+
+TESTS AND TEST FIXES:
+ o Fix a race condition in the dns/bufferevent_connect_hostname test. (cba48c7)
+ o Add function to check referential integrity of an event_base (27737d5)
+ o Check event_base correctness at end of each unit test (3312b02)
+ o Workaround in the unit tests for an apparent epoll bug in Linux 3.2 (dab9187)
+ o Better workaround for Linux 3.2 edge-triggered epoll bug (9f9e259)
+
+Changes in version 2.0.16-stable (18 Nov 2011)
+BUGFIXES (core):
+ o More detailed message in case of libevent self-debugging failure. (9e6a4ef Leonid Evdokimov)
+ o epoll: close fd on alloc fail at initialization (1aee718 Jamie Iles)
+ o Fix compile warning from saying event2/*.h inside a comment (447b0ba)
+ o Warn when unable to construct base because of failing make_base_notifiable (4e797f3)
+ o Don't try to make notifiable event_base when no threading fns are configured (e787413)
+
+BUGFIXES (evbuffer):
+ o unit test for remove_buffer bug (90bd620 Greg Hazel)
+ o Fix an evbuffer crash in evbuffer_remove_buffer() (c37069c)
+
+BUGFIXES (bufferevent_openssl):
+ o Refactor amount-to-read calculations in buffervent_ssl consider_reading() (a186e73 Mark Ellzey)
+ o Move SSL rate-limit enforcement into bytes_to_read() (96c562f)
+ o Avoid spinning on OpenSSL reads (2aa036f Mark Ellzey)
+
+BUGFIXES (dns)
+ o Empty DNS reply with OK status is another way to say NODATA. (21a08d6 Leonid Evdokimov)
+
+TESTING:
+ o Tests for 94fba5b and f72e8f6 (d58c15e Leonid Evdokimov)
+ o Test for commit aff6ba1 (f7841bf Leonid Evdokimov)
+ o Style and comment tweaks for dns/leak* tests (5e42202)
+ o improve test to remove at least one buffer from src (7eb52eb Greg Hazel)
+
+DOCUMENTATION:
+ o Add note about evhttp_send_reply_end to its doxygen (724bfb5)
+ o Update copyright dates to 2011. (3c824bd)
+ o Fix typo in whatsnew-2.0.txt (674bc6a Mansour Moufid)
+ o Improve win32 behavior of dns-sample.c code (a3f320e Gisle Vanem)
+
+
+
+Changes in version 2.0.15-stable (12 Oct 2011)
+BUGFIXES (DNS):
+ o DNS: add ttl for negative answers using RFC 2308 idea. (f72e8f6 Leonid Evdokimov)
+ o Add DNS_ERR_NODATA error code to handle empty replies. (94fba5b Leonid Evdokimov)
+
+BUFGIXES (bufferevents and evbuffers):
+ o Make evbuffer callbacks get the right n_added value after evbuffer_add (1ef1f68 Alex)
+ o Prefer mmap to sendfile unless a DRAINS_TO_FD flag is set. Allows add_file to work with SSL. (0ba0af9)
+
+BUGFIXES (event loop):
+ o When a signal callback is activated to run multiple times, allow event_base_loopbreak to work even before they all have run. (4e8eb6a)
+
+DOCUMENTATION FIXES:
+ o Fix docstring in dns.h (2b6eae5 Leonid Evdokimov)
+ o refer to non-deprecated evdns functions in comments (ba5c27d Greg Hazel)
+
+BUILD AND TESTING FIXES:
+ o le-proxy and regress depend on openssl directly (9ae061a Sergey Avseyev)
+ o Use _SOURCES, not _sources, in sample/Makefile.am (7f82382)
+ o Fixed compiler warnings for unchecked read/write calls. (c3b62fd Mark Ellzey)
+ o Make write-checking fixes use tt_fail_perror (2b76847)
+ o Fix some "value never used" warnings with gcc 4.6.1 (39c0cf7)
+
+
+
+Changes in version 2.0.14-stable (31 Aug 2011)
+BUGFIXES (bufferevents and evbuffers):
+ o Propagate errors on the underlying bufferevent to the user. (4a34394 Joachim Bauch)
+ o Ignore OpenSSL deprecation warnings on OS X (5d1b255 Sebastian Hahn)
+ o Fix handling of group rate limits under 64 bytes of burst (6d5440e)
+ o Solaris sendfile: correctly detect amount of data sent (643922e Michael Herf)
+ o Make rate limiting work with common_timeout logic (5b18f13)
+ o clear read watermark on underlying bufferevent when creating filtering bev to fix potentially failing fragmented ssl handshakes (54f7e61 Joachim Bauch)
+
+BUGFIXES (IOCP):
+ o IOCP: don't launch reads or writes on an unconnected socket (495c227)
+ o Make IOCP rate-limiting group support stricter and less surprising. (a98da7b)
+ o Have test-ratelim.c support IOCP (0ff2c5a)
+ o Make overlapped reads result in evbuffer callbacks getting invoked (6acfbdd)
+ o Correctly terminate IO on an async bufferevent on bufferevent_free (e6af35d)
+
+BUGFIXES (other):
+ o Fix evsig_dealloc memory leak with debugging turned on. (9b724b2 Leonid Evdokimov)
+ o Fix request_finished memory leak with debugging turned on. (aff6ba1 Leonid Evdokimov)
+
+BUILD AND TESTING FIXES:
+ o Allow OS-neutral builds for platforms where some versions have arc4random_buf (b442302 Mitchell Livingston)
+ o Try to fix 'make distcheck' errors when building out-of-tree (04656ea Dave Hart)
+ o Clean up some problems identified by Coverity. (7c11e51 Harlan Stenn)
+
+
+Changes in version 2.0.13-stable (18 Jul 2011)
+BUGFIXES
+ o Avoid race-condition when initializing global locks (b683cae)
+ o Fix bug in SSL bufferevents backed by a bev with a write high-watermarks (e050703 Joachim Bauch)
+ o Speed up invoke_callbacks on evbuffers when there are no callbacks (f87f568 Mark Ellzey)
+ o Avoid a segfault when all methods are disabled or broken (27ce38b)
+ o Fix incorrect results from evbuffer_search_eol(EOL_LF) (4461f1a)
+ o Add some missing checks for mm_calloc failures (89d5e09)
+ o Replace an assertion for event_base_free(NULL) with a check-and-warn (09fe97d)
+ o Report kqueue ebadf, epipe, and eperm as EV_READ events (1fd34ab)
+ o Check if the `evhttp_new_object' function in `http.c' returns NULL. (446cc7a Mansour Moufid)
+ o Use the correct printf args when formatting size_t (3203f88)
+ o Complain if the caller tries to change threading cbs after setting them (cb6ecee)
+
+DOCUMENTATION FIXES AND IMPROVEMENTS
+ o Revise the event/evbuffer/bufferevent doxygen for clarity and accuracy (2888fac)
+ o Update Doxyfile to produce more useful output (aea0555)
+
+TEST FIXES
+ o Fix up test_evutil_snprintf (caf695a)
+ o Fix tinytest invocation from windows shell (57def34 Ed Day)
+
+BUILD FIXES
+ o Use AM_CPPFLAGS in sample/Makefile.am, not AM_CFLAGS (4a5c82d)
+ o Fix select.c compilation on systems with no NFDBITS (49d1136)
+ o Fix a few warnings on OpenBSD (8ee9f9c Nicholas Marriott)
+ o Don't break when building tests from git without python installed (b031adf)
+ o Don't install event_rpcgen.py when --disable-libevent-install is used (e23cda3 Harlan Stenn)
+ o Fix AIX build issue with TAILQ_FOREACH definition (e934096)
+
+
+Changes in version 2.0.12-stable (4 Jun 2011)
+BUGFIXES
+ o Fix a warn-and-fail bug in kqueue by providing kevent() room to report errors (28317a0)
+ o Fix an assert-inducing fencepost bug in the select backend (d90149d)
+ o Fix failing http assertion introducd in commit 0d6622e (0848814 Kevin Ko)
+ o Fix a bug that prevented us from configuring IPv6 nameservers. (74760f1)
+ o Prevent size_t overflow in evhttp_htmlescape. (06c51cd Mansour Moufid)
+ o Added several checks for under/overflow conditions in evhttp_handle_chunked_read (a279272 Mark Ellzey)
+ o Added overflow checks in evhttp_read_body and evhttp_get_body (84560fc Mark Ellzey)
+
+DOCUMENTATION:
+ o Add missing words to EVLOOP_NONBLOCK documentation (9556a7d)
+
+BUILD FIXES
+ o libssl depends on libcrypto, not the other way around. (274dd03 Peter Rosin)
+ o Libtool brings in the dependencies of libevent_openssl.la automatically (7b819f2 Peter Rosin)
+ o Use OPENSSL_LIBS in Makefile.am (292092e Sebastian Hahn)
+ o Move the win32 detection in configure.in (ceb03b9 Sebastian Hahn)
+ o Correctly detect openssl on windows (6619385 Sebastian Hahn)
+ o Fix a compile warning with zlib 1.2.4 and 1.2.5 (5786b91 Sebastian Hahn)
+ o Fix compilation with GCC 2, which had no __builtin_expect (09d39a1 Dave Hart)
+ o Fix new warnings from GCC 4.6 (06a714f)
+ o Link with -lshell32 and -ladvapi32 on Win32. (86090ee Peter Rosin)
+ o Make the tests build when OpenSSL is not available. (07c41be Peter Rosin)
+ o Bring in the compile script from automake, if needed. (f3c7a4c Peter Rosin)
+ o MSVC does not provide S_ISDIR, so provide it manually. (70be7d1 Peter Rosin)
+ o unistd.h and sys/time.h might not exist. (fe93022 Peter Rosin)
+ o Make sure TINYTEST_LOCAL is defined when building tinytest.c (8fa030c Peter Rosin)
+ o Fix winsock2.h #include issues with MSVC (3d768dc Peter Rosin)
+ o Use evutil_gettimeofday instead of relying on the system gettimeofday. (0de87fe Peter Rosin)
+ o Always use evutil_snprintf, even if OS provides it (d1b2d11 Sebastian Hahn)
+ o InitializeCriticalSectionAndSpinCount requires _WIN32_WINNT >= 0x0403. (816115a Peter Rosin)
+ o cygwin: make it possible to build DLLs (d54d3fc)
+
+
+
+Changes in version 2.0.11-stable (27 Apr 2011)
+  [Autogenerated from the Git log, sorted and cleaned by hand.]
+BUGFIXES:
+ o Fix evport handling of POLLHUP and POLLERR (b42ce4b)
+ o Fix compilation on Windows with NDEBUG (cb8059d)
+ o Check for POLLERR, POLLHUP and POLLNVAL for Solaris event ports (0144886 Trond Norbye)
+ o Detect and handle more allocation failures. (666b096 Jardel Weyrich)
+ o Use event_err() only if the failure is truly unrecoverable. (3f8d22a Jardel Weyrich)
+ o Handle resize failures in the select backend better. (83e805a)
+ o Correctly free selectop fields when select_resize fails in select_init (0c0ec0b)
+ o Make --enable-gcc-warnings a no-op if not using gcc (3267703)
+ o Fix a type error in our (unused) arc4random_stir() (f736198)
+ o Correctly detect and stop non-chunked http requests when the body is too long (63a715e)
+ o Have event_base_gettimeofday_cached() always return wall-clock time (a459ef7)
+ o Workaround for http crash bug 3078187 (5dc5662 Tomash Brechko)
+ o Fix incorrect assertions and possible use-after-free in evrpc_free() (4b8f02f Christophe Fillot)
+ o Reset outgoing http connection when read data in idle state. (272823f Tomash Brechko)
+ o Fix subtle recursion in evhttp_connection_cb_cleanup(). (218cf19 Tomash Brechko)
+ o Fix the case when failed evhttp_make_request() leaved request in the queue. (0d6622e Tomash Brechko)
+ o Fix a crash bug in evdns server circular list code (00e91b3)
+ o Handle calloc failure in evdns. (Found by Dave Hart) (364291e)
+ o Fix a memory leak on win32 socket->event map. (b4f89f0)
+ o Add a forgotten NULL check to evhttp_parse_headers (12311ff Sebastian Hahn)
+ o Fix possible NULL-deref in evdns_cancel_request (5208544 Sebastian Hahn)
+
+PORTABILITY:
+ o Fall back to sscanf if we have no other way to implement strtoll (453317b)
+ o Build correctly on platforms without sockaddr_storage (9184563)
+ o Try to build correctly on platforms with no IPv6 support (713c254)
+ o Build on systems without AI_PASSIVE (cb92113)
+ o Fix http unit test on non-windows platforms without getaddrinfo (6092f12)
+ o Do not check for gethostbyname_r versions if we have getaddrinfo (c1260b0)
+ o Include arpa/inet.h as needed on HPUX (10c834c Harlan Stenn)
+ o Include util-internal.h as needed to build on platforms with no sockaddr_storage (bbf5515 Harlan Stenn)
+ o Check for getservbyname even if not on win32. (af08a94 Harlan Stenn)
+ o Add -D_OSF_SOURCE to fix hpux builds (0b33479 Harlan Stenn)
+ o Check for allocation failures in apply_socktype_protocol_hack (637d17a)
+ o Fix the check for multicast or broadcast addresses in evutil_check_interfaces (1a21d7b)
+ o Avoid a free(NULL) if out-of-memory in evdns_getaddrinfo. Found by Dave Hart (3417f68)
+
+DEFENSIVE PROGRAMMING:
+ o Add compile-time check for AF_UNSPEC==PF_UNSPEC (3c8f4e7)
+
+BUGS IN TESTS:
+ o Fix test.sh output on solaris (b4f89b6 Dave Hart)
+ o Make test-eof fail with a timeout if we never get an eof. (05a2c22 Harlan Stenn)
+ o Use %s with printf in test.sh (039b9bd)
+ o Add an assert to appease clang's static analyzer (b0ff7eb Sebastian Hahn)
+ o Add a forgotten return value check in the unit tests (3819b62 Sebastian Hahn)
+ o Actually send NULL request in http_bad_request_test (b693c32 Sebastian Hahn)
+ o add some (void) casts for unused variables (65707d7 Sebastian Hahn)
+ o Refactor test_getaddrinfo_async_cancel_stress() (48c44a6 Sebastian Hahn)
+ o Be nice and "handle" error return values in sample code (4bac793 Sebastian Hahn)
+ o Check return value of evbuffer_add_cb in tests (93a1abb Sebastian Hahn)
+ o Remote some dead code from dns-example.c (744c745 Sebastian Hahn)
+ o Zero a struct sockaddr_in before using it (646f9fe Sebastian Hahn)
+
+BUILD FIXES:
+ o Fix warnings about AC_LANG_PROGRAM usage (f663112 Sebastian Hahn)
+ o Skip check for zlib if we have no zlib.h (a317c06 Harlan Stenn)
+ o Fix autoconf bracket issues; make check for getaddrinfo include netdb.h (833e5e9 Harlan Stenn)
+ o Correct an AM_CFLAGS to an AM_CPPFLAGS in test/Makefile.am (9c469db Dave Hart)
+ o Fix make distcheck & installation of libevent 1 headers (b5a1f9f Dave Hart)
+ o Fix compilation under LLVM/clang with --enable-gcc-warnings (ad9ff58 Sebastian Hahn)
+
+FEATURES:
+ o Make URI parser able to tolerate nonconformant URIs. (95060b5)
+
+DOCUMENTATION:
+ o Clarify event_set_mem_functions doc (926f816)
+ o Correct evhttp_del_accept_socket documentation on whether socket is closed (f665924)
+ o fix spelling mistake in whatsnew-2.0.txt (deb2f73)
+ o Fix sample/http-server ipv6 fixes (eb692be)
+ o Comment internal headers used in sample code. (4eb281c)
+ o Be explicit about how long event loops run in event.h documentation (f95bafb)
+ o Add comment to configure.in to explain gc-sections test logic (c621359)
+ o Fix a couple of memory leaks in samples/http-server.c. Found by Dave Hart. (2e9f665)
+
+
 
 BUILD IMPROVEMENTS:
  Libevent 2.1.2-alpha modernizes Libevent's use of autotools, and makes
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/sntp/libevent/Makefile.am /cur/src/external/bsd/ntp/dist/sntp/libevent/Makefile.am
--- external/bsd/ntp/dist/sntp/libevent/Makefile.am	2014-12-19 12:37:46.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/sntp/libevent/Makefile.am	2015-04-07 19:51:18.000000000 -0700
@@ -38,7 +38,7 @@
 #
 # Once an RC is out, DO NOT MAKE ANY ABI-BREAKING CHANGES IN THAT SERIES
 # UNLESS YOU REALLY REALLY HAVE TO.
-VERSION_INFO = 3:0:0
+VERSION_INFO = 5:0:0
 
 # History:          RELEASE    VERSION_INFO
 #  2.0.1-alpha --     2.0        1:0:0
@@ -67,6 +67,8 @@
 #  2.1.1-alpha --     2.1        1:0:0
 #  2.1.2-alpha --     2.1        1:0:0 (should have been 2:0:1)
 #  2.1.3-alpha --     2.1        3:0:0 (ABI changed slightly)
+#  2.1.4-alpha --     2.1        4:0:0 (ABI changed slightly)
+#  2.1.5-beta  --     2.1        5:0:0 (ABI changed slightly)
 
 # ABI version history for this package effectively restarts every time
 # we change RELEASE.  Version 1.4.x had RELEASE of 1.4.
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/sntp/libevent/Makefile.in /cur/src/external/bsd/ntp/dist/sntp/libevent/Makefile.in
--- external/bsd/ntp/dist/sntp/libevent/Makefile.in	2014-12-19 12:37:45.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/sntp/libevent/Makefile.in	2015-04-07 19:51:18.000000000 -0700
@@ -66,53 +66,52 @@
 @PTHREADS_TRUE@am__append_2 = libevent_pthreads.pc
 @OPENSSL_TRUE@am__append_3 = libevent_openssl.la
 @OPENSSL_TRUE@am__append_4 = libevent_openssl.pc
-noinst_PROGRAMS = $(am__EXEEXT_3) $(am__EXEEXT_5)
+noinst_PROGRAMS = $(am__EXEEXT_4) $(am__EXEEXT_6)
 EXTRA_PROGRAMS = $(am__EXEEXT_1)
-DIST_COMMON = README $(am__configure_deps) \
-	$(am__dist_bin_SCRIPTS_DIST) $(am__include_HEADERS_DIST) \
-	$(am__include_event2_HEADERS_DIST) $(am__noinst_HEADERS_DIST) \
-	$(srcdir)/Makefile.am $(srcdir)/Makefile.in \
-	$(srcdir)/config.h.in $(srcdir)/evconfig-private.h.in \
-	$(srcdir)/include/include.am $(srcdir)/libevent.pc.in \
-	$(srcdir)/libevent_openssl.pc.in \
+DIST_COMMON = $(am__configure_deps) $(am__dist_bin_SCRIPTS_DIST) \
+	$(am__include_HEADERS_DIST) $(am__include_event2_HEADERS_DIST) \
+	$(am__noinst_HEADERS_DIST) $(srcdir)/Makefile.am \
+	$(srcdir)/Makefile.in $(srcdir)/config.h.in \
+	$(srcdir)/evconfig-private.h.in $(srcdir)/include/include.am \
+	$(srcdir)/libevent.pc.in $(srcdir)/libevent_openssl.pc.in \
 	$(srcdir)/libevent_pthreads.pc.in $(srcdir)/sample/include.am \
 	$(srcdir)/test/include.am $(top_srcdir)/configure ChangeLog \
 	build-aux/compile build-aux/config.guess build-aux/config.sub \
 	build-aux/depcomp build-aux/install-sh build-aux/ltmain.sh \
-	build-aux/missing epoll_sub.c
+	build-aux/missing build-aux/ylwrap epoll_sub.c
 @INSTALL_LIBEVENT_FALSE@am__append_5 = $(EVENT2_EXPORT)
 @OPENSSL_TRUE@am__append_6 = sample/le-proxy sample/https-client
 @OPENSSL_TRUE@am__append_7 = \
 @OPENSSL_TRUE@	sample/hostcheck.h \
 @OPENSSL_TRUE@	sample/openssl_hostname_validation.h
 
-@BUILD_REGRESS_TRUE@am__append_8 = $(TESTPROGRAMS)
-@BUILD_REGRESS_TRUE@am__append_9 = test/regress
-@BUILD_REGRESS_TRUE@am__append_10 = test/regress.gen.c test/regress.gen.h
-@PTHREADS_TRUE@am__append_11 = libevent_pthreads.la
-@BUILD_WIN32_TRUE@am__append_12 = test/regress_iocp.c
-@OPENSSL_TRUE@am__append_13 = test/regress_ssl.c
-@OPENSSL_TRUE@am__append_14 = $(OPENSSL_INCS)
-@OPENSSL_TRUE@am__append_15 = libevent_openssl.la $(OPENSSL_LIBS) ${OPENSSL_LIBADD}
-@STRLCPY_IMPL_TRUE@am__append_16 = strlcpy.c
-@SELECT_BACKEND_TRUE@am__append_17 = select.c
-@POLL_BACKEND_TRUE@am__append_18 = poll.c
-@DEVPOLL_BACKEND_TRUE@am__append_19 = devpoll.c
-@KQUEUE_BACKEND_TRUE@am__append_20 = kqueue.c
-@EPOLL_BACKEND_TRUE@am__append_21 = epoll.c
-@EVPORT_BACKEND_TRUE@am__append_22 = evport.c
-@SIGNAL_SUPPORT_TRUE@am__append_23 = signal.c
-@INSTALL_LIBEVENT_FALSE@am__append_24 = $(EVENT1_HDRS)
+@BUILD_SAMPLES_TRUE@am__append_8 = $(SAMPLES)
+@BUILD_REGRESS_TRUE@am__append_9 = $(TESTPROGRAMS)
+@BUILD_REGRESS_TRUE@am__append_10 = test/regress
+@BUILD_REGRESS_TRUE@am__append_11 = test/regress.gen.c test/regress.gen.h
+@PTHREADS_TRUE@am__append_12 = libevent_pthreads.la
+@BUILD_WIN32_TRUE@am__append_13 = test/regress_iocp.c
+@OPENSSL_TRUE@am__append_14 = test/regress_ssl.c
+@OPENSSL_TRUE@am__append_15 = $(OPENSSL_INCS)
+@OPENSSL_TRUE@am__append_16 = libevent_openssl.la $(OPENSSL_LIBS) ${OPENSSL_LIBADD}
+@STRLCPY_IMPL_TRUE@am__append_17 = strlcpy.c
+@SELECT_BACKEND_TRUE@am__append_18 = select.c
+@POLL_BACKEND_TRUE@am__append_19 = poll.c
+@DEVPOLL_BACKEND_TRUE@am__append_20 = devpoll.c
+@KQUEUE_BACKEND_TRUE@am__append_21 = kqueue.c
+@EPOLL_BACKEND_TRUE@am__append_22 = epoll.c
+@EVPORT_BACKEND_TRUE@am__append_23 = evport.c
+@SIGNAL_SUPPORT_TRUE@am__append_24 = signal.c
+@INSTALL_LIBEVENT_FALSE@am__append_25 = $(EVENT1_HDRS)
 subdir = .
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_backport_259_ssizet.m4 \
+	$(top_srcdir)/m4/acx_pthread.m4 \
 	$(top_srcdir)/m4/libevent_openssl.m4 \
 	$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
 	$(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
 	$(top_srcdir)/m4/lt~obsolete.m4 \
-	$(top_srcdir)/m4/ntp_pkg_config.m4 \
-	$(top_srcdir)/m4/openldap-thread-check.m4 \
-	$(top_srcdir)/m4/openldap.m4 $(top_srcdir)/configure.ac
+	$(top_srcdir)/m4/ntp_pkg_config.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
 am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
@@ -250,14 +249,15 @@
 	sample/event-read-fifo$(EXEEXT) sample/hello-world$(EXEEXT) \
 	sample/http-server$(EXEEXT) sample/signal-test$(EXEEXT) \
 	sample/time-test$(EXEEXT) $(am__EXEEXT_2)
-am__EXEEXT_4 = test/bench$(EXEEXT) test/bench_cascade$(EXEEXT) \
+@BUILD_SAMPLES_TRUE@am__EXEEXT_4 = $(am__EXEEXT_3)
+am__EXEEXT_5 = test/bench$(EXEEXT) test/bench_cascade$(EXEEXT) \
 	test/bench_http$(EXEEXT) test/bench_httpclient$(EXEEXT) \
 	test/test-changelist$(EXEEXT) test/test-dumpevents$(EXEEXT) \
 	test/test-eof$(EXEEXT) test/test-closed$(EXEEXT) \
 	test/test-fdleak$(EXEEXT) test/test-init$(EXEEXT) \
 	test/test-ratelim$(EXEEXT) test/test-time$(EXEEXT) \
 	test/test-weof$(EXEEXT) test/regress$(EXEEXT)
-@BUILD_REGRESS_TRUE@am__EXEEXT_5 = $(am__EXEEXT_4)
+@BUILD_REGRESS_TRUE@am__EXEEXT_6 = $(am__EXEEXT_5)
 PROGRAMS = $(noinst_PROGRAMS)
 am__dirstamp = $(am__leading_dot)dirstamp
 am_sample_dns_example_OBJECTS = sample/dns-example.$(OBJEXT)
@@ -343,7 +343,7 @@
 	test/test_regress-tinytest.$(OBJEXT) $(am__objects_12) \
 	$(am__objects_13) $(am__objects_14) $(am__objects_15)
 test_regress_OBJECTS = $(am_test_regress_OBJECTS)
-am__DEPENDENCIES_3 = $(am__append_11)
+am__DEPENDENCIES_3 = $(am__append_12)
 @OPENSSL_TRUE@am__DEPENDENCIES_4 = libevent_openssl.la \
 @OPENSSL_TRUE@	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
 test_regress_DEPENDENCIES = $(am__DEPENDENCIES_1) libevent.la \
@@ -568,8 +568,9 @@
 PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
+PTHREAD_CC = @PTHREAD_CC@
 PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
-PTHREAD_LIBS = @PTHREAD_LIBS@ $(am__append_11)
+PTHREAD_LIBS = @PTHREAD_LIBS@ $(am__append_12)
 RANLIB = @RANLIB@
 SED = @SED@
 SET_MAKE = @SET_MAKE@
@@ -584,6 +585,7 @@
 ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+acx_pthread_config = @acx_pthread_config@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
@@ -663,7 +665,7 @@
 #
 # Once an RC is out, DO NOT MAKE ANY ABI-BREAKING CHANGES IN THAT SERIES
 # UNLESS YOU REALLY REALLY HAVE TO.
-VERSION_INFO = 3:0:0
+VERSION_INFO = 5:0:0
 
 # History:          RELEASE    VERSION_INFO
 #  2.0.1-alpha --     2.0        1:0:0
@@ -692,6 +694,8 @@
 #  2.1.1-alpha --     2.1        1:0:0
 #  2.1.2-alpha --     2.1        1:0:0 (should have been 2:0:1)
 #  2.1.3-alpha --     2.1        3:0:0 (ABI changed slightly)
+#  2.1.4-alpha --     2.1        4:0:0 (ABI changed slightly)
+#  2.1.5-beta  --     2.1        5:0:0 (ABI changed slightly)
 
 # ABI version history for this package effectively restarts every time
 # we change RELEASE.  Version 1.4.x had RELEASE of 1.4.
@@ -744,12 +748,12 @@
 	iocp-internal.h ipv6-internal.h kqueue-internal.h \
 	log-internal.h minheap-internal.h mm-internal.h \
 	ratelim-internal.h ratelim-internal.h strlcpy-internal.h \
-	time-internal.h util-internal.h $(am__append_24)
+	time-internal.h util-internal.h $(am__append_25)
 CLEANFILES = test/rpcgen-attempted
 DISTCLEANFILES = test/test-script.sh test/regress.gen.c \
 	test/regress.gen.h *~ libevent.pc \
 	./include/event2/event-config.h
-BUILT_SOURCES = $(am__append_10) include/event2/event-config.h
+BUILT_SOURCES = $(am__append_11) include/event2/event-config.h
 include_event2dir = $(includedir)/event2
 EVENT2_EXPORT = \
 	include/event2/buffer.h \
@@ -853,14 +857,14 @@
 	test/regress_minheap.c test/regress_rpc.c \
 	test/regress_testutils.c test/regress_testutils.h \
 	test/regress_util.c test/tinytest.c $(regress_thread_SOURCES) \
-	$(regress_zlib_SOURCES) $(am__append_12) $(am__append_13)
+	$(regress_zlib_SOURCES) $(am__append_13) $(am__append_14)
 @BUILD_WIN32_TRUE@regress_thread_SOURCES = test/regress_thread.c
 @PTHREADS_TRUE@regress_thread_SOURCES = test/regress_thread.c
 @ZLIB_REGRESS_TRUE@regress_zlib_SOURCES = test/regress_zlib.c
 test_regress_LDADD = $(LIBEVENT_GC_SECTIONS) libevent.la \
-	$(PTHREAD_LIBS) $(ZLIB_LIBS) $(am__append_15)
+	$(PTHREAD_LIBS) $(ZLIB_LIBS) $(am__append_16)
 test_regress_CPPFLAGS = $(AM_CPPFLAGS) $(PTHREAD_CFLAGS) \
-	$(ZLIB_CFLAGS) -Itest $(am__append_14)
+	$(ZLIB_CFLAGS) -Itest $(am__append_15)
 test_regress_LDFLAGS = $(PTHREAD_CFLAGS)
 test_bench_SOURCES = test/bench.c
 test_bench_LDADD = $(LIBEVENT_GC_SECTIONS) libevent.la
@@ -872,17 +876,17 @@
 test_bench_httpclient_LDADD = $(LIBEVENT_GC_SECTIONS) libevent_core.la
 @BUILD_WIN32_FALSE@SYS_LIBS = 
 @BUILD_WIN32_TRUE@SYS_LIBS = -lws2_32 -lshell32 -ladvapi32
-@BUILD_WIN32_FALSE@SYS_SRC = $(am__append_16) $(am__append_17) \
-@BUILD_WIN32_FALSE@	$(am__append_18) $(am__append_19) \
-@BUILD_WIN32_FALSE@	$(am__append_20) $(am__append_21) \
-@BUILD_WIN32_FALSE@	$(am__append_22) $(am__append_23)
+@BUILD_WIN32_FALSE@SYS_SRC = $(am__append_17) $(am__append_18) \
+@BUILD_WIN32_FALSE@	$(am__append_19) $(am__append_20) \
+@BUILD_WIN32_FALSE@	$(am__append_21) $(am__append_22) \
+@BUILD_WIN32_FALSE@	$(am__append_23) $(am__append_24)
 @BUILD_WIN32_TRUE@SYS_SRC = win32select.c evthread_win32.c \
 @BUILD_WIN32_TRUE@	buffer_iocp.c event_iocp.c \
-@BUILD_WIN32_TRUE@	bufferevent_async.c $(am__append_16) \
-@BUILD_WIN32_TRUE@	$(am__append_17) $(am__append_18) \
-@BUILD_WIN32_TRUE@	$(am__append_19) $(am__append_20) \
-@BUILD_WIN32_TRUE@	$(am__append_21) $(am__append_22) \
-@BUILD_WIN32_TRUE@	$(am__append_23)
+@BUILD_WIN32_TRUE@	bufferevent_async.c $(am__append_17) \
+@BUILD_WIN32_TRUE@	$(am__append_18) $(am__append_19) \
+@BUILD_WIN32_TRUE@	$(am__append_20) $(am__append_21) \
+@BUILD_WIN32_TRUE@	$(am__append_22) $(am__append_23) \
+@BUILD_WIN32_TRUE@	$(am__append_24)
 @BUILD_WIN32_FALSE@SYS_INCLUDES = 
 @BUILD_WIN32_TRUE@SYS_INCLUDES = -IWIN32-Code -IWIN32-Code/nmake
 CORE_SRC = \
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/sntp/libevent/README /cur/src/external/bsd/ntp/dist/sntp/libevent/README
--- external/bsd/ntp/dist/sntp/libevent/README	2013-12-27 15:31:19.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/sntp/libevent/README	1969-12-31 16:00:00.000000000 -0800
@@ -1,218 +0,0 @@
-0. BUILDING AND INSTALLATION (Briefly)
-
-$ ./configure
-$ make
-$ make verify   # (optional)
-$ sudo make install
-
-1. BUILDING AND INSTALLATION (In Depth)
-
-To build libevent, type
-
-$ ./configure && make
-
-     (If you got libevent from the git repository, you will
-      first need to run the included "autogen.sh" script in order to
-      generate the configure script.)
-
-You can run the regression tests by running
-
-$ make verify
-
-Install as root via
-
-# make install
-
-Before reporting any problems, please run the regression tests.
-
-To enable the low-level tracing build the library as:
-
-   CFLAGS=-DUSE_DEBUG ./configure [...]
-
-Standard configure flags should work.  In particular, see:
-
-   --disable-shared          Only build static libraries
-   --prefix                  Install all files relative to this directory.
-
-
-The configure script also supports the following flags:
-
-   --enable-gcc-warnings     Enable extra compiler checking with GCC.
-   --disable-malloc-replacement
-                             Don't let applications replace our memory
-                             management functions
-   --disable-openssl         Disable support for OpenSSL encryption.
-   --disable-thread-support  Don't support multithreaded environments.
-
-2. USEFUL LINKS:
-
-For the latest released version of Libevent, see the official website at
-http://libevent.org/ .
-
-There's a pretty good work-in-progress manual up at
-   http://www.wangafu.net/~nickm/libevent-book/ .
-
-For the latest development versions of Libevent, access our Git repository
-via
-   "git clone git://levent.git.sourceforge.net/gitroot/levent/libevent"
-
-You can browse the git repository online at
-http://levent.git.sourceforge.net/git/gitweb-index.cgi .
-
-To report bugs, request features, or submit patches to Libevent,
-use the Sourceforge trackers at
-https://sourceforge.net/tracker/?group_id=50884 .
-
-There's also a libevent-users mailing list for talking about Libevent
-use and development: http://archives.seul.org/libevent/users/
-
-3. ACKNOWLEDGMENTS
-
-The following people have helped with suggestions, ideas, code or
-fixing bugs:
-
-  Samy Al Bahra
-  Jacob Appelbaum
-  Arno Bakker
-  Weston Andros Adamson
-  William Ahern
-  Ivan Andropov
-  Sergey Avseyev
-  Avi Bab
-  Joachim Bauch
-  Gilad Benjamini
-  Stas Bekman
-  Denis Bilenko
-  Julien Blache
-  Kevin Bowling
-  Tomash Brechko
-  Kelly Brock
-  Ralph Castain
-  Adrian Chadd
-  Lawnstein Chan
-  Shuo Chen
-  Ka-Hing Cheung
-  Andrew Cox
-  Paul Croome
-  George Danchev
-  Andrew Danforth
-  Ed Day
-  Christopher Davis
-  Mike Davis
-  Antony Dovgal
-  Mihai Draghicioiu
-  Alexander Drozdov
-  Mark Ellzey
-  Shie Erlich
-  Leonid Evdokimov
-  Juan Pablo Fernandez
-  Christophe Fillot
-  Mike Frysinger
-  Remi Gacogne
-  Artem Germanov
-  Alexander von Gernler
-  Artur Grabowski
-  Diwaker Gupta
-  Sebastian Hahn
-  Dave Hart
-  Greg Hazel
-  Michael Herf
-  Sebastian Hahn
-  Savg He
-  Mark Heily
-  Michael Herf
-  Greg Hewgill
-  Andrew Hochhaus
-  Aaron Hopkins
-  Tani Hosokawa
-  Jamie Iles
-  Claudio Jeker
-  Evan Jones
-  George Kadianakis
-  Phua Keat
-  Azat Khuzhin
-  Alexander Klauer
-  Kevin Ko
-  Brian Koehmstedt
-  Marko Kreen
-  Valery Kyholodov
-  Ross Lagerwall
-  Scott Lamb
-  Christopher Layne
-  Adam Langley
-  Graham Leggett
-  Philip Lewis
-  Zhou Li
-  David Libenzi
-  Yan Lin
-  Moshe Litvin
-  Simon Liu
-  Mitchell Livingston
-  Hagne Mahre
-  Lubomir Marinov
-  Abilio Marques
-  Abel Mathew
-  Nick Mathewson
-  James Mansion
-  Nicholas Marriott
-  Andrey Matveev
-  Caitlin Mercer
-  Dagobert Michelsen
-  Andrea Montefusco
-  Mansour Moufid
-  Mina Naguib
-  Felix Nawothnig
-  Trond Norbye
-  Linus Nordberg
-  Richard Nyberg
-  Jon Oberheide
-  Phil Oleson
-  Dave Pacheco
-  Derrick Pallas
-  Tassilo von Parseval
-  Catalin Patulea
-  Patrick Pelletier
-  Simon Perreault
-  Pierre Phaneuf
-  Amarin Phaosawasdi
-  Ryan Phillips
-  Dimitre Piskyulev
-  Pavel Plesov
-  Jon Poland
-  Roman Puls
-  Nate R
-  Robert Ransom
-  Bert JW Regeer
-  Peter Rosin
-  Maseeb Abdul Qadir
-  Wang Qin
-  Alex S
-  Hanna Schroeter
-  Ralf Schmitt
-  Mike Smellie
-  Kevin Springborn
-  Nir Soffer
-  Harlan Stenn
-  Steve Snyder
-  Dug Song
-  Dongsheng Song
-  Hannes Sowa
-  Ferenc Szalai
-  Brodie Thiesfield
-  Jason Toffaletti
-  Gisle Vanem
-  Bas Verhoeven
-  Constantine Verutin
-  Colin Watt
-  Zack Weinberg
-  Jardel Weyrich
-  Jay R. Wren
-  Zack Weinberg
-  Alejo
-  Alex
-  Taral
-  propanbutan
-  mmadia
-  yangacer
-
-If we have forgotten your name, please contact us.
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/sntp/libevent/WIN32-Code/nmake/event2/event-config.h /cur/src/external/bsd/ntp/dist/sntp/libevent/WIN32-Code/nmake/event2/event-config.h
--- external/bsd/ntp/dist/sntp/libevent/WIN32-Code/nmake/event2/event-config.h	2014-12-24 18:28:15.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/sntp/libevent/WIN32-Code/nmake/event2/event-config.h	2015-04-07 19:51:18.000000000 -0700
@@ -276,7 +276,7 @@
 /* #undef EVENT__HAVE_WORKING_KQUEUE */
 
 /* Numeric representation of the version */
-#define EVENT__NUMERIC_VERSION 0x02010301
+#define EVENT__NUMERIC_VERSION 0x02010500
 
 /* Name of package */
 #define EVENT__PACKAGE "libevent"
@@ -333,7 +333,7 @@
 #define EVENT__TIME_WITH_SYS_TIME 1
 
 /* Version number of package */
-#define EVENT__VERSION "2.1.3-alpha-dev"
+#define EVENT__VERSION "2.1.5-beta"
 
 /* Define to appropriate substitue if compiler doesnt have __func__ */
 #define EVENT____func__ __FUNCTION__
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/sntp/libevent/WIN32-Code/tree.h /cur/src/external/bsd/ntp/dist/sntp/libevent/WIN32-Code/tree.h
--- external/bsd/ntp/dist/sntp/libevent/WIN32-Code/tree.h	2014-12-24 18:28:15.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/sntp/libevent/WIN32-Code/tree.h	2015-04-07 19:51:18.000000000 -0700
@@ -677,680 +677,3 @@
 	     (x) = name##_RB_NEXT(x))
 
 #endif	/* _SYS_TREE_H_ */
-/*	$OpenBSD: tree.h,v 1.7 2002/10/17 21:51:54 art Exp $	*/
-/*
- * Copyright 2002 Niels Provos <provos@citi.umich.edu>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef	_SYS_TREE_H_
-#define	_SYS_TREE_H_
-
-/*
- * This file defines data structures for different types of trees:
- * splay trees and red-black trees.
- *
- * A splay tree is a self-organizing data structure.  Every operation
- * on the tree causes a splay to happen.  The splay moves the requested
- * node to the root of the tree and partly rebalances it.
- *
- * This has the benefit that request locality causes faster lookups as
- * the requested nodes move to the top of the tree.  On the other hand,
- * every lookup causes memory writes.
- *
- * The Balance Theorem bounds the total access time for m operations
- * and n inserts on an initially empty tree as O((m + n)lg n).  The
- * amortized cost for a sequence of m accesses to a splay tree is O(lg n);
- *
- * A red-black tree is a binary search tree with the node color as an
- * extra attribute.  It fulfills a set of conditions:
- *	- every search path from the root to a leaf consists of the
- *	  same number of black nodes,
- *	- each red node (except for the root) has a black parent,
- *	- each leaf node is black.
- *
- * Every operation on a red-black tree is bounded as O(lg n).
- * The maximum height of a red-black tree is 2lg (n+1).
- */
-
-#define SPLAY_HEAD(name, type)						\
-struct name {								\
-	struct type *sph_root; /* root of the tree */			\
-}
-
-#define SPLAY_INITIALIZER(root)						\
-	{ NULL }
-
-#define SPLAY_INIT(root) do {						\
-	(root)->sph_root = NULL;					\
-} while (0)
-
-#define SPLAY_ENTRY(type)						\
-struct {								\
-	struct type *spe_left; /* left element */			\
-	struct type *spe_right; /* right element */			\
-}
-
-#define SPLAY_LEFT(elm, field)		(elm)->field.spe_left
-#define SPLAY_RIGHT(elm, field)		(elm)->field.spe_right
-#define SPLAY_ROOT(head)		(head)->sph_root
-#define SPLAY_EMPTY(head)		(SPLAY_ROOT(head) == NULL)
-
-/* SPLAY_ROTATE_{LEFT,RIGHT} expect that tmp hold SPLAY_{RIGHT,LEFT} */
-#define SPLAY_ROTATE_RIGHT(head, tmp, field) do {			\
-	SPLAY_LEFT((head)->sph_root, field) = SPLAY_RIGHT(tmp, field);	\
-	SPLAY_RIGHT(tmp, field) = (head)->sph_root;			\
-	(head)->sph_root = tmp;						\
-} while (0)
-
-#define SPLAY_ROTATE_LEFT(head, tmp, field) do {			\
-	SPLAY_RIGHT((head)->sph_root, field) = SPLAY_LEFT(tmp, field);	\
-	SPLAY_LEFT(tmp, field) = (head)->sph_root;			\
-	(head)->sph_root = tmp;						\
-} while (0)
-
-#define SPLAY_LINKLEFT(head, tmp, field) do {				\
-	SPLAY_LEFT(tmp, field) = (head)->sph_root;			\
-	tmp = (head)->sph_root;						\
-	(head)->sph_root = SPLAY_LEFT((head)->sph_root, field);		\
-} while (0)
-
-#define SPLAY_LINKRIGHT(head, tmp, field) do {				\
-	SPLAY_RIGHT(tmp, field) = (head)->sph_root;			\
-	tmp = (head)->sph_root;						\
-	(head)->sph_root = SPLAY_RIGHT((head)->sph_root, field);	\
-} while (0)
-
-#define SPLAY_ASSEMBLE(head, node, left, right, field) do {		\
-	SPLAY_RIGHT(left, field) = SPLAY_LEFT((head)->sph_root, field);	\
-	SPLAY_LEFT(right, field) = SPLAY_RIGHT((head)->sph_root, field);\
-	SPLAY_LEFT((head)->sph_root, field) = SPLAY_RIGHT(node, field);	\
-	SPLAY_RIGHT((head)->sph_root, field) = SPLAY_LEFT(node, field);	\
-} while (0)
-
-/* Generates prototypes and inline functions */
-
-#define SPLAY_PROTOTYPE(name, type, field, cmp)				\
-void name##_SPLAY(struct name *, struct type *);			\
-void name##_SPLAY_MINMAX(struct name *, int);				\
-struct type *name##_SPLAY_INSERT(struct name *, struct type *);		\
-struct type *name##_SPLAY_REMOVE(struct name *, struct type *);		\
-									\
-/* Finds the node with the same key as elm */				\
-static __inline struct type *						\
-name##_SPLAY_FIND(struct name *head, struct type *elm)			\
-{									\
-	if (SPLAY_EMPTY(head))						\
-		return(NULL);						\
-	name##_SPLAY(head, elm);					\
-	if ((cmp)(elm, (head)->sph_root) == 0)				\
-		return (head->sph_root);				\
-	return (NULL);							\
-}									\
-									\
-static __inline struct type *						\
-name##_SPLAY_NEXT(struct name *head, struct type *elm)			\
-{									\
-	name##_SPLAY(head, elm);					\
-	if (SPLAY_RIGHT(elm, field) != NULL) {				\
-		elm = SPLAY_RIGHT(elm, field);				\
-		while (SPLAY_LEFT(elm, field) != NULL) {		\
-			elm = SPLAY_LEFT(elm, field);			\
-		}							\
-	} else								\
-		elm = NULL;						\
-	return (elm);							\
-}									\
-									\
-static __inline struct type *						\
-name##_SPLAY_MIN_MAX(struct name *head, int val)			\
-{									\
-	name##_SPLAY_MINMAX(head, val);					\
-	return (SPLAY_ROOT(head));					\
-}
-
-/* Main splay operation.
- * Moves node close to the key of elm to top
- */
-#define SPLAY_GENERATE(name, type, field, cmp)				\
-struct type *								\
-name##_SPLAY_INSERT(struct name *head, struct type *elm)		\
-{									\
-    if (SPLAY_EMPTY(head)) {						\
-	    SPLAY_LEFT(elm, field) = SPLAY_RIGHT(elm, field) = NULL;	\
-    } else {								\
-	    int __comp;							\
-	    name##_SPLAY(head, elm);					\
-	    __comp = (cmp)(elm, (head)->sph_root);			\
-	    if(__comp < 0) {						\
-		    SPLAY_LEFT(elm, field) = SPLAY_LEFT((head)->sph_root, field);\
-		    SPLAY_RIGHT(elm, field) = (head)->sph_root;		\
-		    SPLAY_LEFT((head)->sph_root, field) = NULL;		\
-	    } else if (__comp > 0) {					\
-		    SPLAY_RIGHT(elm, field) = SPLAY_RIGHT((head)->sph_root, field);\
-		    SPLAY_LEFT(elm, field) = (head)->sph_root;		\
-		    SPLAY_RIGHT((head)->sph_root, field) = NULL;	\
-	    } else							\
-		    return ((head)->sph_root);				\
-    }									\
-    (head)->sph_root = (elm);						\
-    return (NULL);							\
-}									\
-									\
-struct type *								\
-name##_SPLAY_REMOVE(struct name *head, struct type *elm)		\
-{									\
-	struct type *__tmp;						\
-	if (SPLAY_EMPTY(head))						\
-		return (NULL);						\
-	name##_SPLAY(head, elm);					\
-	if ((cmp)(elm, (head)->sph_root) == 0) {			\
-		if (SPLAY_LEFT((head)->sph_root, field) == NULL) {	\
-			(head)->sph_root = SPLAY_RIGHT((head)->sph_root, field);\
-		} else {						\
-			__tmp = SPLAY_RIGHT((head)->sph_root, field);	\
-			(head)->sph_root = SPLAY_LEFT((head)->sph_root, field);\
-			name##_SPLAY(head, elm);			\
-			SPLAY_RIGHT((head)->sph_root, field) = __tmp;	\
-		}							\
-		return (elm);						\
-	}								\
-	return (NULL);							\
-}									\
-									\
-void									\
-name##_SPLAY(struct name *head, struct type *elm)			\
-{									\
-	struct type __node, *__left, *__right, *__tmp;			\
-	int __comp;							\
-\
-	SPLAY_LEFT(&__node, field) = SPLAY_RIGHT(&__node, field) = NULL;\
-	__left = __right = &__node;					\
-\
-	while ((__comp = (cmp)(elm, (head)->sph_root))) {		\
-		if (__comp < 0) {					\
-			__tmp = SPLAY_LEFT((head)->sph_root, field);	\
-			if (__tmp == NULL)				\
-				break;					\
-			if ((cmp)(elm, __tmp) < 0){			\
-				SPLAY_ROTATE_RIGHT(head, __tmp, field);	\
-				if (SPLAY_LEFT((head)->sph_root, field) == NULL)\
-					break;				\
-			}						\
-			SPLAY_LINKLEFT(head, __right, field);		\
-		} else if (__comp > 0) {				\
-			__tmp = SPLAY_RIGHT((head)->sph_root, field);	\
-			if (__tmp == NULL)				\
-				break;					\
-			if ((cmp)(elm, __tmp) > 0){			\
-				SPLAY_ROTATE_LEFT(head, __tmp, field);	\
-				if (SPLAY_RIGHT((head)->sph_root, field) == NULL)\
-					break;				\
-			}						\
-			SPLAY_LINKRIGHT(head, __left, field);		\
-		}							\
-	}								\
-	SPLAY_ASSEMBLE(head, &__node, __left, __right, field);		\
-}									\
-									\
-/* Splay with either the minimum or the maximum element			\
- * Used to find minimum or maximum element in tree.			\
- */									\
-void name##_SPLAY_MINMAX(struct name *head, int __comp) \
-{									\
-	struct type __node, *__left, *__right, *__tmp;			\
-\
-	SPLAY_LEFT(&__node, field) = SPLAY_RIGHT(&__node, field) = NULL;\
-	__left = __right = &__node;					\
-\
-	while (1) {							\
-		if (__comp < 0) {					\
-			__tmp = SPLAY_LEFT((head)->sph_root, field);	\
-			if (__tmp == NULL)				\
-				break;					\
-			if (__comp < 0){				\
-				SPLAY_ROTATE_RIGHT(head, __tmp, field);	\
-				if (SPLAY_LEFT((head)->sph_root, field) == NULL)\
-					break;				\
-			}						\
-			SPLAY_LINKLEFT(head, __right, field);		\
-		} else if (__comp > 0) {				\
-			__tmp = SPLAY_RIGHT((head)->sph_root, field);	\
-			if (__tmp == NULL)				\
-				break;					\
-			if (__comp > 0) {				\
-				SPLAY_ROTATE_LEFT(head, __tmp, field);	\
-				if (SPLAY_RIGHT((head)->sph_root, field) == NULL)\
-					break;				\
-			}						\
-			SPLAY_LINKRIGHT(head, __left, field);		\
-		}							\
-	}								\
-	SPLAY_ASSEMBLE(head, &__node, __left, __right, field);		\
-}
-
-#define SPLAY_NEGINF	-1
-#define SPLAY_INF	1
-
-#define SPLAY_INSERT(name, x, y)	name##_SPLAY_INSERT(x, y)
-#define SPLAY_REMOVE(name, x, y)	name##_SPLAY_REMOVE(x, y)
-#define SPLAY_FIND(name, x, y)		name##_SPLAY_FIND(x, y)
-#define SPLAY_NEXT(name, x, y)		name##_SPLAY_NEXT(x, y)
-#define SPLAY_MIN(name, x)		(SPLAY_EMPTY(x) ? NULL	\
-					: name##_SPLAY_MIN_MAX(x, SPLAY_NEGINF))
-#define SPLAY_MAX(name, x)		(SPLAY_EMPTY(x) ? NULL	\
-					: name##_SPLAY_MIN_MAX(x, SPLAY_INF))
-
-#define SPLAY_FOREACH(x, name, head)					\
-	for ((x) = SPLAY_MIN(name, head);				\
-	     (x) != NULL;						\
-	     (x) = SPLAY_NEXT(name, head, x))
-
-/* Macros that define a red-back tree */
-#define RB_HEAD(name, type)						\
-struct name {								\
-	struct type *rbh_root; /* root of the tree */			\
-}
-
-#define RB_INITIALIZER(root)						\
-	{ NULL }
-
-#define RB_INIT(root) do {						\
-	(root)->rbh_root = NULL;					\
-} while (0)
-
-#define RB_BLACK	0
-#define RB_RED		1
-#define RB_ENTRY(type)							\
-struct {								\
-	struct type *rbe_left;		/* left element */		\
-	struct type *rbe_right;		/* right element */		\
-	struct type *rbe_parent;	/* parent element */		\
-	int rbe_color;			/* node color */		\
-}
-
-#define RB_LEFT(elm, field)		(elm)->field.rbe_left
-#define RB_RIGHT(elm, field)		(elm)->field.rbe_right
-#define RB_PARENT(elm, field)		(elm)->field.rbe_parent
-#define RB_COLOR(elm, field)		(elm)->field.rbe_color
-#define RB_ROOT(head)			(head)->rbh_root
-#define RB_EMPTY(head)			(RB_ROOT(head) == NULL)
-
-#define RB_SET(elm, parent, field) do {					\
-	RB_PARENT(elm, field) = parent;					\
-	RB_LEFT(elm, field) = RB_RIGHT(elm, field) = NULL;		\
-	RB_COLOR(elm, field) = RB_RED;					\
-} while (0)
-
-#define RB_SET_BLACKRED(black, red, field) do {				\
-	RB_COLOR(black, field) = RB_BLACK;				\
-	RB_COLOR(red, field) = RB_RED;					\
-} while (0)
-
-#ifndef RB_AUGMENT
-#define RB_AUGMENT(x)
-#endif
-
-#define RB_ROTATE_LEFT(head, elm, tmp, field) do {			\
-	(tmp) = RB_RIGHT(elm, field);					\
-	if ((RB_RIGHT(elm, field) = RB_LEFT(tmp, field))) {		\
-		RB_PARENT(RB_LEFT(tmp, field), field) = (elm);		\
-	}								\
-	RB_AUGMENT(elm);						\
-	if ((RB_PARENT(tmp, field) = RB_PARENT(elm, field))) {		\
-		if ((elm) == RB_LEFT(RB_PARENT(elm, field), field))	\
-			RB_LEFT(RB_PARENT(elm, field), field) = (tmp);	\
-		else							\
-			RB_RIGHT(RB_PARENT(elm, field), field) = (tmp);	\
-	} else								\
-		(head)->rbh_root = (tmp);				\
-	RB_LEFT(tmp, field) = (elm);					\
-	RB_PARENT(elm, field) = (tmp);					\
-	RB_AUGMENT(tmp);						\
-	if ((RB_PARENT(tmp, field)))					\
-		RB_AUGMENT(RB_PARENT(tmp, field));			\
-} while (0)
-
-#define RB_ROTATE_RIGHT(head, elm, tmp, field) do {			\
-	(tmp) = RB_LEFT(elm, field);					\
-	if ((RB_LEFT(elm, field) = RB_RIGHT(tmp, field))) {		\
-		RB_PARENT(RB_RIGHT(tmp, field), field) = (elm);		\
-	}								\
-	RB_AUGMENT(elm);						\
-	if ((RB_PARENT(tmp, field) = RB_PARENT(elm, field))) {		\
-		if ((elm) == RB_LEFT(RB_PARENT(elm, field), field))	\
-			RB_LEFT(RB_PARENT(elm, field), field) = (tmp);	\
-		else							\
-			RB_RIGHT(RB_PARENT(elm, field), field) = (tmp);	\
-	} else								\
-		(head)->rbh_root = (tmp);				\
-	RB_RIGHT(tmp, field) = (elm);					\
-	RB_PARENT(elm, field) = (tmp);					\
-	RB_AUGMENT(tmp);						\
-	if ((RB_PARENT(tmp, field)))					\
-		RB_AUGMENT(RB_PARENT(tmp, field));			\
-} while (0)
-
-/* Generates prototypes and inline functions */
-#define RB_PROTOTYPE(name, type, field, cmp)				\
-void name##_RB_INSERT_COLOR(struct name *, struct type *);	\
-void name##_RB_REMOVE_COLOR(struct name *, struct type *, struct type *);\
-struct type *name##_RB_REMOVE(struct name *, struct type *);		\
-struct type *name##_RB_INSERT(struct name *, struct type *);		\
-struct type *name##_RB_FIND(struct name *, struct type *);		\
-struct type *name##_RB_NEXT(struct type *);				\
-struct type *name##_RB_MINMAX(struct name *, int);			\
-									\
-
-/* Main rb operation.
- * Moves node close to the key of elm to top
- */
-#define RB_GENERATE(name, type, field, cmp)				\
-void									\
-name##_RB_INSERT_COLOR(struct name *head, struct type *elm)		\
-{									\
-	struct type *parent, *gparent, *tmp;				\
-	while ((parent = RB_PARENT(elm, field)) &&			\
-	    RB_COLOR(parent, field) == RB_RED) {			\
-		gparent = RB_PARENT(parent, field);			\
-		if (parent == RB_LEFT(gparent, field)) {		\
-			tmp = RB_RIGHT(gparent, field);			\
-			if (tmp && RB_COLOR(tmp, field) == RB_RED) {	\
-				RB_COLOR(tmp, field) = RB_BLACK;	\
-				RB_SET_BLACKRED(parent, gparent, field);\
-				elm = gparent;				\
-				continue;				\
-			}						\
-			if (RB_RIGHT(parent, field) == elm) {		\
-				RB_ROTATE_LEFT(head, parent, tmp, field);\
-				tmp = parent;				\
-				parent = elm;				\
-				elm = tmp;				\
-			}						\
-			RB_SET_BLACKRED(parent, gparent, field);	\
-			RB_ROTATE_RIGHT(head, gparent, tmp, field);	\
-		} else {						\
-			tmp = RB_LEFT(gparent, field);			\
-			if (tmp && RB_COLOR(tmp, field) == RB_RED) {	\
-				RB_COLOR(tmp, field) = RB_BLACK;	\
-				RB_SET_BLACKRED(parent, gparent, field);\
-				elm = gparent;				\
-				continue;				\
-			}						\
-			if (RB_LEFT(parent, field) == elm) {		\
-				RB_ROTATE_RIGHT(head, parent, tmp, field);\
-				tmp = parent;				\
-				parent = elm;				\
-				elm = tmp;				\
-			}						\
-			RB_SET_BLACKRED(parent, gparent, field);	\
-			RB_ROTATE_LEFT(head, gparent, tmp, field);	\
-		}							\
-	}								\
-	RB_COLOR(head->rbh_root, field) = RB_BLACK;			\
-}									\
-									\
-void									\
-name##_RB_REMOVE_COLOR(struct name *head, struct type *parent, struct type *elm) \
-{									\
-	struct type *tmp;						\
-	while ((elm == NULL || RB_COLOR(elm, field) == RB_BLACK) &&	\
-	    elm != RB_ROOT(head)) {					\
-		if (RB_LEFT(parent, field) == elm) {			\
-			tmp = RB_RIGHT(parent, field);			\
-			if (RB_COLOR(tmp, field) == RB_RED) {		\
-				RB_SET_BLACKRED(tmp, parent, field);	\
-				RB_ROTATE_LEFT(head, parent, tmp, field);\
-				tmp = RB_RIGHT(parent, field);		\
-			}						\
-			if ((RB_LEFT(tmp, field) == NULL ||		\
-			    RB_COLOR(RB_LEFT(tmp, field), field) == RB_BLACK) &&\
-			    (RB_RIGHT(tmp, field) == NULL ||		\
-			    RB_COLOR(RB_RIGHT(tmp, field), field) == RB_BLACK)) {\
-				RB_COLOR(tmp, field) = RB_RED;		\
-				elm = parent;				\
-				parent = RB_PARENT(elm, field);		\
-			} else {					\
-				if (RB_RIGHT(tmp, field) == NULL ||	\
-				    RB_COLOR(RB_RIGHT(tmp, field), field) == RB_BLACK) {\
-					struct type *oleft;		\
-					if ((oleft = RB_LEFT(tmp, field)))\
-						RB_COLOR(oleft, field) = RB_BLACK;\
-					RB_COLOR(tmp, field) = RB_RED;	\
-					RB_ROTATE_RIGHT(head, tmp, oleft, field);\
-					tmp = RB_RIGHT(parent, field);	\
-				}					\
-				RB_COLOR(tmp, field) = RB_COLOR(parent, field);\
-				RB_COLOR(parent, field) = RB_BLACK;	\
-				if (RB_RIGHT(tmp, field))		\
-					RB_COLOR(RB_RIGHT(tmp, field), field) = RB_BLACK;\
-				RB_ROTATE_LEFT(head, parent, tmp, field);\
-				elm = RB_ROOT(head);			\
-				break;					\
-			}						\
-		} else {						\
-			tmp = RB_LEFT(parent, field);			\
-			if (RB_COLOR(tmp, field) == RB_RED) {		\
-				RB_SET_BLACKRED(tmp, parent, field);	\
-				RB_ROTATE_RIGHT(head, parent, tmp, field);\
-				tmp = RB_LEFT(parent, field);		\
-			}						\
-			if ((RB_LEFT(tmp, field) == NULL ||		\
-			    RB_COLOR(RB_LEFT(tmp, field), field) == RB_BLACK) &&\
-			    (RB_RIGHT(tmp, field) == NULL ||		\
-			    RB_COLOR(RB_RIGHT(tmp, field), field) == RB_BLACK)) {\
-				RB_COLOR(tmp, field) = RB_RED;		\
-				elm = parent;				\
-				parent = RB_PARENT(elm, field);		\
-			} else {					\
-				if (RB_LEFT(tmp, field) == NULL ||	\
-				    RB_COLOR(RB_LEFT(tmp, field), field) == RB_BLACK) {\
-					struct type *oright;		\
-					if ((oright = RB_RIGHT(tmp, field)))\
-						RB_COLOR(oright, field) = RB_BLACK;\
-					RB_COLOR(tmp, field) = RB_RED;	\
-					RB_ROTATE_LEFT(head, tmp, oright, field);\
-					tmp = RB_LEFT(parent, field);	\
-				}					\
-				RB_COLOR(tmp, field) = RB_COLOR(parent, field);\
-				RB_COLOR(parent, field) = RB_BLACK;	\
-				if (RB_LEFT(tmp, field))		\
-					RB_COLOR(RB_LEFT(tmp, field), field) = RB_BLACK;\
-				RB_ROTATE_RIGHT(head, parent, tmp, field);\
-				elm = RB_ROOT(head);			\
-				break;					\
-			}						\
-		}							\
-	}								\
-	if (elm)							\
-		RB_COLOR(elm, field) = RB_BLACK;			\
-}									\
-									\
-struct type *								\
-name##_RB_REMOVE(struct name *head, struct type *elm)			\
-{									\
-	struct type *child, *parent, *old = elm;			\
-	int color;							\
-	if (RB_LEFT(elm, field) == NULL)				\
-		child = RB_RIGHT(elm, field);				\
-	else if (RB_RIGHT(elm, field) == NULL)				\
-		child = RB_LEFT(elm, field);				\
-	else {								\
-		struct type *left;					\
-		elm = RB_RIGHT(elm, field);				\
-		while ((left = RB_LEFT(elm, field)))			\
-			elm = left;					\
-		child = RB_RIGHT(elm, field);				\
-		parent = RB_PARENT(elm, field);				\
-		color = RB_COLOR(elm, field);				\
-		if (child)						\
-			RB_PARENT(child, field) = parent;		\
-		if (parent) {						\
-			if (RB_LEFT(parent, field) == elm)		\
-				RB_LEFT(parent, field) = child;		\
-			else						\
-				RB_RIGHT(parent, field) = child;	\
-			RB_AUGMENT(parent);				\
-		} else							\
-			RB_ROOT(head) = child;				\
-		if (RB_PARENT(elm, field) == old)			\
-			parent = elm;					\
-		(elm)->field = (old)->field;				\
-		if (RB_PARENT(old, field)) {				\
-			if (RB_LEFT(RB_PARENT(old, field), field) == old)\
-				RB_LEFT(RB_PARENT(old, field), field) = elm;\
-			else						\
-				RB_RIGHT(RB_PARENT(old, field), field) = elm;\
-			RB_AUGMENT(RB_PARENT(old, field));		\
-		} else							\
-			RB_ROOT(head) = elm;				\
-		RB_PARENT(RB_LEFT(old, field), field) = elm;		\
-		if (RB_RIGHT(old, field))				\
-			RB_PARENT(RB_RIGHT(old, field), field) = elm;	\
-		if (parent) {						\
-			left = parent;					\
-			do {						\
-				RB_AUGMENT(left);			\
-			} while ((left = RB_PARENT(left, field)));	\
-		}							\
-		goto color;						\
-	}								\
-	parent = RB_PARENT(elm, field);					\
-	color = RB_COLOR(elm, field);					\
-	if (child)							\
-		RB_PARENT(child, field) = parent;			\
-	if (parent) {							\
-		if (RB_LEFT(parent, field) == elm)			\
-			RB_LEFT(parent, field) = child;			\
-		else							\
-			RB_RIGHT(parent, field) = child;		\
-		RB_AUGMENT(parent);					\
-	} else								\
-		RB_ROOT(head) = child;					\
-color:									\
-	if (color == RB_BLACK)						\
-		name##_RB_REMOVE_COLOR(head, parent, child);		\
-	return (old);							\
-}									\
-									\
-/* Inserts a node into the RB tree */					\
-struct type *								\
-name##_RB_INSERT(struct name *head, struct type *elm)			\
-{									\
-	struct type *tmp;						\
-	struct type *parent = NULL;					\
-	int comp = 0;							\
-	tmp = RB_ROOT(head);						\
-	while (tmp) {							\
-		parent = tmp;						\
-		comp = (cmp)(elm, parent);				\
-		if (comp < 0)						\
-			tmp = RB_LEFT(tmp, field);			\
-		else if (comp > 0)					\
-			tmp = RB_RIGHT(tmp, field);			\
-		else							\
-			return (tmp);					\
-	}								\
-	RB_SET(elm, parent, field);					\
-	if (parent != NULL) {						\
-		if (comp < 0)						\
-			RB_LEFT(parent, field) = elm;			\
-		else							\
-			RB_RIGHT(parent, field) = elm;			\
-		RB_AUGMENT(parent);					\
-	} else								\
-		RB_ROOT(head) = elm;					\
-	name##_RB_INSERT_COLOR(head, elm);				\
-	return (NULL);							\
-}									\
-									\
-/* Finds the node with the same key as elm */				\
-struct type *								\
-name##_RB_FIND(struct name *head, struct type *elm)			\
-{									\
-	struct type *tmp = RB_ROOT(head);				\
-	int comp;							\
-	while (tmp) {							\
-		comp = cmp(elm, tmp);					\
-		if (comp < 0)						\
-			tmp = RB_LEFT(tmp, field);			\
-		else if (comp > 0)					\
-			tmp = RB_RIGHT(tmp, field);			\
-		else							\
-			return (tmp);					\
-	}								\
-	return (NULL);							\
-}									\
-									\
-struct type *								\
-name##_RB_NEXT(struct type *elm)					\
-{									\
-	if (RB_RIGHT(elm, field)) {					\
-		elm = RB_RIGHT(elm, field);				\
-		while (RB_LEFT(elm, field))				\
-			elm = RB_LEFT(elm, field);			\
-	} else {							\
-		if (RB_PARENT(elm, field) &&				\
-		    (elm == RB_LEFT(RB_PARENT(elm, field), field)))	\
-			elm = RB_PARENT(elm, field);			\
-		else {							\
-			while (RB_PARENT(elm, field) &&			\
-			    (elm == RB_RIGHT(RB_PARENT(elm, field), field)))\
-				elm = RB_PARENT(elm, field);		\
-			elm = RB_PARENT(elm, field);			\
-		}							\
-	}								\
-	return (elm);							\
-}									\
-									\
-struct type *								\
-name##_RB_MINMAX(struct name *head, int val)				\
-{									\
-	struct type *tmp = RB_ROOT(head);				\
-	struct type *parent = NULL;					\
-	while (tmp) {							\
-		parent = tmp;						\
-		if (val < 0)						\
-			tmp = RB_LEFT(tmp, field);			\
-		else							\
-			tmp = RB_RIGHT(tmp, field);			\
-	}								\
-	return (parent);						\
-}
-
-#define RB_NEGINF	-1
-#define RB_INF	1
-
-#define RB_INSERT(name, x, y)	name##_RB_INSERT(x, y)
-#define RB_REMOVE(name, x, y)	name##_RB_REMOVE(x, y)
-#define RB_FIND(name, x, y)	name##_RB_FIND(x, y)
-#define RB_NEXT(name, x, y)	name##_RB_NEXT(y)
-#define RB_MIN(name, x)		name##_RB_MINMAX(x, RB_NEGINF)
-#define RB_MAX(name, x)		name##_RB_MINMAX(x, RB_INF)
-
-#define RB_FOREACH(x, name, head)					\
-	for ((x) = RB_MIN(name, head);					\
-	     (x) != NULL;						\
-	     (x) = name##_RB_NEXT(x))
-
-#endif	/* _SYS_TREE_H_ */
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/sntp/libevent/aclocal.m4 /cur/src/external/bsd/ntp/dist/sntp/libevent/aclocal.m4
--- external/bsd/ntp/dist/sntp/libevent/aclocal.m4	2013-12-27 15:31:19.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/sntp/libevent/aclocal.m4	2015-04-07 19:51:18.000000000 -0700
@@ -1131,6 +1131,7 @@
 ]) # _AM_PROG_TAR
 
 m4_include([m4/ac_backport_259_ssizet.m4])
+m4_include([m4/acx_pthread.m4])
 m4_include([m4/libevent_openssl.m4])
 m4_include([m4/libtool.m4])
 m4_include([m4/ltoptions.m4])
@@ -1138,5 +1139,3 @@
 m4_include([m4/ltversion.m4])
 m4_include([m4/lt~obsolete.m4])
 m4_include([m4/ntp_pkg_config.m4])
-m4_include([m4/openldap-thread-check.m4])
-m4_include([m4/openldap.m4])
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/sntp/libevent/buffer.c /cur/src/external/bsd/ntp/dist/sntp/libevent/buffer.c
--- external/bsd/ntp/dist/sntp/libevent/buffer.c	2014-12-24 18:28:14.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/sntp/libevent/buffer.c	2015-04-07 19:51:18.000000000 -0700
@@ -160,12 +160,20 @@
 	struct evbuffer_chain *chain;
 	size_t to_alloc;
 
+	if (size > EVBUFFER_CHAIN_MAX - EVBUFFER_CHAIN_SIZE)
+		return (NULL);
+
 	size += EVBUFFER_CHAIN_SIZE;
 
 	/* get the next largest memory that can hold the buffer */
-	to_alloc = MIN_BUFFER_SIZE;
-	while (to_alloc < size)
-		to_alloc <<= 1;
+	if (size < EVBUFFER_CHAIN_MAX / 2) {
+		to_alloc = MIN_BUFFER_SIZE;
+		while (to_alloc < size) {
+			to_alloc <<= 1;
+		}
+	} else {
+		to_alloc = size;
+	}
 
 	/* we get everything in one chunk */
 	if ((chain = mm_malloc(to_alloc)) == NULL)
@@ -1135,6 +1143,7 @@
 		}
 
 		buf->first = chain;
+		EVUTIL_ASSERT(chain && remaining <= chain->off);
 		chain->misalign += remaining;
 		chain->off -= remaining;
 	}
@@ -1183,6 +1192,10 @@
 	EVBUFFER_LOCK(buf);
 
 	if (pos) {
+		if (datlen > (size_t)(EV_SSIZE_MAX - pos->pos)) {
+			result = -1;
+			goto done;
+		}
 		chain = pos->internal_.chain;
 		pos_in_chain = pos->internal_.pos_in_chain;
 		if (datlen + pos->pos > buf->total_len)
@@ -1220,6 +1233,8 @@
 
 	if (datlen) {
 		EVUTIL_ASSERT(chain);
+		EVUTIL_ASSERT(datlen+pos_in_chain <= chain->off);
+
 		memcpy(data, chain->buffer + chain->misalign + pos_in_chain,
 		    datlen);
 	}
@@ -1714,6 +1729,10 @@
 	if (buf->freeze_end) {
 		goto done;
 	}
+	/* Prevent buf->total_len overflow */
+	if (datlen > EV_SIZE_MAX - buf->total_len) {
+		goto done;
+	}
 
 	chain = buf->last;
 
@@ -1727,7 +1746,10 @@
 	}
 
 	if ((chain->flags & EVBUFFER_IMMUTABLE) == 0) {
-		remain = (size_t)(chain->buffer_len - chain->misalign - chain->off);
+		/* Always true for mutable buffers */
+		EVUTIL_ASSERT(chain->misalign >= 0 &&
+		    (ev_uint64_t)chain->misalign <= EVBUFFER_CHAIN_MAX);
+		remain = chain->buffer_len - (size_t)chain->misalign - chain->off;
 		if (remain >= datlen) {
 			/* there's enough space to hold all the data in the
 			 * current last chain */
@@ -1798,6 +1820,9 @@
 	if (buf->freeze_start) {
 		goto done;
 	}
+	if (datlen > EV_SIZE_MAX - buf->total_len) {
+		goto done;
+	}
 
 	chain = buf->first;
 
@@ -1810,6 +1835,10 @@
 
 	/* we cannot touch immutable buffers */
 	if ((chain->flags & EVBUFFER_IMMUTABLE) == 0) {
+		/* Always true for mutable buffers */
+		EVUTIL_ASSERT(chain->misalign >= 0 &&
+		    (ev_uint64_t)chain->misalign <= EVBUFFER_CHAIN_MAX);
+
 		/* If this chain is empty, we can treat it as
 		 * 'empty at the beginning' rather than 'empty at the end' */
 		if (chain->off == 0)
@@ -1847,6 +1876,7 @@
 	tmp->next = chain;
 
 	tmp->off = datlen;
+	EVUTIL_ASSERT(datlen <= tmp->buffer_len);
 	tmp->misalign = tmp->buffer_len - datlen;
 
 	memcpy(tmp->buffer + tmp->misalign, data, datlen);
@@ -1945,7 +1975,9 @@
 
 	/* Would expanding this chunk be affordable and worthwhile? */
 	if (CHAIN_SPACE_LEN(chain) < chain->buffer_len / 8 ||
-	    chain->off > MAX_TO_COPY_IN_EXPAND) {
+	    chain->off > MAX_TO_COPY_IN_EXPAND ||
+	    (datlen < EVBUFFER_CHAIN_MAX &&
+		EVBUFFER_CHAIN_MAX - datlen >= chain->off)) {
 		/* It's not worth resizing this chain. Can the next one be
 		 * used? */
 		if (chain->next && CHAIN_SPACE_LEN(chain->next) >= datlen) {
@@ -2073,6 +2105,8 @@
 			rmv_all = 1;
 			avail = 0;
 		} else {
+			/* can't overflow, since only mutable chains have
+			 * huge misaligns. */
 			avail = (size_t) CHAIN_SPACE_LEN(chain);
 			chain = chain->next;
 		}
@@ -2083,6 +2117,7 @@
 			EVUTIL_ASSERT(chain->off == 0);
 			evbuffer_chain_free(chain);
 		}
+		EVUTIL_ASSERT(datlen >= avail);
 		tmp = evbuffer_chain_new(datlen - avail);
 		if (tmp == NULL) {
 			if (rmv_all) {
@@ -2212,6 +2247,7 @@
 	unsigned long lng = EVBUFFER_MAX_READ;
 	if (ioctlsocket(fd, FIONREAD, &lng) < 0)
 		return -1;
+	/* Can overflow, but mostly harmlessly. XXXX */
 	return (int)lng;
 #elif defined(FIONREAD)
 	int n = EVBUFFER_MAX_READ;
@@ -2324,8 +2360,14 @@
 #ifdef USE_IOVEC_IMPL
 	remaining = n;
 	for (i=0; i < nvecs; ++i) {
-		ev_ssize_t space = (ev_ssize_t) CHAIN_SPACE_LEN(*chainp);
-		if (space < remaining) {
+		/* can't overflow, since only mutable chains have
+		 * huge misaligns. */
+		size_t space = (size_t) CHAIN_SPACE_LEN(*chainp);
+		/* XXXX This is a kludge that can waste space in perverse
+		 * situations. */
+		if (space > EVBUFFER_CHAIN_MAX)
+			space = EVBUFFER_CHAIN_MAX;
+		if ((ev_ssize_t)space < remaining) {
 			(*chainp)->off += space;
 			remaining -= (int)space;
 		} else {
@@ -2487,9 +2529,11 @@
 		/* XXX(nickm) Don't disable this code until we know if
 		 * the WSARecv code above works. */
 		void *p = evbuffer_pullup(buffer, howmuch);
+		EVUTIL_ASSERT(p || !howmuch);
 		n = send(fd, p, howmuch, 0);
 #else
 		void *p = evbuffer_pullup(buffer, howmuch);
+		EVUTIL_ASSERT(p || !howmuch);
 		n = write(fd, p, howmuch);
 #endif
 #ifdef USE_SENDFILE
@@ -2540,6 +2584,8 @@
 evbuffer_ptr_subtract(struct evbuffer *buf, struct evbuffer_ptr *pos,
     size_t howfar)
 {
+	if (pos->pos < 0)
+		return -1;
 	if (howfar > (size_t)pos->pos)
 		return -1;
 	if (pos->internal_.chain && howfar <= pos->internal_.pos_in_chain) {
@@ -2573,12 +2619,17 @@
 	case EVBUFFER_PTR_ADD:
 		/* this avoids iterating over all previous chains if
 		   we just want to advance the position */
+		if (pos->pos < 0 || EV_SIZE_MAX - position < (size_t)pos->pos) {
+			EVBUFFER_UNLOCK(buf);
+			return -1;
+		}
 		chain = pos->internal_.chain;
 		pos->pos += position;
 		position = pos->internal_.pos_in_chain;
 		break;
 	}
 
+	EVUTIL_ASSERT(EV_SIZE_MAX - left >= position);
 	while (chain && position + left >= chain->off) {
 		left -= chain->off - position;
 		chain = chain->next;
@@ -2615,7 +2666,9 @@
 
 	ASSERT_EVBUFFER_LOCKED(buf);
 
-	if (pos->pos + len > buf->total_len)
+	if (pos->pos < 0 ||
+	    EV_SIZE_MAX - len < (size_t)pos->pos ||
+	    pos->pos + len > buf->total_len)
 		return -1;
 
 	chain = pos->internal_.chain;
@@ -2742,7 +2795,10 @@
 	if (n_vec == 0 && len < 0) {
 		/* If no vectors are provided and they asked for "everything",
 		 * pretend they asked for the actual available amount. */
-		len = buffer->total_len - len_so_far;
+		len = buffer->total_len;
+		if (start_at) {
+			len -= start_at->pos;
+		}
 	}
 
 	while (chain) {
@@ -2806,6 +2862,9 @@
 
 		if (sz < 0)
 			goto done;
+		if (INT_MAX >= EVBUFFER_CHAIN_MAX &&
+		    (size_t)sz >= EVBUFFER_CHAIN_MAX)
+			goto done;
 		if ((size_t)sz < space) {
 			chain->off += sz;
 			buf->total_len += sz;
@@ -2915,6 +2974,11 @@
 	}
 	seg->length = length;
 
+	if (offset < 0 || length < 0 ||
+	    ((ev_uint64_t)length > EVBUFFER_CHAIN_MAX) ||
+	    (ev_uint64_t)offset > (ev_uint64_t)(EVBUFFER_CHAIN_MAX - length))
+		goto err;
+
 #if defined(USE_SENDFILE)
 	if (!(flags & EVBUF_FS_DISABLE_SENDFILE)) {
 		seg->can_sendfile = 1;
@@ -3203,7 +3267,7 @@
 	return 0;
 err:
 	EVBUFFER_UNLOCK(buf);
-	evbuffer_file_segment_free(seg);
+	evbuffer_file_segment_free(seg); /* Lowers the refcount */
 	return -1;
 }
 
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/sntp/libevent/bufferevent.c /cur/src/external/bsd/ntp/dist/sntp/libevent/bufferevent.c
--- external/bsd/ntp/dist/sntp/libevent/bufferevent.c	2014-12-24 18:28:14.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/sntp/libevent/bufferevent.c	2015-04-07 19:51:18.000000000 -0700
@@ -601,7 +601,7 @@
 				      bufev_private->read_watermarks_cb,
 				      EVBUFFER_CB_ENABLED|EVBUFFER_CB_NODEFER);
 
-			if (evbuffer_get_length(bufev->input) > highmark)
+			if (evbuffer_get_length(bufev->input) >= highmark)
 				bufferevent_wm_suspend_read(bufev);
 			else if (evbuffer_get_length(bufev->input) < highmark)
 				bufferevent_wm_unsuspend_read(bufev);
@@ -617,25 +617,30 @@
 	BEV_UNLOCK(bufev);
 }
 
-void
+int
 bufferevent_getwatermark(struct bufferevent *bufev, short events,
     size_t *lowmark, size_t *highmark)
 {
-	BEV_LOCK(bufev);
 	if (events == EV_WRITE) {
+		BEV_LOCK(bufev);
 		if (lowmark)
 			*lowmark = bufev->wm_write.low;
 		if (highmark)
 			*highmark = bufev->wm_write.high;
+		BEV_UNLOCK(bufev);
+		return 0;
 	}
 
 	if (events == EV_READ) {
+		BEV_LOCK(bufev);
 		if (lowmark)
 			*lowmark = bufev->wm_read.low;
 		if (highmark)
 			*highmark = bufev->wm_read.high;
+		BEV_UNLOCK(bufev);
+		return 0;
 	}
-	BEV_UNLOCK(bufev);
+	return -1;
 }
 
 int
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/sntp/libevent/bufferevent_async.c /cur/src/external/bsd/ntp/dist/sntp/libevent/bufferevent_async.c
--- external/bsd/ntp/dist/sntp/libevent/bufferevent_async.c	2014-12-24 18:28:14.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/sntp/libevent/bufferevent_async.c	2015-04-07 19:51:18.000000000 -0700
@@ -383,9 +383,10 @@
 	bev_async_del_write(bev_async);
 
 	fd = evbuffer_overlapped_get_fd_(bev->input);
-	if (bev_p->options & BEV_OPT_CLOSE_ON_FREE) {
-		/* XXXX possible double-close */
+	if (fd != (evutil_socket_t)INVALID_SOCKET &&
+		(bev_p->options & BEV_OPT_CLOSE_ON_FREE)) {
 		evutil_closesocket(fd);
+		evbuffer_overlapped_set_fd_(bev->input, INVALID_SOCKET);
 	}
 }
 
@@ -566,9 +567,9 @@
 	event_overlapped_init_(&bev_a->read_overlapped, read_complete);
 	event_overlapped_init_(&bev_a->write_overlapped, write_complete);
 
+	bufferevent_init_generic_timeout_cbs_(bev);
+
 	bev_a->ok = fd >= 0;
-	if (bev_a->ok)
-		bufferevent_init_generic_timeout_cbs_(bev);
 
 	return bev;
 err:
@@ -673,6 +674,7 @@
 		if (fd != (evutil_socket_t)INVALID_SOCKET &&
 		    (bev_a->bev.options & BEV_OPT_CLOSE_ON_FREE)) {
 			closesocket(fd);
+			evbuffer_overlapped_set_fd_(bev->input, INVALID_SOCKET);
 		}
 		bev_a->ok = 0;
 		return 0;
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/sntp/libevent/bufferevent_filter.c /cur/src/external/bsd/ntp/dist/sntp/libevent/bufferevent_filter.c
--- external/bsd/ntp/dist/sntp/libevent/bufferevent_filter.c	2014-12-24 18:28:14.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/sntp/libevent/bufferevent_filter.c	2015-04-07 19:51:18.000000000 -0700
@@ -427,26 +427,34 @@
 	enum bufferevent_filter_result res;
 	enum bufferevent_flush_mode state;
 	struct bufferevent *bufev = downcast(bevf);
+	struct bufferevent_private *bufev_private = BEV_UPCAST(bufev);
 	int processed_any = 0;
 
-	bufferevent_incref_and_lock_(bufev);
+	BEV_LOCK(bufev);
 
-	if (bevf->got_eof)
-		state = BEV_FINISHED;
-	else
-		state = BEV_NORMAL;
+	// It's possible our refcount is 0 at this point if another thread free'd our filterevent
+	EVUTIL_ASSERT(bufev_private->refcnt >= 0);
 
-	/* XXXX use return value */
-	res = be_filter_process_input(bevf, state, &processed_any);
-	(void)res;
-
-	/* XXX This should be in process_input, not here.  There are
-	 * other places that can call process-input, and they should
-	 * force readcb calls as needed. */
-	if (processed_any)
-		bufferevent_trigger_nolock_(bufev, EV_READ, 0);
+	// If our refcount is > 0
+	if (bufev_private->refcnt > 0) {
 
-	bufferevent_decref_and_unlock_(bufev);
+		if (bevf->got_eof)
+			state = BEV_FINISHED;
+		else
+			state = BEV_NORMAL;
+
+		/* XXXX use return value */
+		res = be_filter_process_input(bevf, state, &processed_any);
+		(void)res;
+
+		/* XXX This should be in process_input, not here.  There are
+		 * other places that can call process-input, and they should
+		 * force readcb calls as needed. */
+		if (processed_any)
+			bufferevent_trigger_nolock_(bufev, EV_READ, 0);
+	}
+
+	BEV_UNLOCK(bufev);
 }
 
 /* Called when the underlying socket has drained enough that we can write to
@@ -456,11 +464,20 @@
 {
 	struct bufferevent_filtered *bevf = me_;
 	struct bufferevent *bev = downcast(bevf);
+	struct bufferevent_private *bufev_private = BEV_UPCAST(bev);
 	int processed_any = 0;
 
-	bufferevent_incref_and_lock_(bev);
-	be_filter_process_output(bevf, BEV_NORMAL, &processed_any);
-	bufferevent_decref_and_unlock_(bev);
+	BEV_LOCK(bev);
+
+	// It's possible our refcount is 0 at this point if another thread free'd our filterevent
+	EVUTIL_ASSERT(bufev_private->refcnt >= 0);
+
+	// If our refcount is > 0
+	if (bufev_private->refcnt > 0) {
+		be_filter_process_output(bevf, BEV_NORMAL, &processed_any);
+	}
+
+	BEV_UNLOCK(bev);
 }
 
 /* Called when the underlying socket has given us an error */
@@ -469,11 +486,21 @@
 {
 	struct bufferevent_filtered *bevf = me_;
 	struct bufferevent *bev = downcast(bevf);
+	struct bufferevent_private *bufev_private = BEV_UPCAST(bev);
+
+	BEV_LOCK(bev);
+
+	// It's possible our refcount is 0 at this point if another thread free'd our filterevent
+	EVUTIL_ASSERT(bufev_private->refcnt >= 0);
+
+	// If our refcount is > 0
+	if (bufev_private->refcnt > 0) {
+
+		/* All we can really to is tell our own eventcb. */
+		bufferevent_run_eventcb_(bev, what, 0);
+	}
 
-	bufferevent_incref_and_lock_(bev);
-	/* All we can really to is tell our own eventcb. */
-	bufferevent_run_eventcb_(bev, what, 0);
-	bufferevent_decref_and_unlock_(bev);
+	BEV_UNLOCK(bev);
 }
 
 static int
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/sntp/libevent/bufferevent_openssl.c /cur/src/external/bsd/ntp/dist/sntp/libevent/bufferevent_openssl.c
--- external/bsd/ntp/dist/sntp/libevent/bufferevent_openssl.c	2014-12-24 18:28:14.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/sntp/libevent/bufferevent_openssl.c	2015-04-07 19:51:18.000000000 -0700
@@ -1278,6 +1278,8 @@
 			SSL_set_bio(bev_ssl->ssl, bio, bio);
 			bev_ssl->fd_is_set = 1;
 		}
+		if (data->fd == -1)
+			bev_ssl->fd_is_set = 0;
 		if (bev_ssl->state == BUFFEREVENT_SSL_OPEN)
 			return set_open_callbacks(bev_ssl, data->fd);
 		else {
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/sntp/libevent/bufferevent_pair.c /cur/src/external/bsd/ntp/dist/sntp/libevent/bufferevent_pair.c
--- external/bsd/ntp/dist/sntp/libevent/bufferevent_pair.c	2014-12-24 18:28:14.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/sntp/libevent/bufferevent_pair.c	2015-04-07 19:51:18.000000000 -0700
@@ -47,6 +47,8 @@
 struct bufferevent_pair {
 	struct bufferevent_private bev;
 	struct bufferevent_pair *partner;
+	/* For ->destruct() lock checking */
+	struct bufferevent_pair *unlinked_partner;
 };
 
 
@@ -267,11 +269,40 @@
 	struct bufferevent_pair *bev_p = upcast(bev);
 
 	if (bev_p->partner) {
+		bev_p->unlinked_partner = bev_p->partner;
 		bev_p->partner->partner = NULL;
 		bev_p->partner = NULL;
 	}
 }
 
+/* Free *shared* lock in the latest be (since we share it between two of them). */
+static void
+be_pair_destruct(struct bufferevent *bev)
+{
+	struct bufferevent_pair *bev_p = upcast(bev);
+
+	/* Transfer ownership of the lock into partner, otherwise we will use
+	 * already free'd lock during freeing second bev, see next example:
+	 *
+	 * bev1->own_lock = 1
+	 * bev2->own_lock = 0
+	 * bev2->lock = bev1->lock
+	 *
+	 * bufferevent_free(bev1) # refcnt == 0 -> unlink
+	 * bufferevent_free(bev2) # refcnt == 0 -> unlink
+	 *
+	 * event_base_free() -> finilizers -> EVTHREAD_FREE_LOCK(bev1->lock)
+	 *                                 -> BEV_LOCK(bev2->lock) <-- already freed
+	 *
+	 * Where bev1 == pair[0], bev2 == pair[1].
+	 */
+	if (bev_p->unlinked_partner && bev_p->bev.own_lock) {
+		bev_p->unlinked_partner->bev.own_lock = 1;
+		bev_p->bev.own_lock = 0;
+	}
+	bev_p->unlinked_partner = NULL;
+}
+
 static int
 be_pair_flush(struct bufferevent *bev, short iotype,
     enum bufferevent_flush_mode mode)
@@ -322,7 +353,7 @@
 	be_pair_enable,
 	be_pair_disable,
 	be_pair_unlink,
-	NULL, /* be_pair_destruct, */
+	be_pair_destruct,
 	bufferevent_generic_adj_timeouts_,
 	be_pair_flush,
 	NULL, /* ctrl */
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/sntp/libevent/config.h.in /cur/src/external/bsd/ntp/dist/sntp/libevent/config.h.in
--- external/bsd/ntp/dist/sntp/libevent/config.h.in	2014-12-19 12:37:46.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/sntp/libevent/config.h.in	2015-04-07 19:51:18.000000000 -0700
@@ -24,9 +24,6 @@
 /* Define to 1 if you have the `clock_gettime' function. */
 #undef HAVE_CLOCK_GETTIME
 
-/* Define to 1 if you have the <cthreads.h> header file. */
-#undef HAVE_CTHREADS_H
-
 /* Define to 1 if you have the declaration of `CTL_KERN', and to 0 if you
    don't. */
 #undef HAVE_DECL_CTL_KERN
@@ -109,9 +106,6 @@
 /* Define to 1 if you have the `gettimeofday' function. */
 #undef HAVE_GETTIMEOFDAY
 
-/* if you have GNU Pth */
-#undef HAVE_GNU_PTH
-
 /* Define to 1 if you have the <ifaddrs.h> header file. */
 #undef HAVE_IFADDRS_H
 
@@ -133,24 +127,9 @@
 /* Define if the system has zlib */
 #undef HAVE_LIBZ
 
-/* if you have LinuxThreads */
-#undef HAVE_LINUX_THREADS
-
-/* if you have SunOS LWP package */
-#undef HAVE_LWP
-
-/* Define to 1 if you have the <lwp/lwp.h> header file. */
-#undef HAVE_LWP_LWP_H
-
 /* Define to 1 if you have the `mach_absolute_time' function. */
 #undef HAVE_MACH_ABSOLUTE_TIME
 
-/* define if you have Mach Cthreads */
-#undef HAVE_MACH_CTHREADS
-
-/* Define to 1 if you have the <mach/cthreads.h> header file. */
-#undef HAVE_MACH_CTHREADS_H
-
 /* Define to 1 if you have the <mach/mach_time.h> header file. */
 #undef HAVE_MACH_MACH_TIME_H
 
@@ -175,15 +154,6 @@
 /* Define to 1 if you have the <netinet/tcp.h> header file. */
 #undef HAVE_NETINET_TCP_H
 
-/* if you have NT Event Log */
-#undef HAVE_NT_EVENT_LOG
-
-/* if you have NT Service Manager */
-#undef HAVE_NT_SERVICE_MANAGER
-
-/* if you have NT Threads */
-#undef HAVE_NT_THREADS
-
 /* Define if the system has openssl */
 #undef HAVE_OPENSSL
 
@@ -208,48 +178,15 @@
 /* Define if you have POSIX threads libraries and header files. */
 #undef HAVE_PTHREAD
 
-/* define to pthreads API spec revision */
+/* Define if we have pthreads on this system */
 #undef HAVE_PTHREADS
 
-/* define if you have pthread_detach function */
-#undef HAVE_PTHREAD_DETACH
-
-/* Define to 1 if you have the `pthread_getconcurrency' function. */
-#undef HAVE_PTHREAD_GETCONCURRENCY
-
-/* Define to 1 if you have the <pthread.h> header file. */
-#undef HAVE_PTHREAD_H
-
-/* Define to 1 if you have the `pthread_kill' function. */
-#undef HAVE_PTHREAD_KILL
-
-/* Define to 1 if you have the `pthread_kill_other_threads_np' function. */
-#undef HAVE_PTHREAD_KILL_OTHER_THREADS_NP
-
-/* define if you have pthread_rwlock_destroy function */
-#undef HAVE_PTHREAD_RWLOCK_DESTROY
-
-/* Define to 1 if you have the `pthread_setconcurrency' function. */
-#undef HAVE_PTHREAD_SETCONCURRENCY
-
-/* Define to 1 if you have the `pthread_yield' function. */
-#undef HAVE_PTHREAD_YIELD
-
-/* Define to 1 if you have the <pth.h> header file. */
-#undef HAVE_PTH_H
-
 /* Define to 1 if you have the `putenv' function. */
 #undef HAVE_PUTENV
 
 /* Define to 1 if the system has the type `sa_family_t'. */
 #undef HAVE_SA_FAMILY_T
 
-/* Define to 1 if you have the <sched.h> header file. */
-#undef HAVE_SCHED_H
-
-/* Define to 1 if you have the `sched_yield' function. */
-#undef HAVE_SCHED_YIELD
-
 /* Define to 1 if you have the `select' function. */
 #undef HAVE_SELECT
 
@@ -337,9 +274,6 @@
 /* Define to 1 if the system has the type `struct so_linger'. */
 #undef HAVE_STRUCT_SO_LINGER
 
-/* Define to 1 if you have the <synch.h> header file. */
-#undef HAVE_SYNCH_H
-
 /* Define to 1 if you have the `sysctl' function. */
 #undef HAVE_SYSCTL
 
@@ -403,21 +337,6 @@
 /* Define if TAILQ_FOREACH is defined in <sys/queue.h> */
 #undef HAVE_TAILQFOREACH
 
-/* if you have Solaris LWP (thr) package */
-#undef HAVE_THR
-
-/* Define to 1 if you have the <thread.h> header file. */
-#undef HAVE_THREAD_H
-
-/* Define to 1 if you have the `thr_getconcurrency' function. */
-#undef HAVE_THR_GETCONCURRENCY
-
-/* Define to 1 if you have the `thr_setconcurrency' function. */
-#undef HAVE_THR_SETCONCURRENCY
-
-/* Define to 1 if you have the `thr_yield' function. */
-#undef HAVE_THR_YIELD
-
 /* Define if timeradd is defined in <sys/time.h> */
 #undef HAVE_TIMERADD
 
@@ -466,15 +385,9 @@
 /* Define if kqueue works correctly with pipes */
 #undef HAVE_WORKING_KQUEUE
 
-/* define if select implicitly yields */
-#undef HAVE_YIELDING_SELECT
-
 /* Define to 1 if you have the <zlib.h> header file. */
 #undef HAVE_ZLIB_H
 
-/* define to 1 if library is thread safe */
-#undef LDAP_API_FEATURE_X_OPENLDAP_THREAD_SAFE
-
 /* Define to the sub-directory in which libtool stores uninstalled libraries.
    */
 #undef LT_OBJDIR
@@ -482,9 +395,6 @@
 /* Define to 1 if your C compiler doesn't accept -c and -o together. */
 #undef NO_MINUS_C_MINUS_O
 
-/* define if you have (or want) no threads */
-#undef NO_THREADS
-
 /* Numeric representation of the version */
 #undef NUMERIC_VERSION
 
@@ -509,11 +419,9 @@
 /* Define to the version of this package. */
 #undef PACKAGE_VERSION
 
-/* enable thread safety */
-#undef REENTRANT
-
-/* define if sched_yield yields the entire process */
-#undef REPLACE_BROKEN_YIELD
+/* Define to necessary symbol if this constant uses a non-standard name on
+   your system. */
+#undef PTHREAD_CREATE_JOINABLE
 
 /* The size of `int', as computed by sizeof. */
 #undef SIZEOF_INT
@@ -542,12 +450,6 @@
 /* Define to 1 if you have the ANSI C header files. */
 #undef STDC_HEADERS
 
-/* enable thread safety */
-#undef THREADSAFE
-
-/* enable thread safety */
-#undef THREAD_SAFE
-
 /* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
 #undef TIME_WITH_SYS_TIME
 
@@ -570,18 +472,6 @@
 /* Define to 1 if you need to in order for `stat' and other things to work. */
 #undef _POSIX_SOURCE
 
-/* enable thread safety */
-#undef _REENTRANT
-
-/* enable thread safety */
-#undef _SGI_MP_SOURCE
-
-/* enable thread safety */
-#undef _THREADSAFE
-
-/* enable thread safety */
-#undef _THREAD_SAFE
-
 /* Define to 500 only on HP-UX. */
 #undef _XOPEN_SOURCE
 
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/sntp/libevent/configure /cur/src/external/bsd/ntp/dist/sntp/libevent/configure
--- external/bsd/ntp/dist/sntp/libevent/configure	2014-12-19 12:37:46.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/sntp/libevent/configure	2015-04-07 19:51:18.000000000 -0700
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.68 for libevent 2.1.3-alpha-dev.
+# Generated by GNU Autoconf 2.68 for libevent 2.1.5-beta.
 #
 #
 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@@ -567,8 +567,8 @@
 # Identity of this package.
 PACKAGE_NAME='libevent'
 PACKAGE_TARNAME='libevent'
-PACKAGE_VERSION='2.1.3-alpha-dev'
-PACKAGE_STRING='libevent 2.1.3-alpha-dev'
+PACKAGE_VERSION='2.1.5-beta'
+PACKAGE_STRING='libevent 2.1.5-beta'
 PACKAGE_BUGREPORT=''
 PACKAGE_URL=''
 
@@ -619,6 +619,8 @@
 PTHREADS_TRUE
 PTHREAD_CFLAGS
 PTHREAD_LIBS
+PTHREAD_CC
+acx_pthread_config
 SIGNAL_SUPPORT_FALSE
 SIGNAL_SUPPORT_TRUE
 EVPORT_BACKEND_FALSE
@@ -655,6 +657,8 @@
 ZLIB_LIBS
 BUILD_REGRESS_FALSE
 BUILD_REGRESS_TRUE
+BUILD_SAMPLES_FALSE
+BUILD_SAMPLES_TRUE
 LIBTOOL_DEPS
 OTOOL64
 OTOOL
@@ -778,6 +782,7 @@
 enable_debug_mode
 enable_libevent_install
 enable_libevent_regress
+enable_samples
 enable_function_sections
 enable_verbose_debug
 enable_shared
@@ -788,8 +793,6 @@
 with_sysroot
 enable_libtool_lock
 enable_largefile
-with_threads
-with_yielding_select
 '
       ac_precious_vars='build_alias
 host_alias
@@ -1342,7 +1345,7 @@
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures libevent 2.1.3-alpha-dev to adapt to many kinds of systems.
+\`configure' configures libevent 2.1.5-beta to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1412,7 +1415,7 @@
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of libevent 2.1.3-alpha-dev:";;
+     short | recursive ) echo "Configuration of libevent 2.1.5-beta:";;
    esac
   cat <<\_ACEOF
 
@@ -1437,6 +1440,8 @@
 
   --disable-libevent-regress, skip regress in make check
 
+  --disable-samples, skip building of sample programs
+
   --enable-function-sections, make static library allow smaller binaries with --gc-sections
 
   --enable-verbose-debug, verbose debug logging
@@ -1456,8 +1461,6 @@
   --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
   --with-sysroot=DIR Search for dependent libraries within DIR
                         (or the compiler's sysroot if not specified).
-  --with-threads	  with threads [auto]
-  --with-yielding-select  with yielding select [auto]
 
 Some influential environment variables:
   CC          C compiler command
@@ -1535,7 +1538,7 @@
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-libevent configure 2.1.3-alpha-dev
+libevent configure 2.1.5-beta
 generated by GNU Autoconf 2.68
 
 Copyright (C) 2010 Free Software Foundation, Inc.
@@ -2235,7 +2238,7 @@
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by libevent $as_me 2.1.3-alpha-dev, which was
+It was created by libevent $as_me 2.1.5-beta, which was
 generated by GNU Autoconf 2.68.  Invocation command line was
 
   $ $0 $@
@@ -2616,7 +2619,6 @@
 ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.
 
 
-
 am__api_version='1.11'
 
 # Find a good install program.  We prefer a C program (faster),
@@ -3055,7 +3057,7 @@
 
 # Define the identity of the package.
  PACKAGE='libevent'
- VERSION='2.1.3-alpha-dev'
+ VERSION='2.1.5-beta'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -3110,7 +3112,7 @@
 ac_config_headers="$ac_config_headers config.h evconfig-private.h:evconfig-private.h.in"
 
 
-$as_echo "#define NUMERIC_VERSION 0x02010301" >>confdefs.h
+$as_echo "#define NUMERIC_VERSION 0x02010500" >>confdefs.h
 
 
 if test "$prefix" = "NONE"; then
@@ -5004,6 +5006,13 @@
   enable_libevent_regress=yes
 fi
 
+# Check whether --enable-samples was given.
+if test "${enable_samples+set}" = set; then :
+  enableval=$enable_samples;
+else
+  enable_samples=yes
+fi
+
 # Check whether --enable-function-sections was given.
 if test "${enable_function_sections+set}" = set; then :
   enableval=$enable_function_sections;
@@ -12071,6 +12080,14 @@
 
 
 
+ if test "$enable_samples" = "yes"; then
+  BUILD_SAMPLES_TRUE=
+  BUILD_SAMPLES_FALSE='#'
+else
+  BUILD_SAMPLES_TRUE='#'
+  BUILD_SAMPLES_FALSE=
+fi
+
  if test "$enable_libevent_regress" = "yes"; then
   BUILD_REGRESS_TRUE=
   BUILD_REGRESS_FALSE='#'
@@ -14825,58 +14842,127 @@
 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
-# OpenLDAP --with-threads
+acx_pthread_ok=no
 
-# Check whether --with-threads was given.
-if test "${with_threads+set}" = set; then :
-  withval=$with_threads;
-	ol_arg=invalid
-	for ol_val in auto nt posix mach pth lwp yes no manual  ; do
-		if test "$withval" = "$ol_val" ; then
-			ol_arg="$ol_val"
-		fi
-	done
-	if test "$ol_arg" = "invalid" ; then
-		as_fn_error $? "bad value $withval for --with-threads" "$LINENO" 5
-	fi
-	ol_with_threads="$ol_arg"
+# We used to check for pthread.h first, but this fails if pthread.h
+# requires special compiler flags (e.g. on True64 or Sequent).
+# It gets checked for in the link test anyway.
+
+# First of all, check if the user has set any of the PTHREAD_LIBS,
+# etcetera environment variables, and if threads linking works using
+# them:
+if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then
+        save_CFLAGS="$CFLAGS"
+        CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+        save_LIBS="$LIBS"
+        LIBS="$PTHREAD_LIBS $LIBS"
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS" >&5
+$as_echo_n "checking for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS... " >&6; }
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
-else
-  	ol_with_threads="auto"
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char pthread_join ();
+int
+main ()
+{
+return pthread_join ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  acx_pthread_ok=yes
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $acx_pthread_ok" >&5
+$as_echo "$acx_pthread_ok" >&6; }
+        if test x"$acx_pthread_ok" = xno; then
+                PTHREAD_LIBS=""
+                PTHREAD_CFLAGS=""
+        fi
+        LIBS="$save_LIBS"
+        CFLAGS="$save_CFLAGS"
 fi
-# end --with-threads
 
+# We must check for the threads library under a number of different
+# names; the ordering is very important because some systems
+# (e.g. DEC) have both -lpthread and -lpthreads, where one of the
+# libraries is broken (non-POSIX).
+
+# Create a list of thread flags to try.  Items starting with a "-" are
+# C compiler flags, and other items are library names, except for "none"
+# which indicates that we try without any flags at all, and "pthread-config"
+# which is a program returning the flags for the Pth emulation library.
+
+acx_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config"
+
+# The ordering *is* (sometimes) important.  Some notes on the
+# individual items follow:
+
+# pthreads: AIX (must check this before -lpthread)
+# none: in case threads are in libc; should be tried before -Kthread and
+#       other compiler flags to prevent continual compiler warnings
+# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h)
+# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)
+# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread)
+# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads)
+# -pthreads: Solaris/gcc
+# -mthreads: Mingw32/gcc, Lynx/gcc
+# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it
+#      doesn't hurt to check since this sometimes defines pthreads too;
+#      also defines -D_REENTRANT)
+#      ... -mt is also the pthreads flag for HP/aCC
+# pthread: Linux, etcetera
+# --thread-safe: KAI C++
+# pthread-config: use pthread-config program (for GNU Pth library)
+
+case "${host_cpu}-${host_os}" in
+        *solaris*)
+
+        # On Solaris (at least, for some versions), libc contains stubbed
+        # (non-functional) versions of the pthreads routines, so link-based
+        # tests will erroneously succeed.  (We need to link with -pthreads/-mt/
+        # -lpthread.)  (The stubs are missing pthread_cleanup_push, or rather
+        # a function called by this macro, so we could check for that, but
+        # who knows whether they'll stub that too in a future libc.)  So,
+        # we'll just look for -pthreads and -lpthread first:
 
-case "$ol_with_threads$host" in
- auto*-*-solaris2.[0-6])
-        ol_with_threads=no
-    ;;
+        acx_pthread_flags="-pthreads pthread -mt -pthread $acx_pthread_flags"
+        ;;
 esac
 
+if test x"$acx_pthread_ok" = xno; then
+for flag in $acx_pthread_flags; do
 
-ol_aix_threads=no
-case "$host" in
-*-*-aix*) 	if test -z "$CC" ; then
-		case "$ol_with_threads" in
-		auto | yes |  posix) ol_aix_threads=yes ;;
-		esac
-	fi
-;;
-esac
-
-if test $ol_aix_threads = yes ; then
-	if test -z "${CC}" ; then
-		for ac_prog in cc_r xlc_r cc
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
+        case $flag in
+                none)
+                { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work without any flags" >&5
+$as_echo_n "checking whether pthreads work without any flags... " >&6; }
+                ;;
+
+                -*)
+                { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work with $flag" >&5
+$as_echo_n "checking whether pthreads work with $flag... " >&6; }
+                PTHREAD_CFLAGS="$flag"
+                ;;
+
+		pthread-config)
+		# Extract the first word of "pthread-config", so it can be a program name with args.
+set dummy pthread-config; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
+if ${ac_cv_prog_acx_pthread_config+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  if test -n "$CC"; then
-  ac_cv_prog_CC="$CC" # Let the user override the test.
+  if test -n "$acx_pthread_config"; then
+  ac_cv_prog_acx_pthread_config="$acx_pthread_config" # Let the user override the test.
 else
 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
@@ -14885,7 +14971,7 @@
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_CC="$ac_prog"
+    ac_cv_prog_acx_pthread_config="yes"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
@@ -14893,4456 +14979,273 @@
   done
 IFS=$as_save_IFS
 
+  test -z "$ac_cv_prog_acx_pthread_config" && ac_cv_prog_acx_pthread_config="no"
 fi
 fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
+acx_pthread_config=$ac_cv_prog_acx_pthread_config
+if test -n "$acx_pthread_config"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $acx_pthread_config" >&5
+$as_echo "$acx_pthread_config" >&6; }
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
 
-  test -n "$CC" && break
-done
-
-
-		if test "$CC" = cc ; then
-						if test $ol_with_threads != auto ; then
-				as_fn_error $? "--with-threads requires cc_r (or other suitable compiler) on AIX" "$LINENO" 5
-			else
-				{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: disabling threads, no cc_r on AIX" >&5
-$as_echo "$as_me: WARNING: disabling threads, no cc_r on AIX" >&2;}
-			fi
-			ol_with_threads=no
-  		fi
-	fi
-
-	case ${CC} in cc_r | xlc_r)
-		ol_with_threads=posix
-		ol_cv_pthread_create=yes
+		if test x"$acx_pthread_config" = xno; then continue; fi
+		PTHREAD_CFLAGS="`pthread-config --cflags`"
+		PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`"
 		;;
-	esac
-fi
-
-ol_link_threads=no
-# OpenLDAP --with-yielding_select
-
-# Check whether --with-yielding_select was given.
-if test "${with_yielding_select+set}" = set; then :
-  withval=$with_yielding_select;
-	ol_arg=invalid
-	for ol_val in auto yes no manual  ; do
-		if test "$withval" = "$ol_val" ; then
-			ol_arg="$ol_val"
-		fi
-	done
-	if test "$ol_arg" = "invalid" ; then
-		as_fn_error $? "bad value $withval for --with-yielding_select" "$LINENO" 5
-	fi
-	ol_with_yielding_select="$ol_arg"
-
-else
-  	ol_with_yielding_select="auto"
-fi
-# end --with-yielding_select
-
-
-case $ol_with_threads in auto | yes | nt)
-
 
-	ac_fn_c_check_func "$LINENO" "_beginthread" "ac_cv_func__beginthread"
-if test "x$ac_cv_func__beginthread" = xyes; then :
-
-fi
-
-
-	if test $ac_cv_func__beginthread = yes ; then
-
-$as_echo "#define HAVE_NT_THREADS 1" >>confdefs.h
-
-		ol_cv_nt_threads=yes
-	fi
-
-
-	if test "$ol_cv_nt_threads" = yes ; then
-		ol_link_threads=nt
-		ol_with_threads=found
-		ol_with_yielding_select=yes
-
-
-$as_echo "#define HAVE_NT_SERVICE_MANAGER 1" >>confdefs.h
-
-
-$as_echo "#define HAVE_NT_EVENT_LOG 1" >>confdefs.h
-
-	fi
-
-	if test $ol_with_threads = nt ; then
-		as_fn_error $? "could not locate NT Threads" "$LINENO" 5
-	fi
-	;;
-esac
-
-case $ol_with_threads in auto | yes | posix)
-
-	for ac_header in pthread.h
-do :
-  ac_fn_c_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default"
-if test "x$ac_cv_header_pthread_h" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_PTHREAD_H 1
+                *)
+                { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the pthreads library -l$flag" >&5
+$as_echo_n "checking for the pthreads library -l$flag... " >&6; }
+                PTHREAD_LIBS="-l$flag"
+                ;;
+        esac
+
+        save_LIBS="$LIBS"
+        save_CFLAGS="$CFLAGS"
+        LIBS="$PTHREAD_LIBS $LIBS"
+        CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+
+        # Check for various functions.  We must include pthread.h,
+        # since some functions may be macros.  (On the Sequent, we
+        # need a special flag -Kthread to make this header compile.)
+        # We check for pthread_join because it is in -lpthread on IRIX
+        # while pthread_create is in libc.  We check for pthread_attr_init
+        # due to DEC craziness with -lpthreads.  We check for
+        # pthread_cleanup_push because it is one of the few pthread
+        # functions on Solaris that doesn't have a non-functional libc stub.
+        # We try pthread_create on general principles.
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <pthread.h>
+int
+main ()
+{
+pthread_t th; pthread_join(th, 0);
+                     pthread_attr_init(0); pthread_cleanup_push(0, 0);
+                     pthread_create(0,0,0,0); pthread_cleanup_pop(0);
+  ;
+  return 0;
+}
 _ACEOF
-
+if ac_fn_c_try_link "$LINENO"; then :
+  acx_pthread_ok=yes
 fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
 
-done
+        LIBS="$save_LIBS"
+        CFLAGS="$save_CFLAGS"
 
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $acx_pthread_ok" >&5
+$as_echo "$acx_pthread_ok" >&6; }
+        if test "x$acx_pthread_ok" = xyes; then
+                break;
+        fi
 
-	if test $ac_cv_header_pthread_h = yes ; then
-		{ $as_echo "$as_me:${as_lineno-$LINENO}: checking POSIX thread version" >&5
-$as_echo_n "checking POSIX thread version... " >&6; }
-if ${ol_cv_pthread_version+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+        PTHREAD_LIBS=""
+        PTHREAD_CFLAGS=""
+done
+fi
 
-	cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+# Various other checks:
+if test "x$acx_pthread_ok" = xyes; then
+        save_LIBS="$LIBS"
+        LIBS="$PTHREAD_LIBS $LIBS"
+        save_CFLAGS="$CFLAGS"
+        CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+
+        # Detect AIX lossage: JOINABLE attribute is called UNDETACHED.
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for joinable pthread attribute" >&5
+$as_echo_n "checking for joinable pthread attribute... " >&6; }
+	attr_name=unknown
+	for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do
+	    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-
-#		include <pthread.h>
-
+#include <pthread.h>
 int
 main ()
 {
-
-		int i = PTHREAD_CREATE_JOINABLE;
-
+int attr=$attr; return attr;
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-	cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <pthread.h>
+if ac_fn_c_try_link "$LINENO"; then :
+  attr_name=$attr; break
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+	done
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $attr_name" >&5
+$as_echo "$attr_name" >&6; }
+        if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then
 
+cat >>confdefs.h <<_ACEOF
+#define PTHREAD_CREATE_JOINABLE $attr_name
 _ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "pthread_detach" >/dev/null 2>&1; then :
-  ol_cv_pthread_version=10
-else
-  ol_cv_pthread_version=8
-fi
-rm -f conftest*
 
-else
+        fi
 
-	cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking if more special flags are required for pthreads" >&5
+$as_echo_n "checking if more special flags are required for pthreads... " >&6; }
+        flag=no
+        case "${host_cpu}-${host_os}" in
+            *-aix* | *-freebsd* | *-darwin*) flag="-D_THREAD_SAFE";;
+            *solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";;
+        esac
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${flag}" >&5
+$as_echo "${flag}" >&6; }
+        if test "x$flag" != xno; then
+            PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS"
+        fi
 
-#		include <pthread.h>
-#		ifdef PTHREAD_CREATE_UNDETACHED
-		draft7
-#		endif
+        LIBS="$save_LIBS"
+        CFLAGS="$save_CFLAGS"
 
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "draft7" >/dev/null 2>&1; then :
-  ol_cv_pthread_version=7
+        # More AIX lossage: must compile with xlc_r or cc_r
+	if test x"$GCC" != xyes; then
+          for ac_prog in xlc_r cc_r
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_PTHREAD_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
+  if test -n "$PTHREAD_CC"; then
+  ac_cv_prog_PTHREAD_CC="$PTHREAD_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_PTHREAD_CC="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
 
-	cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <pthread.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "pthread_attr_init" >/dev/null 2>&1; then :
-  ol_cv_pthread_version=6
+fi
+fi
+PTHREAD_CC=$ac_cv_prog_PTHREAD_CC
+if test -n "$PTHREAD_CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PTHREAD_CC" >&5
+$as_echo "$PTHREAD_CC" >&6; }
 else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
 
-	cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
 
-#		include <pthread.h>
-#ifdef		PTHREAD_MUTEX_INITIALIZER
-		draft5
-#endif
+  test -n "$PTHREAD_CC" && break
+done
+test -n "$PTHREAD_CC" || PTHREAD_CC="${CC}"
 
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "draft5" >/dev/null 2>&1; then :
-  ol_cv_pthread_version=5
+        else
+          PTHREAD_CC=$CC
+	fi
 else
-  ol_cv_pthread_version=4
+        PTHREAD_CC="$CC"
 fi
-rm -f conftest*
 
-fi
-rm -f conftest*
 
-fi
-rm -f conftest*
 
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_version" >&5
-$as_echo "$ol_cv_pthread_version" >&6; }
 
+# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
+if test x"$acx_pthread_ok" = xyes; then
 
-		if test $ol_cv_pthread_version != 0 ; then
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_PTHREADS $ol_cv_pthread_version
-_ACEOF
+$as_echo "#define HAVE_PTHREADS 1" >>confdefs.h
 
-		else
-			as_fn_error $? "unknown pthread version" "$LINENO" 5
-		fi
+	have_pthreads=yes
+        :
+else
+        acx_pthread_ok=no
 
-		# consider threads found
-		ol_with_threads=found
+fi
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LinuxThreads pthread.h" >&5
-$as_echo_n "checking for LinuxThreads pthread.h... " >&6; }
-if ${ol_cv_header_linux_threads+:} false; then :
+  CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+  # The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of pthread_t" >&5
+$as_echo_n "checking size of pthread_t... " >&6; }
+if ${ac_cv_sizeof_pthread_t+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <pthread.h>
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "pthread_kill_other_threads_np" >/dev/null 2>&1; then :
-  ol_cv_header_linux_threads=yes
+  if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (pthread_t))" "ac_cv_sizeof_pthread_t"        "$ac_includes_default
+      #include <pthread.h>
+
+"; then :
+
 else
-  ol_cv_header_linux_threads=no
+  if test "$ac_cv_type_pthread_t" = yes; then
+     { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (pthread_t)
+See \`config.log' for more details" "$LINENO" 5; }
+   else
+     ac_cv_sizeof_pthread_t=0
+   fi
 fi
-rm -f conftest*
-
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_header_linux_threads" >&5
-$as_echo "$ol_cv_header_linux_threads" >&6; }
-	if test $ol_cv_header_linux_threads = yes; then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_pthread_t" >&5
+$as_echo "$ac_cv_sizeof_pthread_t" >&6; }
 
-$as_echo "#define HAVE_LINUX_THREADS 1" >>confdefs.h
 
-	fi
 
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_PTHREAD_T $ac_cv_sizeof_pthread_t
+_ACEOF
 
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU Pth pthread.h" >&5
-$as_echo_n "checking for GNU Pth pthread.h... " >&6; }
-if ${ol_cv_header_gnu_pth_pthread_h+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <pthread.h>
-#ifdef _POSIX_THREAD_IS_GNU_PTH
-	__gnu_pth__;
-#endif
 
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "__gnu_pth__" >/dev/null 2>&1; then :
-  ol_cv_header_gnu_pth_pthread_h=yes
+fi
+ if test "$have_pthreads" != "no" && test "$enable_thread_support" != "no"; then
+  PTHREADS_TRUE=
+  PTHREADS_FALSE='#'
 else
-  ol_cv_header_gnu_pth_pthread_h=no
+  PTHREADS_TRUE='#'
+  PTHREADS_FALSE=
 fi
-rm -f conftest*
 
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_header_gnu_pth_pthread_h" >&5
-$as_echo "$ol_cv_header_gnu_pth_pthread_h" >&6; }
-
+# check if we should compile locking into the library
+if test x$enable_thread_support = xno; then
 
-		if test $ol_cv_header_gnu_pth_pthread_h = no ; then
-			for ac_header in sched.h
-do :
-  ac_fn_c_check_header_mongrel "$LINENO" "sched.h" "ac_cv_header_sched_h" "$ac_includes_default"
-if test "x$ac_cv_header_sched_h" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_SCHED_H 1
-_ACEOF
+$as_echo "#define DISABLE_THREAD_SUPPORT 1" >>confdefs.h
 
 fi
 
-done
+# check if we should hard-code the mm functions.
+if test x$enable_malloc_replacement = xno; then
 
-		fi
+$as_echo "#define DISABLE_MM_REPLACEMENT 1" >>confdefs.h
 
+fi
 
-				{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in default libraries" >&5
-$as_echo_n "checking for pthread_create in default libraries... " >&6; }
-if ${ol_cv_pthread_create+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+# check if we should hard-code debugging out
+if test x$enable_debug_mode = xno; then
 
-			if test "$cross_compiling" = yes; then :
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* pthread test headers */
-#include <pthread.h>
-#if HAVE_PTHREADS < 7
-#include <errno.h>
-#endif
-#ifndef NULL
-#define NULL (void*)0
-#endif
-
-static void *task(p)
-	void *p;
-{
-	return (void *) (p == NULL);
-}
-
-int
-main ()
-{
-
-	/* pthread test function */
-#ifndef PTHREAD_CREATE_DETACHED
-#define	PTHREAD_CREATE_DETACHED	1
-#endif
-	pthread_t t;
-	int status;
-	int detach = PTHREAD_CREATE_DETACHED;
-
-#if HAVE_PTHREADS > 4
-	/* Final pthreads */
-	pthread_attr_t attr;
-
-	status = pthread_attr_init(&attr);
-	if( status ) return status;
-
-#if HAVE_PTHREADS < 7
-	status = pthread_attr_setdetachstate(&attr, &detach);
-	if( status < 0 ) status = errno;
-#else
-	status = pthread_attr_setdetachstate(&attr, detach);
-#endif
-	if( status ) return status;
-	status = pthread_create( &t, &attr, task, NULL );
-#if HAVE_PTHREADS < 7
-	if( status < 0 ) status = errno;
-#endif
-	if( status ) return status;
-#else
-	/* Draft 4 pthreads */
-	status = pthread_create( &t, pthread_attr_default, task, NULL );
-	if( status ) return errno;
-
-	/* give thread a chance to complete */
-	/* it should remain joinable and hence detachable */
-	sleep( 1 );
-
-	status = pthread_detach( &t );
-	if( status ) return errno;
-#endif
-
-#ifdef HAVE_LINUX_THREADS
-	pthread_kill_other_threads_np();
-#endif
-
-	return 0;
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ol_cv_pthread_create=yes
-else
-  ol_cv_pthread_create=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-
-/* pthread test headers */
-#include <pthread.h>
-#if HAVE_PTHREADS < 7
-#include <errno.h>
-#endif
-#ifndef NULL
-#define NULL (void*)0
-#endif
-
-static void *task(p)
-	void *p;
-{
-	return (void *) (p == NULL);
-}
-
-
-int main(argc, argv)
-	int argc;
-	char **argv;
-{
-
-	/* pthread test function */
-#ifndef PTHREAD_CREATE_DETACHED
-#define	PTHREAD_CREATE_DETACHED	1
-#endif
-	pthread_t t;
-	int status;
-	int detach = PTHREAD_CREATE_DETACHED;
-
-#if HAVE_PTHREADS > 4
-	/* Final pthreads */
-	pthread_attr_t attr;
-
-	status = pthread_attr_init(&attr);
-	if( status ) return status;
-
-#if HAVE_PTHREADS < 7
-	status = pthread_attr_setdetachstate(&attr, &detach);
-	if( status < 0 ) status = errno;
-#else
-	status = pthread_attr_setdetachstate(&attr, detach);
-#endif
-	if( status ) return status;
-	status = pthread_create( &t, &attr, task, NULL );
-#if HAVE_PTHREADS < 7
-	if( status < 0 ) status = errno;
-#endif
-	if( status ) return status;
-#else
-	/* Draft 4 pthreads */
-	status = pthread_create( &t, pthread_attr_default, task, NULL );
-	if( status ) return errno;
-
-	/* give thread a chance to complete */
-	/* it should remain joinable and hence detachable */
-	sleep( 1 );
-
-	status = pthread_detach( &t );
-	if( status ) return errno;
-#endif
-
-#ifdef HAVE_LINUX_THREADS
-	pthread_kill_other_threads_np();
-#endif
-
-	return 0;
-
-}
-
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  ol_cv_pthread_create=yes
-else
-  ol_cv_pthread_create=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_create" >&5
-$as_echo "$ol_cv_pthread_create" >&6; }
-
-		if test $ol_cv_pthread_create != no ; then
-			ol_link_threads=posix
-			ol_link_pthreads=""
-		fi
-
-		# Pthread try link: -kthread (ol_cv_pthread_kthread)
-if test "$ol_link_threads" = no ; then
-	# try -kthread
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread link with -kthread" >&5
-$as_echo_n "checking for pthread link with -kthread... " >&6; }
-if ${ol_cv_pthread_kthread+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-
-		# save the flags
-		ol_LIBS="$LIBS"
-		LIBS="-kthread $LIBS"
-
-		if test "$cross_compiling" = yes; then :
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* pthread test headers */
-#include <pthread.h>
-#if HAVE_PTHREADS < 7
-#include <errno.h>
-#endif
-#ifndef NULL
-#define NULL (void*)0
-#endif
-
-static void *task(p)
-	void *p;
-{
-	return (void *) (p == NULL);
-}
-
-int
-main ()
-{
-
-	/* pthread test function */
-#ifndef PTHREAD_CREATE_DETACHED
-#define	PTHREAD_CREATE_DETACHED	1
-#endif
-	pthread_t t;
-	int status;
-	int detach = PTHREAD_CREATE_DETACHED;
-
-#if HAVE_PTHREADS > 4
-	/* Final pthreads */
-	pthread_attr_t attr;
-
-	status = pthread_attr_init(&attr);
-	if( status ) return status;
-
-#if HAVE_PTHREADS < 7
-	status = pthread_attr_setdetachstate(&attr, &detach);
-	if( status < 0 ) status = errno;
-#else
-	status = pthread_attr_setdetachstate(&attr, detach);
-#endif
-	if( status ) return status;
-	status = pthread_create( &t, &attr, task, NULL );
-#if HAVE_PTHREADS < 7
-	if( status < 0 ) status = errno;
-#endif
-	if( status ) return status;
-#else
-	/* Draft 4 pthreads */
-	status = pthread_create( &t, pthread_attr_default, task, NULL );
-	if( status ) return errno;
-
-	/* give thread a chance to complete */
-	/* it should remain joinable and hence detachable */
-	sleep( 1 );
-
-	status = pthread_detach( &t );
-	if( status ) return errno;
-#endif
-
-#ifdef HAVE_LINUX_THREADS
-	pthread_kill_other_threads_np();
-#endif
-
-	return 0;
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ol_cv_pthread_kthread=yes
-else
-  ol_cv_pthread_kthread=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-
-/* pthread test headers */
-#include <pthread.h>
-#if HAVE_PTHREADS < 7
-#include <errno.h>
-#endif
-#ifndef NULL
-#define NULL (void*)0
-#endif
-
-static void *task(p)
-	void *p;
-{
-	return (void *) (p == NULL);
-}
-
-
-int main(argc, argv)
-	int argc;
-	char **argv;
-{
-
-	/* pthread test function */
-#ifndef PTHREAD_CREATE_DETACHED
-#define	PTHREAD_CREATE_DETACHED	1
-#endif
-	pthread_t t;
-	int status;
-	int detach = PTHREAD_CREATE_DETACHED;
-
-#if HAVE_PTHREADS > 4
-	/* Final pthreads */
-	pthread_attr_t attr;
-
-	status = pthread_attr_init(&attr);
-	if( status ) return status;
-
-#if HAVE_PTHREADS < 7
-	status = pthread_attr_setdetachstate(&attr, &detach);
-	if( status < 0 ) status = errno;
-#else
-	status = pthread_attr_setdetachstate(&attr, detach);
-#endif
-	if( status ) return status;
-	status = pthread_create( &t, &attr, task, NULL );
-#if HAVE_PTHREADS < 7
-	if( status < 0 ) status = errno;
-#endif
-	if( status ) return status;
-#else
-	/* Draft 4 pthreads */
-	status = pthread_create( &t, pthread_attr_default, task, NULL );
-	if( status ) return errno;
-
-	/* give thread a chance to complete */
-	/* it should remain joinable and hence detachable */
-	sleep( 1 );
-
-	status = pthread_detach( &t );
-	if( status ) return errno;
-#endif
-
-#ifdef HAVE_LINUX_THREADS
-	pthread_kill_other_threads_np();
-#endif
-
-	return 0;
-
-}
-
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  ol_cv_pthread_kthread=yes
-else
-  ol_cv_pthread_kthread=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-
-		# restore the LIBS
-		LIBS="$ol_LIBS"
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_kthread" >&5
-$as_echo "$ol_cv_pthread_kthread" >&6; }
-
-	if test $ol_cv_pthread_kthread = yes ; then
-		ol_link_pthreads="-kthread"
-		ol_link_threads=posix
-	fi
-fi
-
-		# Pthread try link: -pthread (ol_cv_pthread_pthread)
-if test "$ol_link_threads" = no ; then
-	# try -pthread
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread link with -pthread" >&5
-$as_echo_n "checking for pthread link with -pthread... " >&6; }
-if ${ol_cv_pthread_pthread+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-
-		# save the flags
-		ol_LIBS="$LIBS"
-		LIBS="-pthread $LIBS"
-
-		if test "$cross_compiling" = yes; then :
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* pthread test headers */
-#include <pthread.h>
-#if HAVE_PTHREADS < 7
-#include <errno.h>
-#endif
-#ifndef NULL
-#define NULL (void*)0
-#endif
-
-static void *task(p)
-	void *p;
-{
-	return (void *) (p == NULL);
-}
-
-int
-main ()
-{
-
-	/* pthread test function */
-#ifndef PTHREAD_CREATE_DETACHED
-#define	PTHREAD_CREATE_DETACHED	1
-#endif
-	pthread_t t;
-	int status;
-	int detach = PTHREAD_CREATE_DETACHED;
-
-#if HAVE_PTHREADS > 4
-	/* Final pthreads */
-	pthread_attr_t attr;
-
-	status = pthread_attr_init(&attr);
-	if( status ) return status;
-
-#if HAVE_PTHREADS < 7
-	status = pthread_attr_setdetachstate(&attr, &detach);
-	if( status < 0 ) status = errno;
-#else
-	status = pthread_attr_setdetachstate(&attr, detach);
-#endif
-	if( status ) return status;
-	status = pthread_create( &t, &attr, task, NULL );
-#if HAVE_PTHREADS < 7
-	if( status < 0 ) status = errno;
-#endif
-	if( status ) return status;
-#else
-	/* Draft 4 pthreads */
-	status = pthread_create( &t, pthread_attr_default, task, NULL );
-	if( status ) return errno;
-
-	/* give thread a chance to complete */
-	/* it should remain joinable and hence detachable */
-	sleep( 1 );
-
-	status = pthread_detach( &t );
-	if( status ) return errno;
-#endif
-
-#ifdef HAVE_LINUX_THREADS
-	pthread_kill_other_threads_np();
-#endif
-
-	return 0;
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ol_cv_pthread_pthread=yes
-else
-  ol_cv_pthread_pthread=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-
-/* pthread test headers */
-#include <pthread.h>
-#if HAVE_PTHREADS < 7
-#include <errno.h>
-#endif
-#ifndef NULL
-#define NULL (void*)0
-#endif
-
-static void *task(p)
-	void *p;
-{
-	return (void *) (p == NULL);
-}
-
-
-int main(argc, argv)
-	int argc;
-	char **argv;
-{
-
-	/* pthread test function */
-#ifndef PTHREAD_CREATE_DETACHED
-#define	PTHREAD_CREATE_DETACHED	1
-#endif
-	pthread_t t;
-	int status;
-	int detach = PTHREAD_CREATE_DETACHED;
-
-#if HAVE_PTHREADS > 4
-	/* Final pthreads */
-	pthread_attr_t attr;
-
-	status = pthread_attr_init(&attr);
-	if( status ) return status;
-
-#if HAVE_PTHREADS < 7
-	status = pthread_attr_setdetachstate(&attr, &detach);
-	if( status < 0 ) status = errno;
-#else
-	status = pthread_attr_setdetachstate(&attr, detach);
-#endif
-	if( status ) return status;
-	status = pthread_create( &t, &attr, task, NULL );
-#if HAVE_PTHREADS < 7
-	if( status < 0 ) status = errno;
-#endif
-	if( status ) return status;
-#else
-	/* Draft 4 pthreads */
-	status = pthread_create( &t, pthread_attr_default, task, NULL );
-	if( status ) return errno;
-
-	/* give thread a chance to complete */
-	/* it should remain joinable and hence detachable */
-	sleep( 1 );
-
-	status = pthread_detach( &t );
-	if( status ) return errno;
-#endif
-
-#ifdef HAVE_LINUX_THREADS
-	pthread_kill_other_threads_np();
-#endif
-
-	return 0;
-
-}
-
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  ol_cv_pthread_pthread=yes
-else
-  ol_cv_pthread_pthread=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-
-		# restore the LIBS
-		LIBS="$ol_LIBS"
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_pthread" >&5
-$as_echo "$ol_cv_pthread_pthread" >&6; }
-
-	if test $ol_cv_pthread_pthread = yes ; then
-		ol_link_pthreads="-pthread"
-		ol_link_threads=posix
-	fi
-fi
-
-		# Pthread try link: -pthreads (ol_cv_pthread_pthreads)
-if test "$ol_link_threads" = no ; then
-	# try -pthreads
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread link with -pthreads" >&5
-$as_echo_n "checking for pthread link with -pthreads... " >&6; }
-if ${ol_cv_pthread_pthreads+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-
-		# save the flags
-		ol_LIBS="$LIBS"
-		LIBS="-pthreads $LIBS"
-
-		if test "$cross_compiling" = yes; then :
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* pthread test headers */
-#include <pthread.h>
-#if HAVE_PTHREADS < 7
-#include <errno.h>
-#endif
-#ifndef NULL
-#define NULL (void*)0
-#endif
-
-static void *task(p)
-	void *p;
-{
-	return (void *) (p == NULL);
-}
-
-int
-main ()
-{
-
-	/* pthread test function */
-#ifndef PTHREAD_CREATE_DETACHED
-#define	PTHREAD_CREATE_DETACHED	1
-#endif
-	pthread_t t;
-	int status;
-	int detach = PTHREAD_CREATE_DETACHED;
-
-#if HAVE_PTHREADS > 4
-	/* Final pthreads */
-	pthread_attr_t attr;
-
-	status = pthread_attr_init(&attr);
-	if( status ) return status;
-
-#if HAVE_PTHREADS < 7
-	status = pthread_attr_setdetachstate(&attr, &detach);
-	if( status < 0 ) status = errno;
-#else
-	status = pthread_attr_setdetachstate(&attr, detach);
-#endif
-	if( status ) return status;
-	status = pthread_create( &t, &attr, task, NULL );
-#if HAVE_PTHREADS < 7
-	if( status < 0 ) status = errno;
-#endif
-	if( status ) return status;
-#else
-	/* Draft 4 pthreads */
-	status = pthread_create( &t, pthread_attr_default, task, NULL );
-	if( status ) return errno;
-
-	/* give thread a chance to complete */
-	/* it should remain joinable and hence detachable */
-	sleep( 1 );
-
-	status = pthread_detach( &t );
-	if( status ) return errno;
-#endif
-
-#ifdef HAVE_LINUX_THREADS
-	pthread_kill_other_threads_np();
-#endif
-
-	return 0;
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ol_cv_pthread_pthreads=yes
-else
-  ol_cv_pthread_pthreads=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-
-/* pthread test headers */
-#include <pthread.h>
-#if HAVE_PTHREADS < 7
-#include <errno.h>
-#endif
-#ifndef NULL
-#define NULL (void*)0
-#endif
-
-static void *task(p)
-	void *p;
-{
-	return (void *) (p == NULL);
-}
-
-
-int main(argc, argv)
-	int argc;
-	char **argv;
-{
-
-	/* pthread test function */
-#ifndef PTHREAD_CREATE_DETACHED
-#define	PTHREAD_CREATE_DETACHED	1
-#endif
-	pthread_t t;
-	int status;
-	int detach = PTHREAD_CREATE_DETACHED;
-
-#if HAVE_PTHREADS > 4
-	/* Final pthreads */
-	pthread_attr_t attr;
-
-	status = pthread_attr_init(&attr);
-	if( status ) return status;
-
-#if HAVE_PTHREADS < 7
-	status = pthread_attr_setdetachstate(&attr, &detach);
-	if( status < 0 ) status = errno;
-#else
-	status = pthread_attr_setdetachstate(&attr, detach);
-#endif
-	if( status ) return status;
-	status = pthread_create( &t, &attr, task, NULL );
-#if HAVE_PTHREADS < 7
-	if( status < 0 ) status = errno;
-#endif
-	if( status ) return status;
-#else
-	/* Draft 4 pthreads */
-	status = pthread_create( &t, pthread_attr_default, task, NULL );
-	if( status ) return errno;
-
-	/* give thread a chance to complete */
-	/* it should remain joinable and hence detachable */
-	sleep( 1 );
-
-	status = pthread_detach( &t );
-	if( status ) return errno;
-#endif
-
-#ifdef HAVE_LINUX_THREADS
-	pthread_kill_other_threads_np();
-#endif
-
-	return 0;
-
-}
-
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  ol_cv_pthread_pthreads=yes
-else
-  ol_cv_pthread_pthreads=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-
-		# restore the LIBS
-		LIBS="$ol_LIBS"
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_pthreads" >&5
-$as_echo "$ol_cv_pthread_pthreads" >&6; }
-
-	if test $ol_cv_pthread_pthreads = yes ; then
-		ol_link_pthreads="-pthreads"
-		ol_link_threads=posix
-	fi
-fi
-
-		# Pthread try link: -mthreads (ol_cv_pthread_mthreads)
-if test "$ol_link_threads" = no ; then
-	# try -mthreads
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread link with -mthreads" >&5
-$as_echo_n "checking for pthread link with -mthreads... " >&6; }
-if ${ol_cv_pthread_mthreads+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-
-		# save the flags
-		ol_LIBS="$LIBS"
-		LIBS="-mthreads $LIBS"
-
-		if test "$cross_compiling" = yes; then :
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* pthread test headers */
-#include <pthread.h>
-#if HAVE_PTHREADS < 7
-#include <errno.h>
-#endif
-#ifndef NULL
-#define NULL (void*)0
-#endif
-
-static void *task(p)
-	void *p;
-{
-	return (void *) (p == NULL);
-}
-
-int
-main ()
-{
-
-	/* pthread test function */
-#ifndef PTHREAD_CREATE_DETACHED
-#define	PTHREAD_CREATE_DETACHED	1
-#endif
-	pthread_t t;
-	int status;
-	int detach = PTHREAD_CREATE_DETACHED;
-
-#if HAVE_PTHREADS > 4
-	/* Final pthreads */
-	pthread_attr_t attr;
-
-	status = pthread_attr_init(&attr);
-	if( status ) return status;
-
-#if HAVE_PTHREADS < 7
-	status = pthread_attr_setdetachstate(&attr, &detach);
-	if( status < 0 ) status = errno;
-#else
-	status = pthread_attr_setdetachstate(&attr, detach);
-#endif
-	if( status ) return status;
-	status = pthread_create( &t, &attr, task, NULL );
-#if HAVE_PTHREADS < 7
-	if( status < 0 ) status = errno;
-#endif
-	if( status ) return status;
-#else
-	/* Draft 4 pthreads */
-	status = pthread_create( &t, pthread_attr_default, task, NULL );
-	if( status ) return errno;
-
-	/* give thread a chance to complete */
-	/* it should remain joinable and hence detachable */
-	sleep( 1 );
-
-	status = pthread_detach( &t );
-	if( status ) return errno;
-#endif
-
-#ifdef HAVE_LINUX_THREADS
-	pthread_kill_other_threads_np();
-#endif
-
-	return 0;
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ol_cv_pthread_mthreads=yes
-else
-  ol_cv_pthread_mthreads=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-
-/* pthread test headers */
-#include <pthread.h>
-#if HAVE_PTHREADS < 7
-#include <errno.h>
-#endif
-#ifndef NULL
-#define NULL (void*)0
-#endif
-
-static void *task(p)
-	void *p;
-{
-	return (void *) (p == NULL);
-}
-
-
-int main(argc, argv)
-	int argc;
-	char **argv;
-{
-
-	/* pthread test function */
-#ifndef PTHREAD_CREATE_DETACHED
-#define	PTHREAD_CREATE_DETACHED	1
-#endif
-	pthread_t t;
-	int status;
-	int detach = PTHREAD_CREATE_DETACHED;
-
-#if HAVE_PTHREADS > 4
-	/* Final pthreads */
-	pthread_attr_t attr;
-
-	status = pthread_attr_init(&attr);
-	if( status ) return status;
-
-#if HAVE_PTHREADS < 7
-	status = pthread_attr_setdetachstate(&attr, &detach);
-	if( status < 0 ) status = errno;
-#else
-	status = pthread_attr_setdetachstate(&attr, detach);
-#endif
-	if( status ) return status;
-	status = pthread_create( &t, &attr, task, NULL );
-#if HAVE_PTHREADS < 7
-	if( status < 0 ) status = errno;
-#endif
-	if( status ) return status;
-#else
-	/* Draft 4 pthreads */
-	status = pthread_create( &t, pthread_attr_default, task, NULL );
-	if( status ) return errno;
-
-	/* give thread a chance to complete */
-	/* it should remain joinable and hence detachable */
-	sleep( 1 );
-
-	status = pthread_detach( &t );
-	if( status ) return errno;
-#endif
-
-#ifdef HAVE_LINUX_THREADS
-	pthread_kill_other_threads_np();
-#endif
-
-	return 0;
-
-}
-
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  ol_cv_pthread_mthreads=yes
-else
-  ol_cv_pthread_mthreads=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-
-		# restore the LIBS
-		LIBS="$ol_LIBS"
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_mthreads" >&5
-$as_echo "$ol_cv_pthread_mthreads" >&6; }
-
-	if test $ol_cv_pthread_mthreads = yes ; then
-		ol_link_pthreads="-mthreads"
-		ol_link_threads=posix
-	fi
-fi
-
-		# Pthread try link: -thread (ol_cv_pthread_thread)
-if test "$ol_link_threads" = no ; then
-	# try -thread
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread link with -thread" >&5
-$as_echo_n "checking for pthread link with -thread... " >&6; }
-if ${ol_cv_pthread_thread+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-
-		# save the flags
-		ol_LIBS="$LIBS"
-		LIBS="-thread $LIBS"
-
-		if test "$cross_compiling" = yes; then :
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* pthread test headers */
-#include <pthread.h>
-#if HAVE_PTHREADS < 7
-#include <errno.h>
-#endif
-#ifndef NULL
-#define NULL (void*)0
-#endif
-
-static void *task(p)
-	void *p;
-{
-	return (void *) (p == NULL);
-}
-
-int
-main ()
-{
-
-	/* pthread test function */
-#ifndef PTHREAD_CREATE_DETACHED
-#define	PTHREAD_CREATE_DETACHED	1
-#endif
-	pthread_t t;
-	int status;
-	int detach = PTHREAD_CREATE_DETACHED;
-
-#if HAVE_PTHREADS > 4
-	/* Final pthreads */
-	pthread_attr_t attr;
-
-	status = pthread_attr_init(&attr);
-	if( status ) return status;
-
-#if HAVE_PTHREADS < 7
-	status = pthread_attr_setdetachstate(&attr, &detach);
-	if( status < 0 ) status = errno;
-#else
-	status = pthread_attr_setdetachstate(&attr, detach);
-#endif
-	if( status ) return status;
-	status = pthread_create( &t, &attr, task, NULL );
-#if HAVE_PTHREADS < 7
-	if( status < 0 ) status = errno;
-#endif
-	if( status ) return status;
-#else
-	/* Draft 4 pthreads */
-	status = pthread_create( &t, pthread_attr_default, task, NULL );
-	if( status ) return errno;
-
-	/* give thread a chance to complete */
-	/* it should remain joinable and hence detachable */
-	sleep( 1 );
-
-	status = pthread_detach( &t );
-	if( status ) return errno;
-#endif
-
-#ifdef HAVE_LINUX_THREADS
-	pthread_kill_other_threads_np();
-#endif
-
-	return 0;
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ol_cv_pthread_thread=yes
-else
-  ol_cv_pthread_thread=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-
-/* pthread test headers */
-#include <pthread.h>
-#if HAVE_PTHREADS < 7
-#include <errno.h>
-#endif
-#ifndef NULL
-#define NULL (void*)0
-#endif
-
-static void *task(p)
-	void *p;
-{
-	return (void *) (p == NULL);
-}
-
-
-int main(argc, argv)
-	int argc;
-	char **argv;
-{
-
-	/* pthread test function */
-#ifndef PTHREAD_CREATE_DETACHED
-#define	PTHREAD_CREATE_DETACHED	1
-#endif
-	pthread_t t;
-	int status;
-	int detach = PTHREAD_CREATE_DETACHED;
-
-#if HAVE_PTHREADS > 4
-	/* Final pthreads */
-	pthread_attr_t attr;
-
-	status = pthread_attr_init(&attr);
-	if( status ) return status;
-
-#if HAVE_PTHREADS < 7
-	status = pthread_attr_setdetachstate(&attr, &detach);
-	if( status < 0 ) status = errno;
-#else
-	status = pthread_attr_setdetachstate(&attr, detach);
-#endif
-	if( status ) return status;
-	status = pthread_create( &t, &attr, task, NULL );
-#if HAVE_PTHREADS < 7
-	if( status < 0 ) status = errno;
-#endif
-	if( status ) return status;
-#else
-	/* Draft 4 pthreads */
-	status = pthread_create( &t, pthread_attr_default, task, NULL );
-	if( status ) return errno;
-
-	/* give thread a chance to complete */
-	/* it should remain joinable and hence detachable */
-	sleep( 1 );
-
-	status = pthread_detach( &t );
-	if( status ) return errno;
-#endif
-
-#ifdef HAVE_LINUX_THREADS
-	pthread_kill_other_threads_np();
-#endif
-
-	return 0;
-
-}
-
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  ol_cv_pthread_thread=yes
-else
-  ol_cv_pthread_thread=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-
-		# restore the LIBS
-		LIBS="$ol_LIBS"
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_thread" >&5
-$as_echo "$ol_cv_pthread_thread" >&6; }
-
-	if test $ol_cv_pthread_thread = yes ; then
-		ol_link_pthreads="-thread"
-		ol_link_threads=posix
-	fi
-fi
-
-
-		# Pthread try link: -lpthread -lmach -lexc -lc_r (ol_cv_pthread_lpthread_lmach_lexc_lc_r)
-if test "$ol_link_threads" = no ; then
-	# try -lpthread -lmach -lexc -lc_r
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread link with -lpthread -lmach -lexc -lc_r" >&5
-$as_echo_n "checking for pthread link with -lpthread -lmach -lexc -lc_r... " >&6; }
-if ${ol_cv_pthread_lpthread_lmach_lexc_lc_r+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-
-		# save the flags
-		ol_LIBS="$LIBS"
-		LIBS="-lpthread -lmach -lexc -lc_r $LIBS"
-
-		if test "$cross_compiling" = yes; then :
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* pthread test headers */
-#include <pthread.h>
-#if HAVE_PTHREADS < 7
-#include <errno.h>
-#endif
-#ifndef NULL
-#define NULL (void*)0
-#endif
-
-static void *task(p)
-	void *p;
-{
-	return (void *) (p == NULL);
-}
-
-int
-main ()
-{
-
-	/* pthread test function */
-#ifndef PTHREAD_CREATE_DETACHED
-#define	PTHREAD_CREATE_DETACHED	1
-#endif
-	pthread_t t;
-	int status;
-	int detach = PTHREAD_CREATE_DETACHED;
-
-#if HAVE_PTHREADS > 4
-	/* Final pthreads */
-	pthread_attr_t attr;
-
-	status = pthread_attr_init(&attr);
-	if( status ) return status;
-
-#if HAVE_PTHREADS < 7
-	status = pthread_attr_setdetachstate(&attr, &detach);
-	if( status < 0 ) status = errno;
-#else
-	status = pthread_attr_setdetachstate(&attr, detach);
-#endif
-	if( status ) return status;
-	status = pthread_create( &t, &attr, task, NULL );
-#if HAVE_PTHREADS < 7
-	if( status < 0 ) status = errno;
-#endif
-	if( status ) return status;
-#else
-	/* Draft 4 pthreads */
-	status = pthread_create( &t, pthread_attr_default, task, NULL );
-	if( status ) return errno;
-
-	/* give thread a chance to complete */
-	/* it should remain joinable and hence detachable */
-	sleep( 1 );
-
-	status = pthread_detach( &t );
-	if( status ) return errno;
-#endif
-
-#ifdef HAVE_LINUX_THREADS
-	pthread_kill_other_threads_np();
-#endif
-
-	return 0;
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ol_cv_pthread_lpthread_lmach_lexc_lc_r=yes
-else
-  ol_cv_pthread_lpthread_lmach_lexc_lc_r=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-
-/* pthread test headers */
-#include <pthread.h>
-#if HAVE_PTHREADS < 7
-#include <errno.h>
-#endif
-#ifndef NULL
-#define NULL (void*)0
-#endif
-
-static void *task(p)
-	void *p;
-{
-	return (void *) (p == NULL);
-}
-
-
-int main(argc, argv)
-	int argc;
-	char **argv;
-{
-
-	/* pthread test function */
-#ifndef PTHREAD_CREATE_DETACHED
-#define	PTHREAD_CREATE_DETACHED	1
-#endif
-	pthread_t t;
-	int status;
-	int detach = PTHREAD_CREATE_DETACHED;
-
-#if HAVE_PTHREADS > 4
-	/* Final pthreads */
-	pthread_attr_t attr;
-
-	status = pthread_attr_init(&attr);
-	if( status ) return status;
-
-#if HAVE_PTHREADS < 7
-	status = pthread_attr_setdetachstate(&attr, &detach);
-	if( status < 0 ) status = errno;
-#else
-	status = pthread_attr_setdetachstate(&attr, detach);
-#endif
-	if( status ) return status;
-	status = pthread_create( &t, &attr, task, NULL );
-#if HAVE_PTHREADS < 7
-	if( status < 0 ) status = errno;
-#endif
-	if( status ) return status;
-#else
-	/* Draft 4 pthreads */
-	status = pthread_create( &t, pthread_attr_default, task, NULL );
-	if( status ) return errno;
-
-	/* give thread a chance to complete */
-	/* it should remain joinable and hence detachable */
-	sleep( 1 );
-
-	status = pthread_detach( &t );
-	if( status ) return errno;
-#endif
-
-#ifdef HAVE_LINUX_THREADS
-	pthread_kill_other_threads_np();
-#endif
-
-	return 0;
-
-}
-
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  ol_cv_pthread_lpthread_lmach_lexc_lc_r=yes
-else
-  ol_cv_pthread_lpthread_lmach_lexc_lc_r=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-
-		# restore the LIBS
-		LIBS="$ol_LIBS"
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_lpthread_lmach_lexc_lc_r" >&5
-$as_echo "$ol_cv_pthread_lpthread_lmach_lexc_lc_r" >&6; }
-
-	if test $ol_cv_pthread_lpthread_lmach_lexc_lc_r = yes ; then
-		ol_link_pthreads="-lpthread -lmach -lexc -lc_r"
-		ol_link_threads=posix
-	fi
-fi
-
-		# Pthread try link: -lpthread -lmach -lexc (ol_cv_pthread_lpthread_lmach_lexc)
-if test "$ol_link_threads" = no ; then
-	# try -lpthread -lmach -lexc
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread link with -lpthread -lmach -lexc" >&5
-$as_echo_n "checking for pthread link with -lpthread -lmach -lexc... " >&6; }
-if ${ol_cv_pthread_lpthread_lmach_lexc+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-
-		# save the flags
-		ol_LIBS="$LIBS"
-		LIBS="-lpthread -lmach -lexc $LIBS"
-
-		if test "$cross_compiling" = yes; then :
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* pthread test headers */
-#include <pthread.h>
-#if HAVE_PTHREADS < 7
-#include <errno.h>
-#endif
-#ifndef NULL
-#define NULL (void*)0
-#endif
-
-static void *task(p)
-	void *p;
-{
-	return (void *) (p == NULL);
-}
-
-int
-main ()
-{
-
-	/* pthread test function */
-#ifndef PTHREAD_CREATE_DETACHED
-#define	PTHREAD_CREATE_DETACHED	1
-#endif
-	pthread_t t;
-	int status;
-	int detach = PTHREAD_CREATE_DETACHED;
-
-#if HAVE_PTHREADS > 4
-	/* Final pthreads */
-	pthread_attr_t attr;
-
-	status = pthread_attr_init(&attr);
-	if( status ) return status;
-
-#if HAVE_PTHREADS < 7
-	status = pthread_attr_setdetachstate(&attr, &detach);
-	if( status < 0 ) status = errno;
-#else
-	status = pthread_attr_setdetachstate(&attr, detach);
-#endif
-	if( status ) return status;
-	status = pthread_create( &t, &attr, task, NULL );
-#if HAVE_PTHREADS < 7
-	if( status < 0 ) status = errno;
-#endif
-	if( status ) return status;
-#else
-	/* Draft 4 pthreads */
-	status = pthread_create( &t, pthread_attr_default, task, NULL );
-	if( status ) return errno;
-
-	/* give thread a chance to complete */
-	/* it should remain joinable and hence detachable */
-	sleep( 1 );
-
-	status = pthread_detach( &t );
-	if( status ) return errno;
-#endif
-
-#ifdef HAVE_LINUX_THREADS
-	pthread_kill_other_threads_np();
-#endif
-
-	return 0;
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ol_cv_pthread_lpthread_lmach_lexc=yes
-else
-  ol_cv_pthread_lpthread_lmach_lexc=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-
-/* pthread test headers */
-#include <pthread.h>
-#if HAVE_PTHREADS < 7
-#include <errno.h>
-#endif
-#ifndef NULL
-#define NULL (void*)0
-#endif
-
-static void *task(p)
-	void *p;
-{
-	return (void *) (p == NULL);
-}
-
-
-int main(argc, argv)
-	int argc;
-	char **argv;
-{
-
-	/* pthread test function */
-#ifndef PTHREAD_CREATE_DETACHED
-#define	PTHREAD_CREATE_DETACHED	1
-#endif
-	pthread_t t;
-	int status;
-	int detach = PTHREAD_CREATE_DETACHED;
-
-#if HAVE_PTHREADS > 4
-	/* Final pthreads */
-	pthread_attr_t attr;
-
-	status = pthread_attr_init(&attr);
-	if( status ) return status;
-
-#if HAVE_PTHREADS < 7
-	status = pthread_attr_setdetachstate(&attr, &detach);
-	if( status < 0 ) status = errno;
-#else
-	status = pthread_attr_setdetachstate(&attr, detach);
-#endif
-	if( status ) return status;
-	status = pthread_create( &t, &attr, task, NULL );
-#if HAVE_PTHREADS < 7
-	if( status < 0 ) status = errno;
-#endif
-	if( status ) return status;
-#else
-	/* Draft 4 pthreads */
-	status = pthread_create( &t, pthread_attr_default, task, NULL );
-	if( status ) return errno;
-
-	/* give thread a chance to complete */
-	/* it should remain joinable and hence detachable */
-	sleep( 1 );
-
-	status = pthread_detach( &t );
-	if( status ) return errno;
-#endif
-
-#ifdef HAVE_LINUX_THREADS
-	pthread_kill_other_threads_np();
-#endif
-
-	return 0;
-
-}
-
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  ol_cv_pthread_lpthread_lmach_lexc=yes
-else
-  ol_cv_pthread_lpthread_lmach_lexc=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-
-		# restore the LIBS
-		LIBS="$ol_LIBS"
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_lpthread_lmach_lexc" >&5
-$as_echo "$ol_cv_pthread_lpthread_lmach_lexc" >&6; }
-
-	if test $ol_cv_pthread_lpthread_lmach_lexc = yes ; then
-		ol_link_pthreads="-lpthread -lmach -lexc"
-		ol_link_threads=posix
-	fi
-fi
-
-
-		# Pthread try link: -lpthread -Wl,-woff,85 (ol_cv_pthread_lib_lpthread_woff)
-if test "$ol_link_threads" = no ; then
-	# try -lpthread -Wl,-woff,85
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread link with -lpthread -Wl,-woff,85" >&5
-$as_echo_n "checking for pthread link with -lpthread -Wl,-woff,85... " >&6; }
-if ${ol_cv_pthread_lib_lpthread_woff+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-
-		# save the flags
-		ol_LIBS="$LIBS"
-		LIBS="-lpthread -Wl,-woff,85 $LIBS"
-
-		if test "$cross_compiling" = yes; then :
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* pthread test headers */
-#include <pthread.h>
-#if HAVE_PTHREADS < 7
-#include <errno.h>
-#endif
-#ifndef NULL
-#define NULL (void*)0
-#endif
-
-static void *task(p)
-	void *p;
-{
-	return (void *) (p == NULL);
-}
-
-int
-main ()
-{
-
-	/* pthread test function */
-#ifndef PTHREAD_CREATE_DETACHED
-#define	PTHREAD_CREATE_DETACHED	1
-#endif
-	pthread_t t;
-	int status;
-	int detach = PTHREAD_CREATE_DETACHED;
-
-#if HAVE_PTHREADS > 4
-	/* Final pthreads */
-	pthread_attr_t attr;
-
-	status = pthread_attr_init(&attr);
-	if( status ) return status;
-
-#if HAVE_PTHREADS < 7
-	status = pthread_attr_setdetachstate(&attr, &detach);
-	if( status < 0 ) status = errno;
-#else
-	status = pthread_attr_setdetachstate(&attr, detach);
-#endif
-	if( status ) return status;
-	status = pthread_create( &t, &attr, task, NULL );
-#if HAVE_PTHREADS < 7
-	if( status < 0 ) status = errno;
-#endif
-	if( status ) return status;
-#else
-	/* Draft 4 pthreads */
-	status = pthread_create( &t, pthread_attr_default, task, NULL );
-	if( status ) return errno;
-
-	/* give thread a chance to complete */
-	/* it should remain joinable and hence detachable */
-	sleep( 1 );
-
-	status = pthread_detach( &t );
-	if( status ) return errno;
-#endif
-
-#ifdef HAVE_LINUX_THREADS
-	pthread_kill_other_threads_np();
-#endif
-
-	return 0;
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ol_cv_pthread_lib_lpthread_woff=yes
-else
-  ol_cv_pthread_lib_lpthread_woff=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-
-/* pthread test headers */
-#include <pthread.h>
-#if HAVE_PTHREADS < 7
-#include <errno.h>
-#endif
-#ifndef NULL
-#define NULL (void*)0
-#endif
-
-static void *task(p)
-	void *p;
-{
-	return (void *) (p == NULL);
-}
-
-
-int main(argc, argv)
-	int argc;
-	char **argv;
-{
-
-	/* pthread test function */
-#ifndef PTHREAD_CREATE_DETACHED
-#define	PTHREAD_CREATE_DETACHED	1
-#endif
-	pthread_t t;
-	int status;
-	int detach = PTHREAD_CREATE_DETACHED;
-
-#if HAVE_PTHREADS > 4
-	/* Final pthreads */
-	pthread_attr_t attr;
-
-	status = pthread_attr_init(&attr);
-	if( status ) return status;
-
-#if HAVE_PTHREADS < 7
-	status = pthread_attr_setdetachstate(&attr, &detach);
-	if( status < 0 ) status = errno;
-#else
-	status = pthread_attr_setdetachstate(&attr, detach);
-#endif
-	if( status ) return status;
-	status = pthread_create( &t, &attr, task, NULL );
-#if HAVE_PTHREADS < 7
-	if( status < 0 ) status = errno;
-#endif
-	if( status ) return status;
-#else
-	/* Draft 4 pthreads */
-	status = pthread_create( &t, pthread_attr_default, task, NULL );
-	if( status ) return errno;
-
-	/* give thread a chance to complete */
-	/* it should remain joinable and hence detachable */
-	sleep( 1 );
-
-	status = pthread_detach( &t );
-	if( status ) return errno;
-#endif
-
-#ifdef HAVE_LINUX_THREADS
-	pthread_kill_other_threads_np();
-#endif
-
-	return 0;
-
-}
-
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  ol_cv_pthread_lib_lpthread_woff=yes
-else
-  ol_cv_pthread_lib_lpthread_woff=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-
-		# restore the LIBS
-		LIBS="$ol_LIBS"
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_lib_lpthread_woff" >&5
-$as_echo "$ol_cv_pthread_lib_lpthread_woff" >&6; }
-
-	if test $ol_cv_pthread_lib_lpthread_woff = yes ; then
-		ol_link_pthreads="-lpthread -Wl,-woff,85"
-		ol_link_threads=posix
-	fi
-fi
-
-
-		# Pthread try link: -lpthread (ol_cv_pthread_lpthread)
-if test "$ol_link_threads" = no ; then
-	# try -lpthread
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread link with -lpthread" >&5
-$as_echo_n "checking for pthread link with -lpthread... " >&6; }
-if ${ol_cv_pthread_lpthread+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-
-		# save the flags
-		ol_LIBS="$LIBS"
-		LIBS="-lpthread $LIBS"
-
-		if test "$cross_compiling" = yes; then :
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* pthread test headers */
-#include <pthread.h>
-#if HAVE_PTHREADS < 7
-#include <errno.h>
-#endif
-#ifndef NULL
-#define NULL (void*)0
-#endif
-
-static void *task(p)
-	void *p;
-{
-	return (void *) (p == NULL);
-}
-
-int
-main ()
-{
-
-	/* pthread test function */
-#ifndef PTHREAD_CREATE_DETACHED
-#define	PTHREAD_CREATE_DETACHED	1
-#endif
-	pthread_t t;
-	int status;
-	int detach = PTHREAD_CREATE_DETACHED;
-
-#if HAVE_PTHREADS > 4
-	/* Final pthreads */
-	pthread_attr_t attr;
-
-	status = pthread_attr_init(&attr);
-	if( status ) return status;
-
-#if HAVE_PTHREADS < 7
-	status = pthread_attr_setdetachstate(&attr, &detach);
-	if( status < 0 ) status = errno;
-#else
-	status = pthread_attr_setdetachstate(&attr, detach);
-#endif
-	if( status ) return status;
-	status = pthread_create( &t, &attr, task, NULL );
-#if HAVE_PTHREADS < 7
-	if( status < 0 ) status = errno;
-#endif
-	if( status ) return status;
-#else
-	/* Draft 4 pthreads */
-	status = pthread_create( &t, pthread_attr_default, task, NULL );
-	if( status ) return errno;
-
-	/* give thread a chance to complete */
-	/* it should remain joinable and hence detachable */
-	sleep( 1 );
-
-	status = pthread_detach( &t );
-	if( status ) return errno;
-#endif
-
-#ifdef HAVE_LINUX_THREADS
-	pthread_kill_other_threads_np();
-#endif
-
-	return 0;
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ol_cv_pthread_lpthread=yes
-else
-  ol_cv_pthread_lpthread=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-
-/* pthread test headers */
-#include <pthread.h>
-#if HAVE_PTHREADS < 7
-#include <errno.h>
-#endif
-#ifndef NULL
-#define NULL (void*)0
-#endif
-
-static void *task(p)
-	void *p;
-{
-	return (void *) (p == NULL);
-}
-
-
-int main(argc, argv)
-	int argc;
-	char **argv;
-{
-
-	/* pthread test function */
-#ifndef PTHREAD_CREATE_DETACHED
-#define	PTHREAD_CREATE_DETACHED	1
-#endif
-	pthread_t t;
-	int status;
-	int detach = PTHREAD_CREATE_DETACHED;
-
-#if HAVE_PTHREADS > 4
-	/* Final pthreads */
-	pthread_attr_t attr;
-
-	status = pthread_attr_init(&attr);
-	if( status ) return status;
-
-#if HAVE_PTHREADS < 7
-	status = pthread_attr_setdetachstate(&attr, &detach);
-	if( status < 0 ) status = errno;
-#else
-	status = pthread_attr_setdetachstate(&attr, detach);
-#endif
-	if( status ) return status;
-	status = pthread_create( &t, &attr, task, NULL );
-#if HAVE_PTHREADS < 7
-	if( status < 0 ) status = errno;
-#endif
-	if( status ) return status;
-#else
-	/* Draft 4 pthreads */
-	status = pthread_create( &t, pthread_attr_default, task, NULL );
-	if( status ) return errno;
-
-	/* give thread a chance to complete */
-	/* it should remain joinable and hence detachable */
-	sleep( 1 );
-
-	status = pthread_detach( &t );
-	if( status ) return errno;
-#endif
-
-#ifdef HAVE_LINUX_THREADS
-	pthread_kill_other_threads_np();
-#endif
-
-	return 0;
-
-}
-
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  ol_cv_pthread_lpthread=yes
-else
-  ol_cv_pthread_lpthread=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-
-		# restore the LIBS
-		LIBS="$ol_LIBS"
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_lpthread" >&5
-$as_echo "$ol_cv_pthread_lpthread" >&6; }
-
-	if test $ol_cv_pthread_lpthread = yes ; then
-		ol_link_pthreads="-lpthread"
-		ol_link_threads=posix
-	fi
-fi
-
-		# Pthread try link: -lc_r (ol_cv_pthread_lc_r)
-if test "$ol_link_threads" = no ; then
-	# try -lc_r
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread link with -lc_r" >&5
-$as_echo_n "checking for pthread link with -lc_r... " >&6; }
-if ${ol_cv_pthread_lc_r+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-
-		# save the flags
-		ol_LIBS="$LIBS"
-		LIBS="-lc_r $LIBS"
-
-		if test "$cross_compiling" = yes; then :
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* pthread test headers */
-#include <pthread.h>
-#if HAVE_PTHREADS < 7
-#include <errno.h>
-#endif
-#ifndef NULL
-#define NULL (void*)0
-#endif
-
-static void *task(p)
-	void *p;
-{
-	return (void *) (p == NULL);
-}
-
-int
-main ()
-{
-
-	/* pthread test function */
-#ifndef PTHREAD_CREATE_DETACHED
-#define	PTHREAD_CREATE_DETACHED	1
-#endif
-	pthread_t t;
-	int status;
-	int detach = PTHREAD_CREATE_DETACHED;
-
-#if HAVE_PTHREADS > 4
-	/* Final pthreads */
-	pthread_attr_t attr;
-
-	status = pthread_attr_init(&attr);
-	if( status ) return status;
-
-#if HAVE_PTHREADS < 7
-	status = pthread_attr_setdetachstate(&attr, &detach);
-	if( status < 0 ) status = errno;
-#else
-	status = pthread_attr_setdetachstate(&attr, detach);
-#endif
-	if( status ) return status;
-	status = pthread_create( &t, &attr, task, NULL );
-#if HAVE_PTHREADS < 7
-	if( status < 0 ) status = errno;
-#endif
-	if( status ) return status;
-#else
-	/* Draft 4 pthreads */
-	status = pthread_create( &t, pthread_attr_default, task, NULL );
-	if( status ) return errno;
-
-	/* give thread a chance to complete */
-	/* it should remain joinable and hence detachable */
-	sleep( 1 );
-
-	status = pthread_detach( &t );
-	if( status ) return errno;
-#endif
-
-#ifdef HAVE_LINUX_THREADS
-	pthread_kill_other_threads_np();
-#endif
-
-	return 0;
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ol_cv_pthread_lc_r=yes
-else
-  ol_cv_pthread_lc_r=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-
-/* pthread test headers */
-#include <pthread.h>
-#if HAVE_PTHREADS < 7
-#include <errno.h>
-#endif
-#ifndef NULL
-#define NULL (void*)0
-#endif
-
-static void *task(p)
-	void *p;
-{
-	return (void *) (p == NULL);
-}
-
-
-int main(argc, argv)
-	int argc;
-	char **argv;
-{
-
-	/* pthread test function */
-#ifndef PTHREAD_CREATE_DETACHED
-#define	PTHREAD_CREATE_DETACHED	1
-#endif
-	pthread_t t;
-	int status;
-	int detach = PTHREAD_CREATE_DETACHED;
-
-#if HAVE_PTHREADS > 4
-	/* Final pthreads */
-	pthread_attr_t attr;
-
-	status = pthread_attr_init(&attr);
-	if( status ) return status;
-
-#if HAVE_PTHREADS < 7
-	status = pthread_attr_setdetachstate(&attr, &detach);
-	if( status < 0 ) status = errno;
-#else
-	status = pthread_attr_setdetachstate(&attr, detach);
-#endif
-	if( status ) return status;
-	status = pthread_create( &t, &attr, task, NULL );
-#if HAVE_PTHREADS < 7
-	if( status < 0 ) status = errno;
-#endif
-	if( status ) return status;
-#else
-	/* Draft 4 pthreads */
-	status = pthread_create( &t, pthread_attr_default, task, NULL );
-	if( status ) return errno;
-
-	/* give thread a chance to complete */
-	/* it should remain joinable and hence detachable */
-	sleep( 1 );
-
-	status = pthread_detach( &t );
-	if( status ) return errno;
-#endif
-
-#ifdef HAVE_LINUX_THREADS
-	pthread_kill_other_threads_np();
-#endif
-
-	return 0;
-
-}
-
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  ol_cv_pthread_lc_r=yes
-else
-  ol_cv_pthread_lc_r=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-
-		# restore the LIBS
-		LIBS="$ol_LIBS"
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_lc_r" >&5
-$as_echo "$ol_cv_pthread_lc_r" >&6; }
-
-	if test $ol_cv_pthread_lc_r = yes ; then
-		ol_link_pthreads="-lc_r"
-		ol_link_threads=posix
-	fi
-fi
-
-
-		# Pthread try link: -threads (ol_cv_pthread_threads)
-if test "$ol_link_threads" = no ; then
-	# try -threads
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread link with -threads" >&5
-$as_echo_n "checking for pthread link with -threads... " >&6; }
-if ${ol_cv_pthread_threads+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-
-		# save the flags
-		ol_LIBS="$LIBS"
-		LIBS="-threads $LIBS"
-
-		if test "$cross_compiling" = yes; then :
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* pthread test headers */
-#include <pthread.h>
-#if HAVE_PTHREADS < 7
-#include <errno.h>
-#endif
-#ifndef NULL
-#define NULL (void*)0
-#endif
-
-static void *task(p)
-	void *p;
-{
-	return (void *) (p == NULL);
-}
-
-int
-main ()
-{
-
-	/* pthread test function */
-#ifndef PTHREAD_CREATE_DETACHED
-#define	PTHREAD_CREATE_DETACHED	1
-#endif
-	pthread_t t;
-	int status;
-	int detach = PTHREAD_CREATE_DETACHED;
-
-#if HAVE_PTHREADS > 4
-	/* Final pthreads */
-	pthread_attr_t attr;
-
-	status = pthread_attr_init(&attr);
-	if( status ) return status;
-
-#if HAVE_PTHREADS < 7
-	status = pthread_attr_setdetachstate(&attr, &detach);
-	if( status < 0 ) status = errno;
-#else
-	status = pthread_attr_setdetachstate(&attr, detach);
-#endif
-	if( status ) return status;
-	status = pthread_create( &t, &attr, task, NULL );
-#if HAVE_PTHREADS < 7
-	if( status < 0 ) status = errno;
-#endif
-	if( status ) return status;
-#else
-	/* Draft 4 pthreads */
-	status = pthread_create( &t, pthread_attr_default, task, NULL );
-	if( status ) return errno;
-
-	/* give thread a chance to complete */
-	/* it should remain joinable and hence detachable */
-	sleep( 1 );
-
-	status = pthread_detach( &t );
-	if( status ) return errno;
-#endif
-
-#ifdef HAVE_LINUX_THREADS
-	pthread_kill_other_threads_np();
-#endif
-
-	return 0;
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ol_cv_pthread_threads=yes
-else
-  ol_cv_pthread_threads=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-
-/* pthread test headers */
-#include <pthread.h>
-#if HAVE_PTHREADS < 7
-#include <errno.h>
-#endif
-#ifndef NULL
-#define NULL (void*)0
-#endif
-
-static void *task(p)
-	void *p;
-{
-	return (void *) (p == NULL);
-}
-
-
-int main(argc, argv)
-	int argc;
-	char **argv;
-{
-
-	/* pthread test function */
-#ifndef PTHREAD_CREATE_DETACHED
-#define	PTHREAD_CREATE_DETACHED	1
-#endif
-	pthread_t t;
-	int status;
-	int detach = PTHREAD_CREATE_DETACHED;
-
-#if HAVE_PTHREADS > 4
-	/* Final pthreads */
-	pthread_attr_t attr;
-
-	status = pthread_attr_init(&attr);
-	if( status ) return status;
-
-#if HAVE_PTHREADS < 7
-	status = pthread_attr_setdetachstate(&attr, &detach);
-	if( status < 0 ) status = errno;
-#else
-	status = pthread_attr_setdetachstate(&attr, detach);
-#endif
-	if( status ) return status;
-	status = pthread_create( &t, &attr, task, NULL );
-#if HAVE_PTHREADS < 7
-	if( status < 0 ) status = errno;
-#endif
-	if( status ) return status;
-#else
-	/* Draft 4 pthreads */
-	status = pthread_create( &t, pthread_attr_default, task, NULL );
-	if( status ) return errno;
-
-	/* give thread a chance to complete */
-	/* it should remain joinable and hence detachable */
-	sleep( 1 );
-
-	status = pthread_detach( &t );
-	if( status ) return errno;
-#endif
-
-#ifdef HAVE_LINUX_THREADS
-	pthread_kill_other_threads_np();
-#endif
-
-	return 0;
-
-}
-
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  ol_cv_pthread_threads=yes
-else
-  ol_cv_pthread_threads=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-
-		# restore the LIBS
-		LIBS="$ol_LIBS"
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_threads" >&5
-$as_echo "$ol_cv_pthread_threads" >&6; }
-
-	if test $ol_cv_pthread_threads = yes ; then
-		ol_link_pthreads="-threads"
-		ol_link_threads=posix
-	fi
-fi
-
-
-		# Pthread try link: -lpthreads -lmach -lexc -lc_r (ol_cv_pthread_lpthreads_lmach_lexc_lc_r)
-if test "$ol_link_threads" = no ; then
-	# try -lpthreads -lmach -lexc -lc_r
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread link with -lpthreads -lmach -lexc -lc_r" >&5
-$as_echo_n "checking for pthread link with -lpthreads -lmach -lexc -lc_r... " >&6; }
-if ${ol_cv_pthread_lpthreads_lmach_lexc_lc_r+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-
-		# save the flags
-		ol_LIBS="$LIBS"
-		LIBS="-lpthreads -lmach -lexc -lc_r $LIBS"
-
-		if test "$cross_compiling" = yes; then :
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* pthread test headers */
-#include <pthread.h>
-#if HAVE_PTHREADS < 7
-#include <errno.h>
-#endif
-#ifndef NULL
-#define NULL (void*)0
-#endif
-
-static void *task(p)
-	void *p;
-{
-	return (void *) (p == NULL);
-}
-
-int
-main ()
-{
-
-	/* pthread test function */
-#ifndef PTHREAD_CREATE_DETACHED
-#define	PTHREAD_CREATE_DETACHED	1
-#endif
-	pthread_t t;
-	int status;
-	int detach = PTHREAD_CREATE_DETACHED;
-
-#if HAVE_PTHREADS > 4
-	/* Final pthreads */
-	pthread_attr_t attr;
-
-	status = pthread_attr_init(&attr);
-	if( status ) return status;
-
-#if HAVE_PTHREADS < 7
-	status = pthread_attr_setdetachstate(&attr, &detach);
-	if( status < 0 ) status = errno;
-#else
-	status = pthread_attr_setdetachstate(&attr, detach);
-#endif
-	if( status ) return status;
-	status = pthread_create( &t, &attr, task, NULL );
-#if HAVE_PTHREADS < 7
-	if( status < 0 ) status = errno;
-#endif
-	if( status ) return status;
-#else
-	/* Draft 4 pthreads */
-	status = pthread_create( &t, pthread_attr_default, task, NULL );
-	if( status ) return errno;
-
-	/* give thread a chance to complete */
-	/* it should remain joinable and hence detachable */
-	sleep( 1 );
-
-	status = pthread_detach( &t );
-	if( status ) return errno;
-#endif
-
-#ifdef HAVE_LINUX_THREADS
-	pthread_kill_other_threads_np();
-#endif
-
-	return 0;
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ol_cv_pthread_lpthreads_lmach_lexc_lc_r=yes
-else
-  ol_cv_pthread_lpthreads_lmach_lexc_lc_r=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-
-/* pthread test headers */
-#include <pthread.h>
-#if HAVE_PTHREADS < 7
-#include <errno.h>
-#endif
-#ifndef NULL
-#define NULL (void*)0
-#endif
-
-static void *task(p)
-	void *p;
-{
-	return (void *) (p == NULL);
-}
-
-
-int main(argc, argv)
-	int argc;
-	char **argv;
-{
-
-	/* pthread test function */
-#ifndef PTHREAD_CREATE_DETACHED
-#define	PTHREAD_CREATE_DETACHED	1
-#endif
-	pthread_t t;
-	int status;
-	int detach = PTHREAD_CREATE_DETACHED;
-
-#if HAVE_PTHREADS > 4
-	/* Final pthreads */
-	pthread_attr_t attr;
-
-	status = pthread_attr_init(&attr);
-	if( status ) return status;
-
-#if HAVE_PTHREADS < 7
-	status = pthread_attr_setdetachstate(&attr, &detach);
-	if( status < 0 ) status = errno;
-#else
-	status = pthread_attr_setdetachstate(&attr, detach);
-#endif
-	if( status ) return status;
-	status = pthread_create( &t, &attr, task, NULL );
-#if HAVE_PTHREADS < 7
-	if( status < 0 ) status = errno;
-#endif
-	if( status ) return status;
-#else
-	/* Draft 4 pthreads */
-	status = pthread_create( &t, pthread_attr_default, task, NULL );
-	if( status ) return errno;
-
-	/* give thread a chance to complete */
-	/* it should remain joinable and hence detachable */
-	sleep( 1 );
-
-	status = pthread_detach( &t );
-	if( status ) return errno;
-#endif
-
-#ifdef HAVE_LINUX_THREADS
-	pthread_kill_other_threads_np();
-#endif
-
-	return 0;
-
-}
-
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  ol_cv_pthread_lpthreads_lmach_lexc_lc_r=yes
-else
-  ol_cv_pthread_lpthreads_lmach_lexc_lc_r=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-
-		# restore the LIBS
-		LIBS="$ol_LIBS"
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_lpthreads_lmach_lexc_lc_r" >&5
-$as_echo "$ol_cv_pthread_lpthreads_lmach_lexc_lc_r" >&6; }
-
-	if test $ol_cv_pthread_lpthreads_lmach_lexc_lc_r = yes ; then
-		ol_link_pthreads="-lpthreads -lmach -lexc -lc_r"
-		ol_link_threads=posix
-	fi
-fi
-
-		# Pthread try link: -lpthreads -lmach -lexc (ol_cv_pthread_lpthreads_lmach_lexc)
-if test "$ol_link_threads" = no ; then
-	# try -lpthreads -lmach -lexc
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread link with -lpthreads -lmach -lexc" >&5
-$as_echo_n "checking for pthread link with -lpthreads -lmach -lexc... " >&6; }
-if ${ol_cv_pthread_lpthreads_lmach_lexc+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-
-		# save the flags
-		ol_LIBS="$LIBS"
-		LIBS="-lpthreads -lmach -lexc $LIBS"
-
-		if test "$cross_compiling" = yes; then :
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* pthread test headers */
-#include <pthread.h>
-#if HAVE_PTHREADS < 7
-#include <errno.h>
-#endif
-#ifndef NULL
-#define NULL (void*)0
-#endif
-
-static void *task(p)
-	void *p;
-{
-	return (void *) (p == NULL);
-}
-
-int
-main ()
-{
-
-	/* pthread test function */
-#ifndef PTHREAD_CREATE_DETACHED
-#define	PTHREAD_CREATE_DETACHED	1
-#endif
-	pthread_t t;
-	int status;
-	int detach = PTHREAD_CREATE_DETACHED;
-
-#if HAVE_PTHREADS > 4
-	/* Final pthreads */
-	pthread_attr_t attr;
-
-	status = pthread_attr_init(&attr);
-	if( status ) return status;
-
-#if HAVE_PTHREADS < 7
-	status = pthread_attr_setdetachstate(&attr, &detach);
-	if( status < 0 ) status = errno;
-#else
-	status = pthread_attr_setdetachstate(&attr, detach);
-#endif
-	if( status ) return status;
-	status = pthread_create( &t, &attr, task, NULL );
-#if HAVE_PTHREADS < 7
-	if( status < 0 ) status = errno;
-#endif
-	if( status ) return status;
-#else
-	/* Draft 4 pthreads */
-	status = pthread_create( &t, pthread_attr_default, task, NULL );
-	if( status ) return errno;
-
-	/* give thread a chance to complete */
-	/* it should remain joinable and hence detachable */
-	sleep( 1 );
-
-	status = pthread_detach( &t );
-	if( status ) return errno;
-#endif
-
-#ifdef HAVE_LINUX_THREADS
-	pthread_kill_other_threads_np();
-#endif
-
-	return 0;
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ol_cv_pthread_lpthreads_lmach_lexc=yes
-else
-  ol_cv_pthread_lpthreads_lmach_lexc=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-
-/* pthread test headers */
-#include <pthread.h>
-#if HAVE_PTHREADS < 7
-#include <errno.h>
-#endif
-#ifndef NULL
-#define NULL (void*)0
-#endif
-
-static void *task(p)
-	void *p;
-{
-	return (void *) (p == NULL);
-}
-
-
-int main(argc, argv)
-	int argc;
-	char **argv;
-{
-
-	/* pthread test function */
-#ifndef PTHREAD_CREATE_DETACHED
-#define	PTHREAD_CREATE_DETACHED	1
-#endif
-	pthread_t t;
-	int status;
-	int detach = PTHREAD_CREATE_DETACHED;
-
-#if HAVE_PTHREADS > 4
-	/* Final pthreads */
-	pthread_attr_t attr;
-
-	status = pthread_attr_init(&attr);
-	if( status ) return status;
-
-#if HAVE_PTHREADS < 7
-	status = pthread_attr_setdetachstate(&attr, &detach);
-	if( status < 0 ) status = errno;
-#else
-	status = pthread_attr_setdetachstate(&attr, detach);
-#endif
-	if( status ) return status;
-	status = pthread_create( &t, &attr, task, NULL );
-#if HAVE_PTHREADS < 7
-	if( status < 0 ) status = errno;
-#endif
-	if( status ) return status;
-#else
-	/* Draft 4 pthreads */
-	status = pthread_create( &t, pthread_attr_default, task, NULL );
-	if( status ) return errno;
-
-	/* give thread a chance to complete */
-	/* it should remain joinable and hence detachable */
-	sleep( 1 );
-
-	status = pthread_detach( &t );
-	if( status ) return errno;
-#endif
-
-#ifdef HAVE_LINUX_THREADS
-	pthread_kill_other_threads_np();
-#endif
-
-	return 0;
-
-}
-
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  ol_cv_pthread_lpthreads_lmach_lexc=yes
-else
-  ol_cv_pthread_lpthreads_lmach_lexc=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-
-		# restore the LIBS
-		LIBS="$ol_LIBS"
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_lpthreads_lmach_lexc" >&5
-$as_echo "$ol_cv_pthread_lpthreads_lmach_lexc" >&6; }
-
-	if test $ol_cv_pthread_lpthreads_lmach_lexc = yes ; then
-		ol_link_pthreads="-lpthreads -lmach -lexc"
-		ol_link_threads=posix
-	fi
-fi
-
-		# Pthread try link: -lpthreads -lexc (ol_cv_pthread_lpthreads_lexc)
-if test "$ol_link_threads" = no ; then
-	# try -lpthreads -lexc
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread link with -lpthreads -lexc" >&5
-$as_echo_n "checking for pthread link with -lpthreads -lexc... " >&6; }
-if ${ol_cv_pthread_lpthreads_lexc+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-
-		# save the flags
-		ol_LIBS="$LIBS"
-		LIBS="-lpthreads -lexc $LIBS"
-
-		if test "$cross_compiling" = yes; then :
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* pthread test headers */
-#include <pthread.h>
-#if HAVE_PTHREADS < 7
-#include <errno.h>
-#endif
-#ifndef NULL
-#define NULL (void*)0
-#endif
-
-static void *task(p)
-	void *p;
-{
-	return (void *) (p == NULL);
-}
-
-int
-main ()
-{
-
-	/* pthread test function */
-#ifndef PTHREAD_CREATE_DETACHED
-#define	PTHREAD_CREATE_DETACHED	1
-#endif
-	pthread_t t;
-	int status;
-	int detach = PTHREAD_CREATE_DETACHED;
-
-#if HAVE_PTHREADS > 4
-	/* Final pthreads */
-	pthread_attr_t attr;
-
-	status = pthread_attr_init(&attr);
-	if( status ) return status;
-
-#if HAVE_PTHREADS < 7
-	status = pthread_attr_setdetachstate(&attr, &detach);
-	if( status < 0 ) status = errno;
-#else
-	status = pthread_attr_setdetachstate(&attr, detach);
-#endif
-	if( status ) return status;
-	status = pthread_create( &t, &attr, task, NULL );
-#if HAVE_PTHREADS < 7
-	if( status < 0 ) status = errno;
-#endif
-	if( status ) return status;
-#else
-	/* Draft 4 pthreads */
-	status = pthread_create( &t, pthread_attr_default, task, NULL );
-	if( status ) return errno;
-
-	/* give thread a chance to complete */
-	/* it should remain joinable and hence detachable */
-	sleep( 1 );
-
-	status = pthread_detach( &t );
-	if( status ) return errno;
-#endif
-
-#ifdef HAVE_LINUX_THREADS
-	pthread_kill_other_threads_np();
-#endif
-
-	return 0;
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ol_cv_pthread_lpthreads_lexc=yes
-else
-  ol_cv_pthread_lpthreads_lexc=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-
-/* pthread test headers */
-#include <pthread.h>
-#if HAVE_PTHREADS < 7
-#include <errno.h>
-#endif
-#ifndef NULL
-#define NULL (void*)0
-#endif
-
-static void *task(p)
-	void *p;
-{
-	return (void *) (p == NULL);
-}
-
-
-int main(argc, argv)
-	int argc;
-	char **argv;
-{
-
-	/* pthread test function */
-#ifndef PTHREAD_CREATE_DETACHED
-#define	PTHREAD_CREATE_DETACHED	1
-#endif
-	pthread_t t;
-	int status;
-	int detach = PTHREAD_CREATE_DETACHED;
-
-#if HAVE_PTHREADS > 4
-	/* Final pthreads */
-	pthread_attr_t attr;
-
-	status = pthread_attr_init(&attr);
-	if( status ) return status;
-
-#if HAVE_PTHREADS < 7
-	status = pthread_attr_setdetachstate(&attr, &detach);
-	if( status < 0 ) status = errno;
-#else
-	status = pthread_attr_setdetachstate(&attr, detach);
-#endif
-	if( status ) return status;
-	status = pthread_create( &t, &attr, task, NULL );
-#if HAVE_PTHREADS < 7
-	if( status < 0 ) status = errno;
-#endif
-	if( status ) return status;
-#else
-	/* Draft 4 pthreads */
-	status = pthread_create( &t, pthread_attr_default, task, NULL );
-	if( status ) return errno;
-
-	/* give thread a chance to complete */
-	/* it should remain joinable and hence detachable */
-	sleep( 1 );
-
-	status = pthread_detach( &t );
-	if( status ) return errno;
-#endif
-
-#ifdef HAVE_LINUX_THREADS
-	pthread_kill_other_threads_np();
-#endif
-
-	return 0;
-
-}
-
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  ol_cv_pthread_lpthreads_lexc=yes
-else
-  ol_cv_pthread_lpthreads_lexc=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-
-		# restore the LIBS
-		LIBS="$ol_LIBS"
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_lpthreads_lexc" >&5
-$as_echo "$ol_cv_pthread_lpthreads_lexc" >&6; }
-
-	if test $ol_cv_pthread_lpthreads_lexc = yes ; then
-		ol_link_pthreads="-lpthreads -lexc"
-		ol_link_threads=posix
-	fi
-fi
-
-
-		# Pthread try link: -lpthreads (ol_cv_pthread_lib_lpthreads)
-if test "$ol_link_threads" = no ; then
-	# try -lpthreads
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread link with -lpthreads" >&5
-$as_echo_n "checking for pthread link with -lpthreads... " >&6; }
-if ${ol_cv_pthread_lib_lpthreads+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-
-		# save the flags
-		ol_LIBS="$LIBS"
-		LIBS="-lpthreads $LIBS"
-
-		if test "$cross_compiling" = yes; then :
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* pthread test headers */
-#include <pthread.h>
-#if HAVE_PTHREADS < 7
-#include <errno.h>
-#endif
-#ifndef NULL
-#define NULL (void*)0
-#endif
-
-static void *task(p)
-	void *p;
-{
-	return (void *) (p == NULL);
-}
-
-int
-main ()
-{
-
-	/* pthread test function */
-#ifndef PTHREAD_CREATE_DETACHED
-#define	PTHREAD_CREATE_DETACHED	1
-#endif
-	pthread_t t;
-	int status;
-	int detach = PTHREAD_CREATE_DETACHED;
-
-#if HAVE_PTHREADS > 4
-	/* Final pthreads */
-	pthread_attr_t attr;
-
-	status = pthread_attr_init(&attr);
-	if( status ) return status;
-
-#if HAVE_PTHREADS < 7
-	status = pthread_attr_setdetachstate(&attr, &detach);
-	if( status < 0 ) status = errno;
-#else
-	status = pthread_attr_setdetachstate(&attr, detach);
-#endif
-	if( status ) return status;
-	status = pthread_create( &t, &attr, task, NULL );
-#if HAVE_PTHREADS < 7
-	if( status < 0 ) status = errno;
-#endif
-	if( status ) return status;
-#else
-	/* Draft 4 pthreads */
-	status = pthread_create( &t, pthread_attr_default, task, NULL );
-	if( status ) return errno;
-
-	/* give thread a chance to complete */
-	/* it should remain joinable and hence detachable */
-	sleep( 1 );
-
-	status = pthread_detach( &t );
-	if( status ) return errno;
-#endif
-
-#ifdef HAVE_LINUX_THREADS
-	pthread_kill_other_threads_np();
-#endif
-
-	return 0;
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ol_cv_pthread_lib_lpthreads=yes
-else
-  ol_cv_pthread_lib_lpthreads=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-
-/* pthread test headers */
-#include <pthread.h>
-#if HAVE_PTHREADS < 7
-#include <errno.h>
-#endif
-#ifndef NULL
-#define NULL (void*)0
-#endif
-
-static void *task(p)
-	void *p;
-{
-	return (void *) (p == NULL);
-}
-
-
-int main(argc, argv)
-	int argc;
-	char **argv;
-{
-
-	/* pthread test function */
-#ifndef PTHREAD_CREATE_DETACHED
-#define	PTHREAD_CREATE_DETACHED	1
-#endif
-	pthread_t t;
-	int status;
-	int detach = PTHREAD_CREATE_DETACHED;
-
-#if HAVE_PTHREADS > 4
-	/* Final pthreads */
-	pthread_attr_t attr;
-
-	status = pthread_attr_init(&attr);
-	if( status ) return status;
-
-#if HAVE_PTHREADS < 7
-	status = pthread_attr_setdetachstate(&attr, &detach);
-	if( status < 0 ) status = errno;
-#else
-	status = pthread_attr_setdetachstate(&attr, detach);
-#endif
-	if( status ) return status;
-	status = pthread_create( &t, &attr, task, NULL );
-#if HAVE_PTHREADS < 7
-	if( status < 0 ) status = errno;
-#endif
-	if( status ) return status;
-#else
-	/* Draft 4 pthreads */
-	status = pthread_create( &t, pthread_attr_default, task, NULL );
-	if( status ) return errno;
-
-	/* give thread a chance to complete */
-	/* it should remain joinable and hence detachable */
-	sleep( 1 );
-
-	status = pthread_detach( &t );
-	if( status ) return errno;
-#endif
-
-#ifdef HAVE_LINUX_THREADS
-	pthread_kill_other_threads_np();
-#endif
-
-	return 0;
-
-}
-
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  ol_cv_pthread_lib_lpthreads=yes
-else
-  ol_cv_pthread_lib_lpthreads=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-
-		# restore the LIBS
-		LIBS="$ol_LIBS"
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_lib_lpthreads" >&5
-$as_echo "$ol_cv_pthread_lib_lpthreads" >&6; }
-
-	if test $ol_cv_pthread_lib_lpthreads = yes ; then
-		ol_link_pthreads="-lpthreads"
-		ol_link_threads=posix
-	fi
-fi
-
-
-		if test $ol_link_threads != no ; then
-			LTHREAD_LIBS="$LTHREAD_LIBS $ol_link_pthreads"
-
-						save_CPPFLAGS="$CPPFLAGS"
-			save_LIBS="$LIBS"
-			LIBS="$LTHREAD_LIBS $LIBS"
-
-												for ac_func in sched_yield pthread_yield thr_yield
-do :
-  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-done
-
-
-			if test $ac_cv_func_sched_yield = no &&
-			   test $ac_cv_func_pthread_yield = no &&
-			   test $ac_cv_func_thr_yield = no ; then
-								{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sched_yield in -lrt" >&5
-$as_echo_n "checking for sched_yield in -lrt... " >&6; }
-if ${ac_cv_lib_rt_sched_yield+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lrt  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char sched_yield ();
-int
-main ()
-{
-return sched_yield ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_rt_sched_yield=yes
-else
-  ac_cv_lib_rt_sched_yield=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_sched_yield" >&5
-$as_echo "$ac_cv_lib_rt_sched_yield" >&6; }
-if test "x$ac_cv_lib_rt_sched_yield" = xyes; then :
-  LTHREAD_LIBS="$LTHREAD_LIBS -lrt"
-
-$as_echo "#define HAVE_SCHED_YIELD 1" >>confdefs.h
-
-					ac_cv_func_sched_yield=yes
-else
-  ac_cv_func_sched_yield=no
-fi
-
-			fi
-			if test $ac_cv_func_sched_yield = no &&
-			   test $ac_cv_func_pthread_yield = no &&
-			   test "$ac_cv_func_thr_yield" = no ; then
-				{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: could not locate sched_yield() or pthread_yield()" >&5
-$as_echo "$as_me: WARNING: could not locate sched_yield() or pthread_yield()" >&2;}
-			fi
-
-						for ac_func in pthread_kill
-do :
-  ac_fn_c_check_func "$LINENO" "pthread_kill" "ac_cv_func_pthread_kill"
-if test "x$ac_cv_func_pthread_kill" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_PTHREAD_KILL 1
-_ACEOF
-
-fi
-done
-
-
-									{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_rwlock_destroy with <pthread.h>" >&5
-$as_echo_n "checking for pthread_rwlock_destroy with <pthread.h>... " >&6; }
-if ${ol_cv_func_pthread_rwlock_destroy+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-
-								cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-#include <pthread.h>
-pthread_rwlock_t rwlock;
-
-int
-main ()
-{
-pthread_rwlock_destroy(&rwlock);
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ol_cv_func_pthread_rwlock_destroy=yes
-else
-  ol_cv_func_pthread_rwlock_destroy=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_func_pthread_rwlock_destroy" >&5
-$as_echo "$ol_cv_func_pthread_rwlock_destroy" >&6; }
-			if test $ol_cv_func_pthread_rwlock_destroy = yes ; then
-
-$as_echo "#define HAVE_PTHREAD_RWLOCK_DESTROY 1" >>confdefs.h
-
-			fi
-
-									{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_detach with <pthread.h>" >&5
-$as_echo_n "checking for pthread_detach with <pthread.h>... " >&6; }
-if ${ol_cv_func_pthread_detach+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-
-								cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-#include <pthread.h>
-#ifndef NULL
-#define NULL (void*)0
-#endif
-
-int
-main ()
-{
-pthread_detach(NULL);
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ol_cv_func_pthread_detach=yes
-else
-  ol_cv_func_pthread_detach=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_func_pthread_detach" >&5
-$as_echo "$ol_cv_func_pthread_detach" >&6; }
-
-			if test $ol_cv_func_pthread_detach = no ; then
-				as_fn_error $? "could not locate pthread_detach()" "$LINENO" 5
-			fi
-
-
-$as_echo "#define HAVE_PTHREAD_DETACH 1" >>confdefs.h
-
-
-						for ac_func in \
-				pthread_setconcurrency \
-				pthread_getconcurrency \
-				thr_setconcurrency \
-				thr_getconcurrency \
-
-do :
-  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-done
-
-
-
-	for ac_func in pthread_kill_other_threads_np
-do :
-  ac_fn_c_check_func "$LINENO" "pthread_kill_other_threads_np" "ac_cv_func_pthread_kill_other_threads_np"
-if test "x$ac_cv_func_pthread_kill_other_threads_np" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_PTHREAD_KILL_OTHER_THREADS_NP 1
-_ACEOF
-
-fi
-done
-
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LinuxThreads implementation" >&5
-$as_echo_n "checking for LinuxThreads implementation... " >&6; }
-if ${ol_cv_sys_linux_threads+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ol_cv_sys_linux_threads=$ac_cv_func_pthread_kill_other_threads_np
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_sys_linux_threads" >&5
-$as_echo "$ol_cv_sys_linux_threads" >&6; }
-
-
-
-
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LinuxThreads consistency" >&5
-$as_echo_n "checking for LinuxThreads consistency... " >&6; }
-if ${ol_cv_linux_threads+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-
-		if test $ol_cv_header_linux_threads = yes &&
-		   test $ol_cv_sys_linux_threads = yes; then
-			ol_cv_linux_threads=yes
-		elif test $ol_cv_header_linux_threads = no &&
-		     test $ol_cv_sys_linux_threads = no; then
-			ol_cv_linux_threads=no
-		else
-			ol_cv_linux_threads=error
-		fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_linux_threads" >&5
-$as_echo "$ol_cv_linux_threads" >&6; }
-
-
-			if test $ol_cv_linux_threads = error; then
-				as_fn_error $? "LinuxThreads header/library mismatch" "$LINENO" 5;
-			fi
-
-			{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if pthread_create() works" >&5
-$as_echo_n "checking if pthread_create() works... " >&6; }
-if ${ol_cv_pthread_create_works+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-
-			if test "$cross_compiling" = yes; then :
-  				ol_cv_pthread_create_works=yes
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-
-/* pthread test headers */
-#include <pthread.h>
-#if HAVE_PTHREADS < 7
-#include <errno.h>
-#endif
-#ifndef NULL
-#define NULL (void*)0
-#endif
-
-static void *task(p)
-	void *p;
-{
-	return (void *) (p == NULL);
-}
-
-
-int main(argc, argv)
-	int argc;
-	char **argv;
-{
-
-	/* pthread test function */
-#ifndef PTHREAD_CREATE_DETACHED
-#define	PTHREAD_CREATE_DETACHED	1
-#endif
-	pthread_t t;
-	int status;
-	int detach = PTHREAD_CREATE_DETACHED;
-
-#if HAVE_PTHREADS > 4
-	/* Final pthreads */
-	pthread_attr_t attr;
-
-	status = pthread_attr_init(&attr);
-	if( status ) return status;
-
-#if HAVE_PTHREADS < 7
-	status = pthread_attr_setdetachstate(&attr, &detach);
-	if( status < 0 ) status = errno;
-#else
-	status = pthread_attr_setdetachstate(&attr, detach);
-#endif
-	if( status ) return status;
-	status = pthread_create( &t, &attr, task, NULL );
-#if HAVE_PTHREADS < 7
-	if( status < 0 ) status = errno;
-#endif
-	if( status ) return status;
-#else
-	/* Draft 4 pthreads */
-	status = pthread_create( &t, pthread_attr_default, task, NULL );
-	if( status ) return errno;
-
-	/* give thread a chance to complete */
-	/* it should remain joinable and hence detachable */
-	sleep( 1 );
-
-	status = pthread_detach( &t );
-	if( status ) return errno;
-#endif
-
-#ifdef HAVE_LINUX_THREADS
-	pthread_kill_other_threads_np();
-#endif
-
-	return 0;
-
-}
-
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  ol_cv_pthread_create_works=yes
-else
-  ol_cv_pthread_create_works=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_create_works" >&5
-$as_echo "$ol_cv_pthread_create_works" >&6; }
-
-			if test $ol_cv_pthread_create_works = no ; then
-				as_fn_error $? "pthread_create is not usable, check environment settings" "$LINENO" 5
-			fi
-
-			ol_replace_broken_yield=no
-
-			if test $ol_replace_broken_yield = yes ; then
-
-$as_echo "#define REPLACE_BROKEN_YIELD 1" >>confdefs.h
-
-			fi
-
-						if test x$ol_with_yielding_select = xauto ; then
-				{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if select yields when using pthreads" >&5
-$as_echo_n "checking if select yields when using pthreads... " >&6; }
-if ${ol_cv_pthread_select_yields+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-
-				if test "$cross_compiling" = yes; then :
-  ol_cv_pthread_select_yields=cross
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-#include <sys/types.h>
-#include <sys/time.h>
-#include <unistd.h>
-#include <pthread.h>
-#ifndef NULL
-#define NULL (void*) 0
-#endif
-
-static int fildes[2];
-
-static void *task(p)
-	void *p;
-{
-	int i;
-	struct timeval tv;
-
-	fd_set rfds;
-
-	tv.tv_sec=10;
-	tv.tv_usec=0;
-
-	FD_ZERO(&rfds);
-	FD_SET(fildes[0], &rfds);
-
-	/* we're not interested in any fds */
-	i = select(FD_SETSIZE, &rfds, NULL, NULL, &tv);
-
-	if(i < 0) {
-		perror("select");
-		exit(10);
-	}
-
-	exit(0); /* if we exit here, the select blocked the whole process */
-}
-
-int main(argc, argv)
-	int argc;
-	char **argv;
-{
-	pthread_t t;
-
-	/* create a pipe to select */
-	if(pipe(&fildes[0])) {
-		perror("select");
-		exit(1);
-	}
-
-#ifdef HAVE_PTHREAD_SETCONCURRENCY
-	(void) pthread_setconcurrency(2);
-#else
-#ifdef HAVE_THR_SETCONCURRENCY
-	/* Set Solaris LWP concurrency to 2 */
-	thr_setconcurrency(2);
-#endif
-#endif
-
-#if HAVE_PTHREADS < 6
-	pthread_create(&t, pthread_attr_default, task, NULL);
-#else
-	pthread_create(&t, NULL, task, NULL);
-#endif
-
-	/* make sure task runs first */
-#ifdef HAVE_THR_YIELD
-	thr_yield();
-#elif defined( HAVE_SCHED_YIELD )
-	sched_yield();
-#elif defined( HAVE_PTHREAD_YIELD )
-	pthread_yield();
-#endif
-
-	exit(2);
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  ol_cv_pthread_select_yields=no
-else
-  ol_cv_pthread_select_yields=yes
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_select_yields" >&5
-$as_echo "$ol_cv_pthread_select_yields" >&6; }
-
-				if test $ol_cv_pthread_select_yields = cross ; then
-					as_fn_error $? "crossing compiling: use --with-yielding-select=yes|no|manual" "$LINENO" 5
-				fi
-
-				if test $ol_cv_pthread_select_yields = yes ; then
-					ol_with_yielding_select=yes
-				fi
-			fi
-
-						CPPFLAGS="$save_CPPFLAGS"
-			LIBS="$save_LIBS"
-		else
-			as_fn_error $? "could not locate usable POSIX Threads" "$LINENO" 5
-		fi
-	fi
-
-	if test $ol_with_threads = posix ; then
-		as_fn_error $? "could not locate POSIX Threads" "$LINENO" 5
-	fi
-	;;
-esac
-
-case $ol_with_threads in auto | yes | mach)
-
-		for ac_header in mach/cthreads.h cthreads.h
-do :
-  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-	if test $ac_cv_header_mach_cthreads_h = yes ; then
-		ol_with_threads=found
-
-				ac_fn_c_check_func "$LINENO" "cthread_fork" "ac_cv_func_cthread_fork"
-if test "x$ac_cv_func_cthread_fork" = xyes; then :
-  ol_link_threads=yes
-fi
-
-
-		if test $ol_link_threads = no ; then
-									{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for cthread_fork with -all_load" >&5
-$as_echo_n "checking for cthread_fork with -all_load... " >&6; }
-if ${ol_cv_cthread_all_load+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-
-								save_LIBS="$LIBS"
-				LIBS="-all_load $LIBS"
-				cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <mach/cthreads.h>
-int
-main ()
-{
-
-					cthread_fork((void *)0, (void *)0);
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ol_cv_cthread_all_load=yes
-else
-  ol_cv_cthread_all_load=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-								LIBS="$save_LIBS"
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_cthread_all_load" >&5
-$as_echo "$ol_cv_cthread_all_load" >&6; }
-
-			if test $ol_cv_cthread_all_load = yes ; then
-				LTHREAD_LIBS="$LTHREAD_LIBS -all_load"
-				ol_link_threads=mach
-				ol_with_threads=found
-			fi
-		fi
-
-	elif test $ac_cv_header_cthreads_h = yes ; then
-
-		ol_with_threads=found
-
-				save_LIBS="$LIBS"
-		LIBS="$LIBS -lthreads"
-		ac_fn_c_check_func "$LINENO" "cthread_fork" "ac_cv_func_cthread_fork"
-if test "x$ac_cv_func_cthread_fork" = xyes; then :
-  ol_link_threads=yes
-fi
-
-		LIBS="$save_LIBS"
-
-		if test $ol_link_threads = yes ; then
-			LTHREAD_LIBS="-lthreads"
-			ol_link_threads=mach
-			ol_with_threads=found
-		else
-			as_fn_error $? "could not link with Mach CThreads" "$LINENO" 5
-		fi
-
-	elif test $ol_with_threads = mach ; then
-		as_fn_error $? "could not locate Mach CThreads" "$LINENO" 5
-	fi
-
-	if test $ol_link_threads = mach ; then
-
-$as_echo "#define HAVE_MACH_CTHREADS 1" >>confdefs.h
-
-	elif test $ol_with_threads = found ; then
-		as_fn_error $? "could not link with Mach CThreads" "$LINENO" 5
-	fi
-	;;
-esac
-
-case $ol_with_threads in auto | yes | pth)
-
-	for ac_header in pth.h
-do :
-  ac_fn_c_check_header_mongrel "$LINENO" "pth.h" "ac_cv_header_pth_h" "$ac_includes_default"
-if test "x$ac_cv_header_pth_h" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_PTH_H 1
-_ACEOF
-
-fi
-
-done
-
-
-	if test $ac_cv_header_pth_h = yes ; then
-		{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pth_version in -lpth" >&5
-$as_echo_n "checking for pth_version in -lpth... " >&6; }
-if ${ac_cv_lib_pth_pth_version+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lpth  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char pth_version ();
-int
-main ()
-{
-return pth_version ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_pth_pth_version=yes
-else
-  ac_cv_lib_pth_pth_version=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pth_pth_version" >&5
-$as_echo "$ac_cv_lib_pth_pth_version" >&6; }
-if test "x$ac_cv_lib_pth_pth_version" = xyes; then :
-  have_pth=yes
-else
-  have_pth=no
-fi
-
-
-		if test $have_pth = yes ; then
-
-$as_echo "#define HAVE_GNU_PTH 1" >>confdefs.h
-
-			LTHREAD_LIBS="$LTHREAD_LIBS -lpth"
-			ol_link_threads=pth
-			ol_with_threads=found
-
-			if test x$ol_with_yielding_select = xauto ; then
-				ol_with_yielding_select=yes
-			fi
-		fi
-	fi
-	;;
-esac
-
-case $ol_with_threads in auto | yes | lwp)
-
-		for ac_header in thread.h synch.h
-do :
-  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-	if test $ac_cv_header_thread_h = yes &&
-	   test $ac_cv_header_synch_h = yes ; then
-		{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for thr_create in -lthread" >&5
-$as_echo_n "checking for thr_create in -lthread... " >&6; }
-if ${ac_cv_lib_thread_thr_create+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lthread  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char thr_create ();
-int
-main ()
-{
-return thr_create ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_thread_thr_create=yes
-else
-  ac_cv_lib_thread_thr_create=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_thread_thr_create" >&5
-$as_echo "$ac_cv_lib_thread_thr_create" >&6; }
-if test "x$ac_cv_lib_thread_thr_create" = xyes; then :
-  have_thr=yes
-else
-  have_thr=no
-fi
-
-
-		if test $have_thr = yes ; then
-
-$as_echo "#define HAVE_THR 1" >>confdefs.h
-
-			LTHREAD_LIBS="$LTHREAD_LIBS -lthread"
-			ol_link_threads=thr
-
-			if test x$ol_with_yielding_select = xauto ; then
-				ol_with_yielding_select=yes
-			fi
-
-						for ac_func in \
-				thr_setconcurrency \
-				thr_getconcurrency \
-
-do :
-  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-done
-
-		fi
-	fi
-
-		for ac_header in lwp/lwp.h
-do :
-  ac_fn_c_check_header_mongrel "$LINENO" "lwp/lwp.h" "ac_cv_header_lwp_lwp_h" "$ac_includes_default"
-if test "x$ac_cv_header_lwp_lwp_h" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_LWP_LWP_H 1
-_ACEOF
-
-fi
-
-done
-
-	if test $ac_cv_header_lwp_lwp_h = yes ; then
-		{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for lwp_create in -llwp" >&5
-$as_echo_n "checking for lwp_create in -llwp... " >&6; }
-if ${ac_cv_lib_lwp_lwp_create+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-llwp  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char lwp_create ();
-int
-main ()
-{
-return lwp_create ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_lwp_lwp_create=yes
-else
-  ac_cv_lib_lwp_lwp_create=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lwp_lwp_create" >&5
-$as_echo "$ac_cv_lib_lwp_lwp_create" >&6; }
-if test "x$ac_cv_lib_lwp_lwp_create" = xyes; then :
-  have_lwp=yes
-else
-  have_lwp=no
-fi
-
-
-		if test $have_lwp = yes ; then
-
-$as_echo "#define HAVE_LWP 1" >>confdefs.h
-
-			LTHREAD_LIBS="$LTHREAD_LIBS -llwp"
-			ol_link_threads=lwp
-
-			if test x$ol_with_yielding_select = xauto ; then
-				ol_with_yielding_select=no
-			fi
-		fi
-	fi
-	;;
-esac
-
-if test $ol_with_yielding_select = yes ; then
-
-$as_echo "#define HAVE_YIELDING_SELECT 1" >>confdefs.h
-
-fi
-
-if test $ol_with_threads = manual ; then
-		ol_link_threads=yes
-
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: thread defines and link options must be set manually" >&5
-$as_echo "$as_me: WARNING: thread defines and link options must be set manually" >&2;}
-
-	for ac_header in pthread.h sched.h
-do :
-  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-	for ac_func in sched_yield pthread_yield
-do :
-  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-done
-
-
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LinuxThreads pthread.h" >&5
-$as_echo_n "checking for LinuxThreads pthread.h... " >&6; }
-if ${ol_cv_header_linux_threads+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <pthread.h>
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "pthread_kill_other_threads_np" >/dev/null 2>&1; then :
-  ol_cv_header_linux_threads=yes
-else
-  ol_cv_header_linux_threads=no
-fi
-rm -f conftest*
-
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_header_linux_threads" >&5
-$as_echo "$ol_cv_header_linux_threads" >&6; }
-	if test $ol_cv_header_linux_threads = yes; then
-
-$as_echo "#define HAVE_LINUX_THREADS 1" >>confdefs.h
-
-	fi
-
-
-	for ac_header in mach/cthreads.h
-do :
-  ac_fn_c_check_header_mongrel "$LINENO" "mach/cthreads.h" "ac_cv_header_mach_cthreads_h" "$ac_includes_default"
-if test "x$ac_cv_header_mach_cthreads_h" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_MACH_CTHREADS_H 1
-_ACEOF
-
-fi
-
-done
-
-	for ac_header in lwp/lwp.h
-do :
-  ac_fn_c_check_header_mongrel "$LINENO" "lwp/lwp.h" "ac_cv_header_lwp_lwp_h" "$ac_includes_default"
-if test "x$ac_cv_header_lwp_lwp_h" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_LWP_LWP_H 1
-_ACEOF
-
-fi
-
-done
-
-	for ac_header in thread.h synch.h
-do :
-  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-fi
-
-if test $ol_link_threads != no && test $ol_link_threads != nt ; then
-
-$as_echo "#define REENTRANT 1" >>confdefs.h
-
-
-$as_echo "#define _REENTRANT 1" >>confdefs.h
-
-
-$as_echo "#define THREAD_SAFE 1" >>confdefs.h
-
-
-$as_echo "#define _THREAD_SAFE 1" >>confdefs.h
-
-
-$as_echo "#define THREADSAFE 1" >>confdefs.h
-
-
-$as_echo "#define _THREADSAFE 1" >>confdefs.h
-
-
-$as_echo "#define _SGI_MP_SOURCE 1" >>confdefs.h
-
-
-			{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for thread specific errno" >&5
-$as_echo_n "checking for thread specific errno... " >&6; }
-if ${ol_cv_errno_thread_specific+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-
-		cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <errno.h>
-int
-main ()
-{
-errno = 0;
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ol_cv_errno_thread_specific=yes
-else
-  ol_cv_errno_thread_specific=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_errno_thread_specific" >&5
-$as_echo "$ol_cv_errno_thread_specific" >&6; }
-
-			{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for thread specific h_errno" >&5
-$as_echo_n "checking for thread specific h_errno... " >&6; }
-if ${ol_cv_h_errno_thread_specific+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-
-		cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <netdb.h>
-int
-main ()
-{
-h_errno = 0;
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ol_cv_h_errno_thread_specific=yes
-else
-  ol_cv_h_errno_thread_specific=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_h_errno_thread_specific" >&5
-$as_echo "$ol_cv_h_errno_thread_specific" >&6; }
-
-	if test $ol_cv_errno_thread_specific != yes ||
-	   test $ol_cv_h_errno_thread_specific != yes ; then
-		LIBS="$LTHREAD_LIBS $LIBS"
-		LTHREAD_LIBS=""
-	fi
-
-fi
-
-if test $ol_link_threads = no ; then
-	if test $ol_with_threads = yes ; then
-		as_fn_error $? "no suitable thread support" "$LINENO" 5
-	fi
-
-	if test $ol_with_threads = auto ; then
-		{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: no suitable thread support, disabling threads" >&5
-$as_echo "$as_me: WARNING: no suitable thread support, disabling threads" >&2;}
-		ol_with_threads=no
-	fi
-
-
-$as_echo "#define NO_THREADS 1" >>confdefs.h
-
-	LTHREAD_LIBS=""
-	BUILD_THREAD=no
-else
-	BUILD_THREAD=yes
-fi
-
-if test $ol_link_threads != no ; then
-
-$as_echo "#define LDAP_API_FEATURE_X_OPENLDAP_THREAD_SAFE 1" >>confdefs.h
-
-fi
-
-# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
-case "$ol_with_threads" in
- no)
-    ol_pthread_ok=no
-
-    ;;
- *)
-
-	have_pthreads=yes
-	PTHREAD_LIBS="$LTHREAD_LIBS"
-	CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
-	# The cast to long int works around a bug in the HP C Compiler
-# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
-# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
-# This bug is HP SR number 8606223364.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of pthread_t" >&5
-$as_echo_n "checking size of pthread_t... " >&6; }
-if ${ac_cv_sizeof_pthread_t+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (pthread_t))" "ac_cv_sizeof_pthread_t"        "
-		$ac_includes_default
-		#include <pthread.h>
-
-
-"; then :
-
-else
-  if test "$ac_cv_type_pthread_t" = yes; then
-     { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error 77 "cannot compute sizeof (pthread_t)
-See \`config.log' for more details" "$LINENO" 5; }
-   else
-     ac_cv_sizeof_pthread_t=0
-   fi
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_pthread_t" >&5
-$as_echo "$ac_cv_sizeof_pthread_t" >&6; }
-
-
-
-cat >>confdefs.h <<_ACEOF
-#define SIZEOF_PTHREAD_T $ac_cv_sizeof_pthread_t
-_ACEOF
-
-
-
-    ;;
-esac
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-fi
-
-
- if test "$have_pthreads" != "no" && test "$enable_thread_support" != "no"; then
-  PTHREADS_TRUE=
-  PTHREADS_FALSE='#'
-else
-  PTHREADS_TRUE='#'
-  PTHREADS_FALSE=
-fi
-
-
-# check if we should compile locking into the library
-if test x$enable_thread_support = xno; then
-
-$as_echo "#define DISABLE_THREAD_SUPPORT 1" >>confdefs.h
-
-fi
-
-# check if we should hard-code the mm functions.
-if test x$enable_malloc_replacement = xno; then
-
-$as_echo "#define DISABLE_MM_REPLACEMENT 1" >>confdefs.h
-
-fi
-
-# check if we should hard-code debugging out
-if test x$enable_debug_mode = xno; then
-
-$as_echo "#define DISABLE_DEBUG_MODE 1" >>confdefs.h
+$as_echo "#define DISABLE_DEBUG_MODE 1" >>confdefs.h
 
 fi
 
@@ -19712,6 +15615,10 @@
   as_fn_error $? "conditional \"am__fastdepCC\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
+if test -z "${BUILD_SAMPLES_TRUE}" && test -z "${BUILD_SAMPLES_FALSE}"; then
+  as_fn_error $? "conditional \"BUILD_SAMPLES\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
 if test -z "${BUILD_REGRESS_TRUE}" && test -z "${BUILD_REGRESS_FALSE}"; then
   as_fn_error $? "conditional \"BUILD_REGRESS\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
@@ -20189,7 +16096,7 @@
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by libevent $as_me 2.1.3-alpha-dev, which was
+This file was extended by libevent $as_me 2.1.5-beta, which was
 generated by GNU Autoconf 2.68.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -20255,7 +16162,7 @@
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-libevent config.status 2.1.3-alpha-dev
+libevent config.status 2.1.5-beta
 configured by $0, generated by GNU Autoconf 2.68,
   with options \\"\$ac_cs_config\\"
 
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/sntp/libevent/configure.ac /cur/src/external/bsd/ntp/dist/sntp/libevent/configure.ac
--- external/bsd/ntp/dist/sntp/libevent/configure.ac	2014-12-19 12:37:46.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/sntp/libevent/configure.ac	2015-04-07 19:51:18.000000000 -0700
@@ -5,18 +5,17 @@
 dnl
 dnl Original version Dug Song <dugsong@monkey.org>
 
-AC_INIT(libevent,2.1.3-alpha-dev)
+AC_INIT(libevent,2.1.5-beta)
 AC_PREREQ(2.59)
 AC_CONFIG_SRCDIR(event.c)
 
 AC_CONFIG_MACRO_DIR([m4])
 AC_CONFIG_AUX_DIR([build-aux])
-
 AM_INIT_AUTOMAKE
 dnl AM_SILENT_RULES req. automake 1.11.  [no] defaults V=1
 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
 AC_CONFIG_HEADERS(config.h  evconfig-private.h:evconfig-private.h.in)
-AC_DEFINE(NUMERIC_VERSION, 0x02010301, [Numeric representation of the version])
+AC_DEFINE(NUMERIC_VERSION, 0x02010500, [Numeric representation of the version])
 
 dnl Initialize prefix.
 if test "$prefix" = "NONE"; then
@@ -113,6 +112,9 @@
 AC_ARG_ENABLE([libevent-regress],
      AS_HELP_STRING([--disable-libevent-regress, skip regress in make check]),
 	[], [enable_libevent_regress=yes])
+AC_ARG_ENABLE([samples],
+     AS_HELP_STRING([--disable-samples, skip building of sample programs]),
+	[], [enable_samples=yes])
 AC_ARG_ENABLE([function-sections],
      AS_HELP_STRING([--enable-function-sections, make static library allow smaller binaries with --gc-sections]),
 	[], [enable_function_sections=no])
@@ -129,6 +131,7 @@
 dnl AC_DISABLE_SHARED
 AC_SUBST(LIBTOOL_DEPS)
 
+AM_CONDITIONAL([BUILD_SAMPLES], [test "$enable_samples" = "yes"])
 AM_CONDITIONAL([BUILD_REGRESS], [test "$enable_libevent_regress" = "yes"])
 
 dnl Checks for libraries.
@@ -724,22 +727,16 @@
 # check if we can compile with pthreads
 have_pthreads=no
 if test x$bwin32 != xtrue && test "$enable_thread_support" != "no"; then
-    OL_THREAD_CHECK([
-	have_pthreads=yes
-	PTHREAD_LIBS="$LTHREAD_LIBS"
-	CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
-	AC_CHECK_SIZEOF(
-	    [pthread_t],
-	    [],
-	    [
-		AC_INCLUDES_DEFAULT()
-		#include <pthread.h>
-	    ]
-	)
-    ])
+  ACX_PTHREAD([
+	AC_DEFINE(HAVE_PTHREADS, 1,
+		[Define if we have pthreads on this system])
+	have_pthreads=yes])
+  CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+  AC_CHECK_SIZEOF(pthread_t, ,
+     [AC_INCLUDES_DEFAULT()
+      #include <pthread.h> ]
+  )
 fi
-AC_SUBST([PTHREAD_LIBS])
-AC_SUBST([PTHREAD_CFLAGS])
 AM_CONDITIONAL([PTHREADS], [test "$have_pthreads" != "no" && test "$enable_thread_support" != "no"])
 
 # check if we should compile locking into the library
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/sntp/libevent/evbuffer-internal.h /cur/src/external/bsd/ntp/dist/sntp/libevent/evbuffer-internal.h
--- external/bsd/ntp/dist/sntp/libevent/evbuffer-internal.h	2014-12-24 18:28:14.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/sntp/libevent/evbuffer-internal.h	2015-04-07 19:51:18.000000000 -0700
@@ -157,6 +157,18 @@
 	struct bufferevent *parent;
 };
 
+#if EVENT__SIZEOF_OFF_T < EVENT__SIZEOF_SIZE_T
+typedef ev_ssize_t ev_misalign_t;
+#define EVBUFFER_CHAIN_MAX ((size_t)EV_SSIZE_MAX)
+#else
+typedef ev_off_t ev_misalign_t;
+#if EVENT__SIZEOF_OFF_T > EVENT__SIZEOF_SIZE_T
+#define EVBUFFER_CHAIN_MAX EV_SIZE_MAX
+#else
+#define EVBUFFER_CHAIN_MAX ((size_t)EV_SSIZE_MAX)
+#endif
+#endif
+
 /** A single item in an evbuffer. */
 struct evbuffer_chain {
 	/** points to next buffer in the chain */
@@ -167,7 +179,7 @@
 
 	/** unused space at the beginning of buffer or an offset into a
 	 * file for sendfile buffers. */
-	ev_off_t misalign;
+	ev_misalign_t misalign;
 
 	/** Offset into buffer + misalign at which to start writing.
 	 * In other words, the total number of bytes actually stored
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/sntp/libevent/evdns.c /cur/src/external/bsd/ntp/dist/sntp/libevent/evdns.c
--- external/bsd/ntp/dist/sntp/libevent/evdns.c	2014-12-24 18:28:14.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/sntp/libevent/evdns.c	2015-04-07 19:51:18.000000000 -0700
@@ -543,6 +543,17 @@
 	}
 }
 
+static void
+request_swap_ns(struct request *req, struct nameserver *ns) {
+	if (ns && req->ns != ns) {
+		EVUTIL_ASSERT(req->ns->requests_inflight > 0);
+		req->ns->requests_inflight--;
+		ns->requests_inflight++;
+
+		req->ns = ns;
+	}
+}
+
 /* called when a nameserver has been deemed to have failed. For example, too */
 /* many packets have timed out etc */
 static void
@@ -597,7 +608,7 @@
 				if (req->tx_count == 0 && req->ns == ns) {
 					/* still waiting to go out, can be moved */
 					/* to another server */
-					req->ns = nameserver_pick(base);
+					request_swap_ns(req, nameserver_pick(base));
 				}
 				req = req->next;
 			} while (req != started_at);
@@ -661,6 +672,7 @@
 	    req->ns->requests_inflight == 0 &&
 	    req->base->disable_when_inactive) {
 		event_del(&req->ns->event);
+		evtimer_del(&req->ns->timeout_event);
 	}
 
 	if (!req->request_appended) {
@@ -709,7 +721,7 @@
 	/* the last nameserver should have been marked as failing */
 	/* by the caller of this function, therefore pick will try */
 	/* not to return it */
-	req->ns = nameserver_pick(req->base);
+	request_swap_ns(req, nameserver_pick(req->base));
 	if (req->ns == last_ns) {
 		/* ... but pick did return it */
 		/* not a lot of point in trying again with the */
@@ -2160,29 +2172,30 @@
 	log(EVDNS_LOG_DEBUG, "Request %p timed out", arg);
 	EVDNS_LOCK(base);
 
-	req->ns->timedout++;
-	if (req->ns->timedout > req->base->global_max_nameserver_timeout) {
-		req->ns->timedout = 0;
-		nameserver_failed(req->ns, "request timed out.");
-	}
-
 	if (req->tx_count >= req->base->global_max_retransmits) {
+		struct nameserver *ns = req->ns;
 		/* this request has failed */
 		log(EVDNS_LOG_DEBUG, "Giving up on request %p; tx_count==%d",
 		    arg, req->tx_count);
 		reply_schedule_callback(req, 0, DNS_ERR_TIMEOUT, NULL);
+
 		request_finished(req, &REQ_HEAD(req->base, req->trans_id), 1);
+		nameserver_failed(ns, "request timed out.");
 	} else {
 		/* retransmit it */
-		struct nameserver *new_ns;
 		log(EVDNS_LOG_DEBUG, "Retransmitting request %p; tx_count==%d",
 		    arg, req->tx_count);
 		(void) evtimer_del(&req->timeout_event);
-		new_ns = nameserver_pick(base);
-		if (new_ns)
-			req->ns = new_ns;
+		request_swap_ns(req, nameserver_pick(base));
 		evdns_request_transmit(req);
+
+		req->ns->timedout++;
+		if (req->ns->timedout > req->base->global_max_nameserver_timeout) {
+			req->ns->timedout = 0;
+			nameserver_failed(req->ns, "request timed out.");
+		}
 	}
+
 	EVDNS_UNLOCK(base);
 }
 
@@ -2641,6 +2654,34 @@
 	return res;
 }
 
+int
+evdns_base_get_nameserver_addr(struct evdns_base *base, int idx,
+    struct sockaddr *sa, ev_socklen_t len)
+{
+	int result = -1;
+	int i;
+	struct nameserver *server;
+	EVDNS_LOCK(base);
+	server = base->server_head;
+	for (i = 0; i < idx && server; ++i, server = server->next) {
+		if (server->next == base->server_head)
+			goto done;
+	}
+	if (! server)
+		goto done;
+
+	if (server->addrlen > len) {
+		result = (int) server->addrlen;
+		goto done;
+	}
+
+	memcpy(sa, &server->address, server->addrlen);
+	result = (int) server->addrlen;
+done:
+	EVDNS_UNLOCK(base);
+	return result;
+}
+
 /* remove from the queue */
 static void
 evdns_request_remove(struct request *req, struct request **head)
@@ -3313,7 +3354,7 @@
 
 /* Parse a number of seconds into a timeval; return -1 on error. */
 static int
-strtotimeval(const char *const str, struct timeval *out)
+evdns_strtotimeval(const char *const str, struct timeval *out)
 {
 	double d;
 	char *endptr;
@@ -3416,13 +3457,13 @@
 		base->global_search_state->ndots = ndots;
 	} else if (str_matches_option(option, "timeout:")) {
 		struct timeval tv;
-		if (strtotimeval(val, &tv) == -1) return -1;
+		if (evdns_strtotimeval(val, &tv) == -1) return -1;
 		if (!(flags & DNS_OPTION_MISC)) return 0;
 		log(EVDNS_LOG_DEBUG, "Setting timeout to %s", val);
 		memcpy(&base->global_timeout, &tv, sizeof(struct timeval));
 	} else if (str_matches_option(option, "getaddrinfo-allow-skew:")) {
 		struct timeval tv;
-		if (strtotimeval(val, &tv) == -1) return -1;
+		if (evdns_strtotimeval(val, &tv) == -1) return -1;
 		if (!(flags & DNS_OPTION_MISC)) return 0;
 		log(EVDNS_LOG_DEBUG, "Setting getaddrinfo-allow-skew to %s",
 		    val);
@@ -3464,7 +3505,7 @@
 		base->global_outgoing_addrlen = len;
 	} else if (str_matches_option(option, "initial-probe-timeout:")) {
 		struct timeval tv;
-		if (strtotimeval(val, &tv) == -1) return -1;
+		if (evdns_strtotimeval(val, &tv) == -1) return -1;
 		if (tv.tv_sec > 3600)
 			tv.tv_sec = 3600;
 		if (!(flags & DNS_OPTION_MISC)) return 0;
@@ -3557,8 +3598,8 @@
 
 	if (! SHGetSpecialFolderPathA(NULL, path, CSIDL_SYSTEM, 0))
 		return NULL;
-	len_out = strlen(path)+strlen(hostfile);
-	path_out = mm_malloc(len_out+1);
+	len_out = strlen(path)+strlen(hostfile)+1;
+	path_out = mm_malloc(len_out);
 	evutil_snprintf(path_out, len_out, "%s%s", path, hostfile);
 	return path_out;
 #else
@@ -3828,17 +3869,18 @@
 	if (base == NULL)
 		return -1;
 	EVDNS_LOCK(base);
+	fname = evdns_get_default_hosts_filename();
+	log(EVDNS_LOG_DEBUG, "Loading hosts entries from %s", fname);
+	evdns_base_load_hosts(base, fname);
+	if (fname)
+		mm_free(fname);
+
 	if (load_nameservers_with_getnetworkparams(base) == 0) {
 		EVDNS_UNLOCK(base);
 		return 0;
 	}
 	r = load_nameservers_from_registry(base);
 
-	fname = evdns_get_default_hosts_filename();
-	evdns_base_load_hosts(base, fname);
-	if (fname)
-		mm_free(fname);
-
 	EVDNS_UNLOCK(base);
 	return r;
 }
@@ -3975,6 +4017,10 @@
 	event_debug_unassign(&server->event);
 	if (server->state == 0)
 		(void) event_del(&server->timeout_event);
+	if (server->probe_request) {
+		evdns_cancel_request(server->base, server->probe_request);
+		server->probe_request = NULL;
+	}
 	event_debug_unassign(&server->timeout_event);
 	mm_free(server);
 }
@@ -3990,6 +4036,15 @@
 
 	/* TODO(nickm) we might need to refcount here. */
 
+	for (server = base->server_head; server; server = server_next) {
+		server_next = server->next;
+		evdns_nameserver_free(server);
+		if (server_next == base->server_head)
+			break;
+	}
+	base->server_head = NULL;
+	base->global_good_nameservers = 0;
+
 	for (i = 0; i < base->n_req_heads; ++i) {
 		while (base->req_heads[i]) {
 			if (fail_requests)
@@ -4004,14 +4059,6 @@
 	}
 	base->global_requests_inflight = base->global_requests_waiting = 0;
 
-	for (server = base->server_head; server; server = server_next) {
-		server_next = server->next;
-		evdns_nameserver_free(server);
-		if (server_next == base->server_head)
-			break;
-	}
-	base->server_head = NULL;
-	base->global_good_nameservers = 0;
 
 	if (base->global_search_state) {
 		for (dom = base->global_search_state->head; dom; dom = dom_next) {
@@ -4665,7 +4712,7 @@
 		data->ipv4_request.r = evdns_base_resolve_ipv4(dns_base,
 		    nodename, 0, evdns_getaddrinfo_gotresolve,
 		    &data->ipv4_request);
-		if (want_cname)
+		if (want_cname && data->ipv4_request.r)
 			data->ipv4_request.r->current_req->put_cname_in_ptr =
 			    &data->cname_result;
 	}
@@ -4676,7 +4723,7 @@
 		data->ipv6_request.r = evdns_base_resolve_ipv6(dns_base,
 		    nodename, 0, evdns_getaddrinfo_gotresolve,
 		    &data->ipv6_request);
-		if (want_cname)
+		if (want_cname && data->ipv6_request.r)
 			data->ipv6_request.r->current_req->put_cname_in_ptr =
 			    &data->cname_result;
 	}
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/sntp/libevent/event.c /cur/src/external/bsd/ntp/dist/sntp/libevent/event.c
--- external/bsd/ntp/dist/sntp/libevent/event.c	2014-12-24 18:28:15.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/sntp/libevent/event.c	2015-04-07 19:51:18.000000000 -0700
@@ -528,22 +528,24 @@
 #endif
 }
 
-#if 0
 void
 event_disable_debug_mode(void)
 {
+#ifndef EVENT__DISABLE_DEBUG_MODE
 	struct event_debug_entry **ent, *victim;
 
 	EVLOCK_LOCK(event_debug_map_lock_, 0);
 	for (ent = HT_START(event_debug_map, &global_debug_map); ent; ) {
 		victim = *ent;
-		ent = HT_NEXT_RMV(event_debug_map,&global_debug_map, ent);
+		ent = HT_NEXT_RMV(event_debug_map, &global_debug_map, ent);
 		mm_free(victim);
 	}
 	HT_CLEAR(event_debug_map, &global_debug_map);
 	EVLOCK_UNLOCK(event_debug_map_lock_ , 0);
-}
+
+	event_debug_mode_on_  = 0;
 #endif
+}
 
 struct event_base *
 event_base_new_with_config(const struct event_config *cfg)
@@ -995,6 +997,21 @@
 	return (res);
 }
 
+/* Get the monotonic time for this event_base' timer */
+int
+event_gettime_monotonic(struct event_base *base, struct timeval *tv)
+{
+  int rv = -1;
+
+  if (base && tv) {
+    EVBASE_ACQUIRE_LOCK(base, th_base_lock);
+    rv = evutil_gettime_monotonic_(&(base->monotonic_timer), tv);
+    EVBASE_RELEASE_LOCK(base, th_base_lock);
+  }
+
+  return rv;
+}
+
 const char **
 event_get_supported_methods(void)
 {
@@ -1456,10 +1473,13 @@
 static inline void
 event_persist_closure(struct event_base *base, struct event *ev)
 {
-
-	// Define our callback, we use this to store our callback before it's executed
 	void (*evcb_callback)(evutil_socket_t, short, void *);
 
+        // Other fields of *ev that must be stored before executing
+        evutil_socket_t evcb_fd;
+        short evcb_res;
+        void *evcb_arg;
+
 	/* reschedule the persistent event if we have a timeout. */
 	if (ev->ev_io_timeout.tv_sec || ev->ev_io_timeout.tv_usec) {
 		/* If there was a timeout, we want it to run at an interval of
@@ -1503,13 +1523,16 @@
 	}
 
 	// Save our callback before we release the lock
-	evcb_callback = *ev->ev_callback;
+	evcb_callback = ev->ev_callback;
+        evcb_fd = ev->ev_fd;
+        evcb_res = ev->ev_res;
+        evcb_arg = ev->ev_arg;
 
 	// Release the lock
  	EVBASE_RELEASE_LOCK(base, th_base_lock);
 
 	// Execute the callback
-	(evcb_callback)(ev->ev_fd, ev->ev_res, ev->ev_arg);
+        (evcb_callback)(evcb_fd, evcb_res, evcb_arg);
 }
 
 /*
@@ -1571,8 +1594,9 @@
 			event_persist_closure(base, ev);
 			break;
 		case EV_CLOSURE_EVENT: {
+			void (*evcb_callback)(evutil_socket_t, short, void *);
 			EVUTIL_ASSERT(ev != NULL);
-			void (*evcb_callback)(evutil_socket_t, short, void *) = *ev->ev_callback;
+			evcb_callback = *ev->ev_callback;
 			EVBASE_RELEASE_LOCK(base, th_base_lock);
 			evcb_callback(ev->ev_fd, ev->ev_res, ev->ev_arg);
 		}
@@ -1585,14 +1609,16 @@
 		break;
 		case EV_CLOSURE_EVENT_FINALIZE:
 		case EV_CLOSURE_EVENT_FINALIZE_FREE: {
+			void (*evcb_evfinalize)(struct event *, void *);
+			int evcb_closure = evcb->evcb_closure;
 			EVUTIL_ASSERT(ev != NULL);
-			void (*evcb_evfinalize)(struct event *, void *) = ev->ev_evcallback.evcb_cb_union.evcb_evfinalize;
 			base->current_event = NULL;
+			evcb_evfinalize = ev->ev_evcallback.evcb_cb_union.evcb_evfinalize;
 			EVUTIL_ASSERT((evcb->evcb_flags & EVLIST_FINALIZING));
 			EVBASE_RELEASE_LOCK(base, th_base_lock);
 			evcb_evfinalize(ev, ev->ev_arg);
 			event_debug_note_teardown_(ev);
-			if (evcb->evcb_closure == EV_CLOSURE_EVENT_FINALIZE_FREE)
+			if (evcb_closure == EV_CLOSURE_EVENT_FINALIZE_FREE)
 				mm_free(ev);
 		}
 		break;
@@ -3741,6 +3767,7 @@
 	if (event_debug_map_lock_ != NULL) {
 		EVTHREAD_FREE_LOCK(event_debug_map_lock_, 0);
 		event_debug_map_lock_ = NULL;
+		evthreadimpl_disable_lock_debugging_();
 	}
 #endif /* EVENT__DISABLE_DEBUG_MODE */
 #endif /* EVENT__DISABLE_THREAD_SUPPORT */
@@ -3776,6 +3803,7 @@
 void
 libevent_global_shutdown(void)
 {
+	event_disable_debug_mode();
 	event_free_globals();
 }
 
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/sntp/libevent/event_tagging.c /cur/src/external/bsd/ntp/dist/sntp/libevent/event_tagging.c
--- external/bsd/ntp/dist/sntp/libevent/event_tagging.c	2014-12-24 18:28:15.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/sntp/libevent/event_tagging.c	2015-04-07 19:51:18.000000000 -0700
@@ -209,10 +209,19 @@
 	 */
 	data = evbuffer_pullup(
 		evbuf, len < sizeof(number) + 1 ? len : sizeof(number) + 1);
+	if (!data)
+		return (-1);
 
 	while (count++ < len) {
 		ev_uint8_t lower = *data++;
-		number |= (lower & 0x7f) << shift;
+		if (shift >= 28) {
+			/* Make sure it fits into 32 bits */
+			if (shift > 28)
+				return (-1);
+			if ((lower & 0x7f) > 15)
+				return (-1);
+		}
+		number |= (lower & (unsigned)0x7f) << shift;
 		shift += 7;
 
 		if (!(lower & 0x80)) {
@@ -315,6 +324,8 @@
 									\
 	/* XXX(niels): faster? */					\
 	data = evbuffer_pullup(evbuf, offset + 1) + offset;		\
+	if (!data)							\
+		return (-1);						\
 									\
 	nibbles = ((data[0] & 0xf0) >> 4) + 1;				\
 	if (nibbles > maxnibbles || (nibbles >> 1) + 1 > len)		\
@@ -322,6 +333,8 @@
 	len = (nibbles >> 1) + 1;					\
 									\
 	data = evbuffer_pullup(evbuf, offset + len) + offset;		\
+	if (!data)							\
+		return (-1);						\
 									\
 	while (nibbles > 0) {						\
 		number <<= 4;						\
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/sntp/libevent/evrpc-internal.h /cur/src/external/bsd/ntp/dist/sntp/libevent/evrpc-internal.h
--- external/bsd/ntp/dist/sntp/libevent/evrpc-internal.h	2014-12-24 18:28:15.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/sntp/libevent/evrpc-internal.h	2015-04-07 19:51:18.000000000 -0700
@@ -29,6 +29,7 @@
 #ifndef EVRPC_INTERNAL_H_INCLUDED_
 #define EVRPC_INTERNAL_H_INCLUDED_
 
+#include "event2/http.h"
 #include "http-internal.h"
 
 struct evrpc;
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/sntp/libevent/evthread-internal.h /cur/src/external/bsd/ntp/dist/sntp/libevent/evthread-internal.h
--- external/bsd/ntp/dist/sntp/libevent/evthread-internal.h	2014-12-24 18:28:15.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/sntp/libevent/evthread-internal.h	2015-04-07 19:51:18.000000000 -0700
@@ -378,6 +378,13 @@
 int evutil_global_setup_locks_(const int enable_locks);
 int evutil_secure_rng_global_setup_locks_(const int enable_locks);
 
+/** Return current evthread_lock_callbacks */
+struct evthread_lock_callbacks *evthread_get_lock_callbacks(void);
+/** Return current evthread_condition_callbacks */
+struct evthread_condition_callbacks *evthread_get_condition_callbacks(void);
+/** Disable locking for internal usage (like global shutdown) */
+void evthreadimpl_disable_lock_debugging_(void);
+
 #endif
 
 #ifdef __cplusplus
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/sntp/libevent/evthread.c /cur/src/external/bsd/ntp/dist/sntp/libevent/evthread.c
--- external/bsd/ntp/dist/sntp/libevent/evthread.c	2014-12-24 18:28:15.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/sntp/libevent/evthread.c	2015-04-07 19:51:18.000000000 -0700
@@ -71,12 +71,25 @@
 	evthread_id_fn_ = id_fn;
 }
 
+struct evthread_lock_callbacks *evthread_get_lock_callbacks()
+{
+	return evthread_lock_debugging_enabled_
+	    ? &original_lock_fns_ : &evthread_lock_fns_;
+}
+struct evthread_condition_callbacks *evthread_get_condition_callbacks()
+{
+	return evthread_lock_debugging_enabled_
+	    ? &original_cond_fns_ : &evthread_cond_fns_;
+}
+void evthreadimpl_disable_lock_debugging_(void)
+{
+	evthread_lock_debugging_enabled_ = 0;
+}
+
 int
 evthread_set_lock_callbacks(const struct evthread_lock_callbacks *cbs)
 {
-	struct evthread_lock_callbacks *target =
-	    evthread_lock_debugging_enabled_
-	    ? &original_lock_fns_ : &evthread_lock_fns_;
+	struct evthread_lock_callbacks *target = evthread_get_lock_callbacks();
 
 	if (!cbs) {
 		if (target->alloc)
@@ -111,9 +124,7 @@
 int
 evthread_set_condition_callbacks(const struct evthread_condition_callbacks *cbs)
 {
-	struct evthread_condition_callbacks *target =
-	    evthread_lock_debugging_enabled_
-	    ? &original_cond_fns_ : &evthread_cond_fns_;
+	struct evthread_condition_callbacks *target = evthread_get_condition_callbacks();
 
 	if (!cbs) {
 		if (target->alloc_condition)
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/sntp/libevent/evutil.c /cur/src/external/bsd/ntp/dist/sntp/libevent/evutil.c
--- external/bsd/ntp/dist/sntp/libevent/evutil.c	2014-12-24 18:28:15.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/sntp/libevent/evutil.c	2015-04-07 19:51:18.000000000 -0700
@@ -370,6 +370,20 @@
 }
 
 int
+evutil_make_listen_socket_reuseable_port(evutil_socket_t sock)
+{
+#if defined __linux__ && defined(SO_REUSEPORT)
+	int one = 1;
+	/* REUSEPORT on Linux 3.9+ means, "Multiple servers (processes or
+	 * threads) can bind to the same port if they each set the option. */
+	return setsockopt(sock, SOL_SOCKET, SO_REUSEPORT, (void*) &one,
+	    (ev_socklen_t)sizeof(one));
+#else
+	return 0;
+#endif
+}
+
+int
 evutil_make_tcp_listen_socket_deferred(evutil_socket_t sock)
 {
 #if defined(EVENT__HAVE_NETINET_TCP_H) && defined(TCP_DEFER_ACCEPT)
@@ -654,7 +668,7 @@
 	   "GetAdaptersInfo", but that's deprecated; let's just try
 	   GetAdaptersAddresses and fall back to connect+getsockname.
 	*/
-	HANDLE lib = evutil_load_windows_system_library_(TEXT("ihplapi.dll"));
+	HMODULE lib = evutil_load_windows_system_library_(TEXT("ihplapi.dll"));
 	GetAdaptersAddresses_fn_t fn;
 	ULONG size, res;
 	IP_ADAPTER_ADDRESSES *addresses = NULL, *address;
@@ -1920,15 +1934,15 @@
 	return inet_pton(af, src, dst);
 #else
 	if (af == AF_INET) {
-		int a,b,c,d;
+		unsigned a,b,c,d;
 		char more;
 		struct in_addr *addr = dst;
-		if (sscanf(src, "%d.%d.%d.%d%c", &a,&b,&c,&d,&more) != 4)
+		if (sscanf(src, "%u.%u.%u.%u%c", &a,&b,&c,&d,&more) != 4)
 			return 0;
-		if (a < 0 || a > 255) return 0;
-		if (b < 0 || b > 255) return 0;
-		if (c < 0 || c > 255) return 0;
-		if (d < 0 || d > 255) return 0;
+		if (a > 255) return 0;
+		if (b > 255) return 0;
+		if (c > 255) return 0;
+		if (d > 255) return 0;
 		addr->s_addr = htonl((a<<24) | (b<<16) | (c<<8) | d);
 		return 1;
 #ifdef AF_INET6
@@ -1943,7 +1957,7 @@
 		else if (!dot)
 			eow = src+strlen(src);
 		else {
-			int byte1,byte2,byte3,byte4;
+			unsigned byte1,byte2,byte3,byte4;
 			char more;
 			for (eow = dot-1; eow >= src && EVUTIL_ISDIGIT_(*eow); --eow)
 				;
@@ -1951,14 +1965,14 @@
 
 			/* We use "scanf" because some platform inet_aton()s are too lax
 			 * about IPv4 addresses of the form "1.2.3" */
-			if (sscanf(eow, "%d.%d.%d.%d%c",
+			if (sscanf(eow, "%u.%u.%u.%u%c",
 					   &byte1,&byte2,&byte3,&byte4,&more) != 4)
 				return 0;
 
-			if (byte1 > 255 || byte1 < 0 ||
-				byte2 > 255 || byte2 < 0 ||
-				byte3 > 255 || byte3 < 0 ||
-				byte4 > 255 || byte4 < 0)
+			if (byte1 > 255 ||
+			    byte2 > 255 ||
+			    byte3 > 255 ||
+			    byte4 > 255)
 				return 0;
 
 			words[6] = (byte1<<8) | byte2;
@@ -2455,7 +2469,7 @@
 }
 
 #ifdef _WIN32
-HANDLE
+HMODULE
 evutil_load_windows_system_library_(const TCHAR *library_name)
 {
   TCHAR path[MAX_PATH];
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/sntp/libevent/evutil_time.c /cur/src/external/bsd/ntp/dist/sntp/libevent/evutil_time.c
--- external/bsd/ntp/dist/sntp/libevent/evutil_time.c	2014-12-24 18:28:15.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/sntp/libevent/evutil_time.c	2015-04-07 19:51:18.000000000 -0700
@@ -56,6 +56,7 @@
 #include "event2/util.h"
 #include "util-internal.h"
 #include "log-internal.h"
+#include "mm-internal.h"
 
 #ifndef EVENT__HAVE_GETTIMEOFDAY
 /* No gettimeofday; this must be windows. */
@@ -162,6 +163,55 @@
 	base->last_time = *tv;
 }
 
+/*
+   Allocate a new struct evutil_monotonic_timer
+ */
+struct evutil_monotonic_timer *
+evutil_monotonic_timer_new(void)
+{
+  struct evutil_monotonic_timer *p = NULL;
+
+  p = mm_malloc(sizeof(*p));
+  if (!p) goto done;
+
+  memset(p, 0, sizeof(*p));
+
+ done:
+  return p;
+}
+
+/*
+   Free a struct evutil_monotonic_timer
+ */
+void
+evutil_monotonic_timer_free(struct evutil_monotonic_timer *timer)
+{
+  if (timer) {
+    mm_free(timer);
+  }
+}
+
+/*
+   Set up a struct evutil_monotonic_timer for initial use
+ */
+int
+evutil_configure_monotonic_time(struct evutil_monotonic_timer *timer,
+                                int flags)
+{
+  return evutil_configure_monotonic_time_(timer, flags);
+}
+
+/*
+   Query the current monotonic time
+ */
+int
+evutil_gettime_monotonic(struct evutil_monotonic_timer *timer,
+                         struct timeval *tp)
+{
+  return evutil_gettime_monotonic_(timer, tp);
+}
+
+
 #if defined(HAVE_POSIX_MONOTONIC)
 /* =====
    The POSIX clock_gettime() interface provides a few ways to get at a
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/sntp/libevent/ht-internal.h /cur/src/external/bsd/ntp/dist/sntp/libevent/ht-internal.h
--- external/bsd/ntp/dist/sntp/libevent/ht-internal.h	2014-12-24 18:28:15.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/sntp/libevent/ht-internal.h	2015-04-07 19:51:18.000000000 -0700
@@ -382,7 +382,6 @@
   {                                                                     \
     if (head->hth_table)                                                \
       freefn(head->hth_table);                                          \
-    head->hth_table_length = 0;                                         \
     name##_HT_INIT(head);                                               \
   }                                                                     \
   /* Debugging helper: return false iff the representation of 'head' is \
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/sntp/libevent/http-internal.h /cur/src/external/bsd/ntp/dist/sntp/libevent/http-internal.h
--- external/bsd/ntp/dist/sntp/libevent/http-internal.h	2014-12-24 18:28:15.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/sntp/libevent/http-internal.h	2015-04-07 19:51:18.000000000 -0700
@@ -76,6 +76,7 @@
 #define EVHTTP_CON_INCOMING	0x0001	/* only one request on it ever */
 #define EVHTTP_CON_OUTGOING	0x0002  /* multiple requests possible */
 #define EVHTTP_CON_CLOSEDETECT  0x0004  /* detecting if persistent close */
+#define EVHTTP_CON_AUTOFREE 0x0008  /* set when we want to auto free the connection */
 
 	struct timeval timeout;		/* timeout for events */
 	int retry_cnt;			/* retry count */
@@ -101,6 +102,7 @@
 
 	struct event_base *base;
 	struct evdns_base *dns_base;
+	int ai_family;
 
 	/* Saved conn_addr, to extract IP address from it.
 	 *
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/sntp/libevent/http.c /cur/src/external/bsd/ntp/dist/sntp/libevent/http.c
--- external/bsd/ntp/dist/sntp/libevent/http.c	2014-12-24 18:28:15.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/sntp/libevent/http.c	2015-04-07 19:51:18.000000000 -0700
@@ -771,6 +771,7 @@
 {
 	struct evhttp_request *req = TAILQ_FIRST(&evcon->requests);
 	int con_outgoing = evcon->flags & EVHTTP_CON_OUTGOING;
+	int free_evcon = 0;
 
 	if (con_outgoing) {
 		/* idle or close the connection */
@@ -803,6 +804,12 @@
 			 * need to detect if the other side closes it.
 			 */
 			evhttp_connection_start_detectclose(evcon);
+		} else if ((evcon->flags & EVHTTP_CON_AUTOFREE)) {
+			/*
+			 * If we have no more requests that need completion
+			 * and we're not waiting for the connection to close
+			 */
+			 free_evcon = 1;
 		}
 	} else {
 		/*
@@ -821,6 +828,16 @@
 	if (con_outgoing && ((req->flags & EVHTTP_USER_OWNED) == 0)) {
 		evhttp_request_free(req);
 	}
+
+	/* If this was the last request of an outgoing connection and we're
+	 * not waiting to receive a connection close event and we want to
+	 * automatically free the connection. We check to ensure our request
+	 * list is empty one last time just in case our callback added a
+	 * new request.
+	 */
+	if (free_evcon && TAILQ_FIRST(&evcon->requests) == NULL) {
+		evhttp_connection_free(evcon);
+	}
 }
 
 /*
@@ -1177,6 +1194,11 @@
 }
 
 void
+evhttp_connection_free_on_completion(struct evhttp_connection *evcon) {
+	evcon->flags |= EVHTTP_CON_AUTOFREE;
+}
+
+void
 evhttp_connection_set_local_address(struct evhttp_connection *evcon,
     const char *address)
 {
@@ -1245,6 +1267,7 @@
 
 		shutdown(evcon->fd, EVUTIL_SHUT_WR);
 		evutil_closesocket(evcon->fd);
+		bufferevent_setfd(evcon->bufev, -1);
 		evcon->fd = -1;
 	}
 
@@ -1287,6 +1310,7 @@
 {
 	struct evcon_requestq requests;
 
+	evhttp_connection_reset_(evcon);
 	if (evcon->retry_max < 0 || evcon->retry_cnt < evcon->retry_max) {
 		struct timeval tv_retry = evcon->initial_retry_timeout;
 		int i;
@@ -1308,7 +1332,6 @@
 		evcon->retry_cnt++;
 		return;
 	}
-	evhttp_connection_reset_(evcon);
 
 	/*
 	 * User callback can do evhttp_make_request() on the same
@@ -1387,6 +1410,17 @@
 		 */
 		EVUTIL_ASSERT(evcon->state == EVCON_IDLE);
 		evhttp_connection_reset_(evcon);
+
+		/*
+		 * If we have no more requests that need completion
+		 * and we want to auto-free the connection when all
+		 * requests have been completed.
+		 */
+		if (TAILQ_FIRST(&evcon->requests) == NULL
+		  && (evcon->flags & EVHTTP_CON_OUTGOING)
+		  && (evcon->flags & EVHTTP_CON_AUTOFREE)) {
+			evhttp_connection_free(evcon);
+		}
 		return;
 	}
 
@@ -2269,6 +2303,7 @@
 	    evhttp_deferred_read_cb, evcon);
 
 	evcon->dns_base = dnsbase;
+	evcon->ai_family = AF_UNSPEC;
 
 	return (evcon);
 
@@ -2296,6 +2331,12 @@
 	return evhttp_connection_base_bufferevent_new(base, dnsbase, NULL, address, port);
 }
 
+void evhttp_connection_set_family(struct evhttp_connection *evcon,
+	int family)
+{
+	evcon->ai_family = family;
+}
+
 void
 evhttp_connection_set_base(struct evhttp_connection *evcon,
     struct event_base *base)
@@ -2421,7 +2462,7 @@
 	evcon->state = EVCON_CONNECTING;
 
 	if (bufferevent_socket_connect_hostname(evcon->bufev, evcon->dns_base,
-		AF_UNSPEC, evcon->address, evcon->port) < 0) {
+		evcon->ai_family, evcon->address, evcon->port) < 0) {
 		evcon->state = old_state;
 		event_sock_warn(evcon->fd, "%s: connection to \"%s\" failed",
 		    __func__, evcon->address);
@@ -4291,6 +4332,8 @@
 		portnum = (portnum * 10) + (*s - '0');
 		if (portnum < 0)
 			return -1;
+		if (portnum > 65535)
+			return -1;
 		++s;
 	}
 	return portnum;
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/sntp/libevent/include/event2/buffer.h /cur/src/external/bsd/ntp/dist/sntp/libevent/include/event2/buffer.h
--- external/bsd/ntp/dist/sntp/libevent/include/event2/buffer.h	2014-12-24 18:28:16.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/sntp/libevent/include/event2/buffer.h	2015-04-07 19:51:18.000000000 -0700
@@ -107,13 +107,8 @@
 
     Used when repeatedly searching through a buffer.  Calling any function
     that modifies or re-packs the buffer contents may invalidate all
-    evbuffer_ptrs for that buffer.  Do not modify these values except with
-    evbuffer_ptr_set.
-
-    Used when repeatedly searching through a buffer.  Calls to any function
-    that modifies or re-packs the buffer contents may invalidate all
-    evbuffer_ptrs for that buffer.  Do not modify these values except with
-    evbuffer_ptr_set.
+    evbuffer_ptrs for that buffer.  Do not modify or contruct these values
+    except with evbuffer_ptr_set.
 
     An evbuffer_ptr can represent any position from the start of a buffer up
     to a position immediately after the end of a buffer.
@@ -789,7 +784,7 @@
    There are two ways to use this function: you can call
       evbuffer_ptr_set(buf, &pos, N, EVBUFFER_PTR_SET)
    to move 'pos' to a position 'N' bytes after the start of the buffer, or
-      evbuffer_ptr_set(buf, &pos, N, EVBUFFER_PTR_SET)
+      evbuffer_ptr_set(buf, &pos, N, EVBUFFER_PTR_ADD)
    to move 'pos' forward by 'N' bytes.
 
    If evbuffer_ptr is not initialized, this function can only be called
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/sntp/libevent/include/event2/bufferevent.h /cur/src/external/bsd/ntp/dist/sntp/libevent/include/event2/bufferevent.h
--- external/bsd/ntp/dist/sntp/libevent/include/event2/bufferevent.h	2014-12-24 18:28:16.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/sntp/libevent/include/event2/bufferevent.h	2015-04-07 19:51:18.000000000 -0700
@@ -537,8 +537,9 @@
     size_t lowmark, size_t highmark);
 
 /**
-  Retrieves the watermarks for read or write events. Result is undefined if
-  events contains both EV_READ and EV_WRITE.
+  Retrieves the watermarks for read or write events.
+  Returns non-zero if events contains not only EV_READ or EV_WRITE.
+  Returns zero if events equal EV_READ or EV_WRITE
 
   @param bufev the bufferevent to be examined
   @param events EV_READ or EV_WRITE
@@ -546,7 +547,7 @@
   @param highmark receives the high watermark if not NULL
 */
 EVENT2_EXPORT_SYMBOL
-void bufferevent_getwatermark(struct bufferevent *bufev, short events,
+int bufferevent_getwatermark(struct bufferevent *bufev, short events,
     size_t *lowmark, size_t *highmark);
 
 /**
@@ -600,7 +601,7 @@
 	BEV_TRIG_IGNORE_WATERMARKS = (1<<16),
 
 	/** defer even if the callbacks are not */
-	BEV_TRIG_DEFER_CALLBACKS = BEV_OPT_DEFER_CALLBACKS,
+	BEV_TRIG_DEFER_CALLBACKS = BEV_OPT_DEFER_CALLBACKS
 
 	/* (Note: for internal reasons, these need to be disjoint from
 	 * bufferevent_options, except when they mean the same thing. */
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/sntp/libevent/include/event2/dns.h /cur/src/external/bsd/ntp/dist/sntp/libevent/include/event2/dns.h
--- external/bsd/ntp/dist/sntp/libevent/include/event2/dns.h	2014-12-24 18:28:16.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/sntp/libevent/include/event2/dns.h	2015-04-07 19:51:18.000000000 -0700
@@ -455,7 +455,7 @@
 
   @param base the evdns_base to which to apply this operation
   @param flags any of DNS_OPTION_NAMESERVERS|DNS_OPTION_SEARCH|DNS_OPTION_MISC|
-    DNS_OPTIONS_HOSTSFILE|DNS_OPTIONS_ALL
+    DNS_OPTION_HOSTSFILE|DNS_OPTIONS_ALL
   @param filename the path to the resolv.conf file
   @return 0 if successful, or various positive error codes if an error
     occurred (see above)
@@ -696,6 +696,22 @@
 EVENT2_EXPORT_SYMBOL
 void evdns_getaddrinfo_cancel(struct evdns_getaddrinfo_request *req);
 
+/**
+   Retrieve the address of the 'idx'th configured nameserver.
+
+   @param base The evdns_base to examine.
+   @param idx The index of the nameserver to get the address of.
+   @param sa A location to receive the server's address.
+   @param len The number of bytes available at sa.
+
+   @return the number of bytes written into sa on success.  On failure, returns
+     -1 if idx is greater than the number of configured nameservers, or a
+     value greater than 'len' if len was not high enough.
+ */
+EVENT2_EXPORT_SYMBOL
+int evdns_base_get_nameserver_addr(struct evdns_base *base, int idx,
+    struct sockaddr *sa, ev_socklen_t len);
+
 #ifdef __cplusplus
 }
 #endif
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/sntp/libevent/include/event2/event.h /cur/src/external/bsd/ntp/dist/sntp/libevent/include/event2/event.h
--- external/bsd/ntp/dist/sntp/libevent/include/event2/event.h	2014-12-24 18:28:16.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/sntp/libevent/include/event2/event.h	2015-04-07 19:51:18.000000000 -0700
@@ -398,6 +398,12 @@
 EVENT2_EXPORT_SYMBOL
 const char **event_get_supported_methods(void);
 
+/** Query the current monotonic time from a the timer for a struct
+ * event_base.
+ */
+EVENT2_EXPORT_SYMBOL
+int event_gettime_monotonic(struct event_base *base, struct timeval *tp);
+
 /**
    @name event type flag
 
@@ -773,6 +779,10 @@
 EVENT2_EXPORT_SYMBOL
 void event_enable_debug_logging(ev_uint32_t which);
 
+EVENT2_EXPORT_SYMBOL
+void
+event_disable_debug_mode(void);
+
 /**
   Associate a different event base with an event.
 
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/sntp/libevent/include/event2/http.h /cur/src/external/bsd/ntp/dist/sntp/libevent/include/event2/http.h
--- external/bsd/ntp/dist/sntp/libevent/include/event2/http.h	2014-12-24 18:28:16.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/sntp/libevent/include/event2/http.h	2015-04-07 19:51:18.000000000 -0700
@@ -632,6 +632,12 @@
 	struct event_base *base, struct evdns_base *dnsbase,
 	const char *address, unsigned short port);
 
+/**
+ * Set family hint for DNS requests.
+ */
+void evhttp_connection_set_family(struct evhttp_connection *evcon,
+	int family);
+
 /** Takes ownership of the request object
  *
  * Can be used in a request callback to keep onto the request until
@@ -671,6 +677,14 @@
 EVENT2_EXPORT_SYMBOL
 void evhttp_connection_free(struct evhttp_connection *evcon);
 
+/** Disowns a given connection object
+ *
+ * Can be used to tell libevent to free the connection object after
+ * the last request has completed or failed.
+ */
+EVENT2_EXPORT_SYMBOL
+void evhttp_connection_free_on_completion(struct evhttp_connection *evcon);
+
 /** sets the ip address from which http connections are made */
 EVENT2_EXPORT_SYMBOL
 void evhttp_connection_set_local_address(struct evhttp_connection *evcon,
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/sntp/libevent/include/event2/listener.h /cur/src/external/bsd/ntp/dist/sntp/libevent/include/event2/listener.h
--- external/bsd/ntp/dist/sntp/libevent/include/event2/listener.h	2014-12-24 18:28:16.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/sntp/libevent/include/event2/listener.h	2015-04-07 19:51:18.000000000 -0700
@@ -90,6 +90,15 @@
  * to use the option before it is actually bound.
  */
 #define LEV_OPT_DEFERRED_ACCEPT		(1u<<6)
+/** Flag: Indicates that we ask to allow multiple servers (processes or
+ * threads) to bind to the same port if they each set the option. 
+ * 
+ * SO_REUSEPORT is what most people would expect SO_REUSEADDR to be, however
+ * SO_REUSEPORT does not imply SO_REUSEADDR.
+ *
+ * This is only available on Linux and kernel 3.9+
+ */
+#define LEV_OPT_REUSEABLE_PORT		(1u<<7)
 
 /**
    Allocate a new evconnlistener object to listen for incoming TCP connections
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/sntp/libevent/include/event2/util.h /cur/src/external/bsd/ntp/dist/sntp/libevent/include/event2/util.h
--- external/bsd/ntp/dist/sntp/libevent/include/event2/util.h	2014-12-24 18:28:16.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/sntp/libevent/include/event2/util.h	2015-04-07 19:51:18.000000000 -0700
@@ -294,6 +294,62 @@
 #define evutil_socket_t int
 #endif
 
+/**
+ * Structure to hold information about a monotonic timer
+ *
+ * Use this with evutil_configure_monotonic_time() and
+ * evutil_gettime_monotonic().
+ *
+ * This is an opaque structure; you can allocate one using
+ * evutil_monotonic_timer_new().
+ *
+ * @see evutil_monotonic_timer_new(), evutil_monotonic_timer_free(),
+ * evutil_configure_monotonic_time(), evutil_gettime_monotonic()
+ */
+struct evutil_monotonic_timer
+#ifdef EVENT_IN_DOXYGEN_
+{/*Empty body so that doxygen will generate documentation here.*/}
+#endif
+;
+
+#define EV_MONOT_PRECISE  1
+#define EV_MONOT_FALLBACK 2
+
+/** Allocate a new struct evutil_monotonic_timer for use with the
+ * evutil_configure_monotonic_time() and evutil_gettime_monotonic()
+ * functions.  You must configure the timer with
+ * evutil_configure_monotonic_time() before using it.
+ */
+EVENT2_EXPORT_SYMBOL
+struct evutil_monotonic_timer * evutil_monotonic_timer_new(void);
+
+/** Free a struct evutil_monotonic_timer that was allocated using
+ * evutil_monotonic_timer_new().
+ */
+EVENT2_EXPORT_SYMBOL
+void evutil_monotonic_timer_free(struct evutil_monotonic_timer *timer);
+
+/** Set up a struct evutil_monotonic_timer; flags can include
+ * EV_MONOT_PRECISE and EV_MONOT_FALLBACK.
+ */
+EVENT2_EXPORT_SYMBOL
+int evutil_configure_monotonic_time(struct evutil_monotonic_timer *timer,
+                                    int flags);
+
+/** Query the current monotonic time from a struct evutil_monotonic_timer
+ * previously configured with evutil_configure_monotonic_time().  Monotonic
+ * time is guaranteed never to run in reverse, but is not necessarily epoch-
+ * based, or relative to any other definite point.  Use it to make reliable
+ * measurements of elapsed time between events even when the system time
+ * may be changed.
+ *
+ * It is not safe to use this funtion on the same timer from multiple
+ * threads.
+ */
+EVENT2_EXPORT_SYMBOL
+int evutil_gettime_monotonic(struct evutil_monotonic_timer *timer,
+                             struct timeval *tp);
+
 /** Create two new sockets that are connected to each other.
 
     On Unix, this simply calls socketpair().  On Windows, it uses the
@@ -329,6 +385,19 @@
 EVENT2_EXPORT_SYMBOL
 int evutil_make_listen_socket_reuseable(evutil_socket_t sock);
 
+/** Do platform-specific operations to make a listener port reusable.
+
+    Specifically, we want to make sure that multiple programs which also
+    set the same socket option will be able to bind, listen at the same time.
+
+    This is a feature available only to Linux 3.9+
+
+    @param sock The socket to make reusable
+    @return 0 on success, -1 on failure
+ */
+EVENT2_EXPORT_SYMBOL
+int evutil_make_listen_socket_reuseable_port(evutil_socket_t sock);
+
 /** Do platform-specific operations as needed to close a socket upon a
     successful execution of one of the exec*() functions.
 
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/sntp/libevent/kqueue.c /cur/src/external/bsd/ntp/dist/sntp/libevent/kqueue.c
--- external/bsd/ntp/dist/sntp/libevent/kqueue.c	2014-12-24 18:28:15.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/sntp/libevent/kqueue.c	2015-04-07 19:51:18.000000000 -0700
@@ -334,6 +334,23 @@
 			 * on FreeBSD. */
 			case EINVAL:
 				continue;
+#if defined(__FreeBSD__) && defined(ENOTCAPABLE)
+			/*
+			 * This currently occurs if an FD is closed
+			 * before the EV_DELETE makes it out via kevent().
+			 * The FreeBSD capabilities code sees the blank
+			 * capability set and rejects the request to
+			 * modify an event.
+			 *
+			 * To be strictly correct - when an FD is closed,
+			 * all the registered events are also removed.
+			 * Queuing EV_DELETE to a closed FD is wrong.
+			 * The event(s) should just be deleted from
+			 * the pending changelist.
+			 */
+			case ENOTCAPABLE:
+				continue;
+#endif
 
 			/* Can occur on a delete if the fd is closed. */
 			case EBADF:
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/sntp/libevent/listener.c /cur/src/external/bsd/ntp/dist/sntp/libevent/listener.c
--- external/bsd/ntp/dist/sntp/libevent/listener.c	2014-12-24 18:28:15.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/sntp/libevent/listener.c	2015-04-07 19:51:18.000000000 -0700
@@ -237,6 +237,11 @@
 			goto err;
 	}
 
+	if (flags & LEV_OPT_REUSEABLE_PORT) {
+		if (evutil_make_listen_socket_reuseable_port(fd) < 0)
+			goto err;
+	}
+
 	if (flags & LEV_OPT_DEFERRED_ACCEPT) {
 		if (evutil_make_tcp_listen_socket_deferred(fd) < 0)
 			goto err;
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/sntp/libevent/m4/acx_pthread.m4 /cur/src/external/bsd/ntp/dist/sntp/libevent/m4/acx_pthread.m4
--- external/bsd/ntp/dist/sntp/libevent/m4/acx_pthread.m4	1969-12-31 16:00:00.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/sntp/libevent/m4/acx_pthread.m4	2015-04-07 09:49:18.000000000 -0700
@@ -0,0 +1,279 @@
+##### http://autoconf-archive.cryp.to/acx_pthread.html
+#
+# SYNOPSIS
+#
+#   ACX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
+#
+# DESCRIPTION
+#
+#   This macro figures out how to build C programs using POSIX threads.
+#   It sets the PTHREAD_LIBS output variable to the threads library and
+#   linker flags, and the PTHREAD_CFLAGS output variable to any special
+#   C compiler flags that are needed. (The user can also force certain
+#   compiler flags/libs to be tested by setting these environment
+#   variables.)
+#
+#   Also sets PTHREAD_CC to any special C compiler that is needed for
+#   multi-threaded programs (defaults to the value of CC otherwise).
+#   (This is necessary on AIX to use the special cc_r compiler alias.)
+#
+#   NOTE: You are assumed to not only compile your program with these
+#   flags, but also link it with them as well. e.g. you should link
+#   with $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS
+#   $LIBS
+#
+#   If you are only building threads programs, you may wish to use
+#   these variables in your default LIBS, CFLAGS, and CC:
+#
+#          LIBS="$PTHREAD_LIBS $LIBS"
+#          CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+#          CC="$PTHREAD_CC"
+#
+#   In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute
+#   constant has a nonstandard name, defines PTHREAD_CREATE_JOINABLE to
+#   that name (e.g. PTHREAD_CREATE_UNDETACHED on AIX).
+#
+#   ACTION-IF-FOUND is a list of shell commands to run if a threads
+#   library is found, and ACTION-IF-NOT-FOUND is a list of commands to
+#   run it if it is not found. If ACTION-IF-FOUND is not specified, the
+#   default action will define HAVE_PTHREAD.
+#
+#   Please let the authors know if this macro fails on any platform, or
+#   if you have any other suggestions or comments. This macro was based
+#   on work by SGJ on autoconf scripts for FFTW (http://www.fftw.org/)
+#   (with help from M. Frigo), as well as ac_pthread and hb_pthread
+#   macros posted by Alejandro Forero Cuervo to the autoconf macro
+#   repository. We are also grateful for the helpful feedback of
+#   numerous users.
+#
+# LAST MODIFICATION
+#
+#   2007-07-29
+#
+# COPYLEFT
+#
+#   Copyright (c) 2007 Steven G. Johnson <stevenj@alum.mit.edu>
+#
+#   This program is free software: you can redistribute it and/or
+#   modify it under the terms of the GNU General Public License as
+#   published by the Free Software Foundation, either version 3 of the
+#   License, or (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful, but
+#   WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+#   General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program. If not, see
+#   <http://www.gnu.org/licenses/>.
+#
+#   As a special exception, the respective Autoconf Macro's copyright
+#   owner gives unlimited permission to copy, distribute and modify the
+#   configure scripts that are the output of Autoconf when processing
+#   the Macro. You need not follow the terms of the GNU General Public
+#   License when using or distributing such scripts, even though
+#   portions of the text of the Macro appear in them. The GNU General
+#   Public License (GPL) does govern all other use of the material that
+#   constitutes the Autoconf Macro.
+#
+#   This special exception to the GPL applies to versions of the
+#   Autoconf Macro released by the Autoconf Macro Archive. When you
+#   make and distribute a modified version of the Autoconf Macro, you
+#   may extend this special exception to the GPL to apply to your
+#   modified version as well.
+
+AC_DEFUN([ACX_PTHREAD], [
+AC_REQUIRE([AC_CANONICAL_HOST])
+AC_LANG_SAVE
+AC_LANG_C
+acx_pthread_ok=no
+
+# We used to check for pthread.h first, but this fails if pthread.h
+# requires special compiler flags (e.g. on True64 or Sequent).
+# It gets checked for in the link test anyway.
+
+# First of all, check if the user has set any of the PTHREAD_LIBS,
+# etcetera environment variables, and if threads linking works using
+# them:
+if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then
+        save_CFLAGS="$CFLAGS"
+        CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+        save_LIBS="$LIBS"
+        LIBS="$PTHREAD_LIBS $LIBS"
+        AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS])
+        AC_TRY_LINK_FUNC(pthread_join, acx_pthread_ok=yes)
+        AC_MSG_RESULT($acx_pthread_ok)
+        if test x"$acx_pthread_ok" = xno; then
+                PTHREAD_LIBS=""
+                PTHREAD_CFLAGS=""
+        fi
+        LIBS="$save_LIBS"
+        CFLAGS="$save_CFLAGS"
+fi
+
+# We must check for the threads library under a number of different
+# names; the ordering is very important because some systems
+# (e.g. DEC) have both -lpthread and -lpthreads, where one of the
+# libraries is broken (non-POSIX).
+
+# Create a list of thread flags to try.  Items starting with a "-" are
+# C compiler flags, and other items are library names, except for "none"
+# which indicates that we try without any flags at all, and "pthread-config"
+# which is a program returning the flags for the Pth emulation library.
+
+acx_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config"
+
+# The ordering *is* (sometimes) important.  Some notes on the
+# individual items follow:
+
+# pthreads: AIX (must check this before -lpthread)
+# none: in case threads are in libc; should be tried before -Kthread and
+#       other compiler flags to prevent continual compiler warnings
+# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h)
+# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)
+# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread)
+# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads)
+# -pthreads: Solaris/gcc
+# -mthreads: Mingw32/gcc, Lynx/gcc
+# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it
+#      doesn't hurt to check since this sometimes defines pthreads too;
+#      also defines -D_REENTRANT)
+#      ... -mt is also the pthreads flag for HP/aCC
+# pthread: Linux, etcetera
+# --thread-safe: KAI C++
+# pthread-config: use pthread-config program (for GNU Pth library)
+
+case "${host_cpu}-${host_os}" in
+        *solaris*)
+
+        # On Solaris (at least, for some versions), libc contains stubbed
+        # (non-functional) versions of the pthreads routines, so link-based
+        # tests will erroneously succeed.  (We need to link with -pthreads/-mt/
+        # -lpthread.)  (The stubs are missing pthread_cleanup_push, or rather
+        # a function called by this macro, so we could check for that, but
+        # who knows whether they'll stub that too in a future libc.)  So,
+        # we'll just look for -pthreads and -lpthread first:
+
+        acx_pthread_flags="-pthreads pthread -mt -pthread $acx_pthread_flags"
+        ;;
+esac
+
+if test x"$acx_pthread_ok" = xno; then
+for flag in $acx_pthread_flags; do
+
+        case $flag in
+                none)
+                AC_MSG_CHECKING([whether pthreads work without any flags])
+                ;;
+
+                -*)
+                AC_MSG_CHECKING([whether pthreads work with $flag])
+                PTHREAD_CFLAGS="$flag"
+                ;;
+
+		pthread-config)
+		AC_CHECK_PROG(acx_pthread_config, pthread-config, yes, no)
+		if test x"$acx_pthread_config" = xno; then continue; fi
+		PTHREAD_CFLAGS="`pthread-config --cflags`"
+		PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`"
+		;;
+
+                *)
+                AC_MSG_CHECKING([for the pthreads library -l$flag])
+                PTHREAD_LIBS="-l$flag"
+                ;;
+        esac
+
+        save_LIBS="$LIBS"
+        save_CFLAGS="$CFLAGS"
+        LIBS="$PTHREAD_LIBS $LIBS"
+        CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+
+        # Check for various functions.  We must include pthread.h,
+        # since some functions may be macros.  (On the Sequent, we
+        # need a special flag -Kthread to make this header compile.)
+        # We check for pthread_join because it is in -lpthread on IRIX
+        # while pthread_create is in libc.  We check for pthread_attr_init
+        # due to DEC craziness with -lpthreads.  We check for
+        # pthread_cleanup_push because it is one of the few pthread
+        # functions on Solaris that doesn't have a non-functional libc stub.
+        # We try pthread_create on general principles.
+        AC_TRY_LINK([#include <pthread.h>],
+                    [pthread_t th; pthread_join(th, 0);
+                     pthread_attr_init(0); pthread_cleanup_push(0, 0);
+                     pthread_create(0,0,0,0); pthread_cleanup_pop(0); ],
+                    [acx_pthread_ok=yes])
+
+        LIBS="$save_LIBS"
+        CFLAGS="$save_CFLAGS"
+
+        AC_MSG_RESULT($acx_pthread_ok)
+        if test "x$acx_pthread_ok" = xyes; then
+                break;
+        fi
+
+        PTHREAD_LIBS=""
+        PTHREAD_CFLAGS=""
+done
+fi
+
+# Various other checks:
+if test "x$acx_pthread_ok" = xyes; then
+        save_LIBS="$LIBS"
+        LIBS="$PTHREAD_LIBS $LIBS"
+        save_CFLAGS="$CFLAGS"
+        CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+
+        # Detect AIX lossage: JOINABLE attribute is called UNDETACHED.
+	AC_MSG_CHECKING([for joinable pthread attribute])
+	attr_name=unknown
+	for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do
+	    AC_TRY_LINK([#include <pthread.h>], [int attr=$attr; return attr;],
+                        [attr_name=$attr; break])
+	done
+        AC_MSG_RESULT($attr_name)
+        if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then
+            AC_DEFINE_UNQUOTED(PTHREAD_CREATE_JOINABLE, $attr_name,
+                               [Define to necessary symbol if this constant
+                                uses a non-standard name on your system.])
+        fi
+
+        AC_MSG_CHECKING([if more special flags are required for pthreads])
+        flag=no
+        case "${host_cpu}-${host_os}" in
+            *-aix* | *-freebsd* | *-darwin*) flag="-D_THREAD_SAFE";;
+            *solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";;
+        esac
+        AC_MSG_RESULT(${flag})
+        if test "x$flag" != xno; then
+            PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS"
+        fi
+
+        LIBS="$save_LIBS"
+        CFLAGS="$save_CFLAGS"
+
+        # More AIX lossage: must compile with xlc_r or cc_r
+	if test x"$GCC" != xyes; then
+          AC_CHECK_PROGS(PTHREAD_CC, xlc_r cc_r, ${CC})
+        else
+          PTHREAD_CC=$CC
+	fi
+else
+        PTHREAD_CC="$CC"
+fi
+
+AC_SUBST(PTHREAD_LIBS)
+AC_SUBST(PTHREAD_CFLAGS)
+AC_SUBST(PTHREAD_CC)
+
+# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
+if test x"$acx_pthread_ok" = xyes; then
+        ifelse([$1],,AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.]),[$1])
+        :
+else
+        acx_pthread_ok=no
+        $2
+fi
+AC_LANG_RESTORE
+])dnl ACX_PTHREAD
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/sntp/libevent/m4/openldap-thread-check.m4 /cur/src/external/bsd/ntp/dist/sntp/libevent/m4/openldap-thread-check.m4
--- external/bsd/ntp/dist/sntp/libevent/m4/openldap-thread-check.m4	2014-12-19 12:37:47.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/sntp/libevent/m4/openldap-thread-check.m4	1969-12-31 16:00:00.000000000 -0800
@@ -1,683 +0,0 @@
-dnl OpenLDAP Autoconf thread check
-dnl
-dnl This work is part of OpenLDAP Software <http://www.openldap.org/>.
-dnl
-dnl Copyright 1998-2010 The OpenLDAP Foundation.
-dnl All rights reserved.
-dnl
-dnl Redistribution and use in source and binary forms, with or without
-dnl modification, are permitted only as authorized by the OpenLDAP
-dnl Public License.
-dnl
-dnl A copy of this license is available in the file LICENSE-OPENLDAP in
-dnl this directory of the distribution or, alternatively, at
-dnl <http://www.OpenLDAP.org/license.html>.
-dnl
-dnl --------------------------------------------------------------------
-
-#   OL_THREAD_CHECK([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
-
-AC_DEFUN([OL_THREAD_CHECK], [
-AC_REQUIRE([AC_CANONICAL_HOST])
-AC_LANG_SAVE
-AC_LANG([C])
-OL_ARG_WITH(threads,[  --with-threads	  with threads],
-	auto, [auto nt posix mach pth lwp yes no manual] )
-
-case "$ol_with_threads$host" in
- auto*-*-solaris2.[[0-6]])
-    dnl signals sometimes delivered to wrong thread with Solaris 2.6
-    ol_with_threads=no
-    ;;
-esac
-
-dnl AIX Thread requires we use cc_r or xlc_r.
-dnl But only do this IF AIX and CC is not set
-dnl and threads are auto|yes|posix.
-dnl
-dnl If we find cc_r|xlc_r, force pthreads and assume
-dnl		pthread_create is in $LIBS (ie: don't bring in
-dnl		any additional thread libraries)
-dnl If we do not find cc_r|xlc_r, disable threads
-
-ol_aix_threads=no
-case "$host" in
-*-*-aix*) dnl all AIX is not a good idea.
-	if test -z "$CC" ; then
-		case "$ol_with_threads" in
-		auto | yes |  posix) ol_aix_threads=yes ;;
-		esac
-	fi
-;;
-esac
-
-if test $ol_aix_threads = yes ; then
-	if test -z "${CC}" ; then
-		AC_CHECK_PROGS(CC,cc_r xlc_r cc)
-
-		if test "$CC" = cc ; then
-			dnl no CC! don't allow --with-threads
-			if test $ol_with_threads != auto ; then
-				AC_MSG_ERROR([--with-threads requires cc_r (or other suitable compiler) on AIX])
-			else
-				AC_MSG_WARN([disabling threads, no cc_r on AIX])
-			fi
-			ol_with_threads=no
-  		fi
-	fi
-
-	case ${CC} in cc_r | xlc_r)
-		ol_with_threads=posix
-		ol_cv_pthread_create=yes
-		;;
-	esac
-fi
-
-dnl ----------------------------------------------------------------
-dnl Threads?
-ol_link_threads=no
-dnl ol_with_yielding_select=${ol_with_yielding_select:-auto}
-OL_ARG_WITH(yielding_select,[  --with-yielding-select  with yielding select],
-	auto, [auto yes no manual] )
-
-case $ol_with_threads in auto | yes | nt)
-
-	OL_NT_THREADS
-
-	if test "$ol_cv_nt_threads" = yes ; then
-		ol_link_threads=nt
-		ol_with_threads=found
-		ol_with_yielding_select=yes
-
-		AC_DEFINE([HAVE_NT_SERVICE_MANAGER], [1], [if you have NT Service Manager])
-		AC_DEFINE([HAVE_NT_EVENT_LOG], [1], [if you have NT Event Log])
-	fi
-
-	if test $ol_with_threads = nt ; then
-		AC_MSG_ERROR([could not locate NT Threads])
-	fi
-	;;
-esac
-
-case $ol_with_threads in auto | yes | posix)
-
-	AC_CHECK_HEADERS(pthread.h)
-
-	if test $ac_cv_header_pthread_h = yes ; then
-		OL_POSIX_THREAD_VERSION
-
-		if test $ol_cv_pthread_version != 0 ; then
-			AC_DEFINE_UNQUOTED([HAVE_PTHREADS], [$ol_cv_pthread_version],
-				[define to pthreads API spec revision])
-		else
-			AC_MSG_ERROR([unknown pthread version])
-		fi
-
-		# consider threads found
-		ol_with_threads=found
-
-		OL_HEADER_LINUX_THREADS
-		OL_HEADER_GNU_PTH_PTHREAD_H
-
-		if test $ol_cv_header_gnu_pth_pthread_h = no ; then
-			AC_CHECK_HEADERS(sched.h)
-		fi
-
-		dnl Now the hard part, how to link?
-		dnl
-		dnl currently supported checks:
-		dnl
-		dnl Check for no flags 
-		dnl 	pthread_create() in $LIBS
-		dnl
-		dnl Check special pthread (final) flags
-		dnl 	[skipped] pthread_create() with -mt (Solaris) [disabled]
-		dnl 	pthread_create() with -kthread (FreeBSD)
-		dnl 	pthread_create() with -pthread (FreeBSD/Digital Unix)
-		dnl 	pthread_create() with -pthreads (?)
-		dnl 	pthread_create() with -mthreads (AIX)
-		dnl 	pthread_create() with -thread (?)
-		dnl
-		dnl Check pthread (final) libraries
-		dnl 	pthread_mutex_unlock() in -lpthread -lmach -lexc -lc_r (OSF/1)
-		dnl 	pthread_mutex_lock() in -lpthread -lmach -lexc (OSF/1)
-		dnl 	[skipped] pthread_mutex_trylock() in -lpthread -lexc (OSF/1)
-		dnl 	pthread_join() -Wl,-woff,85 -lpthread (IRIX)
-		dnl 	pthread_create() in -lpthread (many)
-		dnl 	pthread_create() in -lc_r (FreeBSD)
-		dnl
-		dnl Check pthread (draft4) flags (depreciated)
-		dnl 	pthread_create() with -threads (OSF/1)
-		dnl
-		dnl Check pthread (draft4) libraries (depreciated)
-		dnl 	pthread_mutex_unlock() in -lpthreads -lmach -lexc -lc_r (OSF/1)
-		dnl 	pthread_mutex_lock() in -lpthreads -lmach -lexc (OSF/1)
-		dnl 	pthread_mutex_trylock() in -lpthreads -lexc (OSF/1)
-		dnl 	pthread_create() in -lpthreads (many)
-		dnl
-
-		dnl pthread_create in $LIBS
-		AC_CACHE_CHECK([for pthread_create in default libraries],
-			ol_cv_pthread_create,[
-			AC_RUN_IFELSE([OL_PTHREAD_TEST_PROGRAM],
-				[ol_cv_pthread_create=yes],
-				[ol_cv_pthread_create=no],
-				[AC_TRY_LINK(OL_PTHREAD_TEST_INCLUDES,OL_PTHREAD_TEST_FUNCTION,
-					[ol_cv_pthread_create=yes],
-					[ol_cv_pthread_create=no])])])
-
-		if test $ol_cv_pthread_create != no ; then
-			ol_link_threads=posix
-			ol_link_pthreads=""
-		fi
-		
-dnl		OL_PTHREAD_TRY([-mt],		[ol_cv_pthread_mt])
-		OL_PTHREAD_TRY([-kthread],	[ol_cv_pthread_kthread])
-		OL_PTHREAD_TRY([-pthread],	[ol_cv_pthread_pthread])
-		OL_PTHREAD_TRY([-pthreads],	[ol_cv_pthread_pthreads])
-		OL_PTHREAD_TRY([-mthreads],	[ol_cv_pthread_mthreads])
-		OL_PTHREAD_TRY([-thread],	[ol_cv_pthread_thread])
-
-		OL_PTHREAD_TRY([-lpthread -lmach -lexc -lc_r],
-			[ol_cv_pthread_lpthread_lmach_lexc_lc_r])
-		OL_PTHREAD_TRY([-lpthread -lmach -lexc],
-			[ol_cv_pthread_lpthread_lmach_lexc])
-dnl		OL_PTHREAD_TRY([-lpthread -lexc],
-dnl			[ol_cv_pthread_lpthread_lexc])
-
-		OL_PTHREAD_TRY([-lpthread -Wl,-woff,85],
-			[ol_cv_pthread_lib_lpthread_woff])
-
-		OL_PTHREAD_TRY([-lpthread],	[ol_cv_pthread_lpthread])
-		OL_PTHREAD_TRY([-lc_r],		[ol_cv_pthread_lc_r])
-
-		OL_PTHREAD_TRY([-threads],	[ol_cv_pthread_threads])
-
-		OL_PTHREAD_TRY([-lpthreads -lmach -lexc -lc_r],
-			[ol_cv_pthread_lpthreads_lmach_lexc_lc_r])
-		OL_PTHREAD_TRY([-lpthreads -lmach -lexc],
-			[ol_cv_pthread_lpthreads_lmach_lexc])
-		OL_PTHREAD_TRY([-lpthreads -lexc],
-			[ol_cv_pthread_lpthreads_lexc])
-
-		OL_PTHREAD_TRY([-lpthreads],[ol_cv_pthread_lib_lpthreads])
-
-		if test $ol_link_threads != no ; then
-			LTHREAD_LIBS="$LTHREAD_LIBS $ol_link_pthreads"
-
-			dnl save flags
-			save_CPPFLAGS="$CPPFLAGS"
-			save_LIBS="$LIBS"
-			LIBS="$LTHREAD_LIBS $LIBS"
-
-			dnl All POSIX Thread (final) implementations should have
-			dnl sched_yield instead of pthread yield.
-			dnl check for both, and thr_yield for Solaris
-			AC_CHECK_FUNCS(sched_yield pthread_yield thr_yield)
-
-			if test $ac_cv_func_sched_yield = no &&
-			   test $ac_cv_func_pthread_yield = no &&
-			   test $ac_cv_func_thr_yield = no ; then
-				dnl Digital UNIX has sched_yield() in -lrt
-				AC_CHECK_LIB(rt, sched_yield,
-					[LTHREAD_LIBS="$LTHREAD_LIBS -lrt"
-					AC_DEFINE([HAVE_SCHED_YIELD], [1],
-						[Define if you have the sched_yield function.])
-					ac_cv_func_sched_yield=yes],
-					[ac_cv_func_sched_yield=no])
-			fi
-			if test $ac_cv_func_sched_yield = no &&
-			   test $ac_cv_func_pthread_yield = no &&
-			   test "$ac_cv_func_thr_yield" = no ; then
-				AC_MSG_WARN([could not locate sched_yield() or pthread_yield()])
-			fi
-
-			dnl Check functions for compatibility
-			AC_CHECK_FUNCS(pthread_kill)
-
-			dnl Check for pthread_rwlock_destroy with <pthread.h>
-			dnl as pthread_rwlock_t may not be defined.
-			AC_CACHE_CHECK([for pthread_rwlock_destroy with <pthread.h>],
-				[ol_cv_func_pthread_rwlock_destroy], [
-				dnl save the flags
-				AC_LINK_IFELSE([AC_LANG_PROGRAM([[
-#include <pthread.h>
-pthread_rwlock_t rwlock;
-]], [[pthread_rwlock_destroy(&rwlock);]])],[ol_cv_func_pthread_rwlock_destroy=yes],[ol_cv_func_pthread_rwlock_destroy=no])
-			])
-			if test $ol_cv_func_pthread_rwlock_destroy = yes ; then
-				AC_DEFINE([HAVE_PTHREAD_RWLOCK_DESTROY], [1],
-					[define if you have pthread_rwlock_destroy function])
-			fi
-
-			dnl Check for pthread_detach with <pthread.h> inclusion
-			dnl as it's symbol may have been mangled.
-			AC_CACHE_CHECK([for pthread_detach with <pthread.h>],
-				[ol_cv_func_pthread_detach], [
-				dnl save the flags
-				AC_LINK_IFELSE([AC_LANG_PROGRAM([[
-#include <pthread.h>
-#ifndef NULL
-#define NULL (void*)0
-#endif
-]], [[pthread_detach(NULL);]])],[ol_cv_func_pthread_detach=yes],[ol_cv_func_pthread_detach=no])
-			])
-
-			if test $ol_cv_func_pthread_detach = no ; then
-				AC_MSG_ERROR([could not locate pthread_detach()])
-			fi
-
-			AC_DEFINE([HAVE_PTHREAD_DETACH], [1],
-				[define if you have pthread_detach function])
-
-			dnl Check for setconcurreny functions
-			AC_CHECK_FUNCS(	\
-				pthread_setconcurrency \
-				pthread_getconcurrency \
-				thr_setconcurrency \
-				thr_getconcurrency \
-			)
-
-			OL_SYS_LINUX_THREADS
-			OL_LINUX_THREADS
-
-			if test $ol_cv_linux_threads = error; then
-				AC_MSG_ERROR([LinuxThreads header/library mismatch]);
-			fi
-
-			AC_CACHE_CHECK([if pthread_create() works],
-				ol_cv_pthread_create_works,[
-			AC_RUN_IFELSE([OL_PTHREAD_TEST_PROGRAM],
-				[ol_cv_pthread_create_works=yes],
-				[ol_cv_pthread_create_works=no],
-				[dnl assume yes
-				ol_cv_pthread_create_works=yes])])
-
-			if test $ol_cv_pthread_create_works = no ; then
-				AC_MSG_ERROR([pthread_create is not usable, check environment settings])
-			fi
-
-			ol_replace_broken_yield=no
-dnl			case "$host" in
-dnl			*-*-linux*) 
-dnl				AC_CHECK_FUNCS(nanosleep)
-dnl				ol_replace_broken_yield=yes
-dnl			;;
-dnl			esac
-
-			if test $ol_replace_broken_yield = yes ; then
-				AC_DEFINE([REPLACE_BROKEN_YIELD], [1],
-					[define if sched_yield yields the entire process])
-			fi
-
-			dnl Check if select causes an yield
-			if test x$ol_with_yielding_select = xauto ; then
-				AC_CACHE_CHECK([if select yields when using pthreads],
-					ol_cv_pthread_select_yields,[
-				AC_RUN_IFELSE([AC_LANG_SOURCE([[
-#include <sys/types.h>
-#include <sys/time.h>
-#include <unistd.h>
-#include <pthread.h>
-#ifndef NULL
-#define NULL (void*) 0
-#endif
-
-static int fildes[2];
-
-static void *task(p)
-	void *p;
-{
-	int i;
-	struct timeval tv;
-
-	fd_set rfds;
-
-	tv.tv_sec=10;
-	tv.tv_usec=0;
-
-	FD_ZERO(&rfds);
-	FD_SET(fildes[0], &rfds);
-
-	/* we're not interested in any fds */
-	i = select(FD_SETSIZE, &rfds, NULL, NULL, &tv);
-
-	if(i < 0) {
-		perror("select");
-		exit(10);
-	}
-
-	exit(0); /* if we exit here, the select blocked the whole process */
-}
-
-int main(argc, argv)
-	int argc;
-	char **argv;
-{
-	pthread_t t;
-
-	/* create a pipe to select */
-	if(pipe(&fildes[0])) {
-		perror("select");
-		exit(1);
-	}
-
-#ifdef HAVE_PTHREAD_SETCONCURRENCY
-	(void) pthread_setconcurrency(2);
-#else
-#ifdef HAVE_THR_SETCONCURRENCY
-	/* Set Solaris LWP concurrency to 2 */
-	thr_setconcurrency(2);
-#endif
-#endif
-
-#if HAVE_PTHREADS < 6
-	pthread_create(&t, pthread_attr_default, task, NULL);
-#else
-	pthread_create(&t, NULL, task, NULL);
-#endif
-
-	/* make sure task runs first */
-#ifdef HAVE_THR_YIELD
-	thr_yield();
-#elif defined( HAVE_SCHED_YIELD )
-	sched_yield();
-#elif defined( HAVE_PTHREAD_YIELD )
-	pthread_yield();
-#endif
-
-	exit(2);
-}]])],[ol_cv_pthread_select_yields=no],[ol_cv_pthread_select_yields=yes],[ol_cv_pthread_select_yields=cross])])
-
-				if test $ol_cv_pthread_select_yields = cross ; then
-					AC_MSG_ERROR([crossing compiling: use --with-yielding-select=yes|no|manual])
-				fi
-
-				if test $ol_cv_pthread_select_yields = yes ; then
-					ol_with_yielding_select=yes
-				fi
-			fi
-
-			dnl restore flags
-			CPPFLAGS="$save_CPPFLAGS"
-			LIBS="$save_LIBS"
-		else
-			AC_MSG_ERROR([could not locate usable POSIX Threads])
-		fi
-	fi
-
-	if test $ol_with_threads = posix ; then
-		AC_MSG_ERROR([could not locate POSIX Threads])
-	fi
-	;;
-esac
-
-case $ol_with_threads in auto | yes | mach)
-
-	dnl check for Mach CThreads
-	AC_CHECK_HEADERS(mach/cthreads.h cthreads.h)
-	if test $ac_cv_header_mach_cthreads_h = yes ; then
-		ol_with_threads=found
-
-		dnl check for cthreads support in current $LIBS
-		AC_CHECK_FUNC(cthread_fork,[ol_link_threads=yes])
-
-		if test $ol_link_threads = no ; then
-			dnl try -all_load
-			dnl this test needs work
-			AC_CACHE_CHECK([for cthread_fork with -all_load],
-				[ol_cv_cthread_all_load], [
-				dnl save the flags
-				save_LIBS="$LIBS"
-				LIBS="-all_load $LIBS"
-				AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <mach/cthreads.h>]], [[
-					cthread_fork((void *)0, (void *)0);
-					]])],[ol_cv_cthread_all_load=yes],[ol_cv_cthread_all_load=no])
-				dnl restore the LIBS
-				LIBS="$save_LIBS"
-			])
-
-			if test $ol_cv_cthread_all_load = yes ; then
-				LTHREAD_LIBS="$LTHREAD_LIBS -all_load"
-				ol_link_threads=mach
-				ol_with_threads=found
-			fi
-		fi
-
-	elif test $ac_cv_header_cthreads_h = yes ; then
-		dnl Hurd variant of Mach Cthreads
-		dnl uses <cthreads.h> and -lthreads
-
-		ol_with_threads=found
- 
-		dnl save the flags
-		save_LIBS="$LIBS"
-		LIBS="$LIBS -lthreads"
-		AC_CHECK_FUNC(cthread_fork,[ol_link_threads=yes])
-		LIBS="$save_LIBS"
-
-		if test $ol_link_threads = yes ; then
-			LTHREAD_LIBS="-lthreads"
-			ol_link_threads=mach
-			ol_with_threads=found
-		else
-			AC_MSG_ERROR([could not link with Mach CThreads])
-		fi
-
-	elif test $ol_with_threads = mach ; then
-		AC_MSG_ERROR([could not locate Mach CThreads])
-	fi
-
-	if test $ol_link_threads = mach ; then
-		AC_DEFINE([HAVE_MACH_CTHREADS], [1],
-			[define if you have Mach Cthreads])
-	elif test $ol_with_threads = found ; then
-		AC_MSG_ERROR([could not link with Mach CThreads])
-	fi
-	;;
-esac
-
-case $ol_with_threads in auto | yes | pth)
-
-	AC_CHECK_HEADERS(pth.h)
-
-	if test $ac_cv_header_pth_h = yes ; then
-		AC_CHECK_LIB(pth, pth_version, [have_pth=yes], [have_pth=no])
-
-		if test $have_pth = yes ; then
-			AC_DEFINE([HAVE_GNU_PTH], [1], [if you have GNU Pth])
-			LTHREAD_LIBS="$LTHREAD_LIBS -lpth"
-			ol_link_threads=pth
-			ol_with_threads=found
-
-			if test x$ol_with_yielding_select = xauto ; then
-				ol_with_yielding_select=yes
-			fi
-		fi
-	fi
-	;;
-esac
-
-case $ol_with_threads in auto | yes | lwp)
-
-	dnl check for SunOS5 LWP
-	AC_CHECK_HEADERS(thread.h synch.h)
-	if test $ac_cv_header_thread_h = yes &&
-	   test $ac_cv_header_synch_h = yes ; then
-		AC_CHECK_LIB(thread, thr_create, [have_thr=yes], [have_thr=no])
-
-		if test $have_thr = yes ; then
-			AC_DEFINE([HAVE_THR], [1],
-				[if you have Solaris LWP (thr) package])
-			LTHREAD_LIBS="$LTHREAD_LIBS -lthread"
-			ol_link_threads=thr
-
-			if test x$ol_with_yielding_select = xauto ; then
-				ol_with_yielding_select=yes
-			fi
-
-			dnl Check for setconcurrency functions
-			AC_CHECK_FUNCS(	\
-				thr_setconcurrency \
-				thr_getconcurrency \
-			)
-		fi
-	fi
-
-	dnl check for SunOS4 LWP
-	AC_CHECK_HEADERS(lwp/lwp.h)
-	if test $ac_cv_header_lwp_lwp_h = yes ; then
-		AC_CHECK_LIB(lwp, lwp_create, [have_lwp=yes], [have_lwp=no])
-
-		if test $have_lwp = yes ; then
-			AC_DEFINE([HAVE_LWP], [1],
-				[if you have SunOS LWP package])
-			LTHREAD_LIBS="$LTHREAD_LIBS -llwp"
-			ol_link_threads=lwp
-
-			if test x$ol_with_yielding_select = xauto ; then
-				ol_with_yielding_select=no
-			fi
-		fi
-	fi
-	;;
-esac
-
-if test $ol_with_yielding_select = yes ; then
-	AC_DEFINE([HAVE_YIELDING_SELECT], [1],
-		[define if select implicitly yields])
-fi
-
-if test $ol_with_threads = manual ; then
-	dnl User thinks he can manually configure threads.
-	ol_link_threads=yes
-
-	AC_MSG_WARN([thread defines and link options must be set manually])
-
-	AC_CHECK_HEADERS(pthread.h sched.h)
-	AC_CHECK_FUNCS(sched_yield pthread_yield)
-	OL_HEADER_LINUX_THREADS
-
-	AC_CHECK_HEADERS(mach/cthreads.h)
-	AC_CHECK_HEADERS(lwp/lwp.h)
-	AC_CHECK_HEADERS(thread.h synch.h)
-fi
-
-if test $ol_link_threads != no && test $ol_link_threads != nt ; then
-	dnl needed to get reentrant/threadsafe versions
-	dnl
-	AC_DEFINE([REENTRANT], [1], [enable thread safety])
-	AC_DEFINE([_REENTRANT], [1], [enable thread safety])
-	AC_DEFINE([THREAD_SAFE], [1], [enable thread safety])
-	AC_DEFINE([_THREAD_SAFE], [1], [enable thread safety])
-	AC_DEFINE([THREADSAFE], [1], [enable thread safety])
-	AC_DEFINE([_THREADSAFE], [1], [enable thread safety])
-	AC_DEFINE([_SGI_MP_SOURCE], [1], [enable thread safety])
-
-	dnl The errno declaration may dependent upon _REENTRANT.
-	dnl If it does, we must link with thread support.
-	AC_CACHE_CHECK([for thread specific errno],
-		[ol_cv_errno_thread_specific], [
-		AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <errno.h>]], [[errno = 0;]])],[ol_cv_errno_thread_specific=yes],[ol_cv_errno_thread_specific=no])
-	])
-
-	dnl The h_errno declaration may dependent upon _REENTRANT.
-	dnl If it does, we must link with thread support.
-	AC_CACHE_CHECK([for thread specific h_errno],
-		[ol_cv_h_errno_thread_specific], [
-		AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <netdb.h>]], [[h_errno = 0;]])],[ol_cv_h_errno_thread_specific=yes],[ol_cv_h_errno_thread_specific=no])
-	])
-
-	if test $ol_cv_errno_thread_specific != yes ||
-	   test $ol_cv_h_errno_thread_specific != yes ; then
-		LIBS="$LTHREAD_LIBS $LIBS"
-		LTHREAD_LIBS=""
-	fi
-
-dnl When in thread environment, use 
-dnl		#if defined( HAVE_REENTRANT_FUNCTIONS ) || defined( HAVE_FUNC_R )
-dnl			func_r(...);
-dnl		#else
-dnl		#	if defined( HAVE_THREADS ) 
-dnl				/* lock */
-dnl		#	endif
-dnl				func(...);
-dnl		#	if defined( HAVE_THREADS ) 
-dnl				/* unlock */
-dnl		#	endif
-dnl		#endif
-dnl
-dnl HAVE_REENTRANT_FUNCTIONS is derived from:
-dnl		_POSIX_REENTRANT_FUNCTIONS
-dnl		_POSIX_THREAD_SAFE_FUNCTIONS
-dnl		_POSIX_THREADSAFE_FUNCTIONS
-dnl
-dnl		and is currently defined in <ldap_pvt_thread.h>
-dnl
-dnl HAVE_THREADS is defined by <ldap_pvt_thread.h> iff -UNO_THREADS
-dnl 
-dnl libldap/*.c should only include <ldap_pvt_thread.h> iff
-dnl LDAP_R_COMPILE is defined.  ie:
-dnl		#ifdef LDAP_R_COMPILE
-dnl		#	include <ldap_pvt_thread.h>
-dnl		#endif
-dnl
-dnl LDAP_R_COMPILE is defined by libldap_r/Makefile.in
-dnl specifically for compiling the threadsafe version of
-dnl	the ldap library (-lldap_r).
-dnl		
-dnl	dnl check for reentrant/threadsafe functions
-dnl	dnl
-dnl	dnl note: these should only be used when linking
-dnl	dnl		with $LTHREAD_LIBS
-dnl	dnl
-dnl	save_CPPFLAGS="$CPPFLAGS"
-dnl	save_LIBS="$LIBS"
-dnl	LIBS="$LTHREAD_LIBS $LIBS"
-dnl	AC_CHECK_FUNCS(	\
-dnl		gmtime_r \
-dnl		gethostbyaddr_r gethostbyname_r \
-dnl		feof_unlocked unlocked_feof \
-dnl		putc_unlocked unlocked_putc \
-dnl		flockfile ftrylockfile \
-dnl	)
-dnl	CPPFLAGS="$save_CPPFLAGS"
-dnl	LIBS="$save_LIBS"
-fi  
-
-if test $ol_link_threads = no ; then
-	if test $ol_with_threads = yes ; then
-		AC_MSG_ERROR([no suitable thread support])
-	fi
-
-	if test $ol_with_threads = auto ; then
-		AC_MSG_WARN([no suitable thread support, disabling threads])
-		ol_with_threads=no
-	fi
-
-	AC_DEFINE([NO_THREADS], [1],
-		[define if you have (or want) no threads])
-	LTHREAD_LIBS=""
-	BUILD_THREAD=no
-else
-	BUILD_THREAD=yes
-fi
-
-if test $ol_link_threads != no ; then
-	AC_DEFINE([LDAP_API_FEATURE_X_OPENLDAP_THREAD_SAFE], [1],
-		[define to 1 if library is thread safe])
-fi
-
-# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
-case "$ol_with_threads" in
- no)
-    ol_pthread_ok=no
-    $2
-    ;;
- *)
-    ifelse([$1],,AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.]),[$1])
-    ;;
-esac
-
-AC_LANG_RESTORE
-])
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/sntp/libevent/m4/openldap.m4 /cur/src/external/bsd/ntp/dist/sntp/libevent/m4/openldap.m4
--- external/bsd/ntp/dist/sntp/libevent/m4/openldap.m4	2013-12-27 15:31:31.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/sntp/libevent/m4/openldap.m4	1969-12-31 16:00:00.000000000 -0800
@@ -1,1131 +0,0 @@
-dnl OpenLDAP Autoconf Macros
-dnl $OpenLDAP: pkg/ldap/build/openldap.m4,v 1.157.2.10 2010/04/13 20:22:21 kurt Exp $
-dnl This work is part of OpenLDAP Software <http://www.openldap.org/>.
-dnl
-dnl Copyright 1998-2010 The OpenLDAP Foundation.
-dnl All rights reserved.
-dnl
-dnl Redistribution and use in source and binary forms, with or without
-dnl modification, are permitted only as authorized by the OpenLDAP
-dnl Public License.
-dnl
-dnl A copy of this license is available in the file LICENSE-OPENLDAP in
-dnl this directory of the distribution or, alternatively, at
-dnl <http://www.OpenLDAP.org/license.html>.
-dnl
-dnl --------------------------------------------------------------------
-dnl Restricted form of AC_ARG_ENABLE that limits user options
-dnl
-dnl $1 = option name
-dnl $2 = help-string
-dnl $3 = default value	(auto).  "--" means do not set it by default
-dnl $4 = allowed values (auto yes no)
-dnl $5 = overridden default
-AC_DEFUN([OL_ARG_ENABLE], [# OpenLDAP --enable-$1
-	pushdef([ol_DefVal],ifelse($3,,auto,$3))
-	AC_ARG_ENABLE($1,ifelse($4,,[$2],[$2] translit([$4],[ ],[|])) ifelse($3,--,,@<:@ol_DefVal@:>@),[
-	ol_arg=invalid
-	for ol_val in ifelse($4,,[auto yes no],[$4]) ; do
-		if test "$enableval" = "$ol_val" ; then
-			ol_arg="$ol_val"
-		fi
-	done
-	if test "$ol_arg" = "invalid" ; then
-		AC_MSG_ERROR(bad value $enableval for --enable-$1)
-	fi
-	ol_enable_$1="$ol_arg"
-]ifelse($3,--,,[,
-[	ol_enable_$1=ifelse($5,,ol_DefVal,[${]$5[:-]ol_DefVal[}])]]))dnl
-dnl AC_MSG_RESULT([OpenLDAP -enable-$1 $ol_enable_$1])
-	popdef([ol_DefVal])
-# end --enable-$1
-])dnl
-dnl
-dnl --------------------------------------------------------------------
-dnl Restricted form of AC_ARG_WITH that limits user options
-dnl
-dnl $1 = option name
-dnl $2 = help-string
-dnl $3 = default value (no)
-dnl $4 = allowed values (yes or no)
-AC_DEFUN([OL_ARG_WITH], [# OpenLDAP --with-$1
-	AC_ARG_WITH($1,[$2 @<:@]ifelse($3,,yes,$3)@:>@,[
-	ol_arg=invalid
-	for ol_val in ifelse($4,,[yes no],[$4]) ; do
-		if test "$withval" = "$ol_val" ; then
-			ol_arg="$ol_val"
-		fi
-	done
-	if test "$ol_arg" = "invalid" ; then
-		AC_MSG_ERROR(bad value $withval for --with-$1)
-	fi
-	ol_with_$1="$ol_arg"
-],
-[	ol_with_$1=ifelse($3,,"no","$3")])dnl
-dnl AC_MSG_RESULT([OpenLDAP --with-$1 $ol_with_$1])
-# end --with-$1
-])dnl
-dnl ====================================================================
-dnl Check for dependency generation flag
-AC_DEFUN([OL_MKDEPEND], [# test for make depend flag
-OL_MKDEP=
-OL_MKDEP_FLAGS=
-if test -z "${MKDEP}"; then
-	OL_MKDEP="${CC-cc}"
-	if test -z "${MKDEP_FLAGS}"; then
-		AC_CACHE_CHECK([for ${OL_MKDEP} depend flag], ol_cv_mkdep, [
-			ol_cv_mkdep=no
-			for flag in "-M" "-xM"; do
-				cat > conftest.c <<EOF
- noCode;
-EOF
-				if AC_TRY_COMMAND($OL_MKDEP $flag conftest.c) \
-					| grep '^conftest\.'"${ac_objext}" >/dev/null 2>&1
-				then
-					if test ! -f conftest."${ac_object}" ; then
-						ol_cv_mkdep=$flag
-						OL_MKDEP_FLAGS="$flag"
-						break
-					fi
-				fi
-			done
-			rm -f conftest*
-		])
-		test "$ol_cv_mkdep" = no && OL_MKDEP=":"
-	else
-		cc_cv_mkdep=yes
-		OL_MKDEP_FLAGS="${MKDEP_FLAGS}"
-	fi
-else
-	cc_cv_mkdep=yes
-	OL_MKDEP="${MKDEP}"
-	OL_MKDEP_FLAGS="${MKDEP_FLAGS}"
-fi
-AC_SUBST(OL_MKDEP)
-AC_SUBST(OL_MKDEP_FLAGS)
-])
-dnl
-dnl ====================================================================
-dnl Check if system uses EBCDIC instead of ASCII
-AC_DEFUN([OL_CPP_EBCDIC], [# test for EBCDIC
-AC_CACHE_CHECK([for EBCDIC],ol_cv_cpp_ebcdic,[
-	AC_PREPROC_IFELSE([AC_LANG_SOURCE([[
-#if !('M' == 0xd4)
-#include <__ASCII__/generate_error.h>
-#endif
-]])],[ol_cv_cpp_ebcdic=yes],[ol_cv_cpp_ebcdic=no])])
-if test $ol_cv_cpp_ebcdic = yes ; then
-	AC_DEFINE(HAVE_EBCDIC,1, [define if system uses EBCDIC instead of ASCII])
-fi
-])
-dnl
-dnl --------------------------------------------------------------------
-dnl Check for MSVC
-AC_DEFUN([OL_MSVC],
-[AC_REQUIRE_CPP()dnl
-AC_CACHE_CHECK([whether we are using MS Visual C++], ol_cv_msvc,
-[AC_PREPROC_IFELSE([AC_LANG_SOURCE([[
-#ifndef _MSC_VER
-#include <__FOO__/generate_error.h>
-#endif
-]])],[ol_cv_msvc=yes],[ol_cv_msvc=no])])])
-
-dnl --------------------------------------------------------------------
-dnl OpenLDAP version of STDC header check w/ EBCDIC support
-AC_DEFUN([OL_HEADER_STDC],
-[AC_REQUIRE_CPP()dnl
-AC_REQUIRE([OL_CPP_EBCDIC])dnl
-AC_CACHE_CHECK([for ANSI C header files], ol_cv_header_stdc,
-[AC_PREPROC_IFELSE([AC_LANG_SOURCE([[#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-#include <float.h>]])],[ol_cv_header_stdc=yes],[ol_cv_header_stdc=no])
-
-if test $ol_cv_header_stdc = yes; then
-  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
-AC_EGREP_HEADER(memchr, string.h, , ol_cv_header_stdc=no)
-fi
-
-if test $ol_cv_header_stdc = yes; then
-  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
-AC_EGREP_HEADER(free, stdlib.h, , ol_cv_header_stdc=no)
-fi
-
-if test $ol_cv_header_stdc = yes; then
-  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
-AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <ctype.h>
-#ifndef HAVE_EBCDIC
-#	define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
-#	define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
-#else
-#	define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
-		|| ('j' <= (c) && (c) <= 'r') \
-		|| ('s' <= (c) && (c) <= 'z'))
-#	define TOUPPER(c)	(ISLOWER(c) ? ((c) | 0x40) : (c))
-#endif
-#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
-int main () { int i; for (i = 0; i < 256; i++)
-if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
-exit (0); }
-]])],[],[ol_cv_header_stdc=no],[:])
-fi])
-if test $ol_cv_header_stdc = yes; then
-  AC_DEFINE([STDC_HEADERS], [1], [is standard C provided?])
-fi
-ac_cv_header_stdc=disable
-])
-dnl
-dnl ====================================================================
-dnl DNS resolver macros
-AC_DEFUN([OL_RESOLVER_TRY],
-[if test $ol_cv_lib_resolver = no ; then
-	AC_CACHE_CHECK([for resolver link (]ifelse($2,,default,$2)[)],[$1],
-[
-	ol_RESOLVER_LIB=ifelse($2,,,$2)
-	ol_LIBS=$LIBS
-	LIBS="$ol_RESOLVER_LIB $LIBS"
-
-	AC_LINK_IFELSE([AC_LANG_PROGRAM([[
-#ifdef HAVE_SYS_TYPES_H
-#	include <sys/types.h>
-#endif
-#include <netinet/in.h>
-#ifdef HAVE_ARPA_NAMESER_H
-#	include <arpa/nameser.h>
-#endif
-#ifdef HAVE_RESOLV_H
-#	include <resolv.h>
-#endif
-]], [[{
-	int len, status;
-	char *request = NULL;
-	unsigned char reply[64*1024];
-	unsigned char host[64*1024];
-	unsigned char *p;
-
-#ifdef NS_HFIXEDSZ
-	/* Bind 8/9 interface */
-	len = res_query(request, ns_c_in, ns_t_srv, reply, sizeof(reply));
-#else
-	/* Bind 4 interface */
-# ifndef T_SRV
-#  define T_SRV 33
-# endif
-	len = res_query(request, C_IN, T_SRV, reply, sizeof(reply));
-#endif
-	p = reply;
-#ifdef NS_HFIXEDSZ
-	/* Bind 8/9 interface */
-	p += NS_HFIXEDSZ;
-#elif defined(HFIXEDSZ)
-	/* Bind 4 interface w/ HFIXEDSZ */
-	p += HFIXEDSZ;
-#else
-	/* Bind 4 interface w/o HFIXEDSZ */
-	p += sizeof(HEADER);
-#endif
-	status = dn_expand( reply, reply+len, p, host, sizeof(host));
-}]])],[$1=yes],[$1=no])
-
-	LIBS="$ol_LIBS"
-])
-
-	if test $$1 = yes ; then
-		ol_cv_lib_resolver=ifelse($2,,yes,$2)
-	fi
-fi
-])
-dnl --------------------------------------------------------------------
-dnl Try to locate appropriate library
-AC_DEFUN([OL_RESOLVER_LINK],
-[ol_cv_lib_resolver=no
-OL_RESOLVER_TRY(ol_cv_resolver_none)
-OL_RESOLVER_TRY(ol_cv_resolver_resolv,[-lresolv])
-OL_RESOLVER_TRY(ol_cv_resolver_bind,[-lbind])
-])
-dnl
-dnl ====================================================================
-dnl International Components for Unicode (ICU)
-AC_DEFUN([OL_ICU],
-[ol_icu=no
-AC_CHECK_HEADERS( unicode/utypes.h )
-if test $ac_cv_header_unicode_utypes_h = yes ; then
-	dnl OL_ICULIBS="-licui18n -licuuc -licudata"
-	OL_ICULIBS="-licuuc -licudata"
-
-	AC_CACHE_CHECK([for ICU libraries], [ol_cv_lib_icu], [
-		ol_LIBS="$LIBS"
-		LIBS="$OL_ICULIBS $LIBS"
-		AC_LINK_IFELSE([AC_LANG_PROGRAM([[
-#include <unicode/utypes.h>
-]], [[
-(void) u_errorName(0);
-]])],[ol_cv_lib_icu=yes],[ol_cv_lib_icu=no])
-		LIBS="$ol_LIBS"
-])
-
-	if test $ol_cv_lib_icu != no ; then
-		ol_icu="$OL_ICULIBS"
-		AC_DEFINE([HAVE_ICU], [1], [define if you actually have ICU])
-	fi
-fi
-])
-dnl
-dnl ====================================================================
-dnl Berkeley DB macros
-dnl
-dnl --------------------------------------------------------------------
-dnl Try to link
-AC_DEFUN([OL_BERKELEY_DB_TRY],
-[if test $ol_cv_lib_db = no ; then
-	AC_CACHE_CHECK([for Berkeley DB link (]ifelse($2,,default,$2)[)],[$1],
-[
-	ol_DB_LIB=ifelse($2,,,$2)
-	ol_LIBS=$LIBS
-	LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
-
-	AC_LINK_IFELSE([AC_LANG_PROGRAM([[
-#ifdef HAVE_DB_185_H
-# include <db_185.h>
-#else
-# include <db.h>
-#endif
-
-#ifndef DB_VERSION_MAJOR
-# define DB_VERSION_MAJOR 1
-#endif
-
-#ifndef NULL
-#define NULL ((void*)0)
-#endif
-]], [[
-#if DB_VERSION_MAJOR > 2
-	db_env_create( NULL, 0 );
-#elif DB_VERSION_MAJOR > 1
-	db_appexit( NULL );
-#else
-	(void) dbopen( NULL, 0, 0, 0, NULL);
-#endif
-]])],[$1=yes],[$1=no])
-
-	LIBS="$ol_LIBS"
-])
-
-	if test $$1 = yes ; then
-		ol_cv_lib_db=ifelse($2,,yes,$2)
-	fi
-fi
-])
-dnl
-dnl --------------------------------------------------------------------
-dnl Get major and minor version from <db.h>
-AC_DEFUN([OL_BDB_HEADER_VERSION],
-[AC_CACHE_CHECK([for Berkeley DB major version in db.h], [ol_cv_bdb_major],[
-	AC_LANG_CONFTEST([
-#include <db.h>
-#ifndef DB_VERSION_MAJOR
-#	define DB_VERSION_MAJOR 1
-#endif
-__db_version DB_VERSION_MAJOR
-])
-	set X `eval "$ac_cpp conftest.$ac_ext" | $EGREP __db_version` none none
-	ol_cv_bdb_major=${3}
-])
-case $ol_cv_bdb_major in [[1-9]]*) : ;; *)
-	AC_MSG_ERROR([Unknown Berkeley DB major version in db.h]) ;;
-esac
-
-dnl Determine minor version
-AC_CACHE_CHECK([for Berkeley DB minor version in db.h], [ol_cv_bdb_minor],[
-	AC_LANG_CONFTEST([
-#include <db.h>
-#ifndef DB_VERSION_MINOR
-#	define DB_VERSION_MINOR 0
-#endif
-__db_version DB_VERSION_MINOR
-])
-	set X `eval "$ac_cpp conftest.$ac_ext" | $EGREP __db_version` none none
-	ol_cv_bdb_minor=${3}
-])
-case $ol_cv_bdb_minor in [[0-9]]*) : ;; *)
-	AC_MSG_ERROR([Unknown Berkeley DB minor version in db.h]) ;;
-esac
-])
-dnl
-dnl --------------------------------------------------------------------
-dnl Try to locate appropriate library
-AC_DEFUN([OL_BERKELEY_DB_LINK],
-[ol_cv_lib_db=no
-
-if test $ol_cv_bdb_major = 4 ; then
-	OL_BERKELEY_DB_TRY(ol_cv_db_db_4_dot_m,[-ldb-4.$ol_cv_bdb_minor])
-	OL_BERKELEY_DB_TRY(ol_cv_db_db4m,[-ldb4$ol_cv_bdb_minor])
-	OL_BERKELEY_DB_TRY(ol_cv_db_db_4m,[-ldb-4$ol_cv_bdb_minor])
-	OL_BERKELEY_DB_TRY(ol_cv_db_db_4_m,[-ldb-4-$ol_cv_bdb_minor])
-	OL_BERKELEY_DB_TRY(ol_cv_db_db_4,[-ldb-4])
-	OL_BERKELEY_DB_TRY(ol_cv_db_db4,[-ldb4])
-	OL_BERKELEY_DB_TRY(ol_cv_db_db,[-ldb])
-fi
-OL_BERKELEY_DB_TRY(ol_cv_db_none)
-])
-dnl
-dnl --------------------------------------------------------------------
-dnl Check if Berkeley DB version
-AC_DEFUN([OL_BERKELEY_DB_VERSION],
-[AC_CACHE_CHECK([for Berkeley DB library and header version match], [ol_cv_berkeley_db_version], [
-	ol_LIBS="$LIBS"
-	LIBS="$LTHREAD_LIBS $LIBS"
-	if test $ol_cv_lib_db != yes ; then
-		LIBS="$ol_cv_lib_db $LIBS"
-	fi
-
-	AC_RUN_IFELSE([AC_LANG_SOURCE([[
-#ifdef HAVE_DB_185_H
-	choke me;
-#else
-#include <db.h>
-#endif
-#ifndef DB_VERSION_MAJOR
-# define DB_VERSION_MAJOR 1
-#endif
-#ifndef NULL
-#define NULL ((void *)0)
-#endif
-main()
-{
-#if DB_VERSION_MAJOR > 1
-	char *version;
-	int major, minor, patch;
-
-	version = db_version( &major, &minor, &patch );
-
-	if( major != DB_VERSION_MAJOR ||
-		minor != DB_VERSION_MINOR ||
-		patch != DB_VERSION_PATCH )
-	{
-		printf("Berkeley DB version mismatch\n"
-			"\theader: %s\n\tlibrary: %s\n",
-			DB_VERSION_STRING, version);
-		return 1;
-	}
-#endif
-
-	return 0;
-}]])],[ol_cv_berkeley_db_version=yes],[ol_cv_berkeley_db_version=no],[ol_cv_berkeley_db_version=cross])
-
-	LIBS="$ol_LIBS"
-])
-
-	if test $ol_cv_berkeley_db_version = no ; then
-		AC_MSG_ERROR([Berkeley DB version mismatch])
-	fi
-])dnl
-dnl
-dnl --------------------------------------------------------------------
-dnl Check if Berkeley DB supports DB_THREAD
-AC_DEFUN([OL_BERKELEY_DB_THREAD],
-[AC_CACHE_CHECK([for Berkeley DB thread support], [ol_cv_berkeley_db_thread], [
-	ol_LIBS="$LIBS"
-	LIBS="$LTHREAD_LIBS $LIBS"
-	if test $ol_cv_lib_db != yes ; then
-		LIBS="$ol_cv_lib_db $LIBS"
-	fi
-
-	AC_RUN_IFELSE([AC_LANG_SOURCE([[
-#ifdef HAVE_DB_185_H
-	choke me;
-#else
-#include <db.h>
-#endif
-#ifndef NULL
-#define NULL ((void *)0)
-#endif
-main()
-{
-	int rc;
-	u_int32_t flags = DB_CREATE |
-#ifdef DB_PRIVATE
-		DB_PRIVATE |
-#endif
-		DB_THREAD;
-
-#if DB_VERSION_MAJOR > 2
-	DB_ENV *env = NULL;
-
-	rc = db_env_create( &env, 0 );
-
-	flags |= DB_INIT_MPOOL;
-#ifdef DB_MPOOL_PRIVATE
-	flags |= DB_MPOOL_PRIVATE;
-#endif
-
-	if( rc ) {
-		printf("BerkeleyDB: %s\n", db_strerror(rc) );
-		return rc;
-	}
-
-#if (DB_VERSION_MAJOR > 3) || (DB_VERSION_MINOR >= 1)
-	rc = (env->open)( env, NULL, flags, 0 );
-#else
-	rc = (env->open)( env, NULL, NULL, flags, 0 );
-#endif
-
-	if ( rc == 0 ) {
-		rc = env->close( env, 0 );
-	}
-
-	if( rc ) {
-		printf("BerkeleyDB: %s\n", db_strerror(rc) );
-		return rc;
-	}
-
-#else
-	DB_ENV env;
-	memset( &env, '\0', sizeof(env) );
-
-	rc = db_appinit( NULL, NULL, &env, flags );
-
-	if( rc == 0 ) {
-		db_appexit( &env );
-	}
-
-	unlink("__db_mpool.share");
-	unlink("__db_lock.share");
-#endif
-
-	return rc;
-}]])],[ol_cv_berkeley_db_thread=yes],[ol_cv_berkeley_db_thread=no],[ol_cv_berkeley_db_thread=cross])
-
-	LIBS="$ol_LIBS"
-])
-
-	if test $ol_cv_berkeley_db_thread != no ; then
-		AC_DEFINE([HAVE_BERKELEY_DB_THREAD], [1],
-			[define if Berkeley DB has DB_THREAD support])
-	fi
-])dnl
-dnl
-dnl --------------------------------------------------------------------
-dnl Find any DB
-AC_DEFUN([OL_BERKELEY_DB],
-[ol_cv_berkeley_db=no
-AC_CHECK_HEADERS(db.h)
-if test $ac_cv_header_db_h = yes; then
-	OL_BDB_HEADER_VERSION
-	OL_BDB_COMPAT
-
-	if test $ol_cv_bdb_compat != yes ; then
-		AC_MSG_ERROR([BerkeleyDB version incompatible with BDB/HDB backends])
-	fi
-
-	OL_BERKELEY_DB_LINK
-	if test "$ol_cv_lib_db" != no ; then
-		ol_cv_berkeley_db=yes
-		OL_BERKELEY_DB_VERSION
-		OL_BERKELEY_DB_THREAD
-	fi
-fi
-])
-dnl --------------------------------------------------------------------
-dnl Check for version compatility with back-bdb
-AC_DEFUN([OL_BDB_COMPAT],
-[AC_CACHE_CHECK([if Berkeley DB version supported by BDB/HDB backends], [ol_cv_bdb_compat],[
-	AC_EGREP_CPP(__db_version_compat,[
-#include <db.h>
-
- /* this check could be improved */
-#ifndef DB_VERSION_MAJOR
-#	define DB_VERSION_MAJOR 1
-#endif
-#ifndef DB_VERSION_MINOR
-#	define DB_VERSION_MINOR 0
-#endif
-
-#define DB_VERSION_MM	((DB_VERSION_MAJOR<<8)|DB_VERSION_MINOR)
-
-/* require 4.4 or later */
-#if DB_VERSION_MM >= 0x0404
-	__db_version_compat
-#endif
-	], [ol_cv_bdb_compat=yes], [ol_cv_bdb_compat=no])])
-])
-
-dnl
-dnl ====================================================================
-dnl Check POSIX Thread version 
-dnl
-dnl defines ol_cv_pthread_version to 4, 5, 6, 7, 8, 10, depending on the
-dnl	version of the POSIX.4a Draft that is implemented.
-dnl	10 == POSIX.4a Final == POSIX.1c-1996 for our purposes.
-dnl	Existence of pthread.h should be tested separately.
-dnl
-dnl tests:
-dnl	pthread_detach() was dropped in Draft 8, it is present
-dnl		in every other version
-dnl	PTHREAD_CREATE_UNDETACHED is only in Draft 7, it was called
-dnl		PTHREAD_CREATE_JOINABLE after that
-dnl	pthread_attr_create was renamed to pthread_attr_init in Draft 6.
-dnl		Draft 6-10 has _init, Draft 4-5 has _create.
-dnl	pthread_attr_default was dropped in Draft 6, only 4 and 5 have it
-dnl	PTHREAD_MUTEX_INITIALIZER was introduced in Draft 5. It's not
-dnl		interesting to us because we don't try to statically
-dnl		initialize mutexes. 5-10 has it.
-dnl
-dnl Draft 9 and 10 are equivalent for our purposes.
-dnl
-AC_DEFUN([OL_POSIX_THREAD_VERSION],
-[AC_CACHE_CHECK([POSIX thread version],[ol_cv_pthread_version],[
-	AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
-#		include <pthread.h>
-	]], [[
-		int i = PTHREAD_CREATE_JOINABLE;
-	]])],[
-	AC_EGREP_HEADER(pthread_detach,pthread.h,
-	ol_cv_pthread_version=10, ol_cv_pthread_version=8)],[
-	AC_EGREP_CPP(draft7,[
-#		include <pthread.h>
-#		ifdef PTHREAD_CREATE_UNDETACHED
-		draft7
-#		endif
-	], ol_cv_pthread_version=7, [
-	AC_EGREP_HEADER(pthread_attr_init,pthread.h,
-	ol_cv_pthread_version=6, [
-	AC_EGREP_CPP(draft5,[
-#		include <pthread.h>
-#ifdef		PTHREAD_MUTEX_INITIALIZER
-		draft5
-#endif
-	], ol_cv_pthread_version=5, ol_cv_pthread_version=4) ]) ]) ])
-])
-])dnl
-dnl
-dnl --------------------------------------------------------------------
-AC_DEFUN([OL_PTHREAD_TEST_INCLUDES], [[
-/* pthread test headers */
-#include <pthread.h>
-#if HAVE_PTHREADS < 7
-#include <errno.h>
-#endif
-#ifndef NULL
-#define NULL (void*)0
-#endif
-
-static void *task(p)
-	void *p;
-{
-	return (void *) (p == NULL);
-}
-]])
-AC_DEFUN([OL_PTHREAD_TEST_FUNCTION],[[
-	/* pthread test function */
-#ifndef PTHREAD_CREATE_DETACHED
-#define	PTHREAD_CREATE_DETACHED	1
-#endif
-	pthread_t t;
-	int status;
-	int detach = PTHREAD_CREATE_DETACHED;
-
-#if HAVE_PTHREADS > 4
-	/* Final pthreads */
-	pthread_attr_t attr;
-
-	status = pthread_attr_init(&attr);
-	if( status ) return status;
-
-#if HAVE_PTHREADS < 7
-	status = pthread_attr_setdetachstate(&attr, &detach);
-	if( status < 0 ) status = errno;
-#else
-	status = pthread_attr_setdetachstate(&attr, detach);
-#endif
-	if( status ) return status;
-	status = pthread_create( &t, &attr, task, NULL );
-#if HAVE_PTHREADS < 7
-	if( status < 0 ) status = errno;
-#endif
-	if( status ) return status;
-#else
-	/* Draft 4 pthreads */
-	status = pthread_create( &t, pthread_attr_default, task, NULL );
-	if( status ) return errno;
-
-	/* give thread a chance to complete */
-	/* it should remain joinable and hence detachable */
-	sleep( 1 );
-
-	status = pthread_detach( &t );
-	if( status ) return errno;
-#endif
-
-#ifdef HAVE_LINUX_THREADS
-	pthread_kill_other_threads_np();
-#endif
-
-	return 0;
-]])
-
-AC_DEFUN([OL_PTHREAD_TEST_PROGRAM], [
-AC_LANG_SOURCE([OL_PTHREAD_TEST_INCLUDES
-
-int main(argc, argv)
-	int argc;
-	char **argv;
-{
-OL_PTHREAD_TEST_FUNCTION
-}
-])])
-dnl --------------------------------------------------------------------
-AC_DEFUN([OL_PTHREAD_TRY], [# Pthread try link: $1 ($2)
-if test "$ol_link_threads" = no ; then
-	# try $1
-	AC_CACHE_CHECK([for pthread link with $1], [$2], [
-		# save the flags
-		ol_LIBS="$LIBS"
-		LIBS="$1 $LIBS"
-
-		AC_RUN_IFELSE([OL_PTHREAD_TEST_PROGRAM],
-			[$2=yes],
-			[$2=no],
-			[AC_LINK_IFELSE([AC_LANG_PROGRAM(OL_PTHREAD_TEST_INCLUDES,
-				OL_PTHREAD_TEST_FUNCTION)],
-				[$2=yes], [$2=no])])
-
-		# restore the LIBS
-		LIBS="$ol_LIBS"
-	])
-
-	if test $$2 = yes ; then
-		ol_link_pthreads="$1"
-		ol_link_threads=posix
-	fi
-fi
-])
-dnl
-dnl ====================================================================
-dnl Check GNU Pth pthread Header
-dnl
-dnl defines ol_cv_header linux_threads to 'yes' or 'no'
-dnl		'no' implies pthreads.h is not LinuxThreads or pthreads.h
-dnl		doesn't exists.  Existance of pthread.h should separately
-dnl		checked.
-dnl 
-AC_DEFUN([OL_HEADER_GNU_PTH_PTHREAD_H], [
-	AC_CACHE_CHECK([for GNU Pth pthread.h],
-		[ol_cv_header_gnu_pth_pthread_h],
-		[AC_EGREP_CPP(__gnu_pth__,
-			[#include <pthread.h>
-#ifdef _POSIX_THREAD_IS_GNU_PTH
-	__gnu_pth__;
-#endif
-],
-			[ol_cv_header_gnu_pth_pthread_h=yes],
-			[ol_cv_header_gnu_pth_pthread_h=no])
-		])
-])dnl
-dnl ====================================================================
-dnl Check for NT Threads
-AC_DEFUN([OL_NT_THREADS], [
-	AC_CHECK_FUNC(_beginthread)
-
-	if test $ac_cv_func__beginthread = yes ; then
-		AC_DEFINE([HAVE_NT_THREADS], [1], [if you have NT Threads])
-		ol_cv_nt_threads=yes
-	fi
-])
-dnl ====================================================================
-dnl Check LinuxThreads Header
-dnl
-dnl defines ol_cv_header linux_threads to 'yes' or 'no'
-dnl		'no' implies pthreads.h is not LinuxThreads or pthreads.h
-dnl		doesn't exists.  Existance of pthread.h should separately
-dnl		checked.
-dnl 
-AC_DEFUN([OL_HEADER_LINUX_THREADS], [
-	AC_CACHE_CHECK([for LinuxThreads pthread.h],
-		[ol_cv_header_linux_threads],
-		[AC_EGREP_CPP(pthread_kill_other_threads_np,
-			[#include <pthread.h>],
-			[ol_cv_header_linux_threads=yes],
-			[ol_cv_header_linux_threads=no])
-		])
-	if test $ol_cv_header_linux_threads = yes; then
-		AC_DEFINE([HAVE_LINUX_THREADS], [1], [if you have LinuxThreads])
-	fi
-])dnl
-dnl --------------------------------------------------------------------
-dnl	Check LinuxThreads Implementation
-dnl
-dnl	defines ol_cv_sys_linux_threads to 'yes' or 'no'
-dnl	'no' implies pthreads implementation is not LinuxThreads.
-dnl 
-AC_DEFUN([OL_SYS_LINUX_THREADS], [
-	AC_CHECK_FUNCS(pthread_kill_other_threads_np)
-	AC_CACHE_CHECK([for LinuxThreads implementation],
-		[ol_cv_sys_linux_threads],
-		[ol_cv_sys_linux_threads=$ac_cv_func_pthread_kill_other_threads_np])
-])dnl
-dnl
-dnl --------------------------------------------------------------------
-dnl Check LinuxThreads consistency
-AC_DEFUN([OL_LINUX_THREADS], [
-	AC_REQUIRE([OL_HEADER_LINUX_THREADS])
-	AC_REQUIRE([OL_SYS_LINUX_THREADS])
-	AC_CACHE_CHECK([for LinuxThreads consistency], [ol_cv_linux_threads], [
-		if test $ol_cv_header_linux_threads = yes &&
-		   test $ol_cv_sys_linux_threads = yes; then
-			ol_cv_linux_threads=yes
-		elif test $ol_cv_header_linux_threads = no &&
-		     test $ol_cv_sys_linux_threads = no; then
-			ol_cv_linux_threads=no
-		else
-			ol_cv_linux_threads=error
-		fi
-	])
-])dnl
-dnl
-dnl ====================================================================
-dnl Check for POSIX Regex
-AC_DEFUN([OL_POSIX_REGEX], [
-AC_CACHE_CHECK([for compatible POSIX regex],ol_cv_c_posix_regex,[
-	AC_RUN_IFELSE([AC_LANG_SOURCE([[
-#include <sys/types.h>
-#include <regex.h>
-static char *pattern, *string;
-main()
-{
-	int rc;
-	regex_t re;
-
-	pattern = "^A";
-
-	if(regcomp(&re, pattern, 0)) {
-		return -1;
-	}
-	
-	string = "ALL MATCH";
-	
-	rc = regexec(&re, string, 0, (void*)0, 0);
-
-	regfree(&re);
-
-	return rc;
-}]])],[ol_cv_c_posix_regex=yes],[ol_cv_c_posix_regex=no],[ol_cv_c_posix_regex=cross])])
-])
-dnl
-dnl ====================================================================
-dnl Check if toupper() requires islower() to be called first
-AC_DEFUN([OL_C_UPPER_LOWER],
-[AC_CACHE_CHECK([if toupper() requires islower()],ol_cv_c_upper_lower,[
-	AC_RUN_IFELSE([AC_LANG_SOURCE([[
-#include <ctype.h>
-main()
-{
-	if ('C' == toupper('C'))
-		exit(0);
-	else
-		exit(1);
-}]])],[ol_cv_c_upper_lower=no],[ol_cv_c_upper_lower=yes],[ol_cv_c_upper_lower=safe])])
-if test $ol_cv_c_upper_lower != no ; then
-	AC_DEFINE([C_UPPER_LOWER], [1], [define if toupper() requires islower()])
-fi
-])
-dnl
-dnl ====================================================================
-dnl Error string checks
-dnl
-dnl Check for declaration of sys_errlist in one of stdio.h and errno.h.
-dnl Declaration of sys_errlist on BSD4.4 interferes with our declaration.
-dnl Reported by Keith Bostic.
-AC_DEFUN([OL_SYS_ERRLIST],
-[AC_CACHE_CHECK([declaration of sys_errlist],ol_cv_dcl_sys_errlist,[
-	AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
-#include <stdio.h>
-#include <sys/types.h>
-#include <errno.h>
-#ifdef _WIN32
-#include <stdlib.h>
-#endif ]], [[char *c = (char *) *sys_errlist]])],[ol_cv_dcl_sys_errlist=yes
-	ol_cv_have_sys_errlist=yes],[ol_cv_dcl_sys_errlist=no])])
-#
-# It's possible (for near-UNIX clones) that sys_errlist doesn't exist
-if test $ol_cv_dcl_sys_errlist = no ; then
-	AC_DEFINE([DECL_SYS_ERRLIST], [1],
-		[define if sys_errlist is not declared in stdio.h or errno.h])
-
-	AC_CACHE_CHECK([existence of sys_errlist],ol_cv_have_sys_errlist,[
-		AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <errno.h>]], [[char *c = (char *) *sys_errlist]])],[ol_cv_have_sys_errlist=yes],[ol_cv_have_sys_errlist=no])])
-fi
-if test $ol_cv_have_sys_errlist = yes ; then
-	AC_DEFINE([HAVE_SYS_ERRLIST], [1],
-		[define if you actually have sys_errlist in your libs])
-fi
-])dnl
-AC_DEFUN([OL_NONPOSIX_STRERROR_R],
-[AC_CACHE_CHECK([non-posix strerror_r],ol_cv_nonposix_strerror_r,[
-	AC_EGREP_CPP(strerror_r,[#include <string.h>],
-		ol_decl_strerror_r=yes, ol_decl_strerror_r=no)dnl
-
-	if test $ol_decl_strerror_r = yes ; then
-		AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <string.h>]], [[   /* from autoconf 2.59 */
-				char buf[100];
-				char x = *strerror_r (0, buf, sizeof buf);
-				char *p = strerror_r (0, buf, sizeof buf);
-			]])],[ol_cv_nonposix_strerror_r=yes],[ol_cv_nonposix_strerror_r=no])
-	else
-		AC_RUN_IFELSE([AC_LANG_SOURCE([[
-			main() {
-				char buf[100];
-				buf[0] = 0;
-				strerror_r( 1, buf, sizeof buf );
-				exit( buf[0] == 0 );
-			}
-			]])],[ol_cv_nonposix_strerror_r=yes],[ol_cv_nonposix_strerror=no],[ol_cv_nonposix_strerror=no])
-	fi
-	])
-if test $ol_cv_nonposix_strerror_r = yes ; then
-	AC_DEFINE([HAVE_NONPOSIX_STRERROR_R], [1],
-		[define if strerror_r returns char* instead of int])
-fi
-])dnl
-dnl
-AC_DEFUN([OL_STRERROR],
-[OL_SYS_ERRLIST dnl TEMPORARY
-AC_CHECK_FUNCS(strerror strerror_r)
-ol_cv_func_strerror_r=no
-if test "${ac_cv_func_strerror_r}" = yes ; then
-	OL_NONPOSIX_STRERROR_R
-elif test "${ac_cv_func_strerror}" = no ; then
-	OL_SYS_ERRLIST
-fi
-])dnl
-dnl ====================================================================
-dnl Early MIPS compilers (used in Ultrix 4.2) don't like
-dnl "int x; int *volatile a = &x; *a = 0;"
-dnl 	-- borrowed from PDKSH
-AC_DEFUN([OL_C_VOLATILE],
- [AC_CACHE_CHECK(if compiler understands volatile, ol_cv_c_volatile,
-    [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[int x, y, z;]], [[volatile int a; int * volatile b = x ? &y : &z;
-      /* Older MIPS compilers (eg., in Ultrix 4.2) don't like *b = 0 */
-      *b = 0;]])],[ol_cv_c_volatile=yes],[ol_cv_c_volatile=no])])
-  if test $ol_cv_c_volatile = yes; then
-    : 
-  else
-    AC_DEFINE([volatile], [], [define as empty if volatile is not supported])
-  fi
- ])dnl
-dnl
-dnl ====================================================================
-dnl Look for fetch(3)
-AC_DEFUN([OL_LIB_FETCH],
-[ol_LIBS=$LIBS
-LIBS="-lfetch -lcom_err $LIBS"
-AC_CACHE_CHECK([fetch(3) library],ol_cv_lib_fetch,[
-	AC_LINK_IFELSE([AC_LANG_PROGRAM([[
-#ifdef HAVE_SYS_PARAM_H
-#include <sys/param.h>
-#endif
-#include <stdio.h>
-#include <fetch.h>]], [[struct url *u = fetchParseURL("file:///"); ]])],[ol_cv_lib_fetch=yes],[ol_cv_lib_fetch=no])])
-LIBS=$ol_LIBS
-if test $ol_cv_lib_fetch != no ; then
-	ol_link_fetch="-lfetch -lcom_err"
-	AC_DEFINE([HAVE_FETCH], [1],
-		[define if you actually have FreeBSD fetch(3)])
-fi
-])dnl
-dnl
-dnl ====================================================================
-dnl Define inet_aton is available
-AC_DEFUN([OL_FUNC_INET_ATON],
- [AC_CACHE_CHECK([for inet_aton()], ol_cv_func_inet_aton,
-    [AC_LINK_IFELSE([AC_LANG_PROGRAM([[
-#ifdef HAVE_SYS_TYPES_H
-#	include <sys/types.h>
-#endif
-#ifdef HAVE_SYS_SOCKET_H
-#	include <sys/socket.h>
-#	ifdef HAVE_SYS_SELECT_H
-#		include <sys/select.h>
-#	endif
-#	include <netinet/in.h>
-#	ifdef HAVE_ARPA_INET_H
-#		include <arpa/inet.h>
-#	endif
-#endif
-]], [[struct in_addr in;
-int rc = inet_aton( "255.255.255.255", &in );]])],[ol_cv_func_inet_aton=yes],[ol_cv_func_inet_aton=no])])
-  if test $ol_cv_func_inet_aton != no; then
-    AC_DEFINE(HAVE_INET_ATON, 1,
-		[define to you inet_aton(3) is available])
-  fi
- ])dnl
-dnl
-dnl ====================================================================
-dnl check no of arguments for ctime_r
-AC_DEFUN([OL_FUNC_CTIME_R_NARGS],
- [AC_CACHE_CHECK(number of arguments of ctime_r, ol_cv_func_ctime_r_nargs,
-   [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[time_t ti; char *buffer; ctime_r(&ti,buffer,32);]])],[ol_cv_func_ctime_r_nargs3=yes],[ol_cv_func_ctime_r_nargs3=no])
-
-	AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[time_t ti; char *buffer; ctime_r(&ti,buffer);]])],[ol_cv_func_ctime_r_nargs2=yes],[ol_cv_func_ctime_r_nargs2=no])
-
-	if test $ol_cv_func_ctime_r_nargs3 = yes &&
-	   test $ol_cv_func_ctime_r_nargs2 = no ; then
-
-		ol_cv_func_ctime_r_nargs=3
-
-	elif test $ol_cv_func_ctime_r_nargs3 = no &&
-	     test $ol_cv_func_ctime_r_nargs2 = yes ; then
-
-		ol_cv_func_ctime_r_nargs=2
-
-	else
-		ol_cv_func_ctime_r_nargs=0
-	fi
-  ])
-
-  if test $ol_cv_func_ctime_r_nargs -gt 1 ; then
- 	AC_DEFINE_UNQUOTED(CTIME_R_NARGS, $ol_cv_func_ctime_r_nargs,
-		[set to the number of arguments ctime_r() expects])
-  fi
-])dnl
-dnl
-dnl --------------------------------------------------------------------
-dnl check return type of ctime_r()
-AC_DEFUN([OL_FUNC_CTIME_R_TYPE],
- [AC_CACHE_CHECK(return type of ctime_r, ol_cv_func_ctime_r_type,
-   [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[extern int (ctime_r)();]])],[ol_cv_func_ctime_r_type="int"],[ol_cv_func_ctime_r_type="charp"])
-	])
-  if test $ol_cv_func_ctime_r_type = "int" ; then
-	AC_DEFINE(CTIME_R_RETURNS_INT,1, [define if ctime_r() returns int])
-  fi
-])dnl
-dnl ====================================================================
-dnl check no of arguments for gethostbyname_r
-AC_DEFUN([OL_FUNC_GETHOSTBYNAME_R_NARGS],
- [AC_CACHE_CHECK(number of arguments of gethostbyname_r,
-	ol_cv_func_gethostbyname_r_nargs,
-	[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <netdb.h>
-#define BUFSIZE (sizeof(struct hostent)+10)]], [[struct hostent hent; char buffer[BUFSIZE];
-		int bufsize=BUFSIZE;int h_errno;
-		(void)gethostbyname_r("segovia.cs.purdue.edu", &hent,
-			buffer, bufsize, &h_errno);]])],[ol_cv_func_gethostbyname_r_nargs5=yes],[ol_cv_func_gethostbyname_r_nargs5=no])
-
-	AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <netdb.h>
-#define BUFSIZE (sizeof(struct hostent)+10)]], [[struct hostent hent;struct hostent *rhent;
-		char buffer[BUFSIZE];
-		int bufsize=BUFSIZE;int h_errno;
-		(void)gethostbyname_r("localhost", &hent, buffer, bufsize,
-			&rhent, &h_errno);]])],[ol_cv_func_gethostbyname_r_nargs6=yes],[ol_cv_func_gethostbyname_r_nargs6=no])
-
-	if test $ol_cv_func_gethostbyname_r_nargs5 = yes &&
-	   test $ol_cv_func_gethostbyname_r_nargs6 = no ; then
-
-		ol_cv_func_gethostbyname_r_nargs=5
-
-	elif test $ol_cv_func_gethostbyname_r_nargs5 = no &&
-	     test $ol_cv_func_gethostbyname_r_nargs6 = yes ; then
-
-		ol_cv_func_gethostbyname_r_nargs=6
-
-	else
-		ol_cv_func_gethostbyname_r_nargs=0
-	fi
-  ])
-  if test $ol_cv_func_gethostbyname_r_nargs -gt 1 ; then
-	AC_DEFINE_UNQUOTED(GETHOSTBYNAME_R_NARGS,
-		$ol_cv_func_gethostbyname_r_nargs,
-		[set to the number of arguments gethostbyname_r() expects])
-  fi
-])dnl
-dnl
-dnl check no of arguments for gethostbyaddr_r
-AC_DEFUN([OL_FUNC_GETHOSTBYADDR_R_NARGS],
- [AC_CACHE_CHECK(number of arguments of gethostbyaddr_r,
-	[ol_cv_func_gethostbyaddr_r_nargs],
-	[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <netdb.h>
-#define BUFSIZE (sizeof(struct hostent)+10)]], [[struct hostent hent; char buffer[BUFSIZE]; 
-	    struct in_addr add;
-	    size_t alen=sizeof(struct in_addr);
-	    int bufsize=BUFSIZE;int h_errno;
-		(void)gethostbyaddr_r( (void *)&(add.s_addr),
-			alen, AF_INET, &hent, buffer, bufsize, &h_errno);]])],[ol_cv_func_gethostbyaddr_r_nargs7=yes],[ol_cv_func_gethostbyaddr_r_nargs7=no])
-
-	AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <netdb.h>
-#define BUFSIZE (sizeof(struct hostent)+10)]], [[struct hostent hent;
-		struct hostent *rhent; char buffer[BUFSIZE]; 
-		struct in_addr add;
-		size_t alen=sizeof(struct in_addr);
-		int bufsize=BUFSIZE;int h_errno;
-		(void)gethostbyaddr_r( (void *)&(add.s_addr),
-			alen, AF_INET, &hent, buffer, bufsize, 
-			&rhent, &h_errno);]])],[ol_cv_func_gethostbyaddr_r_nargs8=yes],[ol_cv_func_gethostbyaddr_r_nargs8=no])
-
-	if test $ol_cv_func_gethostbyaddr_r_nargs7 = yes &&
-	   test $ol_cv_func_gethostbyaddr_r_nargs8 = no ; then
-
-		ol_cv_func_gethostbyaddr_r_nargs=7
-
-	elif test $ol_cv_func_gethostbyaddr_r_nargs7 = no &&
-	     test $ol_cv_func_gethostbyaddr_r_nargs8 = yes ; then
-
-		ol_cv_func_gethostbyaddr_r_nargs=8
-
-	else
-		ol_cv_func_gethostbyaddr_r_nargs=0
-	fi
-  ])
-  if test $ol_cv_func_gethostbyaddr_r_nargs -gt 1 ; then
-    AC_DEFINE_UNQUOTED(GETHOSTBYADDR_R_NARGS,
-		$ol_cv_func_gethostbyaddr_r_nargs,
-		[set to the number of arguments gethostbyaddr_r() expects])
-  fi
-])dnl
-dnl
-dnl --------------------------------------------------------------------
-dnl Check for Cyrus SASL version compatility
-AC_DEFUN([OL_SASL_COMPAT],
-[AC_CACHE_CHECK([Cyrus SASL library version], [ol_cv_sasl_compat],[
-	AC_EGREP_CPP(__sasl_compat,[
-#ifdef HAVE_SASL_SASL_H
-#include <sasl/sasl.h>
-#else
-#include <sasl.h>
-#endif
-
-/* Require 2.1.15+ */
-#if SASL_VERSION_MAJOR == 2  && SASL_VERSION_MINOR > 1
-	char *__sasl_compat = "2.2+ or better okay (we guess)";
-#elif SASL_VERSION_MAJOR == 2  && SASL_VERSION_MINOR == 1 \
-	&& SASL_VERSION_STEP >=15
-	char *__sasl_compat = "2.1.15+ or better okay";
-#endif
-	],	[ol_cv_sasl_compat=yes], [ol_cv_sasl_compat=no])])
-])
-dnl ====================================================================
-dnl check for SSL compatibility
-AC_DEFUN([OL_SSL_COMPAT],
-[AC_CACHE_CHECK([OpenSSL library version (CRL checking capability)],
-	[ol_cv_ssl_crl_compat],[
-		AC_EGREP_CPP(__ssl_compat,[
-#ifdef HAVE_OPENSSL_SSL_H
-#include <openssl/ssl.h>
-#endif
-
-/* Require 0.9.7d+ */
-#if OPENSSL_VERSION_NUMBER >= 0x0090704fL
-	char *__ssl_compat = "0.9.7d";
-#endif
-	], [ol_cv_ssl_crl_compat=yes], [ol_cv_ssl_crl_compat=no])])
-])
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/sntp/libevent/sample/http-server.c /cur/src/external/bsd/ntp/dist/sntp/libevent/sample/http-server.c
--- external/bsd/ntp/dist/sntp/libevent/sample/http-server.c	2014-12-24 18:28:16.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/sntp/libevent/sample/http-server.c	2015-04-07 19:51:18.000000000 -0700
@@ -248,7 +248,10 @@
 			goto err;
 #endif
 
-		evbuffer_add_printf(evb, "<html>\n <head>\n"
+		evbuffer_add_printf(evb,
+                    "<!DOCTYPE html>\n"
+                    "<html>\n <head>\n"
+                    "  <meta charset='utf-8'>\n"
 		    "  <title>%s</title>\n"
 		    "  <base href='%s%s'>\n"
 		    " </head>\n"
@@ -276,7 +279,7 @@
 #endif
 		evbuffer_add_printf(evb, "</ul></body></html>\n");
 #ifdef _WIN32
-		CloseHandle(d);
+		FindClose(d);
 #else
 		closedir(d);
 #endif
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/sntp/libevent/sample/https-client.c /cur/src/external/bsd/ntp/dist/sntp/libevent/sample/https-client.c
--- external/bsd/ntp/dist/sntp/libevent/sample/https-client.c	2014-12-24 18:28:16.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/sntp/libevent/sample/https-client.c	2015-04-07 19:51:18.000000000 -0700
@@ -98,7 +98,7 @@
 syntax(void)
 {
 	fputs("Syntax:\n", stderr);
-	fputs("   https-client -url <https-url> [-data data-file.bin] [-ignore-cert]\n", stderr);
+	fputs("   https-client -url <https-url> [-data data-file.bin] [-ignore-cert] [-retries num]\n", stderr);
 	fputs("Example:\n", stderr);
 	fputs("   https-client -url https://ip.appspot.com/\n", stderr);
 
@@ -197,6 +197,7 @@
 	const char *scheme, *host, *path, *query;
 	char uri[256];
 	int port;
+	int retries = 0;
 
 	SSL_CTX *ssl_ctx;
 	SSL *ssl;
@@ -223,6 +224,12 @@
 			} else {
 				syntax();
 			}
+		} else if (!strcmp("-retries", argv[i])) {
+			if (i < argc - 1) {
+				retries = atoi(argv[i + 1]);
+			} else {
+				syntax();
+			}
 		} else if (!strcmp("-help", argv[i])) {
 			syntax();
 		}
@@ -348,8 +355,10 @@
 		die_openssl("SSL_new()");
 	}
 
+	#ifdef SSL_CTRL_SET_TLSEXT_HOSTNAME
 	// Set hostname for SNI extension
 	SSL_set_tlsext_host_name(ssl, host);
+	#endif
 
 	if (strcasecmp(scheme, "http") == 0) {
 		bev = bufferevent_socket_new(base, -1, BEV_OPT_CLOSE_ON_FREE);
@@ -375,6 +384,10 @@
 		return 1;
 	}
 
+	if (retries > 0) {
+		evhttp_connection_set_retries(evcon, retries);
+	}
+
 	// Fire off the request
 	req = evhttp_request_new(http_request_done, bev);
 	if (req == NULL) {
@@ -404,7 +417,7 @@
 			evbuffer_add(output_buffer, buf, s);
 			bytes += s;
 		}
-		evutil_snprintf(buf, sizeof(buf)-1, "%lu", bytes);
+		evutil_snprintf(buf, sizeof(buf)-1, "%lu", (unsigned long)bytes);
 		evhttp_add_header(output_headers, "Content-Length", buf);
 		fclose(f);
 	}
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/sntp/libevent/sample/include.am /cur/src/external/bsd/ntp/dist/sntp/libevent/sample/include.am
--- external/bsd/ntp/dist/sntp/libevent/sample/include.am	2014-12-19 12:37:47.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/sntp/libevent/sample/include.am	2015-04-07 19:51:18.000000000 -0700
@@ -30,7 +30,9 @@
 	sample/openssl_hostname_validation.h
 endif
 
+if BUILD_SAMPLES
 noinst_PROGRAMS += $(SAMPLES)
+endif
 
 $(SAMPLES) : libevent.la
 
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/sntp/libevent/test/include.am /cur/src/external/bsd/ntp/dist/sntp/libevent/test/include.am
--- external/bsd/ntp/dist/sntp/libevent/test/include.am	2014-12-19 12:37:48.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/sntp/libevent/test/include.am	2015-04-07 19:51:18.000000000 -0700
@@ -49,7 +49,8 @@
 test/test-script.sh: test/test.sh
 	cp $(top_srcdir)/test/test.sh $@
 
-DISTCLEANFILES += test/test-script.sh test/regress.gen.c test/regress.gen.h
+DISTCLEANFILES += test/test-script.sh
+DISTCLEANFILES += test/regress.gen.c test/regress.gen.h
 
 if BUILD_REGRESS
 BUILT_SOURCES += test/regress.gen.c test/regress.gen.h
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/sntp/libevent/test/regress.c /cur/src/external/bsd/ntp/dist/sntp/libevent/test/regress.c
--- external/bsd/ntp/dist/sntp/libevent/test/regress.c	2014-12-24 18:28:16.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/sntp/libevent/test/regress.c	2015-04-07 19:51:18.000000000 -0700
@@ -946,17 +946,18 @@
 }
 
 static void
-test_simplesignal(void)
+test_simplesignal_impl(int find_reorder)
 {
 	struct event ev;
 	struct itimerval itv;
 
-	setup_test("Simple signal: ");
 	evsignal_set(&ev, SIGALRM, signal_cb, &ev);
 	evsignal_add(&ev, NULL);
 	/* find bugs in which operations are re-ordered */
-	evsignal_del(&ev);
-	evsignal_add(&ev, NULL);
+	if (find_reorder) {
+		evsignal_del(&ev);
+		evsignal_add(&ev, NULL);
+	}
 
 	memset(&itv, 0, sizeof(itv));
 	itv.it_value.tv_sec = 0;
@@ -973,6 +974,20 @@
 }
 
 static void
+test_simplestsignal(void)
+{
+	setup_test("Simplest one signal: ");
+	test_simplesignal_impl(0);
+}
+
+static void
+test_simplesignal(void)
+{
+	setup_test("Simple signal: ");
+	test_simplesignal_impl(1);
+}
+
+static void
 test_multiplesignal(void)
 {
 	struct event ev_one, ev_two;
@@ -1660,7 +1675,7 @@
 test_active_later(void *ptr)
 {
 	struct basic_test_data *data = ptr;
-	struct event *ev1, *ev2;
+	struct event *ev1 = NULL, *ev2 = NULL;
 	struct event ev3, ev4;
 	struct timeval qsec = {0, 100000};
 	ev1 = event_new(data->base, data->pair[0], EV_READ|EV_PERSIST, read_and_drain_cb, NULL);
@@ -1695,10 +1710,15 @@
 	 * it. */
 	event_active_later_(&ev3, EV_READ);
 	event_base_assert_ok_(data->base);
+
+end:
+	if (ev1)
+		event_free(ev1);
+	if (ev2)
+		event_free(ev2);
+
 	event_base_free(data->base);
 	data->base = NULL;
-end:
-	;
 }
 
 
@@ -2283,7 +2303,7 @@
 
 	for (j = 0; j < 100; j++) {
 		for (i = 0; i < (int)sizeof(buffer); i++)
-			buffer[i] = rand();
+			buffer[i] = test_weakrand();
 		evbuffer_drain(tmp, -1);
 		evbuffer_add(tmp, buffer, sizeof(buffer));
 
@@ -3296,6 +3316,7 @@
 
 struct testcase_t signal_testcases[] = {
 #ifndef _WIN32
+	LEGACY(simplestsignal, TT_ISOLATED),
 	LEGACY(simplesignal, TT_ISOLATED),
 	LEGACY(multiplesignal, TT_ISOLATED),
 	LEGACY(immediatesignal, TT_ISOLATED),
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/sntp/libevent/test/regress.h /cur/src/external/bsd/ntp/dist/sntp/libevent/test/regress.h
--- external/bsd/ntp/dist/sntp/libevent/test/regress.h	2014-12-24 18:28:16.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/sntp/libevent/test/regress.h	2015-04-07 19:51:18.000000000 -0700
@@ -55,6 +55,10 @@
 extern struct testcase_t listener_iocp_testcases[];
 extern struct testcase_t thread_testcases[];
 
+extern struct evutil_weakrand_state test_weakrand_state;
+
+#define test_weakrand() (evutil_weakrand_(&test_weakrand_state))
+
 void regress_threads(void *);
 void test_bufferevent_zlib(void *);
 
@@ -116,7 +120,7 @@
 	} while (0)
 
 #define test_timeval_diff_leq(tv1, tv2, diff, tolerance)		\
-	tt_int_op(abs(timeval_msec_diff((tv1), (tv2)) - diff), <=, tolerance)
+	tt_int_op(labs(timeval_msec_diff((tv1), (tv2)) - diff), <=, tolerance)
 
 #define test_timeval_diff_eq(tv1, tv2, diff)				\
 	test_timeval_diff_leq((tv1), (tv2), (diff), 50)
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/sntp/libevent/test/regress_buffer.c /cur/src/external/bsd/ntp/dist/sntp/libevent/test/regress_buffer.c
--- external/bsd/ntp/dist/sntp/libevent/test/regress_buffer.c	2014-12-24 18:28:16.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/sntp/libevent/test/regress_buffer.c	2015-04-07 19:51:18.000000000 -0700
@@ -248,7 +248,7 @@
 	if (memcmp(evbuffer_pullup(
 			   evb, -1), buffer, sizeof(buffer) / 2) != 0 ||
 	    memcmp(evbuffer_pullup(
-			   evb_two, -1), buffer, sizeof(buffer) != 0))
+			   evb_two, -1), buffer, sizeof(buffer)) != 0)
 		tt_abort_msg("Pullup did not preserve content");
 
 	evbuffer_validate(evb);
@@ -865,6 +865,10 @@
 		evutil_closesocket(pair[0]);
 	if (pair[1] >= 0)
 		evutil_closesocket(pair[1]);
+	if (wev)
+		event_free(wev);
+	if (rev)
+		event_free(rev);
 	if (tmpfilename) {
 		unlink(tmpfilename);
 		free(tmpfilename);
@@ -1536,9 +1540,9 @@
 	tt_assert(!evbuffer_remove_cb(buf, log_change_callback, buf_out2));
 	evbuffer_validate(buf);
 
-	tt_str_op(evbuffer_pullup(buf_out1, -1), ==,
+	tt_str_op((const char *) evbuffer_pullup(buf_out1, -1), ==,
 		  "0->36; 36->26; 26->31; 31->38; ");
-	tt_str_op(evbuffer_pullup(buf_out2, -1), ==,
+	tt_str_op((const char *) evbuffer_pullup(buf_out2, -1), ==,
 		  "0->36; 31->38; 38->0; 0->1; ");
 	evbuffer_drain(buf_out1, evbuffer_get_length(buf_out1));
 	evbuffer_drain(buf_out2, evbuffer_get_length(buf_out2));
@@ -1554,7 +1558,7 @@
 	tt_uint_op(evbuffer_get_length(buf_out2), ==, 0);
 	evbuffer_setcb(buf, NULL, NULL);
 	evbuffer_add_printf(buf, "This will not.");
-	tt_str_op(evbuffer_pullup(buf, -1), ==, "This will not.");
+	tt_str_op((const char *) evbuffer_pullup(buf, -1), ==, "This will not.");
 	evbuffer_validate(buf);
 	evbuffer_drain(buf, evbuffer_get_length(buf));
 	evbuffer_validate(buf);
@@ -1662,7 +1666,7 @@
 	evbuffer_add(buf1, "You shake and shake the ", 24);
 	evbuffer_add_reference(buf1, "ketchup bottle", 14, ref_done_cb,
 	    (void*)3333);
-	evbuffer_add(buf1, ". Nothing comes and then a lot'll.", 42);
+	evbuffer_add(buf1, ". Nothing comes and then a lot'll.", 35);
 	evbuffer_free(buf1);
 	buf1 = NULL;
 	tt_int_op(ref_done_cb_called_count, ==, 3);
@@ -1842,6 +1846,42 @@
 }
 
 static void
+test_evbuffer_peek_first_gt(void *info)
+{
+	struct evbuffer *buf = NULL, *tmp_buf = NULL;
+	struct evbuffer_ptr ptr;
+	struct evbuffer_iovec v[2];
+
+	buf = evbuffer_new();
+	tmp_buf = evbuffer_new();
+	evbuffer_add_printf(tmp_buf, "Contents of chunk 100\n");
+	evbuffer_add_buffer(buf, tmp_buf);
+	evbuffer_add_printf(tmp_buf, "Contents of chunk 1\n");
+	evbuffer_add_buffer(buf, tmp_buf);
+
+	evbuffer_ptr_set(buf, &ptr, 0, EVBUFFER_PTR_SET);
+
+	/** The only case that matters*/
+	tt_int_op(evbuffer_peek(buf, -1, &ptr, NULL, 0), ==, 2);
+	/** Just in case */
+	tt_int_op(evbuffer_peek(buf, -1, &ptr, v, 2), ==, 2);
+
+	evbuffer_ptr_set(buf, &ptr, 20, EVBUFFER_PTR_ADD);
+	tt_int_op(evbuffer_peek(buf, -1, &ptr, NULL, 0), ==, 2);
+	tt_int_op(evbuffer_peek(buf, -1, &ptr, v, 2), ==, 2);
+	tt_int_op(evbuffer_peek(buf, 2, &ptr, NULL, 0), ==, 1);
+	tt_int_op(evbuffer_peek(buf, 2, &ptr, v, 2), ==, 1);
+	tt_int_op(evbuffer_peek(buf, 3, &ptr, NULL, 0), ==, 2);
+	tt_int_op(evbuffer_peek(buf, 3, &ptr, v, 2), ==, 2);
+
+end:
+	if (buf)
+		evbuffer_free(buf);
+	if (tmp_buf)
+		evbuffer_free(tmp_buf);
+}
+
+static void
 test_evbuffer_peek(void *info)
 {
 	struct evbuffer *buf = NULL, *tmp_buf = NULL;
@@ -2098,7 +2138,7 @@
 	    "When the rich Allobrogenses never kept amanuenses, "
 	    "And our only plots were piled in lakes at Berne.";
 	/* -- Kipling, "In The Neolithic Age" */
-	char tmp[256];
+	char tmp[1024];
 	struct evbuffer_ptr ptr;
 	struct evbuffer *buf;
 
@@ -2208,6 +2248,7 @@
 	{ "multicast_drain", test_evbuffer_multicast_drain, 0, NULL, NULL },
 	{ "prepend", test_evbuffer_prepend, TT_FORK, NULL, NULL },
 	{ "peek", test_evbuffer_peek, 0, NULL, NULL },
+	{ "peek_first_gt", test_evbuffer_peek_first_gt, 0, NULL, NULL },
 	{ "freeze_start", test_evbuffer_freeze, 0, &nil_setup, (void*)"start" },
 	{ "freeze_end", test_evbuffer_freeze, 0, &nil_setup, (void*)"end" },
 	{ "add_iovec", test_evbuffer_add_iovec, 0, NULL, NULL},
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/sntp/libevent/test/regress_bufferevent.c /cur/src/external/bsd/ntp/dist/sntp/libevent/test/regress_bufferevent.c
--- external/bsd/ntp/dist/sntp/libevent/test/regress_bufferevent.c	2014-12-24 18:28:16.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/sntp/libevent/test/regress_bufferevent.c	2015-04-07 19:51:18.000000000 -0700
@@ -77,6 +77,7 @@
 #include "event2/util.h"
 
 #include "bufferevent-internal.h"
+#include "evthread-internal.h"
 #include "util-internal.h"
 #ifdef _WIN32
 #include "iocp-internal.h"
@@ -175,9 +176,9 @@
 
 	event_dispatch();
 
-	bufferevent_free(bev1);
-	tt_ptr_op(bufferevent_pair_get_partner(bev2), ==, NULL);
 	bufferevent_free(bev2);
+	tt_ptr_op(bufferevent_pair_get_partner(bev1), ==, NULL);
+	bufferevent_free(bev1);
 
 	if (test_ok != 2)
 		test_ok = 0;
@@ -197,6 +198,143 @@
 	test_bufferevent_impl(1);
 }
 
+#if defined(EVTHREAD_USE_PTHREADS_IMPLEMENTED)
+/**
+ * Trace lock/unlock/alloc/free for locks.
+ * (More heavier then evthread_debug*)
+ */
+typedef struct
+{
+	void *lock;
+	enum {
+		ALLOC, FREE,
+	} status;
+	size_t locked /** allow recursive locking */;
+} lock_wrapper;
+struct lock_unlock_base
+{
+	/* Original callbacks */
+	struct evthread_lock_callbacks cbs;
+	/* Map of locks */
+	lock_wrapper *locks;
+	size_t nr_locks;
+} lu_base = {
+	.locks = NULL,
+};
+
+static lock_wrapper *lu_find(void *lock_)
+{
+	size_t i;
+	for (i = 0; i < lu_base.nr_locks; ++i) {
+		lock_wrapper *lock = &lu_base.locks[i];
+		if (lock->lock == lock_)
+			return lock;
+	}
+	return NULL;
+}
+
+static void *trace_lock_alloc(unsigned locktype)
+{
+	++lu_base.nr_locks;
+	lu_base.locks = realloc(lu_base.locks,
+		sizeof(lock_wrapper) * lu_base.nr_locks);
+	void *lock = lu_base.cbs.alloc(locktype);
+	lu_base.locks[lu_base.nr_locks - 1] = (lock_wrapper){ lock, ALLOC, 0 };
+	return lock;
+}
+static void trace_lock_free(void *lock_, unsigned locktype)
+{
+	lock_wrapper *lock = lu_find(lock_);
+	if (!lock || lock->status == FREE || lock->locked) {
+		__asm__("int3");
+		TT_FAIL(("lock: free error"));
+	} else {
+		lock->status = FREE;
+		lu_base.cbs.free(lock_, locktype);
+	}
+}
+static int trace_lock_lock(unsigned mode, void *lock_)
+{
+	lock_wrapper *lock = lu_find(lock_);
+	if (!lock || lock->status == FREE) {
+		TT_FAIL(("lock: lock error"));
+		return -1;
+	} else {
+		++lock->locked;
+		return lu_base.cbs.lock(mode, lock_);
+	}
+}
+static int trace_lock_unlock(unsigned mode, void *lock_)
+{
+	lock_wrapper *lock = lu_find(lock_);
+	if (!lock || lock->status == FREE || !lock->locked) {
+		TT_FAIL(("lock: unlock error"));
+		return -1;
+	} else {
+		--lock->locked;
+		return lu_base.cbs.unlock(mode, lock_);
+	}
+}
+static void lock_unlock_free_thread_cbs()
+{
+	event_base_free(NULL);
+
+	/** drop immutable flag */
+	evthread_set_lock_callbacks(NULL);
+	/** avoid calling of event_global_setup_locks_() for new cbs */
+	libevent_global_shutdown();
+	/** drop immutable flag for non-debug ops (since called after shutdown) */
+	evthread_set_lock_callbacks(NULL);
+}
+
+static int use_lock_unlock_profiler(void)
+{
+	struct evthread_lock_callbacks cbs = {
+		EVTHREAD_LOCK_API_VERSION,
+		EVTHREAD_LOCKTYPE_RECURSIVE,
+		trace_lock_alloc,
+		trace_lock_free,
+		trace_lock_lock,
+		trace_lock_unlock,
+	};
+	memcpy(&lu_base.cbs, evthread_get_lock_callbacks(),
+		sizeof(lu_base.cbs));
+	{
+		lock_unlock_free_thread_cbs();
+
+		evthread_set_lock_callbacks(&cbs);
+		/** re-create debug locks correctly */
+		evthread_enable_lock_debugging();
+
+		event_init();
+	}
+	return 0;
+}
+static void free_lock_unlock_profiler(struct basic_test_data *data)
+{
+	lock_unlock_free_thread_cbs();
+	free(lu_base.locks);
+	data->base = NULL;
+}
+
+static void test_bufferevent_pair_release_lock(void *arg)
+{
+	struct basic_test_data *data = arg;
+	use_lock_unlock_profiler();
+	{
+		struct bufferevent *pair[2];
+		if (!bufferevent_pair_new(NULL, BEV_OPT_THREADSAFE, pair)) {
+			bufferevent_free(pair[0]);
+			bufferevent_free(pair[1]);
+		} else
+			tt_abort_perror("bufferevent_pair_new");
+	}
+	free_lock_unlock_profiler(data);
+end:
+	;
+}
+#endif
+
 /*
  * test watermarks and bufferevent
  */
@@ -289,6 +427,11 @@
 	tt_int_op(low, ==, 100);
 	tt_int_op(high, ==, 2000);
 
+	{
+	int r = bufferevent_getwatermark(bev1, EV_WRITE | EV_READ, &low, &high);
+	tt_int_op(r, !=, 0);
+	}
+
 	bufferevent_write(bev1, buffer, sizeof(buffer));
 
 	event_dispatch();
@@ -946,6 +1089,11 @@
 
 	LEGACY(bufferevent, TT_ISOLATED),
 	LEGACY(bufferevent_pair, TT_ISOLATED),
+#if defined(EVTHREAD_USE_PTHREADS_IMPLEMENTED)
+	{ "bufferevent_pair_release_lock", test_bufferevent_pair_release_lock,
+	  TT_FORK|TT_ISOLATED|TT_NEED_THREADS|TT_NEED_BASE|TT_LEGACY,
+	  &basic_setup, NULL },
+#endif
 	LEGACY(bufferevent_watermarks, TT_ISOLATED),
 	LEGACY(bufferevent_pair_watermarks, TT_ISOLATED),
 	LEGACY(bufferevent_filters, TT_ISOLATED),
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/sntp/libevent/test/regress_dns.c /cur/src/external/bsd/ntp/dist/sntp/libevent/test/regress_dns.c
--- external/bsd/ntp/dist/sntp/libevent/test/regress_dns.c	2014-12-24 18:28:16.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/sntp/libevent/test/regress_dns.c	2015-04-07 19:51:18.000000000 -0700
@@ -408,6 +408,22 @@
 	 * the only nameserver. */
 	evdns_base_nameserver_sockaddr_add(base, (struct sockaddr*)&ss, slen, 0);
 	tt_int_op(evdns_base_count_nameservers(base), ==, 1);
+	{
+		struct sockaddr_storage ss2;
+		int slen2;
+
+		memset(&ss2, 0, sizeof(ss2));
+
+		slen2 = evdns_base_get_nameserver_addr(base, 0, (struct sockaddr *)&ss2, 3);
+		tt_int_op(slen2, ==, slen);
+		tt_int_op(ss2.ss_family, ==, 0);
+		slen2 = evdns_base_get_nameserver_addr(base, 0, (struct sockaddr *)&ss2, sizeof(ss2));
+		tt_int_op(slen2, ==, slen);
+		tt_mem_op(&ss2, ==, &ss, slen);
+
+		slen2 = evdns_base_get_nameserver_addr(base, 1, (struct sockaddr *)&ss2, sizeof(ss2));
+		tt_int_op(-1, ==, slen2);
+	}
 
 	/* Send some queries. */
 	evdns_base_resolve_ipv4(base, "zz.example.com", DNS_QUERY_NO_SEARCH,
@@ -445,6 +461,7 @@
 
 static int n_replies_left;
 static struct event_base *exit_base;
+static struct evdns_server_port *exit_port;
 
 struct generic_dns_callback_result {
 	int result;
@@ -485,8 +502,14 @@
 		res->addrs = res->addrs_buf;
 	}
 
-	if (--n_replies_left == 0)
-		event_base_loopexit(exit_base, NULL);
+	--n_replies_left;
+	if (n_replies_left == 0) {
+		if (exit_port) {
+			evdns_close_server_port(exit_port);
+			exit_port = NULL;
+		} else
+			event_base_loopexit(exit_base, NULL);
+	}
 }
 
 static struct regress_dns_server_table search_table[] = {
@@ -666,7 +689,7 @@
 }
 
 static void
-dns_retry_test(void *arg)
+dns_retry_test_impl(void *arg, int flags)
 {
 	struct basic_test_data *data = arg;
 	struct event_base *base = data->base;
@@ -683,7 +706,7 @@
 	tt_assert(port);
 	evutil_snprintf(buf, sizeof(buf), "127.0.0.1:%d", (int)portnum);
 
-	dns = evdns_base_new(base, 0);
+	dns = evdns_base_new(base, flags);
 	tt_assert(!evdns_base_nameserver_ip_add(dns, buf));
 	tt_assert(! evdns_base_set_option(dns, "timeout", "0.2"));
 	tt_assert(! evdns_base_set_option(dns, "max-timeouts:", "10"));
@@ -738,6 +761,16 @@
 	if (port)
 		evdns_close_server_port(port);
 }
+static void
+dns_retry_test(void *arg)
+{
+	dns_retry_test_impl(arg, 0);
+}
+static void
+dns_retry_disable_when_inactive_test(void *arg)
+{
+	dns_retry_test_impl(arg, EVDNS_BASE_DISABLE_WHEN_INACTIVE);
+}
 
 static struct regress_dns_server_table internal_error_table[] = {
 	/* Error 4 (NOTIMPL) makes us reissue the request to another server
@@ -755,7 +788,7 @@
 };
 
 static void
-dns_reissue_test(void *arg)
+dns_reissue_test_impl(void *arg, int flags)
 {
 	struct basic_test_data *data = arg;
 	struct event_base *base = data->base;
@@ -774,7 +807,7 @@
 	evutil_snprintf(buf1, sizeof(buf1), "127.0.0.1:%d", (int)portnum1);
 	evutil_snprintf(buf2, sizeof(buf2), "127.0.0.1:%d", (int)portnum2);
 
-	dns = evdns_base_new(base, 0);
+	dns = evdns_base_new(base, flags);
 	tt_assert(!evdns_base_nameserver_ip_add(dns, buf1));
 	tt_assert(! evdns_base_set_option(dns, "timeout:", "0.3"));
 	tt_assert(! evdns_base_set_option(dns, "max-timeouts:", "2"));
@@ -807,6 +840,16 @@
 	if (port2)
 		evdns_close_server_port(port2);
 }
+static void
+dns_reissue_test(void *arg)
+{
+	dns_reissue_test_impl(arg, 0);
+}
+static void
+dns_reissue_disable_when_inactive_test(void *arg)
+{
+	dns_reissue_test_impl(arg, EVDNS_BASE_DISABLE_WHEN_INACTIVE);
+}
 
 #if 0
 static void
@@ -821,21 +864,29 @@
 #endif
 
 static void
-dns_inflight_test(void *arg)
+dns_inflight_test_impl(void *arg, int flags)
 {
 	struct basic_test_data *data = arg;
 	struct event_base *base = data->base;
 	struct evdns_base *dns = NULL;
+	struct evdns_server_port *dns_port = NULL;
 	ev_uint16_t portnum = 0;
 	char buf[64];
+	int disable_when_inactive = flags & EVDNS_BASE_DISABLE_WHEN_INACTIVE;
 
 	struct generic_dns_callback_result r[20];
 	int i;
 
-	tt_assert(regress_dnsserver(base, &portnum, reissue_table));
+	dns_port = regress_get_dnsserver(base, &portnum, NULL,
+		regress_dns_server_cb, reissue_table);
+	tt_assert(dns_port);
+	if (disable_when_inactive) {
+		exit_port = dns_port;
+	}
+
 	evutil_snprintf(buf, sizeof(buf), "127.0.0.1:%d", (int)portnum);
 
-	dns = evdns_base_new(base, 0);
+	dns = evdns_base_new(base, flags);
 	tt_assert(!evdns_base_nameserver_ip_add(dns, buf));
 	tt_assert(! evdns_base_set_option(dns, "max-inflight:", "3"));
 	tt_assert(! evdns_base_set_option(dns, "randomize-case:", "0"));
@@ -857,7 +908,65 @@
 end:
 	if (dns)
 		evdns_base_free(dns, 0);
+	if (exit_port) {
+		evdns_close_server_port(exit_port);
+		exit_port = NULL;
+	} else if (! disable_when_inactive) {
+		evdns_close_server_port(dns_port);
+	}
+}
+
+static void
+dns_inflight_test(void *arg)
+{
+	dns_inflight_test_impl(arg, 0);
+}
+
+static void
+dns_disable_when_inactive_test(void *arg)
+{
+	dns_inflight_test_impl(arg, EVDNS_BASE_DISABLE_WHEN_INACTIVE);
+}
+
+static void
+dns_disable_when_inactive_no_ns_test(void *arg)
+{
+	struct basic_test_data *data = arg;
+	struct event_base *base = data->base, *inactive_base;
+	struct evdns_base *dns = NULL;
+	ev_uint16_t portnum = 0;
+	char buf[64];
+	struct generic_dns_callback_result r;
+
+	inactive_base = event_base_new();
+	tt_assert(inactive_base);
+
+	/** Create dns server with inactive base, to avoid replying to clients */
+	tt_assert(regress_dnsserver(inactive_base, &portnum, search_table));
+	evutil_snprintf(buf, sizeof(buf), "127.0.0.1:%d", (int)portnum);
+
+	dns = evdns_base_new(base, EVDNS_BASE_DISABLE_WHEN_INACTIVE);
+	tt_assert(!evdns_base_nameserver_ip_add(dns, buf));
+	tt_assert(! evdns_base_set_option(dns, "timeout:", "0.1"));
+
+	evdns_base_resolve_ipv4(dns, "foof.example.com", 0, generic_dns_callback, &r);
+	n_replies_left = 1;
+	exit_base = base;
+
+	event_base_dispatch(base);
+
+	tt_int_op(n_replies_left, ==, 0);
+
+	tt_int_op(r.result, ==, DNS_ERR_TIMEOUT);
+	tt_int_op(r.count, ==, 0);
+	tt_ptr_op(r.addrs, ==, NULL);
+
+end:
+	if (dns)
+		evdns_base_free(dns, 0);
 	regress_clean_dnsserver();
+	if (inactive_base)
+		event_base_free(inactive_base);
 }
 
 /* === Test for bufferevent_socket_connect_hostname */
@@ -1565,7 +1674,8 @@
 end:
 	if (local_outcome.ai)
 		evutil_freeaddrinfo(local_outcome.ai);
-	for (i=0;i<10;++i) {
+#define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0]))
+	for (i=0;i<(int)ARRAY_SIZE(a_out);++i) {
 		if (a_out[i].ai)
 			evutil_freeaddrinfo(a_out[i].ai);
 	}
@@ -1696,9 +1806,15 @@
 	struct testleak_env_t *env;
 
 	allocated_chunks = 0;
+
+	/* Reset allocation counter, to start allocations from the very beginning.
+	 * (this will avoid false-positive negative numbers for allocated_chunks)
+	 */
+	libevent_global_shutdown();
+
 	event_set_mem_functions(cnt_malloc, cnt_realloc, cnt_free);
-	if (!libevent_tests_running_in_debug_mode)
-		event_enable_debug_mode();
+
+	event_enable_debug_mode();
 
 	/* not mm_calloc: we don't want to mess with the count. */
 	env = calloc(1, sizeof(struct testleak_env_t));
@@ -1719,8 +1835,8 @@
 #ifdef EVENT__DISABLE_DEBUG_MODE
 	tt_int_op(allocated_chunks, ==, 0);
 #else
-	/* FIXME: that's `1' because of event_debug_map_HT_GROW */
-	tt_int_op(allocated_chunks, ==, 1);
+	libevent_global_shutdown();
+	tt_int_op(allocated_chunks, ==, 0);
 #endif
 	ok = 1;
 end:
@@ -1793,6 +1909,7 @@
 end:
 	evdns_base_free(env->dns_base, send_err_shutdown);
 	env->dns_base = 0;
+
 	event_base_free(env->base);
 	env->base = 0;
 }
@@ -1877,6 +1994,8 @@
 		evdns_base_free(dns_base, 1);
 	if (server)
 		evdns_close_server_port(server);
+	if (base)
+		event_base_free(base);
 	if (fd >= 0)
 		evutil_closesocket(fd);
 }
@@ -1896,10 +2015,18 @@
 	{ "search_cancel", dns_search_cancel_test,
 	  TT_FORK|TT_NEED_BASE, &basic_setup, NULL },
 	{ "retry", dns_retry_test, TT_FORK|TT_NEED_BASE|TT_NO_LOGS, &basic_setup, NULL },
+	{ "retry_disable_when_inactive", dns_retry_disable_when_inactive_test,
+	  TT_FORK|TT_NEED_BASE|TT_NO_LOGS, &basic_setup, NULL },
 	{ "reissue", dns_reissue_test, TT_FORK|TT_NEED_BASE|TT_NO_LOGS, &basic_setup, NULL },
+	{ "reissue_disable_when_inactive", dns_reissue_disable_when_inactive_test,
+	  TT_FORK|TT_NEED_BASE|TT_NO_LOGS, &basic_setup, NULL },
 	{ "inflight", dns_inflight_test, TT_FORK|TT_NEED_BASE, &basic_setup, NULL },
 	{ "bufferevent_connect_hostname", test_bufferevent_connect_hostname,
 	  TT_FORK|TT_NEED_BASE, &basic_setup, NULL },
+	{ "disable_when_inactive", dns_disable_when_inactive_test,
+	  TT_FORK|TT_NEED_BASE, &basic_setup, NULL },
+	{ "disable_when_inactive_no_ns", dns_disable_when_inactive_no_ns_test,
+	  TT_FORK|TT_NEED_BASE, &basic_setup, NULL },
 
 	{ "getaddrinfo_async", test_getaddrinfo_async,
 	  TT_FORK|TT_NEED_BASE, &basic_setup, (char*)"" },
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/sntp/libevent/test/regress_finalize.c /cur/src/external/bsd/ntp/dist/sntp/libevent/test/regress_finalize.c
--- external/bsd/ntp/dist/sntp/libevent/test/regress_finalize.c	2014-12-24 18:28:16.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/sntp/libevent/test/regress_finalize.c	2015-04-07 19:51:18.000000000 -0700
@@ -27,6 +27,7 @@
  */
 
 #include "event2/event-config.h"
+#include "evconfig-private.h"
 #include "tinytest.h"
 #include "tinytest_macros.h"
 #include <stdlib.h>
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/sntp/libevent/test/regress_http.c /cur/src/external/bsd/ntp/dist/sntp/libevent/test/regress_http.c
--- external/bsd/ntp/dist/sntp/libevent/test/regress_http.c	2014-12-24 18:28:16.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/sntp/libevent/test/regress_http.c	2015-04-07 19:51:18.000000000 -0700
@@ -107,8 +107,12 @@
 	else
 		sock = evhttp_bind_socket_with_handle(myhttp, "127.0.0.1", *pport);
 
-	if (sock == NULL)
-		event_errx(1, "Could not start web server");
+	if (sock == NULL) {
+		if (ipv6)
+			return -1;
+		else
+			event_errx(1, "Could not start web server");
+	}
 
 	port = regress_get_socket_port(evhttp_bound_socket_get_fd(sock));
 	if (port < 0)
@@ -397,7 +401,7 @@
 {
 	struct basic_test_data *data = arg;
 	struct timeval tv;
-	struct bufferevent *bev;
+	struct bufferevent *bev = NULL;
 	evutil_socket_t fd;
 	const char *http_request;
 	ev_uint16_t port = 0, port2 = 0;
@@ -482,7 +486,8 @@
 
 	evhttp_free(http);
  end:
-	;
+	if (bev)
+		bufferevent_free(bev);
 }
 
 
@@ -716,6 +721,7 @@
 
 	http = http_setup(&port, data->base, 0);
 
+	tt_assert(http);
 	fd = http_connect("127.0.0.1", port);
 	tt_int_op(fd, >=, 0);
 
@@ -736,6 +742,7 @@
 
 	bufferevent_free(bev);
 	evutil_closesocket(fd);
+	fd = -1;
 
 	evhttp_free(http);
 
@@ -955,7 +962,8 @@
 static void http_request_empty_done(struct evhttp_request *, void *);
 
 static void
-http_connection_test_(struct basic_test_data *data, int persistent, const char *address, struct evdns_base *dnsbase, int ipv6)
+http_connection_test_(struct basic_test_data *data, int persistent,
+	const char *address, struct evdns_base *dnsbase, int ipv6, int family)
 {
 	ev_uint16_t port = 0;
 	struct evhttp_connection *evcon = NULL;
@@ -964,9 +972,14 @@
 	test_ok = 0;
 
 	http = http_setup(&port, data->base, ipv6);
+	if (!http && ipv6) {
+		tt_skip();
+	}
+	tt_assert(http);
 
 	evcon = evhttp_connection_base_new(data->base, dnsbase, address, port);
 	tt_assert(evcon);
+	evhttp_connection_set_family(evcon, family);
 
 	tt_assert(evhttp_connection_get_base(evcon) == data->base);
 
@@ -1040,12 +1053,12 @@
 static void
 http_connection_test(void *arg)
 {
-	http_connection_test_(arg, 0, "127.0.0.1", NULL, 0);
+	http_connection_test_(arg, 0, "127.0.0.1", NULL, 0, AF_UNSPEC);
 }
 static void
 http_persist_connection_test(void *arg)
 {
-	http_connection_test_(arg, 1, "127.0.0.1", NULL, 0);
+	http_connection_test_(arg, 1, "127.0.0.1", NULL, 0, AF_UNSPEC);
 }
 
 static struct regress_dns_server_table search_table[] = {
@@ -1149,6 +1162,63 @@
 }
 
 static void
+http_autofree_connection_test(void *arg)
+{
+	struct basic_test_data *data = arg;
+	ev_uint16_t port = 0;
+	struct evhttp_connection *evcon = NULL;
+	struct evhttp_request *req[2] = { NULL };
+
+	test_ok = 0;
+	http = http_setup(&port, data->base, 0);
+
+	evcon = evhttp_connection_base_new(data->base, NULL, "127.0.0.1", port);
+	tt_assert(evcon);
+
+	/*
+	 * At this point, we want to schedule two request to the HTTP
+	 * server using our make request method.
+	 */
+	req[0] = evhttp_request_new(http_request_empty_done, data->base);
+	req[1] = evhttp_request_new(http_request_empty_done, data->base);
+
+	/* Add the information that we care about */
+	evhttp_add_header(evhttp_request_get_output_headers(req[0]), "Host", "somehost");
+	evhttp_add_header(evhttp_request_get_output_headers(req[0]), "Connection", "close");
+	evhttp_add_header(evhttp_request_get_output_headers(req[0]), "Empty", "itis");
+	evhttp_add_header(evhttp_request_get_output_headers(req[1]), "Host", "somehost");
+	evhttp_add_header(evhttp_request_get_output_headers(req[1]), "Connection", "close");
+	evhttp_add_header(evhttp_request_get_output_headers(req[1]), "Empty", "itis");
+
+	/* We give ownership of the request to the connection */
+	if (evhttp_make_request(evcon, req[0], EVHTTP_REQ_GET, "/test") == -1) {
+		tt_abort_msg("couldn't make request");
+	}
+	if (evhttp_make_request(evcon, req[1], EVHTTP_REQ_GET, "/test") == -1) {
+		tt_abort_msg("couldn't make request");
+	}
+
+	/*
+	 * Tell libevent to free the connection when the request completes
+	 *	We then set the evcon pointer to NULL since we don't want to free it
+	 *	when this function ends.
+	 */
+	evhttp_connection_free_on_completion(evcon);
+	evcon = NULL;
+
+	event_base_dispatch(data->base);
+
+	/* at this point, the http server should have no connection */
+	tt_assert(TAILQ_FIRST(&http->connections) == NULL);
+
+ end:
+	if (evcon)
+		evhttp_connection_free(evcon);
+	if (http)
+		evhttp_free(http);
+}
+
+static void
 http_request_never_call(struct evhttp_request *req, void *arg)
 {
 	fprintf(stdout, "FAILED\n");
@@ -2745,6 +2815,7 @@
 	bufferevent_free(bev);
 	if (use_timeout) {
 		evutil_closesocket(fd);
+		fd = -1;
 	}
 
 	evhttp_free(http);
@@ -3750,7 +3821,7 @@
 };
 
 static void
-http_ipv6_for_domain_test(void *arg)
+http_ipv6_for_domain_test_impl(void *arg, int family)
 {
 	struct basic_test_data *data = arg;
 	struct evdns_base *dns_base = NULL;
@@ -3767,13 +3838,19 @@
 	evutil_snprintf(address, sizeof(address), "127.0.0.1:%d", portnum);
 	evdns_base_nameserver_ip_add(dns_base, address);
 
-	http_connection_test_(arg, 0 /* not persistent */, "localhost", dns_base, 1 /* ipv6 */);
+	http_connection_test_(arg, 0 /* not persistent */, "localhost", dns_base,
+		1 /* ipv6 */, family);
 
  end:
 	if (dns_base)
 		evdns_base_free(dns_base, 0);
 	regress_clean_dnsserver();
 }
+static void
+http_ipv6_for_domain_test(void *arg)
+{
+	http_ipv6_for_domain_test_impl(arg, AF_UNSPEC);
+}
 
 static void
 http_request_get_addr_on_close(struct evhttp_connection *evcon, void *arg)
@@ -3838,6 +3915,22 @@
 		evhttp_free(http);
 }
 
+static void
+http_set_family_test(void *arg)
+{
+	http_connection_test_(arg, 0, "127.0.0.1", NULL, 0, AF_UNSPEC);
+}
+static void
+http_set_family_ipv4_test(void *arg)
+{
+	http_connection_test_(arg, 0, "127.0.0.1", NULL, 0, AF_INET);
+}
+static void
+http_set_family_ipv6_test(void *arg)
+{
+	http_ipv6_for_domain_test_impl(arg, AF_INET6);
+}
+
 #define HTTP_LEGACY(name)						\
 	{ #name, run_legacy_test_fn, TT_ISOLATED|TT_LEGACY, &legacy_setup, \
 		    http_##name##_test }
@@ -3863,6 +3956,7 @@
 	HTTP(failure),
 	HTTP(connection),
 	HTTP(persist_connection),
+	HTTP(autofree_connection),
 	HTTP(connection_async),
 	HTTP(close_detection),
 	HTTP(close_detection_delay),
@@ -3890,6 +3984,10 @@
 	HTTP(ipv6_for_domain),
 	HTTP(get_addr),
 
+	HTTP(set_family),
+	HTTP(set_family_ipv4),
+	HTTP(set_family_ipv6),
+
 	END_OF_TESTCASES
 };
 
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/sntp/libevent/test/regress_main.c /cur/src/external/bsd/ntp/dist/sntp/libevent/test/regress_main.c
--- external/bsd/ntp/dist/sntp/libevent/test/regress_main.c	2014-12-24 18:28:16.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/sntp/libevent/test/regress_main.c	2015-04-07 19:51:18.000000000 -0700
@@ -92,6 +92,8 @@
 #include "../iocp-internal.h"
 #include "../event-internal.h"
 
+struct evutil_weakrand_state test_weakrand_state;
+
 long
 timeval_msec_diff(const struct timeval *start, const struct timeval *end)
 {
@@ -454,6 +456,8 @@
 
 	tinytest_set_aliases(testaliases);
 
+	evutil_weakrand_seed_(&test_weakrand_state, 0);
+
 	if (tinytest_main(argc,argv,testgroups))
 		return 1;
 
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/sntp/libevent/test/regress_minheap.c /cur/src/external/bsd/ntp/dist/sntp/libevent/test/regress_minheap.c
--- external/bsd/ntp/dist/sntp/libevent/test/regress_minheap.c	2014-12-24 18:28:16.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/sntp/libevent/test/regress_minheap.c	2015-04-07 19:51:18.000000000 -0700
@@ -32,12 +32,13 @@
 
 #include "tinytest.h"
 #include "tinytest_macros.h"
+#include "regress.h"
 
 static void
 set_random_timeout(struct event *ev)
 {
-	ev->ev_timeout.tv_sec = rand();
-	ev->ev_timeout.tv_usec = rand() & 0xfffff;
+	ev->ev_timeout.tv_sec = test_weakrand();
+	ev->ev_timeout.tv_usec = test_weakrand() & 0xfffff;
 	ev->ev_timeout_pos.min_heap_idx = -1;
 }
 
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/sntp/libevent/test/regress_ssl.c /cur/src/external/bsd/ntp/dist/sntp/libevent/test/regress_ssl.c
--- external/bsd/ntp/dist/sntp/libevent/test/regress_ssl.c	2014-12-24 18:28:16.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/sntp/libevent/test/regress_ssl.c	2015-04-07 19:51:18.000000000 -0700
@@ -196,6 +196,7 @@
 	n = atoi(line);
 	if (n <= 0)
 		TT_FAIL(("Bad number: %s", line));
+	free(line);
 	TT_BLATHER(("The number was %d", n));
 	if (n == 1001) {
 		++test_is_done;
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/sntp/libevent/test/regress_thread.c /cur/src/external/bsd/ntp/dist/sntp/libevent/test/regress_thread.c
--- external/bsd/ntp/dist/sntp/libevent/test/regress_thread.c	2014-12-24 18:28:17.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/sntp/libevent/test/regress_thread.c	2015-04-07 19:51:18.000000000 -0700
@@ -363,7 +363,7 @@
 			    &tv_signal);
 			diff2 = timeval_msec_diff(&actual_delay,
 			    &tv_broadcast);
-			if (abs(diff1) < abs(diff2)) {
+			if (labs(diff1) < labs(diff2)) {
 				TT_BLATHER(("%d looks like a signal\n", i));
 				target_delay = &tv_signal;
 				++n_signal;
@@ -384,7 +384,8 @@
 	tt_int_op(n_signal, ==, 1);
 
 end:
-	;
+	EVTHREAD_FREE_LOCK(cond.lock, EVTHREAD_LOCKTYPE_RECURSIVE);
+	EVTHREAD_FREE_COND(cond.cond);
 }
 
 #define CB_COUNT 128
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/sntp/libevent/test/regress_util.c /cur/src/external/bsd/ntp/dist/sntp/libevent/test/regress_util.c
--- external/bsd/ntp/dist/sntp/libevent/test/regress_util.c	2014-12-24 18:28:17.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/sntp/libevent/test/regress_util.c	2015-04-07 19:51:18.000000000 -0700
@@ -181,10 +181,10 @@
 		for (j = 0; j < 4; ++j) {
 			/* Can't use s6_addr32 here; some don't have it. */
 			ev_uint32_t u =
-				(in6.s6_addr[j*4  ] << 24) |
-				(in6.s6_addr[j*4+1] << 16) |
-				(in6.s6_addr[j*4+2] << 8) |
-				(in6.s6_addr[j*4+3]);
+			    ((ev_uint32_t)in6.s6_addr[j*4  ] << 24) |
+			    ((ev_uint32_t)in6.s6_addr[j*4+1] << 16) |
+			    ((ev_uint32_t)in6.s6_addr[j*4+2] << 8) |
+			    ((ev_uint32_t)in6.s6_addr[j*4+3]);
 			if (u != ent->res[j]) {
 				TT_FAIL(("%s did not parse as expected.", ent->addr));
 				continue;
@@ -728,46 +728,48 @@
 	tt_assert(u64 > 0);
 	tt_assert(i64 > 0);
 	u64++;
-	i64++;
+/*	i64++; */
 	tt_assert(u64 == 0);
-	tt_assert(i64 == EV_INT64_MIN);
-	tt_assert(i64 < 0);
+/*	tt_assert(i64 == EV_INT64_MIN); */
+/*	tt_assert(i64 < 0); */
 
 	u32 = EV_UINT32_MAX;
 	i32 = EV_INT32_MAX;
 	tt_assert(u32 > 0);
 	tt_assert(i32 > 0);
 	u32++;
-	i32++;
+/*	i32++; */
 	tt_assert(u32 == 0);
-	tt_assert(i32 == EV_INT32_MIN);
-	tt_assert(i32 < 0);
+/*	tt_assert(i32 == EV_INT32_MIN); */
+/*	tt_assert(i32 < 0); */
 
 	u16 = EV_UINT16_MAX;
 	i16 = EV_INT16_MAX;
 	tt_assert(u16 > 0);
 	tt_assert(i16 > 0);
 	u16++;
-	i16++;
+/*	i16++; */
 	tt_assert(u16 == 0);
-	tt_assert(i16 == EV_INT16_MIN);
-	tt_assert(i16 < 0);
+/*	tt_assert(i16 == EV_INT16_MIN); */
+/* 	tt_assert(i16 < 0); */
 
 	u8 = EV_UINT8_MAX;
 	i8 = EV_INT8_MAX;
 	tt_assert(u8 > 0);
 	tt_assert(i8 > 0);
 	u8++;
-	i8++;
+/*	i8++;*/
 	tt_assert(u8 == 0);
-	tt_assert(i8 == EV_INT8_MIN);
-	tt_assert(i8 < 0);
+/*	tt_assert(i8 == EV_INT8_MIN); */
+/*	tt_assert(i8 < 0); */
 
+/*
 	ssize = EV_SSIZE_MAX;
 	tt_assert(ssize > 0);
 	ssize++;
 	tt_assert(ssize < 0);
 	tt_assert(ssize == EV_SSIZE_MIN);
+*/
 
 	ptr = &ssize;
 	iptr = (ev_intptr_t)ptr;
@@ -1121,7 +1123,7 @@
 static void
 test_evutil_loadsyslib(void *arg)
 {
-	HANDLE h=NULL;
+	HMODULE h=NULL;
 
 	h = evutil_load_windows_system_library_(TEXT("kernel32.dll"));
 	tt_assert(h);
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/sntp/libevent/test/regress_zlib.c /cur/src/external/bsd/ntp/dist/sntp/libevent/test/regress_zlib.c
--- external/bsd/ntp/dist/sntp/libevent/test/regress_zlib.c	2014-12-24 18:28:17.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/sntp/libevent/test/regress_zlib.c	2015-04-07 19:51:18.000000000 -0700
@@ -58,6 +58,7 @@
 #include "event2/bufferevent.h"
 
 #include "regress.h"
+#include "mm-internal.h"
 
 /* zlib 1.2.4 and 1.2.5 do some "clever" things with macros.  Instead of
    saying "(defined(FOO) ? FOO : 0)" they like to say "FOO-0", on the theory
@@ -97,6 +98,7 @@
 	z_streamp p = ctx;
 
 	assert(deflateEnd(p) == Z_OK);
+	mm_free(p);
 }
 
 static void
@@ -105,6 +107,7 @@
 	z_streamp p = ctx;
 
 	assert(inflateEnd(p) == Z_OK);
+	mm_free(p);
 }
 
 static int
@@ -277,7 +280,7 @@
 {
 	struct bufferevent *bev1=NULL, *bev2=NULL;
 	char buffer[8333];
-	z_stream z_input, z_output;
+	z_stream *z_input, *z_output;
 	int i, r;
 	evutil_socket_t pair[2] = {-1, -1};
 	(void)arg;
@@ -295,18 +298,18 @@
 	bev1 = bufferevent_socket_new(NULL, pair[0], 0);
 	bev2 = bufferevent_socket_new(NULL, pair[1], 0);
 
-	memset(&z_output, 0, sizeof(z_output));
-	r = deflateInit(&z_output, Z_DEFAULT_COMPRESSION);
+	z_output = mm_calloc(sizeof(*z_output), 1);
+	r = deflateInit(z_output, Z_DEFAULT_COMPRESSION);
 	tt_int_op(r, ==, Z_OK);
-	memset(&z_input, 0, sizeof(z_input));
-	r = inflateInit(&z_input);
+	z_input = mm_calloc(sizeof(*z_input), 1);
+	r = inflateInit(z_input);
 	tt_int_op(r, ==, Z_OK);
 
 	/* initialize filters */
 	bev1 = bufferevent_filter_new(bev1, NULL, zlib_output_filter,
-	    BEV_OPT_CLOSE_ON_FREE, zlib_deflate_free, &z_output);
+	    BEV_OPT_CLOSE_ON_FREE, zlib_deflate_free, z_output);
 	bev2 = bufferevent_filter_new(bev2, zlib_input_filter,
-	    NULL, BEV_OPT_CLOSE_ON_FREE, zlib_inflate_free, &z_input);
+	    NULL, BEV_OPT_CLOSE_ON_FREE, zlib_inflate_free, z_input);
 	bufferevent_setcb(bev1, readcb, writecb, errorcb, NULL);
 	bufferevent_setcb(bev2, readcb, writecb, errorcb, NULL);
 
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/sntp/libevent/test/test-fdleak.c /cur/src/external/bsd/ntp/dist/sntp/libevent/test/test-fdleak.c
--- external/bsd/ntp/dist/sntp/libevent/test/test-fdleak.c	2014-12-24 18:28:17.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/sntp/libevent/test/test-fdleak.c	2015-04-07 19:51:18.000000000 -0700
@@ -59,7 +59,7 @@
 #endif
 
 /* Provide storage for the address, both for the server & the clients */
-static struct sockaddr_in sin;
+static struct sockaddr_in saddr;
 
 /* Number of sucessful requests so far */
 static int num_requests;
@@ -133,7 +133,7 @@
 
 	listener = evconnlistener_new_bind(base, listener_accept_cb, NULL,
 	    LEV_OPT_CLOSE_ON_FREE|LEV_OPT_REUSEABLE,
-	    -1, (struct sockaddr *)&sin, sizeof(sin));
+	    -1, (struct sockaddr *)&saddr, sizeof(saddr));
 	if (listener == NULL) {
 		my_perror("Could not create listener!");
 		exit(1);
@@ -147,8 +147,8 @@
 		my_perror("getsockname()");
 		exit(1);
 	}
-	memcpy(&sin, &ss, sizeof(sin));
-	if (sin.sin_family != AF_INET) {
+	memcpy(&saddr, &ss, sizeof(saddr));
+	if (saddr.sin_family != AF_INET) {
 		puts("AF mismatch from getsockname().");
 		exit(1);
 	}
@@ -210,8 +210,8 @@
                                                          BEV_OPT_CLOSE_ON_FREE);
 	bufferevent_setcb(bev, client_read_cb, NULL, client_event_cb, NULL);
 
-	if (bufferevent_socket_connect(bev, (struct sockaddr *)&sin,
-                                       sizeof(sin)) < 0) {
+	if (bufferevent_socket_connect(bev, (struct sockaddr *)&saddr,
+                                       sizeof(saddr)) < 0) {
 		my_perror("Could not connect!");
 		bufferevent_free(bev);
 		exit(2);
@@ -238,10 +238,10 @@
 #endif
 
 	/* Set up an address, used by both client & server. */
-	memset(&sin, 0, sizeof(sin));
-	sin.sin_family = AF_INET;
-	sin.sin_addr.s_addr = htonl(0x7f000001);
-	sin.sin_port = 0; /* Tell the implementation to pick a port. */
+	memset(&saddr, 0, sizeof(saddr));
+	saddr.sin_family = AF_INET;
+	saddr.sin_addr.s_addr = htonl(0x7f000001);
+	saddr.sin_port = 0; /* Tell the implementation to pick a port. */
 
 	start_loop();
 
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/sntp/libevent/test/test-ratelim.c /cur/src/external/bsd/ntp/dist/sntp/libevent/test/test-ratelim.c
--- external/bsd/ntp/dist/sntp/libevent/test/test-ratelim.c	2014-12-24 18:28:17.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/sntp/libevent/test/test-ratelim.c	2015-04-07 19:51:18.000000000 -0700
@@ -52,6 +52,7 @@
 #include "event2/listener.h"
 #include "event2/thread.h"
 
+static struct evutil_weakrand_state weakrand_state;
 
 static int cfg_verbose = 0;
 static int cfg_help = 0;
@@ -115,11 +116,7 @@
 	struct client_state *cs = ctx;
 	struct evbuffer *output = bufferevent_get_output(bev);
 	char buf[1024];
-#ifdef _WIN32
-	int r = rand() % 256;
-#else
-	int r = random() % 256;
-#endif
+	int r = evutil_weakrand_(&weakrand_state);
 	memset(buf, r, sizeof(buf));
 	while (evbuffer_get_length(output) < 8192) {
 		evbuffer_add(output, buf, sizeof(buf));
@@ -225,7 +222,7 @@
 #undef B
 
 	total_n_bev_checks++;
-	if (total_n_bev_checks >= .8 * (cfg_duration / cfg_tick_msec) * cfg_n_connections) {
+	if (total_n_bev_checks >= .8 * ((double)cfg_duration / cfg_tick_msec) * cfg_n_connections) {
 		event_free(event_base_get_running_event(bufferevent_get_base(bev)));
 	}
 }
@@ -555,6 +552,8 @@
 	(void) WSAStartup(wVersionRequested, &wsaData);
 #endif
 
+	evutil_weakrand_seed_(&weakrand_state, 0);
+
 #ifndef _WIN32
 	if (signal(SIGPIPE, SIG_IGN) == SIG_ERR)
 		return 1;
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/sntp/libevent/test/test-time.c /cur/src/external/bsd/ntp/dist/sntp/libevent/test/test-time.c
--- external/bsd/ntp/dist/sntp/libevent/test/test-time.c	2014-12-24 18:28:17.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/sntp/libevent/test/test-time.c	2015-04-07 19:51:18.000000000 -0700
@@ -43,6 +43,7 @@
 #include "event2/event.h"
 #include "event2/event_compat.h"
 #include "event2/event_struct.h"
+#include "util-internal.h"
 
 int called = 0;
 
@@ -50,14 +51,12 @@
 
 struct event *ev[NEVENT];
 
+struct evutil_weakrand_state weakrand_state;
+
 static int
 rand_int(int n)
 {
-#ifdef _WIN32
-	return (int)(rand() % n);
-#else
-	return (int)(random() % n);
-#endif
+	return evutil_weakrand_(&weakrand_state) % n;
 }
 
 static void
@@ -73,7 +72,7 @@
 			j = rand_int(NEVENT);
 			tv.tv_sec = 0;
 			tv.tv_usec = rand_int(50000);
-			if (tv.tv_usec % 2)
+			if (tv.tv_usec % 2 || called < NEVENT)
 				evtimer_add(ev[j], &tv);
 			else
 				evtimer_del(ev[j]);
@@ -95,6 +94,8 @@
 	(void) WSAStartup(wVersionRequested, &wsaData);
 #endif
 
+	evutil_weakrand_seed_(&weakrand_state, 0);
+
 	/* Initalize the event library */
 	event_init();
 
@@ -110,6 +111,8 @@
 
 	event_dispatch();
 
+
+	printf("%d, %d\n", called, NEVENT);
 	return (called < NEVENT);
 }
 
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/sntp/libevent/test/tinytest.c /cur/src/external/bsd/ntp/dist/sntp/libevent/test/tinytest.c
--- external/bsd/ntp/dist/sntp/libevent/test/tinytest.c	2014-12-24 18:28:17.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/sntp/libevent/test/tinytest.c	2015-04-07 19:51:18.000000000 -0700
@@ -33,6 +33,8 @@
 #include <string.h>
 #include <assert.h>
 
+#ifndef NO_FORKING
+
 #ifdef _WIN32
 #include <windows.h>
 #else
@@ -50,6 +52,8 @@
 #endif
 #endif
 
+#endif /* !NO_FORKING */
+
 #ifndef __GNUC__
 #define __attribute__(x)
 #endif
@@ -113,6 +117,8 @@
 
 #define MAGIC_EXITCODE 42
 
+#ifndef NO_FORKING
+
 static enum outcome
 testcase_run_forked_(const struct testgroup_t *group,
 		     const struct testcase_t *testcase)
@@ -213,6 +219,8 @@
 #endif
 }
 
+#endif /* !NO_FORKING */
+
 int
 testcase_run_one(const struct testgroup_t *group,
 		 const struct testcase_t *testcase)
@@ -236,9 +244,13 @@
 		cur_test_name = testcase->name;
 	}
 
+#ifndef NO_FORKING
 	if ((testcase->flags & TT_FORK) && !(opt_forked||opt_nofork)) {
 		outcome = testcase_run_forked_(group, testcase);
 	} else {
+#else
+	{
+#endif
 		outcome = testcase_run_bare_(testcase);
 	}
 
@@ -413,7 +425,9 @@
 	if (!n)
 		tinytest_set_flag_(groups, "..", 1, TT_ENABLED_);
 
+#ifdef _IONBF
 	setvbuf(stdout, NULL, _IONBF, 0);
+#endif
 
 	++in_tinytest_main;
 	for (i=0; groups[i].prefix; ++i)
@@ -460,3 +474,22 @@
 		cur_test_outcome = SKIP;
 }
 
+char *
+tinytest_format_hex_(const void *val_, unsigned long len)
+{
+	const unsigned char *val = val_;
+	char *result, *cp;
+	size_t i;
+
+	if (!val)
+		return strdup("null");
+	if (!(result = malloc(len*2+1)))
+		return strdup("<allocation failure>");
+	cp = result;
+	for (i=0;i<len;++i) {
+		*cp++ = "0123456789ABCDEF"[val[i] >> 4];
+		*cp++ = "0123456789ABCDEF"[val[i] & 0x0f];
+	}
+	*cp = 0;
+	return result;
+}
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/sntp/libevent/test/tinytest.h /cur/src/external/bsd/ntp/dist/sntp/libevent/test/tinytest.h
--- external/bsd/ntp/dist/sntp/libevent/test/tinytest.h	2014-12-24 18:28:17.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/sntp/libevent/test/tinytest.h	2015-04-07 19:51:18.000000000 -0700
@@ -83,6 +83,8 @@
 /** Implementation: Set a flag on tests matching a name; returns number
  * of tests that matched. */
 int tinytest_set_flag_(struct testgroup_t *, const char *, int set, unsigned long);
+/** Implementation: Put a chunk of memory into hex. */
+char *tinytest_format_hex_(const void *, unsigned long);
 
 /** Set all tests in 'groups' matching the name 'named' to be skipped. */
 #define tinytest_skip(groups, named) \
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/sntp/libevent/test/tinytest_macros.h /cur/src/external/bsd/ntp/dist/sntp/libevent/test/tinytest_macros.h
--- external/bsd/ntp/dist/sntp/libevent/test/tinytest_macros.h	2014-12-24 18:28:17.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/sntp/libevent/test/tinytest_macros.h	2015-04-07 19:51:18.000000000 -0700
@@ -115,8 +115,8 @@
 #define tt_assert_test_fmt_type(a,b,str_test,type,test,printf_type,printf_fmt, \
     setup_block,cleanup_block,die_on_fail)				\
 	TT_STMT_BEGIN							\
-	type val1_ = (type)(a);						\
-	type val2_ = (type)(b);						\
+	type val1_ = (a);						\
+	type val2_ = (b);						\
 	int tt_status_ = (test);					\
 	if (!tt_status_ || tinytest_get_verbosity_()>1)	{		\
 		printf_type print_;					\
@@ -146,6 +146,10 @@
 	tt_assert_test_fmt_type(a,b,str_test,type,test,type,fmt,	\
 	    {print_=value_;},{},die_on_fail)
 
+#define tt_assert_test_type_opt(a,b,str_test,type,test,fmt,die_on_fail)	\
+	tt_assert_test_fmt_type(a,b,str_test,type,test,type,fmt,	\
+            {print_=value_?value_:"<NULL>";},{},die_on_fail)
+
 /* Helper: assert that a op b, when cast to type.  Format the values with
  * printf format fmt on failure. */
 #define tt_assert_op_type(a,op,b,type,fmt)				\
@@ -161,12 +165,23 @@
 	    (val1_ op val2_),"%lu",TT_EXIT_TEST_FUNCTION)
 
 #define tt_ptr_op(a,op,b)						\
-	tt_assert_test_type(a,b,#a" "#op" "#b,void*,			\
+	tt_assert_test_type(a,b,#a" "#op" "#b,const void*,              \
 	    (val1_ op val2_),"%p",TT_EXIT_TEST_FUNCTION)
 
 #define tt_str_op(a,op,b)						\
-	tt_assert_test_type(a,b,#a" "#op" "#b,const char *,		\
-	    (strcmp(val1_,val2_) op 0),"<%s>",TT_EXIT_TEST_FUNCTION)
+	tt_assert_test_type_opt(a,b,#a" "#op" "#b,const char *,		\
+	    (val1_ && val2_ && strcmp(val1_,val2_) op 0),"<%s>",	\
+	    TT_EXIT_TEST_FUNCTION)
+
+#define tt_mem_op(expr1, op, expr2, len)                                \
+  tt_assert_test_fmt_type(expr1,expr2,#expr1" "#op" "#expr2,            \
+			  const void *,                                 \
+			  (val1_ && val2_ && memcmp(val1_, val2_, len) op 0), \
+			  char *, "%s",					\
+			  { print_ = tinytest_format_hex_(value_, (len)); }, \
+			  { if (print_) free(print_); },		\
+			  TT_EXIT_TEST_FUNCTION				\
+                          );
 
 #define tt_want_int_op(a,op,b)						\
 	tt_assert_test_type(a,b,#a" "#op" "#b,long,(val1_ op val2_),"%ld",(void)0)
@@ -176,7 +191,7 @@
 	    (val1_ op val2_),"%lu",(void)0)
 
 #define tt_want_ptr_op(a,op,b)						\
-	tt_assert_test_type(a,b,#a" "#op" "#b,void*,			\
+  tt_assert_test_type(a,b,#a" "#op" "#b,const void*,			\
 	    (val1_ op val2_),"%p",(void)0)
 
 #define tt_want_str_op(a,op,b)						\
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/sntp/libevent/time-internal.h /cur/src/external/bsd/ntp/dist/sntp/libevent/time-internal.h
--- external/bsd/ntp/dist/sntp/libevent/time-internal.h	2014-12-24 18:28:15.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/sntp/libevent/time-internal.h	2015-04-07 19:51:18.000000000 -0700
@@ -88,9 +88,6 @@
 	struct timeval last_time;
 };
 
-#define EV_MONOT_PRECISE  1
-#define EV_MONOT_FALLBACK 2
-
 int evutil_configure_monotonic_time_(struct evutil_monotonic_timer *mt,
     int flags);
 int evutil_gettime_monotonic_(struct evutil_monotonic_timer *mt, struct timeval *tv);
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/sntp/libevent/util-internal.h /cur/src/external/bsd/ntp/dist/sntp/libevent/util-internal.h
--- external/bsd/ntp/dist/sntp/libevent/util-internal.h	2014-12-24 18:28:15.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/sntp/libevent/util-internal.h	2015-04-07 19:51:18.000000000 -0700
@@ -394,7 +394,7 @@
 void evutil_free_globals_(void);
 
 #ifdef _WIN32
-HANDLE evutil_load_windows_system_library_(const TCHAR *library_name);
+HMODULE evutil_load_windows_system_library_(const TCHAR *library_name);
 #endif
 
 #ifndef EV_SIZE_FMT
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/sntp/libevent/whatsnew-2.1.txt /cur/src/external/bsd/ntp/dist/sntp/libevent/whatsnew-2.1.txt
--- external/bsd/ntp/dist/sntp/libevent/whatsnew-2.1.txt	2014-12-19 12:37:46.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/sntp/libevent/whatsnew-2.1.txt	2015-04-07 19:51:18.000000000 -0700
@@ -41,7 +41,7 @@
 
   We don't try to do binary compatibility except within stable release
   series, so binaries linked against any version of Libevent 2.0 will
-  probably need to be recompiled against Libevent 2.1.3-alpha if you
+  probably need to be recompiled against Libevent 2.1.4-alpha if you
   want to use it.  It is probable that we'll break binary compatibility
   again before Libevent 2.1 is stable.
 
@@ -63,6 +63,9 @@
   surrounded with appropriate #ifdef lines to keep your IDE from getting
   upset.
 
+  There is now an alternative cmake-based build process; cmake users
+  should see the relevant sections in the README.
+
 
 1.2. New functions for events and the event loop
 
@@ -146,6 +149,19 @@
   that's a no-op in past versions of Libevent, and we don't want to
   break compatibility.)
 
+  You can use the new event_base_get_num_events() function to find the
+  number of events active or pending on an event_base. To find the
+  largest number of events that there have been since the last call, use
+  event_base_get_max_events().
+
+  You can now activate all the events waiting for a given fd or signal
+  using the event_base_active_by_fd() and event_base_active_by_signal()
+  APIs.
+
+  On backends that support it (currently epoll), there is now an
+  EV_CLOSED flag that programs can use to detect when a socket has
+  closed without having to read all the bytes until receiving an EOF.
+
 1.3. Event finalization
 
   [NOTE: This is an experimental feature in Libevent 2.1.3-alpha. Though
@@ -325,6 +341,13 @@
   You can find the priority at which a bufferevent runs with
   bufferevent_get_priority().
 
+  The function bufferevent_get_token_bucket_cfg() can retrieve the
+  rate-limit settings for a bufferevent; bufferevent_getwatermark() can
+  return a bufferevent's current watermark settings.
+
+  You can manually trigger a bufferevent's callbacks via
+  bufferevent_trigger() and bufferevent_trigger_event().
+
 1.7. New functions and features: evdns
 
   The previous evdns interface used an "open a test UDP socket" trick in
@@ -340,6 +363,9 @@
   flag, which tells the evdns_base that it should not prevent Libevent from
   exiting while it has no DNS requests in progress.
 
+  There is a new evdns_base_clear_host_addresses() function to remove
+  all the /etc/hosts addresses registered with an evdns instance.
+
 1.8. New functions and features: evconnlistener
 
   Libevent 2.1 adds the following evconnlistener flags:
@@ -392,6 +418,31 @@
   and actually reports the error code and lets you figure out which request
   failed.
 
+  You can navigate from an evhttp_connection back to its evhttp with the
+  new evhttp_connection_get_server() function.
+
+  You can override the default HTTP Content-Type with the new
+  evhttp_set_default_content_type() function
+
+  There's a new evhttp_connection_get_addr() API to return the peer
+  address of an evhttp_connection.
+
+  The new evhttp_send_reply_chunk_with_cb() is a variant of
+  evhttp_send_reply_chunk() with a callback to be invoked when the
+  chunk is sent.
+
+  The evhttp_request_set_header_cb() facility adds a callback to be
+  invoked while parsing headers.
+
+  The evhttp_request_set_on_complete_cb() facility adds a callback to be
+  invoked on request completion.
+
+1.10. New functions and features: evutil
+
+  There's a function "evutil_secure_rng_set_urandom_device_file()" that
+  you can use to override the default file that Libevent uses to seed
+  its (sort-of) secure RNG.
+
 2. Cross-platform performance improvements
 
 2.1. Better data structures
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/sntp/libopts/Makefile.in /cur/src/external/bsd/ntp/dist/sntp/libopts/Makefile.in
--- external/bsd/ntp/dist/sntp/libopts/Makefile.in	2014-12-19 12:37:45.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/sntp/libopts/Makefile.in	2015-04-07 19:51:18.000000000 -0700
@@ -39,8 +39,6 @@
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/libopts/m4/libopts.m4 \
 	$(top_srcdir)/libopts/m4/stdnoreturn.m4 \
-	$(top_srcdir)/libevent/m4/openldap-thread-check.m4 \
-	$(top_srcdir)/libevent/m4/openldap.m4 \
 	$(top_srcdir)/m4/hms_search_lib.m4 $(top_srcdir)/m4/libtool.m4 \
 	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
 	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
@@ -60,8 +58,10 @@
 	$(top_srcdir)/m4/ntp_prog_cc.m4 $(top_srcdir)/m4/ntp_sntp.m4 \
 	$(top_srcdir)/m4/ntp_sysexits.m4 \
 	$(top_srcdir)/m4/ntp_ver_suffix.m4 \
-	$(top_srcdir)/m4/os_cflags.m4 $(top_srcdir)/m4/snprintf.m4 \
-	$(top_srcdir)/m4/version.m4 $(top_srcdir)/configure.ac
+	$(top_srcdir)/m4/openldap-thread-check.m4 \
+	$(top_srcdir)/m4/openldap.m4 $(top_srcdir)/m4/os_cflags.m4 \
+	$(top_srcdir)/m4/snprintf.m4 $(top_srcdir)/m4/version.m4 \
+	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
 mkinstalldirs = $(install_sh) -d
@@ -187,6 +187,7 @@
 LD = @LD@
 LDADD_LIBEVENT = @LDADD_LIBEVENT@
 LDADD_LIBNTP = @LDADD_LIBNTP@
+LDADD_LIBUTIL = @LDADD_LIBUTIL@
 LDADD_NTP = @LDADD_NTP@
 LDFLAGS = @LDFLAGS@
 LDFLAGS_NTP = @LDFLAGS_NTP@
@@ -302,6 +303,11 @@
 TIMETRIM_DS = @TIMETRIM_DS@
 TIMETRIM_MS = @TIMETRIM_MS@
 TIMETRIM_NI = @TIMETRIM_NI@
+UPDATE_LEAP_DB = @UPDATE_LEAP_DB@
+UPDATE_LEAP_DL = @UPDATE_LEAP_DL@
+UPDATE_LEAP_DS = @UPDATE_LEAP_DS@
+UPDATE_LEAP_MS = @UPDATE_LEAP_MS@
+UPDATE_LEAP_NI = @UPDATE_LEAP_NI@
 VERSION = @VERSION@
 VER_SUFFIX = @VER_SUFFIX@
 abs_builddir = @abs_builddir@
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/sntp/libopts/m4/libopts.m4 /cur/src/external/bsd/ntp/dist/sntp/libopts/m4/libopts.m4
--- external/bsd/ntp/dist/sntp/libopts/m4/libopts.m4	2014-12-19 12:37:45.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/sntp/libopts/m4/libopts.m4	2015-04-07 19:51:18.000000000 -0700
@@ -216,7 +216,7 @@
   LIBREGEX_LIBS=""
   AC_MSG_CHECKING([whether libregex functions properly])
   AC_CACHE_VAL([libopts_cv_with_libregex],[
-  AC_RUN_IFELSE([@%:@include <stdio.h>
+  AC_RUN_IFELSE([AC_LANG_SOURCE([@%:@include <stdio.h>
 @%:@include <stdlib.h>
 @%:@include <sys/types.h>
 @%:@include REGEX_HEADER
@@ -235,7 +235,7 @@
     fputs( "error: regex -->.<-- did not match\n", stderr );
     return 1;
   }
-  return 0; }],
+  return 0; }])],
     [libopts_cv_with_libregex=yes], [libopts_cv_with_libregex=no],
     [libopts_cv_with_libregex=no]) # end of AC_RUN_IFELSE 
   ]) # end of AC_CACHE_VAL for libopts_cv_with_libregex
@@ -260,12 +260,12 @@
 AC_DEFUN([LIBOPTS_RUN_PATHFIND],[
   AC_MSG_CHECKING([whether pathfind(3) works])
   AC_CACHE_VAL([libopts_cv_run_pathfind],[
-  AC_RUN_IFELSE([@%:@include <string.h>
+  AC_RUN_IFELSE([AC_LANG_SOURCE([@%:@include <string.h>
 @%:@include <stdlib.h>
 int main (int argc, char** argv) {
    char* pz = pathfind( getenv( "PATH" ), "sh", "x" );
    return (pz == 0) ? 1 : 0;
-}],
+}])],
     [libopts_cv_run_pathfind=yes],[libopts_cv_run_pathfind=no],[libopts_cv_run_pathfind=no]
   ) # end of RUN_IFELSE
   ]) # end of AC_CACHE_VAL for libopts_cv_run_pathfind
@@ -303,7 +303,7 @@
 AC_DEFUN([LIBOPTS_RUN_REALPATH],[
   AC_MSG_CHECKING([whether we have a functional realpath(3C)])
   AC_CACHE_VAL([libopts_cv_run_realpath],[
-  AC_RUN_IFELSE([@%:@include <limits.h>
+  AC_RUN_IFELSE([AC_LANG_SOURCE([@%:@include <limits.h>
 @%:@include <stdlib.h>
 int main (int argc, char** argv) {
 @%:@ifndef PATH_MAX
@@ -313,7 +313,7 @@
 @%:@endif
    char *pz = realpath(argv@<:@0@:>@, zPath);
    return (pz == zPath) ? 0 : 1;
-}],
+}])],
     [libopts_cv_run_realpath=yes],[libopts_cv_run_realpath=no],[libopts_cv_run_realpath=no]
   ) # end of RUN_IFELSE
   ]) # end of AC_CACHE_VAL for libopts_cv_run_realpath
@@ -330,7 +330,7 @@
 AC_DEFUN([LIBOPTS_RUN_STRFTIME],[
   AC_MSG_CHECKING([whether strftime() works])
   AC_CACHE_VAL([libopts_cv_run_strftime],[
-  AC_RUN_IFELSE([@%:@include <time.h>
+  AC_RUN_IFELSE([AC_LANG_SOURCE([@%:@include <time.h>
 @%:@include <string.h>
 char t_buf@<:@ 64 @:>@;
 int main() {
@@ -346,7 +346,7 @@
   tm.tm_yday  = 239; /* days since January 1 @<:@0, 365@:>@ */
   tm.tm_isdst =  1;  /* flag for daylight savings time */
   strftime( t_buf, sizeof( t_buf ), "%A %b %d %j", &tm );
-  return (strcmp( t_buf, z ) != 0); }],
+  return (strcmp( t_buf, z ) != 0); }])],
     [libopts_cv_run_strftime=yes],[libopts_cv_run_strftime=no],[libopts_cv_run_strftime=no]
   ) # end of RUN_IFELSE
   ]) # end of AC_CACHE_VAL for libopts_cv_run_strftime
@@ -363,10 +363,10 @@
 AC_DEFUN([LIBOPTS_RUN_FOPEN_BINARY],[
   AC_MSG_CHECKING([whether fopen accepts "b" mode])
   AC_CACHE_VAL([libopts_cv_run_fopen_binary],[
-  AC_RUN_IFELSE([@%:@include <stdio.h>
+  AC_RUN_IFELSE([AC_LANG_SOURCE([@%:@include <stdio.h>
 int main (int argc, char** argv) {
 FILE* fp = fopen("conftest.@S|@ac_ext", "rb");
-return (fp == NULL) ? 1 : fclose(fp); }],
+return (fp == NULL) ? 1 : fclose(fp); }])],
     [libopts_cv_run_fopen_binary=yes],[libopts_cv_run_fopen_binary=no],[libopts_cv_run_fopen_binary=no]
   ) # end of RUN_IFELSE
   ]) # end of AC_CACHE_VAL for libopts_cv_run_fopen_binary
@@ -386,10 +386,10 @@
 AC_DEFUN([LIBOPTS_RUN_FOPEN_TEXT],[
   AC_MSG_CHECKING([whether fopen accepts "t" mode])
   AC_CACHE_VAL([libopts_cv_run_fopen_text],[
-  AC_RUN_IFELSE([@%:@include <stdio.h>
+  AC_RUN_IFELSE([AC_LANG_SOURCE([@%:@include <stdio.h>
 int main (int argc, char** argv) {
 FILE* fp = fopen("conftest.@S|@ac_ext", "rt");
-return (fp == NULL) ? 1 : fclose(fp); }],
+return (fp == NULL) ? 1 : fclose(fp); }])],
     [libopts_cv_run_fopen_text=yes],[libopts_cv_run_fopen_text=no],[libopts_cv_run_fopen_text=no]
   ) # end of RUN_IFELSE
   ]) # end of AC_CACHE_VAL for libopts_cv_run_fopen_text
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/sntp/libopts/usage.c /cur/src/external/bsd/ntp/dist/sntp/libopts/usage.c
--- external/bsd/ntp/dist/sntp/libopts/usage.c	2014-12-24 18:28:17.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/sntp/libopts/usage.c	2015-04-07 19:51:18.000000000 -0700
@@ -437,7 +437,7 @@
     else {
         char const * t = optionQuoteString(text, LINE_SPLICE);
         fprintf(fp, PUTS_FMT, t);
-        AGFREE((void *)(intptr_t)t);
+        AGFREE(t);
     }
 }
  
@@ -548,7 +548,7 @@
             buf = scan;
         }
     }
-    AGFREE((void *)(intptr_t)text);
+    AGFREE(text);
 }
 
 /*=export_func  optionUsage
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/sntp/loc/darwin /cur/src/external/bsd/ntp/dist/sntp/loc/darwin
--- external/bsd/ntp/dist/sntp/loc/darwin	2014-12-19 12:37:45.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/sntp/loc/darwin	2015-04-07 19:51:18.000000000 -0700
@@ -12,3 +12,4 @@
 ntptime,sbin,8
 ntptrace,sbin,8
 sntp,bin,8
+update-leap,sbin,8
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/sntp/loc/debian /cur/src/external/bsd/ntp/dist/sntp/loc/debian
--- external/bsd/ntp/dist/sntp/loc/debian	2014-12-19 12:37:45.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/sntp/loc/debian	2015-04-07 19:51:18.000000000 -0700
@@ -15,3 +15,4 @@
 sntp,bin,1
 tickadj,sbin,8
 timetrim,sbin,8
+update-leap,sbin,8
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/sntp/loc/freebsd /cur/src/external/bsd/ntp/dist/sntp/loc/freebsd
--- external/bsd/ntp/dist/sntp/loc/freebsd	2014-12-19 12:37:45.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/sntp/loc/freebsd	2015-04-07 19:51:18.000000000 -0700
@@ -12,3 +12,4 @@
 ntpsweep,noinst,8
 ntptrace,sbin,8
 sntp,sbin,8
+update-leap,sbin,8
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/sntp/loc/legacy /cur/src/external/bsd/ntp/dist/sntp/loc/legacy
--- external/bsd/ntp/dist/sntp/loc/legacy	2014-12-19 12:37:45.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/sntp/loc/legacy	2015-04-07 19:51:18.000000000 -0700
@@ -15,3 +15,4 @@
 sntp,bin,1
 tickadj,bin,1
 timetrim,bin,1
+update-leap,bin,1
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/sntp/loc/netbsd /cur/src/external/bsd/ntp/dist/sntp/loc/netbsd
--- external/bsd/ntp/dist/sntp/loc/netbsd	2014-12-19 12:37:45.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/sntp/loc/netbsd	2015-04-07 19:51:18.000000000 -0700
@@ -11,4 +11,5 @@
 ntpsweep,noinst,8
 ntptime,sbin,8
 ntptrace,sbin,8
-sntp,bin,1
+sntp,sbin,1
+update-leap,sbin,8
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/sntp/loc/solaris /cur/src/external/bsd/ntp/dist/sntp/loc/solaris
--- external/bsd/ntp/dist/sntp/loc/solaris	2014-12-19 12:37:45.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/sntp/loc/solaris	2015-04-07 19:51:18.000000000 -0700
@@ -14,3 +14,4 @@
 ntptrace,sbin,1m
 sntp,sbin,1m
 tickadj,sbin,1m
+update-leap,sbin,1m
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/sntp/m4/ax_c99_struct_init.m4 /cur/src/external/bsd/ntp/dist/sntp/m4/ax_c99_struct_init.m4
--- external/bsd/ntp/dist/sntp/m4/ax_c99_struct_init.m4	1969-12-31 16:00:00.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/sntp/m4/ax_c99_struct_init.m4	2015-04-07 09:49:13.000000000 -0700
@@ -0,0 +1,59 @@
+# ===========================================================================
+#       http://www.gnu.org/software/autoconf-archive/ax_c99_struct_init.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+#   AX_C99_STRUCT_INIT
+#
+# DESCRIPTION
+#
+#   This macro defines MISSING_C99_STRUCT_INIT if the C compiler does not
+#   supports the C99 tagged structure initialization.
+#
+#   Given: struct foo_s {int i1; int i2; int i3;};
+#   one can write:
+#	#if !define(MISSING_C99_STRUCT_INIT)
+#	# define FOO_INIT(a, b, c) { .i1 = a, .i2 = b, .i3 = c }
+#	#else
+#	# define FOO_INIT(a, b, c) { a, b, c }
+#
+#	static struct foo_s foo[] = {
+#		FOO_INIT(1, 1, 1),
+#		FOO_INIT(2, 2, 2),
+#		FOO_INIT(0, 0, 0)
+#	};
+#
+# LICENSE
+#
+#   Copyright (c) 2015 Network Time Foundation
+#
+#   Author: Harlan Stenn <stenn@nwtime.org>
+#
+#   Copying and distribution of this file, with or without modification, are
+#   permitted in any medium without royalty provided the copyright notice
+#   and this notice are preserved. This file is offered as-is, without any
+#   warranty.
+
+#serial 1
+
+AC_DEFUN([AX_C99_STRUCT_INIT], [
+	AC_MSG_CHECKING([whether the compiler supports C99 structure initialization])
+	AC_REQUIRE([AC_PROG_CC_C99])
+
+	AC_LANG_PUSH([C])
+
+	dnl AC_LINK_IFELSE?
+	AC_COMPILE_IFELSE(
+		[AC_LANG_SOURCE([[
+			struct foo_s {int i1; int i2;};
+			int main() { struct foo_s foo[] = { { .i1 = 1, .i2 = 1 }, { .i1 = 2, .i2 = 2 }, { .i1 = 0, .i2 = 0 } }; }
+			]])],
+		AC_MSG_RESULT([yes]),
+		AC_MSG_RESULT([no])
+		AC_DEFINE([MISSING_C99_STRUCT_INIT], [1],
+			[Define to 1 if the compiler does not support C99's structure initialization.]),
+		)
+
+	AC_LANG_POP([C])
+	]);
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/sntp/m4/hms_search_lib.m4 /cur/src/external/bsd/ntp/dist/sntp/m4/hms_search_lib.m4
--- external/bsd/ntp/dist/sntp/m4/hms_search_lib.m4	2013-12-27 15:31:34.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/sntp/m4/hms_search_lib.m4	2015-04-07 19:51:18.000000000 -0700
@@ -25,6 +25,6 @@
  no) ;;
  *) $1[]="$ac_cv_search_$2[] $[]$1" ;;
  esac
- [$4]],
- [$5],
+ $4],
+ $5,
  [$6])])
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/sntp/m4/ntp_compiler.m4 /cur/src/external/bsd/ntp/dist/sntp/m4/ntp_compiler.m4
--- external/bsd/ntp/dist/sntp/m4/ntp_compiler.m4	2013-12-27 15:31:34.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/sntp/m4/ntp_compiler.m4	2015-04-07 19:51:18.000000000 -0700
@@ -2,6 +2,7 @@
 dnl Common m4sh code for compiler stuff
 AC_DEFUN([NTP_COMPILER], [
 AC_REQUIRE([AC_PROG_CC_C89])
+AC_REQUIRE([AC_PROG_CC_C99])
 
 CFLAGS_NTP=
 CPPFLAGS_NTP=
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/sntp/m4/ntp_libevent.m4 /cur/src/external/bsd/ntp/dist/sntp/m4/ntp_libevent.m4
--- external/bsd/ntp/dist/sntp/m4/ntp_libevent.m4	2014-12-19 12:37:48.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/sntp/m4/ntp_libevent.m4	2015-04-07 19:51:18.000000000 -0700
@@ -1,4 +1,25 @@
-dnl NTP_ENABLE_LOCAL_LIBEVENT				     -*- Autoconf -*-
+# SYNOPSIS						-*- Autoconf -*-
+#
+#  NTP_ENABLE_LOCAL_LIBEVENT
+#  NTP_LIBEVENT_CHECK([MINVERSION [, DIR]])
+#  NTP_LIBEVENT_CHECK_NOBUILD([MINVERSION [, DIR]])
+#
+# DESCRIPTION
+#
+# AUTHOR
+#
+#  Harlan Stenn
+#
+# LICENSE
+#
+#  This file is Copyright (c) 2014 Network Time Foundation
+# 
+#  Copying and distribution of this file, with or without modification, are
+#  permitted in any medium without royalty provided the copyright notice,
+#  author attribution and this notice are preserved.  This file is offered
+#  as-is, without any warranty.
+
+dnl NTP_ENABLE_LOCAL_LIBEVENT
 dnl
 dnl Provide only the --enable-local-libevent command-line option.
 dnl
@@ -29,7 +50,7 @@
 dnl but DO NOT invoke DIR/configure if we are going to use our bundled
 dnl version.  This may be the case for nested packages.
 dnl
-dnl provide --enable-local-libevent .
+dnl provides: --enable-local-libevent 
 dnl
 dnl Examples:
 dnl
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/sntp/m4/ntp_libntp.m4 /cur/src/external/bsd/ntp/dist/sntp/m4/ntp_libntp.m4
--- external/bsd/ntp/dist/sntp/m4/ntp_libntp.m4	2014-12-19 12:37:48.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/sntp/m4/ntp_libntp.m4	2015-04-07 19:51:18.000000000 -0700
@@ -78,6 +78,12 @@
 
 AC_CHECK_FUNCS([getclock stime timegm strlcpy strlcat])
 
+# Bug 2713
+LDADD_LIBUTIL=
+AC_SUBST([LDADD_LIBUTIL])
+HMS_SEARCH_LIBS([LDADD_LIBUTIL], [snprintb], [util],
+		[AC_DEFINE([USE_SNPRINTB], 1, [OK to use snprintb()?])])
+
 dnl  HP-UX 11.31 on HPPA has a net/if.h that can't be compiled with gcc4
 dnl  due to an incomplete type (a union) mpinfou used in an array.  gcc3
 dnl  compiles it without complaint.  The mpinfou union is defined later
@@ -872,13 +878,13 @@
     [for SIGIO],
     [ntp_cv_hdr_def_sigio],
     [AC_PREPROC_IFELSE(
-	[
+	[AC_LANG_SOURCE([
 	    #include <signal.h>
 
 	    #ifndef SIGIO
 	    # error
 	    #endif
-	],
+	])],
 	[ntp_cv_hdr_def_sigio=yes],
 	[ntp_cv_hdr_def_sigio=no]
     )]
@@ -941,13 +947,13 @@
     [for SIGPOLL],
     [ntp_cv_hdr_def_sigpoll],
     [AC_PREPROC_IFELSE(
-	[
+	[AC_LANG_SOURCE([
 	    #include <signal.h>
 	    
 	    #ifndef SIGPOLL
 	    # error
 	    #endif
-	],
+	])],
 	[ntp_cv_hdr_def_sigpoll=yes],
 	[ntp_cv_hdr_def_sigpoll=no]
     )]
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/sntp/m4/ntp_locinfo.m4 /cur/src/external/bsd/ntp/dist/sntp/m4/ntp_locinfo.m4
--- external/bsd/ntp/dist/sntp/m4/ntp_locinfo.m4	2014-12-19 12:37:48.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/sntp/m4/ntp_locinfo.m4	2015-04-07 19:51:18.000000000 -0700
@@ -124,6 +124,12 @@
 AC_SUBST([TIMETRIM_DS])
 AC_SUBST([TIMETRIM_MS])
 AC_SUBST([TIMETRIM_NI])
+AC_SUBST([UPDATE_LEAP_DB])
+AC_SUBST([UPDATE_LEAP_DL])
+AC_SUBST([UPDATE_LEAP_DS])
+AC_SUBST([UPDATE_LEAP_MS])
+AC_SUBST([UPDATE_LEAP_NI])
+AM_CONDITIONAL([INSTALL_UPDATE_LEAP], [test -z "$UPDATE_LEAP_NI" ])
 
 ])dnl
 dnl ======================================================================
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/sntp/m4/openldap-thread-check.m4 /cur/src/external/bsd/ntp/dist/sntp/m4/openldap-thread-check.m4
--- external/bsd/ntp/dist/sntp/m4/openldap-thread-check.m4	1969-12-31 16:00:00.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/sntp/m4/openldap-thread-check.m4	2015-04-07 09:49:13.000000000 -0700
@@ -0,0 +1,683 @@
+dnl OpenLDAP Autoconf thread check
+dnl
+dnl This work is part of OpenLDAP Software <http://www.openldap.org/>.
+dnl
+dnl Copyright 1998-2010 The OpenLDAP Foundation.
+dnl All rights reserved.
+dnl
+dnl Redistribution and use in source and binary forms, with or without
+dnl modification, are permitted only as authorized by the OpenLDAP
+dnl Public License.
+dnl
+dnl A copy of this license is available in the file LICENSE-OPENLDAP in
+dnl this directory of the distribution or, alternatively, at
+dnl <http://www.OpenLDAP.org/license.html>.
+dnl
+dnl --------------------------------------------------------------------
+
+#   OL_THREAD_CHECK([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
+
+AC_DEFUN([OL_THREAD_CHECK], [
+AC_REQUIRE([AC_CANONICAL_HOST])
+AC_LANG_SAVE
+AC_LANG([C])
+OL_ARG_WITH(threads,[  --with-threads	  with threads],
+	auto, [auto nt posix mach pth lwp yes no manual] )
+
+case "$ol_with_threads$host" in
+ auto*-*-solaris2.[[0-6]])
+    dnl signals sometimes delivered to wrong thread with Solaris 2.6
+    ol_with_threads=no
+    ;;
+esac
+
+dnl AIX Thread requires we use cc_r or xlc_r.
+dnl But only do this IF AIX and CC is not set
+dnl and threads are auto|yes|posix.
+dnl
+dnl If we find cc_r|xlc_r, force pthreads and assume
+dnl		pthread_create is in $LIBS (ie: don't bring in
+dnl		any additional thread libraries)
+dnl If we do not find cc_r|xlc_r, disable threads
+
+ol_aix_threads=no
+case "$host" in
+*-*-aix*) dnl all AIX is not a good idea.
+	if test -z "$CC" ; then
+		case "$ol_with_threads" in
+		auto | yes |  posix) ol_aix_threads=yes ;;
+		esac
+	fi
+;;
+esac
+
+if test $ol_aix_threads = yes ; then
+	if test -z "${CC}" ; then
+		AC_CHECK_PROGS(CC,cc_r xlc_r cc)
+
+		if test "$CC" = cc ; then
+			dnl no CC! don't allow --with-threads
+			if test $ol_with_threads != auto ; then
+				AC_MSG_ERROR([--with-threads requires cc_r (or other suitable compiler) on AIX])
+			else
+				AC_MSG_WARN([disabling threads, no cc_r on AIX])
+			fi
+			ol_with_threads=no
+  		fi
+	fi
+
+	case ${CC} in cc_r | xlc_r)
+		ol_with_threads=posix
+		ol_cv_pthread_create=yes
+		;;
+	esac
+fi
+
+dnl ----------------------------------------------------------------
+dnl Threads?
+ol_link_threads=no
+dnl ol_with_yielding_select=${ol_with_yielding_select:-auto}
+OL_ARG_WITH(yielding_select,[  --with-yielding-select  with yielding select],
+	auto, [auto yes no manual] )
+
+case $ol_with_threads in auto | yes | nt)
+
+	OL_NT_THREADS
+
+	if test "$ol_cv_nt_threads" = yes ; then
+		ol_link_threads=nt
+		ol_with_threads=found
+		ol_with_yielding_select=yes
+
+		AC_DEFINE([HAVE_NT_SERVICE_MANAGER], [1], [if you have NT Service Manager])
+		AC_DEFINE([HAVE_NT_EVENT_LOG], [1], [if you have NT Event Log])
+	fi
+
+	if test $ol_with_threads = nt ; then
+		AC_MSG_ERROR([could not locate NT Threads])
+	fi
+	;;
+esac
+
+case $ol_with_threads in auto | yes | posix)
+
+	AC_CHECK_HEADERS(pthread.h)
+
+	if test $ac_cv_header_pthread_h = yes ; then
+		OL_POSIX_THREAD_VERSION
+
+		if test $ol_cv_pthread_version != 0 ; then
+			AC_DEFINE_UNQUOTED([HAVE_PTHREADS], [$ol_cv_pthread_version],
+				[define to pthreads API spec revision])
+		else
+			AC_MSG_ERROR([unknown pthread version])
+		fi
+
+		# consider threads found
+		ol_with_threads=found
+
+		OL_HEADER_LINUX_THREADS
+		OL_HEADER_GNU_PTH_PTHREAD_H
+
+		if test $ol_cv_header_gnu_pth_pthread_h = no ; then
+			AC_CHECK_HEADERS(sched.h)
+		fi
+
+		dnl Now the hard part, how to link?
+		dnl
+		dnl currently supported checks:
+		dnl
+		dnl Check for no flags 
+		dnl 	pthread_create() in $LIBS
+		dnl
+		dnl Check special pthread (final) flags
+		dnl 	[skipped] pthread_create() with -mt (Solaris) [disabled]
+		dnl 	pthread_create() with -kthread (FreeBSD)
+		dnl 	pthread_create() with -pthread (FreeBSD/Digital Unix)
+		dnl 	pthread_create() with -pthreads (?)
+		dnl 	pthread_create() with -mthreads (AIX)
+		dnl 	pthread_create() with -thread (?)
+		dnl
+		dnl Check pthread (final) libraries
+		dnl 	pthread_mutex_unlock() in -lpthread -lmach -lexc -lc_r (OSF/1)
+		dnl 	pthread_mutex_lock() in -lpthread -lmach -lexc (OSF/1)
+		dnl 	[skipped] pthread_mutex_trylock() in -lpthread -lexc (OSF/1)
+		dnl 	pthread_join() -Wl,-woff,85 -lpthread (IRIX)
+		dnl 	pthread_create() in -lpthread (many)
+		dnl 	pthread_create() in -lc_r (FreeBSD)
+		dnl
+		dnl Check pthread (draft4) flags (depreciated)
+		dnl 	pthread_create() with -threads (OSF/1)
+		dnl
+		dnl Check pthread (draft4) libraries (depreciated)
+		dnl 	pthread_mutex_unlock() in -lpthreads -lmach -lexc -lc_r (OSF/1)
+		dnl 	pthread_mutex_lock() in -lpthreads -lmach -lexc (OSF/1)
+		dnl 	pthread_mutex_trylock() in -lpthreads -lexc (OSF/1)
+		dnl 	pthread_create() in -lpthreads (many)
+		dnl
+
+		dnl pthread_create in $LIBS
+		AC_CACHE_CHECK([for pthread_create in default libraries],
+			ol_cv_pthread_create,[
+			AC_RUN_IFELSE([OL_PTHREAD_TEST_PROGRAM],
+				[ol_cv_pthread_create=yes],
+				[ol_cv_pthread_create=no],
+				[AC_TRY_LINK(OL_PTHREAD_TEST_INCLUDES,OL_PTHREAD_TEST_FUNCTION,
+					[ol_cv_pthread_create=yes],
+					[ol_cv_pthread_create=no])])])
+
+		if test $ol_cv_pthread_create != no ; then
+			ol_link_threads=posix
+			ol_link_pthreads=""
+		fi
+		
+dnl		OL_PTHREAD_TRY([-mt],		[ol_cv_pthread_mt])
+		OL_PTHREAD_TRY([-kthread],	[ol_cv_pthread_kthread])
+		OL_PTHREAD_TRY([-pthread],	[ol_cv_pthread_pthread])
+		OL_PTHREAD_TRY([-pthreads],	[ol_cv_pthread_pthreads])
+		OL_PTHREAD_TRY([-mthreads],	[ol_cv_pthread_mthreads])
+		OL_PTHREAD_TRY([-thread],	[ol_cv_pthread_thread])
+
+		OL_PTHREAD_TRY([-lpthread -lmach -lexc -lc_r],
+			[ol_cv_pthread_lpthread_lmach_lexc_lc_r])
+		OL_PTHREAD_TRY([-lpthread -lmach -lexc],
+			[ol_cv_pthread_lpthread_lmach_lexc])
+dnl		OL_PTHREAD_TRY([-lpthread -lexc],
+dnl			[ol_cv_pthread_lpthread_lexc])
+
+		OL_PTHREAD_TRY([-lpthread -Wl,-woff,85],
+			[ol_cv_pthread_lib_lpthread_woff])
+
+		OL_PTHREAD_TRY([-lpthread],	[ol_cv_pthread_lpthread])
+		OL_PTHREAD_TRY([-lc_r],		[ol_cv_pthread_lc_r])
+
+		OL_PTHREAD_TRY([-threads],	[ol_cv_pthread_threads])
+
+		OL_PTHREAD_TRY([-lpthreads -lmach -lexc -lc_r],
+			[ol_cv_pthread_lpthreads_lmach_lexc_lc_r])
+		OL_PTHREAD_TRY([-lpthreads -lmach -lexc],
+			[ol_cv_pthread_lpthreads_lmach_lexc])
+		OL_PTHREAD_TRY([-lpthreads -lexc],
+			[ol_cv_pthread_lpthreads_lexc])
+
+		OL_PTHREAD_TRY([-lpthreads],[ol_cv_pthread_lib_lpthreads])
+
+		if test $ol_link_threads != no ; then
+			LTHREAD_LIBS="$LTHREAD_LIBS $ol_link_pthreads"
+
+			dnl save flags
+			save_CPPFLAGS="$CPPFLAGS"
+			save_LIBS="$LIBS"
+			LIBS="$LTHREAD_LIBS $LIBS"
+
+			dnl All POSIX Thread (final) implementations should have
+			dnl sched_yield instead of pthread yield.
+			dnl check for both, and thr_yield for Solaris
+			AC_CHECK_FUNCS(sched_yield pthread_yield thr_yield)
+
+			if test $ac_cv_func_sched_yield = no &&
+			   test $ac_cv_func_pthread_yield = no &&
+			   test $ac_cv_func_thr_yield = no ; then
+				dnl Digital UNIX has sched_yield() in -lrt
+				AC_CHECK_LIB(rt, sched_yield,
+					[LTHREAD_LIBS="$LTHREAD_LIBS -lrt"
+					AC_DEFINE([HAVE_SCHED_YIELD], [1],
+						[Define if you have the sched_yield function.])
+					ac_cv_func_sched_yield=yes],
+					[ac_cv_func_sched_yield=no])
+			fi
+			if test $ac_cv_func_sched_yield = no &&
+			   test $ac_cv_func_pthread_yield = no &&
+			   test "$ac_cv_func_thr_yield" = no ; then
+				AC_MSG_WARN([could not locate sched_yield() or pthread_yield()])
+			fi
+
+			dnl Check functions for compatibility
+			AC_CHECK_FUNCS(pthread_kill)
+
+			dnl Check for pthread_rwlock_destroy with <pthread.h>
+			dnl as pthread_rwlock_t may not be defined.
+			AC_CACHE_CHECK([for pthread_rwlock_destroy with <pthread.h>],
+				[ol_cv_func_pthread_rwlock_destroy], [
+				dnl save the flags
+				AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+#include <pthread.h>
+pthread_rwlock_t rwlock;
+]], [[pthread_rwlock_destroy(&rwlock);]])],[ol_cv_func_pthread_rwlock_destroy=yes],[ol_cv_func_pthread_rwlock_destroy=no])
+			])
+			if test $ol_cv_func_pthread_rwlock_destroy = yes ; then
+				AC_DEFINE([HAVE_PTHREAD_RWLOCK_DESTROY], [1],
+					[define if you have pthread_rwlock_destroy function])
+			fi
+
+			dnl Check for pthread_detach with <pthread.h> inclusion
+			dnl as it's symbol may have been mangled.
+			AC_CACHE_CHECK([for pthread_detach with <pthread.h>],
+				[ol_cv_func_pthread_detach], [
+				dnl save the flags
+				AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+#include <pthread.h>
+#ifndef NULL
+#define NULL (void*)0
+#endif
+]], [[pthread_detach(NULL);]])],[ol_cv_func_pthread_detach=yes],[ol_cv_func_pthread_detach=no])
+			])
+
+			if test $ol_cv_func_pthread_detach = no ; then
+				AC_MSG_ERROR([could not locate pthread_detach()])
+			fi
+
+			AC_DEFINE([HAVE_PTHREAD_DETACH], [1],
+				[define if you have pthread_detach function])
+
+			dnl Check for setconcurreny functions
+			AC_CHECK_FUNCS(	\
+				pthread_setconcurrency \
+				pthread_getconcurrency \
+				thr_setconcurrency \
+				thr_getconcurrency \
+			)
+
+			OL_SYS_LINUX_THREADS
+			OL_LINUX_THREADS
+
+			if test $ol_cv_linux_threads = error; then
+				AC_MSG_ERROR([LinuxThreads header/library mismatch]);
+			fi
+
+			AC_CACHE_CHECK([if pthread_create() works],
+				ol_cv_pthread_create_works,[
+			AC_RUN_IFELSE([OL_PTHREAD_TEST_PROGRAM],
+				[ol_cv_pthread_create_works=yes],
+				[ol_cv_pthread_create_works=no],
+				[dnl assume yes
+				ol_cv_pthread_create_works=yes])])
+
+			if test $ol_cv_pthread_create_works = no ; then
+				AC_MSG_ERROR([pthread_create is not usable, check environment settings])
+			fi
+
+			ol_replace_broken_yield=no
+dnl			case "$host" in
+dnl			*-*-linux*) 
+dnl				AC_CHECK_FUNCS(nanosleep)
+dnl				ol_replace_broken_yield=yes
+dnl			;;
+dnl			esac
+
+			if test $ol_replace_broken_yield = yes ; then
+				AC_DEFINE([REPLACE_BROKEN_YIELD], [1],
+					[define if sched_yield yields the entire process])
+			fi
+
+			dnl Check if select causes an yield
+			if test x$ol_with_yielding_select = xauto ; then
+				AC_CACHE_CHECK([if select yields when using pthreads],
+					ol_cv_pthread_select_yields,[
+				AC_RUN_IFELSE([AC_LANG_SOURCE([[
+#include <sys/types.h>
+#include <sys/time.h>
+#include <unistd.h>
+#include <pthread.h>
+#ifndef NULL
+#define NULL (void*) 0
+#endif
+
+static int fildes[2];
+
+static void *task(p)
+	void *p;
+{
+	int i;
+	struct timeval tv;
+
+	fd_set rfds;
+
+	tv.tv_sec=10;
+	tv.tv_usec=0;
+
+	FD_ZERO(&rfds);
+	FD_SET(fildes[0], &rfds);
+
+	/* we're not interested in any fds */
+	i = select(FD_SETSIZE, &rfds, NULL, NULL, &tv);
+
+	if(i < 0) {
+		perror("select");
+		exit(10);
+	}
+
+	exit(0); /* if we exit here, the select blocked the whole process */
+}
+
+int main(argc, argv)
+	int argc;
+	char **argv;
+{
+	pthread_t t;
+
+	/* create a pipe to select */
+	if(pipe(&fildes[0])) {
+		perror("select");
+		exit(1);
+	}
+
+#ifdef HAVE_PTHREAD_SETCONCURRENCY
+	(void) pthread_setconcurrency(2);
+#else
+#ifdef HAVE_THR_SETCONCURRENCY
+	/* Set Solaris LWP concurrency to 2 */
+	thr_setconcurrency(2);
+#endif
+#endif
+
+#if HAVE_PTHREADS < 6
+	pthread_create(&t, pthread_attr_default, task, NULL);
+#else
+	pthread_create(&t, NULL, task, NULL);
+#endif
+
+	/* make sure task runs first */
+#ifdef HAVE_THR_YIELD
+	thr_yield();
+#elif defined( HAVE_SCHED_YIELD )
+	sched_yield();
+#elif defined( HAVE_PTHREAD_YIELD )
+	pthread_yield();
+#endif
+
+	exit(2);
+}]])],[ol_cv_pthread_select_yields=no],[ol_cv_pthread_select_yields=yes],[ol_cv_pthread_select_yields=cross])])
+
+				if test $ol_cv_pthread_select_yields = cross ; then
+					AC_MSG_ERROR([crossing compiling: use --with-yielding-select=yes|no|manual])
+				fi
+
+				if test $ol_cv_pthread_select_yields = yes ; then
+					ol_with_yielding_select=yes
+				fi
+			fi
+
+			dnl restore flags
+			CPPFLAGS="$save_CPPFLAGS"
+			LIBS="$save_LIBS"
+		else
+			AC_MSG_ERROR([could not locate usable POSIX Threads])
+		fi
+	fi
+
+	if test $ol_with_threads = posix ; then
+		AC_MSG_ERROR([could not locate POSIX Threads])
+	fi
+	;;
+esac
+
+case $ol_with_threads in auto | yes | mach)
+
+	dnl check for Mach CThreads
+	AC_CHECK_HEADERS(mach/cthreads.h cthreads.h)
+	if test $ac_cv_header_mach_cthreads_h = yes ; then
+		ol_with_threads=found
+
+		dnl check for cthreads support in current $LIBS
+		AC_CHECK_FUNC(cthread_fork,[ol_link_threads=yes])
+
+		if test $ol_link_threads = no ; then
+			dnl try -all_load
+			dnl this test needs work
+			AC_CACHE_CHECK([for cthread_fork with -all_load],
+				[ol_cv_cthread_all_load], [
+				dnl save the flags
+				save_LIBS="$LIBS"
+				LIBS="-all_load $LIBS"
+				AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <mach/cthreads.h>]], [[
+					cthread_fork((void *)0, (void *)0);
+					]])],[ol_cv_cthread_all_load=yes],[ol_cv_cthread_all_load=no])
+				dnl restore the LIBS
+				LIBS="$save_LIBS"
+			])
+
+			if test $ol_cv_cthread_all_load = yes ; then
+				LTHREAD_LIBS="$LTHREAD_LIBS -all_load"
+				ol_link_threads=mach
+				ol_with_threads=found
+			fi
+		fi
+
+	elif test $ac_cv_header_cthreads_h = yes ; then
+		dnl Hurd variant of Mach Cthreads
+		dnl uses <cthreads.h> and -lthreads
+
+		ol_with_threads=found
+ 
+		dnl save the flags
+		save_LIBS="$LIBS"
+		LIBS="$LIBS -lthreads"
+		AC_CHECK_FUNC(cthread_fork,[ol_link_threads=yes])
+		LIBS="$save_LIBS"
+
+		if test $ol_link_threads = yes ; then
+			LTHREAD_LIBS="-lthreads"
+			ol_link_threads=mach
+			ol_with_threads=found
+		else
+			AC_MSG_ERROR([could not link with Mach CThreads])
+		fi
+
+	elif test $ol_with_threads = mach ; then
+		AC_MSG_ERROR([could not locate Mach CThreads])
+	fi
+
+	if test $ol_link_threads = mach ; then
+		AC_DEFINE([HAVE_MACH_CTHREADS], [1],
+			[define if you have Mach Cthreads])
+	elif test $ol_with_threads = found ; then
+		AC_MSG_ERROR([could not link with Mach CThreads])
+	fi
+	;;
+esac
+
+case $ol_with_threads in auto | yes | pth)
+
+	AC_CHECK_HEADERS(pth.h)
+
+	if test $ac_cv_header_pth_h = yes ; then
+		AC_CHECK_LIB(pth, pth_version, [have_pth=yes], [have_pth=no])
+
+		if test $have_pth = yes ; then
+			AC_DEFINE([HAVE_GNU_PTH], [1], [if you have GNU Pth])
+			LTHREAD_LIBS="$LTHREAD_LIBS -lpth"
+			ol_link_threads=pth
+			ol_with_threads=found
+
+			if test x$ol_with_yielding_select = xauto ; then
+				ol_with_yielding_select=yes
+			fi
+		fi
+	fi
+	;;
+esac
+
+case $ol_with_threads in auto | yes | lwp)
+
+	dnl check for SunOS5 LWP
+	AC_CHECK_HEADERS(thread.h synch.h)
+	if test $ac_cv_header_thread_h = yes &&
+	   test $ac_cv_header_synch_h = yes ; then
+		AC_CHECK_LIB(thread, thr_create, [have_thr=yes], [have_thr=no])
+
+		if test $have_thr = yes ; then
+			AC_DEFINE([HAVE_THR], [1],
+				[if you have Solaris LWP (thr) package])
+			LTHREAD_LIBS="$LTHREAD_LIBS -lthread"
+			ol_link_threads=thr
+
+			if test x$ol_with_yielding_select = xauto ; then
+				ol_with_yielding_select=yes
+			fi
+
+			dnl Check for setconcurrency functions
+			AC_CHECK_FUNCS(	\
+				thr_setconcurrency \
+				thr_getconcurrency \
+			)
+		fi
+	fi
+
+	dnl check for SunOS4 LWP
+	AC_CHECK_HEADERS(lwp/lwp.h)
+	if test $ac_cv_header_lwp_lwp_h = yes ; then
+		AC_CHECK_LIB(lwp, lwp_create, [have_lwp=yes], [have_lwp=no])
+
+		if test $have_lwp = yes ; then
+			AC_DEFINE([HAVE_LWP], [1],
+				[if you have SunOS LWP package])
+			LTHREAD_LIBS="$LTHREAD_LIBS -llwp"
+			ol_link_threads=lwp
+
+			if test x$ol_with_yielding_select = xauto ; then
+				ol_with_yielding_select=no
+			fi
+		fi
+	fi
+	;;
+esac
+
+if test $ol_with_yielding_select = yes ; then
+	AC_DEFINE([HAVE_YIELDING_SELECT], [1],
+		[define if select implicitly yields])
+fi
+
+if test $ol_with_threads = manual ; then
+	dnl User thinks he can manually configure threads.
+	ol_link_threads=yes
+
+	AC_MSG_WARN([thread defines and link options must be set manually])
+
+	AC_CHECK_HEADERS(pthread.h sched.h)
+	AC_CHECK_FUNCS(sched_yield pthread_yield)
+	OL_HEADER_LINUX_THREADS
+
+	AC_CHECK_HEADERS(mach/cthreads.h)
+	AC_CHECK_HEADERS(lwp/lwp.h)
+	AC_CHECK_HEADERS(thread.h synch.h)
+fi
+
+if test $ol_link_threads != no && test $ol_link_threads != nt ; then
+	dnl needed to get reentrant/threadsafe versions
+	dnl
+	AC_DEFINE([REENTRANT], [1], [enable thread safety])
+	AC_DEFINE([_REENTRANT], [1], [enable thread safety])
+	AC_DEFINE([THREAD_SAFE], [1], [enable thread safety])
+	AC_DEFINE([_THREAD_SAFE], [1], [enable thread safety])
+	AC_DEFINE([THREADSAFE], [1], [enable thread safety])
+	AC_DEFINE([_THREADSAFE], [1], [enable thread safety])
+	AC_DEFINE([_SGI_MP_SOURCE], [1], [enable thread safety])
+
+	dnl The errno declaration may dependent upon _REENTRANT.
+	dnl If it does, we must link with thread support.
+	AC_CACHE_CHECK([for thread specific errno],
+		[ol_cv_errno_thread_specific], [
+		AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <errno.h>]], [[errno = 0;]])],[ol_cv_errno_thread_specific=yes],[ol_cv_errno_thread_specific=no])
+	])
+
+	dnl The h_errno declaration may dependent upon _REENTRANT.
+	dnl If it does, we must link with thread support.
+	AC_CACHE_CHECK([for thread specific h_errno],
+		[ol_cv_h_errno_thread_specific], [
+		AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <netdb.h>]], [[h_errno = 0;]])],[ol_cv_h_errno_thread_specific=yes],[ol_cv_h_errno_thread_specific=no])
+	])
+
+	if test $ol_cv_errno_thread_specific != yes ||
+	   test $ol_cv_h_errno_thread_specific != yes ; then
+		LIBS="$LTHREAD_LIBS $LIBS"
+		LTHREAD_LIBS=""
+	fi
+
+dnl When in thread environment, use 
+dnl		#if defined( HAVE_REENTRANT_FUNCTIONS ) || defined( HAVE_FUNC_R )
+dnl			func_r(...);
+dnl		#else
+dnl		#	if defined( HAVE_THREADS ) 
+dnl				/* lock */
+dnl		#	endif
+dnl				func(...);
+dnl		#	if defined( HAVE_THREADS ) 
+dnl				/* unlock */
+dnl		#	endif
+dnl		#endif
+dnl
+dnl HAVE_REENTRANT_FUNCTIONS is derived from:
+dnl		_POSIX_REENTRANT_FUNCTIONS
+dnl		_POSIX_THREAD_SAFE_FUNCTIONS
+dnl		_POSIX_THREADSAFE_FUNCTIONS
+dnl
+dnl		and is currently defined in <ldap_pvt_thread.h>
+dnl
+dnl HAVE_THREADS is defined by <ldap_pvt_thread.h> iff -UNO_THREADS
+dnl 
+dnl libldap/*.c should only include <ldap_pvt_thread.h> iff
+dnl LDAP_R_COMPILE is defined.  ie:
+dnl		#ifdef LDAP_R_COMPILE
+dnl		#	include <ldap_pvt_thread.h>
+dnl		#endif
+dnl
+dnl LDAP_R_COMPILE is defined by libldap_r/Makefile.in
+dnl specifically for compiling the threadsafe version of
+dnl	the ldap library (-lldap_r).
+dnl		
+dnl	dnl check for reentrant/threadsafe functions
+dnl	dnl
+dnl	dnl note: these should only be used when linking
+dnl	dnl		with $LTHREAD_LIBS
+dnl	dnl
+dnl	save_CPPFLAGS="$CPPFLAGS"
+dnl	save_LIBS="$LIBS"
+dnl	LIBS="$LTHREAD_LIBS $LIBS"
+dnl	AC_CHECK_FUNCS(	\
+dnl		gmtime_r \
+dnl		gethostbyaddr_r gethostbyname_r \
+dnl		feof_unlocked unlocked_feof \
+dnl		putc_unlocked unlocked_putc \
+dnl		flockfile ftrylockfile \
+dnl	)
+dnl	CPPFLAGS="$save_CPPFLAGS"
+dnl	LIBS="$save_LIBS"
+fi  
+
+if test $ol_link_threads = no ; then
+	if test $ol_with_threads = yes ; then
+		AC_MSG_ERROR([no suitable thread support])
+	fi
+
+	if test $ol_with_threads = auto ; then
+		AC_MSG_WARN([no suitable thread support, disabling threads])
+		ol_with_threads=no
+	fi
+
+	AC_DEFINE([NO_THREADS], [1],
+		[define if you have (or want) no threads])
+	LTHREAD_LIBS=""
+	BUILD_THREAD=no
+else
+	BUILD_THREAD=yes
+fi
+
+if test $ol_link_threads != no ; then
+	AC_DEFINE([LDAP_API_FEATURE_X_OPENLDAP_THREAD_SAFE], [1],
+		[define to 1 if library is thread safe])
+fi
+
+# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
+case "$ol_with_threads" in
+ no)
+    ol_pthread_ok=no
+    $2
+    ;;
+ *)
+    ifelse([$1],,AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.]),[$1])
+    ;;
+esac
+
+AC_LANG_RESTORE
+])
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/sntp/m4/openldap.m4 /cur/src/external/bsd/ntp/dist/sntp/m4/openldap.m4
--- external/bsd/ntp/dist/sntp/m4/openldap.m4	1969-12-31 16:00:00.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/sntp/m4/openldap.m4	2015-04-07 09:49:13.000000000 -0700
@@ -0,0 +1,1131 @@
+dnl OpenLDAP Autoconf Macros
+dnl $OpenLDAP: pkg/ldap/build/openldap.m4,v 1.157.2.10 2010/04/13 20:22:21 kurt Exp $
+dnl This work is part of OpenLDAP Software <http://www.openldap.org/>.
+dnl
+dnl Copyright 1998-2010 The OpenLDAP Foundation.
+dnl All rights reserved.
+dnl
+dnl Redistribution and use in source and binary forms, with or without
+dnl modification, are permitted only as authorized by the OpenLDAP
+dnl Public License.
+dnl
+dnl A copy of this license is available in the file LICENSE-OPENLDAP in
+dnl this directory of the distribution or, alternatively, at
+dnl <http://www.OpenLDAP.org/license.html>.
+dnl
+dnl --------------------------------------------------------------------
+dnl Restricted form of AC_ARG_ENABLE that limits user options
+dnl
+dnl $1 = option name
+dnl $2 = help-string
+dnl $3 = default value	(auto).  "--" means do not set it by default
+dnl $4 = allowed values (auto yes no)
+dnl $5 = overridden default
+AC_DEFUN([OL_ARG_ENABLE], [# OpenLDAP --enable-$1
+	pushdef([ol_DefVal],ifelse($3,,auto,$3))
+	AC_ARG_ENABLE($1,ifelse($4,,[$2],[$2] translit([$4],[ ],[|])) ifelse($3,--,,@<:@ol_DefVal@:>@),[
+	ol_arg=invalid
+	for ol_val in ifelse($4,,[auto yes no],[$4]) ; do
+		if test "$enableval" = "$ol_val" ; then
+			ol_arg="$ol_val"
+		fi
+	done
+	if test "$ol_arg" = "invalid" ; then
+		AC_MSG_ERROR(bad value $enableval for --enable-$1)
+	fi
+	ol_enable_$1="$ol_arg"
+]ifelse($3,--,,[,
+[	ol_enable_$1=ifelse($5,,ol_DefVal,[${]$5[:-]ol_DefVal[}])]]))dnl
+dnl AC_MSG_RESULT([OpenLDAP -enable-$1 $ol_enable_$1])
+	popdef([ol_DefVal])
+# end --enable-$1
+])dnl
+dnl
+dnl --------------------------------------------------------------------
+dnl Restricted form of AC_ARG_WITH that limits user options
+dnl
+dnl $1 = option name
+dnl $2 = help-string
+dnl $3 = default value (no)
+dnl $4 = allowed values (yes or no)
+AC_DEFUN([OL_ARG_WITH], [# OpenLDAP --with-$1
+	AC_ARG_WITH($1,[$2 @<:@]ifelse($3,,yes,$3)@:>@,[
+	ol_arg=invalid
+	for ol_val in ifelse($4,,[yes no],[$4]) ; do
+		if test "$withval" = "$ol_val" ; then
+			ol_arg="$ol_val"
+		fi
+	done
+	if test "$ol_arg" = "invalid" ; then
+		AC_MSG_ERROR(bad value $withval for --with-$1)
+	fi
+	ol_with_$1="$ol_arg"
+],
+[	ol_with_$1=ifelse($3,,"no","$3")])dnl
+dnl AC_MSG_RESULT([OpenLDAP --with-$1 $ol_with_$1])
+# end --with-$1
+])dnl
+dnl ====================================================================
+dnl Check for dependency generation flag
+AC_DEFUN([OL_MKDEPEND], [# test for make depend flag
+OL_MKDEP=
+OL_MKDEP_FLAGS=
+if test -z "${MKDEP}"; then
+	OL_MKDEP="${CC-cc}"
+	if test -z "${MKDEP_FLAGS}"; then
+		AC_CACHE_CHECK([for ${OL_MKDEP} depend flag], ol_cv_mkdep, [
+			ol_cv_mkdep=no
+			for flag in "-M" "-xM"; do
+				cat > conftest.c <<EOF
+ noCode;
+EOF
+				if AC_TRY_COMMAND($OL_MKDEP $flag conftest.c) \
+					| grep '^conftest\.'"${ac_objext}" >/dev/null 2>&1
+				then
+					if test ! -f conftest."${ac_object}" ; then
+						ol_cv_mkdep=$flag
+						OL_MKDEP_FLAGS="$flag"
+						break
+					fi
+				fi
+			done
+			rm -f conftest*
+		])
+		test "$ol_cv_mkdep" = no && OL_MKDEP=":"
+	else
+		cc_cv_mkdep=yes
+		OL_MKDEP_FLAGS="${MKDEP_FLAGS}"
+	fi
+else
+	cc_cv_mkdep=yes
+	OL_MKDEP="${MKDEP}"
+	OL_MKDEP_FLAGS="${MKDEP_FLAGS}"
+fi
+AC_SUBST(OL_MKDEP)
+AC_SUBST(OL_MKDEP_FLAGS)
+])
+dnl
+dnl ====================================================================
+dnl Check if system uses EBCDIC instead of ASCII
+AC_DEFUN([OL_CPP_EBCDIC], [# test for EBCDIC
+AC_CACHE_CHECK([for EBCDIC],ol_cv_cpp_ebcdic,[
+	AC_PREPROC_IFELSE([AC_LANG_SOURCE([[
+#if !('M' == 0xd4)
+#include <__ASCII__/generate_error.h>
+#endif
+]])],[ol_cv_cpp_ebcdic=yes],[ol_cv_cpp_ebcdic=no])])
+if test $ol_cv_cpp_ebcdic = yes ; then
+	AC_DEFINE(HAVE_EBCDIC,1, [define if system uses EBCDIC instead of ASCII])
+fi
+])
+dnl
+dnl --------------------------------------------------------------------
+dnl Check for MSVC
+AC_DEFUN([OL_MSVC],
+[AC_REQUIRE_CPP()dnl
+AC_CACHE_CHECK([whether we are using MS Visual C++], ol_cv_msvc,
+[AC_PREPROC_IFELSE([AC_LANG_SOURCE([[
+#ifndef _MSC_VER
+#include <__FOO__/generate_error.h>
+#endif
+]])],[ol_cv_msvc=yes],[ol_cv_msvc=no])])])
+
+dnl --------------------------------------------------------------------
+dnl OpenLDAP version of STDC header check w/ EBCDIC support
+AC_DEFUN([OL_HEADER_STDC],
+[AC_REQUIRE_CPP()dnl
+AC_REQUIRE([OL_CPP_EBCDIC])dnl
+AC_CACHE_CHECK([for ANSI C header files], ol_cv_header_stdc,
+[AC_PREPROC_IFELSE([AC_LANG_SOURCE([[#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>]])],[ol_cv_header_stdc=yes],[ol_cv_header_stdc=no])
+
+if test $ol_cv_header_stdc = yes; then
+  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+AC_EGREP_HEADER(memchr, string.h, , ol_cv_header_stdc=no)
+fi
+
+if test $ol_cv_header_stdc = yes; then
+  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+AC_EGREP_HEADER(free, stdlib.h, , ol_cv_header_stdc=no)
+fi
+
+if test $ol_cv_header_stdc = yes; then
+  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <ctype.h>
+#ifndef HAVE_EBCDIC
+#	define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+#	define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+#	define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
+		|| ('j' <= (c) && (c) <= 'r') \
+		|| ('s' <= (c) && (c) <= 'z'))
+#	define TOUPPER(c)	(ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int main () { int i; for (i = 0; i < 256; i++)
+if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
+exit (0); }
+]])],[],[ol_cv_header_stdc=no],[:])
+fi])
+if test $ol_cv_header_stdc = yes; then
+  AC_DEFINE([STDC_HEADERS], [1], [is standard C provided?])
+fi
+ac_cv_header_stdc=disable
+])
+dnl
+dnl ====================================================================
+dnl DNS resolver macros
+AC_DEFUN([OL_RESOLVER_TRY],
+[if test $ol_cv_lib_resolver = no ; then
+	AC_CACHE_CHECK([for resolver link (]ifelse($2,,default,$2)[)],[$1],
+[
+	ol_RESOLVER_LIB=ifelse($2,,,$2)
+	ol_LIBS=$LIBS
+	LIBS="$ol_RESOLVER_LIB $LIBS"
+
+	AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+#ifdef HAVE_SYS_TYPES_H
+#	include <sys/types.h>
+#endif
+#include <netinet/in.h>
+#ifdef HAVE_ARPA_NAMESER_H
+#	include <arpa/nameser.h>
+#endif
+#ifdef HAVE_RESOLV_H
+#	include <resolv.h>
+#endif
+]], [[{
+	int len, status;
+	char *request = NULL;
+	unsigned char reply[64*1024];
+	unsigned char host[64*1024];
+	unsigned char *p;
+
+#ifdef NS_HFIXEDSZ
+	/* Bind 8/9 interface */
+	len = res_query(request, ns_c_in, ns_t_srv, reply, sizeof(reply));
+#else
+	/* Bind 4 interface */
+# ifndef T_SRV
+#  define T_SRV 33
+# endif
+	len = res_query(request, C_IN, T_SRV, reply, sizeof(reply));
+#endif
+	p = reply;
+#ifdef NS_HFIXEDSZ
+	/* Bind 8/9 interface */
+	p += NS_HFIXEDSZ;
+#elif defined(HFIXEDSZ)
+	/* Bind 4 interface w/ HFIXEDSZ */
+	p += HFIXEDSZ;
+#else
+	/* Bind 4 interface w/o HFIXEDSZ */
+	p += sizeof(HEADER);
+#endif
+	status = dn_expand( reply, reply+len, p, host, sizeof(host));
+}]])],[$1=yes],[$1=no])
+
+	LIBS="$ol_LIBS"
+])
+
+	if test $$1 = yes ; then
+		ol_cv_lib_resolver=ifelse($2,,yes,$2)
+	fi
+fi
+])
+dnl --------------------------------------------------------------------
+dnl Try to locate appropriate library
+AC_DEFUN([OL_RESOLVER_LINK],
+[ol_cv_lib_resolver=no
+OL_RESOLVER_TRY(ol_cv_resolver_none)
+OL_RESOLVER_TRY(ol_cv_resolver_resolv,[-lresolv])
+OL_RESOLVER_TRY(ol_cv_resolver_bind,[-lbind])
+])
+dnl
+dnl ====================================================================
+dnl International Components for Unicode (ICU)
+AC_DEFUN([OL_ICU],
+[ol_icu=no
+AC_CHECK_HEADERS( unicode/utypes.h )
+if test $ac_cv_header_unicode_utypes_h = yes ; then
+	dnl OL_ICULIBS="-licui18n -licuuc -licudata"
+	OL_ICULIBS="-licuuc -licudata"
+
+	AC_CACHE_CHECK([for ICU libraries], [ol_cv_lib_icu], [
+		ol_LIBS="$LIBS"
+		LIBS="$OL_ICULIBS $LIBS"
+		AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+#include <unicode/utypes.h>
+]], [[
+(void) u_errorName(0);
+]])],[ol_cv_lib_icu=yes],[ol_cv_lib_icu=no])
+		LIBS="$ol_LIBS"
+])
+
+	if test $ol_cv_lib_icu != no ; then
+		ol_icu="$OL_ICULIBS"
+		AC_DEFINE([HAVE_ICU], [1], [define if you actually have ICU])
+	fi
+fi
+])
+dnl
+dnl ====================================================================
+dnl Berkeley DB macros
+dnl
+dnl --------------------------------------------------------------------
+dnl Try to link
+AC_DEFUN([OL_BERKELEY_DB_TRY],
+[if test $ol_cv_lib_db = no ; then
+	AC_CACHE_CHECK([for Berkeley DB link (]ifelse($2,,default,$2)[)],[$1],
+[
+	ol_DB_LIB=ifelse($2,,,$2)
+	ol_LIBS=$LIBS
+	LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
+
+	AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+#ifdef HAVE_DB_185_H
+# include <db_185.h>
+#else
+# include <db.h>
+#endif
+
+#ifndef DB_VERSION_MAJOR
+# define DB_VERSION_MAJOR 1
+#endif
+
+#ifndef NULL
+#define NULL ((void*)0)
+#endif
+]], [[
+#if DB_VERSION_MAJOR > 2
+	db_env_create( NULL, 0 );
+#elif DB_VERSION_MAJOR > 1
+	db_appexit( NULL );
+#else
+	(void) dbopen( NULL, 0, 0, 0, NULL);
+#endif
+]])],[$1=yes],[$1=no])
+
+	LIBS="$ol_LIBS"
+])
+
+	if test $$1 = yes ; then
+		ol_cv_lib_db=ifelse($2,,yes,$2)
+	fi
+fi
+])
+dnl
+dnl --------------------------------------------------------------------
+dnl Get major and minor version from <db.h>
+AC_DEFUN([OL_BDB_HEADER_VERSION],
+[AC_CACHE_CHECK([for Berkeley DB major version in db.h], [ol_cv_bdb_major],[
+	AC_LANG_CONFTEST([
+#include <db.h>
+#ifndef DB_VERSION_MAJOR
+#	define DB_VERSION_MAJOR 1
+#endif
+__db_version DB_VERSION_MAJOR
+])
+	set X `eval "$ac_cpp conftest.$ac_ext" | $EGREP __db_version` none none
+	ol_cv_bdb_major=${3}
+])
+case $ol_cv_bdb_major in [[1-9]]*) : ;; *)
+	AC_MSG_ERROR([Unknown Berkeley DB major version in db.h]) ;;
+esac
+
+dnl Determine minor version
+AC_CACHE_CHECK([for Berkeley DB minor version in db.h], [ol_cv_bdb_minor],[
+	AC_LANG_CONFTEST([
+#include <db.h>
+#ifndef DB_VERSION_MINOR
+#	define DB_VERSION_MINOR 0
+#endif
+__db_version DB_VERSION_MINOR
+])
+	set X `eval "$ac_cpp conftest.$ac_ext" | $EGREP __db_version` none none
+	ol_cv_bdb_minor=${3}
+])
+case $ol_cv_bdb_minor in [[0-9]]*) : ;; *)
+	AC_MSG_ERROR([Unknown Berkeley DB minor version in db.h]) ;;
+esac
+])
+dnl
+dnl --------------------------------------------------------------------
+dnl Try to locate appropriate library
+AC_DEFUN([OL_BERKELEY_DB_LINK],
+[ol_cv_lib_db=no
+
+if test $ol_cv_bdb_major = 4 ; then
+	OL_BERKELEY_DB_TRY(ol_cv_db_db_4_dot_m,[-ldb-4.$ol_cv_bdb_minor])
+	OL_BERKELEY_DB_TRY(ol_cv_db_db4m,[-ldb4$ol_cv_bdb_minor])
+	OL_BERKELEY_DB_TRY(ol_cv_db_db_4m,[-ldb-4$ol_cv_bdb_minor])
+	OL_BERKELEY_DB_TRY(ol_cv_db_db_4_m,[-ldb-4-$ol_cv_bdb_minor])
+	OL_BERKELEY_DB_TRY(ol_cv_db_db_4,[-ldb-4])
+	OL_BERKELEY_DB_TRY(ol_cv_db_db4,[-ldb4])
+	OL_BERKELEY_DB_TRY(ol_cv_db_db,[-ldb])
+fi
+OL_BERKELEY_DB_TRY(ol_cv_db_none)
+])
+dnl
+dnl --------------------------------------------------------------------
+dnl Check if Berkeley DB version
+AC_DEFUN([OL_BERKELEY_DB_VERSION],
+[AC_CACHE_CHECK([for Berkeley DB library and header version match], [ol_cv_berkeley_db_version], [
+	ol_LIBS="$LIBS"
+	LIBS="$LTHREAD_LIBS $LIBS"
+	if test $ol_cv_lib_db != yes ; then
+		LIBS="$ol_cv_lib_db $LIBS"
+	fi
+
+	AC_RUN_IFELSE([AC_LANG_SOURCE([[
+#ifdef HAVE_DB_185_H
+	choke me;
+#else
+#include <db.h>
+#endif
+#ifndef DB_VERSION_MAJOR
+# define DB_VERSION_MAJOR 1
+#endif
+#ifndef NULL
+#define NULL ((void *)0)
+#endif
+main()
+{
+#if DB_VERSION_MAJOR > 1
+	char *version;
+	int major, minor, patch;
+
+	version = db_version( &major, &minor, &patch );
+
+	if( major != DB_VERSION_MAJOR ||
+		minor != DB_VERSION_MINOR ||
+		patch != DB_VERSION_PATCH )
+	{
+		printf("Berkeley DB version mismatch\n"
+			"\theader: %s\n\tlibrary: %s\n",
+			DB_VERSION_STRING, version);
+		return 1;
+	}
+#endif
+
+	return 0;
+}]])],[ol_cv_berkeley_db_version=yes],[ol_cv_berkeley_db_version=no],[ol_cv_berkeley_db_version=cross])
+
+	LIBS="$ol_LIBS"
+])
+
+	if test $ol_cv_berkeley_db_version = no ; then
+		AC_MSG_ERROR([Berkeley DB version mismatch])
+	fi
+])dnl
+dnl
+dnl --------------------------------------------------------------------
+dnl Check if Berkeley DB supports DB_THREAD
+AC_DEFUN([OL_BERKELEY_DB_THREAD],
+[AC_CACHE_CHECK([for Berkeley DB thread support], [ol_cv_berkeley_db_thread], [
+	ol_LIBS="$LIBS"
+	LIBS="$LTHREAD_LIBS $LIBS"
+	if test $ol_cv_lib_db != yes ; then
+		LIBS="$ol_cv_lib_db $LIBS"
+	fi
+
+	AC_RUN_IFELSE([AC_LANG_SOURCE([[
+#ifdef HAVE_DB_185_H
+	choke me;
+#else
+#include <db.h>
+#endif
+#ifndef NULL
+#define NULL ((void *)0)
+#endif
+main()
+{
+	int rc;
+	u_int32_t flags = DB_CREATE |
+#ifdef DB_PRIVATE
+		DB_PRIVATE |
+#endif
+		DB_THREAD;
+
+#if DB_VERSION_MAJOR > 2
+	DB_ENV *env = NULL;
+
+	rc = db_env_create( &env, 0 );
+
+	flags |= DB_INIT_MPOOL;
+#ifdef DB_MPOOL_PRIVATE
+	flags |= DB_MPOOL_PRIVATE;
+#endif
+
+	if( rc ) {
+		printf("BerkeleyDB: %s\n", db_strerror(rc) );
+		return rc;
+	}
+
+#if (DB_VERSION_MAJOR > 3) || (DB_VERSION_MINOR >= 1)
+	rc = (env->open)( env, NULL, flags, 0 );
+#else
+	rc = (env->open)( env, NULL, NULL, flags, 0 );
+#endif
+
+	if ( rc == 0 ) {
+		rc = env->close( env, 0 );
+	}
+
+	if( rc ) {
+		printf("BerkeleyDB: %s\n", db_strerror(rc) );
+		return rc;
+	}
+
+#else
+	DB_ENV env;
+	memset( &env, '\0', sizeof(env) );
+
+	rc = db_appinit( NULL, NULL, &env, flags );
+
+	if( rc == 0 ) {
+		db_appexit( &env );
+	}
+
+	unlink("__db_mpool.share");
+	unlink("__db_lock.share");
+#endif
+
+	return rc;
+}]])],[ol_cv_berkeley_db_thread=yes],[ol_cv_berkeley_db_thread=no],[ol_cv_berkeley_db_thread=cross])
+
+	LIBS="$ol_LIBS"
+])
+
+	if test $ol_cv_berkeley_db_thread != no ; then
+		AC_DEFINE([HAVE_BERKELEY_DB_THREAD], [1],
+			[define if Berkeley DB has DB_THREAD support])
+	fi
+])dnl
+dnl
+dnl --------------------------------------------------------------------
+dnl Find any DB
+AC_DEFUN([OL_BERKELEY_DB],
+[ol_cv_berkeley_db=no
+AC_CHECK_HEADERS(db.h)
+if test $ac_cv_header_db_h = yes; then
+	OL_BDB_HEADER_VERSION
+	OL_BDB_COMPAT
+
+	if test $ol_cv_bdb_compat != yes ; then
+		AC_MSG_ERROR([BerkeleyDB version incompatible with BDB/HDB backends])
+	fi
+
+	OL_BERKELEY_DB_LINK
+	if test "$ol_cv_lib_db" != no ; then
+		ol_cv_berkeley_db=yes
+		OL_BERKELEY_DB_VERSION
+		OL_BERKELEY_DB_THREAD
+	fi
+fi
+])
+dnl --------------------------------------------------------------------
+dnl Check for version compatility with back-bdb
+AC_DEFUN([OL_BDB_COMPAT],
+[AC_CACHE_CHECK([if Berkeley DB version supported by BDB/HDB backends], [ol_cv_bdb_compat],[
+	AC_EGREP_CPP(__db_version_compat,[
+#include <db.h>
+
+ /* this check could be improved */
+#ifndef DB_VERSION_MAJOR
+#	define DB_VERSION_MAJOR 1
+#endif
+#ifndef DB_VERSION_MINOR
+#	define DB_VERSION_MINOR 0
+#endif
+
+#define DB_VERSION_MM	((DB_VERSION_MAJOR<<8)|DB_VERSION_MINOR)
+
+/* require 4.4 or later */
+#if DB_VERSION_MM >= 0x0404
+	__db_version_compat
+#endif
+	], [ol_cv_bdb_compat=yes], [ol_cv_bdb_compat=no])])
+])
+
+dnl
+dnl ====================================================================
+dnl Check POSIX Thread version 
+dnl
+dnl defines ol_cv_pthread_version to 4, 5, 6, 7, 8, 10, depending on the
+dnl	version of the POSIX.4a Draft that is implemented.
+dnl	10 == POSIX.4a Final == POSIX.1c-1996 for our purposes.
+dnl	Existence of pthread.h should be tested separately.
+dnl
+dnl tests:
+dnl	pthread_detach() was dropped in Draft 8, it is present
+dnl		in every other version
+dnl	PTHREAD_CREATE_UNDETACHED is only in Draft 7, it was called
+dnl		PTHREAD_CREATE_JOINABLE after that
+dnl	pthread_attr_create was renamed to pthread_attr_init in Draft 6.
+dnl		Draft 6-10 has _init, Draft 4-5 has _create.
+dnl	pthread_attr_default was dropped in Draft 6, only 4 and 5 have it
+dnl	PTHREAD_MUTEX_INITIALIZER was introduced in Draft 5. It's not
+dnl		interesting to us because we don't try to statically
+dnl		initialize mutexes. 5-10 has it.
+dnl
+dnl Draft 9 and 10 are equivalent for our purposes.
+dnl
+AC_DEFUN([OL_POSIX_THREAD_VERSION],
+[AC_CACHE_CHECK([POSIX thread version],[ol_cv_pthread_version],[
+	AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+#		include <pthread.h>
+	]], [[
+		int i = PTHREAD_CREATE_JOINABLE;
+	]])],[
+	AC_EGREP_HEADER(pthread_detach,pthread.h,
+	ol_cv_pthread_version=10, ol_cv_pthread_version=8)],[
+	AC_EGREP_CPP(draft7,[
+#		include <pthread.h>
+#		ifdef PTHREAD_CREATE_UNDETACHED
+		draft7
+#		endif
+	], ol_cv_pthread_version=7, [
+	AC_EGREP_HEADER(pthread_attr_init,pthread.h,
+	ol_cv_pthread_version=6, [
+	AC_EGREP_CPP(draft5,[
+#		include <pthread.h>
+#ifdef		PTHREAD_MUTEX_INITIALIZER
+		draft5
+#endif
+	], ol_cv_pthread_version=5, ol_cv_pthread_version=4) ]) ]) ])
+])
+])dnl
+dnl
+dnl --------------------------------------------------------------------
+AC_DEFUN([OL_PTHREAD_TEST_INCLUDES], [[
+/* pthread test headers */
+#include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+	void *p;
+{
+	return (void *) (p == NULL);
+}
+]])
+AC_DEFUN([OL_PTHREAD_TEST_FUNCTION],[[
+	/* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define	PTHREAD_CREATE_DETACHED	1
+#endif
+	pthread_t t;
+	int status;
+	int detach = PTHREAD_CREATE_DETACHED;
+
+#if HAVE_PTHREADS > 4
+	/* Final pthreads */
+	pthread_attr_t attr;
+
+	status = pthread_attr_init(&attr);
+	if( status ) return status;
+
+#if HAVE_PTHREADS < 7
+	status = pthread_attr_setdetachstate(&attr, &detach);
+	if( status < 0 ) status = errno;
+#else
+	status = pthread_attr_setdetachstate(&attr, detach);
+#endif
+	if( status ) return status;
+	status = pthread_create( &t, &attr, task, NULL );
+#if HAVE_PTHREADS < 7
+	if( status < 0 ) status = errno;
+#endif
+	if( status ) return status;
+#else
+	/* Draft 4 pthreads */
+	status = pthread_create( &t, pthread_attr_default, task, NULL );
+	if( status ) return errno;
+
+	/* give thread a chance to complete */
+	/* it should remain joinable and hence detachable */
+	sleep( 1 );
+
+	status = pthread_detach( &t );
+	if( status ) return errno;
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+	pthread_kill_other_threads_np();
+#endif
+
+	return 0;
+]])
+
+AC_DEFUN([OL_PTHREAD_TEST_PROGRAM], [
+AC_LANG_SOURCE([OL_PTHREAD_TEST_INCLUDES
+
+int main(argc, argv)
+	int argc;
+	char **argv;
+{
+OL_PTHREAD_TEST_FUNCTION
+}
+])])
+dnl --------------------------------------------------------------------
+AC_DEFUN([OL_PTHREAD_TRY], [# Pthread try link: $1 ($2)
+if test "$ol_link_threads" = no ; then
+	# try $1
+	AC_CACHE_CHECK([for pthread link with $1], [$2], [
+		# save the flags
+		ol_LIBS="$LIBS"
+		LIBS="$1 $LIBS"
+
+		AC_RUN_IFELSE([OL_PTHREAD_TEST_PROGRAM],
+			[$2=yes],
+			[$2=no],
+			[AC_LINK_IFELSE([AC_LANG_PROGRAM(OL_PTHREAD_TEST_INCLUDES,
+				OL_PTHREAD_TEST_FUNCTION)],
+				[$2=yes], [$2=no])])
+
+		# restore the LIBS
+		LIBS="$ol_LIBS"
+	])
+
+	if test $$2 = yes ; then
+		ol_link_pthreads="$1"
+		ol_link_threads=posix
+	fi
+fi
+])
+dnl
+dnl ====================================================================
+dnl Check GNU Pth pthread Header
+dnl
+dnl defines ol_cv_header linux_threads to 'yes' or 'no'
+dnl		'no' implies pthreads.h is not LinuxThreads or pthreads.h
+dnl		doesn't exists.  Existance of pthread.h should separately
+dnl		checked.
+dnl 
+AC_DEFUN([OL_HEADER_GNU_PTH_PTHREAD_H], [
+	AC_CACHE_CHECK([for GNU Pth pthread.h],
+		[ol_cv_header_gnu_pth_pthread_h],
+		[AC_EGREP_CPP(__gnu_pth__,
+			[#include <pthread.h>
+#ifdef _POSIX_THREAD_IS_GNU_PTH
+	__gnu_pth__;
+#endif
+],
+			[ol_cv_header_gnu_pth_pthread_h=yes],
+			[ol_cv_header_gnu_pth_pthread_h=no])
+		])
+])dnl
+dnl ====================================================================
+dnl Check for NT Threads
+AC_DEFUN([OL_NT_THREADS], [
+	AC_CHECK_FUNC(_beginthread)
+
+	if test $ac_cv_func__beginthread = yes ; then
+		AC_DEFINE([HAVE_NT_THREADS], [1], [if you have NT Threads])
+		ol_cv_nt_threads=yes
+	fi
+])
+dnl ====================================================================
+dnl Check LinuxThreads Header
+dnl
+dnl defines ol_cv_header linux_threads to 'yes' or 'no'
+dnl		'no' implies pthreads.h is not LinuxThreads or pthreads.h
+dnl		doesn't exists.  Existance of pthread.h should separately
+dnl		checked.
+dnl 
+AC_DEFUN([OL_HEADER_LINUX_THREADS], [
+	AC_CACHE_CHECK([for LinuxThreads pthread.h],
+		[ol_cv_header_linux_threads],
+		[AC_EGREP_CPP(pthread_kill_other_threads_np,
+			[#include <pthread.h>],
+			[ol_cv_header_linux_threads=yes],
+			[ol_cv_header_linux_threads=no])
+		])
+	if test $ol_cv_header_linux_threads = yes; then
+		AC_DEFINE([HAVE_LINUX_THREADS], [1], [if you have LinuxThreads])
+	fi
+])dnl
+dnl --------------------------------------------------------------------
+dnl	Check LinuxThreads Implementation
+dnl
+dnl	defines ol_cv_sys_linux_threads to 'yes' or 'no'
+dnl	'no' implies pthreads implementation is not LinuxThreads.
+dnl 
+AC_DEFUN([OL_SYS_LINUX_THREADS], [
+	AC_CHECK_FUNCS(pthread_kill_other_threads_np)
+	AC_CACHE_CHECK([for LinuxThreads implementation],
+		[ol_cv_sys_linux_threads],
+		[ol_cv_sys_linux_threads=$ac_cv_func_pthread_kill_other_threads_np])
+])dnl
+dnl
+dnl --------------------------------------------------------------------
+dnl Check LinuxThreads consistency
+AC_DEFUN([OL_LINUX_THREADS], [
+	AC_REQUIRE([OL_HEADER_LINUX_THREADS])
+	AC_REQUIRE([OL_SYS_LINUX_THREADS])
+	AC_CACHE_CHECK([for LinuxThreads consistency], [ol_cv_linux_threads], [
+		if test $ol_cv_header_linux_threads = yes &&
+		   test $ol_cv_sys_linux_threads = yes; then
+			ol_cv_linux_threads=yes
+		elif test $ol_cv_header_linux_threads = no &&
+		     test $ol_cv_sys_linux_threads = no; then
+			ol_cv_linux_threads=no
+		else
+			ol_cv_linux_threads=error
+		fi
+	])
+])dnl
+dnl
+dnl ====================================================================
+dnl Check for POSIX Regex
+AC_DEFUN([OL_POSIX_REGEX], [
+AC_CACHE_CHECK([for compatible POSIX regex],ol_cv_c_posix_regex,[
+	AC_RUN_IFELSE([AC_LANG_SOURCE([[
+#include <sys/types.h>
+#include <regex.h>
+static char *pattern, *string;
+main()
+{
+	int rc;
+	regex_t re;
+
+	pattern = "^A";
+
+	if(regcomp(&re, pattern, 0)) {
+		return -1;
+	}
+	
+	string = "ALL MATCH";
+	
+	rc = regexec(&re, string, 0, (void*)0, 0);
+
+	regfree(&re);
+
+	return rc;
+}]])],[ol_cv_c_posix_regex=yes],[ol_cv_c_posix_regex=no],[ol_cv_c_posix_regex=cross])])
+])
+dnl
+dnl ====================================================================
+dnl Check if toupper() requires islower() to be called first
+AC_DEFUN([OL_C_UPPER_LOWER],
+[AC_CACHE_CHECK([if toupper() requires islower()],ol_cv_c_upper_lower,[
+	AC_RUN_IFELSE([AC_LANG_SOURCE([[
+#include <ctype.h>
+main()
+{
+	if ('C' == toupper('C'))
+		exit(0);
+	else
+		exit(1);
+}]])],[ol_cv_c_upper_lower=no],[ol_cv_c_upper_lower=yes],[ol_cv_c_upper_lower=safe])])
+if test $ol_cv_c_upper_lower != no ; then
+	AC_DEFINE([C_UPPER_LOWER], [1], [define if toupper() requires islower()])
+fi
+])
+dnl
+dnl ====================================================================
+dnl Error string checks
+dnl
+dnl Check for declaration of sys_errlist in one of stdio.h and errno.h.
+dnl Declaration of sys_errlist on BSD4.4 interferes with our declaration.
+dnl Reported by Keith Bostic.
+AC_DEFUN([OL_SYS_ERRLIST],
+[AC_CACHE_CHECK([declaration of sys_errlist],ol_cv_dcl_sys_errlist,[
+	AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+#include <stdio.h>
+#include <sys/types.h>
+#include <errno.h>
+#ifdef _WIN32
+#include <stdlib.h>
+#endif ]], [[char *c = (char *) *sys_errlist]])],[ol_cv_dcl_sys_errlist=yes
+	ol_cv_have_sys_errlist=yes],[ol_cv_dcl_sys_errlist=no])])
+#
+# It's possible (for near-UNIX clones) that sys_errlist doesn't exist
+if test $ol_cv_dcl_sys_errlist = no ; then
+	AC_DEFINE([DECL_SYS_ERRLIST], [1],
+		[define if sys_errlist is not declared in stdio.h or errno.h])
+
+	AC_CACHE_CHECK([existence of sys_errlist],ol_cv_have_sys_errlist,[
+		AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <errno.h>]], [[char *c = (char *) *sys_errlist]])],[ol_cv_have_sys_errlist=yes],[ol_cv_have_sys_errlist=no])])
+fi
+if test $ol_cv_have_sys_errlist = yes ; then
+	AC_DEFINE([HAVE_SYS_ERRLIST], [1],
+		[define if you actually have sys_errlist in your libs])
+fi
+])dnl
+AC_DEFUN([OL_NONPOSIX_STRERROR_R],
+[AC_CACHE_CHECK([non-posix strerror_r],ol_cv_nonposix_strerror_r,[
+	AC_EGREP_CPP(strerror_r,[#include <string.h>],
+		ol_decl_strerror_r=yes, ol_decl_strerror_r=no)dnl
+
+	if test $ol_decl_strerror_r = yes ; then
+		AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <string.h>]], [[   /* from autoconf 2.59 */
+				char buf[100];
+				char x = *strerror_r (0, buf, sizeof buf);
+				char *p = strerror_r (0, buf, sizeof buf);
+			]])],[ol_cv_nonposix_strerror_r=yes],[ol_cv_nonposix_strerror_r=no])
+	else
+		AC_RUN_IFELSE([AC_LANG_SOURCE([[
+			main() {
+				char buf[100];
+				buf[0] = 0;
+				strerror_r( 1, buf, sizeof buf );
+				exit( buf[0] == 0 );
+			}
+			]])],[ol_cv_nonposix_strerror_r=yes],[ol_cv_nonposix_strerror=no],[ol_cv_nonposix_strerror=no])
+	fi
+	])
+if test $ol_cv_nonposix_strerror_r = yes ; then
+	AC_DEFINE([HAVE_NONPOSIX_STRERROR_R], [1],
+		[define if strerror_r returns char* instead of int])
+fi
+])dnl
+dnl
+AC_DEFUN([OL_STRERROR],
+[OL_SYS_ERRLIST dnl TEMPORARY
+AC_CHECK_FUNCS(strerror strerror_r)
+ol_cv_func_strerror_r=no
+if test "${ac_cv_func_strerror_r}" = yes ; then
+	OL_NONPOSIX_STRERROR_R
+elif test "${ac_cv_func_strerror}" = no ; then
+	OL_SYS_ERRLIST
+fi
+])dnl
+dnl ====================================================================
+dnl Early MIPS compilers (used in Ultrix 4.2) don't like
+dnl "int x; int *volatile a = &x; *a = 0;"
+dnl 	-- borrowed from PDKSH
+AC_DEFUN([OL_C_VOLATILE],
+ [AC_CACHE_CHECK(if compiler understands volatile, ol_cv_c_volatile,
+    [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[int x, y, z;]], [[volatile int a; int * volatile b = x ? &y : &z;
+      /* Older MIPS compilers (eg., in Ultrix 4.2) don't like *b = 0 */
+      *b = 0;]])],[ol_cv_c_volatile=yes],[ol_cv_c_volatile=no])])
+  if test $ol_cv_c_volatile = yes; then
+    : 
+  else
+    AC_DEFINE([volatile], [], [define as empty if volatile is not supported])
+  fi
+ ])dnl
+dnl
+dnl ====================================================================
+dnl Look for fetch(3)
+AC_DEFUN([OL_LIB_FETCH],
+[ol_LIBS=$LIBS
+LIBS="-lfetch -lcom_err $LIBS"
+AC_CACHE_CHECK([fetch(3) library],ol_cv_lib_fetch,[
+	AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#include <stdio.h>
+#include <fetch.h>]], [[struct url *u = fetchParseURL("file:///"); ]])],[ol_cv_lib_fetch=yes],[ol_cv_lib_fetch=no])])
+LIBS=$ol_LIBS
+if test $ol_cv_lib_fetch != no ; then
+	ol_link_fetch="-lfetch -lcom_err"
+	AC_DEFINE([HAVE_FETCH], [1],
+		[define if you actually have FreeBSD fetch(3)])
+fi
+])dnl
+dnl
+dnl ====================================================================
+dnl Define inet_aton is available
+AC_DEFUN([OL_FUNC_INET_ATON],
+ [AC_CACHE_CHECK([for inet_aton()], ol_cv_func_inet_aton,
+    [AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+#ifdef HAVE_SYS_TYPES_H
+#	include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+#	include <sys/socket.h>
+#	ifdef HAVE_SYS_SELECT_H
+#		include <sys/select.h>
+#	endif
+#	include <netinet/in.h>
+#	ifdef HAVE_ARPA_INET_H
+#		include <arpa/inet.h>
+#	endif
+#endif
+]], [[struct in_addr in;
+int rc = inet_aton( "255.255.255.255", &in );]])],[ol_cv_func_inet_aton=yes],[ol_cv_func_inet_aton=no])])
+  if test $ol_cv_func_inet_aton != no; then
+    AC_DEFINE(HAVE_INET_ATON, 1,
+		[define to you inet_aton(3) is available])
+  fi
+ ])dnl
+dnl
+dnl ====================================================================
+dnl check no of arguments for ctime_r
+AC_DEFUN([OL_FUNC_CTIME_R_NARGS],
+ [AC_CACHE_CHECK(number of arguments of ctime_r, ol_cv_func_ctime_r_nargs,
+   [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[time_t ti; char *buffer; ctime_r(&ti,buffer,32);]])],[ol_cv_func_ctime_r_nargs3=yes],[ol_cv_func_ctime_r_nargs3=no])
+
+	AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[time_t ti; char *buffer; ctime_r(&ti,buffer);]])],[ol_cv_func_ctime_r_nargs2=yes],[ol_cv_func_ctime_r_nargs2=no])
+
+	if test $ol_cv_func_ctime_r_nargs3 = yes &&
+	   test $ol_cv_func_ctime_r_nargs2 = no ; then
+
+		ol_cv_func_ctime_r_nargs=3
+
+	elif test $ol_cv_func_ctime_r_nargs3 = no &&
+	     test $ol_cv_func_ctime_r_nargs2 = yes ; then
+
+		ol_cv_func_ctime_r_nargs=2
+
+	else
+		ol_cv_func_ctime_r_nargs=0
+	fi
+  ])
+
+  if test $ol_cv_func_ctime_r_nargs -gt 1 ; then
+ 	AC_DEFINE_UNQUOTED(CTIME_R_NARGS, $ol_cv_func_ctime_r_nargs,
+		[set to the number of arguments ctime_r() expects])
+  fi
+])dnl
+dnl
+dnl --------------------------------------------------------------------
+dnl check return type of ctime_r()
+AC_DEFUN([OL_FUNC_CTIME_R_TYPE],
+ [AC_CACHE_CHECK(return type of ctime_r, ol_cv_func_ctime_r_type,
+   [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[extern int (ctime_r)();]])],[ol_cv_func_ctime_r_type="int"],[ol_cv_func_ctime_r_type="charp"])
+	])
+  if test $ol_cv_func_ctime_r_type = "int" ; then
+	AC_DEFINE(CTIME_R_RETURNS_INT,1, [define if ctime_r() returns int])
+  fi
+])dnl
+dnl ====================================================================
+dnl check no of arguments for gethostbyname_r
+AC_DEFUN([OL_FUNC_GETHOSTBYNAME_R_NARGS],
+ [AC_CACHE_CHECK(number of arguments of gethostbyname_r,
+	ol_cv_func_gethostbyname_r_nargs,
+	[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <netdb.h>
+#define BUFSIZE (sizeof(struct hostent)+10)]], [[struct hostent hent; char buffer[BUFSIZE];
+		int bufsize=BUFSIZE;int h_errno;
+		(void)gethostbyname_r("segovia.cs.purdue.edu", &hent,
+			buffer, bufsize, &h_errno);]])],[ol_cv_func_gethostbyname_r_nargs5=yes],[ol_cv_func_gethostbyname_r_nargs5=no])
+
+	AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <netdb.h>
+#define BUFSIZE (sizeof(struct hostent)+10)]], [[struct hostent hent;struct hostent *rhent;
+		char buffer[BUFSIZE];
+		int bufsize=BUFSIZE;int h_errno;
+		(void)gethostbyname_r("localhost", &hent, buffer, bufsize,
+			&rhent, &h_errno);]])],[ol_cv_func_gethostbyname_r_nargs6=yes],[ol_cv_func_gethostbyname_r_nargs6=no])
+
+	if test $ol_cv_func_gethostbyname_r_nargs5 = yes &&
+	   test $ol_cv_func_gethostbyname_r_nargs6 = no ; then
+
+		ol_cv_func_gethostbyname_r_nargs=5
+
+	elif test $ol_cv_func_gethostbyname_r_nargs5 = no &&
+	     test $ol_cv_func_gethostbyname_r_nargs6 = yes ; then
+
+		ol_cv_func_gethostbyname_r_nargs=6
+
+	else
+		ol_cv_func_gethostbyname_r_nargs=0
+	fi
+  ])
+  if test $ol_cv_func_gethostbyname_r_nargs -gt 1 ; then
+	AC_DEFINE_UNQUOTED(GETHOSTBYNAME_R_NARGS,
+		$ol_cv_func_gethostbyname_r_nargs,
+		[set to the number of arguments gethostbyname_r() expects])
+  fi
+])dnl
+dnl
+dnl check no of arguments for gethostbyaddr_r
+AC_DEFUN([OL_FUNC_GETHOSTBYADDR_R_NARGS],
+ [AC_CACHE_CHECK(number of arguments of gethostbyaddr_r,
+	[ol_cv_func_gethostbyaddr_r_nargs],
+	[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <netdb.h>
+#define BUFSIZE (sizeof(struct hostent)+10)]], [[struct hostent hent; char buffer[BUFSIZE]; 
+	    struct in_addr add;
+	    size_t alen=sizeof(struct in_addr);
+	    int bufsize=BUFSIZE;int h_errno;
+		(void)gethostbyaddr_r( (void *)&(add.s_addr),
+			alen, AF_INET, &hent, buffer, bufsize, &h_errno);]])],[ol_cv_func_gethostbyaddr_r_nargs7=yes],[ol_cv_func_gethostbyaddr_r_nargs7=no])
+
+	AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <netdb.h>
+#define BUFSIZE (sizeof(struct hostent)+10)]], [[struct hostent hent;
+		struct hostent *rhent; char buffer[BUFSIZE]; 
+		struct in_addr add;
+		size_t alen=sizeof(struct in_addr);
+		int bufsize=BUFSIZE;int h_errno;
+		(void)gethostbyaddr_r( (void *)&(add.s_addr),
+			alen, AF_INET, &hent, buffer, bufsize, 
+			&rhent, &h_errno);]])],[ol_cv_func_gethostbyaddr_r_nargs8=yes],[ol_cv_func_gethostbyaddr_r_nargs8=no])
+
+	if test $ol_cv_func_gethostbyaddr_r_nargs7 = yes &&
+	   test $ol_cv_func_gethostbyaddr_r_nargs8 = no ; then
+
+		ol_cv_func_gethostbyaddr_r_nargs=7
+
+	elif test $ol_cv_func_gethostbyaddr_r_nargs7 = no &&
+	     test $ol_cv_func_gethostbyaddr_r_nargs8 = yes ; then
+
+		ol_cv_func_gethostbyaddr_r_nargs=8
+
+	else
+		ol_cv_func_gethostbyaddr_r_nargs=0
+	fi
+  ])
+  if test $ol_cv_func_gethostbyaddr_r_nargs -gt 1 ; then
+    AC_DEFINE_UNQUOTED(GETHOSTBYADDR_R_NARGS,
+		$ol_cv_func_gethostbyaddr_r_nargs,
+		[set to the number of arguments gethostbyaddr_r() expects])
+  fi
+])dnl
+dnl
+dnl --------------------------------------------------------------------
+dnl Check for Cyrus SASL version compatility
+AC_DEFUN([OL_SASL_COMPAT],
+[AC_CACHE_CHECK([Cyrus SASL library version], [ol_cv_sasl_compat],[
+	AC_EGREP_CPP(__sasl_compat,[
+#ifdef HAVE_SASL_SASL_H
+#include <sasl/sasl.h>
+#else
+#include <sasl.h>
+#endif
+
+/* Require 2.1.15+ */
+#if SASL_VERSION_MAJOR == 2  && SASL_VERSION_MINOR > 1
+	char *__sasl_compat = "2.2+ or better okay (we guess)";
+#elif SASL_VERSION_MAJOR == 2  && SASL_VERSION_MINOR == 1 \
+	&& SASL_VERSION_STEP >=15
+	char *__sasl_compat = "2.1.15+ or better okay";
+#endif
+	],	[ol_cv_sasl_compat=yes], [ol_cv_sasl_compat=no])])
+])
+dnl ====================================================================
+dnl check for SSL compatibility
+AC_DEFUN([OL_SSL_COMPAT],
+[AC_CACHE_CHECK([OpenSSL library version (CRL checking capability)],
+	[ol_cv_ssl_crl_compat],[
+		AC_EGREP_CPP(__ssl_compat,[
+#ifdef HAVE_OPENSSL_SSL_H
+#include <openssl/ssl.h>
+#endif
+
+/* Require 0.9.7d+ */
+#if OPENSSL_VERSION_NUMBER >= 0x0090704fL
+	char *__ssl_compat = "0.9.7d";
+#endif
+	], [ol_cv_ssl_crl_compat=yes], [ol_cv_ssl_crl_compat=no])])
+])
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/sntp/m4/version.m4 /cur/src/external/bsd/ntp/dist/sntp/m4/version.m4
--- external/bsd/ntp/dist/sntp/m4/version.m4	2014-12-19 12:37:49.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/sntp/m4/version.m4	2015-04-07 19:51:18.000000000 -0700
@@ -1 +1 @@
-m4_define([VERSION_NUMBER],[4.2.8])
+m4_define([VERSION_NUMBER],[4.2.8p2])
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/sntp/main.c /cur/src/external/bsd/ntp/dist/sntp/main.c
--- external/bsd/ntp/dist/sntp/main.c	2014-12-24 18:28:14.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/sntp/main.c	2015-04-07 19:51:18.000000000 -0700
@@ -1163,6 +1163,7 @@
 	int		stratum;
 	char *		ref;
 	char *		ts_str;
+	const char *	leaptxt;
 	double		offset;
 	double		precision;
 	double		synch_distance;
@@ -1258,9 +1259,28 @@
 			disptxt[0] = '\0';
 		}
 
-		msyslog(LOG_INFO, "%s %+.*f%s %s s%d%s", ts_str,
+		switch (PKT_LEAP(rpkt->li_vn_mode)) {
+		    case LEAP_NOWARNING:
+		    	leaptxt = "no-leap";
+			break;
+		    case LEAP_ADDSECOND:
+		    	leaptxt = "add-leap";
+			break;
+		    case LEAP_DELSECOND:
+		    	leaptxt = "del-leap";
+			break;
+		    case LEAP_NOTINSYNC:
+		    	leaptxt = "unsync";
+			break;
+		    default:
+		    	leaptxt = "LEAP-ERROR";
+			break;
+		}
+
+		msyslog(LOG_INFO, "%s %+.*f%s %s s%d %s%s", ts_str,
 			digits, offset, disptxt,
 			hostnameaddr(hostname, host), stratum,
+			leaptxt,
 			(time_adjusted)
 			    ? " [excess]"
 			    : "");
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/sntp/networking.c /cur/src/external/bsd/ntp/dist/sntp/networking.c
--- external/bsd/ntp/dist/sntp/networking.c	2014-12-24 18:28:14.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/sntp/networking.c	2015-04-07 19:51:18.000000000 -0700
@@ -140,8 +140,12 @@
 	/* Note: pkt_len must be a multiple of 4 at this point! */
 	packet_end = (u_int32*)((char*)rpkt + pkt_len);
 	exten_end = skip_efields(rpkt->exten, packet_end);
-	if (NULL == exten_end)
-		goto unusable;
+	if (NULL == exten_end) {
+		msyslog(LOG_ERR,
+			"%s: Missing extension field.  Discarding.",
+			func_name);
+		return PACKET_UNUSEABLE;
+	}
 	/* get size of MAC in cells; can be zero */
 	exten_len = (u_int)(packet_end - exten_end);
 
@@ -157,7 +161,10 @@
 		break;
 
 	case 3: /* key ID + 3DES MAC -- unsupported! */
-		goto unusable;
+		msyslog(LOG_ERR,
+			"%s: Key ID + 3DES MAC is unsupported.  Discarding.",
+			func_name);
+		return PACKET_UNUSEABLE;
 
 	case 5:	/* key ID + MD5 MAC */
 	case 6:	/* key ID + SHA MAC */
@@ -191,7 +198,10 @@
 		break;
 
 	default:
-		goto unusable;
+		msyslog(LOG_ERR,
+			"%s: Unexpected extension length: %d.  Discarding.",
+			func_name, exten_len);
+		return PACKET_UNUSEABLE;
 	}
 
 	switch (is_authentic) {
@@ -254,7 +264,6 @@
 		msyslog(LOG_ERR,
 			"%s: %s not in sync, skipping this server",
 			func_name, stoa(sender));
-unusable:
 		return SERVER_UNUSEABLE;
 	}
 
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/sntp/scripts/Makefile.in /cur/src/external/bsd/ntp/dist/sntp/scripts/Makefile.in
--- external/bsd/ntp/dist/sntp/scripts/Makefile.in	2014-12-19 12:37:49.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/sntp/scripts/Makefile.in	2015-04-07 19:51:18.000000000 -0700
@@ -38,8 +38,6 @@
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/libopts/m4/libopts.m4 \
 	$(top_srcdir)/libopts/m4/stdnoreturn.m4 \
-	$(top_srcdir)/libevent/m4/openldap-thread-check.m4 \
-	$(top_srcdir)/libevent/m4/openldap.m4 \
 	$(top_srcdir)/m4/hms_search_lib.m4 $(top_srcdir)/m4/libtool.m4 \
 	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
 	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
@@ -59,8 +57,10 @@
 	$(top_srcdir)/m4/ntp_prog_cc.m4 $(top_srcdir)/m4/ntp_sntp.m4 \
 	$(top_srcdir)/m4/ntp_sysexits.m4 \
 	$(top_srcdir)/m4/ntp_ver_suffix.m4 \
-	$(top_srcdir)/m4/os_cflags.m4 $(top_srcdir)/m4/snprintf.m4 \
-	$(top_srcdir)/m4/version.m4 $(top_srcdir)/configure.ac
+	$(top_srcdir)/m4/openldap-thread-check.m4 \
+	$(top_srcdir)/m4/openldap.m4 $(top_srcdir)/m4/os_cflags.m4 \
+	$(top_srcdir)/m4/snprintf.m4 $(top_srcdir)/m4/version.m4 \
+	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
 mkinstalldirs = $(install_sh) -d
@@ -130,6 +130,7 @@
 LD = @LD@
 LDADD_LIBEVENT = @LDADD_LIBEVENT@
 LDADD_LIBNTP = @LDADD_LIBNTP@
+LDADD_LIBUTIL = @LDADD_LIBUTIL@
 LDADD_NTP = @LDADD_NTP@
 LDFLAGS = @LDFLAGS@
 LDFLAGS_NTP = @LDFLAGS_NTP@
@@ -245,6 +246,11 @@
 TIMETRIM_DS = @TIMETRIM_DS@
 TIMETRIM_MS = @TIMETRIM_MS@
 TIMETRIM_NI = @TIMETRIM_NI@
+UPDATE_LEAP_DB = @UPDATE_LEAP_DB@
+UPDATE_LEAP_DL = @UPDATE_LEAP_DL@
+UPDATE_LEAP_DS = @UPDATE_LEAP_DS@
+UPDATE_LEAP_MS = @UPDATE_LEAP_MS@
+UPDATE_LEAP_NI = @UPDATE_LEAP_NI@
 VERSION = @VERSION@
 VER_SUFFIX = @VER_SUFFIX@
 abs_builddir = @abs_builddir@
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/sntp/scripts/cvo.sh /cur/src/external/bsd/ntp/dist/sntp/scripts/cvo.sh
--- external/bsd/ntp/dist/sntp/scripts/cvo.sh	2013-12-27 15:31:15.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/sntp/scripts/cvo.sh	2015-04-07 19:51:18.000000000 -0700
@@ -45,7 +45,13 @@
 	    set `cat /etc/redhat-release`
 	    case "$1" in
 	     CentOS)
-	        CVO_OS=centos$3
+		case "$2" in
+		 Linux)
+		    CVO_OS=centos$4
+		    ;;
+		 *) CVO_OS=centos$3
+		    ;;
+		esac
 	        ;;
 	     Fedora)
 	        CVO_OS=fedora$3
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/sntp/sntp-opts.c /cur/src/external/bsd/ntp/dist/sntp/sntp-opts.c
--- external/bsd/ntp/dist/sntp/sntp-opts.c	2014-12-24 18:28:14.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/sntp/sntp-opts.c	2015-04-07 19:51:18.000000000 -0700
@@ -3,7 +3,7 @@
 /*
  *  EDIT THIS FILE WITH CAUTION  (sntp-opts.c)
  *
- *  It has been AutoGen-ed  December 19, 2014 at 07:51:01 AM by AutoGen 5.18.5pre4
+ *  It has been AutoGen-ed  April  7, 2015 at 04:17:23 AM by AutoGen 5.18.5pre4
  *  From the definitions    sntp-opts.def
  *  and the template file   options
  *
@@ -20,7 +20,7 @@
  * The sntp program is copyrighted and licensed
  * under the following terms:
  *
- *  Copyright (C) 1970-2014 The University of Delaware, all rights reserved.
+ *  Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation, all rights reserved.
  *  This is free software. It is licensed for use, modification and
  *  redistribution under the terms of the NTP License, copies of which
  *  can be seen at:
@@ -33,7 +33,7 @@
  *  both the copyright notice and this permission notice appear in
  *  supporting documentation, and that the name The University of Delaware not be used in
  *  advertising or publicity pertaining to distribution of the software
- *  without specific, written prior permission. The University of Delaware makes no
+ *  without specific, written prior permission. The University of Delaware and Network Time Foundation makes no
  *  representations about the suitability this software for any purpose. It
  *  is provided "as is" without express or implied warranty.
  */
@@ -53,7 +53,7 @@
 #endif
 extern FILE * option_usage_fp;
 #define zCopyright      (sntp_opt_strs+0)
-#define zLicenseDescrip (sntp_opt_strs+310)
+#define zLicenseDescrip (sntp_opt_strs+340)
 
 /*
  *  global included definitions
@@ -71,111 +71,112 @@
 /**
  *  static const strings for sntp options
  */
-static char const sntp_opt_strs[2487] =
-/*     0 */ "sntp 4.2.8\n"
-            "Copyright (C) 1970-2014 The University of Delaware, all rights reserved.\n"
+static char const sntp_opt_strs[2549] =
+/*     0 */ "sntp 4.2.8p2\n"
+            "Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation, all rights reserved.\n"
             "This is free software. It is licensed for use, modification and\n"
             "redistribution under the terms of the NTP License, copies of which\n"
             "can be seen at:\n"
             "  <http://ntp.org/license>\n"
             "  <http://opensource.org/licenses/ntp-license.php>\n\0"
-/*   310 */ "Permission to use, copy, modify, and distribute this software and its\n"
+/*   340 */ "Permission to use, copy, modify, and distribute this software and its\n"
             "documentation for any purpose with or without fee is hereby granted,\n"
             "provided that the above copyright notice appears in all copies and that\n"
             "both the copyright notice and this permission notice appear in supporting\n"
             "documentation, and that the name The University of Delaware not be used in\n"
             "advertising or publicity pertaining to distribution of the software without\n"
-            "specific, written prior permission.  The University of Delaware makes no\n"
-            "representations about the suitability this software for any purpose.  It is\n"
-            "provided \"as is\" without express or implied warranty.\n\0"
-/*   950 */ "Force IPv4 DNS name resolution\0"
-/*   981 */ "IPV4\0"
-/*   986 */ "ipv4\0"
-/*   991 */ "Force IPv6 DNS name resolution\0"
-/*  1022 */ "IPV6\0"
-/*  1027 */ "ipv6\0"
-/*  1032 */ "Enable authentication with the key auth-keynumber\0"
-/*  1082 */ "AUTHENTICATION\0"
-/*  1097 */ "authentication\0"
-/*  1112 */ "Listen to the address specified for broadcast time sync\0"
-/*  1168 */ "BROADCAST\0"
-/*  1178 */ "broadcast\0"
-/*  1188 */ "Concurrently query all IPs returned for host-name\0"
-/*  1238 */ "CONCURRENT\0"
-/*  1249 */ "concurrent\0"
-/*  1260 */ "Increase debug verbosity level\0"
-/*  1291 */ "DEBUG_LEVEL\0"
-/*  1303 */ "debug-level\0"
-/*  1315 */ "Set the debug verbosity level\0"
-/*  1345 */ "SET_DEBUG_LEVEL\0"
-/*  1361 */ "set-debug-level\0"
-/*  1377 */ "The gap (in milliseconds) between time requests\0"
-/*  1425 */ "GAP\0"
-/*  1429 */ "gap\0"
-/*  1433 */ "KoD history filename\0"
-/*  1454 */ "KOD\0"
-/*  1458 */ "kod\0"
-/*  1462 */ "/var/db/ntp-kod\0"
-/*  1478 */ "Look in this file for the key specified with -a\0"
-/*  1526 */ "KEYFILE\0"
-/*  1534 */ "keyfile\0"
-/*  1542 */ "Log to specified logfile\0"
-/*  1567 */ "LOGFILE\0"
-/*  1575 */ "logfile\0"
-/*  1583 */ "Adjustments less than steplimit msec will be slewed\0"
-/*  1635 */ "STEPLIMIT\0"
-/*  1645 */ "steplimit\0"
-/*  1655 */ "Send int as our NTP protocol version\0"
-/*  1692 */ "NTPVERSION\0"
-/*  1703 */ "ntpversion\0"
-/*  1714 */ "Use the NTP Reserved Port (port 123)\0"
-/*  1751 */ "USERESERVEDPORT\0"
-/*  1767 */ "usereservedport\0"
-/*  1783 */ "OK to 'step' the time with settimeofday(2)\0"
-/*  1826 */ "STEP\0"
-/*  1831 */ "step\0"
-/*  1836 */ "OK to 'slew' the time with adjtime(2)\0"
-/*  1874 */ "SLEW\0"
-/*  1879 */ "slew\0"
-/*  1884 */ "The number of seconds to wait for responses\0"
-/*  1928 */ "TIMEOUT\0"
-/*  1936 */ "timeout\0"
-/*  1944 */ "Wait for pending replies (if not setting the time)\0"
-/*  1995 */ "WAIT\0"
-/*  2000 */ "no-wait\0"
-/*  2008 */ "no\0"
-/*  2011 */ "display extended usage information and exit\0"
-/*  2055 */ "help\0"
-/*  2060 */ "extended usage information passed thru pager\0"
-/*  2105 */ "more-help\0"
-/*  2115 */ "output version information and exit\0"
-/*  2151 */ "version\0"
-/*  2159 */ "save the option state to a config file\0"
-/*  2198 */ "save-opts\0"
-/*  2208 */ "load options from a config file\0"
-/*  2240 */ "LOAD_OPTS\0"
-/*  2250 */ "no-load-opts\0"
-/*  2263 */ "SNTP\0"
-/*  2268 */ "sntp - standard Simple Network Time Protocol client program - Ver. 4.2.8\n"
+            "specific, written prior permission.  The University of Delaware and Network\n"
+            "Time Foundation makes no representations about the suitability this\n"
+            "software for any purpose.  It is provided \"as is\" without express or\n"
+            "implied warranty.\n\0"
+/*  1008 */ "Force IPv4 DNS name resolution\0"
+/*  1039 */ "IPV4\0"
+/*  1044 */ "ipv4\0"
+/*  1049 */ "Force IPv6 DNS name resolution\0"
+/*  1080 */ "IPV6\0"
+/*  1085 */ "ipv6\0"
+/*  1090 */ "Enable authentication with the key auth-keynumber\0"
+/*  1140 */ "AUTHENTICATION\0"
+/*  1155 */ "authentication\0"
+/*  1170 */ "Listen to the address specified for broadcast time sync\0"
+/*  1226 */ "BROADCAST\0"
+/*  1236 */ "broadcast\0"
+/*  1246 */ "Concurrently query all IPs returned for host-name\0"
+/*  1296 */ "CONCURRENT\0"
+/*  1307 */ "concurrent\0"
+/*  1318 */ "Increase debug verbosity level\0"
+/*  1349 */ "DEBUG_LEVEL\0"
+/*  1361 */ "debug-level\0"
+/*  1373 */ "Set the debug verbosity level\0"
+/*  1403 */ "SET_DEBUG_LEVEL\0"
+/*  1419 */ "set-debug-level\0"
+/*  1435 */ "The gap (in milliseconds) between time requests\0"
+/*  1483 */ "GAP\0"
+/*  1487 */ "gap\0"
+/*  1491 */ "KoD history filename\0"
+/*  1512 */ "KOD\0"
+/*  1516 */ "kod\0"
+/*  1520 */ "/var/db/ntp-kod\0"
+/*  1536 */ "Look in this file for the key specified with -a\0"
+/*  1584 */ "KEYFILE\0"
+/*  1592 */ "keyfile\0"
+/*  1600 */ "Log to specified logfile\0"
+/*  1625 */ "LOGFILE\0"
+/*  1633 */ "logfile\0"
+/*  1641 */ "Adjustments less than steplimit msec will be slewed\0"
+/*  1693 */ "STEPLIMIT\0"
+/*  1703 */ "steplimit\0"
+/*  1713 */ "Send int as our NTP protocol version\0"
+/*  1750 */ "NTPVERSION\0"
+/*  1761 */ "ntpversion\0"
+/*  1772 */ "Use the NTP Reserved Port (port 123)\0"
+/*  1809 */ "USERESERVEDPORT\0"
+/*  1825 */ "usereservedport\0"
+/*  1841 */ "OK to 'step' the time with settimeofday(2)\0"
+/*  1884 */ "STEP\0"
+/*  1889 */ "step\0"
+/*  1894 */ "OK to 'slew' the time with adjtime(2)\0"
+/*  1932 */ "SLEW\0"
+/*  1937 */ "slew\0"
+/*  1942 */ "The number of seconds to wait for responses\0"
+/*  1986 */ "TIMEOUT\0"
+/*  1994 */ "timeout\0"
+/*  2002 */ "Wait for pending replies (if not setting the time)\0"
+/*  2053 */ "WAIT\0"
+/*  2058 */ "no-wait\0"
+/*  2066 */ "no\0"
+/*  2069 */ "display extended usage information and exit\0"
+/*  2113 */ "help\0"
+/*  2118 */ "extended usage information passed thru pager\0"
+/*  2163 */ "more-help\0"
+/*  2173 */ "output version information and exit\0"
+/*  2209 */ "version\0"
+/*  2217 */ "save the option state to a config file\0"
+/*  2256 */ "save-opts\0"
+/*  2266 */ "load options from a config file\0"
+/*  2298 */ "LOAD_OPTS\0"
+/*  2308 */ "no-load-opts\0"
+/*  2321 */ "SNTP\0"
+/*  2326 */ "sntp - standard Simple Network Time Protocol client program - Ver. 4.2.8p2\n"
             "Usage:  %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... \\\n"
             "\t\t[ hostname-or-IP ...]\n\0"
-/*  2425 */ "$HOME\0"
-/*  2431 */ ".\0"
-/*  2433 */ ".ntprc\0"
-/*  2440 */ "http://bugs.ntp.org, bugs@ntp.org\0"
-/*  2474 */ "\n\0"
-/*  2476 */ "sntp 4.2.8";
+/*  2485 */ "$HOME\0"
+/*  2491 */ ".\0"
+/*  2493 */ ".ntprc\0"
+/*  2500 */ "http://bugs.ntp.org, bugs@ntp.org\0"
+/*  2534 */ "\n\0"
+/*  2536 */ "sntp 4.2.8p2";
 
 /**
  *  ipv4 option description with
  *  "Must also have options" and "Incompatible options":
  */
 /** Descriptive text for the ipv4 option */
-#define IPV4_DESC      (sntp_opt_strs+950)
+#define IPV4_DESC      (sntp_opt_strs+1008)
 /** Upper-cased name for the ipv4 option */
-#define IPV4_NAME      (sntp_opt_strs+981)
+#define IPV4_NAME      (sntp_opt_strs+1039)
 /** Name string for the ipv4 option */
-#define IPV4_name      (sntp_opt_strs+986)
+#define IPV4_name      (sntp_opt_strs+1044)
 /** Other options that appear in conjunction with the ipv4 option */
 static int const aIpv4CantList[] = {
     INDEX_OPT_IPV6, NO_EQUIVALENT };
@@ -187,11 +188,11 @@
  *  "Must also have options" and "Incompatible options":
  */
 /** Descriptive text for the ipv6 option */
-#define IPV6_DESC      (sntp_opt_strs+991)
+#define IPV6_DESC      (sntp_opt_strs+1049)
 /** Upper-cased name for the ipv6 option */
-#define IPV6_NAME      (sntp_opt_strs+1022)
+#define IPV6_NAME      (sntp_opt_strs+1080)
 /** Name string for the ipv6 option */
-#define IPV6_name      (sntp_opt_strs+1027)
+#define IPV6_name      (sntp_opt_strs+1085)
 /** Other options that appear in conjunction with the ipv6 option */
 static int const aIpv6CantList[] = {
     INDEX_OPT_IPV4, NO_EQUIVALENT };
@@ -202,11 +203,11 @@
  *  authentication option description:
  */
 /** Descriptive text for the authentication option */
-#define AUTHENTICATION_DESC      (sntp_opt_strs+1032)
+#define AUTHENTICATION_DESC      (sntp_opt_strs+1090)
 /** Upper-cased name for the authentication option */
-#define AUTHENTICATION_NAME      (sntp_opt_strs+1082)
+#define AUTHENTICATION_NAME      (sntp_opt_strs+1140)
 /** Name string for the authentication option */
-#define AUTHENTICATION_name      (sntp_opt_strs+1097)
+#define AUTHENTICATION_name      (sntp_opt_strs+1155)
 /** Compiled in flag settings for the authentication option */
 #define AUTHENTICATION_FLAGS     (OPTST_DISABLED \
         | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
@@ -215,11 +216,11 @@
  *  broadcast option description:
  */
 /** Descriptive text for the broadcast option */
-#define BROADCAST_DESC      (sntp_opt_strs+1112)
+#define BROADCAST_DESC      (sntp_opt_strs+1170)
 /** Upper-cased name for the broadcast option */
-#define BROADCAST_NAME      (sntp_opt_strs+1168)
+#define BROADCAST_NAME      (sntp_opt_strs+1226)
 /** Name string for the broadcast option */
-#define BROADCAST_name      (sntp_opt_strs+1178)
+#define BROADCAST_name      (sntp_opt_strs+1236)
 /** Compiled in flag settings for the broadcast option */
 #define BROADCAST_FLAGS     (OPTST_DISABLED | OPTST_STACKED \
         | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
@@ -228,11 +229,11 @@
  *  concurrent option description:
  */
 /** Descriptive text for the concurrent option */
-#define CONCURRENT_DESC      (sntp_opt_strs+1188)
+#define CONCURRENT_DESC      (sntp_opt_strs+1246)
 /** Upper-cased name for the concurrent option */
-#define CONCURRENT_NAME      (sntp_opt_strs+1238)
+#define CONCURRENT_NAME      (sntp_opt_strs+1296)
 /** Name string for the concurrent option */
-#define CONCURRENT_name      (sntp_opt_strs+1249)
+#define CONCURRENT_name      (sntp_opt_strs+1307)
 /** Compiled in flag settings for the concurrent option */
 #define CONCURRENT_FLAGS     (OPTST_DISABLED | OPTST_STACKED \
         | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
@@ -241,11 +242,11 @@
  *  debug-level option description:
  */
 /** Descriptive text for the debug-level option */
-#define DEBUG_LEVEL_DESC      (sntp_opt_strs+1260)
+#define DEBUG_LEVEL_DESC      (sntp_opt_strs+1318)
 /** Upper-cased name for the debug-level option */
-#define DEBUG_LEVEL_NAME      (sntp_opt_strs+1291)
+#define DEBUG_LEVEL_NAME      (sntp_opt_strs+1349)
 /** Name string for the debug-level option */
-#define DEBUG_LEVEL_name      (sntp_opt_strs+1303)
+#define DEBUG_LEVEL_name      (sntp_opt_strs+1361)
 /** Compiled in flag settings for the debug-level option */
 #define DEBUG_LEVEL_FLAGS     (OPTST_DISABLED)
 
@@ -253,11 +254,11 @@
  *  set-debug-level option description:
  */
 /** Descriptive text for the set-debug-level option */
-#define SET_DEBUG_LEVEL_DESC      (sntp_opt_strs+1315)
+#define SET_DEBUG_LEVEL_DESC      (sntp_opt_strs+1373)
 /** Upper-cased name for the set-debug-level option */
-#define SET_DEBUG_LEVEL_NAME      (sntp_opt_strs+1345)
+#define SET_DEBUG_LEVEL_NAME      (sntp_opt_strs+1403)
 /** Name string for the set-debug-level option */
-#define SET_DEBUG_LEVEL_name      (sntp_opt_strs+1361)
+#define SET_DEBUG_LEVEL_name      (sntp_opt_strs+1419)
 /** Compiled in flag settings for the set-debug-level option */
 #define SET_DEBUG_LEVEL_FLAGS     (OPTST_DISABLED \
         | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
@@ -266,11 +267,11 @@
  *  gap option description:
  */
 /** Descriptive text for the gap option */
-#define GAP_DESC      (sntp_opt_strs+1377)
+#define GAP_DESC      (sntp_opt_strs+1435)
 /** Upper-cased name for the gap option */
-#define GAP_NAME      (sntp_opt_strs+1425)
+#define GAP_NAME      (sntp_opt_strs+1483)
 /** Name string for the gap option */
-#define GAP_name      (sntp_opt_strs+1429)
+#define GAP_name      (sntp_opt_strs+1487)
 /** The compiled in default value for the gap option argument */
 #define GAP_DFT_ARG   ((char const*)50)
 /** Compiled in flag settings for the gap option */
@@ -281,13 +282,13 @@
  *  kod option description:
  */
 /** Descriptive text for the kod option */
-#define KOD_DESC      (sntp_opt_strs+1433)
+#define KOD_DESC      (sntp_opt_strs+1491)
 /** Upper-cased name for the kod option */
-#define KOD_NAME      (sntp_opt_strs+1454)
+#define KOD_NAME      (sntp_opt_strs+1512)
 /** Name string for the kod option */
-#define KOD_name      (sntp_opt_strs+1458)
+#define KOD_name      (sntp_opt_strs+1516)
 /** The compiled in default value for the kod option argument */
-#define KOD_DFT_ARG   (sntp_opt_strs+1462)
+#define KOD_DFT_ARG   (sntp_opt_strs+1520)
 /** Compiled in flag settings for the kod option */
 #define KOD_FLAGS     (OPTST_DISABLED \
         | OPTST_SET_ARGTYPE(OPARG_TYPE_FILE))
@@ -296,11 +297,11 @@
  *  keyfile option description:
  */
 /** Descriptive text for the keyfile option */
-#define KEYFILE_DESC      (sntp_opt_strs+1478)
+#define KEYFILE_DESC      (sntp_opt_strs+1536)
 /** Upper-cased name for the keyfile option */
-#define KEYFILE_NAME      (sntp_opt_strs+1526)
+#define KEYFILE_NAME      (sntp_opt_strs+1584)
 /** Name string for the keyfile option */
-#define KEYFILE_name      (sntp_opt_strs+1534)
+#define KEYFILE_name      (sntp_opt_strs+1592)
 /** Compiled in flag settings for the keyfile option */
 #define KEYFILE_FLAGS     (OPTST_DISABLED \
         | OPTST_SET_ARGTYPE(OPARG_TYPE_FILE))
@@ -309,11 +310,11 @@
  *  logfile option description:
  */
 /** Descriptive text for the logfile option */
-#define LOGFILE_DESC      (sntp_opt_strs+1542)
+#define LOGFILE_DESC      (sntp_opt_strs+1600)
 /** Upper-cased name for the logfile option */
-#define LOGFILE_NAME      (sntp_opt_strs+1567)
+#define LOGFILE_NAME      (sntp_opt_strs+1625)
 /** Name string for the logfile option */
-#define LOGFILE_name      (sntp_opt_strs+1575)
+#define LOGFILE_name      (sntp_opt_strs+1633)
 /** Compiled in flag settings for the logfile option */
 #define LOGFILE_FLAGS     (OPTST_DISABLED \
         | OPTST_SET_ARGTYPE(OPARG_TYPE_FILE))
@@ -322,11 +323,11 @@
  *  steplimit option description:
  */
 /** Descriptive text for the steplimit option */
-#define STEPLIMIT_DESC      (sntp_opt_strs+1583)
+#define STEPLIMIT_DESC      (sntp_opt_strs+1641)
 /** Upper-cased name for the steplimit option */
-#define STEPLIMIT_NAME      (sntp_opt_strs+1635)
+#define STEPLIMIT_NAME      (sntp_opt_strs+1693)
 /** Name string for the steplimit option */
-#define STEPLIMIT_name      (sntp_opt_strs+1645)
+#define STEPLIMIT_name      (sntp_opt_strs+1703)
 /** Compiled in flag settings for the steplimit option */
 #define STEPLIMIT_FLAGS     (OPTST_DISABLED \
         | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
@@ -335,11 +336,11 @@
  *  ntpversion option description:
  */
 /** Descriptive text for the ntpversion option */
-#define NTPVERSION_DESC      (sntp_opt_strs+1655)
+#define NTPVERSION_DESC      (sntp_opt_strs+1713)
 /** Upper-cased name for the ntpversion option */
-#define NTPVERSION_NAME      (sntp_opt_strs+1692)
+#define NTPVERSION_NAME      (sntp_opt_strs+1750)
 /** Name string for the ntpversion option */
-#define NTPVERSION_name      (sntp_opt_strs+1703)
+#define NTPVERSION_name      (sntp_opt_strs+1761)
 /** The compiled in default value for the ntpversion option argument */
 #define NTPVERSION_DFT_ARG   ((char const*)4)
 /** Compiled in flag settings for the ntpversion option */
@@ -350,11 +351,11 @@
  *  usereservedport option description:
  */
 /** Descriptive text for the usereservedport option */
-#define USERESERVEDPORT_DESC      (sntp_opt_strs+1714)
+#define USERESERVEDPORT_DESC      (sntp_opt_strs+1772)
 /** Upper-cased name for the usereservedport option */
-#define USERESERVEDPORT_NAME      (sntp_opt_strs+1751)
+#define USERESERVEDPORT_NAME      (sntp_opt_strs+1809)
 /** Name string for the usereservedport option */
-#define USERESERVEDPORT_name      (sntp_opt_strs+1767)
+#define USERESERVEDPORT_name      (sntp_opt_strs+1825)
 /** Compiled in flag settings for the usereservedport option */
 #define USERESERVEDPORT_FLAGS     (OPTST_DISABLED)
 
@@ -362,11 +363,11 @@
  *  step option description:
  */
 /** Descriptive text for the step option */
-#define STEP_DESC      (sntp_opt_strs+1783)
+#define STEP_DESC      (sntp_opt_strs+1841)
 /** Upper-cased name for the step option */
-#define STEP_NAME      (sntp_opt_strs+1826)
+#define STEP_NAME      (sntp_opt_strs+1884)
 /** Name string for the step option */
-#define STEP_name      (sntp_opt_strs+1831)
+#define STEP_name      (sntp_opt_strs+1889)
 /** Compiled in flag settings for the step option */
 #define STEP_FLAGS     (OPTST_DISABLED)
 
@@ -374,11 +375,11 @@
  *  slew option description:
  */
 /** Descriptive text for the slew option */
-#define SLEW_DESC      (sntp_opt_strs+1836)
+#define SLEW_DESC      (sntp_opt_strs+1894)
 /** Upper-cased name for the slew option */
-#define SLEW_NAME      (sntp_opt_strs+1874)
+#define SLEW_NAME      (sntp_opt_strs+1932)
 /** Name string for the slew option */
-#define SLEW_name      (sntp_opt_strs+1879)
+#define SLEW_name      (sntp_opt_strs+1937)
 /** Compiled in flag settings for the slew option */
 #define SLEW_FLAGS     (OPTST_DISABLED)
 
@@ -386,11 +387,11 @@
  *  timeout option description:
  */
 /** Descriptive text for the timeout option */
-#define TIMEOUT_DESC      (sntp_opt_strs+1884)
+#define TIMEOUT_DESC      (sntp_opt_strs+1942)
 /** Upper-cased name for the timeout option */
-#define TIMEOUT_NAME      (sntp_opt_strs+1928)
+#define TIMEOUT_NAME      (sntp_opt_strs+1986)
 /** Name string for the timeout option */
-#define TIMEOUT_name      (sntp_opt_strs+1936)
+#define TIMEOUT_name      (sntp_opt_strs+1994)
 /** The compiled in default value for the timeout option argument */
 #define TIMEOUT_DFT_ARG   ((char const*)5)
 /** Compiled in flag settings for the timeout option */
@@ -401,13 +402,13 @@
  *  wait option description:
  */
 /** Descriptive text for the wait option */
-#define WAIT_DESC      (sntp_opt_strs+1944)
+#define WAIT_DESC      (sntp_opt_strs+2002)
 /** Upper-cased name for the wait option */
-#define WAIT_NAME      (sntp_opt_strs+1995)
+#define WAIT_NAME      (sntp_opt_strs+2053)
 /** disablement name for the wait option */
-#define NOT_WAIT_name  (sntp_opt_strs+2000)
+#define NOT_WAIT_name  (sntp_opt_strs+2058)
 /** disablement prefix for the wait option */
-#define NOT_WAIT_PFX   (sntp_opt_strs+2008)
+#define NOT_WAIT_PFX   (sntp_opt_strs+2066)
 /** Name string for the wait option */
 #define WAIT_name      (NOT_WAIT_name + 3)
 /** Compiled in flag settings for the wait option */
@@ -416,11 +417,11 @@
 /*
  *  Help/More_Help/Version option descriptions:
  */
-#define HELP_DESC       (sntp_opt_strs+2011)
-#define HELP_name       (sntp_opt_strs+2055)
+#define HELP_DESC       (sntp_opt_strs+2069)
+#define HELP_name       (sntp_opt_strs+2113)
 #ifdef HAVE_WORKING_FORK
-#define MORE_HELP_DESC  (sntp_opt_strs+2060)
-#define MORE_HELP_name  (sntp_opt_strs+2105)
+#define MORE_HELP_DESC  (sntp_opt_strs+2118)
+#define MORE_HELP_name  (sntp_opt_strs+2163)
 #define MORE_HELP_FLAGS (OPTST_IMM | OPTST_NO_INIT)
 #else
 #define MORE_HELP_DESC  HELP_DESC
@@ -433,14 +434,14 @@
 #  define VER_FLAGS     (OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) | \
                          OPTST_ARG_OPTIONAL | OPTST_IMM | OPTST_NO_INIT)
 #endif
-#define VER_DESC        (sntp_opt_strs+2115)
-#define VER_name        (sntp_opt_strs+2151)
-#define SAVE_OPTS_DESC  (sntp_opt_strs+2159)
-#define SAVE_OPTS_name  (sntp_opt_strs+2198)
-#define LOAD_OPTS_DESC     (sntp_opt_strs+2208)
-#define LOAD_OPTS_NAME     (sntp_opt_strs+2240)
-#define NO_LOAD_OPTS_name  (sntp_opt_strs+2250)
-#define LOAD_OPTS_pfx      (sntp_opt_strs+2008)
+#define VER_DESC        (sntp_opt_strs+2173)
+#define VER_name        (sntp_opt_strs+2209)
+#define SAVE_OPTS_DESC  (sntp_opt_strs+2217)
+#define SAVE_OPTS_name  (sntp_opt_strs+2256)
+#define LOAD_OPTS_DESC     (sntp_opt_strs+2266)
+#define LOAD_OPTS_NAME     (sntp_opt_strs+2298)
+#define NO_LOAD_OPTS_name  (sntp_opt_strs+2308)
+#define LOAD_OPTS_pfx      (sntp_opt_strs+2066)
 #define LOAD_OPTS_name     (NO_LOAD_OPTS_name + 3)
 /**
  *  Declare option callback procedures
@@ -746,24 +747,24 @@
 
 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
 /** Reference to the upper cased version of sntp. */
-#define zPROGNAME       (sntp_opt_strs+2263)
+#define zPROGNAME       (sntp_opt_strs+2321)
 /** Reference to the title line for sntp usage. */
-#define zUsageTitle     (sntp_opt_strs+2268)
+#define zUsageTitle     (sntp_opt_strs+2326)
 /** sntp configuration file name. */
-#define zRcName         (sntp_opt_strs+2433)
+#define zRcName         (sntp_opt_strs+2493)
 /** Directories to search for sntp config files. */
 static char const * const apzHomeList[3] = {
-    sntp_opt_strs+2425,
-    sntp_opt_strs+2431,
+    sntp_opt_strs+2485,
+    sntp_opt_strs+2491,
     NULL };
 /** The sntp program bug email address. */
-#define zBugsAddr       (sntp_opt_strs+2440)
+#define zBugsAddr       (sntp_opt_strs+2500)
 /** Clarification/explanation of what sntp does. */
-#define zExplain        (sntp_opt_strs+2474)
+#define zExplain        (sntp_opt_strs+2534)
 /** Extra detail explaining what sntp does. */
 #define zDetail         (NULL)
 /** The full version string for sntp. */
-#define zFullVersion    (sntp_opt_strs+2476)
+#define zFullVersion    (sntp_opt_strs+2536)
 /* extracted from optcode.tlib near line 364 */
 
 #if defined(ENABLE_NLS)
@@ -906,7 +907,9 @@
  * Code to handle the steplimit option.
  * If the time adjustment is less than @file{steplimit} milliseconds,
  * slew the amount using @command{adjtime(2)}.  Otherwise, step the
- * correction using @command{settimeofday(2)}.
+ * correction using @command{settimeofday(2)}.  The default value is 0,
+ * which means all adjustments will be stepped.  This is a feature, as
+ * different situations demand different values.
  * @param[in] pOptions the sntp options data structure
  * @param[in,out] pOptDesc the option descriptor for this option.
  */
@@ -1172,8 +1175,8 @@
      translate option names.
    */
   /* referenced via sntpOptions.pzCopyright */
-  puts(_("sntp 4.2.8\n\
-Copyright (C) 1970-2014 The University of Delaware, all rights reserved.\n\
+  puts(_("sntp 4.2.8p2\n\
+Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation, all rights reserved.\n\
 This is free software. It is licensed for use, modification and\n\
 redistribution under the terms of the NTP License, copies of which\n\
 can be seen at:\n"));
@@ -1187,9 +1190,10 @@
 both the copyright notice and this permission notice appear in supporting\n\
 documentation, and that the name The University of Delaware not be used in\n\
 advertising or publicity pertaining to distribution of the software without\n\
-specific, written prior permission.  The University of Delaware makes no\n\
-representations about the suitability this software for any purpose.  It is\n\
-provided \"as is\" without express or implied warranty.\n"));
+specific, written prior permission.  The University of Delaware and Network\n\
+Time Foundation makes no representations about the suitability this\n\
+software for any purpose.  It is provided \"as is\" without express or\n\
+implied warranty.\n"));
 
   /* referenced via sntpOptions.pOptDesc->pzText */
   puts(_("Force IPv4 DNS name resolution"));
@@ -1261,7 +1265,7 @@
   puts(_("load options from a config file"));
 
   /* referenced via sntpOptions.pzUsageTitle */
-  puts(_("sntp - standard Simple Network Time Protocol client program - Ver. 4.2.8\n\
+  puts(_("sntp - standard Simple Network Time Protocol client program - Ver. 4.2.8p2\n\
 Usage:  %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... \\\n\
 \t\t[ hostname-or-IP ...]\n"));
 
@@ -1269,7 +1273,7 @@
   puts(_("\n"));
 
   /* referenced via sntpOptions.pzFullVersion */
-  puts(_("sntp 4.2.8"));
+  puts(_("sntp 4.2.8p2"));
 
   /* referenced via sntpOptions.pzFullUsage */
   puts(_("<<<NOT-FOUND>>>"));
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/sntp/sntp-opts.def /cur/src/external/bsd/ntp/dist/sntp/sntp-opts.def
--- external/bsd/ntp/dist/sntp/sntp-opts.def	2014-12-19 12:37:43.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/sntp/sntp-opts.def	2015-04-07 19:51:18.000000000 -0700
@@ -157,7 +157,9 @@
   doc		= <<- _EndOfDoc_
 	If the time adjustment is less than @file{steplimit} milliseconds,
 	slew the amount using @command{adjtime(2)}.  Otherwise, step the
-	correction using @command{settimeofday(2)}. 
+	correction using @command{settimeofday(2)}.  The default value is 0,
+	which means all adjustments will be stepped.  This is a feature, as
+	different situations demand different values.
 	_EndOfDoc_;
 };
 
@@ -279,7 +281,8 @@
 is displayed.
 Finally, the
 .Em stratum
-of the host is reported.
+of the host is reported
+and the leap indicator is decoded and displayed.
 	_END_PROG_MDOC_DESCRIP;
 };
 
@@ -292,14 +295,27 @@
 is the simplest use of this program
 and can be run as an unprivileged command
 to check the current time and error in the local clock.
-.It Li "sntp -a ntpserver.somewhere"
+.It Li "sntp -Ss -M 128 ntpserver.somewhere"
 With suitable privilege,
 run as a command
 or from a
 .Xr cron 8
 job,
-.Ic "sntp -a"
-will reset the local clock from a synchronized specified server,
+.Ic "sntp -Ss -M 128 ntpserver.somewhere"
+will request the time from the server,
+and if that server reports that it is synchronized
+then if the offset adjustment is less than 128 milliseconds
+the correction will be slewed,
+and if the correction is more than 128 milliseconds
+the correction  will be stepped.
+.It Li "sntp -S ntpserver.somewhere"
+With suitable privilege,
+run as a command
+or from a
+.Xr cron 8
+job,
+.Ic "sntp -S ntpserver.somewhere"
+will set (step) the local clock from a synchronized specified server,
 like the (deprecated)
 .Xr ntpdate 1ntpdatemdoc ,
 or
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/sntp/sntp-opts.h /cur/src/external/bsd/ntp/dist/sntp/sntp-opts.h
--- external/bsd/ntp/dist/sntp/sntp-opts.h	2014-12-24 18:28:14.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/sntp/sntp-opts.h	2015-04-07 19:51:18.000000000 -0700
@@ -3,7 +3,7 @@
 /*
  *  EDIT THIS FILE WITH CAUTION  (sntp-opts.h)
  *
- *  It has been AutoGen-ed  December 19, 2014 at 07:51:00 AM by AutoGen 5.18.5pre4
+ *  It has been AutoGen-ed  April  7, 2015 at 04:17:22 AM by AutoGen 5.18.5pre4
  *  From the definitions    sntp-opts.def
  *  and the template file   options
  *
@@ -20,7 +20,7 @@
  * The sntp program is copyrighted and licensed
  * under the following terms:
  *
- *  Copyright (C) 1970-2014 The University of Delaware, all rights reserved.
+ *  Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation, all rights reserved.
  *  This is free software. It is licensed for use, modification and
  *  redistribution under the terms of the NTP License, copies of which
  *  can be seen at:
@@ -33,7 +33,7 @@
  *  both the copyright notice and this permission notice appear in
  *  supporting documentation, and that the name The University of Delaware not be used in
  *  advertising or publicity pertaining to distribution of the software
- *  without specific, written prior permission. The University of Delaware makes no
+ *  without specific, written prior permission. The University of Delaware and Network Time Foundation makes no
  *  representations about the suitability this software for any purpose. It
  *  is provided "as is" without express or implied warranty.
  */
@@ -93,9 +93,9 @@
 /** count of all options for sntp */
 #define OPTION_CT    23
 /** sntp version */
-#define SNTP_VERSION       "4.2.8"
+#define SNTP_VERSION       "4.2.8p2"
 /** Full sntp version text */
-#define SNTP_FULL_VERSION  "sntp 4.2.8"
+#define SNTP_FULL_VERSION  "sntp 4.2.8p2"
 
 /**
  *  Interface defines for all options.  Replace "n" with the UPPER_CASED
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/sntp/sntp.1sntpman /cur/src/external/bsd/ntp/dist/sntp/sntp.1sntpman
--- external/bsd/ntp/dist/sntp/sntp.1sntpman	2014-12-19 12:37:43.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/sntp/sntp.1sntpman	2015-04-07 19:51:18.000000000 -0700
@@ -10,11 +10,11 @@
 .ds B-Font B
 .ds I-Font I
 .ds R-Font R
-.TH sntp 1sntpman "19 Dec 2014" "4.2.8" "User Commands"
+.TH sntp 1sntpman "07 Apr 2015" "4.2.8p2" "User Commands"
 .\"
-.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-4dayXk/ag-feaqWk)
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-E6aqmA/ag-76ailA)
 .\"
-.\" It has been AutoGen-ed December 19, 2014 at 07:51:32 AM by AutoGen 5.18.5pre4
+.\" It has been AutoGen-ed April 7, 2015 at 04:18:00 AM by AutoGen 5.18.5pre4
 .\" From the definitions sntp-opts.def
 .\" and the template file agman-cmd.tpl
 .SH NAME
@@ -72,7 +72,8 @@
 is displayed.
 Finally, the
 \fIstratum\f[]
-of the host is reported.
+of the host is reported
+and the leap indicator is decoded and displayed.
 .SH "OPTIONS"
 .TP
 .NOP \f\*[B-Font]\-4\f[], \f\*[B-Font]\-\-ipv4\f[]
@@ -188,7 +189,9 @@
 .sp
 If the time adjustment is less than \fIsteplimit\fP milliseconds,
 slew the amount using \fBadjtime(2)\fP.  Otherwise, step the
-correction using \fBsettimeofday(2)\fP. 
+correction using \fBsettimeofday(2)\fP.  The default value is 0,
+which means all adjustments will be stepped.  This is a feature, as
+different situations demand different values.
 .TP
 .NOP \f\*[B-Font]\-o\f[] \f\*[I-Font]number\f[], \f\*[B-Font]\-\-ntpversion\f[]=\f\*[I-Font]number\f[]
 Send \fBint\fP as our NTP protocol version.
@@ -289,14 +292,28 @@
 and can be run as an unprivileged command
 to check the current time and error in the local clock.
 .TP 7
-.NOP \f[C]sntp \-a ntpserver.somewhere\f[]
+.NOP \f[C]sntp \-Ss \-M 128 ntpserver.somewhere\f[]
 With suitable privilege,
 run as a command
 or from a
 \fCcron\fR(8)\f[]
 job,
-\f\*[B-Font]sntp \-a\f[]
-will reset the local clock from a synchronized specified server,
+\f\*[B-Font]sntp \-Ss \-M 128 ntpserver.somewhere\f[]
+will request the time from the server,
+and if that server reports that it is synchronized
+then if the offset adjustment is less than 128 milliseconds
+the correction will be slewed,
+and if the correction is more than 128 milliseconds
+the correction  will be stepped.
+.TP 7
+.NOP \f[C]sntp \-S ntpserver.somewhere\f[]
+With suitable privilege,
+run as a command
+or from a
+\fCcron\fR(8)\f[]
+job,
+\f\*[B-Font]sntp \-S ntpserver.somewhere\f[]
+will set (step) the local clock from a synchronized specified server,
 like the (deprecated)
 \fCntpdate\fR(1ntpdatemdoc)\f[],
 or
@@ -331,7 +348,7 @@
 .NOP  "Dave Hart" 
 .br
 .SH "COPYRIGHT"
-Copyright (C) 1970-2014 The University of Delaware all rights reserved.
+Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation all rights reserved.
 This program is released under the terms of the NTP license, <http://ntp.org/license>.
 .SH "BUGS"
 Please send bug reports to: http://bugs.ntp.org, bugs@ntp.org
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/sntp/sntp.1sntpmdoc /cur/src/external/bsd/ntp/dist/sntp/sntp.1sntpmdoc
--- external/bsd/ntp/dist/sntp/sntp.1sntpmdoc	2014-12-19 12:37:44.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/sntp/sntp.1sntpmdoc	2015-04-07 19:51:18.000000000 -0700
@@ -1,9 +1,9 @@
-.Dd December 19 2014
+.Dd April 7 2015
 .Dt SNTP 1sntpmdoc User Commands
 .Os
 .\"  EDIT THIS FILE WITH CAUTION  (sntp-opts.mdoc)
 .\"
-.\"  It has been AutoGen-ed  December 19, 2014 at 07:51:38 AM by AutoGen 5.18.5pre4
+.\"  It has been AutoGen-ed  April  7, 2015 at 04:18:06 AM by AutoGen 5.18.5pre4
 .\"  From the definitions    sntp-opts.def
 .\"  and the template file   agmdoc-cmd.tpl
 .Sh NAME
@@ -57,7 +57,8 @@
 is displayed.
 Finally, the
 .Em stratum
-of the host is reported.
+of the host is reported
+and the leap indicator is decoded and displayed.
 .Sh "OPTIONS"
 .Bl -tag
 .It  Fl 4 , Fl \-ipv4 
@@ -162,7 +163,9 @@
 .sp
 If the time adjustment is less than \fIsteplimit\fP milliseconds,
 slew the amount using \fBadjtime(2)\fP.  Otherwise, step the
-correction using \fBsettimeofday(2)\fP. 
+correction using \fBsettimeofday(2)\fP.  The default value is 0,
+which means all adjustments will be stepped.  This is a feature, as
+different situations demand different values.
 .It  Fl o Ar number , Fl \-ntpversion Ns = Ns Ar number 
 Send \fBint\fP as our NTP protocol version.
 This option takes an integer number as its argument.
@@ -251,14 +254,27 @@
 is the simplest use of this program
 and can be run as an unprivileged command
 to check the current time and error in the local clock.
-.It Li "sntp \-a ntpserver.somewhere"
+.It Li "sntp \-Ss \-M 128 ntpserver.somewhere"
 With suitable privilege,
 run as a command
 or from a
 .Xr cron 8
 job,
-.Ic "sntp \-a"
-will reset the local clock from a synchronized specified server,
+.Ic "sntp \-Ss \-M 128 ntpserver.somewhere"
+will request the time from the server,
+and if that server reports that it is synchronized
+then if the offset adjustment is less than 128 milliseconds
+the correction will be slewed,
+and if the correction is more than 128 milliseconds
+the correction  will be stepped.
+.It Li "sntp \-S ntpserver.somewhere"
+With suitable privilege,
+run as a command
+or from a
+.Xr cron 8
+job,
+.Ic "sntp \-S ntpserver.somewhere"
+will set (step) the local clock from a synchronized specified server,
 like the (deprecated)
 .Xr ntpdate 1ntpdatemdoc ,
 or
@@ -287,7 +303,7 @@
 .An "Harlan Stenn"
 .An "Dave Hart"
 .Sh "COPYRIGHT"
-Copyright (C) 1970\-2014 The University of Delaware all rights reserved.
+Copyright (C) 1992\-2015 The University of Delaware and Network Time Foundation all rights reserved.
 This program is released under the terms of the NTP license, <http://ntp.org/license>.
 .Sh "BUGS"
 Please send bug reports to: http://bugs.ntp.org, bugs@ntp.org
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/sntp/sntp.html /cur/src/external/bsd/ntp/dist/sntp/sntp.html
--- external/bsd/ntp/dist/sntp/sntp.html	2014-12-19 12:37:43.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/sntp/sntp.html	2015-04-07 19:51:18.000000000 -0700
@@ -36,7 +36,7 @@
 clock.  Run as root, it can correct the system clock to this offset as
 well.  It can be run as an interactive command or from a cron job.
 
-  <p>This document applies to version 4.2.8 of <code>sntp</code>.
+  <p>This document applies to version 4.2.8p2 of <code>sntp</code>.
 
   <p>The program implements the SNTP protocol as defined by RFC 5905, the NTPv4
 IETF specification.
@@ -127,7 +127,8 @@
 is displayed. 
 Finally, the
 <em>stratum</em>
-of the host is reported.
+of the host is reported
+and the leap indicator is decoded and displayed.
 
   <p>This section was generated by <strong>AutoGen</strong>,
 using the <code>agtexi-cmd</code> template and the option descriptions for the <code>sntp</code> program. 
@@ -175,7 +176,7 @@
 used to select the program, defaulting to <span class="file">more</span>.  Both will exit
 with a status code of 0.
 
-<pre class="example">sntp - standard Simple Network Time Protocol client program - Ver. 4.2.8
+<pre class="example">sntp - standard Simple Network Time Protocol client program - Ver. 4.2.8p2
 Usage:  sntp [ -&lt;flag&gt; [&lt;val&gt;] | --&lt;name&gt;[{=| }&lt;val&gt;] ]... \
                 [ hostname-or-IP ...]
   Flg Arg Option-Name    Description
@@ -417,7 +418,9 @@
 This option takes a number argument. 
 If the time adjustment is less than <span class="file">steplimit</span> milliseconds,
 slew the amount using <span class="command">adjtime(2)</span>.  Otherwise, step the
-correction using <span class="command">settimeofday(2)</span>. 
+correction using <span class="command">settimeofday(2)</span>.  The default value is 0,
+which means all adjustments will be stepped.  This is a feature, as
+different situations demand different values. 
 <div class="node">
 <p><hr>
 <a name="sntp-ntpversion"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#sntp-usereservedport">sntp usereservedport</a>,
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/sntp/sntp.man.in /cur/src/external/bsd/ntp/dist/sntp/sntp.man.in
--- external/bsd/ntp/dist/sntp/sntp.man.in	2014-12-19 12:37:44.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/sntp/sntp.man.in	2015-04-07 19:51:18.000000000 -0700
@@ -10,11 +10,11 @@
 .ds B-Font B
 .ds I-Font I
 .ds R-Font R
-.TH sntp @SNTP_MS@ "19 Dec 2014" "4.2.8" "User Commands"
+.TH sntp @SNTP_MS@ "07 Apr 2015" "4.2.8p2" "User Commands"
 .\"
-.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-4dayXk/ag-feaqWk)
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-E6aqmA/ag-76ailA)
 .\"
-.\" It has been AutoGen-ed December 19, 2014 at 07:51:32 AM by AutoGen 5.18.5pre4
+.\" It has been AutoGen-ed April 7, 2015 at 04:18:00 AM by AutoGen 5.18.5pre4
 .\" From the definitions sntp-opts.def
 .\" and the template file agman-cmd.tpl
 .SH NAME
@@ -72,7 +72,8 @@
 is displayed.
 Finally, the
 \fIstratum\f[]
-of the host is reported.
+of the host is reported
+and the leap indicator is decoded and displayed.
 .SH "OPTIONS"
 .TP
 .NOP \f\*[B-Font]\-4\f[], \f\*[B-Font]\-\-ipv4\f[]
@@ -188,7 +189,9 @@
 .sp
 If the time adjustment is less than \fIsteplimit\fP milliseconds,
 slew the amount using \fBadjtime(2)\fP.  Otherwise, step the
-correction using \fBsettimeofday(2)\fP. 
+correction using \fBsettimeofday(2)\fP.  The default value is 0,
+which means all adjustments will be stepped.  This is a feature, as
+different situations demand different values.
 .TP
 .NOP \f\*[B-Font]\-o\f[] \f\*[I-Font]number\f[], \f\*[B-Font]\-\-ntpversion\f[]=\f\*[I-Font]number\f[]
 Send \fBint\fP as our NTP protocol version.
@@ -289,14 +292,28 @@
 and can be run as an unprivileged command
 to check the current time and error in the local clock.
 .TP 7
-.NOP \f[C]sntp \-a ntpserver.somewhere\f[]
+.NOP \f[C]sntp \-Ss \-M 128 ntpserver.somewhere\f[]
 With suitable privilege,
 run as a command
 or from a
 \fCcron\fR(8)\f[]
 job,
-\f\*[B-Font]sntp \-a\f[]
-will reset the local clock from a synchronized specified server,
+\f\*[B-Font]sntp \-Ss \-M 128 ntpserver.somewhere\f[]
+will request the time from the server,
+and if that server reports that it is synchronized
+then if the offset adjustment is less than 128 milliseconds
+the correction will be slewed,
+and if the correction is more than 128 milliseconds
+the correction  will be stepped.
+.TP 7
+.NOP \f[C]sntp \-S ntpserver.somewhere\f[]
+With suitable privilege,
+run as a command
+or from a
+\fCcron\fR(8)\f[]
+job,
+\f\*[B-Font]sntp \-S ntpserver.somewhere\f[]
+will set (step) the local clock from a synchronized specified server,
 like the (deprecated)
 \fCntpdate\fR(@NTPDATE_MS@)\f[],
 or
@@ -331,7 +348,7 @@
 .NOP  "Dave Hart" 
 .br
 .SH "COPYRIGHT"
-Copyright (C) 1970-2014 The University of Delaware all rights reserved.
+Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation all rights reserved.
 This program is released under the terms of the NTP license, <http://ntp.org/license>.
 .SH "BUGS"
 Please send bug reports to: http://bugs.ntp.org, bugs@ntp.org
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/sntp/sntp.mdoc.in /cur/src/external/bsd/ntp/dist/sntp/sntp.mdoc.in
--- external/bsd/ntp/dist/sntp/sntp.mdoc.in	2014-12-19 12:37:44.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/sntp/sntp.mdoc.in	2015-04-07 19:51:18.000000000 -0700
@@ -1,9 +1,9 @@
-.Dd December 19 2014
+.Dd April 7 2015
 .Dt SNTP @SNTP_MS@ User Commands
 .Os
 .\"  EDIT THIS FILE WITH CAUTION  (sntp-opts.mdoc)
 .\"
-.\"  It has been AutoGen-ed  December 19, 2014 at 07:51:38 AM by AutoGen 5.18.5pre4
+.\"  It has been AutoGen-ed  April  7, 2015 at 04:18:06 AM by AutoGen 5.18.5pre4
 .\"  From the definitions    sntp-opts.def
 .\"  and the template file   agmdoc-cmd.tpl
 .Sh NAME
@@ -57,7 +57,8 @@
 is displayed.
 Finally, the
 .Em stratum
-of the host is reported.
+of the host is reported
+and the leap indicator is decoded and displayed.
 .Sh "OPTIONS"
 .Bl -tag
 .It  Fl 4 , Fl \-ipv4 
@@ -162,7 +163,9 @@
 .sp
 If the time adjustment is less than \fIsteplimit\fP milliseconds,
 slew the amount using \fBadjtime(2)\fP.  Otherwise, step the
-correction using \fBsettimeofday(2)\fP. 
+correction using \fBsettimeofday(2)\fP.  The default value is 0,
+which means all adjustments will be stepped.  This is a feature, as
+different situations demand different values.
 .It  Fl o Ar number , Fl \-ntpversion Ns = Ns Ar number 
 Send \fBint\fP as our NTP protocol version.
 This option takes an integer number as its argument.
@@ -251,14 +254,27 @@
 is the simplest use of this program
 and can be run as an unprivileged command
 to check the current time and error in the local clock.
-.It Li "sntp \-a ntpserver.somewhere"
+.It Li "sntp \-Ss \-M 128 ntpserver.somewhere"
 With suitable privilege,
 run as a command
 or from a
 .Xr cron 8
 job,
-.Ic "sntp \-a"
-will reset the local clock from a synchronized specified server,
+.Ic "sntp \-Ss \-M 128 ntpserver.somewhere"
+will request the time from the server,
+and if that server reports that it is synchronized
+then if the offset adjustment is less than 128 milliseconds
+the correction will be slewed,
+and if the correction is more than 128 milliseconds
+the correction  will be stepped.
+.It Li "sntp \-S ntpserver.somewhere"
+With suitable privilege,
+run as a command
+or from a
+.Xr cron 8
+job,
+.Ic "sntp \-S ntpserver.somewhere"
+will set (step) the local clock from a synchronized specified server,
 like the (deprecated)
 .Xr ntpdate @NTPDATE_MS@ ,
 or
@@ -287,7 +303,7 @@
 .An "Harlan Stenn"
 .An "Dave Hart"
 .Sh "COPYRIGHT"
-Copyright (C) 1970\-2014 The University of Delaware all rights reserved.
+Copyright (C) 1992\-2015 The University of Delaware and Network Time Foundation all rights reserved.
 This program is released under the terms of the NTP license, <http://ntp.org/license>.
 .Sh "BUGS"
 Please send bug reports to: http://bugs.ntp.org, bugs@ntp.org
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/sntp/tests/Makefile.in /cur/src/external/bsd/ntp/dist/sntp/tests/Makefile.in
--- external/bsd/ntp/dist/sntp/tests/Makefile.in	2014-12-19 12:37:45.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/sntp/tests/Makefile.in	2015-04-07 19:51:18.000000000 -0700
@@ -44,8 +44,6 @@
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/libopts/m4/libopts.m4 \
 	$(top_srcdir)/libopts/m4/stdnoreturn.m4 \
-	$(top_srcdir)/libevent/m4/openldap-thread-check.m4 \
-	$(top_srcdir)/libevent/m4/openldap.m4 \
 	$(top_srcdir)/m4/hms_search_lib.m4 $(top_srcdir)/m4/libtool.m4 \
 	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
 	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
@@ -65,8 +63,10 @@
 	$(top_srcdir)/m4/ntp_prog_cc.m4 $(top_srcdir)/m4/ntp_sntp.m4 \
 	$(top_srcdir)/m4/ntp_sysexits.m4 \
 	$(top_srcdir)/m4/ntp_ver_suffix.m4 \
-	$(top_srcdir)/m4/os_cflags.m4 $(top_srcdir)/m4/snprintf.m4 \
-	$(top_srcdir)/m4/version.m4 $(top_srcdir)/configure.ac
+	$(top_srcdir)/m4/openldap-thread-check.m4 \
+	$(top_srcdir)/m4/openldap.m4 $(top_srcdir)/m4/os_cflags.m4 \
+	$(top_srcdir)/m4/snprintf.m4 $(top_srcdir)/m4/version.m4 \
+	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
 mkinstalldirs = $(install_sh) -d
@@ -179,6 +179,7 @@
 LD = @LD@
 LDADD_LIBEVENT = @LDADD_LIBEVENT@
 LDADD_LIBNTP = @LDADD_LIBNTP@
+LDADD_LIBUTIL = @LDADD_LIBUTIL@
 LDADD_NTP = @LDADD_NTP@
 LDFLAGS = @LDFLAGS@
 LDFLAGS_NTP = @LDFLAGS_NTP@
@@ -294,6 +295,11 @@
 TIMETRIM_DS = @TIMETRIM_DS@
 TIMETRIM_MS = @TIMETRIM_MS@
 TIMETRIM_NI = @TIMETRIM_NI@
+UPDATE_LEAP_DB = @UPDATE_LEAP_DB@
+UPDATE_LEAP_DL = @UPDATE_LEAP_DL@
+UPDATE_LEAP_DS = @UPDATE_LEAP_DS@
+UPDATE_LEAP_MS = @UPDATE_LEAP_MS@
+UPDATE_LEAP_NI = @UPDATE_LEAP_NI@
 VERSION = @VERSION@
 VER_SUFFIX = @VER_SUFFIX@
 abs_builddir = @abs_builddir@
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/tests/Makefile.in /cur/src/external/bsd/ntp/dist/tests/Makefile.in
--- external/bsd/ntp/dist/tests/Makefile.in	2014-12-19 12:37:49.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/tests/Makefile.in	2015-04-07 19:51:18.000000000 -0700
@@ -42,8 +42,7 @@
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
 	$(top_srcdir)/sntp/libopts/m4/stdnoreturn.m4 \
-	$(top_srcdir)/sntp/libevent/m4/openldap-thread-check.m4 \
-	$(top_srcdir)/sntp/libevent/m4/openldap.m4 \
+	$(top_srcdir)/sntp/m4/ax_c99_struct_init.m4 \
 	$(top_srcdir)/sntp/m4/define_dir.m4 \
 	$(top_srcdir)/sntp/m4/hms_search_lib.m4 \
 	$(top_srcdir)/sntp/m4/libtool.m4 \
@@ -72,6 +71,8 @@
 	$(top_srcdir)/sntp/m4/ntp_sntp.m4 \
 	$(top_srcdir)/sntp/m4/ntp_ver_suffix.m4 \
 	$(top_srcdir)/sntp/m4/ntp_vpathhack.m4 \
+	$(top_srcdir)/sntp/m4/openldap-thread-check.m4 \
+	$(top_srcdir)/sntp/m4/openldap.m4 \
 	$(top_srcdir)/sntp/m4/os_cflags.m4 \
 	$(top_srcdir)/sntp/m4/snprintf.m4 \
 	$(top_srcdir)/sntp/m4/version.m4 $(top_srcdir)/configure.ac
@@ -152,6 +153,7 @@
 CONFIG_SHELL = @CONFIG_SHELL@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
+CPPFLAGS_LIBEVENT = @CPPFLAGS_LIBEVENT@
 CPPFLAGS_NTP = @CPPFLAGS_NTP@
 CXX = @CXX@
 CXXCPP = @CXXCPP@
@@ -186,7 +188,9 @@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 LD = @LD@
+LDADD_LIBEVENT = @LDADD_LIBEVENT@
 LDADD_LIBNTP = @LDADD_LIBNTP@
+LDADD_LIBUTIL = @LDADD_LIBUTIL@
 LDADD_NLIST = @LDADD_NLIST@
 LDADD_NTP = @LDADD_NTP@
 LDFLAGS = @LDFLAGS@
@@ -325,6 +329,11 @@
 TIMETRIM_DS = @TIMETRIM_DS@
 TIMETRIM_MS = @TIMETRIM_MS@
 TIMETRIM_NI = @TIMETRIM_NI@
+UPDATE_LEAP_DB = @UPDATE_LEAP_DB@
+UPDATE_LEAP_DL = @UPDATE_LEAP_DL@
+UPDATE_LEAP_DS = @UPDATE_LEAP_DS@
+UPDATE_LEAP_MS = @UPDATE_LEAP_MS@
+UPDATE_LEAP_NI = @UPDATE_LEAP_NI@
 VERSION = @VERSION@
 VER_SUFFIX = @VER_SUFFIX@
 YACC = @YACC@
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/tests/libntp/Makefile.in /cur/src/external/bsd/ntp/dist/tests/libntp/Makefile.in
--- external/bsd/ntp/dist/tests/libntp/Makefile.in	2014-12-19 12:37:49.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/tests/libntp/Makefile.in	2015-04-07 19:51:18.000000000 -0700
@@ -44,8 +44,7 @@
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
 	$(top_srcdir)/sntp/libopts/m4/stdnoreturn.m4 \
-	$(top_srcdir)/sntp/libevent/m4/openldap-thread-check.m4 \
-	$(top_srcdir)/sntp/libevent/m4/openldap.m4 \
+	$(top_srcdir)/sntp/m4/ax_c99_struct_init.m4 \
 	$(top_srcdir)/sntp/m4/define_dir.m4 \
 	$(top_srcdir)/sntp/m4/hms_search_lib.m4 \
 	$(top_srcdir)/sntp/m4/libtool.m4 \
@@ -74,6 +73,8 @@
 	$(top_srcdir)/sntp/m4/ntp_sntp.m4 \
 	$(top_srcdir)/sntp/m4/ntp_ver_suffix.m4 \
 	$(top_srcdir)/sntp/m4/ntp_vpathhack.m4 \
+	$(top_srcdir)/sntp/m4/openldap-thread-check.m4 \
+	$(top_srcdir)/sntp/m4/openldap.m4 \
 	$(top_srcdir)/sntp/m4/os_cflags.m4 \
 	$(top_srcdir)/sntp/m4/snprintf.m4 \
 	$(top_srcdir)/sntp/m4/version.m4 $(top_srcdir)/configure.ac
@@ -166,6 +167,7 @@
 CONFIG_SHELL = @CONFIG_SHELL@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
+CPPFLAGS_LIBEVENT = @CPPFLAGS_LIBEVENT@
 CPPFLAGS_NTP = @CPPFLAGS_NTP@
 CXX = @CXX@
 CXXCPP = @CXXCPP@
@@ -200,7 +202,9 @@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 LD = @LD@
+LDADD_LIBEVENT = @LDADD_LIBEVENT@
 LDADD_LIBNTP = @LDADD_LIBNTP@
+LDADD_LIBUTIL = @LDADD_LIBUTIL@
 LDADD_NLIST = @LDADD_NLIST@
 LDADD_NTP = @LDADD_NTP@
 LDFLAGS = @LDFLAGS@
@@ -339,6 +343,11 @@
 TIMETRIM_DS = @TIMETRIM_DS@
 TIMETRIM_MS = @TIMETRIM_MS@
 TIMETRIM_NI = @TIMETRIM_NI@
+UPDATE_LEAP_DB = @UPDATE_LEAP_DB@
+UPDATE_LEAP_DL = @UPDATE_LEAP_DL@
+UPDATE_LEAP_DS = @UPDATE_LEAP_DS@
+UPDATE_LEAP_MS = @UPDATE_LEAP_MS@
+UPDATE_LEAP_NI = @UPDATE_LEAP_NI@
 VERSION = @VERSION@
 VER_SUFFIX = @VER_SUFFIX@
 YACC = @YACC@
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/tests/ntpd/Makefile.in /cur/src/external/bsd/ntp/dist/tests/ntpd/Makefile.in
--- external/bsd/ntp/dist/tests/ntpd/Makefile.in	2014-12-19 12:37:49.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/tests/ntpd/Makefile.in	2015-04-07 19:51:18.000000000 -0700
@@ -44,8 +44,7 @@
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
 	$(top_srcdir)/sntp/libopts/m4/stdnoreturn.m4 \
-	$(top_srcdir)/sntp/libevent/m4/openldap-thread-check.m4 \
-	$(top_srcdir)/sntp/libevent/m4/openldap.m4 \
+	$(top_srcdir)/sntp/m4/ax_c99_struct_init.m4 \
 	$(top_srcdir)/sntp/m4/define_dir.m4 \
 	$(top_srcdir)/sntp/m4/hms_search_lib.m4 \
 	$(top_srcdir)/sntp/m4/libtool.m4 \
@@ -74,6 +73,8 @@
 	$(top_srcdir)/sntp/m4/ntp_sntp.m4 \
 	$(top_srcdir)/sntp/m4/ntp_ver_suffix.m4 \
 	$(top_srcdir)/sntp/m4/ntp_vpathhack.m4 \
+	$(top_srcdir)/sntp/m4/openldap-thread-check.m4 \
+	$(top_srcdir)/sntp/m4/openldap.m4 \
 	$(top_srcdir)/sntp/m4/os_cflags.m4 \
 	$(top_srcdir)/sntp/m4/snprintf.m4 \
 	$(top_srcdir)/sntp/m4/version.m4 $(top_srcdir)/configure.ac
@@ -169,6 +170,7 @@
 CONFIG_SHELL = @CONFIG_SHELL@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
+CPPFLAGS_LIBEVENT = @CPPFLAGS_LIBEVENT@
 CPPFLAGS_NTP = @CPPFLAGS_NTP@
 CXX = @CXX@
 CXXCPP = @CXXCPP@
@@ -203,7 +205,9 @@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 LD = @LD@
+LDADD_LIBEVENT = @LDADD_LIBEVENT@
 LDADD_LIBNTP = @LDADD_LIBNTP@
+LDADD_LIBUTIL = @LDADD_LIBUTIL@
 LDADD_NLIST = @LDADD_NLIST@
 LDADD_NTP = @LDADD_NTP@
 LDFLAGS = @LDFLAGS@
@@ -342,6 +346,11 @@
 TIMETRIM_DS = @TIMETRIM_DS@
 TIMETRIM_MS = @TIMETRIM_MS@
 TIMETRIM_NI = @TIMETRIM_NI@
+UPDATE_LEAP_DB = @UPDATE_LEAP_DB@
+UPDATE_LEAP_DL = @UPDATE_LEAP_DL@
+UPDATE_LEAP_DS = @UPDATE_LEAP_DS@
+UPDATE_LEAP_MS = @UPDATE_LEAP_MS@
+UPDATE_LEAP_NI = @UPDATE_LEAP_NI@
 VERSION = @VERSION@
 VER_SUFFIX = @VER_SUFFIX@
 YACC = @YACC@
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/util/Makefile.am /cur/src/external/bsd/ntp/dist/util/Makefile.am
--- external/bsd/ntp/dist/util/Makefile.am	2014-12-19 12:37:49.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/util/Makefile.am	2015-04-07 19:51:18.000000000 -0700
@@ -19,6 +19,7 @@
 LDADD=		../libntp/libntp.a $(LDADD_LIBNTP) $(LIBM) $(PTHREAD_LIBS)
 tg2_LDADD=	../libntp/libntp.a $(LDADD_LIBNTP) $(LIBM)
 ntp_keygen_LDADD  = version.o $(LIBOPTS_LDADD) ../libntp/libntp.a
+ntp_keygen_LDADD += $(LDADD_LIBEVENT)
 ntp_keygen_LDADD += $(LDADD_LIBNTP) $(PTHREAD_LIBS) $(LDADD_NTP) $(LIBM)
 ntp_keygen_SOURCES = ntp-keygen.c ntp-keygen-opts.c ntp-keygen-opts.h
 
@@ -111,7 +112,7 @@
 	cd $(srcdir) && ( makeinfo --force --html --no-split -o ntp-keygen.html ntp-keygen.texi || true )
 
 
-jitter_SOURCES=	jitter.c jitter.h
+jitter_SOURCES=	jitter.c
 jitter_LDADD=
 
 kern.o: kern.c
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/util/Makefile.in /cur/src/external/bsd/ntp/dist/util/Makefile.in
--- external/bsd/ntp/dist/util/Makefile.in	2014-12-19 12:37:49.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/util/Makefile.in	2015-04-07 19:51:18.000000000 -0700
@@ -52,8 +52,7 @@
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
 	$(top_srcdir)/sntp/libopts/m4/stdnoreturn.m4 \
-	$(top_srcdir)/sntp/libevent/m4/openldap-thread-check.m4 \
-	$(top_srcdir)/sntp/libevent/m4/openldap.m4 \
+	$(top_srcdir)/sntp/m4/ax_c99_struct_init.m4 \
 	$(top_srcdir)/sntp/m4/define_dir.m4 \
 	$(top_srcdir)/sntp/m4/hms_search_lib.m4 \
 	$(top_srcdir)/sntp/m4/libtool.m4 \
@@ -82,6 +81,8 @@
 	$(top_srcdir)/sntp/m4/ntp_sntp.m4 \
 	$(top_srcdir)/sntp/m4/ntp_ver_suffix.m4 \
 	$(top_srcdir)/sntp/m4/ntp_vpathhack.m4 \
+	$(top_srcdir)/sntp/m4/openldap-thread-check.m4 \
+	$(top_srcdir)/sntp/m4/openldap.m4 \
 	$(top_srcdir)/sntp/m4/os_cflags.m4 \
 	$(top_srcdir)/sntp/m4/snprintf.m4 \
 	$(top_srcdir)/sntp/m4/version.m4 $(top_srcdir)/configure.ac
@@ -131,7 +132,8 @@
 ntp_keygen_OBJECTS = $(am_ntp_keygen_OBJECTS)
 ntp_keygen_DEPENDENCIES = version.o $(am__DEPENDENCIES_1) \
 	../libntp/libntp.a $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
-	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
+	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+	$(am__DEPENDENCIES_1)
 ntptime_SOURCES = ntptime.c
 ntptime_OBJECTS = ntptime.$(OBJEXT)
 ntptime_LDADD = $(LDADD)
@@ -259,6 +261,7 @@
 CONFIG_SHELL = @CONFIG_SHELL@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
+CPPFLAGS_LIBEVENT = @CPPFLAGS_LIBEVENT@
 CPPFLAGS_NTP = @CPPFLAGS_NTP@
 CXX = @CXX@
 CXXCPP = @CXXCPP@
@@ -293,7 +296,9 @@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 LD = @LD@
+LDADD_LIBEVENT = @LDADD_LIBEVENT@
 LDADD_LIBNTP = @LDADD_LIBNTP@
+LDADD_LIBUTIL = @LDADD_LIBUTIL@
 LDADD_NLIST = @LDADD_NLIST@
 LDADD_NTP = @LDADD_NTP@
 LDFLAGS = @LDFLAGS@
@@ -432,6 +437,11 @@
 TIMETRIM_DS = @TIMETRIM_DS@
 TIMETRIM_MS = @TIMETRIM_MS@
 TIMETRIM_NI = @TIMETRIM_NI@
+UPDATE_LEAP_DB = @UPDATE_LEAP_DB@
+UPDATE_LEAP_DL = @UPDATE_LEAP_DL@
+UPDATE_LEAP_DS = @UPDATE_LEAP_DS@
+UPDATE_LEAP_MS = @UPDATE_LEAP_MS@
+UPDATE_LEAP_NI = @UPDATE_LEAP_NI@
 VERSION = @VERSION@
 VER_SUFFIX = @VER_SUFFIX@
 YACC = @YACC@
@@ -502,7 +512,8 @@
 LDADD = ../libntp/libntp.a $(LDADD_LIBNTP) $(LIBM) $(PTHREAD_LIBS)
 tg2_LDADD = ../libntp/libntp.a $(LDADD_LIBNTP) $(LIBM)
 ntp_keygen_LDADD = version.o $(LIBOPTS_LDADD) ../libntp/libntp.a \
-	$(LDADD_LIBNTP) $(PTHREAD_LIBS) $(LDADD_NTP) $(LIBM)
+	$(LDADD_LIBEVENT) $(LDADD_LIBNTP) $(PTHREAD_LIBS) $(LDADD_NTP) \
+	$(LIBM)
 ntp_keygen_SOURCES = ntp-keygen.c ntp-keygen-opts.c ntp-keygen-opts.h
 tickadj_LDADD = ../libntp/libntp.a $(LDADD_LIBNTP) $(LIBM) $(PTHREAD_LIBS) $(LDADD_NLIST)
 EXTRA_DIST = \
@@ -549,7 +560,7 @@
 	$(top_srcdir)/sntp/include/version.def			\
 	$(NULL)
 
-jitter_SOURCES = jitter.c jitter.h
+jitter_SOURCES = jitter.c
 jitter_LDADD = 
 NTP_INCS = -I$(top_srcdir)/include -I$(top_srcdir)/lib/isc/include \
 	-I$(top_srcdir)/lib/isc/$(LIBISC_PTHREADS_NOTHREADS)/include \
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/util/invoke-ntp-keygen.texi /cur/src/external/bsd/ntp/dist/util/invoke-ntp-keygen.texi
--- external/bsd/ntp/dist/util/invoke-ntp-keygen.texi	2014-12-19 12:37:49.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/util/invoke-ntp-keygen.texi	2015-04-07 19:51:18.000000000 -0700
@@ -6,7 +6,7 @@
 #
 # EDIT THIS FILE WITH CAUTION  (invoke-ntp-keygen.texi)
 #
-# It has been AutoGen-ed  December 19, 2014 at 07:50:55 AM by AutoGen 5.18.5pre4
+# It has been AutoGen-ed  April  7, 2015 at 04:27:46 AM by AutoGen 5.18.5pre4
 # From the definitions    ntp-keygen-opts.def
 # and the template file   agtexi-cmd.tpl
 @end ignore
@@ -886,7 +886,7 @@
 
 @exampleindent 0
 @example
-ntp-keygen (ntp) - Create a NTP host key - Ver. 4.2.8
+ntp-keygen (ntp) - Create a NTP host key - Ver. 4.2.8p2
 Usage:  ntp-keygen [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]...
   Flg Arg Option-Name    Description
    -b Num imbits         identity modulus bits
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/util/jitter.c /cur/src/external/bsd/ntp/dist/util/jitter.c
--- external/bsd/ntp/dist/util/jitter.c	2014-12-24 18:28:19.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/util/jitter.c	2015-04-07 19:51:18.000000000 -0700
@@ -16,10 +16,9 @@
 #include <stdio.h>
 #include <sys/time.h>
 #include <stdlib.h>
-#include "jitter.h"
+#include "ntp_fp.h"
 
 #define NBUF	800002
-#define FRAC	4294967296.		/* a bbbbillion */
 #define JAN_1970 2208988800UL		/* Unix base epoch */
 #define CLOCK_GETTIME			/* Solaris hires clock */
 
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/util/jitter.h /cur/src/external/bsd/ntp/dist/util/jitter.h
--- external/bsd/ntp/dist/util/jitter.h	2014-12-24 18:28:19.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/util/jitter.h	1969-12-31 16:00:00.000000000 -0800
@@ -1,403 +0,0 @@
-/*	$NetBSD: jitter.h,v 1.2.14.1 2014/12/25 02:28:19 snj Exp $	*/
-
-/*
- *  ntp_types.h - defines how int32 and u_int32 are treated.
- *  For 64 bit systems like the DEC Alpha, they have to be defined
- *  as int and u_int.
- *  For 32 bit systems, define them as long and u_long
- */
-#define SIZEOF_INT 4
-
-/*
- * VMS DECC (v4.1), {u_char,u_short,u_long} are only in SOCKET.H,
- *                      and u_int isn't defined anywhere
- */
-#if defined(VMS)
-#include <socket.h>
-typedef unsigned int u_int;
-/*
- * Note: VMS DECC has  long == int  (even on __alpha),
- *       so the distinction below doesn't matter
- */
-#endif /* VMS */
-
-#if (SIZEOF_INT == 4)
-# ifndef int32
-#  define int32 int
-# endif
-# ifndef u_int32
-#  define u_int32 unsigned int
-# endif
-#else /* not sizeof(int) == 4 */
-# if (SIZEOF_LONG == 4)
-# else /* not sizeof(long) == 4 */
-#  ifndef int32
-#   define int32 long
-#  endif
-#  ifndef u_int32
-#   define u_int32 unsigned long
-#  endif
-# endif /* not sizeof(long) == 4 */
-# include "Bletch: what's 32 bits on this machine?"
-#endif /* not sizeof(int) == 4 */
-
-typedef unsigned short associd_t; /* association ID */
-typedef u_int32 keyid_t;        /* cryptographic key ID */
-typedef u_int32 tstamp_t;       /* NTP seconds timestamp */
-
-/*
- * NTP uses two fixed point formats.  The first (l_fp) is the "long"
- * format and is 64 bits long with the decimal between bits 31 and 32.
- * This is used for time stamps in the NTP packet header (in network
- * byte order) and for internal computations of offsets (in local host
- * byte order). We use the same structure for both signed and unsigned
- * values, which is a big hack but saves rewriting all the operators
- * twice. Just to confuse this, we also sometimes just carry the
- * fractional part in calculations, in both signed and unsigned forms.
- * Anyway, an l_fp looks like:
- *
- *    0			  1		      2			  3
- *    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
- *   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- *   |			       Integral Part			     |
- *   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- *   |			       Fractional Part			     |
- *   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- *
- */
-typedef struct {
-	union {
-		u_int32 Xl_ui;
-		int32 Xl_i;
-	} Ul_i;
-	union {
-		u_int32 Xl_uf;
-		int32 Xl_f;
-	} Ul_f;
-} l_fp;
-
-#define l_ui	Ul_i.Xl_ui		/* unsigned integral part */
-#define	l_i	Ul_i.Xl_i		/* signed integral part */
-#define	l_uf	Ul_f.Xl_uf		/* unsigned fractional part */
-#define	l_f	Ul_f.Xl_f		/* signed fractional part */
-
-/*
- * Fractional precision (of an l_fp) is actually the number of
- * bits in a long.
- */
-#define	FRACTION_PREC	(32)
-
-
-/*
- * The second fixed point format is 32 bits, with the decimal between
- * bits 15 and 16.  There is a signed version (s_fp) and an unsigned
- * version (u_fp).  This is used to represent synchronizing distance
- * and synchronizing dispersion in the NTP packet header (again, in
- * network byte order) and internally to hold both distance and
- * dispersion values (in local byte order).  In network byte order
- * it looks like:
- *
- *    0			  1		      2			  3
- *    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
- *   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- *   |		  Integer Part	     |	   Fraction Part	     |
- *   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- *
- */
-typedef int32 s_fp;
-typedef u_int32 u_fp;
-
-/*
- * A unit second in fp format.  Actually 2**(half_the_bits_in_a_long)
- */
-#define	FP_SECOND	(0x10000)
-
-/*
- * Byte order conversions
- */
-#define	HTONS_FP(x)	(htonl(x))
-#define	HTONL_FP(h, n)	do { (n)->l_ui = htonl((h)->l_ui); \
-			     (n)->l_uf = htonl((h)->l_uf); } while (0)
-#define	NTOHS_FP(x)	(ntohl(x))
-#define	NTOHL_FP(n, h)	do { (h)->l_ui = ntohl((n)->l_ui); \
-			     (h)->l_uf = ntohl((n)->l_uf); } while (0)
-#define	NTOHL_MFP(ni, nf, hi, hf) \
-	do { (hi) = ntohl(ni); (hf) = ntohl(nf); } while (0)
-#define	HTONL_MFP(hi, hf, ni, nf) \
-	do { (ni) = ntohl(hi); (nf) = ntohl(hf); } while (0)
-
-/* funny ones.  Converts ts fractions to net order ts */
-#define	HTONL_UF(uf, nts) \
-	do { (nts)->l_ui = 0; (nts)->l_uf = htonl(uf); } while (0)
-#define	HTONL_F(f, nts) do { (nts)->l_uf = htonl(f); \
-				if ((f) & 0x80000000) \
-					(nts)->l_i = -1; \
-				else \
-					(nts)->l_i = 0; \
-			} while (0)
-
-/*
- * Conversions between the two fixed point types
- */
-#define	MFPTOFP(x_i, x_f)	(((int)(x_i) >= 0x00010000) ? 0x7fffffff : \
-				(((int)(x_i) <= -0x00010000) ? 0x80000000 : \
-				(u_int)(((x_i)<<16) | (((x_f)>>16)&0xffff))))
-#define	LFPTOFP(v)		MFPTOFP((v)->l_i, (v)->l_f)
-
-#define UFPTOLFP(x, v) ((v)->l_ui = (u_fp)(x)>>16, (v)->l_uf = (x)<<16)
-#define FPTOLFP(x, v)  (UFPTOLFP((x), (v)), (x) < 0 ? (v)->l_ui -= 0x10000 : 0)
-
-#define MAXLFP(v) ((v)->l_ui = 0x7fffffff, (v)->l_uf = 0xffffffff)
-#define MINLFP(v) ((v)->l_ui = 0x80000000, (v)->l_uf = 0)
-
-/*
- * Primitive operations on long fixed point values.  If these are
- * reminiscent of assembler op codes it's only because some may
- * be replaced by inline assembler for particular machines someday.
- * These are the (kind of inefficient) run-anywhere versions.
- */
-#define	M_NEG(v_i, v_f) 	/* v = -v */ \
-	do { \
-		if ((v_f) == 0) \
-			(v_i) = -((s_fp)(v_i)); \
-		else { \
-			(v_f) = -((s_fp)(v_f)); \
-			(v_i) = ~(v_i); \
-		} \
-	} while(0)
-
-#define	M_NEGM(r_i, r_f, a_i, a_f) 	/* r = -a */ \
-	do { \
-		if ((a_f) == 0) { \
-			(r_f) = 0; \
-			(r_i) = -(a_i); \
-		} else { \
-			(r_f) = -(a_f); \
-			(r_i) = ~(a_i); \
-		} \
-	} while(0)
-
-#define M_ADD(r_i, r_f, a_i, a_f) 	/* r += a */ \
-	do { \
-		register u_int32 lo_tmp; \
-		register u_int32 hi_tmp; \
-		\
-		lo_tmp = ((r_f) & 0xffff) + ((a_f) & 0xffff); \
-		hi_tmp = (((r_f) >> 16) & 0xffff) + (((a_f) >> 16) & 0xffff); \
-		if (lo_tmp & 0x10000) \
-			hi_tmp++; \
-		(r_f) = ((hi_tmp & 0xffff) << 16) | (lo_tmp & 0xffff); \
-		\
-		(r_i) += (a_i); \
-		if (hi_tmp & 0x10000) \
-			(r_i)++; \
-	} while (0)
-
-#define M_ADD3(r_ovr, r_i, r_f, a_ovr, a_i, a_f) /* r += a, three word */ \
-	do { \
-		register u_int32 lo_tmp; \
-		register u_int32 hi_tmp; \
-		\
-		lo_tmp = ((r_f) & 0xffff) + ((a_f) & 0xffff); \
-		hi_tmp = (((r_f) >> 16) & 0xffff) + (((a_f) >> 16) & 0xffff); \
-		if (lo_tmp & 0x10000) \
-			hi_tmp++; \
-		(r_f) = ((hi_tmp & 0xffff) << 16) | (lo_tmp & 0xffff); \
-		\
-		lo_tmp = ((r_i) & 0xffff) + ((a_i) & 0xffff); \
-		if (hi_tmp & 0x10000) \
-			lo_tmp++; \
-		hi_tmp = (((r_i) >> 16) & 0xffff) + (((a_i) >> 16) & 0xffff); \
-		if (lo_tmp & 0x10000) \
-			hi_tmp++; \
-		(r_i) = ((hi_tmp & 0xffff) << 16) | (lo_tmp & 0xffff); \
-		\
-		(r_ovr) += (a_ovr); \
-		if (hi_tmp & 0x10000) \
-			(r_ovr)++; \
-	} while (0)
-
-#define M_SUB(r_i, r_f, a_i, a_f)	/* r -= a */ \
-	do { \
-		register u_int32 lo_tmp; \
-		register u_int32 hi_tmp; \
-		\
-		if ((a_f) == 0) { \
-			(r_i) -= (a_i); \
-		} else { \
-			lo_tmp = ((r_f) & 0xffff) + ((-((s_fp)(a_f))) & 0xffff); \
-			hi_tmp = (((r_f) >> 16) & 0xffff) \
-			    + (((-((s_fp)(a_f))) >> 16) & 0xffff); \
-			if (lo_tmp & 0x10000) \
-				hi_tmp++; \
-			(r_f) = ((hi_tmp & 0xffff) << 16) | (lo_tmp & 0xffff); \
-			\
-			(r_i) += ~(a_i); \
-			if (hi_tmp & 0x10000) \
-				(r_i)++; \
-		} \
-	} while (0)
-
-#define	M_RSHIFTU(v_i, v_f)		/* v >>= 1, v is unsigned */ \
-	do { \
-		(v_f) = (u_int32)(v_f) >> 1; \
-		if ((v_i) & 01) \
-			(v_f) |= 0x80000000; \
-		(v_i) = (u_int32)(v_i) >> 1; \
-	} while (0)
-
-#define	M_RSHIFT(v_i, v_f)		/* v >>= 1, v is signed */ \
-	do { \
-		(v_f) = (u_int32)(v_f) >> 1; \
-		if ((v_i) & 01) \
-			(v_f) |= 0x80000000; \
-		if ((v_i) & 0x80000000) \
-			(v_i) = ((v_i) >> 1) | 0x80000000; \
-		else \
-			(v_i) = (v_i) >> 1; \
-	} while (0)
-
-#define	M_LSHIFT(v_i, v_f)		/* v <<= 1 */ \
-	do { \
-		(v_i) <<= 1; \
-		if ((v_f) & 0x80000000) \
-			(v_i) |= 0x1; \
-		(v_f) <<= 1; \
-	} while (0)
-
-#define	M_LSHIFT3(v_ovr, v_i, v_f)	/* v <<= 1, with overflow */ \
-	do { \
-		(v_ovr) <<= 1; \
-		if ((v_i) & 0x80000000) \
-			(v_ovr) |= 0x1; \
-		(v_i) <<= 1; \
-		if ((v_f) & 0x80000000) \
-			(v_i) |= 0x1; \
-		(v_f) <<= 1; \
-	} while (0)
-
-#define	M_ADDUF(r_i, r_f, uf) 		/* r += uf, uf is u_int32 fraction */ \
-	M_ADD((r_i), (r_f), 0, (uf))	/* let optimizer worry about it */
-
-#define	M_SUBUF(r_i, r_f, uf)		/* r -= uf, uf is u_int32 fraction */ \
-	M_SUB((r_i), (r_f), 0, (uf))	/* let optimizer worry about it */
-
-#define	M_ADDF(r_i, r_f, f)		/* r += f, f is a int32 fraction */ \
-	do { \
-		if ((f) > 0) \
-			M_ADD((r_i), (r_f), 0, (f)); \
-		else if ((f) < 0) \
-			M_ADD((r_i), (r_f), (-1), (f));\
-	} while(0)
-
-#define	M_ISNEG(v_i, v_f) 		/* v < 0 */ \
-	(((v_i) & 0x80000000) != 0)
-
-#define	M_ISHIS(a_i, a_f, b_i, b_f)	/* a >= b unsigned */ \
-	(((u_int32)(a_i)) > ((u_int32)(b_i)) || \
-	  ((a_i) == (b_i) && ((u_int32)(a_f)) >= ((u_int32)(b_f))))
-
-#define	M_ISGEQ(a_i, a_f, b_i, b_f)	/* a >= b signed */ \
-	(((int32)(a_i)) > ((int32)(b_i)) || \
-	  ((a_i) == (b_i) && ((u_int32)(a_f)) >= ((u_int32)(b_f))))
-
-#define	M_ISEQU(a_i, a_f, b_i, b_f)	/* a == b unsigned */ \
-	((a_i) == (b_i) && (a_f) == (b_f))
-
-/*
- * Operations on the long fp format
- */
-#define	L_ADD(r, a)	M_ADD((r)->l_ui, (r)->l_uf, (a)->l_ui, (a)->l_uf)
-#define	L_SUB(r, a)	M_SUB((r)->l_ui, (r)->l_uf, (a)->l_ui, (a)->l_uf)
-#define	L_NEG(v)	M_NEG((v)->l_ui, (v)->l_uf)
-#define L_ADDUF(r, uf)	M_ADDUF((r)->l_ui, (r)->l_uf, (uf))
-#define L_SUBUF(r, uf)	M_SUBUF((r)->l_ui, (r)->l_uf, (uf))
-#define	L_ADDF(r, f)	M_ADDF((r)->l_ui, (r)->l_uf, (f))
-#define	L_RSHIFT(v)	M_RSHIFT((v)->l_i, (v)->l_uf)
-#define	L_RSHIFTU(v)	M_RSHIFT((v)->l_ui, (v)->l_uf)
-#define	L_LSHIFT(v)	M_LSHIFT((v)->l_ui, (v)->l_uf)
-#define	L_CLR(v)	((v)->l_ui = (v)->l_uf = 0)
-
-#define	L_ISNEG(v)	(((v)->l_ui & 0x80000000) != 0)
-#define L_ISZERO(v)	((v)->l_ui == 0 && (v)->l_uf == 0)
-#define	L_ISHIS(a, b)	((a)->l_ui > (b)->l_ui || \
-			  ((a)->l_ui == (b)->l_ui && (a)->l_uf >= (b)->l_uf))
-#define	L_ISGEQ(a, b)	((a)->l_i > (b)->l_i || \
-			  ((a)->l_i == (b)->l_i && (a)->l_uf >= (b)->l_uf))
-#define	L_ISEQU(a, b)	M_ISEQU((a)->l_ui, (a)->l_uf, (b)->l_ui, (b)->l_uf)
-
-/*
- * s_fp/double and u_fp/double conversions
- */
-#define FRIC		65536.	 		/* 2^16 as a double */
-#define DTOFP(r)	((s_fp)((r) * FRIC))
-#define DTOUFP(r)	((u_fp)((r) * FRIC))
-#define FPTOD(r)	((double)(r) / FRIC)
-
-/*
- * l_fp/double conversions
- */
-#define FRAC		4294967296. 		/* 2^32 as a double */
-#define M_DTOLFP(d, r_i, r_uf) 			/* double to l_fp */ \
-	do { \
-		register double d_tmp; \
-		\
-		d_tmp = (d); \
-		if (d_tmp < 0) { \
-			d_tmp = -d_tmp; \
-			(r_i) = (int32)(d_tmp); \
-			(r_uf) = (u_int32)(((d_tmp) - (double)(r_i)) * FRAC); \
-			M_NEG((r_i), (r_uf)); \
-		} else { \
-			(r_i) = (int32)(d_tmp); \
-			(r_uf) = (u_int32)(((d_tmp) - (double)(r_i)) * FRAC); \
-		} \
-	} while (0)
-#define M_LFPTOD(r_i, r_uf, d) 			/* l_fp to double */ \
-	do { \
-		register l_fp l_tmp; \
-		\
-		l_tmp.l_i = (r_i); \
-		l_tmp.l_f = (r_uf); \
-		if (l_tmp.l_i < 0) { \
-			M_NEG(l_tmp.l_i, l_tmp.l_uf); \
-			(d) = -((double)l_tmp.l_i + ((double)l_tmp.l_uf) / FRAC); \
-		} else { \
-			(d) = (double)l_tmp.l_i + ((double)l_tmp.l_uf) / FRAC; \
-		} \
-	} while (0)
-#define DTOLFP(d, v) 	M_DTOLFP((d), (v)->l_ui, (v)->l_uf)
-#define LFPTOD(v, d) 	M_LFPTOD((v)->l_ui, (v)->l_uf, (d))
-
-/*
- * Prototypes
- */
-#if 0
-extern	char *	dofptoa		(u_fp, int, short, int);
-extern	char *	dolfptoa	(u_long, u_long, int, short, int);
-#endif
-
-extern	int	atolfp		(const char *, l_fp *);
-extern	int	buftvtots	(const char *, l_fp *);
-extern	char *	fptoa		(s_fp, short);
-extern	char *	fptoms		(s_fp, short);
-extern	int	hextolfp	(const char *, l_fp *);
-extern  void    gpstolfp        (int, int, unsigned long, l_fp *);
-extern	int	mstolfp		(const char *, l_fp *);
-extern	char *	prettydate	(l_fp *);
-extern	char *	gmprettydate	(l_fp *);
-extern	char *	uglydate	(l_fp *);
-extern  void    mfp_mul         (int32 *, u_int32 *, int32, u_int32, int32, u_int32);
-
-extern	void	get_systime	(l_fp *);
-extern	int	step_systime	(double);
-extern	int	adj_systime	(double);
-
-#define	lfptoa(_fpv, _ndec)	mfptoa((_fpv)->l_ui, (_fpv)->l_uf, (_ndec))
-#define	lfptoms(_fpv, _ndec)	mfptoms((_fpv)->l_ui, (_fpv)->l_uf, (_ndec))
-
-#define	ufptoa(_fpv, _ndec)	dofptoa((_fpv), 0, (_ndec), 0)
-#define	ufptoms(_fpv, _ndec)	dofptoa((_fpv), 0, (_ndec), 1)
-#define	ulfptoa(_fpv, _ndec)	dolfptoa((_fpv)->l_ui, (_fpv)->l_uf, 0, (_ndec), 0)
-#define	ulfptoms(_fpv, _ndec)	dolfptoa((_fpv)->l_ui, (_fpv)->l_uf, 0, (_ndec), 1)
-#define	umfptoa(_fpi, _fpf, _ndec) dolfptoa((_fpi), (_fpf), 0, (_ndec), 0)
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/util/ntp-keygen-opts.c /cur/src/external/bsd/ntp/dist/util/ntp-keygen-opts.c
--- external/bsd/ntp/dist/util/ntp-keygen-opts.c	2014-12-24 18:28:19.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/util/ntp-keygen-opts.c	2015-04-07 19:51:18.000000000 -0700
@@ -3,7 +3,7 @@
 /*
  *  EDIT THIS FILE WITH CAUTION  (ntp-keygen-opts.c)
  *
- *  It has been AutoGen-ed  December 19, 2014 at 07:50:39 AM by AutoGen 5.18.5pre4
+ *  It has been AutoGen-ed  April  7, 2015 at 04:27:30 AM by AutoGen 5.18.5pre4
  *  From the definitions    ntp-keygen-opts.def
  *  and the template file   options
  *
@@ -20,7 +20,7 @@
  * The ntp-keygen program is copyrighted and licensed
  * under the following terms:
  *
- *  Copyright (C) 1970-2014 The University of Delaware, all rights reserved.
+ *  Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation, all rights reserved.
  *  This is free software. It is licensed for use, modification and
  *  redistribution under the terms of the NTP License, copies of which
  *  can be seen at:
@@ -33,7 +33,7 @@
  *  both the copyright notice and this permission notice appear in
  *  supporting documentation, and that the name The University of Delaware not be used in
  *  advertising or publicity pertaining to distribution of the software
- *  without specific, written prior permission. The University of Delaware makes no
+ *  without specific, written prior permission. The University of Delaware and Network Time Foundation makes no
  *  representations about the suitability this software for any purpose. It
  *  is provided "as is" without express or implied warranty.
  */
@@ -53,7 +53,7 @@
 #endif
 extern FILE * option_usage_fp;
 #define zCopyright      (ntp_keygen_opt_strs+0)
-#define zLicenseDescrip (ntp_keygen_opt_strs+322)
+#define zLicenseDescrip (ntp_keygen_opt_strs+352)
 
 /*
  *  global included definitions
@@ -73,117 +73,118 @@
 /**
  *  static const strings for ntp-keygen options
  */
-static char const ntp_keygen_opt_strs[2357] =
-/*     0 */ "ntp-keygen (ntp) 4.2.8\n"
-            "Copyright (C) 1970-2014 The University of Delaware, all rights reserved.\n"
+static char const ntp_keygen_opt_strs[2419] =
+/*     0 */ "ntp-keygen (ntp) 4.2.8p2\n"
+            "Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation, all rights reserved.\n"
             "This is free software. It is licensed for use, modification and\n"
             "redistribution under the terms of the NTP License, copies of which\n"
             "can be seen at:\n"
             "  <http://ntp.org/license>\n"
             "  <http://opensource.org/licenses/ntp-license.php>\n\0"
-/*   322 */ "Permission to use, copy, modify, and distribute this software and its\n"
+/*   352 */ "Permission to use, copy, modify, and distribute this software and its\n"
             "documentation for any purpose with or without fee is hereby granted,\n"
             "provided that the above copyright notice appears in all copies and that\n"
             "both the copyright notice and this permission notice appear in supporting\n"
             "documentation, and that the name The University of Delaware not be used in\n"
             "advertising or publicity pertaining to distribution of the software without\n"
-            "specific, written prior permission.  The University of Delaware makes no\n"
-            "representations about the suitability this software for any purpose.  It is\n"
-            "provided \"as is\" without express or implied warranty.\n\0"
-/*   962 */ "identity modulus bits\0"
-/*   984 */ "IMBITS\0"
-/*   991 */ "imbits\0"
-/*   998 */ "certificate scheme\0"
-/*  1017 */ "CERTIFICATE\0"
-/*  1029 */ "certificate\0"
-/*  1041 */ "privatekey cipher\0"
-/*  1059 */ "CIPHER\0"
-/*  1066 */ "cipher\0"
-/*  1073 */ "Increase debug verbosity level\0"
-/*  1104 */ "DEBUG_LEVEL\0"
-/*  1116 */ "debug-level\0"
-/*  1128 */ "Set the debug verbosity level\0"
-/*  1158 */ "SET_DEBUG_LEVEL\0"
-/*  1174 */ "set-debug-level\0"
-/*  1190 */ "Write IFF or GQ identity keys\0"
-/*  1220 */ "ID_KEY\0"
-/*  1227 */ "id-key\0"
-/*  1234 */ "Generate GQ parameters and keys\0"
-/*  1266 */ "GQ_PARAMS\0"
-/*  1276 */ "gq-params\0"
-/*  1286 */ "generate RSA host key\0"
-/*  1308 */ "HOST_KEY\0"
-/*  1317 */ "host-key\0"
-/*  1326 */ "generate IFF parameters\0"
-/*  1350 */ "IFFKEY\0"
-/*  1357 */ "iffkey\0"
-/*  1364 */ "set Autokey group name\0"
-/*  1387 */ "IDENT\0"
-/*  1393 */ "ident\0"
-/*  1399 */ "set certificate lifetime\0"
-/*  1424 */ "LIFETIME\0"
-/*  1433 */ "lifetime\0"
-/*  1442 */ "generate MD5 keys\0"
-/*  1460 */ "MD5KEY\0"
-/*  1467 */ "md5key\0"
-/*  1474 */ "modulus\0"
-/*  1482 */ "MODULUS\0"
-/*  1490 */ "generate PC private certificate\0"
-/*  1522 */ "PVT_CERT\0"
-/*  1531 */ "pvt-cert\0"
-/*  1540 */ "local private password\0"
-/*  1563 */ "PASSWORD\0"
-/*  1572 */ "password\0"
-/*  1581 */ "export IFF or GQ group keys with password\0"
-/*  1623 */ "EXPORT_PASSWD\0"
-/*  1637 */ "export-passwd\0"
-/*  1651 */ "generate sign key (RSA or DSA)\0"
-/*  1682 */ "SIGN_KEY\0"
-/*  1691 */ "sign-key\0"
-/*  1700 */ "set host and optionally group name\0"
-/*  1735 */ "SUBJECT_NAME\0"
-/*  1748 */ "subject-name\0"
-/*  1761 */ "trusted certificate (TC scheme)\0"
-/*  1793 */ "TRUSTED_CERT\0"
-/*  1806 */ "trusted-cert\0"
-/*  1819 */ "generate <num> MV parameters\0"
-/*  1848 */ "MV_PARAMS\0"
-/*  1858 */ "mv-params\0"
-/*  1868 */ "update <num> MV keys\0"
-/*  1889 */ "MV_KEYS\0"
-/*  1897 */ "mv-keys\0"
-/*  1905 */ "display extended usage information and exit\0"
-/*  1949 */ "help\0"
-/*  1954 */ "extended usage information passed thru pager\0"
-/*  1999 */ "more-help\0"
-/*  2009 */ "output version information and exit\0"
-/*  2045 */ "version\0"
-/*  2053 */ "save the option state to a config file\0"
-/*  2092 */ "save-opts\0"
-/*  2102 */ "load options from a config file\0"
-/*  2134 */ "LOAD_OPTS\0"
-/*  2144 */ "no-load-opts\0"
-/*  2157 */ "no\0"
-/*  2160 */ "NTP_KEYGEN\0"
-/*  2171 */ "ntp-keygen (ntp) - Create a NTP host key - Ver. 4.2.8\n"
+            "specific, written prior permission.  The University of Delaware and Network\n"
+            "Time Foundation makes no representations about the suitability this\n"
+            "software for any purpose.  It is provided \"as is\" without express or\n"
+            "implied warranty.\n\0"
+/*  1020 */ "identity modulus bits\0"
+/*  1042 */ "IMBITS\0"
+/*  1049 */ "imbits\0"
+/*  1056 */ "certificate scheme\0"
+/*  1075 */ "CERTIFICATE\0"
+/*  1087 */ "certificate\0"
+/*  1099 */ "privatekey cipher\0"
+/*  1117 */ "CIPHER\0"
+/*  1124 */ "cipher\0"
+/*  1131 */ "Increase debug verbosity level\0"
+/*  1162 */ "DEBUG_LEVEL\0"
+/*  1174 */ "debug-level\0"
+/*  1186 */ "Set the debug verbosity level\0"
+/*  1216 */ "SET_DEBUG_LEVEL\0"
+/*  1232 */ "set-debug-level\0"
+/*  1248 */ "Write IFF or GQ identity keys\0"
+/*  1278 */ "ID_KEY\0"
+/*  1285 */ "id-key\0"
+/*  1292 */ "Generate GQ parameters and keys\0"
+/*  1324 */ "GQ_PARAMS\0"
+/*  1334 */ "gq-params\0"
+/*  1344 */ "generate RSA host key\0"
+/*  1366 */ "HOST_KEY\0"
+/*  1375 */ "host-key\0"
+/*  1384 */ "generate IFF parameters\0"
+/*  1408 */ "IFFKEY\0"
+/*  1415 */ "iffkey\0"
+/*  1422 */ "set Autokey group name\0"
+/*  1445 */ "IDENT\0"
+/*  1451 */ "ident\0"
+/*  1457 */ "set certificate lifetime\0"
+/*  1482 */ "LIFETIME\0"
+/*  1491 */ "lifetime\0"
+/*  1500 */ "generate MD5 keys\0"
+/*  1518 */ "MD5KEY\0"
+/*  1525 */ "md5key\0"
+/*  1532 */ "modulus\0"
+/*  1540 */ "MODULUS\0"
+/*  1548 */ "generate PC private certificate\0"
+/*  1580 */ "PVT_CERT\0"
+/*  1589 */ "pvt-cert\0"
+/*  1598 */ "local private password\0"
+/*  1621 */ "PASSWORD\0"
+/*  1630 */ "password\0"
+/*  1639 */ "export IFF or GQ group keys with password\0"
+/*  1681 */ "EXPORT_PASSWD\0"
+/*  1695 */ "export-passwd\0"
+/*  1709 */ "generate sign key (RSA or DSA)\0"
+/*  1740 */ "SIGN_KEY\0"
+/*  1749 */ "sign-key\0"
+/*  1758 */ "set host and optionally group name\0"
+/*  1793 */ "SUBJECT_NAME\0"
+/*  1806 */ "subject-name\0"
+/*  1819 */ "trusted certificate (TC scheme)\0"
+/*  1851 */ "TRUSTED_CERT\0"
+/*  1864 */ "trusted-cert\0"
+/*  1877 */ "generate <num> MV parameters\0"
+/*  1906 */ "MV_PARAMS\0"
+/*  1916 */ "mv-params\0"
+/*  1926 */ "update <num> MV keys\0"
+/*  1947 */ "MV_KEYS\0"
+/*  1955 */ "mv-keys\0"
+/*  1963 */ "display extended usage information and exit\0"
+/*  2007 */ "help\0"
+/*  2012 */ "extended usage information passed thru pager\0"
+/*  2057 */ "more-help\0"
+/*  2067 */ "output version information and exit\0"
+/*  2103 */ "version\0"
+/*  2111 */ "save the option state to a config file\0"
+/*  2150 */ "save-opts\0"
+/*  2160 */ "load options from a config file\0"
+/*  2192 */ "LOAD_OPTS\0"
+/*  2202 */ "no-load-opts\0"
+/*  2215 */ "no\0"
+/*  2218 */ "NTP_KEYGEN\0"
+/*  2229 */ "ntp-keygen (ntp) - Create a NTP host key - Ver. 4.2.8p2\n"
             "Usage:  %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]...\n\0"
-/*  2283 */ "$HOME\0"
-/*  2289 */ ".\0"
-/*  2291 */ ".ntprc\0"
-/*  2298 */ "http://bugs.ntp.org, bugs@ntp.org\0"
-/*  2332 */ "\n\0"
-/*  2334 */ "ntp-keygen (ntp) 4.2.8";
+/*  2343 */ "$HOME\0"
+/*  2349 */ ".\0"
+/*  2351 */ ".ntprc\0"
+/*  2358 */ "http://bugs.ntp.org, bugs@ntp.org\0"
+/*  2392 */ "\n\0"
+/*  2394 */ "ntp-keygen (ntp) 4.2.8p2";
 
 /**
  *  imbits option description:
  */
 #ifdef AUTOKEY
 /** Descriptive text for the imbits option */
-#define IMBITS_DESC      (ntp_keygen_opt_strs+962)
+#define IMBITS_DESC      (ntp_keygen_opt_strs+1020)
 /** Upper-cased name for the imbits option */
-#define IMBITS_NAME      (ntp_keygen_opt_strs+984)
+#define IMBITS_NAME      (ntp_keygen_opt_strs+1042)
 /** Name string for the imbits option */
-#define IMBITS_name      (ntp_keygen_opt_strs+991)
+#define IMBITS_name      (ntp_keygen_opt_strs+1049)
 /** Compiled in flag settings for the imbits option */
 #define IMBITS_FLAGS     (OPTST_DISABLED \
         | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
@@ -200,11 +201,11 @@
  */
 #ifdef AUTOKEY
 /** Descriptive text for the certificate option */
-#define CERTIFICATE_DESC      (ntp_keygen_opt_strs+998)
+#define CERTIFICATE_DESC      (ntp_keygen_opt_strs+1056)
 /** Upper-cased name for the certificate option */
-#define CERTIFICATE_NAME      (ntp_keygen_opt_strs+1017)
+#define CERTIFICATE_NAME      (ntp_keygen_opt_strs+1075)
 /** Name string for the certificate option */
-#define CERTIFICATE_name      (ntp_keygen_opt_strs+1029)
+#define CERTIFICATE_name      (ntp_keygen_opt_strs+1087)
 /** Compiled in flag settings for the certificate option */
 #define CERTIFICATE_FLAGS     (OPTST_DISABLED \
         | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
@@ -221,11 +222,11 @@
  */
 #ifdef AUTOKEY
 /** Descriptive text for the cipher option */
-#define CIPHER_DESC      (ntp_keygen_opt_strs+1041)
+#define CIPHER_DESC      (ntp_keygen_opt_strs+1099)
 /** Upper-cased name for the cipher option */
-#define CIPHER_NAME      (ntp_keygen_opt_strs+1059)
+#define CIPHER_NAME      (ntp_keygen_opt_strs+1117)
 /** Name string for the cipher option */
-#define CIPHER_name      (ntp_keygen_opt_strs+1066)
+#define CIPHER_name      (ntp_keygen_opt_strs+1124)
 /** Compiled in flag settings for the cipher option */
 #define CIPHER_FLAGS     (OPTST_DISABLED \
         | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
@@ -241,11 +242,11 @@
  *  debug-level option description:
  */
 /** Descriptive text for the debug-level option */
-#define DEBUG_LEVEL_DESC      (ntp_keygen_opt_strs+1073)
+#define DEBUG_LEVEL_DESC      (ntp_keygen_opt_strs+1131)
 /** Upper-cased name for the debug-level option */
-#define DEBUG_LEVEL_NAME      (ntp_keygen_opt_strs+1104)
+#define DEBUG_LEVEL_NAME      (ntp_keygen_opt_strs+1162)
 /** Name string for the debug-level option */
-#define DEBUG_LEVEL_name      (ntp_keygen_opt_strs+1116)
+#define DEBUG_LEVEL_name      (ntp_keygen_opt_strs+1174)
 /** Compiled in flag settings for the debug-level option */
 #define DEBUG_LEVEL_FLAGS     (OPTST_DISABLED)
 
@@ -253,11 +254,11 @@
  *  set-debug-level option description:
  */
 /** Descriptive text for the set-debug-level option */
-#define SET_DEBUG_LEVEL_DESC      (ntp_keygen_opt_strs+1128)
+#define SET_DEBUG_LEVEL_DESC      (ntp_keygen_opt_strs+1186)
 /** Upper-cased name for the set-debug-level option */
-#define SET_DEBUG_LEVEL_NAME      (ntp_keygen_opt_strs+1158)
+#define SET_DEBUG_LEVEL_NAME      (ntp_keygen_opt_strs+1216)
 /** Name string for the set-debug-level option */
-#define SET_DEBUG_LEVEL_name      (ntp_keygen_opt_strs+1174)
+#define SET_DEBUG_LEVEL_name      (ntp_keygen_opt_strs+1232)
 /** Compiled in flag settings for the set-debug-level option */
 #define SET_DEBUG_LEVEL_FLAGS     (OPTST_DISABLED \
         | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
@@ -267,11 +268,11 @@
  */
 #ifdef AUTOKEY
 /** Descriptive text for the id-key option */
-#define ID_KEY_DESC      (ntp_keygen_opt_strs+1190)
+#define ID_KEY_DESC      (ntp_keygen_opt_strs+1248)
 /** Upper-cased name for the id-key option */
-#define ID_KEY_NAME      (ntp_keygen_opt_strs+1220)
+#define ID_KEY_NAME      (ntp_keygen_opt_strs+1278)
 /** Name string for the id-key option */
-#define ID_KEY_name      (ntp_keygen_opt_strs+1227)
+#define ID_KEY_name      (ntp_keygen_opt_strs+1285)
 /** Compiled in flag settings for the id-key option */
 #define ID_KEY_FLAGS     (OPTST_DISABLED)
 
@@ -287,11 +288,11 @@
  */
 #ifdef AUTOKEY
 /** Descriptive text for the gq-params option */
-#define GQ_PARAMS_DESC      (ntp_keygen_opt_strs+1234)
+#define GQ_PARAMS_DESC      (ntp_keygen_opt_strs+1292)
 /** Upper-cased name for the gq-params option */
-#define GQ_PARAMS_NAME      (ntp_keygen_opt_strs+1266)
+#define GQ_PARAMS_NAME      (ntp_keygen_opt_strs+1324)
 /** Name string for the gq-params option */
-#define GQ_PARAMS_name      (ntp_keygen_opt_strs+1276)
+#define GQ_PARAMS_name      (ntp_keygen_opt_strs+1334)
 /** Compiled in flag settings for the gq-params option */
 #define GQ_PARAMS_FLAGS     (OPTST_DISABLED)
 
@@ -307,11 +308,11 @@
  */
 #ifdef AUTOKEY
 /** Descriptive text for the host-key option */
-#define HOST_KEY_DESC      (ntp_keygen_opt_strs+1286)
+#define HOST_KEY_DESC      (ntp_keygen_opt_strs+1344)
 /** Upper-cased name for the host-key option */
-#define HOST_KEY_NAME      (ntp_keygen_opt_strs+1308)
+#define HOST_KEY_NAME      (ntp_keygen_opt_strs+1366)
 /** Name string for the host-key option */
-#define HOST_KEY_name      (ntp_keygen_opt_strs+1317)
+#define HOST_KEY_name      (ntp_keygen_opt_strs+1375)
 /** Compiled in flag settings for the host-key option */
 #define HOST_KEY_FLAGS     (OPTST_DISABLED)
 
@@ -327,11 +328,11 @@
  */
 #ifdef AUTOKEY
 /** Descriptive text for the iffkey option */
-#define IFFKEY_DESC      (ntp_keygen_opt_strs+1326)
+#define IFFKEY_DESC      (ntp_keygen_opt_strs+1384)
 /** Upper-cased name for the iffkey option */
-#define IFFKEY_NAME      (ntp_keygen_opt_strs+1350)
+#define IFFKEY_NAME      (ntp_keygen_opt_strs+1408)
 /** Name string for the iffkey option */
-#define IFFKEY_name      (ntp_keygen_opt_strs+1357)
+#define IFFKEY_name      (ntp_keygen_opt_strs+1415)
 /** Compiled in flag settings for the iffkey option */
 #define IFFKEY_FLAGS     (OPTST_DISABLED)
 
@@ -347,11 +348,11 @@
  */
 #ifdef AUTOKEY
 /** Descriptive text for the ident option */
-#define IDENT_DESC      (ntp_keygen_opt_strs+1364)
+#define IDENT_DESC      (ntp_keygen_opt_strs+1422)
 /** Upper-cased name for the ident option */
-#define IDENT_NAME      (ntp_keygen_opt_strs+1387)
+#define IDENT_NAME      (ntp_keygen_opt_strs+1445)
 /** Name string for the ident option */
-#define IDENT_name      (ntp_keygen_opt_strs+1393)
+#define IDENT_name      (ntp_keygen_opt_strs+1451)
 /** Compiled in flag settings for the ident option */
 #define IDENT_FLAGS     (OPTST_DISABLED \
         | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
@@ -368,11 +369,11 @@
  */
 #ifdef AUTOKEY
 /** Descriptive text for the lifetime option */
-#define LIFETIME_DESC      (ntp_keygen_opt_strs+1399)
+#define LIFETIME_DESC      (ntp_keygen_opt_strs+1457)
 /** Upper-cased name for the lifetime option */
-#define LIFETIME_NAME      (ntp_keygen_opt_strs+1424)
+#define LIFETIME_NAME      (ntp_keygen_opt_strs+1482)
 /** Name string for the lifetime option */
-#define LIFETIME_name      (ntp_keygen_opt_strs+1433)
+#define LIFETIME_name      (ntp_keygen_opt_strs+1491)
 /** Compiled in flag settings for the lifetime option */
 #define LIFETIME_FLAGS     (OPTST_DISABLED \
         | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
@@ -388,11 +389,11 @@
  *  md5key option description:
  */
 /** Descriptive text for the md5key option */
-#define MD5KEY_DESC      (ntp_keygen_opt_strs+1442)
+#define MD5KEY_DESC      (ntp_keygen_opt_strs+1500)
 /** Upper-cased name for the md5key option */
-#define MD5KEY_NAME      (ntp_keygen_opt_strs+1460)
+#define MD5KEY_NAME      (ntp_keygen_opt_strs+1518)
 /** Name string for the md5key option */
-#define MD5KEY_name      (ntp_keygen_opt_strs+1467)
+#define MD5KEY_name      (ntp_keygen_opt_strs+1525)
 /** Compiled in flag settings for the md5key option */
 #define MD5KEY_FLAGS     (OPTST_DISABLED)
 
@@ -401,11 +402,11 @@
  */
 #ifdef AUTOKEY
 /** Descriptive text for the modulus option */
-#define MODULUS_DESC      (ntp_keygen_opt_strs+1474)
+#define MODULUS_DESC      (ntp_keygen_opt_strs+1532)
 /** Upper-cased name for the modulus option */
-#define MODULUS_NAME      (ntp_keygen_opt_strs+1482)
+#define MODULUS_NAME      (ntp_keygen_opt_strs+1540)
 /** Name string for the modulus option */
-#define MODULUS_name      (ntp_keygen_opt_strs+1474)
+#define MODULUS_name      (ntp_keygen_opt_strs+1532)
 /** Compiled in flag settings for the modulus option */
 #define MODULUS_FLAGS     (OPTST_DISABLED \
         | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
@@ -422,11 +423,11 @@
  */
 #ifdef AUTOKEY
 /** Descriptive text for the pvt-cert option */
-#define PVT_CERT_DESC      (ntp_keygen_opt_strs+1490)
+#define PVT_CERT_DESC      (ntp_keygen_opt_strs+1548)
 /** Upper-cased name for the pvt-cert option */
-#define PVT_CERT_NAME      (ntp_keygen_opt_strs+1522)
+#define PVT_CERT_NAME      (ntp_keygen_opt_strs+1580)
 /** Name string for the pvt-cert option */
-#define PVT_CERT_name      (ntp_keygen_opt_strs+1531)
+#define PVT_CERT_name      (ntp_keygen_opt_strs+1589)
 /** Compiled in flag settings for the pvt-cert option */
 #define PVT_CERT_FLAGS     (OPTST_DISABLED)
 
@@ -442,11 +443,11 @@
  */
 #ifdef AUTOKEY
 /** Descriptive text for the password option */
-#define PASSWORD_DESC      (ntp_keygen_opt_strs+1540)
+#define PASSWORD_DESC      (ntp_keygen_opt_strs+1598)
 /** Upper-cased name for the password option */
-#define PASSWORD_NAME      (ntp_keygen_opt_strs+1563)
+#define PASSWORD_NAME      (ntp_keygen_opt_strs+1621)
 /** Name string for the password option */
-#define PASSWORD_name      (ntp_keygen_opt_strs+1572)
+#define PASSWORD_name      (ntp_keygen_opt_strs+1630)
 /** Compiled in flag settings for the password option */
 #define PASSWORD_FLAGS     (OPTST_DISABLED \
         | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
@@ -463,11 +464,11 @@
  */
 #ifdef AUTOKEY
 /** Descriptive text for the export-passwd option */
-#define EXPORT_PASSWD_DESC      (ntp_keygen_opt_strs+1581)
+#define EXPORT_PASSWD_DESC      (ntp_keygen_opt_strs+1639)
 /** Upper-cased name for the export-passwd option */
-#define EXPORT_PASSWD_NAME      (ntp_keygen_opt_strs+1623)
+#define EXPORT_PASSWD_NAME      (ntp_keygen_opt_strs+1681)
 /** Name string for the export-passwd option */
-#define EXPORT_PASSWD_name      (ntp_keygen_opt_strs+1637)
+#define EXPORT_PASSWD_name      (ntp_keygen_opt_strs+1695)
 /** Compiled in flag settings for the export-passwd option */
 #define EXPORT_PASSWD_FLAGS     (OPTST_DISABLED \
         | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
@@ -484,11 +485,11 @@
  */
 #ifdef AUTOKEY
 /** Descriptive text for the sign-key option */
-#define SIGN_KEY_DESC      (ntp_keygen_opt_strs+1651)
+#define SIGN_KEY_DESC      (ntp_keygen_opt_strs+1709)
 /** Upper-cased name for the sign-key option */
-#define SIGN_KEY_NAME      (ntp_keygen_opt_strs+1682)
+#define SIGN_KEY_NAME      (ntp_keygen_opt_strs+1740)
 /** Name string for the sign-key option */
-#define SIGN_KEY_name      (ntp_keygen_opt_strs+1691)
+#define SIGN_KEY_name      (ntp_keygen_opt_strs+1749)
 /** Compiled in flag settings for the sign-key option */
 #define SIGN_KEY_FLAGS     (OPTST_DISABLED \
         | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
@@ -505,11 +506,11 @@
  */
 #ifdef AUTOKEY
 /** Descriptive text for the subject-name option */
-#define SUBJECT_NAME_DESC      (ntp_keygen_opt_strs+1700)
+#define SUBJECT_NAME_DESC      (ntp_keygen_opt_strs+1758)
 /** Upper-cased name for the subject-name option */
-#define SUBJECT_NAME_NAME      (ntp_keygen_opt_strs+1735)
+#define SUBJECT_NAME_NAME      (ntp_keygen_opt_strs+1793)
 /** Name string for the subject-name option */
-#define SUBJECT_NAME_name      (ntp_keygen_opt_strs+1748)
+#define SUBJECT_NAME_name      (ntp_keygen_opt_strs+1806)
 /** Compiled in flag settings for the subject-name option */
 #define SUBJECT_NAME_FLAGS     (OPTST_DISABLED \
         | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
@@ -526,11 +527,11 @@
  */
 #ifdef AUTOKEY
 /** Descriptive text for the trusted-cert option */
-#define TRUSTED_CERT_DESC      (ntp_keygen_opt_strs+1761)
+#define TRUSTED_CERT_DESC      (ntp_keygen_opt_strs+1819)
 /** Upper-cased name for the trusted-cert option */
-#define TRUSTED_CERT_NAME      (ntp_keygen_opt_strs+1793)
+#define TRUSTED_CERT_NAME      (ntp_keygen_opt_strs+1851)
 /** Name string for the trusted-cert option */
-#define TRUSTED_CERT_name      (ntp_keygen_opt_strs+1806)
+#define TRUSTED_CERT_name      (ntp_keygen_opt_strs+1864)
 /** Compiled in flag settings for the trusted-cert option */
 #define TRUSTED_CERT_FLAGS     (OPTST_DISABLED)
 
@@ -546,11 +547,11 @@
  */
 #ifdef AUTOKEY
 /** Descriptive text for the mv-params option */
-#define MV_PARAMS_DESC      (ntp_keygen_opt_strs+1819)
+#define MV_PARAMS_DESC      (ntp_keygen_opt_strs+1877)
 /** Upper-cased name for the mv-params option */
-#define MV_PARAMS_NAME      (ntp_keygen_opt_strs+1848)
+#define MV_PARAMS_NAME      (ntp_keygen_opt_strs+1906)
 /** Name string for the mv-params option */
-#define MV_PARAMS_name      (ntp_keygen_opt_strs+1858)
+#define MV_PARAMS_name      (ntp_keygen_opt_strs+1916)
 /** Compiled in flag settings for the mv-params option */
 #define MV_PARAMS_FLAGS     (OPTST_DISABLED \
         | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
@@ -567,11 +568,11 @@
  */
 #ifdef AUTOKEY
 /** Descriptive text for the mv-keys option */
-#define MV_KEYS_DESC      (ntp_keygen_opt_strs+1868)
+#define MV_KEYS_DESC      (ntp_keygen_opt_strs+1926)
 /** Upper-cased name for the mv-keys option */
-#define MV_KEYS_NAME      (ntp_keygen_opt_strs+1889)
+#define MV_KEYS_NAME      (ntp_keygen_opt_strs+1947)
 /** Name string for the mv-keys option */
-#define MV_KEYS_name      (ntp_keygen_opt_strs+1897)
+#define MV_KEYS_name      (ntp_keygen_opt_strs+1955)
 /** Compiled in flag settings for the mv-keys option */
 #define MV_KEYS_FLAGS     (OPTST_DISABLED \
         | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
@@ -586,11 +587,11 @@
 /*
  *  Help/More_Help/Version option descriptions:
  */
-#define HELP_DESC       (ntp_keygen_opt_strs+1905)
-#define HELP_name       (ntp_keygen_opt_strs+1949)
+#define HELP_DESC       (ntp_keygen_opt_strs+1963)
+#define HELP_name       (ntp_keygen_opt_strs+2007)
 #ifdef HAVE_WORKING_FORK
-#define MORE_HELP_DESC  (ntp_keygen_opt_strs+1954)
-#define MORE_HELP_name  (ntp_keygen_opt_strs+1999)
+#define MORE_HELP_DESC  (ntp_keygen_opt_strs+2012)
+#define MORE_HELP_name  (ntp_keygen_opt_strs+2057)
 #define MORE_HELP_FLAGS (OPTST_IMM | OPTST_NO_INIT)
 #else
 #define MORE_HELP_DESC  HELP_DESC
@@ -603,14 +604,14 @@
 #  define VER_FLAGS     (OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) | \
                          OPTST_ARG_OPTIONAL | OPTST_IMM | OPTST_NO_INIT)
 #endif
-#define VER_DESC        (ntp_keygen_opt_strs+2009)
-#define VER_name        (ntp_keygen_opt_strs+2045)
-#define SAVE_OPTS_DESC  (ntp_keygen_opt_strs+2053)
-#define SAVE_OPTS_name  (ntp_keygen_opt_strs+2092)
-#define LOAD_OPTS_DESC     (ntp_keygen_opt_strs+2102)
-#define LOAD_OPTS_NAME     (ntp_keygen_opt_strs+2134)
-#define NO_LOAD_OPTS_name  (ntp_keygen_opt_strs+2144)
-#define LOAD_OPTS_pfx      (ntp_keygen_opt_strs+2157)
+#define VER_DESC        (ntp_keygen_opt_strs+2067)
+#define VER_name        (ntp_keygen_opt_strs+2103)
+#define SAVE_OPTS_DESC  (ntp_keygen_opt_strs+2111)
+#define SAVE_OPTS_name  (ntp_keygen_opt_strs+2150)
+#define LOAD_OPTS_DESC     (ntp_keygen_opt_strs+2160)
+#define LOAD_OPTS_NAME     (ntp_keygen_opt_strs+2192)
+#define NO_LOAD_OPTS_name  (ntp_keygen_opt_strs+2202)
+#define LOAD_OPTS_pfx      (ntp_keygen_opt_strs+2215)
 #define LOAD_OPTS_name     (NO_LOAD_OPTS_name + 3)
 /**
  *  Declare option callback procedures
@@ -961,24 +962,24 @@
 
 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
 /** Reference to the upper cased version of ntp-keygen. */
-#define zPROGNAME       (ntp_keygen_opt_strs+2160)
+#define zPROGNAME       (ntp_keygen_opt_strs+2218)
 /** Reference to the title line for ntp-keygen usage. */
-#define zUsageTitle     (ntp_keygen_opt_strs+2171)
+#define zUsageTitle     (ntp_keygen_opt_strs+2229)
 /** ntp-keygen configuration file name. */
-#define zRcName         (ntp_keygen_opt_strs+2291)
+#define zRcName         (ntp_keygen_opt_strs+2351)
 /** Directories to search for ntp-keygen config files. */
 static char const * const apzHomeList[3] = {
-    ntp_keygen_opt_strs+2283,
-    ntp_keygen_opt_strs+2289,
+    ntp_keygen_opt_strs+2343,
+    ntp_keygen_opt_strs+2349,
     NULL };
 /** The ntp-keygen program bug email address. */
-#define zBugsAddr       (ntp_keygen_opt_strs+2298)
+#define zBugsAddr       (ntp_keygen_opt_strs+2358)
 /** Clarification/explanation of what ntp-keygen does. */
-#define zExplain        (ntp_keygen_opt_strs+2332)
+#define zExplain        (ntp_keygen_opt_strs+2392)
 /** Extra detail explaining what ntp-keygen does. */
 #define zDetail         (NULL)
 /** The full version string for ntp-keygen. */
-#define zFullVersion    (ntp_keygen_opt_strs+2334)
+#define zFullVersion    (ntp_keygen_opt_strs+2394)
 /* extracted from optcode.tlib near line 364 */
 
 #if defined(ENABLE_NLS)
@@ -1310,8 +1311,8 @@
      translate option names.
    */
   /* referenced via ntp_keygenOptions.pzCopyright */
-  puts(_("ntp-keygen (ntp) 4.2.8\n\
-Copyright (C) 1970-2014 The University of Delaware, all rights reserved.\n\
+  puts(_("ntp-keygen (ntp) 4.2.8p2\n\
+Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation, all rights reserved.\n\
 This is free software. It is licensed for use, modification and\n\
 redistribution under the terms of the NTP License, copies of which\n\
 can be seen at:\n"));
@@ -1325,9 +1326,10 @@
 both the copyright notice and this permission notice appear in supporting\n\
 documentation, and that the name The University of Delaware not be used in\n\
 advertising or publicity pertaining to distribution of the software without\n\
-specific, written prior permission.  The University of Delaware makes no\n\
-representations about the suitability this software for any purpose.  It is\n\
-provided \"as is\" without express or implied warranty.\n"));
+specific, written prior permission.  The University of Delaware and Network\n\
+Time Foundation makes no representations about the suitability this\n\
+software for any purpose.  It is provided \"as is\" without express or\n\
+implied warranty.\n"));
 
   /* referenced via ntp_keygenOptions.pOptDesc->pzText */
   puts(_("identity modulus bits"));
@@ -1408,14 +1410,14 @@
   puts(_("load options from a config file"));
 
   /* referenced via ntp_keygenOptions.pzUsageTitle */
-  puts(_("ntp-keygen (ntp) - Create a NTP host key - Ver. 4.2.8\n\
+  puts(_("ntp-keygen (ntp) - Create a NTP host key - Ver. 4.2.8p2\n\
 Usage:  %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]...\n"));
 
   /* referenced via ntp_keygenOptions.pzExplain */
   puts(_("\n"));
 
   /* referenced via ntp_keygenOptions.pzFullVersion */
-  puts(_("ntp-keygen (ntp) 4.2.8"));
+  puts(_("ntp-keygen (ntp) 4.2.8p2"));
 
   /* referenced via ntp_keygenOptions.pzFullUsage */
   puts(_("<<<NOT-FOUND>>>"));
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/util/ntp-keygen-opts.h /cur/src/external/bsd/ntp/dist/util/ntp-keygen-opts.h
--- external/bsd/ntp/dist/util/ntp-keygen-opts.h	2014-12-24 18:28:19.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/util/ntp-keygen-opts.h	2015-04-07 19:51:18.000000000 -0700
@@ -3,7 +3,7 @@
 /*
  *  EDIT THIS FILE WITH CAUTION  (ntp-keygen-opts.h)
  *
- *  It has been AutoGen-ed  December 19, 2014 at 07:50:38 AM by AutoGen 5.18.5pre4
+ *  It has been AutoGen-ed  April  7, 2015 at 04:27:29 AM by AutoGen 5.18.5pre4
  *  From the definitions    ntp-keygen-opts.def
  *  and the template file   options
  *
@@ -20,7 +20,7 @@
  * The ntp-keygen program is copyrighted and licensed
  * under the following terms:
  *
- *  Copyright (C) 1970-2014 The University of Delaware, all rights reserved.
+ *  Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation, all rights reserved.
  *  This is free software. It is licensed for use, modification and
  *  redistribution under the terms of the NTP License, copies of which
  *  can be seen at:
@@ -33,7 +33,7 @@
  *  both the copyright notice and this permission notice appear in
  *  supporting documentation, and that the name The University of Delaware not be used in
  *  advertising or publicity pertaining to distribution of the software
- *  without specific, written prior permission. The University of Delaware makes no
+ *  without specific, written prior permission. The University of Delaware and Network Time Foundation makes no
  *  representations about the suitability this software for any purpose. It
  *  is provided "as is" without express or implied warranty.
  */
@@ -96,9 +96,9 @@
 /** count of all options for ntp-keygen */
 #define OPTION_CT    26
 /** ntp-keygen version */
-#define NTP_KEYGEN_VERSION       "4.2.8"
+#define NTP_KEYGEN_VERSION       "4.2.8p2"
 /** Full ntp-keygen version text */
-#define NTP_KEYGEN_FULL_VERSION  "ntp-keygen (ntp) 4.2.8"
+#define NTP_KEYGEN_FULL_VERSION  "ntp-keygen (ntp) 4.2.8p2"
 
 /**
  *  Interface defines for all options.  Replace "n" with the UPPER_CASED
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/util/ntp-keygen.1ntp-keygenman /cur/src/external/bsd/ntp/dist/util/ntp-keygen.1ntp-keygenman
--- external/bsd/ntp/dist/util/ntp-keygen.1ntp-keygenman	2014-12-19 12:37:49.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/util/ntp-keygen.1ntp-keygenman	2015-04-07 19:51:18.000000000 -0700
@@ -10,11 +10,11 @@
 .ds B-Font B
 .ds I-Font I
 .ds R-Font R
-.TH ntp-keygen 1ntp-keygenman "19 Dec 2014" "ntp (4.2.8)" "User Commands"
+.TH ntp-keygen 1ntp-keygenman "07 Apr 2015" "ntp (4.2.8p2)" "User Commands"
 .\"
-.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-6fayVi/ag-hgaqUi)
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-Kfaqzc/ag-Wfaiyc)
 .\"
-.\" It has been AutoGen-ed December 19, 2014 at 07:50:51 AM by AutoGen 5.18.5pre4
+.\" It has been AutoGen-ed April 7, 2015 at 04:27:42 AM by AutoGen 5.18.5pre4
 .\" From the definitions ntp-keygen-opts.def
 .\" and the template file agman-cmd.tpl
 .SH NAME
@@ -1195,9 +1195,9 @@
 it to autogen-users@lists.sourceforge.net.  Thank you.
 .PP
 .SH "AUTHORS"
-The University of Delaware
+The University of Delaware and Network Time Foundation
 .SH "COPYRIGHT"
-Copyright (C) 1970-2014 The University of Delaware all rights reserved.
+Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation all rights reserved.
 This program is released under the terms of the NTP license, <http://ntp.org/license>.
 .SH BUGS
 It can take quite a while to generate some cryptographic values,
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/util/ntp-keygen.1ntp-keygenmdoc /cur/src/external/bsd/ntp/dist/util/ntp-keygen.1ntp-keygenmdoc
--- external/bsd/ntp/dist/util/ntp-keygen.1ntp-keygenmdoc	2014-12-19 12:37:49.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/util/ntp-keygen.1ntp-keygenmdoc	2015-04-07 19:51:18.000000000 -0700
@@ -1,9 +1,9 @@
-.Dd December 19 2014
+.Dd April 7 2015
 .Dt NTP_KEYGEN 1ntp-keygenmdoc User Commands
 .Os
 .\"  EDIT THIS FILE WITH CAUTION  (ntp-keygen-opts.mdoc)
 .\"
-.\"  It has been AutoGen-ed  December 19, 2014 at 07:50:58 AM by AutoGen 5.18.5pre4
+.\"  It has been AutoGen-ed  April  7, 2015 at 04:27:49 AM by AutoGen 5.18.5pre4
 .\"  From the definitions    ntp-keygen-opts.def
 .\"  and the template file   agmdoc-cmd.tpl
 .Sh NAME
@@ -1051,9 +1051,9 @@
 it to autogen\-users@lists.sourceforge.net.  Thank you.
 .El
 .Sh "AUTHORS"
-The University of Delaware
+The University of Delaware and Network Time Foundation
 .Sh "COPYRIGHT"
-Copyright (C) 1970\-2014 The University of Delaware all rights reserved.
+Copyright (C) 1992\-2015 The University of Delaware and Network Time Foundation all rights reserved.
 This program is released under the terms of the NTP license, <http://ntp.org/license>.
 .Sh BUGS
 It can take quite a while to generate some cryptographic values,
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/util/ntp-keygen.c /cur/src/external/bsd/ntp/dist/util/ntp-keygen.c
--- external/bsd/ntp/dist/util/ntp-keygen.c	2014-12-24 18:28:19.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/util/ntp-keygen.c	2015-04-07 19:51:18.000000000 -0700
@@ -829,24 +829,24 @@
 	str = fheader("MD5key", id, groupname);
 	for (i = 1; i <= MD5KEYS; i++) {
 		for (j = 0; j < MD5SIZE; j++) {
-			int temp;
+			u_char temp;
 
 			while (1) {
 				int rc;
 
-				rc = ntp_crypto_random_buf(&temp, 1);
+				rc = ntp_crypto_random_buf(
+				    &temp, sizeof(temp));
 				if (-1 == rc) {
 					fprintf(stderr, "ntp_crypto_random_buf() failed.\n");
 					exit (-1);
 				}
-				temp &= 0xff;
 				if (temp == '#')
 					continue;
 
 				if (temp > 0x20 && temp < 0x7f)
 					break;
 			}
-			md5key[j] = (u_char)temp;
+			md5key[j] = temp;
 		}
 		md5key[j] = '\0';
 		fprintf(str, "%2d MD5 %s  # MD5 key\n", i,
@@ -2172,15 +2172,29 @@
 	FILE	*str;		/* file handle */
 	char	linkname[MAXFILENAME]; /* link name */
 	int	temp;
-
+#ifdef HAVE_UMASK
+        mode_t  orig_umask;
+#endif
+        
 	snprintf(filename, sizeof(filename), "ntpkey_%s_%s.%u", file,
 	    owner, fstamp); 
-	if ((str = fopen(filename, "w")) == NULL) {
+#ifdef HAVE_UMASK
+        orig_umask = umask( S_IWGRP | S_IRWXO );
+        str = fopen(filename, "w");
+        (void) umask(orig_umask);
+#else
+        str = fopen(filename, "w");
+#endif
+	if (str == NULL) {
 		perror("Write");
 		exit (-1);
 	}
-	snprintf(linkname, sizeof(linkname), "ntpkey_%s_%s", ulink,
-	    hostname);
+        if (strcmp(ulink, "md5") == 0) {
+          strcpy(linkname,"ntp.keys");
+        } else {
+          snprintf(linkname, sizeof(linkname), "ntpkey_%s_%s", ulink,
+                   hostname);
+        }
 	(void)remove(linkname);		/* The symlink() line below matters */
 	temp = symlink(filename, linkname);
 	if (temp < 0)
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/util/ntp-keygen.html /cur/src/external/bsd/ntp/dist/util/ntp-keygen.html
--- external/bsd/ntp/dist/util/ntp-keygen.html	2014-12-19 12:37:49.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/util/ntp-keygen.html	2015-04-07 19:51:18.000000000 -0700
@@ -70,7 +70,7 @@
 printable ASCII format so they can be embedded as MIME attachments in
 mail to other sites.
 
-  <p>This document applies to version 4.2.8 of <code>ntp-keygen</code>.
+  <p>This document applies to version 4.2.8p2 of <code>ntp-keygen</code>.
 
 <div class="node">
 <p><hr>
@@ -1085,7 +1085,7 @@
 used to select the program, defaulting to <span class="file">more</span>.  Both will exit
 with a status code of 0.
 
-<pre class="example">ntp-keygen (ntp) - Create a NTP host key - Ver. 4.2.7p486-RC
+<pre class="example">ntp-keygen (ntp) - Create a NTP host key - Ver. 4.2.8p2-RC3
 Usage:  ntp-keygen [ -&lt;flag&gt; [&lt;val&gt;] | --&lt;name&gt;[{=| }&lt;val&gt;] ]...
   Flg Arg Option-Name    Description
    -b Num imbits         identity modulus bits
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/util/ntp-keygen.man.in /cur/src/external/bsd/ntp/dist/util/ntp-keygen.man.in
--- external/bsd/ntp/dist/util/ntp-keygen.man.in	2014-12-19 12:37:49.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/util/ntp-keygen.man.in	2015-04-07 19:51:18.000000000 -0700
@@ -10,11 +10,11 @@
 .ds B-Font B
 .ds I-Font I
 .ds R-Font R
-.TH ntp-keygen @NTP_KEYGEN_MS@ "19 Dec 2014" "ntp (4.2.8)" "User Commands"
+.TH ntp-keygen @NTP_KEYGEN_MS@ "07 Apr 2015" "ntp (4.2.8p2)" "User Commands"
 .\"
-.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-6fayVi/ag-hgaqUi)
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-Kfaqzc/ag-Wfaiyc)
 .\"
-.\" It has been AutoGen-ed December 19, 2014 at 07:50:51 AM by AutoGen 5.18.5pre4
+.\" It has been AutoGen-ed April 7, 2015 at 04:27:42 AM by AutoGen 5.18.5pre4
 .\" From the definitions ntp-keygen-opts.def
 .\" and the template file agman-cmd.tpl
 .SH NAME
@@ -1195,9 +1195,9 @@
 it to autogen-users@lists.sourceforge.net.  Thank you.
 .PP
 .SH "AUTHORS"
-The University of Delaware
+The University of Delaware and Network Time Foundation
 .SH "COPYRIGHT"
-Copyright (C) 1970-2014 The University of Delaware all rights reserved.
+Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation all rights reserved.
 This program is released under the terms of the NTP license, <http://ntp.org/license>.
 .SH BUGS
 It can take quite a while to generate some cryptographic values,
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/dist/util/ntp-keygen.mdoc.in /cur/src/external/bsd/ntp/dist/util/ntp-keygen.mdoc.in
--- external/bsd/ntp/dist/util/ntp-keygen.mdoc.in	2014-12-19 12:37:49.000000000 -0800
+++ /cur/src/external/bsd/ntp/dist/util/ntp-keygen.mdoc.in	2015-04-07 19:51:18.000000000 -0700
@@ -1,9 +1,9 @@
-.Dd December 19 2014
+.Dd April 7 2015
 .Dt NTP_KEYGEN @NTP_KEYGEN_MS@ User Commands
 .Os
 .\"  EDIT THIS FILE WITH CAUTION  (ntp-keygen-opts.mdoc)
 .\"
-.\"  It has been AutoGen-ed  December 19, 2014 at 07:50:58 AM by AutoGen 5.18.5pre4
+.\"  It has been AutoGen-ed  April  7, 2015 at 04:27:49 AM by AutoGen 5.18.5pre4
 .\"  From the definitions    ntp-keygen-opts.def
 .\"  and the template file   agmdoc-cmd.tpl
 .Sh NAME
@@ -1051,9 +1051,9 @@
 it to autogen\-users@lists.sourceforge.net.  Thank you.
 .El
 .Sh "AUTHORS"
-The University of Delaware
+The University of Delaware and Network Time Foundation
 .Sh "COPYRIGHT"
-Copyright (C) 1970\-2014 The University of Delaware all rights reserved.
+Copyright (C) 1992\-2015 The University of Delaware and Network Time Foundation all rights reserved.
 This program is released under the terms of the NTP license, <http://ntp.org/license>.
 .Sh BUGS
 It can take quite a while to generate some cryptographic values,
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/html/Makefile /cur/src/external/bsd/ntp/html/Makefile
--- external/bsd/ntp/html/Makefile	2014-12-24 18:28:19.000000000 -0800
+++ /cur/src/external/bsd/ntp/html/Makefile	2014-07-05 12:22:42.000000000 -0700
@@ -112,7 +112,7 @@
 _FDIR:=		ntp/${F:H}				# subdir
 _FDIR:=		${_FDIR:S,/.$,,}			# remove trivial directory
 _FNAME:=	${F:T}					# name override
-_F:=		${DESTDIR}${HTMLDOCDIR}/${_FDIR}/${_FNAME}		# installed path
+_F:=		${DESTDIR}${NTP_HTMLDIR}/${_FDIR}/${_FNAME}		# installed path
 _FILE:=		${F}
 
 .if ${MKUPDATE} == "no"
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/importdate /cur/src/external/bsd/ntp/importdate
--- external/bsd/ntp/importdate	2014-12-19 18:59:24.000000000 -0800
+++ /cur/src/external/bsd/ntp/importdate	2015-04-07 19:51:10.000000000 -0700
@@ -1 +1 @@
-Fri Dec 19 21:49:44 EST 2014 (import)
+Tue Apr  7 13:06:24 EDT 2015 (import)
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/include/config.h /cur/src/external/bsd/ntp/include/config.h
--- external/bsd/ntp/include/config.h	2014-12-19 12:46:47.000000000 -0800
+++ /cur/src/external/bsd/ntp/include/config.h	2015-04-07 19:51:18.000000000 -0700
@@ -328,6 +328,9 @@
    */
 /* #undef HAVE_ALLOCA_H */
 
+/* Define to 1 if you have the `arc4random_buf' function. */
+#define HAVE_ARC4RANDOM_BUF 1
+
 /* Define to 1 if you have the <arpa/nameser.h> header file. */
 #define HAVE_ARPA_NAMESER_H 1
 
@@ -1337,6 +1340,10 @@
 /* Should we recommend a minimum value for tickadj? */
 /* #undef MIN_REC_TICKADJ */
 
+/* Define to 1 if the compiler does not support C99's structure
+   initialization. */
+/* #undef MISSING_C99_STRUCT_INIT */
+
 /* Do we need HPUX adjtime() library support? */
 /* #undef NEED_HPUX_ADJTIME */
 
@@ -1428,7 +1435,7 @@
 #define PACKAGE_NAME "ntp"
 
 /* Define to the full name and version of this package. */
-#define PACKAGE_STRING "ntp 4.2.8"
+#define PACKAGE_STRING "ntp 4.2.8p2"
 
 /* Define to the one symbol short name of this package. */
 #define PACKAGE_TARNAME "ntp"
@@ -1437,7 +1444,7 @@
 #define PACKAGE_URL "http://www.ntp.org./"
 
 /* Define to the version of this package. */
-#define PACKAGE_VERSION "4.2.8"
+#define PACKAGE_VERSION "4.2.8p2"
 
 /* data dir */
 #define PERLLIBDIR "/usr/local/share/ntp/lib"
@@ -1538,7 +1545,7 @@
 /* #undef STRERROR_R_CHAR_P */
 
 /* canonical system (cpu-vendor-os) of where we should run */
-#define STR_SYSTEM  "NetBSD"
+#define STR_SYSTEM "NetBSD"
 
 /* Does Xettimeofday take 1 arg? */
 /* #undef SYSV_TIMEOFDAY */
@@ -1582,6 +1589,9 @@
 /* Use OpenSSL's crypto random functions */
 #define USE_OPENSSL_CRYPTO_RAND 1
 
+/* OK to use snprintb()? */
+#define USE_SNPRINTB 1
+
 /* Can we use SIGPOLL for tty IO? */
 /* #undef USE_TTY_SIGPOLL */
 
@@ -1589,7 +1599,7 @@
 /* #undef USE_UDP_SIGPOLL */
 
 /* Version number of package */
-#define VERSION "4.2.8"
+#define VERSION "4.2.8p2"
 
 /* vsnprintf expands "%m" to strerror(errno) */
 /* #undef VSNPRINTF_PERCENT_M */
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/ntp2netbsd /cur/src/external/bsd/ntp/ntp2netbsd
--- external/bsd/ntp/ntp2netbsd	2014-12-24 18:27:52.000000000 -0800
+++ /cur/src/external/bsd/ntp/ntp2netbsd	2015-04-07 19:51:10.000000000 -0700
@@ -42,13 +42,18 @@
 #	$ echo cp config.h /usr/src/external/bsd/ntp/include
 #         - not really - we have some changed defaults and the vax port has no ieee.h support.
 #           so do a careful diff and patch - Frank Kardel
-#	$ echo cp scripts/mkver /usr/src/external/bsd/ntp/scripts
+#	$ echo cp scripts/build/mkver /usr/src/external/bsd/ntp/scripts
 #		merge possible changes to mkver 
 #	        our version uses the import date in the file
 #               /usr/src/external/bsd/ntp/importdate for the date and buildnumber information
 #		to achieve consistent version string over all builds
 #	$ cd ..
 #	$ rm -r src ntp-4.x.y
+#	$ cd dist/ntpd
+#	$ cc -DOPENSSL -I../../include keyword-gen.c -I../include -I../lib/isc/unix/include -I../lib/isc/include -I../../bin/ntpd/obj.amd64 -L../../lib/libntp/obj.amd64 -lntp -L../../lib/libisc/obj.amd64 -lisc
+#	$ ./a.out ntp_keyword.h > ntp_keyword.h
+#	- Rebuild ntp_keywords file since our parser is not bison and the
+#	  keyword numbers are different
 #	$ cd /usr/src/external/bsd/ntp
 #	$ cvs update
 #	$ cvs commit -m "Updated autoconf generated files for ntp 4.x.y."
diff -x CVS -I'$NetBSD:' -ruN external/bsd/ntp/scripts/mkver /cur/src/external/bsd/ntp/scripts/mkver
--- external/bsd/ntp/scripts/mkver	2014-12-19 18:59:24.000000000 -0800
+++ /cur/src/external/bsd/ntp/scripts/mkver	2015-04-07 19:51:18.000000000 -0700
@@ -3,7 +3,7 @@
 
 ConfStr="$PROG"
 
-ConfStr="$ConfStr 4.2.8"
+ConfStr="$ConfStr 4.2.8p2"
 
 case "$CSET" in
  '') ;;
