summaryrefslogtreecommitdiffstats
path: root/contrib/ntp/libntp/lib_strbuf.c
diff options
context:
space:
mode:
authordelphij <delphij@FreeBSD.org>2015-07-15 19:21:26 +0000
committerdelphij <delphij@FreeBSD.org>2015-07-15 19:21:26 +0000
commit2a25cee78ab1d37e7d2bc40ae675646974d99f56 (patch)
treeb0302ac4be59e104f4e1e54014561a1389397192 /contrib/ntp/libntp/lib_strbuf.c
parenta0741a75537b2e0514472ac3b28afc55a7846c30 (diff)
downloadFreeBSD-src-2a25cee78ab1d37e7d2bc40ae675646974d99f56.zip
FreeBSD-src-2a25cee78ab1d37e7d2bc40ae675646974d99f56.tar.gz
MFC r280849,280915-280916,281015-281016,282097,282408,282415,283542,
284864,285169-285170,285435: ntp 4.2.8p3. Relnotes: yes Approved by: re (?)
Diffstat (limited to 'contrib/ntp/libntp/lib_strbuf.c')
-rw-r--r--contrib/ntp/libntp/lib_strbuf.c26
1 files changed, 21 insertions, 5 deletions
diff --git a/contrib/ntp/libntp/lib_strbuf.c b/contrib/ntp/libntp/lib_strbuf.c
index 315070f..76f7016 100644
--- a/contrib/ntp/libntp/lib_strbuf.c
+++ b/contrib/ntp/libntp/lib_strbuf.c
@@ -1,16 +1,28 @@
/*
* lib_strbuf - library string storage
*/
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+#include <isc/net.h>
+#include <isc/result.h>
+
+#include "ntp_fp.h"
#include "ntp_stdlib.h"
#include "lib_strbuf.h"
+
/*
* Storage declarations
*/
-char lib_stringbuf[LIB_NUMBUFS][LIB_BUFLENGTH];
-int lib_nextbuf;
-int lib_inited = 0;
+int debug;
+libbufstr lib_stringbuf[LIB_NUMBUF];
+int lib_nextbuf;
+int ipv4_works;
+int ipv6_works;
+int lib_inited;
+
/*
* initialization routine. Might be needed if the code is ROMized.
@@ -18,6 +30,10 @@ int lib_inited = 0;
void
init_lib(void)
{
- lib_nextbuf = 0;
- lib_inited = 1;
+ if (lib_inited)
+ return;
+ ipv4_works = (ISC_R_SUCCESS == isc_net_probeipv4());
+ ipv6_works = (ISC_R_SUCCESS == isc_net_probeipv6());
+ init_systime();
+ lib_inited = TRUE;
}
OpenPOWER on IntegriCloud