diff options
author | roberto <roberto@FreeBSD.org> | 2002-10-29 19:58:12 +0000 |
---|---|---|
committer | roberto <roberto@FreeBSD.org> | 2002-10-29 19:58:12 +0000 |
commit | f77146900e35a78aaabf5f88d47b7675304c8445 (patch) | |
tree | daab9e5ccc14bec1f0fee71e35464e6040c6756f /contrib/ntp/ntpdc | |
parent | 40b8e415eb0f835a9dd7a473ddf134ec67877fd7 (diff) | |
download | FreeBSD-src-f77146900e35a78aaabf5f88d47b7675304c8445.zip FreeBSD-src-f77146900e35a78aaabf5f88d47b7675304c8445.tar.gz |
Virgin import of ntpd 4.1.1a
Diffstat (limited to 'contrib/ntp/ntpdc')
-rw-r--r-- | contrib/ntp/ntpdc/Makefile.am | 2 | ||||
-rw-r--r-- | contrib/ntp/ntpdc/Makefile.in | 169 | ||||
-rw-r--r-- | contrib/ntp/ntpdc/ntpdc.c | 41 | ||||
-rw-r--r-- | contrib/ntp/ntpdc/ntpdc_ops.c | 37 |
4 files changed, 140 insertions, 109 deletions
diff --git a/contrib/ntp/ntpdc/Makefile.am b/contrib/ntp/ntpdc/Makefile.am index 19e9cfa..ba0626f 100644 --- a/contrib/ntp/ntpdc/Makefile.am +++ b/contrib/ntp/ntpdc/Makefile.am @@ -17,5 +17,5 @@ $(PROGRAMS): $(LDADD) cd ../libntp && $(MAKE) version.o: $(ntpdc_OBJECTS) ../libntp/libntp.a @LIBRSAREF@ Makefile - $(top_builddir)/scripts/mkver ntpdc + env CSET=`cat $(top_srcdir)/version` $(top_builddir)/scripts/mkver ntpdc $(COMPILE) -c version.c diff --git a/contrib/ntp/ntpdc/Makefile.in b/contrib/ntp/ntpdc/Makefile.in index ce9683a..4c722e3 100644 --- a/contrib/ntp/ntpdc/Makefile.in +++ b/contrib/ntp/ntpdc/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated automatically by automake 1.4e from Makefile.am. +# Makefile.in generated automatically by automake 1.5 from Makefile.am. # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 # Free Software Foundation, Inc. @@ -11,6 +11,10 @@ # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. +@SET_MAKE@ + +#AUTOMAKE_OPTIONS = ../util/ansi2knr no-dependencies + SHELL = @SHELL@ srcdir = @srcdir@ @@ -31,11 +35,9 @@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include - pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ - top_builddir = .. ACLOCAL = @ACLOCAL@ @@ -49,23 +51,18 @@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_HEADER = $(INSTALL_DATA) transform = @program_transform_name@ - NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : - build_alias = @build_alias@ build_triplet = @build@ host_alias = @host_alias@ host_triplet = @host@ target_alias = @target_alias@ target_triplet = @target@ - -@SET_MAKE@ -AMDEP = @AMDEP@ AMTAR = @AMTAR@ AUTOKEY = @AUTOKEY@ AWK = @AWK@ @@ -78,13 +75,12 @@ DCFD = @DCFD@ DEPDIR = @DEPDIR@ EF_LIBS = @EF_LIBS@ EF_PROGS = @EF_PROGS@ +EXEEXT = @EXEEXT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -INSTALL_STRIP_PROGRAM_ENV = @INSTALL_STRIP_PROGRAM_ENV@ LDFLAGS = @LDFLAGS@ LIBPARSE = @LIBPARSE@ LIBRSAREF = @LIBRSAREF@ LN_S = @LN_S@ -MAKEINFO = @MAKEINFO@ MAKE_ADJTIMED = @MAKE_ADJTIMED@ MAKE_CHECK_Y2K = @MAKE_CHECK_Y2K@ MAKE_LIBPARSE = @MAKE_LIBPARSE@ @@ -95,6 +91,7 @@ MAKE_NTP_GENKEYS = @MAKE_NTP_GENKEYS@ MAKE_PARSEKMODULE = @MAKE_PARSEKMODULE@ MAKE_TICKADJ = @MAKE_TICKADJ@ MAKE_TIMETRIM = @MAKE_TIMETRIM@ +OBJEXT = @OBJEXT@ OPENSSL = @OPENSSL@ OPENSSL_INC = @OPENSSL_INC@ OPENSSL_LIB = @OPENSSL_LIB@ @@ -107,16 +104,13 @@ RSADIR = @RSADIR@ RSAOBJS = @RSAOBJS@ RSAREF = @RSAREF@ RSASRCS = @RSASRCS@ -STRIP = @STRIP@ TESTDCF = @TESTDCF@ U = @U@ VERSION = @VERSION@ -_am_include = @_am_include@ +am__include = @am__include@ +am__quote = @am__quote@ install_sh = @install_sh@ -#AUTOMAKE_OPTIONS = ../util/ansi2knr no-dependencies - - AUTOMAKE_OPTIONS = ../util/ansi2knr bin_PROGRAMS = ntpdc INCLUDES = -I$(top_srcdir)/include @@ -128,8 +122,6 @@ noinst_HEADERS = ntpdc.h ETAGS_ARGS = Makefile.am ntpdc_SOURCES = ntpdc.c ntpdc_ops.c -EXEEXT = -OBJEXT = o subdir = ntpdc mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h @@ -137,39 +129,37 @@ CONFIG_CLEAN_FILES = bin_PROGRAMS = ntpdc$(EXEEXT) PROGRAMS = $(bin_PROGRAMS) - -DEFS = @DEFS@ -I. -I$(srcdir) -I$(top_builddir) -CPPFLAGS = @CPPFLAGS@ -LIBS = @LIBS@ -ANSI2KNR = ../util/ansi2knr am_ntpdc_OBJECTS = ntpdc$U.$(OBJEXT) ntpdc_ops$U.$(OBJEXT) ntpdc_OBJECTS = $(am_ntpdc_OBJECTS) ntpdc_LDADD = $(LDADD) ntpdc_DEPENDENCIES = version.o ../libntp/libntp.a -ntpdc_LDFLAGS = -COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +ntpdc_LDFLAGS = + +DEFS = @DEFS@ +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +CPPFLAGS = @CPPFLAGS@ +LDFLAGS = @LDFLAGS@ +LIBS = @LIBS@ +depcomp = $(SHELL) $(top_srcdir)/depcomp +@AMDEP_TRUE@DEP_FILES = $(DEPDIR)/ntpdc$U.Po $(DEPDIR)/ntpdc_ops$U.Po +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ DIST_SOURCES = $(ntpdc_SOURCES) HEADERS = $(noinst_HEADERS) -depcomp = $(SHELL) $(top_srcdir)/depcomp -@AMDEP@DEP_FILES = $(DEPDIR)/ntpdc$U.Po $(DEPDIR)/ntpdc_ops$U.Po DIST_COMMON = README $(noinst_HEADERS) Makefile.am Makefile.in - SOURCES = $(ntpdc_SOURCES) -OBJECTS = $(am_ntpdc_OBJECTS) all: all-am .SUFFIXES: .SUFFIXES: .c .o .obj - -$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && \ $(AUTOMAKE) --gnu ntpdc/Makefile - -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) && \ CONFIG_HEADERS= CONFIG_LINKS= \ CONFIG_FILES=$(subdir)/$@ $(SHELL) ./config.status @@ -177,8 +167,10 @@ install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(bindir) @list='$(bin_PROGRAMS)'; for p in $$list; do \ - if test -f $$p; then \ - f=`echo $$p|sed 's/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ + p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + if test -f $$p \ + ; then \ + f=`echo $$p1|sed '$(transform);s/$$/$(EXEEXT)/'`; \ echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/$$f"; \ $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/$$f; \ else :; fi; \ @@ -194,30 +186,47 @@ uninstall-binPROGRAMS: clean-binPROGRAMS: -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) +ntpdc$(EXEEXT): $(ntpdc_OBJECTS) $(ntpdc_DEPENDENCIES) + @rm -f ntpdc$(EXEEXT) + $(LINK) $(ntpdc_LDFLAGS) $(ntpdc_OBJECTS) $(ntpdc_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) core *.core distclean-compile: -rm -f *.tab.c -../util/ansi2knr: ../util/ansi2knr.$(OBJEXT) - cd ../util && $(MAKE) $(AM_MAKEFLAGS) ansi2knr - -../util/ansi2knr.$(OBJEXT): - cd ../util && $(MAKE) $(AM_MAKEFLAGS) ansi2knr.$(OBJEXT) +ANSI2KNR = ../util/ansi2knr +../util/ansi2knr: + cd ../util && $(MAKE) $(AM_MAKEFLAGS) ansi2knr mostlyclean-kr: -rm -f *_.c -ntpdc: $(ntpdc_OBJECTS) $(ntpdc_DEPENDENCIES) - @rm -f ntpdc - $(LINK) $(ntpdc_LDFLAGS) $(ntpdc_OBJECTS) $(ntpdc_LDADD) $(LIBS) +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/ntpdc$U.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/ntpdc_ops$U.Po@am__quote@ + +distclean-depend: + -rm -rf $(DEPDIR) + +.c.o: +@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(COMPILE) -c `test -f $< || echo '$(srcdir)/'`$< + +.c.obj: +@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(COMPILE) -c `cygpath -w $<` +CCDEPMODE = @CCDEPMODE@ ntpdc_.c: ntpdc.c $(ANSI2KNR) - $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/ntpdc.c; then echo $(srcdir)/ntpdc.c; else echo ntpdc.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > ntpdc_.c + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/ntpdc.c; then echo $(srcdir)/ntpdc.c; else echo ntpdc.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > ntpdc_.c || rm -f ntpdc_.c ntpdc_ops_.c: ntpdc_ops.c $(ANSI2KNR) - $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/ntpdc_ops.c; then echo $(srcdir)/ntpdc_ops.c; else echo ntpdc_ops.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > ntpdc_ops_.c + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/ntpdc_ops.c; then echo $(srcdir)/ntpdc_ops.c; else echo ntpdc_ops.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > ntpdc_ops_.c || rm -f ntpdc_ops_.c ntpdc_.$(OBJEXT) ntpdc_ops_.$(OBJEXT) : $(ANSI2KNR) +uninstall-info-am: tags: TAGS @@ -230,7 +239,7 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) END { for (i in files) print i; }'`; \ mkid -fID $$unique $(LISP) -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ @@ -246,31 +255,10 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ GTAGS: here=`CDPATH=: && cd $(top_builddir) && pwd` \ && cd $(top_srcdir) \ - && gtags -i $$here + && gtags -i $(GTAGS_ARGS) $$here distclean-tags: - -rm -f TAGS ID - -@AMDEP@@_am_include@ $(DEPDIR)/ntpdc$U.Po -@AMDEP@@_am_include@ $(DEPDIR)/ntpdc_ops$U.Po - -distclean-depend: - -rm -rf $(DEPDIR) - -@AMDEP@CCDEPMODE = @CCDEPMODE@ - -.c.o: -@AMDEP@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ -@AMDEP@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ - $(COMPILE) -c -o $@ `test -f $< || echo '$(srcdir)/'`$< - -.c.obj: -@AMDEP@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ -@AMDEP@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ - $(COMPILE) -c -o $@ `cygpath -w $<` - + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) @@ -279,7 +267,11 @@ distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) @for file in $(DISTFILES); do \ - d=$(srcdir); \ + if test -f $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + $(mkinstalldirs) "$(distdir)/$$dir"; \ + fi; \ if test -d $$d/$$file; then \ cp -pR $$d/$$file $(distdir) \ || exit 1; \ @@ -305,24 +297,21 @@ 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_PROGRAM_ENV='$(INSTALL_STRIP_PROGRAM_ENV)' install - + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: - -rm -f Makefile $(CONFIG_CLEAN_FILES) - -rm -f config.cache config.log stamp-h stamp-h[0-9]* + -rm -f Makefile $(CONFIG_CLEAN_FILES) stamp-h stamp-h[0-9]* -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." - -rm -f Makefile.in clean: clean-am clean-am: clean-binPROGRAMS clean-generic mostlyclean-am @@ -332,11 +321,11 @@ distclean: distclean-am distclean-am: clean-am distclean-compile distclean-depend \ distclean-generic distclean-tags -dvi: +dvi: dvi-am dvi-am: -info: +info: info-am info-am: @@ -344,7 +333,7 @@ install-data-am: install-exec-am: install-binPROGRAMS -install-info: +install-info: install-info-am install-man: @@ -358,17 +347,18 @@ mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic mostlyclean-kr -uninstall-am: uninstall-binPROGRAMS +uninstall-am: uninstall-binPROGRAMS uninstall-info-am -.PHONY: all all-am check check-am clean clean-binPROGRAMS clean-generic \ - distclean distclean-compile distclean-depend distclean-generic \ - distclean-tags distdir dvi dvi-am info info-am install \ - install-am install-binPROGRAMS install-data install-data-am \ - install-exec install-exec-am install-info install-man \ - install-strip installcheck installcheck-am installdirs \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-compile mostlyclean-generic mostlyclean-kr tags \ - uninstall uninstall-am uninstall-binPROGRAMS +.PHONY: GTAGS all all-am check check-am clean clean-binPROGRAMS \ + clean-generic distclean distclean-compile distclean-depend \ + distclean-generic distclean-tags distdir dvi dvi-am info \ + info-am install install-am install-binPROGRAMS install-data \ + install-data-am install-exec install-exec-am install-info \ + install-info-am install-man install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-kr tags uninstall uninstall-am \ + uninstall-binPROGRAMS uninstall-info-am $(PROGRAMS): $(LDADD) @@ -377,9 +367,8 @@ $(PROGRAMS): $(LDADD) cd ../libntp && $(MAKE) version.o: $(ntpdc_OBJECTS) ../libntp/libntp.a @LIBRSAREF@ Makefile - $(top_builddir)/scripts/mkver ntpdc + env CSET=`cat $(top_srcdir)/version` $(top_builddir)/scripts/mkver ntpdc $(COMPILE) -c version.c - # 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 --git a/contrib/ntp/ntpdc/ntpdc.c b/contrib/ntp/ntpdc/ntpdc.c index 09ba633..6086dae 100644 --- a/contrib/ntp/ntpdc/ntpdc.c +++ b/contrib/ntp/ntpdc/ntpdc.c @@ -192,6 +192,11 @@ static char *pktdata; static int pktdatasize; /* + * These are used to help the magic with old and new versions of ntpd. + */ +static int req_pkt_size = REQ_LEN_NOMAC; + +/* * For commands typed on the command line (with the -c option) */ static int numcmds = 0; @@ -474,6 +479,7 @@ openhost( error("connect", "", ""); havehost = 1; + req_pkt_size = REQ_LEN_NOMAC; return 1; } @@ -770,11 +776,15 @@ sendrequest( if (!auth) { qpkt.auth_seq = AUTH_SEQ(0, 0); - return sendpkt((char *)&qpkt, REQ_LEN_NOMAC); + return sendpkt((char *)&qpkt, req_pkt_size); } else { l_fp ts; int maclen = 0; const char *pass = "\0"; + struct req_pkt_tail *qpktail; + + qpktail = (struct req_pkt_tail *)((char *)&qpkt + req_pkt_size + + MAX_MAC_LEN - sizeof(struct req_pkt_tail)); if (info_auth_keyid == 0) { maclen = getkeyid("Keyid: "); @@ -797,17 +807,17 @@ sendrequest( authusekey(info_auth_keyid, info_auth_keytype, (const u_char *)pass); authtrust(info_auth_keyid, 1); qpkt.auth_seq = AUTH_SEQ(1, 0); - qpkt.keyid = htonl(info_auth_keyid); + qpktail->keyid = htonl(info_auth_keyid); get_systime(&ts); L_ADD(&ts, &delay_time); - HTONL_FP(&ts, &qpkt.tstamp); + HTONL_FP(&ts, &qpktail->tstamp); maclen = authencrypt(info_auth_keyid, (u_int32 *)&qpkt, - REQ_LEN_NOMAC); + req_pkt_size); if (maclen == 0) { (void) fprintf(stderr, "Key not found\n"); return (1); } - return sendpkt((char *)&qpkt, (int)(REQ_LEN_NOMAC + maclen)); + return sendpkt((char *)&qpkt, (int)(req_pkt_size + maclen)); } /*NOTREACHED*/ } @@ -846,6 +856,7 @@ doquery( /* * Poll the socket and clear out any pending data */ +again: do { tvzero.tv_sec = tvzero.tv_usec = 0; FD_ZERO(&fds); @@ -873,6 +884,26 @@ doquery( */ res = getresponse(implcode, reqcode, ritems, rsize, rdata); + /* + * Try to be compatible with older implementations of ntpd. + */ + if (res == INFO_ERR_FMT && req_pkt_size != 48) { + int oldsize; + + oldsize = req_pkt_size; + + switch(req_pkt_size) { + case REQ_LEN_NOMAC: + req_pkt_size = 48; + break; + } + + fprintf(stderr, + "***Warning changing the request packet size from %d to %d\n", + oldsize, req_pkt_size); + goto again; + } + /* log error message if not told to be quiet */ if ((res > 0) && (((1 << res) & quiet_mask) == 0)) { switch(res) { diff --git a/contrib/ntp/ntpdc/ntpdc_ops.c b/contrib/ntp/ntpdc/ntpdc_ops.c index 0661d53..b163401 100644 --- a/contrib/ntp/ntpdc/ntpdc_ops.c +++ b/contrib/ntp/ntpdc/ntpdc_ops.c @@ -786,7 +786,7 @@ sysinfo( (void) fprintf(fp, "system flags: "); if ((is->flags & (INFO_FLAG_BCLIENT | INFO_FLAG_AUTHENABLE | - INFO_FLAG_NTP | INFO_FLAG_KERNEL| INFO_FLAG_PLL_SYNC | + INFO_FLAG_NTP | INFO_FLAG_KERNEL| INFO_FLAG_CAL | INFO_FLAG_PPS_SYNC | INFO_FLAG_MONITOR | INFO_FLAG_FILEGEN)) == 0) { (void) fprintf(fp, "none\n"); } else { @@ -802,10 +802,10 @@ sysinfo( (void) fprintf(fp, "kernel "); if (is->flags & INFO_FLAG_FILEGEN) (void) fprintf(fp, "stats "); - if (is->flags & INFO_FLAG_PLL_SYNC) - (void) fprintf(fp, "kernel_sync "); + if (is->flags & INFO_FLAG_CAL) + (void) fprintf(fp, "calibrate "); if (is->flags & INFO_FLAG_PPS_SYNC) - (void) fprintf(fp, "pps_sync "); + (void) fprintf(fp, "pps "); (void) fprintf(fp, "\n"); } (void) fprintf(fp, "jitter: %s s\n", @@ -1174,6 +1174,13 @@ doconfig( sizeof(struct conf_peer), (char *)&cpeer, &items, &itemsize, &dummy, 0); + if (res == INFO_ERR_FMT) { + (void) fprintf(fp, + "***Retrying command with old conf_peer size\n"); + res = doquery(IMPL_XNTPD, REQ_CONFIG, 1, 1, + sizeof(struct old_conf_peer), (char *)&cpeer, + &items, &itemsize, &dummy, 0); + } if (res == 0) (void) fprintf(fp, "done!\n"); return; @@ -1256,21 +1263,25 @@ doset( sys.flags = 0; res = 0; for (items = 0; items < pcmd->nargs; items++) { - if (STREQ(pcmd->argval[items].string, "pps")) - sys.flags |= SYS_FLAG_PPS; + if (STREQ(pcmd->argval[items].string, "auth")) + sys.flags |= SYS_FLAG_AUTH; else if (STREQ(pcmd->argval[items].string, "bclient")) - sys.flags |= SYS_FLAG_BCLIENT; + sys.flags |= SYS_FLAG_BCLIENT; + else if (STREQ(pcmd->argval[items].string, "calibrate")) + sys.flags |= SYS_FLAG_CAL; + else if (STREQ(pcmd->argval[items].string, "kernel")) + sys.flags |= SYS_FLAG_KERNEL; else if (STREQ(pcmd->argval[items].string, "monitor")) - sys.flags |= SYS_FLAG_MONITOR; + sys.flags |= SYS_FLAG_MONITOR; else if (STREQ(pcmd->argval[items].string, "ntp")) - sys.flags |= SYS_FLAG_NTP; - else if (STREQ(pcmd->argval[items].string, "kernel")) - sys.flags |= SYS_FLAG_KERNEL; + sys.flags |= SYS_FLAG_NTP; + else if (STREQ(pcmd->argval[items].string, "pps")) + sys.flags |= SYS_FLAG_PPS; else if (STREQ(pcmd->argval[items].string, "stats")) - sys.flags |= SYS_FLAG_FILEGEN; + sys.flags |= SYS_FLAG_FILEGEN; else { (void) fprintf(fp, "Unknown flag %s\n", - pcmd->argval[items].string); + pcmd->argval[items].string); res = 1; } } |