summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile.inc12
-rw-r--r--UPDATING4
-rw-r--r--contrib/less/LICENSE2
-rw-r--r--contrib/less/NEWS39
-rw-r--r--contrib/less/README7
-rw-r--r--contrib/less/brac.c2
-rw-r--r--contrib/less/ch.c37
-rw-r--r--contrib/less/charset.c485
-rw-r--r--contrib/less/charset.h2
-rw-r--r--contrib/less/cmd.h3
-rw-r--r--contrib/less/cmdbuf.c300
-rw-r--r--contrib/less/command.c106
-rw-r--r--contrib/less/compose.uni261
-rw-r--r--contrib/less/cvt.c8
-rw-r--r--contrib/less/decode.c3
-rw-r--r--contrib/less/edit.c13
-rw-r--r--contrib/less/filename.c75
-rw-r--r--contrib/less/forwback.c33
-rw-r--r--contrib/less/funcs.h8
-rw-r--r--contrib/less/help.c35
-rw-r--r--contrib/less/ifile.c2
-rw-r--r--contrib/less/input.c28
-rw-r--r--contrib/less/jump.c23
-rw-r--r--contrib/less/less.h29
-rw-r--r--contrib/less/less.hlp35
-rw-r--r--contrib/less/less.nro376
-rw-r--r--contrib/less/lessecho.c2
-rw-r--r--contrib/less/lessecho.nro2
-rw-r--r--contrib/less/lesskey.c5
-rw-r--r--contrib/less/lesskey.h2
-rw-r--r--contrib/less/lesskey.nro36
-rw-r--r--contrib/less/lglob.h2
-rw-r--r--contrib/less/line.c34
-rw-r--r--contrib/less/linenum.c4
-rw-r--r--contrib/less/lsystem.c4
-rw-r--r--contrib/less/main.c5
-rw-r--r--contrib/less/mark.c10
-rw-r--r--contrib/less/mkhelp.c2
-rwxr-xr-xcontrib/less/mkutable75
-rw-r--r--contrib/less/optfunc.c48
-rw-r--r--contrib/less/option.c7
-rw-r--r--contrib/less/option.h2
-rw-r--r--contrib/less/opttbl.c2
-rw-r--r--contrib/less/os.c12
-rw-r--r--contrib/less/output.c10
-rw-r--r--contrib/less/pattern.c70
-rw-r--r--contrib/less/pattern.h3
-rw-r--r--contrib/less/pckeys.h2
-rw-r--r--contrib/less/position.c2
-rw-r--r--contrib/less/position.h2
-rw-r--r--contrib/less/prompt.c6
-rw-r--r--contrib/less/regexp.c15
-rw-r--r--contrib/less/screen.c2
-rw-r--r--contrib/less/scrsize.c2
-rw-r--r--contrib/less/search.c665
-rw-r--r--contrib/less/signal.c2
-rw-r--r--contrib/less/tags.c13
-rw-r--r--contrib/less/ttyin.c2
-rw-r--r--contrib/less/ubin.uni32
-rw-r--r--contrib/less/version.c33
-rw-r--r--contrib/less/wide.uni81
-rw-r--r--contrib/netcat/nc.16
-rw-r--r--contrib/netcat/netcat.c14
-rw-r--r--contrib/netcat/socks.c6
-rw-r--r--contrib/ntp/ChangeLog38
-rw-r--r--contrib/ntp/CommitLog1020
-rw-r--r--contrib/ntp/NEWS253
-rwxr-xr-xcontrib/ntp/configure20
-rw-r--r--contrib/ntp/html/miscopt.html14
-rw-r--r--contrib/ntp/include/Makefile.am1
-rw-r--r--contrib/ntp/include/Makefile.in1
-rw-r--r--contrib/ntp/include/ntp.h7
-rw-r--r--contrib/ntp/include/ntp_io.h3
-rw-r--r--contrib/ntp/include/ntp_keyacc.h13
-rw-r--r--contrib/ntp/include/ntp_stdlib.h5
-rw-r--r--contrib/ntp/include/ntp_types.h1
-rw-r--r--contrib/ntp/include/ntp_worker.h53
-rw-r--r--contrib/ntp/include/parse.h6
-rw-r--r--contrib/ntp/libntp/Makefile.am1
-rw-r--r--contrib/ntp/libntp/Makefile.in56
-rw-r--r--contrib/ntp/libntp/authkeys.c105
-rw-r--r--contrib/ntp/libntp/authreadkeys.c51
-rw-r--r--contrib/ntp/libntp/authusekey.c2
-rw-r--r--contrib/ntp/libntp/is_ip_address.c129
-rw-r--r--contrib/ntp/libntp/ntp_worker.c27
-rw-r--r--contrib/ntp/libntp/systime.c15
-rw-r--r--contrib/ntp/libntp/work_thread.c74
-rw-r--r--contrib/ntp/ntpd/invoke-ntp.conf.texi67
-rw-r--r--contrib/ntp/ntpd/invoke-ntp.keys.texi14
-rw-r--r--contrib/ntp/ntpd/invoke-ntpd.texi4
-rw-r--r--contrib/ntp/ntpd/keyword-gen-utd2
-rw-r--r--contrib/ntp/ntpd/keyword-gen.c3
-rw-r--r--contrib/ntp/ntpd/ntp.conf.5man76
-rw-r--r--contrib/ntp/ntpd/ntp.conf.5mdoc77
-rw-r--r--contrib/ntp/ntpd/ntp.conf.def71
-rw-r--r--contrib/ntp/ntpd/ntp.conf.html62
-rw-r--r--contrib/ntp/ntpd/ntp.conf.man.in76
-rw-r--r--contrib/ntp/ntpd/ntp.conf.mdoc.in77
-rw-r--r--contrib/ntp/ntpd/ntp.keys.5man18
-rw-r--r--contrib/ntp/ntpd/ntp.keys.5mdoc18
-rw-r--r--contrib/ntp/ntpd/ntp.keys.def12
-rw-r--r--contrib/ntp/ntpd/ntp.keys.html14
-rw-r--r--contrib/ntp/ntpd/ntp.keys.man.in18
-rw-r--r--contrib/ntp/ntpd/ntp.keys.mdoc.in18
-rw-r--r--contrib/ntp/ntpd/ntp_config.c14
-rw-r--r--contrib/ntp/ntpd/ntp_control.c221
-rw-r--r--contrib/ntp/ntpd/ntp_crypto.c2
-rw-r--r--contrib/ntp/ntpd/ntp_io.c367
-rw-r--r--contrib/ntp/ntpd/ntp_keyword.h971
-rw-r--r--contrib/ntp/ntpd/ntp_parser.c3091
-rw-r--r--contrib/ntp/ntpd/ntp_parser.h488
-rw-r--r--contrib/ntp/ntpd/ntp_proto.c158
-rw-r--r--contrib/ntp/ntpd/ntp_request.c293
-rw-r--r--contrib/ntp/ntpd/ntp_scanner.c2
-rw-r--r--contrib/ntp/ntpd/ntp_timer.c17
-rw-r--r--contrib/ntp/ntpd/ntpd-opts.c20
-rw-r--r--contrib/ntp/ntpd/ntpd-opts.h8
-rw-r--r--contrib/ntp/ntpd/ntpd.1ntpdman8
-rw-r--r--contrib/ntp/ntpd/ntpd.1ntpdmdoc6
-rw-r--r--contrib/ntp/ntpd/ntpd.c58
-rw-r--r--contrib/ntp/ntpd/ntpd.html4
-rw-r--r--contrib/ntp/ntpd/ntpd.man.in8
-rw-r--r--contrib/ntp/ntpd/ntpd.mdoc.in6
-rw-r--r--contrib/ntp/ntpd/refclock_chu.c2
-rw-r--r--contrib/ntp/ntpd/refclock_gpsdjson.c28
-rw-r--r--contrib/ntp/ntpd/refclock_jjy.c87
-rw-r--r--contrib/ntp/ntpd/refclock_shm.c2
-rw-r--r--contrib/ntp/ntpdc/invoke-ntpdc.texi4
-rw-r--r--contrib/ntp/ntpdc/ntpdc-opts.c20
-rw-r--r--contrib/ntp/ntpdc/ntpdc-opts.h8
-rw-r--r--contrib/ntp/ntpdc/ntpdc.1ntpdcman8
-rw-r--r--contrib/ntp/ntpdc/ntpdc.1ntpdcmdoc6
-rw-r--r--contrib/ntp/ntpdc/ntpdc.c23
-rw-r--r--contrib/ntp/ntpdc/ntpdc.html4
-rw-r--r--contrib/ntp/ntpdc/ntpdc.man.in8
-rw-r--r--contrib/ntp/ntpdc/ntpdc.mdoc.in6
-rw-r--r--contrib/ntp/ntpq/invoke-ntpq.texi4
-rw-r--r--contrib/ntp/ntpq/ntpq-opts.c20
-rw-r--r--contrib/ntp/ntpq/ntpq-opts.h8
-rw-r--r--contrib/ntp/ntpq/ntpq-subs.c8
-rw-r--r--contrib/ntp/ntpq/ntpq.1ntpqman8
-rw-r--r--contrib/ntp/ntpq/ntpq.1ntpqmdoc6
-rw-r--r--contrib/ntp/ntpq/ntpq.c94
-rw-r--r--contrib/ntp/ntpq/ntpq.html4
-rw-r--r--contrib/ntp/ntpq/ntpq.man.in8
-rw-r--r--contrib/ntp/ntpq/ntpq.mdoc.in6
-rw-r--r--contrib/ntp/ntpsnmpd/invoke-ntpsnmpd.texi4
-rw-r--r--contrib/ntp/ntpsnmpd/ntpsnmpd-opts.c20
-rw-r--r--contrib/ntp/ntpsnmpd/ntpsnmpd-opts.h8
-rw-r--r--contrib/ntp/ntpsnmpd/ntpsnmpd.1ntpsnmpdman8
-rw-r--r--contrib/ntp/ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc6
-rw-r--r--contrib/ntp/ntpsnmpd/ntpsnmpd.html2
-rw-r--r--contrib/ntp/ntpsnmpd/ntpsnmpd.man.in8
-rw-r--r--contrib/ntp/ntpsnmpd/ntpsnmpd.mdoc.in6
-rw-r--r--contrib/ntp/packageinfo.sh2
-rw-r--r--contrib/ntp/scripts/calc_tickadj/calc_tickadj.1calc_tickadjman6
-rw-r--r--contrib/ntp/scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc4
-rw-r--r--contrib/ntp/scripts/calc_tickadj/calc_tickadj.html2
-rw-r--r--contrib/ntp/scripts/calc_tickadj/calc_tickadj.man.in6
-rw-r--r--contrib/ntp/scripts/calc_tickadj/calc_tickadj.mdoc.in4
-rw-r--r--contrib/ntp/scripts/calc_tickadj/invoke-calc_tickadj.texi2
-rw-r--r--contrib/ntp/scripts/invoke-plot_summary.texi4
-rw-r--r--contrib/ntp/scripts/invoke-summary.texi4
-rw-r--r--contrib/ntp/scripts/ntp-wait/invoke-ntp-wait.texi4
-rw-r--r--contrib/ntp/scripts/ntp-wait/ntp-wait-opts4
-rw-r--r--contrib/ntp/scripts/ntp-wait/ntp-wait.1ntp-waitman6
-rw-r--r--contrib/ntp/scripts/ntp-wait/ntp-wait.1ntp-waitmdoc4
-rw-r--r--contrib/ntp/scripts/ntp-wait/ntp-wait.html4
-rw-r--r--contrib/ntp/scripts/ntp-wait/ntp-wait.man.in6
-rw-r--r--contrib/ntp/scripts/ntp-wait/ntp-wait.mdoc.in4
-rw-r--r--contrib/ntp/scripts/ntpsweep/invoke-ntpsweep.texi4
-rw-r--r--contrib/ntp/scripts/ntpsweep/ntpsweep-opts4
-rw-r--r--contrib/ntp/scripts/ntpsweep/ntpsweep.1ntpsweepman6
-rw-r--r--contrib/ntp/scripts/ntpsweep/ntpsweep.1ntpsweepmdoc4
-rw-r--r--contrib/ntp/scripts/ntpsweep/ntpsweep.html4
-rw-r--r--contrib/ntp/scripts/ntpsweep/ntpsweep.man.in6
-rw-r--r--contrib/ntp/scripts/ntpsweep/ntpsweep.mdoc.in4
-rw-r--r--contrib/ntp/scripts/ntptrace/invoke-ntptrace.texi4
-rw-r--r--contrib/ntp/scripts/ntptrace/ntptrace-opts4
-rw-r--r--contrib/ntp/scripts/ntptrace/ntptrace.1ntptraceman6
-rw-r--r--contrib/ntp/scripts/ntptrace/ntptrace.1ntptracemdoc4
-rw-r--r--contrib/ntp/scripts/ntptrace/ntptrace.html4
-rw-r--r--contrib/ntp/scripts/ntptrace/ntptrace.man.in6
-rw-r--r--contrib/ntp/scripts/ntptrace/ntptrace.mdoc.in4
-rw-r--r--contrib/ntp/scripts/plot_summary-opts4
-rw-r--r--contrib/ntp/scripts/plot_summary.1plot_summaryman6
-rw-r--r--contrib/ntp/scripts/plot_summary.1plot_summarymdoc4
-rw-r--r--contrib/ntp/scripts/plot_summary.html4
-rw-r--r--contrib/ntp/scripts/plot_summary.man.in6
-rw-r--r--contrib/ntp/scripts/plot_summary.mdoc.in4
-rw-r--r--contrib/ntp/scripts/summary-opts4
-rw-r--r--contrib/ntp/scripts/summary.1summaryman6
-rw-r--r--contrib/ntp/scripts/summary.1summarymdoc4
-rw-r--r--contrib/ntp/scripts/summary.html4
-rw-r--r--contrib/ntp/scripts/summary.man.in6
-rw-r--r--contrib/ntp/scripts/summary.mdoc.in4
-rw-r--r--contrib/ntp/scripts/update-leap/invoke-update-leap.texi2
-rw-r--r--contrib/ntp/scripts/update-leap/update-leap-opts4
-rw-r--r--contrib/ntp/scripts/update-leap/update-leap.1update-leapman6
-rw-r--r--contrib/ntp/scripts/update-leap/update-leap.1update-leapmdoc4
-rw-r--r--contrib/ntp/scripts/update-leap/update-leap.html2
-rw-r--r--contrib/ntp/scripts/update-leap/update-leap.man.in6
-rw-r--r--contrib/ntp/scripts/update-leap/update-leap.mdoc.in4
-rwxr-xr-xcontrib/ntp/sntp/configure20
-rw-r--r--contrib/ntp/sntp/crypto.c25
-rw-r--r--contrib/ntp/sntp/crypto.h20
-rw-r--r--contrib/ntp/sntp/include/copyright.def2
-rw-r--r--contrib/ntp/sntp/include/version.def2
-rw-r--r--contrib/ntp/sntp/include/version.texi6
-rw-r--r--contrib/ntp/sntp/invoke-sntp.texi4
-rw-r--r--contrib/ntp/sntp/libopts/configfile.c44
-rw-r--r--contrib/ntp/sntp/libopts/enum.c10
-rw-r--r--contrib/ntp/sntp/libopts/find.c2
-rw-r--r--contrib/ntp/sntp/libopts/init.c5
-rw-r--r--contrib/ntp/sntp/libopts/load.c2
-rw-r--r--contrib/ntp/sntp/libopts/makeshell.c6
-rw-r--r--contrib/ntp/sntp/libopts/nested.c4
-rw-r--r--contrib/ntp/sntp/libopts/parse-duration.c10
-rw-r--r--contrib/ntp/sntp/libopts/reset.c2
-rw-r--r--contrib/ntp/sntp/libopts/save.c4
-rw-r--r--contrib/ntp/sntp/libopts/tokenize.c2
-rw-r--r--contrib/ntp/sntp/m4/version.m42
-rw-r--r--contrib/ntp/sntp/main.c2
-rw-r--r--contrib/ntp/sntp/networking.c2
-rw-r--r--contrib/ntp/sntp/sntp-opts.c20
-rw-r--r--contrib/ntp/sntp/sntp-opts.h8
-rw-r--r--contrib/ntp/sntp/sntp.1sntpman8
-rw-r--r--contrib/ntp/sntp/sntp.1sntpmdoc6
-rw-r--r--contrib/ntp/sntp/sntp.html4
-rw-r--r--contrib/ntp/sntp/sntp.man.in8
-rw-r--r--contrib/ntp/sntp/sntp.mdoc.in6
-rw-r--r--contrib/ntp/sntp/tests/crypto.c68
-rw-r--r--contrib/ntp/sntp/tests/fileHandlingTest.c65
-rw-r--r--contrib/ntp/sntp/tests/fileHandlingTest.h.in21
-rw-r--r--contrib/ntp/sntp/tests/keyFile.c112
-rw-r--r--contrib/ntp/sntp/tests/packetHandling.c141
-rw-r--r--contrib/ntp/sntp/tests/packetProcessing.c214
-rw-r--r--contrib/ntp/sntp/tests/run-packetProcessing.c36
-rw-r--r--contrib/ntp/sntp/unity/unity_internals.h2
-rw-r--r--contrib/ntp/sntp/version.c2
-rw-r--r--contrib/ntp/tests/libntp/authkeys.c40
-rw-r--r--contrib/ntp/tests/libntp/decodenetnum.c56
-rw-r--r--contrib/ntp/tests/libntp/run-authkeys.c15
-rw-r--r--contrib/ntp/tests/libntp/run-decodenetnum.c8
-rw-r--r--contrib/ntp/tests/libntp/run-socktoa.c10
-rw-r--r--contrib/ntp/tests/libntp/socktoa.c40
-rw-r--r--contrib/ntp/tests/ntpd/t-ntp_signd.c4
-rw-r--r--contrib/ntp/util/invoke-ntp-keygen.texi4
-rw-r--r--contrib/ntp/util/ntp-keygen-opts.c20
-rw-r--r--contrib/ntp/util/ntp-keygen-opts.h8
-rw-r--r--contrib/ntp/util/ntp-keygen.1ntp-keygenman8
-rw-r--r--contrib/ntp/util/ntp-keygen.1ntp-keygenmdoc6
-rw-r--r--contrib/ntp/util/ntp-keygen.html4
-rw-r--r--contrib/ntp/util/ntp-keygen.man.in8
-rw-r--r--contrib/ntp/util/ntp-keygen.mdoc.in6
-rw-r--r--contrib/openpam/CREDITS5
-rw-r--r--contrib/openpam/configure.ac2
-rw-r--r--contrib/openpam/lib/libpam/openpam_constants.c3
-rw-r--r--contrib/openpam/lib/libpam/openpam_ctype.h10
-rw-r--r--contrib/openpam/lib/libpam/openpam_dispatch.c2
-rw-r--r--contrib/openpam/modules/pam_unix/pam_unix.c4
-rw-r--r--contrib/openpam/t/Makefile.am1
-rw-r--r--contrib/openpam/t/t_openpam_ctype.c122
-rw-r--r--contrib/openpam/t/t_openpam_readlinev.c2
-rw-r--r--contrib/openpam/t/t_openpam_readword.c2
-rw-r--r--contrib/smbfs/lib/smb/nb_name.c32
-rw-r--r--contrib/unbound/.gitignore38
-rw-r--r--contrib/unbound/Makefile.in247
-rw-r--r--contrib/unbound/acx_nlnetlabs.m412
-rw-r--r--contrib/unbound/compat/arc4random.c2
-rw-r--r--contrib/unbound/compat/getentropy_linux.c25
-rw-r--r--contrib/unbound/compat/getentropy_solaris.c6
-rw-r--r--contrib/unbound/compat/isblank.c45
-rw-r--r--contrib/unbound/compat/reallocarray.c3
-rw-r--r--contrib/unbound/compat/sha512.c2
-rw-r--r--contrib/unbound/compat/snprintf.c3
-rw-r--r--contrib/unbound/config.h35
-rw-r--r--contrib/unbound/config.h.in27
-rwxr-xr-xcontrib/unbound/configure201
-rw-r--r--contrib/unbound/configure.ac69
-rw-r--r--contrib/unbound/daemon/remote.c6
-rw-r--r--contrib/unbound/daemon/unbound.c5
-rw-r--r--contrib/unbound/daemon/worker.c9
-rw-r--r--contrib/unbound/dns64/dns64.c6
-rw-r--r--contrib/unbound/dnstap/dnstap.proto2
-rw-r--r--contrib/unbound/doc/Changelog136
-rw-r--r--contrib/unbound/doc/README2
-rw-r--r--contrib/unbound/doc/example.conf94
-rw-r--r--contrib/unbound/doc/example.conf.in94
-rw-r--r--contrib/unbound/doc/libunbound.34
-rw-r--r--contrib/unbound/doc/libunbound.3.in4
-rw-r--r--contrib/unbound/doc/unbound-anchor.82
-rw-r--r--contrib/unbound/doc/unbound-anchor.8.in2
-rw-r--r--contrib/unbound/doc/unbound-checkconf.82
-rw-r--r--contrib/unbound/doc/unbound-checkconf.8.in2
-rw-r--r--contrib/unbound/doc/unbound-control.84
-rw-r--r--contrib/unbound/doc/unbound-control.8.in4
-rw-r--r--contrib/unbound/doc/unbound-host.12
-rw-r--r--contrib/unbound/doc/unbound-host.1.in2
-rw-r--r--contrib/unbound/doc/unbound.84
-rw-r--r--contrib/unbound/doc/unbound.8.in4
-rw-r--r--contrib/unbound/doc/unbound.conf.547
-rw-r--r--contrib/unbound/doc/unbound.conf.5.in47
-rwxr-xr-xcontrib/unbound/freebsd-configure.sh3
-rw-r--r--contrib/unbound/iterator/iter_scrub.c38
-rw-r--r--contrib/unbound/iterator/iter_utils.c4
-rw-r--r--contrib/unbound/iterator/iterator.c132
-rw-r--r--contrib/unbound/iterator/iterator.h35
-rw-r--r--contrib/unbound/libunbound/libunbound.c3
-rw-r--r--contrib/unbound/libunbound/python/Makefile2
-rw-r--r--contrib/unbound/libunbound/python/doc/install.rst2
-rw-r--r--contrib/unbound/libunbound/python/doc/modules/unbound.rst2
-rw-r--r--contrib/unbound/libunbound/python/examples/dnssec-valid.py2
-rw-r--r--contrib/unbound/libunbound/python/libunbound.i4
-rwxr-xr-xcontrib/unbound/ltmain.sh2
-rw-r--r--contrib/unbound/services/cache/dns.c5
-rw-r--r--contrib/unbound/services/cache/rrset.c1
-rw-r--r--contrib/unbound/sldns/parseutil.h4
-rw-r--r--contrib/unbound/sldns/wire2str.c3
-rw-r--r--contrib/unbound/smallapp/unbound-anchor.c18
-rw-r--r--contrib/unbound/smallapp/unbound-checkconf.c4
-rwxr-xr-xcontrib/unbound/smallapp/unbound-control-setup.sh38
-rwxr-xr-xcontrib/unbound/smallapp/unbound-control-setup.sh.in38
-rw-r--r--contrib/unbound/smallapp/unbound-control.c9
-rw-r--r--contrib/unbound/util/config_file.c27
-rw-r--r--contrib/unbound/util/config_file.h7
-rw-r--r--contrib/unbound/util/configlexer.lex1
-rw-r--r--contrib/unbound/util/configparser.y13
-rw-r--r--contrib/unbound/util/iana_ports.inc4
-rw-r--r--contrib/unbound/util/locks.c2
-rw-r--r--contrib/unbound/util/net_help.c12
-rw-r--r--contrib/unbound/util/random.c74
-rw-r--r--contrib/unbound/util/rbtree.c2
-rw-r--r--contrib/unbound/util/rtt.h2
-rw-r--r--contrib/unbound/util/storage/lookup3.c8
-rw-r--r--contrib/unbound/util/tube.h2
-rw-r--r--contrib/unbound/util/winsock_event.h2
-rw-r--r--contrib/unbound/validator/autotrust.c10
-rw-r--r--contrib/unbound/validator/val_neg.c2
-rw-r--r--contrib/unbound/validator/val_neg.h2
-rw-r--r--contrib/unbound/validator/val_nsec.c28
-rw-r--r--contrib/unbound/validator/val_nsec.h6
-rw-r--r--contrib/unbound/validator/val_nsec3.c136
-rw-r--r--contrib/unbound/validator/val_nsec3.h6
-rw-r--r--contrib/unbound/validator/val_secalgo.c520
-rw-r--r--contrib/unbound/validator/val_secalgo.h15
-rw-r--r--contrib/unbound/validator/val_sigcrypt.c2
-rw-r--r--contrib/unbound/validator/val_utils.h2
-rw-r--r--contrib/unbound/validator/validator.c6
-rw-r--r--crypto/openssh/FREEBSD-tricks14
-rw-r--r--crypto/openssh/FREEBSD-upgrade112
-rw-r--r--crypto/openssh/README.hpn120
-rw-r--r--crypto/openssh/auth-krb5.c2
-rw-r--r--crypto/openssh/buffer.c10
-rw-r--r--crypto/openssh/buffer.h3
-rw-r--r--crypto/openssh/channels.c97
-rw-r--r--crypto/openssh/channels.h8
-rw-r--r--crypto/openssh/cipher.c14
-rw-r--r--crypto/openssh/clientloop.c36
-rw-r--r--crypto/openssh/compat.c11
-rw-r--r--crypto/openssh/compat.h3
-rw-r--r--crypto/openssh/config.h5
-rw-r--r--crypto/openssh/config.h.in1708
-rwxr-xr-xcrypto/openssh/configure19741
-rw-r--r--crypto/openssh/configure.ac1
-rw-r--r--crypto/openssh/digest-libc.c2
-rwxr-xr-xcrypto/openssh/freebsd-configure.sh14
-rwxr-xr-xcrypto/openssh/freebsd-post-merge.sh14
-rwxr-xr-xcrypto/openssh/freebsd-pre-merge.sh17
-rw-r--r--crypto/openssh/kex.c26
-rw-r--r--crypto/openssh/kex.h5
-rw-r--r--crypto/openssh/misc.c32
-rw-r--r--crypto/openssh/misc.h2
-rw-r--r--crypto/openssh/moduli.52
-rw-r--r--crypto/openssh/mux.c1
-rw-r--r--crypto/openssh/myproposal.h4
-rw-r--r--crypto/openssh/packet.c27
-rw-r--r--crypto/openssh/packet.h7
-rw-r--r--crypto/openssh/pathnames.h1
-rw-r--r--crypto/openssh/readconf.c100
-rw-r--r--crypto/openssh/readconf.h14
-rw-r--r--crypto/openssh/schnorr.c672
-rw-r--r--crypto/openssh/scp.12
-rw-r--r--crypto/openssh/servconf.c71
-rw-r--r--crypto/openssh/servconf.h9
-rw-r--r--crypto/openssh/serverloop.c13
-rw-r--r--crypto/openssh/session.c18
-rw-r--r--crypto/openssh/sftp-common.c1
-rw-r--r--crypto/openssh/sftp-server.83
-rw-r--r--crypto/openssh/sftp.16
-rw-r--r--crypto/openssh/sftp.c3
-rw-r--r--crypto/openssh/ssh-add.12
-rw-r--r--crypto/openssh/ssh-agent.12
-rw-r--r--crypto/openssh/ssh-gss.h1
-rw-r--r--crypto/openssh/ssh-keygen.13
-rw-r--r--crypto/openssh/ssh-keyscan.13
-rw-r--r--crypto/openssh/ssh-keysign.82
-rw-r--r--crypto/openssh/ssh-pkcs11-helper.82
-rw-r--r--crypto/openssh/ssh.12
-rw-r--r--crypto/openssh/ssh.c59
-rw-r--r--crypto/openssh/ssh_config2
-rw-r--r--crypto/openssh/ssh_config.54
-rw-r--r--crypto/openssh/ssh_namespace.h124
-rw-r--r--crypto/openssh/sshconnect.c32
-rw-r--r--crypto/openssh/sshconnect2.c34
-rw-r--r--crypto/openssh/sshd.82
-rw-r--r--crypto/openssh/sshd.c29
-rw-r--r--crypto/openssh/sshd_config14
-rw-r--r--crypto/openssh/sshd_config.54
-rw-r--r--crypto/openssh/version.h3
-rw-r--r--etc/defaults/rc.conf4
-rwxr-xr-xetc/rc.d/NETWORKING2
-rwxr-xr-xetc/rc.d/netwait129
-rw-r--r--lib/Makefile9
-rw-r--r--lib/libc/net/if_nametoindex.c2
-rw-r--r--lib/libc/rpc/rpc_soc.c2
-rw-r--r--lib/libc/rpc/rpcb_clnt.c4
-rw-r--r--lib/libc/rpc/rpcb_prot.c4
-rw-r--r--lib/libc/string/wcslcat.c2
-rw-r--r--lib/libc/string/wcsncat.c2
-rw-r--r--lib/libc/sys/futimens.c5
-rw-r--r--lib/libc/sys/utimensat.211
-rw-r--r--lib/libc/sys/utimensat.c5
-rw-r--r--lib/libc/tests/net/Makefile2
-rw-r--r--lib/libfetch/common.c7
-rw-r--r--lib/libfetch/fetch.312
-rw-r--r--lib/libfetch/file.c8
-rw-r--r--lib/libfetch/http.c59
-rw-r--r--lib/libpam/Makefile.inc1
-rw-r--r--lib/libpam/libpam/Makefile1
-rw-r--r--lib/libstand/Makefile5
-rw-r--r--lib/libstand/bootp.c19
-rw-r--r--lib/libthr/thread/thr_umtx.c5
-rw-r--r--lib/msun/tests/Makefile8
-rw-r--r--lib/msun/tests/ctrig_test.c (renamed from tools/regression/lib/msun/test-ctrig.c)0
-rw-r--r--lib/msun/tests/exponential_test.c (renamed from tools/regression/lib/msun/test-exponential.c)0
-rw-r--r--lib/msun/tests/fma_test.c (renamed from tools/regression/lib/msun/test-fma.c)8
-rw-r--r--lib/msun/tests/invtrig_test.c (renamed from tools/regression/lib/msun/test-invtrig.c)2
-rw-r--r--lib/msun/tests/lround_test.c (renamed from tools/regression/lib/msun/test-lround.c)0
-rw-r--r--lib/msun/tests/lround_test.t (renamed from tools/regression/lib/msun/test-ctrig.t)0
-rw-r--r--lib/msun/tests/test-utils.h (renamed from tools/regression/lib/msun/test-utils.h)0
-rw-r--r--sbin/ifconfig/sfp.c48
-rw-r--r--sbin/mount/mount.c10
-rw-r--r--secure/lib/libssh/Makefile4
-rw-r--r--secure/usr.bin/ssh/Makefile4
-rw-r--r--secure/usr.sbin/sshd/Makefile4
-rw-r--r--share/man/man4/sfxge.46
-rw-r--r--share/man/man4/uart.453
-rw-r--r--share/man/man7/ascii.78
-rw-r--r--share/man/man9/Makefile2
-rw-r--r--share/man/man9/devfs_set_cdevpriv.99
-rw-r--r--share/man/man9/pci.955
-rw-r--r--share/misc/ascii6
-rw-r--r--share/mk/bsd.own.mk1
-rw-r--r--sys/amd64/amd64/elf_machdep.c1
-rw-r--r--sys/amd64/amd64/machdep.c2
-rw-r--r--sys/amd64/amd64/trap.c7
-rw-r--r--sys/amd64/include/metadata.h56
-rw-r--r--sys/amd64/include/pcb.h20
-rw-r--r--sys/amd64/linux/linux_proto.h2
-rw-r--r--sys/amd64/linux/linux_syscall.h2
-rw-r--r--sys/amd64/linux/linux_syscalls.c2
-rw-r--r--sys/amd64/linux/linux_sysent.c2
-rw-r--r--sys/amd64/linux/linux_systrace_args.c12
-rw-r--r--sys/amd64/linux/linux_sysvec.c51
-rw-r--r--sys/amd64/linux/syscalls.master6
-rw-r--r--sys/amd64/linux32/linux.h2
-rw-r--r--sys/amd64/linux32/linux32_locore.s4
-rw-r--r--sys/amd64/linux32/linux32_proto.h562
-rw-r--r--sys/amd64/linux32/linux32_syscall.h634
-rw-r--r--sys/amd64/linux32/linux32_syscalls.c4
-rw-r--r--sys/amd64/linux32/linux32_sysent.c4
-rw-r--r--sys/amd64/linux32/linux32_sysvec.c11
-rw-r--r--sys/amd64/linux32/syscalls.conf8
-rw-r--r--sys/amd64/linux32/syscalls.master2
-rw-r--r--sys/arm/arm/bcopyinout.S3
-rw-r--r--sys/arm/arm/bcopyinout_xscale.S4
-rw-r--r--sys/arm/arm/busdma_machdep.c3
-rw-r--r--sys/arm/arm/copystr.S3
-rw-r--r--sys/arm/arm/elf_machdep.c1
-rw-r--r--sys/arm/arm/fusu.S4
-rw-r--r--sys/arm/arm/locore-v4.S239
-rw-r--r--sys/arm/arm/locore-v6.S188
-rw-r--r--sys/arm/arm/machdep.c8
-rw-r--r--sys/arm/arm/physmem.c29
-rw-r--r--sys/arm/arm/trap.c3
-rw-r--r--sys/arm/at91/at91_mci.c21
-rw-r--r--sys/arm/freescale/imx/imx6_anatop.c17
-rw-r--r--sys/arm/freescale/imx/imx6_machdep.c4
-rw-r--r--sys/arm/freescale/imx/imx_machdep.c36
-rw-r--r--sys/arm/freescale/imx/imx_machdep.h4
-rw-r--r--sys/arm/freescale/imx/imx_sdhci.c12
-rw-r--r--sys/arm/freescale/imx/imx_wdogreg.h1
-rw-r--r--sys/arm/mv/std-pj4b.mv6
-rw-r--r--sys/arm/xscale/ixp425/avila_machdep.c8
-rw-r--r--sys/boot/common/bootstrap.h7
-rw-r--r--sys/boot/common/load_elf.c265
-rw-r--r--sys/boot/common/load_elf_obj.c9
-rw-r--r--sys/boot/common/module.c11
-rw-r--r--sys/boot/efi/boot1/Makefile14
-rw-r--r--sys/boot/efi/boot1/boot1.c31
-rw-r--r--sys/boot/efi/include/efierr.h3
-rw-r--r--sys/boot/efi/libefi/Makefile1
-rw-r--r--sys/boot/efi/libefi/efi_console.c420
-rw-r--r--sys/boot/efi/loader/Makefile3
-rw-r--r--sys/boot/efi/loader/bootinfo.c7
-rw-r--r--sys/boot/efi/loader/copy.c2
-rw-r--r--sys/boot/efi/loader/main.c99
-rw-r--r--sys/boot/fdt/dts/arm/beaglebone-black.dts4
-rw-r--r--sys/boot/fdt/dts/arm/beaglebone.dts2
-rw-r--r--sys/boot/fdt/fdt_loader_cmd.c2
-rw-r--r--sys/boot/ficl/amd64/sysdep.c2
-rw-r--r--sys/boot/forth/beastie.4th6
-rw-r--r--sys/boot/forth/beastie.4th.85
-rw-r--r--sys/boot/forth/loader.4th3
-rw-r--r--sys/boot/forth/loader.conf.55
-rw-r--r--sys/boot/forth/support.4th27
-rw-r--r--sys/boot/i386/libi386/Makefile3
-rw-r--r--sys/boot/i386/libi386/bootinfo64.c45
-rw-r--r--sys/boot/i386/libi386/elf64_freebsd.c2
-rw-r--r--sys/boot/i386/libi386/libi386.h3
-rw-r--r--sys/boot/i386/libi386/multiboot.c425
-rw-r--r--sys/boot/i386/libi386/multiboot.h225
-rw-r--r--sys/boot/i386/libi386/multiboot_tramp.S51
-rw-r--r--sys/boot/i386/loader/conf.c4
-rw-r--r--sys/boot/i386/zfsboot/zfsboot.c6
-rw-r--r--sys/boot/ia64/efi/Makefile1
-rw-r--r--sys/boot/libstand32/Makefile4
-rw-r--r--sys/boot/pc98/boot2/boot2.c2
-rw-r--r--sys/boot/pc98/libpc98/biosdisk.c6
-rw-r--r--sys/boot/uboot/common/main.c55
-rw-r--r--sys/boot/uboot/lib/copy.c22
-rw-r--r--sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c1
-rw-r--r--sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c2
-rw-r--r--sys/cddl/dev/systrace/systrace.c44
-rw-r--r--sys/compat/ia32/ia32_sysvec.c1
-rw-r--r--sys/compat/linux/linux_misc.c11
-rw-r--r--sys/compat/linux/linux_socket.c1
-rw-r--r--sys/compat/svr4/svr4_sysvec.c1
-rw-r--r--sys/conf/files.amd641
-rw-r--r--sys/dev/drm2/i915/intel_iic.c3
-rw-r--r--sys/dev/e1000/if_igb.c11
-rw-r--r--sys/dev/iicbus/icee.c157
-rw-r--r--sys/dev/iicbus/iicbb.c17
-rw-r--r--sys/dev/iicbus/iicbus.c9
-rw-r--r--sys/dev/iicbus/iicoc.c1
-rw-r--r--sys/dev/iicbus/iiconf.c15
-rw-r--r--sys/dev/iicbus/iiconf.h2
-rw-r--r--sys/dev/iicbus/iicsmb.c6
-rw-r--r--sys/dev/iscsi/iscsi.c99
-rw-r--r--sys/dev/iscsi/iscsi.h3
-rw-r--r--sys/dev/nvd/nvd.c2
-rw-r--r--sys/dev/nvme/nvme.h1
-rw-r--r--sys/dev/nvme/nvme_ns.c18
-rw-r--r--sys/dev/nvme/nvme_sysctl.c16
-rw-r--r--sys/dev/ofw/ofw_iicbus.c6
-rw-r--r--sys/dev/pci/pci.c24
-rw-r--r--sys/dev/pci/pci_if.m16
-rw-r--r--sys/dev/pci/pci_private.h2
-rw-r--r--sys/dev/pci/pcireg.h24
-rw-r--r--sys/dev/pci/pcivar.h17
-rw-r--r--sys/dev/rt/if_rt.c24
-rw-r--r--sys/dev/sfxge/common/ef10_impl.h46
-rw-r--r--sys/dev/sfxge/common/ef10_tlv_layout.h10
-rw-r--r--sys/dev/sfxge/common/efsys.h4
-rw-r--r--sys/dev/sfxge/common/efx.h73
-rw-r--r--sys/dev/sfxge/common/efx_check.h11
-rw-r--r--sys/dev/sfxge/common/efx_impl.h54
-rw-r--r--sys/dev/sfxge/common/efx_lic.c792
-rw-r--r--sys/dev/sfxge/common/efx_mac.c51
-rw-r--r--sys/dev/sfxge/common/efx_mcdi.c166
-rw-r--r--sys/dev/sfxge/common/efx_mcdi.h5
-rw-r--r--sys/dev/sfxge/common/efx_nic.c52
-rw-r--r--sys/dev/sfxge/common/efx_nvram.c131
-rw-r--r--sys/dev/sfxge/common/efx_phy.c30
-rw-r--r--sys/dev/sfxge/common/efx_regs_ef10.h65
-rw-r--r--sys/dev/sfxge/common/efx_rx.c4
-rw-r--r--sys/dev/sfxge/common/efx_tx.c22
-rw-r--r--sys/dev/sfxge/common/efx_vpd.c19
-rw-r--r--sys/dev/sfxge/common/hunt_ev.c184
-rw-r--r--sys/dev/sfxge/common/hunt_impl.h193
-rw-r--r--sys/dev/sfxge/common/hunt_mac.c307
-rw-r--r--sys/dev/sfxge/common/hunt_mcdi.c145
-rw-r--r--sys/dev/sfxge/common/hunt_nic.c210
-rw-r--r--sys/dev/sfxge/common/hunt_nvram.c215
-rw-r--r--sys/dev/sfxge/common/hunt_phy.c85
-rwxr-xr-xsys/dev/sfxge/common/hunt_tx.c35
-rw-r--r--sys/dev/sfxge/common/hunt_vpd.c41
-rw-r--r--sys/dev/sfxge/common/medford_impl.h22
-rw-r--r--sys/dev/sfxge/common/medford_nic.c266
-rw-r--r--sys/dev/sfxge/common/siena_flash.h4
-rw-r--r--sys/dev/sfxge/common/siena_impl.h102
-rw-r--r--sys/dev/sfxge/common/siena_mcdi.c75
-rw-r--r--sys/dev/sfxge/common/siena_nic.c1
-rw-r--r--sys/dev/sfxge/common/siena_nvram.c181
-rw-r--r--sys/dev/sfxge/common/siena_vpd.c7
-rw-r--r--sys/dev/sfxge/sfxge.h5
-rw-r--r--sys/dev/sfxge/sfxge_tx.c238
-rw-r--r--sys/dev/sfxge/sfxge_tx.h1
-rw-r--r--sys/dev/sfxge/sfxge_version.h2
-rw-r--r--sys/dev/uart/uart_bus.h1
-rw-r--r--sys/dev/uart/uart_core.c145
-rw-r--r--sys/dev/uart/uart_dev_ns8250.c76
-rw-r--r--sys/dev/uart/uart_ppstypes.h46
-rw-r--r--sys/dev/usb/serial/usb_serial.c45
-rw-r--r--sys/fs/devfs/devfs_vnops.c8
-rw-r--r--sys/fs/smbfs/smbfs_smb.c8
-rw-r--r--sys/fs/smbfs/smbfs_subr.h3
-rw-r--r--sys/fs/smbfs/smbfs_vnops.c3
-rw-r--r--sys/geom/geom_disk.c17
-rw-r--r--sys/geom/multipath/g_multipath.c20
-rw-r--r--sys/i386/i386/elf_machdep.c1
-rw-r--r--sys/i386/i386/machdep.c9
-rw-r--r--sys/i386/ibcs2/ibcs2_sysvec.c1
-rw-r--r--sys/i386/include/metadata.h36
-rw-r--r--sys/i386/include/pcb.h16
-rw-r--r--sys/i386/linux/linux_sysvec.c2
-rw-r--r--sys/kern/imgact_aout.c1
-rw-r--r--sys/kern/init_main.c1
-rw-r--r--sys/kern/kern_environment.c38
-rw-r--r--sys/kern/kern_linker.c6
-rw-r--r--sys/kern/kern_mib.c5
-rw-r--r--sys/kern/kern_proc.c15
-rw-r--r--sys/kern/kern_thread.c11
-rw-r--r--sys/kern/makesyscalls.sh4
-rw-r--r--sys/kern/subr_busdma_bufalloc.c4
-rw-r--r--sys/mips/include/elf.h29
-rw-r--r--sys/mips/mips/elf_machdep.c2
-rw-r--r--sys/mips/mips/freebsd32_machdep.c1
-rw-r--r--sys/modules/dtrace/Makefile5
-rw-r--r--sys/modules/dtrace/systrace_linux/Makefile18
-rw-r--r--sys/modules/dtrace/systrace_linux32/Makefile6
-rw-r--r--sys/modules/sfxge/Makefile2
-rw-r--r--sys/net/bpf.c2
-rw-r--r--sys/net/if.c20
-rw-r--r--sys/net/if_llatbl.c14
-rw-r--r--sys/net/sff8436.h2
-rw-r--r--sys/netinet/sctp.h20
-rw-r--r--sys/netinet/sctp_asconf.c8
-rw-r--r--sys/netinet/sctp_auth.c31
-rw-r--r--sys/netinet/sctp_constants.h8
-rw-r--r--sys/netinet/sctp_header.h51
-rw-r--r--sys/netinet/sctp_indata.c167
-rw-r--r--sys/netinet/sctp_indata.h6
-rw-r--r--sys/netinet/sctp_input.c274
-rw-r--r--sys/netinet/sctp_os_bsd.h1
-rw-r--r--sys/netinet/sctp_output.c362
-rw-r--r--sys/netinet/sctp_output.h11
-rw-r--r--sys/netinet/sctp_pcb.c72
-rw-r--r--sys/netinet/sctp_pcb.h8
-rw-r--r--sys/netinet/sctp_structs.h15
-rw-r--r--sys/netinet/sctp_sysctl.c3
-rw-r--r--sys/netinet/sctp_sysctl.h4
-rw-r--r--sys/netinet/sctp_timer.c17
-rw-r--r--sys/netinet/sctp_uio.h22
-rw-r--r--sys/netinet/sctp_usrreq.c252
-rw-r--r--sys/netinet/sctputil.c129
-rw-r--r--sys/netinet/sctputil.h5
-rw-r--r--sys/netinet/tcp_subr.c2
-rw-r--r--sys/netinet6/in6.c4
-rw-r--r--sys/netinet6/sctp6_usrreq.c7
-rw-r--r--sys/ofed/include/linux/linux_compat.c2
-rw-r--r--sys/powerpc/powerpc/busdma_machdep.c4
-rw-r--r--sys/powerpc/powerpc/elf32_machdep.c1
-rw-r--r--sys/powerpc/powerpc/elf64_machdep.c1
-rw-r--r--sys/security/audit/audit_worker.c60
-rw-r--r--sys/sparc64/sparc64/bus_machdep.c4
-rw-r--r--sys/sparc64/sparc64/elf_machdep.c1
-rw-r--r--sys/sparc64/sparc64/machdep.c3
-rw-r--r--sys/sys/conf.h4
-rw-r--r--sys/sys/elf32.h12
-rw-r--r--sys/sys/elf64.h12
-rw-r--r--sys/sys/elf_common.h217
-rw-r--r--sys/sys/sysent.h1
-rw-r--r--sys/vm/vm_kern.c3
-rw-r--r--sys/x86/include/metadata.h57
-rw-r--r--sys/x86/x86/busdma_bounce.c4
-rw-r--r--tools/build/options/WITH_OPENSSH_NONE_CIPHER9
-rw-r--r--tools/regression/geom_mirror/conf.sh7
-rw-r--r--tools/regression/geom_mirror/test-1.t19
-rw-r--r--tools/regression/geom_mirror/test-2.t25
-rw-r--r--tools/regression/geom_mirror/test-3.t24
-rw-r--r--tools/regression/geom_mirror/test-4.t26
-rw-r--r--tools/regression/geom_mirror/test-5.t24
-rw-r--r--tools/regression/geom_mirror/test-6.t25
-rw-r--r--tools/regression/geom_mirror/test-7.t24
-rw-r--r--tools/regression/geom_subr.sh42
-rw-r--r--tools/regression/lib/msun/Makefile14
-rw-r--r--tools/regression/lib/msun/test-cexp.c322
-rw-r--r--tools/regression/lib/msun/test-conj.c139
-rw-r--r--tools/regression/lib/msun/test-csqrt.c295
-rw-r--r--tools/regression/lib/msun/test-exponential.t10
-rw-r--r--tools/regression/lib/msun/test-fma.t10
-rw-r--r--tools/regression/lib/msun/test-invtrig.t10
-rw-r--r--tools/regression/lib/msun/test-lround.t10
-rw-r--r--tools/regression/lib/msun/test-trig.c280
-rw-r--r--tools/regression/sockets/accf_data_attach/accf_data_attach.c15
-rw-r--r--tools/regression/sockets/reconnect/reconnect.c3
-rw-r--r--tools/regression/sockets/rtsocket/rtsocket.c8
-rw-r--r--tools/regression/sockets/sendfile/sendfile.c3
-rw-r--r--tools/regression/sockets/so_setfib/so_setfib.c2
-rw-r--r--tools/regression/sockets/unix_gc/Makefile2
-rw-r--r--tools/regression/sockets/unix_gc/unix_gc.c2
-rw-r--r--tools/regression/sockets/unix_socket/unix_socket.c2
-rw-r--r--tools/regression/sockets/zerosend/Makefile2
-rw-r--r--tools/regression/sockets/zerosend/zerosend.c64
-rw-r--r--usr.bin/elfdump/elfdump.c2
-rw-r--r--usr.bin/fetch/fetch.17
-rw-r--r--usr.bin/fetch/fetch.c25
-rw-r--r--usr.bin/iscsictl/iscsictl.817
-rw-r--r--usr.bin/iscsictl/iscsictl.c79
-rw-r--r--usr.bin/kdump/Makefile13
-rw-r--r--usr.bin/kdump/kdump.c46
-rw-r--r--usr.bin/kdump/linux32_syscalls.conf11
-rw-r--r--usr.bin/less/defines.h5
-rw-r--r--usr.bin/netstat/sctp.c23
-rw-r--r--usr.bin/sockstat/sockstat.17
-rw-r--r--usr.bin/sockstat/sockstat.c88
-rw-r--r--usr.bin/systat/Makefile2
-rw-r--r--usr.bin/systat/cmdtab.c3
-rw-r--r--usr.bin/systat/extern.h11
-rw-r--r--usr.bin/systat/sctp.c362
-rw-r--r--usr.bin/systat/systat.19
-rw-r--r--usr.sbin/Makefile1
-rw-r--r--usr.sbin/Makefile.amd641
-rw-r--r--usr.sbin/Makefile.arm2
-rw-r--r--usr.sbin/Makefile.i3861
-rw-r--r--usr.sbin/Makefile.ia641
-rw-r--r--usr.sbin/Makefile.powerpc1
-rw-r--r--usr.sbin/Makefile.sparc641
-rw-r--r--usr.sbin/arp/arp.c5
-rw-r--r--usr.sbin/bhyve/pci_virtio_net.c306
-rw-r--r--usr.sbin/boot0cfg/boot0cfg.c3
-rwxr-xr-xusr.sbin/bsdinstall/scripts/auto56
-rwxr-xr-xusr.sbin/bsdinstall/scripts/zfsboot4
-rw-r--r--usr.sbin/jail/command.c1
-rw-r--r--usr.sbin/jail/config.c21
-rw-r--r--usr.sbin/mountd/exports.52
-rw-r--r--usr.sbin/mountd/mountd.c71
-rw-r--r--usr.sbin/ndp/ndp.c2
-rw-r--r--usr.sbin/ntp/config.h12
-rw-r--r--usr.sbin/ntp/doc/ntp-keygen.86
-rw-r--r--usr.sbin/ntp/doc/ntp.conf.577
-rw-r--r--usr.sbin/ntp/doc/ntp.keys.518
-rw-r--r--usr.sbin/ntp/doc/ntpd.86
-rw-r--r--usr.sbin/ntp/doc/ntpdc.86
-rw-r--r--usr.sbin/ntp/doc/ntpq.86
-rw-r--r--usr.sbin/ntp/doc/sntp.86
-rw-r--r--usr.sbin/ntp/libntp/Makefile1
-rwxr-xr-xusr.sbin/ntp/scripts/mkver2
-rw-r--r--usr.sbin/pciconf/pciconf.842
-rw-r--r--usr.sbin/pciconf/pciconf.c212
-rwxr-xr-xusr.sbin/service/service.sh8
753 files changed, 20040 insertions, 33229 deletions
diff --git a/Makefile.inc1 b/Makefile.inc1
index 2e18f2b..5e6d687 100644
--- a/Makefile.inc1
+++ b/Makefile.inc1
@@ -1012,7 +1012,7 @@ KERNCONFDIR?= ${KRNLCONFDIR}
BUILDKERNELS=
INSTALLKERNEL=
-NO_INSTALLEXTRAKERNELS=yes
+NO_INSTALLEXTRAKERNELS?= yes
.if defined(NO_INSTALLKERNEL)
# All of the BUILDKERNELS loops start at index 1.
BUILDKERNELS+= dummy
diff --git a/UPDATING b/UPDATING
index c737b71..387d117 100644
--- a/UPDATING
+++ b/UPDATING
@@ -16,6 +16,10 @@ from older versions of FreeBSD, try WITHOUT_CLANG to bootstrap to the tip of
stable/10, and then rebuild without this option. The bootstrap process from
older version of current is a bit fragile.
+20160124:
+ The NONE and HPN patches has been removed from OpenSSH. They are
+ still available in the security/openssh-portable port.
+
20151214:
r292223 changed the internal interface between the nfsd.ko and
nfscommon.ko modules. As such, they must both be upgraded to-gether.
diff --git a/contrib/less/LICENSE b/contrib/less/LICENSE
index 3fe715f..376b8c8 100644
--- a/contrib/less/LICENSE
+++ b/contrib/less/LICENSE
@@ -2,7 +2,7 @@
------------
Less
-Copyright (C) 1984-2012 Mark Nudelman
+Copyright (C) 1984-2015 Mark Nudelman
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
diff --git a/contrib/less/NEWS b/contrib/less/NEWS
index e03f35a..43f1247 100644
--- a/contrib/less/NEWS
+++ b/contrib/less/NEWS
@@ -7,7 +7,44 @@
http://www.greenwoodsoftware.com/less
You can also download the latest version of less from there.
- To report bugs, suggestions or comments, send email to bug-less@gnu.org.
+ To report bugs, suggestions or comments, send email to bug-less@gnu.org
+
+======================================================================
+
+ Major changes between "less" versions 458 and 481
+
+* Don't overwrite history file; just append to it.
+
+* New command ESC-G goes to end of currently buffered data in a pipe.
+
+* Disable history feature when compiled with LESSHISTFILE set to "-".
+
+* In more-compatible mode, make the -p option apply to every file opened,
+ not just the first one.
+
+* In more-compatible mode, change the -e option to work like -E, not -EF.
+
+* Treat multiple CRs before LF are like one CR (all the CRs are hidden).
+
+* Allow "extra" string in lesskey file to append to a multi-char command
+ (like a search pattern), without executing the command.
+
+* Ignore -u/-U setting while viewing help file, so that
+ underline and bold chars are displayed correctly.
+
+* Improve detection of "binary" files in UTF-8 mode.
+
+* Fix bug with ++ commands.
+
+* Fix bug where prompt was sometimes not displayed with +G.
+
+* Fix possible memory corruption
+
+* Fix bugs and improve performance in ampersand filtering.
+
+* Automate construction of Unicode tables from Unicode database.
+
+* Allow %% escape sequence in LESSOPEN variable.
======================================================================
diff --git a/contrib/less/README b/contrib/less/README
index 807749a..1088431 100644
--- a/contrib/less/README
+++ b/contrib/less/README
@@ -7,9 +7,9 @@
**************************************************************************
**************************************************************************
- Less, version 458
+ Less, version 481
- This is the distribution of less, version 458, released 04 Apr 2013.
+ This is the distribution of less, version 481, released 31 Aug 2015.
This program is part of the GNU project (http://www.gnu.org).
This program is free software. You may redistribute it and/or
@@ -53,8 +53,9 @@ INSTALLATION (Unix systems only):
Specifies the regular expression library used by less for pattern
matching. The default is "auto", which means the configure program
finds a regular expression library automatically. Other values are:
- posix Use the POSIX-compatible regcomp.
+ gnu Use the GNU regex library.
pcre Use the PCRE library.
+ posix Use the POSIX-compatible regcomp.
regcmp Use the regcmp library.
re_comp Use the re_comp library.
regcomp Use the V8-compatible regcomp.
diff --git a/contrib/less/brac.c b/contrib/less/brac.c
index 70a7771..10a0843 100644
--- a/contrib/less/brac.c
+++ b/contrib/less/brac.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 1984-2012 Mark Nudelman
+ * Copyright (C) 1984-2015 Mark Nudelman
*
* You may distribute under the terms of either the GNU General Public
* License or the Less License, as specified in the README file.
diff --git a/contrib/less/ch.c b/contrib/less/ch.c
index 2e2ded7..da729c5 100644
--- a/contrib/less/ch.c
+++ b/contrib/less/ch.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 1984-2012 Mark Nudelman
+ * Copyright (C) 1984-2015 Mark Nudelman
*
* You may distribute under the terms of either the GNU General Public
* License or the Less License, as specified in the README file.
@@ -54,7 +54,7 @@ struct buf {
* The file state is maintained in a filestate structure.
* A pointer to the filestate is kept in the ifile structure.
*/
-#define BUFHASH_SIZE 64
+#define BUFHASH_SIZE 1024
struct filestate {
struct bufnode buflist;
struct bufnode hashtbl[BUFHASH_SIZE];
@@ -323,13 +323,16 @@ ch_get()
#if HAVE_STAT_INO
if (follow_mode == FOLLOW_NAME)
{
- /* See whether the file's i-number has changed.
+ /* See whether the file's i-number has changed,
+ * or the file has shrunk.
* If so, force the file to be closed and
* reopened. */
struct stat st;
+ POSITION curr_pos = ch_tell();
int r = stat(get_filename(curr_ifile), &st);
if (r == 0 && (st.st_ino != curr_ino ||
- st.st_dev != curr_dev))
+ st.st_dev != curr_dev ||
+ (curr_pos != NULL_POSITION && st.st_size < curr_pos)))
{
/* screen_trashed=2 causes
* make_display to reopen the file. */
@@ -536,6 +539,32 @@ ch_end_seek()
}
/*
+ * Seek to the last position in the file that is currently buffered.
+ */
+ public int
+ch_end_buffer_seek()
+{
+ register struct buf *bp;
+ register struct bufnode *bn;
+ POSITION buf_pos;
+ POSITION end_pos;
+
+ if (thisfile == NULL || (ch_flags & CH_CANSEEK))
+ return (ch_end_seek());
+
+ end_pos = 0;
+ FOR_BUFS(bn)
+ {
+ bp = bufnode_buf(bn);
+ buf_pos = (bp->block * LBUFSIZE) + bp->datasize;
+ if (buf_pos > end_pos)
+ end_pos = buf_pos;
+ }
+
+ return (ch_seek(end_pos));
+}
+
+/*
* Seek to the beginning of the file, or as close to it as we can get.
* We may not be able to seek there if input is a pipe and the
* beginning of the pipe is no longer buffered.
diff --git a/contrib/less/charset.c b/contrib/less/charset.c
index 03b38e0..4c62664 100644
--- a/contrib/less/charset.c
+++ b/contrib/less/charset.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 1984-2012 Mark Nudelman
+ * Copyright (C) 1984-2015 Mark Nudelman
*
* You may distribute under the terms of either the GNU General Public
* License or the Less License, as specified in the README file.
@@ -466,36 +466,15 @@ prutfchar(ch)
else
SNPRINTF1(buf, sizeof(buf), binfmt, (char) ch);
} else if (is_ubin_char(ch))
+ {
SNPRINTF1(buf, sizeof(buf), utfbinfmt, ch);
- else
+ } else
{
- int len;
+ char *p = buf;
if (ch >= 0x80000000)
- {
- len = 3;
- ch = 0xFFFD;
- } else
- {
- len = (ch < 0x80) ? 1
- : (ch < 0x800) ? 2
- : (ch < 0x10000) ? 3
- : (ch < 0x200000) ? 4
- : (ch < 0x4000000) ? 5
- : 6;
- }
- buf[len] = '\0';
- if (len == 1)
- *buf = (char) ch;
- else
- {
- *buf = ((1 << len) - 1) << (8 - len);
- while (--len > 0)
- {
- buf[len] = (char) (0x80 | (ch & 0x3F));
- ch >>= 6;
- }
- *buf |= ch;
- }
+ ch = 0xFFFD; /* REPLACEMENT CHARACTER */
+ put_wchar(&p, ch);
+ *p = '\0';
}
return (buf);
}
@@ -524,11 +503,12 @@ utf_len(ch)
}
/*
- * Is a UTF-8 character well-formed?
+ * Does the parameter point to the lead byte of a well-formed UTF-8 character?
*/
public int
-is_utf8_well_formed(s)
+is_utf8_well_formed(s, slen)
unsigned char *s;
+ int slen;
{
int i;
int len;
@@ -537,6 +517,8 @@ is_utf8_well_formed(s)
return (0);
len = utf_len((char) s[0]);
+ if (len > slen)
+ return (0);
if (len == 1)
return (1);
if (len == 2)
@@ -558,6 +540,35 @@ is_utf8_well_formed(s)
}
/*
+ * Return number of invalid UTF-8 sequences found in a buffer.
+ */
+ public int
+utf_bin_count(data, len)
+ unsigned char *data;
+ int len;
+{
+ int bin_count = 0;
+ while (len > 0)
+ {
+ if (is_utf8_well_formed(data, len))
+ {
+ int clen = utf_len(*data);
+ data += clen;
+ len -= clen;
+ } else
+ {
+ /* Skip to next lead byte. */
+ bin_count++;
+ do {
+ ++data;
+ --len;
+ } while (len > 0 && !IS_UTF8_LEAD(*data));
+ }
+ }
+ return (bin_count);
+}
+
+/*
* Get the value of a UTF-8 character.
*/
public LWCHAR
@@ -706,411 +717,51 @@ step_char(pp, dir, limit)
/*
* Unicode characters data
+ * Actual data is in the generated *.uni files.
*/
-struct wchar_range { LWCHAR first, last; };
-/*
- * Characters with general category values
- * Mn: Mark, Nonspacing
- * Me: Mark, Enclosing
- * Last synched with
- * <http://www.unicode.org/Public/5.0.0/ucd/UnicodeData-5.0.0d7.txt>
- * dated 2005-11-30T00:58:48Z
- */
-static struct wchar_range comp_table[] = {
- { 0x0300, 0x036F} /* Mn */, { 0x0483, 0x0486} /* Mn */,
- { 0x0488, 0x0489} /* Me */,
- { 0x0591, 0x05BD} /* Mn */, { 0x05BF, 0x05BF} /* Mn */,
- { 0x05C1, 0x05C2} /* Mn */, { 0x05C4, 0x05C5} /* Mn */,
- { 0x05C7, 0x05C7} /* Mn */, { 0x0610, 0x0615} /* Mn */,
- { 0x064B, 0x065E} /* Mn */, { 0x0670, 0x0670} /* Mn */,
- { 0x06D6, 0x06DC} /* Mn */,
- { 0x06DE, 0x06DE} /* Me */,
- { 0x06DF, 0x06E4} /* Mn */, { 0x06E7, 0x06E8} /* Mn */,
- { 0x06EA, 0x06ED} /* Mn */, { 0x0711, 0x0711} /* Mn */,
- { 0x0730, 0x074A} /* Mn */, { 0x07A6, 0x07B0} /* Mn */,
- { 0x07EB, 0x07F3} /* Mn */, { 0x0901, 0x0902} /* Mn */,
- { 0x093C, 0x093C} /* Mn */, { 0x0941, 0x0948} /* Mn */,
- { 0x094D, 0x094D} /* Mn */, { 0x0951, 0x0954} /* Mn */,
- { 0x0962, 0x0963} /* Mn */, { 0x0981, 0x0981} /* Mn */,
- { 0x09BC, 0x09BC} /* Mn */, { 0x09C1, 0x09C4} /* Mn */,
- { 0x09CD, 0x09CD} /* Mn */, { 0x09E2, 0x09E3} /* Mn */,
- { 0x0A01, 0x0A02} /* Mn */, { 0x0A3C, 0x0A3C} /* Mn */,
- { 0x0A41, 0x0A42} /* Mn */, { 0x0A47, 0x0A48} /* Mn */,
- { 0x0A4B, 0x0A4D} /* Mn */, { 0x0A70, 0x0A71} /* Mn */,
- { 0x0A81, 0x0A82} /* Mn */, { 0x0ABC, 0x0ABC} /* Mn */,
- { 0x0AC1, 0x0AC5} /* Mn */, { 0x0AC7, 0x0AC8} /* Mn */,
- { 0x0ACD, 0x0ACD} /* Mn */, { 0x0AE2, 0x0AE3} /* Mn */,
- { 0x0B01, 0x0B01} /* Mn */, { 0x0B3C, 0x0B3C} /* Mn */,
- { 0x0B3F, 0x0B3F} /* Mn */, { 0x0B41, 0x0B43} /* Mn */,
- { 0x0B4D, 0x0B4D} /* Mn */, { 0x0B56, 0x0B56} /* Mn */,
- { 0x0B82, 0x0B82} /* Mn */, { 0x0BC0, 0x0BC0} /* Mn */,
- { 0x0BCD, 0x0BCD} /* Mn */, { 0x0C3E, 0x0C40} /* Mn */,
- { 0x0C46, 0x0C48} /* Mn */, { 0x0C4A, 0x0C4D} /* Mn */,
- { 0x0C55, 0x0C56} /* Mn */, { 0x0CBC, 0x0CBC} /* Mn */,
- { 0x0CBF, 0x0CBF} /* Mn */, { 0x0CC6, 0x0CC6} /* Mn */,
- { 0x0CCC, 0x0CCD} /* Mn */, { 0x0CE2, 0x0CE3} /* Mn */,
- { 0x0D41, 0x0D43} /* Mn */, { 0x0D4D, 0x0D4D} /* Mn */,
- { 0x0DCA, 0x0DCA} /* Mn */, { 0x0DD2, 0x0DD4} /* Mn */,
- { 0x0DD6, 0x0DD6} /* Mn */, { 0x0E31, 0x0E31} /* Mn */,
- { 0x0E34, 0x0E3A} /* Mn */, { 0x0E47, 0x0E4E} /* Mn */,
- { 0x0EB1, 0x0EB1} /* Mn */, { 0x0EB4, 0x0EB9} /* Mn */,
- { 0x0EBB, 0x0EBC} /* Mn */, { 0x0EC8, 0x0ECD} /* Mn */,
- { 0x0F18, 0x0F19} /* Mn */, { 0x0F35, 0x0F35} /* Mn */,
- { 0x0F37, 0x0F37} /* Mn */, { 0x0F39, 0x0F39} /* Mn */,
- { 0x0F71, 0x0F7E} /* Mn */, { 0x0F80, 0x0F84} /* Mn */,
- { 0x0F86, 0x0F87} /* Mn */, { 0x0F90, 0x0F97} /* Mn */,
- { 0x0F99, 0x0FBC} /* Mn */, { 0x0FC6, 0x0FC6} /* Mn */,
- { 0x102D, 0x1030} /* Mn */, { 0x1032, 0x1032} /* Mn */,
- { 0x1036, 0x1037} /* Mn */, { 0x1039, 0x1039} /* Mn */,
- { 0x1058, 0x1059} /* Mn */, { 0x135F, 0x135F} /* Mn */,
- { 0x1712, 0x1714} /* Mn */, { 0x1732, 0x1734} /* Mn */,
- { 0x1752, 0x1753} /* Mn */, { 0x1772, 0x1773} /* Mn */,
- { 0x17B7, 0x17BD} /* Mn */, { 0x17C6, 0x17C6} /* Mn */,
- { 0x17C9, 0x17D3} /* Mn */, { 0x17DD, 0x17DD} /* Mn */,
- { 0x180B, 0x180D} /* Mn */, { 0x18A9, 0x18A9} /* Mn */,
- { 0x1920, 0x1922} /* Mn */, { 0x1927, 0x1928} /* Mn */,
- { 0x1932, 0x1932} /* Mn */, { 0x1939, 0x193B} /* Mn */,
- { 0x1A17, 0x1A18} /* Mn */, { 0x1B00, 0x1B03} /* Mn */,
- { 0x1B34, 0x1B34} /* Mn */, { 0x1B36, 0x1B3A} /* Mn */,
- { 0x1B3C, 0x1B3C} /* Mn */, { 0x1B42, 0x1B42} /* Mn */,
- { 0x1B6B, 0x1B73} /* Mn */, { 0x1DC0, 0x1DCA} /* Mn */,
- { 0x1DFE, 0x1DFF} /* Mn */, { 0x20D0, 0x20DC} /* Mn */,
- { 0x20DD, 0x20E0} /* Me */,
- { 0x20E1, 0x20E1} /* Mn */,
- { 0x20E2, 0x20E4} /* Me */,
- { 0x20E5, 0x20EF} /* Mn */, { 0x302A, 0x302F} /* Mn */,
- { 0x3099, 0x309A} /* Mn */, { 0xA806, 0xA806} /* Mn */,
- { 0xA80B, 0xA80B} /* Mn */, { 0xA825, 0xA826} /* Mn */,
- { 0xFB1E, 0xFB1E} /* Mn */, { 0xFE00, 0xFE0F} /* Mn */,
- { 0xFE20, 0xFE23} /* Mn */, { 0x10A01, 0x10A03} /* Mn */,
- { 0x10A05, 0x10A06} /* Mn */, { 0x10A0C, 0x10A0F} /* Mn */,
- { 0x10A38, 0x10A3A} /* Mn */, { 0x10A3F, 0x10A3F} /* Mn */,
- { 0x1D167, 0x1D169} /* Mn */, { 0x1D17B, 0x1D182} /* Mn */,
- { 0x1D185, 0x1D18B} /* Mn */, { 0x1D1AA, 0x1D1AD} /* Mn */,
- { 0x1D242, 0x1D244} /* Mn */, { 0xE0100, 0xE01EF} /* Mn */,
-};
+#define DECLARE_RANGE_TABLE_START(name) \
+ static struct wchar_range name##_array[] = {
+#define DECLARE_RANGE_TABLE_END(name) \
+ }; struct wchar_range_table name##_table = { name##_array, sizeof(name##_array)/sizeof(*name##_array) };
-/*
- * Special pairs, not ranges.
- */
+DECLARE_RANGE_TABLE_START(compose)
+#include "compose.uni"
+DECLARE_RANGE_TABLE_END(compose)
+
+DECLARE_RANGE_TABLE_START(ubin)
+#include "ubin.uni"
+DECLARE_RANGE_TABLE_END(ubin)
+
+DECLARE_RANGE_TABLE_START(wide)
+#include "wide.uni"
+DECLARE_RANGE_TABLE_END(wide)
+
+/* comb_table is special pairs, not ranges. */
static struct wchar_range comb_table[] = {
{0x0644,0x0622}, {0x0644,0x0623}, {0x0644,0x0625}, {0x0644,0x0627},
};
-/*
- * Characters with general category values
- * Cc: Other, Control
- * Cf: Other, Format
- * Cs: Other, Surrogate
- * Co: Other, Private Use
- * Cn: Other, Not Assigned
- * Zl: Separator, Line
- * Zp: Separator, Paragraph
- * Last synched with
- * <http://www.unicode.org/Public/5.0.0/ucd/UnicodeData-5.0.0d7.txt>
- * dated 2005-11-30T00:58:48Z
- */
-static struct wchar_range ubin_table[] = {
- { 0x0000, 0x0007} /* Cc */,
- { 0x000B, 0x000C} /* Cc */,
- { 0x000E, 0x001A} /* Cc */,
- { 0x001C, 0x001F} /* Cc */,
- { 0x007F, 0x009F} /* Cc */,
-#if 0
- { 0x00AD, 0x00AD} /* Cf */,
-#endif
- { 0x0370, 0x0373} /* Cn */, { 0x0376, 0x0379} /* Cn */,
- { 0x037F, 0x0383} /* Cn */, { 0x038B, 0x038B} /* Cn */,
- { 0x038D, 0x038D} /* Cn */, { 0x03A2, 0x03A2} /* Cn */,
- { 0x03CF, 0x03CF} /* Cn */, { 0x0487, 0x0487} /* Cn */,
- { 0x0514, 0x0530} /* Cn */, { 0x0557, 0x0558} /* Cn */,
- { 0x0560, 0x0560} /* Cn */, { 0x0588, 0x0588} /* Cn */,
- { 0x058B, 0x0590} /* Cn */, { 0x05C8, 0x05CF} /* Cn */,
- { 0x05EB, 0x05EF} /* Cn */, { 0x05F5, 0x05FF} /* Cn */,
-#if 0
- { 0x0600, 0x0603} /* Cf */,
-#endif
- { 0x0604, 0x060A} /* Cn */, { 0x0616, 0x061A} /* Cn */,
- { 0x061C, 0x061D} /* Cn */, { 0x0620, 0x0620} /* Cn */,
- { 0x063B, 0x063F} /* Cn */, { 0x065F, 0x065F} /* Cn */,
-#if 0
- { 0x06DD, 0x06DD} /* Cf */,
-#endif
- { 0x070E, 0x070E} /* Cn */,
-#if 0
- { 0x070F, 0x070F} /* Cf */,
-#endif
- { 0x074B, 0x074C} /* Cn */, { 0x076E, 0x077F} /* Cn */,
- { 0x07B2, 0x07BF} /* Cn */, { 0x07FB, 0x0900} /* Cn */,
- { 0x093A, 0x093B} /* Cn */, { 0x094E, 0x094F} /* Cn */,
- { 0x0955, 0x0957} /* Cn */, { 0x0971, 0x097A} /* Cn */,
- { 0x0980, 0x0980} /* Cn */, { 0x0984, 0x0984} /* Cn */,
- { 0x098D, 0x098E} /* Cn */, { 0x0991, 0x0992} /* Cn */,
- { 0x09A9, 0x09A9} /* Cn */, { 0x09B1, 0x09B1} /* Cn */,
- { 0x09B3, 0x09B5} /* Cn */, { 0x09BA, 0x09BB} /* Cn */,
- { 0x09C5, 0x09C6} /* Cn */, { 0x09C9, 0x09CA} /* Cn */,
- { 0x09CF, 0x09D6} /* Cn */, { 0x09D8, 0x09DB} /* Cn */,
- { 0x09DE, 0x09DE} /* Cn */, { 0x09E4, 0x09E5} /* Cn */,
- { 0x09FB, 0x0A00} /* Cn */, { 0x0A04, 0x0A04} /* Cn */,
- { 0x0A0B, 0x0A0E} /* Cn */, { 0x0A11, 0x0A12} /* Cn */,
- { 0x0A29, 0x0A29} /* Cn */, { 0x0A31, 0x0A31} /* Cn */,
- { 0x0A34, 0x0A34} /* Cn */, { 0x0A37, 0x0A37} /* Cn */,
- { 0x0A3A, 0x0A3B} /* Cn */, { 0x0A3D, 0x0A3D} /* Cn */,
- { 0x0A43, 0x0A46} /* Cn */, { 0x0A49, 0x0A4A} /* Cn */,
- { 0x0A4E, 0x0A58} /* Cn */, { 0x0A5D, 0x0A5D} /* Cn */,
- { 0x0A5F, 0x0A65} /* Cn */, { 0x0A75, 0x0A80} /* Cn */,
- { 0x0A84, 0x0A84} /* Cn */, { 0x0A8E, 0x0A8E} /* Cn */,
- { 0x0A92, 0x0A92} /* Cn */, { 0x0AA9, 0x0AA9} /* Cn */,
- { 0x0AB1, 0x0AB1} /* Cn */, { 0x0AB4, 0x0AB4} /* Cn */,
- { 0x0ABA, 0x0ABB} /* Cn */, { 0x0AC6, 0x0AC6} /* Cn */,
- { 0x0ACA, 0x0ACA} /* Cn */, { 0x0ACE, 0x0ACF} /* Cn */,
- { 0x0AD1, 0x0ADF} /* Cn */, { 0x0AE4, 0x0AE5} /* Cn */,
- { 0x0AF0, 0x0AF0} /* Cn */, { 0x0AF2, 0x0B00} /* Cn */,
- { 0x0B04, 0x0B04} /* Cn */, { 0x0B0D, 0x0B0E} /* Cn */,
- { 0x0B11, 0x0B12} /* Cn */, { 0x0B29, 0x0B29} /* Cn */,
- { 0x0B31, 0x0B31} /* Cn */, { 0x0B34, 0x0B34} /* Cn */,
- { 0x0B3A, 0x0B3B} /* Cn */, { 0x0B44, 0x0B46} /* Cn */,
- { 0x0B49, 0x0B4A} /* Cn */, { 0x0B4E, 0x0B55} /* Cn */,
- { 0x0B58, 0x0B5B} /* Cn */, { 0x0B5E, 0x0B5E} /* Cn */,
- { 0x0B62, 0x0B65} /* Cn */, { 0x0B72, 0x0B81} /* Cn */,
- { 0x0B84, 0x0B84} /* Cn */, { 0x0B8B, 0x0B8D} /* Cn */,
- { 0x0B91, 0x0B91} /* Cn */, { 0x0B96, 0x0B98} /* Cn */,
- { 0x0B9B, 0x0B9B} /* Cn */, { 0x0B9D, 0x0B9D} /* Cn */,
- { 0x0BA0, 0x0BA2} /* Cn */, { 0x0BA5, 0x0BA7} /* Cn */,
- { 0x0BAB, 0x0BAD} /* Cn */, { 0x0BBA, 0x0BBD} /* Cn */,
- { 0x0BC3, 0x0BC5} /* Cn */, { 0x0BC9, 0x0BC9} /* Cn */,
- { 0x0BCE, 0x0BD6} /* Cn */, { 0x0BD8, 0x0BE5} /* Cn */,
- { 0x0BFB, 0x0C00} /* Cn */, { 0x0C04, 0x0C04} /* Cn */,
- { 0x0C0D, 0x0C0D} /* Cn */, { 0x0C11, 0x0C11} /* Cn */,
- { 0x0C29, 0x0C29} /* Cn */, { 0x0C34, 0x0C34} /* Cn */,
- { 0x0C3A, 0x0C3D} /* Cn */, { 0x0C45, 0x0C45} /* Cn */,
- { 0x0C49, 0x0C49} /* Cn */, { 0x0C4E, 0x0C54} /* Cn */,
- { 0x0C57, 0x0C5F} /* Cn */, { 0x0C62, 0x0C65} /* Cn */,
- { 0x0C70, 0x0C81} /* Cn */, { 0x0C84, 0x0C84} /* Cn */,
- { 0x0C8D, 0x0C8D} /* Cn */, { 0x0C91, 0x0C91} /* Cn */,
- { 0x0CA9, 0x0CA9} /* Cn */, { 0x0CB4, 0x0CB4} /* Cn */,
- { 0x0CBA, 0x0CBB} /* Cn */, { 0x0CC5, 0x0CC5} /* Cn */,
- { 0x0CC9, 0x0CC9} /* Cn */, { 0x0CCE, 0x0CD4} /* Cn */,
- { 0x0CD7, 0x0CDD} /* Cn */, { 0x0CDF, 0x0CDF} /* Cn */,
- { 0x0CE4, 0x0CE5} /* Cn */, { 0x0CF0, 0x0CF0} /* Cn */,
- { 0x0CF3, 0x0D01} /* Cn */, { 0x0D04, 0x0D04} /* Cn */,
- { 0x0D0D, 0x0D0D} /* Cn */, { 0x0D11, 0x0D11} /* Cn */,
- { 0x0D29, 0x0D29} /* Cn */, { 0x0D3A, 0x0D3D} /* Cn */,
- { 0x0D44, 0x0D45} /* Cn */, { 0x0D49, 0x0D49} /* Cn */,
- { 0x0D4E, 0x0D56} /* Cn */, { 0x0D58, 0x0D5F} /* Cn */,
- { 0x0D62, 0x0D65} /* Cn */, { 0x0D70, 0x0D81} /* Cn */,
- { 0x0D84, 0x0D84} /* Cn */, { 0x0D97, 0x0D99} /* Cn */,
- { 0x0DB2, 0x0DB2} /* Cn */, { 0x0DBC, 0x0DBC} /* Cn */,
- { 0x0DBE, 0x0DBF} /* Cn */, { 0x0DC7, 0x0DC9} /* Cn */,
- { 0x0DCB, 0x0DCE} /* Cn */, { 0x0DD5, 0x0DD5} /* Cn */,
- { 0x0DD7, 0x0DD7} /* Cn */, { 0x0DE0, 0x0DF1} /* Cn */,
- { 0x0DF5, 0x0E00} /* Cn */, { 0x0E3B, 0x0E3E} /* Cn */,
- { 0x0E5C, 0x0E80} /* Cn */, { 0x0E83, 0x0E83} /* Cn */,
- { 0x0E85, 0x0E86} /* Cn */, { 0x0E89, 0x0E89} /* Cn */,
- { 0x0E8B, 0x0E8C} /* Cn */, { 0x0E8E, 0x0E93} /* Cn */,
- { 0x0E98, 0x0E98} /* Cn */, { 0x0EA0, 0x0EA0} /* Cn */,
- { 0x0EA4, 0x0EA4} /* Cn */, { 0x0EA6, 0x0EA6} /* Cn */,
- { 0x0EA8, 0x0EA9} /* Cn */, { 0x0EAC, 0x0EAC} /* Cn */,
- { 0x0EBA, 0x0EBA} /* Cn */, { 0x0EBE, 0x0EBF} /* Cn */,
- { 0x0EC5, 0x0EC5} /* Cn */, { 0x0EC7, 0x0EC7} /* Cn */,
- { 0x0ECE, 0x0ECF} /* Cn */, { 0x0EDA, 0x0EDB} /* Cn */,
- { 0x0EDE, 0x0EFF} /* Cn */, { 0x0F48, 0x0F48} /* Cn */,
- { 0x0F6B, 0x0F70} /* Cn */, { 0x0F8C, 0x0F8F} /* Cn */,
- { 0x0F98, 0x0F98} /* Cn */, { 0x0FBD, 0x0FBD} /* Cn */,
- { 0x0FCD, 0x0FCE} /* Cn */, { 0x0FD2, 0x0FFF} /* Cn */,
- { 0x1022, 0x1022} /* Cn */, { 0x1028, 0x1028} /* Cn */,
- { 0x102B, 0x102B} /* Cn */, { 0x1033, 0x1035} /* Cn */,
- { 0x103A, 0x103F} /* Cn */, { 0x105A, 0x109F} /* Cn */,
- { 0x10C6, 0x10CF} /* Cn */, { 0x10FD, 0x10FF} /* Cn */,
- { 0x115A, 0x115E} /* Cn */, { 0x11A3, 0x11A7} /* Cn */,
- { 0x11FA, 0x11FF} /* Cn */, { 0x1249, 0x1249} /* Cn */,
- { 0x124E, 0x124F} /* Cn */, { 0x1257, 0x1257} /* Cn */,
- { 0x1259, 0x1259} /* Cn */, { 0x125E, 0x125F} /* Cn */,
- { 0x1289, 0x1289} /* Cn */, { 0x128E, 0x128F} /* Cn */,
- { 0x12B1, 0x12B1} /* Cn */, { 0x12B6, 0x12B7} /* Cn */,
- { 0x12BF, 0x12BF} /* Cn */, { 0x12C1, 0x12C1} /* Cn */,
- { 0x12C6, 0x12C7} /* Cn */, { 0x12D7, 0x12D7} /* Cn */,
- { 0x1311, 0x1311} /* Cn */, { 0x1316, 0x1317} /* Cn */,
- { 0x135B, 0x135E} /* Cn */, { 0x137D, 0x137F} /* Cn */,
- { 0x139A, 0x139F} /* Cn */, { 0x13F5, 0x1400} /* Cn */,
- { 0x1677, 0x167F} /* Cn */, { 0x169D, 0x169F} /* Cn */,
- { 0x16F1, 0x16FF} /* Cn */, { 0x170D, 0x170D} /* Cn */,
- { 0x1715, 0x171F} /* Cn */, { 0x1737, 0x173F} /* Cn */,
- { 0x1754, 0x175F} /* Cn */, { 0x176D, 0x176D} /* Cn */,
- { 0x1771, 0x1771} /* Cn */, { 0x1774, 0x177F} /* Cn */,
-#if 0
- { 0x17B4, 0x17B5} /* Cf */,
-#endif
- { 0x17DE, 0x17DF} /* Cn */, { 0x17EA, 0x17EF} /* Cn */,
- { 0x17FA, 0x17FF} /* Cn */, { 0x180F, 0x180F} /* Cn */,
- { 0x181A, 0x181F} /* Cn */, { 0x1878, 0x187F} /* Cn */,
- { 0x18AA, 0x18FF} /* Cn */, { 0x191D, 0x191F} /* Cn */,
- { 0x192C, 0x192F} /* Cn */, { 0x193C, 0x193F} /* Cn */,
- { 0x1941, 0x1943} /* Cn */, { 0x196E, 0x196F} /* Cn */,
- { 0x1975, 0x197F} /* Cn */, { 0x19AA, 0x19AF} /* Cn */,
- { 0x19CA, 0x19CF} /* Cn */, { 0x19DA, 0x19DD} /* Cn */,
- { 0x1A1C, 0x1A1D} /* Cn */, { 0x1A20, 0x1AFF} /* Cn */,
- { 0x1B4C, 0x1B4F} /* Cn */, { 0x1B7D, 0x1CFF} /* Cn */,
- { 0x1DCB, 0x1DFD} /* Cn */, { 0x1E9C, 0x1E9F} /* Cn */,
- { 0x1EFA, 0x1EFF} /* Cn */, { 0x1F16, 0x1F17} /* Cn */,
- { 0x1F1E, 0x1F1F} /* Cn */, { 0x1F46, 0x1F47} /* Cn */,
- { 0x1F4E, 0x1F4F} /* Cn */, { 0x1F58, 0x1F58} /* Cn */,
- { 0x1F5A, 0x1F5A} /* Cn */, { 0x1F5C, 0x1F5C} /* Cn */,
- { 0x1F5E, 0x1F5E} /* Cn */, { 0x1F7E, 0x1F7F} /* Cn */,
- { 0x1FB5, 0x1FB5} /* Cn */, { 0x1FC5, 0x1FC5} /* Cn */,
- { 0x1FD4, 0x1FD5} /* Cn */, { 0x1FDC, 0x1FDC} /* Cn */,
- { 0x1FF0, 0x1FF1} /* Cn */, { 0x1FF5, 0x1FF5} /* Cn */,
- { 0x1FFF, 0x1FFF} /* Cn */,
- { 0x200B, 0x200F} /* Cf */,
- { 0x2028, 0x2028} /* Zl */,
- { 0x2029, 0x2029} /* Zp */,
- { 0x202A, 0x202E} /* Cf */,
- { 0x2060, 0x2063} /* Cf */,
- { 0x2064, 0x2069} /* Cn */,
- { 0x206A, 0x206F} /* Cf */,
- { 0x2072, 0x2073} /* Cn */, { 0x208F, 0x208F} /* Cn */,
- { 0x2095, 0x209F} /* Cn */, { 0x20B6, 0x20CF} /* Cn */,
- { 0x20F0, 0x20FF} /* Cn */, { 0x214F, 0x2152} /* Cn */,
- { 0x2185, 0x218F} /* Cn */, { 0x23E8, 0x23FF} /* Cn */,
- { 0x2427, 0x243F} /* Cn */, { 0x244B, 0x245F} /* Cn */,
- { 0x269D, 0x269F} /* Cn */, { 0x26B3, 0x2700} /* Cn */,
- { 0x2705, 0x2705} /* Cn */, { 0x270A, 0x270B} /* Cn */,
- { 0x2728, 0x2728} /* Cn */, { 0x274C, 0x274C} /* Cn */,
- { 0x274E, 0x274E} /* Cn */, { 0x2753, 0x2755} /* Cn */,
- { 0x2757, 0x2757} /* Cn */, { 0x275F, 0x2760} /* Cn */,
- { 0x2795, 0x2797} /* Cn */, { 0x27B0, 0x27B0} /* Cn */,
- { 0x27BF, 0x27BF} /* Cn */, { 0x27CB, 0x27CF} /* Cn */,
- { 0x27EC, 0x27EF} /* Cn */, { 0x2B1B, 0x2B1F} /* Cn */,
- { 0x2B24, 0x2BFF} /* Cn */, { 0x2C2F, 0x2C2F} /* Cn */,
- { 0x2C5F, 0x2C5F} /* Cn */, { 0x2C6D, 0x2C73} /* Cn */,
- { 0x2C78, 0x2C7F} /* Cn */, { 0x2CEB, 0x2CF8} /* Cn */,
- { 0x2D26, 0x2D2F} /* Cn */, { 0x2D66, 0x2D6E} /* Cn */,
- { 0x2D70, 0x2D7F} /* Cn */, { 0x2D97, 0x2D9F} /* Cn */,
- { 0x2DA7, 0x2DA7} /* Cn */, { 0x2DAF, 0x2DAF} /* Cn */,
- { 0x2DB7, 0x2DB7} /* Cn */, { 0x2DBF, 0x2DBF} /* Cn */,
- { 0x2DC7, 0x2DC7} /* Cn */, { 0x2DCF, 0x2DCF} /* Cn */,
- { 0x2DD7, 0x2DD7} /* Cn */, { 0x2DDF, 0x2DFF} /* Cn */,
- { 0x2E18, 0x2E1B} /* Cn */, { 0x2E1E, 0x2E7F} /* Cn */,
- { 0x2E9A, 0x2E9A} /* Cn */, { 0x2EF4, 0x2EFF} /* Cn */,
- { 0x2FD6, 0x2FEF} /* Cn */, { 0x2FFC, 0x2FFF} /* Cn */,
- { 0x3040, 0x3040} /* Cn */, { 0x3097, 0x3098} /* Cn */,
- { 0x3100, 0x3104} /* Cn */, { 0x312D, 0x3130} /* Cn */,
- { 0x318F, 0x318F} /* Cn */, { 0x31B8, 0x31BF} /* Cn */,
- { 0x31D0, 0x31EF} /* Cn */, { 0x321F, 0x321F} /* Cn */,
- { 0x3244, 0x324F} /* Cn */, { 0x32FF, 0x32FF} /* Cn */,
- { 0x4DB6, 0x4DBF} /* Cn */, { 0x9FBC, 0x9FFF} /* Cn */,
- { 0xA48D, 0xA48F} /* Cn */, { 0xA4C7, 0xA6FF} /* Cn */,
- { 0xA71B, 0xA71F} /* Cn */, { 0xA722, 0xA7FF} /* Cn */,
- { 0xA82C, 0xA83F} /* Cn */, { 0xA878, 0xABFF} /* Cn */,
- { 0xD7A4, 0xD7FF} /* Cn */,
- { 0xD800, 0xDFFF} /* Cs */,
- { 0xE000, 0xF8FF} /* Co */,
- { 0xFA2E, 0xFA2F} /* Cn */, { 0xFA6B, 0xFA6F} /* Cn */,
- { 0xFADA, 0xFAFF} /* Cn */, { 0xFB07, 0xFB12} /* Cn */,
- { 0xFB18, 0xFB1C} /* Cn */, { 0xFB37, 0xFB37} /* Cn */,
- { 0xFB3D, 0xFB3D} /* Cn */, { 0xFB3F, 0xFB3F} /* Cn */,
- { 0xFB42, 0xFB42} /* Cn */, { 0xFB45, 0xFB45} /* Cn */,
- { 0xFBB2, 0xFBD2} /* Cn */, { 0xFD40, 0xFD4F} /* Cn */,
- { 0xFD90, 0xFD91} /* Cn */, { 0xFDC8, 0xFDEF} /* Cn */,
- { 0xFDFE, 0xFDFF} /* Cn */, { 0xFE1A, 0xFE1F} /* Cn */,
- { 0xFE24, 0xFE2F} /* Cn */, { 0xFE53, 0xFE53} /* Cn */,
- { 0xFE67, 0xFE67} /* Cn */, { 0xFE6C, 0xFE6F} /* Cn */,
- { 0xFE75, 0xFE75} /* Cn */, { 0xFEFD, 0xFEFE} /* Cn */,
- { 0xFEFF, 0xFEFF} /* Cf */,
- { 0xFF00, 0xFF00} /* Cn */, { 0xFFBF, 0xFFC1} /* Cn */,
- { 0xFFC8, 0xFFC9} /* Cn */, { 0xFFD0, 0xFFD1} /* Cn */,
- { 0xFFD8, 0xFFD9} /* Cn */, { 0xFFDD, 0xFFDF} /* Cn */,
- { 0xFFE7, 0xFFE7} /* Cn */, { 0xFFEF, 0xFFF8} /* Cn */,
- { 0xFFF9, 0xFFFB} /* Cf */,
- { 0xFFFE, 0xFFFF} /* Cn */, { 0x1000C, 0x1000C} /* Cn */,
- { 0x10027, 0x10027} /* Cn */, { 0x1003B, 0x1003B} /* Cn */,
- { 0x1003E, 0x1003E} /* Cn */, { 0x1004E, 0x1004F} /* Cn */,
- { 0x1005E, 0x1007F} /* Cn */, { 0x100FB, 0x100FF} /* Cn */,
- { 0x10103, 0x10106} /* Cn */, { 0x10134, 0x10136} /* Cn */,
- { 0x1018B, 0x102FF} /* Cn */, { 0x1031F, 0x1031F} /* Cn */,
- { 0x10324, 0x1032F} /* Cn */, { 0x1034B, 0x1037F} /* Cn */,
- { 0x1039E, 0x1039E} /* Cn */, { 0x103C4, 0x103C7} /* Cn */,
- { 0x103D6, 0x103FF} /* Cn */,
- { 0x1049E, 0x1049F} /* Cn */, { 0x104AA, 0x107FF} /* Cn */,
- { 0x10806, 0x10807} /* Cn */, { 0x10809, 0x10809} /* Cn */,
- { 0x10836, 0x10836} /* Cn */, { 0x10839, 0x1083B} /* Cn */,
- { 0x1083D, 0x1083E} /* Cn */, { 0x10840, 0x108FF} /* Cn */,
- { 0x1091A, 0x1091E} /* Cn */, { 0x10920, 0x109FF} /* Cn */,
- { 0x10A04, 0x10A04} /* Cn */, { 0x10A07, 0x10A0B} /* Cn */,
- { 0x10A14, 0x10A14} /* Cn */, { 0x10A18, 0x10A18} /* Cn */,
- { 0x10A34, 0x10A37} /* Cn */, { 0x10A3B, 0x10A3E} /* Cn */,
- { 0x10A48, 0x10A4F} /* Cn */, { 0x10A59, 0x11FFF} /* Cn */,
- { 0x1236F, 0x123FF} /* Cn */, { 0x12463, 0x1246F} /* Cn */,
- { 0x12474, 0x1CFFF} /* Cn */, { 0x1D0F6, 0x1D0FF} /* Cn */,
- { 0x1D127, 0x1D129} /* Cn */,
- { 0x1D173, 0x1D17A} /* Cf */,
- { 0x1D1DE, 0x1D1FF} /* Cn */, { 0x1D246, 0x1D2FF} /* Cn */,
- { 0x1D357, 0x1D35F} /* Cn */, { 0x1D372, 0x1D3FF} /* Cn */,
- { 0x1D455, 0x1D455} /* Cn */, { 0x1D49D, 0x1D49D} /* Cn */,
- { 0x1D4A0, 0x1D4A1} /* Cn */, { 0x1D4A3, 0x1D4A4} /* Cn */,
- { 0x1D4A7, 0x1D4A8} /* Cn */, { 0x1D4AD, 0x1D4AD} /* Cn */,
- { 0x1D4BA, 0x1D4BA} /* Cn */, { 0x1D4BC, 0x1D4BC} /* Cn */,
- { 0x1D4C4, 0x1D4C4} /* Cn */, { 0x1D506, 0x1D506} /* Cn */,
- { 0x1D50B, 0x1D50C} /* Cn */, { 0x1D515, 0x1D515} /* Cn */,
- { 0x1D51D, 0x1D51D} /* Cn */, { 0x1D53A, 0x1D53A} /* Cn */,
- { 0x1D53F, 0x1D53F} /* Cn */, { 0x1D545, 0x1D545} /* Cn */,
- { 0x1D547, 0x1D549} /* Cn */, { 0x1D551, 0x1D551} /* Cn */,
- { 0x1D6A6, 0x1D6A7} /* Cn */, { 0x1D7CC, 0x1D7CD} /* Cn */,
- { 0x1D800, 0x1FFFF} /* Cn */, { 0x2A6D7, 0x2F7FF} /* Cn */,
- { 0x2FA1E, 0xE0000} /* Cn */,
- { 0xE0001, 0xE0001} /* Cf */,
- { 0xE0002, 0xE001F} /* Cn */,
- { 0xE0020, 0xE007F} /* Cf */,
- { 0xE0080, 0xE00FF} /* Cn */, { 0xE01F0, 0xEFFFF} /* Cn */,
- { 0xF0000, 0xFFFFD} /* Co */,
- { 0xFFFFE, 0xFFFFF} /* Cn */,
- {0x100000,0x10FFFD} /* Co */,
- {0x10FFFE,0x10FFFF} /* Cn */,
- {0x110000,0x7FFFFFFF} /* ISO 10646?? */
-};
-
-/*
- * Double width characters
- * W: East Asian Wide
- * F: East Asian Full-width
- * Unassigned code points may be included when they allow ranges to be merged.
- * Last synched with
- * <http://www.unicode.org/Public/5.0.0/ucd/EastAsianWidth-5.0.0d2.txt>
- * dated 2005-11-08T01:32:56Z
- */
-static struct wchar_range wide_table[] = {
- { 0x1100, 0x115F} /* W */, { 0x2329, 0x232A} /* W */,
- { 0x2E80, 0x2FFB} /* W */,
- { 0x3000, 0x3000} /* F */,
- { 0x3001, 0x303E} /* W */, { 0x3041, 0x4DB5} /* W */,
- { 0x4E00, 0x9FBB} /* W */, { 0xA000, 0xA4C6} /* W */,
- { 0xAC00, 0xD7A3} /* W */, { 0xF900, 0xFAD9} /* W */,
- { 0xFE10, 0xFE19} /* W */, { 0xFE30, 0xFE6B} /* W */,
- { 0xFF01, 0xFF60} /* F */, { 0xFFE0, 0xFFE6} /* F */,
- { 0x20000, 0x2FFFD} /* W */, { 0x30000, 0x3FFFD} /* W */,
-};
static int
-is_in_table(ch, table, tsize)
+is_in_table(ch, table)
LWCHAR ch;
- struct wchar_range table[];
- int tsize;
+ struct wchar_range_table *table;
{
int hi;
int lo;
/* Binary search in the table. */
- if (ch < table[0].first)
+ if (ch < table->table[0].first)
return 0;
lo = 0;
- hi = tsize - 1;
+ hi = table->count - 1;
while (lo <= hi)
{
int mid = (lo + hi) / 2;
- if (ch > table[mid].last)
+ if (ch > table->table[mid].last)
lo = mid + 1;
- else if (ch < table[mid].first)
+ else if (ch < table->table[mid].first)
hi = mid - 1;
else
return 1;
@@ -1126,7 +777,7 @@ is_in_table(ch, table, tsize)
is_composing_char(ch)
LWCHAR ch;
{
- return is_in_table(ch, comp_table, (sizeof(comp_table) / sizeof(*comp_table)));
+ return is_in_table(ch, &compose_table);
}
/*
@@ -1136,7 +787,7 @@ is_composing_char(ch)
is_ubin_char(ch)
LWCHAR ch;
{
- return is_in_table(ch, ubin_table, (sizeof(ubin_table) / sizeof(*ubin_table)));
+ return is_in_table(ch, &ubin_table);
}
/*
@@ -1146,7 +797,7 @@ is_ubin_char(ch)
is_wide_char(ch)
LWCHAR ch;
{
- return is_in_table(ch, wide_table, (sizeof(wide_table) / sizeof(*wide_table)));
+ return is_in_table(ch, &wide_table);
}
/*
diff --git a/contrib/less/charset.h b/contrib/less/charset.h
index 7df4df6..bb1e437 100644
--- a/contrib/less/charset.h
+++ b/contrib/less/charset.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 1984-2012 Mark Nudelman
+ * Copyright (C) 1984-2015 Mark Nudelman
*
* You may distribute under the terms of either the GNU General Public
* License or the Less License, as specified in the README file.
diff --git a/contrib/less/cmd.h b/contrib/less/cmd.h
index 9a72160..8a943d1 100644
--- a/contrib/less/cmd.h
+++ b/contrib/less/cmd.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 1984-2012 Mark Nudelman
+ * Copyright (C) 1984-2015 Mark Nudelman
*
* You may distribute under the terms of either the GNU General Public
* License or the Less License, as specified in the README file.
@@ -66,6 +66,7 @@
#define A_PREV_TAG 54
#define A_FILTER 55
#define A_F_UNTIL_HILITE 56
+#define A_GOEND_BUF 57
#define A_INVALID 100
#define A_NOACTION 101
diff --git a/contrib/less/cmdbuf.c b/contrib/less/cmdbuf.c
index e387ccc..69d7414 100644
--- a/contrib/less/cmdbuf.c
+++ b/contrib/less/cmdbuf.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 1984-2012 Mark Nudelman
+ * Copyright (C) 1984-2015 Mark Nudelman
*
* You may distribute under the terms of either the GNU General Public
* License or the Less License, as specified in the README file.
@@ -203,7 +203,7 @@ cmd_step_common(p, ch, len, pwidth, bswidth)
pr = prchar((int) ch);
if (pwidth != NULL || bswidth != NULL)
{
- int len = strlen(pr);
+ int len = (int) strlen(pr);
if (pwidth != NULL)
*pwidth = len;
if (bswidth != NULL)
@@ -222,7 +222,7 @@ cmd_step_common(p, ch, len, pwidth, bswidth)
*bswidth = 0;
} else if (is_ubin_char(ch))
{
- int len = strlen(pr);
+ int len = (int) strlen(pr);
if (pwidth != NULL)
*pwidth = len;
if (bswidth != NULL)
@@ -375,7 +375,7 @@ cmd_lshift()
s = ns;
}
- cmd_offset = s - cmdbuf;
+ cmd_offset = (int) (s - cmdbuf);
save_cp = cp;
cmd_home();
cmd_repaint(save_cp);
@@ -405,7 +405,7 @@ cmd_rshift()
cols += width;
}
- cmd_offset = s - cmdbuf;
+ cmd_offset = (int) (s - cmdbuf);
save_cp = cp;
cmd_home();
cmd_repaint(save_cp);
@@ -535,7 +535,7 @@ cmd_erase()
*/
s = cp;
cmd_left();
- clen = s - cp;
+ clen = (int) (s - cp);
/*
* Remove the char from the buffer (shift the buffer left).
@@ -701,7 +701,7 @@ cmd_updown(action)
if (updown_match < 0)
{
- updown_match = cp - cmdbuf;
+ updown_match = (int) (cp - cmdbuf);
}
/*
@@ -744,12 +744,13 @@ cmd_updown(action)
#endif
/*
- * Add a string to a history list.
+ * Add a string to an mlist.
*/
public void
-cmd_addhist(mlist, cmd)
+cmd_addhist(mlist, cmd, modified)
struct mlist *mlist;
char *cmd;
+ int modified;
{
#if CMD_HISTORY
struct mlist *ml;
@@ -773,6 +774,7 @@ cmd_addhist(mlist, cmd)
*/
ml = (struct mlist *) ecalloc(1, sizeof(struct mlist));
ml->string = save(cmd);
+ ml->modified = modified;
ml->next = mlist;
ml->prev = mlist->prev;
mlist->prev->next = ml;
@@ -799,7 +801,7 @@ cmd_accept()
*/
if (curr_mlist == NULL)
return;
- cmd_addhist(curr_mlist, cmdbuf);
+ cmd_addhist(curr_mlist, cmdbuf, 1);
curr_mlist->modified = 1;
#endif
}
@@ -965,7 +967,7 @@ delimit_word()
int delim_quoted = 0;
int meta_quoted = 0;
char *esc = get_meta_escape();
- int esclen = strlen(esc);
+ int esclen = (int) strlen(esc);
#endif
/*
@@ -1262,7 +1264,7 @@ cmd_char(c)
cmd_mbc_buf[cmd_mbc_buf_index++] = c;
if (cmd_mbc_buf_index < cmd_mbc_buf_len)
return (CC_OK);
- if (!is_utf8_well_formed(cmd_mbc_buf))
+ if (!is_utf8_well_formed(cmd_mbc_buf, cmd_mbc_buf_index))
{
/* complete, but not well formed (non-shortest form), sequence */
cmd_mbc_buf_len = 0;
@@ -1359,6 +1361,18 @@ cmd_lastpattern()
#if CMD_HISTORY
/*
+ */
+ static int
+mlist_size(ml)
+ struct mlist *ml;
+{
+ int size = 0;
+ for (ml = ml->next; ml->string != NULL; ml = ml->next)
+ ++size;
+ return size;
+}
+
+/*
* Get the name of the history file.
*/
static char *
@@ -1378,6 +1392,10 @@ histfile_name()
return (save(name));
}
+ /* See if history file is disabled in the build. */
+ if (strcmp(LESSHISTFILE, "") == 0 || strcmp(LESSHISTFILE, "-") == 0)
+ return (NULL);
+
/* Otherwise, file is in $HOME. */
home = lgetenv("HOME");
if (home == NULL || *home == '\0')
@@ -1388,25 +1406,28 @@ histfile_name()
#endif
return (NULL);
}
- len = strlen(home) + strlen(LESSHISTFILE) + 2;
+ len = (int) (strlen(home) + strlen(LESSHISTFILE) + 2);
name = (char *) ecalloc(len, sizeof(char));
SNPRINTF2(name, len, "%s/%s", home, LESSHISTFILE);
return (name);
}
-#endif /* CMD_HISTORY */
/*
- * Initialize history from a .lesshist file.
+ * Read a .lesshst file and call a callback for each line in the file.
*/
- public void
-init_cmdhist()
+ static void
+read_cmdhist2(action, uparam, skip_search, skip_shell)
+ void (*action)(void*,struct mlist*,char*);
+ void *uparam;
+ int skip_search;
+ int skip_shell;
{
-#if CMD_HISTORY
struct mlist *ml = NULL;
char line[CMDBUF_SIZE];
char *filename;
FILE *f;
char *p;
+ int *skip = NULL;
filename = histfile_name();
if (filename == NULL)
@@ -1432,84 +1453,170 @@ init_cmdhist()
}
}
if (strcmp(line, HISTFILE_SEARCH_SECTION) == 0)
+ {
ml = &mlist_search;
- else if (strcmp(line, HISTFILE_SHELL_SECTION) == 0)
+ skip = &skip_search;
+ } else if (strcmp(line, HISTFILE_SHELL_SECTION) == 0)
{
#if SHELL_ESCAPE || PIPEC
ml = &mlist_shell;
+ skip = &skip_shell;
#else
ml = NULL;
+ skip = NULL;
#endif
} else if (*line == '"')
{
if (ml != NULL)
- cmd_addhist(ml, line+1);
+ {
+ if (skip != NULL && *skip > 0)
+ --(*skip);
+ else
+ (*action)(uparam, ml, line+1);
+ }
}
}
fclose(f);
+}
+
+ static void
+read_cmdhist(action, uparam, skip_search, skip_shell)
+ void (*action)(void*,struct mlist*,char*);
+ void *uparam;
+ int skip_search;
+ int skip_shell;
+{
+ read_cmdhist2(action, uparam, skip_search, skip_shell);
+ (*action)(uparam, NULL, NULL); /* signal end of file */
+}
+
+ static void
+addhist_init(void *uparam, struct mlist *ml, char *string)
+{
+ if (ml == NULL || string == NULL)
+ return;
+ cmd_addhist(ml, string, 0);
+}
+#endif /* CMD_HISTORY */
+
+/*
+ * Initialize history from a .lesshist file.
+ */
+ public void
+init_cmdhist()
+{
+#if CMD_HISTORY
+ read_cmdhist(&addhist_init, NULL, 0, 0);
#endif /* CMD_HISTORY */
}
/*
- *
+ * Write the header for a section of the history file.
*/
#if CMD_HISTORY
static void
-save_mlist(ml, f)
+write_mlist_header(ml, f)
struct mlist *ml;
FILE *f;
{
- int histsize = 0;
- int n;
- char *s;
-
- s = lgetenv("LESSHISTSIZE");
- if (s != NULL)
- histsize = atoi(s);
- if (histsize == 0)
- histsize = 100;
+ if (ml == &mlist_search)
+ fprintf(f, "%s\n", HISTFILE_SEARCH_SECTION);
+#if SHELL_ESCAPE || PIPEC
+ else if (ml == &mlist_shell)
+ fprintf(f, "%s\n", HISTFILE_SHELL_SECTION);
+#endif
+}
- ml = ml->prev;
- for (n = 0; n < histsize; n++)
- {
- if (ml->string == NULL)
- break;
- ml = ml->prev;
- }
+/*
+ * Write all modified entries in an mlist to the history file.
+ */
+ static void
+write_mlist(ml, f)
+ struct mlist *ml;
+ FILE *f;
+{
for (ml = ml->next; ml->string != NULL; ml = ml->next)
+ {
+ if (!ml->modified)
+ continue;
fprintf(f, "\"%s\n", ml->string);
+ ml->modified = 0;
+ }
+ ml->modified = 0; /* entire mlist is now unmodified */
}
-#endif /* CMD_HISTORY */
/*
- *
+ * Make a temp name in the same directory as filename.
*/
- public void
-save_cmdhist()
-{
-#if CMD_HISTORY
+ static char *
+make_tempname(filename)
char *filename;
- FILE *f;
- int modified = 0;
+{
+ char lastch;
+ char *tempname = ecalloc(1, strlen(filename)+1);
+ strcpy(tempname, filename);
+ lastch = tempname[strlen(tempname)-1];
+ tempname[strlen(tempname)-1] = (lastch == 'Q') ? 'Z' : 'Q';
+ return tempname;
+}
- if (mlist_search.modified)
- modified = 1;
+struct save_ctx
+{
+ struct mlist *mlist;
+ FILE *fout;
+};
+
+/*
+ * Copy entries from the saved history file to a new file.
+ * At the end of each mlist, append any new entries
+ * created during this session.
+ */
+ static void
+copy_hist(void *uparam, struct mlist *ml, char *string)
+{
+ struct save_ctx *ctx = (struct save_ctx *) uparam;
+
+ if (ml != ctx->mlist) {
+ /* We're changing mlists. */
+ if (ctx->mlist)
+ /* Append any new entries to the end of the current mlist. */
+ write_mlist(ctx->mlist, ctx->fout);
+ /* Write the header for the new mlist. */
+ ctx->mlist = ml;
+ write_mlist_header(ctx->mlist, ctx->fout);
+ }
+ if (string != NULL)
+ {
+ /* Copy the entry. */
+ fprintf(ctx->fout, "\"%s\n", string);
+ }
+ if (ml == NULL) /* End of file */
+ {
+ /* Write any sections that were not in the original file. */
+ if (mlist_search.modified)
+ {
+ write_mlist_header(&mlist_search, ctx->fout);
+ write_mlist(&mlist_search, ctx->fout);
+ }
#if SHELL_ESCAPE || PIPEC
- if (mlist_shell.modified)
- modified = 1;
+ if (mlist_shell.modified)
+ {
+ write_mlist_header(&mlist_shell, ctx->fout);
+ write_mlist(&mlist_shell, ctx->fout);
+ }
#endif
- if (!modified)
- return;
- filename = histfile_name();
- if (filename == NULL)
- return;
- f = fopen(filename, "w");
- free(filename);
- if (f == NULL)
- return;
-#if HAVE_FCHMOD
+ }
+}
+#endif /* CMD_HISTORY */
+
+/*
+ * Make a file readable only by its owner.
+ */
+ static void
+make_file_private(f)
+ FILE *f;
{
- /* Make history file readable only by owner. */
+#if HAVE_FCHMOD
int do_chmod = 1;
#if HAVE_STAT
struct stat statbuf;
@@ -1520,19 +1627,74 @@ save_cmdhist()
#endif
if (do_chmod)
fchmod(fileno(f), 0600);
-}
#endif
+}
- fprintf(f, "%s\n", HISTFILE_FIRST_LINE);
+/*
+ * Does the history file need to be updated?
+ */
+ static int
+histfile_modified()
+{
+ if (mlist_search.modified)
+ return 1;
+#if SHELL_ESCAPE || PIPEC
+ if (mlist_shell.modified)
+ return 1;
+#endif
+ return 0;
+}
- fprintf(f, "%s\n", HISTFILE_SEARCH_SECTION);
- save_mlist(&mlist_search, f);
+/*
+ * Update the .lesshst file.
+ */
+ public void
+save_cmdhist()
+{
+#if CMD_HISTORY
+ char *histname;
+ char *tempname;
+ int skip_search;
+ int skip_shell;
+ struct save_ctx ctx;
+ char *s;
+ FILE *fout = NULL;
+ int histsize = 0;
+ if (!histfile_modified())
+ return;
+ histname = histfile_name();
+ if (histname == NULL)
+ return;
+ tempname = make_tempname(histname);
+ fout = fopen(tempname, "w");
+ if (fout != NULL)
+ {
+ make_file_private(fout);
+ s = lgetenv("LESSHISTSIZE");
+ if (s != NULL)
+ histsize = atoi(s);
+ if (histsize <= 0)
+ histsize = 100;
+ skip_search = mlist_size(&mlist_search) - histsize;
#if SHELL_ESCAPE || PIPEC
- fprintf(f, "%s\n", HISTFILE_SHELL_SECTION);
- save_mlist(&mlist_shell, f);
+ skip_shell = mlist_size(&mlist_shell) - histsize;
#endif
-
- fclose(f);
+ fprintf(fout, "%s\n", HISTFILE_FIRST_LINE);
+ ctx.fout = fout;
+ ctx.mlist = NULL;
+ read_cmdhist(copy_hist, &ctx, skip_search, skip_shell);
+ fclose(fout);
+#if MSDOS_COMPILER==WIN32C
+ /*
+ * Windows rename doesn't remove an existing file,
+ * making it useless for atomic operations. Sigh.
+ */
+ remove(histname);
+#endif
+ rename(tempname, histname);
+ }
+ free(tempname);
+ free(histname);
#endif /* CMD_HISTORY */
}
diff --git a/contrib/less/command.c b/contrib/less/command.c
index 5cbab00..ddcddd4 100644
--- a/contrib/less/command.c
+++ b/contrib/less/command.c
@@ -1,6 +1,6 @@
/* $FreeBSD$ */
/*
- * Copyright (C) 1984-2012 Mark Nudelman
+ * Copyright (C) 1984-2015 Mark Nudelman
*
* You may distribute under the terms of either the GNU General Public
* License or the Less License, as specified in the README file.
@@ -35,6 +35,7 @@ extern int top_scroll;
extern int ignore_eoi;
extern int secure;
extern int hshift;
+extern int bs_mode;
extern int show_attn;
extern int less_is_more;
extern POSITION highest_hilite;
@@ -56,6 +57,7 @@ extern int screen_trashed; /* The screen has been overwritten */
extern int shift_count;
extern int oldbot;
extern int forw_prompt;
+extern int same_pos_bell;
#if SHELL_ESCAPE
static char *shellcmd = NULL; /* For holding last shell command for "!!" */
@@ -70,6 +72,7 @@ static int optflag;
static int optgetname;
static POSITION bottompos;
static int save_hshift;
+static int save_bs_mode;
#if PIPEC
static char pipec;
#endif
@@ -77,9 +80,9 @@ static char pipec;
struct ungot {
struct ungot *ug_next;
char ug_char;
+ char ug_end_command;
};
static struct ungot* ungot = NULL;
-static int unget_end = 0;
static void multi_search();
@@ -160,6 +163,7 @@ mca_search()
cmd_putstr("/");
else
cmd_putstr("?");
+ forw_prompt = 0;
set_mlist(ml_search, 0);
}
@@ -194,6 +198,7 @@ mca_opt_toggle()
cmd_putstr("!");
break;
}
+ forw_prompt = 0;
set_mlist(NULL, 0);
}
@@ -212,7 +217,7 @@ exec_mca()
{
case A_F_SEARCH:
case A_B_SEARCH:
- multi_search(cbuf, (int) number);
+ multi_search(cbuf, (int) number, 0);
break;
#if HILITE_SEARCH
case A_FILTER:
@@ -688,7 +693,7 @@ prompt()
{
register constant char *p;
- if (ungot != NULL)
+ if (ungot != NULL && !ungot->ug_end_command)
{
/*
* No prompt necessary if commands are from
@@ -778,40 +783,6 @@ dispversion()
public int
getcc()
{
- if (unget_end)
- {
- /*
- * We have just run out of ungotten chars.
- */
- unget_end = 0;
- if (len_cmdbuf() == 0 || !empty_screen())
- return (getchr());
- /*
- * Command is incomplete, so try to complete it.
- */
- switch (mca)
- {
- case A_DIGIT:
- /*
- * We have a number but no command. Treat as #g.
- */
- return ('g');
-
- case A_F_SEARCH:
- case A_B_SEARCH:
- /*
- * We have "/string" but no newline. Add the \n.
- */
- return ('\n');
-
- default:
- /*
- * Some other incomplete command. Let user complete it.
- */
- return (getchr());
- }
- }
-
if (ungot == NULL)
{
/*
@@ -826,9 +797,36 @@ getcc()
{
struct ungot *ug = ungot;
char c = ug->ug_char;
+ int end_command = ug->ug_end_command;
ungot = ug->ug_next;
free(ug);
- unget_end = (ungot == NULL);
+ if (end_command)
+ {
+ /*
+ * Command is incomplete, so try to complete it.
+ */
+ switch (mca)
+ {
+ case A_DIGIT:
+ /*
+ * We have a number but no command. Treat as #g.
+ */
+ return ('g');
+
+ case A_F_SEARCH:
+ case A_B_SEARCH:
+ /*
+ * We have "/string" but no newline. Add the \n.
+ */
+ return ('\n');
+
+ default:
+ /*
+ * Some other incomplete command. Let user complete it.
+ */
+ return (getchr());
+ }
+ }
return (c);
}
}
@@ -843,10 +841,10 @@ ungetcc(c)
{
struct ungot *ug = (struct ungot *) ecalloc(1, sizeof(struct ungot));
- ug->ug_char = c;
+ ug->ug_char = (char) c;
+ ug->ug_end_command = (c == CHAR_END_COMMAND);
ug->ug_next = ungot;
ungot = ug;
- unget_end = 0;
}
/*
@@ -869,9 +867,10 @@ ungetsc(s)
* If SRCH_PAST_EOF is set, continue the search thru multiple files.
*/
static void
-multi_search(pattern, n)
+multi_search(pattern, n, silent)
char *pattern;
int n;
+ int silent;
{
register int nomore;
IFILE save_ifile;
@@ -946,7 +945,7 @@ multi_search(pattern, n)
* Didn't find it.
* Print an error message if we haven't already.
*/
- if (n > 0)
+ if (n > 0 && !silent)
error("Pattern not found", NULL_PARG);
if (changed_file)
@@ -974,7 +973,7 @@ forw_loop(until_hilite)
return (A_NOACTION);
cmd_exec();
- jump_forw();
+ jump_forw_buffered();
curr_len = ch_length();
highest_hilite = until_hilite ? curr_len : NULL_POSITION;
ignore_eoi = 1;
@@ -1019,7 +1018,6 @@ commands()
IFILE old_ifile;
IFILE new_ifile;
char *tagfile;
- int until_hilite = 0;
search_type = SRCH_FORW;
wscroll = (sc_height + 1) / 2;
@@ -1247,6 +1245,8 @@ commands()
/*
* Forward forever, ignoring EOF.
*/
+ if (show_attn)
+ set_attnpos(bottompos);
newaction = forw_loop(0);
break;
@@ -1332,6 +1332,17 @@ commands()
jump_back(number);
break;
+ case A_GOEND_BUF:
+ /*
+ * Go to line N, default last buffered byte.
+ */
+ cmd_exec();
+ if (number <= 0)
+ jump_forw_buffered();
+ else
+ jump_back(number);
+ break;
+
case A_GOPOS:
/*
* Go to a specified byte position in the file.
@@ -1374,6 +1385,7 @@ commands()
* previous file.
*/
hshift = save_hshift;
+ bs_mode = save_bs_mode;
if (edit_prev(1) == 0)
break;
}
@@ -1389,7 +1401,7 @@ commands()
if (number <= 0) number = 1; \
mca_search(); \
cmd_exec(); \
- multi_search((char *)NULL, (int) number);
+ multi_search((char *)NULL, (int) number, 0);
case A_F_SEARCH:
@@ -1477,6 +1489,8 @@ commands()
cmd_exec();
save_hshift = hshift;
hshift = 0;
+ save_bs_mode = bs_mode;
+ bs_mode = BS_SPECIAL;
(void) edit(FAKE_HELPFILE);
break;
diff --git a/contrib/less/compose.uni b/contrib/less/compose.uni
new file mode 100644
index 0000000..b814ce9
--- /dev/null
+++ b/contrib/less/compose.uni
@@ -0,0 +1,261 @@
+/* Generated by "./mkutable -f2 Mn Me -- unicode/UnicodeData.txt" on Mon Jul 14 16:21:21 PDT 2014 */
+ { 0x0300, 0x036f }, /* Mn */
+ { 0x0483, 0x0487 }, /* Mn */
+ { 0x0488, 0x0489 }, /* Me */
+ { 0x0591, 0x05bd }, /* Mn */
+ { 0x05bf, 0x05bf }, /* Mn */
+ { 0x05c1, 0x05c2 }, /* Mn */
+ { 0x05c4, 0x05c5 }, /* Mn */
+ { 0x05c7, 0x05c7 }, /* Mn */
+ { 0x0610, 0x061a }, /* Mn */
+ { 0x064b, 0x065f }, /* Mn */
+ { 0x0670, 0x0670 }, /* Mn */
+ { 0x06d6, 0x06dc }, /* Mn */
+ { 0x06df, 0x06e4 }, /* Mn */
+ { 0x06e7, 0x06e8 }, /* Mn */
+ { 0x06ea, 0x06ed }, /* Mn */
+ { 0x0711, 0x0711 }, /* Mn */
+ { 0x0730, 0x074a }, /* Mn */
+ { 0x07a6, 0x07b0 }, /* Mn */
+ { 0x07eb, 0x07f3 }, /* Mn */
+ { 0x0816, 0x0819 }, /* Mn */
+ { 0x081b, 0x0823 }, /* Mn */
+ { 0x0825, 0x0827 }, /* Mn */
+ { 0x0829, 0x082d }, /* Mn */
+ { 0x0859, 0x085b }, /* Mn */
+ { 0x08e4, 0x0902 }, /* Mn */
+ { 0x093a, 0x093a }, /* Mn */
+ { 0x093c, 0x093c }, /* Mn */
+ { 0x0941, 0x0948 }, /* Mn */
+ { 0x094d, 0x094d }, /* Mn */
+ { 0x0951, 0x0957 }, /* Mn */
+ { 0x0962, 0x0963 }, /* Mn */
+ { 0x0981, 0x0981 }, /* Mn */
+ { 0x09bc, 0x09bc }, /* Mn */
+ { 0x09c1, 0x09c4 }, /* Mn */
+ { 0x09cd, 0x09cd }, /* Mn */
+ { 0x09e2, 0x09e3 }, /* Mn */
+ { 0x0a01, 0x0a02 }, /* Mn */
+ { 0x0a3c, 0x0a3c }, /* Mn */
+ { 0x0a41, 0x0a42 }, /* Mn */
+ { 0x0a47, 0x0a48 }, /* Mn */
+ { 0x0a4b, 0x0a4d }, /* Mn */
+ { 0x0a51, 0x0a51 }, /* Mn */
+ { 0x0a70, 0x0a71 }, /* Mn */
+ { 0x0a75, 0x0a75 }, /* Mn */
+ { 0x0a81, 0x0a82 }, /* Mn */
+ { 0x0abc, 0x0abc }, /* Mn */
+ { 0x0ac1, 0x0ac5 }, /* Mn */
+ { 0x0ac7, 0x0ac8 }, /* Mn */
+ { 0x0acd, 0x0acd }, /* Mn */
+ { 0x0ae2, 0x0ae3 }, /* Mn */
+ { 0x0b01, 0x0b01 }, /* Mn */
+ { 0x0b3c, 0x0b3c }, /* Mn */
+ { 0x0b3f, 0x0b3f }, /* Mn */
+ { 0x0b41, 0x0b44 }, /* Mn */
+ { 0x0b4d, 0x0b4d }, /* Mn */
+ { 0x0b56, 0x0b56 }, /* Mn */
+ { 0x0b62, 0x0b63 }, /* Mn */
+ { 0x0b82, 0x0b82 }, /* Mn */
+ { 0x0bc0, 0x0bc0 }, /* Mn */
+ { 0x0bcd, 0x0bcd }, /* Mn */
+ { 0x0c00, 0x0c00 }, /* Mn */
+ { 0x0c3e, 0x0c40 }, /* Mn */
+ { 0x0c46, 0x0c48 }, /* Mn */
+ { 0x0c4a, 0x0c4d }, /* Mn */
+ { 0x0c55, 0x0c56 }, /* Mn */
+ { 0x0c62, 0x0c63 }, /* Mn */
+ { 0x0c81, 0x0c81 }, /* Mn */
+ { 0x0cbc, 0x0cbc }, /* Mn */
+ { 0x0cbf, 0x0cbf }, /* Mn */
+ { 0x0cc6, 0x0cc6 }, /* Mn */
+ { 0x0ccc, 0x0ccd }, /* Mn */
+ { 0x0ce2, 0x0ce3 }, /* Mn */
+ { 0x0d01, 0x0d01 }, /* Mn */
+ { 0x0d41, 0x0d44 }, /* Mn */
+ { 0x0d4d, 0x0d4d }, /* Mn */
+ { 0x0d62, 0x0d63 }, /* Mn */
+ { 0x0dca, 0x0dca }, /* Mn */
+ { 0x0dd2, 0x0dd4 }, /* Mn */
+ { 0x0dd6, 0x0dd6 }, /* Mn */
+ { 0x0e31, 0x0e31 }, /* Mn */
+ { 0x0e34, 0x0e3a }, /* Mn */
+ { 0x0e47, 0x0e4e }, /* Mn */
+ { 0x0eb1, 0x0eb1 }, /* Mn */
+ { 0x0eb4, 0x0eb9 }, /* Mn */
+ { 0x0ebb, 0x0ebc }, /* Mn */
+ { 0x0ec8, 0x0ecd }, /* Mn */
+ { 0x0f18, 0x0f19 }, /* Mn */
+ { 0x0f35, 0x0f35 }, /* Mn */
+ { 0x0f37, 0x0f37 }, /* Mn */
+ { 0x0f39, 0x0f39 }, /* Mn */
+ { 0x0f71, 0x0f7e }, /* Mn */
+ { 0x0f80, 0x0f84 }, /* Mn */
+ { 0x0f86, 0x0f87 }, /* Mn */
+ { 0x0f8d, 0x0f97 }, /* Mn */
+ { 0x0f99, 0x0fbc }, /* Mn */
+ { 0x0fc6, 0x0fc6 }, /* Mn */
+ { 0x102d, 0x1030 }, /* Mn */
+ { 0x1032, 0x1037 }, /* Mn */
+ { 0x1039, 0x103a }, /* Mn */
+ { 0x103d, 0x103e }, /* Mn */
+ { 0x1058, 0x1059 }, /* Mn */
+ { 0x105e, 0x1060 }, /* Mn */
+ { 0x1071, 0x1074 }, /* Mn */
+ { 0x1082, 0x1082 }, /* Mn */
+ { 0x1085, 0x1086 }, /* Mn */
+ { 0x108d, 0x108d }, /* Mn */
+ { 0x109d, 0x109d }, /* Mn */
+ { 0x135d, 0x135f }, /* Mn */
+ { 0x1712, 0x1714 }, /* Mn */
+ { 0x1732, 0x1734 }, /* Mn */
+ { 0x1752, 0x1753 }, /* Mn */
+ { 0x1772, 0x1773 }, /* Mn */
+ { 0x17b4, 0x17b5 }, /* Mn */
+ { 0x17b7, 0x17bd }, /* Mn */
+ { 0x17c6, 0x17c6 }, /* Mn */
+ { 0x17c9, 0x17d3 }, /* Mn */
+ { 0x17dd, 0x17dd }, /* Mn */
+ { 0x180b, 0x180d }, /* Mn */
+ { 0x18a9, 0x18a9 }, /* Mn */
+ { 0x1920, 0x1922 }, /* Mn */
+ { 0x1927, 0x1928 }, /* Mn */
+ { 0x1932, 0x1932 }, /* Mn */
+ { 0x1939, 0x193b }, /* Mn */
+ { 0x1a17, 0x1a18 }, /* Mn */
+ { 0x1a1b, 0x1a1b }, /* Mn */
+ { 0x1a56, 0x1a56 }, /* Mn */
+ { 0x1a58, 0x1a5e }, /* Mn */
+ { 0x1a60, 0x1a60 }, /* Mn */
+ { 0x1a62, 0x1a62 }, /* Mn */
+ { 0x1a65, 0x1a6c }, /* Mn */
+ { 0x1a73, 0x1a7c }, /* Mn */
+ { 0x1a7f, 0x1a7f }, /* Mn */
+ { 0x1ab0, 0x1abd }, /* Mn */
+ { 0x1abe, 0x1abe }, /* Me */
+ { 0x1b00, 0x1b03 }, /* Mn */
+ { 0x1b34, 0x1b34 }, /* Mn */
+ { 0x1b36, 0x1b3a }, /* Mn */
+ { 0x1b3c, 0x1b3c }, /* Mn */
+ { 0x1b42, 0x1b42 }, /* Mn */
+ { 0x1b6b, 0x1b73 }, /* Mn */
+ { 0x1b80, 0x1b81 }, /* Mn */
+ { 0x1ba2, 0x1ba5 }, /* Mn */
+ { 0x1ba8, 0x1ba9 }, /* Mn */
+ { 0x1bab, 0x1bad }, /* Mn */
+ { 0x1be6, 0x1be6 }, /* Mn */
+ { 0x1be8, 0x1be9 }, /* Mn */
+ { 0x1bed, 0x1bed }, /* Mn */
+ { 0x1bef, 0x1bf1 }, /* Mn */
+ { 0x1c2c, 0x1c33 }, /* Mn */
+ { 0x1c36, 0x1c37 }, /* Mn */
+ { 0x1cd0, 0x1cd2 }, /* Mn */
+ { 0x1cd4, 0x1ce0 }, /* Mn */
+ { 0x1ce2, 0x1ce8 }, /* Mn */
+ { 0x1ced, 0x1ced }, /* Mn */
+ { 0x1cf4, 0x1cf4 }, /* Mn */
+ { 0x1cf8, 0x1cf9 }, /* Mn */
+ { 0x1dc0, 0x1df5 }, /* Mn */
+ { 0x1dfc, 0x1dff }, /* Mn */
+ { 0x20d0, 0x20dc }, /* Mn */
+ { 0x20dd, 0x20e0 }, /* Me */
+ { 0x20e1, 0x20e1 }, /* Mn */
+ { 0x20e2, 0x20e4 }, /* Me */
+ { 0x20e5, 0x20f0 }, /* Mn */
+ { 0x2cef, 0x2cf1 }, /* Mn */
+ { 0x2d7f, 0x2d7f }, /* Mn */
+ { 0x2de0, 0x2dff }, /* Mn */
+ { 0x302a, 0x302d }, /* Mn */
+ { 0x3099, 0x309a }, /* Mn */
+ { 0xa66f, 0xa66f }, /* Mn */
+ { 0xa670, 0xa672 }, /* Me */
+ { 0xa674, 0xa67d }, /* Mn */
+ { 0xa69f, 0xa69f }, /* Mn */
+ { 0xa6f0, 0xa6f1 }, /* Mn */
+ { 0xa802, 0xa802 }, /* Mn */
+ { 0xa806, 0xa806 }, /* Mn */
+ { 0xa80b, 0xa80b }, /* Mn */
+ { 0xa825, 0xa826 }, /* Mn */
+ { 0xa8c4, 0xa8c4 }, /* Mn */
+ { 0xa8e0, 0xa8f1 }, /* Mn */
+ { 0xa926, 0xa92d }, /* Mn */
+ { 0xa947, 0xa951 }, /* Mn */
+ { 0xa980, 0xa982 }, /* Mn */
+ { 0xa9b3, 0xa9b3 }, /* Mn */
+ { 0xa9b6, 0xa9b9 }, /* Mn */
+ { 0xa9bc, 0xa9bc }, /* Mn */
+ { 0xa9e5, 0xa9e5 }, /* Mn */
+ { 0xaa29, 0xaa2e }, /* Mn */
+ { 0xaa31, 0xaa32 }, /* Mn */
+ { 0xaa35, 0xaa36 }, /* Mn */
+ { 0xaa43, 0xaa43 }, /* Mn */
+ { 0xaa4c, 0xaa4c }, /* Mn */
+ { 0xaa7c, 0xaa7c }, /* Mn */
+ { 0xaab0, 0xaab0 }, /* Mn */
+ { 0xaab2, 0xaab4 }, /* Mn */
+ { 0xaab7, 0xaab8 }, /* Mn */
+ { 0xaabe, 0xaabf }, /* Mn */
+ { 0xaac1, 0xaac1 }, /* Mn */
+ { 0xaaec, 0xaaed }, /* Mn */
+ { 0xaaf6, 0xaaf6 }, /* Mn */
+ { 0xabe5, 0xabe5 }, /* Mn */
+ { 0xabe8, 0xabe8 }, /* Mn */
+ { 0xabed, 0xabed }, /* Mn */
+ { 0xfb1e, 0xfb1e }, /* Mn */
+ { 0xfe00, 0xfe0f }, /* Mn */
+ { 0xfe20, 0xfe2d }, /* Mn */
+ { 0x101fd, 0x101fd }, /* Mn */
+ { 0x102e0, 0x102e0 }, /* Mn */
+ { 0x10376, 0x1037a }, /* Mn */
+ { 0x10a01, 0x10a03 }, /* Mn */
+ { 0x10a05, 0x10a06 }, /* Mn */
+ { 0x10a0c, 0x10a0f }, /* Mn */
+ { 0x10a38, 0x10a3a }, /* Mn */
+ { 0x10a3f, 0x10a3f }, /* Mn */
+ { 0x10ae5, 0x10ae6 }, /* Mn */
+ { 0x11001, 0x11001 }, /* Mn */
+ { 0x11038, 0x11046 }, /* Mn */
+ { 0x1107f, 0x11081 }, /* Mn */
+ { 0x110b3, 0x110b6 }, /* Mn */
+ { 0x110b9, 0x110ba }, /* Mn */
+ { 0x11100, 0x11102 }, /* Mn */
+ { 0x11127, 0x1112b }, /* Mn */
+ { 0x1112d, 0x11134 }, /* Mn */
+ { 0x11173, 0x11173 }, /* Mn */
+ { 0x11180, 0x11181 }, /* Mn */
+ { 0x111b6, 0x111be }, /* Mn */
+ { 0x1122f, 0x11231 }, /* Mn */
+ { 0x11234, 0x11234 }, /* Mn */
+ { 0x11236, 0x11237 }, /* Mn */
+ { 0x112df, 0x112df }, /* Mn */
+ { 0x112e3, 0x112ea }, /* Mn */
+ { 0x11301, 0x11301 }, /* Mn */
+ { 0x1133c, 0x1133c }, /* Mn */
+ { 0x11340, 0x11340 }, /* Mn */
+ { 0x11366, 0x1136c }, /* Mn */
+ { 0x11370, 0x11374 }, /* Mn */
+ { 0x114b3, 0x114b8 }, /* Mn */
+ { 0x114ba, 0x114ba }, /* Mn */
+ { 0x114bf, 0x114c0 }, /* Mn */
+ { 0x114c2, 0x114c3 }, /* Mn */
+ { 0x115b2, 0x115b5 }, /* Mn */
+ { 0x115bc, 0x115bd }, /* Mn */
+ { 0x115bf, 0x115c0 }, /* Mn */
+ { 0x11633, 0x1163a }, /* Mn */
+ { 0x1163d, 0x1163d }, /* Mn */
+ { 0x1163f, 0x11640 }, /* Mn */
+ { 0x116ab, 0x116ab }, /* Mn */
+ { 0x116ad, 0x116ad }, /* Mn */
+ { 0x116b0, 0x116b5 }, /* Mn */
+ { 0x116b7, 0x116b7 }, /* Mn */
+ { 0x16af0, 0x16af4 }, /* Mn */
+ { 0x16b30, 0x16b36 }, /* Mn */
+ { 0x16f8f, 0x16f92 }, /* Mn */
+ { 0x1bc9d, 0x1bc9e }, /* Mn */
+ { 0x1d167, 0x1d169 }, /* Mn */
+ { 0x1d17b, 0x1d182 }, /* Mn */
+ { 0x1d185, 0x1d18b }, /* Mn */
+ { 0x1d1aa, 0x1d1ad }, /* Mn */
+ { 0x1d242, 0x1d244 }, /* Mn */
+ { 0x1e8d0, 0x1e8d6 }, /* Mn */
+ { 0xe0100, 0xe01ef }, /* Mn */
diff --git a/contrib/less/cvt.c b/contrib/less/cvt.c
index c3b3e6e..d983641 100644
--- a/contrib/less/cvt.c
+++ b/contrib/less/cvt.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 1984-2012 Mark Nudelman
+ * Copyright (C) 1984-2015 Mark Nudelman
*
* You may distribute under the terms of either the GNU General Public
* License or the Less License, as specified in the README file.
@@ -75,8 +75,8 @@ cvt_text(odst, osrc, chpos, lenp, ops)
for (src = osrc, dst = odst; src < src_end; )
{
- int src_pos = src - osrc;
- int dst_pos = dst - odst;
+ int src_pos = (int) (src - osrc);
+ int dst_pos = (int) (dst - odst);
ch = step_char(&src, +1, src_end);
if ((ops & CVT_BS) && ch == '\b' && dst > odst)
{
@@ -109,6 +109,6 @@ cvt_text(odst, osrc, chpos, lenp, ops)
edst--;
*edst = '\0';
if (lenp != NULL)
- *lenp = edst - odst;
+ *lenp = (int) (edst - odst);
/* FIXME: why was this here? if (chpos != NULL) chpos[dst - odst] = src - osrc; */
}
diff --git a/contrib/less/decode.c b/contrib/less/decode.c
index 6d0312d..1cd1599 100644
--- a/contrib/less/decode.c
+++ b/contrib/less/decode.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 1984-2012 Mark Nudelman
+ * Copyright (C) 1984-2015 Mark Nudelman
*
* You may distribute under the terms of either the GNU General Public
* License or the Less License, as specified in the README file.
@@ -105,6 +105,7 @@ static unsigned char cmdtable[] =
ESC,CONTROL('F'),0, A_F_BRACKET,
ESC,CONTROL('B'),0, A_B_BRACKET,
'G',0, A_GOEND,
+ ESC,'G',0, A_GOEND_BUF,
ESC,'>',0, A_GOEND,
'>',0, A_GOEND,
SK(SK_END),0, A_GOEND,
diff --git a/contrib/less/edit.c b/contrib/less/edit.c
index 5f4e679..2a35ade 100644
--- a/contrib/less/edit.c
+++ b/contrib/less/edit.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 1984-2012 Mark Nudelman
+ * Copyright (C) 1984-2015 Mark Nudelman
*
* You may distribute under the terms of either the GNU General Public
* License or the Less License, as specified in the README file.
@@ -64,7 +64,7 @@ init_textlist(tlist, str)
int meta_quoted = 0;
int delim_quoted = 0;
char *esc = get_meta_escape();
- int esclen = strlen(esc);
+ int esclen = (int) strlen(esc);
#endif
tlist->string = skipsp(str);
@@ -411,7 +411,10 @@ edit_ifile(ifile)
}
#endif
if (every_first_cmd != NULL)
+ {
+ ungetcc(CHAR_END_COMMAND);
ungetsc(every_first_cmd);
+ }
}
free(qopen_filename);
@@ -433,7 +436,8 @@ edit_ifile(ifile)
#if HILITE_SEARCH
clr_hilite();
#endif
- cmd_addhist(ml_examine, filename);
+ if (strcmp(filename, FAKE_HELPFILE) && strcmp(filename, FAKE_EMPTYFILE))
+ cmd_addhist(ml_examine, filename, 1);
if (no_display && errmsgs > 0)
{
/*
@@ -745,7 +749,8 @@ use_logfile(filename)
*/
filename = shell_unquote(filename);
exists = open(filename, OPEN_READ);
- close(exists);
+ if (exists >= 0)
+ close(exists);
exists = (exists >= 0);
/*
diff --git a/contrib/less/filename.c b/contrib/less/filename.c
index 14e85e3..9631f1c 100644
--- a/contrib/less/filename.c
+++ b/contrib/less/filename.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 1984-2012 Mark Nudelman
+ * Copyright (C) 1984-2015 Mark Nudelman
*
* You may distribute under the terms of either the GNU General Public
* License or the Less License, as specified in the README file.
@@ -86,7 +86,7 @@ shell_unquote(str)
} else
{
char *esc = get_meta_escape();
- int esclen = strlen(esc);
+ int esclen = (int) strlen(esc);
while (*str != '\0')
{
if (esclen > 0 && strncmp(str, esc, esclen) == 0)
@@ -150,7 +150,7 @@ shell_quote(s)
char *newstr;
int len;
char *esc = get_meta_escape();
- int esclen = strlen(esc);
+ int esclen = (int) strlen(esc);
int use_quotes = 0;
int have_quotes = 0;
@@ -188,7 +188,7 @@ shell_quote(s)
* We can't quote a string that contains quotes.
*/
return (NULL);
- len = strlen(s) + 3;
+ len = (int) strlen(s) + 3;
}
/*
* Allocate and construct the new string.
@@ -235,7 +235,7 @@ dirfile(dirname, filename)
/*
* Construct the full pathname.
*/
- len= strlen(dirname) + strlen(filename) + 2;
+ len = (int) (strlen(dirname) + strlen(filename) + 2);
pathname = (char *) calloc(len, sizeof(char));
if (pathname == NULL)
return (NULL);
@@ -350,7 +350,7 @@ fexpand(s)
if (ifile == NULL_IFILE)
n++;
else
- n += strlen(get_filename(ifile));
+ n += (int) strlen(get_filename(ifile));
}
/*
* Else it is the first char in a string of
@@ -432,7 +432,7 @@ fcomplete(s)
for (slash = s+strlen(s)-1; slash > s; slash--)
if (*slash == *PATHNAME_SEP || *slash == '/')
break;
- len = strlen(s) + 4;
+ len = (int) strlen(s) + 4;
fpat = (char *) ecalloc(len, sizeof(char));
if (strchr(slash, '.') == NULL)
SNPRINTF1(fpat, len, "%s*.*", s);
@@ -441,7 +441,7 @@ fcomplete(s)
}
#else
{
- int len = strlen(s) + 2;
+ int len = (int) strlen(s) + 2;
fpat = (char *) ecalloc(len, sizeof(char));
SNPRINTF1(fpat, len, "%s*", s);
}
@@ -481,17 +481,25 @@ bin_file(f)
if (lseek(f, (off_t)0, SEEK_SET) == BAD_LSEEK)
return (0);
n = read(f, data, sizeof(data));
- pend = &data[n];
- for (p = data; p < pend; )
+ if (n <= 0)
+ return (0);
+ if (utf_mode)
+ {
+ bin_count = utf_bin_count(data, n);
+ } else
{
- LWCHAR c = step_char(&p, +1, pend);
- if (ctldisp == OPT_ONPLUS && IS_CSI_START(c))
+ pend = &data[n];
+ for (p = data; p < pend; )
{
- do {
- c = step_char(&p, +1, pend);
- } while (p < pend && is_ansi_middle(c));
- } else if (binary_char(c))
- bin_count++;
+ LWCHAR c = step_char(&p, +1, pend);
+ if (ctldisp == OPT_ONPLUS && IS_CSI_START(c))
+ {
+ do {
+ c = step_char(&p, +1, pend);
+ } while (p < pend && is_ansi_middle(c));
+ } else if (binary_char(c))
+ bin_count++;
+ }
}
/*
* Call it a binary file if there are more than 5 binary characters
@@ -593,7 +601,7 @@ shellcmd(cmd)
fd = popen(cmd, "r");
} else
{
- int len = strlen(shell) + strlen(esccmd) + 5;
+ int len = (int) (strlen(shell) + strlen(esccmd) + 5);
scmd = (char *) ecalloc(len, sizeof(char));
SNPRINTF3(scmd, len, "%s %s %s", shell, shell_coption(), esccmd);
free(esccmd);
@@ -701,14 +709,14 @@ lglob(filename)
gfilename = (char *) ecalloc(len, sizeof(char));
p = gfilename;
do {
- n = strlen(drive) + strlen(dir) + strlen(fnd.GLOB_NAME) + 1;
+ n = (int) (strlen(drive) + strlen(dir) + strlen(fnd.GLOB_NAME) + 1);
pathname = (char *) ecalloc(n, sizeof(char));
SNPRINTF3(pathname, n, "%s%s%s", drive, dir, fnd.GLOB_NAME);
qpathname = shell_quote(pathname);
free(pathname);
if (qpathname != NULL)
{
- n = strlen(qpathname);
+ n = (int) strlen(qpathname);
while (p - gfilename + n + 2 >= len)
{
/*
@@ -765,7 +773,7 @@ lglob(filename)
/*
* Invoke lessecho, and read its output (a globbed list of filenames).
*/
- len = strlen(lessecho) + strlen(ofilename) + (7*strlen(metachars())) + 24;
+ len = (int) (strlen(lessecho) + strlen(ofilename) + (7*strlen(metachars())) + 24);
cmd = (char *) ecalloc(len, sizeof(char));
SNPRINTF4(cmd, len, "%s -p0x%x -d0x%x -e%s ", lessecho, openquote, closequote, esc);
free(esc);
@@ -813,15 +821,20 @@ lglob(filename)
num_pct_s(lessopen)
char *lessopen;
{
- int num;
+ int num = 0;
- for (num = 0;; num++)
+ while (*lessopen != '\0')
{
- lessopen = strchr(lessopen, '%');
- if (lessopen == NULL)
- break;
- if (*++lessopen != 's')
- return (999);
+ if (*lessopen == '%')
+ {
+ if (lessopen[1] == '%')
+ ++lessopen;
+ else if (lessopen[1] == 's')
+ ++num;
+ else
+ return (999);
+ }
+ ++lessopen;
}
return (num);
}
@@ -881,7 +894,7 @@ open_altfile(filename, pf, pfd)
return (NULL);
}
- len = strlen(lessopen) + strlen(filename) + 2;
+ len = (int) (strlen(lessopen) + strlen(filename) + 2);
cmd = (char *) ecalloc(len, sizeof(char));
SNPRINTF1(cmd, len, lessopen, filename);
fd = shellcmd(cmd);
@@ -971,10 +984,10 @@ close_altfile(altfilename, filename, pipefd)
return;
if (num_pct_s(lessclose) > 2)
{
- error("Invalid LESSCLOSE variable");
+ error("Invalid LESSCLOSE variable", NULL_PARG);
return;
}
- len = strlen(lessclose) + strlen(filename) + strlen(altfilename) + 2;
+ len = (int) (strlen(lessclose) + strlen(filename) + strlen(altfilename) + 2);
cmd = (char *) ecalloc(len, sizeof(char));
SNPRINTF2(cmd, len, lessclose, filename, altfilename);
fd = shellcmd(cmd);
diff --git a/contrib/less/forwback.c b/contrib/less/forwback.c
index 0166266..9626dc1 100644
--- a/contrib/less/forwback.c
+++ b/contrib/less/forwback.c
@@ -1,6 +1,6 @@
/* $FreeBSD$ */
/*
- * Copyright (C) 1984-2012 Mark Nudelman
+ * Copyright (C) 1984-2015 Mark Nudelman
*
* You may distribute under the terms of either the GNU General Public
* License or the Less License, as specified in the README file.
@@ -21,6 +21,7 @@ public int screen_trashed;
public int squished;
public int no_back_scroll = 0;
public int forw_prompt;
+public int same_pos_bell = 1;
extern int sigs;
extern int top_scroll;
@@ -34,6 +35,11 @@ extern int ignore_eoi;
extern int clear_bg;
extern int final_attr;
extern int oldbot;
+#if HILITE_SEARCH
+extern int size_linebuf;
+extern int hilite_search;
+extern int status_col;
+#endif
#if TAGS
extern char *tagoption;
#endif
@@ -126,7 +132,6 @@ forw(n, pos, force, only_last, nblank)
int only_last;
int nblank;
{
- int eof = 0;
int nlines = 0;
int do_repaint;
static int first_time = 1;
@@ -145,6 +150,13 @@ forw(n, pos, force, only_last, nblank)
do_repaint = (only_last && n > sc_height-1) ||
(forw_scroll >= 0 && n > forw_scroll && n != sc_height-1);
+#if HILITE_SEARCH
+ if (hilite_search == OPT_ONPLUS || is_filtering() || status_col) {
+ prep_hilite(pos, pos + 4*size_linebuf, ignore_eoi ? 1 : -1);
+ pos = next_unfiltered(pos);
+ }
+#endif
+
if (!do_repaint)
{
if (top_scroll && n >= sc_height - 1 && pos != ch_length())
@@ -206,6 +218,9 @@ forw(n, pos, force, only_last, nblank)
* Get the next line from the file.
*/
pos = forw_line(pos);
+#if HILITE_SEARCH
+ pos = next_unfiltered(pos);
+#endif
if (pos == NULL_POSITION)
{
/*
@@ -214,7 +229,6 @@ forw(n, pos, force, only_last, nblank)
* Even if force is true, stop when the last
* line in the file reaches the top of screen.
*/
- eof = 1;
if (!force && position(TOP) != NULL_POSITION)
break;
if (!empty_lines(0, 0) &&
@@ -276,7 +290,7 @@ forw(n, pos, force, only_last, nblank)
forw_prompt = 1;
}
- if (nlines == 0)
+ if (nlines == 0 && same_pos_bell)
eof_bell();
else if (do_repaint)
repaint();
@@ -299,11 +313,20 @@ back(n, pos, force, only_last)
squish_check();
do_repaint = (n > get_back_scroll() || (only_last && n > sc_height-1));
+#if HILITE_SEARCH
+ if (hilite_search == OPT_ONPLUS || is_filtering() || status_col) {
+ prep_hilite((pos < 3*size_linebuf) ? 0 : pos - 3*size_linebuf, pos, -1);
+ }
+#endif
while (--n >= 0)
{
/*
* Get the previous line of input.
*/
+#if HILITE_SEARCH
+ pos = prev_unfiltered(pos);
+#endif
+
pos = back_line(pos);
if (pos == NULL_POSITION)
{
@@ -327,7 +350,7 @@ back(n, pos, force, only_last)
}
}
- if (nlines == 0)
+ if (nlines == 0 && same_pos_bell)
eof_bell();
else if (do_repaint)
repaint();
diff --git a/contrib/less/funcs.h b/contrib/less/funcs.h
index 325ba0e..53550f0 100644
--- a/contrib/less/funcs.h
+++ b/contrib/less/funcs.h
@@ -38,6 +38,7 @@
public void sync_logfile ();
public int ch_seek ();
public int ch_end_seek ();
+ public int ch_end_buffer_seek ();
public int ch_beg_seek ();
public POSITION ch_length ();
public POSITION ch_tell ();
@@ -58,6 +59,7 @@
public char * prutfchar ();
public int utf_len ();
public int is_utf8_well_formed ();
+ public int utf_bin_count ();
public LWCHAR get_wchar ();
public void put_wchar ();
public LWCHAR step_char ();
@@ -158,6 +160,7 @@
public POSITION back_line ();
public void set_attnpos ();
public void jump_forw ();
+ public void jump_forw_buffered ();
public void jump_back ();
public void repaint ();
public void jump_percent ();
@@ -227,7 +230,7 @@
public struct loption * findopt_name ();
public int iread ();
public void intread ();
- public long get_time ();
+ public time_type get_time ();
public char * errno_message ();
public int percentage ();
public POSITION percent_pos ();
@@ -242,6 +245,7 @@
public int query ();
public int compile_pattern ();
public void uncompile_pattern ();
+ public int valid_pattern ();
public int is_null_pattern ();
public int match_pattern ();
public POSITION position ();
@@ -267,6 +271,8 @@
public void clr_hilite ();
public void clr_filter ();
public int is_filtered ();
+ public POSITION next_unfiltered ();
+ public POSITION prev_unfiltered ();
public int is_hilited ();
public void chg_caseless ();
public void chg_hilite ();
diff --git a/contrib/less/help.c b/contrib/less/help.c
index 46b8ff1..aba7116 100644
--- a/contrib/less/help.c
+++ b/contrib/less/help.c
@@ -26,6 +26,7 @@ constant char helpdata[] = {
' ',' ','E','S','C','-',')',' ',' ','R','i','g','h','t','A','r','r','o','w',' ','*',' ',' ','L','e','f','t',' ',' ','o','n','e',' ','h','a','l','f',' ','s','c','r','e','e','n',' ','w','i','d','t','h',' ','(','o','r',' ','_','\b','N',' ','p','o','s','i','t','i','o','n','s',')','.','\n',
' ',' ','E','S','C','-','(',' ',' ','L','e','f','t','A','r','r','o','w',' ',' ','*',' ',' ','R','i','g','h','t',' ','o','n','e',' ','h','a','l','f',' ','s','c','r','e','e','n',' ','w','i','d','t','h',' ','(','o','r',' ','_','\b','N',' ','p','o','s','i','t','i','o','n','s',')','.','\n',
' ',' ','F',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','F','o','r','w','a','r','d',' ','f','o','r','e','v','e','r',';',' ','l','i','k','e',' ','"','t','a','i','l',' ','-','f','"','.','\n',
+' ',' ','E','S','C','-','F',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','L','i','k','e',' ','F',' ','b','u','t',' ','s','t','o','p',' ','w','h','e','n',' ','s','e','a','r','c','h',' ','p','a','t','t','e','r','n',' ','i','s',' ','f','o','u','n','d','.','\n',
' ',' ','r',' ',' ','^','R',' ',' ','^','L',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','R','e','p','a','i','n','t',' ','s','c','r','e','e','n','.','\n',
' ',' ','R',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','R','e','p','a','i','n','t',' ','s','c','r','e','e','n',',',' ','d','i','s','c','a','r','d','i','n','g',' ','b','u','f','f','e','r','e','d',' ','i','n','p','u','t','.','\n',
' ',' ',' ',' ',' ',' ',' ',' ','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','\n',
@@ -204,6 +205,8 @@ constant char helpdata[] = {
' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','D','o','n','\'','t',' ','s','e','n','d',' ','t','e','r','m','c','a','p',' ','k','e','y','p','a','d',' ','i','n','i','t','/','d','e','i','n','i','t',' ','s','t','r','i','n','g','s','.','\n',
' ',' ',' ',' ',' ',' ','.','.','.','.','.','.','.','.',' ',' ','-','-','f','o','l','l','o','w','-','n','a','m','e','\n',
' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','T','h','e',' ','F',' ','c','o','m','m','a','n','d',' ','c','h','a','n','g','e','s',' ','f','i','l','e','s',' ','i','f',' ','t','h','e',' ','i','n','p','u','t',' ','f','i','l','e',' ','i','s',' ','r','e','n','a','m','e','d','.','\n',
+' ',' ',' ',' ',' ',' ','.','.','.','.','.','.','.','.',' ',' ','-','-','u','s','e','-','b','a','c','k','s','l','a','s','h','\n',
+' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','S','u','b','s','e','q','u','e','n','t',' ','o','p','t','i','o','n','s',' ','u','s','e',' ','b','a','c','k','s','l','a','s','h',' ','a','s',' ','e','s','c','a','p','e',' ','c','h','a','r','.','\n',
'\n',
'\n',
' ','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','\n',
@@ -213,22 +216,22 @@ constant char helpdata[] = {
' ',' ',' ',' ',' ',' ',' ',' ','T','h','e','s','e',' ','k','e','y','s',' ','c','a','n',' ','b','e',' ','u','s','e','d',' ','t','o',' ','e','d','i','t',' ','t','e','x','t',' ','b','e','i','n','g',' ','e','n','t','e','r','e','d',' ','\n',
' ',' ',' ',' ',' ',' ',' ',' ','o','n',' ','t','h','e',' ','"','c','o','m','m','a','n','d',' ','l','i','n','e','"',' ','a','t',' ','t','h','e',' ','b','o','t','t','o','m',' ','o','f',' ','t','h','e',' ','s','c','r','e','e','n','.','\n',
'\n',
-' ','R','i','g','h','t','A','r','r','o','w',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','E','S','C','-','l',' ',' ',' ',' ',' ','M','o','v','e',' ','c','u','r','s','o','r',' ','r','i','g','h','t',' ','o','n','e',' ','c','h','a','r','a','c','t','e','r','.','\n',
-' ','L','e','f','t','A','r','r','o','w',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','E','S','C','-','h',' ',' ',' ',' ',' ','M','o','v','e',' ','c','u','r','s','o','r',' ','l','e','f','t',' ','o','n','e',' ','c','h','a','r','a','c','t','e','r','.','\n',
-' ','c','t','r','l','-','R','i','g','h','t','A','r','r','o','w',' ',' ','E','S','C','-','R','i','g','h','t','A','r','r','o','w',' ',' ','E','S','C','-','w',' ',' ',' ',' ',' ','M','o','v','e',' ','c','u','r','s','o','r',' ','r','i','g','h','t',' ','o','n','e',' ','w','o','r','d','.','\n',
-' ','c','t','r','l','-','L','e','f','t','A','r','r','o','w',' ',' ',' ','E','S','C','-','L','e','f','t','A','r','r','o','w',' ',' ',' ','E','S','C','-','b',' ',' ',' ',' ',' ','M','o','v','e',' ','c','u','r','s','o','r',' ','l','e','f','t',' ','o','n','e',' ','w','o','r','d','.','\n',
-' ','H','O','M','E',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','E','S','C','-','0',' ',' ',' ',' ',' ','M','o','v','e',' ','c','u','r','s','o','r',' ','t','o',' ','s','t','a','r','t',' ','o','f',' ','l','i','n','e','.','\n',
-' ','E','N','D',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','E','S','C','-','$',' ',' ',' ',' ',' ','M','o','v','e',' ','c','u','r','s','o','r',' ','t','o',' ','e','n','d',' ','o','f',' ','l','i','n','e','.','\n',
-' ','B','A','C','K','S','P','A','C','E',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','D','e','l','e','t','e',' ','c','h','a','r',' ','t','o',' ','l','e','f','t',' ','o','f',' ','c','u','r','s','o','r','.','\n',
-' ','D','E','L','E','T','E',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','E','S','C','-','x',' ',' ',' ',' ',' ','D','e','l','e','t','e',' ','c','h','a','r',' ','u','n','d','e','r',' ','c','u','r','s','o','r','.','\n',
-' ','c','t','r','l','-','B','A','C','K','S','P','A','C','E',' ',' ',' ','E','S','C','-','B','A','C','K','S','P','A','C','E',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','D','e','l','e','t','e',' ','w','o','r','d',' ','t','o',' ','l','e','f','t',' ','o','f',' ','c','u','r','s','o','r','.','\n',
-' ','c','t','r','l','-','D','E','L','E','T','E',' ',' ',' ',' ',' ',' ','E','S','C','-','D','E','L','E','T','E',' ',' ',' ',' ',' ',' ','E','S','C','-','X',' ',' ',' ',' ',' ','D','e','l','e','t','e',' ','w','o','r','d',' ','u','n','d','e','r',' ','c','u','r','s','o','r','.','\n',
-' ','c','t','r','l','-','U',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','E','S','C',' ','(','M','S','-','D','O','S',' ','o','n','l','y',')',' ',' ',' ',' ',' ',' ',' ',' ',' ','D','e','l','e','t','e',' ','e','n','t','i','r','e',' ','l','i','n','e','.','\n',
-' ','U','p','A','r','r','o','w',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','E','S','C','-','k',' ',' ',' ',' ',' ','R','e','t','r','i','e','v','e',' ','p','r','e','v','i','o','u','s',' ','c','o','m','m','a','n','d',' ','l','i','n','e','.','\n',
-' ','D','o','w','n','A','r','r','o','w',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','E','S','C','-','j',' ',' ',' ',' ',' ','R','e','t','r','i','e','v','e',' ','n','e','x','t',' ','c','o','m','m','a','n','d',' ','l','i','n','e','.','\n',
-' ','T','A','B',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','C','o','m','p','l','e','t','e',' ','f','i','l','e','n','a','m','e',' ','&',' ','c','y','c','l','e','.','\n',
-' ','S','H','I','F','T','-','T','A','B',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','E','S','C','-','T','A','B',' ',' ',' ','C','o','m','p','l','e','t','e',' ','f','i','l','e','n','a','m','e',' ','&',' ','r','e','v','e','r','s','e',' ','c','y','c','l','e','.','\n',
-' ','c','t','r','l','-','L',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','C','o','m','p','l','e','t','e',' ','f','i','l','e','n','a','m','e',',',' ','l','i','s','t',' ','a','l','l','.','\n',
+' ','R','i','g','h','t','A','r','r','o','w',' ','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.',' ','E','S','C','-','l',' ','.','.','.',' ','M','o','v','e',' ','c','u','r','s','o','r',' ','r','i','g','h','t',' ','o','n','e',' ','c','h','a','r','a','c','t','e','r','.','\n',
+' ','L','e','f','t','A','r','r','o','w',' ','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.',' ','E','S','C','-','h',' ','.','.','.',' ','M','o','v','e',' ','c','u','r','s','o','r',' ','l','e','f','t',' ','o','n','e',' ','c','h','a','r','a','c','t','e','r','.','\n',
+' ','c','t','r','l','-','R','i','g','h','t','A','r','r','o','w',' ',' ','E','S','C','-','R','i','g','h','t','A','r','r','o','w',' ',' ','E','S','C','-','w',' ','.','.','.',' ','M','o','v','e',' ','c','u','r','s','o','r',' ','r','i','g','h','t',' ','o','n','e',' ','w','o','r','d','.','\n',
+' ','c','t','r','l','-','L','e','f','t','A','r','r','o','w',' ',' ',' ','E','S','C','-','L','e','f','t','A','r','r','o','w',' ',' ',' ','E','S','C','-','b',' ','.','.','.',' ','M','o','v','e',' ','c','u','r','s','o','r',' ','l','e','f','t',' ','o','n','e',' ','w','o','r','d','.','\n',
+' ','H','O','M','E',' ','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.',' ','E','S','C','-','0',' ','.','.','.',' ','M','o','v','e',' ','c','u','r','s','o','r',' ','t','o',' ','s','t','a','r','t',' ','o','f',' ','l','i','n','e','.','\n',
+' ','E','N','D',' ','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.',' ','E','S','C','-','$',' ','.','.','.',' ','M','o','v','e',' ','c','u','r','s','o','r',' ','t','o',' ','e','n','d',' ','o','f',' ','l','i','n','e','.','\n',
+' ','B','A','C','K','S','P','A','C','E',' ','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.',' ','D','e','l','e','t','e',' ','c','h','a','r',' ','t','o',' ','l','e','f','t',' ','o','f',' ','c','u','r','s','o','r','.','\n',
+' ','D','E','L','E','T','E',' ','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.',' ','E','S','C','-','x',' ','.','.','.',' ','D','e','l','e','t','e',' ','c','h','a','r',' ','u','n','d','e','r',' ','c','u','r','s','o','r','.','\n',
+' ','c','t','r','l','-','B','A','C','K','S','P','A','C','E',' ',' ',' ','E','S','C','-','B','A','C','K','S','P','A','C','E',' ','.','.','.','.','.','.','.','.','.','.','.',' ','D','e','l','e','t','e',' ','w','o','r','d',' ','t','o',' ','l','e','f','t',' ','o','f',' ','c','u','r','s','o','r','.','\n',
+' ','c','t','r','l','-','D','E','L','E','T','E',' ','.','.','.','.',' ','E','S','C','-','D','E','L','E','T','E',' ','.','.','.','.',' ','E','S','C','-','X',' ','.','.','.',' ','D','e','l','e','t','e',' ','w','o','r','d',' ','u','n','d','e','r',' ','c','u','r','s','o','r','.','\n',
+' ','c','t','r','l','-','U',' ','.','.','.','.','.','.','.','.','.',' ','E','S','C',' ','(','M','S','-','D','O','S',' ','o','n','l','y',')',' ','.','.','.','.','.','.','.',' ','D','e','l','e','t','e',' ','e','n','t','i','r','e',' ','l','i','n','e','.','\n',
+' ','U','p','A','r','r','o','w',' ','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.',' ','E','S','C','-','k',' ','.','.','.',' ','R','e','t','r','i','e','v','e',' ','p','r','e','v','i','o','u','s',' ','c','o','m','m','a','n','d',' ','l','i','n','e','.','\n',
+' ','D','o','w','n','A','r','r','o','w',' ','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.',' ','E','S','C','-','j',' ','.','.','.',' ','R','e','t','r','i','e','v','e',' ','n','e','x','t',' ','c','o','m','m','a','n','d',' ','l','i','n','e','.','\n',
+' ','T','A','B',' ','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.',' ','C','o','m','p','l','e','t','e',' ','f','i','l','e','n','a','m','e',' ','&',' ','c','y','c','l','e','.','\n',
+' ','S','H','I','F','T','-','T','A','B',' ','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.',' ','E','S','C','-','T','A','B',' ',' ',' ','C','o','m','p','l','e','t','e',' ','f','i','l','e','n','a','m','e',' ','&',' ','r','e','v','e','r','s','e',' ','c','y','c','l','e','.','\n',
+' ','c','t','r','l','-','L',' ','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.',' ','C','o','m','p','l','e','t','e',' ','f','i','l','e','n','a','m','e',',',' ','l','i','s','t',' ','a','l','l','.','\n',
'\n',
'\n',
0 };
diff --git a/contrib/less/ifile.c b/contrib/less/ifile.c
index 3e5e855..fea2ea1 100644
--- a/contrib/less/ifile.c
+++ b/contrib/less/ifile.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 1984-2012 Mark Nudelman
+ * Copyright (C) 1984-2015 Mark Nudelman
*
* You may distribute under the terms of either the GNU General Public
* License or the Less License, as specified in the README file.
diff --git a/contrib/less/input.c b/contrib/less/input.c
index b211323..9419a02 100644
--- a/contrib/less/input.c
+++ b/contrib/less/input.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 1984-2012 Mark Nudelman
+ * Copyright (C) 1984-2015 Mark Nudelman
*
* You may distribute under the terms of either the GNU General Public
* License or the Less License, as specified in the README file.
@@ -60,6 +60,7 @@ get_forw_line:
}
#if HILITE_SEARCH
if (hilite_search == OPT_ONPLUS || is_filtering() || status_col)
+ {
/*
* If we are ignoring EOI (command F), only prepare
* one line ahead, to avoid getting stuck waiting for
@@ -69,6 +70,8 @@ get_forw_line:
*/
prep_hilite(curr_pos, curr_pos + 3*size_linebuf,
ignore_eoi ? 1 : -1);
+ curr_pos = next_unfiltered(curr_pos);
+ }
#endif
if (ch_seek(curr_pos))
{
@@ -439,19 +442,22 @@ set_attnpos(pos)
{
c = ch_forw_get();
if (c == EOI)
- return;
- if (c != '\n' && c != '\r')
break;
+ if (c == '\n' || c == '\r')
+ {
+ (void) ch_back_get();
+ break;
+ }
pos++;
}
+ end_attnpos = pos;
+ for (;;)
+ {
+ c = ch_back_get();
+ if (c == EOI || c == '\n' || c == '\r')
+ break;
+ pos--;
+ }
}
start_attnpos = pos;
- for (;;)
- {
- c = ch_forw_get();
- pos++;
- if (c == EOI || c == '\n' || c == '\r')
- break;
- }
- end_attnpos = pos;
}
diff --git a/contrib/less/jump.c b/contrib/less/jump.c
index 075aa64..8373d8b 100644
--- a/contrib/less/jump.c
+++ b/contrib/less/jump.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 1984-2012 Mark Nudelman
+ * Copyright (C) 1984-2015 Mark Nudelman
*
* You may distribute under the terms of either the GNU General Public
* License or the Less License, as specified in the README file.
@@ -61,6 +61,24 @@ jump_forw()
}
/*
+ * Jump to the last buffered line in the file.
+ */
+ public void
+jump_forw_buffered()
+{
+ POSITION end;
+
+ if (ch_end_buffer_seek())
+ {
+ error("Cannot seek to end of buffers", NULL_PARG);
+ return;
+ }
+ end = ch_tell();
+ if (end != NULL_POSITION && end > 0)
+ jump_line_loc(end-1, sc_height-1);
+}
+
+/*
* Jump to line n in the file.
*/
public void
@@ -281,6 +299,9 @@ jump_loc(pos, sline)
*/
break;
}
+#if HILITE_SEARCH
+ pos = next_unfiltered(pos);
+#endif
if (pos >= tpos)
{
/*
diff --git a/contrib/less/less.h b/contrib/less/less.h
index fada513..f57fb1e 100644
--- a/contrib/less/less.h
+++ b/contrib/less/less.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 1984-2012 Mark Nudelman
+ * Copyright (C) 1984-2015 Mark Nudelman
*
* You may distribute under the terms of either the GNU General Public
* License or the Less License, as specified in the README file.
@@ -295,6 +295,15 @@ struct scrpos
int ln;
};
+/*
+ * A mark is an ifile (input file) plus a position within the file.
+ */
+struct mark
+{
+ IFILE m_ifile;
+ struct scrpos m_scrpos;
+};
+
typedef union parg
{
char *p_string;
@@ -310,6 +319,17 @@ struct textlist
char *endstring;
};
+struct wchar_range
+{
+ LWCHAR first, last;
+};
+
+struct wchar_range_table
+{
+ struct wchar_range *table;
+ int count;
+};
+
#define EOI (-1)
#define READ_INTR (-2)
@@ -445,6 +465,7 @@ struct textlist
#define ESC CONTROL('[')
#define CSI ((unsigned char)'\233')
+#define CHAR_END_COMMAND 0x40000000
#if _OSK_MWC32
#define LSIGNAL(sig,func) os9_signal(sig,func)
@@ -498,6 +519,12 @@ struct textlist
#define CVT_CRLF 04 /* Remove CR after LF */
#define CVT_ANSI 010 /* Remove ANSI escape sequences */
+#if HAVE_TIME_T
+#define time_type time_t
+#else
+#define time_type long
+#endif
+
#include "funcs.h"
/* Functions not included in funcs.h */
diff --git a/contrib/less/less.hlp b/contrib/less/less.hlp
index 45a7fe5..2a8e3e7 100644
--- a/contrib/less/less.hlp
+++ b/contrib/less/less.hlp
@@ -23,6 +23,7 @@
ESC-) RightArrow * Left one half screen width (or _N positions).
ESC-( LeftArrow * Right one half screen width (or _N positions).
F Forward forever; like "tail -f".
+ ESC-F Like F but stop when search pattern is found.
r ^R ^L Repaint screen.
R Repaint screen, discarding buffered input.
---------------------------------------------------
@@ -201,6 +202,8 @@
Don't send termcap keypad init/deinit strings.
........ --follow-name
The F command changes files if the input file is renamed.
+ ........ --use-backslash
+ Subsequent options use backslash as escape char.
---------------------------------------------------------------------------
@@ -210,21 +213,21 @@
These keys can be used to edit text being entered
on the "command line" at the bottom of the screen.
- RightArrow ESC-l Move cursor right one character.
- LeftArrow ESC-h Move cursor left one character.
- ctrl-RightArrow ESC-RightArrow ESC-w Move cursor right one word.
- ctrl-LeftArrow ESC-LeftArrow ESC-b Move cursor left one word.
- HOME ESC-0 Move cursor to start of line.
- END ESC-$ Move cursor to end of line.
- BACKSPACE Delete char to left of cursor.
- DELETE ESC-x Delete char under cursor.
- ctrl-BACKSPACE ESC-BACKSPACE Delete word to left of cursor.
- ctrl-DELETE ESC-DELETE ESC-X Delete word under cursor.
- ctrl-U ESC (MS-DOS only) Delete entire line.
- UpArrow ESC-k Retrieve previous command line.
- DownArrow ESC-j Retrieve next command line.
- TAB Complete filename & cycle.
- SHIFT-TAB ESC-TAB Complete filename & reverse cycle.
- ctrl-L Complete filename, list all.
+ RightArrow ..................... ESC-l ... Move cursor right one character.
+ LeftArrow ...................... ESC-h ... Move cursor left one character.
+ ctrl-RightArrow ESC-RightArrow ESC-w ... Move cursor right one word.
+ ctrl-LeftArrow ESC-LeftArrow ESC-b ... Move cursor left one word.
+ HOME ........................... ESC-0 ... Move cursor to start of line.
+ END ............................ ESC-$ ... Move cursor to end of line.
+ BACKSPACE ................................ Delete char to left of cursor.
+ DELETE ......................... ESC-x ... Delete char under cursor.
+ ctrl-BACKSPACE ESC-BACKSPACE ........... Delete word to left of cursor.
+ ctrl-DELETE .... ESC-DELETE .... ESC-X ... Delete word under cursor.
+ ctrl-U ......... ESC (MS-DOS only) ....... Delete entire line.
+ UpArrow ........................ ESC-k ... Retrieve previous command line.
+ DownArrow ...................... ESC-j ... Retrieve next command line.
+ TAB ...................................... Complete filename & cycle.
+ SHIFT-TAB ...................... ESC-TAB Complete filename & reverse cycle.
+ ctrl-L ................................... Complete filename, list all.
diff --git a/contrib/less/less.nro b/contrib/less/less.nro
index eba98ee..b3d9874 100644
--- a/contrib/less/less.nro
+++ b/contrib/less/less.nro
@@ -1,4 +1,4 @@
-.TH LESS 1 "Version 458: 04 Apr 2013"
+.TH LESS 1 "Version 481: 31 Aug 2015"
.SH NAME
less \- opposite of more
.SH SYNOPSIS
@@ -12,19 +12,19 @@ less \- opposite of more
.br
.B "less [\-[+]aABcCdeEfFgGiIJKLmMnNqQrRsSuUVwWX~]"
.br
-.B " [\-b \fIspace\fP] [\-h \fIlines\fP] [\-j \fIline\fP] [\-k \fIkeyfile\fP]"
+.B " [\-b \fIspace\/\fP] [\-h \fIlines\/\fP] [\-j \fIline\/\fP] [\-k \fIkeyfile\/\fP]"
.br
-.B " [\-{oO} \fIlogfile\fP] [\-p \fIpattern\fP] [\-P \fIprompt\fP] [\-t \fItag\fP]"
+.B " [\-{oO} \fIlogfile\/\fP] [\-p \fIpattern\/\fP] [\-P \fIprompt\/\fP] [\-t \fItag\/\fP]"
.br
-.B " [\-T \fItagsfile\fP] [\-x \fItab\fP,...] [\-y \fIlines\fP] [\-[z] \fIlines\fP]"
+.B " [\-T \fItagsfile\/\fP] [\-x \fItab\/\fP,...] [\-y \fIlines\/\fP] [\-[z] \fIlines\/\fP]"
.br
-.B " [\-# \fIshift\fP] [+[+]\fIcmd\fP] [\-\-] [\fIfilename\fP]..."
+.B " [\-# \fIshift\/\fP] [+[+]\fIcmd\/\fP] [\-\-] [\fIfilename\/\fP]..."
.br
(See the OPTIONS section for alternate option syntax with long option names.)
.SH DESCRIPTION
.I Less
-is a program similar to
+is a program similar to
.I more
(1), but which allows backward movement
in the file as well as forward movement.
@@ -45,7 +45,7 @@ Commands are based on both
.I more
and
.I vi.
-Commands may be preceded by a decimal number,
+Commands may be preceded by a decimal number,
called N in the descriptions below.
The number is used by some commands, as indicated.
@@ -70,7 +70,7 @@ Scroll forward N lines, default 1.
The entire N lines are displayed, even if N is more than the screen size.
.IP "d or ^D"
Scroll forward N lines, default one half of the screen size.
-If N is specified, it becomes the new default for
+If N is specified, it becomes the new default for
subsequent d and u commands.
.IP "b or ^B or ESC-v"
Scroll backward N lines, default one window (see option \-z below).
@@ -83,8 +83,12 @@ The entire N lines are displayed, even if N is more than the screen size.
Warning: some systems use ^Y as a special job control character.
.IP "u or ^U"
Scroll backward N lines, default one half of the screen size.
-If N is specified, it becomes the new default for
+If N is specified, it becomes the new default for
subsequent d and u commands.
+.IP "J"
+Like j, but continues to scroll beyond the end of the file.
+.IP "K or Y"
+Like k, but continues to scroll beyond the beginning of the file.
.IP "ESC-) or RIGHTARROW"
Scroll horizontally right N characters, default half the screen width
(see the \-# option).
@@ -111,7 +115,7 @@ while it is being viewed.
(The behavior is similar to the "tail \-f" command.)
.IP "ESC-F"
Like F, but as soon as a line is found which matches
-the last search pattern, the terminal bell is rung
+the last search pattern, the terminal bell is rung
and forward scrolling stops.
.IP "g or < or ESC-<"
Go to line N in the file, default 1 (beginning of file).
@@ -121,6 +125,9 @@ Go to line N in the file, default the end of the file.
(Warning: this may be slow if N is large,
or if N is not specified and
standard input, rather than a file, is being read.)
+.IP "ESC-G"
+Same as G, except if no number N is specified and the input is standard input,
+goes to the last line which is currently buffered.
.IP "p or %"
Go to a position N percent into the file.
N should be between 0 and 100, and may contain a decimal point.
@@ -154,16 +161,16 @@ Like }, but applies to square brackets rather than curly brackets.
Followed by two characters,
acts like {, but uses the two characters as open and close brackets,
respectively.
-For example, "ESC ^F < >" could be used to
+For example, "ESC ^F < >" could be used to
go forward to the > which matches the < in the top displayed line.
.IP "ESC-^B"
Followed by two characters,
acts like }, but uses the two characters as open and close brackets,
respectively.
-For example, "ESC ^B < >" could be used to
+For example, "ESC ^B < >" could be used to
go backward to the < which matches the > in the bottom displayed line.
.IP m
-Followed by any lowercase letter,
+Followed by any lowercase letter,
marks the current position with that letter.
.IP "'"
(Single quote.)
@@ -193,7 +200,7 @@ they modify the type of search rather than become part of the pattern:
Search for lines which do NOT match the pattern.
.IP "^E or *"
Search multiple files.
-That is, if the search reaches the END of the current file
+That is, if the search reaches the END of the current file
without finding a match,
the search continues in the next file in the command line list.
.IP "^F or @"
@@ -202,7 +209,7 @@ in the command line list,
regardless of what is currently displayed on the screen
or the settings of the \-a or \-j options.
.IP "^K"
-Highlight any text which matches the pattern on the current screen,
+Highlight any text which matches the pattern on the current screen,
but don't move to the first match (KEEP current position).
.IP "^R"
Don't interpret regular expression metacharacters;
@@ -210,7 +217,8 @@ that is, do a simple textual comparison.
.RE
.IP ?pattern
Search backward in the file for the N-th line containing the pattern.
-The search starts at the line immediately before the top line displayed.
+The search starts at the last line displayed
+(but see the \-a and \-j options, which change this).
.sp
Certain characters are special as in the / command:
.RS
@@ -218,7 +226,7 @@ Certain characters are special as in the / command:
Search for lines which do NOT match the pattern.
.IP "^E or *"
Search multiple files.
-That is, if the search reaches the beginning of the current file
+That is, if the search reaches the beginning of the current file
without finding a match,
the search continues in the previous file in the command line list.
.IP "^F or @"
@@ -254,7 +262,7 @@ Repeat previous search, but in the reverse direction
and crossing file boundaries.
.IP "ESC-u"
Undo search highlighting.
-Turn off highlighting of strings matching the current search pattern.
+Turn off highlighting of strings matching the current search pattern.
If highlighting is already off because of a previous ESC-u command,
turn highlighting back on.
Any search command will also turn highlighting back on.
@@ -282,10 +290,10 @@ Examine a new file.
If the filename is missing, the "current" file (see the :n and :p commands
below) from the list of files in the command line is re-examined.
A percent sign (%) in the filename is replaced by the name of the
-current file.
+current file.
A pound sign (#) is replaced by the name of the previously examined file.
-However, two consecutive percent signs are simply
-replaced with a single percent sign.
+However, two consecutive percent signs are simply
+replaced with a single percent sign.
This allows you to enter a filename that contains a percent sign
in the name.
Similarly, two consecutive pound signs are replaced with a single pound sign.
@@ -338,7 +346,7 @@ the current setting is printed and nothing is changed.
Like the \- command, but takes a long option name (see OPTIONS below)
rather than a single option letter.
You must press ENTER or RETURN after typing the option name.
-A ^P immediately after the second dash suppresses printing of a
+A ^P immediately after the second dash suppresses printing of a
message describing the new setting, as in the \- command.
.IP \-+
Followed by one of the command line option letters
@@ -370,19 +378,19 @@ rather than a single option letter.
You must press ENTER or RETURN after typing the option name.
.IP +cmd
Causes the specified cmd to be executed each time a new file is examined.
-For example, +G causes
+For example, +G causes
.I less
-to initially display each file starting at the end
+to initially display each file starting at the end
rather than the beginning.
.IP V
-Prints the version number of
-.I less
+Prints the version number of
+.I less
being run.
.IP "q or Q or :q or :Q or ZZ"
Exits
.I less.
.PP
-The following
+The following
four
commands may or may not be valid, depending on your particular installation.
.PP
@@ -395,7 +403,7 @@ See also the discussion of LESSEDIT under the section on PROMPTS below.
.IP "! shell-command"
Invokes a shell to run the shell-command given.
A percent sign (%) in the command is replaced by the name of the
-current file.
+current file.
A pound sign (#) is replaced by the name of the previously examined file.
"!!" repeats the last shell command.
"!" with no shell command simply invokes a shell.
@@ -408,7 +416,7 @@ Pipes a section of the input file to the given shell command.
The section of the file to be piped is between the first line on
the current screen and the position marked by the letter.
<m> may also be ^ or $ to indicate beginning or end of file respectively.
-If <m> is . or newline, the current screen is piped.
+If <m> is \&.\& or newline, the current screen is piped.
.IP "s filename"
Save the input to a file.
This only works if the input is a pipe, not an ordinary file.
@@ -416,16 +424,16 @@ This only works if the input is a pipe, not an ordinary file.
.SH OPTIONS
Command line options are described below.
Most options may be changed while
-.I less
+.I less
is running, via the "\-" command.
.PP
-Most options may be given in one of two forms:
+Most options may be given in one of two forms:
either a dash followed by a single letter,
or two dashes followed by a long option name.
A long option name may be abbreviated as long as
the abbreviation is unambiguous.
For example, \-\-quit-at-eof may be abbreviated \-\-quit, but not
---qui, since both \-\-quit-at-eof and \-\-quiet begin with \-\-qui.
+\-\-qui, since both \-\-quit-at-eof and \-\-quiet begin with \-\-qui.
Some long option names are in uppercase, such as \-\-QUIT-AT-EOF, as
distinct from \-\-quit-at-eof.
Such option names need only have their first letter capitalized;
@@ -433,20 +441,20 @@ the remainder of the name may be in either case.
For example, \-\-Quit-at-eof is equivalent to \-\-QUIT-AT-EOF.
.PP
Options are also taken from the environment variable "LESS".
-For example,
-to avoid typing "less \-options ..." each time
-.I less
-is invoked, you might tell
+For example,
+to avoid typing "less \-options \&...\&" each time
+.I less
+is invoked, you might tell
.I csh:
.sp
-setenv LESS "-options"
+setenv LESS "\-options"
.sp
-or if you use
+or if you use
.I sh:
.sp
-LESS="-options"; export LESS
+LESS="\-options"; export LESS
.sp
-On MS-DOS, you don't need the quotes, but you should replace any
+On MS-DOS, you don't need the quotes, but you should replace any
percent signs in the options string by double percent signs.
.sp
The environment variable is parsed before the command line,
@@ -461,11 +469,11 @@ For example, you can set two \-D options on MS-DOS like this:
.sp
LESS="Dn9.1$Ds4.1"
.sp
-If the --use-backslash option appears earlier in the options, then
+If the \-\-use-backslash option appears earlier in the options, then
a dollar sign or backslash may be included literally in an option string
by preceding it with a backslash.
-If the --use-backslash option is not in effect, then backslashes are
-not treated specially, and there is no way to include a dollar sign
+If the \-\-use-backslash option is not in effect, then backslashes are
+not treated specially, and there is no way to include a dollar sign
in the option string.
.IP "\-? or \-\-help"
This option displays a summary of the commands accepted by
@@ -484,8 +492,8 @@ the bottom of the screen
and backward searches to start at the top of the screen,
thus skipping all lines displayed on the screen.
.IP "\-A or \-\-SEARCH-SKIP-SCREEN"
-Causes all forward searches (not just non-repeated searches)
-to start just after the target line, and all backward searches
+Causes all forward searches (not just non-repeated searches)
+to start just after the target line, and all backward searches
to start just before the target line.
Thus, forward searches will skip part of the displayed screen
(from the first line up to and including the target line).
@@ -496,9 +504,9 @@ This was the default behavior in less versions prior to 441.
Specifies the amount of buffer space
.I less
will use for each file, in units of kilobytes (1024 bytes).
-By default 64K of buffer space is used for each file
+By default 64\ K of buffer space is used for each file
(unless the file is a pipe; see the \-B option).
-The \-b option specifies instead that \fIn\fP kilobytes of
+The \-b option specifies instead that \fIn\fP kilobytes of
buffer space should be used for each file.
If \fIn\fP is \-1, buffer space is unlimited; that is,
the entire file can be read into memory.
@@ -508,18 +516,18 @@ buffers are allocated automatically as needed.
If a large amount of data is read from the pipe, this can cause
a large amount of memory to be allocated.
The \-B option disables this automatic allocation of buffers for pipes,
-so that only 64K
+so that only 64\ K
(or the amount of space specified by the \-b option)
is used for the pipe.
Warning: use of \-B can result in erroneous display, since only the
-most recently viewed part of the piped data is kept in memory;
+most recently viewed part of the piped data is kept in memory;
any earlier data is lost.
.IP "\-c or \-\-clear-screen"
Causes full screen repaints to be painted from the top line down.
By default,
full screen repaints are done by scrolling from the bottom of the screen.
.IP "\-C or \-\-CLEAR-SCREEN"
-Same as \-c, for compatibility with older versions of
+Same as \-c, for compatibility with older versions of
.I less.
.IP "\-d or \-\-dumb"
The \-d option suppresses the error message
@@ -532,24 +540,24 @@ on a dumb terminal.
.IP "\-D\fBx\fP\fIcolor\fP or \-\-color=\fBx\fP\fIcolor\fP"
[MS-DOS only]
Sets the color of the text displayed.
-\fBx\fP is a single character which selects the type of text whose color is
+\fBx\fP is a single character which selects the type of text whose color is
being set: n=normal, s=standout, d=bold, u=underlined, k=blink.
-\fIcolor\fP is a pair of numbers separated by a period.
-The first number selects the foreground color and the second selects
+\fIcolor\fP is a pair of numbers separated by a period.
+The first number selects the foreground color and the second selects
the background color of the text.
A single number \fIN\fP is the same as \fIN.M\fP,
where \fIM\fP is the normal background color.
.IP "\-e or \-\-quit-at-eof"
-Causes
-.I less
+Causes
+.I less
to automatically exit
the second time it reaches end-of-file.
-By default, the only way to exit
+By default, the only way to exit
.I less
is via the "q" command.
.IP "\-E or \-\-QUIT-AT-EOF"
-Causes
+Causes
.I less
to automatically exit the first time it reaches end-of-file.
.IP "\-f or \-\-force"
@@ -567,13 +575,13 @@ Causes
to automatically exit
if the entire file can be displayed on the first screen.
.IP "\-g or \-\-hilite-search"
-Normally,
-.I less
+Normally,
+.I less
will highlight ALL strings which match the last search command.
-The \-g option changes this behavior to highlight only the particular string
+The \-g option changes this behavior to highlight only the particular string
which was found by the last search command.
-This can cause
-.I less
+This can cause
+.I less
to run somewhat faster than the default.
.IP "\-G or \-\-HILITE-SEARCH"
The \-G option suppresses all highlighting of strings found by search commands.
@@ -587,11 +595,11 @@ backward, \-h0 is implied.)
Causes searches to ignore case; that is,
uppercase and lowercase are considered identical.
This option is ignored if any uppercase letters
-appear in the search pattern;
+appear in the search pattern;
in other words,
if a pattern contains uppercase letters, then that search does not ignore case.
.IP "\-I or \-\-IGNORE-CASE"
-Like \-i, but searches ignore case even if
+Like \-i, but searches ignore case even if
the pattern contains uppercase letters.
.IP "\-j\fIn\fP or \-\-jump-target=\fIn\fP"
Specifies a line on the screen where the "target" line
@@ -605,18 +613,21 @@ The number may be negative to specify a line relative to the bottom
of the screen: the bottom line on the screen is \-1, the second
to the bottom is \-2, and so on.
Alternately, the screen line may be specified as a fraction of the height
-of the screen, starting with a decimal point: .5 is in the middle of the
-screen, .3 is three tenths down from the first line, and so on.
+of the screen, starting with a decimal point: \&.5 is in the middle of the
+screen, \&.3 is three tenths down from the first line, and so on.
If the line is specified as a fraction, the actual line number
is recalculated if the terminal window is resized, so that the
target line remains at the specified fraction of the screen height.
-If any form of the \-j option is used,
-forward searches begin at the line immediately after the target line,
-and backward searches begin at the target line,
+If any form of the \-j option is used,
+repeated forward searches (invoked with "n" or "N")
+begin at the line immediately after the target line,
+and repeated backward searches begin at the target line,
unless changed by \-a or \-A.
For example, if "\-j4" is used, the target line is the
fourth line on the screen, so forward searches begin at the fifth line
on the screen.
+However nonrepeated searches (invoked with "/" or "?")
+always begin at the start or end of the current screen respectively.
.IP "\-J or \-\-status-column"
Displays a status column at the left edge of the screen.
The status column shows the lines that matched the current search.
@@ -630,7 +641,7 @@ to open and interpret the named file as a
Multiple \-k options may be specified.
If the LESSKEY or LESSKEY_SYSTEM environment variable is set, or
if a lesskey file is found in a standard place (see KEY BINDINGS),
-it is also used as a
+it is also used as a
.I lesskey
file.
.IP "\-K or \-\-quit-on-intr"
@@ -641,16 +652,16 @@ when an interrupt character (usually ^C) is typed.
Normally, an interrupt character causes
.I less
to stop whatever it is doing and return to its command prompt.
-Note that use of this option makes it impossible to return to the
+Note that use of this option makes it impossible to return to the
command prompt from the "F" command.
.IP "\-L or \-\-no-lessopen"
Ignore the LESSOPEN environment variable
(see the INPUT PREPROCESSOR section below).
-This option can be set from within \fIless\fP,
-but it will apply only to files opened subsequently, not to the
+This option can be set from within \fIless\fP,
+but it will apply only to files opened subsequently, not to the
file which is currently open.
.IP "\-m or \-\-long-prompt"
-Causes
+Causes
.I less
to prompt verbosely (like \fImore\fP),
with the percent into the file.
@@ -658,9 +669,9 @@ By default,
.I less
prompts with a colon.
.IP "\-M or \-\-LONG-PROMPT"
-Causes
+Causes
.I less
-to prompt even more verbosely than
+to prompt even more verbosely than
.I more.
.IP "\-n or \-\-line-numbers"
Suppresses line numbers.
@@ -681,7 +692,7 @@ Causes
to copy its input to the named file as it is being viewed.
This applies only when the input file is a pipe,
not an ordinary file.
-If the file already exists,
+If the file already exists,
.I less
will ask for confirmation before overwriting it.
.IP "\-O\fIfilename\fP or \-\-LOG-FILE=\fIfilename\fP"
@@ -689,14 +700,14 @@ The \-O option is like \-o, but it will overwrite an existing
file without asking for confirmation.
.sp
If no log file has been specified,
-the \-o and \-O options can be used from within
+the \-o and \-O options can be used from within
.I less
to specify a log file.
Without a file name, they will simply report the name of the log file.
The "s" command is equivalent to specifying \-o from within
.I less.
.IP "\-p\fIpattern\fP or \-\-pattern=\fIpattern\fP"
-The \-p option on the command line is equivalent to
+The \-p option on the command line is equivalent to
specifying +/\fIpattern\fP;
that is, it tells
.I less
@@ -705,24 +716,24 @@ to start at the first occurrence of \fIpattern\fP in the file.
Provides a way to tailor the three prompt
styles to your own preference.
This option would normally be put in the LESS environment
-variable, rather than being typed in with each
+variable, rather than being typed in with each
.I less
command.
Such an option must either be the last option in the LESS variable,
or be terminated by a dollar sign.
--Ps followed by a string changes the default (short) prompt
+ \-Ps followed by a string changes the default (short) prompt
to that string.
--Pm changes the medium (\-m) prompt.
--PM changes the long (\-M) prompt.
--Ph changes the prompt for the help screen.
--P= changes the message printed by the = command.
--Pw changes the message printed while waiting for data (in the F command).
-All prompt strings consist of a sequence of
+ \-Pm changes the medium (\-m) prompt.
+ \-PM changes the long (\-M) prompt.
+ \-Ph changes the prompt for the help screen.
+ \-P= changes the message printed by the = command.
+ \-Pw changes the message printed while waiting for data (in the F command).
+All prompt strings consist of a sequence of
letters and special escape sequences.
See the section on PROMPTS for more details.
.IP "\-q or \-\-quiet or \-\-silent"
Causes moderately "quiet" operation:
-the terminal bell is not rung
+the terminal bell is not rung
if an attempt is made to scroll past the end of the file
or before the beginning of the file.
If the terminal has a "visual bell", it is used instead.
@@ -748,9 +759,9 @@ Like \-r, but only ANSI "color" escape sequences are output in "raw" form.
Unlike \-r, the screen appearance is maintained correctly in most cases.
ANSI "color" escape sequences are sequences of the form:
.sp
- ESC [ ... m
+ ESC [ \&...\& m
.sp
-where the "..." is zero or more color specification characters
+where the "...\&" is zero or more color specification characters
For the purpose of keeping track of screen appearance,
ANSI color escape sequences are assumed to not move the cursor.
You can make
@@ -758,9 +769,9 @@ You can make
think that characters other than "m" can end ANSI color escape sequences
by setting the environment variable LESSANSIENDCHARS to the list of
characters which can end a color escape sequence.
-And you can make
-.I less
-think that characters other than the standard ones may appear between
+And you can make
+.I less
+think that characters other than the standard ones may appear between
the ESC and the m by setting the environment variable LESSANSIMIDCHARS
to the list of characters which can appear.
.IP "\-s or \-\-squeeze-blank-lines"
@@ -780,16 +791,16 @@ The \-t option, followed immediately by a TAG,
will edit the file containing that tag.
For this to work, tag information must be available;
for example, there may be a file in the current directory called "tags",
-which was previously built by
+which was previously built by
.I ctags
(1) or an equivalent command.
If the environment variable LESSGLOBALTAGS is set, it is taken to be
-the name of a command compatible with
+the name of a command compatible with
.I global
(1), and that command is executed to find the tag.
(See http://www.gnu.org/software/global/global.html).
-The \-t option may also be specified from within
-.I less
+The \-t option may also be specified from within
+.I less
(using the \- command) as a way of examining a new file.
The command ":t" is equivalent to specifying \-t from within
.I less.
@@ -799,18 +810,18 @@ Specifies a tags file to be used instead of "tags".
Causes backspaces and carriage returns to be treated as printable characters;
that is, they are sent to the terminal when they appear in the input.
.IP "\-U or \-\-UNDERLINE-SPECIAL"
-Causes backspaces, tabs and carriage returns to be
+Causes backspaces, tabs and carriage returns to be
treated as control characters;
that is, they are handled as specified by the \-r option.
.sp
By default, if neither \-u nor \-U is given,
backspaces which appear adjacent to an underscore character
are treated specially:
-the underlined text is displayed
+the underlined text is displayed
using the terminal's hardware underlining capability.
Also, backspaces which appear between two identical characters
-are treated specially:
-the overstruck text is printed
+are treated specially:
+the overstruck text is printed
using the terminal's hardware boldface capability.
Other backspaces are deleted, along with the preceding character.
Carriage returns immediately followed by a newline are deleted.
@@ -818,7 +829,7 @@ Other carriage returns are handled as specified by the \-r option.
Text which is overstruck or underlined can be searched for
if neither \-u nor \-U is in effect.
.IP "\-V or \-\-version"
-Displays the version number of
+Displays the version number of
.I less.
.IP "\-w or \-\-hilite-unread"
Temporarily highlights the first "new" line after a forward movement
@@ -830,9 +841,9 @@ The highlight is removed at the next command which causes movement.
The entire line is highlighted, unless the \-J option is in effect,
in which case only the status column is highlighted.
.IP "\-W or \-\-HILITE-UNREAD"
-Like \-w, but temporarily highlights the first new line after any
+Like \-w, but temporarily highlights the first new line after any
forward movement command larger than one line.
-.IP "\-x\fIn\fP,... or \-\-tabs=\fIn\fP,..."
+.IP "\-x\fIn\fP,...\& or \-\-tabs=\fIn\fP,..."
Sets tab stops.
If only one \fIn\fP is specified, tab stops are set at multiples of \fIn\fP.
If multiple values separated by commas are specified, tab stops
@@ -856,14 +867,14 @@ By default, any forward movement causes scrolling.
Changes the default scrolling window size to \fIn\fP lines.
The default is one screenful.
The z and w commands can also be used to change the window size.
-The "z" may be omitted for compatibility with some versions of
+The "z" may be omitted for compatibility with some versions of
.I more.
If the number
.I n
-is negative, it indicates
+is negative, it indicates
.I n
lines less than the current screen size.
-For example, if the screen is 24 lines, \fI\-z-4\fP sets the
+For example, if the screen is 24 lines, \fI\-z\-4\fP sets the
scrolling window to 20 lines. If the screen is resized to 40 lines,
the scrolling window automatically changes to 36 lines.
.IP "\-\fI\(dqcc\fP\ or\ \-\-quotes=\fIcc\fP"
@@ -889,14 +900,14 @@ in the RIGHTARROW and LEFTARROW commands.
If the number specified is zero, it sets the default number of
positions to one half of the screen width.
Alternately, the number may be specified as a fraction of the width
-of the screen, starting with a decimal point: .5 is half of the
-screen width, .3 is three tenths of the screen width, and so on.
-If the number is specified as a fraction, the actual number of
-scroll positions is recalculated if the terminal window is resized,
-so that the actual scroll remains at the specified fraction
+of the screen, starting with a decimal point: \&.5 is half of the
+screen width, \&.3 is three tenths of the screen width, and so on.
+If the number is specified as a fraction, the actual number of
+scroll positions is recalculated if the terminal window is resized,
+so that the actual scroll remains at the specified fraction
of the screen width.
.IP "\-\-follow-name"
-Normally, if the input file is renamed while an F command is executing,
+Normally, if the input file is renamed while an F command is executing,
.I less
will continue to display the contents of the original file despite
its name change.
@@ -904,7 +915,7 @@ If \-\-follow-name is specified, during an F command
.I less
will periodically attempt to reopen the file by name.
If the reopen succeeds and the file is a different file from the original
-(which means that a new file has been created
+(which means that a new file has been created
with the same name as the original (now renamed) file),
.I less
will display the contents of that new file.
@@ -930,7 +941,7 @@ For example, +G tells
.I less
to start at the end of the file rather than the beginning,
and +/xyz tells it to start at the first occurrence of "xyz" in the file.
-As a special case, +<number> acts like +<number>g;
+As a special case, +<number> acts like +<number>g;
that is, it starts the display at the specified line number
(however, see the caveat under the "g" command above).
If the option starts with ++, the initial command applies to
@@ -944,8 +955,8 @@ When entering command line at the bottom of the screen
or the pattern for a search command),
certain keys can be used to manipulate the command line.
Most commands have an alternate form in [ brackets ] which can be used if
-a key does not exist on a particular keyboard.
-(Note that the forms beginning with ESC do not work
+a key does not exist on a particular keyboard.
+(Note that the forms beginning with ESC do not work
in some MS-DOS and Windows systems because ESC is the line erase character.)
Any of these special keys may be entered literally by preceding
it with the "literal" character, either ^V or ^A.
@@ -990,7 +1001,7 @@ is entered into the command line.
Repeated TABs will cycle thru the other matching filenames.
If the completed filename is a directory, a "/" is appended to the filename.
(On MS-DOS systems, a "\e" is appended.)
-The environment variable LESSSEPARATOR can be used to specify a
+The environment variable LESSSEPARATOR can be used to specify a
different character to append to a directory name.
.IP "BACKTAB [ ESC-TAB ]"
Like, TAB, but cycles in the reverse direction thru the matching filenames.
@@ -1007,9 +1018,9 @@ other than ^U, that character is used instead of ^U.
Delete the entire command line and return to the main prompt.
.SH "KEY BINDINGS"
-You may define your own
+You may define your own
.I less
-commands by using the program
+commands by using the program
.I lesskey
(1)
to create a lesskey file.
@@ -1022,7 +1033,7 @@ and to set environment variables.
If the environment variable LESSKEY is set,
.I less
uses that as the name of the lesskey file.
-Otherwise,
+Otherwise,
.I less
looks in a standard place for the lesskey file:
On Unix systems,
@@ -1046,24 +1057,24 @@ manual page for more details.
.P
A system-wide lesskey file may also be set up to provide key bindings.
If a key is defined in both a local lesskey file and in the
-system-wide file, key bindings in the local file take precedence over
+system-wide file, key bindings in the local file take precedence over
those in the system-wide file.
If the environment variable LESSKEY_SYSTEM is set,
.I less
uses that as the name of the system-wide lesskey file.
Otherwise,
-.I less
+.I less
looks in a standard place for the system-wide lesskey file:
On Unix systems, the system-wide lesskey file is /usr/local/etc/sysless.
-(However, if
-.I less
+(However, if
+.I less
was built with a different sysconf directory than /usr/local/etc,
that directory is where the sysless file is found.)
On MS-DOS and Windows systems, the system-wide lesskey file is c:\e_sysless.
On OS/2 systems, the system-wide lesskey file is c:\esysless.ini.
.SH "INPUT PREPROCESSOR"
-You may define an "input preprocessor" for
+You may define an "input preprocessor" for
.I less.
Before
.I less
@@ -1072,10 +1083,10 @@ way the contents of the file are displayed.
An input preprocessor is simply an executable program (or shell script),
which writes the contents of the file to a different file,
called the replacement file.
-The contents of the replacement file are then displayed
+The contents of the replacement file are then displayed
in place of the contents of the original file.
However, it will appear to the user as if the original file is opened;
-that is,
+that is,
.I less
will display the original filename as the name of the current file.
.PP
@@ -1083,17 +1094,17 @@ An input preprocessor receives one command line argument, the original filename,
as entered by the user.
It should create the replacement file, and when finished,
print the name of the replacement file to its standard output.
-If the input preprocessor does not output a replacement filename,
+If the input preprocessor does not output a replacement filename,
.I less
uses the original file, as normal.
The input preprocessor is not called when viewing standard input.
To set up an input preprocessor, set the LESSOPEN environment variable
to a command line which will invoke your input preprocessor.
-This command line should include one occurrence of the string "%s",
+This command line should include one occurrence of the string "%s",
which will be replaced by the filename
when the input preprocessor command is invoked.
.PP
-When
+When
.I less
closes a file opened in such a way, it will call another program,
called the input postprocessor,
@@ -1101,11 +1112,11 @@ which may perform any desired clean-up action (such as deleting the
replacement file created by LESSOPEN).
This program receives two command line arguments, the original filename
as entered by the user, and the name of the replacement file.
-To set up an input postprocessor, set the LESSCLOSE environment variable
+To set up an input postprocessor, set the LESSCLOSE environment variable
to a command line which will invoke your input postprocessor.
-It may include two occurrences of the string "%s";
-the first is replaced with the original name of the file and
-the second with the name of the replacement file,
+It may include two occurrences of the string "%s";
+the first is replaced with the original name of the file and
+the second with the name of the replacement file,
which was output by LESSOPEN.
.PP
For example, on many Unix systems, these two scripts will allow you
@@ -1119,9 +1130,9 @@ lessopen.sh:
.br
case "$1" in
.br
- *.Z) uncompress -\c $1 >/tmp/less.$$ 2>/dev/null
+ *.Z) uncompress \-c $1 >/tmp/less.$$ 2>/dev/null
.br
- if [ \-s /tmp/less.$$ ]; then
+ if [ \-s /tmp/less.$$ ]; then
.br
echo /tmp/less.$$
.br
@@ -1148,21 +1159,21 @@ More complex LESSOPEN and LESSCLOSE scripts may be written
to accept other types of compressed files, and so on.
.PP
It is also possible to set up an input preprocessor to
-pipe the file data directly to
+pipe the file data directly to
.I less,
rather than putting the data into a replacement file.
-This avoids the need to decompress the entire file before
+This avoids the need to decompress the entire file before
starting to view it.
An input preprocessor that works this way is called an input pipe.
An input pipe, instead of writing the name of a replacement file on
its standard output,
writes the entire contents of the replacement file on its standard output.
If the input pipe does not write any characters on its standard output,
-then there is no replacement file and
+then there is no replacement file and
.I less
uses the original file, as normal.
To use an input pipe,
-make the first character in the LESSOPEN environment variable a
+make the first character in the LESSOPEN environment variable a
vertical bar (|) to signify that the input preprocessor is an input pipe.
.PP
For example, on many Unix systems, this script will work like the
@@ -1189,11 +1200,11 @@ To use this script, put it where it can be executed and set
LESSOPEN="|lesspipe.sh %s".
.PP
Note that a preprocessor cannot output an empty file, since that
-is interpreted as meaning there is no replacement, and
+is interpreted as meaning there is no replacement, and
the original file is used.
To avoid this, if LESSOPEN starts with two vertical bars,
the exit status of the script becomes meaningful.
-If the exit status is zero, the output is considered to be
+If the exit status is zero, the output is considered to be
replacement text, even if it empty.
If the exit status is nonzero, any output is ignored and the
original file is used.
@@ -1212,17 +1223,17 @@ For compatibility with previous versions of
.I less,
the input preprocessor or pipe is not used if
.I less
-is viewing standard input.
+is viewing standard input.
However, if the first character of LESSOPEN is a dash (\-),
the input preprocessor is used on standard input as well as other files.
-In this case, the dash is not considered to be part of
+In this case, the dash is not considered to be part of
the preprocessor command.
If standard input is being viewed, the input preprocessor is passed
a file name consisting of a single dash.
Similarly, if the first two characters of LESSOPEN are vertical bar and dash
-(|\-) or two vertical bars and a dash (||\-),
+(|\-) or two vertical bars and a dash (||\-),
the input pipe is used on standard input as well as other files.
-Again, in this case the dash is not considered to be part of
+Again, in this case the dash is not considered to be part of
the input pipe command.
.SH "NATIONAL CHARACTER SETS"
@@ -1282,11 +1293,11 @@ one character in the character set.
The character "." is used for a normal character, "c" for control,
and "b" for binary.
A decimal number may be used for repetition.
-For example, "bccc4b." would mean character 0 is binary,
+For example, "bccc4b.\&" would mean character 0 is binary,
1, 2 and 3 are control, 4, 5, 6 and 7 are binary, and 8 is normal.
All characters after the last are taken to be the same as the last,
so characters 9 through 255 would be normal.
-(This is an example, and does not necessarily
+(This is an example, and does not necessarily
represent any real character set.)
.PP
This table shows the value of LESSCHARDEF which is equivalent
@@ -1313,7 +1324,7 @@ to each of the possible values for LESSCHARSET:
next\ \ 8bcccbcc18b95.bb125.bb
.PP
If neither LESSCHARSET nor LESSCHARDEF is set,
-but any of the strings "UTF-8", "UTF8", "utf-8" or "utf8"
+but any of the strings "UTF-8", "UTF8", "utf-8" or "utf8"
is found in the LC_ALL, LC_CTYPE or LANG
environment variables, then the default character set is utf-8.
.PP
@@ -1331,12 +1342,12 @@ interface is also not available, the default character set is latin1.
.PP
Control and binary characters are displayed in standout (reverse video).
Each such character is displayed in caret notation if possible
-(e.g. ^A for control-A). Caret notation is used only if
+(e.g.\& ^A for control-A). Caret notation is used only if
inverting the 0100 bit results in a normal printable character.
Otherwise, the character is displayed as a hex number in angle brackets.
-This format can be changed by
+This format can be changed by
setting the LESSBINFMT environment variable.
-LESSBINFMT may begin with a "*" and one character to select
+LESSBINFMT may begin with a "*" and one character to select
the display attribute:
"*k" is blinking, "*d" is bold, "*u" is underlined, "*s" is standout,
and "*n" is normal.
@@ -1354,12 +1365,12 @@ acts similarly to LESSBINFMT but it applies to Unicode code points
that were successfully decoded but are unsuitable for display (e.g.,
unassigned code points).
Its default value is "<U+%04lX>".
-Note that LESSUTFBINFMT and LESSBINFMT share their display attribute
-setting ("*x") so specifying one will affect both;
+Note that LESSUTFBINFMT and LESSBINFMT share their display attribute
+setting ("*x") so specifying one will affect both;
LESSUTFBINFMT is read after LESSBINFMT so its setting, if any,
-will have priority.
+will have priority.
Problematic octets in a UTF-8 file (octets of a truncated sequence,
-octets of a complete but non-shortest form sequence, illegal octets,
+octets of a complete but non-shortest form sequence, illegal octets,
and stray trailing octets)
are displayed individually using LESSBINFMT so as to facilitate diagnostic
of how the UTF-8 file is ill-formed.
@@ -1424,6 +1435,9 @@ Same as %B.
.IP "%t"
Causes any trailing spaces to be removed.
Usually used at the end of the string, but may appear anywhere.
+.IP "%T"
+Normally expands to the word "file".
+However if viewing files via a tags list using the \-t option, it expands to the word "tag".
.IP "%x"
Replaced by the name of the next input file in the list.
.PP
@@ -1490,7 +1504,7 @@ Some examples:
This prompt prints the filename, if known;
otherwise the string "Standard input".
.sp
-?f%f .?ltLine %lt:?pt%pt\e%:?btByte %bt:-...
+?f%f \&.?ltLine %lt:?pt%pt\e%:?btByte %bt:-...
.sp
This prompt would print the filename, if known.
The filename is followed by the line number, if known,
@@ -1500,7 +1514,7 @@ Notice how each question mark has a matching period,
and how the % after the %pt
is included literally by escaping it with a backslash.
.sp
-?n?f%f\ .?m(file\ %i\ of\ %m)\ ..?e(END)\ ?x-\ Next\e:\ %x..%t
+?n?f%f\ .?m(%T %i of %m)\ ..?e(END)\ ?x-\ Next\e:\ %x..%t";
.sp
This prints the filename if this is the first prompt in a file,
followed by the "file N of N" message if there is more
@@ -1514,17 +1528,17 @@ the other two prompts (\-m and \-M respectively).
Each is broken into two lines here for readability only.
.nf
.sp
-?n?f%f\ .?m(file\ %i\ of\ %m)\ ..?e(END)\ ?x-\ Next\e:\ %x.:
+?n?f%f\ .?m(%T\ %i\ of\ %m)\ ..?e(END)\ ?x-\ Next\e:\ %x.:
?pB%pB\e%:byte\ %bB?s/%s...%t
.sp
-?f%f\ .?n?m(file\ %i\ of\ %m)\ ..?ltlines\ %lt-%lb?L/%L.\ :
+?f%f\ .?n?m(%T\ %i\ of\ %m)\ ..?ltlines\ %lt-%lb?L/%L.\ :
byte\ %bB?s/%s.\ .?e(END)\ ?x-\ Next\e:\ %x.:?pB%pB\e%..%t
.sp
.fi
And here is the default message produced by the = command:
.nf
.sp
-?f%f\ .?m(file\ %i\ of\ %m)\ .?ltlines\ %lt-%lb?L/%L.\ .
+?f%f\ .?m(%T\ %i\ of\ %m)\ .?ltlines\ %lt-%lb?L/%L.\ .
byte\ %bB?s/%s.\ ?e(END)\ :?pB%pB\e%..%t
.fi
.PP
@@ -1541,7 +1555,7 @@ The default value for LESSEDIT is:
Note that this expands to the editor name, followed by a + and the
line number, followed by the file name.
If your editor does not accept the "+linenumber" syntax, or has other
-differences in invocation syntax, the LESSEDIT variable can be
+differences in invocation syntax, the LESSEDIT variable can be
changed to modify this default.
.SH SECURITY
@@ -1580,12 +1594,12 @@ behaves (mostly) in conformance with the POSIX "more" command specification.
In this mode, less behaves differently in these ways:
.PP
The \-e option works differently.
-If the \-e option is not set,
+If the \-e option is not set,
.I less
-behaves as if the \-E option were set.
-If the \-e option is set,
+behaves as if the \-e option were set.
+If the \-e option is set,
.I less
-behaves as if the \-e and \-F options were set.
+behaves as if the \-E option were set.
.PP
The \-m option works differently.
If the \-m option is not set, the medium prompt is used,
@@ -1595,7 +1609,7 @@ If the \-m option is set, the short prompt is used.
The \-n option acts like the \-z option.
The normal behavior of the \-n option is unavailable in this mode.
.PP
-The parameter to the \-p option is taken to be a
+The parameter to the \-p option is taken to be a
.I less
command rather than a search pattern.
.PP
@@ -1604,10 +1618,10 @@ and the MORE environment variable is used in its place.
.SH "ENVIRONMENT VARIABLES"
Environment variables may be specified either in the system environment
-as usual, or in a
+as usual, or in a
.I lesskey
(1) file.
-If environment variables are defined in more than one place,
+If environment variables are defined in more than one place,
variables defined in a local lesskey file take precedence over
variables defined in the system environment, which take precedence
over variables defined in the system-wide lesskey file.
@@ -1633,7 +1647,7 @@ Language for determining the character set.
.IP LC_CTYPE
Language for determining the character set.
.IP LESS
-Options which are passed to
+Options which are passed to
.I less
automatically.
.IP LESSANSIENDCHARS
@@ -1642,7 +1656,7 @@ Characters which may end an ANSI color escape sequence
.IP LESSANSIMIDCHARS
Characters which may appear between the ESC character and the
end character in an ANSI color escape sequence
-(default "0123456789;[?!"'#%()*+\ ".
+(default "0123456789:;[?!"'#%()*+\ ".
.IP LESSBINFMT
Format for displaying non-printable, non-control characters.
.IP LESSCHARDEF
@@ -1665,11 +1679,11 @@ Normally should be set to "global" if your system has the
(1) command. If not set, global tags are not used.
.IP LESSHISTFILE
Name of the history file used to remember search commands and
-shell commands between invocations of
+shell commands between invocations of
.I less.
If set to "\-" or "/dev/null", a history file is not used.
The default is "$HOME/.lesshst" on Unix systems, "$HOME/_lesshst" on
-DOS and Windows systems, or "$HOME/lesshst.ini" or "$INIT/lesshst.ini"
+DOS and Windows systems, or "$HOME/lesshst.ini" or "$INIT/lesshst.ini"
on OS/2 systems.
.IP LESSHISTSIZE
The maximum number of commands to save in the history file.
@@ -1695,7 +1709,7 @@ String to be appended to a directory name in filename completion.
.IP LESSUTFBINFMT
Format for displaying non-printable Unicode code points.
.IP LESS_IS_MORE
-Emulate the
+Emulate the
.I more
(1) command.
.IP LINES
@@ -1707,11 +1721,11 @@ LINES and COLUMNS environment variables.)
.IP MORE
Options which are passed to
.I less
-automatically when running in
+automatically when running in
.I more
compatible mode.
.IP PATH
-User's search path (used to find a lesskey file
+User's search path (used to find a lesskey file
on MS-DOS and OS/2 systems).
.IP SHELL
The shell used to execute the ! command, as well as to expand filenames.
@@ -1726,7 +1740,7 @@ The name of the editor (used for the v command).
lesskey(1)
.SH COPYRIGHT
-Copyright (C) 1984-2012 Mark Nudelman
+Copyright (C) 1984-2015 Mark Nudelman
.PP
less is part of the GNU project and is free software.
You can redistribute it and/or modify it
@@ -1735,7 +1749,7 @@ under the terms of either
the Free Software Foundation; or (2) the Less License.
See the file README in the less distribution for more details
regarding redistribution.
-You should have received a copy of the GNU General Public License
+You should have received a copy of the GNU General Public License
along with the source for less; see the file COPYING.
If not, write to the Free Software Foundation, 59 Temple Place,
Suite 330, Boston, MA 02111-1307, USA.
@@ -1749,12 +1763,12 @@ See the GNU General Public License for more details.
.SH AUTHOR
.PP
-Mark Nudelman
+Mark Nudelman
.br
Send bug reports or comments to <bug-less@gnu.org>
.br
See http://www.greenwoodsoftware.com/less/bugs.html for the latest list of known bugs in less.
.br
-For more information, see the less homepage at
+For more information, see the less homepage at
.br
http://www.greenwoodsoftware.com/less.
diff --git a/contrib/less/lessecho.c b/contrib/less/lessecho.c
index 7098f2d..fb0b22d 100644
--- a/contrib/less/lessecho.c
+++ b/contrib/less/lessecho.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 1984-2012 Mark Nudelman
+ * Copyright (C) 1984-2015 Mark Nudelman
*
* You may distribute under the terms of either the GNU General Public
* License or the Less License, as specified in the README file.
diff --git a/contrib/less/lessecho.nro b/contrib/less/lessecho.nro
index d7fb390..78b893f 100644
--- a/contrib/less/lessecho.nro
+++ b/contrib/less/lessecho.nro
@@ -1,4 +1,4 @@
-.TH LESSECHO 1 "Version 458: 04 Apr 2013"
+.TH LESSECHO 1 "Version 481: 31 Aug 2015"
.SH NAME
lessecho \- expand metacharacters
.SH SYNOPSIS
diff --git a/contrib/less/lesskey.c b/contrib/less/lesskey.c
index 3d7571e..298748b 100644
--- a/contrib/less/lesskey.c
+++ b/contrib/less/lesskey.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 1984-2012 Mark Nudelman
+ * Copyright (C) 1984-2015 Mark Nudelman
*
* You may distribute under the terms of either the GNU General Public
* License or the Less License, as specified in the README file.
@@ -120,6 +120,7 @@ struct cmdname cmdnames[] =
{ "forw-search", A_F_SEARCH },
{ "forw-window", A_F_WINDOW },
{ "goto-end", A_GOEND },
+ { "goto-end-buffered", A_GOEND_BUF },
{ "goto-line", A_GOLINE },
{ "goto-mark", A_GOMARK },
{ "help", A_HELP },
@@ -647,7 +648,7 @@ parse_cmdline(p)
do
{
s = tstr(&p, 1);
- cmdlen += strlen(s);
+ cmdlen += (int) strlen(s);
if (cmdlen > MAX_CMDLEN)
error("command too long");
else
diff --git a/contrib/less/lesskey.h b/contrib/less/lesskey.h
index 91098a5..34b8c17 100644
--- a/contrib/less/lesskey.h
+++ b/contrib/less/lesskey.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 1984-2012 Mark Nudelman
+ * Copyright (C) 1984-2015 Mark Nudelman
*
* You may distribute under the terms of either the GNU General Public
* License or the Less License, as specified in the README file.
diff --git a/contrib/less/lesskey.nro b/contrib/less/lesskey.nro
index 2bbd887..826332d 100644
--- a/contrib/less/lesskey.nro
+++ b/contrib/less/lesskey.nro
@@ -1,4 +1,4 @@
-.TH LESSKEY 1 "Version 458: 04 Apr 2013"
+.TH LESSKEY 1 "Version 481: 31 Aug 2015"
.SH NAME
lesskey \- specify key bindings for less
.SH SYNOPSIS
@@ -178,6 +178,8 @@ default command keys used by less:
\ee] right-scroll
\ee( left-scroll
\ee) right-scroll
+ \ekl left-scroll
+ \ekr right-scroll
{ forw-bracket {}
} back-bracket {}
( forw-bracket ()
@@ -190,6 +192,7 @@ default command keys used by less:
\ee> goto-end
> goto-end
\eke goto-end
+ \eeG goto-end-buffered
= status
^G status
:f status
@@ -356,26 +359,29 @@ which start with a NUL character (0).
This NUL character should be represented as \e340 in a lesskey file.
.SH COPYRIGHT
-Copyright (C) 2000-2012 Mark Nudelman
+Copyright (C) 1984-2015 Mark Nudelman
.PP
-lesskey is part of the GNU project and 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 2, or (at your option) any later version.
+less is part of the GNU project and is free software.
+You can redistribute it and/or modify it
+under the terms of either
+(1) the GNU General Public License as published by
+the Free Software Foundation; or (2) the Less License.
+See the file README in the less distribution for more details
+regarding redistribution.
+You should have received a copy of the GNU General Public License
+along with the source for less; see the file COPYING.
+If not, write to the Free Software Foundation, 59 Temple Place,
+Suite 330, Boston, MA 02111-1307, USA.
+You should also have received a copy of the Less License;
+see the file LICENSE.
.PP
-lesskey is distributed in the hope that it will be useful, but
+less 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.
-.PP
-You should have received a copy of the GNU General Public License
-along with lesskey; see the file COPYING.
-If not, write to the Free Software Foundation, 59 Temple Place,
-Suite 330, Boston, MA 02111-1307, USA.
.SH AUTHOR
.PP
-Mark Nudelman <bug-less@gnu.org>
+Mark Nudelman
.br
-Send bug reports or comments to bug-less@gnu.org.
+Send bug reports or comments to <bug-less@gnu.org>.
diff --git a/contrib/less/lglob.h b/contrib/less/lglob.h
index b08d24c..87b5fb4 100644
--- a/contrib/less/lglob.h
+++ b/contrib/less/lglob.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 1984-2012 Mark Nudelman
+ * Copyright (C) 1984-2015 Mark Nudelman
*
* You may distribute under the terms of either the GNU General Public
* License or the Less License, as specified in the README file.
diff --git a/contrib/less/line.c b/contrib/less/line.c
index 1eb3914..e54835d 100644
--- a/contrib/less/line.c
+++ b/contrib/less/line.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 1984-2012 Mark Nudelman
+ * Copyright (C) 1984-2015 Mark Nudelman
*
* You may distribute under the terms of either the GNU General Public
* License or the Less License, as specified in the README file.
@@ -35,7 +35,7 @@ static int overstrike; /* Next char should overstrike previous char */
static int last_overstrike = AT_NORMAL;
static int is_null_line; /* There is no current line */
static int lmargin; /* Left margin */
-static char pendc;
+static LWCHAR pendc;
static POSITION pendpos;
static char *end_ansi_chars;
static char *mid_ansi_chars;
@@ -78,7 +78,7 @@ init_line()
mid_ansi_chars = lgetenv("LESSANSIMIDCHARS");
if (mid_ansi_chars == NULL || *mid_ansi_chars == '\0')
- mid_ansi_chars = "0123456789;[?!\"'#%()*+ ";
+ mid_ansi_chars = "0123456789:;[?!\"'#%()*+ ";
linebuf = (char *) ecalloc(LINEBUF_SIZE, sizeof(char));
attr = (char *) ecalloc(LINEBUF_SIZE, sizeof(char));
@@ -209,7 +209,7 @@ plinenum(pos)
int n;
linenumtoa(linenum, buf);
- n = strlen(buf);
+ n = (int) strlen(buf);
if (n < MIN_LINENUM_WIDTH)
n = MIN_LINENUM_WIDTH;
sprintf(linebuf+curr, "%*s ", n, buf);
@@ -491,7 +491,7 @@ backc()
&& column > lmargin
&& (!(attr[curr - 1] & (AT_ANSI|AT_BINARY))))
{
- curr = p - linebuf;
+ curr = (int) (p - linebuf);
prev_ch = step_char(&p, -1, linebuf + lmargin);
width = pwidth(ch, attr[curr], prev_ch);
column -= width;
@@ -604,7 +604,7 @@ store_char(ch, a, rep, pos)
do {
bch = step_char(&p, -1, linebuf);
} while (p > linebuf && !IS_CSI_START(bch));
- curr = p - linebuf;
+ curr = (int) (p - linebuf);
return 0;
}
a = AT_ANSI; /* Will force re-AT_'ing around it. */
@@ -697,7 +697,7 @@ store_tab(attr, pos)
static int
store_prchar(c, pos)
- char c;
+ LWCHAR c;
POSITION pos;
{
char *s;
@@ -741,13 +741,15 @@ flush_mbc_buf(pos)
*/
public int
pappend(c, pos)
- char c;
+ unsigned char c;
POSITION pos;
{
int r;
if (pendc)
{
+ if (c == '\r' && pendc == '\r')
+ return (0);
if (do_append(pendc, NULL, pendpos))
/*
* Oops. We've probably lost the char which
@@ -781,7 +783,7 @@ pappend(c, pos)
if (!utf_mode)
{
- r = do_append((LWCHAR) c, NULL, pos);
+ r = do_append(c, NULL, pos);
} else
{
/* Perform strict validation in all possible cases. */
@@ -791,7 +793,7 @@ pappend(c, pos)
mbc_buf_index = 1;
*mbc_buf = c;
if (IS_ASCII_OCTET(c))
- r = do_append((LWCHAR) c, NULL, pos);
+ r = do_append(c, NULL, pos);
else if (IS_UTF8_LEAD(c))
{
mbc_buf_len = utf_len(c);
@@ -805,7 +807,7 @@ pappend(c, pos)
mbc_buf[mbc_buf_index++] = c;
if (mbc_buf_index < mbc_buf_len)
return (0);
- if (is_utf8_well_formed(mbc_buf))
+ if (is_utf8_well_formed(mbc_buf, mbc_buf_index))
r = do_append(get_wchar(mbc_buf), mbc_buf, mbc_pos);
else
/* Complete, but not shortest form, sequence. */
@@ -885,8 +887,14 @@ do_append(ch, rep, pos)
* or just deletion of the character in the buffer.
*/
overstrike = utf_mode ? -1 : 0;
- /* To be correct, this must be a base character. */
- prev_ch = get_wchar(linebuf + curr);
+ if (utf_mode)
+ {
+ /* To be correct, this must be a base character. */
+ prev_ch = get_wchar(linebuf + curr);
+ } else
+ {
+ prev_ch = (unsigned char) linebuf[curr];
+ }
a = attr[curr];
if (ch == prev_ch)
{
diff --git a/contrib/less/linenum.c b/contrib/less/linenum.c
index 4f45be8..6d078ec 100644
--- a/contrib/less/linenum.c
+++ b/contrib/less/linenum.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 1984-2012 Mark Nudelman
+ * Copyright (C) 1984-2015 Mark Nudelman
*
* You may distribute under the terms of either the GNU General Public
* License or the Less License, as specified in the README file.
@@ -216,7 +216,7 @@ longloopmessage()
static int loopcount;
#if HAVE_TIME
-static long startime;
+static time_type startime;
#endif
static void
diff --git a/contrib/less/lsystem.c b/contrib/less/lsystem.c
index 674e5a2..8a7cb8f 100644
--- a/contrib/less/lsystem.c
+++ b/contrib/less/lsystem.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 1984-2012 Mark Nudelman
+ * Copyright (C) 1984-2015 Mark Nudelman
*
* You may distribute under the terms of either the GNU General Public
* License or the Less License, as specified in the README file.
@@ -137,7 +137,7 @@ lsystem(cmd, donemsg)
char *esccmd = shell_quote(cmd);
if (esccmd != NULL)
{
- int len = strlen(shell) + strlen(esccmd) + 5;
+ int len = (int) (strlen(shell) + strlen(esccmd) + 5);
p = (char *) ecalloc(len, sizeof(char));
SNPRINTF3(p, len, "%s %s %s", shell, shell_coption(), esccmd);
free(esccmd);
diff --git a/contrib/less/main.c b/contrib/less/main.c
index 4a66147..6cfd34d 100644
--- a/contrib/less/main.c
+++ b/contrib/less/main.c
@@ -1,6 +1,6 @@
/* $FreeBSD$ */
/*
- * Copyright (C) 1984-2012 Mark Nudelman
+ * Copyright (C) 1984-2015 Mark Nudelman
*
* You may distribute under the terms of either the GNU General Public
* License or the Less License, as specified in the README file.
@@ -57,7 +57,6 @@ static char consoleTitle[256];
extern int less_is_more;
extern int missing_cap;
extern int know_dumb;
-extern int quit_if_one_screen;
extern int no_init;
extern int pr_type;
@@ -167,8 +166,6 @@ main(argc, argv)
if (less_is_more)
no_init = TRUE;
- if (less_is_more && get_quit_at_eof())
- quit_if_one_screen = TRUE;
#if EDITOR
editor = lgetenv("VISUAL");
diff --git a/contrib/less/mark.c b/contrib/less/mark.c
index c61ce03..44d606f 100644
--- a/contrib/less/mark.c
+++ b/contrib/less/mark.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 1984-2012 Mark Nudelman
+ * Copyright (C) 1984-2015 Mark Nudelman
*
* You may distribute under the terms of either the GNU General Public
* License or the Less License, as specified in the README file.
@@ -15,14 +15,6 @@ extern int sc_height;
extern int jump_sline;
/*
- * A mark is an ifile (input file) plus a position within the file.
- */
-struct mark {
- IFILE m_ifile;
- struct scrpos m_scrpos;
-};
-
-/*
* The table of marks.
* Each mark is identified by a lowercase or uppercase letter.
* The final one is lmark, for the "last mark"; addressed by the apostrophe.
diff --git a/contrib/less/mkhelp.c b/contrib/less/mkhelp.c
index 45530fd..d4e4063 100644
--- a/contrib/less/mkhelp.c
+++ b/contrib/less/mkhelp.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 1984-2012 Mark Nudelman
+ * Copyright (C) 1984-2015 Mark Nudelman
*
* You may distribute under the terms of either the GNU General Public
* License or the Less License, as specified in the README file.
diff --git a/contrib/less/mkutable b/contrib/less/mkutable
new file mode 100755
index 0000000..803335b
--- /dev/null
+++ b/contrib/less/mkutable
@@ -0,0 +1,75 @@
+#! /usr/bin/perl
+use strict;
+
+my $USAGE = <<__EOF__;
+ usage: mkutable [-n] [-f#] type... [--] [<] UnicodeData.txt
+ -n = take non-matching types
+ -f = zero-based type field (default 2)
+__EOF__
+
+use vars qw( $opt_f $opt_n );
+use Getopt::Std;
+my $type_field = 2;
+
+exit (main() ? 1 : 0);
+
+sub main {
+ my $date = `date`;
+ chomp $date;
+ my $args = join ' ', @ARGV;
+ my $header = "/* Generated by \"$0 $args\" on $date */\n";
+
+ die $USAGE if not getopts('f:n');
+ $type_field = $opt_f if $opt_f;
+ my %types;
+ my $arg;
+ while ($arg = shift @ARGV) {
+ last if $arg eq '--';
+ $types{$arg} = 1;
+ }
+ my %out = ( 'types' => \%types );
+ my $last_code = 0;
+
+ print $header;
+ while (<>) {
+ chomp;
+ s/#.*//;
+ my @fields = split /;/;
+ next if not @fields;
+ my $code = hex $fields[0];
+ my $type = $fields[$type_field];
+ $type =~ s/\s//g;
+ while (++$last_code < $code) {
+ output(\%out, $last_code, '?');
+ }
+ output(\%out, $code, $type);
+ }
+ output(\%out, $last_code+1, '?');
+}
+
+sub output {
+ my ($out, $code, $type) = @_;
+ my $match = ${${$out}{types}}{$type};
+ my $type_change = (not $$out{start_type} or $type ne $$out{start_type});
+ $match = not $match if $opt_n;
+ if ($match and (not $$out{in_run} or $type_change)) {
+ end_run($out, $code-1);
+ start_run($out, $code, $type);
+ } elsif (not $match and $$out{in_run}) {
+ end_run($out, $code-1);
+ }
+}
+
+sub start_run {
+ my ($out, $code, $type) = @_;
+ $$out{start_code} = $code;
+ $$out{start_type} = $type;
+ $$out{in_run} = 1;
+}
+
+sub end_run {
+ my ($out, $code) = @_;
+ return if not $$out{in_run};
+ printf "\t{ 0x%04x, 0x%04x }, /* %s */\n", $$out{start_code}, $code, $$out{start_type};
+ $$out{in_run} = 0;
+}
diff --git a/contrib/less/optfunc.c b/contrib/less/optfunc.c
index e3cd57f..c3bb6b2 100644
--- a/contrib/less/optfunc.c
+++ b/contrib/less/optfunc.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 1984-2012 Mark Nudelman
+ * Copyright (C) 1984-2015 Mark Nudelman
*
* You may distribute under the terms of either the GNU General Public
* License or the Less License, as specified in the README file.
@@ -43,6 +43,7 @@ extern char *prproto[];
extern char *eqproto;
extern char *hproto;
extern char *wproto;
+extern char *every_first_cmd;
extern IFILE curr_ifile;
extern char version[];
extern int jump_sline;
@@ -58,6 +59,7 @@ extern int logfile;
#if TAGS
public char *tagoption = NULL;
extern char *tags;
+extern char ztags[];
#endif
#if MSDOS_COMPILER
extern int nm_fg_color, nm_bg_color;
@@ -87,7 +89,7 @@ opt_o(type, s)
switch (type)
{
case INIT:
- namelogfile = s;
+ namelogfile = save(s);
break;
case TOGGLE:
if (ch_getflags() & CH_CANSEEK)
@@ -101,6 +103,8 @@ opt_o(type, s)
return;
}
s = skipsp(s);
+ if (namelogfile != NULL)
+ free(namelogfile);
namelogfile = lglob(s);
use_logfile(namelogfile);
sync_logfile();
@@ -176,7 +180,7 @@ opt_j(type, s)
{
sprintf(buf, ".%06d", jump_sline_fraction);
- len = strlen(buf);
+ len = (int) strlen(buf);
while (len > 2 && buf[len-1] == '0')
len--;
buf[len] = '\0';
@@ -241,7 +245,7 @@ opt_shift(type, s)
{
sprintf(buf, ".%06d", shift_count_fraction);
- len = strlen(buf);
+ len = (int) strlen(buf);
while (len > 2 && buf[len-1] == '0')
len--;
buf[len] = '\0';
@@ -295,7 +299,7 @@ opt_t(type, s)
switch (type)
{
case INIT:
- tagoption = s;
+ tagoption = save(s);
/* Do the rest in main() */
break;
case TOGGLE:
@@ -335,10 +339,12 @@ opt__T(type, s)
switch (type)
{
case INIT:
- tags = s;
+ tags = save(s);
break;
case TOGGLE:
s = skipsp(s);
+ if (tags != NULL && tags != ztags)
+ free(tags);
tags = lglob(s);
break;
case QUERY:
@@ -361,18 +367,26 @@ opt_p(type, s)
{
case INIT:
/*
- * Unget a search command for the specified string.
- * {{ This won't work if the "/" command is
- * changed or invalidated by a .lesskey file. }}
+ * Unget a command for the specified string.
*/
- plusoption = TRUE;
- ungetsc(s);
- /*
- * In "more" mode, the -p argument is a command,
- * not a search string, so we don't need a slash.
- */
- if (!less_is_more)
+ if (less_is_more)
+ {
+ /*
+ * In "more" mode, the -p argument is a command,
+ * not a search string, so we don't need a slash.
+ */
+ every_first_cmd = save(s);
+ } else
+ {
+ plusoption = TRUE;
+ ungetcc(CHAR_END_COMMAND);
+ ungetsc(s);
+ /*
+ * {{ This won't work if the "/" command is
+ * changed or invalidated by a .lesskey file. }}
+ */
ungetsc("/");
+ }
break;
}
}
@@ -503,7 +517,7 @@ opt__V(type, s)
putstr("no ");
#endif
putstr("regular expressions)\n");
- putstr("Copyright (C) 1984-2012 Mark Nudelman\n\n");
+ putstr("Copyright (C) 1984-2015 Mark Nudelman\n\n");
putstr("less comes with NO WARRANTY, to the extent permitted by law.\n");
putstr("For information about the terms of redistribution,\n");
putstr("see the file named README in the less distribution.\n");
diff --git a/contrib/less/option.c b/contrib/less/option.c
index 2c26dc6..256f569 100644
--- a/contrib/less/option.c
+++ b/contrib/less/option.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 1984-2012 Mark Nudelman
+ * Copyright (C) 1984-2015 Mark Nudelman
*
* You may distribute under the terms of either the GNU General Public
* License or the Less License, as specified in the README file.
@@ -152,7 +152,10 @@ scan_option(s)
if (*str == '+')
every_first_cmd = save(str+1);
else
+ {
+ ungetcc(CHAR_END_COMMAND);
ungetsc(str);
+ }
free(str);
continue;
case '0': case '1': case '2': case '3': case '4':
@@ -701,5 +704,5 @@ get_quit_at_eof()
if (!less_is_more)
return quit_at_eof;
/* When less_is_more is set, the -e flag semantics are different. */
- return quit_at_eof ? OPT_ON : OPT_ONPLUS;
+ return quit_at_eof ? OPT_ONPLUS : OPT_ON;
}
diff --git a/contrib/less/option.h b/contrib/less/option.h
index c11ad3b..dc97d75f 100644
--- a/contrib/less/option.h
+++ b/contrib/less/option.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 1984-2012 Mark Nudelman
+ * Copyright (C) 1984-2015 Mark Nudelman
*
* You may distribute under the terms of either the GNU General Public
* License or the Less License, as specified in the README file.
diff --git a/contrib/less/opttbl.c b/contrib/less/opttbl.c
index 6f582bf..b896391 100644
--- a/contrib/less/opttbl.c
+++ b/contrib/less/opttbl.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 1984-2012 Mark Nudelman
+ * Copyright (C) 1984-2015 Mark Nudelman
*
* You may distribute under the terms of either the GNU General Public
* License or the Less License, as specified in the README file.
diff --git a/contrib/less/os.c b/contrib/less/os.c
index eb75bba..530abe1 100644
--- a/contrib/less/os.c
+++ b/contrib/less/os.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 1984-2012 Mark Nudelman
+ * Copyright (C) 1984-2015 Mark Nudelman
*
* You may distribute under the terms of either the GNU General Public
* License or the Less License, as specified in the README file.
@@ -33,12 +33,6 @@
#include <values.h>
#endif
-#if HAVE_TIME_T
-#define time_type time_t
-#else
-#define time_type long
-#endif
-
/*
* BSD setjmp() saves (and longjmp() restores) the signal mask.
* This costs a system call or two per setjmp(), so if possible we clear the
@@ -191,7 +185,7 @@ intread()
* Return the current time.
*/
#if HAVE_TIME
- public long
+ public time_type
get_time()
{
time_type t;
@@ -243,7 +237,7 @@ errno_message(filename)
#else
p = "cannot open";
#endif
- len = strlen(filename) + strlen(p) + 3;
+ len = (int) (strlen(filename) + strlen(p) + 3);
m = (char *) ecalloc(len, sizeof(char));
SNPRINTF2(m, len, "%s: %s", filename, p);
return (m);
diff --git a/contrib/less/output.c b/contrib/less/output.c
index e1f2cff..d6cfc38 100644
--- a/contrib/less/output.c
+++ b/contrib/less/output.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 1984-2012 Mark Nudelman
+ * Copyright (C) 1984-2015 Mark Nudelman
*
* You may distribute under the terms of either the GNU General Public
* License or the Less License, as specified in the README file.
@@ -98,7 +98,7 @@ flush()
register int n;
register int fd;
- n = ob - obuf;
+ n = (int) (ob - obuf);
if (n == 0)
return;
@@ -197,7 +197,7 @@ flush()
* Leave it unprocessed
* in the buffer.
*/
- int slop = q - anchor;
+ int slop = (int) (q - anchor);
/* {{ strcpy args overlap! }} */
strcpy(obuf, anchor);
ob = &obuf[slop];
@@ -423,7 +423,7 @@ iprint_int(num)
inttoa(num, buf);
putstr(buf);
- return (strlen(buf));
+ return ((int) strlen(buf));
}
/*
@@ -437,7 +437,7 @@ iprint_linenum(num)
linenumtoa(num, buf);
putstr(buf);
- return (strlen(buf));
+ return ((int) strlen(buf));
}
/*
diff --git a/contrib/less/pattern.c b/contrib/less/pattern.c
index fa26b99..71141c7 100644
--- a/contrib/less/pattern.c
+++ b/contrib/less/pattern.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 1984-2012 Mark Nudelman
+ * Copyright (C) 1984-2015 Mark Nudelman
*
* You may distribute under the terms of either the GNU General Public
* License or the Less License, as specified in the README file.
@@ -20,10 +20,11 @@ extern int caseless;
* Compile a search pattern, for future use by match_pattern.
*/
static int
-compile_pattern2(pattern, search_type, comp_pattern)
+compile_pattern2(pattern, search_type, comp_pattern, show_error)
char *pattern;
int search_type;
void **comp_pattern;
+ int show_error;
{
if (search_type & SRCH_NO_REGEX)
return (0);
@@ -37,7 +38,8 @@ compile_pattern2(pattern, search_type, comp_pattern)
if (re_compile_pattern(pattern, strlen(pattern), comp))
{
free(comp);
- error("Invalid pattern", NULL_PARG);
+ if (show_error)
+ error("Invalid pattern", NULL_PARG);
return (-1);
}
if (*pcomp != NULL)
@@ -50,7 +52,8 @@ compile_pattern2(pattern, search_type, comp_pattern)
if (regcomp(comp, pattern, REGCOMP_FLAG))
{
free(comp);
- error("Invalid pattern", NULL_PARG);
+ if (show_error)
+ error("Invalid pattern", NULL_PARG);
return (-1);
}
if (*pcomp != NULL)
@@ -68,7 +71,8 @@ compile_pattern2(pattern, search_type, comp_pattern)
if (comp == NULL)
{
parg.p_string = (char *) errstring;
- error("%s", &parg);
+ if (show_error)
+ error("%s", &parg);
return (-1);
}
*pcomp = comp;
@@ -78,7 +82,8 @@ compile_pattern2(pattern, search_type, comp_pattern)
int *pcomp = (int *) comp_pattern;
if ((parg.p_string = re_comp(pattern)) != NULL)
{
- error("%s", &parg);
+ if (show_error)
+ error("%s", &parg);
return (-1);
}
*pcomp = 1;
@@ -88,7 +93,8 @@ compile_pattern2(pattern, search_type, comp_pattern)
char **pcomp = (char **) comp_pattern;
if ((comp = regcmp(pattern, 0)) == NULL)
{
- error("Invalid pattern", NULL_PARG);
+ if (show_error)
+ error("Invalid pattern", NULL_PARG);
return (-1);
}
if (pcomp != NULL)
@@ -98,7 +104,10 @@ compile_pattern2(pattern, search_type, comp_pattern)
#if HAVE_V8_REGCOMP
struct regexp *comp;
struct regexp **pcomp = (struct regexp **) comp_pattern;
- if ((comp = regcomp(pattern)) == NULL)
+ reg_show_error = show_error;
+ comp = regcomp(pattern);
+ reg_show_error = 1;
+ if (comp == NULL)
{
/*
* regcomp has already printed an error message
@@ -133,7 +142,7 @@ compile_pattern(pattern, search_type, comp_pattern)
cvt_pattern = (char*) ecalloc(1, cvt_length(strlen(pattern), CVT_TO_LC));
cvt_text(cvt_pattern, pattern, (int *)NULL, (int *)NULL, CVT_TO_LC);
}
- result = compile_pattern2(cvt_pattern, search_type, comp_pattern);
+ result = compile_pattern2(cvt_pattern, search_type, comp_pattern, 1);
if (cvt_pattern != pattern)
free(cvt_pattern);
return (result);
@@ -183,6 +192,24 @@ uncompile_pattern(pattern)
}
/*
+ * Can a pattern be successfully compiled?
+ */
+ public int
+valid_pattern(pattern)
+ char *pattern;
+{
+ void *comp_pattern;
+ int result;
+
+ CLEAR_PATTERN(comp_pattern);
+ result = compile_pattern2(pattern, 0, &comp_pattern, 0);
+ if (result != 0)
+ return (0);
+ uncompile_pattern(&comp_pattern);
+ return (1);
+}
+
+/*
* Is a compiled pattern null?
*/
public int
@@ -207,6 +234,9 @@ is_null_pattern(pattern)
#if HAVE_V8_REGCOMP
return (pattern == NULL);
#endif
+#if NO_REGEX
+ return (pattern == NULL);
+#endif
}
/*
@@ -227,9 +257,17 @@ match(pattern, pattern_len, buf, buf_len, pfound, pend)
for ( ; buf < buf_end; buf++)
{
- for (pp = pattern, lp = buf; *pp == *lp; pp++, lp++)
+ for (pp = pattern, lp = buf; ; pp++, lp++)
+ {
+ char cp = *pp;
+ char cl = *lp;
+ if (caseless == OPT_ONPLUS && ASCII_IS_UPPER(cp))
+ cp = ASCII_TO_LOWER(cp);
+ if (cp != cl)
+ break;
if (pp == pattern_end || lp == buf_end)
break;
+ }
if (pp == pattern_end)
{
if (pfound != NULL)
@@ -277,6 +315,7 @@ match_pattern(pattern, tpattern, line, line_len, sp, ep, notbol, search_type)
struct regexp *spattern = (struct regexp *) pattern;
#endif
+ *sp = *ep = NULL;
#if NO_REGEX
search_type |= SRCH_NO_REGEX;
#endif
@@ -287,24 +326,25 @@ match_pattern(pattern, tpattern, line, line_len, sp, ep, notbol, search_type)
#if HAVE_GNU_REGEX
{
struct re_registers search_regs;
- regoff_t *starts = (regoff_t *) ecalloc(1, sizeof (regoff_t));
- regoff_t *ends = (regoff_t *) ecalloc(1, sizeof (regoff_t));
spattern->not_bol = notbol;
- re_set_registers(spattern, &search_regs, 1, starts, ends);
+ spattern->regs_allocated = REGS_UNALLOCATED;
matched = re_search(spattern, line, line_len, 0, line_len, &search_regs) >= 0;
if (matched)
{
*sp = line + search_regs.start[0];
*ep = line + search_regs.end[0];
}
- free(starts);
- free(ends);
}
#endif
#if HAVE_POSIX_REGCOMP
{
regmatch_t rm;
int flags = (notbol) ? REG_NOTBOL : 0;
+#ifdef REG_STARTEND
+ flags |= REG_STARTEND;
+ rm.rm_so = 0;
+ rm.rm_eo = line_len;
+#endif
matched = !regexec(spattern, line, 1, &rm, flags);
if (matched)
{
diff --git a/contrib/less/pattern.h b/contrib/less/pattern.h
index 0a90d5d..712fdcf 100644
--- a/contrib/less/pattern.h
+++ b/contrib/less/pattern.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 1984-2012 Mark Nudelman
+ * Copyright (C) 1984-2015 Mark Nudelman
*
* You may distribute under the terms of either the GNU General Public
* License or the Less License, as specified in the README file.
@@ -49,6 +49,7 @@ extern char *__loc1;
#if HAVE_V8_REGCOMP
#include "regexp.h"
+extern int reg_show_error;
#define DEFINE_PATTERN(name) struct regexp *name
#define CLEAR_PATTERN(name) name = NULL
#endif
diff --git a/contrib/less/pckeys.h b/contrib/less/pckeys.h
index b673756..8fb6800 100644
--- a/contrib/less/pckeys.h
+++ b/contrib/less/pckeys.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 1984-2012 Mark Nudelman
+ * Copyright (C) 1984-2015 Mark Nudelman
*
* You may distribute under the terms of either the GNU General Public
* License or the Less License, as specified in the README file.
diff --git a/contrib/less/position.c b/contrib/less/position.c
index b655f07..dc80fd6 100644
--- a/contrib/less/position.c
+++ b/contrib/less/position.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 1984-2012 Mark Nudelman
+ * Copyright (C) 1984-2015 Mark Nudelman
*
* You may distribute under the terms of either the GNU General Public
* License or the Less License, as specified in the README file.
diff --git a/contrib/less/position.h b/contrib/less/position.h
index 3b96637..e0e2bff 100644
--- a/contrib/less/position.h
+++ b/contrib/less/position.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 1984-2012 Mark Nudelman
+ * Copyright (C) 1984-2015 Mark Nudelman
*
* You may distribute under the terms of either the GNU General Public
* License or the Less License, as specified in the README file.
diff --git a/contrib/less/prompt.c b/contrib/less/prompt.c
index f374101..50ced97 100644
--- a/contrib/less/prompt.c
+++ b/contrib/less/prompt.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 1984-2012 Mark Nudelman
+ * Copyright (C) 1984-2015 Mark Nudelman
*
* You may distribute under the terms of either the GNU General Public
* License or the Less License, as specified in the README file.
@@ -85,9 +85,9 @@ ap_str(s)
{
int len;
- len = strlen(s);
+ len = (int) strlen(s);
if (mp + len >= message + PROMPT_SIZE)
- len = message + PROMPT_SIZE - mp - 1;
+ len = (int) (message + PROMPT_SIZE - mp - 1);
strncpy(mp, s, len);
mp += len;
*mp = '\0';
diff --git a/contrib/less/regexp.c b/contrib/less/regexp.c
index 77ab611..fcf7c9a 100644
--- a/contrib/less/regexp.c
+++ b/contrib/less/regexp.c
@@ -243,7 +243,10 @@ char *exp;
regcode = r->program;
regc(MAGIC);
if (reg(0, &flags) == NULL)
+ {
+ free(r);
return(NULL);
+ }
/* Dig out information for optimizations. */
r->regstart = '\0'; /* Worst-case defaults. */
@@ -274,7 +277,7 @@ char *exp;
for (; scan != NULL; scan = regnext(scan))
if (OP(scan) == EXACTLY && ((int) strlen(OPERAND(scan))) >= len) {
longest = OPERAND(scan);
- len = strlen(OPERAND(scan));
+ len = (int) strlen(OPERAND(scan));
}
r->regmust = longest;
r->regmlen = len;
@@ -554,7 +557,7 @@ int *flagp;
register char ender;
regparse--;
- len = strcspn(regparse, META);
+ len = (int) strcspn(regparse, META);
if (len <= 0)
FAIL("internal disaster");
ender = *(regparse+len);
@@ -670,9 +673,9 @@ char *val;
}
if (OP(scan) == BACK)
- offset = scan - val;
+ offset = (int) (scan - val);
else
- offset = val - scan;
+ offset = (int) (val - scan);
*(scan+1) = (offset>>8)&0377;
*(scan+2) = offset&0377;
}
@@ -870,7 +873,7 @@ char *prog;
/* Inline the first character, for speed. */
if (*opnd != *reginput)
return(0);
- len = strlen(opnd);
+ len = (int) strlen(opnd);
if (len > 1 && strncmp(opnd, reginput, len) != 0)
return(0);
reginput += len;
@@ -1034,7 +1037,7 @@ char *p;
opnd = OPERAND(p);
switch (OP(p)) {
case ANY:
- count = strlen(scan);
+ count = (int) strlen(scan);
scan += count;
break;
case EXACTLY:
diff --git a/contrib/less/screen.c b/contrib/less/screen.c
index a79eba2..8f8a433 100644
--- a/contrib/less/screen.c
+++ b/contrib/less/screen.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 1984-2012 Mark Nudelman
+ * Copyright (C) 1984-2015 Mark Nudelman
*
* You may distribute under the terms of either the GNU General Public
* License or the Less License, as specified in the README file.
diff --git a/contrib/less/scrsize.c b/contrib/less/scrsize.c
index 9f786fe..91fc03f 100644
--- a/contrib/less/scrsize.c
+++ b/contrib/less/scrsize.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 1984-2012 Mark Nudelman
+ * Copyright (C) 1984-2015 Mark Nudelman
*
* You may distribute under the terms of either the GNU General Public
* License or the Less License, as specified in the README file.
diff --git a/contrib/less/search.c b/contrib/less/search.c
index 24d4210..e824acb 100644
--- a/contrib/less/search.c
+++ b/contrib/less/search.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 1984-2012 Mark Nudelman
+ * Copyright (C) 1984-2015 Mark Nudelman
*
* You may distribute under the terms of either the GNU General Public
* License or the Less License, as specified in the README file.
@@ -45,15 +45,57 @@ static POSITION prep_endpos;
static int is_caseless;
static int is_ucase_pattern;
+/*
+ * Structures for maintaining a set of ranges for hilites and filtered-out
+ * lines. Each range is stored as a node within a red-black tree, and we
+ * try to extend existing ranges (without creating overlaps) rather than
+ * create new nodes if possible. We remember the last node found by a
+ * search for constant-time lookup if the next search is near enough to
+ * the previous. To aid that, we overlay a secondary doubly-linked list
+ * on top of the red-black tree so we can find the preceding/succeeding
+ * nodes also in constant time.
+ *
+ * Each node is allocated from a series of pools, each pool double the size
+ * of the previous (for amortised constant time allocation). Since our only
+ * tree operations are clear and node insertion, not node removal, we don't
+ * need to maintain a usage bitmap or freelist and can just return nodes
+ * from the pool in-order until capacity is reached.
+ */
struct hilite
{
- struct hilite *hl_next;
POSITION hl_startpos;
POSITION hl_endpos;
};
-static struct hilite hilite_anchor = { NULL, NULL_POSITION, NULL_POSITION };
-static struct hilite filter_anchor = { NULL, NULL_POSITION, NULL_POSITION };
-#define hl_first hl_next
+struct hilite_node
+{
+ struct hilite_node *parent;
+ struct hilite_node *left;
+ struct hilite_node *right;
+ struct hilite_node *prev;
+ struct hilite_node *next;
+ int red;
+ struct hilite r;
+};
+struct hilite_storage
+{
+ int capacity;
+ int used;
+ struct hilite_storage *next;
+ struct hilite_node *nodes;
+};
+struct hilite_tree
+{
+ struct hilite_storage *first;
+ struct hilite_storage *current;
+ struct hilite_node *root;
+ struct hilite_node *lookaside;
+};
+#define HILITE_INITIALIZER() { NULL, NULL, NULL, NULL }
+#define HILITE_LOOKASIDE_STEPS 2
+
+static struct hilite_tree hilite_anchor = HILITE_INITIALIZER();
+static struct hilite_tree filter_anchor = HILITE_INITIALIZER();
+
#endif
/*
@@ -219,7 +261,6 @@ repaint_hilite(on)
{
int slinenum;
POSITION pos;
- POSITION epos;
int save_hide_hilite;
if (squished)
@@ -245,7 +286,6 @@ repaint_hilite(on)
pos = position(slinenum);
if (pos == NULL_POSITION)
continue;
- epos = position(slinenum+1);
(void) forw_line(pos);
goto_line(slinenum);
put_line();
@@ -324,17 +364,23 @@ undo_search()
*/
public void
clr_hlist(anchor)
- struct hilite *anchor;
+ struct hilite_tree *anchor;
{
- struct hilite *hl;
- struct hilite *nexthl;
+ struct hilite_storage *hls;
+ struct hilite_storage *nexthls;
- for (hl = anchor->hl_first; hl != NULL; hl = nexthl)
+ for (hls = anchor->first; hls != NULL; hls = nexthls)
{
- nexthl = hl->hl_next;
- free((void*)hl);
+ nexthls = hls->next;
+ free((void*)hls->nodes);
+ free((void*)hls);
}
- anchor->hl_first = NULL;
+ anchor->first = NULL;
+ anchor->current = NULL;
+ anchor->root = NULL;
+
+ anchor->lookaside = NULL;
+
prep_startpos = prep_endpos = NULL_POSITION;
}
@@ -350,6 +396,126 @@ clr_filter()
clr_hlist(&filter_anchor);
}
+ struct hilite_node*
+hlist_last(anchor)
+ struct hilite_tree *anchor;
+{
+ struct hilite_node *n = anchor->root;
+ while (n != NULL && n->right != NULL)
+ n = n->right;
+ return n;
+}
+
+ struct hilite_node*
+hlist_next(n)
+ struct hilite_node *n;
+{
+ return n->next;
+}
+
+ struct hilite_node*
+hlist_prev(n)
+ struct hilite_node *n;
+{
+ return n->prev;
+}
+
+/*
+ * Find the node covering pos, or the node after it if no node covers it,
+ * or return NULL if pos is after the last range. Remember the found node,
+ * to speed up subsequent searches for the same or similar positions (if
+ * we return NULL, remember the last node.)
+ */
+ struct hilite_node*
+hlist_find(anchor, pos)
+ struct hilite_tree *anchor;
+ POSITION pos;
+{
+ struct hilite_node *n, *m;
+
+ if (anchor->lookaside)
+ {
+ int steps = 0;
+ int hit = 0;
+
+ n = anchor->lookaside;
+
+ for (;;)
+ {
+ if (pos < n->r.hl_endpos)
+ {
+ if (n->prev == NULL || pos >= n->prev->r.hl_endpos)
+ {
+ hit = 1;
+ break;
+ }
+ } else if (n->next == NULL)
+ {
+ n = NULL;
+ hit = 1;
+ break;
+ }
+
+ /*
+ * If we don't find the right node within a small
+ * distance, don't keep doing a linear search!
+ */
+ if (steps >= HILITE_LOOKASIDE_STEPS)
+ break;
+ steps++;
+
+ if (pos < n->r.hl_endpos)
+ anchor->lookaside = n = n->prev;
+ else
+ anchor->lookaside = n = n->next;
+ }
+
+ if (hit)
+ return n;
+ }
+
+ n = anchor->root;
+ m = NULL;
+
+ while (n != NULL)
+ {
+ if (pos < n->r.hl_startpos)
+ {
+ if (n->left != NULL)
+ {
+ m = n;
+ n = n->left;
+ continue;
+ }
+ break;
+ }
+ if (pos >= n->r.hl_endpos)
+ {
+ if (n->right != NULL)
+ {
+ n = n->right;
+ continue;
+ }
+ if (m != NULL)
+ {
+ n = m;
+ } else
+ {
+ m = n;
+ n = NULL;
+ }
+ }
+ break;
+ }
+
+ if (n != NULL)
+ anchor->lookaside = n;
+ else if (m != NULL)
+ anchor->lookaside = m;
+
+ return n;
+}
+
/*
* Should any characters in a specified range be highlighted?
*/
@@ -358,18 +524,8 @@ is_hilited_range(pos, epos)
POSITION pos;
POSITION epos;
{
- struct hilite *hl;
-
- /*
- * Look at each highlight and see if any part of it falls in the range.
- */
- for (hl = hilite_anchor.hl_first; hl != NULL; hl = hl->hl_next)
- {
- if (hl->hl_endpos > pos &&
- (epos == NULL_POSITION || epos > hl->hl_startpos))
- return (1);
- }
- return (0);
+ struct hilite_node *n = hlist_find(&hilite_anchor, pos);
+ return (n != NULL && (epos == NULL_POSITION || epos > n->r.hl_startpos));
}
/*
@@ -379,24 +535,64 @@ is_hilited_range(pos, epos)
is_filtered(pos)
POSITION pos;
{
- struct hilite *hl;
+ struct hilite_node *n;
if (ch_getflags() & CH_HELPFILE)
return (0);
- /*
- * Look at each filter and see if the start position
- * equals the start position of the line.
- */
- for (hl = filter_anchor.hl_first; hl != NULL; hl = hl->hl_next)
+ n = hlist_find(&filter_anchor, pos);
+ return (n != NULL && pos >= n->r.hl_startpos);
+}
+
+/*
+ * If pos is hidden, return the next position which isn't, otherwise
+ * just return pos.
+ */
+ public POSITION
+next_unfiltered(pos)
+ POSITION pos;
+{
+ struct hilite_node *n;
+
+ if (ch_getflags() & CH_HELPFILE)
+ return (pos);
+
+ n = hlist_find(&filter_anchor, pos);
+ while (n != NULL && pos >= n->r.hl_startpos)
{
- if (hl->hl_startpos == pos)
- return (1);
+ pos = n->r.hl_endpos;
+ n = n->next;
}
- return (0);
+ return (pos);
}
/*
+ * If pos is hidden, return the previous position which isn't or 0 if
+ * we're filtered right to the beginning, otherwise just return pos.
+ */
+ public POSITION
+prev_unfiltered(pos)
+ POSITION pos;
+{
+ struct hilite_node *n;
+
+ if (ch_getflags() & CH_HELPFILE)
+ return (pos);
+
+ n = hlist_find(&filter_anchor, pos);
+ while (n != NULL && pos >= n->r.hl_startpos)
+ {
+ pos = n->r.hl_startpos;
+ if (pos == 0)
+ break;
+ pos--;
+ n = n->prev;
+ }
+ return (pos);
+}
+
+
+/*
* Should any characters in a specified range be highlighted?
* If nohide is nonzero, don't consider hide_hilite.
*/
@@ -447,43 +643,288 @@ is_hilited(pos, epos, nohide, p_matches)
}
/*
+ * Tree node storage: get the current block of nodes if it has spare
+ * capacity, or create a new one if not.
+ */
+ static struct hilite_storage*
+hlist_getstorage(anchor)
+ struct hilite_tree *anchor;
+{
+ int capacity = 1;
+ struct hilite_storage *s;
+
+ if (anchor->current)
+ {
+ if (anchor->current->used < anchor->current->capacity)
+ return anchor->current;
+ capacity = anchor->current->capacity * 2;
+ }
+
+ s = (struct hilite_storage *) ecalloc(1, sizeof(struct hilite_storage));
+ s->nodes = (struct hilite_node *) ecalloc(capacity, sizeof(struct hilite_node));
+ s->capacity = capacity;
+ s->used = 0;
+ s->next = NULL;
+ if (anchor->current)
+ anchor->current->next = s;
+ else
+ anchor->first = s;
+ anchor->current = s;
+ return s;
+}
+
+/*
+ * Tree node storage: retrieve a new empty node to be inserted into the
+ * tree.
+ */
+ static struct hilite_node*
+hlist_getnode(anchor)
+ struct hilite_tree *anchor;
+{
+ struct hilite_storage *s = hlist_getstorage(anchor);
+ return &s->nodes[s->used++];
+}
+
+/*
+ * Rotate the tree left around a pivot node.
+ */
+ static void
+hlist_rotate_left(anchor, n)
+ struct hilite_tree *anchor;
+ struct hilite_node *n;
+{
+ struct hilite_node *np = n->parent;
+ struct hilite_node *nr = n->right;
+ struct hilite_node *nrl = n->right->left;
+
+ if (np != NULL)
+ {
+ if (n == np->left)
+ np->left = nr;
+ else
+ np->right = nr;
+ } else
+ {
+ anchor->root = nr;
+ }
+ nr->left = n;
+ n->right = nrl;
+
+ nr->parent = np;
+ n->parent = nr;
+ if (nrl != NULL)
+ nrl->parent = n;
+}
+
+/*
+ * Rotate the tree right around a pivot node.
+ */
+ static void
+hlist_rotate_right(anchor, n)
+ struct hilite_tree *anchor;
+ struct hilite_node *n;
+{
+ struct hilite_node *np = n->parent;
+ struct hilite_node *nl = n->left;
+ struct hilite_node *nlr = n->left->right;
+
+ if (np != NULL)
+ {
+ if (n == np->right)
+ np->right = nl;
+ else
+ np->left = nl;
+ } else
+ {
+ anchor->root = nl;
+ }
+ nl->right = n;
+ n->left = nlr;
+
+ nl->parent = np;
+ n->parent = nl;
+ if (nlr != NULL)
+ nlr->parent = n;
+}
+
+
+/*
* Add a new hilite to a hilite list.
*/
static void
add_hilite(anchor, hl)
- struct hilite *anchor;
+ struct hilite_tree *anchor;
struct hilite *hl;
{
- struct hilite *ihl;
+ struct hilite_node *p, *n, *u;
+
+ /* Ignore empty ranges. */
+ if (hl->hl_startpos >= hl->hl_endpos)
+ return;
+
+ p = anchor->root;
+
+ /* Inserting the very first node is trivial. */
+ if (p == NULL)
+ {
+ n = hlist_getnode(anchor);
+ n->r = *hl;
+ anchor->root = n;
+ anchor->lookaside = n;
+ return;
+ }
/*
- * Hilites are sorted in the list; find where new one belongs.
- * Insert new one after ihl.
+ * Find our insertion point. If we come across any overlapping
+ * or adjoining existing ranges, shrink our range and discard
+ * if it become empty.
*/
- for (ihl = anchor; ihl->hl_next != NULL; ihl = ihl->hl_next)
+ for (;;)
{
- if (ihl->hl_next->hl_startpos > hl->hl_startpos)
+ if (hl->hl_startpos < p->r.hl_startpos)
+ {
+ if (hl->hl_endpos > p->r.hl_startpos)
+ hl->hl_endpos = p->r.hl_startpos;
+ if (p->left != NULL)
+ {
+ p = p->left;
+ continue;
+ }
break;
+ }
+ if (hl->hl_startpos < p->r.hl_endpos) {
+ hl->hl_startpos = p->r.hl_endpos;
+ if (hl->hl_startpos >= hl->hl_endpos)
+ return;
+ }
+ if (p->right != NULL)
+ {
+ p = p->right;
+ continue;
+ }
+ break;
}
/*
- * Truncate hilite so it doesn't overlap any existing ones
- * above and below it.
+ * Now we're at the right leaf, again check for contiguous ranges
+ * and extend the existing node if possible to avoid the
+ * insertion. Otherwise insert a new node at the leaf.
*/
- if (ihl != anchor)
- hl->hl_startpos = MAXPOS(hl->hl_startpos, ihl->hl_endpos);
- if (ihl->hl_next != NULL)
- hl->hl_endpos = MINPOS(hl->hl_endpos, ihl->hl_next->hl_startpos);
- if (hl->hl_startpos >= hl->hl_endpos)
+ if (hl->hl_startpos < p->r.hl_startpos) {
+ if (hl->hl_endpos == p->r.hl_startpos)
+ {
+ p->r.hl_startpos = hl->hl_startpos;
+ return;
+ }
+ if (p->prev != NULL && p->prev->r.hl_endpos == hl->hl_startpos)
+ {
+ p->prev->r.hl_endpos = hl->hl_endpos;
+ return;
+ }
+
+ p->left = n = hlist_getnode(anchor);
+ n->next = p;
+ if (p->prev != NULL)
+ {
+ n->prev = p->prev;
+ p->prev->next = n;
+ }
+ p->prev = n;
+ } else {
+ if (p->r.hl_endpos == hl->hl_startpos)
+ {
+ p->r.hl_endpos = hl->hl_endpos;
+ return;
+ }
+ if (p->next != NULL && hl->hl_endpos == p->next->r.hl_startpos) {
+ p->next->r.hl_startpos = hl->hl_startpos;
+ return;
+ }
+
+ p->right = n = hlist_getnode(anchor);
+ n->prev = p;
+ if (p->next != NULL)
+ {
+ n->next = p->next;
+ p->next->prev = n;
+ }
+ p->next = n;
+ }
+ n->parent = p;
+ n->red = 1;
+ n->r = *hl;
+
+ /*
+ * The tree is in the correct order and covers the right ranges
+ * now, but may have become unbalanced. Rebalance it using the
+ * standard red-black tree constraints and operations.
+ */
+ for (;;)
{
+ /* case 1 - current is root, root is always black */
+ if (n->parent == NULL)
+ {
+ n->red = 0;
+ break;
+ }
+
+ /* case 2 - parent is black, we can always be red */
+ if (!n->parent->red)
+ break;
+
/*
- * Hilite was truncated out of existence.
+ * constraint: because the root must be black, if our
+ * parent is red it cannot be the root therefore we must
+ * have a grandparent
*/
- free(hl);
- return;
+
+ /*
+ * case 3 - parent and uncle are red, repaint them black,
+ * the grandparent red, and start again at the grandparent.
+ */
+ u = n->parent->parent->left;
+ if (n->parent == u)
+ u = n->parent->parent->right;
+ if (u != NULL && u->red)
+ {
+ n->parent->red = 0;
+ u->red = 0;
+ n = n->parent->parent;
+ n->red = 1;
+ continue;
+ }
+
+ /*
+ * case 4 - parent is red but uncle is black, parent and
+ * grandparent on opposite sides. We need to start
+ * changing the structure now. This and case 5 will shorten
+ * our branch and lengthen the sibling, between them
+ * restoring balance.
+ */
+ if (n == n->parent->right &&
+ n->parent == n->parent->parent->left)
+ {
+ hlist_rotate_left(anchor, n->parent);
+ n = n->left;
+ } else if (n == n->parent->left &&
+ n->parent == n->parent->parent->right)
+ {
+ hlist_rotate_right(anchor, n->parent);
+ n = n->right;
+ }
+
+ /*
+ * case 5 - parent is red but uncle is black, parent and
+ * grandparent on same side
+ */
+ n->parent->red = 0;
+ n->parent->parent->red = 1;
+ if (n == n->parent->left)
+ hlist_rotate_right(anchor, n->parent->parent);
+ else
+ hlist_rotate_left(anchor, n->parent->parent);
+ break;
}
- hl->hl_next = ihl->hl_next;
- ihl->hl_next = hl;
}
/*
@@ -496,12 +937,11 @@ create_hilites(linepos, start_index, end_index, chpos)
int end_index;
int *chpos;
{
- struct hilite *hl;
+ struct hilite hl;
int i;
/* Start the first hilite. */
- hl = (struct hilite *) ecalloc(1, sizeof(struct hilite));
- hl->hl_startpos = linepos + chpos[start_index];
+ hl.hl_startpos = linepos + chpos[start_index];
/*
* Step through the displayed chars.
@@ -515,13 +955,12 @@ create_hilites(linepos, start_index, end_index, chpos)
{
if (chpos[i] != chpos[i-1] + 1 || i == end_index)
{
- hl->hl_endpos = linepos + chpos[i-1] + 1;
- add_hilite(&hilite_anchor, hl);
+ hl.hl_endpos = linepos + chpos[i-1] + 1;
+ add_hilite(&hilite_anchor, &hl);
/* Start new hilite unless this is the last char. */
if (i < end_index)
{
- hl = (struct hilite *) ecalloc(1, sizeof(struct hilite));
- hl->hl_startpos = linepos + chpos[i];
+ hl.hl_startpos = linepos + chpos[i];
}
}
}
@@ -545,8 +984,6 @@ hilite_line(linepos, line, line_len, chpos, sp, ep, cvt_ops)
char *searchp;
char *line_end = line + line_len;
- if (sp == NULL || ep == NULL)
- return;
/*
* sp and ep delimit the first match in the line.
* Mark the corresponding file positions, then
@@ -559,6 +996,8 @@ hilite_line(linepos, line, line_len, chpos, sp, ep, cvt_ops)
*/
searchp = line;
do {
+ if (sp == NULL || ep == NULL)
+ return;
create_hilites(linepos, sp-line, ep-line, chpos);
/*
* If we matched more than zero characters,
@@ -694,11 +1133,10 @@ search_pos(search_type)
* It starts at the jump target (if searching backwards),
* or at the jump target plus one (if forwards).
*/
- linenum = jump_sline;
+ linenum = adjsline(jump_sline);
if (search_type & SRCH_FORW)
- add_one = 1;
+ add_one = 1;
}
- linenum = adjsline(linenum);
pos = position(linenum);
if (add_one)
pos = forw_raw_line(pos, (char **)NULL, (int *)NULL);
@@ -709,20 +1147,20 @@ search_pos(search_type)
*/
if (search_type & SRCH_FORW)
{
- while (pos == NULL_POSITION)
- {
- if (++linenum >= sc_height)
- break;
- pos = position(linenum);
- }
+ while (pos == NULL_POSITION)
+ {
+ if (++linenum >= sc_height)
+ break;
+ pos = position(linenum);
+ }
} else
{
- while (pos == NULL_POSITION)
- {
- if (--linenum < 0)
- break;
- pos = position(linenum);
- }
+ while (pos == NULL_POSITION)
+ {
+ if (--linenum < 0)
+ break;
+ pos = position(linenum);
+ }
}
return (pos);
}
@@ -842,16 +1280,19 @@ search_range(pos, endpos, search_type, matches, maxlines, plinepos, pendpos)
* Check to see if the line matches the filter pattern.
* If so, add an entry to the filter list.
*/
- if ((search_type & SRCH_FIND_ALL) && prev_pattern(&filter_info)) {
+ if (((search_type & SRCH_FIND_ALL) ||
+ prep_startpos == NULL_POSITION ||
+ linepos < prep_startpos || linepos >= prep_endpos) &&
+ prev_pattern(&filter_info)) {
int line_filter = match_pattern(info_compiled(&filter_info), filter_info.text,
cline, line_len, &sp, &ep, 0, filter_info.search_type);
if (line_filter)
{
- struct hilite *hl = (struct hilite *)
- ecalloc(1, sizeof(struct hilite));
- hl->hl_startpos = linepos;
- hl->hl_endpos = pos;
- add_hilite(&filter_anchor, hl);
+ struct hilite hl;
+ hl.hl_startpos = linepos;
+ hl.hl_endpos = pos;
+ add_hilite(&filter_anchor, &hl);
+ continue;
}
}
#endif
@@ -1108,6 +1549,12 @@ prep_hilite(spos, epos, maxlines)
return;
/*
+ * Make sure our prep region always starts at the beginning of
+ * a line. (search_range takes care of the end boundary below.)
+ */
+ spos = back_raw_line(spos+1, (char **)NULL, (int *)NULL);
+
+ /*
* If we're limited to a max number of lines, figure out the
* file position we should stop at.
*/
@@ -1199,12 +1646,48 @@ prep_hilite(spos, epos, maxlines)
{
int search_type = SRCH_FORW | SRCH_FIND_ALL;
search_type |= (search_info.search_type & SRCH_NO_REGEX);
- result = search_range(spos, epos, search_type, 0,
- maxlines, (POSITION*)NULL, &new_epos);
- if (result < 0)
- return;
- if (prep_endpos == NULL_POSITION || new_epos > prep_endpos)
- nprep_endpos = new_epos;
+ for (;;)
+ {
+ result = search_range(spos, epos, search_type, 0, maxlines, (POSITION*)NULL, &new_epos);
+ if (result < 0)
+ return;
+ if (prep_endpos == NULL_POSITION || new_epos > prep_endpos)
+ nprep_endpos = new_epos;
+
+ /*
+ * Check both ends of the resulting prep region to
+ * make sure they're not filtered. If they are,
+ * keep going at least one more line until we find
+ * something that isn't filtered, or hit the end.
+ */
+ if (prep_endpos == NULL_POSITION || nprep_endpos > prep_endpos)
+ {
+ if (new_epos >= nprep_endpos && is_filtered(new_epos-1))
+ {
+ spos = nprep_endpos;
+ epos = forw_raw_line(nprep_endpos, (char **)NULL, (int *)NULL);
+ if (epos == NULL_POSITION)
+ break;
+ maxlines = 1;
+ continue;
+ }
+ }
+
+ if (prep_startpos == NULL_POSITION || nprep_startpos < prep_startpos)
+ {
+ if (nprep_startpos > 0 && is_filtered(nprep_startpos))
+ {
+ epos = nprep_startpos;
+ spos = back_raw_line(nprep_startpos, (char **)NULL, (int *)NULL);
+ if (spos == NULL_POSITION)
+ break;
+ nprep_startpos = spos;
+ maxlines = 1;
+ continue;
+ }
+ }
+ break;
+ }
}
prep_startpos = nprep_startpos;
prep_endpos = nprep_endpos;
@@ -1243,12 +1726,16 @@ is_filtering()
* This function is called by the V8 regcomp to report
* errors in regular expressions.
*/
+public int reg_show_error = 1;
+
void
regerror(s)
char *s;
{
PARG parg;
+ if (!reg_show_error)
+ return;
parg.p_string = s;
error("%s", &parg);
}
diff --git a/contrib/less/signal.c b/contrib/less/signal.c
index 9c6c2f6..caa2143 100644
--- a/contrib/less/signal.c
+++ b/contrib/less/signal.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 1984-2012 Mark Nudelman
+ * Copyright (C) 1984-2015 Mark Nudelman
*
* You may distribute under the terms of either the GNU General Public
* License or the Less License, as specified in the README file.
diff --git a/contrib/less/tags.c b/contrib/less/tags.c
index 51fbb56..5acf374 100644
--- a/contrib/less/tags.c
+++ b/contrib/less/tags.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 1984-2012 Mark Nudelman
+ * Copyright (C) 1984-2015 Mark Nudelman
*
* You may distribute under the terms of either the GNU General Public
* License or the Less License, as specified in the README file.
@@ -14,7 +14,8 @@
#if TAGS
-public char *tags = "tags";
+public char ztags[] = "tags";
+public char *tags = ztags;
static int total;
static int curseq;
@@ -287,7 +288,7 @@ findctag(tag)
cleantags();
total = 0;
- taglen = strlen(tag);
+ taglen = (int) strlen(tag);
/*
* Search the tags file for the desired tag.
@@ -445,7 +446,7 @@ ctagsearch()
* If tagendline is set, make sure we match all
* the way to end of line (no extra chars after the match).
*/
- len = strlen(curtag->tag_pattern);
+ len = (int) strlen(curtag->tag_pattern);
if (strncmp(curtag->tag_pattern, line, len) == 0 &&
(!curtag->tag_endline || line[len] == '\0' || line[len] == '\r'))
{
@@ -491,7 +492,7 @@ findgtag(tag, type)
{
fp = stdin;
/* Set tag default because we cannot read stdin again. */
- tags = "tags";
+ tags = ztags;
} else
{
#if !HAVE_POPEN
@@ -551,7 +552,7 @@ findgtag(tag, type)
#endif
return TAG_INTR;
}
- len = strlen(buf);
+ len = (int) strlen(buf);
if (len > 0 && buf[len-1] == '\n')
buf[len-1] = '\0';
else
diff --git a/contrib/less/ttyin.c b/contrib/less/ttyin.c
index db6e72e..129eea1 100644
--- a/contrib/less/ttyin.c
+++ b/contrib/less/ttyin.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 1984-2012 Mark Nudelman
+ * Copyright (C) 1984-2015 Mark Nudelman
*
* You may distribute under the terms of either the GNU General Public
* License or the Less License, as specified in the README file.
diff --git a/contrib/less/ubin.uni b/contrib/less/ubin.uni
new file mode 100644
index 0000000..39ec303
--- /dev/null
+++ b/contrib/less/ubin.uni
@@ -0,0 +1,32 @@
+/* Generated by "./mkutable -f2 Cc Cf Cs Co Zl Zp -- unicode/UnicodeData.txt" on Mon Jul 14 16:21:22 PDT 2014 */
+ { 0x0000, 0x001f }, /* Cc */
+ { 0x007f, 0x009f }, /* Cc */
+ { 0x00ad, 0x00ad }, /* Cf */
+ { 0x0600, 0x0605 }, /* Cf */
+ { 0x061c, 0x061c }, /* Cf */
+ { 0x06dd, 0x06dd }, /* Cf */
+ { 0x070f, 0x070f }, /* Cf */
+ { 0x180e, 0x180e }, /* Cf */
+ { 0x200b, 0x200f }, /* Cf */
+ { 0x2028, 0x2028 }, /* Zl */
+ { 0x2029, 0x2029 }, /* Zp */
+ { 0x202a, 0x202e }, /* Cf */
+ { 0x2060, 0x2064 }, /* Cf */
+ { 0x2066, 0x206f }, /* Cf */
+ { 0xd800, 0xd800 }, /* Cs */
+ { 0xdb7f, 0xdb80 }, /* Cs */
+ { 0xdbff, 0xdc00 }, /* Cs */
+ { 0xdfff, 0xdfff }, /* Cs */
+ { 0xe000, 0xe000 }, /* Co */
+ { 0xf8ff, 0xf8ff }, /* Co */
+ { 0xfeff, 0xfeff }, /* Cf */
+ { 0xfff9, 0xfffb }, /* Cf */
+ { 0x110bd, 0x110bd }, /* Cf */
+ { 0x1bca0, 0x1bca3 }, /* Cf */
+ { 0x1d173, 0x1d17a }, /* Cf */
+ { 0xe0001, 0xe0001 }, /* Cf */
+ { 0xe0020, 0xe007f }, /* Cf */
+ { 0xf0000, 0xf0000 }, /* Co */
+ { 0xffffd, 0xffffd }, /* Co */
+ { 0x100000, 0x100000 }, /* Co */
+ { 0x10fffd, 0x10fffd }, /* Co */
diff --git a/contrib/less/version.c b/contrib/less/version.c
index d3ecd14..87b0b42 100644
--- a/contrib/less/version.c
+++ b/contrib/less/version.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 1984-2012 Mark Nudelman
+ * Copyright (C) 1984-2015 Mark Nudelman
*
* You may distribute under the terms of either the GNU General Public
* License or the Less License, as specified in the README file.
@@ -762,6 +762,35 @@ v455 11/5/12 Fix typo.
v456 11/8/12 Fix option string incompatibility.
v457 12/8/12 Use new option string syntax only after --use-backslash.
v458 4/4/13 Fix display bug in using up/down in cmd buffer.
+-----------------------------------------------------------------
+v459 5/6/13 Fix ++ bug.
+v460 6/19/13 Automate construction of Unicode tables.
+v461 6/21/13 Collapse multiple CRs before LF.
+v462 11/26/13 Don't overwrite history file, just append to it.
+v463 7/13/14 Misc. fixes.
+v464 7/19/14 Fix bugs & improve performance in & filtering
+ (thanks to John Sullivan).
+v465 8/9/14 More fixes from John Sullivan.
+v466 8/23/14 Add colon to LESSANSIMIDCHARS.
+v467 9/18/14 Misc. fixes.
+v468 9/18/14 Fix typo
+v469 10/2/14 Allow extra string in command to append to a multichar
+ cmd without executing it; fix bug using GNU regex.
+v470 10/5/14 Fix some compiler warnings.
+v471 12/14/14 Fix unget issues with prompt. Allow disabling history
+ when compiled value of LESSHISTFILE = "-".
+v473 12/19/14 Fix prompt bug with stdin and -^P in lesskey extra string.
+v474 1/30/15 Fix bug in backwards search with match on bottom line.
+ Make follow mode reopen file if file shrinks.
+v475 3/2/15 Fix possible buffer overrun with invalid UTF-8;
+ fix bug when compiled with no regex; fix non-match search.
+v476 5/3/15 Update man pages.
+v477 5/19/15 Fix off-by-one in jump_forw_buffered;
+ don't add FAKE_* files to cmd history.
+v478 5/21/15 Fix nonportable pointer usage in hilite tree.
+v479 7/6/15 Allow %% escapes in LESSOPEN variable.
+v480 7/24/15 Fix bug in no-regex searches; support MSVC v1900.
+v481 8/20/15 Fix broken -g option.
*/
-char version[] = "458";
+char version[] = "481";
diff --git a/contrib/less/wide.uni b/contrib/less/wide.uni
new file mode 100644
index 0000000..b43f7d3
--- /dev/null
+++ b/contrib/less/wide.uni
@@ -0,0 +1,81 @@
+/* Generated by "./mkutable -f1 W -- unicode/EastAsianWidth.txt" on Mon Jul 14 16:21:23 PDT 2014 */
+ { 0x1100, 0x1100 }, /* W */
+ { 0x2329, 0x232a }, /* W */
+ { 0x2e80, 0x2e80 }, /* W */
+ { 0x2e9b, 0x2e9b }, /* W */
+ { 0x2f00, 0x2f00 }, /* W */
+ { 0x2ff0, 0x2ff0 }, /* W */
+ { 0x3001, 0x3001 }, /* W */
+ { 0x3004, 0x3012 }, /* W */
+ { 0x3014, 0x301e }, /* W */
+ { 0x3020, 0x3021 }, /* W */
+ { 0x302a, 0x302a }, /* W */
+ { 0x302e, 0x302e }, /* W */
+ { 0x3030, 0x3031 }, /* W */
+ { 0x3036, 0x3036 }, /* W */
+ { 0x3038, 0x3038 }, /* W */
+ { 0x303b, 0x303e }, /* W */
+ { 0x3041, 0x3041 }, /* W */
+ { 0x3099, 0x3099 }, /* W */
+ { 0x309b, 0x309b }, /* W */
+ { 0x309d, 0x309d }, /* W */
+ { 0x309f, 0x30a1 }, /* W */
+ { 0x30fb, 0x30fc }, /* W */
+ { 0x30ff, 0x30ff }, /* W */
+ { 0x3105, 0x3105 }, /* W */
+ { 0x3131, 0x3131 }, /* W */
+ { 0x3190, 0x3190 }, /* W */
+ { 0x3192, 0x3192 }, /* W */
+ { 0x3196, 0x3196 }, /* W */
+ { 0x31a0, 0x31a0 }, /* W */
+ { 0x31c0, 0x31c0 }, /* W */
+ { 0x31f0, 0x31f0 }, /* W */
+ { 0x3200, 0x3200 }, /* W */
+ { 0x3220, 0x3220 }, /* W */
+ { 0x322a, 0x322a }, /* W */
+ { 0x3250, 0x3251 }, /* W */
+ { 0x3260, 0x3260 }, /* W */
+ { 0x3280, 0x3280 }, /* W */
+ { 0x328a, 0x328a }, /* W */
+ { 0x32b1, 0x32b1 }, /* W */
+ { 0x32c0, 0x32c0 }, /* W */
+ { 0x3300, 0x3300 }, /* W */
+ { 0x3400, 0x3400 }, /* W */
+ { 0x4db6, 0x4db6 }, /* W */
+ { 0x4e00, 0x4e00 }, /* W */
+ { 0x9fcd, 0x9fcd }, /* W */
+ { 0xa000, 0xa000 }, /* W */
+ { 0xa015, 0xa016 }, /* W */
+ { 0xa490, 0xa490 }, /* W */
+ { 0xa960, 0xa960 }, /* W */
+ { 0xac00, 0xac00 }, /* W */
+ { 0xf900, 0xf900 }, /* W */
+ { 0xfa6e, 0xfa6e }, /* W */
+ { 0xfa70, 0xfa70 }, /* W */
+ { 0xfada, 0xfada }, /* W */
+ { 0xfe10, 0xfe10 }, /* W */
+ { 0xfe17, 0xfe19 }, /* W */
+ { 0xfe30, 0xfe31 }, /* W */
+ { 0xfe33, 0xfe33 }, /* W */
+ { 0xfe35, 0xfe45 }, /* W */
+ { 0xfe47, 0xfe49 }, /* W */
+ { 0xfe4d, 0xfe4d }, /* W */
+ { 0xfe50, 0xfe50 }, /* W */
+ { 0xfe54, 0xfe54 }, /* W */
+ { 0xfe58, 0xfe5f }, /* W */
+ { 0xfe62, 0xfe64 }, /* W */
+ { 0xfe68, 0xfe6a }, /* W */
+ { 0x1b000, 0x1b000 }, /* W */
+ { 0x1f200, 0x1f200 }, /* W */
+ { 0x1f210, 0x1f210 }, /* W */
+ { 0x1f240, 0x1f240 }, /* W */
+ { 0x1f250, 0x1f250 }, /* W */
+ { 0x20000, 0x20000 }, /* W */
+ { 0x2a6d7, 0x2a6d7 }, /* W */
+ { 0x2a700, 0x2a700 }, /* W */
+ { 0x2b735, 0x2b735 }, /* W */
+ { 0x2b740, 0x2b740 }, /* W */
+ { 0x2b81e, 0x2b81e }, /* W */
+ { 0x2f800, 0x2f800 }, /* W */
+ { 0x2fa1e, 0x2fa1e }, /* W */
+ { 0x30000, 0x30000 }, /* W */
diff --git a/contrib/netcat/nc.1 b/contrib/netcat/nc.1
index e1f4c2d..7e7b9fd 100644
--- a/contrib/netcat/nc.1
+++ b/contrib/netcat/nc.1
@@ -1,4 +1,4 @@
-.\" $OpenBSD: nc.1,v 1.67 2014/02/26 20:56:11 claudio Exp $
+.\" $OpenBSD: nc.1,v 1.68 2015/03/26 10:35:04 tobias Exp $
.\"
.\" Copyright (c) 1996 David Sacerdote
.\" All rights reserved.
@@ -27,7 +27,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd April 11, 2014
+.Dd September 26, 2015
.Dt NC 1
.Os
.Sh NAME
@@ -133,7 +133,7 @@ connection to another program (e.g.\&
.Xr ssh 1
using the
.Xr ssh_config 5
-.Cm ProxyUseFdPass
+.Cm ProxyUseFdpass
option).
.It Fl h
Prints out
diff --git a/contrib/netcat/netcat.c b/contrib/netcat/netcat.c
index 041fff8..04e31e8a 100644
--- a/contrib/netcat/netcat.c
+++ b/contrib/netcat/netcat.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: netcat.c,v 1.127 2015/02/14 22:40:22 jca Exp $ */
+/* $OpenBSD: netcat.c,v 1.130 2015/07/26 19:12:28 chl Exp $ */
/*
* Copyright (c) 2001 Eric Jackson <ericj@monkey.org>
*
@@ -52,15 +52,16 @@
#include <err.h>
#include <errno.h>
#include <getopt.h>
+#include <fcntl.h>
+#include <limits.h>
#include <netdb.h>
#include <poll.h>
+#include <signal.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-#include <fcntl.h>
-#include <limits.h>
#include "atomicio.h"
#ifndef SUN_LEN
@@ -163,6 +164,8 @@ main(int argc, char *argv[])
uport = NULL;
sv = NULL;
+ signal(SIGPIPE, SIG_IGN);
+
while ((ch = getopt_long(argc, argv,
"46DdEe:FhI:i:klNnoO:P:p:rSs:tT:UuV:vw:X:x:z",
longopts, NULL)) != -1) {
@@ -1042,7 +1045,6 @@ fdpass(int nfd)
bzero(&mh, sizeof(mh));
bzero(&cmsgbuf, sizeof(cmsgbuf));
bzero(&iov, sizeof(iov));
- bzero(&pfd, sizeof(pfd));
mh.msg_control = (caddr_t)&cmsgbuf.buf;
mh.msg_controllen = sizeof(cmsgbuf.buf);
@@ -1059,17 +1061,17 @@ fdpass(int nfd)
bzero(&pfd, sizeof(pfd));
pfd.fd = STDOUT_FILENO;
+ pfd.events = POLLOUT;
for (;;) {
r = sendmsg(STDOUT_FILENO, &mh, 0);
if (r == -1) {
if (errno == EAGAIN || errno == EINTR) {
- pfd.events = POLLOUT;
if (poll(&pfd, 1, -1) == -1)
err(1, "poll");
continue;
}
err(1, "sendmsg");
- } else if (r == -1)
+ } else if (r != 1)
errx(1, "sendmsg: unexpected return value %zd", r);
else
break;
diff --git a/contrib/netcat/socks.c b/contrib/netcat/socks.c
index f8adda4..1b06e0e 100644
--- a/contrib/netcat/socks.c
+++ b/contrib/netcat/socks.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: socks.c,v 1.20 2012/03/08 09:56:28 espie Exp $ */
+/* $OpenBSD: socks.c,v 1.21 2015/03/26 21:19:51 tobias Exp $ */
/*
* Copyright (c) 1999 Niklas Hallqvist. All rights reserved.
@@ -308,8 +308,8 @@ socks_connect(const char *host, const char *port,
}
/* Terminate headers */
- if ((r = atomicio(vwrite, proxyfd, "\r\n", 2)) != 2)
- err(1, "write failed (2/%d)", r);
+ if ((cnt = atomicio(vwrite, proxyfd, "\r\n", 2)) != 2)
+ err(1, "write failed (%zu/2)", cnt);
/* Read status reply */
proxy_read_line(proxyfd, buf, sizeof(buf));
diff --git a/contrib/ntp/ChangeLog b/contrib/ntp/ChangeLog
index 304bd85..cfe4aa1 100644
--- a/contrib/ntp/ChangeLog
+++ b/contrib/ntp/ChangeLog
@@ -1,4 +1,38 @@
---
+(4.2.8p6) 2016/01/20 Released by Harlan Stenn <stenn@ntp.org>
+
+* [Sec 2935] Deja Vu: Replay attack on authenticated broadcast mode. HStenn.
+* [Sec 2936] Skeleton Key: Any trusted key system can serve time. HStenn.
+* [Sec 2937] ntpq: nextvar() missing length check. perlinger@ntp.org
+* [Sec 2938] ntpq saveconfig command allows dangerous characters
+ in filenames. perlinger@ntp.org
+* [Sec 2939] reslist NULL pointer dereference. perlinger@ntp.org
+* [Sec 2940] Stack exhaustion in recursive traversal of restriction
+ list. perlinger@ntp.org
+* [Sec 2942]: Off-path DoS attack on auth broadcast mode. HStenn.
+* [Sec 2945] Zero Origin Timestamp Bypass. perlinger@ntp.org
+* [Sec 2948] Potential Infinite Loop in ntpq ( and ntpdc) perlinger@ntp.org
+* [Bug 2772] adj_systime overflows tv_usec. perlinger@ntp.org
+* [Bug 2814] msyslog deadlock when signaled. perlinger@ntp.org
+ - applied patch by shenpeng11@huawei.com with minor adjustments
+* [Bug 2882] Look at ntp_request.c:list_peers_sum(). perlinger@ntp.org
+* [Bug 2891] Deadlock in deferred DNS lookup framework. perlinger@ntp.org
+* [Bug 2892] Several test cases assume IPv6 capabilities even when
+ IPv6 is disabled in the build. perlinger@ntp.org
+ - Found this already fixed, but validation led to cleanup actions.
+* [Bug 2905] DNS lookups broken. perlinger@ntp.org
+ - added limits to stack consumption, fixed some return code handling
+* [Bug 2971] ntpq bails on ^C: select fails: Interrupted system call
+ - changed stacked/nested handling of CTRL-C. perlinger@ntp.org
+ - make CTRL-C work for retrieval and printing od MRU list. perlinger@ntp.org
+* [Bug 2980] reduce number of warnings. perlinger@ntp.org
+ - integrated several patches from Havard Eidnes (he@uninett.no)
+* [Bug 2985] bogus calculation in authkeys.c perlinger@ntp.org
+ - implement 'auth_log2()' using integer bithack instead of float calculation
+* Make leapsec_query debug messages less verbose. Harlan Stenn.
+* Disable incomplete t-ntp_signd.c test. Harlan Stenn.
+
+---
(4.2.8p5) 2016/01/07 Released by Harlan Stenn <stenn@ntp.org>
* [Sec 2956] small-step/big-step. Close the panic gate earlier. HStenn.
@@ -47,6 +81,7 @@
lots of clients. perlinger@ntp.org
* [Bug 2971] ntpq bails on ^C: select fails: Interrupted system call
- changed stacked/nested handling of CTRL-C. perlinger@ntp.org
+ - make CTRL-C work for retrieval and printing od MRU list. perlinger@ntp.org
* Unity cleanup for FreeBSD-6.4. Harlan Stenn.
* Unity test cleanup. Harlan Stenn.
* Libevent autoconf pthread fixes for FreeBSD-10. Harlan Stenn.
@@ -55,9 +90,8 @@
* Quiet a warning from clang. Harlan Stenn.
* Update the NEWS file. Harlan Stenn.
* Update scripts/calc_tickadj/Makefile.am. Harlan Stenn.
+
---
-(4.2.8p4) 2015/10/21 Released by Harlan Stenn <stenn@ntp.org>
-(4.2.8p4-RC1) 2015/10/06 Released by Harlan Stenn <stenn@ntp.org>
* [Sec 2899] CVE-2014-9297 perlinger@ntp.org
* [Sec 2901] Drop invalid packet before checking KoD. Check for all KoD's.
diff --git a/contrib/ntp/CommitLog b/contrib/ntp/CommitLog
index 9caeaa2..26afcc5 100644
--- a/contrib/ntp/CommitLog
+++ b/contrib/ntp/CommitLog
@@ -1,8 +1,633 @@
-ChangeSet@1.3623, 2016-01-07 23:33:11+00:00, stenn@deacon.udel.edu
+ChangeSet@1.3628, 2016-01-20 04:20:12-05:00, stenn@deacon.udel.edu
+ NTP_4_2_8P6
+ TAG: NTP_4_2_8P6
+
+ ChangeLog@1.1793 +1 -0
+ NTP_4_2_8P6
+
+ ntpd/invoke-ntp.conf.texi@1.196 +1 -1
+ NTP_4_2_8P6
+
+ ntpd/invoke-ntp.keys.texi@1.188 +1 -1
+ NTP_4_2_8P6
+
+ ntpd/invoke-ntpd.texi@1.504 +2 -2
+ NTP_4_2_8P6
+
+ ntpd/ntp.conf.5man@1.230 +3 -3
+ NTP_4_2_8P6
+
+ ntpd/ntp.conf.5mdoc@1.230 +2 -3
+ NTP_4_2_8P6
+
+ ntpd/ntp.conf.html@1.183 +60 -2
+ NTP_4_2_8P6
+
+ ntpd/ntp.conf.man.in@1.230 +3 -3
+ NTP_4_2_8P6
+
+ ntpd/ntp.conf.mdoc.in@1.230 +2 -3
+ NTP_4_2_8P6
+
+ ntpd/ntp.keys.5man@1.222 +2 -2
+ NTP_4_2_8P6
+
+ ntpd/ntp.keys.5mdoc@1.222 +3 -3
+ NTP_4_2_8P6
+
+ ntpd/ntp.keys.html@1.184 +21 -33
+ NTP_4_2_8P6
+
+ ntpd/ntp.keys.man.in@1.222 +2 -2
+ NTP_4_2_8P6
+
+ ntpd/ntp.keys.mdoc.in@1.222 +3 -3
+ NTP_4_2_8P6
+
+ ntpd/ntpd-opts.c@1.526 +10 -10
+ NTP_4_2_8P6
+
+ ntpd/ntpd-opts.h@1.525 +4 -4
+ NTP_4_2_8P6
+
+ ntpd/ntpd.1ntpdman@1.333 +4 -4
+ NTP_4_2_8P6
+
+ ntpd/ntpd.1ntpdmdoc@1.333 +3 -3
+ NTP_4_2_8P6
+
+ ntpd/ntpd.html@1.177 +2 -2
+ NTP_4_2_8P6
+
+ ntpd/ntpd.man.in@1.333 +4 -4
+ NTP_4_2_8P6
+
+ ntpd/ntpd.mdoc.in@1.333 +3 -3
+ NTP_4_2_8P6
+
+ ntpdc/invoke-ntpdc.texi@1.501 +2 -2
+ NTP_4_2_8P6
+
+ ntpdc/ntpdc-opts.c@1.519 +10 -10
+ NTP_4_2_8P6
+
+ ntpdc/ntpdc-opts.h@1.518 +4 -4
+ NTP_4_2_8P6
+
+ ntpdc/ntpdc.1ntpdcman@1.332 +4 -4
+ NTP_4_2_8P6
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.332 +3 -3
+ NTP_4_2_8P6
+
+ ntpdc/ntpdc.html@1.345 +2 -2
+ NTP_4_2_8P6
+
+ ntpdc/ntpdc.man.in@1.332 +4 -4
+ NTP_4_2_8P6
+
+ ntpdc/ntpdc.mdoc.in@1.332 +3 -3
+ NTP_4_2_8P6
+
+ ntpq/invoke-ntpq.texi@1.508 +2 -2
+ NTP_4_2_8P6
+
+ ntpq/ntpq-opts.c@1.525 +10 -10
+ NTP_4_2_8P6
+
+ ntpq/ntpq-opts.h@1.523 +4 -4
+ NTP_4_2_8P6
+
+ ntpq/ntpq.1ntpqman@1.336 +4 -4
+ NTP_4_2_8P6
+
+ ntpq/ntpq.1ntpqmdoc@1.336 +3 -3
+ NTP_4_2_8P6
+
+ ntpq/ntpq.html@1.174 +2 -2
+ NTP_4_2_8P6
+
+ ntpq/ntpq.man.in@1.336 +4 -4
+ NTP_4_2_8P6
+
+ ntpq/ntpq.mdoc.in@1.336 +3 -3
+ NTP_4_2_8P6
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.503 +2 -2
+ NTP_4_2_8P6
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.521 +10 -10
+ NTP_4_2_8P6
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.520 +4 -4
+ NTP_4_2_8P6
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.332 +4 -4
+ NTP_4_2_8P6
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.332 +3 -3
+ NTP_4_2_8P6
+
+ ntpsnmpd/ntpsnmpd.html@1.172 +1 -1
+ NTP_4_2_8P6
+
+ ntpsnmpd/ntpsnmpd.man.in@1.332 +4 -4
+ NTP_4_2_8P6
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.332 +3 -3
+ NTP_4_2_8P6
+
+ packageinfo.sh@1.524 +2 -2
+ NTP_4_2_8P6
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjman@1.93 +3 -3
+ NTP_4_2_8P6
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc@1.94 +2 -2
+ NTP_4_2_8P6
+
+ scripts/calc_tickadj/calc_tickadj.html@1.95 +1 -1
+ NTP_4_2_8P6
+
+ scripts/calc_tickadj/calc_tickadj.man.in@1.92 +3 -3
+ NTP_4_2_8P6
+
+ scripts/calc_tickadj/calc_tickadj.mdoc.in@1.94 +2 -2
+ NTP_4_2_8P6
+
+ scripts/calc_tickadj/invoke-calc_tickadj.texi@1.97 +1 -1
+ NTP_4_2_8P6
+
+ scripts/invoke-plot_summary.texi@1.114 +2 -2
+ NTP_4_2_8P6
+
+ scripts/invoke-summary.texi@1.114 +2 -2
+ NTP_4_2_8P6
+
+ scripts/ntp-wait/invoke-ntp-wait.texi@1.324 +2 -2
+ NTP_4_2_8P6
+
+ scripts/ntp-wait/ntp-wait-opts@1.60 +2 -2
+ NTP_4_2_8P6
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitman@1.321 +3 -3
+ NTP_4_2_8P6
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitmdoc@1.322 +2 -2
+ NTP_4_2_8P6
+
+ scripts/ntp-wait/ntp-wait.html@1.341 +2 -2
+ NTP_4_2_8P6
+
+ scripts/ntp-wait/ntp-wait.man.in@1.321 +3 -3
+ NTP_4_2_8P6
+
+ scripts/ntp-wait/ntp-wait.mdoc.in@1.322 +2 -2
+ NTP_4_2_8P6
+
+ scripts/ntpsweep/invoke-ntpsweep.texi@1.112 +2 -2
+ NTP_4_2_8P6
+
+ scripts/ntpsweep/ntpsweep-opts@1.62 +2 -2
+ NTP_4_2_8P6
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepman@1.100 +3 -3
+ NTP_4_2_8P6
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepmdoc@1.100 +2 -2
+ NTP_4_2_8P6
+
+ scripts/ntpsweep/ntpsweep.html@1.113 +2 -2
+ NTP_4_2_8P6
+
+ scripts/ntpsweep/ntpsweep.man.in@1.100 +3 -3
+ NTP_4_2_8P6
+
+ scripts/ntpsweep/ntpsweep.mdoc.in@1.101 +2 -2
+ NTP_4_2_8P6
+
+ scripts/ntptrace/invoke-ntptrace.texi@1.113 +2 -2
+ NTP_4_2_8P6
+
+ scripts/ntptrace/ntptrace-opts@1.62 +2 -2
+ NTP_4_2_8P6
+
+ scripts/ntptrace/ntptrace.1ntptraceman@1.100 +3 -3
+ NTP_4_2_8P6
+
+ scripts/ntptrace/ntptrace.1ntptracemdoc@1.101 +2 -2
+ NTP_4_2_8P6
+
+ scripts/ntptrace/ntptrace.html@1.114 +2 -2
+ NTP_4_2_8P6
+
+ scripts/ntptrace/ntptrace.man.in@1.100 +3 -3
+ NTP_4_2_8P6
+
+ scripts/ntptrace/ntptrace.mdoc.in@1.102 +2 -2
+ NTP_4_2_8P6
+
+ scripts/plot_summary-opts@1.62 +2 -2
+ NTP_4_2_8P6
+
+ scripts/plot_summary.1plot_summaryman@1.112 +3 -3
+ NTP_4_2_8P6
+
+ scripts/plot_summary.1plot_summarymdoc@1.112 +2 -2
+ NTP_4_2_8P6
+
+ scripts/plot_summary.html@1.115 +2 -2
+ NTP_4_2_8P6
+
+ scripts/plot_summary.man.in@1.112 +3 -3
+ NTP_4_2_8P6
+
+ scripts/plot_summary.mdoc.in@1.112 +2 -2
+ NTP_4_2_8P6
+
+ scripts/summary-opts@1.62 +2 -2
+ NTP_4_2_8P6
+
+ scripts/summary.1summaryman@1.112 +3 -3
+ NTP_4_2_8P6
+
+ scripts/summary.1summarymdoc@1.112 +2 -2
+ NTP_4_2_8P6
+
+ scripts/summary.html@1.115 +2 -2
+ NTP_4_2_8P6
+
+ scripts/summary.man.in@1.112 +3 -3
+ NTP_4_2_8P6
+
+ scripts/summary.mdoc.in@1.112 +2 -2
+ NTP_4_2_8P6
+
+ scripts/update-leap/invoke-update-leap.texi@1.13 +1 -1
+ NTP_4_2_8P6
+
+ scripts/update-leap/update-leap-opts@1.13 +2 -2
+ NTP_4_2_8P6
+
+ scripts/update-leap/update-leap.1update-leapman@1.13 +3 -3
+ NTP_4_2_8P6
+
+ scripts/update-leap/update-leap.1update-leapmdoc@1.13 +2 -2
+ NTP_4_2_8P6
+
+ scripts/update-leap/update-leap.html@1.13 +1 -1
+ NTP_4_2_8P6
+
+ scripts/update-leap/update-leap.man.in@1.13 +3 -3
+ NTP_4_2_8P6
+
+ scripts/update-leap/update-leap.mdoc.in@1.13 +2 -2
+ NTP_4_2_8P6
+
+ sntp/invoke-sntp.texi@1.501 +2 -2
+ NTP_4_2_8P6
+
+ sntp/sntp-opts.c@1.520 +10 -10
+ NTP_4_2_8P6
+
+ sntp/sntp-opts.h@1.518 +4 -4
+ NTP_4_2_8P6
+
+ sntp/sntp.1sntpman@1.336 +4 -4
+ NTP_4_2_8P6
+
+ sntp/sntp.1sntpmdoc@1.336 +3 -3
+ NTP_4_2_8P6
+
+ sntp/sntp.html@1.516 +2 -2
+ NTP_4_2_8P6
+
+ sntp/sntp.man.in@1.336 +4 -4
+ NTP_4_2_8P6
+
+ sntp/sntp.mdoc.in@1.336 +3 -3
+ NTP_4_2_8P6
+
+ util/invoke-ntp-keygen.texi@1.504 +2 -2
+ NTP_4_2_8P6
+
+ util/ntp-keygen-opts.c@1.522 +10 -10
+ NTP_4_2_8P6
+
+ util/ntp-keygen-opts.h@1.520 +4 -4
+ NTP_4_2_8P6
+
+ util/ntp-keygen.1ntp-keygenman@1.332 +4 -4
+ NTP_4_2_8P6
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.332 +3 -3
+ NTP_4_2_8P6
+
+ util/ntp-keygen.html@1.178 +2 -2
+ NTP_4_2_8P6
+
+ util/ntp-keygen.man.in@1.332 +4 -4
+ NTP_4_2_8P6
+
+ util/ntp-keygen.mdoc.in@1.332 +3 -3
+ NTP_4_2_8P6
+
+ChangeSet@1.3627, 2016-01-20 04:14:51-05:00, stenn@deacon.udel.edu
+ solaris hack
+
+ libntp/work_thread.c@1.20 +2 -0
+ solaris hack
+
+ChangeSet@1.3626, 2016-01-20 01:50:09-05:00, stenn@deacon.udel.edu
+ 4.2.8p6
+
+ packageinfo.sh@1.523 +1 -1
+ 4.2.8p6
+
+ChangeSet@1.3625, 2016-01-20 00:34:15+00:00, stenn@psp-deb1.ntp.org
+ updates
+
+ NEWS@1.160 +24 -24
+ updates
+
+ChangeSet@1.3624, 2016-01-19 22:28:41+00:00, stenn@psp-deb1.ntp.org
+ typo
+
+ NEWS@1.159 +1 -1
+ typo
+
+ChangeSet@1.3623, 2016-01-18 11:55:56+00:00, stenn@psp-deb1.ntp.org
+ [Sec 2936] Skeleton Key: Any trusted key system can serve time. HStenn.
+
+ ChangeLog@1.1792 +1 -0
+ [Sec 2936] Skeleton Key: Any trusted key system can serve time. HStenn.
+
+ NEWS@1.158 +40 -0
+ [Sec 2936] Skeleton Key: Any trusted key system can serve time. HStenn.
+
+ include/Makefile.am@1.54 +1 -0
+ [Sec 2936] Skeleton Key: Any trusted key system can serve time. HStenn.
+
+ include/ntp_io.h@1.23 +2 -1
+ [Sec 2936] Skeleton Key: Any trusted key system can serve time. HStenn.
+
+ include/ntp_keyacc.h@1.1 +13 -0
+ BitKeeper file /home/stenn/ntp-stable-2936/include/ntp_keyacc.h
+
+ include/ntp_keyacc.h@1.0 +0 -0
+
+ include/ntp_stdlib.h@1.81 +4 -1
+ [Sec 2936] Skeleton Key: Any trusted key system can serve time. HStenn.
+
+ include/ntp_types.h@1.36 +1 -0
+ [Sec 2936] Skeleton Key: Any trusted key system can serve time. HStenn.
+
+ libntp/Makefile.am@1.77 +1 -0
+ [Sec 2936] Skeleton Key: Any trusted key system can serve time. HStenn.
+
+ libntp/authkeys.c@1.31 +60 -6
+ [Sec 2936] Skeleton Key: Any trusted key system can serve time. HStenn.
+
+ libntp/authreadkeys.c@1.25 +50 -1
+ [Sec 2936] Skeleton Key: Any trusted key system can serve time. HStenn.
+
+ libntp/authusekey.c@1.11 +1 -1
+ [Sec 2936] Skeleton Key: Any trusted key system can serve time. HStenn.
+
+ libntp/is_ip_address.c@1.1 +129 -0
+ BitKeeper file /home/stenn/ntp-stable-2936/libntp/is_ip_address.c
+
+ libntp/is_ip_address.c@1.0 +0 -0
+
+ ntpd/invoke-ntp.keys.texi@1.187 +11 -3
+ [Sec 2936] Skeleton Key: Any trusted key system can serve time. HStenn.
+
+ ntpd/ntp.keys.5man@1.221 +13 -5
+ [Sec 2936] Skeleton Key: Any trusted key system can serve time. HStenn.
+
+ ntpd/ntp.keys.5mdoc@1.221 +14 -6
+ [Sec 2936] Skeleton Key: Any trusted key system can serve time. HStenn.
+
+ ntpd/ntp.keys.def@1.11 +10 -2
+ [Sec 2936] Skeleton Key: Any trusted key system can serve time. HStenn.
+
+ ntpd/ntp.keys.html@1.183 +42 -22
+ [Sec 2936] Skeleton Key: Any trusted key system can serve time. HStenn.
+
+ ntpd/ntp.keys.man.in@1.221 +13 -5
+ [Sec 2936] Skeleton Key: Any trusted key system can serve time. HStenn.
+
+ ntpd/ntp.keys.mdoc.in@1.221 +14 -6
+ [Sec 2936] Skeleton Key: Any trusted key system can serve time. HStenn.
+
+ ntpd/ntp_crypto.c@1.186 +1 -1
+ [Sec 2936] Skeleton Key: Any trusted key system can serve time. HStenn.
+
+ ntpd/ntp_io.c@1.412 +0 -72
+ [Sec 2936] Skeleton Key: Any trusted key system can serve time. HStenn.
+
+ ntpd/ntp_proto.c@1.373 +34 -0
+ [Sec 2936] Skeleton Key: Any trusted key system can serve time. HStenn.
+
+ tests/libntp/authkeys.c@1.15 +1 -1
+ [Sec 2936] Skeleton Key: Any trusted key system can serve time. HStenn.
+
+ChangeSet@1.3622, 2016-01-17 09:03:57+00:00, stenn@psp-deb1.ntp.org
+ Disable incomplete t-ntp_signd.c test. Harlan Stenn.
+
+ ChangeLog@1.1791 +1 -0
+ Disable incomplete t-ntp_signd.c test. Harlan Stenn.
+
+ tests/ntpd/t-ntp_signd.c@1.16 +4 -0
+ Disable incomplete t-ntp_signd.c test. Harlan Stenn.
+
+ChangeSet@1.3621, 2016-01-17 05:51:14+00:00, stenn@psp-deb1.ntp.org
+ Update NEWS file for 2942
+
+ NEWS@1.157 +22 -0
+ Update NEWS file for 2942
+
+ChangeSet@1.3615.13.1, 2016-01-17 05:07:22+00:00, stenn@psp-deb1.ntp.org
+ [Sec 2942]: Off-path DoS attack on auth broadcast mode. HStenn.
+
+ ChangeLog@1.1786.13.1 +4 -0
+ [Sec 2942]: Off-path DoS attack on auth broadcast mode. HStenn.
+
+ html/miscopt.html@1.85 +11 -3
+ [Sec 2942]: Off-path DoS attack on auth broadcast mode. HStenn.
+
+ include/ntp.h@1.213.1.1 +3 -0
+ [Sec 2942]: Off-path DoS attack on auth broadcast mode. HStenn.
+
+ ntpd/invoke-ntp.conf.texi@1.195 +64 -3
+ [Sec 2942]: Off-path DoS attack on auth broadcast mode. HStenn.
+
+ ntpd/keyword-gen-utd@1.27 +1 -1
+ [Sec 2942]: Off-path DoS attack on auth broadcast mode. HStenn.
+
+ ntpd/keyword-gen.c@1.33 +3 -0
+ [Sec 2942]: Off-path DoS attack on auth broadcast mode. HStenn.
+
+ ntpd/ntp.conf.5man@1.229 +71 -7
+ [Sec 2942]: Off-path DoS attack on auth broadcast mode. HStenn.
+
+ ntpd/ntp.conf.5mdoc@1.229 +71 -7
+ [Sec 2942]: Off-path DoS attack on auth broadcast mode. HStenn.
+
+ ntpd/ntp.conf.def@1.21 +67 -4
+ [Sec 2942]: Off-path DoS attack on auth broadcast mode. HStenn.
+
+ ntpd/ntp.conf.man.in@1.229 +71 -7
+ [Sec 2942]: Off-path DoS attack on auth broadcast mode. HStenn.
+
+ ntpd/ntp.conf.mdoc.in@1.229 +71 -7
+ [Sec 2942]: Off-path DoS attack on auth broadcast mode. HStenn.
+
+ ntpd/ntp_config.c@1.335.1.1 +12 -0
+ [Sec 2942]: Off-path DoS attack on auth broadcast mode. HStenn.
+
+ ntpd/ntp_keyword.h@1.29 +505 -468
+ [Sec 2942]: Off-path DoS attack on auth broadcast mode. HStenn.
+
+ ntpd/ntp_parser.c@1.101 +1762 -1513
+ [Sec 2942]: Off-path DoS attack on auth broadcast mode. HStenn.
+
+ ntpd/ntp_parser.h@1.65 +257 -235
+ [Sec 2942]: Off-path DoS attack on auth broadcast mode. HStenn.
+
+ ntpd/ntp_parser.y@1.91 +6 -0
+ [Sec 2942]: Off-path DoS attack on auth broadcast mode. HStenn.
+
+ ntpd/ntp_proto.c@1.368.2.1 +40 -4
+ [Sec 2942]: Off-path DoS attack on auth broadcast mode. HStenn.
+
+ChangeSet@1.3619, 2016-01-14 12:19:16+00:00, stenn@psp-at1.ntp.org
+ NEWS file updates
+
+ NEWS@1.156 +21 -0
+ NEWS file updates
+
+ChangeSet@1.3615.1.9, 2016-01-14 11:33:43+00:00, stenn@psp-at1.ntp.org
+ merge cleanup
+
+ ChangeLog@1.1786.1.9 +3 -0
+ merge cleanup
+
+ChangeSet@1.3615.1.5, 2016-01-14 10:44:13+00:00, stenn@psp-at1.ntp.org
+ merge cleanup
+
+ ChangeLog@1.1786.1.5 +0 -1
+ merge cleanup
+
+ChangeSet@1.3615.12.4, 2016-01-14 10:27:23+00:00, stenn@psp-at1.ntp.org
+ merge cleanup
+
+ ChangeLog@1.1786.12.4 +1 -1
+ merge cleanup
+
+ChangeSet@1.3615.12.2, 2016-01-14 09:49:52+00:00, stenn@psp-at1.ntp.org
+ merge cleanup
+
+ ChangeLog@1.1786.12.2 +2 -2
+ merge cleanup
+
+ChangeSet@1.3615.3.17, 2016-01-14 09:33:56+00:00, stenn@psp-at1.ntp.org
+ merge cleanup
+
+ ChangeLog@1.1786.3.14 +1 -1
+ merge cleanup
+
+ChangeSet@1.3615.3.14, 2016-01-14 07:36:57+00:00, stenn@psp-at1.ntp.org
+ NEWS update
+
+ NEWS@1.155 +98 -7
+ NEWS update
+
+ChangeSet@1.3615.3.12, 2016-01-13 08:07:30+00:00, stenn@psp-deb1.ntp.org
+ typo
+
+ ChangeLog@1.1786.3.10 +1 -1
+ typo
+
+ChangeSet@1.3615.3.10, 2016-01-13 06:08:29+00:00, stenn@psp-deb1.ntp.org
+ Update NEWS file for bug 2938
+
+ NEWS@1.154 +29 -2
+ Update NEWS file for bug 2938
+
+ChangeSet@1.3615.3.8, 2016-01-13 04:23:46+00:00, stenn@psp-deb1.ntp.org
+ Update NEWS file for bug 2935
+
+ NEWS@1.153 +52 -0
+ Update NEWS file for bug 2935
+
+ChangeSet@1.3615.7.12, 2016-01-12 09:53:06+00:00, stenn@psp-at1.ntp.org
+ [Sec 2935] use L_SUB instead of L_ISGT. Juergen Perlinger
+
+ ntpd/ntp_proto.c@1.368.1.5 +4 -1
+ [Sec 2935] use L_SUB instead of L_ISGT. Juergen Perlinger
+
+ChangeSet@1.3615.7.11, 2016-01-11 03:02:53-08:00, harlan@max.pfcs.com
+ [Sec 2935] Deja Vu: Replay attack on authenticated broadcast mode.
+
+ ChangeLog@1.1786.9.1 +4 -0
+ [Sec 2935] Deja Vu: Replay attack on authenticated broadcast mode.
+
+ include/ntp.h@1.215 +1 -0
+ [Sec 2935] Deja Vu: Replay attack on authenticated broadcast mode.
+
+ ntpd/ntp_proto.c@1.368.1.4 +67 -0
+ [Sec 2935] Deja Vu: Replay attack on authenticated broadcast mode.
+
+ChangeSet@1.3615.7.10, 2016-01-11 02:44:25-08:00, harlan@max.pfcs.com
+ make leapsec_query messages less verbose.
+
+ ntpd/ntp_timer.c@1.93.1.1 +6 -4
+ make leapsec_query messages less verbose.
+
+ChangeSet@1.3615.9.1, 2016-01-11 10:26:12+01:00, jnperlin@hydra.localnet
+ [Bug 2985] bogus calculation in authkeys.c
+ - implement 'auth_log2()' using integer bithack instead of float calculation
+
+ ChangeLog@1.1786.7.5 +2 -0
+ [Bug 2985] bogus calculation in authkeys.c
+ - implement 'auth_log2()' using integer bithack instead of float calculation
+
+ libntp/authkeys.c@1.30 +33 -10
+ [Bug 2985] bogus calculation in authkeys.c
+ - implement 'auth_log2()' using integer bithack instead of float calculation
+
+ tests/libntp/authkeys.c@1.14 +38 -0
+ [Bug 2985] bogus calculation in authkeys.c
+ - test bithack implementation of 'auth_log2()'
+
+ tests/libntp/run-authkeys.c@1.12 +9 -6
+ [Bug 2985] bogus calculation in authkeys.c
+ - update auto-generated file
+
+ChangeSet@1.3615.7.9, 2016-01-09 09:52:44+00:00, stenn@psp-at1.ntp.org
+ Add timelastrec to the peer structure
+
+ include/ntp.h@1.214 +2 -1
+ Add timelastrec to the peer structure
+
+ChangeSet@1.3615.3.6, 2016-01-08 10:00:03+00:00, stenn@psp-at1.ntp.org
+ 4.2.8p5 merge cleanup
+
+ ChangeLog@1.1786.3.6 +1 -1
+ 4.2.8p5 merge cleanup
+
+ChangeSet@1.3615.7.8, 2016-01-08 00:26:09+00:00, stenn@deacon.udel.edu
+ Update copyright year
+
+ sntp/include/copyright.def@1.26 +1 -1
+ Update copyright year
+
+ChangeSet@1.3615.7.7, 2016-01-07 23:33:11+00:00, stenn@deacon.udel.edu
NTP_4_2_8P5
TAG: NTP_4_2_8P5
- ChangeLog@1.1791 +1 -0
+ ChangeLog@1.1786.7.4 +1 -0
NTP_4_2_8P5
ntpd/invoke-ntp.conf.texi@1.194 +1 -1
@@ -332,60 +957,349 @@ ChangeSet@1.3623, 2016-01-07 23:33:11+00:00, stenn@deacon.udel.edu
util/ntp-keygen.mdoc.in@1.331 +2 -2
NTP_4_2_8P5
-ChangeSet@1.3622, 2016-01-07 17:52:24-05:00, stenn@deacon.udel.edu
+ChangeSet@1.3615.7.6, 2016-01-07 17:52:24-05:00, stenn@deacon.udel.edu
ntp-4.2.8p5
packageinfo.sh@1.521 +1 -1
ntp-4.2.8p5
-ChangeSet@1.3621, 2016-01-07 22:20:05+00:00, stenn@psp-at1.ntp.org
+ChangeSet@1.3615.7.5, 2016-01-07 22:20:05+00:00, stenn@psp-at1.ntp.org
cleanup
NEWS@1.152 +2 -2
cleanup
-ChangeSet@1.3620, 2016-01-07 09:33:11+00:00, stenn@psp-at1.ntp.org
+ChangeSet@1.3615.7.4, 2016-01-07 09:33:11+00:00, stenn@psp-at1.ntp.org
typo in ntp_proto.c - leap smear. Reported by Martin Burnicki
- ntpd/ntp_proto.c@1.371 +1 -1
+ ntpd/ntp_proto.c@1.368.1.3 +1 -1
typo in ntp_proto.c - leap smear. Reported by Martin Burnicki
-ChangeSet@1.3619, 2016-01-07 06:33:08+00:00, stenn@psp-at1.ntp.org
+ChangeSet@1.3615.7.3, 2016-01-07 06:33:08+00:00, stenn@psp-at1.ntp.org
Update scripts/calc_tickadj/Makefile.am. Harlan Stenn.
- ChangeLog@1.1790 +1 -0
+ ChangeLog@1.1786.7.3 +1 -0
Update scripts/calc_tickadj/Makefile.am. Harlan Stenn.
scripts/calc_tickadj/Makefile.am@1.11 +2 -0
Update scripts/calc_tickadj/Makefile.am. Harlan Stenn.
-ChangeSet@1.3616.1.1, 2016-01-05 10:57:45+00:00, stenn@psp-at1.ntp.org
+ChangeSet@1.3615.3.2, 2016-01-05 12:34:56+00:00, stenn@psp-at1.ntp.org
+ ntp-4.2.8p6
+
+ ChangeLog@1.1786.3.2 +2 -0
+ ntp-4.2.8p6
+
+ChangeSet@1.3615.8.1, 2016-01-05 10:57:45+00:00, stenn@psp-at1.ntp.org
Bug 2952 fixes
- ChangeLog@1.1787.1.1 +1 -0
+ ChangeLog@1.1786.8.1 +1 -0
Bug 2952 fixes
- ntpd/ntp_proto.c@1.370 +165 -152
+ ntpd/ntp_proto.c@1.368.1.2 +165 -152
Bug 2952 fixes
-ChangeSet@1.3617, 2016-01-05 09:56:31+00:00, stenn@psp-at1.ntp.org
+ChangeSet@1.3615.7.1, 2016-01-05 09:56:31+00:00, stenn@psp-at1.ntp.org
ntp-4.2.8p5 prep
- ChangeLog@1.1788 +2 -1
+ ChangeLog@1.1786.7.1 +2 -1
ntp-4.2.8p5 prep
NEWS@1.151 +104 -3
ntp-4.2.8p5 prep
-ChangeSet@1.3616, 2015-12-06 11:20:02+00:00, stenn@psp-deb1.ntp.org
+ChangeSet@1.3615.5.1, 2015-12-13 13:35:12+01:00, jnperlin@hydra.localnet
+ [Bug 2892] Several test cases assume IPv6 capabilities even when IPv6 is disabled in the build
+ Found this already fixed, but validation lead to further cleanup:
+ - source code formatting
+ - inline variable definitions moved to start of block
+ - made some pure input data pointers 'const void*' instead of 'char*'; avoids casts and warnings
+
+ ChangeLog@1.1786.5.1 +3 -0
+ [Bug 2892] Several test cases assume IPv6 capabilities even when IPv6 is disabled in the build
+
+ sntp/crypto.c@1.19 +13 -12
+ [Bug 2892] Several test cases assume IPv6 capabilities even when IPv6 is disabled in the build
+ - sidekick: make pure input pointers 'const void*' instead of 'char*'
+ - sidekick: remove unnecessary casts
+
+ sntp/crypto.h@1.11 +11 -9
+ [Bug 2892] Several test cases assume IPv6 capabilities even when IPv6 is disabled in the build
+ - sidekick: make pure input pointers 'const void*' instead of 'char*'
+ - source formatting
+
+ sntp/main.c@1.99 +1 -1
+ [Bug 2892] Several test cases assume IPv6 capabilities even when IPv6 is disabled in the build
+ - no need to cast input to 'make_mac()' any more
+
+ sntp/networking.c@1.68 +1 -1
+ [Bug 2892] Several test cases assume IPv6 capabilities even when IPv6 is disabled in the build
+ - no need to cast input to 'auth_md5()' any more
+
+ sntp/tests/crypto.c@1.10 +41 -27
+ [Bug 2892] Several test cases assume IPv6 capabilities even when IPv6 is disabled in the build
+ - remove unnecessary casts
+ - source code formatting
+
+ sntp/tests/fileHandlingTest.c@1.4 +43 -20
+ [Bug 2892] Several test cases assume IPv6 capabilities even when IPv6 is disabled in the build
+ - create 'DestroyPath()' companion to 'CreatePath()' to avoid trouble with 'free()' on 'const char*'
+
+ sntp/tests/fileHandlingTest.h.in@1.15 +6 -15
+ [Bug 2892] Several test cases assume IPv6 capabilities even when IPv6 is disabled in the build
+ - create 'DestroyPath()' companion to 'CreatePath()' to avoid trouble with 'free()' on 'const char*'
+
+ sntp/tests/keyFile.c@1.13 +66 -46
+ [Bug 2892] Several test cases assume IPv6 capabilities even when IPv6 is disabled in the build
+ - use 'DestroyPath()' avoid trouble with 'free()' on 'const char*'
+ - printf() combined
+ - source code formatting
+ - move variable declarations to front
+
+ sntp/tests/packetHandling.c@1.6 +75 -64
+ [Bug 2892] Several test cases assume IPv6 capabilities even when IPv6 is disabled in the build
+ - move variable declarations to front
+ - source code formatting
+
+ sntp/tests/packetProcessing.c@1.9 +124 -90
+ [Bug 2892] Several test cases assume IPv6 capabilities even when IPv6 is disabled in the build
+ - move variable declarations to front
+ - source code formatting
+ - drop unnecessary casts
+
+ sntp/tests/run-packetProcessing.c@1.10 +18 -18
+ [Bug 2892] Several test cases assume IPv6 capabilities even when IPv6 is disabled in the build
+
+ sntp/unity/unity_internals.h@1.6 +1 -1
+ [Bug 2892] Several test cases assume IPv6 capabilities even when IPv6 is disabled in the build
+ - added missing 'const' in pointer casts
+
+ tests/libntp/decodenetnum.c@1.11 +33 -23
+ [Bug 2892] Several test cases assume IPv6 capabilities even when IPv6 is disabled in the build
+ - source code formatting + cleanup
+
+ tests/libntp/run-decodenetnum.c@1.11 +4 -4
+ [Bug 2892] Several test cases assume IPv6 capabilities even when IPv6 is disabled in the build
+
+ tests/libntp/run-socktoa.c@1.14 +5 -5
+ [Bug 2892] Several test cases assume IPv6 capabilities even when IPv6 is disabled in the build
+
+ tests/libntp/socktoa.c@1.12 +23 -17
+ [Bug 2892] Several test cases assume IPv6 capabilities even when IPv6 is disabled in the build
+ - source code formatting + cleanup
+
+ChangeSet@1.3615.4.1, 2015-12-11 18:24:16+01:00, jnperlin@hydra.localnet
+ [Bug 2882] Look at ntp_request.c:list_peers_sum()
+
+ ChangeLog@1.1786.4.1 +1 -0
+ [Bug 2882] Look at ntp_request.c:list_peers_sum()
+
+ ntpd/ntp_request.c@1.116 +57 -72
+ [Bug 2882] Look at ntp_request.c:list_peers_sum()
+ - 'list_peers()' and 'list_peers_sum()' skip IPv6 entires if client does not support them,
+ but continue processing until end of list now.
+
+ChangeSet@1.3615.1.3, 2015-12-09 18:23:31+01:00, jnperlin@hydra.localnet
+ [Bug 2891] Deadlock in deferred DNS lookup framework.
+
+ ChangeLog@1.1786.1.3 +1 -0
+ [Bug 2891] Deadlock in deferred DNS lookup framework.
+
+ include/ntp_worker.h@1.5 +31 -22
+ [Bug 2891] Deadlock in deferred DNS lookup framework.
+ - provide signal-safe result-ready detection
+
+ libntp/ntp_worker.c@1.7 +27 -0
+ [Bug 2891] Deadlock in deferred DNS lookup framework.
+ - support signal-safe result-ready detection
+ - provide function to harvest async results from mainloop
+
+ ntpd/ntp_io.c@1.409.1.1 +160 -133
+ [Bug 2891] Deadlock in deferred DNS lookup framework.
+ - do not process async-resolver results from signal handler
+ - set notification tags to harvest asyn-resolver results from mainloop
+ - avoid double select for synchronous IO
+ - avoid several syslog calls in signal-handler context
+ - refactor / conditionalize some functions that cannot be used in signal-driven IO
+
+ ntpd/ntpd.c@1.169 +4 -0
+ [Bug 2891] Deadlock in deferred DNS lookup framework.
+ - reap/harvest async resolver results from mainloop
+
+ChangeSet@1.3615.1.2, 2015-12-06 21:33:26+01:00, jnperlin@hydra.localnet
+ [Bug 2814] msyslog deadlock when signaled. perlinger@ntp.org
+ - applied patch by shenpeng11@huawei.com with minor adjustments
+
+ ChangeLog@1.1786.1.2 +2 -0
+ [Bug 2814] msyslog deadlock when signaled. perlinger@ntp.org
+ - applied patch by shenpeng11@huawei.com with minor adjustments
+
+ ntpd/ntpd.c@1.168 +26 -3
+ [Bug 2814] msyslog deadlock when signaled. perlinger@ntp.org
+ - applied patch by shenpeng11@huawei.com with minor adjustments
+
+ChangeSet@1.3615.2.1, 2015-12-06 20:19:32+01:00, jnperlin@hydra.localnet
+ [Bug 2772] adj_systime overflows tv_usec
+
+ ChangeLog@1.1786.2.1 +1 -0
+ [Bug 2772] adj_systime overflows tv_usec
+
+ libntp/systime.c@1.71 +12 -3
+ [Bug 2772] adj_systime overflows tv_usec
+ - add missing normalisation for nitpicking implementations of 'adjtime()'
+
+ChangeSet@1.3615.1.1, 2015-12-06 11:20:02+00:00, stenn@psp-deb1.ntp.org
Quiet a warning from clang. Harlan Stenn.
- ChangeLog@1.1787 +1 -0
+ ChangeLog@1.1786.1.1 +1 -0
Quiet a warning from clang. Harlan Stenn.
libntp/ntp_rfc2553.c@1.50 +3 -2
Quiet a warning from clang. Harlan Stenn.
+ChangeSet@1.3616, 2015-12-05 20:28:19+00:00, perlinger@psp-deb1.ntp.org
+ [Bug 2980] reduce number of warnings
+ - string formatting(arguments should be literals)
+ - applying constness where necessary
+ - removing bad consts that are superfluous
+ - avoid signed/unsigned clashes in conditionals (either by cast or type change)
+ - signed/unsigned and promotion conflicts
+ - add prototypes for function pointer tables
+ - force unsigned argument promotion in calls to 'ctype' functions (is{digit,cntrl,...})
+
+ ChangeLog@1.1787 +2 -0
+ [Bug 2980] reduce number of warnings
+
+ include/parse.h@1.14 +3 -3
+ [Bug 2980] reduce number of warnings
+ - make GPSWRAP and GPSWEEK unqualified literals to avoid signed/unsigned clashes
+
+ ntpd/ntp_config.c@1.336 +2 -0
+ [Bug 2980] reduce number of warnings
+ - add forward declaration of yyparse()
+
+ ntpd/ntp_io.c@1.410 +1 -1
+ [Bug 2980] reduce number of warnings
+ - fix a signedness comparison by adding a cast to size_t
+
+ ntpd/ntp_scanner.c@1.49 +1 -1
+ [Bug 2980] reduce number of warnings
+ - for type compatibility, make counter 'i' a size_t
+
+ ntpd/ntp_timer.c@1.94 +5 -6
+ [Bug 2980] reduce number of warnings
+ - fix a signed / unsigned compare
+
+ ntpd/refclock_chu.c@1.58 +1 -1
+ [Bug 2980] reduce number of warnings
+ - rewrite check to avoid warning about integer overflow
+
+ ntpd/refclock_gpsdjson.c@1.24 +13 -15
+ [Bug 2980] reduce number of warnings
+ - reshuffle to use a literal format string
+ - fix signed/unsigned clashes in compare
+
+ ntpd/refclock_jjy.c@1.30 +47 -44
+ Bug 2980 - reduce number of warnings
+ - make several pointers 'const char*'
+ - add prototypes for function pointer tables
+ - force unsigned argument promotion in calls to 'ctype' functions (is{digit,cntrl,...})
+
+ ntpd/refclock_shm.c@1.39 +1 -1
+ [Bug 2980] reduce number of warnings
+ - fix signed/unsigned clashes in compare
+
+ ntpq/ntpq-subs.c@1.114.1.1 +1 -1
+ [Bug 2980] reduce number of warnings
+ - avoid signed/unsigned clashe in compare
+
+ ntpq/ntpq.c@1.165.1.1 +47 -7
+ [Bug 2980] reduce number of warnings
+ - avoid juggling with formatting into dynamic buffers by a 'asprintf' like function
+
+ sntp/libopts/configfile.c@1.24 +22 -22
+ [Bug 2980] reduce number of warnings
+ - add some pointer constness to avoid casting it away
+
+ sntp/libopts/enum.c@1.14 +5 -5
+ [Bug 2980] reduce number of warnings
+ - avoid some unnecessary casts
+ - avoid shift/promote ambiguity by proper typing
+
+ sntp/libopts/find.c@1.13 +1 -1
+ [Bug 2980] reduce number of warnings
+ - Use VOIDP instead of a (char*) cast
+
+ sntp/libopts/init.c@1.9 +2 -3
+ [Bug 2980] reduce number of warnings
+ - use VOIDP() to replace a complicated double cast
+ - remove one useless cast
+
+ sntp/libopts/load.c@1.22 +1 -1
+ [Bug 2980] reduce number of warnings
+ - remove a useless cast
+
+ sntp/libopts/makeshell.c@1.21 +3 -3
+ [Bug 2980] reduce number of warnings
+ - fix integer promotion in calls to toupper/tolower
+
+ sntp/libopts/nested.c@1.17 +3 -1
+ [Bug 2980] reduce number of warnings
+ - avoid casting away constness by using a helper variable
+
+ sntp/libopts/parse-duration.c@1.15 +8 -2
+ [Bug 2980] reduce number of warnings
+ - avoid casting away constness by using a helper variable
+
+ sntp/libopts/reset.c@1.18 +1 -1
+ [Bug 2980] reduce number of warnings
+ - remove a useless cast
+
+ sntp/libopts/save.c@1.19 +2 -2
+ [Bug 2980] reduce number of warnings
+ - use VOIDP() instead of cast via (void**)
+
+ sntp/libopts/tokenize.c@1.14 +1 -1
+ [Bug 2980] reduce number of warnings
+ - add a required const qualification
+
+ChangeSet@1.3597.1.5, 2015-12-05 14:29:10+01:00, jnperlin@hydra.localnet
+ [Bug 2971] ntpq bails on ^C: select fails: Interrupted system call
+ - make CTRL-C work for retrieval and printing od MRU list.
+
+ ChangeLog@1.1770.1.3 +1 -0
+ [Bug 2971] ntpq bails on ^C: select fails: Interrupted system call
+ - make CTRL-C work for retrieval and printing od MRU list.
+
+ ntpq/ntpq-subs.c@1.115 +6 -0
+ [Bug 2971] ntpq bails on ^C: select fails: Interrupted system call
+ - make CTRL-C work for retrieval and printing od MRU list:
+ 1) CTRL-C while collecting terminates the assembling of respose.
+ 2) CTRL-C while printing will terminate the print loop.
+ 3) both work independently of each other.
+
+ ntpq/ntpq.c@1.166 +16 -0
+ [Bug 2971] ntpq bails on ^C: select fails: Interrupted system call
+ - when collecting fragments, CTRL-C will try to cleanly return the list of fragments so far.
+
+ChangeSet@1.3597.5.1, 2015-12-05 13:44:57+01:00, jnperlin@hydra.localnet
+ [Bug 2905] DNS lookups broken.
+ - added limits to stack consumption, fixed some return code handling
+
+ ChangeLog@1.1770.5.1 +2 -0
+ [Bug 2905] DNS lookups broken.
+ - added limits to stack consumption, fixed some return code handling
+
+ libntp/work_thread.c@1.19 +55 -17
+ [Bug 2905] DNS lookups broken.
+ - added limits to stack consumption
+ - fixed some return code handling
+ - harden queue handling
+
+ ntpd/ntpd.c@1.166.1.1 +21 -4
+ [Bug 2905] DNS lookups broken.
+ - added limits to stack consumption of wartmup thread
+
ChangeSet@1.3615, 2015-12-05 10:41:51+00:00, stenn@psp-at1.ntp.org
CID 1341677: Nits in sntp/tests/keyFile.c. HStenn.
@@ -1113,7 +2027,7 @@ ChangeSet@1.3584.1.1, 2015-11-13 22:54:35+01:00, jnperlin@hydra.localnet
[Bug 2962] truncation of size_t/ptrdiff_t on 64bit targets
- avoid 'unused' warnings
- ntpd/ntp_proto.c@1.369 +8 -6
+ ntpd/ntp_proto.c@1.368.1.1 +8 -6
[Bug 2962] truncation of size_t/ptrdiff_t on 64bit targets
- promote use of 'size_t' for values that express a size
- format string fixes
@@ -1164,7 +2078,7 @@ ChangeSet@1.3584.1.1, 2015-11-13 22:54:35+01:00, jnperlin@hydra.localnet
- promote use of 'size_t' for values that express a size
- avoid truncation of SOCKET handles
- ntpdc/ntpdc.c@1.105 +36 -34
+ ntpdc/ntpdc.c@1.104.1.1 +36 -34
[Bug 2962] truncation of size_t/ptrdiff_t on 64bit targets
- promote use of 'size_t' for values that express a size
- format string fixes
@@ -1827,6 +2741,31 @@ ChangeSet@1.3574, 2015-10-20 08:00:43+00:00, stenn@psp-deb1.ntp.org
NEWS@1.149 +16 -16
Update CVEs
+ChangeSet@1.3558.8.1, 2015-10-17 23:19:57+02:00, jnperlin@hydra.localnet
+ [Bug 2945] Zero Origin Timestamp Bypass
+
+ ChangeLog@1.1743.8.1 +2 -0
+ [Bug 2945] Zero Origin Timestamp Bypass
+
+ ntpd/ntp_proto.c@1.364.2.1 +9 -1
+ [Bug 2945] Zero Origin Timestamp Bypass
+ - in basic mode 'aorg' is cleared to indicate a response has been received. So a reply has to be dropped
+ when it either does not match the origin timestamp OR the origin time stamp is zero.
+
+ChangeSet@1.3558.7.1, 2015-10-17 21:15:39+02:00, jnperlin@hydra.localnet
+ [Bug 2948] Potential Infinite Loop in ntpq and ntpdc
+
+ ChangeLog@1.1743.7.1 +2 -0
+ [Bug 2948] Potential Infinite Loop in ntpq and ntpdc
+
+ ntpdc/ntpdc.c@1.105 +20 -1
+ [Bug 2948] Potential Infinite Loop in ntpq and ntpdc
+ - check timeout between request and valid response(s) instead of *any* incoming data
+
+ ntpq/ntpq.c@1.161.2.1 +22 -2
+ [Bug 2948] Potential Infinite Loop in ntpq and ntpdc
+ - check timeout between request and valid response(s) instead of *any* incoming data
+
ChangeSet@1.3573, 2015-10-17 06:28:49+00:00, stenn@psp-deb1.ntp.org
ntp-4.2.8p4-sec-RC2
@@ -2172,6 +3111,53 @@ ChangeSet@1.3571, 2015-10-17 01:39:22+00:00, stenn@psp-deb1.ntp.org
ChangeLog@1.1755 +4 -1
[Sec 2941] NAK to the Future: Symmetric association authentication bypass via crypto-NAK
+ChangeSet@1.3558.6.2, 2015-10-13 23:31:28+02:00, jnperlin@hydra.localnet
+ [Bug 2938] ntpq saveconfig command allows dangerous characters in filenames.
+ - make sure the file does not exist (no overwrite allowed)
+ - ensure text mode where applicable (windows)
+
+ ntpd/ntp_control.c@1.203.1.2 +17 -3
+ [Bug 2938] ntpq saveconfig command allows dangerous characters in filenames.
+ - make sure the file does not exist (no overwrite allowed)
+ - ensure text mode where applicable (windows)
+
+ChangeSet@1.3558.6.1, 2015-10-12 08:18:56+02:00, jnperlin@hydra.localnet
+ [Bug 2938] ntpq saveconfig command allows dangerous characters in filenames
+
+ ChangeLog@1.1743.6.1 +3 -0
+ [Bug 2938] ntpq saveconfig command allows dangerous characters in filenames
+
+ ntpd/ntp_control.c@1.203.1.1 +161 -37
+ [Bug 2938] ntpq saveconfig command allows dangerous characters in filenames
+ - added function to check safe file names ([_A-Za-z0-9][-+._A-Za-z0-9]*)
+ - checked for truncation, too, not only overrun safey
+
+ChangeSet@1.3558.5.1, 2015-10-11 14:12:31+02:00, jnperlin@hydra.localnet
+ [Bug 2939] reslist NULL pointer dereference
+ [Bug 2940] Stack exhaustion in recursive traversal of restriction list
+ -- these two where fixed together --
+
+ ChangeLog@1.1743.5.1 +4 -0
+ [Bug 2939] reslist NULL pointer dereference
+ [Bug 2940] Stack exhaustion in recursive traversal of restriction list
+
+ ntpd/ntp_request.c@1.113.1.1 +127 -39
+ [Bug 2939] reslist NULL pointer dereference
+ [Bug 2940] Stack exhaustion in recursive traversal of restriction list
+ - use iteration and a scratch pad stack to do the list reversal; deep recusrsion can be dangerous in C
+ - properly terminate processing when 'more_pkt()' indicates packet full
+ - check the return value of 'more_pkt()' when used in iterations, or trash it explicitely
+ - fixed uint32_t vs. u_long clash that would cause security problems on big-endian 64bit machines
+
+ChangeSet@1.3558.4.1, 2015-10-11 09:32:40+02:00, jnperlin@hydra.localnet
+ [Bug 2937] (NTPQ) nextvar() missing length check
+
+ ChangeLog@1.1743.4.1 +2 -0
+ [Bug 2937] (NTPQ) nextvar() missing length check
+
+ ntpq/ntpq.c@1.161.1.1 +2 -0
+ [Bug 2937] (NTPQ) nextvar() missing length check
+
ChangeSet@1.3558.3.3, 2015-10-11 08:10:20+02:00, jnperlin@hydra.localnet
[Bug 2941] NAK to the Future: Symmetric association authentication bypass via crypto-NAK
diff --git a/contrib/ntp/NEWS b/contrib/ntp/NEWS
index 32c9288..278943c 100644
--- a/contrib/ntp/NEWS
+++ b/contrib/ntp/NEWS
@@ -1,5 +1,258 @@
---
+NTP 4.2.8p6
+
+Focus: Security, Bug fixes, enhancements.
+
+Severity: MEDIUM
+
+In addition to bug fixes and enhancements, this release fixes the
+following X low- and Y medium-severity vulnerabilities:
+
+* Potential Infinite Loop in 'ntpq'
+ Date Resolved: Stable (4.2.8p6) 19 Jan 2016; Dev (4.3.90) 19 Jan 2016
+ References: Sec 2548 / CVE-2015-8158
+ Affects: All ntp-4 releases up to, but not including 4.2.8p6, and
+ 4.3.0 up to, but not including 4.3.90
+ CVSS2: (AV:N/AC:M/Au:N/C:N/I:N/A:P) Base Score: 4.3 - MEDIUM
+ CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N Base Score: 5.3 - MEDIUM
+ Summary: 'ntpq' processes incoming packets in a loop in 'getresponse()'.
+ The loop's only stopping conditions are receiving a complete and
+ correct response or hitting a small number of error conditions.
+ If the packet contains incorrect values that don't trigger one of
+ the error conditions, the loop continues to receive new packets.
+ Note well, this is an attack against an instance of 'ntpq', not
+ 'ntpd', and this attack requires the attacker to do one of the
+ following:
+ * Own a malicious NTP server that the client trusts
+ * Prevent a legitimate NTP server from sending packets to
+ the 'ntpq' client
+ * MITM the 'ntpq' communications between the 'ntpq' client
+ and the NTP server
+ Mitigation:
+ Upgrade to 4.2.8p6, or later, from the NTP Project Download Page
+ or the NTP Public Services Project Download Page
+ Credit: This weakness was discovered by Jonathan Gardner of Cisco ASIG.
+
+* 0rigin: Zero Origin Timestamp Bypass
+ Date Resolved: Stable (4.2.8p6) 19 Jan 2016; Dev (4.3.90) 19 Jan 2016
+ References: Sec 2945 / CVE-2015-8138
+ Affects: All ntp-4 releases up to, but not including 4.2.8p6, and
+ 4.3.0 up to, but not including 4.3.90
+ CVSS2: (AV:N/AC:L/Au:N/C:N/I:P/A:N) Base Score: 5.0 - MEDIUM
+ CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N Base Score: 5.3 - MEDIUM
+ (3.7 - LOW if you score AC:L)
+ Summary: To distinguish legitimate peer responses from forgeries, a
+ client attempts to verify a response packet by ensuring that the
+ origin timestamp in the packet matches the origin timestamp it
+ transmitted in its last request. A logic error exists that
+ allows packets with an origin timestamp of zero to bypass this
+ check whenever there is not an outstanding request to the server.
+ Mitigation:
+ Configure 'ntpd' to get time from multiple sources.
+ Upgrade to 4.2.8p6, or later, from the NTP Project Download Page
+ or the NTP Public Services Project Download Page.
+ Monitor your 'ntpd= instances.
+ Credit: This weakness was discovered by Jonathan Gardner of Cisco ASIG.
+
+* Stack exhaustion in recursive traversal of restriction list
+ Date Resolved: Stable (4.2.8p6) 19 Jan 2016
+ References: Sec 2940 / CVE-2015-7978
+ Affects: All ntp-4 releases up to, but not including 4.2.8p6, and
+ 4.3.0 up to, but not including 4.3.90
+ CVSS: (AV:N/AC:M/Au:N/C:N/I:N/A:P) Base Score: 4.3 - MEDIUM
+ Summary: An unauthenticated 'ntpdc reslist' command can cause a
+ segmentation fault in ntpd by exhausting the call stack.
+ Mitigation:
+ Implement BCP-38.
+ Upgrade to 4.2.8p6, or later, from the NTP Project Download Page
+ or the NTP Public Services Project Download Page.
+ If you are unable to upgrade:
+ In ntp-4.2.8, mode 7 is disabled by default. Don't enable it.
+ If you must enable mode 7:
+ configure the use of a 'requestkey' to control who can
+ issue mode 7 requests.
+ configure 'restrict noquery' to further limit mode 7
+ requests to trusted sources.
+ Monitor your ntpd instances.
+ Credit: This weakness was discovered by Stephen Gray at Cisco ASIG.
+
+* Off-path Denial of Service (!DoS) attack on authenticated broadcast mode
+ Date Resolved: Stable (4.2.8p6) 19 Jan 2016; Dev (4.3.90) 19 Jan 2016
+ References: Sec 2942 / CVE-2015-7979
+ Affects: All ntp-4 releases up to, but not including 4.2.8p6, and
+ 4.3.0 up to, but not including 4.3.90
+ CVSS: (AV:N/AC:M/Au:N/C:N/I:P/A:P) Base Score: 5.8
+ Summary: An off-path attacker can send broadcast packets with bad
+ authentication (wrong key, mismatched key, incorrect MAC, etc)
+ to broadcast clients. It is observed that the broadcast client
+ tears down the association with the broadcast server upon
+ receiving just one bad packet.
+ Mitigation:
+ Implement BCP-38.
+ Upgrade to 4.2.8p6, or later, from the NTP Project Download Page
+ or the NTP Public Services Project Download Page.
+ Monitor your 'ntpd' instances.
+ If this sort of attack is an active problem for you, you have
+ deeper problems to investigate. In this case also consider
+ having smaller NTP broadcast domains.
+ Credit: This weakness was discovered by Aanchal Malhotra of Boston
+ University.
+
+* reslist NULL pointer dereference
+ Date Resolved: Stable (4.2.8p6) 19 Jan 2016; Dev (4.3.90) 19 Jan 2016
+ References: Sec 2939 / CVE-2015-7977
+ Affects: All ntp-4 releases up to, but not including 4.2.8p6, and
+ 4.3.0 up to, but not including 4.3.90
+ CVSS: (AV:N/AC:M/Au:N/C:N/I:N/A:P) Base Score: 4.3 - MEDIUM
+ Summary: An unauthenticated 'ntpdc reslist' command can cause a
+ segmentation fault in ntpd by causing a NULL pointer dereference.
+ Mitigation:
+ Implement BCP-38.
+ Upgrade to 4.2.8p6, or later, from NTP Project Download Page or
+ the NTP Public Services Project Download Page.
+ If you are unable to upgrade:
+ mode 7 is disabled by default. Don't enable it.
+ If you must enable mode 7:
+ configure the use of a 'requestkey' to control who can
+ issue mode 7 requests.
+ configure 'restrict noquery' to further limit mode 7
+ requests to trusted sources.
+ Monitor your ntpd instances.
+ Credit: This weakness was discovered by Stephen Gray of Cisco ASIG.
+
+* 'ntpq saveconfig' command allows dangerous characters in filenames.
+ Date Resolved: Stable (4.2.8p6) 19 Jan 2016; Dev (4.3.90) 19 Jan 2016
+ References: Sec 2938 / CVE-2015-7976
+ Affects: All ntp-4 releases up to, but not including 4.2.8p6, and
+ 4.3.0 up to, but not including 4.3.90
+ CVSS: (AV:N/AC:L/Au:S/C:N/I:P/A:N) Base Score: 4.0 - MEDIUM
+ Summary: The ntpq saveconfig command does not do adequate filtering
+ of special characters from the supplied filename.
+ Note well: The ability to use the saveconfig command is controlled
+ by the 'restrict nomodify' directive, and the recommended default
+ configuration is to disable this capability. If the ability to
+ execute a 'saveconfig' is required, it can easily (and should) be
+ limited and restricted to a known small number of IP addresses.
+ Mitigation:
+ Implement BCP-38.
+ use 'restrict default nomodify' in your 'ntp.conf' file.
+ Upgrade to 4.2.8p6, or later, from the NTP Project Download Page.
+ If you are unable to upgrade:
+ build NTP with 'configure --disable-saveconfig' if you will
+ never need this capability, or
+ use 'restrict default nomodify' in your 'ntp.conf' file. Be
+ careful about what IPs have the ability to send 'modify'
+ requests to 'ntpd'.
+ Monitor your ntpd instances.
+ 'saveconfig' requests are logged to syslog - monitor your syslog files.
+ Credit: This weakness was discovered by Jonathan Gardner of Cisco ASIG.
+
+* nextvar() missing length check in ntpq
+ Date Resolved: Stable (4.2.8p6) 19 Jan 2016; Dev (4.3.90) 19 Jan 2016
+ References: Sec 2937 / CVE-2015-7975
+ Affects: All ntp-4 releases up to, but not including 4.2.8p6, and
+ 4.3.0 up to, but not including 4.3.90
+ CVSS: (AV:L/AC:H/Au:N/C:N/I:N/A:P) Base Score: 1.2 - LOW
+ If you score A:C, this becomes 4.0.
+ CVSSv3: (CVSS:3.0/AV:L/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L) Base Score 2.9, LOW
+ Summary: ntpq may call nextvar() which executes a memcpy() into the
+ name buffer without a proper length check against its maximum
+ length of 256 bytes. Note well that we're taking about ntpq here.
+ The usual worst-case effect of this vulnerability is that the
+ specific instance of ntpq will crash and the person or process
+ that did this will have stopped themselves.
+ Mitigation:
+ Upgrade to 4.2.8p6, or later, from the NTP Project Download Page
+ or the NTP Public Services Project Download Page.
+ If you are unable to upgrade:
+ If you have scripts that feed input to ntpq make sure there are
+ some sanity checks on the input received from the "outside".
+ This is potentially more dangerous if ntpq is run as root.
+ Credit: This weakness was discovered by Jonathan Gardner at Cisco ASIG.
+
+* Skeleton Key: Any trusted key system can serve time
+ Date Resolved: Stable (4.2.8p6) 19 Jan 2016; Dev (4.3.90) 19 Jan 2016
+ References: Sec 2936 / CVE-2015-7974
+ Affects: All ntp-4 releases up to, but not including 4.2.8p6, and
+ 4.3.0 up to, but not including 4.3.90
+ CVSS: (AV:N/AC:H/Au:S/C:N/I:C/A:N) Base Score: 4.9
+ Summary: Symmetric key encryption uses a shared trusted key. The
+ reported title for this issue was "Missing key check allows
+ impersonation between authenticated peers" and the report claimed
+ "A key specified only for one server should only work to
+ authenticate that server, other trusted keys should be refused."
+ Except there has never been any correlation between this trusted
+ key and server v. clients machines and there has never been any
+ way to specify a key only for one server. We have treated this as
+ an enhancement request, and ntp-4.2.8p6 includes other checks and
+ tests to strengthen clients against attacks coming from broadcast
+ servers.
+ Mitigation:
+ Implement BCP-38.
+ If this scenario represents a real or a potential issue for you,
+ upgrade to 4.2.8p6, or later, from the NTP Project Download
+ Page or the NTP Public Services Project Download Page, and
+ use the new field in the ntp.keys file that specifies the list
+ of IPs that are allowed to serve time. Note that this alone
+ will not protect against time packets with forged source IP
+ addresses, however other changes in ntp-4.2.8p6 provide
+ significant mitigation against broadcast attacks. MITM attacks
+ are a different story.
+ If you are unable to upgrade:
+ Don't use broadcast mode if you cannot monitor your client
+ servers.
+ If you choose to use symmetric keys to authenticate time
+ packets in a hostile environment where ephemeral time
+ servers can be created, or if it is expected that malicious
+ time servers will participate in an NTP broadcast domain,
+ limit the number of participating systems that participate
+ in the shared-key group.
+ Monitor your ntpd instances.
+ Credit: This weakness was discovered by Matt Street of Cisco ASIG.
+
+* Deja Vu: Replay attack on authenticated broadcast mode
+ Date Resolved: Stable (4.2.8p6) 19 Jan 2016; Dev (4.3.90) 19 Jan 2016
+ References: Sec 2935 / CVE-2015-7973
+ Affects: All ntp-4 releases up to, but not including 4.2.8p6, and
+ 4.3.0 up to, but not including 4.3.90
+ CVSS: (AV:A/AC:M/Au:N/C:N/I:P/A:P) Base Score: 4.3 - MEDIUM
+ Summary: If an NTP network is configured for broadcast operations then
+ either a man-in-the-middle attacker or a malicious participant
+ that has the same trusted keys as the victim can replay time packets.
+ Mitigation:
+ Implement BCP-38.
+ Upgrade to 4.2.8p6, or later, from the NTP Project Download Page
+ or the NTP Public Services Project Download Page.
+ If you are unable to upgrade:
+ Don't use broadcast mode if you cannot monitor your client servers.
+ Monitor your ntpd instances.
+ Credit: This weakness was discovered by Aanchal Malhotra of Boston
+ University.
+
+Other fixes:
+
+* [Bug 2772] adj_systime overflows tv_usec. perlinger@ntp.org
+* [Bug 2814] msyslog deadlock when signaled. perlinger@ntp.org
+ - applied patch by shenpeng11@huawei.com with minor adjustments
+* [Bug 2882] Look at ntp_request.c:list_peers_sum(). perlinger@ntp.org
+* [Bug 2891] Deadlock in deferred DNS lookup framework. perlinger@ntp.org
+* [Bug 2892] Several test cases assume IPv6 capabilities even when
+ IPv6 is disabled in the build. perlinger@ntp.org
+ - Found this already fixed, but validation led to cleanup actions.
+* [Bug 2905] DNS lookups broken. perlinger@ntp.org
+ - added limits to stack consumption, fixed some return code handling
+* [Bug 2971] ntpq bails on ^C: select fails: Interrupted system call
+ - changed stacked/nested handling of CTRL-C. perlinger@ntp.org
+ - make CTRL-C work for retrieval and printing od MRU list. perlinger@ntp.org
+* [Bug 2980] reduce number of warnings. perlinger@ntp.org
+ - integrated several patches from Havard Eidnes (he@uninett.no)
+* [Bug 2985] bogus calculation in authkeys.c perlinger@ntp.org
+ - implement 'auth_log2()' using integer bithack instead of float calculation
+* Make leapsec_query debug messages less verbose. Harlan Stenn.
+
+---
+
NTP 4.2.8p5
Focus: Security, Bug fixes, enhancements.
diff --git a/contrib/ntp/configure b/contrib/ntp/configure
index 758ffa9..75724cc 100755
--- a/contrib/ntp/configure
+++ b/contrib/ntp/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for ntp 4.2.8p5.
+# Generated by GNU Autoconf 2.69 for ntp 4.2.8p6.
#
# Report bugs to <http://bugs.ntp.org./>.
#
@@ -590,8 +590,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='ntp'
PACKAGE_TARNAME='ntp'
-PACKAGE_VERSION='4.2.8p5'
-PACKAGE_STRING='ntp 4.2.8p5'
+PACKAGE_VERSION='4.2.8p6'
+PACKAGE_STRING='ntp 4.2.8p6'
PACKAGE_BUGREPORT='http://bugs.ntp.org./'
PACKAGE_URL='http://www.ntp.org./'
@@ -1616,7 +1616,7 @@ if test "$ac_init_help" = "long"; then
# 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 ntp 4.2.8p5 to adapt to many kinds of systems.
+\`configure' configures ntp 4.2.8p6 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1686,7 +1686,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of ntp 4.2.8p5:";;
+ short | recursive ) echo "Configuration of ntp 4.2.8p6:";;
esac
cat <<\_ACEOF
@@ -1919,7 +1919,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-ntp configure 4.2.8p5
+ntp configure 4.2.8p6
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2749,7 +2749,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by ntp $as_me 4.2.8p5, which was
+It was created by ntp $as_me 4.2.8p6, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -3750,7 +3750,7 @@ fi
# Define the identity of the package.
PACKAGE='ntp'
- VERSION='4.2.8p5'
+ VERSION='4.2.8p6'
cat >>confdefs.h <<_ACEOF
@@ -37840,7 +37840,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by ntp $as_me 4.2.8p5, which was
+This file was extended by ntp $as_me 4.2.8p6, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -37907,7 +37907,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-ntp config.status 4.2.8p5
+ntp config.status 4.2.8p6
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
diff --git a/contrib/ntp/html/miscopt.html b/contrib/ntp/html/miscopt.html
index 261b08f..bc520f6 100644
--- a/contrib/ntp/html/miscopt.html
+++ b/contrib/ntp/html/miscopt.html
@@ -11,7 +11,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 -->17-Nov-2015 11:06<!-- #EndDate -->
+ <!-- #BeginDate format:En2m -->16-Jan-2016 13:08<!-- #EndDate -->
UTC</p>
<br clear="left">
<h4>Related Links</h4>
@@ -29,8 +29,9 @@
<dd>The file format consists of a single line containing a single floating point number, which records the frequency offset measured in parts-per-million (PPM). The file is updated by first writing the current drift value into a temporary file and then renaming this file to replace the old version.</dd>
<dt id="dscp"><tt>dscp <i>dscp</i></tt></dt>
<dd>This command specifies the Differentiated Services Code Point (DSCP) value that is used in sent NTP packets. The default value is 46 for Expedited Forwarding (EF).</dd>
- <dt id="enable"><tt>enable [auth | bclient | calibrate | kernel | mode7 | monitor | ntp | stats]</tt><br>
- <tt>disable [auth | bclient | calibrate | kernel | mode7 | monitor | ntp | stats]</tt></dt>
+ <dt id="enable"><tt>enable [auth | bclient | calibrate | kernel | mode7 | monitor | ntp | stats | unpeer_crypto_early | unpeer_crypto_nak_early | unpeer_digest_early]</tt></dt>
+
+ <dt><tt>disable [auth | bclient | calibrate | kernel | mode7 | monitor | ntp | stats | unpeer_crypto_early | unpeer_crypto_nak_early | unpeer_digest_early]</tt></dt>
<dd>Provides a way to enable or disable various system options. Flags not mentioned are unaffected. Note that most of these flags can be modified remotely using <a href="ntpq.html"><tt>ntpq</tt></a> utility program's <tt>:config</tt> and <tt>config-from-file</tt> commands.
<dl>
<dt><tt>auth</tt></dt>
@@ -50,6 +51,13 @@
<dd>Enables time and frequency discipline. In effect, this switch opens and closes the feedback loop, which is useful for testing. The default for this flag is enable.</dd>
<dt><tt>stats</tt></dt>
<dd>Enables the statistics facility. See the <a href="monopt.html">Monitoring Options</a> page for further information. The default for this flag is enabled. This flag is excluded from runtime configuration using <tt>ntpq</tt>.</dd>
+| unpeer_crypto_early | unpeer_crypto_nak_early | unpeer_digest_early
+ <dt><tt>unpeer_crypto_early</tt></dt>
+ <dd>Enables the early resetting of an association in case of a crypto failure. This is generally a feature, but it can be used in a DoS attack. If you are seeing these packets being used as a DoS attack against your server, you should disable this flag. The default for this flag is enabled. This flag is excluded from runtime configuration using <tt>ntpq</tt>.</dd>
+ <dt><tt>unpeer_crypto_nak_early</tt></dt>
+ <dd>Enables the early resetting of an association in case of a crypto_NAK message. This is generally a feature, but it can be used in a DoS attack. If you are seeing these packets being used as a DoS attack against your server, you should disable this flag. The default for this flag is enabled. This flag is excluded from runtime configuration using <tt>ntpq</tt>.</dd>
+ <dt><tt>unpeer_digest_early</tt></dt>
+ <dd>Enables the early resetting of an association in case of an autokey digest failur. This is generally a feature, but it can be used in a DoS attack. If you are seeing these packets being used as a DoS attack against your server, you should disable this flag. The default for this flag is enabled. This flag is excluded from runtime configuration using <tt>ntpq</tt>.</dd>
</dl>
</dd>
<dt id="includefile"><tt>includefile <i>includefile</i></tt></dt>
diff --git a/contrib/ntp/include/Makefile.am b/contrib/ntp/include/Makefile.am
index d8b4dd2..521ac14 100644
--- a/contrib/ntp/include/Makefile.am
+++ b/contrib/ntp/include/Makefile.am
@@ -36,6 +36,7 @@ noinst_HEADERS = \
ntp_if.h \
ntp_intres.h \
ntp_io.h \
+ ntp_keyacc.h \
ntp_libopts.h \
ntp_lineedit.h \
ntp_lists.h \
diff --git a/contrib/ntp/include/Makefile.in b/contrib/ntp/include/Makefile.in
index 6e45e93..ef92804 100644
--- a/contrib/ntp/include/Makefile.in
+++ b/contrib/ntp/include/Makefile.in
@@ -521,6 +521,7 @@ noinst_HEADERS = \
ntp_if.h \
ntp_intres.h \
ntp_io.h \
+ ntp_keyacc.h \
ntp_libopts.h \
ntp_lineedit.h \
ntp_lists.h \
diff --git a/contrib/ntp/include/ntp.h b/contrib/ntp/include/ntp.h
index 4ffc35f..6a4e9aa 100644
--- a/contrib/ntp/include/ntp.h
+++ b/contrib/ntp/include/ntp.h
@@ -350,6 +350,7 @@ struct peer {
l_fp dst; /* destination timestamp */
l_fp aorg; /* origin timestamp */
l_fp borg; /* alternate origin timestamp */
+ l_fp bxmt; /* most recent broadcast transmit timestamp */
double offset; /* peer clock offset */
double delay; /* peer roundtrip delay */
double jitter; /* peer jitter (squares) */
@@ -382,7 +383,8 @@ struct peer {
* Statistic counters
*/
u_long timereset; /* time stat counters were reset */
- u_long timereceived; /* last packet received time */
+ u_long timelastrec; /* last packet received time */
+ u_long timereceived; /* last (clean) packet received time */
u_long timereachable; /* last reachable/unreachable time */
u_long sent; /* packets sent */
@@ -708,6 +710,9 @@ struct pkt {
#define PROTO_ORPHAN 26
#define PROTO_ORPHWAIT 27
#define PROTO_MODE7 28
+#define PROTO_UECRYPTO 29
+#define PROTO_UECRYPTONAK 30
+#define PROTO_UEDIGEST 31
/*
* Configuration items for the loop filter
diff --git a/contrib/ntp/include/ntp_io.h b/contrib/ntp/include/ntp_io.h
index 5950f00..d34d60a 100644
--- a/contrib/ntp/include/ntp_io.h
+++ b/contrib/ntp/include/ntp_io.h
@@ -40,6 +40,8 @@
#include "libntp.h" /* This needs Something above for GETDTABLESIZE */
+#include "ntp_keyacc.h"
+
/*
* Define FNDELAY and FASYNC using O_NONBLOCK and O_ASYNC if we need
* to (and can). This is here initially for QNX, but may help for
@@ -83,7 +85,6 @@ typedef enum {
extern int qos;
SOCKET move_fd(SOCKET fd);
isc_boolean_t get_broadcastclient_flag(void);
-extern int is_ip_address(const char *, u_short, sockaddr_u *);
extern void sau_from_netaddr(sockaddr_u *, const isc_netaddr_t *);
extern void add_nic_rule(nic_rule_match match_type,
const char *if_name, int prefixlen,
diff --git a/contrib/ntp/include/ntp_keyacc.h b/contrib/ntp/include/ntp_keyacc.h
new file mode 100644
index 0000000..730c310
--- /dev/null
+++ b/contrib/ntp/include/ntp_keyacc.h
@@ -0,0 +1,13 @@
+/*
+ * ntp_keyacc.h - key access stuff
+ */
+#ifndef NTP_KEYACC_H
+#define NTP_KEYACC_H
+
+typedef struct keyaccess KeyAccT;
+struct keyaccess {
+ KeyAccT * next;
+ sockaddr_u addr;
+};
+
+#endif /* NTP_KEYACC_H */
diff --git a/contrib/ntp/include/ntp_stdlib.h b/contrib/ntp/include/ntp_stdlib.h
index d735b41..98ac69e 100644
--- a/contrib/ntp/include/ntp_stdlib.h
+++ b/contrib/ntp/include/ntp_stdlib.h
@@ -16,6 +16,7 @@
#include "ntp_malloc.h"
#include "ntp_string.h"
#include "ntp_syslog.h"
+#include "ntp_keyacc.h"
#ifdef __GNUC__
#define NTP_PRINTF(fmt, args) __attribute__((__format__(__printf__, fmt, args)))
@@ -69,6 +70,7 @@ extern int authdecrypt (keyid_t, u_int32 *, size_t, size_t);
extern size_t authencrypt (keyid_t, u_int32 *, size_t);
extern int authhavekey (keyid_t);
extern int authistrusted (keyid_t);
+extern int authistrustedip (keyid_t, sockaddr_u *);
extern int authreadkeys (const char *);
extern void authtrust (keyid_t, u_long);
extern int authusekey (keyid_t, int, const u_char *);
@@ -97,7 +99,7 @@ extern int ymd2yd (int, int, int);
/* a_md5encrypt.c */
extern int MD5authdecrypt (int, const u_char *, u_int32 *, size_t, size_t);
extern size_t MD5authencrypt (int, const u_char *, u_int32 *, size_t);
-extern void MD5auth_setkey (keyid_t, int, const u_char *, size_t);
+extern void MD5auth_setkey (keyid_t, int, const u_char *, size_t, KeyAccT *c);
extern u_int32 addr2refid (sockaddr_u *);
/* emalloc.c */
@@ -141,6 +143,7 @@ extern int atouint (const char *, u_long *);
extern int hextoint (const char *, u_long *);
extern const char * humanlogtime (void);
extern const char * humantime (time_t);
+extern int is_ip_address (const char *, u_short, sockaddr_u *);
extern char * mfptoa (u_int32, u_int32, short);
extern char * mfptoms (u_int32, u_int32, short);
extern const char * modetoa (size_t);
diff --git a/contrib/ntp/include/ntp_types.h b/contrib/ntp/include/ntp_types.h
index a947f30..7ff3125 100644
--- a/contrib/ntp/include/ntp_types.h
+++ b/contrib/ntp/include/ntp_types.h
@@ -218,6 +218,7 @@ typedef uint16_t associd_t; /* association ID */
#define ASSOCID_MAX USHRT_MAX
typedef u_int32 keyid_t; /* cryptographic key ID */
#define KEYID_T_MAX (0xffffffff)
+
typedef u_int32 tstamp_t; /* NTP seconds timestamp */
/*
diff --git a/contrib/ntp/include/ntp_worker.h b/contrib/ntp/include/ntp_worker.h
index 50616b3..7720b8c 100644
--- a/contrib/ntp/include/ntp_worker.h
+++ b/contrib/ntp/include/ntp_worker.h
@@ -60,33 +60,35 @@ typedef sema_type *sem_ref;
#if defined(WORK_FORK)
typedef struct blocking_child_tag {
- int reusable;
- int pid;
- int req_write_pipe; /* parent */
- int resp_read_pipe;
- void * resp_read_ctx;
- int req_read_pipe; /* child */
- int resp_write_pipe;
- int ispipe;
+ int reusable;
+ int pid;
+ int req_write_pipe; /* parent */
+ int resp_read_pipe;
+ void * resp_read_ctx;
+ int req_read_pipe; /* child */
+ int resp_write_pipe;
+ int ispipe;
+ volatile u_int resp_ready_seen; /* signal/scan */
+ volatile u_int resp_ready_done; /* consumer/mainloop */
} blocking_child;
#elif defined(WORK_THREAD)
typedef struct blocking_child_tag {
-/*
- * blocking workitems and blocking_responses are dynamically-sized
- * one-dimensional arrays of pointers to blocking worker requests and
- * responses.
- *
- * IMPORTANT: This structure is shared between threads, and all access
- * that is not atomic (especially queue operations) must hold the
- * 'accesslock' semaphore to avoid data races.
- *
- * The resource management (thread/semaphore creation/destruction)
- * functions and functions just testing a handle are safe because these
- * are only changed by the main thread when no worker is running on the
- * same data structure.
- */
+ /*
+ * blocking workitems and blocking_responses are
+ * dynamically-sized one-dimensional arrays of pointers to
+ * blocking worker requests and responses.
+ *
+ * IMPORTANT: This structure is shared between threads, and all
+ * access that is not atomic (especially queue operations) must
+ * hold the 'accesslock' semaphore to avoid data races.
+ *
+ * The resource management (thread/semaphore
+ * creation/destruction) functions and functions just testing a
+ * handle are safe because these are only changed by the main
+ * thread when no worker is running on the same data structure.
+ */
int reusable;
sem_ref accesslock; /* shared access lock */
thr_ref thread_ref; /* thread 'handle' */
@@ -117,6 +119,8 @@ typedef struct blocking_child_tag {
int resp_write_pipe; /* child */
int ispipe;
void * resp_read_ctx; /* child */
+ volatile u_int resp_ready_seen; /* signal/scan */
+ volatile u_int resp_ready_done; /* consumer/mainloop */
#else
sem_ref responses_pending; /* signalling */
#endif
@@ -126,6 +130,10 @@ typedef struct blocking_child_tag {
#endif /* WORK_THREAD */
+/* we need some global tag to indicate any blocking child may be ready: */
+extern volatile u_int blocking_child_ready_seen;/* signal/scan */
+extern volatile u_int blocking_child_ready_done;/* consumer/mainloop */
+
extern blocking_child ** blocking_children;
extern size_t blocking_children_alloc;
extern int worker_per_query; /* boolean */
@@ -139,6 +147,7 @@ extern int queue_blocking_response(blocking_child *,
blocking_pipe_header *, size_t,
const blocking_pipe_header *);
extern void process_blocking_resp(blocking_child *);
+extern void harvest_blocking_responses(void);
extern int send_blocking_req_internal(blocking_child *,
blocking_pipe_header *,
void *);
diff --git a/contrib/ntp/include/parse.h b/contrib/ntp/include/parse.h
index 9b1ffb2..02dbb30 100644
--- a/contrib/ntp/include/parse.h
+++ b/contrib/ntp/include/parse.h
@@ -107,9 +107,9 @@ extern unsigned int splclock (void);
/*
* 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 */
+#define GPSORIGIN 2524953600UL /* NTP origin - GPS origin in seconds */
+#define GPSWRAP 990 /* assume week count less than this in the previous epoch */
+#define GPSWEEKS 1024 /* number of weeks until the GPS epch rolls over */
/*
* state flags
diff --git a/contrib/ntp/libntp/Makefile.am b/contrib/ntp/libntp/Makefile.am
index 914badb..a3b50e1 100644
--- a/contrib/ntp/libntp/Makefile.am
+++ b/contrib/ntp/libntp/Makefile.am
@@ -70,6 +70,7 @@ libntp_a_SRCS = \
humandate.c \
icom.c \
iosignal.c \
+ is_ip_address.c \
lib_strbuf.c \
machines.c \
mktime.c \
diff --git a/contrib/ntp/libntp/Makefile.in b/contrib/ntp/libntp/Makefile.in
index 6e40cd4..5cf5703 100644
--- a/contrib/ntp/libntp/Makefile.in
+++ b/contrib/ntp/libntp/Makefile.in
@@ -150,12 +150,12 @@ am__libntp_a_SOURCES_DIST = systime.c a_md5encrypt.c adjtime.c \
calyearstart.c clocktime.c clocktypes.c decodenetnum.c \
dofptoa.c dolfptoa.c emalloc.c findconfig.c getopt.c \
hextoint.c hextolfp.c humandate.c icom.c iosignal.c \
- lib_strbuf.c machines.c mktime.c modetoa.c mstolfp.c msyslog.c \
- netof.c ntp_calendar.c ntp_crypto_rnd.c ntp_intres.c \
- ntp_libopts.c ntp_lineedit.c ntp_random.c ntp_rfc2553.c \
- ntp_worker.c numtoa.c numtohost.c octtoint.c prettydate.c \
- refidsmear.c recvbuff.c refnumtoa.c snprintf.c socket.c \
- socktoa.c socktohost.c ssl_init.c statestr.c strdup.c \
+ is_ip_address.c lib_strbuf.c machines.c mktime.c modetoa.c \
+ mstolfp.c msyslog.c netof.c ntp_calendar.c ntp_crypto_rnd.c \
+ ntp_intres.c ntp_libopts.c ntp_lineedit.c ntp_random.c \
+ ntp_rfc2553.c ntp_worker.c numtoa.c numtohost.c octtoint.c \
+ prettydate.c refidsmear.c recvbuff.c refnumtoa.c snprintf.c \
+ socket.c socktoa.c socktohost.c ssl_init.c statestr.c strdup.c \
strl_obsd.c syssignal.c timetoa.c timevalops.c uglydate.c \
vint64ops.c work_fork.c work_thread.c ymd2yd.c \
$(srcdir)/../lib/isc/assertions.c \
@@ -207,21 +207,21 @@ am__objects_4 = a_md5encrypt.$(OBJEXT) adjtime.$(OBJEXT) \
dolfptoa.$(OBJEXT) emalloc.$(OBJEXT) findconfig.$(OBJEXT) \
getopt.$(OBJEXT) hextoint.$(OBJEXT) hextolfp.$(OBJEXT) \
humandate.$(OBJEXT) icom.$(OBJEXT) iosignal.$(OBJEXT) \
- lib_strbuf.$(OBJEXT) machines.$(OBJEXT) mktime.$(OBJEXT) \
- modetoa.$(OBJEXT) mstolfp.$(OBJEXT) msyslog.$(OBJEXT) \
- netof.$(OBJEXT) ntp_calendar.$(OBJEXT) \
- ntp_crypto_rnd.$(OBJEXT) ntp_intres.$(OBJEXT) \
- ntp_libopts.$(OBJEXT) ntp_lineedit.$(OBJEXT) \
- ntp_random.$(OBJEXT) ntp_rfc2553.$(OBJEXT) \
- ntp_worker.$(OBJEXT) numtoa.$(OBJEXT) numtohost.$(OBJEXT) \
- octtoint.$(OBJEXT) prettydate.$(OBJEXT) refidsmear.$(OBJEXT) \
- recvbuff.$(OBJEXT) refnumtoa.$(OBJEXT) snprintf.$(OBJEXT) \
- socket.$(OBJEXT) socktoa.$(OBJEXT) socktohost.$(OBJEXT) \
- ssl_init.$(OBJEXT) statestr.$(OBJEXT) strdup.$(OBJEXT) \
- strl_obsd.$(OBJEXT) syssignal.$(OBJEXT) timetoa.$(OBJEXT) \
- timevalops.$(OBJEXT) uglydate.$(OBJEXT) vint64ops.$(OBJEXT) \
- work_fork.$(OBJEXT) work_thread.$(OBJEXT) ymd2yd.$(OBJEXT) \
- $(am__objects_3) $(am__objects_1)
+ is_ip_address.$(OBJEXT) lib_strbuf.$(OBJEXT) \
+ machines.$(OBJEXT) mktime.$(OBJEXT) modetoa.$(OBJEXT) \
+ mstolfp.$(OBJEXT) msyslog.$(OBJEXT) netof.$(OBJEXT) \
+ ntp_calendar.$(OBJEXT) ntp_crypto_rnd.$(OBJEXT) \
+ ntp_intres.$(OBJEXT) ntp_libopts.$(OBJEXT) \
+ ntp_lineedit.$(OBJEXT) ntp_random.$(OBJEXT) \
+ ntp_rfc2553.$(OBJEXT) ntp_worker.$(OBJEXT) numtoa.$(OBJEXT) \
+ numtohost.$(OBJEXT) octtoint.$(OBJEXT) prettydate.$(OBJEXT) \
+ refidsmear.$(OBJEXT) recvbuff.$(OBJEXT) refnumtoa.$(OBJEXT) \
+ snprintf.$(OBJEXT) socket.$(OBJEXT) socktoa.$(OBJEXT) \
+ socktohost.$(OBJEXT) ssl_init.$(OBJEXT) statestr.$(OBJEXT) \
+ strdup.$(OBJEXT) strl_obsd.$(OBJEXT) syssignal.$(OBJEXT) \
+ timetoa.$(OBJEXT) timevalops.$(OBJEXT) uglydate.$(OBJEXT) \
+ vint64ops.$(OBJEXT) work_fork.$(OBJEXT) work_thread.$(OBJEXT) \
+ ymd2yd.$(OBJEXT) $(am__objects_3) $(am__objects_1)
am_libntp_a_OBJECTS = systime.$(OBJEXT) $(am__objects_4)
libntp_a_OBJECTS = $(am_libntp_a_OBJECTS)
libntpsim_a_AR = $(AR) $(ARFLAGS)
@@ -232,12 +232,12 @@ am__libntpsim_a_SOURCES_DIST = systime_s.c a_md5encrypt.c adjtime.c \
calyearstart.c clocktime.c clocktypes.c decodenetnum.c \
dofptoa.c dolfptoa.c emalloc.c findconfig.c getopt.c \
hextoint.c hextolfp.c humandate.c icom.c iosignal.c \
- lib_strbuf.c machines.c mktime.c modetoa.c mstolfp.c msyslog.c \
- netof.c ntp_calendar.c ntp_crypto_rnd.c ntp_intres.c \
- ntp_libopts.c ntp_lineedit.c ntp_random.c ntp_rfc2553.c \
- ntp_worker.c numtoa.c numtohost.c octtoint.c prettydate.c \
- refidsmear.c recvbuff.c refnumtoa.c snprintf.c socket.c \
- socktoa.c socktohost.c ssl_init.c statestr.c strdup.c \
+ is_ip_address.c lib_strbuf.c machines.c mktime.c modetoa.c \
+ mstolfp.c msyslog.c netof.c ntp_calendar.c ntp_crypto_rnd.c \
+ ntp_intres.c ntp_libopts.c ntp_lineedit.c ntp_random.c \
+ ntp_rfc2553.c ntp_worker.c numtoa.c numtohost.c octtoint.c \
+ prettydate.c refidsmear.c recvbuff.c refnumtoa.c snprintf.c \
+ socket.c socktoa.c socktohost.c ssl_init.c statestr.c strdup.c \
strl_obsd.c syssignal.c timetoa.c timevalops.c uglydate.c \
vint64ops.c work_fork.c work_thread.c ymd2yd.c \
$(srcdir)/../lib/isc/assertions.c \
@@ -660,6 +660,7 @@ libntp_a_SRCS = \
humandate.c \
icom.c \
iosignal.c \
+ is_ip_address.c \
lib_strbuf.c \
machines.c \
mktime.c \
@@ -806,6 +807,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inet_pton.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/interfaceiter.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iosignal.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/is_ip_address.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lib.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lib_strbuf.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/log.Po@am__quote@
diff --git a/contrib/ntp/libntp/authkeys.c b/contrib/ntp/libntp/authkeys.c
index f7462a2..36fdd8b 100644
--- a/contrib/ntp/libntp/authkeys.c
+++ b/contrib/ntp/libntp/authkeys.c
@@ -15,6 +15,7 @@
#include "ntp_string.h"
#include "ntp_malloc.h"
#include "ntp_stdlib.h"
+#include "ntp_keyacc.h"
/*
* Structure to store keys in in the hash table.
@@ -25,6 +26,7 @@ struct savekey {
symkey * hlink; /* next in hash bucket */
DECL_DLIST_LINK(symkey, llink); /* for overall & free lists */
u_char * secret; /* shared secret */
+ KeyAccT * keyacclist; /* Private key access list */
u_long lifetime; /* remaining lifetime */
keyid_t keyid; /* key identifier */
u_short type; /* OpenSSL digest NID */
@@ -48,13 +50,13 @@ struct symkey_alloc_tag {
symkey_alloc * authallocs;
#endif /* DEBUG */
-static inline u_short auth_log2(double x);
-static void auth_resize_hashtable(void);
-static void allocsymkey(symkey **, keyid_t, u_short,
- u_short, u_long, u_short, u_char *);
-static void freesymkey(symkey *, symkey **);
+static u_short auth_log2(size_t);
+static void auth_resize_hashtable(void);
+static void allocsymkey(symkey **, keyid_t, u_short, u_short,
+ u_long, u_short, u_char *, KeyAccT *);
+static void freesymkey(symkey *, symkey **);
#ifdef DEBUG
-static void free_auth_mem(void);
+static void free_auth_mem(void);
#endif
symkey key_listhead; /* list of all in-use keys */;
@@ -97,6 +99,7 @@ u_char *cache_secret; /* secret */
u_short cache_secretsize; /* secret length */
int cache_type; /* OpenSSL digest NID */
u_short cache_flags; /* flags that wave */
+KeyAccT *cache_keyacclist; /* key access list */
/*
@@ -142,6 +145,7 @@ free_auth_mem(void)
key_hash = NULL;
cache_keyid = 0;
cache_flags = 0;
+ cache_keyacclist = NULL;
for (alloc = authallocs; alloc != NULL; alloc = next_alloc) {
next_alloc = alloc->link;
free(alloc->mem);
@@ -210,10 +214,33 @@ auth_prealloc_symkeys(
}
-static inline u_short
-auth_log2(double x)
+static u_short
+auth_log2(size_t x)
{
- return (u_short)(log10(x) / log10(2));
+ /*
+ ** bithack to calculate floor(log2(x))
+ **
+ ** This assumes
+ ** - (sizeof(size_t) is a power of two
+ ** - CHAR_BITS is a power of two
+ ** - returning zero for arguments <= 0 is OK.
+ **
+ ** Does only shifts, masks and sums in integer arithmetic in
+ ** log2(CHAR_BIT*sizeof(size_t)) steps. (that is, 5/6 steps for
+ ** 32bit/64bit size_t)
+ */
+ int s;
+ int r = 0;
+ size_t m = ~(size_t)0;
+
+ for (s = sizeof(size_t) / 2 * CHAR_BIT; s != 0; s >>= 1) {
+ m <<= s;
+ if (x & m)
+ r += s;
+ else
+ x <<= s;
+ }
+ return (u_short)r;
}
@@ -234,7 +261,7 @@ auth_resize_hashtable(void)
symkey * sk;
totalkeys = authnumkeys + authnumfreekeys;
- hashbits = auth_log2(totalkeys / 4.0) + 1;
+ hashbits = auth_log2(totalkeys / 4) + 1;
hashbits = max(4, hashbits);
hashbits = min(15, hashbits);
@@ -267,7 +294,8 @@ allocsymkey(
u_short type,
u_long lifetime,
u_short secretsize,
- u_char * secret
+ u_char * secret,
+ KeyAccT * ka
)
{
symkey * sk;
@@ -281,6 +309,7 @@ allocsymkey(
sk->type = type;
sk->secretsize = secretsize;
sk->secret = secret;
+ sk->keyacclist = ka;
sk->lifetime = lifetime;
LINK_SLIST(*bucket, sk, hlink);
LINK_TAIL_DLIST(key_listhead, sk, llink);
@@ -412,6 +441,7 @@ authhavekey(
cache_flags = sk->flags;
cache_secret = sk->secret;
cache_secretsize = sk->secretsize;
+ cache_keyacclist = sk->keyacclist;
return TRUE;
}
@@ -451,6 +481,7 @@ authtrust(
if (cache_keyid == id) {
cache_flags = 0;
cache_keyid = 0;
+ cache_keyacclist = NULL;
}
/*
@@ -480,7 +511,7 @@ authtrust(
} else {
lifetime = 0;
}
- allocsymkey(bucket, id, KEY_TRUSTED, 0, lifetime, 0, NULL);
+ allocsymkey(bucket, id, KEY_TRUSTED, 0, lifetime, 0, NULL, NULL);
}
@@ -511,6 +542,49 @@ authistrusted(
return TRUE;
}
+
+/*
+ * authistrustedip - determine if the IP is OK for the keyid
+ */
+ int
+ authistrustedip(
+ keyid_t keyno,
+ sockaddr_u * sau
+ )
+{
+ symkey * sk;
+ symkey ** bucket;
+ KeyAccT * kal;
+ KeyAccT * k;
+
+ if (keyno == cache_keyid)
+ kal = cache_keyacclist;
+ else {
+ authkeyuncached++;
+ bucket = &key_hash[KEYHASH(keyno)];
+ for (sk = *bucket; sk != NULL; sk = sk->hlink) {
+ if (keyno == sk->keyid)
+ break;
+ }
+ if (NULL == sk || !(KEY_TRUSTED & sk->flags)) {
+ INSIST(!"authistrustedip: keyid not found/trusted!");
+ return FALSE;
+ }
+ kal = sk->keyacclist;
+ }
+
+ if (NULL == kal)
+ return TRUE;
+
+ for (k = kal; k; k = k->next) {
+ if (SOCK_EQ(&k->addr, sau))
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+
/* Note: There are two locations below where 'strncpy()' is used. While
* this function is a hazard by itself, it's essential that it is used
* here. Bug 1243 involved that the secret was filled with NUL bytes
@@ -527,7 +601,8 @@ MD5auth_setkey(
keyid_t keyno,
int keytype,
const u_char *key,
- size_t len
+ size_t len,
+ KeyAccT *ka
)
{
symkey * sk;
@@ -553,6 +628,7 @@ MD5auth_setkey(
sk->type = (u_short)keytype;
secretsize = len;
sk->secretsize = (u_short)secretsize;
+ sk->keyacclist = ka;
#ifndef DISABLE_BUG1243_FIX
memcpy(sk->secret, key, secretsize);
#else
@@ -563,6 +639,7 @@ MD5auth_setkey(
if (cache_keyid == keyno) {
cache_flags = 0;
cache_keyid = 0;
+ cache_keyacclist = NULL;
}
return;
}
@@ -580,7 +657,7 @@ MD5auth_setkey(
strncpy((char *)secret, (const char *)key, secretsize);
#endif
allocsymkey(bucket, keyno, 0, (u_short)keytype, 0,
- (u_short)secretsize, secret);
+ (u_short)secretsize, secret, ka);
#ifdef DEBUG
if (debug >= 4) {
size_t j;
diff --git a/contrib/ntp/libntp/authreadkeys.c b/contrib/ntp/libntp/authreadkeys.c
index 95a357a..1d4ee30 100644
--- a/contrib/ntp/libntp/authreadkeys.c
+++ b/contrib/ntp/libntp/authreadkeys.c
@@ -5,10 +5,12 @@
#include <stdio.h>
#include <ctype.h>
+#include "ntpd.h" /* Only for DPRINTF */
#include "ntp_fp.h"
#include "ntp.h"
#include "ntp_syslog.h"
#include "ntp_stdlib.h"
+#include "ntp_keyacc.h"
#ifdef OPENSSL
#include "openssl/objects.h"
@@ -85,6 +87,7 @@ static void log_maybe(u_int*, const char*, ...) NTP_PRINTF(2, 3);
typedef struct keydata KeyDataT;
struct keydata {
KeyDataT *next; /* queue/stack link */
+ KeyAccT *keyacclist; /* key access list */
keyid_t keyid; /* stored key ID */
u_short keytype; /* stored key type */
u_short seclen; /* length of secret */
@@ -228,6 +231,7 @@ authreadkeys(
len = strlen(token);
if (len <= 20) { /* Bug 2537 */
next = emalloc(sizeof(KeyDataT) + len);
+ next->keyacclist = NULL;
next->keyid = keyno;
next->keytype = keytype;
next->seclen = len;
@@ -257,11 +261,48 @@ authreadkeys(
}
len = jlim/2; /* hmmmm.... what about odd length?!? */
next = emalloc(sizeof(KeyDataT) + len);
+ next->keyacclist = NULL;
next->keyid = keyno;
next->keytype = keytype;
next->seclen = len;
memcpy(next->secbuf, keystr, len);
}
+
+ token = nexttok(&line);
+DPRINTF(0, ("authreadkeys: full access list <%s>\n", (token) ? token : "NULL"));
+ if (token != NULL) { /* A comma-separated IP access list */
+ char *tp = token;
+
+ while (tp) {
+ char *i;
+ KeyAccT ka;
+
+ i = strchr(tp, (int)',');
+ if (i)
+ *i = '\0';
+DPRINTF(0, ("authreadkeys: access list: <%s>\n", tp));
+
+ if (is_ip_address(tp, AF_UNSPEC, &ka.addr)) {
+ KeyAccT *kap;
+
+ kap = emalloc(sizeof(KeyAccT));
+ memcpy(kap, &ka, sizeof ka);
+ kap->next = next->keyacclist;
+ next->keyacclist = kap;
+ } else {
+ log_maybe(&nerr,
+ "authreadkeys: invalid IP address <%s> for key %d",
+ tp, keyno);
+ }
+
+ if (i) {
+ tp = i + 1;
+ } else {
+ tp = 0;
+ }
+ }
+ }
+
INSIST(NULL != next);
next->next = list;
list = next;
@@ -286,7 +327,7 @@ authreadkeys(
while (NULL != (next = list)) {
list = next->next;
MD5auth_setkey(next->keyid, next->keytype,
- next->secbuf, next->seclen);
+ next->secbuf, next->seclen, next->keyacclist);
/* purge secrets from memory before free()ing it */
memset(next, 0, sizeof(*next) + next->seclen);
free(next);
@@ -297,6 +338,14 @@ authreadkeys(
/* Mop up temporary storage before bailing out. */
while (NULL != (next = list)) {
list = next->next;
+
+ while (next->keyacclist) {
+ KeyAccT *kap = next->keyacclist;
+
+ next->keyacclist = kap->next;
+ free(kap);
+ }
+
/* purge secrets from memory before free()ing it */
memset(next, 0, sizeof(*next) + next->seclen);
free(next);
diff --git a/contrib/ntp/libntp/authusekey.c b/contrib/ntp/libntp/authusekey.c
index 0ccf522..ff449d3 100644
--- a/contrib/ntp/libntp/authusekey.c
+++ b/contrib/ntp/libntp/authusekey.c
@@ -29,6 +29,6 @@ authusekey(
if (0 == len)
return 0;
- MD5auth_setkey(keyno, keytype, str, len);
+ MD5auth_setkey(keyno, keytype, str, len, NULL);
return 1;
}
diff --git a/contrib/ntp/libntp/is_ip_address.c b/contrib/ntp/libntp/is_ip_address.c
new file mode 100644
index 0000000..1f21376
--- /dev/null
+++ b/contrib/ntp/libntp/is_ip_address.c
@@ -0,0 +1,129 @@
+/*
+ * is_ip_address
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#if 0
+#include <stdio.h>
+#include <signal.h>
+#ifdef HAVE_FNMATCH_H
+# include <fnmatch.h>
+# if !defined(FNM_CASEFOLD) && defined(FNM_IGNORECASE)
+# define FNM_CASEFOLD FNM_IGNORECASE
+# endif
+#endif
+#ifdef HAVE_SYS_PARAM_H
+# include <sys/param.h>
+#endif
+#ifdef HAVE_SYS_IOCTL_H
+# include <sys/ioctl.h>
+#endif
+#ifdef HAVE_SYS_SOCKIO_H /* UXPV: SIOC* #defines (Frank Vance <fvance@waii.com>) */
+# include <sys/sockio.h>
+#endif
+#ifdef HAVE_SYS_UIO_H
+# include <sys/uio.h>
+#endif
+#endif
+
+#include "ntp_assert.h"
+#include "ntp_stdlib.h"
+#include "safecast.h"
+
+#if 0
+#include "ntp_machine.h"
+#include "ntpd.h"
+#include "ntp_io.h"
+#include "iosignal.h"
+#include "ntp_lists.h"
+#include "ntp_refclock.h"
+#include "ntp_worker.h"
+#include "ntp_request.h"
+#include "timevalops.h"
+#include "timespecops.h"
+#include "ntpd-opts.h"
+#endif
+
+/* Don't include ISC's version of IPv6 variables and structures */
+#define ISC_IPV6_H 1
+#include <isc/mem.h>
+#include <isc/interfaceiter.h>
+#include <isc/netaddr.h>
+#include <isc/result.h>
+#include <isc/sockaddr.h>
+
+
+/*
+ * Code to tell if we have an IP address
+ * If we have then return the sockaddr structure
+ * and set the return value
+ * see the bind9/getaddresses.c for details
+ */
+int
+is_ip_address(
+ const char * host,
+ u_short af,
+ sockaddr_u * addr
+ )
+{
+ struct in_addr in4;
+ struct addrinfo hints;
+ struct addrinfo *result;
+ struct sockaddr_in6 *resaddr6;
+ char tmpbuf[128];
+ char *pch;
+
+ REQUIRE(host != NULL);
+ REQUIRE(addr != NULL);
+
+ ZERO_SOCK(addr);
+
+ /*
+ * Try IPv4, then IPv6. In order to handle the extended format
+ * for IPv6 scoped addresses (address%scope_ID), we'll use a local
+ * working buffer of 128 bytes. The length is an ad-hoc value, but
+ * should be enough for this purpose; the buffer can contain a string
+ * of at least 80 bytes for scope_ID in addition to any IPv6 numeric
+ * addresses (up to 46 bytes), the delimiter character and the
+ * terminating NULL character.
+ */
+ if (AF_UNSPEC == af || AF_INET == af)
+ if (inet_pton(AF_INET, host, &in4) == 1) {
+ AF(addr) = AF_INET;
+ SET_ADDR4N(addr, in4.s_addr);
+
+ return TRUE;
+ }
+
+ if (AF_UNSPEC == af || AF_INET6 == af)
+ if (sizeof(tmpbuf) > strlen(host)) {
+ if ('[' == host[0]) {
+ strlcpy(tmpbuf, &host[1], sizeof(tmpbuf));
+ pch = strchr(tmpbuf, ']');
+ if (pch != NULL)
+ *pch = '\0';
+ } else {
+ strlcpy(tmpbuf, host, sizeof(tmpbuf));
+ }
+ ZERO(hints);
+ hints.ai_family = AF_INET6;
+ hints.ai_flags |= AI_NUMERICHOST;
+ if (getaddrinfo(tmpbuf, NULL, &hints, &result) == 0) {
+ AF(addr) = AF_INET6;
+ resaddr6 = UA_PTR(struct sockaddr_in6, result->ai_addr);
+ SET_ADDR6N(addr, resaddr6->sin6_addr);
+ SET_SCOPE(addr, resaddr6->sin6_scope_id);
+
+ freeaddrinfo(result);
+ return TRUE;
+ }
+ }
+ /*
+ * If we got here it was not an IP address
+ */
+ return FALSE;
+}
diff --git a/contrib/ntp/libntp/ntp_worker.c b/contrib/ntp/libntp/ntp_worker.c
index f5642e1..087f06c 100644
--- a/contrib/ntp/libntp/ntp_worker.c
+++ b/contrib/ntp/libntp/ntp_worker.c
@@ -27,6 +27,8 @@ blocking_child ** blocking_children;
size_t blocking_children_alloc;
int worker_per_query; /* boolean */
int intres_req_pending;
+volatile u_int blocking_child_ready_seen;
+volatile u_int blocking_child_ready_done;
#ifndef HAVE_IO_COMPLETION_PORT
@@ -262,6 +264,31 @@ process_blocking_resp(
req_child_exit(c);
}
+void
+harvest_blocking_responses(void)
+{
+ int idx;
+ blocking_child* cp;
+ u_int scseen, scdone;
+
+ scseen = blocking_child_ready_seen;
+ scdone = blocking_child_ready_done;
+ if (scdone != scseen) {
+ blocking_child_ready_done = scseen;
+ for (idx = 0; idx < blocking_children_alloc; idx++) {
+ cp = blocking_children[idx];
+ if (NULL == cp)
+ continue;
+ scseen = cp->resp_ready_seen;
+ scdone = cp->resp_ready_done;
+ if (scdone != scseen) {
+ cp->resp_ready_done = scseen;
+ process_blocking_resp(cp);
+ }
+ }
+ }
+}
+
/*
* blocking_child_common runs as a forked child or a thread
diff --git a/contrib/ntp/libntp/systime.c b/contrib/ntp/libntp/systime.c
index c89d157..29f1e86 100644
--- a/contrib/ntp/libntp/systime.c
+++ b/contrib/ntp/libntp/systime.c
@@ -323,9 +323,18 @@ adj_systime(
else
quant = 1e-6;
ticks = (long)(dtemp / quant + .5);
- adjtv.tv_usec = (long)(ticks * quant * 1e6);
- dtemp -= adjtv.tv_usec / 1e6;
- sys_residual = dtemp;
+ adjtv.tv_usec = (long)(ticks * quant * 1.e6 + .5);
+ /* The rounding in the conversions could us push over the
+ * limits: make sure the result is properly normalised!
+ * note: sign comes later, all numbers non-negative here.
+ */
+ if (adjtv.tv_usec >= 1000000) {
+ adjtv.tv_sec += 1;
+ adjtv.tv_usec -= 1000000;
+ dtemp -= 1.;
+ }
+ /* set the new residual with leftover from correction */
+ sys_residual = dtemp - adjtv.tv_usec * 1.e-6;
/*
* Convert to signed seconds and microseconds for the Unix
diff --git a/contrib/ntp/libntp/work_thread.c b/contrib/ntp/libntp/work_thread.c
index 49e90c1..11e3267 100644
--- a/contrib/ntp/libntp/work_thread.c
+++ b/contrib/ntp/libntp/work_thread.c
@@ -25,13 +25,38 @@
#define CHILD_EXIT_REQ ((blocking_pipe_header *)(intptr_t)-1)
#define CHILD_GONE_RESP CHILD_EXIT_REQ
+/* Queue size increments:
+ * The request queue grows a bit faster than the response queue -- the
+ * deamon can push requests and pull results faster on avarage than the
+ * worker can process requests and push results... If this really pays
+ * off is debatable.
+ */
#define WORKITEMS_ALLOC_INC 16
#define RESPONSES_ALLOC_INC 4
+/* Fiddle with min/max stack sizes. 64kB minimum seems to work, so we
+ * set the maximum to 256kB. If the minimum goes below the
+ * system-defined minimum stack size, we have to adjust accordingly.
+ */
#ifndef THREAD_MINSTACKSIZE
-#define THREAD_MINSTACKSIZE (64U * 1024)
+# define THREAD_MINSTACKSIZE (64U * 1024)
+#endif
+#ifndef __sun
+#if defined(PTHREAD_STACK_MIN) && THREAD_MINSTACKSIZE < PTHREAD_STACK_MIN
+# undef THREAD_MINSTACKSIZE
+# define THREAD_MINSTACKSIZE PTHREAD_STACK_MIN
+#endif
#endif
+#ifndef THREAD_MAXSTACKSIZE
+# define THREAD_MAXSTACKSIZE (256U * 1024)
+#endif
+#if THREAD_MAXSTACKSIZE < THREAD_MINSTACKSIZE
+# undef THREAD_MAXSTACKSIZE
+# define THREAD_MAXSTACKSIZE THREAD_MINSTACKSIZE
+#endif
+
+
#ifdef SYS_WINNT
# define thread_exit(c) _endthreadex(c)
@@ -148,15 +173,19 @@ ensure_workitems_empty_slot(
size_t new_alloc;
size_t slots_used;
+ size_t sidx;
slots_used = c->head_workitem - c->tail_workitem;
if (slots_used >= c->workitems_alloc) {
new_alloc = c->workitems_alloc + WORKITEMS_ALLOC_INC;
c->workitems = erealloc(c->workitems, new_alloc * each);
+ for (sidx = c->workitems_alloc; sidx < new_alloc; ++sidx)
+ c->workitems[sidx] = NULL;
c->tail_workitem = 0;
c->head_workitem = c->workitems_alloc;
c->workitems_alloc = new_alloc;
}
+ INSIST(NULL == c->workitems[c->head_workitem % c->workitems_alloc]);
return (0 == slots_used);
}
@@ -180,15 +209,19 @@ ensure_workresp_empty_slot(
size_t new_alloc;
size_t slots_used;
+ size_t sidx;
slots_used = c->head_response - c->tail_response;
if (slots_used >= c->responses_alloc) {
new_alloc = c->responses_alloc + RESPONSES_ALLOC_INC;
c->responses = erealloc(c->responses, new_alloc * each);
+ for (sidx = c->responses_alloc; sidx < new_alloc; ++sidx)
+ c->responses[sidx] = NULL;
c->tail_response = 0;
c->head_response = c->responses_alloc;
c->responses_alloc = new_alloc;
}
+ INSIST(NULL == c->responses[c->head_response % c->responses_alloc]);
return (0 == slots_used);
}
@@ -478,11 +511,11 @@ start_blocking_thread_internal(
# endif
pthread_attr_t thr_attr;
int rc;
- int saved_errno;
int pipe_ends[2]; /* read then write */
int is_pipe;
int flags;
- size_t stacksize;
+ size_t ostacksize;
+ size_t nstacksize;
sigset_t saved_sig_mask;
c->thread_ref = NULL;
@@ -522,21 +555,29 @@ start_blocking_thread_internal(
pthread_attr_setdetachstate(&thr_attr, PTHREAD_CREATE_DETACHED);
#if defined(HAVE_PTHREAD_ATTR_GETSTACKSIZE) && \
defined(HAVE_PTHREAD_ATTR_SETSTACKSIZE)
- rc = pthread_attr_getstacksize(&thr_attr, &stacksize);
- if (-1 == rc) {
+ rc = pthread_attr_getstacksize(&thr_attr, &ostacksize);
+ if (0 != rc) {
msyslog(LOG_ERR,
- "start_blocking_thread: pthread_attr_getstacksize %m");
- } else if (stacksize < THREAD_MINSTACKSIZE) {
- rc = pthread_attr_setstacksize(&thr_attr,
- THREAD_MINSTACKSIZE);
- if (-1 == rc)
+ "start_blocking_thread: pthread_attr_getstacksize() -> %s",
+ strerror(rc));
+ } else {
+ if (ostacksize < THREAD_MINSTACKSIZE)
+ nstacksize = THREAD_MINSTACKSIZE;
+ else if (ostacksize > THREAD_MAXSTACKSIZE)
+ nstacksize = THREAD_MAXSTACKSIZE;
+ else
+ nstacksize = ostacksize;
+ if (nstacksize != ostacksize)
+ rc = pthread_attr_setstacksize(&thr_attr, nstacksize);
+ if (0 != rc)
msyslog(LOG_ERR,
- "start_blocking_thread: pthread_attr_setstacksize(0x%lx -> 0x%lx) %m",
- (u_long)stacksize,
- (u_long)THREAD_MINSTACKSIZE);
+ "start_blocking_thread: pthread_attr_setstacksize(0x%lx -> 0x%lx) -> %s",
+ (u_long)ostacksize, (u_long)nstacksize,
+ strerror(rc));
}
#else
- UNUSED_ARG(stacksize);
+ UNUSED_ARG(nstacksize);
+ UNUSED_ARG(ostacksize);
#endif
#if defined(PTHREAD_SCOPE_SYSTEM) && defined(NEED_PTHREAD_SCOPE_SYSTEM)
pthread_attr_setscope(&thr_attr, PTHREAD_SCOPE_SYSTEM);
@@ -545,12 +586,11 @@ start_blocking_thread_internal(
block_thread_signals(&saved_sig_mask);
rc = pthread_create(&c->thr_table[0], &thr_attr,
&blocking_thread, c);
- saved_errno = errno;
pthread_sigmask(SIG_SETMASK, &saved_sig_mask, NULL);
pthread_attr_destroy(&thr_attr);
if (0 != rc) {
- errno = saved_errno;
- msyslog(LOG_ERR, "pthread_create() blocking child: %m");
+ msyslog(LOG_ERR, "start_blocking_thread: pthread_create() -> %s",
+ strerror(rc));
exit(1);
}
c->thread_ref = &c->thr_table[0];
diff --git a/contrib/ntp/ntpd/invoke-ntp.conf.texi b/contrib/ntp/ntpd/invoke-ntp.conf.texi
index 32b41e6..1d8a621 100644
--- a/contrib/ntp/ntpd/invoke-ntp.conf.texi
+++ b/contrib/ntp/ntpd/invoke-ntp.conf.texi
@@ -6,7 +6,7 @@
#
# EDIT THIS FILE WITH CAUTION (invoke-ntp.conf.texi)
#
-# It has been AutoGen-ed January 7, 2016 at 11:30:49 PM by AutoGen 5.18.5
+# It has been AutoGen-ed January 20, 2016 at 04:17:59 AM by AutoGen 5.18.5
# From the definitions ntp.conf.def
# and the template file agtexi-file.tpl
@end ignore
@@ -2294,8 +2294,8 @@ otherwise, should be avoided.
@item @code{dscp} @kbd{value}
This option specifies the Differentiated Services Control Point (DSCP) value,
a 6-bit code. The default value is 46, signifying Expedited Forwarding.
-@item @code{enable} @code{[@code{auth} | @code{bclient} | @code{calibrate} | @code{kernel} | @code{mode7} | @code{monitor} | @code{ntp} | @code{stats}]}
-@item @code{disable} @code{[@code{auth} | @code{bclient} | @code{calibrate} | @code{kernel} | @code{mode7} | @code{monitor} | @code{ntp} | @code{stats}]}
+@item @code{enable} @code{[@code{auth} | @code{bclient} | @code{calibrate} | @code{kernel} | @code{mode7} | @code{monitor} | @code{ntp} | @code{stats} | @code{unpeer_crypto_early} | @code{unpeer_crypto_nak_early} | @code{unpeer_digest_early}]}
+@item @code{disable} @code{[@code{auth} | @code{bclient} | @code{calibrate} | @code{kernel} | @code{mode7} | @code{monitor} | @code{ntp} | @code{stats} | @code{unpeer_crypto_early} | @code{unpeer_crypto_nak_early} | @code{unpeer_digest_early}]}
Provides a way to enable or disable various server options.
Flags not mentioned are unaffected.
Note that all of these flags
@@ -2367,6 +2367,67 @@ See the
section for further information.
The default for this flag is
@code{disable}.
+@item @code{unpeer_crypto_early}
+By default, if
+@code{ntpd(1ntpdmdoc)}
+receives an autokey packet that fails TEST9,
+a crypto failure,
+the association is immediately cleared.
+This is almost certainly a feature,
+but if, in spite of the current recommendation of not using autokey,
+you are
+.B still
+using autokey
+.B and
+you are seeing this sort of DoS attack
+disabling this flag will delay
+tearing down the association until the reachability counter
+becomes zero.
+You can check your
+@code{peerstats}
+file for evidence of any of these attacks.
+The
+default for this flag is
+@code{enable}.
+@item @code{unpeer_crypto_nak_early}
+By default, if
+@code{ntpd(1ntpdmdoc)}
+receives a crypto-NAK packet that
+passes the duplicate packet and origin timestamp checks
+the association is immediately cleared.
+While this is generally a feature
+as it allows for quick recovery if a server key has changed,
+a properly forged and appropriately delivered crypto-NAK packet
+can be used in a DoS attack.
+If you have active noticable problems with this type of DoS attack
+then you should consider
+disabling this option.
+You can check your
+@code{peerstats}
+file for evidence of any of these attacks.
+The
+default for this flag is
+@code{enable}.
+@item @code{unpeer_digest_early}
+By default, if
+@code{ntpd(1ntpdmdoc)}
+receives what should be an authenticated packet
+that passes other packet sanity checks but
+contains an invalid digest
+the association is immediately cleared.
+While this is generally a feature
+as it allows for quick recovery,
+if this type of packet is carefully forged and sent
+during an appropriate window it can be used for a DoS attack.
+If you have active noticable problems with this type of DoS attack
+then you should consider
+disabling this option.
+You can check your
+@code{peerstats}
+file for evidence of any of these attacks.
+The
+default for this flag is
+@code{enable}.
@end table
@item @code{includefile} @kbd{includefile}
This command allows additional configuration commands
diff --git a/contrib/ntp/ntpd/invoke-ntp.keys.texi b/contrib/ntp/ntpd/invoke-ntp.keys.texi
index b755d97..915044e 100644
--- a/contrib/ntp/ntpd/invoke-ntp.keys.texi
+++ b/contrib/ntp/ntpd/invoke-ntp.keys.texi
@@ -6,7 +6,7 @@
#
# EDIT THIS FILE WITH CAUTION (invoke-ntp.keys.texi)
#
-# It has been AutoGen-ed January 7, 2016 at 11:30:52 PM by AutoGen 5.18.5
+# It has been AutoGen-ed January 20, 2016 at 04:18:02 AM by AutoGen 5.18.5
# From the definitions ntp.keys.def
# and the template file agtexi-file.tpl
@end ignore
@@ -37,7 +37,7 @@ as the configuration file.
Key entries use a fixed format of the form
@example
-@kbd{keyno} @kbd{type} @kbd{key}
+@kbd{keyno} @kbd{type} @kbd{key} @kbd{opt_IP_list}
@end example
where
@@ -47,7 +47,15 @@ is a positive integer (between 1 and 65534),
is the message digest algorithm,
and
@kbd{key}
-is the key itself.
+is the key itself, and
+@kbd{opt_IP_list}
+is an optional comma-separated list of IPs
+that are allowed to serve time.
+If
+@kbd{opt_IP_list}
+is empty,
+any properly-authenticated server message will be
+accepted.
The
@kbd{key}
diff --git a/contrib/ntp/ntpd/invoke-ntpd.texi b/contrib/ntp/ntpd/invoke-ntpd.texi
index 66ce19d..50e8f65 100644
--- a/contrib/ntp/ntpd/invoke-ntpd.texi
+++ b/contrib/ntp/ntpd/invoke-ntpd.texi
@@ -6,7 +6,7 @@
#
# EDIT THIS FILE WITH CAUTION (invoke-ntpd.texi)
#
-# It has been AutoGen-ed January 7, 2016 at 11:30:54 PM by AutoGen 5.18.5
+# It has been AutoGen-ed January 20, 2016 at 04:18:04 AM by AutoGen 5.18.5
# From the definitions ntpd-opts.def
# and the template file agtexi-cmd.tpl
@end ignore
@@ -142,7 +142,7 @@ with a status code of 0.
@exampleindent 0
@example
-ntpd - NTP daemon program - Ver. 4.2.8p5
+ntpd - NTP daemon program - Ver. 4.2.8p6
Usage: ntpd [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]... \
[ <server1> ... <serverN> ]
Flg Arg Option-Name Description
diff --git a/contrib/ntp/ntpd/keyword-gen-utd b/contrib/ntp/ntpd/keyword-gen-utd
index 467351b..99c7220 100644
--- a/contrib/ntp/ntpd/keyword-gen-utd
+++ b/contrib/ntp/ntpd/keyword-gen-utd
@@ -1 +1 @@
- * Generated 2015-06-25 03:57:00 UTC diff_ignore_line
+ * Generated 2016-01-16 08:33:03 UTC diff_ignore_line
diff --git a/contrib/ntp/ntpd/keyword-gen.c b/contrib/ntp/ntpd/keyword-gen.c
index 42e9497..2e7f621 100644
--- a/contrib/ntp/ntpd/keyword-gen.c
+++ b/contrib/ntp/ntpd/keyword-gen.c
@@ -202,6 +202,9 @@ struct key_tok ntp_keywords[] = {
{ "ntp", T_Ntp, FOLLBY_TOKEN },
{ "mode7", T_Mode7, FOLLBY_TOKEN },
{ "stats", T_Stats, FOLLBY_TOKEN },
+{ "unpeer_crypto_early", T_UEcrypto, FOLLBY_TOKEN },
+{ "unpeer_crypto_nak_early", T_UEcryptonak, FOLLBY_TOKEN },
+{ "unpeer_digest_early", T_UEdigest, FOLLBY_TOKEN },
/* rlimit_option */
{ "memlock", T_Memlock, FOLLBY_TOKEN },
{ "stacksize", T_Stacksize, FOLLBY_TOKEN },
diff --git a/contrib/ntp/ntpd/ntp.conf.5man b/contrib/ntp/ntpd/ntp.conf.5man
index 6e6aa32..1e5e464 100644
--- a/contrib/ntp/ntpd/ntp.conf.5man
+++ b/contrib/ntp/ntpd/ntp.conf.5man
@@ -10,11 +10,11 @@
.ds B-Font B
.ds I-Font I
.ds R-Font R
-.TH ntp.conf 5man "07 Jan 2016" "4.2.8p5" "File Formats"
+.TH ntp.conf 5man "20 Jan 2016" "4.2.8p6" "File Formats"
.\"
-.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-8qayqp/ag-Vraqpp)
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-gsaOxR/ag-XsaGwR)
.\"
-.\" It has been AutoGen-ed January 7, 2016 at 11:30:35 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed January 20, 2016 at 04:17:45 AM by AutoGen 5.18.5
.\" From the definitions ntp.conf.def
.\" and the template file agman-cmd.tpl
.SH NAME
@@ -2573,9 +2573,9 @@ otherwise, should be avoided.
This option specifies the Differentiated Services Control Point (DSCP) value,
a 6-bit code. The default value is 46, signifying Expedited Forwarding.
.TP 7
-.NOP \f\*[B-Font]enable\f[] [\f\*[B-Font]auth\f[] | \f\*[B-Font]bclient\f[] | \f\*[B-Font]calibrate\f[] | \f\*[B-Font]kernel\f[] | \f\*[B-Font]mode7\f[] | \f\*[B-Font]monitor\f[] | \f\*[B-Font]ntp\f[] | \f\*[B-Font]stats\f[]]
+.NOP \f\*[B-Font]enable\f[] [\f\*[B-Font]auth\f[] | \f\*[B-Font]bclient\f[] | \f\*[B-Font]calibrate\f[] | \f\*[B-Font]kernel\f[] | \f\*[B-Font]mode7\f[] | \f\*[B-Font]monitor\f[] | \f\*[B-Font]ntp\f[] | \f\*[B-Font]stats\f[] | \f\*[B-Font]unpeer_crypto_early\f[] | \f\*[B-Font]unpeer_crypto_nak_early\f[] | \f\*[B-Font]unpeer_digest_early\f[]]
.TP 7
-.NOP \f\*[B-Font]disable\f[] [\f\*[B-Font]auth\f[] | \f\*[B-Font]bclient\f[] | \f\*[B-Font]calibrate\f[] | \f\*[B-Font]kernel\f[] | \f\*[B-Font]mode7\f[] | \f\*[B-Font]monitor\f[] | \f\*[B-Font]ntp\f[] | \f\*[B-Font]stats\f[]]
+.NOP \f\*[B-Font]disable\f[] [\f\*[B-Font]auth\f[] | \f\*[B-Font]bclient\f[] | \f\*[B-Font]calibrate\f[] | \f\*[B-Font]kernel\f[] | \f\*[B-Font]mode7\f[] | \f\*[B-Font]monitor\f[] | \f\*[B-Font]ntp\f[] | \f\*[B-Font]stats\f[] | \f\*[B-Font]unpeer_crypto_early\f[] | \f\*[B-Font]unpeer_crypto_nak_early\f[] | \f\*[B-Font]unpeer_digest_early\f[]]
Provides a way to enable or disable various server options.
Flags not mentioned are unaffected.
Note that all of these flags
@@ -2655,6 +2655,70 @@ See the
section for further information.
The default for this flag is
\f\*[B-Font]disable\f[].
+.TP 7
+.NOP \f\*[B-Font]unpeer_crypto_early\f[]
+By default, if
+\fCntpd\f[]\fR(1ntpdmdoc)\f[]
+receives an autokey packet that fails TEST9,
+a crypto failure,
+the association is immediately cleared.
+This is almost certainly a feature,
+but if, in spite of the current recommendation of not using autokey,
+you are
+.B still
+using autokey
+.B and
+you are seeing this sort of DoS attack
+disabling this flag will delay
+tearing down the association until the reachability counter
+becomes zero.
+You can check your
+\f\*[B-Font]peerstats\f[]
+file for evidence of any of these attacks.
+The
+default for this flag is
+\f\*[B-Font]enable\f[].
+.TP 7
+.NOP \f\*[B-Font]unpeer_crypto_nak_early\f[]
+By default, if
+\fCntpd\f[]\fR(1ntpdmdoc)\f[]
+receives a crypto-NAK packet that
+passes the duplicate packet and origin timestamp checks
+the association is immediately cleared.
+While this is generally a feature
+as it allows for quick recovery if a server key has changed,
+a properly forged and appropriately delivered crypto-NAK packet
+can be used in a DoS attack.
+If you have active noticable problems with this type of DoS attack
+then you should consider
+disabling this option.
+You can check your
+\f\*[B-Font]peerstats\f[]
+file for evidence of any of these attacks.
+The
+default for this flag is
+\f\*[B-Font]enable\f[].
+.TP 7
+.NOP \f\*[B-Font]unpeer_digest_early\f[]
+By default, if
+\fCntpd\f[]\fR(1ntpdmdoc)\f[]
+receives what should be an authenticated packet
+that passes other packet sanity checks but
+contains an invalid digest
+the association is immediately cleared.
+While this is generally a feature
+as it allows for quick recovery,
+if this type of packet is carefully forged and sent
+during an appropriate window it can be used for a DoS attack.
+If you have active noticable problems with this type of DoS attack
+then you should consider
+disabling this option.
+You can check your
+\f\*[B-Font]peerstats\f[]
+file for evidence of any of these attacks.
+The
+default for this flag is
+\f\*[B-Font]enable\f[].
.RE
.TP 7
.NOP \f\*[B-Font]includefile\f[] \f\*[I-Font]includefile\f[]
@@ -3027,7 +3091,7 @@ RFC5905
.SH "AUTHORS"
The University of Delaware and Network Time Foundation
.SH "COPYRIGHT"
-Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation all rights reserved.
+Copyright (C) 1992-2016 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 --git a/contrib/ntp/ntpd/ntp.conf.5mdoc b/contrib/ntp/ntpd/ntp.conf.5mdoc
index 800e995..f2b418b 100644
--- a/contrib/ntp/ntpd/ntp.conf.5mdoc
+++ b/contrib/ntp/ntpd/ntp.conf.5mdoc
@@ -1,9 +1,9 @@
-.Dd January 7 2016
+.Dd January 20 2016
.Dt NTP_CONF 5mdoc File Formats
.Os
.\" EDIT THIS FILE WITH CAUTION (ntp.mdoc)
.\"
-.\" It has been AutoGen-ed January 7, 2016 at 11:30:57 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed January 20, 2016 at 04:18:07 AM by AutoGen 5.18.5
.\" From the definitions ntp.conf.def
.\" and the template file agmdoc-cmd.tpl
.Sh NAME
@@ -2393,16 +2393,18 @@ a 6\-bit code. The default value is 46, signifying Expedited Forwarding.
.Oo
.Cm auth | Cm bclient |
.Cm calibrate | Cm kernel |
-.Cm mode7 | monitor |
-.Cm ntp | Cm stats
+.Cm mode7 | Cm monitor |
+.Cm ntp | Cm stats |
+.Cm unpeer_crypto_early | Cm unpeer_crypto_nak_early | Cm unpeer_digest_early
.Oc
.Xc
.It Xo Ic disable
.Oo
.Cm auth | Cm bclient |
.Cm calibrate | Cm kernel |
-.Cm mode7 | monitor |
-.Cm ntp | Cm stats
+.Cm mode7 | Cm monitor |
+.Cm ntp | Cm stats |
+.Cm unpeer_crypto_early | Cm unpeer_crypto_nak_early | Cm unpeer_digest_early
.Oc
.Xc
Provides a way to enable or disable various server options.
@@ -2476,6 +2478,67 @@ See the
section for further information.
The default for this flag is
.Ic disable .
+.It Cm unpeer_crypto_early
+By default, if
+.Xr ntpd 1ntpdmdoc
+receives an autokey packet that fails TEST9,
+a crypto failure,
+the association is immediately cleared.
+This is almost certainly a feature,
+but if, in spite of the current recommendation of not using autokey,
+you are
+.B still
+using autokey
+.B and
+you are seeing this sort of DoS attack
+disabling this flag will delay
+tearing down the association until the reachability counter
+becomes zero.
+You can check your
+.Cm peerstats
+file for evidence of any of these attacks.
+The
+default for this flag is
+.Ic enable .
+.It Cm unpeer_crypto_nak_early
+By default, if
+.Xr ntpd 1ntpdmdoc
+receives a crypto\-NAK packet that
+passes the duplicate packet and origin timestamp checks
+the association is immediately cleared.
+While this is generally a feature
+as it allows for quick recovery if a server key has changed,
+a properly forged and appropriately delivered crypto\-NAK packet
+can be used in a DoS attack.
+If you have active noticable problems with this type of DoS attack
+then you should consider
+disabling this option.
+You can check your
+.Cm peerstats
+file for evidence of any of these attacks.
+The
+default for this flag is
+.Ic enable .
+.It Cm unpeer_digest_early
+By default, if
+.Xr ntpd 1ntpdmdoc
+receives what should be an authenticated packet
+that passes other packet sanity checks but
+contains an invalid digest
+the association is immediately cleared.
+While this is generally a feature
+as it allows for quick recovery,
+if this type of packet is carefully forged and sent
+during an appropriate window it can be used for a DoS attack.
+If you have active noticable problems with this type of DoS attack
+then you should consider
+disabling this option.
+You can check your
+.Cm peerstats
+file for evidence of any of these attacks.
+The
+default for this flag is
+.Ic enable .
.El
.It Ic includefile Ar includefile
This command allows additional configuration commands
@@ -2834,7 +2897,7 @@ A snapshot of this documentation is available in HTML format in
.Sh "AUTHORS"
The University of Delaware and Network Time Foundation
.Sh "COPYRIGHT"
-Copyright (C) 1992\-2015 The University of Delaware and Network Time Foundation all rights reserved.
+Copyright (C) 1992\-2016 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 --git a/contrib/ntp/ntpd/ntp.conf.def b/contrib/ntp/ntpd/ntp.conf.def
index 43835bc..25d9fd0 100644
--- a/contrib/ntp/ntpd/ntp.conf.def
+++ b/contrib/ntp/ntpd/ntp.conf.def
@@ -2395,16 +2395,18 @@ a 6-bit code. The default value is 46, signifying Expedited Forwarding.
.Oo
.Cm auth | Cm bclient |
.Cm calibrate | Cm kernel |
-.Cm mode7 | monitor |
-.Cm ntp | Cm stats
+.Cm mode7 | Cm monitor |
+.Cm ntp | Cm stats |
+.Cm unpeer_crypto_early | Cm unpeer_crypto_nak_early | Cm unpeer_digest_early
.Oc
.Xc
.It Xo Ic disable
.Oo
.Cm auth | Cm bclient |
.Cm calibrate | Cm kernel |
-.Cm mode7 | monitor |
-.Cm ntp | Cm stats
+.Cm mode7 | Cm monitor |
+.Cm ntp | Cm stats |
+.Cm unpeer_crypto_early | Cm unpeer_crypto_nak_early | Cm unpeer_digest_early
.Oc
.Xc
Provides a way to enable or disable various server options.
@@ -2478,6 +2480,67 @@ See the
section for further information.
The default for this flag is
.Ic disable .
+.It Cm unpeer_crypto_early
+By default, if
+.Xr ntpd 1ntpdmdoc
+receives an autokey packet that fails TEST9,
+a crypto failure,
+the association is immediately cleared.
+This is almost certainly a feature,
+but if, in spite of the current recommendation of not using autokey,
+you are
+.B still
+using autokey
+.B and
+you are seeing this sort of DoS attack
+disabling this flag will delay
+tearing down the association until the reachability counter
+becomes zero.
+You can check your
+.Cm peerstats
+file for evidence of any of these attacks.
+The
+default for this flag is
+.Ic enable .
+.It Cm unpeer_crypto_nak_early
+By default, if
+.Xr ntpd 1ntpdmdoc
+receives a crypto-NAK packet that
+passes the duplicate packet and origin timestamp checks
+the association is immediately cleared.
+While this is generally a feature
+as it allows for quick recovery if a server key has changed,
+a properly forged and appropriately delivered crypto-NAK packet
+can be used in a DoS attack.
+If you have active noticable problems with this type of DoS attack
+then you should consider
+disabling this option.
+You can check your
+.Cm peerstats
+file for evidence of any of these attacks.
+The
+default for this flag is
+.Ic enable .
+.It Cm unpeer_digest_early
+By default, if
+.Xr ntpd 1ntpdmdoc
+receives what should be an authenticated packet
+that passes other packet sanity checks but
+contains an invalid digest
+the association is immediately cleared.
+While this is generally a feature
+as it allows for quick recovery,
+if this type of packet is carefully forged and sent
+during an appropriate window it can be used for a DoS attack.
+If you have active noticable problems with this type of DoS attack
+then you should consider
+disabling this option.
+You can check your
+.Cm peerstats
+file for evidence of any of these attacks.
+The
+default for this flag is
+.Ic enable .
.El
.It Ic includefile Ar includefile
This command allows additional configuration commands
diff --git a/contrib/ntp/ntpd/ntp.conf.html b/contrib/ntp/ntpd/ntp.conf.html
index d10a88d..c50f0e1 100644
--- a/contrib/ntp/ntpd/ntp.conf.html
+++ b/contrib/ntp/ntpd/ntp.conf.html
@@ -33,7 +33,7 @@ Up:&nbsp;<a rel="up" accesskey="u" href="#dir">(dir)</a>
<p>This document describes the configuration file for the NTP Project's
<code>ntpd</code> program.
- <p>This document applies to version 4.2.8p5 of <code>ntp.conf</code>.
+ <p>This document applies to version 4.2.8p6 of <code>ntp.conf</code>.
<div class="shortcontents">
<h2>Short Contents</h2>
@@ -2288,7 +2288,7 @@ drift file is located in, and that file system links, symbolic or
otherwise, should be avoided.
<br><dt><code>dscp</code> <kbd>value</kbd><dd>This option specifies the Differentiated Services Control Point (DSCP) value,
a 6-bit code. The default value is 46, signifying Expedited Forwarding.
-<br><dt><code>enable</code> <code>[auth | bclient | calibrate | kernel | mode7 | monitor | ntp | stats]</code><br><dt><code>disable</code> <code>[auth | bclient | calibrate | kernel | mode7 | monitor | ntp | stats]</code><dd>Provides a way to enable or disable various server options.
+<br><dt><code>enable</code> <code>[auth | bclient | calibrate | kernel | mode7 | monitor | ntp | stats | unpeer_crypto_early | unpeer_crypto_nak_early | unpeer_digest_early]</code><br><dt><code>disable</code> <code>[auth | bclient | calibrate | kernel | mode7 | monitor | ntp | stats | unpeer_crypto_early | unpeer_crypto_nak_early | unpeer_digest_early]</code><dd>Provides a way to enable or disable various server options.
Flags not mentioned are unaffected.
Note that all of these flags
can be controlled remotely using the
@@ -2351,6 +2351,64 @@ See the
section for further information.
The default for this flag is
<code>disable</code>.
+<br><dt><code>unpeer_crypto_early</code><dd>By default, if
+<code>ntpd(1ntpdmdoc)</code>
+receives an autokey packet that fails TEST9,
+a crypto failure,
+the association is immediately cleared.
+This is almost certainly a feature,
+but if, in spite of the current recommendation of not using autokey,
+you are
+.B still
+using autokey
+.B and
+you are seeing this sort of DoS attack
+disabling this flag will delay
+tearing down the association until the reachability counter
+becomes zero.
+You can check your
+<code>peerstats</code>
+file for evidence of any of these attacks.
+The
+default for this flag is
+<code>enable</code>.
+<br><dt><code>unpeer_crypto_nak_early</code><dd>By default, if
+<code>ntpd(1ntpdmdoc)</code>
+receives a crypto-NAK packet that
+passes the duplicate packet and origin timestamp checks
+the association is immediately cleared.
+While this is generally a feature
+as it allows for quick recovery if a server key has changed,
+a properly forged and appropriately delivered crypto-NAK packet
+can be used in a DoS attack.
+If you have active noticable problems with this type of DoS attack
+then you should consider
+disabling this option.
+You can check your
+<code>peerstats</code>
+file for evidence of any of these attacks.
+The
+default for this flag is
+<code>enable</code>.
+<br><dt><code>unpeer_digest_early</code><dd>By default, if
+<code>ntpd(1ntpdmdoc)</code>
+receives what should be an authenticated packet
+that passes other packet sanity checks but
+contains an invalid digest
+the association is immediately cleared.
+While this is generally a feature
+as it allows for quick recovery,
+if this type of packet is carefully forged and sent
+during an appropriate window it can be used for a DoS attack.
+If you have active noticable problems with this type of DoS attack
+then you should consider
+disabling this option.
+You can check your
+<code>peerstats</code>
+file for evidence of any of these attacks.
+The
+default for this flag is
+<code>enable</code>.
</dl>
<br><dt><code>includefile</code> <kbd>includefile</kbd><dd>This command allows additional configuration commands
to be included from a separate file.
diff --git a/contrib/ntp/ntpd/ntp.conf.man.in b/contrib/ntp/ntpd/ntp.conf.man.in
index f701b41..7a5b750 100644
--- a/contrib/ntp/ntpd/ntp.conf.man.in
+++ b/contrib/ntp/ntpd/ntp.conf.man.in
@@ -10,11 +10,11 @@
.ds B-Font B
.ds I-Font I
.ds R-Font R
-.TH ntp.conf 5 "07 Jan 2016" "4.2.8p5" "File Formats"
+.TH ntp.conf 5 "20 Jan 2016" "4.2.8p6" "File Formats"
.\"
-.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-8qayqp/ag-Vraqpp)
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-gsaOxR/ag-XsaGwR)
.\"
-.\" It has been AutoGen-ed January 7, 2016 at 11:30:35 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed January 20, 2016 at 04:17:45 AM by AutoGen 5.18.5
.\" From the definitions ntp.conf.def
.\" and the template file agman-cmd.tpl
.SH NAME
@@ -2573,9 +2573,9 @@ otherwise, should be avoided.
This option specifies the Differentiated Services Control Point (DSCP) value,
a 6-bit code. The default value is 46, signifying Expedited Forwarding.
.TP 7
-.NOP \f\*[B-Font]enable\f[] [\f\*[B-Font]auth\f[] | \f\*[B-Font]bclient\f[] | \f\*[B-Font]calibrate\f[] | \f\*[B-Font]kernel\f[] | \f\*[B-Font]mode7\f[] | \f\*[B-Font]monitor\f[] | \f\*[B-Font]ntp\f[] | \f\*[B-Font]stats\f[]]
+.NOP \f\*[B-Font]enable\f[] [\f\*[B-Font]auth\f[] | \f\*[B-Font]bclient\f[] | \f\*[B-Font]calibrate\f[] | \f\*[B-Font]kernel\f[] | \f\*[B-Font]mode7\f[] | \f\*[B-Font]monitor\f[] | \f\*[B-Font]ntp\f[] | \f\*[B-Font]stats\f[] | \f\*[B-Font]unpeer_crypto_early\f[] | \f\*[B-Font]unpeer_crypto_nak_early\f[] | \f\*[B-Font]unpeer_digest_early\f[]]
.TP 7
-.NOP \f\*[B-Font]disable\f[] [\f\*[B-Font]auth\f[] | \f\*[B-Font]bclient\f[] | \f\*[B-Font]calibrate\f[] | \f\*[B-Font]kernel\f[] | \f\*[B-Font]mode7\f[] | \f\*[B-Font]monitor\f[] | \f\*[B-Font]ntp\f[] | \f\*[B-Font]stats\f[]]
+.NOP \f\*[B-Font]disable\f[] [\f\*[B-Font]auth\f[] | \f\*[B-Font]bclient\f[] | \f\*[B-Font]calibrate\f[] | \f\*[B-Font]kernel\f[] | \f\*[B-Font]mode7\f[] | \f\*[B-Font]monitor\f[] | \f\*[B-Font]ntp\f[] | \f\*[B-Font]stats\f[] | \f\*[B-Font]unpeer_crypto_early\f[] | \f\*[B-Font]unpeer_crypto_nak_early\f[] | \f\*[B-Font]unpeer_digest_early\f[]]
Provides a way to enable or disable various server options.
Flags not mentioned are unaffected.
Note that all of these flags
@@ -2655,6 +2655,70 @@ See the
section for further information.
The default for this flag is
\f\*[B-Font]disable\f[].
+.TP 7
+.NOP \f\*[B-Font]unpeer_crypto_early\f[]
+By default, if
+\fCntpd\f[]\fR(@NTPD_MS@)\f[]
+receives an autokey packet that fails TEST9,
+a crypto failure,
+the association is immediately cleared.
+This is almost certainly a feature,
+but if, in spite of the current recommendation of not using autokey,
+you are
+.B still
+using autokey
+.B and
+you are seeing this sort of DoS attack
+disabling this flag will delay
+tearing down the association until the reachability counter
+becomes zero.
+You can check your
+\f\*[B-Font]peerstats\f[]
+file for evidence of any of these attacks.
+The
+default for this flag is
+\f\*[B-Font]enable\f[].
+.TP 7
+.NOP \f\*[B-Font]unpeer_crypto_nak_early\f[]
+By default, if
+\fCntpd\f[]\fR(@NTPD_MS@)\f[]
+receives a crypto-NAK packet that
+passes the duplicate packet and origin timestamp checks
+the association is immediately cleared.
+While this is generally a feature
+as it allows for quick recovery if a server key has changed,
+a properly forged and appropriately delivered crypto-NAK packet
+can be used in a DoS attack.
+If you have active noticable problems with this type of DoS attack
+then you should consider
+disabling this option.
+You can check your
+\f\*[B-Font]peerstats\f[]
+file for evidence of any of these attacks.
+The
+default for this flag is
+\f\*[B-Font]enable\f[].
+.TP 7
+.NOP \f\*[B-Font]unpeer_digest_early\f[]
+By default, if
+\fCntpd\f[]\fR(@NTPD_MS@)\f[]
+receives what should be an authenticated packet
+that passes other packet sanity checks but
+contains an invalid digest
+the association is immediately cleared.
+While this is generally a feature
+as it allows for quick recovery,
+if this type of packet is carefully forged and sent
+during an appropriate window it can be used for a DoS attack.
+If you have active noticable problems with this type of DoS attack
+then you should consider
+disabling this option.
+You can check your
+\f\*[B-Font]peerstats\f[]
+file for evidence of any of these attacks.
+The
+default for this flag is
+\f\*[B-Font]enable\f[].
.RE
.TP 7
.NOP \f\*[B-Font]includefile\f[] \f\*[I-Font]includefile\f[]
@@ -3027,7 +3091,7 @@ RFC5905
.SH "AUTHORS"
The University of Delaware and Network Time Foundation
.SH "COPYRIGHT"
-Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation all rights reserved.
+Copyright (C) 1992-2016 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 --git a/contrib/ntp/ntpd/ntp.conf.mdoc.in b/contrib/ntp/ntpd/ntp.conf.mdoc.in
index 7ad4cc1..fe85d85 100644
--- a/contrib/ntp/ntpd/ntp.conf.mdoc.in
+++ b/contrib/ntp/ntpd/ntp.conf.mdoc.in
@@ -1,9 +1,9 @@
-.Dd January 7 2016
+.Dd January 20 2016
.Dt NTP_CONF 5 File Formats
.Os
.\" EDIT THIS FILE WITH CAUTION (ntp.mdoc)
.\"
-.\" It has been AutoGen-ed January 7, 2016 at 11:30:57 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed January 20, 2016 at 04:18:07 AM by AutoGen 5.18.5
.\" From the definitions ntp.conf.def
.\" and the template file agmdoc-cmd.tpl
.Sh NAME
@@ -2393,16 +2393,18 @@ a 6\-bit code. The default value is 46, signifying Expedited Forwarding.
.Oo
.Cm auth | Cm bclient |
.Cm calibrate | Cm kernel |
-.Cm mode7 | monitor |
-.Cm ntp | Cm stats
+.Cm mode7 | Cm monitor |
+.Cm ntp | Cm stats |
+.Cm unpeer_crypto_early | Cm unpeer_crypto_nak_early | Cm unpeer_digest_early
.Oc
.Xc
.It Xo Ic disable
.Oo
.Cm auth | Cm bclient |
.Cm calibrate | Cm kernel |
-.Cm mode7 | monitor |
-.Cm ntp | Cm stats
+.Cm mode7 | Cm monitor |
+.Cm ntp | Cm stats |
+.Cm unpeer_crypto_early | Cm unpeer_crypto_nak_early | Cm unpeer_digest_early
.Oc
.Xc
Provides a way to enable or disable various server options.
@@ -2476,6 +2478,67 @@ See the
section for further information.
The default for this flag is
.Ic disable .
+.It Cm unpeer_crypto_early
+By default, if
+.Xr ntpd @NTPD_MS@
+receives an autokey packet that fails TEST9,
+a crypto failure,
+the association is immediately cleared.
+This is almost certainly a feature,
+but if, in spite of the current recommendation of not using autokey,
+you are
+.B still
+using autokey
+.B and
+you are seeing this sort of DoS attack
+disabling this flag will delay
+tearing down the association until the reachability counter
+becomes zero.
+You can check your
+.Cm peerstats
+file for evidence of any of these attacks.
+The
+default for this flag is
+.Ic enable .
+.It Cm unpeer_crypto_nak_early
+By default, if
+.Xr ntpd @NTPD_MS@
+receives a crypto\-NAK packet that
+passes the duplicate packet and origin timestamp checks
+the association is immediately cleared.
+While this is generally a feature
+as it allows for quick recovery if a server key has changed,
+a properly forged and appropriately delivered crypto\-NAK packet
+can be used in a DoS attack.
+If you have active noticable problems with this type of DoS attack
+then you should consider
+disabling this option.
+You can check your
+.Cm peerstats
+file for evidence of any of these attacks.
+The
+default for this flag is
+.Ic enable .
+.It Cm unpeer_digest_early
+By default, if
+.Xr ntpd @NTPD_MS@
+receives what should be an authenticated packet
+that passes other packet sanity checks but
+contains an invalid digest
+the association is immediately cleared.
+While this is generally a feature
+as it allows for quick recovery,
+if this type of packet is carefully forged and sent
+during an appropriate window it can be used for a DoS attack.
+If you have active noticable problems with this type of DoS attack
+then you should consider
+disabling this option.
+You can check your
+.Cm peerstats
+file for evidence of any of these attacks.
+The
+default for this flag is
+.Ic enable .
.El
.It Ic includefile Ar includefile
This command allows additional configuration commands
@@ -2834,7 +2897,7 @@ A snapshot of this documentation is available in HTML format in
.Sh "AUTHORS"
The University of Delaware and Network Time Foundation
.Sh "COPYRIGHT"
-Copyright (C) 1992\-2015 The University of Delaware and Network Time Foundation all rights reserved.
+Copyright (C) 1992\-2016 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 --git a/contrib/ntp/ntpd/ntp.keys.5man b/contrib/ntp/ntpd/ntp.keys.5man
index bb0028b..6d270b6 100644
--- a/contrib/ntp/ntpd/ntp.keys.5man
+++ b/contrib/ntp/ntpd/ntp.keys.5man
@@ -1,8 +1,8 @@
-.TH ntp.keys 5man "07 Jan 2016" "4.2.8p5" "File Formats"
+.TH ntp.keys 5man "20 Jan 2016" "4.2.8p6" "File Formats"
.\"
.\" EDIT THIS FILE WITH CAUTION (ntp.man)
.\"
-.\" It has been AutoGen-ed January 7, 2016 at 11:30:41 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed January 20, 2016 at 04:17:51 AM by AutoGen 5.18.5
.\" From the definitions ntp.keys.def
.\" and the template file agman-file.tpl
.Sh NAME
@@ -66,7 +66,7 @@ Key entries use a fixed format of the form
.ne 2
.in +4
-\f\*[I-Font]keyno\f[] \f\*[I-Font]type\f[] \f\*[I-Font]key\f[]
+\f\*[I-Font]keyno\f[] \f\*[I-Font]type\f[] \f\*[I-Font]key\f[] \f\*[I-Font]opt_IP_list\f[]
.in -4
.sp \n(Ppu
.ne 2
@@ -78,7 +78,15 @@ is a positive integer (between 1 and 65534),
is the message digest algorithm,
and
\f\*[I-Font]key\f[]
-is the key itself.
+is the key itself, and
+\f\*[I-Font]opt_IP_list\f[]
+is an optional comma-separated list of IPs
+that are allowed to serve time.
+If
+\f\*[I-Font]opt_IP_list\f[]
+is empty,
+any properly-authenticated server message will be
+accepted.
.sp \n(Ppu
.ne 2
@@ -160,7 +168,7 @@ the default name of the configuration file
.SH "AUTHORS"
The University of Delaware and Network Time Foundation
.SH "COPYRIGHT"
-Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation all rights reserved.
+Copyright (C) 1992-2016 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 --git a/contrib/ntp/ntpd/ntp.keys.5mdoc b/contrib/ntp/ntpd/ntp.keys.5mdoc
index 9524989..6091e09 100644
--- a/contrib/ntp/ntpd/ntp.keys.5mdoc
+++ b/contrib/ntp/ntpd/ntp.keys.5mdoc
@@ -1,9 +1,9 @@
-.Dd January 7 2016
+.Dd January 20 2016
.Dt NTP_KEYS 5mdoc File Formats
.Os SunOS 5.10
.\" EDIT THIS FILE WITH CAUTION (ntp.mdoc)
.\"
-.\" It has been AutoGen-ed January 7, 2016 at 11:31:00 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed January 20, 2016 at 04:18:10 AM by AutoGen 5.18.5
.\" From the definitions ntp.keys.def
.\" and the template file agmdoc-file.tpl
.Sh NAME
@@ -44,7 +44,7 @@ The key file uses the same comment conventions
as the configuration file.
Key entries use a fixed format of the form
.Pp
-.D1 Ar keyno type key
+.D1 Ar keyno type key opt_IP_list
.Pp
where
.Ar keyno
@@ -53,7 +53,15 @@ is a positive integer (between 1 and 65534),
is the message digest algorithm,
and
.Ar key
-is the key itself.
+is the key itself, and
+.Ar opt_IP_list
+is an optional comma\-separated list of IPs
+that are allowed to serve time.
+If
+.Ar opt_IP_list
+is empty,
+any properly\-authenticated server message will be
+accepted.
.Pp
The
.Ar key
@@ -147,7 +155,7 @@ it to autogen\-users@lists.sourceforge.net. Thank you.
.Sh "AUTHORS"
The University of Delaware and Network Time Foundation
.Sh "COPYRIGHT"
-Copyright (C) 1992\-2015 The University of Delaware and Network Time Foundation all rights reserved.
+Copyright (C) 1992\-2016 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 --git a/contrib/ntp/ntpd/ntp.keys.def b/contrib/ntp/ntpd/ntp.keys.def
index dcb3d55..efe774c 100644
--- a/contrib/ntp/ntpd/ntp.keys.def
+++ b/contrib/ntp/ntpd/ntp.keys.def
@@ -43,7 +43,7 @@ The key file uses the same comment conventions
as the configuration file.
Key entries use a fixed format of the form
.Pp
-.D1 Ar keyno type key
+.D1 Ar keyno type key opt_IP_list
.Pp
where
.Ar keyno
@@ -52,7 +52,15 @@ is a positive integer (between 1 and 65534),
is the message digest algorithm,
and
.Ar key
-is the key itself.
+is the key itself, and
+.Ar opt_IP_list
+is an optional comma-separated list of IPs
+that are allowed to serve time.
+If
+.Ar opt_IP_list
+is empty,
+any properly-authenticated server message will be
+accepted.
.Pp
The
.Ar key
diff --git a/contrib/ntp/ntpd/ntp.keys.html b/contrib/ntp/ntpd/ntp.keys.html
index 738f9e0..409e7fc 100644
--- a/contrib/ntp/ntpd/ntp.keys.html
+++ b/contrib/ntp/ntpd/ntp.keys.html
@@ -33,7 +33,7 @@ Up:&nbsp;<a rel="up" accesskey="u" href="#dir">(dir)</a>
<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.8p5 of <code>ntp.keys</code>.
+ <p>This document applies to version 4.2.8p6 of <code>ntp.keys</code>.
<div class="shortcontents">
<h2>Short Contents</h2>
@@ -93,7 +93,7 @@ may be arbitrarily set in the keys file.
as the configuration file.
Key entries use a fixed format of the form
-<pre class="example"> <kbd>keyno</kbd> <kbd>type</kbd> <kbd>key</kbd>
+<pre class="example"> <kbd>keyno</kbd> <kbd>type</kbd> <kbd>key</kbd> <kbd>opt_IP_list</kbd>
</pre>
<p>where
<kbd>keyno</kbd>
@@ -102,7 +102,15 @@ is a positive integer (between 1 and 65534),
is the message digest algorithm,
and
<kbd>key</kbd>
-is the key itself.
+is the key itself, and
+<kbd>opt_IP_list</kbd>
+is an optional comma-separated list of IPs
+that are allowed to serve time.
+If
+<kbd>opt_IP_list</kbd>
+is empty,
+any properly-authenticated server message will be
+accepted.
<p>The
<kbd>key</kbd>
diff --git a/contrib/ntp/ntpd/ntp.keys.man.in b/contrib/ntp/ntpd/ntp.keys.man.in
index 78d5f09..2e97e27 100644
--- a/contrib/ntp/ntpd/ntp.keys.man.in
+++ b/contrib/ntp/ntpd/ntp.keys.man.in
@@ -1,8 +1,8 @@
-.TH ntp.keys 5 "07 Jan 2016" "4.2.8p5" "File Formats"
+.TH ntp.keys 5 "20 Jan 2016" "4.2.8p6" "File Formats"
.\"
.\" EDIT THIS FILE WITH CAUTION (ntp.man)
.\"
-.\" It has been AutoGen-ed January 7, 2016 at 11:30:41 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed January 20, 2016 at 04:17:51 AM by AutoGen 5.18.5
.\" From the definitions ntp.keys.def
.\" and the template file agman-file.tpl
.Sh NAME
@@ -66,7 +66,7 @@ Key entries use a fixed format of the form
.ne 2
.in +4
-\f\*[I-Font]keyno\f[] \f\*[I-Font]type\f[] \f\*[I-Font]key\f[]
+\f\*[I-Font]keyno\f[] \f\*[I-Font]type\f[] \f\*[I-Font]key\f[] \f\*[I-Font]opt_IP_list\f[]
.in -4
.sp \n(Ppu
.ne 2
@@ -78,7 +78,15 @@ is a positive integer (between 1 and 65534),
is the message digest algorithm,
and
\f\*[I-Font]key\f[]
-is the key itself.
+is the key itself, and
+\f\*[I-Font]opt_IP_list\f[]
+is an optional comma-separated list of IPs
+that are allowed to serve time.
+If
+\f\*[I-Font]opt_IP_list\f[]
+is empty,
+any properly-authenticated server message will be
+accepted.
.sp \n(Ppu
.ne 2
@@ -160,7 +168,7 @@ the default name of the configuration file
.SH "AUTHORS"
The University of Delaware and Network Time Foundation
.SH "COPYRIGHT"
-Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation all rights reserved.
+Copyright (C) 1992-2016 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 --git a/contrib/ntp/ntpd/ntp.keys.mdoc.in b/contrib/ntp/ntpd/ntp.keys.mdoc.in
index 40c821e..3b4fa2c 100644
--- a/contrib/ntp/ntpd/ntp.keys.mdoc.in
+++ b/contrib/ntp/ntpd/ntp.keys.mdoc.in
@@ -1,9 +1,9 @@
-.Dd January 7 2016
+.Dd January 20 2016
.Dt NTP_KEYS 5 File Formats
.Os SunOS 5.10
.\" EDIT THIS FILE WITH CAUTION (ntp.mdoc)
.\"
-.\" It has been AutoGen-ed January 7, 2016 at 11:31:00 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed January 20, 2016 at 04:18:10 AM by AutoGen 5.18.5
.\" From the definitions ntp.keys.def
.\" and the template file agmdoc-file.tpl
.Sh NAME
@@ -44,7 +44,7 @@ The key file uses the same comment conventions
as the configuration file.
Key entries use a fixed format of the form
.Pp
-.D1 Ar keyno type key
+.D1 Ar keyno type key opt_IP_list
.Pp
where
.Ar keyno
@@ -53,7 +53,15 @@ is a positive integer (between 1 and 65534),
is the message digest algorithm,
and
.Ar key
-is the key itself.
+is the key itself, and
+.Ar opt_IP_list
+is an optional comma\-separated list of IPs
+that are allowed to serve time.
+If
+.Ar opt_IP_list
+is empty,
+any properly\-authenticated server message will be
+accepted.
.Pp
The
.Ar key
@@ -147,7 +155,7 @@ it to autogen\-users@lists.sourceforge.net. Thank you.
.Sh "AUTHORS"
The University of Delaware and Network Time Foundation
.Sh "COPYRIGHT"
-Copyright (C) 1992\-2015 The University of Delaware and Network Time Foundation all rights reserved.
+Copyright (C) 1992\-2016 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 --git a/contrib/ntp/ntpd/ntp_config.c b/contrib/ntp/ntpd/ntp_config.c
index 1c754bd..cb32737 100644
--- a/contrib/ntp/ntpd/ntp_config.c
+++ b/contrib/ntp/ntpd/ntp_config.c
@@ -53,6 +53,8 @@
#include "ntp_parser.h"
#include "ntpd-opts.h"
+extern int yyparse(void);
+
/* Bug 2817 */
#if defined(HAVE_SYS_MMAN_H)
# include <sys/mman.h>
@@ -2981,6 +2983,18 @@ apply_enable_disable(
proto_config(PROTO_FILEGEN, enable, 0., NULL);
break;
+ case T_UEcrypto:
+ proto_config(PROTO_UECRYPTO, enable, 0., NULL);
+ break;
+
+ case T_UEcryptonak:
+ proto_config(PROTO_UECRYPTONAK, enable, 0., NULL);
+ break;
+
+ case T_UEdigest:
+ proto_config(PROTO_UEDIGEST, enable, 0., NULL);
+ break;
+
#ifdef BC_LIST_FRAMEWORK_NOT_YET_USED
case T_Bc_bugXXXX:
pentry = bc_list;
diff --git a/contrib/ntp/ntpd/ntp_control.c b/contrib/ntp/ntpd/ntp_control.c
index 2e174d0..e5a567e 100644
--- a/contrib/ntp/ntpd/ntp_control.c
+++ b/contrib/ntp/ntpd/ntp_control.c
@@ -75,6 +75,7 @@ static void ctl_putarray (const char *, double *, int);
static void ctl_putsys (int);
static void ctl_putpeer (int, struct peer *);
static void ctl_putfs (const char *, tstamp_t);
+static void ctl_printf (const char *, ...) NTP_PRINTF(1, 2);
#ifdef REFCLOCK
static void ctl_putclock (int, struct refclockstat *, int);
#endif /* REFCLOCK */
@@ -111,6 +112,8 @@ static void unset_trap (struct recvbuf *, int);
static struct ctl_trap *ctlfindtrap(sockaddr_u *,
struct interface *);
+int/*BOOL*/ is_safe_filename(const char * name);
+
static const struct ctl_proc control_codes[] = {
{ CTL_OP_UNSPEC, NOAUTH, control_unspec },
{ CTL_OP_READSTAT, NOAUTH, read_status },
@@ -873,10 +876,66 @@ ctl_error(
CTL_HEADER_LEN);
}
+int/*BOOL*/
+is_safe_filename(const char * name)
+{
+ /* We need a strict validation of filenames we should write: The
+ * daemon might run with special permissions and is remote
+ * controllable, so we better take care what we allow as file
+ * name!
+ *
+ * The first character must be digit or a letter from the ASCII
+ * base plane or a '_' ([_A-Za-z0-9]), the following characters
+ * must be from [-._+A-Za-z0-9].
+ *
+ * We do not trust the character classification much here: Since
+ * the NTP protocol makes no provisions for UTF-8 or local code
+ * pages, we strictly require the 7bit ASCII code page.
+ *
+ * The following table is a packed bit field of 128 two-bit
+ * groups. The LSB in each group tells us if a character is
+ * acceptable at the first position, the MSB if the character is
+ * accepted at any other position.
+ *
+ * This does not ensure that the file name is syntactically
+ * correct (multiple dots will not work with VMS...) but it will
+ * exclude potential globbing bombs and directory traversal. It
+ * also rules out drive selection. (For systems that have this
+ * notion, like Windows or VMS.)
+ */
+ static const uint32_t chclass[8] = {
+ 0x00000000, 0x00000000,
+ 0x28800000, 0x000FFFFF,
+ 0xFFFFFFFC, 0xC03FFFFF,
+ 0xFFFFFFFC, 0x003FFFFF
+ };
+
+ u_int widx, bidx, mask;
+ if (!*name)
+ return FALSE;
+
+ mask = 1u;
+ while (0 != (widx = (u_char)*name++)) {
+ bidx = (widx & 15) << 1;
+ widx = widx >> 4;
+ if (widx >= sizeof(chclass))
+ return FALSE;
+ if (0 == ((chclass[widx] >> bidx) & mask))
+ return FALSE;
+ mask |= 2u;
+ }
+ return TRUE;
+}
+
+
/*
* save_config - Implements ntpq -c "saveconfig <filename>"
* Writes current configuration including any runtime
* changes by ntpq's :config or config-from-file
+ *
+ * Note: There should be no buffer overflow or truncation in the
+ * processing of file names -- both cause security problems. This is bit
+ * painful to code but essential here.
*/
void
save_config(
@@ -904,24 +963,38 @@ save_config(
"\\/" /* separator and critical char for POSIX */
#endif
;
-
-
char reply[128];
#ifdef SAVECONFIG
+ static const char savedconfig_eq[] = "savedconfig=";
+
+ /* Build a safe open mode from the available mode flags. We want
+ * to create a new file and write it in text mode (when
+ * applicable -- only Windows does this...)
+ */
+ static const int openmode = O_CREAT | O_TRUNC | O_WRONLY
+# if defined(O_EXCL) /* posix, vms */
+ | O_EXCL
+# elif defined(_O_EXCL) /* windows is alway very special... */
+ | _O_EXCL
+# endif
+# if defined(_O_TEXT) /* windows, again */
+ | _O_TEXT
+#endif
+ ;
+
char filespec[128];
char filename[128];
char fullpath[512];
- const char savedconfig_eq[] = "savedconfig=";
char savedconfig[sizeof(savedconfig_eq) + sizeof(filename)];
time_t now;
int fd;
FILE *fptr;
+ int prc;
+ size_t reqlen;
#endif
if (RES_NOMODIFY & restrict_mask) {
- snprintf(reply, sizeof(reply),
- "saveconfig prohibited by restrict ... nomodify");
- ctl_putdata(reply, strlen(reply), 0);
+ ctl_printf("%s", "saveconfig prohibited by restrict ... nomodify");
ctl_flushpkt(0);
NLOG(NLOG_SYSINFO)
msyslog(LOG_NOTICE,
@@ -933,9 +1006,7 @@ save_config(
#ifdef SAVECONFIG
if (NULL == saveconfigdir) {
- snprintf(reply, sizeof(reply),
- "saveconfig prohibited, no saveconfigdir configured");
- ctl_putdata(reply, strlen(reply), 0);
+ ctl_printf("%s", "saveconfig prohibited, no saveconfigdir configured");
ctl_flushpkt(0);
NLOG(NLOG_SYSINFO)
msyslog(LOG_NOTICE,
@@ -944,21 +1015,79 @@ save_config(
return;
}
- if (0 == reqend - reqpt)
+ /* The length checking stuff gets serious. Do not assume a NUL
+ * byte can be found, but if so, use it to calculate the needed
+ * buffer size. If the available buffer is too short, bail out;
+ * likewise if there is no file spec. (The latter will not
+ * happen when using NTPQ, but there are other ways to craft a
+ * network packet!)
+ */
+ reqlen = (size_t)(reqend - reqpt);
+ if (0 != reqlen) {
+ char * nulpos = (char*)memchr(reqpt, 0, reqlen);
+ if (NULL != nulpos)
+ reqlen = (size_t)(nulpos - reqpt);
+ }
+ if (0 == reqlen)
return;
+ if (reqlen >= sizeof(filespec)) {
+ ctl_printf("saveconfig exceeded maximum raw name length (%u)",
+ (u_int)sizeof(filespec));
+ ctl_flushpkt(0);
+ msyslog(LOG_NOTICE,
+ "saveconfig exceeded maximum raw name length from %s",
+ stoa(&rbufp->recv_srcadr));
+ return;
+ }
- strlcpy(filespec, reqpt, sizeof(filespec));
- time(&now);
-
+ /* copy data directly as we exactly know the size */
+ memcpy(filespec, reqpt, reqlen);
+ filespec[reqlen] = '\0';
+
/*
* allow timestamping of the saved config filename with
* strftime() format such as:
* ntpq -c "saveconfig ntp-%Y%m%d-%H%M%S.conf"
* XXX: Nice feature, but not too safe.
+ * YYY: The check for permitted characters in file names should
+ * weed out the worst. Let's hope 'strftime()' does not
+ * develop pathological problems.
*/
+ time(&now);
if (0 == strftime(filename, sizeof(filename), filespec,
- localtime(&now)))
+ localtime(&now)))
+ {
+ /*
+ * If we arrive here, 'strftime()' balked; most likely
+ * the buffer was too short. (Or it encounterd an empty
+ * format, or just a format that expands to an empty
+ * string.) We try to use the original name, though this
+ * is very likely to fail later if there are format
+ * specs in the string. Note that truncation cannot
+ * happen here as long as both buffers have the same
+ * size!
+ */
strlcpy(filename, filespec, sizeof(filename));
+ }
+
+ /*
+ * Check the file name for sanity. This might/will rule out file
+ * names that would be legal but problematic, and it blocks
+ * directory traversal.
+ */
+ if (!is_safe_filename(filename)) {
+ ctl_printf("saveconfig rejects unsafe file name '%s'",
+ filename);
+ ctl_flushpkt(0);
+ msyslog(LOG_NOTICE,
+ "saveconfig rejects unsafe file name from %s",
+ stoa(&rbufp->recv_srcadr));
+ return;
+ }
+
+ /*
+ * XXX: This next test may not be needed with is_safe_filename()
+ */
/* block directory/drive traversal */
/* TALOS-CAN-0062: block directory traversal for VMS, too */
@@ -968,38 +1097,49 @@ save_config(
ctl_putdata(reply, strlen(reply), 0);
ctl_flushpkt(0);
msyslog(LOG_NOTICE,
- "saveconfig with path from %s rejected",
+ "saveconfig rejects unsafe file name from %s",
stoa(&rbufp->recv_srcadr));
return;
}
- snprintf(fullpath, sizeof(fullpath), "%s%s",
- saveconfigdir, filename);
+ /* concatenation of directory and path can cause another
+ * truncation...
+ */
+ prc = snprintf(fullpath, sizeof(fullpath), "%s%s",
+ saveconfigdir, filename);
+ if (prc < 0 || prc >= sizeof(fullpath)) {
+ ctl_printf("saveconfig exceeded maximum path length (%u)",
+ (u_int)sizeof(fullpath));
+ ctl_flushpkt(0);
+ msyslog(LOG_NOTICE,
+ "saveconfig exceeded maximum path length from %s",
+ stoa(&rbufp->recv_srcadr));
+ return;
+ }
- fd = open(fullpath, O_CREAT | O_TRUNC | O_WRONLY,
- S_IRUSR | S_IWUSR);
+ fd = open(fullpath, openmode, S_IRUSR | S_IWUSR);
if (-1 == fd)
fptr = NULL;
else
fptr = fdopen(fd, "w");
if (NULL == fptr || -1 == dump_all_config_trees(fptr, 1)) {
- snprintf(reply, sizeof(reply),
- "Unable to save configuration to file %s",
- filename);
+ ctl_printf("Unable to save configuration to file '%s': %m",
+ filename);
msyslog(LOG_ERR,
"saveconfig %s from %s failed", filename,
stoa(&rbufp->recv_srcadr));
} else {
- snprintf(reply, sizeof(reply),
- "Configuration saved to %s", filename);
+ ctl_printf("Configuration saved to '%s'", filename);
msyslog(LOG_NOTICE,
- "Configuration saved to %s (requested by %s)",
+ "Configuration saved to '%s' (requested by %s)",
fullpath, stoa(&rbufp->recv_srcadr));
/*
* save the output filename in system variable
* savedconfig, retrieved with:
* ntpq -c "rv 0 savedconfig"
+ * Note: the way 'savedconfig' is defined makes overflow
+ * checks unnecessary here.
*/
snprintf(savedconfig, sizeof(savedconfig), "%s%s",
savedconfig_eq, filename);
@@ -1009,11 +1149,9 @@ save_config(
if (NULL != fptr)
fclose(fptr);
#else /* !SAVECONFIG follows */
- snprintf(reply, sizeof(reply),
- "saveconfig unavailable, configured with --disable-saveconfig");
-#endif
-
- ctl_putdata(reply, strlen(reply), 0);
+ ctl_printf("%s",
+ "saveconfig unavailable, configured with --disable-saveconfig");
+#endif
ctl_flushpkt(0);
}
@@ -1757,6 +1895,29 @@ ctl_putarray(
ctl_putdata(buffer, (unsigned)(cp - buffer), 0);
}
+/*
+ * ctl_printf - put a formatted string into the data buffer
+ */
+static void
+ctl_printf(
+ const char * fmt,
+ ...
+ )
+{
+ static const char * ellipsis = "[...]";
+ va_list va;
+ char fmtbuf[128];
+ int rc;
+
+ va_start(va, fmt);
+ rc = vsnprintf(fmtbuf, sizeof(fmtbuf), fmt, va);
+ va_end(va);
+ if (rc < 0 || rc >= sizeof(fmtbuf))
+ strcpy(fmtbuf + sizeof(fmtbuf) - strlen(ellipsis) - 1,
+ ellipsis);
+ ctl_putdata(fmtbuf, strlen(fmtbuf), 0);
+}
+
/*
* ctl_putsys - output a system variable
diff --git a/contrib/ntp/ntpd/ntp_crypto.c b/contrib/ntp/ntpd/ntp_crypto.c
index 8574266..5b87f19 100644
--- a/contrib/ntp/ntpd/ntp_crypto.c
+++ b/contrib/ntp/ntpd/ntp_crypto.c
@@ -269,7 +269,7 @@ session_key(
memcpy(&keyid, dgst, 4);
keyid = ntohl(keyid);
if (lifetime != 0) {
- MD5auth_setkey(keyno, crypto_nid, dgst, len);
+ MD5auth_setkey(keyno, crypto_nid, dgst, len, NULL);
authtrust(keyno, lifetime);
}
DPRINTF(2, ("session_key: %s > %s %08x %08x hash %08x life %lu\n",
diff --git a/contrib/ntp/ntpd/ntp_io.c b/contrib/ntp/ntpd/ntp_io.c
index dd23459..ee52b1a 100644
--- a/contrib/ntp/ntpd/ntp_io.c
+++ b/contrib/ntp/ntpd/ntp_io.c
@@ -62,6 +62,9 @@
# endif
#endif
+#if defined(HAVE_SIGNALED_IO) && defined(DEBUG_TIMING)
+# undef DEBUG_TIMING
+#endif
/*
* setsockopt does not always have the same arg declaration
@@ -280,9 +283,12 @@ static int addr_samesubnet (const sockaddr_u *, const sockaddr_u *,
const sockaddr_u *, const sockaddr_u *);
static int create_sockets (u_short);
static SOCKET open_socket (sockaddr_u *, int, int, endpt *);
-static char * fdbits (int, fd_set *);
static void set_reuseaddr (int);
static isc_boolean_t socket_broadcast_enable (struct interface *, SOCKET, sockaddr_u *);
+
+#if !defined(HAVE_IO_COMPLETION_PORT) && !defined(HAVE_SIGNALED_IO)
+static char * fdbits (int, const fd_set *);
+#endif
#ifdef OS_MISSES_SPECIFIC_ROUTE_UPDATES
static isc_boolean_t socket_broadcast_disable (struct interface *, sockaddr_u *);
#endif
@@ -337,12 +343,15 @@ static int cmp_addr_distance(const sockaddr_u *,
#if !defined(HAVE_IO_COMPLETION_PORT)
static inline int read_network_packet (SOCKET, struct interface *, l_fp);
static void ntpd_addremove_io_fd (int, int, int);
-static input_handler_t input_handler;
+static void input_handler_scan (const l_fp*, const fd_set*);
+static int/*BOOL*/ sanitize_fdset (int errc);
#ifdef REFCLOCK
static inline int read_refclock_packet (SOCKET, struct refclockio *, l_fp);
#endif
+#ifdef HAVE_SIGNALED_IO
+static void input_handler (l_fp*);
+#endif
#endif
-
#ifndef HAVE_IO_COMPLETION_PORT
@@ -455,11 +464,9 @@ init_io(void)
addremove_io_fd = &ntpd_addremove_io_fd;
#endif
-#ifdef SYS_WINNT
+#if defined(SYS_WINNT)
init_io_completion_port();
-#endif
-
-#if defined(HAVE_SIGNALED_IO)
+#elif defined(HAVE_SIGNALED_IO)
(void) set_signal(input_handler);
#endif
}
@@ -475,7 +482,8 @@ ntpd_addremove_io_fd(
UNUSED_ARG(is_pipe);
#ifdef HAVE_SIGNALED_IO
- init_socket_sig(fd);
+ if (!remove_it)
+ init_socket_sig(fd);
#endif /* not HAVE_SIGNALED_IO */
maintain_activefds(fd, remove_it);
@@ -717,78 +725,6 @@ addr_samesubnet(
/*
- * Code to tell if we have an IP address
- * If we have then return the sockaddr structure
- * and set the return value
- * see the bind9/getaddresses.c for details
- */
-int
-is_ip_address(
- const char * host,
- u_short af,
- sockaddr_u * addr
- )
-{
- struct in_addr in4;
- struct addrinfo hints;
- struct addrinfo *result;
- struct sockaddr_in6 *resaddr6;
- char tmpbuf[128];
- char *pch;
-
- REQUIRE(host != NULL);
- REQUIRE(addr != NULL);
-
- ZERO_SOCK(addr);
-
- /*
- * Try IPv4, then IPv6. In order to handle the extended format
- * for IPv6 scoped addresses (address%scope_ID), we'll use a local
- * working buffer of 128 bytes. The length is an ad-hoc value, but
- * should be enough for this purpose; the buffer can contain a string
- * of at least 80 bytes for scope_ID in addition to any IPv6 numeric
- * addresses (up to 46 bytes), the delimiter character and the
- * terminating NULL character.
- */
- if (AF_UNSPEC == af || AF_INET == af)
- if (inet_pton(AF_INET, host, &in4) == 1) {
- AF(addr) = AF_INET;
- SET_ADDR4N(addr, in4.s_addr);
-
- return TRUE;
- }
-
- if (AF_UNSPEC == af || AF_INET6 == af)
- if (sizeof(tmpbuf) > strlen(host)) {
- if ('[' == host[0]) {
- strlcpy(tmpbuf, &host[1], sizeof(tmpbuf));
- pch = strchr(tmpbuf, ']');
- if (pch != NULL)
- *pch = '\0';
- } else {
- strlcpy(tmpbuf, host, sizeof(tmpbuf));
- }
- ZERO(hints);
- hints.ai_family = AF_INET6;
- hints.ai_flags |= AI_NUMERICHOST;
- if (getaddrinfo(tmpbuf, NULL, &hints, &result) == 0) {
- AF(addr) = AF_INET6;
- resaddr6 = UA_PTR(struct sockaddr_in6, result->ai_addr);
- SET_ADDR6N(addr, resaddr6->sin6_addr);
- SET_SCOPE(addr, resaddr6->sin6_scope_id);
-
- freeaddrinfo(result);
- return TRUE;
- }
- }
- /*
- * If we got here it was not an IP address
- */
- return FALSE;
-}
-
-
-/*
* interface list enumerator - visitor pattern
*/
void
@@ -2354,6 +2290,7 @@ get_broadcastclient_flag(void)
{
return (broadcast_client_enabled);
}
+
/*
* Check to see if the address is a multicast address
*/
@@ -3204,15 +3141,15 @@ sendpkt(
}
-#if !defined(HAVE_IO_COMPLETION_PORT)
+#if !defined(HAVE_IO_COMPLETION_PORT) && !defined(HAVE_SIGNALED_IO)
/*
* fdbits - generate ascii representation of fd_set (FAU debug support)
* HFDF format - highest fd first.
*/
static char *
fdbits(
- int count,
- fd_set *set
+ int count,
+ const fd_set* set
)
{
static char buffer[256];
@@ -3228,7 +3165,7 @@ fdbits(
return buffer;
}
-
+#endif
#ifdef REFCLOCK
/*
@@ -3265,7 +3202,7 @@ read_refclock_packet(
/* TALOS-CAN-0064: avoid signed/unsigned clashes that can lead
* to buffer overrun and memory corruption
*/
- if (rp->datalen <= 0 || rp->datalen > sizeof(rb->recv_space))
+ if (rp->datalen <= 0 || (size_t)rp->datalen > sizeof(rb->recv_space))
read_count = sizeof(rb->recv_space);
else
read_count = (u_int)rp->datalen;
@@ -3582,6 +3519,7 @@ io_handler(void)
* and - lacking a hardware reference clock - I have
* yet to learn about anything else that is.
*/
+ ++handler_calls;
rdfdes = activefds;
# if !defined(VMS) && !defined(SYS_VXWORKS)
nfound = select(maxactivefd + 1, &rdfdes, NULL,
@@ -3590,20 +3528,29 @@ io_handler(void)
/* make select() wake up after one second */
{
struct timeval t1;
-
- t1.tv_sec = 1;
+ t1.tv_sec = 1;
t1.tv_usec = 0;
nfound = select(maxactivefd + 1,
&rdfdes, NULL, NULL,
&t1);
}
# endif /* VMS, VxWorks */
+ if (nfound < 0 && sanitize_fdset(errno)) {
+ struct timeval t1;
+ t1.tv_sec = 0;
+ t1.tv_usec = 0;
+ rdfdes = activefds;
+ nfound = select(maxactivefd + 1,
+ &rdfdes, NULL, NULL,
+ &t1);
+ }
+
if (nfound > 0) {
l_fp ts;
get_systime(&ts);
- input_handler(&ts);
+ input_handler_scan(&ts, &rdfdes);
} else if (nfound == -1 && errno != EINTR) {
msyslog(LOG_ERR, "select() error: %m");
}
@@ -3619,46 +3566,22 @@ io_handler(void)
# endif /* HAVE_SIGNALED_IO */
}
+#ifdef HAVE_SIGNALED_IO
/*
* input_handler - receive packets asynchronously
+ *
+ * ALWAYS IN SIGNAL HANDLER CONTEXT -- only async-safe functions allowed!
*/
-static void
+static RETSIGTYPE
input_handler(
l_fp * cts
)
{
- int buflen;
int n;
- u_int idx;
- int doing;
- SOCKET fd;
- blocking_child *c;
struct timeval tvzero;
- l_fp ts; /* Timestamp at BOselect() gob */
-#ifdef DEBUG_TIMING
- l_fp ts_e; /* Timestamp at EOselect() gob */
-#endif
fd_set fds;
- size_t select_count;
- endpt * ep;
-#ifdef REFCLOCK
- struct refclockio *rp;
- int saved_errno;
- const char * clk;
-#endif
-#ifdef HAS_ROUTING_SOCKET
- struct asyncio_reader * asyncio_reader;
- struct asyncio_reader * next_asyncio_reader;
-#endif
-
- handler_calls++;
- select_count = 0;
-
- /*
- * If we have something to do, freeze a timestamp.
- * See below for the other cases (nothing left to do or error)
- */
- ts = *cts;
+
+ ++handler_calls;
/*
* Do a poll to see who has data
@@ -3668,82 +3591,133 @@ input_handler(
tvzero.tv_sec = tvzero.tv_usec = 0;
n = select(maxactivefd + 1, &fds, NULL, NULL, &tvzero);
+ if (n < 0 && sanitize_fdset(errno)) {
+ fds = activefds;
+ tvzero.tv_sec = tvzero.tv_usec = 0;
+ n = select(maxactivefd + 1, &fds, NULL, NULL, &tvzero);
+ }
+ if (n > 0)
+ input_handler_scan(cts, &fds);
+}
+#endif /* HAVE_SIGNALED_IO */
+
+
+/*
+ * Try to sanitize the global FD set
+ *
+ * SIGNAL HANDLER CONTEXT if HAVE_SIGNALED_IO, ordinary userspace otherwise
+ */
+static int/*BOOL*/
+sanitize_fdset(
+ int errc
+ )
+{
+ int j, b, maxscan;
+# ifndef HAVE_SIGNALED_IO
/*
- * If there are no packets waiting just return
+ * extended FAU debugging output
*/
- if (n < 0) {
- int err = errno;
- int j, b, prior;
- /*
- * extended FAU debugging output
- */
- if (err != EINTR)
- msyslog(LOG_ERR,
- "select(%d, %s, 0L, 0L, &0.0) error: %m",
- maxactivefd + 1,
- fdbits(maxactivefd, &activefds));
- if (err != EBADF)
- goto ih_return;
- for (j = 0, prior = 0; j <= maxactivefd; j++) {
- if (FD_ISSET(j, &activefds)) {
- if (-1 != read(j, &b, 0)) {
- prior = j;
- continue;
- }
- msyslog(LOG_ERR,
- "Removing bad file descriptor %d from select set",
- j);
- FD_CLR(j, &activefds);
- if (j == maxactivefd)
- maxactivefd = prior;
+ if (errc != EINTR) {
+ msyslog(LOG_ERR,
+ "select(%d, %s, 0L, 0L, &0.0) error: %m",
+ maxactivefd + 1,
+ fdbits(maxactivefd, &activefds));
+ }
+# endif
+
+ if (errc != EBADF)
+ return FALSE;
+
+ /* if we have oviously bad FDs, try to sanitize the FD set. */
+ for (j = 0, maxscan = 0; j <= maxactivefd; j++) {
+ if (FD_ISSET(j, &activefds)) {
+ if (-1 != read(j, &b, 0)) {
+ maxscan = j;
+ continue;
}
+# ifndef HAVE_SIGNALED_IO
+ msyslog(LOG_ERR,
+ "Removing bad file descriptor %d from select set",
+ j);
+# endif
+ FD_CLR(j, &activefds);
}
- goto ih_return;
}
- else if (n == 0)
- goto ih_return;
+ if (maxactivefd != maxscan)
+ maxactivefd = maxscan;
+ return TRUE;
+}
+
+/*
+ * scan the known FDs (clocks, servers, ...) for presence in a 'fd_set'.
+ *
+ * SIGNAL HANDLER CONTEXT if HAVE_SIGNALED_IO, ordinary userspace otherwise
+ */
+static void
+input_handler_scan(
+ const l_fp * cts,
+ const fd_set * pfds
+ )
+{
+ int buflen;
+ u_int idx;
+ int doing;
+ SOCKET fd;
+ blocking_child *c;
+ l_fp ts; /* Timestamp at BOselect() gob */
+
+#if defined(DEBUG_TIMING)
+ l_fp ts_e; /* Timestamp at EOselect() gob */
+#endif
+ endpt * ep;
+#ifdef REFCLOCK
+ struct refclockio *rp;
+ int saved_errno;
+ const char * clk;
+#endif
+#ifdef HAS_ROUTING_SOCKET
+ struct asyncio_reader * asyncio_reader;
+ struct asyncio_reader * next_asyncio_reader;
+#endif
++handler_pkts;
+ ts = *cts;
#ifdef REFCLOCK
/*
* Check out the reference clocks first, if any
*/
-
- if (refio != NULL) {
- for (rp = refio; rp != NULL; rp = rp->next) {
- fd = rp->fd;
-
- if (!FD_ISSET(fd, &fds))
- continue;
- ++select_count;
- buflen = read_refclock_packet(fd, rp, ts);
- /*
- * The first read must succeed after select()
- * indicates readability, or we've reached
- * a permanent EOF. http://bugs.ntp.org/1732
- * reported ntpd munching CPU after a USB GPS
- * was unplugged because select was indicating
- * EOF but ntpd didn't remove the descriptor
- * from the activefds set.
- */
- if (buflen < 0 && EAGAIN != errno) {
- saved_errno = errno;
- clk = refnumtoa(&rp->srcclock->srcadr);
- errno = saved_errno;
- msyslog(LOG_ERR, "%s read: %m", clk);
- maintain_activefds(fd, TRUE);
- } else if (0 == buflen) {
- clk = refnumtoa(&rp->srcclock->srcadr);
- msyslog(LOG_ERR, "%s read EOF", clk);
- maintain_activefds(fd, TRUE);
- } else {
- /* drain any remaining refclock input */
- do {
- buflen = read_refclock_packet(fd, rp, ts);
- } while (buflen > 0);
- }
+
+ for (rp = refio; rp != NULL; rp = rp->next) {
+ fd = rp->fd;
+
+ if (!FD_ISSET(fd, pfds))
+ continue;
+ buflen = read_refclock_packet(fd, rp, ts);
+ /*
+ * The first read must succeed after select() indicates
+ * readability, or we've reached a permanent EOF.
+ * http://bugs.ntp.org/1732 reported ntpd munching CPU
+ * after a USB GPS was unplugged because select was
+ * indicating EOF but ntpd didn't remove the descriptor
+ * from the activefds set.
+ */
+ if (buflen < 0 && EAGAIN != errno) {
+ saved_errno = errno;
+ clk = refnumtoa(&rp->srcclock->srcadr);
+ errno = saved_errno;
+ msyslog(LOG_ERR, "%s read: %m", clk);
+ maintain_activefds(fd, TRUE);
+ } else if (0 == buflen) {
+ clk = refnumtoa(&rp->srcclock->srcadr);
+ msyslog(LOG_ERR, "%s read EOF", clk);
+ maintain_activefds(fd, TRUE);
+ } else {
+ /* drain any remaining refclock input */
+ do {
+ buflen = read_refclock_packet(fd, rp, ts);
+ } while (buflen > 0);
}
}
#endif /* REFCLOCK */
@@ -3762,9 +3736,8 @@ input_handler(
}
if (fd < 0)
continue;
- if (FD_ISSET(fd, &fds))
+ if (FD_ISSET(fd, pfds))
do {
- ++select_count;
buflen = read_network_packet(
fd, ep, ts);
} while (buflen > 0);
@@ -3781,10 +3754,8 @@ input_handler(
while (asyncio_reader != NULL) {
/* callback may unlink and free asyncio_reader */
next_asyncio_reader = asyncio_reader->link;
- if (FD_ISSET(asyncio_reader->fd, &fds)) {
- ++select_count;
+ if (FD_ISSET(asyncio_reader->fd, pfds))
(*asyncio_reader->receiver)(asyncio_reader);
- }
asyncio_reader = next_asyncio_reader;
}
#endif /* HAS_ROUTING_SOCKET */
@@ -3796,26 +3767,14 @@ input_handler(
c = blocking_children[idx];
if (NULL == c || -1 == c->resp_read_pipe)
continue;
- if (FD_ISSET(c->resp_read_pipe, &fds)) {
- select_count++;
- process_blocking_resp(c);
+ if (FD_ISSET(c->resp_read_pipe, pfds)) {
+ ++c->resp_ready_seen;
+ ++blocking_child_ready_seen;
}
}
- /*
- * Done everything from that select.
- * If nothing to do, just return.
- * If an error occurred, complain and return.
- */
- if (select_count == 0) { /* We really had nothing to do */
-#ifdef DEBUG
- if (debug)
- msyslog(LOG_DEBUG, "input_handler: select() returned 0");
-#endif /* DEBUG */
- goto ih_return;
- }
/* We've done our work */
-#ifdef DEBUG_TIMING
+#if defined(DEBUG_TIMING)
get_systime(&ts_e);
/*
* (ts_e - ts) is the amount of time we spent
@@ -3829,11 +3788,7 @@ input_handler(
"input_handler: Processed a gob of fd's in %s msec",
lfptoms(&ts_e, 6));
#endif /* DEBUG_TIMING */
- /* We're done... */
- ih_return:
- return;
}
-#endif /* !HAVE_IO_COMPLETION_PORT */
/*
diff --git a/contrib/ntp/ntpd/ntp_keyword.h b/contrib/ntp/ntpd/ntp_keyword.h
index 0a593f6..c726c60 100644
--- a/contrib/ntp/ntpd/ntp_keyword.h
+++ b/contrib/ntp/ntpd/ntp_keyword.h
@@ -2,7 +2,7 @@
* ntp_keyword.h
*
* NOTE: edit this file with caution, it is generated by keyword-gen.c
- * Generated 2015-06-25 03:57:00 UTC diff_ignore_line
+ * Generated 2016-01-16 08:33:03 UTC diff_ignore_line
*
*/
#include "ntp_scanner.h"
@@ -10,7 +10,7 @@
#define LOWEST_KEYWORD_ID 258
-const char * const keyword_text[191] = {
+const char * const keyword_text[194] = {
/* 0 258 T_Abbrev */ "abbrev",
/* 1 259 T_Age */ "age",
/* 2 260 T_All */ "all",
@@ -182,31 +182,34 @@ const char * const keyword_text[191] = {
/* 168 426 T_Ttl */ "ttl",
/* 169 427 T_Type */ "type",
/* 170 428 T_U_int */ NULL,
- /* 171 429 T_Unconfig */ "unconfig",
- /* 172 430 T_Unpeer */ "unpeer",
- /* 173 431 T_Version */ "version",
- /* 174 432 T_WanderThreshold */ NULL,
- /* 175 433 T_Week */ "week",
- /* 176 434 T_Wildcard */ "wildcard",
- /* 177 435 T_Xleave */ "xleave",
- /* 178 436 T_Year */ "year",
- /* 179 437 T_Flag */ NULL,
- /* 180 438 T_EOC */ NULL,
- /* 181 439 T_Simulate */ "simulate",
- /* 182 440 T_Beep_Delay */ "beep_delay",
- /* 183 441 T_Sim_Duration */ "simulation_duration",
- /* 184 442 T_Server_Offset */ "server_offset",
- /* 185 443 T_Duration */ "duration",
- /* 186 444 T_Freq_Offset */ "freq_offset",
- /* 187 445 T_Wander */ "wander",
- /* 188 446 T_Jitter */ "jitter",
- /* 189 447 T_Prop_Delay */ "prop_delay",
- /* 190 448 T_Proc_Delay */ "proc_delay"
+ /* 171 429 T_UEcrypto */ "unpeer_crypto_early",
+ /* 172 430 T_UEcryptonak */ "unpeer_crypto_nak_early",
+ /* 173 431 T_UEdigest */ "unpeer_digest_early",
+ /* 174 432 T_Unconfig */ "unconfig",
+ /* 175 433 T_Unpeer */ "unpeer",
+ /* 176 434 T_Version */ "version",
+ /* 177 435 T_WanderThreshold */ NULL,
+ /* 178 436 T_Week */ "week",
+ /* 179 437 T_Wildcard */ "wildcard",
+ /* 180 438 T_Xleave */ "xleave",
+ /* 181 439 T_Year */ "year",
+ /* 182 440 T_Flag */ NULL,
+ /* 183 441 T_EOC */ NULL,
+ /* 184 442 T_Simulate */ "simulate",
+ /* 185 443 T_Beep_Delay */ "beep_delay",
+ /* 186 444 T_Sim_Duration */ "simulation_duration",
+ /* 187 445 T_Server_Offset */ "server_offset",
+ /* 188 446 T_Duration */ "duration",
+ /* 189 447 T_Freq_Offset */ "freq_offset",
+ /* 190 448 T_Wander */ "wander",
+ /* 191 449 T_Jitter */ "jitter",
+ /* 192 450 T_Prop_Delay */ "prop_delay",
+ /* 193 451 T_Proc_Delay */ "proc_delay"
};
-#define SCANNER_INIT_S 853
+#define SCANNER_INIT_S 887
-const scan_state sst[856] = {
+const scan_state sst[890] = {
/*SS_T( ch, f-by, match, other ), */
0, /* 0 */
S_ST( '-', 3, 323, 0 ), /* 1 */
@@ -252,7 +255,7 @@ const scan_state sst[856] = {
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, 440, 0 ), /* 44 beep_del */
+ S_ST( 'a', 3, 443, 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 */
@@ -352,7 +355,7 @@ const scan_state sst[856] = {
S_ST( 'a', 3, 142, 0 ), /* 141 dur */
S_ST( 't', 3, 143, 0 ), /* 142 dura */
S_ST( 'i', 3, 144, 0 ), /* 143 durat */
- S_ST( 'o', 3, 443, 0 ), /* 144 durati */
+ S_ST( 'o', 3, 446, 0 ), /* 144 durati */
S_ST( 'e', 3, 146, 105 ), /* 145 */
S_ST( 'n', 3, 293, 0 ), /* 146 e */
S_ST( 'a', 3, 148, 0 ), /* 147 en */
@@ -378,7 +381,7 @@ const scan_state sst[856] = {
S_ST( 'f', 3, 168, 0 ), /* 167 freq_o */
S_ST( 'f', 3, 169, 0 ), /* 168 freq_of */
S_ST( 's', 3, 170, 0 ), /* 169 freq_off */
- S_ST( 'e', 3, 444, 0 ), /* 170 freq_offs */
+ S_ST( 'e', 3, 447, 0 ), /* 170 freq_offs */
S_ST( 'u', 3, 172, 163 ), /* 171 f */
S_ST( 'd', 3, 173, 0 ), /* 172 fu */
S_ST( 'g', 3, 305, 0 ), /* 173 fud */
@@ -438,7 +441,7 @@ const scan_state sst[856] = {
S_ST( 'i', 3, 228, 0 ), /* 227 j */
S_ST( 't', 3, 229, 0 ), /* 228 ji */
S_ST( 't', 3, 230, 0 ), /* 229 jit */
- S_ST( 'e', 3, 446, 0 ), /* 230 jitt */
+ S_ST( 'e', 3, 449, 0 ), /* 230 jitt */
S_ST( 'k', 3, 238, 226 ), /* 231 */
S_ST( 'e', 3, 325, 0 ), /* 232 k */
S_ST( 'r', 3, 234, 0 ), /* 233 ke */
@@ -447,7 +450,7 @@ const scan_state sst[856] = {
S_ST( 'd', 3, 237, 0 ), /* 236 keys */
S_ST( 'i', 3, 327, 0 ), /* 237 keysd */
S_ST( 'o', 3, 328, 232 ), /* 238 k */
- S_ST( 'l', 3, 449, 231 ), /* 239 */
+ S_ST( 'l', 3, 452, 231 ), /* 239 */
S_ST( 'e', 3, 241, 0 ), /* 240 l */
S_ST( 'a', 3, 242, 0 ), /* 241 le */
S_ST( 'p', 3, 246, 0 ), /* 242 lea */
@@ -495,7 +498,7 @@ const scan_state sst[856] = {
S_ST( 'e', 0, 0, 0 ), /* 284 T_Disable */
S_ST( 'd', 0, 0, 0 ), /* 285 T_Discard */
S_ST( 'n', 0, 0, 0 ), /* 286 T_Dispersion */
- S_ST( 'i', 3, 432, 240 ), /* 287 l */
+ S_ST( 'i', 3, 435, 240 ), /* 287 l */
S_ST( 'e', 1, 0, 0 ), /* 288 T_Driftfile */
S_ST( 'p', 0, 0, 0 ), /* 289 T_Drop */
S_ST( 'p', 0, 0, 0 ), /* 290 T_Dscp */
@@ -557,7 +560,7 @@ const scan_state sst[856] = {
S_ST( 'm', 0, 0, 0 ), /* 346 T_Maxmem */
S_ST( 'l', 0, 0, 0 ), /* 347 T_Maxpoll */
S_ST( 's', 0, 0, 0 ), /* 348 T_Mdnstries */
- S_ST( 'm', 0, 518, 0 ), /* 349 T_Mem */
+ S_ST( 'm', 0, 521, 0 ), /* 349 T_Mem */
S_ST( 'k', 0, 0, 0 ), /* 350 T_Memlock */
S_ST( 'k', 0, 0, 0 ), /* 351 T_Minclock */
S_ST( 'h', 0, 0, 0 ), /* 352 T_Mindepth */
@@ -583,23 +586,23 @@ const scan_state sst[856] = {
S_ST( 'e', 0, 0, 0 ), /* 372 T_Noserve */
S_ST( 'p', 0, 0, 0 ), /* 373 T_Notrap */
S_ST( 't', 0, 0, 0 ), /* 374 T_Notrust */
- S_ST( 'p', 0, 614, 0 ), /* 375 T_Ntp */
+ S_ST( 'p', 0, 617, 0 ), /* 375 T_Ntp */
S_ST( 't', 0, 0, 0 ), /* 376 T_Ntpport */
S_ST( 't', 1, 0, 0 ), /* 377 T_NtpSignDsocket */
- S_ST( 'n', 0, 629, 0 ), /* 378 T_Orphan */
+ S_ST( 'n', 0, 632, 0 ), /* 378 T_Orphan */
S_ST( 't', 0, 0, 0 ), /* 379 T_Orphanwait */
S_ST( 'c', 0, 0, 0 ), /* 380 T_Panic */
- S_ST( 'r', 1, 638, 0 ), /* 381 T_Peer */
+ S_ST( 'r', 1, 641, 0 ), /* 381 T_Peer */
S_ST( 's', 0, 0, 0 ), /* 382 T_Peerstats */
S_ST( 'e', 2, 0, 0 ), /* 383 T_Phone */
- S_ST( 'd', 0, 646, 0 ), /* 384 T_Pid */
+ S_ST( 'd', 0, 649, 0 ), /* 384 T_Pid */
S_ST( 'e', 1, 0, 0 ), /* 385 T_Pidfile */
S_ST( 'l', 1, 0, 0 ), /* 386 T_Pool */
S_ST( 't', 0, 0, 0 ), /* 387 T_Port */
S_ST( 't', 0, 0, 0 ), /* 388 T_Preempt */
S_ST( 'r', 0, 0, 0 ), /* 389 T_Prefer */
S_ST( 's', 0, 0, 0 ), /* 390 T_Protostats */
- S_ST( 'w', 1, 0, 652 ), /* 391 T_Pw */
+ S_ST( 'w', 1, 0, 655 ), /* 391 T_Pw */
S_ST( 'e', 1, 0, 0 ), /* 392 T_Randfile */
S_ST( 's', 0, 0, 0 ), /* 393 T_Rawstats */
S_ST( 'd', 1, 0, 0 ), /* 394 T_Refid */
@@ -609,20 +612,20 @@ const scan_state sst[856] = {
S_ST( 'e', 0, 0, 0 ), /* 398 T_Revoke */
S_ST( 't', 0, 0, 0 ), /* 399 T_Rlimit */
S_ST( 'r', 1, 0, 0 ), /* 400 T_Saveconfigdir */
- S_ST( 'r', 1, 729, 0 ), /* 401 T_Server */
+ S_ST( 'r', 1, 732, 0 ), /* 401 T_Server */
S_ST( 'r', 1, 0, 0 ), /* 402 T_Setvar */
S_ST( 'e', 0, 0, 0 ), /* 403 T_Source */
S_ST( 'e', 0, 0, 0 ), /* 404 T_Stacksize */
S_ST( 's', 0, 0, 0 ), /* 405 T_Statistics */
- S_ST( 's', 0, 772, 767 ), /* 406 T_Stats */
+ S_ST( 's', 0, 775, 770 ), /* 406 T_Stats */
S_ST( 'r', 1, 0, 0 ), /* 407 T_Statsdir */
- S_ST( 'p', 0, 780, 0 ), /* 408 T_Step */
+ S_ST( 'p', 0, 783, 0 ), /* 408 T_Step */
S_ST( 'k', 0, 0, 0 ), /* 409 T_Stepback */
S_ST( 'd', 0, 0, 0 ), /* 410 T_Stepfwd */
S_ST( 't', 0, 0, 0 ), /* 411 T_Stepout */
S_ST( 'm', 0, 0, 0 ), /* 412 T_Stratum */
S_ST( 'e', 3, 332, 0 ), /* 413 limit */
- S_ST( 's', 0, 787, 0 ), /* 414 T_Sys */
+ S_ST( 's', 0, 790, 0 ), /* 414 T_Sys */
S_ST( 's', 0, 0, 0 ), /* 415 T_Sysstats */
S_ST( 'k', 0, 0, 0 ), /* 416 T_Tick */
S_ST( '1', 0, 0, 0 ), /* 417 T_Time1 */
@@ -637,432 +640,466 @@ const scan_state sst[856] = {
S_ST( 'l', 0, 0, 0 ), /* 426 T_Ttl */
S_ST( 'e', 0, 0, 0 ), /* 427 T_Type */
S_ST( 'n', 3, 333, 294 ), /* 428 li */
- S_ST( 'g', 1, 0, 0 ), /* 429 T_Unconfig */
- S_ST( 'r', 1, 0, 0 ), /* 430 T_Unpeer */
- S_ST( 'n', 0, 0, 0 ), /* 431 T_Version */
- S_ST( 's', 3, 437, 428 ), /* 432 li */
- S_ST( 'k', 0, 0, 0 ), /* 433 T_Week */
- S_ST( 'd', 0, 0, 0 ), /* 434 T_Wildcard */
- S_ST( 'e', 0, 0, 0 ), /* 435 T_Xleave */
- S_ST( 'r', 0, 0, 0 ), /* 436 T_Year */
- S_ST( 't', 3, 438, 0 ), /* 437 lis */
- S_ST( 'e', 3, 334, 0 ), /* 438 list */
- S_ST( 'e', 0, 0, 0 ), /* 439 T_Simulate */
- S_ST( 'y', 0, 0, 0 ), /* 440 T_Beep_Delay */
- S_ST( 'n', 0, 0, 0 ), /* 441 T_Sim_Duration */
- S_ST( 't', 0, 0, 0 ), /* 442 T_Server_Offset */
- S_ST( 'n', 0, 0, 0 ), /* 443 T_Duration */
- S_ST( 't', 0, 0, 0 ), /* 444 T_Freq_Offset */
- S_ST( 'r', 0, 0, 0 ), /* 445 T_Wander */
- S_ST( 'r', 0, 0, 0 ), /* 446 T_Jitter */
- S_ST( 'y', 0, 0, 0 ), /* 447 T_Prop_Delay */
- S_ST( 'y', 0, 0, 0 ), /* 448 T_Proc_Delay */
- S_ST( 'o', 3, 465, 287 ), /* 449 l */
- S_ST( 'g', 3, 456, 0 ), /* 450 lo */
- S_ST( 'c', 3, 452, 0 ), /* 451 log */
- S_ST( 'o', 3, 453, 0 ), /* 452 logc */
- S_ST( 'n', 3, 454, 0 ), /* 453 logco */
- S_ST( 'f', 3, 455, 0 ), /* 454 logcon */
- S_ST( 'i', 3, 335, 0 ), /* 455 logconf */
- S_ST( 'f', 3, 457, 451 ), /* 456 log */
- S_ST( 'i', 3, 458, 0 ), /* 457 logf */
- S_ST( 'l', 3, 336, 0 ), /* 458 logfi */
- S_ST( 'o', 3, 460, 450 ), /* 459 lo */
- S_ST( 'p', 3, 461, 0 ), /* 460 loo */
- S_ST( 's', 3, 462, 0 ), /* 461 loop */
- S_ST( 't', 3, 463, 0 ), /* 462 loops */
- S_ST( 'a', 3, 464, 0 ), /* 463 loopst */
- S_ST( 't', 3, 337, 0 ), /* 464 loopsta */
- S_ST( 'w', 3, 466, 459 ), /* 465 lo */
- S_ST( 'p', 3, 467, 0 ), /* 466 low */
- S_ST( 'r', 3, 468, 0 ), /* 467 lowp */
- S_ST( 'i', 3, 469, 0 ), /* 468 lowpr */
- S_ST( 'o', 3, 470, 0 ), /* 469 lowpri */
- S_ST( 't', 3, 471, 0 ), /* 470 lowprio */
- S_ST( 'r', 3, 472, 0 ), /* 471 lowpriot */
- S_ST( 'a', 3, 338, 0 ), /* 472 lowpriotr */
- S_ST( 'm', 3, 554, 239 ), /* 473 */
- S_ST( 'a', 3, 492, 0 ), /* 474 m */
- S_ST( 'n', 3, 476, 0 ), /* 475 ma */
- S_ST( 'y', 3, 477, 0 ), /* 476 man */
- S_ST( 'c', 3, 478, 0 ), /* 477 many */
- S_ST( 'a', 3, 479, 0 ), /* 478 manyc */
- S_ST( 's', 3, 480, 0 ), /* 479 manyca */
- S_ST( 't', 3, 486, 0 ), /* 480 manycas */
- S_ST( 'c', 3, 482, 0 ), /* 481 manycast */
- S_ST( 'l', 3, 483, 0 ), /* 482 manycastc */
- S_ST( 'i', 3, 484, 0 ), /* 483 manycastcl */
- S_ST( 'e', 3, 485, 0 ), /* 484 manycastcli */
- S_ST( 'n', 3, 339, 0 ), /* 485 manycastclie */
- S_ST( 's', 3, 487, 481 ), /* 486 manycast */
- S_ST( 'e', 3, 488, 0 ), /* 487 manycasts */
- S_ST( 'r', 3, 489, 0 ), /* 488 manycastse */
- S_ST( 'v', 3, 490, 0 ), /* 489 manycastser */
- S_ST( 'e', 3, 340, 0 ), /* 490 manycastserv */
- S_ST( 's', 3, 341, 475 ), /* 491 ma */
- S_ST( 'x', 3, 507, 491 ), /* 492 ma */
- S_ST( 'a', 3, 494, 0 ), /* 493 max */
- S_ST( 'g', 3, 342, 0 ), /* 494 maxa */
- S_ST( 'c', 3, 496, 493 ), /* 495 max */
- S_ST( 'l', 3, 497, 0 ), /* 496 maxc */
- S_ST( 'o', 3, 498, 0 ), /* 497 maxcl */
- S_ST( 'c', 3, 343, 0 ), /* 498 maxclo */
- S_ST( 'd', 3, 503, 495 ), /* 499 max */
- S_ST( 'e', 3, 501, 0 ), /* 500 maxd */
- S_ST( 'p', 3, 502, 0 ), /* 501 maxde */
- S_ST( 't', 3, 344, 0 ), /* 502 maxdep */
- S_ST( 'i', 3, 504, 500 ), /* 503 maxd */
- S_ST( 's', 3, 345, 0 ), /* 504 maxdi */
- S_ST( 'm', 3, 506, 499 ), /* 505 max */
- S_ST( 'e', 3, 346, 0 ), /* 506 maxm */
- S_ST( 'p', 3, 508, 505 ), /* 507 max */
- S_ST( 'o', 3, 509, 0 ), /* 508 maxp */
- S_ST( 'l', 3, 347, 0 ), /* 509 maxpo */
- S_ST( 'd', 3, 511, 474 ), /* 510 m */
- S_ST( 'n', 3, 512, 0 ), /* 511 md */
- S_ST( 's', 3, 513, 0 ), /* 512 mdn */
- S_ST( 't', 3, 514, 0 ), /* 513 mdns */
- S_ST( 'r', 3, 515, 0 ), /* 514 mdnst */
- S_ST( 'i', 3, 516, 0 ), /* 515 mdnstr */
- S_ST( 'e', 3, 348, 0 ), /* 516 mdnstri */
- S_ST( 'e', 3, 349, 510 ), /* 517 m */
- S_ST( 'l', 3, 519, 0 ), /* 518 mem */
- S_ST( 'o', 3, 520, 0 ), /* 519 meml */
- S_ST( 'c', 3, 350, 0 ), /* 520 memlo */
- S_ST( 'i', 3, 522, 517 ), /* 521 m */
- S_ST( 'n', 3, 539, 0 ), /* 522 mi */
- S_ST( 'c', 3, 524, 0 ), /* 523 min */
- S_ST( 'l', 3, 525, 0 ), /* 524 minc */
- S_ST( 'o', 3, 526, 0 ), /* 525 mincl */
- S_ST( 'c', 3, 351, 0 ), /* 526 minclo */
- S_ST( 'd', 3, 531, 523 ), /* 527 min */
- S_ST( 'e', 3, 529, 0 ), /* 528 mind */
- S_ST( 'p', 3, 530, 0 ), /* 529 minde */
- S_ST( 't', 3, 352, 0 ), /* 530 mindep */
- S_ST( 'i', 3, 532, 528 ), /* 531 mind */
- S_ST( 's', 3, 353, 0 ), /* 532 mindi */
- S_ST( 'i', 3, 534, 527 ), /* 533 min */
- S_ST( 'm', 3, 535, 0 ), /* 534 mini */
- S_ST( 'u', 3, 354, 0 ), /* 535 minim */
- S_ST( 'p', 3, 537, 533 ), /* 536 min */
- S_ST( 'o', 3, 538, 0 ), /* 537 minp */
- S_ST( 'l', 3, 355, 0 ), /* 538 minpo */
- S_ST( 's', 3, 540, 536 ), /* 539 min */
- S_ST( 'a', 3, 541, 0 ), /* 540 mins */
- S_ST( 'n', 3, 356, 0 ), /* 541 minsa */
- S_ST( 'o', 3, 544, 521 ), /* 542 m */
- S_ST( 'd', 3, 357, 0 ), /* 543 mo */
- S_ST( 'n', 3, 548, 543 ), /* 544 mo */
- S_ST( 'i', 3, 546, 0 ), /* 545 mon */
- S_ST( 't', 3, 547, 0 ), /* 546 moni */
- S_ST( 'o', 3, 359, 0 ), /* 547 monit */
- S_ST( 't', 3, 360, 545 ), /* 548 mon */
- S_ST( 'r', 3, 361, 542 ), /* 549 m */
- S_ST( 's', 3, 551, 549 ), /* 550 m */
- S_ST( 's', 3, 552, 0 ), /* 551 ms */
- S_ST( 'n', 3, 553, 0 ), /* 552 mss */
- S_ST( 't', 3, 329, 0 ), /* 553 mssn */
- S_ST( 'u', 3, 555, 550 ), /* 554 m */
- S_ST( 'l', 3, 556, 0 ), /* 555 mu */
- S_ST( 't', 3, 557, 0 ), /* 556 mul */
- S_ST( 'i', 3, 558, 0 ), /* 557 mult */
- S_ST( 'c', 3, 559, 0 ), /* 558 multi */
- S_ST( 'a', 3, 560, 0 ), /* 559 multic */
- S_ST( 's', 3, 561, 0 ), /* 560 multica */
- S_ST( 't', 3, 562, 0 ), /* 561 multicas */
- S_ST( 'c', 3, 563, 0 ), /* 562 multicast */
- S_ST( 'l', 3, 564, 0 ), /* 563 multicastc */
- S_ST( 'i', 3, 565, 0 ), /* 564 multicastcl */
- S_ST( 'e', 3, 566, 0 ), /* 565 multicastcli */
- S_ST( 'n', 3, 362, 0 ), /* 566 multicastclie */
- S_ST( 'n', 3, 610, 473 ), /* 567 */
- S_ST( 'i', 3, 363, 0 ), /* 568 n */
- S_ST( 'o', 3, 605, 568 ), /* 569 n */
- S_ST( 'l', 3, 571, 0 ), /* 570 no */
- S_ST( 'i', 3, 572, 0 ), /* 571 nol */
- S_ST( 'n', 3, 364, 0 ), /* 572 noli */
- S_ST( 'm', 3, 578, 570 ), /* 573 no */
- S_ST( 'o', 3, 575, 0 ), /* 574 nom */
- S_ST( 'd', 3, 576, 0 ), /* 575 nomo */
- S_ST( 'i', 3, 577, 0 ), /* 576 nomod */
- S_ST( 'f', 3, 365, 0 ), /* 577 nomodi */
- S_ST( 'r', 3, 579, 574 ), /* 578 nom */
- S_ST( 'u', 3, 580, 0 ), /* 579 nomr */
- S_ST( 'l', 3, 581, 0 ), /* 580 nomru */
- S_ST( 'i', 3, 582, 0 ), /* 581 nomrul */
- S_ST( 's', 3, 366, 0 ), /* 582 nomruli */
- S_ST( 'n', 3, 584, 573 ), /* 583 no */
- S_ST( 'v', 3, 585, 367 ), /* 584 non */
- S_ST( 'o', 3, 586, 0 ), /* 585 nonv */
- S_ST( 'l', 3, 587, 0 ), /* 586 nonvo */
- S_ST( 'a', 3, 588, 0 ), /* 587 nonvol */
- S_ST( 't', 3, 589, 0 ), /* 588 nonvola */
- S_ST( 'i', 3, 590, 0 ), /* 589 nonvolat */
- S_ST( 'l', 3, 368, 0 ), /* 590 nonvolati */
- S_ST( 'p', 3, 592, 583 ), /* 591 no */
- S_ST( 'e', 3, 593, 0 ), /* 592 nop */
- S_ST( 'e', 3, 369, 0 ), /* 593 nope */
- S_ST( 'q', 3, 595, 591 ), /* 594 no */
- S_ST( 'u', 3, 596, 0 ), /* 595 noq */
- S_ST( 'e', 3, 597, 0 ), /* 596 noqu */
- S_ST( 'r', 3, 370, 0 ), /* 597 noque */
- S_ST( 's', 3, 599, 594 ), /* 598 no */
- S_ST( 'e', 3, 603, 0 ), /* 599 nos */
- S_ST( 'l', 3, 601, 0 ), /* 600 nose */
- S_ST( 'e', 3, 602, 0 ), /* 601 nosel */
- S_ST( 'c', 3, 371, 0 ), /* 602 nosele */
- S_ST( 'r', 3, 604, 600 ), /* 603 nose */
- S_ST( 'v', 3, 372, 0 ), /* 604 noser */
- S_ST( 't', 3, 606, 598 ), /* 605 no */
- S_ST( 'r', 3, 608, 0 ), /* 606 not */
- S_ST( 'a', 3, 373, 0 ), /* 607 notr */
- S_ST( 'u', 3, 609, 607 ), /* 608 notr */
- S_ST( 's', 3, 374, 0 ), /* 609 notru */
- S_ST( 't', 3, 375, 569 ), /* 610 n */
- S_ST( 'p', 3, 612, 0 ), /* 611 ntp */
- S_ST( 'o', 3, 613, 0 ), /* 612 ntpp */
- S_ST( 'r', 3, 376, 0 ), /* 613 ntppo */
- S_ST( 's', 3, 615, 611 ), /* 614 ntp */
- S_ST( 'i', 3, 616, 0 ), /* 615 ntps */
- S_ST( 'g', 3, 617, 0 ), /* 616 ntpsi */
- S_ST( 'n', 3, 618, 0 ), /* 617 ntpsig */
- S_ST( 'd', 3, 619, 0 ), /* 618 ntpsign */
- S_ST( 's', 3, 620, 0 ), /* 619 ntpsignd */
- S_ST( 'o', 3, 621, 0 ), /* 620 ntpsignds */
- S_ST( 'c', 3, 622, 0 ), /* 621 ntpsigndso */
- S_ST( 'k', 3, 623, 0 ), /* 622 ntpsigndsoc */
- S_ST( 'e', 3, 377, 0 ), /* 623 ntpsigndsock */
- S_ST( 'o', 3, 625, 567 ), /* 624 */
- S_ST( 'r', 3, 626, 0 ), /* 625 o */
- S_ST( 'p', 3, 627, 0 ), /* 626 or */
- S_ST( 'h', 3, 628, 0 ), /* 627 orp */
- S_ST( 'a', 3, 378, 0 ), /* 628 orph */
- S_ST( 'w', 3, 630, 0 ), /* 629 orphan */
- S_ST( 'a', 3, 631, 0 ), /* 630 orphanw */
- S_ST( 'i', 3, 379, 0 ), /* 631 orphanwa */
- S_ST( 'p', 3, 391, 624 ), /* 632 */
- S_ST( 'a', 3, 634, 0 ), /* 633 p */
- S_ST( 'n', 3, 635, 0 ), /* 634 pa */
- S_ST( 'i', 3, 380, 0 ), /* 635 pan */
- S_ST( 'e', 3, 637, 633 ), /* 636 p */
- S_ST( 'e', 3, 381, 0 ), /* 637 pe */
- S_ST( 's', 3, 639, 0 ), /* 638 peer */
- S_ST( 't', 3, 640, 0 ), /* 639 peers */
- S_ST( 'a', 3, 641, 0 ), /* 640 peerst */
- S_ST( 't', 3, 382, 0 ), /* 641 peersta */
- S_ST( 'h', 3, 643, 636 ), /* 642 p */
- S_ST( 'o', 3, 644, 0 ), /* 643 ph */
- S_ST( 'n', 3, 383, 0 ), /* 644 pho */
- S_ST( 'i', 3, 384, 642 ), /* 645 p */
- S_ST( 'f', 3, 647, 0 ), /* 646 pid */
- S_ST( 'i', 3, 648, 0 ), /* 647 pidf */
- S_ST( 'l', 3, 385, 0 ), /* 648 pidfi */
- S_ST( 'o', 3, 651, 645 ), /* 649 p */
- S_ST( 'o', 3, 386, 0 ), /* 650 po */
- S_ST( 'r', 3, 387, 650 ), /* 651 po */
- S_ST( 'r', 3, 659, 649 ), /* 652 p */
- S_ST( 'e', 3, 657, 0 ), /* 653 pr */
- S_ST( 'e', 3, 655, 0 ), /* 654 pre */
- S_ST( 'm', 3, 656, 0 ), /* 655 pree */
- S_ST( 'p', 3, 388, 0 ), /* 656 preem */
- S_ST( 'f', 3, 658, 654 ), /* 657 pre */
- S_ST( 'e', 3, 389, 0 ), /* 658 pref */
- S_ST( 'o', 3, 672, 653 ), /* 659 pr */
- S_ST( 'c', 3, 661, 0 ), /* 660 pro */
- S_ST( '_', 3, 662, 0 ), /* 661 proc */
- S_ST( 'd', 3, 663, 0 ), /* 662 proc_ */
- S_ST( 'e', 3, 664, 0 ), /* 663 proc_d */
- S_ST( 'l', 3, 665, 0 ), /* 664 proc_de */
- S_ST( 'a', 3, 448, 0 ), /* 665 proc_del */
- S_ST( 'p', 3, 667, 660 ), /* 666 pro */
- S_ST( '_', 3, 668, 0 ), /* 667 prop */
- S_ST( 'd', 3, 669, 0 ), /* 668 prop_ */
- S_ST( 'e', 3, 670, 0 ), /* 669 prop_d */
- S_ST( 'l', 3, 671, 0 ), /* 670 prop_de */
- S_ST( 'a', 3, 447, 0 ), /* 671 prop_del */
- S_ST( 't', 3, 673, 666 ), /* 672 pro */
- S_ST( 'o', 3, 674, 0 ), /* 673 prot */
- S_ST( 's', 3, 675, 0 ), /* 674 proto */
- S_ST( 't', 3, 676, 0 ), /* 675 protos */
- S_ST( 'a', 3, 677, 0 ), /* 676 protost */
- S_ST( 't', 3, 390, 0 ), /* 677 protosta */
- S_ST( 'r', 3, 709, 632 ), /* 678 */
- S_ST( 'a', 3, 685, 0 ), /* 679 r */
- S_ST( 'n', 3, 681, 0 ), /* 680 ra */
- S_ST( 'd', 3, 682, 0 ), /* 681 ran */
- S_ST( 'f', 3, 683, 0 ), /* 682 rand */
- S_ST( 'i', 3, 684, 0 ), /* 683 randf */
- S_ST( 'l', 3, 392, 0 ), /* 684 randfi */
- S_ST( 'w', 3, 686, 680 ), /* 685 ra */
- S_ST( 's', 3, 687, 0 ), /* 686 raw */
- S_ST( 't', 3, 688, 0 ), /* 687 raws */
- S_ST( 'a', 3, 689, 0 ), /* 688 rawst */
- S_ST( 't', 3, 393, 0 ), /* 689 rawsta */
- S_ST( 'e', 3, 706, 679 ), /* 690 r */
- S_ST( 'f', 3, 692, 0 ), /* 691 re */
- S_ST( 'i', 3, 394, 0 ), /* 692 ref */
- S_ST( 'q', 3, 694, 691 ), /* 693 re */
- S_ST( 'u', 3, 695, 0 ), /* 694 req */
- S_ST( 'e', 3, 696, 0 ), /* 695 requ */
- S_ST( 's', 3, 697, 0 ), /* 696 reque */
- S_ST( 't', 3, 698, 0 ), /* 697 reques */
- S_ST( 'k', 3, 699, 0 ), /* 698 request */
- S_ST( 'e', 3, 395, 0 ), /* 699 requestk */
- S_ST( 's', 3, 702, 693 ), /* 700 re */
- S_ST( 'e', 3, 396, 0 ), /* 701 res */
- S_ST( 't', 3, 703, 701 ), /* 702 res */
- S_ST( 'r', 3, 704, 0 ), /* 703 rest */
- S_ST( 'i', 3, 705, 0 ), /* 704 restr */
- S_ST( 'c', 3, 397, 0 ), /* 705 restri */
- S_ST( 'v', 3, 707, 700 ), /* 706 re */
- S_ST( 'o', 3, 708, 0 ), /* 707 rev */
- S_ST( 'k', 3, 398, 0 ), /* 708 revo */
- S_ST( 'l', 3, 710, 690 ), /* 709 r */
- S_ST( 'i', 3, 711, 0 ), /* 710 rl */
- S_ST( 'm', 3, 712, 0 ), /* 711 rli */
- S_ST( 'i', 3, 399, 0 ), /* 712 rlim */
- S_ST( 's', 3, 786, 678 ), /* 713 */
- S_ST( 'a', 3, 715, 0 ), /* 714 s */
- S_ST( 'v', 3, 716, 0 ), /* 715 sa */
- S_ST( 'e', 3, 717, 0 ), /* 716 sav */
- S_ST( 'c', 3, 718, 0 ), /* 717 save */
- S_ST( 'o', 3, 719, 0 ), /* 718 savec */
- S_ST( 'n', 3, 720, 0 ), /* 719 saveco */
- S_ST( 'f', 3, 721, 0 ), /* 720 savecon */
- S_ST( 'i', 3, 722, 0 ), /* 721 saveconf */
- S_ST( 'g', 3, 723, 0 ), /* 722 saveconfi */
- S_ST( 'd', 3, 724, 0 ), /* 723 saveconfig */
- S_ST( 'i', 3, 400, 0 ), /* 724 saveconfigd */
- S_ST( 'e', 3, 735, 714 ), /* 725 s */
- S_ST( 'r', 3, 727, 0 ), /* 726 se */
- S_ST( 'v', 3, 728, 0 ), /* 727 ser */
- S_ST( 'e', 3, 401, 0 ), /* 728 serv */
- S_ST( '_', 3, 730, 0 ), /* 729 server */
- S_ST( 'o', 3, 731, 0 ), /* 730 server_ */
- S_ST( 'f', 3, 732, 0 ), /* 731 server_o */
- S_ST( 'f', 3, 733, 0 ), /* 732 server_of */
- S_ST( 's', 3, 734, 0 ), /* 733 server_off */
- S_ST( 'e', 3, 442, 0 ), /* 734 server_offs */
- S_ST( 't', 3, 736, 726 ), /* 735 se */
- S_ST( 'v', 3, 737, 0 ), /* 736 set */
- S_ST( 'a', 3, 402, 0 ), /* 737 setv */
- S_ST( 'i', 3, 739, 725 ), /* 738 s */
- S_ST( 'm', 3, 740, 0 ), /* 739 si */
- S_ST( 'u', 3, 741, 0 ), /* 740 sim */
- S_ST( 'l', 3, 742, 0 ), /* 741 simu */
- S_ST( 'a', 3, 743, 0 ), /* 742 simul */
- S_ST( 't', 3, 744, 0 ), /* 743 simula */
- S_ST( 'i', 3, 745, 439 ), /* 744 simulat */
- S_ST( 'o', 3, 746, 0 ), /* 745 simulati */
- S_ST( 'n', 3, 747, 0 ), /* 746 simulatio */
- S_ST( '_', 3, 748, 0 ), /* 747 simulation */
- S_ST( 'd', 3, 749, 0 ), /* 748 simulation_ */
- S_ST( 'u', 3, 750, 0 ), /* 749 simulation_d */
- S_ST( 'r', 3, 751, 0 ), /* 750 simulation_du */
- S_ST( 'a', 3, 752, 0 ), /* 751 simulation_dur */
- S_ST( 't', 3, 753, 0 ), /* 752 simulation_dura */
- S_ST( 'i', 3, 754, 0 ), /* 753 simulation_durat */
- S_ST( 'o', 3, 441, 0 ), /* 754 simulation_durati */
- S_ST( 'o', 3, 756, 738 ), /* 755 s */
- S_ST( 'u', 3, 757, 0 ), /* 756 so */
- S_ST( 'r', 3, 758, 0 ), /* 757 sou */
- S_ST( 'c', 3, 403, 0 ), /* 758 sour */
- S_ST( 't', 3, 782, 755 ), /* 759 s */
- S_ST( 'a', 3, 766, 0 ), /* 760 st */
- S_ST( 'c', 3, 762, 0 ), /* 761 sta */
- S_ST( 'k', 3, 763, 0 ), /* 762 stac */
- S_ST( 's', 3, 764, 0 ), /* 763 stack */
- S_ST( 'i', 3, 765, 0 ), /* 764 stacks */
- S_ST( 'z', 3, 404, 0 ), /* 765 stacksi */
- S_ST( 't', 3, 406, 761 ), /* 766 sta */
- S_ST( 'i', 3, 768, 0 ), /* 767 stat */
- S_ST( 's', 3, 769, 0 ), /* 768 stati */
- S_ST( 't', 3, 770, 0 ), /* 769 statis */
- S_ST( 'i', 3, 771, 0 ), /* 770 statist */
- S_ST( 'c', 3, 405, 0 ), /* 771 statisti */
- S_ST( 'd', 3, 773, 0 ), /* 772 stats */
- S_ST( 'i', 3, 407, 0 ), /* 773 statsd */
- S_ST( 'e', 3, 408, 760 ), /* 774 st */
- S_ST( 'b', 3, 776, 0 ), /* 775 step */
- S_ST( 'a', 3, 777, 0 ), /* 776 stepb */
- S_ST( 'c', 3, 409, 0 ), /* 777 stepba */
- S_ST( 'f', 3, 779, 775 ), /* 778 step */
- S_ST( 'w', 3, 410, 0 ), /* 779 stepf */
- S_ST( 'o', 3, 781, 778 ), /* 780 step */
- S_ST( 'u', 3, 411, 0 ), /* 781 stepo */
- S_ST( 'r', 3, 783, 774 ), /* 782 st */
- S_ST( 'a', 3, 784, 0 ), /* 783 str */
- S_ST( 't', 3, 785, 0 ), /* 784 stra */
- S_ST( 'u', 3, 412, 0 ), /* 785 strat */
- S_ST( 'y', 3, 414, 759 ), /* 786 s */
- S_ST( 's', 3, 788, 0 ), /* 787 sys */
- S_ST( 't', 3, 789, 0 ), /* 788 syss */
- S_ST( 'a', 3, 790, 0 ), /* 789 sysst */
- S_ST( 't', 3, 415, 0 ), /* 790 syssta */
- S_ST( 't', 3, 817, 713 ), /* 791 */
- S_ST( 'i', 3, 803, 0 ), /* 792 t */
- S_ST( 'c', 3, 416, 0 ), /* 793 ti */
- S_ST( 'm', 3, 796, 793 ), /* 794 ti */
- S_ST( 'e', 3, 419, 0 ), /* 795 tim */
- S_ST( 'i', 3, 797, 795 ), /* 796 tim */
- S_ST( 'n', 3, 798, 0 ), /* 797 timi */
- S_ST( 'g', 3, 799, 0 ), /* 798 timin */
- S_ST( 's', 3, 800, 0 ), /* 799 timing */
- S_ST( 't', 3, 801, 0 ), /* 800 timings */
- S_ST( 'a', 3, 802, 0 ), /* 801 timingst */
- S_ST( 't', 3, 420, 0 ), /* 802 timingsta */
- S_ST( 'n', 3, 804, 794 ), /* 803 ti */
- S_ST( 'k', 3, 805, 0 ), /* 804 tin */
- S_ST( 'e', 3, 421, 0 ), /* 805 tink */
- S_ST( 'o', 3, 422, 792 ), /* 806 t */
- S_ST( 'r', 3, 809, 806 ), /* 807 t */
- S_ST( 'a', 3, 423, 0 ), /* 808 tr */
- S_ST( 'u', 3, 810, 808 ), /* 809 tr */
- S_ST( 's', 3, 811, 424 ), /* 810 tru */
- S_ST( 't', 3, 812, 0 ), /* 811 trus */
- S_ST( 'e', 3, 813, 0 ), /* 812 trust */
- S_ST( 'd', 3, 814, 0 ), /* 813 truste */
- S_ST( 'k', 3, 815, 0 ), /* 814 trusted */
- S_ST( 'e', 3, 425, 0 ), /* 815 trustedk */
- S_ST( 't', 3, 426, 807 ), /* 816 t */
- S_ST( 'y', 3, 818, 816 ), /* 817 t */
- S_ST( 'p', 3, 427, 0 ), /* 818 ty */
- S_ST( 'u', 3, 820, 791 ), /* 819 */
- S_ST( 'n', 3, 826, 0 ), /* 820 u */
- S_ST( 'c', 3, 822, 0 ), /* 821 un */
- S_ST( 'o', 3, 823, 0 ), /* 822 unc */
- S_ST( 'n', 3, 824, 0 ), /* 823 unco */
- S_ST( 'f', 3, 825, 0 ), /* 824 uncon */
- S_ST( 'i', 3, 429, 0 ), /* 825 unconf */
- S_ST( 'p', 3, 827, 821 ), /* 826 un */
- S_ST( 'e', 3, 828, 0 ), /* 827 unp */
- S_ST( 'e', 3, 430, 0 ), /* 828 unpe */
- S_ST( 'v', 3, 830, 819 ), /* 829 */
- S_ST( 'e', 3, 831, 0 ), /* 830 v */
- S_ST( 'r', 3, 832, 0 ), /* 831 ve */
- S_ST( 's', 3, 833, 0 ), /* 832 ver */
- S_ST( 'i', 3, 834, 0 ), /* 833 vers */
- S_ST( 'o', 3, 431, 0 ), /* 834 versi */
- S_ST( 'w', 3, 842, 829 ), /* 835 */
- S_ST( 'a', 3, 837, 0 ), /* 836 w */
- S_ST( 'n', 3, 838, 0 ), /* 837 wa */
- S_ST( 'd', 3, 839, 0 ), /* 838 wan */
- S_ST( 'e', 3, 445, 0 ), /* 839 wand */
- S_ST( 'e', 3, 841, 836 ), /* 840 w */
- S_ST( 'e', 3, 433, 0 ), /* 841 we */
- S_ST( 'i', 3, 843, 840 ), /* 842 w */
- S_ST( 'l', 3, 844, 0 ), /* 843 wi */
- S_ST( 'd', 3, 845, 0 ), /* 844 wil */
- S_ST( 'c', 3, 846, 0 ), /* 845 wild */
- S_ST( 'a', 3, 847, 0 ), /* 846 wildc */
- S_ST( 'r', 3, 434, 0 ), /* 847 wildca */
- S_ST( 'x', 3, 849, 835 ), /* 848 */
- S_ST( 'l', 3, 850, 0 ), /* 849 x */
- S_ST( 'e', 3, 851, 0 ), /* 850 xl */
- S_ST( 'a', 3, 852, 0 ), /* 851 xle */
- S_ST( 'v', 3, 435, 0 ), /* 852 xlea */
- S_ST( 'y', 3, 854, 848 ), /* 853 [initial state] */
- S_ST( 'e', 3, 855, 0 ), /* 854 y */
- S_ST( 'a', 3, 436, 0 ) /* 855 ye */
+ S_ST( 'y', 0, 0, 0 ), /* 429 T_UEcrypto */
+ S_ST( 'y', 0, 0, 0 ), /* 430 T_UEcryptonak */
+ S_ST( 'y', 0, 0, 0 ), /* 431 T_UEdigest */
+ S_ST( 'g', 1, 0, 0 ), /* 432 T_Unconfig */
+ S_ST( 'r', 1, 832, 0 ), /* 433 T_Unpeer */
+ S_ST( 'n', 0, 0, 0 ), /* 434 T_Version */
+ S_ST( 's', 3, 440, 428 ), /* 435 li */
+ S_ST( 'k', 0, 0, 0 ), /* 436 T_Week */
+ S_ST( 'd', 0, 0, 0 ), /* 437 T_Wildcard */
+ S_ST( 'e', 0, 0, 0 ), /* 438 T_Xleave */
+ S_ST( 'r', 0, 0, 0 ), /* 439 T_Year */
+ S_ST( 't', 3, 441, 0 ), /* 440 lis */
+ S_ST( 'e', 3, 334, 0 ), /* 441 list */
+ S_ST( 'e', 0, 0, 0 ), /* 442 T_Simulate */
+ S_ST( 'y', 0, 0, 0 ), /* 443 T_Beep_Delay */
+ S_ST( 'n', 0, 0, 0 ), /* 444 T_Sim_Duration */
+ S_ST( 't', 0, 0, 0 ), /* 445 T_Server_Offset */
+ S_ST( 'n', 0, 0, 0 ), /* 446 T_Duration */
+ S_ST( 't', 0, 0, 0 ), /* 447 T_Freq_Offset */
+ S_ST( 'r', 0, 0, 0 ), /* 448 T_Wander */
+ S_ST( 'r', 0, 0, 0 ), /* 449 T_Jitter */
+ S_ST( 'y', 0, 0, 0 ), /* 450 T_Prop_Delay */
+ S_ST( 'y', 0, 0, 0 ), /* 451 T_Proc_Delay */
+ S_ST( 'o', 3, 468, 287 ), /* 452 l */
+ S_ST( 'g', 3, 459, 0 ), /* 453 lo */
+ S_ST( 'c', 3, 455, 0 ), /* 454 log */
+ S_ST( 'o', 3, 456, 0 ), /* 455 logc */
+ S_ST( 'n', 3, 457, 0 ), /* 456 logco */
+ S_ST( 'f', 3, 458, 0 ), /* 457 logcon */
+ S_ST( 'i', 3, 335, 0 ), /* 458 logconf */
+ S_ST( 'f', 3, 460, 454 ), /* 459 log */
+ S_ST( 'i', 3, 461, 0 ), /* 460 logf */
+ S_ST( 'l', 3, 336, 0 ), /* 461 logfi */
+ S_ST( 'o', 3, 463, 453 ), /* 462 lo */
+ S_ST( 'p', 3, 464, 0 ), /* 463 loo */
+ S_ST( 's', 3, 465, 0 ), /* 464 loop */
+ S_ST( 't', 3, 466, 0 ), /* 465 loops */
+ S_ST( 'a', 3, 467, 0 ), /* 466 loopst */
+ S_ST( 't', 3, 337, 0 ), /* 467 loopsta */
+ S_ST( 'w', 3, 469, 462 ), /* 468 lo */
+ S_ST( 'p', 3, 470, 0 ), /* 469 low */
+ S_ST( 'r', 3, 471, 0 ), /* 470 lowp */
+ S_ST( 'i', 3, 472, 0 ), /* 471 lowpr */
+ S_ST( 'o', 3, 473, 0 ), /* 472 lowpri */
+ S_ST( 't', 3, 474, 0 ), /* 473 lowprio */
+ S_ST( 'r', 3, 475, 0 ), /* 474 lowpriot */
+ S_ST( 'a', 3, 338, 0 ), /* 475 lowpriotr */
+ S_ST( 'm', 3, 557, 239 ), /* 476 */
+ S_ST( 'a', 3, 495, 0 ), /* 477 m */
+ S_ST( 'n', 3, 479, 0 ), /* 478 ma */
+ S_ST( 'y', 3, 480, 0 ), /* 479 man */
+ S_ST( 'c', 3, 481, 0 ), /* 480 many */
+ S_ST( 'a', 3, 482, 0 ), /* 481 manyc */
+ S_ST( 's', 3, 483, 0 ), /* 482 manyca */
+ S_ST( 't', 3, 489, 0 ), /* 483 manycas */
+ S_ST( 'c', 3, 485, 0 ), /* 484 manycast */
+ S_ST( 'l', 3, 486, 0 ), /* 485 manycastc */
+ S_ST( 'i', 3, 487, 0 ), /* 486 manycastcl */
+ S_ST( 'e', 3, 488, 0 ), /* 487 manycastcli */
+ S_ST( 'n', 3, 339, 0 ), /* 488 manycastclie */
+ S_ST( 's', 3, 490, 484 ), /* 489 manycast */
+ S_ST( 'e', 3, 491, 0 ), /* 490 manycasts */
+ S_ST( 'r', 3, 492, 0 ), /* 491 manycastse */
+ S_ST( 'v', 3, 493, 0 ), /* 492 manycastser */
+ S_ST( 'e', 3, 340, 0 ), /* 493 manycastserv */
+ S_ST( 's', 3, 341, 478 ), /* 494 ma */
+ S_ST( 'x', 3, 510, 494 ), /* 495 ma */
+ S_ST( 'a', 3, 497, 0 ), /* 496 max */
+ S_ST( 'g', 3, 342, 0 ), /* 497 maxa */
+ S_ST( 'c', 3, 499, 496 ), /* 498 max */
+ S_ST( 'l', 3, 500, 0 ), /* 499 maxc */
+ S_ST( 'o', 3, 501, 0 ), /* 500 maxcl */
+ S_ST( 'c', 3, 343, 0 ), /* 501 maxclo */
+ S_ST( 'd', 3, 506, 498 ), /* 502 max */
+ S_ST( 'e', 3, 504, 0 ), /* 503 maxd */
+ S_ST( 'p', 3, 505, 0 ), /* 504 maxde */
+ S_ST( 't', 3, 344, 0 ), /* 505 maxdep */
+ S_ST( 'i', 3, 507, 503 ), /* 506 maxd */
+ S_ST( 's', 3, 345, 0 ), /* 507 maxdi */
+ S_ST( 'm', 3, 509, 502 ), /* 508 max */
+ S_ST( 'e', 3, 346, 0 ), /* 509 maxm */
+ S_ST( 'p', 3, 511, 508 ), /* 510 max */
+ S_ST( 'o', 3, 512, 0 ), /* 511 maxp */
+ S_ST( 'l', 3, 347, 0 ), /* 512 maxpo */
+ S_ST( 'd', 3, 514, 477 ), /* 513 m */
+ S_ST( 'n', 3, 515, 0 ), /* 514 md */
+ S_ST( 's', 3, 516, 0 ), /* 515 mdn */
+ S_ST( 't', 3, 517, 0 ), /* 516 mdns */
+ S_ST( 'r', 3, 518, 0 ), /* 517 mdnst */
+ S_ST( 'i', 3, 519, 0 ), /* 518 mdnstr */
+ S_ST( 'e', 3, 348, 0 ), /* 519 mdnstri */
+ S_ST( 'e', 3, 349, 513 ), /* 520 m */
+ S_ST( 'l', 3, 522, 0 ), /* 521 mem */
+ S_ST( 'o', 3, 523, 0 ), /* 522 meml */
+ S_ST( 'c', 3, 350, 0 ), /* 523 memlo */
+ S_ST( 'i', 3, 525, 520 ), /* 524 m */
+ S_ST( 'n', 3, 542, 0 ), /* 525 mi */
+ S_ST( 'c', 3, 527, 0 ), /* 526 min */
+ S_ST( 'l', 3, 528, 0 ), /* 527 minc */
+ S_ST( 'o', 3, 529, 0 ), /* 528 mincl */
+ S_ST( 'c', 3, 351, 0 ), /* 529 minclo */
+ S_ST( 'd', 3, 534, 526 ), /* 530 min */
+ S_ST( 'e', 3, 532, 0 ), /* 531 mind */
+ S_ST( 'p', 3, 533, 0 ), /* 532 minde */
+ S_ST( 't', 3, 352, 0 ), /* 533 mindep */
+ S_ST( 'i', 3, 535, 531 ), /* 534 mind */
+ S_ST( 's', 3, 353, 0 ), /* 535 mindi */
+ S_ST( 'i', 3, 537, 530 ), /* 536 min */
+ S_ST( 'm', 3, 538, 0 ), /* 537 mini */
+ S_ST( 'u', 3, 354, 0 ), /* 538 minim */
+ S_ST( 'p', 3, 540, 536 ), /* 539 min */
+ S_ST( 'o', 3, 541, 0 ), /* 540 minp */
+ S_ST( 'l', 3, 355, 0 ), /* 541 minpo */
+ S_ST( 's', 3, 543, 539 ), /* 542 min */
+ S_ST( 'a', 3, 544, 0 ), /* 543 mins */
+ S_ST( 'n', 3, 356, 0 ), /* 544 minsa */
+ S_ST( 'o', 3, 547, 524 ), /* 545 m */
+ S_ST( 'd', 3, 357, 0 ), /* 546 mo */
+ S_ST( 'n', 3, 551, 546 ), /* 547 mo */
+ S_ST( 'i', 3, 549, 0 ), /* 548 mon */
+ S_ST( 't', 3, 550, 0 ), /* 549 moni */
+ S_ST( 'o', 3, 359, 0 ), /* 550 monit */
+ S_ST( 't', 3, 360, 548 ), /* 551 mon */
+ S_ST( 'r', 3, 361, 545 ), /* 552 m */
+ S_ST( 's', 3, 554, 552 ), /* 553 m */
+ S_ST( 's', 3, 555, 0 ), /* 554 ms */
+ S_ST( 'n', 3, 556, 0 ), /* 555 mss */
+ S_ST( 't', 3, 329, 0 ), /* 556 mssn */
+ S_ST( 'u', 3, 558, 553 ), /* 557 m */
+ S_ST( 'l', 3, 559, 0 ), /* 558 mu */
+ S_ST( 't', 3, 560, 0 ), /* 559 mul */
+ S_ST( 'i', 3, 561, 0 ), /* 560 mult */
+ S_ST( 'c', 3, 562, 0 ), /* 561 multi */
+ S_ST( 'a', 3, 563, 0 ), /* 562 multic */
+ S_ST( 's', 3, 564, 0 ), /* 563 multica */
+ S_ST( 't', 3, 565, 0 ), /* 564 multicas */
+ S_ST( 'c', 3, 566, 0 ), /* 565 multicast */
+ S_ST( 'l', 3, 567, 0 ), /* 566 multicastc */
+ S_ST( 'i', 3, 568, 0 ), /* 567 multicastcl */
+ S_ST( 'e', 3, 569, 0 ), /* 568 multicastcli */
+ S_ST( 'n', 3, 362, 0 ), /* 569 multicastclie */
+ S_ST( 'n', 3, 613, 476 ), /* 570 */
+ S_ST( 'i', 3, 363, 0 ), /* 571 n */
+ S_ST( 'o', 3, 608, 571 ), /* 572 n */
+ S_ST( 'l', 3, 574, 0 ), /* 573 no */
+ S_ST( 'i', 3, 575, 0 ), /* 574 nol */
+ S_ST( 'n', 3, 364, 0 ), /* 575 noli */
+ S_ST( 'm', 3, 581, 573 ), /* 576 no */
+ S_ST( 'o', 3, 578, 0 ), /* 577 nom */
+ S_ST( 'd', 3, 579, 0 ), /* 578 nomo */
+ S_ST( 'i', 3, 580, 0 ), /* 579 nomod */
+ S_ST( 'f', 3, 365, 0 ), /* 580 nomodi */
+ S_ST( 'r', 3, 582, 577 ), /* 581 nom */
+ S_ST( 'u', 3, 583, 0 ), /* 582 nomr */
+ S_ST( 'l', 3, 584, 0 ), /* 583 nomru */
+ S_ST( 'i', 3, 585, 0 ), /* 584 nomrul */
+ S_ST( 's', 3, 366, 0 ), /* 585 nomruli */
+ S_ST( 'n', 3, 587, 576 ), /* 586 no */
+ S_ST( 'v', 3, 588, 367 ), /* 587 non */
+ S_ST( 'o', 3, 589, 0 ), /* 588 nonv */
+ S_ST( 'l', 3, 590, 0 ), /* 589 nonvo */
+ S_ST( 'a', 3, 591, 0 ), /* 590 nonvol */
+ S_ST( 't', 3, 592, 0 ), /* 591 nonvola */
+ S_ST( 'i', 3, 593, 0 ), /* 592 nonvolat */
+ S_ST( 'l', 3, 368, 0 ), /* 593 nonvolati */
+ S_ST( 'p', 3, 595, 586 ), /* 594 no */
+ S_ST( 'e', 3, 596, 0 ), /* 595 nop */
+ S_ST( 'e', 3, 369, 0 ), /* 596 nope */
+ S_ST( 'q', 3, 598, 594 ), /* 597 no */
+ S_ST( 'u', 3, 599, 0 ), /* 598 noq */
+ S_ST( 'e', 3, 600, 0 ), /* 599 noqu */
+ S_ST( 'r', 3, 370, 0 ), /* 600 noque */
+ S_ST( 's', 3, 602, 597 ), /* 601 no */
+ S_ST( 'e', 3, 606, 0 ), /* 602 nos */
+ S_ST( 'l', 3, 604, 0 ), /* 603 nose */
+ S_ST( 'e', 3, 605, 0 ), /* 604 nosel */
+ S_ST( 'c', 3, 371, 0 ), /* 605 nosele */
+ S_ST( 'r', 3, 607, 603 ), /* 606 nose */
+ S_ST( 'v', 3, 372, 0 ), /* 607 noser */
+ S_ST( 't', 3, 609, 601 ), /* 608 no */
+ S_ST( 'r', 3, 611, 0 ), /* 609 not */
+ S_ST( 'a', 3, 373, 0 ), /* 610 notr */
+ S_ST( 'u', 3, 612, 610 ), /* 611 notr */
+ S_ST( 's', 3, 374, 0 ), /* 612 notru */
+ S_ST( 't', 3, 375, 572 ), /* 613 n */
+ S_ST( 'p', 3, 615, 0 ), /* 614 ntp */
+ S_ST( 'o', 3, 616, 0 ), /* 615 ntpp */
+ S_ST( 'r', 3, 376, 0 ), /* 616 ntppo */
+ S_ST( 's', 3, 618, 614 ), /* 617 ntp */
+ S_ST( 'i', 3, 619, 0 ), /* 618 ntps */
+ S_ST( 'g', 3, 620, 0 ), /* 619 ntpsi */
+ S_ST( 'n', 3, 621, 0 ), /* 620 ntpsig */
+ S_ST( 'd', 3, 622, 0 ), /* 621 ntpsign */
+ S_ST( 's', 3, 623, 0 ), /* 622 ntpsignd */
+ S_ST( 'o', 3, 624, 0 ), /* 623 ntpsignds */
+ S_ST( 'c', 3, 625, 0 ), /* 624 ntpsigndso */
+ S_ST( 'k', 3, 626, 0 ), /* 625 ntpsigndsoc */
+ S_ST( 'e', 3, 377, 0 ), /* 626 ntpsigndsock */
+ S_ST( 'o', 3, 628, 570 ), /* 627 */
+ S_ST( 'r', 3, 629, 0 ), /* 628 o */
+ S_ST( 'p', 3, 630, 0 ), /* 629 or */
+ S_ST( 'h', 3, 631, 0 ), /* 630 orp */
+ S_ST( 'a', 3, 378, 0 ), /* 631 orph */
+ S_ST( 'w', 3, 633, 0 ), /* 632 orphan */
+ S_ST( 'a', 3, 634, 0 ), /* 633 orphanw */
+ S_ST( 'i', 3, 379, 0 ), /* 634 orphanwa */
+ S_ST( 'p', 3, 391, 627 ), /* 635 */
+ S_ST( 'a', 3, 637, 0 ), /* 636 p */
+ S_ST( 'n', 3, 638, 0 ), /* 637 pa */
+ S_ST( 'i', 3, 380, 0 ), /* 638 pan */
+ S_ST( 'e', 3, 640, 636 ), /* 639 p */
+ S_ST( 'e', 3, 381, 0 ), /* 640 pe */
+ S_ST( 's', 3, 642, 0 ), /* 641 peer */
+ S_ST( 't', 3, 643, 0 ), /* 642 peers */
+ S_ST( 'a', 3, 644, 0 ), /* 643 peerst */
+ S_ST( 't', 3, 382, 0 ), /* 644 peersta */
+ S_ST( 'h', 3, 646, 639 ), /* 645 p */
+ S_ST( 'o', 3, 647, 0 ), /* 646 ph */
+ S_ST( 'n', 3, 383, 0 ), /* 647 pho */
+ S_ST( 'i', 3, 384, 645 ), /* 648 p */
+ S_ST( 'f', 3, 650, 0 ), /* 649 pid */
+ S_ST( 'i', 3, 651, 0 ), /* 650 pidf */
+ S_ST( 'l', 3, 385, 0 ), /* 651 pidfi */
+ S_ST( 'o', 3, 654, 648 ), /* 652 p */
+ S_ST( 'o', 3, 386, 0 ), /* 653 po */
+ S_ST( 'r', 3, 387, 653 ), /* 654 po */
+ S_ST( 'r', 3, 662, 652 ), /* 655 p */
+ S_ST( 'e', 3, 660, 0 ), /* 656 pr */
+ S_ST( 'e', 3, 658, 0 ), /* 657 pre */
+ S_ST( 'm', 3, 659, 0 ), /* 658 pree */
+ S_ST( 'p', 3, 388, 0 ), /* 659 preem */
+ S_ST( 'f', 3, 661, 657 ), /* 660 pre */
+ S_ST( 'e', 3, 389, 0 ), /* 661 pref */
+ S_ST( 'o', 3, 675, 656 ), /* 662 pr */
+ S_ST( 'c', 3, 664, 0 ), /* 663 pro */
+ S_ST( '_', 3, 665, 0 ), /* 664 proc */
+ S_ST( 'd', 3, 666, 0 ), /* 665 proc_ */
+ S_ST( 'e', 3, 667, 0 ), /* 666 proc_d */
+ S_ST( 'l', 3, 668, 0 ), /* 667 proc_de */
+ S_ST( 'a', 3, 451, 0 ), /* 668 proc_del */
+ S_ST( 'p', 3, 670, 663 ), /* 669 pro */
+ S_ST( '_', 3, 671, 0 ), /* 670 prop */
+ S_ST( 'd', 3, 672, 0 ), /* 671 prop_ */
+ S_ST( 'e', 3, 673, 0 ), /* 672 prop_d */
+ S_ST( 'l', 3, 674, 0 ), /* 673 prop_de */
+ S_ST( 'a', 3, 450, 0 ), /* 674 prop_del */
+ S_ST( 't', 3, 676, 669 ), /* 675 pro */
+ S_ST( 'o', 3, 677, 0 ), /* 676 prot */
+ S_ST( 's', 3, 678, 0 ), /* 677 proto */
+ S_ST( 't', 3, 679, 0 ), /* 678 protos */
+ S_ST( 'a', 3, 680, 0 ), /* 679 protost */
+ S_ST( 't', 3, 390, 0 ), /* 680 protosta */
+ S_ST( 'r', 3, 712, 635 ), /* 681 */
+ S_ST( 'a', 3, 688, 0 ), /* 682 r */
+ S_ST( 'n', 3, 684, 0 ), /* 683 ra */
+ S_ST( 'd', 3, 685, 0 ), /* 684 ran */
+ S_ST( 'f', 3, 686, 0 ), /* 685 rand */
+ S_ST( 'i', 3, 687, 0 ), /* 686 randf */
+ S_ST( 'l', 3, 392, 0 ), /* 687 randfi */
+ S_ST( 'w', 3, 689, 683 ), /* 688 ra */
+ S_ST( 's', 3, 690, 0 ), /* 689 raw */
+ S_ST( 't', 3, 691, 0 ), /* 690 raws */
+ S_ST( 'a', 3, 692, 0 ), /* 691 rawst */
+ S_ST( 't', 3, 393, 0 ), /* 692 rawsta */
+ S_ST( 'e', 3, 709, 682 ), /* 693 r */
+ S_ST( 'f', 3, 695, 0 ), /* 694 re */
+ S_ST( 'i', 3, 394, 0 ), /* 695 ref */
+ S_ST( 'q', 3, 697, 694 ), /* 696 re */
+ S_ST( 'u', 3, 698, 0 ), /* 697 req */
+ S_ST( 'e', 3, 699, 0 ), /* 698 requ */
+ S_ST( 's', 3, 700, 0 ), /* 699 reque */
+ S_ST( 't', 3, 701, 0 ), /* 700 reques */
+ S_ST( 'k', 3, 702, 0 ), /* 701 request */
+ S_ST( 'e', 3, 395, 0 ), /* 702 requestk */
+ S_ST( 's', 3, 705, 696 ), /* 703 re */
+ S_ST( 'e', 3, 396, 0 ), /* 704 res */
+ S_ST( 't', 3, 706, 704 ), /* 705 res */
+ S_ST( 'r', 3, 707, 0 ), /* 706 rest */
+ S_ST( 'i', 3, 708, 0 ), /* 707 restr */
+ S_ST( 'c', 3, 397, 0 ), /* 708 restri */
+ S_ST( 'v', 3, 710, 703 ), /* 709 re */
+ S_ST( 'o', 3, 711, 0 ), /* 710 rev */
+ S_ST( 'k', 3, 398, 0 ), /* 711 revo */
+ S_ST( 'l', 3, 713, 693 ), /* 712 r */
+ S_ST( 'i', 3, 714, 0 ), /* 713 rl */
+ S_ST( 'm', 3, 715, 0 ), /* 714 rli */
+ S_ST( 'i', 3, 399, 0 ), /* 715 rlim */
+ S_ST( 's', 3, 789, 681 ), /* 716 */
+ S_ST( 'a', 3, 718, 0 ), /* 717 s */
+ S_ST( 'v', 3, 719, 0 ), /* 718 sa */
+ S_ST( 'e', 3, 720, 0 ), /* 719 sav */
+ S_ST( 'c', 3, 721, 0 ), /* 720 save */
+ S_ST( 'o', 3, 722, 0 ), /* 721 savec */
+ S_ST( 'n', 3, 723, 0 ), /* 722 saveco */
+ S_ST( 'f', 3, 724, 0 ), /* 723 savecon */
+ S_ST( 'i', 3, 725, 0 ), /* 724 saveconf */
+ S_ST( 'g', 3, 726, 0 ), /* 725 saveconfi */
+ S_ST( 'd', 3, 727, 0 ), /* 726 saveconfig */
+ S_ST( 'i', 3, 400, 0 ), /* 727 saveconfigd */
+ S_ST( 'e', 3, 738, 717 ), /* 728 s */
+ S_ST( 'r', 3, 730, 0 ), /* 729 se */
+ S_ST( 'v', 3, 731, 0 ), /* 730 ser */
+ S_ST( 'e', 3, 401, 0 ), /* 731 serv */
+ S_ST( '_', 3, 733, 0 ), /* 732 server */
+ S_ST( 'o', 3, 734, 0 ), /* 733 server_ */
+ S_ST( 'f', 3, 735, 0 ), /* 734 server_o */
+ S_ST( 'f', 3, 736, 0 ), /* 735 server_of */
+ S_ST( 's', 3, 737, 0 ), /* 736 server_off */
+ S_ST( 'e', 3, 445, 0 ), /* 737 server_offs */
+ S_ST( 't', 3, 739, 729 ), /* 738 se */
+ S_ST( 'v', 3, 740, 0 ), /* 739 set */
+ S_ST( 'a', 3, 402, 0 ), /* 740 setv */
+ S_ST( 'i', 3, 742, 728 ), /* 741 s */
+ S_ST( 'm', 3, 743, 0 ), /* 742 si */
+ S_ST( 'u', 3, 744, 0 ), /* 743 sim */
+ S_ST( 'l', 3, 745, 0 ), /* 744 simu */
+ S_ST( 'a', 3, 746, 0 ), /* 745 simul */
+ S_ST( 't', 3, 747, 0 ), /* 746 simula */
+ S_ST( 'i', 3, 748, 442 ), /* 747 simulat */
+ S_ST( 'o', 3, 749, 0 ), /* 748 simulati */
+ S_ST( 'n', 3, 750, 0 ), /* 749 simulatio */
+ S_ST( '_', 3, 751, 0 ), /* 750 simulation */
+ S_ST( 'd', 3, 752, 0 ), /* 751 simulation_ */
+ S_ST( 'u', 3, 753, 0 ), /* 752 simulation_d */
+ S_ST( 'r', 3, 754, 0 ), /* 753 simulation_du */
+ S_ST( 'a', 3, 755, 0 ), /* 754 simulation_dur */
+ S_ST( 't', 3, 756, 0 ), /* 755 simulation_dura */
+ S_ST( 'i', 3, 757, 0 ), /* 756 simulation_durat */
+ S_ST( 'o', 3, 444, 0 ), /* 757 simulation_durati */
+ S_ST( 'o', 3, 759, 741 ), /* 758 s */
+ S_ST( 'u', 3, 760, 0 ), /* 759 so */
+ S_ST( 'r', 3, 761, 0 ), /* 760 sou */
+ S_ST( 'c', 3, 403, 0 ), /* 761 sour */
+ S_ST( 't', 3, 785, 758 ), /* 762 s */
+ S_ST( 'a', 3, 769, 0 ), /* 763 st */
+ S_ST( 'c', 3, 765, 0 ), /* 764 sta */
+ S_ST( 'k', 3, 766, 0 ), /* 765 stac */
+ S_ST( 's', 3, 767, 0 ), /* 766 stack */
+ S_ST( 'i', 3, 768, 0 ), /* 767 stacks */
+ S_ST( 'z', 3, 404, 0 ), /* 768 stacksi */
+ S_ST( 't', 3, 406, 764 ), /* 769 sta */
+ S_ST( 'i', 3, 771, 0 ), /* 770 stat */
+ S_ST( 's', 3, 772, 0 ), /* 771 stati */
+ S_ST( 't', 3, 773, 0 ), /* 772 statis */
+ S_ST( 'i', 3, 774, 0 ), /* 773 statist */
+ S_ST( 'c', 3, 405, 0 ), /* 774 statisti */
+ S_ST( 'd', 3, 776, 0 ), /* 775 stats */
+ S_ST( 'i', 3, 407, 0 ), /* 776 statsd */
+ S_ST( 'e', 3, 408, 763 ), /* 777 st */
+ S_ST( 'b', 3, 779, 0 ), /* 778 step */
+ S_ST( 'a', 3, 780, 0 ), /* 779 stepb */
+ S_ST( 'c', 3, 409, 0 ), /* 780 stepba */
+ S_ST( 'f', 3, 782, 778 ), /* 781 step */
+ S_ST( 'w', 3, 410, 0 ), /* 782 stepf */
+ S_ST( 'o', 3, 784, 781 ), /* 783 step */
+ S_ST( 'u', 3, 411, 0 ), /* 784 stepo */
+ S_ST( 'r', 3, 786, 777 ), /* 785 st */
+ S_ST( 'a', 3, 787, 0 ), /* 786 str */
+ S_ST( 't', 3, 788, 0 ), /* 787 stra */
+ S_ST( 'u', 3, 412, 0 ), /* 788 strat */
+ S_ST( 'y', 3, 414, 762 ), /* 789 s */
+ S_ST( 's', 3, 791, 0 ), /* 790 sys */
+ S_ST( 't', 3, 792, 0 ), /* 791 syss */
+ S_ST( 'a', 3, 793, 0 ), /* 792 sysst */
+ S_ST( 't', 3, 415, 0 ), /* 793 syssta */
+ S_ST( 't', 3, 820, 716 ), /* 794 */
+ S_ST( 'i', 3, 806, 0 ), /* 795 t */
+ S_ST( 'c', 3, 416, 0 ), /* 796 ti */
+ S_ST( 'm', 3, 799, 796 ), /* 797 ti */
+ S_ST( 'e', 3, 419, 0 ), /* 798 tim */
+ S_ST( 'i', 3, 800, 798 ), /* 799 tim */
+ S_ST( 'n', 3, 801, 0 ), /* 800 timi */
+ S_ST( 'g', 3, 802, 0 ), /* 801 timin */
+ S_ST( 's', 3, 803, 0 ), /* 802 timing */
+ S_ST( 't', 3, 804, 0 ), /* 803 timings */
+ S_ST( 'a', 3, 805, 0 ), /* 804 timingst */
+ S_ST( 't', 3, 420, 0 ), /* 805 timingsta */
+ S_ST( 'n', 3, 807, 797 ), /* 806 ti */
+ S_ST( 'k', 3, 808, 0 ), /* 807 tin */
+ S_ST( 'e', 3, 421, 0 ), /* 808 tink */
+ S_ST( 'o', 3, 422, 795 ), /* 809 t */
+ S_ST( 'r', 3, 812, 809 ), /* 810 t */
+ S_ST( 'a', 3, 423, 0 ), /* 811 tr */
+ S_ST( 'u', 3, 813, 811 ), /* 812 tr */
+ S_ST( 's', 3, 814, 424 ), /* 813 tru */
+ S_ST( 't', 3, 815, 0 ), /* 814 trus */
+ S_ST( 'e', 3, 816, 0 ), /* 815 trust */
+ S_ST( 'd', 3, 817, 0 ), /* 816 truste */
+ S_ST( 'k', 3, 818, 0 ), /* 817 trusted */
+ S_ST( 'e', 3, 425, 0 ), /* 818 trustedk */
+ S_ST( 't', 3, 426, 810 ), /* 819 t */
+ S_ST( 'y', 3, 821, 819 ), /* 820 t */
+ S_ST( 'p', 3, 427, 0 ), /* 821 ty */
+ S_ST( 'u', 3, 823, 794 ), /* 822 */
+ S_ST( 'n', 3, 829, 0 ), /* 823 u */
+ S_ST( 'c', 3, 825, 0 ), /* 824 un */
+ S_ST( 'o', 3, 826, 0 ), /* 825 unc */
+ S_ST( 'n', 3, 827, 0 ), /* 826 unco */
+ S_ST( 'f', 3, 828, 0 ), /* 827 uncon */
+ S_ST( 'i', 3, 432, 0 ), /* 828 unconf */
+ S_ST( 'p', 3, 830, 824 ), /* 829 un */
+ S_ST( 'e', 3, 831, 0 ), /* 830 unp */
+ S_ST( 'e', 3, 433, 0 ), /* 831 unpe */
+ S_ST( '_', 3, 852, 0 ), /* 832 unpeer */
+ S_ST( 'c', 3, 834, 0 ), /* 833 unpeer_ */
+ S_ST( 'r', 3, 835, 0 ), /* 834 unpeer_c */
+ S_ST( 'y', 3, 836, 0 ), /* 835 unpeer_cr */
+ S_ST( 'p', 3, 837, 0 ), /* 836 unpeer_cry */
+ S_ST( 't', 3, 838, 0 ), /* 837 unpeer_cryp */
+ S_ST( 'o', 3, 839, 0 ), /* 838 unpeer_crypt */
+ S_ST( '_', 3, 844, 0 ), /* 839 unpeer_crypto */
+ S_ST( 'e', 3, 841, 0 ), /* 840 unpeer_crypto_ */
+ S_ST( 'a', 3, 842, 0 ), /* 841 unpeer_crypto_e */
+ S_ST( 'r', 3, 843, 0 ), /* 842 unpeer_crypto_ea */
+ S_ST( 'l', 3, 429, 0 ), /* 843 unpeer_crypto_ear */
+ S_ST( 'n', 3, 845, 840 ), /* 844 unpeer_crypto_ */
+ S_ST( 'a', 3, 846, 0 ), /* 845 unpeer_crypto_n */
+ S_ST( 'k', 3, 847, 0 ), /* 846 unpeer_crypto_na */
+ S_ST( '_', 3, 848, 0 ), /* 847 unpeer_crypto_nak */
+ S_ST( 'e', 3, 849, 0 ), /* 848 unpeer_crypto_nak_ */
+ S_ST( 'a', 3, 850, 0 ), /* 849 unpeer_crypto_nak_e */
+ S_ST( 'r', 3, 851, 0 ), /* 850 unpeer_crypto_nak_ea */
+ S_ST( 'l', 3, 430, 0 ), /* 851 unpeer_crypto_nak_ear */
+ S_ST( 'd', 3, 853, 833 ), /* 852 unpeer_ */
+ S_ST( 'i', 3, 854, 0 ), /* 853 unpeer_d */
+ S_ST( 'g', 3, 855, 0 ), /* 854 unpeer_di */
+ S_ST( 'e', 3, 856, 0 ), /* 855 unpeer_dig */
+ S_ST( 's', 3, 857, 0 ), /* 856 unpeer_dige */
+ S_ST( 't', 3, 858, 0 ), /* 857 unpeer_diges */
+ S_ST( '_', 3, 859, 0 ), /* 858 unpeer_digest */
+ S_ST( 'e', 3, 860, 0 ), /* 859 unpeer_digest_ */
+ S_ST( 'a', 3, 861, 0 ), /* 860 unpeer_digest_e */
+ S_ST( 'r', 3, 862, 0 ), /* 861 unpeer_digest_ea */
+ S_ST( 'l', 3, 431, 0 ), /* 862 unpeer_digest_ear */
+ S_ST( 'v', 3, 864, 822 ), /* 863 */
+ S_ST( 'e', 3, 865, 0 ), /* 864 v */
+ S_ST( 'r', 3, 866, 0 ), /* 865 ve */
+ S_ST( 's', 3, 867, 0 ), /* 866 ver */
+ S_ST( 'i', 3, 868, 0 ), /* 867 vers */
+ S_ST( 'o', 3, 434, 0 ), /* 868 versi */
+ S_ST( 'w', 3, 876, 863 ), /* 869 */
+ S_ST( 'a', 3, 871, 0 ), /* 870 w */
+ S_ST( 'n', 3, 872, 0 ), /* 871 wa */
+ S_ST( 'd', 3, 873, 0 ), /* 872 wan */
+ S_ST( 'e', 3, 448, 0 ), /* 873 wand */
+ S_ST( 'e', 3, 875, 870 ), /* 874 w */
+ S_ST( 'e', 3, 436, 0 ), /* 875 we */
+ S_ST( 'i', 3, 877, 874 ), /* 876 w */
+ S_ST( 'l', 3, 878, 0 ), /* 877 wi */
+ S_ST( 'd', 3, 879, 0 ), /* 878 wil */
+ S_ST( 'c', 3, 880, 0 ), /* 879 wild */
+ S_ST( 'a', 3, 881, 0 ), /* 880 wildc */
+ S_ST( 'r', 3, 437, 0 ), /* 881 wildca */
+ S_ST( 'x', 3, 883, 869 ), /* 882 */
+ S_ST( 'l', 3, 884, 0 ), /* 883 x */
+ S_ST( 'e', 3, 885, 0 ), /* 884 xl */
+ S_ST( 'a', 3, 886, 0 ), /* 885 xle */
+ S_ST( 'v', 3, 438, 0 ), /* 886 xlea */
+ S_ST( 'y', 3, 888, 882 ), /* 887 [initial state] */
+ S_ST( 'e', 3, 889, 0 ), /* 888 y */
+ S_ST( 'a', 3, 439, 0 ) /* 889 ye */
};
diff --git a/contrib/ntp/ntpd/ntp_parser.c b/contrib/ntp/ntpd/ntp_parser.c
index cc17950..3159669 100644
--- a/contrib/ntp/ntpd/ntp_parser.c
+++ b/contrib/ntp/ntpd/ntp_parser.c
@@ -1,19 +1,19 @@
-/* A Bison parser, made by GNU Bison 3.0.2. */
+/* A Bison parser, made by GNU Bison 2.7.12-4996. */
/* Bison implementation for Yacc-like parsers in C
-
- Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc.
-
+
+ Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc.
+
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/>. */
@@ -26,7 +26,7 @@
special exception, which will cause the skeleton and the resulting
Bison output files to be licensed under the GNU General Public
License without this special exception.
-
+
This special exception was added by the Free Software Foundation in
version 2.2 of Bison. */
@@ -44,7 +44,7 @@
#define YYBISON 1
/* Bison version. */
-#define YYBISON_VERSION "3.0.2"
+#define YYBISON_VERSION "2.7.12-4996"
/* Skeleton name. */
#define YYSKELETON_NAME "yacc.c"
@@ -62,7 +62,8 @@
/* Copy the first part of user declarations. */
-#line 11 "../../ntpd/ntp_parser.y" /* yacc.c:339 */
+/* Line 371 of yacc.c */
+#line 11 "../../ntpd/ntp_parser.y"
#ifdef HAVE_CONFIG_H
# include <config.h>
@@ -96,13 +97,14 @@
# define ONLY_SIM(a) NULL
#endif
-#line 100 "../../ntpd/ntp_parser.c" /* yacc.c:339 */
+/* Line 371 of yacc.c */
+#line 102 "ntp_parser.c"
-# ifndef YY_NULLPTR
+# ifndef YY_NULL
# if defined __cplusplus && 201103L <= __cplusplus
-# define YY_NULLPTR nullptr
+# define YY_NULL nullptr
# else
-# define YY_NULLPTR 0
+# define YY_NULL 0
# endif
# endif
@@ -116,9 +118,9 @@
/* In a future release of Bison, this section will be replaced
by #include "y.tab.h". */
-#ifndef YY_YY__NTPD_NTP_PARSER_H_INCLUDED
-# define YY_YY__NTPD_NTP_PARSER_H_INCLUDED
-/* Debug traces. */
+#ifndef YY_YY_NTP_PARSER_H_INCLUDED
+# define YY_YY_NTP_PARSER_H_INCLUDED
+/* Enabling traces. */
#ifndef YYDEBUG
# define YYDEBUG 1
#endif
@@ -126,203 +128,207 @@
extern int yydebug;
#endif
-/* Token type. */
+/* Tokens. */
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
- enum yytokentype
- {
- T_Abbrev = 258,
- T_Age = 259,
- T_All = 260,
- T_Allan = 261,
- T_Allpeers = 262,
- T_Auth = 263,
- T_Autokey = 264,
- T_Automax = 265,
- T_Average = 266,
- T_Bclient = 267,
- T_Beacon = 268,
- T_Broadcast = 269,
- T_Broadcastclient = 270,
- T_Broadcastdelay = 271,
- T_Burst = 272,
- T_Calibrate = 273,
- T_Ceiling = 274,
- T_Clockstats = 275,
- T_Cohort = 276,
- T_ControlKey = 277,
- T_Crypto = 278,
- T_Cryptostats = 279,
- T_Ctl = 280,
- T_Day = 281,
- T_Default = 282,
- T_Digest = 283,
- T_Disable = 284,
- T_Discard = 285,
- T_Dispersion = 286,
- T_Double = 287,
- T_Driftfile = 288,
- T_Drop = 289,
- T_Dscp = 290,
- T_Ellipsis = 291,
- T_Enable = 292,
- T_End = 293,
- T_False = 294,
- T_File = 295,
- T_Filegen = 296,
- T_Filenum = 297,
- T_Flag1 = 298,
- T_Flag2 = 299,
- T_Flag3 = 300,
- T_Flag4 = 301,
- T_Flake = 302,
- T_Floor = 303,
- T_Freq = 304,
- T_Fudge = 305,
- T_Host = 306,
- T_Huffpuff = 307,
- T_Iburst = 308,
- T_Ident = 309,
- T_Ignore = 310,
- T_Incalloc = 311,
- T_Incmem = 312,
- T_Initalloc = 313,
- T_Initmem = 314,
- T_Includefile = 315,
- T_Integer = 316,
- T_Interface = 317,
- T_Intrange = 318,
- T_Io = 319,
- T_Ipv4 = 320,
- T_Ipv4_flag = 321,
- T_Ipv6 = 322,
- T_Ipv6_flag = 323,
- T_Kernel = 324,
- T_Key = 325,
- T_Keys = 326,
- T_Keysdir = 327,
- T_Kod = 328,
- T_Mssntp = 329,
- T_Leapfile = 330,
- T_Leapsmearinterval = 331,
- T_Limited = 332,
- T_Link = 333,
- T_Listen = 334,
- T_Logconfig = 335,
- T_Logfile = 336,
- T_Loopstats = 337,
- T_Lowpriotrap = 338,
- T_Manycastclient = 339,
- T_Manycastserver = 340,
- T_Mask = 341,
- T_Maxage = 342,
- T_Maxclock = 343,
- T_Maxdepth = 344,
- T_Maxdist = 345,
- T_Maxmem = 346,
- T_Maxpoll = 347,
- T_Mdnstries = 348,
- T_Mem = 349,
- T_Memlock = 350,
- T_Minclock = 351,
- T_Mindepth = 352,
- T_Mindist = 353,
- T_Minimum = 354,
- T_Minpoll = 355,
- T_Minsane = 356,
- T_Mode = 357,
- T_Mode7 = 358,
- T_Monitor = 359,
- T_Month = 360,
- T_Mru = 361,
- T_Multicastclient = 362,
- T_Nic = 363,
- T_Nolink = 364,
- T_Nomodify = 365,
- T_Nomrulist = 366,
- T_None = 367,
- T_Nonvolatile = 368,
- T_Nopeer = 369,
- T_Noquery = 370,
- T_Noselect = 371,
- T_Noserve = 372,
- T_Notrap = 373,
- T_Notrust = 374,
- T_Ntp = 375,
- T_Ntpport = 376,
- T_NtpSignDsocket = 377,
- T_Orphan = 378,
- T_Orphanwait = 379,
- T_Panic = 380,
- T_Peer = 381,
- T_Peerstats = 382,
- T_Phone = 383,
- T_Pid = 384,
- T_Pidfile = 385,
- T_Pool = 386,
- T_Port = 387,
- T_Preempt = 388,
- T_Prefer = 389,
- T_Protostats = 390,
- T_Pw = 391,
- T_Randfile = 392,
- T_Rawstats = 393,
- T_Refid = 394,
- T_Requestkey = 395,
- T_Reset = 396,
- T_Restrict = 397,
- T_Revoke = 398,
- T_Rlimit = 399,
- T_Saveconfigdir = 400,
- T_Server = 401,
- T_Setvar = 402,
- T_Source = 403,
- T_Stacksize = 404,
- T_Statistics = 405,
- T_Stats = 406,
- T_Statsdir = 407,
- T_Step = 408,
- T_Stepback = 409,
- T_Stepfwd = 410,
- T_Stepout = 411,
- T_Stratum = 412,
- T_String = 413,
- T_Sys = 414,
- T_Sysstats = 415,
- T_Tick = 416,
- T_Time1 = 417,
- T_Time2 = 418,
- T_Timer = 419,
- T_Timingstats = 420,
- T_Tinker = 421,
- T_Tos = 422,
- T_Trap = 423,
- T_True = 424,
- T_Trustedkey = 425,
- T_Ttl = 426,
- T_Type = 427,
- T_U_int = 428,
- T_Unconfig = 429,
- T_Unpeer = 430,
- T_Version = 431,
- T_WanderThreshold = 432,
- T_Week = 433,
- T_Wildcard = 434,
- T_Xleave = 435,
- T_Year = 436,
- T_Flag = 437,
- T_EOC = 438,
- T_Simulate = 439,
- T_Beep_Delay = 440,
- T_Sim_Duration = 441,
- T_Server_Offset = 442,
- T_Duration = 443,
- T_Freq_Offset = 444,
- T_Wander = 445,
- T_Jitter = 446,
- T_Prop_Delay = 447,
- T_Proc_Delay = 448
- };
+ /* Put the tokens into the symbol table, so that GDB and other debuggers
+ know about them. */
+ enum yytokentype {
+ T_Abbrev = 258,
+ T_Age = 259,
+ T_All = 260,
+ T_Allan = 261,
+ T_Allpeers = 262,
+ T_Auth = 263,
+ T_Autokey = 264,
+ T_Automax = 265,
+ T_Average = 266,
+ T_Bclient = 267,
+ T_Beacon = 268,
+ T_Broadcast = 269,
+ T_Broadcastclient = 270,
+ T_Broadcastdelay = 271,
+ T_Burst = 272,
+ T_Calibrate = 273,
+ T_Ceiling = 274,
+ T_Clockstats = 275,
+ T_Cohort = 276,
+ T_ControlKey = 277,
+ T_Crypto = 278,
+ T_Cryptostats = 279,
+ T_Ctl = 280,
+ T_Day = 281,
+ T_Default = 282,
+ T_Digest = 283,
+ T_Disable = 284,
+ T_Discard = 285,
+ T_Dispersion = 286,
+ T_Double = 287,
+ T_Driftfile = 288,
+ T_Drop = 289,
+ T_Dscp = 290,
+ T_Ellipsis = 291,
+ T_Enable = 292,
+ T_End = 293,
+ T_False = 294,
+ T_File = 295,
+ T_Filegen = 296,
+ T_Filenum = 297,
+ T_Flag1 = 298,
+ T_Flag2 = 299,
+ T_Flag3 = 300,
+ T_Flag4 = 301,
+ T_Flake = 302,
+ T_Floor = 303,
+ T_Freq = 304,
+ T_Fudge = 305,
+ T_Host = 306,
+ T_Huffpuff = 307,
+ T_Iburst = 308,
+ T_Ident = 309,
+ T_Ignore = 310,
+ T_Incalloc = 311,
+ T_Incmem = 312,
+ T_Initalloc = 313,
+ T_Initmem = 314,
+ T_Includefile = 315,
+ T_Integer = 316,
+ T_Interface = 317,
+ T_Intrange = 318,
+ T_Io = 319,
+ T_Ipv4 = 320,
+ T_Ipv4_flag = 321,
+ T_Ipv6 = 322,
+ T_Ipv6_flag = 323,
+ T_Kernel = 324,
+ T_Key = 325,
+ T_Keys = 326,
+ T_Keysdir = 327,
+ T_Kod = 328,
+ T_Mssntp = 329,
+ T_Leapfile = 330,
+ T_Leapsmearinterval = 331,
+ T_Limited = 332,
+ T_Link = 333,
+ T_Listen = 334,
+ T_Logconfig = 335,
+ T_Logfile = 336,
+ T_Loopstats = 337,
+ T_Lowpriotrap = 338,
+ T_Manycastclient = 339,
+ T_Manycastserver = 340,
+ T_Mask = 341,
+ T_Maxage = 342,
+ T_Maxclock = 343,
+ T_Maxdepth = 344,
+ T_Maxdist = 345,
+ T_Maxmem = 346,
+ T_Maxpoll = 347,
+ T_Mdnstries = 348,
+ T_Mem = 349,
+ T_Memlock = 350,
+ T_Minclock = 351,
+ T_Mindepth = 352,
+ T_Mindist = 353,
+ T_Minimum = 354,
+ T_Minpoll = 355,
+ T_Minsane = 356,
+ T_Mode = 357,
+ T_Mode7 = 358,
+ T_Monitor = 359,
+ T_Month = 360,
+ T_Mru = 361,
+ T_Multicastclient = 362,
+ T_Nic = 363,
+ T_Nolink = 364,
+ T_Nomodify = 365,
+ T_Nomrulist = 366,
+ T_None = 367,
+ T_Nonvolatile = 368,
+ T_Nopeer = 369,
+ T_Noquery = 370,
+ T_Noselect = 371,
+ T_Noserve = 372,
+ T_Notrap = 373,
+ T_Notrust = 374,
+ T_Ntp = 375,
+ T_Ntpport = 376,
+ T_NtpSignDsocket = 377,
+ T_Orphan = 378,
+ T_Orphanwait = 379,
+ T_Panic = 380,
+ T_Peer = 381,
+ T_Peerstats = 382,
+ T_Phone = 383,
+ T_Pid = 384,
+ T_Pidfile = 385,
+ T_Pool = 386,
+ T_Port = 387,
+ T_Preempt = 388,
+ T_Prefer = 389,
+ T_Protostats = 390,
+ T_Pw = 391,
+ T_Randfile = 392,
+ T_Rawstats = 393,
+ T_Refid = 394,
+ T_Requestkey = 395,
+ T_Reset = 396,
+ T_Restrict = 397,
+ T_Revoke = 398,
+ T_Rlimit = 399,
+ T_Saveconfigdir = 400,
+ T_Server = 401,
+ T_Setvar = 402,
+ T_Source = 403,
+ T_Stacksize = 404,
+ T_Statistics = 405,
+ T_Stats = 406,
+ T_Statsdir = 407,
+ T_Step = 408,
+ T_Stepback = 409,
+ T_Stepfwd = 410,
+ T_Stepout = 411,
+ T_Stratum = 412,
+ T_String = 413,
+ T_Sys = 414,
+ T_Sysstats = 415,
+ T_Tick = 416,
+ T_Time1 = 417,
+ T_Time2 = 418,
+ T_Timer = 419,
+ T_Timingstats = 420,
+ T_Tinker = 421,
+ T_Tos = 422,
+ T_Trap = 423,
+ T_True = 424,
+ T_Trustedkey = 425,
+ T_Ttl = 426,
+ T_Type = 427,
+ T_U_int = 428,
+ T_UEcrypto = 429,
+ T_UEcryptonak = 430,
+ T_UEdigest = 431,
+ T_Unconfig = 432,
+ T_Unpeer = 433,
+ T_Version = 434,
+ T_WanderThreshold = 435,
+ T_Week = 436,
+ T_Wildcard = 437,
+ T_Xleave = 438,
+ T_Year = 439,
+ T_Flag = 440,
+ T_EOC = 441,
+ T_Simulate = 442,
+ T_Beep_Delay = 443,
+ T_Sim_Duration = 444,
+ T_Server_Offset = 445,
+ T_Duration = 446,
+ T_Freq_Offset = 447,
+ T_Wander = 448,
+ T_Jitter = 449,
+ T_Prop_Delay = 450,
+ T_Proc_Delay = 451
+ };
#endif
/* Tokens. */
#define T_Abbrev 258
@@ -496,33 +502,37 @@ extern int yydebug;
#define T_Ttl 426
#define T_Type 427
#define T_U_int 428
-#define T_Unconfig 429
-#define T_Unpeer 430
-#define T_Version 431
-#define T_WanderThreshold 432
-#define T_Week 433
-#define T_Wildcard 434
-#define T_Xleave 435
-#define T_Year 436
-#define T_Flag 437
-#define T_EOC 438
-#define T_Simulate 439
-#define T_Beep_Delay 440
-#define T_Sim_Duration 441
-#define T_Server_Offset 442
-#define T_Duration 443
-#define T_Freq_Offset 444
-#define T_Wander 445
-#define T_Jitter 446
-#define T_Prop_Delay 447
-#define T_Proc_Delay 448
-
-/* Value type. */
+#define T_UEcrypto 429
+#define T_UEcryptonak 430
+#define T_UEdigest 431
+#define T_Unconfig 432
+#define T_Unpeer 433
+#define T_Version 434
+#define T_WanderThreshold 435
+#define T_Week 436
+#define T_Wildcard 437
+#define T_Xleave 438
+#define T_Year 439
+#define T_Flag 440
+#define T_EOC 441
+#define T_Simulate 442
+#define T_Beep_Delay 443
+#define T_Sim_Duration 444
+#define T_Server_Offset 445
+#define T_Duration 446
+#define T_Freq_Offset 447
+#define T_Wander 448
+#define T_Jitter 449
+#define T_Prop_Delay 450
+#define T_Proc_Delay 451
+
+
+
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
-typedef union YYSTYPE YYSTYPE;
-union YYSTYPE
+typedef union YYSTYPE
{
-#line 51 "../../ntpd/ntp_parser.y" /* yacc.c:355 */
+/* Line 387 of yacc.c */
+#line 51 "../../ntpd/ntp_parser.y"
char * String;
double Double;
@@ -541,22 +551,37 @@ union YYSTYPE
script_info * Sim_script;
script_info_fifo * Sim_script_fifo;
-#line 545 "../../ntpd/ntp_parser.c" /* yacc.c:355 */
-};
+
+/* Line 387 of yacc.c */
+#line 557 "ntp_parser.c"
+} YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1
+# define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1
#endif
-
extern YYSTYPE yylval;
+#ifdef YYPARSE_PARAM
+#if defined __STDC__ || defined __cplusplus
+int yyparse (void *YYPARSE_PARAM);
+#else
+int yyparse ();
+#endif
+#else /* ! YYPARSE_PARAM */
+#if defined __STDC__ || defined __cplusplus
int yyparse (void);
+#else
+int yyparse ();
+#endif
+#endif /* ! YYPARSE_PARAM */
-#endif /* !YY_YY__NTPD_NTP_PARSER_H_INCLUDED */
+#endif /* !YY_YY_NTP_PARSER_H_INCLUDED */
/* Copy the second part of user declarations. */
-#line 560 "../../ntpd/ntp_parser.c" /* yacc.c:358 */
+/* Line 390 of yacc.c */
+#line 585 "ntp_parser.c"
#ifdef short
# undef short
@@ -570,8 +595,11 @@ typedef unsigned char yytype_uint8;
#ifdef YYTYPE_INT8
typedef YYTYPE_INT8 yytype_int8;
-#else
+#elif (defined __STDC__ || defined __C99__FUNC__ \
+ || defined __cplusplus || defined _MSC_VER)
typedef signed char yytype_int8;
+#else
+typedef short int yytype_int8;
#endif
#ifdef YYTYPE_UINT16
@@ -591,7 +619,8 @@ typedef short int yytype_int16;
# define YYSIZE_T __SIZE_TYPE__
# elif defined size_t
# define YYSIZE_T size_t
-# elif ! defined YYSIZE_T
+# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
+ || defined __cplusplus || defined _MSC_VER)
# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
# define YYSIZE_T size_t
# else
@@ -613,30 +642,11 @@ typedef short int yytype_int16;
# endif
#endif
-#ifndef YY_ATTRIBUTE
-# if (defined __GNUC__ \
- && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \
- || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
-# define YY_ATTRIBUTE(Spec) __attribute__(Spec)
-# else
-# define YY_ATTRIBUTE(Spec) /* empty */
-# endif
-#endif
-
-#ifndef YY_ATTRIBUTE_PURE
-# define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__))
-#endif
-
-#ifndef YY_ATTRIBUTE_UNUSED
-# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
-#endif
-
-#if !defined _Noreturn \
- && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112)
-# if defined _MSC_VER && 1200 <= _MSC_VER
-# define _Noreturn __declspec (noreturn)
-# else
-# define _Noreturn YY_ATTRIBUTE ((__noreturn__))
+#ifndef __attribute__
+/* This feature is available in gcc versions 2.5 and later. */
+# if (! defined __GNUC__ || __GNUC__ < 2 \
+ || (__GNUC__ == 2 && __GNUC_MINOR__ < 5))
+# define __attribute__(Spec) /* empty */
# endif
#endif
@@ -647,26 +657,25 @@ typedef short int yytype_int16;
# define YYUSE(E) /* empty */
#endif
-#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
-/* Suppress an incorrect diagnostic about yylval being uninitialized. */
-# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
- _Pragma ("GCC diagnostic push") \
- _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
- _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
-# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
- _Pragma ("GCC diagnostic pop")
+
+/* Identity function, used to suppress warnings about constant conditions. */
+#ifndef lint
+# define YYID(N) (N)
#else
-# define YY_INITIAL_VALUE(Value) Value
-#endif
-#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
-# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
-# define YY_IGNORE_MAYBE_UNINITIALIZED_END
+#if (defined __STDC__ || defined __C99__FUNC__ \
+ || defined __cplusplus || defined _MSC_VER)
+static int
+YYID (int yyi)
+#else
+static int
+YYID (yyi)
+ int yyi;
#endif
-#ifndef YY_INITIAL_VALUE
-# define YY_INITIAL_VALUE(Value) /* Nothing. */
+{
+ return yyi;
+}
#endif
-
#if ! defined yyoverflow || YYERROR_VERBOSE
/* The parser invokes alloca or malloc; define the necessary symbols. */
@@ -684,7 +693,8 @@ typedef short int yytype_int16;
# define alloca _alloca
# else
# define YYSTACK_ALLOC alloca
-# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
+# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
+ || defined __cplusplus || defined _MSC_VER)
# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
/* Use EXIT_SUCCESS as a witness for stdlib.h. */
# ifndef EXIT_SUCCESS
@@ -696,8 +706,8 @@ typedef short int yytype_int16;
# endif
# ifdef YYSTACK_ALLOC
- /* Pacify GCC's 'empty if-body' warning. */
-# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
+ /* Pacify GCC's `empty if-body' warning. */
+# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
# ifndef YYSTACK_ALLOC_MAXIMUM
/* The OS might guarantee only one guard page at the bottom of the stack,
and a page size can be as small as 4096 bytes. So we cannot safely
@@ -713,7 +723,7 @@ typedef short int yytype_int16;
# endif
# if (defined __cplusplus && ! defined EXIT_SUCCESS \
&& ! ((defined YYMALLOC || defined malloc) \
- && (defined YYFREE || defined free)))
+ && (defined YYFREE || defined free)))
# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
# ifndef EXIT_SUCCESS
# define EXIT_SUCCESS 0
@@ -721,13 +731,15 @@ typedef short int yytype_int16;
# endif
# ifndef YYMALLOC
# define YYMALLOC malloc
-# if ! defined malloc && ! defined EXIT_SUCCESS
+# if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
+ || defined __cplusplus || defined _MSC_VER)
void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
# endif
# endif
# ifndef YYFREE
# define YYFREE free
-# if ! defined free && ! defined EXIT_SUCCESS
+# if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
+ || defined __cplusplus || defined _MSC_VER)
void free (void *); /* INFRINGES ON USER NAME SPACE */
# endif
# endif
@@ -737,7 +749,7 @@ void free (void *); /* INFRINGES ON USER NAME SPACE */
#if (! defined yyoverflow \
&& (! defined __cplusplus \
- || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
+ || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
/* A type that is properly aligned for any stack member. */
union yyalloc
@@ -762,16 +774,16 @@ union yyalloc
elements in the stack, and YYPTR gives the new location of the
stack. Advance YYPTR to a properly aligned location for the next
stack. */
-# define YYSTACK_RELOCATE(Stack_alloc, Stack) \
- do \
- { \
- YYSIZE_T yynewbytes; \
- YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
- Stack = &yyptr->Stack_alloc; \
- yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
- yyptr += yynewbytes / sizeof (*yyptr); \
- } \
- while (0)
+# define YYSTACK_RELOCATE(Stack_alloc, Stack) \
+ do \
+ { \
+ YYSIZE_T yynewbytes; \
+ YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
+ Stack = &yyptr->Stack_alloc; \
+ yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
+ yyptr += yynewbytes / sizeof (*yyptr); \
+ } \
+ while (YYID (0))
#endif
@@ -790,50 +802,48 @@ union yyalloc
for (yyi = 0; yyi < (Count); yyi++) \
(Dst)[yyi] = (Src)[yyi]; \
} \
- while (0)
+ while (YYID (0))
# endif
# endif
#endif /* !YYCOPY_NEEDED */
/* YYFINAL -- State number of the termination state. */
-#define YYFINAL 210
+#define YYFINAL 213
/* YYLAST -- Last index in YYTABLE. */
-#define YYLAST 647
+#define YYLAST 624
/* YYNTOKENS -- Number of terminals. */
-#define YYNTOKENS 199
+#define YYNTOKENS 202
/* YYNNTS -- Number of nonterminals. */
#define YYNNTS 105
/* YYNRULES -- Number of rules. */
-#define YYNRULES 313
-/* YYNSTATES -- Number of states. */
-#define YYNSTATES 419
+#define YYNRULES 316
+/* YYNRULES -- Number of states. */
+#define YYNSTATES 422
-/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
- by yylex, with out-of-bounds checking. */
+/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
#define YYUNDEFTOK 2
-#define YYMAXUTOK 448
+#define YYMAXUTOK 451
-#define YYTRANSLATE(YYX) \
+#define YYTRANSLATE(YYX) \
((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
-/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
- as returned by yylex, without out-of-bounds checking. */
+/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
static const yytype_uint8 yytranslate[] =
{
0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 195, 196, 2, 2, 2, 2, 2, 2, 2, 2,
+ 198, 199, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 194, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 197, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 197, 2, 198, 2, 2, 2, 2,
+ 2, 2, 2, 200, 2, 201, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
@@ -865,45 +875,166 @@ static const yytype_uint8 yytranslate[] =
155, 156, 157, 158, 159, 160, 161, 162, 163, 164,
165, 166, 167, 168, 169, 170, 171, 172, 173, 174,
175, 176, 177, 178, 179, 180, 181, 182, 183, 184,
- 185, 186, 187, 188, 189, 190, 191, 192, 193
+ 185, 186, 187, 188, 189, 190, 191, 192, 193, 194,
+ 195, 196
};
#if YYDEBUG
- /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
+/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
+ YYRHS. */
+static const yytype_uint16 yyprhs[] =
+{
+ 0, 0, 3, 5, 9, 12, 15, 16, 18, 20,
+ 22, 24, 26, 28, 30, 32, 34, 36, 38, 40,
+ 42, 46, 48, 50, 52, 54, 56, 58, 61, 63,
+ 65, 67, 68, 71, 73, 75, 77, 79, 81, 83,
+ 85, 87, 89, 91, 93, 95, 98, 101, 103, 105,
+ 107, 109, 111, 113, 116, 118, 121, 123, 125, 127,
+ 130, 133, 136, 139, 142, 145, 148, 151, 154, 157,
+ 160, 163, 164, 167, 170, 173, 175, 177, 179, 181,
+ 183, 186, 189, 191, 194, 197, 200, 202, 204, 206,
+ 208, 210, 212, 214, 216, 218, 220, 223, 226, 230,
+ 233, 235, 237, 239, 241, 243, 245, 247, 249, 251,
+ 252, 255, 258, 261, 263, 265, 267, 269, 271, 273,
+ 275, 277, 279, 281, 283, 285, 287, 290, 293, 297,
+ 303, 307, 312, 317, 321, 322, 325, 327, 329, 331,
+ 333, 335, 337, 339, 341, 343, 345, 347, 349, 351,
+ 353, 355, 358, 360, 363, 365, 367, 369, 372, 374,
+ 377, 379, 381, 383, 385, 387, 389, 391, 393, 397,
+ 400, 402, 405, 408, 411, 414, 417, 419, 421, 423,
+ 425, 427, 429, 432, 435, 437, 440, 442, 444, 446,
+ 449, 452, 455, 457, 459, 461, 463, 465, 467, 469,
+ 471, 473, 475, 477, 479, 481, 483, 486, 489, 491,
+ 494, 496, 498, 500, 502, 504, 506, 508, 510, 512,
+ 514, 516, 518, 521, 524, 527, 530, 534, 536, 539,
+ 542, 545, 548, 552, 555, 557, 559, 561, 563, 565,
+ 567, 569, 571, 573, 575, 577, 580, 581, 586, 588,
+ 589, 590, 593, 596, 599, 602, 604, 606, 610, 614,
+ 616, 618, 620, 622, 624, 626, 628, 630, 632, 635,
+ 638, 640, 642, 644, 646, 648, 650, 652, 654, 657,
+ 659, 662, 664, 666, 668, 674, 677, 679, 682, 684,
+ 686, 688, 690, 692, 694, 700, 702, 706, 709, 713,
+ 715, 717, 720, 722, 728, 733, 737, 740, 742, 749,
+ 753, 756, 760, 762, 764, 766, 768
+};
+
+/* YYRHS -- A `-1'-separated list of the rules' RHS. */
+static const yytype_int16 yyrhs[] =
+{
+ 203, 0, -1, 204, -1, 204, 205, 186, -1, 205,
+ 186, -1, 1, 186, -1, -1, 206, -1, 219, -1,
+ 221, -1, 222, -1, 231, -1, 239, -1, 226, -1,
+ 248, -1, 253, -1, 257, -1, 262, -1, 266, -1,
+ 293, -1, 207, 208, 211, -1, 146, -1, 131, -1,
+ 126, -1, 14, -1, 84, -1, 209, -1, 210, 158,
+ -1, 158, -1, 66, -1, 68, -1, -1, 211, 212,
+ -1, 213, -1, 215, -1, 217, -1, 214, -1, 9,
+ -1, 17, -1, 53, -1, 116, -1, 133, -1, 134,
+ -1, 169, -1, 183, -1, 216, 61, -1, 216, 173,
+ -1, 70, -1, 100, -1, 92, -1, 171, -1, 102,
+ -1, 179, -1, 218, 158, -1, 54, -1, 220, 208,
+ -1, 177, -1, 178, -1, 15, -1, 85, 290, -1,
+ 107, 290, -1, 93, 61, -1, 10, 61, -1, 22,
+ 61, -1, 23, 223, -1, 71, 158, -1, 72, 158,
+ -1, 140, 61, -1, 143, 61, -1, 170, 286, -1,
+ 122, 158, -1, -1, 223, 224, -1, 225, 158, -1,
+ 143, 61, -1, 51, -1, 54, -1, 136, -1, 137,
+ -1, 28, -1, 167, 227, -1, 227, 228, -1, 228,
+ -1, 229, 61, -1, 230, 292, -1, 21, 291, -1,
+ 19, -1, 48, -1, 123, -1, 124, -1, 101, -1,
+ 13, -1, 98, -1, 90, -1, 96, -1, 88, -1,
+ 150, 232, -1, 152, 158, -1, 41, 233, 234, -1,
+ 232, 233, -1, 233, -1, 20, -1, 24, -1, 82,
+ -1, 127, -1, 138, -1, 160, -1, 165, -1, 135,
+ -1, -1, 234, 235, -1, 40, 158, -1, 172, 238,
+ -1, 236, -1, 237, -1, 78, -1, 109, -1, 37,
+ -1, 29, -1, 112, -1, 129, -1, 26, -1, 181,
+ -1, 105, -1, 184, -1, 4, -1, 30, 242, -1,
+ 106, 245, -1, 142, 208, 240, -1, 142, 209, 86,
+ 209, 240, -1, 142, 27, 240, -1, 142, 66, 27,
+ 240, -1, 142, 68, 27, 240, -1, 142, 148, 240,
+ -1, -1, 240, 241, -1, 47, -1, 55, -1, 73,
+ -1, 74, -1, 77, -1, 83, -1, 110, -1, 111,
+ -1, 114, -1, 115, -1, 117, -1, 118, -1, 119,
+ -1, 121, -1, 179, -1, 242, 243, -1, 243, -1,
+ 244, 61, -1, 11, -1, 99, -1, 104, -1, 245,
+ 246, -1, 246, -1, 247, 61, -1, 56, -1, 57,
+ -1, 58, -1, 59, -1, 87, -1, 89, -1, 91,
+ -1, 97, -1, 50, 208, 249, -1, 249, 250, -1,
+ 250, -1, 251, 292, -1, 252, 291, -1, 157, 61,
+ -1, 3, 158, -1, 139, 158, -1, 162, -1, 163,
+ -1, 43, -1, 44, -1, 45, -1, 46, -1, 144,
+ 254, -1, 254, 255, -1, 255, -1, 256, 61, -1,
+ 95, -1, 149, -1, 42, -1, 37, 258, -1, 29,
+ 258, -1, 258, 259, -1, 259, -1, 260, -1, 261,
+ -1, 8, -1, 12, -1, 18, -1, 69, -1, 104,
+ -1, 120, -1, 103, -1, 151, -1, 174, -1, 175,
+ -1, 176, -1, 166, 263, -1, 263, 264, -1, 264,
+ -1, 265, 292, -1, 6, -1, 31, -1, 49, -1,
+ 52, -1, 125, -1, 153, -1, 154, -1, 155, -1,
+ 156, -1, 161, -1, 278, -1, 282, -1, 267, 292,
+ -1, 268, 61, -1, 269, 158, -1, 270, 158, -1,
+ 60, 158, 205, -1, 38, -1, 33, 271, -1, 80,
+ 276, -1, 128, 289, -1, 147, 272, -1, 168, 209,
+ 274, -1, 171, 285, -1, 16, -1, 113, -1, 161,
+ -1, 35, -1, 76, -1, 54, -1, 75, -1, 81,
+ -1, 130, -1, 145, -1, 158, -1, 158, 32, -1,
+ -1, 158, 197, 158, 273, -1, 27, -1, -1, -1,
+ 274, 275, -1, 132, 61, -1, 62, 209, -1, 276,
+ 277, -1, 277, -1, 158, -1, 279, 281, 280, -1,
+ 279, 281, 158, -1, 62, -1, 108, -1, 5, -1,
+ 65, -1, 67, -1, 182, -1, 79, -1, 55, -1,
+ 34, -1, 141, 283, -1, 283, 284, -1, 284, -1,
+ 7, -1, 8, -1, 25, -1, 64, -1, 94, -1,
+ 159, -1, 164, -1, 285, 61, -1, 61, -1, 286,
+ 287, -1, 287, -1, 61, -1, 288, -1, 198, 61,
+ 36, 61, 199, -1, 289, 158, -1, 158, -1, 290,
+ 208, -1, 208, -1, 61, -1, 169, -1, 39, -1,
+ 61, -1, 32, -1, 294, 200, 295, 298, 201, -1,
+ 187, -1, 295, 296, 186, -1, 296, 186, -1, 297,
+ 197, 292, -1, 188, -1, 189, -1, 298, 299, -1,
+ 299, -1, 301, 200, 300, 302, 201, -1, 190, 197,
+ 292, 186, -1, 146, 197, 208, -1, 302, 303, -1,
+ 303, -1, 191, 197, 292, 200, 304, 201, -1, 304,
+ 305, 186, -1, 305, 186, -1, 306, 197, 292, -1,
+ 192, -1, 193, -1, 194, -1, 195, -1, 196, -1
+};
+
+/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
static const yytype_uint16 yyrline[] =
{
- 0, 366, 366, 370, 371, 372, 387, 388, 389, 390,
- 391, 392, 393, 394, 395, 396, 397, 398, 399, 400,
- 408, 418, 419, 420, 421, 422, 426, 427, 432, 437,
- 439, 445, 446, 454, 455, 456, 460, 465, 466, 467,
- 468, 469, 470, 471, 472, 476, 478, 483, 484, 485,
- 486, 487, 488, 492, 497, 506, 516, 517, 527, 529,
- 531, 533, 544, 551, 553, 558, 560, 562, 564, 566,
- 575, 581, 582, 590, 592, 604, 605, 606, 607, 608,
- 617, 622, 627, 635, 637, 639, 644, 645, 646, 647,
- 648, 649, 653, 654, 655, 656, 665, 667, 676, 686,
- 691, 699, 700, 701, 702, 703, 704, 705, 706, 711,
- 712, 720, 730, 739, 754, 759, 760, 764, 765, 769,
- 770, 771, 772, 773, 774, 775, 784, 788, 792, 800,
- 808, 816, 831, 846, 859, 860, 868, 869, 870, 871,
- 872, 873, 874, 875, 876, 877, 878, 879, 880, 881,
- 882, 886, 891, 899, 904, 905, 906, 910, 915, 923,
- 928, 929, 930, 931, 932, 933, 934, 935, 943, 953,
- 958, 966, 968, 970, 979, 981, 986, 987, 991, 992,
- 993, 994, 1002, 1007, 1012, 1020, 1025, 1026, 1027, 1036,
- 1038, 1043, 1048, 1056, 1058, 1075, 1076, 1077, 1078, 1079,
- 1080, 1084, 1085, 1093, 1098, 1103, 1111, 1116, 1117, 1118,
- 1119, 1120, 1121, 1122, 1123, 1124, 1125, 1134, 1135, 1136,
- 1143, 1150, 1157, 1173, 1192, 1194, 1196, 1198, 1200, 1202,
- 1209, 1214, 1215, 1216, 1220, 1224, 1233, 1234, 1238, 1239,
- 1240, 1244, 1255, 1269, 1281, 1286, 1288, 1293, 1294, 1302,
- 1304, 1312, 1317, 1325, 1350, 1357, 1367, 1368, 1372, 1373,
- 1374, 1375, 1379, 1380, 1381, 1385, 1390, 1395, 1403, 1404,
- 1405, 1406, 1407, 1408, 1409, 1419, 1424, 1432, 1437, 1445,
- 1447, 1451, 1456, 1461, 1469, 1474, 1482, 1491, 1492, 1496,
- 1497, 1506, 1524, 1528, 1533, 1541, 1546, 1547, 1551, 1556,
- 1564, 1569, 1574, 1579, 1584, 1592, 1597, 1602, 1610, 1615,
- 1616, 1617, 1618, 1619
+ 0, 369, 369, 373, 374, 375, 390, 391, 392, 393,
+ 394, 395, 396, 397, 398, 399, 400, 401, 402, 403,
+ 411, 421, 422, 423, 424, 425, 429, 430, 435, 440,
+ 442, 448, 449, 457, 458, 459, 463, 468, 469, 470,
+ 471, 472, 473, 474, 475, 479, 481, 486, 487, 488,
+ 489, 490, 491, 495, 500, 509, 519, 520, 530, 532,
+ 534, 536, 547, 554, 556, 561, 563, 565, 567, 569,
+ 578, 584, 585, 593, 595, 607, 608, 609, 610, 611,
+ 620, 625, 630, 638, 640, 642, 647, 648, 649, 650,
+ 651, 652, 656, 657, 658, 659, 668, 670, 679, 689,
+ 694, 702, 703, 704, 705, 706, 707, 708, 709, 714,
+ 715, 723, 733, 742, 757, 762, 763, 767, 768, 772,
+ 773, 774, 775, 776, 777, 778, 787, 791, 795, 803,
+ 811, 819, 834, 849, 862, 863, 871, 872, 873, 874,
+ 875, 876, 877, 878, 879, 880, 881, 882, 883, 884,
+ 885, 889, 894, 902, 907, 908, 909, 913, 918, 926,
+ 931, 932, 933, 934, 935, 936, 937, 938, 946, 956,
+ 961, 969, 971, 973, 982, 984, 989, 990, 994, 995,
+ 996, 997, 1005, 1010, 1015, 1023, 1028, 1029, 1030, 1039,
+ 1041, 1046, 1051, 1059, 1061, 1078, 1079, 1080, 1081, 1082,
+ 1083, 1087, 1088, 1089, 1090, 1091, 1099, 1104, 1109, 1117,
+ 1122, 1123, 1124, 1125, 1126, 1127, 1128, 1129, 1130, 1131,
+ 1140, 1141, 1142, 1149, 1156, 1163, 1179, 1198, 1200, 1202,
+ 1204, 1206, 1208, 1215, 1220, 1221, 1222, 1226, 1230, 1239,
+ 1240, 1244, 1245, 1246, 1250, 1261, 1275, 1287, 1292, 1294,
+ 1299, 1300, 1308, 1310, 1318, 1323, 1331, 1356, 1363, 1373,
+ 1374, 1378, 1379, 1380, 1381, 1385, 1386, 1387, 1391, 1396,
+ 1401, 1409, 1410, 1411, 1412, 1413, 1414, 1415, 1425, 1430,
+ 1438, 1443, 1451, 1453, 1457, 1462, 1467, 1475, 1480, 1488,
+ 1497, 1498, 1502, 1503, 1512, 1530, 1534, 1539, 1547, 1552,
+ 1553, 1557, 1562, 1570, 1575, 1580, 1585, 1590, 1598, 1603,
+ 1608, 1616, 1621, 1622, 1623, 1624, 1625
};
#endif
@@ -944,29 +1075,29 @@ static const char *const yytname[] =
"T_Step", "T_Stepback", "T_Stepfwd", "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", "'='", "'('",
- "')'", "'{'", "'}'", "$accept", "configuration", "command_list",
- "command", "server_command", "client_type", "address", "ip_address",
- "address_fam", "option_list", "option", "option_flag",
- "option_flag_keyword", "option_int", "option_int_keyword", "option_str",
- "option_str_keyword", "unpeer_command", "unpeer_keyword",
- "other_mode_command", "authentication_command", "crypto_command_list",
- "crypto_command", "crypto_str_keyword", "orphan_mode_command",
- "tos_option_list", "tos_option", "tos_option_int_keyword",
- "tos_option_dbl_keyword", "monitoring_command", "stats_list", "stat",
- "filegen_option_list", "filegen_option", "link_nolink", "enable_disable",
- "filegen_type", "access_control_command", "ac_flag_list",
- "access_control_flag", "discard_option_list", "discard_option",
- "discard_option_keyword", "mru_option_list", "mru_option",
- "mru_option_keyword", "fudge_command", "fudge_factor_list",
- "fudge_factor", "fudge_factor_dbl_keyword", "fudge_factor_bool_keyword",
- "rlimit_command", "rlimit_option_list", "rlimit_option",
- "rlimit_option_keyword", "system_option_command", "system_option_list",
- "system_option", "system_option_flag_keyword",
+ "T_Trustedkey", "T_Ttl", "T_Type", "T_U_int", "T_UEcrypto",
+ "T_UEcryptonak", "T_UEdigest", "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", "'='", "'('", "')'", "'{'", "'}'",
+ "$accept", "configuration", "command_list", "command", "server_command",
+ "client_type", "address", "ip_address", "address_fam", "option_list",
+ "option", "option_flag", "option_flag_keyword", "option_int",
+ "option_int_keyword", "option_str", "option_str_keyword",
+ "unpeer_command", "unpeer_keyword", "other_mode_command",
+ "authentication_command", "crypto_command_list", "crypto_command",
+ "crypto_str_keyword", "orphan_mode_command", "tos_option_list",
+ "tos_option", "tos_option_int_keyword", "tos_option_dbl_keyword",
+ "monitoring_command", "stats_list", "stat", "filegen_option_list",
+ "filegen_option", "link_nolink", "enable_disable", "filegen_type",
+ "access_control_command", "ac_flag_list", "access_control_flag",
+ "discard_option_list", "discard_option", "discard_option_keyword",
+ "mru_option_list", "mru_option", "mru_option_keyword", "fudge_command",
+ "fudge_factor_list", "fudge_factor", "fudge_factor_dbl_keyword",
+ "fudge_factor_bool_keyword", "rlimit_command", "rlimit_option_list",
+ "rlimit_option", "rlimit_option_keyword", "system_option_command",
+ "system_option_list", "system_option", "system_option_flag_keyword",
"system_option_local_flag_keyword", "tinker_command",
"tinker_option_list", "tinker_option", "tinker_option_keyword",
"miscellaneous_command", "misc_cmd_dbl_keyword", "misc_cmd_int_keyword",
@@ -981,13 +1112,13 @@ static const char *const yytname[] =
"sim_init_statement_list", "sim_init_statement", "sim_init_keyword",
"sim_server_list", "sim_server", "sim_server_offset", "sim_server_name",
"sim_act_list", "sim_act", "sim_act_stmt_list", "sim_act_stmt",
- "sim_act_keyword", YY_NULLPTR
+ "sim_act_keyword", YY_NULL
};
#endif
# ifdef YYPRINT
-/* YYTOKNUM[NUM] -- (External) token number corresponding to the
- (internal) symbol number NUM (which must be that of a token). */
+/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
+ token YYLEX-NUM. */
static const yytype_uint16 yytoknum[] =
{
0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
@@ -1009,292 +1140,363 @@ static const yytype_uint16 yytoknum[] =
415, 416, 417, 418, 419, 420, 421, 422, 423, 424,
425, 426, 427, 428, 429, 430, 431, 432, 433, 434,
435, 436, 437, 438, 439, 440, 441, 442, 443, 444,
- 445, 446, 447, 448, 61, 40, 41, 123, 125
+ 445, 446, 447, 448, 449, 450, 451, 61, 40, 41,
+ 123, 125
};
# endif
-#define YYPACT_NINF -185
-
-#define yypact_value_is_default(Yystate) \
- (!!((Yystate) == (-185)))
-
-#define YYTABLE_NINF -7
-
-#define yytable_value_is_error(Yytable_value) \
- 0
+/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
+static const yytype_uint16 yyr1[] =
+{
+ 0, 202, 203, 204, 204, 204, 205, 205, 205, 205,
+ 205, 205, 205, 205, 205, 205, 205, 205, 205, 205,
+ 206, 207, 207, 207, 207, 207, 208, 208, 209, 210,
+ 210, 211, 211, 212, 212, 212, 213, 214, 214, 214,
+ 214, 214, 214, 214, 214, 215, 215, 216, 216, 216,
+ 216, 216, 216, 217, 218, 219, 220, 220, 221, 221,
+ 221, 221, 222, 222, 222, 222, 222, 222, 222, 222,
+ 222, 223, 223, 224, 224, 225, 225, 225, 225, 225,
+ 226, 227, 227, 228, 228, 228, 229, 229, 229, 229,
+ 229, 229, 230, 230, 230, 230, 231, 231, 231, 232,
+ 232, 233, 233, 233, 233, 233, 233, 233, 233, 234,
+ 234, 235, 235, 235, 235, 236, 236, 237, 237, 238,
+ 238, 238, 238, 238, 238, 238, 239, 239, 239, 239,
+ 239, 239, 239, 239, 240, 240, 241, 241, 241, 241,
+ 241, 241, 241, 241, 241, 241, 241, 241, 241, 241,
+ 241, 242, 242, 243, 244, 244, 244, 245, 245, 246,
+ 247, 247, 247, 247, 247, 247, 247, 247, 248, 249,
+ 249, 250, 250, 250, 250, 250, 251, 251, 252, 252,
+ 252, 252, 253, 254, 254, 255, 256, 256, 256, 257,
+ 257, 258, 258, 259, 259, 260, 260, 260, 260, 260,
+ 260, 261, 261, 261, 261, 261, 262, 263, 263, 264,
+ 265, 265, 265, 265, 265, 265, 265, 265, 265, 265,
+ 266, 266, 266, 266, 266, 266, 266, 266, 266, 266,
+ 266, 266, 266, 266, 267, 267, 267, 268, 268, 269,
+ 269, 270, 270, 270, 271, 271, 271, 272, 273, 273,
+ 274, 274, 275, 275, 276, 276, 277, 278, 278, 279,
+ 279, 280, 280, 280, 280, 281, 281, 281, 282, 283,
+ 283, 284, 284, 284, 284, 284, 284, 284, 285, 285,
+ 286, 286, 287, 287, 288, 289, 289, 290, 290, 291,
+ 291, 291, 292, 292, 293, 294, 295, 295, 296, 297,
+ 297, 298, 298, 299, 300, 301, 302, 302, 303, 304,
+ 304, 305, 306, 306, 306, 306, 306
+};
- /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
- STATE-NUM. */
-static const yytype_int16 yypact[] =
+/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
+static const yytype_uint8 yyr2[] =
{
- 78, -169, -34, -185, -185, -185, -29, -185, 17, 43,
- -124, -185, 17, -185, -5, -27, -185, -121, -185, -112,
- -110, -185, -185, -100, -185, -185, -27, 0, 116, -27,
- -185, -185, -91, -185, -89, -185, -185, 11, 35, 30,
- 13, 31, -185, -185, -83, -5, -78, -185, 186, 523,
- -76, -56, 15, -185, -185, -185, 83, 244, -99, -185,
- -27, -185, -27, -185, -185, -185, -185, -185, -185, -185,
- -185, -185, -185, -12, 24, -71, -69, -185, -11, -185,
- -185, -107, -185, -185, -185, 8, -185, -185, -185, -185,
- -185, -185, -185, -185, 17, -185, -185, -185, -185, -185,
- -185, 43, -185, 34, 59, -185, 17, -185, -185, -185,
- -185, -185, -185, -185, -185, -185, -185, -185, -185, 7,
- -185, -61, 407, -185, -185, -185, -100, -185, -185, -27,
- -185, -185, -185, -185, -185, -185, -185, -185, -185, 116,
- -185, 44, -27, -185, -185, -52, -185, -185, -185, -185,
- -185, -185, -185, -185, 35, -185, -185, 85, 96, -185,
- -185, 39, -185, -185, -185, -185, 31, -185, 75, -46,
- -185, -5, -185, -185, -185, -185, -185, -185, -185, -185,
- -185, -185, -185, -185, 186, -185, -12, -185, -185, -35,
- -185, -185, -185, -185, -185, -185, -185, -185, 523, -185,
- 82, -12, -185, -185, 91, -56, -185, -185, -185, 100,
- -185, -26, -185, -185, -185, -185, -185, -185, -185, -185,
- -185, -185, -185, -185, -2, -130, -185, -185, -185, -185,
- -185, 105, -185, 9, -185, -185, -185, -185, -7, 18,
- -185, -185, -185, -185, 25, 121, -185, -185, 7, -185,
- -12, -35, -185, -185, -185, -185, -185, -185, -185, -185,
- 391, -185, -185, 391, 391, -76, -185, -185, 29, -185,
- -185, -185, -185, -185, -185, -185, -185, -185, -185, -51,
- 153, -185, -185, -185, 464, -185, -185, -185, -185, -185,
- -185, -185, -185, -82, 14, 1, -185, -185, -185, -185,
- 38, -185, -185, 12, -185, -185, -185, -185, -185, -185,
- -185, -185, -185, -185, -185, -185, -185, -185, -185, -185,
- -185, -185, -185, -185, -185, -185, -185, -185, -185, 391,
- 391, -185, 171, -76, 140, -185, 141, -185, -185, -185,
- -185, -185, -185, -185, -185, -185, -185, -185, -185, -185,
- -185, -185, -185, -185, -185, -185, -55, -185, 53, 20,
- 33, -128, -185, 32, -185, -12, -185, -185, -185, -185,
- -185, -185, -185, -185, -185, 391, -185, -185, -185, -185,
- 16, -185, -185, -185, -27, -185, -185, -185, 46, -185,
- -185, -185, 37, 48, -12, 40, -167, -185, 54, -12,
- -185, -185, -185, 45, 79, -185, -185, -185, -185, -185,
- 98, 57, 47, -185, 60, -185, -12, -185, -185
+ 0, 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, 1, 1, 1, 2, 2, 1, 2,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 2, 2, 2, 2, 3, 1, 2, 2,
+ 2, 2, 3, 2, 1, 1, 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
};
- /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
- Performed when YYTABLE does not specify something else to do. Zero
- means the default is an error. */
+/* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM.
+ Performed when YYTABLE doesn't specify something else to do. Zero
+ means the default is an error. */
static const yytype_uint16 yydefact[] =
{
- 0, 0, 0, 24, 58, 231, 0, 71, 0, 0,
- 243, 234, 0, 224, 0, 0, 236, 0, 256, 0,
- 0, 237, 235, 0, 238, 25, 0, 0, 0, 0,
- 257, 232, 0, 23, 0, 239, 22, 0, 0, 0,
- 0, 0, 240, 21, 0, 0, 0, 233, 0, 0,
- 0, 0, 0, 56, 57, 292, 0, 2, 0, 7,
+ 0, 0, 0, 24, 58, 234, 0, 71, 0, 0,
+ 246, 237, 0, 227, 0, 0, 239, 0, 259, 0,
+ 0, 240, 238, 0, 241, 25, 0, 0, 0, 0,
+ 260, 235, 0, 23, 0, 242, 22, 0, 0, 0,
+ 0, 0, 243, 21, 0, 0, 0, 236, 0, 0,
+ 0, 0, 0, 56, 57, 295, 0, 2, 0, 7,
0, 8, 0, 9, 10, 13, 11, 12, 14, 15,
- 16, 17, 18, 0, 0, 0, 0, 217, 0, 218,
+ 16, 17, 18, 0, 0, 0, 0, 220, 0, 221,
19, 0, 5, 62, 63, 64, 195, 196, 197, 198,
- 201, 199, 200, 202, 190, 192, 193, 194, 154, 155,
- 156, 126, 152, 0, 241, 225, 189, 101, 102, 103,
- 104, 108, 105, 106, 107, 109, 29, 30, 28, 0,
- 26, 0, 6, 65, 66, 253, 226, 252, 285, 59,
- 61, 160, 161, 162, 163, 164, 165, 166, 167, 127,
- 158, 0, 60, 70, 283, 227, 67, 268, 269, 270,
- 271, 272, 273, 274, 265, 267, 134, 29, 30, 134,
- 134, 26, 68, 188, 186, 187, 182, 184, 0, 0,
- 228, 96, 100, 97, 207, 208, 209, 210, 211, 212,
- 213, 214, 215, 216, 203, 205, 0, 91, 86, 0,
- 87, 95, 93, 94, 92, 90, 88, 89, 80, 82,
- 0, 0, 247, 279, 0, 69, 278, 280, 276, 230,
- 1, 0, 4, 31, 55, 290, 289, 219, 220, 221,
- 222, 264, 263, 262, 0, 0, 79, 75, 76, 77,
- 78, 0, 72, 0, 191, 151, 153, 242, 98, 0,
- 178, 179, 180, 181, 0, 0, 176, 177, 168, 170,
- 0, 0, 27, 223, 251, 284, 157, 159, 282, 266,
- 130, 134, 134, 133, 128, 0, 183, 185, 0, 99,
- 204, 206, 288, 286, 287, 85, 81, 83, 84, 229,
- 0, 277, 275, 3, 20, 258, 259, 260, 255, 261,
- 254, 296, 297, 0, 0, 0, 74, 73, 118, 117,
- 0, 115, 116, 0, 110, 113, 114, 174, 175, 173,
- 169, 171, 172, 136, 137, 138, 139, 140, 141, 142,
- 143, 144, 145, 146, 147, 148, 149, 150, 135, 131,
- 132, 134, 246, 0, 0, 248, 0, 37, 38, 39,
- 54, 47, 49, 48, 51, 40, 41, 42, 43, 50,
- 52, 44, 32, 33, 36, 34, 0, 35, 0, 0,
- 0, 0, 299, 0, 294, 0, 111, 125, 121, 123,
- 119, 120, 122, 124, 112, 129, 245, 244, 250, 249,
- 0, 45, 46, 53, 0, 293, 291, 298, 0, 295,
- 281, 302, 0, 0, 0, 0, 0, 304, 0, 0,
- 300, 303, 301, 0, 0, 309, 310, 311, 312, 313,
- 0, 0, 0, 305, 0, 307, 0, 306, 308
+ 201, 199, 200, 202, 203, 204, 205, 190, 192, 193,
+ 194, 154, 155, 156, 126, 152, 0, 244, 228, 189,
+ 101, 102, 103, 104, 108, 105, 106, 107, 109, 29,
+ 30, 28, 0, 26, 0, 6, 65, 66, 256, 229,
+ 255, 288, 59, 61, 160, 161, 162, 163, 164, 165,
+ 166, 167, 127, 158, 0, 60, 70, 286, 230, 67,
+ 271, 272, 273, 274, 275, 276, 277, 268, 270, 134,
+ 29, 30, 134, 134, 26, 68, 188, 186, 187, 182,
+ 184, 0, 0, 231, 96, 100, 97, 210, 211, 212,
+ 213, 214, 215, 216, 217, 218, 219, 206, 208, 0,
+ 91, 86, 0, 87, 95, 93, 94, 92, 90, 88,
+ 89, 80, 82, 0, 0, 250, 282, 0, 69, 281,
+ 283, 279, 233, 1, 0, 4, 31, 55, 293, 292,
+ 222, 223, 224, 225, 267, 266, 265, 0, 0, 79,
+ 75, 76, 77, 78, 0, 72, 0, 191, 151, 153,
+ 245, 98, 0, 178, 179, 180, 181, 0, 0, 176,
+ 177, 168, 170, 0, 0, 27, 226, 254, 287, 157,
+ 159, 285, 269, 130, 134, 134, 133, 128, 0, 183,
+ 185, 0, 99, 207, 209, 291, 289, 290, 85, 81,
+ 83, 84, 232, 0, 280, 278, 3, 20, 261, 262,
+ 263, 258, 264, 257, 299, 300, 0, 0, 0, 74,
+ 73, 118, 117, 0, 115, 116, 0, 110, 113, 114,
+ 174, 175, 173, 169, 171, 172, 136, 137, 138, 139,
+ 140, 141, 142, 143, 144, 145, 146, 147, 148, 149,
+ 150, 135, 131, 132, 134, 249, 0, 0, 251, 0,
+ 37, 38, 39, 54, 47, 49, 48, 51, 40, 41,
+ 42, 43, 50, 52, 44, 32, 33, 36, 34, 0,
+ 35, 0, 0, 0, 0, 302, 0, 297, 0, 111,
+ 125, 121, 123, 119, 120, 122, 124, 112, 129, 248,
+ 247, 253, 252, 0, 45, 46, 53, 0, 296, 294,
+ 301, 0, 298, 284, 305, 0, 0, 0, 0, 0,
+ 307, 0, 0, 303, 306, 304, 0, 0, 312, 313,
+ 314, 315, 316, 0, 0, 0, 308, 0, 310, 0,
+ 309, 311
};
- /* YYPGOTO[NTERM-NUM]. */
-static const yytype_int16 yypgoto[] =
+/* YYDEFGOTO[NTERM-NUM]. */
+static const yytype_int16 yydefgoto[] =
{
- -185, -185, -185, -44, -185, -185, -15, -38, -185, -185,
- -185, -185, -185, -185, -185, -185, -185, -185, -185, -185,
- -185, -185, -185, -185, -185, -185, 28, -185, -185, -185,
- -185, -36, -185, -185, -185, -185, -185, -185, -152, -185,
- -185, 146, -185, -185, 111, -185, -185, -185, 3, -185,
- -185, -185, -185, 89, -185, -185, 245, -66, -185, -185,
- -185, -185, 72, -185, -185, -185, -185, -185, -185, -185,
- -185, -185, -185, -185, -185, 137, -185, -185, -185, -185,
- -185, -185, 110, -185, -185, 70, -185, -185, 236, 27,
- -184, -185, -185, -185, -17, -185, -185, -81, -185, -185,
- -185, -113, -185, -126, -185
+ -1, 56, 57, 58, 59, 60, 131, 123, 124, 287,
+ 355, 356, 357, 358, 359, 360, 361, 61, 62, 63,
+ 64, 85, 235, 236, 65, 201, 202, 203, 204, 66,
+ 174, 118, 241, 307, 308, 309, 377, 67, 263, 331,
+ 104, 105, 106, 142, 143, 144, 68, 251, 252, 253,
+ 254, 69, 169, 170, 171, 70, 97, 98, 99, 100,
+ 71, 187, 188, 189, 72, 73, 74, 75, 76, 108,
+ 173, 380, 282, 338, 129, 130, 77, 78, 293, 227,
+ 79, 157, 158, 212, 208, 209, 210, 148, 132, 278,
+ 220, 80, 81, 296, 297, 298, 364, 365, 396, 366,
+ 399, 400, 413, 414, 415
};
- /* YYDEFGOTO[NTERM-NUM]. */
-static const yytype_int16 yydefgoto[] =
+/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
+ STATE-NUM. */
+#define YYPACT_NINF -188
+static const yytype_int16 yypact[] =
{
- -1, 56, 57, 58, 59, 60, 128, 120, 121, 284,
- 352, 353, 354, 355, 356, 357, 358, 61, 62, 63,
- 64, 85, 232, 233, 65, 198, 199, 200, 201, 66,
- 171, 115, 238, 304, 305, 306, 374, 67, 260, 328,
- 101, 102, 103, 139, 140, 141, 68, 248, 249, 250,
- 251, 69, 166, 167, 168, 70, 94, 95, 96, 97,
- 71, 184, 185, 186, 72, 73, 74, 75, 76, 105,
- 170, 377, 279, 335, 126, 127, 77, 78, 290, 224,
- 79, 154, 155, 209, 205, 206, 207, 145, 129, 275,
- 217, 80, 81, 293, 294, 295, 361, 362, 393, 363,
- 396, 397, 410, 411, 412
+ 5, -160, -28, -188, -188, -188, -24, -188, 60, 0,
+ -119, -188, 60, -188, 118, 7, -188, -117, -188, -110,
+ -108, -188, -188, -101, -188, -188, 7, -1, 345, 7,
+ -188, -188, -96, -188, -95, -188, -188, 21, -3, 73,
+ 33, 11, -188, -188, -94, 118, -61, -188, 43, 446,
+ -57, -58, 41, -188, -188, -188, 105, 179, -79, -188,
+ 7, -188, 7, -188, -188, -188, -188, -188, -188, -188,
+ -188, -188, -188, -7, 48, -48, -39, -188, 24, -188,
+ -188, -86, -188, -188, -188, 42, -188, -188, -188, -188,
+ -188, -188, -188, -188, -188, -188, -188, 60, -188, -188,
+ -188, -188, -188, -188, 0, -188, 59, 89, -188, 60,
+ -188, -188, -188, -188, -188, -188, -188, -188, -188, -188,
+ -188, -188, 80, -188, 9, 338, -188, -188, -188, -101,
+ -188, -188, 7, -188, -188, -188, -188, -188, -188, -188,
+ -188, -188, 345, -188, 67, 7, -188, -188, 12, -188,
+ -188, -188, -188, -188, -188, -188, -188, -3, -188, -188,
+ 107, 116, -188, -188, 83, -188, -188, -188, -188, 11,
+ -188, 113, -20, -188, 118, -188, -188, -188, -188, -188,
+ -188, -188, -188, -188, -188, -188, -188, 43, -188, -7,
+ -188, -188, -25, -188, -188, -188, -188, -188, -188, -188,
+ -188, 446, -188, 127, -7, -188, -188, 129, -58, -188,
+ -188, -188, 142, -188, 19, -188, -188, -188, -188, -188,
+ -188, -188, -188, -188, -188, -188, -188, 4, -158, -188,
+ -188, -188, -188, -188, 145, -188, 49, -188, -188, -188,
+ -188, 233, 55, -188, -188, -188, -188, 64, 157, -188,
+ -188, 80, -188, -7, -25, -188, -188, -188, -188, -188,
+ -188, -188, -188, 445, -188, -188, 445, 445, -57, -188,
+ -188, 82, -188, -188, -188, -188, -188, -188, -188, -188,
+ -188, -188, -44, 202, -188, -188, -188, 324, -188, -188,
+ -188, -188, -188, -188, -188, -188, -30, 58, 50, -188,
+ -188, -188, -188, 88, -188, -188, 3, -188, -188, -188,
+ -188, -188, -188, -188, -188, -188, -188, -188, -188, -188,
+ -188, -188, -188, -188, -188, -188, -188, -188, -188, -188,
+ -188, -188, 445, 445, -188, 221, -57, 188, -188, 191,
+ -188, -188, -188, -188, -188, -188, -188, -188, -188, -188,
+ -188, -188, -188, -188, -188, -188, -188, -188, -188, -51,
+ -188, 99, 61, 75, -114, -188, 65, -188, -7, -188,
+ -188, -188, -188, -188, -188, -188, -188, -188, 445, -188,
+ -188, -188, -188, 68, -188, -188, -188, 7, -188, -188,
+ -188, 76, -188, -188, -188, 71, 78, -7, 74, -178,
+ -188, 90, -7, -188, -188, -188, 77, 32, -188, -188,
+ -188, -188, -188, 101, 93, 84, -188, 94, -188, -7,
+ -188, -188
};
- /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
- positive, shift that token. If negative, reduce the rule whose
- number is the opposite. If YYTABLE_NINF, syntax error. */
+/* YYPGOTO[NTERM-NUM]. */
+static const yytype_int16 yypgoto[] =
+{
+ -188, -188, -188, -41, -188, -188, -15, -38, -188, -188,
+ -188, -188, -188, -188, -188, -188, -188, -188, -188, -188,
+ -188, -188, -188, -188, -188, -188, 81, -188, -188, -188,
+ -188, -37, -188, -188, -188, -188, -188, -188, -111, -188,
+ -188, 170, -188, -188, 133, -188, -188, -188, 37, -188,
+ -188, -188, -188, 115, -188, -188, 277, -53, -188, -188,
+ -188, -188, 103, -188, -188, -188, -188, -188, -188, -188,
+ -188, -188, -188, -188, -188, 162, -188, -188, -188, -188,
+ -188, -188, 143, -188, -188, 91, -188, -188, 274, 52,
+ -187, -188, -188, -188, 8, -188, -188, -56, -188, -188,
+ -188, -87, -188, -100, -188
+};
+
+/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
+ positive, shift that token. If negative, reduce the rule which
+ number is the opposite. If YYTABLE_NINF, syntax error. */
+#define YYTABLE_NINF -7
static const yytype_int16 yytable[] =
{
- 119, 161, 271, 285, 272, 203, 381, 263, 264, 172,
- 239, 333, 202, 211, 82, 107, 367, 278, 359, 108,
- 215, 395, 298, 221, 160, 86, 273, 83, 234, 87,
- 299, 400, 84, 300, 104, 88, 226, 122, 368, 116,
- 234, 117, 147, 148, 222, 213, 123, 214, 124, 216,
- 240, 241, 242, 243, 98, 291, 292, 156, 125, 227,
- 149, 130, 228, 286, 359, 287, 311, 143, 223, 144,
- 386, 301, 146, 163, 162, 169, 208, 109, 253, 1,
- 173, 334, 118, 210, 212, 218, 89, 219, 2, 220,
- 225, 237, 3, 4, 5, 236, 157, 252, 158, 150,
- 6, 7, 302, 291, 292, 257, 258, 8, 9, 329,
- 330, 10, 261, 11, 255, 12, 13, 369, 382, 14,
- 90, 91, 110, 262, 370, 265, 164, 255, 15, 151,
- 111, 118, 16, 112, 274, 269, 267, 92, 17, 204,
- 18, 371, 99, 277, 229, 230, 244, 100, 268, 19,
- 20, 231, 280, 21, 22, 113, 288, 283, 23, 24,
- 114, 282, 25, 26, 245, 303, 296, 297, 93, 246,
- 247, 27, 131, 132, 133, 134, 307, 289, 159, 375,
- 165, 389, 309, 308, 28, 29, 30, 332, 118, 336,
- 372, 31, 174, 373, 152, 365, 366, 364, 376, 153,
- 32, 379, 380, 135, 33, 136, 34, 137, 35, 36,
- 398, 383, 390, 138, 384, 403, 385, 175, 37, 38,
- 39, 40, 41, 42, 43, 44, 276, 331, 45, 388,
- 46, 394, 418, 392, 399, 176, 395, 402, 177, 47,
- 415, 416, 404, 417, 48, 49, 50, 235, 51, 52,
- 256, 310, 53, 54, 2, 266, 270, 106, 3, 4,
- 5, -6, 55, 254, 259, 142, 6, 7, 405, 406,
- 407, 408, 409, 8, 9, 281, 360, 10, 312, 11,
- 387, 12, 13, 401, 414, 14, 0, 405, 406, 407,
- 408, 409, 0, 0, 15, 378, 413, 0, 16, 0,
- 0, 0, 0, 0, 17, 0, 18, 0, 0, 0,
- 0, 178, 0, 0, 0, 19, 20, 0, 0, 21,
- 22, 0, 0, 0, 23, 24, 0, 0, 25, 26,
- 0, 0, 0, 0, 0, 0, 0, 27, 0, 179,
- 180, 181, 182, 0, 0, 0, 0, 183, 0, 0,
- 28, 29, 30, 0, 0, 0, 0, 31, 0, 0,
- 0, 0, 0, 0, 0, 0, 32, 0, 0, 391,
- 33, 0, 34, 0, 35, 36, 0, 0, 0, 0,
- 0, 0, 0, 0, 37, 38, 39, 40, 41, 42,
- 43, 44, 0, 0, 45, 0, 46, 0, 0, 0,
- 0, 0, 0, 0, 0, 47, 0, 0, 0, 0,
- 48, 49, 50, 0, 51, 52, 0, 2, 53, 54,
- 0, 3, 4, 5, 0, 0, 0, -6, 55, 6,
- 7, 0, 0, 0, 0, 0, 8, 9, 313, 0,
- 10, 0, 11, 0, 12, 13, 314, 0, 14, 0,
- 0, 0, 0, 0, 0, 0, 0, 15, 0, 0,
- 0, 16, 0, 0, 315, 316, 0, 17, 317, 18,
- 0, 0, 0, 337, 318, 0, 0, 0, 19, 20,
- 0, 338, 21, 22, 0, 0, 0, 23, 24, 0,
- 0, 25, 26, 0, 0, 0, 0, 0, 0, 0,
- 27, 319, 320, 0, 0, 321, 322, 0, 323, 324,
- 325, 0, 326, 28, 29, 30, 0, 339, 340, 0,
- 31, 0, 0, 0, 0, 0, 0, 0, 0, 32,
- 0, 0, 0, 33, 341, 34, 187, 35, 36, 0,
- 0, 0, 188, 0, 189, 0, 0, 37, 38, 39,
- 40, 41, 42, 43, 44, 0, 342, 45, 0, 46,
- 0, 0, 0, 0, 343, 0, 344, 327, 47, 0,
- 0, 190, 0, 48, 49, 50, 0, 51, 52, 0,
- 345, 53, 54, 0, 0, 0, 0, 0, 0, 0,
- 0, 55, 0, 0, 0, 0, 0, 346, 347, 0,
+ 122, 164, 274, 206, 150, 151, 1, 370, 175, 288,
+ 384, 101, 205, 398, 275, 2, 214, 281, 336, 3,
+ 4, 5, 152, 403, 163, 218, 82, 6, 7, 371,
+ 294, 295, 362, 83, 8, 9, 276, 84, 10, 107,
+ 11, 125, 12, 13, 237, 216, 14, 217, 126, 177,
+ 127, 266, 267, 166, 219, 15, 237, 128, 224, 16,
+ 133, 153, 146, 147, 172, 17, 314, 18, 86, 289,
+ 229, 290, 87, 119, 178, 120, 19, 20, 88, 225,
+ 21, 22, 149, 242, 256, 23, 24, 389, 337, 25,
+ 26, 154, 179, 230, 165, 180, 231, 176, 27, 102,
+ 159, 121, 211, 226, 103, 213, 167, 215, 372, 221,
+ 222, 28, 29, 30, 228, 373, 362, 258, 31, 223,
+ 239, 240, 385, 243, 244, 245, 246, 32, 260, 89,
+ 258, 33, 374, 34, 264, 35, 36, 272, 110, 160,
+ 207, 161, 111, 265, 277, 37, 38, 39, 40, 41,
+ 42, 43, 44, 332, 333, 45, 155, 46, 294, 295,
+ 168, 156, 291, 90, 91, 121, 47, 255, 181, 268,
+ 261, 48, 49, 50, 270, 51, 52, 271, 232, 233,
+ 92, 392, 53, 54, 375, 234, 292, 376, 280, 2,
+ 283, -6, 55, 3, 4, 5, 182, 183, 184, 185,
+ 112, 6, 7, 285, 186, 286, 299, 300, 8, 9,
+ 401, 93, 10, 310, 11, 406, 12, 13, 312, 247,
+ 14, 162, 311, 378, 408, 409, 410, 411, 412, 15,
+ 334, 121, 421, 16, 94, 95, 96, 248, 339, 17,
+ 335, 18, 249, 250, 367, 113, 369, 368, 379, 382,
+ 19, 20, 383, 114, 21, 22, 115, 386, 387, 23,
+ 24, 388, 301, 25, 26, 391, 395, 393, 397, 398,
+ 302, 402, 27, 303, 238, 259, 405, 407, 116, 418,
+ 420, 419, 279, 117, 269, 28, 29, 30, 313, 109,
+ 273, 257, 31, 408, 409, 410, 411, 412, 381, 284,
+ 262, 32, 416, 145, 363, 33, 315, 34, 390, 35,
+ 36, 304, 404, 417, 0, 0, 0, 0, 0, 37,
+ 38, 39, 40, 41, 42, 43, 44, 0, 0, 45,
+ 0, 46, 0, 340, 0, 0, 0, 0, 0, 0,
+ 47, 341, 305, 0, 0, 48, 49, 50, 2, 51,
+ 52, 0, 3, 4, 5, 0, 53, 54, 0, 0,
+ 6, 7, 0, 0, 0, -6, 55, 8, 9, 0,
+ 0, 10, 394, 11, 0, 12, 13, 342, 343, 14,
+ 0, 0, 0, 0, 0, 0, 0, 0, 15, 0,
+ 0, 0, 16, 0, 344, 0, 0, 0, 17, 0,
+ 18, 134, 135, 136, 137, 306, 0, 0, 0, 19,
+ 20, 0, 0, 21, 22, 0, 345, 0, 23, 24,
+ 0, 0, 25, 26, 346, 0, 347, 0, 0, 0,
+ 0, 27, 138, 0, 139, 0, 140, 0, 0, 0,
+ 348, 0, 141, 0, 28, 29, 30, 0, 0, 0,
+ 0, 31, 0, 0, 0, 0, 0, 349, 350, 190,
+ 32, 0, 0, 0, 33, 191, 34, 192, 35, 36,
+ 0, 0, 0, 0, 0, 0, 0, 0, 37, 38,
+ 39, 40, 41, 42, 43, 44, 0, 0, 45, 0,
+ 46, 0, 316, 351, 193, 352, 0, 0, 0, 47,
+ 317, 0, 0, 353, 48, 49, 50, 354, 51, 52,
+ 0, 0, 0, 0, 0, 53, 54, 0, 318, 319,
+ 0, 0, 320, 0, 0, 55, 0, 0, 321, 0,
+ 0, 0, 0, 0, 194, 0, 195, 0, 0, 0,
+ 0, 0, 196, 0, 197, 0, 0, 198, 0, 0,
+ 0, 0, 0, 0, 0, 322, 323, 0, 0, 324,
+ 325, 0, 326, 327, 328, 0, 329, 0, 0, 199,
+ 200, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 191, 0, 192, 0, 0, 0, 0, 0, 193,
- 0, 194, 0, 0, 195, 0, 0, 0, 0, 0,
- 0, 0, 0, 348, 0, 349, 0, 0, 0, 0,
- 350, 0, 0, 0, 351, 0, 196, 197
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 330
};
+#define yypact_value_is_default(Yystate) \
+ (!!((Yystate) == (-188)))
+
+#define yytable_value_is_error(Yytable_value) \
+ YYID (0)
+
static const yytype_int16 yycheck[] =
{
- 15, 39, 186, 5, 39, 61, 61, 159, 160, 45,
- 3, 62, 50, 57, 183, 20, 4, 201, 146, 24,
- 32, 188, 29, 34, 39, 8, 61, 61, 94, 12,
- 37, 198, 61, 40, 158, 18, 28, 158, 26, 66,
- 106, 68, 7, 8, 55, 60, 158, 62, 158, 61,
- 43, 44, 45, 46, 11, 185, 186, 27, 158, 51,
- 25, 61, 54, 65, 146, 67, 250, 158, 79, 158,
- 198, 78, 61, 42, 61, 158, 61, 82, 122, 1,
- 158, 132, 158, 0, 183, 61, 69, 158, 10, 158,
- 197, 32, 14, 15, 16, 61, 66, 158, 68, 64,
- 22, 23, 109, 185, 186, 61, 158, 29, 30, 261,
- 262, 33, 27, 35, 129, 37, 38, 105, 173, 41,
- 103, 104, 127, 27, 112, 86, 95, 142, 50, 94,
- 135, 158, 54, 138, 169, 171, 61, 120, 60, 195,
- 62, 129, 99, 61, 136, 137, 139, 104, 194, 71,
- 72, 143, 61, 75, 76, 160, 158, 183, 80, 81,
- 165, 61, 84, 85, 157, 172, 61, 158, 151, 162,
- 163, 93, 56, 57, 58, 59, 158, 179, 148, 331,
- 149, 365, 61, 158, 106, 107, 108, 158, 158, 36,
- 178, 113, 6, 181, 159, 194, 158, 183, 27, 164,
- 122, 61, 61, 87, 126, 89, 128, 91, 130, 131,
- 394, 158, 196, 97, 194, 399, 183, 31, 140, 141,
- 142, 143, 144, 145, 146, 147, 198, 265, 150, 197,
- 152, 194, 416, 187, 194, 49, 188, 183, 52, 161,
- 183, 194, 197, 183, 166, 167, 168, 101, 170, 171,
- 139, 248, 174, 175, 10, 166, 184, 12, 14, 15,
- 16, 183, 184, 126, 154, 29, 22, 23, 189, 190,
- 191, 192, 193, 29, 30, 205, 293, 33, 251, 35,
- 361, 37, 38, 396, 410, 41, -1, 189, 190, 191,
- 192, 193, -1, -1, 50, 333, 198, -1, 54, -1,
- -1, -1, -1, -1, 60, -1, 62, -1, -1, -1,
- -1, 125, -1, -1, -1, 71, 72, -1, -1, 75,
- 76, -1, -1, -1, 80, 81, -1, -1, 84, 85,
- -1, -1, -1, -1, -1, -1, -1, 93, -1, 153,
- 154, 155, 156, -1, -1, -1, -1, 161, -1, -1,
- 106, 107, 108, -1, -1, -1, -1, 113, -1, -1,
- -1, -1, -1, -1, -1, -1, 122, -1, -1, 384,
- 126, -1, 128, -1, 130, 131, -1, -1, -1, -1,
- -1, -1, -1, -1, 140, 141, 142, 143, 144, 145,
- 146, 147, -1, -1, 150, -1, 152, -1, -1, -1,
- -1, -1, -1, -1, -1, 161, -1, -1, -1, -1,
- 166, 167, 168, -1, 170, 171, -1, 10, 174, 175,
- -1, 14, 15, 16, -1, -1, -1, 183, 184, 22,
- 23, -1, -1, -1, -1, -1, 29, 30, 47, -1,
- 33, -1, 35, -1, 37, 38, 55, -1, 41, -1,
- -1, -1, -1, -1, -1, -1, -1, 50, -1, -1,
- -1, 54, -1, -1, 73, 74, -1, 60, 77, 62,
- -1, -1, -1, 9, 83, -1, -1, -1, 71, 72,
- -1, 17, 75, 76, -1, -1, -1, 80, 81, -1,
- -1, 84, 85, -1, -1, -1, -1, -1, -1, -1,
- 93, 110, 111, -1, -1, 114, 115, -1, 117, 118,
- 119, -1, 121, 106, 107, 108, -1, 53, 54, -1,
- 113, -1, -1, -1, -1, -1, -1, -1, -1, 122,
- -1, -1, -1, 126, 70, 128, 13, 130, 131, -1,
- -1, -1, 19, -1, 21, -1, -1, 140, 141, 142,
- 143, 144, 145, 146, 147, -1, 92, 150, -1, 152,
- -1, -1, -1, -1, 100, -1, 102, 176, 161, -1,
- -1, 48, -1, 166, 167, 168, -1, 170, 171, -1,
- 116, 174, 175, -1, -1, -1, -1, -1, -1, -1,
- -1, 184, -1, -1, -1, -1, -1, 133, 134, -1,
+ 15, 39, 189, 61, 7, 8, 1, 4, 45, 5,
+ 61, 11, 50, 191, 39, 10, 57, 204, 62, 14,
+ 15, 16, 25, 201, 39, 32, 186, 22, 23, 26,
+ 188, 189, 146, 61, 29, 30, 61, 61, 33, 158,
+ 35, 158, 37, 38, 97, 60, 41, 62, 158, 6,
+ 158, 162, 163, 42, 61, 50, 109, 158, 34, 54,
+ 61, 64, 158, 158, 158, 60, 253, 62, 8, 65,
+ 28, 67, 12, 66, 31, 68, 71, 72, 18, 55,
+ 75, 76, 61, 3, 125, 80, 81, 201, 132, 84,
+ 85, 94, 49, 51, 61, 52, 54, 158, 93, 99,
+ 27, 158, 61, 79, 104, 0, 95, 186, 105, 61,
+ 158, 106, 107, 108, 200, 112, 146, 132, 113, 158,
+ 61, 32, 173, 43, 44, 45, 46, 122, 61, 69,
+ 145, 126, 129, 128, 27, 130, 131, 174, 20, 66,
+ 198, 68, 24, 27, 169, 140, 141, 142, 143, 144,
+ 145, 146, 147, 264, 265, 150, 159, 152, 188, 189,
+ 149, 164, 158, 103, 104, 158, 161, 158, 125, 86,
+ 158, 166, 167, 168, 61, 170, 171, 197, 136, 137,
+ 120, 368, 177, 178, 181, 143, 182, 184, 61, 10,
+ 61, 186, 187, 14, 15, 16, 153, 154, 155, 156,
+ 82, 22, 23, 61, 161, 186, 61, 158, 29, 30,
+ 397, 151, 33, 158, 35, 402, 37, 38, 61, 139,
+ 41, 148, 158, 334, 192, 193, 194, 195, 196, 50,
+ 268, 158, 419, 54, 174, 175, 176, 157, 36, 60,
+ 158, 62, 162, 163, 186, 127, 158, 197, 27, 61,
+ 71, 72, 61, 135, 75, 76, 138, 158, 197, 80,
+ 81, 186, 29, 84, 85, 200, 190, 199, 197, 191,
+ 37, 197, 93, 40, 104, 142, 186, 200, 160, 186,
+ 186, 197, 201, 165, 169, 106, 107, 108, 251, 12,
+ 187, 129, 113, 192, 193, 194, 195, 196, 336, 208,
+ 157, 122, 201, 29, 296, 126, 254, 128, 364, 130,
+ 131, 78, 399, 413, -1, -1, -1, -1, -1, 140,
+ 141, 142, 143, 144, 145, 146, 147, -1, -1, 150,
+ -1, 152, -1, 9, -1, -1, -1, -1, -1, -1,
+ 161, 17, 109, -1, -1, 166, 167, 168, 10, 170,
+ 171, -1, 14, 15, 16, -1, 177, 178, -1, -1,
+ 22, 23, -1, -1, -1, 186, 187, 29, 30, -1,
+ -1, 33, 387, 35, -1, 37, 38, 53, 54, 41,
+ -1, -1, -1, -1, -1, -1, -1, -1, 50, -1,
+ -1, -1, 54, -1, 70, -1, -1, -1, 60, -1,
+ 62, 56, 57, 58, 59, 172, -1, -1, -1, 71,
+ 72, -1, -1, 75, 76, -1, 92, -1, 80, 81,
+ -1, -1, 84, 85, 100, -1, 102, -1, -1, -1,
+ -1, 93, 87, -1, 89, -1, 91, -1, -1, -1,
+ 116, -1, 97, -1, 106, 107, 108, -1, -1, -1,
+ -1, 113, -1, -1, -1, -1, -1, 133, 134, 13,
+ 122, -1, -1, -1, 126, 19, 128, 21, 130, 131,
+ -1, -1, -1, -1, -1, -1, -1, -1, 140, 141,
+ 142, 143, 144, 145, 146, 147, -1, -1, 150, -1,
+ 152, -1, 47, 169, 48, 171, -1, -1, -1, 161,
+ 55, -1, -1, 179, 166, 167, 168, 183, 170, 171,
+ -1, -1, -1, -1, -1, 177, 178, -1, 73, 74,
+ -1, -1, 77, -1, -1, 187, -1, -1, 83, -1,
+ -1, -1, -1, -1, 88, -1, 90, -1, -1, -1,
+ -1, -1, 96, -1, 98, -1, -1, 101, -1, -1,
+ -1, -1, -1, -1, -1, 110, 111, -1, -1, 114,
+ 115, -1, 117, 118, 119, -1, 121, -1, -1, 123,
+ 124, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 88, -1, 90, -1, -1, -1, -1, -1, 96,
- -1, 98, -1, -1, 101, -1, -1, -1, -1, -1,
- -1, -1, -1, 169, -1, 171, -1, -1, -1, -1,
- 176, -1, -1, -1, 180, -1, 123, 124
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, 179
};
- /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
- symbol of state STATE-NUM. */
+/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
+ symbol of state STATE-NUM. */
static const yytype_uint16 yystos[] =
{
0, 1, 10, 14, 15, 16, 22, 23, 29, 30,
@@ -1302,129 +1504,70 @@ static const yytype_uint16 yystos[] =
72, 75, 76, 80, 81, 84, 85, 93, 106, 107,
108, 113, 122, 126, 128, 130, 131, 140, 141, 142,
143, 144, 145, 146, 147, 150, 152, 161, 166, 167,
- 168, 170, 171, 174, 175, 184, 200, 201, 202, 203,
- 204, 216, 217, 218, 219, 223, 228, 236, 245, 250,
- 254, 259, 263, 264, 265, 266, 267, 275, 276, 279,
- 290, 291, 183, 61, 61, 220, 8, 12, 18, 69,
- 103, 104, 120, 151, 255, 256, 257, 258, 11, 99,
- 104, 239, 240, 241, 158, 268, 255, 20, 24, 82,
- 127, 135, 138, 160, 165, 230, 66, 68, 158, 205,
- 206, 207, 158, 158, 158, 158, 273, 274, 205, 287,
- 61, 56, 57, 58, 59, 87, 89, 91, 97, 242,
- 243, 244, 287, 158, 158, 286, 61, 7, 8, 25,
- 64, 94, 159, 164, 280, 281, 27, 66, 68, 148,
- 205, 206, 61, 42, 95, 149, 251, 252, 253, 158,
- 269, 229, 230, 158, 6, 31, 49, 52, 125, 153,
- 154, 155, 156, 161, 260, 261, 262, 13, 19, 21,
- 48, 88, 90, 96, 98, 101, 123, 124, 224, 225,
- 226, 227, 206, 61, 195, 283, 284, 285, 61, 282,
- 0, 202, 183, 205, 205, 32, 61, 289, 61, 158,
- 158, 34, 55, 79, 278, 197, 28, 51, 54, 136,
- 137, 143, 221, 222, 256, 240, 61, 32, 231, 3,
- 43, 44, 45, 46, 139, 157, 162, 163, 246, 247,
- 248, 249, 158, 202, 274, 205, 243, 61, 158, 281,
- 237, 27, 27, 237, 237, 86, 252, 61, 194, 230,
- 261, 289, 39, 61, 169, 288, 225, 61, 289, 271,
- 61, 284, 61, 183, 208, 5, 65, 67, 158, 179,
- 277, 185, 186, 292, 293, 294, 61, 158, 29, 37,
- 40, 78, 109, 172, 232, 233, 234, 158, 158, 61,
- 247, 289, 288, 47, 55, 73, 74, 77, 83, 110,
- 111, 114, 115, 117, 118, 119, 121, 176, 238, 237,
- 237, 206, 158, 62, 132, 272, 36, 9, 17, 53,
- 54, 70, 92, 100, 102, 116, 133, 134, 169, 171,
- 176, 180, 209, 210, 211, 212, 213, 214, 215, 146,
- 293, 295, 296, 298, 183, 194, 158, 4, 26, 105,
- 112, 129, 178, 181, 235, 237, 27, 270, 206, 61,
- 61, 61, 173, 158, 194, 183, 198, 296, 197, 289,
- 196, 205, 187, 297, 194, 188, 299, 300, 289, 194,
- 198, 300, 183, 289, 197, 189, 190, 191, 192, 193,
- 301, 302, 303, 198, 302, 183, 194, 183, 289
-};
-
- /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
-static const yytype_uint16 yyr1[] =
-{
- 0, 199, 200, 201, 201, 201, 202, 202, 202, 202,
- 202, 202, 202, 202, 202, 202, 202, 202, 202, 202,
- 203, 204, 204, 204, 204, 204, 205, 205, 206, 207,
- 207, 208, 208, 209, 209, 209, 210, 211, 211, 211,
- 211, 211, 211, 211, 211, 212, 212, 213, 213, 213,
- 213, 213, 213, 214, 215, 216, 217, 217, 218, 218,
- 218, 218, 219, 219, 219, 219, 219, 219, 219, 219,
- 219, 220, 220, 221, 221, 222, 222, 222, 222, 222,
- 223, 224, 224, 225, 225, 225, 226, 226, 226, 226,
- 226, 226, 227, 227, 227, 227, 228, 228, 228, 229,
- 229, 230, 230, 230, 230, 230, 230, 230, 230, 231,
- 231, 232, 232, 232, 232, 233, 233, 234, 234, 235,
- 235, 235, 235, 235, 235, 235, 236, 236, 236, 236,
- 236, 236, 236, 236, 237, 237, 238, 238, 238, 238,
- 238, 238, 238, 238, 238, 238, 238, 238, 238, 238,
- 238, 239, 239, 240, 241, 241, 241, 242, 242, 243,
- 244, 244, 244, 244, 244, 244, 244, 244, 245, 246,
- 246, 247, 247, 247, 247, 247, 248, 248, 249, 249,
- 249, 249, 250, 251, 251, 252, 253, 253, 253, 254,
- 254, 255, 255, 256, 256, 257, 257, 257, 257, 257,
- 257, 258, 258, 259, 260, 260, 261, 262, 262, 262,
- 262, 262, 262, 262, 262, 262, 262, 263, 263, 263,
- 263, 263, 263, 263, 263, 263, 263, 263, 263, 263,
- 263, 264, 264, 264, 265, 265, 266, 266, 267, 267,
- 267, 268, 268, 268, 269, 270, 270, 271, 271, 272,
- 272, 273, 273, 274, 275, 275, 276, 276, 277, 277,
- 277, 277, 278, 278, 278, 279, 280, 280, 281, 281,
- 281, 281, 281, 281, 281, 282, 282, 283, 283, 284,
- 284, 285, 286, 286, 287, 287, 288, 288, 288, 289,
- 289, 290, 291, 292, 292, 293, 294, 294, 295, 295,
- 296, 297, 298, 299, 299, 300, 301, 301, 302, 303,
- 303, 303, 303, 303
-};
-
- /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */
-static const yytype_uint8 yyr2[] =
-{
- 0, 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, 1, 1, 2,
- 2, 2, 2, 3, 1, 2, 2, 2, 2, 3,
- 2, 1, 1, 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
+ 168, 170, 171, 177, 178, 187, 203, 204, 205, 206,
+ 207, 219, 220, 221, 222, 226, 231, 239, 248, 253,
+ 257, 262, 266, 267, 268, 269, 270, 278, 279, 282,
+ 293, 294, 186, 61, 61, 223, 8, 12, 18, 69,
+ 103, 104, 120, 151, 174, 175, 176, 258, 259, 260,
+ 261, 11, 99, 104, 242, 243, 244, 158, 271, 258,
+ 20, 24, 82, 127, 135, 138, 160, 165, 233, 66,
+ 68, 158, 208, 209, 210, 158, 158, 158, 158, 276,
+ 277, 208, 290, 61, 56, 57, 58, 59, 87, 89,
+ 91, 97, 245, 246, 247, 290, 158, 158, 289, 61,
+ 7, 8, 25, 64, 94, 159, 164, 283, 284, 27,
+ 66, 68, 148, 208, 209, 61, 42, 95, 149, 254,
+ 255, 256, 158, 272, 232, 233, 158, 6, 31, 49,
+ 52, 125, 153, 154, 155, 156, 161, 263, 264, 265,
+ 13, 19, 21, 48, 88, 90, 96, 98, 101, 123,
+ 124, 227, 228, 229, 230, 209, 61, 198, 286, 287,
+ 288, 61, 285, 0, 205, 186, 208, 208, 32, 61,
+ 292, 61, 158, 158, 34, 55, 79, 281, 200, 28,
+ 51, 54, 136, 137, 143, 224, 225, 259, 243, 61,
+ 32, 234, 3, 43, 44, 45, 46, 139, 157, 162,
+ 163, 249, 250, 251, 252, 158, 205, 277, 208, 246,
+ 61, 158, 284, 240, 27, 27, 240, 240, 86, 255,
+ 61, 197, 233, 264, 292, 39, 61, 169, 291, 228,
+ 61, 292, 274, 61, 287, 61, 186, 211, 5, 65,
+ 67, 158, 182, 280, 188, 189, 295, 296, 297, 61,
+ 158, 29, 37, 40, 78, 109, 172, 235, 236, 237,
+ 158, 158, 61, 250, 292, 291, 47, 55, 73, 74,
+ 77, 83, 110, 111, 114, 115, 117, 118, 119, 121,
+ 179, 241, 240, 240, 209, 158, 62, 132, 275, 36,
+ 9, 17, 53, 54, 70, 92, 100, 102, 116, 133,
+ 134, 169, 171, 179, 183, 212, 213, 214, 215, 216,
+ 217, 218, 146, 296, 298, 299, 301, 186, 197, 158,
+ 4, 26, 105, 112, 129, 181, 184, 238, 240, 27,
+ 273, 209, 61, 61, 61, 173, 158, 197, 186, 201,
+ 299, 200, 292, 199, 208, 190, 300, 197, 191, 302,
+ 303, 292, 197, 201, 303, 186, 292, 200, 192, 193,
+ 194, 195, 196, 304, 305, 306, 201, 305, 186, 197,
+ 186, 292
};
-
-#define yyerrok (yyerrstatus = 0)
-#define yyclearin (yychar = YYEMPTY)
-#define YYEMPTY (-2)
-#define YYEOF 0
-
-#define YYACCEPT goto yyacceptlab
-#define YYABORT goto yyabortlab
-#define YYERROR goto yyerrorlab
-
+#define yyerrok (yyerrstatus = 0)
+#define yyclearin (yychar = YYEMPTY)
+#define YYEMPTY (-2)
+#define YYEOF 0
+
+#define YYACCEPT goto yyacceptlab
+#define YYABORT goto yyabortlab
+#define YYERROR goto yyerrorlab
+
+
+/* Like YYERROR except do call yyerror. This remains here temporarily
+ to ease the transition to the new meaning of YYERROR, for GCC.
+ Once GCC version 2 has supplanted version 1, this can go. However,
+ YYFAIL appears to be in use. Nevertheless, it is formally deprecated
+ in Bison 2.4.2's NEWS entry, where a plan to phase it out is
+ discussed. */
+
+#define YYFAIL goto yyerrlab
+#if defined YYFAIL
+ /* This is here to suppress warnings from the GCC cpp's
+ -Wunused-macros. Normally we don't worry about that warning, but
+ some users do, and we want to make it easy for users to remove
+ YYFAIL uses, which will produce warnings from Bison 2.5. */
+#endif
#define YYRECOVERING() (!!yyerrstatus)
@@ -1441,15 +1584,27 @@ do \
else \
{ \
yyerror (YY_("syntax error: cannot back up")); \
- YYERROR; \
- } \
-while (0)
+ YYERROR; \
+ } \
+while (YYID (0))
/* Error token number */
-#define YYTERROR 1
-#define YYERRCODE 256
+#define YYTERROR 1
+#define YYERRCODE 256
+/* This macro is provided for backward compatibility. */
+#ifndef YY_LOCATION_PRINT
+# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
+#endif
+
+
+/* YYLEX -- calling `yylex' with the right arguments. */
+#ifdef YYLEX_PARAM
+# define YYLEX yylex (YYLEX_PARAM)
+#else
+# define YYLEX yylex ()
+#endif
/* Enable debugging if requested. */
#if YYDEBUG
@@ -1459,36 +1614,40 @@ while (0)
# define YYFPRINTF fprintf
# endif
-# define YYDPRINTF(Args) \
-do { \
- if (yydebug) \
- YYFPRINTF Args; \
-} while (0)
-
-/* This macro is provided for backward compatibility. */
-#ifndef YY_LOCATION_PRINT
-# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
-#endif
+# define YYDPRINTF(Args) \
+do { \
+ if (yydebug) \
+ YYFPRINTF Args; \
+} while (YYID (0))
+# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
+do { \
+ if (yydebug) \
+ { \
+ YYFPRINTF (stderr, "%s ", Title); \
+ yy_symbol_print (stderr, \
+ Type, Value); \
+ YYFPRINTF (stderr, "\n"); \
+ } \
+} while (YYID (0))
-# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
-do { \
- if (yydebug) \
- { \
- YYFPRINTF (stderr, "%s ", Title); \
- yy_symbol_print (stderr, \
- Type, Value); \
- YYFPRINTF (stderr, "\n"); \
- } \
-} while (0)
+/*--------------------------------.
+| Print this symbol on YYOUTPUT. |
+`--------------------------------*/
-/*----------------------------------------.
-| Print this symbol's value on YYOUTPUT. |
-`----------------------------------------*/
-
+/*ARGSUSED*/
+#if (defined __STDC__ || defined __C99__FUNC__ \
+ || defined __cplusplus || defined _MSC_VER)
static void
yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
+#else
+static void
+yy_symbol_value_print (yyoutput, yytype, yyvaluep)
+ FILE *yyoutput;
+ int yytype;
+ YYSTYPE const * const yyvaluep;
+#endif
{
FILE *yyo = yyoutput;
YYUSE (yyo);
@@ -1497,6 +1656,8 @@ yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvalue
# ifdef YYPRINT
if (yytype < YYNTOKENS)
YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
+# else
+ YYUSE (yyoutput);
# endif
YYUSE (yytype);
}
@@ -1506,11 +1667,22 @@ yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvalue
| Print this symbol on YYOUTPUT. |
`--------------------------------*/
+#if (defined __STDC__ || defined __C99__FUNC__ \
+ || defined __cplusplus || defined _MSC_VER)
static void
yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
+#else
+static void
+yy_symbol_print (yyoutput, yytype, yyvaluep)
+ FILE *yyoutput;
+ int yytype;
+ YYSTYPE const * const yyvaluep;
+#endif
{
- YYFPRINTF (yyoutput, "%s %s (",
- yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
+ if (yytype < YYNTOKENS)
+ YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
+ else
+ YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
yy_symbol_value_print (yyoutput, yytype, yyvaluep);
YYFPRINTF (yyoutput, ")");
@@ -1521,8 +1693,16 @@ yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
| TOP (included). |
`------------------------------------------------------------------*/
+#if (defined __STDC__ || defined __C99__FUNC__ \
+ || defined __cplusplus || defined _MSC_VER)
static void
yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
+#else
+static void
+yy_stack_print (yybottom, yytop)
+ yytype_int16 *yybottom;
+ yytype_int16 *yytop;
+#endif
{
YYFPRINTF (stderr, "Stack now");
for (; yybottom <= yytop; yybottom++)
@@ -1533,42 +1713,49 @@ yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
YYFPRINTF (stderr, "\n");
}
-# define YY_STACK_PRINT(Bottom, Top) \
-do { \
- if (yydebug) \
- yy_stack_print ((Bottom), (Top)); \
-} while (0)
+# define YY_STACK_PRINT(Bottom, Top) \
+do { \
+ if (yydebug) \
+ yy_stack_print ((Bottom), (Top)); \
+} while (YYID (0))
/*------------------------------------------------.
| Report that the YYRULE is going to be reduced. |
`------------------------------------------------*/
+#if (defined __STDC__ || defined __C99__FUNC__ \
+ || defined __cplusplus || defined _MSC_VER)
static void
-yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule)
+yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
+#else
+static void
+yy_reduce_print (yyvsp, yyrule)
+ YYSTYPE *yyvsp;
+ int yyrule;
+#endif
{
- unsigned long int yylno = yyrline[yyrule];
int yynrhs = yyr2[yyrule];
int yyi;
+ unsigned long int yylno = yyrline[yyrule];
YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
- yyrule - 1, yylno);
+ yyrule - 1, yylno);
/* The symbols being reduced. */
for (yyi = 0; yyi < yynrhs; yyi++)
{
YYFPRINTF (stderr, " $%d = ", yyi + 1);
- yy_symbol_print (stderr,
- yystos[yyssp[yyi + 1 - yynrhs]],
- &(yyvsp[(yyi + 1) - (yynrhs)])
- );
+ yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
+ &(yyvsp[(yyi + 1) - (yynrhs)])
+ );
YYFPRINTF (stderr, "\n");
}
}
-# define YY_REDUCE_PRINT(Rule) \
-do { \
- if (yydebug) \
- yy_reduce_print (yyssp, yyvsp, Rule); \
-} while (0)
+# define YY_REDUCE_PRINT(Rule) \
+do { \
+ if (yydebug) \
+ yy_reduce_print (yyvsp, Rule); \
+} while (YYID (0))
/* Nonzero means print parse trace. It is left uninitialized so that
multiple parsers can coexist. */
@@ -1582,7 +1769,7 @@ int yydebug;
/* YYINITDEPTH -- initial size of the parser's stacks. */
-#ifndef YYINITDEPTH
+#ifndef YYINITDEPTH
# define YYINITDEPTH 200
#endif
@@ -1605,8 +1792,15 @@ int yydebug;
# define yystrlen strlen
# else
/* Return the length of YYSTR. */
+#if (defined __STDC__ || defined __C99__FUNC__ \
+ || defined __cplusplus || defined _MSC_VER)
static YYSIZE_T
yystrlen (const char *yystr)
+#else
+static YYSIZE_T
+yystrlen (yystr)
+ const char *yystr;
+#endif
{
YYSIZE_T yylen;
for (yylen = 0; yystr[yylen]; yylen++)
@@ -1622,8 +1816,16 @@ yystrlen (const char *yystr)
# else
/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
YYDEST. */
+#if (defined __STDC__ || defined __C99__FUNC__ \
+ || defined __cplusplus || defined _MSC_VER)
static char *
yystpcpy (char *yydest, const char *yysrc)
+#else
+static char *
+yystpcpy (yydest, yysrc)
+ char *yydest;
+ const char *yysrc;
+#endif
{
char *yyd = yydest;
const char *yys = yysrc;
@@ -1653,27 +1855,27 @@ yytnamerr (char *yyres, const char *yystr)
char const *yyp = yystr;
for (;;)
- switch (*++yyp)
- {
- case '\'':
- case ',':
- goto do_not_strip_quotes;
-
- case '\\':
- if (*++yyp != '\\')
- goto do_not_strip_quotes;
- /* Fall through. */
- default:
- if (yyres)
- yyres[yyn] = *yyp;
- yyn++;
- break;
-
- case '"':
- if (yyres)
- yyres[yyn] = '\0';
- return yyn;
- }
+ switch (*++yyp)
+ {
+ case '\'':
+ case ',':
+ goto do_not_strip_quotes;
+
+ case '\\':
+ if (*++yyp != '\\')
+ goto do_not_strip_quotes;
+ /* Fall through. */
+ default:
+ if (yyres)
+ yyres[yyn] = *yyp;
+ yyn++;
+ break;
+
+ case '"':
+ if (yyres)
+ yyres[yyn] = '\0';
+ return yyn;
+ }
do_not_strip_quotes: ;
}
@@ -1696,11 +1898,11 @@ static int
yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
yytype_int16 *yyssp, int yytoken)
{
- YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
+ YYSIZE_T yysize0 = yytnamerr (YY_NULL, yytname[yytoken]);
YYSIZE_T yysize = yysize0;
enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
/* Internationalized format string. */
- const char *yyformat = YY_NULLPTR;
+ const char *yyformat = YY_NULL;
/* Arguments of yyformat. */
char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
/* Number of reported tokens (one for the "unexpected", one per
@@ -1708,6 +1910,10 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
int yycount = 0;
/* There are many possibilities here to consider:
+ - Assume YYFAIL is not used. It's too flawed to consider. See
+ <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html>
+ for details. YYERROR is fine as it does not invoke this
+ function.
- If this state is a consistent state with a default action, then
the only way this function was invoked is if the default action
is an error action. In that case, don't check for expected
@@ -1757,7 +1963,7 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
}
yyarg[yycount++] = yytname[yyx];
{
- YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
+ YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]);
if (! (yysize <= yysize1
&& yysize1 <= YYSTACK_ALLOC_MAXIMUM))
return 2;
@@ -1824,17 +2030,26 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
| Release the memory associated to this symbol. |
`-----------------------------------------------*/
+/*ARGSUSED*/
+#if (defined __STDC__ || defined __C99__FUNC__ \
+ || defined __cplusplus || defined _MSC_VER)
static void
yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
+#else
+static void
+yydestruct (yymsg, yytype, yyvaluep)
+ const char *yymsg;
+ int yytype;
+ YYSTYPE *yyvaluep;
+#endif
{
YYUSE (yyvaluep);
+
if (!yymsg)
yymsg = "Deleting";
YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
- YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
YYUSE (yytype);
- YY_IGNORE_MAYBE_UNINITIALIZED_END
}
@@ -1843,8 +2058,18 @@ yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
/* The lookahead symbol. */
int yychar;
+
+#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
+# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
+# define YY_IGNORE_MAYBE_UNINITIALIZED_END
+#endif
+#ifndef YY_INITIAL_VALUE
+# define YY_INITIAL_VALUE(Value) /* Nothing. */
+#endif
+
/* The semantic value of the lookahead symbol. */
-YYSTYPE yylval;
+YYSTYPE yylval YY_INITIAL_VALUE(yyval_default);
+
/* Number of syntax errors so far. */
int yynerrs;
@@ -1853,16 +2078,35 @@ int yynerrs;
| yyparse. |
`----------*/
+#ifdef YYPARSE_PARAM
+#if (defined __STDC__ || defined __C99__FUNC__ \
+ || defined __cplusplus || defined _MSC_VER)
+int
+yyparse (void *YYPARSE_PARAM)
+#else
+int
+yyparse (YYPARSE_PARAM)
+ void *YYPARSE_PARAM;
+#endif
+#else /* ! YYPARSE_PARAM */
+#if (defined __STDC__ || defined __C99__FUNC__ \
+ || defined __cplusplus || defined _MSC_VER)
int
yyparse (void)
+#else
+int
+yyparse ()
+
+#endif
+#endif
{
int yystate;
/* Number of tokens to shift before error messages enabled. */
int yyerrstatus;
/* The stacks and their tools:
- 'yyss': related to states.
- 'yyvs': related to semantic values.
+ `yyss': related to states.
+ `yyvs': related to semantic values.
Refer to the stacks through separate pointers, to allow yyoverflow
to reallocate them elsewhere. */
@@ -1930,23 +2174,23 @@ yyparse (void)
#ifdef yyoverflow
{
- /* Give user a chance to reallocate the stack. Use copies of
- these so that the &'s don't force the real ones into
- memory. */
- YYSTYPE *yyvs1 = yyvs;
- yytype_int16 *yyss1 = yyss;
-
- /* Each stack pointer address is followed by the size of the
- data in use in that stack, in bytes. This used to be a
- conditional around just the two extra args, but that might
- be undefined if yyoverflow is a macro. */
- yyoverflow (YY_("memory exhausted"),
- &yyss1, yysize * sizeof (*yyssp),
- &yyvs1, yysize * sizeof (*yyvsp),
- &yystacksize);
-
- yyss = yyss1;
- yyvs = yyvs1;
+ /* Give user a chance to reallocate the stack. Use copies of
+ these so that the &'s don't force the real ones into
+ memory. */
+ YYSTYPE *yyvs1 = yyvs;
+ yytype_int16 *yyss1 = yyss;
+
+ /* Each stack pointer address is followed by the size of the
+ data in use in that stack, in bytes. This used to be a
+ conditional around just the two extra args, but that might
+ be undefined if yyoverflow is a macro. */
+ yyoverflow (YY_("memory exhausted"),
+ &yyss1, yysize * sizeof (*yyssp),
+ &yyvs1, yysize * sizeof (*yyvsp),
+ &yystacksize);
+
+ yyss = yyss1;
+ yyvs = yyvs1;
}
#else /* no yyoverflow */
# ifndef YYSTACK_RELOCATE
@@ -1954,22 +2198,22 @@ yyparse (void)
# else
/* Extend the stack our own way. */
if (YYMAXDEPTH <= yystacksize)
- goto yyexhaustedlab;
+ goto yyexhaustedlab;
yystacksize *= 2;
if (YYMAXDEPTH < yystacksize)
- yystacksize = YYMAXDEPTH;
+ yystacksize = YYMAXDEPTH;
{
- yytype_int16 *yyss1 = yyss;
- union yyalloc *yyptr =
- (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
- if (! yyptr)
- goto yyexhaustedlab;
- YYSTACK_RELOCATE (yyss_alloc, yyss);
- YYSTACK_RELOCATE (yyvs_alloc, yyvs);
+ yytype_int16 *yyss1 = yyss;
+ union yyalloc *yyptr =
+ (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
+ if (! yyptr)
+ goto yyexhaustedlab;
+ YYSTACK_RELOCATE (yyss_alloc, yyss);
+ YYSTACK_RELOCATE (yyvs_alloc, yyvs);
# undef YYSTACK_RELOCATE
- if (yyss1 != yyssa)
- YYSTACK_FREE (yyss1);
+ if (yyss1 != yyssa)
+ YYSTACK_FREE (yyss1);
}
# endif
#endif /* no yyoverflow */
@@ -1978,10 +2222,10 @@ yyparse (void)
yyvsp = yyvs + yysize - 1;
YYDPRINTF ((stderr, "Stack size increased to %lu\n",
- (unsigned long int) yystacksize));
+ (unsigned long int) yystacksize));
if (yyss + yystacksize - 1 <= yyssp)
- YYABORT;
+ YYABORT;
}
YYDPRINTF ((stderr, "Entering state %d\n", yystate));
@@ -2010,7 +2254,7 @@ yybackup:
if (yychar == YYEMPTY)
{
YYDPRINTF ((stderr, "Reading a token: "));
- yychar = yylex ();
+ yychar = YYLEX;
}
if (yychar <= YYEOF)
@@ -2075,7 +2319,7 @@ yyreduce:
yylen = yyr2[yyn];
/* If YYLEN is nonzero, implement the default value of the action:
- '$$ = $1'.
+ `$$ = $1'.
Otherwise, the following line sets YYVAL to garbage.
This behavior is undocumented and Bison
@@ -2089,7 +2333,8 @@ yyreduce:
switch (yyn)
{
case 5:
-#line 373 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+/* Line 1787 of yacc.c */
+#line 376 "../../ntpd/ntp_parser.y"
{
/* I will need to incorporate much more fine grained
* error messages. The following should suffice for
@@ -2102,433 +2347,433 @@ yyreduce:
ip_ctx->errpos.nline,
ip_ctx->errpos.ncol);
}
-#line 2106 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 20:
-#line 409 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+/* Line 1787 of yacc.c */
+#line 412 "../../ntpd/ntp_parser.y"
{
peer_node *my_node;
- my_node = create_peer_node((yyvsp[-2].Integer), (yyvsp[-1].Address_node), (yyvsp[0].Attr_val_fifo));
+ my_node = create_peer_node((yyvsp[(1) - (3)].Integer), (yyvsp[(2) - (3)].Address_node), (yyvsp[(3) - (3)].Attr_val_fifo));
APPEND_G_FIFO(cfgt.peers, my_node);
}
-#line 2117 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 27:
-#line 428 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
- { (yyval.Address_node) = create_address_node((yyvsp[0].String), (yyvsp[-1].Integer)); }
-#line 2123 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+/* Line 1787 of yacc.c */
+#line 431 "../../ntpd/ntp_parser.y"
+ { (yyval.Address_node) = create_address_node((yyvsp[(2) - (2)].String), (yyvsp[(1) - (2)].Integer)); }
break;
case 28:
-#line 433 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
- { (yyval.Address_node) = create_address_node((yyvsp[0].String), AF_UNSPEC); }
-#line 2129 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+/* Line 1787 of yacc.c */
+#line 436 "../../ntpd/ntp_parser.y"
+ { (yyval.Address_node) = create_address_node((yyvsp[(1) - (1)].String), AF_UNSPEC); }
break;
case 29:
-#line 438 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+/* Line 1787 of yacc.c */
+#line 441 "../../ntpd/ntp_parser.y"
{ (yyval.Integer) = AF_INET; }
-#line 2135 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 30:
-#line 440 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+/* Line 1787 of yacc.c */
+#line 443 "../../ntpd/ntp_parser.y"
{ (yyval.Integer) = AF_INET6; }
-#line 2141 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 31:
-#line 445 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+/* Line 1787 of yacc.c */
+#line 448 "../../ntpd/ntp_parser.y"
{ (yyval.Attr_val_fifo) = NULL; }
-#line 2147 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 32:
-#line 447 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+/* Line 1787 of yacc.c */
+#line 450 "../../ntpd/ntp_parser.y"
{
- (yyval.Attr_val_fifo) = (yyvsp[-1].Attr_val_fifo);
- APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val));
+ (yyval.Attr_val_fifo) = (yyvsp[(1) - (2)].Attr_val_fifo);
+ APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[(2) - (2)].Attr_val));
}
-#line 2156 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 36:
-#line 461 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
- { (yyval.Attr_val) = create_attr_ival(T_Flag, (yyvsp[0].Integer)); }
-#line 2162 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+/* Line 1787 of yacc.c */
+#line 464 "../../ntpd/ntp_parser.y"
+ { (yyval.Attr_val) = create_attr_ival(T_Flag, (yyvsp[(1) - (1)].Integer)); }
break;
case 45:
-#line 477 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
- { (yyval.Attr_val) = create_attr_ival((yyvsp[-1].Integer), (yyvsp[0].Integer)); }
-#line 2168 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+/* Line 1787 of yacc.c */
+#line 480 "../../ntpd/ntp_parser.y"
+ { (yyval.Attr_val) = create_attr_ival((yyvsp[(1) - (2)].Integer), (yyvsp[(2) - (2)].Integer)); }
break;
case 46:
-#line 479 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
- { (yyval.Attr_val) = create_attr_uval((yyvsp[-1].Integer), (yyvsp[0].Integer)); }
-#line 2174 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+/* Line 1787 of yacc.c */
+#line 482 "../../ntpd/ntp_parser.y"
+ { (yyval.Attr_val) = create_attr_uval((yyvsp[(1) - (2)].Integer), (yyvsp[(2) - (2)].Integer)); }
break;
case 53:
-#line 493 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
- { (yyval.Attr_val) = create_attr_sval((yyvsp[-1].Integer), (yyvsp[0].String)); }
-#line 2180 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+/* Line 1787 of yacc.c */
+#line 496 "../../ntpd/ntp_parser.y"
+ { (yyval.Attr_val) = create_attr_sval((yyvsp[(1) - (2)].Integer), (yyvsp[(2) - (2)].String)); }
break;
case 55:
-#line 507 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+/* Line 1787 of yacc.c */
+#line 510 "../../ntpd/ntp_parser.y"
{
unpeer_node *my_node;
- my_node = create_unpeer_node((yyvsp[0].Address_node));
+ my_node = create_unpeer_node((yyvsp[(2) - (2)].Address_node));
if (my_node)
APPEND_G_FIFO(cfgt.unpeers, my_node);
}
-#line 2192 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 58:
-#line 528 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+/* Line 1787 of yacc.c */
+#line 531 "../../ntpd/ntp_parser.y"
{ cfgt.broadcastclient = 1; }
-#line 2198 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 59:
-#line 530 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
- { CONCAT_G_FIFOS(cfgt.manycastserver, (yyvsp[0].Address_fifo)); }
-#line 2204 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+/* Line 1787 of yacc.c */
+#line 533 "../../ntpd/ntp_parser.y"
+ { CONCAT_G_FIFOS(cfgt.manycastserver, (yyvsp[(2) - (2)].Address_fifo)); }
break;
case 60:
-#line 532 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
- { CONCAT_G_FIFOS(cfgt.multicastclient, (yyvsp[0].Address_fifo)); }
-#line 2210 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+/* Line 1787 of yacc.c */
+#line 535 "../../ntpd/ntp_parser.y"
+ { CONCAT_G_FIFOS(cfgt.multicastclient, (yyvsp[(2) - (2)].Address_fifo)); }
break;
case 61:
-#line 534 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
- { cfgt.mdnstries = (yyvsp[0].Integer); }
-#line 2216 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+/* Line 1787 of yacc.c */
+#line 537 "../../ntpd/ntp_parser.y"
+ { cfgt.mdnstries = (yyvsp[(2) - (2)].Integer); }
break;
case 62:
-#line 545 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+/* Line 1787 of yacc.c */
+#line 548 "../../ntpd/ntp_parser.y"
{
attr_val *atrv;
- atrv = create_attr_ival((yyvsp[-1].Integer), (yyvsp[0].Integer));
+ atrv = create_attr_ival((yyvsp[(1) - (2)].Integer), (yyvsp[(2) - (2)].Integer));
APPEND_G_FIFO(cfgt.vars, atrv);
}
-#line 2227 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 63:
-#line 552 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
- { cfgt.auth.control_key = (yyvsp[0].Integer); }
-#line 2233 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+/* Line 1787 of yacc.c */
+#line 555 "../../ntpd/ntp_parser.y"
+ { cfgt.auth.control_key = (yyvsp[(2) - (2)].Integer); }
break;
case 64:
-#line 554 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+/* Line 1787 of yacc.c */
+#line 557 "../../ntpd/ntp_parser.y"
{
cfgt.auth.cryptosw++;
- CONCAT_G_FIFOS(cfgt.auth.crypto_cmd_list, (yyvsp[0].Attr_val_fifo));
+ CONCAT_G_FIFOS(cfgt.auth.crypto_cmd_list, (yyvsp[(2) - (2)].Attr_val_fifo));
}
-#line 2242 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 65:
-#line 559 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
- { cfgt.auth.keys = (yyvsp[0].String); }
-#line 2248 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+/* Line 1787 of yacc.c */
+#line 562 "../../ntpd/ntp_parser.y"
+ { cfgt.auth.keys = (yyvsp[(2) - (2)].String); }
break;
case 66:
-#line 561 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
- { cfgt.auth.keysdir = (yyvsp[0].String); }
-#line 2254 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+/* Line 1787 of yacc.c */
+#line 564 "../../ntpd/ntp_parser.y"
+ { cfgt.auth.keysdir = (yyvsp[(2) - (2)].String); }
break;
case 67:
-#line 563 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
- { cfgt.auth.request_key = (yyvsp[0].Integer); }
-#line 2260 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+/* Line 1787 of yacc.c */
+#line 566 "../../ntpd/ntp_parser.y"
+ { cfgt.auth.request_key = (yyvsp[(2) - (2)].Integer); }
break;
case 68:
-#line 565 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
- { cfgt.auth.revoke = (yyvsp[0].Integer); }
-#line 2266 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+/* Line 1787 of yacc.c */
+#line 568 "../../ntpd/ntp_parser.y"
+ { cfgt.auth.revoke = (yyvsp[(2) - (2)].Integer); }
break;
case 69:
-#line 567 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+/* Line 1787 of yacc.c */
+#line 570 "../../ntpd/ntp_parser.y"
{
- cfgt.auth.trusted_key_list = (yyvsp[0].Attr_val_fifo);
+ cfgt.auth.trusted_key_list = (yyvsp[(2) - (2)].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);
}
-#line 2279 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 70:
-#line 576 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
- { cfgt.auth.ntp_signd_socket = (yyvsp[0].String); }
-#line 2285 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+/* Line 1787 of yacc.c */
+#line 579 "../../ntpd/ntp_parser.y"
+ { cfgt.auth.ntp_signd_socket = (yyvsp[(2) - (2)].String); }
break;
case 71:
-#line 581 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+/* Line 1787 of yacc.c */
+#line 584 "../../ntpd/ntp_parser.y"
{ (yyval.Attr_val_fifo) = NULL; }
-#line 2291 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 72:
-#line 583 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+/* Line 1787 of yacc.c */
+#line 586 "../../ntpd/ntp_parser.y"
{
- (yyval.Attr_val_fifo) = (yyvsp[-1].Attr_val_fifo);
- APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val));
+ (yyval.Attr_val_fifo) = (yyvsp[(1) - (2)].Attr_val_fifo);
+ APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[(2) - (2)].Attr_val));
}
-#line 2300 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 73:
-#line 591 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
- { (yyval.Attr_val) = create_attr_sval((yyvsp[-1].Integer), (yyvsp[0].String)); }
-#line 2306 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+/* Line 1787 of yacc.c */
+#line 594 "../../ntpd/ntp_parser.y"
+ { (yyval.Attr_val) = create_attr_sval((yyvsp[(1) - (2)].Integer), (yyvsp[(2) - (2)].String)); }
break;
case 74:
-#line 593 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+/* Line 1787 of yacc.c */
+#line 596 "../../ntpd/ntp_parser.y"
{
(yyval.Attr_val) = NULL;
- cfgt.auth.revoke = (yyvsp[0].Integer);
+ cfgt.auth.revoke = (yyvsp[(2) - (2)].Integer);
msyslog(LOG_WARNING,
"'crypto revoke %d' is deprecated, "
"please use 'revoke %d' instead.",
cfgt.auth.revoke, cfgt.auth.revoke);
}
-#line 2319 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 80:
-#line 618 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
- { CONCAT_G_FIFOS(cfgt.orphan_cmds, (yyvsp[0].Attr_val_fifo)); }
-#line 2325 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+/* Line 1787 of yacc.c */
+#line 621 "../../ntpd/ntp_parser.y"
+ { CONCAT_G_FIFOS(cfgt.orphan_cmds, (yyvsp[(2) - (2)].Attr_val_fifo)); }
break;
case 81:
-#line 623 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+/* Line 1787 of yacc.c */
+#line 626 "../../ntpd/ntp_parser.y"
{
- (yyval.Attr_val_fifo) = (yyvsp[-1].Attr_val_fifo);
- APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val));
+ (yyval.Attr_val_fifo) = (yyvsp[(1) - (2)].Attr_val_fifo);
+ APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[(2) - (2)].Attr_val));
}
-#line 2334 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 82:
-#line 628 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+/* Line 1787 of yacc.c */
+#line 631 "../../ntpd/ntp_parser.y"
{
(yyval.Attr_val_fifo) = NULL;
- APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val));
+ APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[(1) - (1)].Attr_val));
}
-#line 2343 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 83:
-#line 636 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
- { (yyval.Attr_val) = create_attr_dval((yyvsp[-1].Integer), (double)(yyvsp[0].Integer)); }
-#line 2349 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+/* Line 1787 of yacc.c */
+#line 639 "../../ntpd/ntp_parser.y"
+ { (yyval.Attr_val) = create_attr_dval((yyvsp[(1) - (2)].Integer), (double)(yyvsp[(2) - (2)].Integer)); }
break;
case 84:
-#line 638 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
- { (yyval.Attr_val) = create_attr_dval((yyvsp[-1].Integer), (yyvsp[0].Double)); }
-#line 2355 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+/* Line 1787 of yacc.c */
+#line 641 "../../ntpd/ntp_parser.y"
+ { (yyval.Attr_val) = create_attr_dval((yyvsp[(1) - (2)].Integer), (yyvsp[(2) - (2)].Double)); }
break;
case 85:
-#line 640 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
- { (yyval.Attr_val) = create_attr_dval((yyvsp[-1].Integer), (double)(yyvsp[0].Integer)); }
-#line 2361 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+/* Line 1787 of yacc.c */
+#line 643 "../../ntpd/ntp_parser.y"
+ { (yyval.Attr_val) = create_attr_dval((yyvsp[(1) - (2)].Integer), (double)(yyvsp[(2) - (2)].Integer)); }
break;
case 96:
-#line 666 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
- { CONCAT_G_FIFOS(cfgt.stats_list, (yyvsp[0].Int_fifo)); }
-#line 2367 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+/* Line 1787 of yacc.c */
+#line 669 "../../ntpd/ntp_parser.y"
+ { CONCAT_G_FIFOS(cfgt.stats_list, (yyvsp[(2) - (2)].Int_fifo)); }
break;
case 97:
-#line 668 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+/* Line 1787 of yacc.c */
+#line 671 "../../ntpd/ntp_parser.y"
{
if (lex_from_file()) {
- cfgt.stats_dir = (yyvsp[0].String);
+ cfgt.stats_dir = (yyvsp[(2) - (2)].String);
} else {
- YYFREE((yyvsp[0].String));
+ YYFREE((yyvsp[(2) - (2)].String));
yyerror("statsdir remote configuration ignored");
}
}
-#line 2380 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 98:
-#line 677 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+/* Line 1787 of yacc.c */
+#line 680 "../../ntpd/ntp_parser.y"
{
filegen_node *fgn;
- fgn = create_filegen_node((yyvsp[-1].Integer), (yyvsp[0].Attr_val_fifo));
+ fgn = create_filegen_node((yyvsp[(2) - (3)].Integer), (yyvsp[(3) - (3)].Attr_val_fifo));
APPEND_G_FIFO(cfgt.filegen_opts, fgn);
}
-#line 2391 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 99:
-#line 687 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+/* Line 1787 of yacc.c */
+#line 690 "../../ntpd/ntp_parser.y"
{
- (yyval.Int_fifo) = (yyvsp[-1].Int_fifo);
- APPEND_G_FIFO((yyval.Int_fifo), create_int_node((yyvsp[0].Integer)));
+ (yyval.Int_fifo) = (yyvsp[(1) - (2)].Int_fifo);
+ APPEND_G_FIFO((yyval.Int_fifo), create_int_node((yyvsp[(2) - (2)].Integer)));
}
-#line 2400 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 100:
-#line 692 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+/* Line 1787 of yacc.c */
+#line 695 "../../ntpd/ntp_parser.y"
{
(yyval.Int_fifo) = NULL;
- APPEND_G_FIFO((yyval.Int_fifo), create_int_node((yyvsp[0].Integer)));
+ APPEND_G_FIFO((yyval.Int_fifo), create_int_node((yyvsp[(1) - (1)].Integer)));
}
-#line 2409 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 109:
-#line 711 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+/* Line 1787 of yacc.c */
+#line 714 "../../ntpd/ntp_parser.y"
{ (yyval.Attr_val_fifo) = NULL; }
-#line 2415 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 110:
-#line 713 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+/* Line 1787 of yacc.c */
+#line 716 "../../ntpd/ntp_parser.y"
{
- (yyval.Attr_val_fifo) = (yyvsp[-1].Attr_val_fifo);
- APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val));
+ (yyval.Attr_val_fifo) = (yyvsp[(1) - (2)].Attr_val_fifo);
+ APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[(2) - (2)].Attr_val));
}
-#line 2424 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 111:
-#line 721 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+/* Line 1787 of yacc.c */
+#line 724 "../../ntpd/ntp_parser.y"
{
if (lex_from_file()) {
- (yyval.Attr_val) = create_attr_sval((yyvsp[-1].Integer), (yyvsp[0].String));
+ (yyval.Attr_val) = create_attr_sval((yyvsp[(1) - (2)].Integer), (yyvsp[(2) - (2)].String));
} else {
(yyval.Attr_val) = NULL;
- YYFREE((yyvsp[0].String));
+ YYFREE((yyvsp[(2) - (2)].String));
yyerror("filegen file remote config ignored");
}
}
-#line 2438 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 112:
-#line 731 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+/* Line 1787 of yacc.c */
+#line 734 "../../ntpd/ntp_parser.y"
{
if (lex_from_file()) {
- (yyval.Attr_val) = create_attr_ival((yyvsp[-1].Integer), (yyvsp[0].Integer));
+ (yyval.Attr_val) = create_attr_ival((yyvsp[(1) - (2)].Integer), (yyvsp[(2) - (2)].Integer));
} else {
(yyval.Attr_val) = NULL;
yyerror("filegen type remote config ignored");
}
}
-#line 2451 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 113:
-#line 740 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+/* Line 1787 of yacc.c */
+#line 743 "../../ntpd/ntp_parser.y"
{
const char *err;
if (lex_from_file()) {
- (yyval.Attr_val) = create_attr_ival(T_Flag, (yyvsp[0].Integer));
+ (yyval.Attr_val) = create_attr_ival(T_Flag, (yyvsp[(1) - (1)].Integer));
} else {
(yyval.Attr_val) = NULL;
- if (T_Link == (yyvsp[0].Integer))
+ if (T_Link == (yyvsp[(1) - (1)].Integer))
err = "filegen link remote config ignored";
else
err = "filegen nolink remote config ignored";
yyerror(err);
}
}
-#line 2470 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 114:
-#line 755 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
- { (yyval.Attr_val) = create_attr_ival(T_Flag, (yyvsp[0].Integer)); }
-#line 2476 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+/* Line 1787 of yacc.c */
+#line 758 "../../ntpd/ntp_parser.y"
+ { (yyval.Attr_val) = create_attr_ival(T_Flag, (yyvsp[(1) - (1)].Integer)); }
break;
case 126:
-#line 785 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+/* Line 1787 of yacc.c */
+#line 788 "../../ntpd/ntp_parser.y"
{
- CONCAT_G_FIFOS(cfgt.discard_opts, (yyvsp[0].Attr_val_fifo));
+ CONCAT_G_FIFOS(cfgt.discard_opts, (yyvsp[(2) - (2)].Attr_val_fifo));
}
-#line 2484 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 127:
-#line 789 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+/* Line 1787 of yacc.c */
+#line 792 "../../ntpd/ntp_parser.y"
{
- CONCAT_G_FIFOS(cfgt.mru_opts, (yyvsp[0].Attr_val_fifo));
+ CONCAT_G_FIFOS(cfgt.mru_opts, (yyvsp[(2) - (2)].Attr_val_fifo));
}
-#line 2492 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 128:
-#line 793 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+/* Line 1787 of yacc.c */
+#line 796 "../../ntpd/ntp_parser.y"
{
restrict_node *rn;
- rn = create_restrict_node((yyvsp[-1].Address_node), NULL, (yyvsp[0].Int_fifo),
+ rn = create_restrict_node((yyvsp[(2) - (3)].Address_node), NULL, (yyvsp[(3) - (3)].Int_fifo),
lex_current()->curpos.nline);
APPEND_G_FIFO(cfgt.restrict_opts, rn);
}
-#line 2504 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 129:
-#line 801 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+/* Line 1787 of yacc.c */
+#line 804 "../../ntpd/ntp_parser.y"
{
restrict_node *rn;
- rn = create_restrict_node((yyvsp[-3].Address_node), (yyvsp[-1].Address_node), (yyvsp[0].Int_fifo),
+ rn = create_restrict_node((yyvsp[(2) - (5)].Address_node), (yyvsp[(4) - (5)].Address_node), (yyvsp[(5) - (5)].Int_fifo),
lex_current()->curpos.nline);
APPEND_G_FIFO(cfgt.restrict_opts, rn);
}
-#line 2516 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 130:
-#line 809 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+/* Line 1787 of yacc.c */
+#line 812 "../../ntpd/ntp_parser.y"
{
restrict_node *rn;
- rn = create_restrict_node(NULL, NULL, (yyvsp[0].Int_fifo),
+ rn = create_restrict_node(NULL, NULL, (yyvsp[(3) - (3)].Int_fifo),
lex_current()->curpos.nline);
APPEND_G_FIFO(cfgt.restrict_opts, rn);
}
-#line 2528 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 131:
-#line 817 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+/* Line 1787 of yacc.c */
+#line 820 "../../ntpd/ntp_parser.y"
{
restrict_node *rn;
@@ -2539,15 +2784,15 @@ yyreduce:
create_address_node(
estrdup("0.0.0.0"),
AF_INET),
- (yyvsp[0].Int_fifo),
+ (yyvsp[(4) - (4)].Int_fifo),
lex_current()->curpos.nline);
APPEND_G_FIFO(cfgt.restrict_opts, rn);
}
-#line 2547 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 132:
-#line 832 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+/* Line 1787 of yacc.c */
+#line 835 "../../ntpd/ntp_parser.y"
{
restrict_node *rn;
@@ -2558,327 +2803,327 @@ yyreduce:
create_address_node(
estrdup("::"),
AF_INET6),
- (yyvsp[0].Int_fifo),
+ (yyvsp[(4) - (4)].Int_fifo),
lex_current()->curpos.nline);
APPEND_G_FIFO(cfgt.restrict_opts, rn);
}
-#line 2566 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 133:
-#line 847 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+/* Line 1787 of yacc.c */
+#line 850 "../../ntpd/ntp_parser.y"
{
restrict_node * rn;
- APPEND_G_FIFO((yyvsp[0].Int_fifo), create_int_node((yyvsp[-1].Integer)));
+ APPEND_G_FIFO((yyvsp[(3) - (3)].Int_fifo), create_int_node((yyvsp[(2) - (3)].Integer)));
rn = create_restrict_node(
- NULL, NULL, (yyvsp[0].Int_fifo), lex_current()->curpos.nline);
+ NULL, NULL, (yyvsp[(3) - (3)].Int_fifo), lex_current()->curpos.nline);
APPEND_G_FIFO(cfgt.restrict_opts, rn);
}
-#line 2579 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 134:
-#line 859 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+/* Line 1787 of yacc.c */
+#line 862 "../../ntpd/ntp_parser.y"
{ (yyval.Int_fifo) = NULL; }
-#line 2585 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 135:
-#line 861 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+/* Line 1787 of yacc.c */
+#line 864 "../../ntpd/ntp_parser.y"
{
- (yyval.Int_fifo) = (yyvsp[-1].Int_fifo);
- APPEND_G_FIFO((yyval.Int_fifo), create_int_node((yyvsp[0].Integer)));
+ (yyval.Int_fifo) = (yyvsp[(1) - (2)].Int_fifo);
+ APPEND_G_FIFO((yyval.Int_fifo), create_int_node((yyvsp[(2) - (2)].Integer)));
}
-#line 2594 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 151:
-#line 887 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+/* Line 1787 of yacc.c */
+#line 890 "../../ntpd/ntp_parser.y"
{
- (yyval.Attr_val_fifo) = (yyvsp[-1].Attr_val_fifo);
- APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val));
+ (yyval.Attr_val_fifo) = (yyvsp[(1) - (2)].Attr_val_fifo);
+ APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[(2) - (2)].Attr_val));
}
-#line 2603 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 152:
-#line 892 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+/* Line 1787 of yacc.c */
+#line 895 "../../ntpd/ntp_parser.y"
{
(yyval.Attr_val_fifo) = NULL;
- APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val));
+ APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[(1) - (1)].Attr_val));
}
-#line 2612 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 153:
-#line 900 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
- { (yyval.Attr_val) = create_attr_ival((yyvsp[-1].Integer), (yyvsp[0].Integer)); }
-#line 2618 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+/* Line 1787 of yacc.c */
+#line 903 "../../ntpd/ntp_parser.y"
+ { (yyval.Attr_val) = create_attr_ival((yyvsp[(1) - (2)].Integer), (yyvsp[(2) - (2)].Integer)); }
break;
case 157:
-#line 911 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+/* Line 1787 of yacc.c */
+#line 914 "../../ntpd/ntp_parser.y"
{
- (yyval.Attr_val_fifo) = (yyvsp[-1].Attr_val_fifo);
- APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val));
+ (yyval.Attr_val_fifo) = (yyvsp[(1) - (2)].Attr_val_fifo);
+ APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[(2) - (2)].Attr_val));
}
-#line 2627 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 158:
-#line 916 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+/* Line 1787 of yacc.c */
+#line 919 "../../ntpd/ntp_parser.y"
{
(yyval.Attr_val_fifo) = NULL;
- APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val));
+ APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[(1) - (1)].Attr_val));
}
-#line 2636 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 159:
-#line 924 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
- { (yyval.Attr_val) = create_attr_ival((yyvsp[-1].Integer), (yyvsp[0].Integer)); }
-#line 2642 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+/* Line 1787 of yacc.c */
+#line 927 "../../ntpd/ntp_parser.y"
+ { (yyval.Attr_val) = create_attr_ival((yyvsp[(1) - (2)].Integer), (yyvsp[(2) - (2)].Integer)); }
break;
case 168:
-#line 944 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+/* Line 1787 of yacc.c */
+#line 947 "../../ntpd/ntp_parser.y"
{
addr_opts_node *aon;
- aon = create_addr_opts_node((yyvsp[-1].Address_node), (yyvsp[0].Attr_val_fifo));
+ aon = create_addr_opts_node((yyvsp[(2) - (3)].Address_node), (yyvsp[(3) - (3)].Attr_val_fifo));
APPEND_G_FIFO(cfgt.fudge, aon);
}
-#line 2653 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 169:
-#line 954 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+/* Line 1787 of yacc.c */
+#line 957 "../../ntpd/ntp_parser.y"
{
- (yyval.Attr_val_fifo) = (yyvsp[-1].Attr_val_fifo);
- APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val));
+ (yyval.Attr_val_fifo) = (yyvsp[(1) - (2)].Attr_val_fifo);
+ APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[(2) - (2)].Attr_val));
}
-#line 2662 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 170:
-#line 959 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+/* Line 1787 of yacc.c */
+#line 962 "../../ntpd/ntp_parser.y"
{
(yyval.Attr_val_fifo) = NULL;
- APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val));
+ APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[(1) - (1)].Attr_val));
}
-#line 2671 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 171:
-#line 967 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
- { (yyval.Attr_val) = create_attr_dval((yyvsp[-1].Integer), (yyvsp[0].Double)); }
-#line 2677 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+/* Line 1787 of yacc.c */
+#line 970 "../../ntpd/ntp_parser.y"
+ { (yyval.Attr_val) = create_attr_dval((yyvsp[(1) - (2)].Integer), (yyvsp[(2) - (2)].Double)); }
break;
case 172:
-#line 969 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
- { (yyval.Attr_val) = create_attr_ival((yyvsp[-1].Integer), (yyvsp[0].Integer)); }
-#line 2683 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+/* Line 1787 of yacc.c */
+#line 972 "../../ntpd/ntp_parser.y"
+ { (yyval.Attr_val) = create_attr_ival((yyvsp[(1) - (2)].Integer), (yyvsp[(2) - (2)].Integer)); }
break;
case 173:
-#line 971 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+/* Line 1787 of yacc.c */
+#line 974 "../../ntpd/ntp_parser.y"
{
- if ((yyvsp[0].Integer) >= 0 && (yyvsp[0].Integer) <= 16) {
- (yyval.Attr_val) = create_attr_ival((yyvsp[-1].Integer), (yyvsp[0].Integer));
+ if ((yyvsp[(2) - (2)].Integer) >= 0 && (yyvsp[(2) - (2)].Integer) <= 16) {
+ (yyval.Attr_val) = create_attr_ival((yyvsp[(1) - (2)].Integer), (yyvsp[(2) - (2)].Integer));
} else {
(yyval.Attr_val) = NULL;
yyerror("fudge factor: stratum value not in [0..16], ignored");
}
}
-#line 2696 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 174:
-#line 980 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
- { (yyval.Attr_val) = create_attr_sval((yyvsp[-1].Integer), (yyvsp[0].String)); }
-#line 2702 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+/* Line 1787 of yacc.c */
+#line 983 "../../ntpd/ntp_parser.y"
+ { (yyval.Attr_val) = create_attr_sval((yyvsp[(1) - (2)].Integer), (yyvsp[(2) - (2)].String)); }
break;
case 175:
-#line 982 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
- { (yyval.Attr_val) = create_attr_sval((yyvsp[-1].Integer), (yyvsp[0].String)); }
-#line 2708 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+/* Line 1787 of yacc.c */
+#line 985 "../../ntpd/ntp_parser.y"
+ { (yyval.Attr_val) = create_attr_sval((yyvsp[(1) - (2)].Integer), (yyvsp[(2) - (2)].String)); }
break;
case 182:
-#line 1003 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
- { CONCAT_G_FIFOS(cfgt.rlimit, (yyvsp[0].Attr_val_fifo)); }
-#line 2714 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+/* Line 1787 of yacc.c */
+#line 1006 "../../ntpd/ntp_parser.y"
+ { CONCAT_G_FIFOS(cfgt.rlimit, (yyvsp[(2) - (2)].Attr_val_fifo)); }
break;
case 183:
-#line 1008 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+/* Line 1787 of yacc.c */
+#line 1011 "../../ntpd/ntp_parser.y"
{
- (yyval.Attr_val_fifo) = (yyvsp[-1].Attr_val_fifo);
- APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val));
+ (yyval.Attr_val_fifo) = (yyvsp[(1) - (2)].Attr_val_fifo);
+ APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[(2) - (2)].Attr_val));
}
-#line 2723 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 184:
-#line 1013 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+/* Line 1787 of yacc.c */
+#line 1016 "../../ntpd/ntp_parser.y"
{
(yyval.Attr_val_fifo) = NULL;
- APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val));
+ APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[(1) - (1)].Attr_val));
}
-#line 2732 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 185:
-#line 1021 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
- { (yyval.Attr_val) = create_attr_ival((yyvsp[-1].Integer), (yyvsp[0].Integer)); }
-#line 2738 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+/* Line 1787 of yacc.c */
+#line 1024 "../../ntpd/ntp_parser.y"
+ { (yyval.Attr_val) = create_attr_ival((yyvsp[(1) - (2)].Integer), (yyvsp[(2) - (2)].Integer)); }
break;
case 189:
-#line 1037 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
- { CONCAT_G_FIFOS(cfgt.enable_opts, (yyvsp[0].Attr_val_fifo)); }
-#line 2744 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+/* Line 1787 of yacc.c */
+#line 1040 "../../ntpd/ntp_parser.y"
+ { CONCAT_G_FIFOS(cfgt.enable_opts, (yyvsp[(2) - (2)].Attr_val_fifo)); }
break;
case 190:
-#line 1039 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
- { CONCAT_G_FIFOS(cfgt.disable_opts, (yyvsp[0].Attr_val_fifo)); }
-#line 2750 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+/* Line 1787 of yacc.c */
+#line 1042 "../../ntpd/ntp_parser.y"
+ { CONCAT_G_FIFOS(cfgt.disable_opts, (yyvsp[(2) - (2)].Attr_val_fifo)); }
break;
case 191:
-#line 1044 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+/* Line 1787 of yacc.c */
+#line 1047 "../../ntpd/ntp_parser.y"
{
- (yyval.Attr_val_fifo) = (yyvsp[-1].Attr_val_fifo);
- APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val));
+ (yyval.Attr_val_fifo) = (yyvsp[(1) - (2)].Attr_val_fifo);
+ APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[(2) - (2)].Attr_val));
}
-#line 2759 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 192:
-#line 1049 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+/* Line 1787 of yacc.c */
+#line 1052 "../../ntpd/ntp_parser.y"
{
(yyval.Attr_val_fifo) = NULL;
- APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val));
+ APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[(1) - (1)].Attr_val));
}
-#line 2768 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 193:
-#line 1057 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
- { (yyval.Attr_val) = create_attr_ival(T_Flag, (yyvsp[0].Integer)); }
-#line 2774 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+/* Line 1787 of yacc.c */
+#line 1060 "../../ntpd/ntp_parser.y"
+ { (yyval.Attr_val) = create_attr_ival(T_Flag, (yyvsp[(1) - (1)].Integer)); }
break;
case 194:
-#line 1059 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+/* Line 1787 of yacc.c */
+#line 1062 "../../ntpd/ntp_parser.y"
{
if (lex_from_file()) {
- (yyval.Attr_val) = create_attr_ival(T_Flag, (yyvsp[0].Integer));
+ (yyval.Attr_val) = create_attr_ival(T_Flag, (yyvsp[(1) - (1)].Integer));
} else {
char err_str[128];
(yyval.Attr_val) = NULL;
snprintf(err_str, sizeof(err_str),
"enable/disable %s remote configuration ignored",
- keyword((yyvsp[0].Integer)));
+ keyword((yyvsp[(1) - (1)].Integer)));
yyerror(err_str);
}
}
-#line 2792 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
- case 203:
-#line 1094 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
- { CONCAT_G_FIFOS(cfgt.tinker, (yyvsp[0].Attr_val_fifo)); }
-#line 2798 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ case 206:
+/* Line 1787 of yacc.c */
+#line 1100 "../../ntpd/ntp_parser.y"
+ { CONCAT_G_FIFOS(cfgt.tinker, (yyvsp[(2) - (2)].Attr_val_fifo)); }
break;
- case 204:
-#line 1099 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+ case 207:
+/* Line 1787 of yacc.c */
+#line 1105 "../../ntpd/ntp_parser.y"
{
- (yyval.Attr_val_fifo) = (yyvsp[-1].Attr_val_fifo);
- APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val));
+ (yyval.Attr_val_fifo) = (yyvsp[(1) - (2)].Attr_val_fifo);
+ APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[(2) - (2)].Attr_val));
}
-#line 2807 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
- case 205:
-#line 1104 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+ case 208:
+/* Line 1787 of yacc.c */
+#line 1110 "../../ntpd/ntp_parser.y"
{
(yyval.Attr_val_fifo) = NULL;
- APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val));
+ APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[(1) - (1)].Attr_val));
}
-#line 2816 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
- case 206:
-#line 1112 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
- { (yyval.Attr_val) = create_attr_dval((yyvsp[-1].Integer), (yyvsp[0].Double)); }
-#line 2822 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ case 209:
+/* Line 1787 of yacc.c */
+#line 1118 "../../ntpd/ntp_parser.y"
+ { (yyval.Attr_val) = create_attr_dval((yyvsp[(1) - (2)].Integer), (yyvsp[(2) - (2)].Double)); }
break;
- case 219:
-#line 1137 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+ case 222:
+/* Line 1787 of yacc.c */
+#line 1143 "../../ntpd/ntp_parser.y"
{
attr_val *av;
- av = create_attr_dval((yyvsp[-1].Integer), (yyvsp[0].Double));
+ av = create_attr_dval((yyvsp[(1) - (2)].Integer), (yyvsp[(2) - (2)].Double));
APPEND_G_FIFO(cfgt.vars, av);
}
-#line 2833 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
- case 220:
-#line 1144 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+ case 223:
+/* Line 1787 of yacc.c */
+#line 1150 "../../ntpd/ntp_parser.y"
{
attr_val *av;
- av = create_attr_ival((yyvsp[-1].Integer), (yyvsp[0].Integer));
+ av = create_attr_ival((yyvsp[(1) - (2)].Integer), (yyvsp[(2) - (2)].Integer));
APPEND_G_FIFO(cfgt.vars, av);
}
-#line 2844 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
- case 221:
-#line 1151 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+ case 224:
+/* Line 1787 of yacc.c */
+#line 1157 "../../ntpd/ntp_parser.y"
{
attr_val *av;
- av = create_attr_sval((yyvsp[-1].Integer), (yyvsp[0].String));
+ av = create_attr_sval((yyvsp[(1) - (2)].Integer), (yyvsp[(2) - (2)].String));
APPEND_G_FIFO(cfgt.vars, av);
}
-#line 2855 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
- case 222:
-#line 1158 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+ case 225:
+/* Line 1787 of yacc.c */
+#line 1164 "../../ntpd/ntp_parser.y"
{
char error_text[64];
attr_val *av;
if (lex_from_file()) {
- av = create_attr_sval((yyvsp[-1].Integer), (yyvsp[0].String));
+ av = create_attr_sval((yyvsp[(1) - (2)].Integer), (yyvsp[(2) - (2)].String));
APPEND_G_FIFO(cfgt.vars, av);
} else {
- YYFREE((yyvsp[0].String));
+ YYFREE((yyvsp[(2) - (2)].String));
snprintf(error_text, sizeof(error_text),
"%s remote config ignored",
- keyword((yyvsp[-1].Integer)));
+ keyword((yyvsp[(1) - (2)].Integer)));
yyerror(error_text);
}
}
-#line 2875 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
- case 223:
-#line 1174 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+ case 226:
+/* Line 1787 of yacc.c */
+#line 1180 "../../ntpd/ntp_parser.y"
{
if (!lex_from_file()) {
- YYFREE((yyvsp[-1].String)); /* avoid leak */
+ YYFREE((yyvsp[(2) - (3)].String)); /* avoid leak */
yyerror("remote includefile ignored");
break;
}
@@ -2886,108 +3131,108 @@ yyreduce:
fprintf(stderr, "getconfig: Maximum include file level exceeded.\n");
msyslog(LOG_ERR, "getconfig: Maximum include file level exceeded.");
} else {
- const char * path = FindConfig((yyvsp[-1].String)); /* might return $2! */
+ const char * path = FindConfig((yyvsp[(2) - (3)].String)); /* might return $2! */
if (!lex_push_file(path, "r")) {
fprintf(stderr, "getconfig: Couldn't open <%s>\n", path);
msyslog(LOG_ERR, "getconfig: Couldn't open <%s>", path);
}
}
- YYFREE((yyvsp[-1].String)); /* avoid leak */
+ YYFREE((yyvsp[(2) - (3)].String)); /* avoid leak */
}
-#line 2898 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
- case 224:
-#line 1193 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+ case 227:
+/* Line 1787 of yacc.c */
+#line 1199 "../../ntpd/ntp_parser.y"
{ lex_flush_stack(); }
-#line 2904 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
- case 225:
-#line 1195 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+ case 228:
+/* Line 1787 of yacc.c */
+#line 1201 "../../ntpd/ntp_parser.y"
{ /* see drift_parm below for actions */ }
-#line 2910 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
- case 226:
-#line 1197 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
- { CONCAT_G_FIFOS(cfgt.logconfig, (yyvsp[0].Attr_val_fifo)); }
-#line 2916 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ case 229:
+/* Line 1787 of yacc.c */
+#line 1203 "../../ntpd/ntp_parser.y"
+ { CONCAT_G_FIFOS(cfgt.logconfig, (yyvsp[(2) - (2)].Attr_val_fifo)); }
break;
- case 227:
-#line 1199 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
- { CONCAT_G_FIFOS(cfgt.phone, (yyvsp[0].String_fifo)); }
-#line 2922 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ case 230:
+/* Line 1787 of yacc.c */
+#line 1205 "../../ntpd/ntp_parser.y"
+ { CONCAT_G_FIFOS(cfgt.phone, (yyvsp[(2) - (2)].String_fifo)); }
break;
- case 228:
-#line 1201 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
- { APPEND_G_FIFO(cfgt.setvar, (yyvsp[0].Set_var)); }
-#line 2928 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ case 231:
+/* Line 1787 of yacc.c */
+#line 1207 "../../ntpd/ntp_parser.y"
+ { APPEND_G_FIFO(cfgt.setvar, (yyvsp[(2) - (2)].Set_var)); }
break;
- case 229:
-#line 1203 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+ case 232:
+/* Line 1787 of yacc.c */
+#line 1209 "../../ntpd/ntp_parser.y"
{
addr_opts_node *aon;
- aon = create_addr_opts_node((yyvsp[-1].Address_node), (yyvsp[0].Attr_val_fifo));
+ aon = create_addr_opts_node((yyvsp[(2) - (3)].Address_node), (yyvsp[(3) - (3)].Attr_val_fifo));
APPEND_G_FIFO(cfgt.trap, aon);
}
-#line 2939 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
- case 230:
-#line 1210 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
- { CONCAT_G_FIFOS(cfgt.ttl, (yyvsp[0].Attr_val_fifo)); }
-#line 2945 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ case 233:
+/* Line 1787 of yacc.c */
+#line 1216 "../../ntpd/ntp_parser.y"
+ { CONCAT_G_FIFOS(cfgt.ttl, (yyvsp[(2) - (2)].Attr_val_fifo)); }
break;
- case 235:
-#line 1225 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+ case 238:
+/* Line 1787 of yacc.c */
+#line 1231 "../../ntpd/ntp_parser.y"
{
#ifndef LEAP_SMEAR
yyerror("Built without LEAP_SMEAR support.");
#endif
}
-#line 2955 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
- case 241:
-#line 1245 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+ case 244:
+/* Line 1787 of yacc.c */
+#line 1251 "../../ntpd/ntp_parser.y"
{
if (lex_from_file()) {
attr_val *av;
- av = create_attr_sval(T_Driftfile, (yyvsp[0].String));
+ av = create_attr_sval(T_Driftfile, (yyvsp[(1) - (1)].String));
APPEND_G_FIFO(cfgt.vars, av);
} else {
- YYFREE((yyvsp[0].String));
+ YYFREE((yyvsp[(1) - (1)].String));
yyerror("driftfile remote configuration ignored");
}
}
-#line 2970 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
- case 242:
-#line 1256 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+ case 245:
+/* Line 1787 of yacc.c */
+#line 1262 "../../ntpd/ntp_parser.y"
{
if (lex_from_file()) {
attr_val *av;
- av = create_attr_sval(T_Driftfile, (yyvsp[-1].String));
+ av = create_attr_sval(T_Driftfile, (yyvsp[(1) - (2)].String));
APPEND_G_FIFO(cfgt.vars, av);
- av = create_attr_dval(T_WanderThreshold, (yyvsp[0].Double));
+ av = create_attr_dval(T_WanderThreshold, (yyvsp[(2) - (2)].Double));
APPEND_G_FIFO(cfgt.vars, av);
} else {
- YYFREE((yyvsp[-1].String));
+ YYFREE((yyvsp[(1) - (2)].String));
yyerror("driftfile remote configuration ignored");
}
}
-#line 2987 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
- case 243:
-#line 1269 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+ case 246:
+/* Line 1787 of yacc.c */
+#line 1275 "../../ntpd/ntp_parser.y"
{
if (lex_from_file()) {
attr_val *av;
@@ -2997,386 +3242,386 @@ yyreduce:
yyerror("driftfile remote configuration ignored");
}
}
-#line 3001 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
- case 244:
-#line 1282 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
- { (yyval.Set_var) = create_setvar_node((yyvsp[-3].String), (yyvsp[-1].String), (yyvsp[0].Integer)); }
-#line 3007 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ case 247:
+/* Line 1787 of yacc.c */
+#line 1288 "../../ntpd/ntp_parser.y"
+ { (yyval.Set_var) = create_setvar_node((yyvsp[(1) - (4)].String), (yyvsp[(3) - (4)].String), (yyvsp[(4) - (4)].Integer)); }
break;
- case 246:
-#line 1288 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+ case 249:
+/* Line 1787 of yacc.c */
+#line 1294 "../../ntpd/ntp_parser.y"
{ (yyval.Integer) = 0; }
-#line 3013 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
- case 247:
-#line 1293 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+ case 250:
+/* Line 1787 of yacc.c */
+#line 1299 "../../ntpd/ntp_parser.y"
{ (yyval.Attr_val_fifo) = NULL; }
-#line 3019 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
- case 248:
-#line 1295 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+ case 251:
+/* Line 1787 of yacc.c */
+#line 1301 "../../ntpd/ntp_parser.y"
{
- (yyval.Attr_val_fifo) = (yyvsp[-1].Attr_val_fifo);
- APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val));
+ (yyval.Attr_val_fifo) = (yyvsp[(1) - (2)].Attr_val_fifo);
+ APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[(2) - (2)].Attr_val));
}
-#line 3028 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
- case 249:
-#line 1303 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
- { (yyval.Attr_val) = create_attr_ival((yyvsp[-1].Integer), (yyvsp[0].Integer)); }
-#line 3034 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ case 252:
+/* Line 1787 of yacc.c */
+#line 1309 "../../ntpd/ntp_parser.y"
+ { (yyval.Attr_val) = create_attr_ival((yyvsp[(1) - (2)].Integer), (yyvsp[(2) - (2)].Integer)); }
break;
- case 250:
-#line 1305 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+ case 253:
+/* Line 1787 of yacc.c */
+#line 1311 "../../ntpd/ntp_parser.y"
{
- (yyval.Attr_val) = create_attr_sval((yyvsp[-1].Integer), estrdup((yyvsp[0].Address_node)->address));
- destroy_address_node((yyvsp[0].Address_node));
+ (yyval.Attr_val) = create_attr_sval((yyvsp[(1) - (2)].Integer), estrdup((yyvsp[(2) - (2)].Address_node)->address));
+ destroy_address_node((yyvsp[(2) - (2)].Address_node));
}
-#line 3043 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
- case 251:
-#line 1313 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+ case 254:
+/* Line 1787 of yacc.c */
+#line 1319 "../../ntpd/ntp_parser.y"
{
- (yyval.Attr_val_fifo) = (yyvsp[-1].Attr_val_fifo);
- APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val));
+ (yyval.Attr_val_fifo) = (yyvsp[(1) - (2)].Attr_val_fifo);
+ APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[(2) - (2)].Attr_val));
}
-#line 3052 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
- case 252:
-#line 1318 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+ case 255:
+/* Line 1787 of yacc.c */
+#line 1324 "../../ntpd/ntp_parser.y"
{
(yyval.Attr_val_fifo) = NULL;
- APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val));
+ APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[(1) - (1)].Attr_val));
}
-#line 3061 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
- case 253:
-#line 1326 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+ case 256:
+/* Line 1787 of yacc.c */
+#line 1332 "../../ntpd/ntp_parser.y"
{
char prefix;
char * type;
- switch ((yyvsp[0].String)[0]) {
+ switch ((yyvsp[(1) - (1)].String)[0]) {
case '+':
case '-':
case '=':
- prefix = (yyvsp[0].String)[0];
- type = (yyvsp[0].String) + 1;
+ prefix = (yyvsp[(1) - (1)].String)[0];
+ type = (yyvsp[(1) - (1)].String) + 1;
break;
default:
prefix = '=';
- type = (yyvsp[0].String);
+ type = (yyvsp[(1) - (1)].String);
}
(yyval.Attr_val) = create_attr_sval(prefix, estrdup(type));
- YYFREE((yyvsp[0].String));
+ YYFREE((yyvsp[(1) - (1)].String));
}
-#line 3087 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
- case 254:
-#line 1351 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+ case 257:
+/* Line 1787 of yacc.c */
+#line 1357 "../../ntpd/ntp_parser.y"
{
nic_rule_node *nrn;
- nrn = create_nic_rule_node((yyvsp[0].Integer), NULL, (yyvsp[-1].Integer));
+ nrn = create_nic_rule_node((yyvsp[(3) - (3)].Integer), NULL, (yyvsp[(2) - (3)].Integer));
APPEND_G_FIFO(cfgt.nic_rules, nrn);
}
-#line 3098 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
- case 255:
-#line 1358 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+ case 258:
+/* Line 1787 of yacc.c */
+#line 1364 "../../ntpd/ntp_parser.y"
{
nic_rule_node *nrn;
- nrn = create_nic_rule_node(0, (yyvsp[0].String), (yyvsp[-1].Integer));
+ nrn = create_nic_rule_node(0, (yyvsp[(3) - (3)].String), (yyvsp[(2) - (3)].Integer));
APPEND_G_FIFO(cfgt.nic_rules, nrn);
}
-#line 3109 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
- case 265:
-#line 1386 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
- { CONCAT_G_FIFOS(cfgt.reset_counters, (yyvsp[0].Int_fifo)); }
-#line 3115 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ case 268:
+/* Line 1787 of yacc.c */
+#line 1392 "../../ntpd/ntp_parser.y"
+ { CONCAT_G_FIFOS(cfgt.reset_counters, (yyvsp[(2) - (2)].Int_fifo)); }
break;
- case 266:
-#line 1391 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+ case 269:
+/* Line 1787 of yacc.c */
+#line 1397 "../../ntpd/ntp_parser.y"
{
- (yyval.Int_fifo) = (yyvsp[-1].Int_fifo);
- APPEND_G_FIFO((yyval.Int_fifo), create_int_node((yyvsp[0].Integer)));
+ (yyval.Int_fifo) = (yyvsp[(1) - (2)].Int_fifo);
+ APPEND_G_FIFO((yyval.Int_fifo), create_int_node((yyvsp[(2) - (2)].Integer)));
}
-#line 3124 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
- case 267:
-#line 1396 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+ case 270:
+/* Line 1787 of yacc.c */
+#line 1402 "../../ntpd/ntp_parser.y"
{
(yyval.Int_fifo) = NULL;
- APPEND_G_FIFO((yyval.Int_fifo), create_int_node((yyvsp[0].Integer)));
+ APPEND_G_FIFO((yyval.Int_fifo), create_int_node((yyvsp[(1) - (1)].Integer)));
}
-#line 3133 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
- case 275:
-#line 1420 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+ case 278:
+/* Line 1787 of yacc.c */
+#line 1426 "../../ntpd/ntp_parser.y"
{
- (yyval.Attr_val_fifo) = (yyvsp[-1].Attr_val_fifo);
- APPEND_G_FIFO((yyval.Attr_val_fifo), create_int_node((yyvsp[0].Integer)));
+ (yyval.Attr_val_fifo) = (yyvsp[(1) - (2)].Attr_val_fifo);
+ APPEND_G_FIFO((yyval.Attr_val_fifo), create_int_node((yyvsp[(2) - (2)].Integer)));
}
-#line 3142 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
- case 276:
-#line 1425 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+ case 279:
+/* Line 1787 of yacc.c */
+#line 1431 "../../ntpd/ntp_parser.y"
{
(yyval.Attr_val_fifo) = NULL;
- APPEND_G_FIFO((yyval.Attr_val_fifo), create_int_node((yyvsp[0].Integer)));
+ APPEND_G_FIFO((yyval.Attr_val_fifo), create_int_node((yyvsp[(1) - (1)].Integer)));
}
-#line 3151 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
- case 277:
-#line 1433 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+ case 280:
+/* Line 1787 of yacc.c */
+#line 1439 "../../ntpd/ntp_parser.y"
{
- (yyval.Attr_val_fifo) = (yyvsp[-1].Attr_val_fifo);
- APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val));
+ (yyval.Attr_val_fifo) = (yyvsp[(1) - (2)].Attr_val_fifo);
+ APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[(2) - (2)].Attr_val));
}
-#line 3160 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
- case 278:
-#line 1438 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+ case 281:
+/* Line 1787 of yacc.c */
+#line 1444 "../../ntpd/ntp_parser.y"
{
(yyval.Attr_val_fifo) = NULL;
- APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val));
+ APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[(1) - (1)].Attr_val));
}
-#line 3169 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
- case 279:
-#line 1446 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
- { (yyval.Attr_val) = create_attr_ival('i', (yyvsp[0].Integer)); }
-#line 3175 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ case 282:
+/* Line 1787 of yacc.c */
+#line 1452 "../../ntpd/ntp_parser.y"
+ { (yyval.Attr_val) = create_attr_ival('i', (yyvsp[(1) - (1)].Integer)); }
break;
- case 281:
-#line 1452 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
- { (yyval.Attr_val) = create_attr_rangeval('-', (yyvsp[-3].Integer), (yyvsp[-1].Integer)); }
-#line 3181 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ case 284:
+/* Line 1787 of yacc.c */
+#line 1458 "../../ntpd/ntp_parser.y"
+ { (yyval.Attr_val) = create_attr_rangeval('-', (yyvsp[(2) - (5)].Integer), (yyvsp[(4) - (5)].Integer)); }
break;
- case 282:
-#line 1457 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+ case 285:
+/* Line 1787 of yacc.c */
+#line 1463 "../../ntpd/ntp_parser.y"
{
- (yyval.String_fifo) = (yyvsp[-1].String_fifo);
- APPEND_G_FIFO((yyval.String_fifo), create_string_node((yyvsp[0].String)));
+ (yyval.String_fifo) = (yyvsp[(1) - (2)].String_fifo);
+ APPEND_G_FIFO((yyval.String_fifo), create_string_node((yyvsp[(2) - (2)].String)));
}
-#line 3190 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
- case 283:
-#line 1462 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+ case 286:
+/* Line 1787 of yacc.c */
+#line 1468 "../../ntpd/ntp_parser.y"
{
(yyval.String_fifo) = NULL;
- APPEND_G_FIFO((yyval.String_fifo), create_string_node((yyvsp[0].String)));
+ APPEND_G_FIFO((yyval.String_fifo), create_string_node((yyvsp[(1) - (1)].String)));
}
-#line 3199 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
- case 284:
-#line 1470 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+ case 287:
+/* Line 1787 of yacc.c */
+#line 1476 "../../ntpd/ntp_parser.y"
{
- (yyval.Address_fifo) = (yyvsp[-1].Address_fifo);
- APPEND_G_FIFO((yyval.Address_fifo), (yyvsp[0].Address_node));
+ (yyval.Address_fifo) = (yyvsp[(1) - (2)].Address_fifo);
+ APPEND_G_FIFO((yyval.Address_fifo), (yyvsp[(2) - (2)].Address_node));
}
-#line 3208 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
- case 285:
-#line 1475 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+ case 288:
+/* Line 1787 of yacc.c */
+#line 1481 "../../ntpd/ntp_parser.y"
{
(yyval.Address_fifo) = NULL;
- APPEND_G_FIFO((yyval.Address_fifo), (yyvsp[0].Address_node));
+ APPEND_G_FIFO((yyval.Address_fifo), (yyvsp[(1) - (1)].Address_node));
}
-#line 3217 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
- case 286:
-#line 1483 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+ case 289:
+/* Line 1787 of yacc.c */
+#line 1489 "../../ntpd/ntp_parser.y"
{
- if ((yyvsp[0].Integer) != 0 && (yyvsp[0].Integer) != 1) {
+ if ((yyvsp[(1) - (1)].Integer) != 0 && (yyvsp[(1) - (1)].Integer) != 1) {
yyerror("Integer value is not boolean (0 or 1). Assuming 1");
(yyval.Integer) = 1;
} else {
- (yyval.Integer) = (yyvsp[0].Integer);
+ (yyval.Integer) = (yyvsp[(1) - (1)].Integer);
}
}
-#line 3230 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
- case 287:
-#line 1491 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+ case 290:
+/* Line 1787 of yacc.c */
+#line 1497 "../../ntpd/ntp_parser.y"
{ (yyval.Integer) = 1; }
-#line 3236 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
- case 288:
-#line 1492 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+ case 291:
+/* Line 1787 of yacc.c */
+#line 1498 "../../ntpd/ntp_parser.y"
{ (yyval.Integer) = 0; }
-#line 3242 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
- case 289:
-#line 1496 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
- { (yyval.Double) = (double)(yyvsp[0].Integer); }
-#line 3248 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ case 292:
+/* Line 1787 of yacc.c */
+#line 1502 "../../ntpd/ntp_parser.y"
+ { (yyval.Double) = (double)(yyvsp[(1) - (1)].Integer); }
break;
- case 291:
-#line 1507 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+ case 294:
+/* Line 1787 of yacc.c */
+#line 1513 "../../ntpd/ntp_parser.y"
{
sim_node *sn;
- sn = create_sim_node((yyvsp[-2].Attr_val_fifo), (yyvsp[-1].Sim_server_fifo));
+ sn = create_sim_node((yyvsp[(3) - (5)].Attr_val_fifo), (yyvsp[(4) - (5)].Sim_server_fifo));
APPEND_G_FIFO(cfgt.sim_details, sn);
/* Revert from ; to \n for end-of-command */
old_config_style = 1;
}
-#line 3262 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
- case 292:
-#line 1524 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+ case 295:
+/* Line 1787 of yacc.c */
+#line 1530 "../../ntpd/ntp_parser.y"
{ old_config_style = 0; }
-#line 3268 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
- case 293:
-#line 1529 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+ case 296:
+/* Line 1787 of yacc.c */
+#line 1535 "../../ntpd/ntp_parser.y"
{
- (yyval.Attr_val_fifo) = (yyvsp[-2].Attr_val_fifo);
- APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[-1].Attr_val));
+ (yyval.Attr_val_fifo) = (yyvsp[(1) - (3)].Attr_val_fifo);
+ APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[(2) - (3)].Attr_val));
}
-#line 3277 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
- case 294:
-#line 1534 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+ case 297:
+/* Line 1787 of yacc.c */
+#line 1540 "../../ntpd/ntp_parser.y"
{
(yyval.Attr_val_fifo) = NULL;
- APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[-1].Attr_val));
+ APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[(1) - (2)].Attr_val));
}
-#line 3286 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
- case 295:
-#line 1542 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
- { (yyval.Attr_val) = create_attr_dval((yyvsp[-2].Integer), (yyvsp[0].Double)); }
-#line 3292 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ case 298:
+/* Line 1787 of yacc.c */
+#line 1548 "../../ntpd/ntp_parser.y"
+ { (yyval.Attr_val) = create_attr_dval((yyvsp[(1) - (3)].Integer), (yyvsp[(3) - (3)].Double)); }
break;
- case 298:
-#line 1552 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+ case 301:
+/* Line 1787 of yacc.c */
+#line 1558 "../../ntpd/ntp_parser.y"
{
- (yyval.Sim_server_fifo) = (yyvsp[-1].Sim_server_fifo);
- APPEND_G_FIFO((yyval.Sim_server_fifo), (yyvsp[0].Sim_server));
+ (yyval.Sim_server_fifo) = (yyvsp[(1) - (2)].Sim_server_fifo);
+ APPEND_G_FIFO((yyval.Sim_server_fifo), (yyvsp[(2) - (2)].Sim_server));
}
-#line 3301 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
- case 299:
-#line 1557 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+ case 302:
+/* Line 1787 of yacc.c */
+#line 1563 "../../ntpd/ntp_parser.y"
{
(yyval.Sim_server_fifo) = NULL;
- APPEND_G_FIFO((yyval.Sim_server_fifo), (yyvsp[0].Sim_server));
+ APPEND_G_FIFO((yyval.Sim_server_fifo), (yyvsp[(1) - (1)].Sim_server));
}
-#line 3310 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
- case 300:
-#line 1565 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
- { (yyval.Sim_server) = ONLY_SIM(create_sim_server((yyvsp[-4].Address_node), (yyvsp[-2].Double), (yyvsp[-1].Sim_script_fifo))); }
-#line 3316 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ case 303:
+/* Line 1787 of yacc.c */
+#line 1571 "../../ntpd/ntp_parser.y"
+ { (yyval.Sim_server) = ONLY_SIM(create_sim_server((yyvsp[(1) - (5)].Address_node), (yyvsp[(3) - (5)].Double), (yyvsp[(4) - (5)].Sim_script_fifo))); }
break;
- case 301:
-#line 1570 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
- { (yyval.Double) = (yyvsp[-1].Double); }
-#line 3322 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ case 304:
+/* Line 1787 of yacc.c */
+#line 1576 "../../ntpd/ntp_parser.y"
+ { (yyval.Double) = (yyvsp[(3) - (4)].Double); }
break;
- case 302:
-#line 1575 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
- { (yyval.Address_node) = (yyvsp[0].Address_node); }
-#line 3328 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ case 305:
+/* Line 1787 of yacc.c */
+#line 1581 "../../ntpd/ntp_parser.y"
+ { (yyval.Address_node) = (yyvsp[(3) - (3)].Address_node); }
break;
- case 303:
-#line 1580 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+ case 306:
+/* Line 1787 of yacc.c */
+#line 1586 "../../ntpd/ntp_parser.y"
{
- (yyval.Sim_script_fifo) = (yyvsp[-1].Sim_script_fifo);
- APPEND_G_FIFO((yyval.Sim_script_fifo), (yyvsp[0].Sim_script));
+ (yyval.Sim_script_fifo) = (yyvsp[(1) - (2)].Sim_script_fifo);
+ APPEND_G_FIFO((yyval.Sim_script_fifo), (yyvsp[(2) - (2)].Sim_script));
}
-#line 3337 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
- case 304:
-#line 1585 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+ case 307:
+/* Line 1787 of yacc.c */
+#line 1591 "../../ntpd/ntp_parser.y"
{
(yyval.Sim_script_fifo) = NULL;
- APPEND_G_FIFO((yyval.Sim_script_fifo), (yyvsp[0].Sim_script));
+ APPEND_G_FIFO((yyval.Sim_script_fifo), (yyvsp[(1) - (1)].Sim_script));
}
-#line 3346 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
- case 305:
-#line 1593 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
- { (yyval.Sim_script) = ONLY_SIM(create_sim_script_info((yyvsp[-3].Double), (yyvsp[-1].Attr_val_fifo))); }
-#line 3352 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ case 308:
+/* Line 1787 of yacc.c */
+#line 1599 "../../ntpd/ntp_parser.y"
+ { (yyval.Sim_script) = ONLY_SIM(create_sim_script_info((yyvsp[(3) - (6)].Double), (yyvsp[(5) - (6)].Attr_val_fifo))); }
break;
- case 306:
-#line 1598 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+ case 309:
+/* Line 1787 of yacc.c */
+#line 1604 "../../ntpd/ntp_parser.y"
{
- (yyval.Attr_val_fifo) = (yyvsp[-2].Attr_val_fifo);
- APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[-1].Attr_val));
+ (yyval.Attr_val_fifo) = (yyvsp[(1) - (3)].Attr_val_fifo);
+ APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[(2) - (3)].Attr_val));
}
-#line 3361 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
- case 307:
-#line 1603 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+ case 310:
+/* Line 1787 of yacc.c */
+#line 1609 "../../ntpd/ntp_parser.y"
{
(yyval.Attr_val_fifo) = NULL;
- APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[-1].Attr_val));
+ APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[(1) - (2)].Attr_val));
}
-#line 3370 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
- case 308:
-#line 1611 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
- { (yyval.Attr_val) = create_attr_dval((yyvsp[-2].Integer), (yyvsp[0].Double)); }
-#line 3376 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ case 311:
+/* Line 1787 of yacc.c */
+#line 1617 "../../ntpd/ntp_parser.y"
+ { (yyval.Attr_val) = create_attr_dval((yyvsp[(1) - (3)].Integer), (yyvsp[(3) - (3)].Double)); }
break;
-#line 3380 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+/* Line 1787 of yacc.c */
+#line 3625 "ntp_parser.c"
default: break;
}
/* User semantic actions sometimes alter yychar, and that requires
@@ -3398,7 +3643,7 @@ yyreduce:
*++yyvsp = yyval;
- /* Now 'shift' the result of the reduction. Determine what state
+ /* Now `shift' the result of the reduction. Determine what state
that goes to, based on the state we popped back to and the rule
number reduced by. */
@@ -3413,9 +3658,9 @@ yyreduce:
goto yynewstate;
-/*--------------------------------------.
-| yyerrlab -- here on detecting error. |
-`--------------------------------------*/
+/*------------------------------------.
+| yyerrlab -- here on detecting error |
+`------------------------------------*/
yyerrlab:
/* Make sure we have latest lookahead translation. See comments at
user semantic actions for why this is necessary. */
@@ -3466,20 +3711,20 @@ yyerrlab:
if (yyerrstatus == 3)
{
/* If just tried and failed to reuse lookahead token after an
- error, discard it. */
+ error, discard it. */
if (yychar <= YYEOF)
- {
- /* Return failure if at end of input. */
- if (yychar == YYEOF)
- YYABORT;
- }
+ {
+ /* Return failure if at end of input. */
+ if (yychar == YYEOF)
+ YYABORT;
+ }
else
- {
- yydestruct ("Error: discarding",
- yytoken, &yylval);
- yychar = YYEMPTY;
- }
+ {
+ yydestruct ("Error: discarding",
+ yytoken, &yylval);
+ yychar = YYEMPTY;
+ }
}
/* Else will try to reuse lookahead token after shifting the error
@@ -3498,7 +3743,7 @@ yyerrorlab:
if (/*CONSTCOND*/ 0)
goto yyerrorlab;
- /* Do not reclaim the symbols of the rule whose action triggered
+ /* Do not reclaim the symbols of the rule which action triggered
this YYERROR. */
YYPOPSTACK (yylen);
yylen = 0;
@@ -3511,29 +3756,29 @@ yyerrorlab:
| yyerrlab1 -- common code for both syntax error and YYERROR. |
`-------------------------------------------------------------*/
yyerrlab1:
- yyerrstatus = 3; /* Each real token shifted decrements this. */
+ yyerrstatus = 3; /* Each real token shifted decrements this. */
for (;;)
{
yyn = yypact[yystate];
if (!yypact_value_is_default (yyn))
- {
- yyn += YYTERROR;
- if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
- {
- yyn = yytable[yyn];
- if (0 < yyn)
- break;
- }
- }
+ {
+ yyn += YYTERROR;
+ if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
+ {
+ yyn = yytable[yyn];
+ if (0 < yyn)
+ break;
+ }
+ }
/* Pop the current state because it cannot handle the error token. */
if (yyssp == yyss)
- YYABORT;
+ YYABORT;
yydestruct ("Error: popping",
- yystos[yystate], yyvsp);
+ yystos[yystate], yyvsp);
YYPOPSTACK (1);
yystate = *yyssp;
YY_STACK_PRINT (yyss, yyssp);
@@ -3584,14 +3829,14 @@ yyreturn:
yydestruct ("Cleanup: discarding lookahead",
yytoken, &yylval);
}
- /* Do not reclaim the symbols of the rule whose action triggered
+ /* Do not reclaim the symbols of the rule which action triggered
this YYABORT or YYACCEPT. */
YYPOPSTACK (yylen);
YY_STACK_PRINT (yyss, yyssp);
while (yyssp != yyss)
{
yydestruct ("Cleanup: popping",
- yystos[*yyssp], yyvsp);
+ yystos[*yyssp], yyvsp);
YYPOPSTACK (1);
}
#ifndef yyoverflow
@@ -3602,9 +3847,13 @@ yyreturn:
if (yymsg != yymsgbuf)
YYSTACK_FREE (yymsg);
#endif
- return yyresult;
+ /* Make sure YYID is used. */
+ return YYID (yyresult);
}
-#line 1622 "../../ntpd/ntp_parser.y" /* yacc.c:1906 */
+
+
+/* Line 2050 of yacc.c */
+#line 1628 "../../ntpd/ntp_parser.y"
void
diff --git a/contrib/ntp/ntpd/ntp_parser.h b/contrib/ntp/ntpd/ntp_parser.h
index 1ec7f8c..ae729b5 100644
--- a/contrib/ntp/ntpd/ntp_parser.h
+++ b/contrib/ntp/ntpd/ntp_parser.h
@@ -1,19 +1,19 @@
-/* A Bison parser, made by GNU Bison 3.0.2. */
+/* A Bison parser, made by GNU Bison 2.7.12-4996. */
/* Bison interface for Yacc-like parsers in C
-
- Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc.
-
+
+ Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc.
+
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/>. */
@@ -26,13 +26,13 @@
special exception, which will cause the skeleton and the resulting
Bison output files to be licensed under the GNU General Public
License without this special exception.
-
+
This special exception was added by the Free Software Foundation in
version 2.2 of Bison. */
-#ifndef YY_YY__NTPD_NTP_PARSER_H_INCLUDED
-# define YY_YY__NTPD_NTP_PARSER_H_INCLUDED
-/* Debug traces. */
+#ifndef YY_YY_NTP_PARSER_H_INCLUDED
+# define YY_YY_NTP_PARSER_H_INCLUDED
+/* Enabling traces. */
#ifndef YYDEBUG
# define YYDEBUG 1
#endif
@@ -40,203 +40,207 @@
extern int yydebug;
#endif
-/* Token type. */
+/* Tokens. */
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
- enum yytokentype
- {
- T_Abbrev = 258,
- T_Age = 259,
- T_All = 260,
- T_Allan = 261,
- T_Allpeers = 262,
- T_Auth = 263,
- T_Autokey = 264,
- T_Automax = 265,
- T_Average = 266,
- T_Bclient = 267,
- T_Beacon = 268,
- T_Broadcast = 269,
- T_Broadcastclient = 270,
- T_Broadcastdelay = 271,
- T_Burst = 272,
- T_Calibrate = 273,
- T_Ceiling = 274,
- T_Clockstats = 275,
- T_Cohort = 276,
- T_ControlKey = 277,
- T_Crypto = 278,
- T_Cryptostats = 279,
- T_Ctl = 280,
- T_Day = 281,
- T_Default = 282,
- T_Digest = 283,
- T_Disable = 284,
- T_Discard = 285,
- T_Dispersion = 286,
- T_Double = 287,
- T_Driftfile = 288,
- T_Drop = 289,
- T_Dscp = 290,
- T_Ellipsis = 291,
- T_Enable = 292,
- T_End = 293,
- T_False = 294,
- T_File = 295,
- T_Filegen = 296,
- T_Filenum = 297,
- T_Flag1 = 298,
- T_Flag2 = 299,
- T_Flag3 = 300,
- T_Flag4 = 301,
- T_Flake = 302,
- T_Floor = 303,
- T_Freq = 304,
- T_Fudge = 305,
- T_Host = 306,
- T_Huffpuff = 307,
- T_Iburst = 308,
- T_Ident = 309,
- T_Ignore = 310,
- T_Incalloc = 311,
- T_Incmem = 312,
- T_Initalloc = 313,
- T_Initmem = 314,
- T_Includefile = 315,
- T_Integer = 316,
- T_Interface = 317,
- T_Intrange = 318,
- T_Io = 319,
- T_Ipv4 = 320,
- T_Ipv4_flag = 321,
- T_Ipv6 = 322,
- T_Ipv6_flag = 323,
- T_Kernel = 324,
- T_Key = 325,
- T_Keys = 326,
- T_Keysdir = 327,
- T_Kod = 328,
- T_Mssntp = 329,
- T_Leapfile = 330,
- T_Leapsmearinterval = 331,
- T_Limited = 332,
- T_Link = 333,
- T_Listen = 334,
- T_Logconfig = 335,
- T_Logfile = 336,
- T_Loopstats = 337,
- T_Lowpriotrap = 338,
- T_Manycastclient = 339,
- T_Manycastserver = 340,
- T_Mask = 341,
- T_Maxage = 342,
- T_Maxclock = 343,
- T_Maxdepth = 344,
- T_Maxdist = 345,
- T_Maxmem = 346,
- T_Maxpoll = 347,
- T_Mdnstries = 348,
- T_Mem = 349,
- T_Memlock = 350,
- T_Minclock = 351,
- T_Mindepth = 352,
- T_Mindist = 353,
- T_Minimum = 354,
- T_Minpoll = 355,
- T_Minsane = 356,
- T_Mode = 357,
- T_Mode7 = 358,
- T_Monitor = 359,
- T_Month = 360,
- T_Mru = 361,
- T_Multicastclient = 362,
- T_Nic = 363,
- T_Nolink = 364,
- T_Nomodify = 365,
- T_Nomrulist = 366,
- T_None = 367,
- T_Nonvolatile = 368,
- T_Nopeer = 369,
- T_Noquery = 370,
- T_Noselect = 371,
- T_Noserve = 372,
- T_Notrap = 373,
- T_Notrust = 374,
- T_Ntp = 375,
- T_Ntpport = 376,
- T_NtpSignDsocket = 377,
- T_Orphan = 378,
- T_Orphanwait = 379,
- T_Panic = 380,
- T_Peer = 381,
- T_Peerstats = 382,
- T_Phone = 383,
- T_Pid = 384,
- T_Pidfile = 385,
- T_Pool = 386,
- T_Port = 387,
- T_Preempt = 388,
- T_Prefer = 389,
- T_Protostats = 390,
- T_Pw = 391,
- T_Randfile = 392,
- T_Rawstats = 393,
- T_Refid = 394,
- T_Requestkey = 395,
- T_Reset = 396,
- T_Restrict = 397,
- T_Revoke = 398,
- T_Rlimit = 399,
- T_Saveconfigdir = 400,
- T_Server = 401,
- T_Setvar = 402,
- T_Source = 403,
- T_Stacksize = 404,
- T_Statistics = 405,
- T_Stats = 406,
- T_Statsdir = 407,
- T_Step = 408,
- T_Stepback = 409,
- T_Stepfwd = 410,
- T_Stepout = 411,
- T_Stratum = 412,
- T_String = 413,
- T_Sys = 414,
- T_Sysstats = 415,
- T_Tick = 416,
- T_Time1 = 417,
- T_Time2 = 418,
- T_Timer = 419,
- T_Timingstats = 420,
- T_Tinker = 421,
- T_Tos = 422,
- T_Trap = 423,
- T_True = 424,
- T_Trustedkey = 425,
- T_Ttl = 426,
- T_Type = 427,
- T_U_int = 428,
- T_Unconfig = 429,
- T_Unpeer = 430,
- T_Version = 431,
- T_WanderThreshold = 432,
- T_Week = 433,
- T_Wildcard = 434,
- T_Xleave = 435,
- T_Year = 436,
- T_Flag = 437,
- T_EOC = 438,
- T_Simulate = 439,
- T_Beep_Delay = 440,
- T_Sim_Duration = 441,
- T_Server_Offset = 442,
- T_Duration = 443,
- T_Freq_Offset = 444,
- T_Wander = 445,
- T_Jitter = 446,
- T_Prop_Delay = 447,
- T_Proc_Delay = 448
- };
+ /* Put the tokens into the symbol table, so that GDB and other debuggers
+ know about them. */
+ enum yytokentype {
+ T_Abbrev = 258,
+ T_Age = 259,
+ T_All = 260,
+ T_Allan = 261,
+ T_Allpeers = 262,
+ T_Auth = 263,
+ T_Autokey = 264,
+ T_Automax = 265,
+ T_Average = 266,
+ T_Bclient = 267,
+ T_Beacon = 268,
+ T_Broadcast = 269,
+ T_Broadcastclient = 270,
+ T_Broadcastdelay = 271,
+ T_Burst = 272,
+ T_Calibrate = 273,
+ T_Ceiling = 274,
+ T_Clockstats = 275,
+ T_Cohort = 276,
+ T_ControlKey = 277,
+ T_Crypto = 278,
+ T_Cryptostats = 279,
+ T_Ctl = 280,
+ T_Day = 281,
+ T_Default = 282,
+ T_Digest = 283,
+ T_Disable = 284,
+ T_Discard = 285,
+ T_Dispersion = 286,
+ T_Double = 287,
+ T_Driftfile = 288,
+ T_Drop = 289,
+ T_Dscp = 290,
+ T_Ellipsis = 291,
+ T_Enable = 292,
+ T_End = 293,
+ T_False = 294,
+ T_File = 295,
+ T_Filegen = 296,
+ T_Filenum = 297,
+ T_Flag1 = 298,
+ T_Flag2 = 299,
+ T_Flag3 = 300,
+ T_Flag4 = 301,
+ T_Flake = 302,
+ T_Floor = 303,
+ T_Freq = 304,
+ T_Fudge = 305,
+ T_Host = 306,
+ T_Huffpuff = 307,
+ T_Iburst = 308,
+ T_Ident = 309,
+ T_Ignore = 310,
+ T_Incalloc = 311,
+ T_Incmem = 312,
+ T_Initalloc = 313,
+ T_Initmem = 314,
+ T_Includefile = 315,
+ T_Integer = 316,
+ T_Interface = 317,
+ T_Intrange = 318,
+ T_Io = 319,
+ T_Ipv4 = 320,
+ T_Ipv4_flag = 321,
+ T_Ipv6 = 322,
+ T_Ipv6_flag = 323,
+ T_Kernel = 324,
+ T_Key = 325,
+ T_Keys = 326,
+ T_Keysdir = 327,
+ T_Kod = 328,
+ T_Mssntp = 329,
+ T_Leapfile = 330,
+ T_Leapsmearinterval = 331,
+ T_Limited = 332,
+ T_Link = 333,
+ T_Listen = 334,
+ T_Logconfig = 335,
+ T_Logfile = 336,
+ T_Loopstats = 337,
+ T_Lowpriotrap = 338,
+ T_Manycastclient = 339,
+ T_Manycastserver = 340,
+ T_Mask = 341,
+ T_Maxage = 342,
+ T_Maxclock = 343,
+ T_Maxdepth = 344,
+ T_Maxdist = 345,
+ T_Maxmem = 346,
+ T_Maxpoll = 347,
+ T_Mdnstries = 348,
+ T_Mem = 349,
+ T_Memlock = 350,
+ T_Minclock = 351,
+ T_Mindepth = 352,
+ T_Mindist = 353,
+ T_Minimum = 354,
+ T_Minpoll = 355,
+ T_Minsane = 356,
+ T_Mode = 357,
+ T_Mode7 = 358,
+ T_Monitor = 359,
+ T_Month = 360,
+ T_Mru = 361,
+ T_Multicastclient = 362,
+ T_Nic = 363,
+ T_Nolink = 364,
+ T_Nomodify = 365,
+ T_Nomrulist = 366,
+ T_None = 367,
+ T_Nonvolatile = 368,
+ T_Nopeer = 369,
+ T_Noquery = 370,
+ T_Noselect = 371,
+ T_Noserve = 372,
+ T_Notrap = 373,
+ T_Notrust = 374,
+ T_Ntp = 375,
+ T_Ntpport = 376,
+ T_NtpSignDsocket = 377,
+ T_Orphan = 378,
+ T_Orphanwait = 379,
+ T_Panic = 380,
+ T_Peer = 381,
+ T_Peerstats = 382,
+ T_Phone = 383,
+ T_Pid = 384,
+ T_Pidfile = 385,
+ T_Pool = 386,
+ T_Port = 387,
+ T_Preempt = 388,
+ T_Prefer = 389,
+ T_Protostats = 390,
+ T_Pw = 391,
+ T_Randfile = 392,
+ T_Rawstats = 393,
+ T_Refid = 394,
+ T_Requestkey = 395,
+ T_Reset = 396,
+ T_Restrict = 397,
+ T_Revoke = 398,
+ T_Rlimit = 399,
+ T_Saveconfigdir = 400,
+ T_Server = 401,
+ T_Setvar = 402,
+ T_Source = 403,
+ T_Stacksize = 404,
+ T_Statistics = 405,
+ T_Stats = 406,
+ T_Statsdir = 407,
+ T_Step = 408,
+ T_Stepback = 409,
+ T_Stepfwd = 410,
+ T_Stepout = 411,
+ T_Stratum = 412,
+ T_String = 413,
+ T_Sys = 414,
+ T_Sysstats = 415,
+ T_Tick = 416,
+ T_Time1 = 417,
+ T_Time2 = 418,
+ T_Timer = 419,
+ T_Timingstats = 420,
+ T_Tinker = 421,
+ T_Tos = 422,
+ T_Trap = 423,
+ T_True = 424,
+ T_Trustedkey = 425,
+ T_Ttl = 426,
+ T_Type = 427,
+ T_U_int = 428,
+ T_UEcrypto = 429,
+ T_UEcryptonak = 430,
+ T_UEdigest = 431,
+ T_Unconfig = 432,
+ T_Unpeer = 433,
+ T_Version = 434,
+ T_WanderThreshold = 435,
+ T_Week = 436,
+ T_Wildcard = 437,
+ T_Xleave = 438,
+ T_Year = 439,
+ T_Flag = 440,
+ T_EOC = 441,
+ T_Simulate = 442,
+ T_Beep_Delay = 443,
+ T_Sim_Duration = 444,
+ T_Server_Offset = 445,
+ T_Duration = 446,
+ T_Freq_Offset = 447,
+ T_Wander = 448,
+ T_Jitter = 449,
+ T_Prop_Delay = 450,
+ T_Proc_Delay = 451
+ };
#endif
/* Tokens. */
#define T_Abbrev 258
@@ -410,33 +414,37 @@ extern int yydebug;
#define T_Ttl 426
#define T_Type 427
#define T_U_int 428
-#define T_Unconfig 429
-#define T_Unpeer 430
-#define T_Version 431
-#define T_WanderThreshold 432
-#define T_Week 433
-#define T_Wildcard 434
-#define T_Xleave 435
-#define T_Year 436
-#define T_Flag 437
-#define T_EOC 438
-#define T_Simulate 439
-#define T_Beep_Delay 440
-#define T_Sim_Duration 441
-#define T_Server_Offset 442
-#define T_Duration 443
-#define T_Freq_Offset 444
-#define T_Wander 445
-#define T_Jitter 446
-#define T_Prop_Delay 447
-#define T_Proc_Delay 448
+#define T_UEcrypto 429
+#define T_UEcryptonak 430
+#define T_UEdigest 431
+#define T_Unconfig 432
+#define T_Unpeer 433
+#define T_Version 434
+#define T_WanderThreshold 435
+#define T_Week 436
+#define T_Wildcard 437
+#define T_Xleave 438
+#define T_Year 439
+#define T_Flag 440
+#define T_EOC 441
+#define T_Simulate 442
+#define T_Beep_Delay 443
+#define T_Sim_Duration 444
+#define T_Server_Offset 445
+#define T_Duration 446
+#define T_Freq_Offset 447
+#define T_Wander 448
+#define T_Jitter 449
+#define T_Prop_Delay 450
+#define T_Proc_Delay 451
+
+
-/* Value type. */
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
-typedef union YYSTYPE YYSTYPE;
-union YYSTYPE
+typedef union YYSTYPE
{
-#line 51 "../../ntpd/ntp_parser.y" /* yacc.c:1909 */
+/* Line 2053 of yacc.c */
+#line 51 "../../ntpd/ntp_parser.y"
char * String;
double Double;
@@ -455,15 +463,29 @@ union YYSTYPE
script_info * Sim_script;
script_info_fifo * Sim_script_fifo;
-#line 459 "../../ntpd/ntp_parser.h" /* yacc.c:1909 */
-};
+
+/* Line 2053 of yacc.c */
+#line 469 "ntp_parser.h"
+} YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1
+# define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1
#endif
-
extern YYSTYPE yylval;
+#ifdef YYPARSE_PARAM
+#if defined __STDC__ || defined __cplusplus
+int yyparse (void *YYPARSE_PARAM);
+#else
+int yyparse ();
+#endif
+#else /* ! YYPARSE_PARAM */
+#if defined __STDC__ || defined __cplusplus
int yyparse (void);
+#else
+int yyparse ();
+#endif
+#endif /* ! YYPARSE_PARAM */
-#endif /* !YY_YY__NTPD_NTP_PARSER_H_INCLUDED */
+#endif /* !YY_YY_NTP_PARSER_H_INCLUDED */
diff --git a/contrib/ntp/ntpd/ntp_proto.c b/contrib/ntp/ntpd/ntp_proto.c
index f770472..ad45409 100644
--- a/contrib/ntp/ntpd/ntp_proto.c
+++ b/contrib/ntp/ntpd/ntp_proto.c
@@ -153,6 +153,19 @@ u_long sys_declined; /* declined */
u_long sys_limitrejected; /* rate exceeded */
u_long sys_kodsent; /* KoD sent */
+/*
+ * Mechanism knobs: how soon do we unpeer()?
+ *
+ * The default way is "on-receipt". If this was a packet from a
+ * well-behaved source, on-receipt will offer the fastest recovery.
+ * If this was from a DoS attack, the default way makes it easier
+ * for a bad-guy to DoS us. So look and see what bites you harder
+ * and choose according to your environment.
+ */
+int unpeer_crypto_early = 1; /* bad crypto (TEST9) */
+int unpeer_crypto_nak_early = 1; /* crypto_NAK (TEST5) */
+int unpeer_digest_early = 1; /* bad digest (TEST5) */
+
static int kiss_code_check(u_char hisleap, u_char hisstratum, u_char hismode, u_int32 refid);
static double root_distance (struct peer *);
static void clock_combine (peer_select *, int, int);
@@ -1157,6 +1170,7 @@ receive(
} else {
peer->delay = sys_bdelay;
+ peer->bxmt = p_xmt;
}
break;
}
@@ -1177,6 +1191,7 @@ receive(
sys_restricted++;
return; /* ignore duplicate */
}
+ peer->bxmt = p_xmt;
#ifdef AUTOKEY
if (skeyid > NTP_MAXKEY)
crypto_recv(peer, rbufp);
@@ -1286,6 +1301,73 @@ receive(
return;
}
#endif /* AUTOKEY */
+
+ if (MODE_BROADCAST == hismode) {
+ u_char poll;
+ int bail = 0;
+ l_fp tdiff;
+
+ DPRINTF(2, ("receive: PROCPKT/BROADCAST: prev pkt %ld seconds ago, ppoll: %d, %d secs\n",
+ (current_time - peer->timelastrec),
+ peer->ppoll, (1 << peer->ppoll)
+ ));
+ /* Things we can check:
+ *
+ * Did the poll interval change?
+ * Is the poll interval in the packet in-range?
+ * Did this packet arrive too soon?
+ * Is the timestamp in this packet monotonic
+ * with respect to the previous packet?
+ */
+
+ /* This is noteworthy, not error-worthy */
+ if (pkt->ppoll != peer->ppoll) {
+ msyslog(LOG_INFO, "receive: broadcast poll from %s changed from %ud to %ud",
+ stoa(&rbufp->recv_srcadr),
+ peer->ppoll, pkt->ppoll);
+ }
+
+ poll = min(peer->maxpoll,
+ max(peer->minpoll, pkt->ppoll));
+
+ /* This is error-worthy */
+ if (pkt->ppoll != poll) {
+ msyslog(LOG_INFO, "receive: broadcast poll of %ud from %s is out-of-range (%d to %d)!",
+ pkt->ppoll, stoa(&rbufp->recv_srcadr),
+ peer->minpoll, peer->maxpoll);
+ ++bail;
+ }
+
+ if ( (current_time - peer->timelastrec)
+ < (1 << pkt->ppoll)) {
+ msyslog(LOG_INFO, "receive: broadcast packet from %s arrived after %ld, not %d seconds!",
+ stoa(&rbufp->recv_srcadr),
+ (current_time - peer->timelastrec),
+ (1 << pkt->ppoll)
+ );
+ ++bail;
+ }
+
+ tdiff = p_xmt;
+ L_SUB(&tdiff, &peer->bxmt);
+ if (tdiff.l_i < 0) {
+ msyslog(LOG_INFO, "receive: broadcast packet from %s contains non-monotonic timestamp: %#010x.%08x -> %#010x.%08x",
+ stoa(&rbufp->recv_srcadr),
+ peer->bxmt.l_ui, peer->bxmt.l_uf,
+ p_xmt.l_ui, p_xmt.l_uf
+ );
+ ++bail;
+ }
+
+ peer->bxmt = p_xmt;
+
+ if (bail) {
+ peer->timelastrec = current_time;
+ sys_declined++;
+ return;
+ }
+ }
+
break;
/*
@@ -1362,7 +1444,12 @@ receive(
/*
* Basic mode checks:
*
- * If there is no origin timestamp, it's an initial packet.
+ * If there is no origin timestamp, it's either an initial packet
+ * or we've already received a response to our query. Of course,
+ * should 'aorg' be all-zero because this really was the original
+ * transmit timestamp, we'll drop the reply. There is a window of
+ * one nanosecond once every 136 years' time where this is possible.
+ * We currently ignore this situation.
*
* Otherwise, check for bogus packet in basic mode.
* If it is bogus, switch to interleaved mode and resynchronize,
@@ -1375,7 +1462,8 @@ receive(
} else if (peer->flip == 0) {
if (0 < hisstratum && L_ISZERO(&p_org)) {
L_CLR(&peer->aorg);
- } else if (!L_ISEQU(&p_org, &peer->aorg)) {
+ } else if ( L_ISZERO(&peer->aorg)
+ || !L_ISEQU(&p_org, &peer->aorg)) {
peer->bogusorg++;
peer->flash |= TEST2; /* bogus */
msyslog(LOG_INFO,
@@ -1424,7 +1512,9 @@ receive(
peer->flash |= TEST5; /* bad auth */
peer->badauth++;
if (peer->flags & FLAG_PREEMPT) {
- unpeer(peer);
+ if (unpeer_crypto_nak_early) {
+ unpeer(peer);
+ }
return;
}
#ifdef AUTOKEY
@@ -1450,7 +1540,9 @@ receive(
&& (hismode == MODE_ACTIVE || hismode == MODE_PASSIVE))
fast_xmit(rbufp, MODE_ACTIVE, 0, restrict_mask);
if (peer->flags & FLAG_PREEMPT) {
- unpeer(peer);
+ if (unpeer_digest_early) {
+ unpeer(peer);
+ }
return;
}
#ifdef AUTOKEY
@@ -1505,12 +1597,47 @@ receive(
return; /* Drop any other kiss code packets */
}
+ /*
+ * If:
+ * - this is a *cast (uni-, broad-, or m-) server packet
+ * - and it's authenticated
+ * then see if the sender's IP is trusted for this keyid.
+ * If it is, great - nothing special to do here.
+ * Otherwise, we should report and bail.
+ */
+
+ switch (hismode) {
+ case MODE_SERVER: /* server mode */
+ case MODE_BROADCAST: /* broadcast mode */
+ case MODE_ACTIVE: /* symmetric active mode */
+ if ( is_authentic == AUTH_OK
+ && !authistrustedip(skeyid, &peer->srcadr)) {
+ report_event(PEVNT_AUTH, peer, "authIP");
+ peer->badauth++;
+ return;
+ }
+ break;
+
+ case MODE_UNSPEC: /* unspecified (old version) */
+ case MODE_PASSIVE: /* symmetric passive mode */
+ case MODE_CLIENT: /* client mode */
+#if 0 /* At this point, MODE_CONTROL is overloaded by MODE_BCLIENT */
+ case MODE_CONTROL: /* control mode */
+#endif
+ case MODE_PRIVATE: /* private mode */
+ case MODE_BCLIENT: /* broadcast client mode */
+ break;
+ default:
+ break;
+ }
+
/*
* That was hard and I am sweaty, but the packet is squeaky
* clean. Get on with real work.
*/
peer->timereceived = current_time;
+ peer->timelastrec = current_time;
if (is_authentic == AUTH_OK)
peer->flags |= FLAG_AUTHENTIC;
else
@@ -1560,8 +1687,11 @@ receive(
"crypto error");
peer_clear(peer, "CRYP");
peer->flash |= TEST9; /* bad crypt */
- if (peer->flags & FLAG_PREEMPT)
- unpeer(peer);
+ if (peer->flags & FLAG_PREEMPT) {
+ if (unpeer_crypto_early) {
+ unpeer(peer);
+ }
+ }
}
return;
}
@@ -4358,6 +4488,22 @@ proto_config(
io_multicast_del(svalue);
break;
+ /*
+ * Unpeer Early policy choices
+ */
+
+ case PROTO_UECRYPTO: /* Crypto */
+ unpeer_crypto_early = value;
+ break;
+
+ case PROTO_UECRYPTONAK: /* Crypto_NAK */
+ unpeer_crypto_nak_early = value;
+ break;
+
+ case PROTO_UEDIGEST: /* Digest */
+ unpeer_digest_early = value;
+ break;
+
default:
msyslog(LOG_NOTICE,
"proto: unsupported option %d", item);
diff --git a/contrib/ntp/ntpd/ntp_request.c b/contrib/ntp/ntpd/ntp_request.c
index fa78ce1..ba968e2 100644
--- a/contrib/ntp/ntpd/ntp_request.c
+++ b/contrib/ntp/ntpd/ntp_request.c
@@ -81,8 +81,8 @@ static void do_unconf (sockaddr_u *, endpt *, struct req_pkt *);
static void set_sys_flag (sockaddr_u *, endpt *, struct req_pkt *);
static void clr_sys_flag (sockaddr_u *, endpt *, struct req_pkt *);
static void setclr_flags (sockaddr_u *, endpt *, struct req_pkt *, u_long);
-static void list_restrict4 (restrict_u *, struct info_restrict **);
-static void list_restrict6 (restrict_u *, struct info_restrict **);
+static void list_restrict4 (const restrict_u *, struct info_restrict **);
+static void list_restrict6 (const restrict_u *, struct info_restrict **);
static void list_restrict (sockaddr_u *, endpt *, struct req_pkt *);
static void do_resaddflags (sockaddr_u *, endpt *, struct req_pkt *);
static void do_ressubflags (sockaddr_u *, endpt *, struct req_pkt *);
@@ -667,43 +667,35 @@ list_peers(
struct req_pkt *inpkt
)
{
- struct info_peer_list *ip;
- struct peer *pp;
- int skip = 0;
+ struct info_peer_list * ip;
+ const struct peer * pp;
ip = (struct info_peer_list *)prepare_pkt(srcadr, inter, inpkt,
v6sizeof(struct info_peer_list));
for (pp = peer_list; pp != NULL && ip != NULL; pp = pp->p_link) {
if (IS_IPV6(&pp->srcadr)) {
- if (client_v6_capable) {
- ip->addr6 = SOCK_ADDR6(&pp->srcadr);
- ip->v6_flag = 1;
- skip = 0;
- } else {
- skip = 1;
- break;
- }
+ if (!client_v6_capable)
+ continue;
+ ip->addr6 = SOCK_ADDR6(&pp->srcadr);
+ ip->v6_flag = 1;
} else {
ip->addr = NSRCADR(&pp->srcadr);
if (client_v6_capable)
ip->v6_flag = 0;
- skip = 0;
}
- if (!skip) {
- ip->port = NSRCPORT(&pp->srcadr);
- ip->hmode = pp->hmode;
- ip->flags = 0;
- if (pp->flags & FLAG_CONFIG)
- ip->flags |= INFO_FLAG_CONFIG;
- if (pp == sys_peer)
- ip->flags |= INFO_FLAG_SYSPEER;
- if (pp->status == CTL_PST_SEL_SYNCCAND)
- ip->flags |= INFO_FLAG_SEL_CANDIDATE;
- if (pp->status >= CTL_PST_SEL_SYSPEER)
- ip->flags |= INFO_FLAG_SHORTLIST;
- ip = (struct info_peer_list *)more_pkt();
- }
+ ip->port = NSRCPORT(&pp->srcadr);
+ ip->hmode = pp->hmode;
+ ip->flags = 0;
+ if (pp->flags & FLAG_CONFIG)
+ ip->flags |= INFO_FLAG_CONFIG;
+ if (pp == sys_peer)
+ ip->flags |= INFO_FLAG_SYSPEER;
+ if (pp->status == CTL_PST_SEL_SYNCCAND)
+ ip->flags |= INFO_FLAG_SEL_CANDIDATE;
+ if (pp->status >= CTL_PST_SEL_SYSPEER)
+ ip->flags |= INFO_FLAG_SHORTLIST;
+ ip = (struct info_peer_list *)more_pkt();
} /* for pp */
flush_pkt();
@@ -720,10 +712,9 @@ list_peers_sum(
struct req_pkt *inpkt
)
{
- register struct info_peer_summary *ips;
- register struct peer *pp;
- l_fp ltmp;
- register int skip;
+ struct info_peer_summary * ips;
+ const struct peer * pp;
+ l_fp ltmp;
DPRINTF(3, ("wants peer list summary\n"));
@@ -736,18 +727,14 @@ list_peers_sum(
* want only v4.
*/
if (IS_IPV6(&pp->srcadr)) {
- if (client_v6_capable) {
- ips->srcadr6 = SOCK_ADDR6(&pp->srcadr);
- ips->v6_flag = 1;
- if (pp->dstadr)
- ips->dstadr6 = SOCK_ADDR6(&pp->dstadr->sin);
- else
- ZERO(ips->dstadr6);
- skip = 0;
- } else {
- skip = 1;
- break;
- }
+ if (!client_v6_capable)
+ continue;
+ ips->srcadr6 = SOCK_ADDR6(&pp->srcadr);
+ ips->v6_flag = 1;
+ if (pp->dstadr)
+ ips->dstadr6 = SOCK_ADDR6(&pp->dstadr->sin);
+ else
+ ZERO(ips->dstadr6);
} else {
ips->srcadr = NSRCADR(&pp->srcadr);
if (client_v6_capable)
@@ -765,39 +752,37 @@ list_peers_sum(
ips->dstadr = NSRCADR(&pp->dstadr->bcast);
}
}
- } else
+ } else {
ips->dstadr = 0;
-
- skip = 0;
+ }
}
- if (!skip) {
- ips->srcport = NSRCPORT(&pp->srcadr);
- ips->stratum = pp->stratum;
- ips->hpoll = pp->hpoll;
- ips->ppoll = pp->ppoll;
- ips->reach = pp->reach;
- ips->flags = 0;
- if (pp == sys_peer)
- ips->flags |= INFO_FLAG_SYSPEER;
- if (pp->flags & FLAG_CONFIG)
- ips->flags |= INFO_FLAG_CONFIG;
- if (pp->flags & FLAG_REFCLOCK)
- ips->flags |= INFO_FLAG_REFCLOCK;
- if (pp->flags & FLAG_PREFER)
- ips->flags |= INFO_FLAG_PREFER;
- if (pp->flags & FLAG_BURST)
- ips->flags |= INFO_FLAG_BURST;
- if (pp->status == CTL_PST_SEL_SYNCCAND)
- ips->flags |= INFO_FLAG_SEL_CANDIDATE;
- if (pp->status >= CTL_PST_SEL_SYSPEER)
- ips->flags |= INFO_FLAG_SHORTLIST;
- ips->hmode = pp->hmode;
- ips->delay = HTONS_FP(DTOFP(pp->delay));
- DTOLFP(pp->offset, &ltmp);
- HTONL_FP(&ltmp, &ips->offset);
- ips->dispersion = HTONS_FP(DTOUFP(SQRT(pp->disp)));
- }
+ ips->srcport = NSRCPORT(&pp->srcadr);
+ ips->stratum = pp->stratum;
+ ips->hpoll = pp->hpoll;
+ ips->ppoll = pp->ppoll;
+ ips->reach = pp->reach;
+ ips->flags = 0;
+ if (pp == sys_peer)
+ ips->flags |= INFO_FLAG_SYSPEER;
+ if (pp->flags & FLAG_CONFIG)
+ ips->flags |= INFO_FLAG_CONFIG;
+ if (pp->flags & FLAG_REFCLOCK)
+ ips->flags |= INFO_FLAG_REFCLOCK;
+ if (pp->flags & FLAG_PREFER)
+ ips->flags |= INFO_FLAG_PREFER;
+ if (pp->flags & FLAG_BURST)
+ ips->flags |= INFO_FLAG_BURST;
+ if (pp->status == CTL_PST_SEL_SYNCCAND)
+ ips->flags |= INFO_FLAG_SEL_CANDIDATE;
+ if (pp->status >= CTL_PST_SEL_SYSPEER)
+ ips->flags |= INFO_FLAG_SHORTLIST;
+ ips->hmode = pp->hmode;
+ ips->delay = HTONS_FP(DTOFP(pp->delay));
+ DTOLFP(pp->offset, &ltmp);
+ HTONL_FP(&ltmp, &ips->offset);
+ ips->dispersion = HTONS_FP(DTOUFP(SQRT(pp->disp)));
+
ips = (struct info_peer_summary *)more_pkt();
} /* for pp */
@@ -1197,7 +1182,7 @@ mem_stats(
ms->hashcount[i] = (u_char)
max((u_int)peer_hash_count[i], UCHAR_MAX);
- more_pkt();
+ (void) more_pkt();
flush_pkt();
}
@@ -1285,7 +1270,7 @@ loop_info(
li->compliance = htonl((u_int32)(tc_counter));
li->watchdog_timer = htonl((u_int32)(current_time - sys_epoch));
- more_pkt();
+ (void) more_pkt();
flush_pkt();
}
@@ -1571,56 +1556,143 @@ setclr_flags(
req_ack(srcadr, inter, inpkt, INFO_OKAY);
}
+/* There have been some issues with the restrict list processing,
+ * ranging from problems with deep recursion (resulting in stack
+ * overflows) and overfull reply buffers.
+ *
+ * To avoid this trouble the list reversal is done iteratively using a
+ * scratch pad.
+ */
+typedef struct RestrictStack RestrictStackT;
+struct RestrictStack {
+ RestrictStackT *link;
+ size_t fcnt;
+ const restrict_u *pres[63];
+};
+
+static size_t
+getStackSheetSize(
+ RestrictStackT *sp
+ )
+{
+ if (sp)
+ return sizeof(sp->pres)/sizeof(sp->pres[0]);
+ return 0u;
+}
+
+static int/*BOOL*/
+pushRestriction(
+ RestrictStackT **spp,
+ const restrict_u *ptr
+ )
+{
+ RestrictStackT *sp;
+
+ if (NULL == (sp = *spp) || 0 == sp->fcnt) {
+ /* need another sheet in the scratch pad */
+ sp = emalloc(sizeof(*sp));
+ sp->link = *spp;
+ sp->fcnt = getStackSheetSize(sp);
+ *spp = sp;
+ }
+ sp->pres[--sp->fcnt] = ptr;
+ return TRUE;
+}
+
+static int/*BOOL*/
+popRestriction(
+ RestrictStackT **spp,
+ const restrict_u **opp
+ )
+{
+ RestrictStackT *sp;
+
+ if (NULL == (sp = *spp) || sp->fcnt >= getStackSheetSize(sp))
+ return FALSE;
+
+ *opp = sp->pres[sp->fcnt++];
+ if (sp->fcnt >= getStackSheetSize(sp)) {
+ /* discard sheet from scratch pad */
+ *spp = sp->link;
+ free(sp);
+ }
+ return TRUE;
+}
+
+static void
+flushRestrictionStack(
+ RestrictStackT **spp
+ )
+{
+ RestrictStackT *sp;
+
+ while (NULL != (sp = *spp)) {
+ *spp = sp->link;
+ free(sp);
+ }
+}
+
/*
- * list_restrict4 - recursive helper for list_restrict dumps IPv4
+ * list_restrict4 - iterative helper for list_restrict dumps IPv4
* restriction list in reverse order.
*/
static void
list_restrict4(
- restrict_u * res,
+ const restrict_u * res,
struct info_restrict ** ppir
)
{
+ RestrictStackT * rpad;
struct info_restrict * pir;
- if (res->link != NULL)
- list_restrict4(res->link, ppir);
-
pir = *ppir;
- pir->addr = htonl(res->u.v4.addr);
- if (client_v6_capable)
- pir->v6_flag = 0;
- pir->mask = htonl(res->u.v4.mask);
- pir->count = htonl(res->count);
- pir->flags = htons(res->flags);
- pir->mflags = htons(res->mflags);
- *ppir = (struct info_restrict *)more_pkt();
+ for (rpad = NULL; res; res = res->link)
+ if (!pushRestriction(&rpad, res))
+ break;
+
+ while (pir && popRestriction(&rpad, &res)) {
+ pir->addr = htonl(res->u.v4.addr);
+ if (client_v6_capable)
+ pir->v6_flag = 0;
+ pir->mask = htonl(res->u.v4.mask);
+ pir->count = htonl(res->count);
+ pir->flags = htons(res->flags);
+ pir->mflags = htons(res->mflags);
+ pir = (struct info_restrict *)more_pkt();
+ }
+ flushRestrictionStack(&rpad);
+ *ppir = pir;
}
-
/*
- * list_restrict6 - recursive helper for list_restrict dumps IPv6
+ * list_restrict6 - iterative helper for list_restrict dumps IPv6
* restriction list in reverse order.
*/
static void
list_restrict6(
- restrict_u * res,
+ const restrict_u * res,
struct info_restrict ** ppir
)
{
+ RestrictStackT * rpad;
struct info_restrict * pir;
- if (res->link != NULL)
- list_restrict6(res->link, ppir);
-
pir = *ppir;
- pir->addr6 = res->u.v6.addr;
- pir->mask6 = res->u.v6.mask;
- pir->v6_flag = 1;
- pir->count = htonl(res->count);
- pir->flags = htons(res->flags);
- pir->mflags = htons(res->mflags);
- *ppir = (struct info_restrict *)more_pkt();
+ for (rpad = NULL; res; res = res->link)
+ if (!pushRestriction(&rpad, res))
+ break;
+
+ while (pir && popRestriction(&rpad, &res)) {
+ pir->addr6 = res->u.v6.addr;
+ pir->mask6 = res->u.v6.mask;
+ pir->v6_flag = 1;
+ pir->count = htonl(res->count);
+ pir->flags = htons(res->flags);
+ pir->mflags = htons(res->mflags);
+ pir = (struct info_restrict *)more_pkt();
+ }
+ flushRestrictionStack(&rpad);
+ *ppir = pir;
}
@@ -1644,8 +1716,7 @@ list_restrict(
/*
* The restriction lists are kept sorted in the reverse order
* than they were originally. To preserve the output semantics,
- * dump each list in reverse order. A recursive helper function
- * achieves that.
+ * dump each list in reverse order. The workers take care of that.
*/
list_restrict4(restrictlist4, &ir);
if (client_v6_capable)
@@ -2010,7 +2081,7 @@ do_trustkey(
register int items;
items = INFO_NITEMS(inpkt->err_nitems);
- kp = (uint32_t*)&inpkt->u;
+ kp = (uint32_t *)&inpkt->u;
while (items-- > 0) {
authtrust(*kp, trust);
kp++;
@@ -2089,7 +2160,7 @@ req_get_traps(
it = (struct info_trap *)prepare_pkt(srcadr, inter, inpkt,
v6sizeof(struct info_trap));
- for (i = 0, tr = ctl_traps; i < COUNTOF(ctl_traps); i++, tr++) {
+ for (i = 0, tr = ctl_traps; it && i < COUNTOF(ctl_traps); i++, tr++) {
if (tr->tr_flags & TRAP_INUSE) {
if (IS_IPV4(&tr->tr_addr)) {
if (tr->tr_localaddr == any_interface)
@@ -2405,7 +2476,7 @@ get_clock_info(
ic = (struct info_clock *)prepare_pkt(srcadr, inter, inpkt,
sizeof(struct info_clock));
- while (items-- > 0) {
+ while (items-- > 0 && ic) {
NSRCADR(&addr) = *clkaddr++;
if (!ISREFCLOCKADR(&addr) || NULL ==
findexistingpeer(&addr, NULL, NULL, -1, 0)) {
@@ -2544,7 +2615,7 @@ get_clkbug_info(
ic = (struct info_clkbug *)prepare_pkt(srcadr, inter, inpkt,
sizeof(struct info_clkbug));
- while (items-- > 0) {
+ while (items-- > 0 && ic) {
NSRCADR(&addr) = *clkaddr++;
if (!ISREFCLOCKADR(&addr) || NULL ==
findexistingpeer(&addr, NULL, NULL, -1, 0)) {
@@ -2592,13 +2663,15 @@ fill_info_if_stats(void *data, interface_info_t *interface_info)
struct info_if_stats **ifsp = (struct info_if_stats **)data;
struct info_if_stats *ifs = *ifsp;
endpt *ep = interface_info->ep;
+
+ if (NULL == ifs)
+ return;
ZERO(*ifs);
if (IS_IPV6(&ep->sin)) {
- if (!client_v6_capable) {
+ if (!client_v6_capable)
return;
- }
ifs->v6_flag = 1;
ifs->unaddr.addr6 = SOCK_ADDR6(&ep->sin);
ifs->unbcast.addr6 = SOCK_ADDR6(&ep->bcast);
diff --git a/contrib/ntp/ntpd/ntp_scanner.c b/contrib/ntp/ntpd/ntp_scanner.c
index 49adf6b..631c218 100644
--- a/contrib/ntp/ntpd/ntp_scanner.c
+++ b/contrib/ntp/ntpd/ntp_scanner.c
@@ -669,7 +669,7 @@ int
yylex(void)
{
static follby followedby = FOLLBY_TOKEN;
- int i;
+ size_t i;
int instring;
int yylval_was_set;
int converted;
diff --git a/contrib/ntp/ntpd/ntp_timer.c b/contrib/ntp/ntpd/ntp_timer.c
index 03084a3..78c81b6 100644
--- a/contrib/ntp/ntpd/ntp_timer.c
+++ b/contrib/ntp/ntpd/ntp_timer.c
@@ -549,14 +549,16 @@ check_leapsec(
#ifdef LEAP_SMEAR
leap_smear.enabled = leap_smear_intv != 0;
#endif
- if (reset) {
+ if (reset) {
lsprox = LSPROX_NOWARN;
leapsec_reset_frame();
memset(&lsdata, 0, sizeof(lsdata));
} else {
- int fired = leapsec_query(&lsdata, now, tpiv);
+ int fired;
- DPRINTF(1, ("*** leapsec_query: fired %i, now %u (0x%08X), tai_diff %i, ddist %u\n",
+ fired = leapsec_query(&lsdata, now, tpiv);
+
+ DPRINTF(3, ("*** leapsec_query: fired %i, now %u (0x%08X), tai_diff %i, ddist %u\n",
fired, now, now, lsdata.tai_diff, lsdata.ddist));
#ifdef LEAP_SMEAR
@@ -572,8 +574,7 @@ check_leapsec(
DPRINTF(1, ("*** leapsec_query: setting leap_smear interval %li, begin %.0f, end %.0f\n",
leap_smear.interval, leap_smear.intv_start, leap_smear.intv_end));
}
- }
- else {
+ } else {
if (leap_smear.interval)
DPRINTF(1, ("*** leapsec_query: clearing leap_smear interval\n"));
leap_smear.interval = 0;
@@ -655,10 +656,10 @@ check_leapsec(
sys_tai = lsdata.tai_offs;
} else {
#ifdef AUTOKEY
- update_autokey = (sys_tai != lsdata.tai_offs);
+ update_autokey = (sys_tai != (u_int)lsdata.tai_offs);
#endif
- lsprox = lsdata.proximity;
- sys_tai = lsdata.tai_offs;
+ lsprox = lsdata.proximity;
+ sys_tai = lsdata.tai_offs;
}
}
diff --git a/contrib/ntp/ntpd/ntpd-opts.c b/contrib/ntp/ntpd/ntpd-opts.c
index 660884b..f435a31 100644
--- a/contrib/ntp/ntpd/ntpd-opts.c
+++ b/contrib/ntp/ntpd/ntpd-opts.c
@@ -1,7 +1,7 @@
/*
* EDIT THIS FILE WITH CAUTION (ntpd-opts.c)
*
- * It has been AutoGen-ed January 7, 2016 at 11:28:29 PM by AutoGen 5.18.5
+ * It has been AutoGen-ed January 20, 2016 at 04:15:45 AM by AutoGen 5.18.5
* From the definitions ntpd-opts.def
* and the template file options
*
@@ -18,7 +18,7 @@
* The ntpd program is copyrighted and licensed
* under the following terms:
*
- * Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation, all rights reserved.
+ * Copyright (C) 1992-2016 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:
@@ -75,8 +75,8 @@ extern FILE * option_usage_fp;
* static const strings for ntpd options
*/
static char const ntpd_opt_strs[3129] =
-/* 0 */ "ntpd 4.2.8p5\n"
- "Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation, all rights reserved.\n"
+/* 0 */ "ntpd 4.2.8p6\n"
+ "Copyright (C) 1992-2016 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"
@@ -205,12 +205,12 @@ static char const ntpd_opt_strs[3129] =
/* 2900 */ "output version information and exit\0"
/* 2936 */ "version\0"
/* 2944 */ "NTPD\0"
-/* 2949 */ "ntpd - NTP daemon program - Ver. 4.2.8p5\n"
+/* 2949 */ "ntpd - NTP daemon program - Ver. 4.2.8p6\n"
"Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... \\\n"
"\t\t[ <server1> ... <serverN> ]\n\0"
/* 3080 */ "http://bugs.ntp.org, bugs@ntp.org\0"
/* 3114 */ "\n\0"
-/* 3116 */ "ntpd 4.2.8p5";
+/* 3116 */ "ntpd 4.2.8p6";
/**
* ipv4 option description with
@@ -1529,8 +1529,8 @@ static void bogus_function(void) {
translate option names.
*/
/* referenced via ntpdOptions.pzCopyright */
- puts(_("ntpd 4.2.8p5\n\
-Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation, all rights reserved.\n\
+ puts(_("ntpd 4.2.8p6\n\
+Copyright (C) 1992-2016 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"));
@@ -1670,7 +1670,7 @@ implied warranty.\n"));
puts(_("output version information and exit"));
/* referenced via ntpdOptions.pzUsageTitle */
- puts(_("ntpd - NTP daemon program - Ver. 4.2.8p5\n\
+ puts(_("ntpd - NTP daemon program - Ver. 4.2.8p6\n\
Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... \\\n\
\t\t[ <server1> ... <serverN> ]\n"));
@@ -1678,7 +1678,7 @@ Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... \\\n\
puts(_("\n"));
/* referenced via ntpdOptions.pzFullVersion */
- puts(_("ntpd 4.2.8p5"));
+ puts(_("ntpd 4.2.8p6"));
/* referenced via ntpdOptions.pzFullUsage */
puts(_("<<<NOT-FOUND>>>"));
diff --git a/contrib/ntp/ntpd/ntpd-opts.h b/contrib/ntp/ntpd/ntpd-opts.h
index 571fd34..9427cac 100644
--- a/contrib/ntp/ntpd/ntpd-opts.h
+++ b/contrib/ntp/ntpd/ntpd-opts.h
@@ -1,7 +1,7 @@
/*
* EDIT THIS FILE WITH CAUTION (ntpd-opts.h)
*
- * It has been AutoGen-ed January 7, 2016 at 11:28:28 PM by AutoGen 5.18.5
+ * It has been AutoGen-ed January 20, 2016 at 04:15:43 AM by AutoGen 5.18.5
* From the definitions ntpd-opts.def
* and the template file options
*
@@ -18,7 +18,7 @@
* The ntpd program is copyrighted and licensed
* under the following terms:
*
- * Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation, all rights reserved.
+ * Copyright (C) 1992-2016 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:
@@ -106,9 +106,9 @@ typedef enum {
/** count of all options for ntpd */
#define OPTION_CT 38
/** ntpd version */
-#define NTPD_VERSION "4.2.8p5"
+#define NTPD_VERSION "4.2.8p6"
/** Full ntpd version text */
-#define NTPD_FULL_VERSION "ntpd 4.2.8p5"
+#define NTPD_FULL_VERSION "ntpd 4.2.8p6"
/**
* Interface defines for all options. Replace "n" with the UPPER_CASED
diff --git a/contrib/ntp/ntpd/ntpd.1ntpdman b/contrib/ntp/ntpd/ntpd.1ntpdman
index 42d0caf..322d0bc4 100644
--- a/contrib/ntp/ntpd/ntpd.1ntpdman
+++ b/contrib/ntp/ntpd/ntpd.1ntpdman
@@ -10,11 +10,11 @@
.ds B-Font B
.ds I-Font I
.ds R-Font R
-.TH ntpd 1ntpdman "07 Jan 2016" "4.2.8p5" "User Commands"
+.TH ntpd 1ntpdman "20 Jan 2016" "4.2.8p6" "User Commands"
.\"
-.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-KDaWJq/ag-WDaOIq)
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-9JaiRS/ag-jKaaQS)
.\"
-.\" It has been AutoGen-ed January 7, 2016 at 11:30:44 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed January 20, 2016 at 04:17:54 AM by AutoGen 5.18.5
.\" From the definitions ntpd-opts.def
.\" and the template file agman-cmd.tpl
.SH NAME
@@ -979,7 +979,7 @@ RFC5908
.SH "AUTHORS"
The University of Delaware and Network Time Foundation
.SH "COPYRIGHT"
-Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation all rights reserved.
+Copyright (C) 1992-2016 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 --git a/contrib/ntp/ntpd/ntpd.1ntpdmdoc b/contrib/ntp/ntpd/ntpd.1ntpdmdoc
index dc06f58..301d983 100644
--- a/contrib/ntp/ntpd/ntpd.1ntpdmdoc
+++ b/contrib/ntp/ntpd/ntpd.1ntpdmdoc
@@ -1,9 +1,9 @@
-.Dd January 7 2016
+.Dd January 20 2016
.Dt NTPD 1ntpdmdoc User Commands
.Os
.\" EDIT THIS FILE WITH CAUTION (ntpd-opts.mdoc)
.\"
-.\" It has been AutoGen-ed January 7, 2016 at 11:31:02 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed January 20, 2016 at 04:18:12 AM by AutoGen 5.18.5
.\" From the definitions ntpd-opts.def
.\" and the template file agmdoc-cmd.tpl
.Sh NAME
@@ -886,7 +886,7 @@ A snapshot of this documentation is available in HTML format in
.Sh "AUTHORS"
The University of Delaware and Network Time Foundation
.Sh "COPYRIGHT"
-Copyright (C) 1992\-2015 The University of Delaware and Network Time Foundation all rights reserved.
+Copyright (C) 1992\-2016 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 --git a/contrib/ntp/ntpd/ntpd.c b/contrib/ntp/ntpd/ntpd.c
index 7630aee..2c7f02e 100644
--- a/contrib/ntp/ntpd/ntpd.c
+++ b/contrib/ntp/ntpd/ntpd.c
@@ -209,6 +209,11 @@ extern int syscall (int, ...);
#if !defined(SIM) && defined(SIGDIE1)
+static volatile int signalled = 0;
+static volatile int signo = 0;
+
+/* In an ideal world, 'finish_safe()' would declared as noreturn... */
+static void finish_safe (int);
static RETSIGTYPE finish (int);
#endif
@@ -298,11 +303,28 @@ my_pthread_warmup_worker(
static void
my_pthread_warmup(void)
{
- pthread_t thread;
- int rc;
+ pthread_t thread;
+ pthread_attr_t thr_attr;
+ int rc;
+
+ pthread_attr_init(&thr_attr);
+#if defined(HAVE_PTHREAD_ATTR_GETSTACKSIZE) && \
+ defined(HAVE_PTHREAD_ATTR_SETSTACKSIZE) && \
+ defined(PTHREAD_STACK_MIN)
+ rc = pthread_attr_setstacksize(&thr_attr, PTHREAD_STACK_MIN);
+ if (0 != rc)
+ msyslog(LOG_ERR,
+ "my_pthread_warmup: pthread_attr_setstacksize() -> %s",
+ strerror(rc));
+#endif
rc = pthread_create(
- &thread, NULL, my_pthread_warmup_worker, NULL);
- if (0 == rc) {
+ &thread, &thr_attr, my_pthread_warmup_worker, NULL);
+ pthread_attr_destroy(&thr_attr);
+ if (0 != rc) {
+ msyslog(LOG_ERR,
+ "my_pthread_warmup: pthread_create() -> %s",
+ strerror(rc));
+ } else {
pthread_cancel(thread);
pthread_join(thread, NULL);
}
@@ -1204,6 +1226,10 @@ int scmp_sc[] = {
# ifdef HAVE_IO_COMPLETION_PORT
for (;;) {
+#if !defined(SIM) && defined(SIGDIE1)
+ if (signalled)
+ finish_safe(signo);
+#endif
GetReceivedBuffers();
# else /* normal I/O */
@@ -1211,11 +1237,19 @@ int scmp_sc[] = {
was_alarmed = FALSE;
for (;;) {
+#if !defined(SIM) && defined(SIGDIE1)
+ if (signalled)
+ finish_safe(signo);
+#endif
if (alarm_flag) { /* alarmed? */
was_alarmed = TRUE;
alarm_flag = FALSE;
}
+ /* collect async name/addr results */
+ if (!was_alarmed)
+ harvest_blocking_responses();
+
if (!was_alarmed && !has_full_recv_buffer()) {
/*
* Nothing to do. Wait for something.
@@ -1330,9 +1364,9 @@ int scmp_sc[] = {
/*
* finish - exit gracefully
*/
-static RETSIGTYPE
-finish(
- int sig
+static void
+finish_safe(
+ int sig
)
{
const char *sig_desc;
@@ -1353,6 +1387,16 @@ finish(
peer_cleanup();
exit(0);
}
+
+static RETSIGTYPE
+finish(
+ int sig
+ )
+{
+ signalled = 1;
+ signo = sig;
+}
+
#endif /* !SIM && SIGDIE1 */
diff --git a/contrib/ntp/ntpd/ntpd.html b/contrib/ntp/ntpd/ntpd.html
index ae3e17c..bdf58a1 100644
--- a/contrib/ntp/ntpd/ntpd.html
+++ b/contrib/ntp/ntpd/ntpd.html
@@ -39,7 +39,7 @@ The program can operate in any of several modes, including client/server,
symmetric and broadcast modes, and with both symmetric-key and public-key
cryptography.
- <p>This document applies to version 4.2.8p5 of <code>ntpd</code>.
+ <p>This document applies to version 4.2.8p6 of <code>ntpd</code>.
<ul class="menu">
<li><a accesskey="1" href="#ntpd-Description">ntpd Description</a>: Description
@@ -220,7 +220,7 @@ the usage text by passing it through a pager program.
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.8p4
+<pre class="example">ntpd - NTP daemon program - Ver. 4.2.8p5
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
diff --git a/contrib/ntp/ntpd/ntpd.man.in b/contrib/ntp/ntpd/ntpd.man.in
index 222f0b3..4abcc57 100644
--- a/contrib/ntp/ntpd/ntpd.man.in
+++ b/contrib/ntp/ntpd/ntpd.man.in
@@ -10,11 +10,11 @@
.ds B-Font B
.ds I-Font I
.ds R-Font R
-.TH ntpd @NTPD_MS@ "07 Jan 2016" "4.2.8p5" "User Commands"
+.TH ntpd @NTPD_MS@ "20 Jan 2016" "4.2.8p6" "User Commands"
.\"
-.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-KDaWJq/ag-WDaOIq)
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-9JaiRS/ag-jKaaQS)
.\"
-.\" It has been AutoGen-ed January 7, 2016 at 11:30:44 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed January 20, 2016 at 04:17:54 AM by AutoGen 5.18.5
.\" From the definitions ntpd-opts.def
.\" and the template file agman-cmd.tpl
.SH NAME
@@ -979,7 +979,7 @@ RFC5908
.SH "AUTHORS"
The University of Delaware and Network Time Foundation
.SH "COPYRIGHT"
-Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation all rights reserved.
+Copyright (C) 1992-2016 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 --git a/contrib/ntp/ntpd/ntpd.mdoc.in b/contrib/ntp/ntpd/ntpd.mdoc.in
index e5be1ee..fcd5fc1 100644
--- a/contrib/ntp/ntpd/ntpd.mdoc.in
+++ b/contrib/ntp/ntpd/ntpd.mdoc.in
@@ -1,9 +1,9 @@
-.Dd January 7 2016
+.Dd January 20 2016
.Dt NTPD @NTPD_MS@ User Commands
.Os
.\" EDIT THIS FILE WITH CAUTION (ntpd-opts.mdoc)
.\"
-.\" It has been AutoGen-ed January 7, 2016 at 11:31:02 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed January 20, 2016 at 04:18:12 AM by AutoGen 5.18.5
.\" From the definitions ntpd-opts.def
.\" and the template file agmdoc-cmd.tpl
.Sh NAME
@@ -886,7 +886,7 @@ A snapshot of this documentation is available in HTML format in
.Sh "AUTHORS"
The University of Delaware and Network Time Foundation
.Sh "COPYRIGHT"
-Copyright (C) 1992\-2015 The University of Delaware and Network Time Foundation all rights reserved.
+Copyright (C) 1992\-2016 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 --git a/contrib/ntp/ntpd/refclock_chu.c b/contrib/ntp/ntpd/refclock_chu.c
index 1f02a1c..d745c81 100644
--- a/contrib/ntp/ntpd/refclock_chu.c
+++ b/contrib/ntp/ntpd/refclock_chu.c
@@ -1264,7 +1264,7 @@ chu_a(
offset = up->charstamp;
else if (k > 0)
i = 1;
- for (; i < nchar && i < k + 10; i++) {
+ for (; i < nchar && (i - 10) < k; i++) {
up->tstamp[up->ntstamp] = up->cstamp[i];
L_SUB(&up->tstamp[up->ntstamp], &offset);
L_ADD(&offset, &up->charstamp);
diff --git a/contrib/ntp/ntpd/refclock_gpsdjson.c b/contrib/ntp/ntpd/refclock_gpsdjson.c
index c2bf09a..24a15e7 100644
--- a/contrib/ntp/ntpd/refclock_gpsdjson.c
+++ b/contrib/ntp/ntpd/refclock_gpsdjson.c
@@ -377,17 +377,6 @@ static int16_t clamped_precision(int rawprec);
* local / static stuff
*/
-/* The logon string is actually the ?WATCH command of GPSD, using JSON
- * data and selecting the GPS device name we created from our unit
- * number. We have an old a newer version that request PPS (and TOFF)
- * transmission.
- * Note: These are actually format strings!
- */
-static const char * const s_req_watch[2] = {
- "?WATCH={\"device\":\"%s\",\"enable\":true,\"json\":true};\r\n",
- "?WATCH={\"device\":\"%s\",\"enable\":true,\"json\":true,\"pps\":true};\r\n"
-};
-
static const char * const s_req_version =
"?VERSION;\r\n";
@@ -1147,7 +1136,7 @@ json_token_skip(
const json_ctx * ctx,
tok_ref tid)
{
- if (tid >= 0 && tid < ctx->ntok) {
+ if (tid >= 0 && (u_int)tid < ctx->ntok) {
int len = ctx->tok[tid].size;
/* For arrays and objects, the size is the number of
* ITEMS in the compound. Thats the number of objects in
@@ -1172,7 +1161,10 @@ json_token_skip(
++tid;
break;
}
- if (tid > ctx->ntok) /* Impossible? Paranoia rulez. */
+ /* The next condition should never be true, but paranoia
+ * prevails...
+ */
+ if (tid < 0 || (u_int)tid > ctx->ntok)
tid = ctx->ntok;
}
return tid;
@@ -1200,7 +1192,7 @@ json_object_lookup(
tid = json_token_skip(ctx, tid); /* skip val */
} else if (strcmp(key, ctx->buf + ctx->tok[tid].start)) {
tid = json_token_skip(ctx, tid+1); /* skip key+val */
- } else if (what < 0 || what == ctx->tok[tid+1].type) {
+ } else if (what < 0 || (u_int)what == ctx->tok[tid+1].type) {
return tid + 1;
} else {
break;
@@ -1513,8 +1505,14 @@ process_version(
if (up->fl_watch)
return;
+ /* The logon string is actually the ?WATCH command of GPSD,
+ * using JSON data and selecting the GPS device name we created
+ * from our unit number. We have an old a newer version that
+ * request PPS (and TOFF) transmission.
+ */
snprintf(up->buffer, sizeof(up->buffer),
- s_req_watch[up->pf_toff != 0], up->device);
+ "?WATCH={\"device\":\"%s\",\"enable\":true,\"json\":true%s};\r\n",
+ up->device, (up->pf_toff ? ",\"pps\":true" : ""));
buf = up->buffer;
len = strlen(buf);
log_data(peer, "send", buf, len);
diff --git a/contrib/ntp/ntpd/refclock_jjy.c b/contrib/ntp/ntpd/refclock_jjy.c
index fef829c..fc51fd9 100644
--- a/contrib/ntp/ntpd/refclock_jjy.c
+++ b/contrib/ntp/ntpd/refclock_jjy.c
@@ -149,8 +149,8 @@
*/
struct jjyRawDataBreak {
- char *pString ;
- int iLength ;
+ const char * pString ;
+ int iLength ;
} ;
#define MAX_TIMESTAMP 6
@@ -627,7 +627,7 @@ jjy_receive ( struct recvbuf *rbufp )
#ifdef DEBUG
printf( "\nrefclock_jjy.c : %s : Len=%d ", sFunctionName, pp->lencode ) ;
for ( i = 0 ; i < pp->lencode ; i ++ ) {
- if ( iscntrl( pp->a_lastcode[i] & 0x7F ) ) {
+ if ( iscntrl( (u_char)(pp->a_lastcode[i] & 0x7F) ) ) {
printf( "<x%02X>", pp->a_lastcode[i] & 0xFF ) ;
} else {
printf( "%c", pp->a_lastcode[i] ) ;
@@ -702,7 +702,7 @@ jjy_receive ( struct recvbuf *rbufp )
up->iLineBufLen ++ ;
/* Copy printable characters */
- if ( ! iscntrl( up->sRawBuf[i] ) ) {
+ if ( ! iscntrl( (u_char)up->sRawBuf[i] ) ) {
up->sTextBuf[up->iTextBufLen] = up->sRawBuf[i] ;
up->iTextBufLen ++ ;
}
@@ -1154,12 +1154,13 @@ jjy_receive_tristate_jjy01 ( struct recvbuf *rbufp )
struct refclockproc *pp ;
struct peer *peer;
- char *pBuf, sLog [ 100 ] ;
- int iLen ;
- int rc ;
+ char * pBuf ;
+ char sLog [ 100 ] ;
+ int iLen ;
+ int rc ;
- const char *pCmd ;
- int iCmdLen ;
+ const char * pCmd ;
+ int iCmdLen ;
/* Initialize pointers */
@@ -1359,8 +1360,8 @@ jjy_poll_tristate_jjy01 ( int unit, struct peer *peer )
struct refclockproc *pp ;
struct jjyunit *up ;
- const char *pCmd ;
- int iCmdLen ;
+ const char * pCmd ;
+ int iCmdLen ;
pp = peer->procptr;
up = pp->unitptr ;
@@ -2010,12 +2011,13 @@ jjy_receive_tristate_gpsclock01 ( struct recvbuf *rbufp )
struct refclockproc *pp ;
struct peer *peer;
- char *pBuf, sLog [ 100 ] ;
- int iLen ;
- int rc ;
+ char * pBuf ;
+ char sLog [ 100 ] ;
+ int iLen ;
+ int rc ;
- const char *pCmd ;
- int iCmdLen ;
+ const char * pCmd ;
+ int iCmdLen ;
/* Initialize pointers */
@@ -2239,8 +2241,8 @@ jjy_poll_tristate_gpsclock01 ( int unit, struct peer *peer )
struct refclockproc *pp ;
struct jjyunit *up ;
- const char *pCmd ;
- int iCmdLen ;
+ const char * pCmd ;
+ int iCmdLen ;
pp = peer->procptr ;
up = pp->unitptr ;
@@ -2576,7 +2578,7 @@ static int teljjy_bye_ignore ( struct peer *peer, struct refclockproc *, struct
static int teljjy_bye_disc ( struct peer *peer, struct refclockproc *, struct jjyunit * ) ;
static int teljjy_bye_modem ( struct peer *peer, struct refclockproc *, struct jjyunit * ) ;
-static int ( *pTeljjyHandler [ ] [ 5 ] ) ( ) =
+static int ( *pTeljjyHandler [ ] [ 5 ] ) ( struct peer *, struct refclockproc *, struct jjyunit *) =
{ /*STATE_IDLE STATE_DAILOUT STATE_LOGIN STATE_CONNECT STATE_BYE */
/* NULL */ { teljjy_idle_ignore , teljjy_dial_ignore, teljjy_login_ignore, teljjy_conn_ignore, teljjy_bye_ignore },
/* START */ { teljjy_idle_dialout, teljjy_dial_ignore, teljjy_login_ignore, teljjy_conn_ignore, teljjy_bye_ignore },
@@ -2715,12 +2717,12 @@ jjy_start_telephone ( int unit, struct peer *peer, struct jjyunit *up )
iNumberOfDigitsOfPhoneNumber = iCommaCount = iCommaPosition = iFirstThreeDigitsCount = 0 ;
for ( i = 0 ; i < strlen( sys_phone[0] ) ; i ++ ) {
- if ( isdigit( *(sys_phone[0]+i) ) ) {
+ if ( isdigit( (u_char)sys_phone[0][i] ) ) {
if ( iFirstThreeDigitsCount < sizeof(sFirstThreeDigits)-1 ) {
- sFirstThreeDigits[iFirstThreeDigitsCount++] = *(sys_phone[0]+i) ;
+ sFirstThreeDigits[iFirstThreeDigitsCount++] = sys_phone[0][i] ;
}
iNumberOfDigitsOfPhoneNumber ++ ;
- } else if ( *(sys_phone[0]+i) == ',' ) {
+ } else if ( sys_phone[0][i] == ',' ) {
iCommaCount ++ ;
if ( iCommaCount > 1 ) {
msyslog( LOG_ERR, "refclock_jjy.c : jjy_start_telephone : phone in the ntpd.conf should be zero or one comma." ) ;
@@ -2729,7 +2731,7 @@ jjy_start_telephone ( int unit, struct peer *peer, struct jjyunit *up )
}
iFirstThreeDigitsCount = 0 ;
iCommaPosition = i ;
- } else if ( *(sys_phone[0]+i) != '-' ) {
+ } else if ( sys_phone[0][i] != '-' ) {
msyslog( LOG_ERR, "refclock_jjy.c : jjy_start_telephone : phone in the ntpd.conf should be a number or a hyphen." ) ;
up->bInitError = TRUE ;
return 1 ;
@@ -3213,8 +3215,8 @@ static int
teljjy_login_login ( struct peer *peer, struct refclockproc *pp, struct jjyunit *up )
{
- char *pCmd ;
- int iCmdLen ;
+ const char * pCmd ;
+ int iCmdLen ;
DEBUG_TELJJY_PRINTF( "teljjy_login_login" ) ;
@@ -3290,8 +3292,8 @@ static int
teljjy_conn_send ( struct peer *peer, struct refclockproc *pp, struct jjyunit *up )
{
- const char *pCmd ;
- int i, iLen, iNextClockState ;
+ const char * pCmd ;
+ int i, iLen, iNextClockState ;
DEBUG_TELJJY_PRINTF( "teljjy_conn_send" ) ;
@@ -3527,7 +3529,7 @@ static int
teljjy_conn_silent ( struct peer *peer, struct refclockproc *pp, struct jjyunit *up )
{
- const char *pCmd ;
+ const char * pCmd ;
DEBUG_TELJJY_PRINTF( "teljjy_conn_silent" ) ;
@@ -3665,7 +3667,7 @@ static int modem_esc_data ( struct peer *, struct refclockproc *, struct jjyu
static int modem_esc_silent ( struct peer *, struct refclockproc *, struct jjyunit * ) ;
static int modem_esc_disc ( struct peer *, struct refclockproc *, struct jjyunit * ) ;
-static int ( *pModemHandler [ ] [ 5 ] ) ( ) =
+static int ( *pModemHandler [ ] [ 5 ] ) ( struct peer *, struct refclockproc *, struct jjyunit * ) =
{ /*STATE_DISCONNECT STATE_INITIALIZE STATE_DAILING STATE_CONNECT STATE_ESCAPE */
/* NULL */ { modem_disc_ignore, modem_init_ignore, modem_dial_ignore , modem_conn_ignore, modem_esc_ignore },
/* INITIALIZE */ { modem_disc_init , modem_init_start , modem_dial_ignore , modem_conn_ignore, modem_esc_ignore },
@@ -3993,10 +3995,11 @@ static int
modem_init_resp00 ( struct peer *peer, struct refclockproc *pp, struct jjyunit *up )
{
- char *pCmd, cBuf [ 46 ] ;
- int iCmdLen ;
- int iErrorCorrection, iSpeakerSwitch, iSpeakerVolume ;
- int iNextModemState = STAY_MODEM_STATE ;
+ const char * pCmd ;
+ char cBuf [ 46 ] ;
+ int iCmdLen ;
+ int iErrorCorrection, iSpeakerSwitch, iSpeakerVolume ;
+ int iNextModemState = STAY_MODEM_STATE ;
DEBUG_MODEM_PRINTF( "modem_init_resp00" ) ;
@@ -4031,7 +4034,7 @@ modem_init_resp00 ( struct peer *peer, struct refclockproc *pp, struct jjyunit *
}
pCmd = cBuf ;
- snprintf( pCmd, sizeof(cBuf), "ATM%dL%d\r\n", iSpeakerSwitch, iSpeakerVolume ) ;
+ snprintf( cBuf, sizeof(cBuf), "ATM%dL%d\r\n", iSpeakerSwitch, iSpeakerVolume ) ;
break ;
case 3 :
@@ -4060,7 +4063,7 @@ modem_init_resp00 ( struct peer *peer, struct refclockproc *pp, struct jjyunit *
}
pCmd = cBuf ;
- snprintf( pCmd, sizeof(cBuf), "AT\\N%d\r\n", iErrorCorrection ) ;
+ snprintf( cBuf, sizeof(cBuf), "AT\\N%d\r\n", iErrorCorrection ) ;
break ;
case 7 :
@@ -4251,8 +4254,8 @@ static int
modem_esc_escape ( struct peer *peer, struct refclockproc *pp, struct jjyunit *up )
{
- char *pCmd ;
- int iCmdLen ;
+ const char * pCmd ;
+ int iCmdLen ;
DEBUG_MODEM_PRINTF( "modem_esc_escape" ) ;
@@ -4317,8 +4320,8 @@ static int
modem_esc_disc ( struct peer *peer, struct refclockproc *pp, struct jjyunit *up )
{
- char *pCmd ;
- int iCmdLen ;
+ const char * pCmd ;
+ int iCmdLen ;
DEBUG_MODEM_PRINTF( "modem_esc_disc" ) ;
@@ -4349,9 +4352,9 @@ static void
jjy_write_clockstats ( struct peer *peer, int iMark, const char *pData )
{
- char sLog [ 100 ] ;
- char *pMark ;
- int iMarkLen, iDataLen ;
+ char sLog [ 100 ] ;
+ const char * pMark ;
+ int iMarkLen, iDataLen ;
switch ( iMark ) {
case JJY_CLOCKSTATS_MARK_JJY :
diff --git a/contrib/ntp/ntpd/refclock_shm.c b/contrib/ntp/ntpd/refclock_shm.c
index f3e7f51..f031a39 100644
--- a/contrib/ntp/ntpd/refclock_shm.c
+++ b/contrib/ntp/ntpd/refclock_shm.c
@@ -600,7 +600,7 @@ shm_timer(
cd.year, cd.month, cd.monthday,
cd.hour, cd.minute, cd.second,
(long)shm_stat.tvt.tv_nsec);
- pp->lencode = (c < sizeof(pp->a_lastcode)) ? c : 0;
+ pp->lencode = (c > 0 && (size_t)c < sizeof(pp->a_lastcode)) ? c : 0;
/* check 1: age control of local time stamp */
tt = shm_stat.tvc.tv_sec - shm_stat.tvr.tv_sec;
diff --git a/contrib/ntp/ntpdc/invoke-ntpdc.texi b/contrib/ntp/ntpdc/invoke-ntpdc.texi
index f8283de..a2f440a 100644
--- a/contrib/ntp/ntpdc/invoke-ntpdc.texi
+++ b/contrib/ntp/ntpdc/invoke-ntpdc.texi
@@ -6,7 +6,7 @@
#
# EDIT THIS FILE WITH CAUTION (invoke-ntpdc.texi)
#
-# It has been AutoGen-ed January 7, 2016 at 11:31:26 PM by AutoGen 5.18.5
+# It has been AutoGen-ed January 20, 2016 at 04:18:37 AM by AutoGen 5.18.5
# From the definitions ntpdc-opts.def
# and the template file agtexi-cmd.tpl
@end ignore
@@ -76,7 +76,7 @@ with a status code of 0.
@exampleindent 0
@example
-ntpdc - vendor-specific NTPD control program - Ver. 4.2.8p5
+ntpdc - vendor-specific NTPD control program - Ver. 4.2.8p6
Usage: ntpdc [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]... [ host ...]
Flg Arg Option-Name Description
-4 no ipv4 Force IPv4 DNS name resolution
diff --git a/contrib/ntp/ntpdc/ntpdc-opts.c b/contrib/ntp/ntpdc/ntpdc-opts.c
index da89ee2..568a97a 100644
--- a/contrib/ntp/ntpdc/ntpdc-opts.c
+++ b/contrib/ntp/ntpdc/ntpdc-opts.c
@@ -1,7 +1,7 @@
/*
* EDIT THIS FILE WITH CAUTION (ntpdc-opts.c)
*
- * It has been AutoGen-ed January 7, 2016 at 11:31:12 PM by AutoGen 5.18.5
+ * It has been AutoGen-ed January 20, 2016 at 04:18:22 AM by AutoGen 5.18.5
* From the definitions ntpdc-opts.def
* and the template file options
*
@@ -18,7 +18,7 @@
* The ntpdc program is copyrighted and licensed
* under the following terms:
*
- * Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation, all rights reserved.
+ * Copyright (C) 1992-2016 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:
@@ -69,8 +69,8 @@ extern FILE * option_usage_fp;
* static const strings for ntpdc options
*/
static char const ntpdc_opt_strs[1911] =
-/* 0 */ "ntpdc 4.2.8p5\n"
- "Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation, all rights reserved.\n"
+/* 0 */ "ntpdc 4.2.8p6\n"
+ "Copyright (C) 1992-2016 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"
@@ -128,14 +128,14 @@ static char const ntpdc_opt_strs[1911] =
/* 1694 */ "no-load-opts\0"
/* 1707 */ "no\0"
/* 1710 */ "NTPDC\0"
-/* 1716 */ "ntpdc - vendor-specific NTPD control program - Ver. 4.2.8p5\n"
+/* 1716 */ "ntpdc - vendor-specific NTPD control program - Ver. 4.2.8p6\n"
"Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... [ host ...]\n\0"
/* 1846 */ "$HOME\0"
/* 1852 */ ".\0"
/* 1854 */ ".ntprc\0"
/* 1861 */ "http://bugs.ntp.org, bugs@ntp.org\0"
/* 1895 */ "\n\0"
-/* 1897 */ "ntpdc 4.2.8p5";
+/* 1897 */ "ntpdc 4.2.8p6";
/**
* ipv4 option description with
@@ -796,8 +796,8 @@ static void bogus_function(void) {
translate option names.
*/
/* referenced via ntpdcOptions.pzCopyright */
- puts(_("ntpdc 4.2.8p5\n\
-Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation, all rights reserved.\n\
+ puts(_("ntpdc 4.2.8p6\n\
+Copyright (C) 1992-2016 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"));
@@ -862,14 +862,14 @@ implied warranty.\n"));
puts(_("load options from a config file"));
/* referenced via ntpdcOptions.pzUsageTitle */
- puts(_("ntpdc - vendor-specific NTPD control program - Ver. 4.2.8p5\n\
+ puts(_("ntpdc - vendor-specific NTPD control program - Ver. 4.2.8p6\n\
Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... [ host ...]\n"));
/* referenced via ntpdcOptions.pzExplain */
puts(_("\n"));
/* referenced via ntpdcOptions.pzFullVersion */
- puts(_("ntpdc 4.2.8p5"));
+ puts(_("ntpdc 4.2.8p6"));
/* referenced via ntpdcOptions.pzFullUsage */
puts(_("<<<NOT-FOUND>>>"));
diff --git a/contrib/ntp/ntpdc/ntpdc-opts.h b/contrib/ntp/ntpdc/ntpdc-opts.h
index d3326a7..a022a72 100644
--- a/contrib/ntp/ntpdc/ntpdc-opts.h
+++ b/contrib/ntp/ntpdc/ntpdc-opts.h
@@ -1,7 +1,7 @@
/*
* EDIT THIS FILE WITH CAUTION (ntpdc-opts.h)
*
- * It has been AutoGen-ed January 7, 2016 at 11:31:11 PM by AutoGen 5.18.5
+ * It has been AutoGen-ed January 20, 2016 at 04:18:21 AM by AutoGen 5.18.5
* From the definitions ntpdc-opts.def
* and the template file options
*
@@ -18,7 +18,7 @@
* The ntpdc program is copyrighted and licensed
* under the following terms:
*
- * Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation, all rights reserved.
+ * Copyright (C) 1992-2016 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:
@@ -83,9 +83,9 @@ typedef enum {
/** count of all options for ntpdc */
#define OPTION_CT 15
/** ntpdc version */
-#define NTPDC_VERSION "4.2.8p5"
+#define NTPDC_VERSION "4.2.8p6"
/** Full ntpdc version text */
-#define NTPDC_FULL_VERSION "ntpdc 4.2.8p5"
+#define NTPDC_FULL_VERSION "ntpdc 4.2.8p6"
/**
* Interface defines for all options. Replace "n" with the UPPER_CASED
diff --git a/contrib/ntp/ntpdc/ntpdc.1ntpdcman b/contrib/ntp/ntpdc/ntpdc.1ntpdcman
index 3e78896..e764a11 100644
--- a/contrib/ntp/ntpdc/ntpdc.1ntpdcman
+++ b/contrib/ntp/ntpdc/ntpdc.1ntpdcman
@@ -10,11 +10,11 @@
.ds B-Font B
.ds I-Font I
.ds R-Font R
-.TH ntpdc 1ntpdcman "07 Jan 2016" "4.2.8p5" "User Commands"
+.TH ntpdc 1ntpdcman "20 Jan 2016" "4.2.8p6" "User Commands"
.\"
-.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-EXaGzs/ag-QXayys)
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-n4aaHU/ag-A4a4FU)
.\"
-.\" It has been AutoGen-ed January 7, 2016 at 11:31:22 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed January 20, 2016 at 04:18:33 AM by AutoGen 5.18.5
.\" From the definitions ntpdc-opts.def
.\" and the template file agman-cmd.tpl
.SH NAME
@@ -848,7 +848,7 @@ RFC1305
.SH AUTHORS
The formatting directives in this document came from FreeBSD.
.SH "COPYRIGHT"
-Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation all rights reserved.
+Copyright (C) 1992-2016 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 --git a/contrib/ntp/ntpdc/ntpdc.1ntpdcmdoc b/contrib/ntp/ntpdc/ntpdc.1ntpdcmdoc
index df53d89..b3e5895 100644
--- a/contrib/ntp/ntpdc/ntpdc.1ntpdcmdoc
+++ b/contrib/ntp/ntpdc/ntpdc.1ntpdcmdoc
@@ -1,9 +1,9 @@
-.Dd January 7 2016
+.Dd January 20 2016
.Dt NTPDC 1ntpdcmdoc User Commands
.Os
.\" EDIT THIS FILE WITH CAUTION (ntpdc-opts.mdoc)
.\"
-.\" It has been AutoGen-ed January 7, 2016 at 11:31:29 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed January 20, 2016 at 04:18:39 AM by AutoGen 5.18.5
.\" From the definitions ntpdc-opts.def
.\" and the template file agmdoc-cmd.tpl
.Sh NAME
@@ -787,7 +787,7 @@ it to autogen\-users@lists.sourceforge.net. Thank you.
.Sh AUTHORS
The formatting directives in this document came from FreeBSD.
.Sh "COPYRIGHT"
-Copyright (C) 1992\-2015 The University of Delaware and Network Time Foundation all rights reserved.
+Copyright (C) 1992\-2016 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 --git a/contrib/ntp/ntpdc/ntpdc.c b/contrib/ntp/ntpdc/ntpdc.c
index bef9ca3..8a79d0b 100644
--- a/contrib/ntp/ntpdc/ntpdc.c
+++ b/contrib/ntp/ntpdc/ntpdc.c
@@ -605,7 +605,11 @@ getresponse(
int seq;
fd_set fds;
ssize_t n;
- size_t pad;
+ int pad;
+ /* absolute timeout checks. Not 'time_t' by intention! */
+ uint32_t tobase; /* base value for timeout */
+ uint32_t tospan; /* timeout span (max delay) */
+ uint32_t todiff; /* current delay */
/*
* This is pretty tricky. We may get between 1 and many packets
@@ -622,12 +626,14 @@ getresponse(
lastseq = 999; /* too big to be a sequence number */
ZERO(haveseq);
FD_ZERO(&fds);
+ tobase = (uint32_t)time(NULL);
again:
if (firstpkt)
tvo = tvout;
else
tvo = tvsout;
+ tospan = (uint32_t)tvo.tv_sec + (tvo.tv_usec != 0);
FD_SET(sockfd, &fds);
n = select(sockfd+1, &fds, NULL, NULL, &tvo);
@@ -635,6 +641,17 @@ getresponse(
warning("select fails");
return -1;
}
+
+ /*
+ * Check if this is already too late. Trash the data and fake a
+ * timeout if this is so.
+ */
+ todiff = (((uint32_t)time(NULL)) - tobase) & 0x7FFFFFFFu;
+ if ((n > 0) && (todiff > tospan)) {
+ n = recv(sockfd, (char *)&rpkt, sizeof(rpkt), 0);
+ n = 0; /* faked timeout return from 'select()'*/
+ }
+
if (n == 0) {
/*
* Timed out. Return what we have
@@ -780,8 +797,10 @@ getresponse(
}
/*
- * So far, so good. Copy this data into the output array.
+ * So far, so good. Copy this data into the output array. Bump
+ * the timeout base, in case we expect more data.
*/
+ tobase = (uint32_t)time(NULL);
if ((datap + datasize + (pad * items)) > (pktdata + pktdatasize)) {
size_t offset = datap - pktdata;
growpktdata();
diff --git a/contrib/ntp/ntpdc/ntpdc.html b/contrib/ntp/ntpdc/ntpdc.html
index 107af9b..ce73039 100644
--- a/contrib/ntp/ntpdc/ntpdc.html
+++ b/contrib/ntp/ntpdc/ntpdc.html
@@ -36,7 +36,7 @@ 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 cron job.
- <p>This document applies to version 4.2.8p5 of <code>ntpdc</code>.
+ <p>This document applies to version 4.2.8p6 of <code>ntpdc</code>.
<p>The program implements the SNTP protocol as defined by RFC 5905, the NTPv4
IETF specification.
@@ -152,7 +152,7 @@ the usage text by passing it through a pager program.
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.8p5
+<pre class="example">ntpdc - vendor-specific NTPD control program - Ver. 4.2.8p6
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 --git a/contrib/ntp/ntpdc/ntpdc.man.in b/contrib/ntp/ntpdc/ntpdc.man.in
index 6662438..d7e25fa 100644
--- a/contrib/ntp/ntpdc/ntpdc.man.in
+++ b/contrib/ntp/ntpdc/ntpdc.man.in
@@ -10,11 +10,11 @@
.ds B-Font B
.ds I-Font I
.ds R-Font R
-.TH ntpdc @NTPDC_MS@ "07 Jan 2016" "4.2.8p5" "User Commands"
+.TH ntpdc @NTPDC_MS@ "20 Jan 2016" "4.2.8p6" "User Commands"
.\"
-.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-EXaGzs/ag-QXayys)
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-n4aaHU/ag-A4a4FU)
.\"
-.\" It has been AutoGen-ed January 7, 2016 at 11:31:22 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed January 20, 2016 at 04:18:33 AM by AutoGen 5.18.5
.\" From the definitions ntpdc-opts.def
.\" and the template file agman-cmd.tpl
.SH NAME
@@ -848,7 +848,7 @@ RFC1305
.SH AUTHORS
The formatting directives in this document came from FreeBSD.
.SH "COPYRIGHT"
-Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation all rights reserved.
+Copyright (C) 1992-2016 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 --git a/contrib/ntp/ntpdc/ntpdc.mdoc.in b/contrib/ntp/ntpdc/ntpdc.mdoc.in
index 2e2fd31..4dd9e15 100644
--- a/contrib/ntp/ntpdc/ntpdc.mdoc.in
+++ b/contrib/ntp/ntpdc/ntpdc.mdoc.in
@@ -1,9 +1,9 @@
-.Dd January 7 2016
+.Dd January 20 2016
.Dt NTPDC @NTPDC_MS@ User Commands
.Os
.\" EDIT THIS FILE WITH CAUTION (ntpdc-opts.mdoc)
.\"
-.\" It has been AutoGen-ed January 7, 2016 at 11:31:29 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed January 20, 2016 at 04:18:39 AM by AutoGen 5.18.5
.\" From the definitions ntpdc-opts.def
.\" and the template file agmdoc-cmd.tpl
.Sh NAME
@@ -787,7 +787,7 @@ it to autogen\-users@lists.sourceforge.net. Thank you.
.Sh AUTHORS
The formatting directives in this document came from FreeBSD.
.Sh "COPYRIGHT"
-Copyright (C) 1992\-2015 The University of Delaware and Network Time Foundation all rights reserved.
+Copyright (C) 1992\-2016 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 --git a/contrib/ntp/ntpq/invoke-ntpq.texi b/contrib/ntp/ntpq/invoke-ntpq.texi
index b01127c..bcd1df4 100644
--- a/contrib/ntp/ntpq/invoke-ntpq.texi
+++ b/contrib/ntp/ntpq/invoke-ntpq.texi
@@ -6,7 +6,7 @@
#
# EDIT THIS FILE WITH CAUTION (invoke-ntpq.texi)
#
-# It has been AutoGen-ed January 7, 2016 at 11:32:00 PM by AutoGen 5.18.5
+# It has been AutoGen-ed January 20, 2016 at 04:19:10 AM by AutoGen 5.18.5
# From the definitions ntpq-opts.def
# and the template file agtexi-cmd.tpl
@end ignore
@@ -847,7 +847,7 @@ with a status code of 0.
@exampleindent 0
@example
-ntpq - standard NTP query program - Ver. 4.2.8p5
+ntpq - standard NTP query program - Ver. 4.2.8p6
Usage: ntpq [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]... [ host ...]
Flg Arg Option-Name Description
-4 no ipv4 Force IPv4 DNS name resolution
diff --git a/contrib/ntp/ntpq/ntpq-opts.c b/contrib/ntp/ntpq/ntpq-opts.c
index 69f4881..42131a3 100644
--- a/contrib/ntp/ntpq/ntpq-opts.c
+++ b/contrib/ntp/ntpq/ntpq-opts.c
@@ -1,7 +1,7 @@
/*
* EDIT THIS FILE WITH CAUTION (ntpq-opts.c)
*
- * It has been AutoGen-ed January 7, 2016 at 11:31:32 PM by AutoGen 5.18.5
+ * It has been AutoGen-ed January 20, 2016 at 04:18:42 AM by AutoGen 5.18.5
* From the definitions ntpq-opts.def
* and the template file options
*
@@ -18,7 +18,7 @@
* The ntpq program is copyrighted and licensed
* under the following terms:
*
- * Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation, all rights reserved.
+ * Copyright (C) 1992-2016 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:
@@ -69,8 +69,8 @@ extern FILE * option_usage_fp;
* static const strings for ntpq options
*/
static char const ntpq_opt_strs[1925] =
-/* 0 */ "ntpq 4.2.8p5\n"
- "Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation, all rights reserved.\n"
+/* 0 */ "ntpq 4.2.8p6\n"
+ "Copyright (C) 1992-2016 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"
@@ -129,13 +129,13 @@ static char const ntpq_opt_strs[1925] =
/* 1723 */ "no-load-opts\0"
/* 1736 */ "no\0"
/* 1739 */ "NTPQ\0"
-/* 1744 */ "ntpq - standard NTP query program - Ver. 4.2.8p5\n"
+/* 1744 */ "ntpq - standard NTP query program - Ver. 4.2.8p6\n"
"Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... [ host ...]\n\0"
/* 1863 */ "$HOME\0"
/* 1869 */ ".\0"
/* 1871 */ ".ntprc\0"
/* 1878 */ "http://bugs.ntp.org, bugs@ntp.org\0"
-/* 1912 */ "ntpq 4.2.8p5";
+/* 1912 */ "ntpq 4.2.8p6";
/**
* ipv4 option description with
@@ -786,8 +786,8 @@ static void bogus_function(void) {
translate option names.
*/
/* referenced via ntpqOptions.pzCopyright */
- puts(_("ntpq 4.2.8p5\n\
-Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation, all rights reserved.\n\
+ puts(_("ntpq 4.2.8p6\n\
+Copyright (C) 1992-2016 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"));
@@ -852,11 +852,11 @@ implied warranty.\n"));
puts(_("load options from a config file"));
/* referenced via ntpqOptions.pzUsageTitle */
- puts(_("ntpq - standard NTP query program - Ver. 4.2.8p5\n\
+ puts(_("ntpq - standard NTP query program - Ver. 4.2.8p6\n\
Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... [ host ...]\n"));
/* referenced via ntpqOptions.pzFullVersion */
- puts(_("ntpq 4.2.8p5"));
+ puts(_("ntpq 4.2.8p6"));
/* referenced via ntpqOptions.pzFullUsage */
puts(_("<<<NOT-FOUND>>>"));
diff --git a/contrib/ntp/ntpq/ntpq-opts.h b/contrib/ntp/ntpq/ntpq-opts.h
index 758817f..af7a4c2 100644
--- a/contrib/ntp/ntpq/ntpq-opts.h
+++ b/contrib/ntp/ntpq/ntpq-opts.h
@@ -1,7 +1,7 @@
/*
* EDIT THIS FILE WITH CAUTION (ntpq-opts.h)
*
- * It has been AutoGen-ed January 7, 2016 at 11:31:32 PM by AutoGen 5.18.5
+ * It has been AutoGen-ed January 20, 2016 at 04:18:42 AM by AutoGen 5.18.5
* From the definitions ntpq-opts.def
* and the template file options
*
@@ -18,7 +18,7 @@
* The ntpq program is copyrighted and licensed
* under the following terms:
*
- * Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation, all rights reserved.
+ * Copyright (C) 1992-2016 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:
@@ -83,9 +83,9 @@ typedef enum {
/** count of all options for ntpq */
#define OPTION_CT 15
/** ntpq version */
-#define NTPQ_VERSION "4.2.8p5"
+#define NTPQ_VERSION "4.2.8p6"
/** Full ntpq version text */
-#define NTPQ_FULL_VERSION "ntpq 4.2.8p5"
+#define NTPQ_FULL_VERSION "ntpq 4.2.8p6"
/**
* Interface defines for all options. Replace "n" with the UPPER_CASED
diff --git a/contrib/ntp/ntpq/ntpq-subs.c b/contrib/ntp/ntpq/ntpq-subs.c
index 438c7ca..8e70477 100644
--- a/contrib/ntp/ntpq/ntpq-subs.c
+++ b/contrib/ntp/ntpq/ntpq-subs.c
@@ -2861,7 +2861,7 @@ collect_mru_list(
ri, sptoa(&recent->addr), ri,
recent->last.l_ui, recent->last.l_uf);
chars = strlen(buf);
- if (REQ_ROOM <= chars)
+ if ((size_t)REQ_ROOM <= chars)
break;
memcpy(req, buf, chars + 1);
req += chars;
@@ -3173,6 +3173,7 @@ mrulist(
qsort(sorted, mru_count, sizeof(sorted[0]),
mru_qcmp_table[order]);
+ mrulist_interrupted = FALSE;
printf( "lstint avgint rstr r m v count rport remote address\n"
"==============================================================================\n");
/* '=' x 78 */
@@ -3199,6 +3200,11 @@ mrulist(
nntohost(&recent->addr));
if (showhostnames)
fflush(fp);
+ if (mrulist_interrupted) {
+ fputs("\n --interrupted--\n", fp);
+ fflush(fp);
+ break;
+ }
}
fflush(fp);
if (debug) {
diff --git a/contrib/ntp/ntpq/ntpq.1ntpqman b/contrib/ntp/ntpq/ntpq.1ntpqman
index 1c26076..b96d106 100644
--- a/contrib/ntp/ntpq/ntpq.1ntpqman
+++ b/contrib/ntp/ntpq/ntpq.1ntpqman
@@ -10,11 +10,11 @@
.ds B-Font B
.ds I-Font I
.ds R-Font R
-.TH ntpq 1ntpqman "07 Jan 2016" "4.2.8p5" "User Commands"
+.TH ntpq 1ntpqman "20 Jan 2016" "4.2.8p6" "User Commands"
.\"
-.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-4VaaKt/ag-eWa4It)
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-Z7aWRV/ag-_7aOQV)
.\"
-.\" It has been AutoGen-ed January 7, 2016 at 11:31:55 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed January 20, 2016 at 04:19:06 AM by AutoGen 5.18.5
.\" From the definitions ntpq-opts.def
.\" and the template file agman-cmd.tpl
.SH NAME
@@ -1412,7 +1412,7 @@ it to autogen-users@lists.sourceforge.net. Thank you.
.SH "AUTHORS"
The University of Delaware and Network Time Foundation
.SH "COPYRIGHT"
-Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation all rights reserved.
+Copyright (C) 1992-2016 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 --git a/contrib/ntp/ntpq/ntpq.1ntpqmdoc b/contrib/ntp/ntpq/ntpq.1ntpqmdoc
index bf8d101..d4da8d7 100644
--- a/contrib/ntp/ntpq/ntpq.1ntpqmdoc
+++ b/contrib/ntp/ntpq/ntpq.1ntpqmdoc
@@ -1,9 +1,9 @@
-.Dd January 7 2016
+.Dd January 20 2016
.Dt NTPQ 1ntpqmdoc User Commands
.Os
.\" EDIT THIS FILE WITH CAUTION (ntpq-opts.mdoc)
.\"
-.\" It has been AutoGen-ed January 7, 2016 at 11:32:02 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed January 20, 2016 at 04:19:12 AM by AutoGen 5.18.5
.\" From the definitions ntpq-opts.def
.\" and the template file agmdoc-cmd.tpl
.Sh NAME
@@ -955,7 +955,7 @@ it to autogen\-users@lists.sourceforge.net. Thank you.
.Sh "AUTHORS"
The University of Delaware and Network Time Foundation
.Sh "COPYRIGHT"
-Copyright (C) 1992\-2015 The University of Delaware and Network Time Foundation all rights reserved.
+Copyright (C) 1992\-2016 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 --git a/contrib/ntp/ntpq/ntpq.c b/contrib/ntp/ntpq/ntpq.c
index 5b3c9cb..1dcaeb7 100644
--- a/contrib/ntp/ntpq/ntpq.c
+++ b/contrib/ntp/ntpq/ntpq.c
@@ -218,7 +218,7 @@ static void outputarr (FILE *, char *, int, l_fp *);
static int assoccmp (const void *, const void *);
static void on_ctrlc (void);
u_short varfmt (const char *);
-
+static int my_easprintf (char**, const char *, ...) NTP_PRINTF(2, 3);
void ntpq_custom_opt_handler (tOptions *, tOptDesc *);
#ifdef OPENSSL
@@ -472,7 +472,7 @@ ntpqmain(
{
char *list;
- char *msg, *fmt;
+ char *msg;
list = list_digest_names();
for (icmd = 0; icmd < sizeof(builtins)/sizeof(builtins[0]); icmd++) {
@@ -486,13 +486,15 @@ ntpqmain(
#ifdef OPENSSL
builtins[icmd].desc[0] = "digest-name";
- fmt = "set key type to use for authenticated requests, one of:%s";
+ my_easprintf(&msg,
+ "set key type to use for authenticated requests, one of:%s",
+ list);
#else
builtins[icmd].desc[0] = "md5";
- fmt = "set key type to use for authenticated requests (%s)";
+ my_easprintf(&msg,
+ "set key type to use for authenticated requests (%s)",
+ list);
#endif
- msg = emalloc(strlen(fmt) + strlen(list) - strlen("%s") +1);
- sprintf(msg, fmt, list);
builtins[icmd].comment = msg;
free(list);
}
@@ -844,6 +846,10 @@ getresponse(
fd_set fds;
int n;
int errcode;
+ /* absolute timeout checks. Not 'time_t' by intention! */
+ uint32_t tobase; /* base value for timeout */
+ uint32_t tospan; /* timeout span (max delay) */
+ uint32_t todiff; /* current delay */
/*
* This is pretty tricky. We may get between 1 and MAXFRAG packets
@@ -860,6 +866,8 @@ getresponse(
numfrags = 0;
seenlastfrag = 0;
+ tobase = (uint32_t)time(NULL);
+
FD_ZERO(&fds);
/*
@@ -872,13 +880,40 @@ getresponse(
tvo = tvout;
else
tvo = tvsout;
+ tospan = (uint32_t)tvo.tv_sec + (tvo.tv_usec != 0);
FD_SET(sockfd, &fds);
n = select(sockfd+1, &fds, NULL, NULL, &tvo);
if (n == -1) {
+#if !defined(SYS_WINNT) && defined(EINTR)
+ /* Windows does not know about EINTR (until very
+ * recently) and the handling of console events
+ * is *very* different from POSIX/UNIX signal
+ * handling anyway.
+ *
+ * Under non-windows targets we map EINTR as
+ * 'last packet was received' and try to exit
+ * the receive sequence.
+ */
+ if (errno == EINTR) {
+ seenlastfrag = 1;
+ goto maybe_final;
+ }
+#endif
warning("select fails");
return -1;
}
+
+ /*
+ * Check if this is already too late. Trash the data and
+ * fake a timeout if this is so.
+ */
+ todiff = (((uint32_t)time(NULL)) - tobase) & 0x7FFFFFFFu;
+ if ((n > 0) && (todiff > tospan)) {
+ n = recv(sockfd, (char *)&rpkt, sizeof(rpkt), 0);
+ n = 0; /* faked timeout return from 'select()'*/
+ }
+
if (n == 0) {
/*
* Timed out. Return what we have
@@ -1141,14 +1176,17 @@ getresponse(
}
/*
- * Copy the data into the data buffer.
+ * Copy the data into the data buffer, and bump the
+ * timout base in case we need more.
*/
memcpy((char *)pktdata + offset, &rpkt.u, count);
-
+ tobase = (uint32_t)time(NULL);
+
/*
* If we've seen the last fragment, look for holes in the sequence.
* If there aren't any, we're done.
*/
+ maybe_final:
if (seenlastfrag && offsets[0] == 0) {
for (f = 1; f < numfrags; f++)
if (offsets[f-1] + counts[f-1] !=
@@ -2954,6 +2992,8 @@ nextvar(
len = srclen;
while (len > 0 && isspace((unsigned char)cp[len - 1]))
len--;
+ if (len >= sizeof(name))
+ return 0;
if (len > 0)
memcpy(name, cp, len);
name[len] = '\0';
@@ -3615,3 +3655,41 @@ on_ctrlc(void)
if ((*ctrlc_stack[--size])())
break;
}
+
+static int
+my_easprintf(
+ char ** ppinto,
+ const char * fmt ,
+ ...
+ )
+{
+ va_list va;
+ int prc;
+ size_t len = 128;
+ char * buf = emalloc(len);
+
+ again:
+ /* Note: we expect the memory allocation to fail long before the
+ * increment in buffer size actually overflows.
+ */
+ buf = (buf) ? erealloc(buf, len) : emalloc(len);
+
+ va_start(va, fmt);
+ prc = vsnprintf(buf, len, fmt, va);
+ va_end(va);
+
+ if (prc < 0) {
+ /* might be very old vsnprintf. Or actually MSVC... */
+ len += len >> 1;
+ goto again;
+ }
+ if ((size_t)prc >= len) {
+ /* at least we have the proper size now... */
+ len = (size_t)prc + 1;
+ goto again;
+ }
+ if ((size_t)prc < (len - 32))
+ buf = erealloc(buf, (size_t)prc + 1);
+ *ppinto = buf;
+ return prc;
+}
diff --git a/contrib/ntp/ntpq/ntpq.html b/contrib/ntp/ntpq/ntpq.html
index 16f2597..96df83d 100644
--- a/contrib/ntp/ntpq/ntpq.html
+++ b/contrib/ntp/ntpq/ntpq.html
@@ -44,7 +44,7 @@ monitor the operational status
and determine the performance of
<code>ntpd</code>, the NTP daemon.
- <p>This document applies to version 4.2.8p5 of <code>ntpq</code>.
+ <p>This document applies to version 4.2.8p6 of <code>ntpq</code>.
<ul class="menu">
<li><a accesskey="1" href="#ntpq-Description">ntpq Description</a>
@@ -769,7 +769,7 @@ the usage text by passing it through a pager program.
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.8p4
+<pre class="example">ntpq - standard NTP query program - Ver. 4.2.8p5
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 --git a/contrib/ntp/ntpq/ntpq.man.in b/contrib/ntp/ntpq/ntpq.man.in
index 17ccb1c..abe2608 100644
--- a/contrib/ntp/ntpq/ntpq.man.in
+++ b/contrib/ntp/ntpq/ntpq.man.in
@@ -10,11 +10,11 @@
.ds B-Font B
.ds I-Font I
.ds R-Font R
-.TH ntpq @NTPQ_MS@ "07 Jan 2016" "4.2.8p5" "User Commands"
+.TH ntpq @NTPQ_MS@ "20 Jan 2016" "4.2.8p6" "User Commands"
.\"
-.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-4VaaKt/ag-eWa4It)
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-Z7aWRV/ag-_7aOQV)
.\"
-.\" It has been AutoGen-ed January 7, 2016 at 11:31:55 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed January 20, 2016 at 04:19:06 AM by AutoGen 5.18.5
.\" From the definitions ntpq-opts.def
.\" and the template file agman-cmd.tpl
.SH NAME
@@ -1412,7 +1412,7 @@ it to autogen-users@lists.sourceforge.net. Thank you.
.SH "AUTHORS"
The University of Delaware and Network Time Foundation
.SH "COPYRIGHT"
-Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation all rights reserved.
+Copyright (C) 1992-2016 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 --git a/contrib/ntp/ntpq/ntpq.mdoc.in b/contrib/ntp/ntpq/ntpq.mdoc.in
index 9214a66..d71c508 100644
--- a/contrib/ntp/ntpq/ntpq.mdoc.in
+++ b/contrib/ntp/ntpq/ntpq.mdoc.in
@@ -1,9 +1,9 @@
-.Dd January 7 2016
+.Dd January 20 2016
.Dt NTPQ @NTPQ_MS@ User Commands
.Os
.\" EDIT THIS FILE WITH CAUTION (ntpq-opts.mdoc)
.\"
-.\" It has been AutoGen-ed January 7, 2016 at 11:32:02 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed January 20, 2016 at 04:19:12 AM by AutoGen 5.18.5
.\" From the definitions ntpq-opts.def
.\" and the template file agmdoc-cmd.tpl
.Sh NAME
@@ -955,7 +955,7 @@ it to autogen\-users@lists.sourceforge.net. Thank you.
.Sh "AUTHORS"
The University of Delaware and Network Time Foundation
.Sh "COPYRIGHT"
-Copyright (C) 1992\-2015 The University of Delaware and Network Time Foundation all rights reserved.
+Copyright (C) 1992\-2016 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 --git a/contrib/ntp/ntpsnmpd/invoke-ntpsnmpd.texi b/contrib/ntp/ntpsnmpd/invoke-ntpsnmpd.texi
index 1185316..fcbc23e 100644
--- a/contrib/ntp/ntpsnmpd/invoke-ntpsnmpd.texi
+++ b/contrib/ntp/ntpsnmpd/invoke-ntpsnmpd.texi
@@ -6,7 +6,7 @@
#
# EDIT THIS FILE WITH CAUTION (invoke-ntpsnmpd.texi)
#
-# It has been AutoGen-ed January 7, 2016 at 11:32:15 PM by AutoGen 5.18.5
+# It has been AutoGen-ed January 20, 2016 at 04:19:26 AM by AutoGen 5.18.5
# From the definitions ntpsnmpd-opts.def
# and the template file agtexi-cmd.tpl
@end ignore
@@ -47,7 +47,7 @@ with a status code of 0.
@exampleindent 0
@example
-ntpsnmpd - NTP SNMP MIB agent - Ver. 4.2.8p5
+ntpsnmpd - NTP SNMP MIB agent - Ver. 4.2.8p6
Usage: ntpsnmpd [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]...
Flg Arg Option-Name Description
-n no nofork Do not fork
diff --git a/contrib/ntp/ntpsnmpd/ntpsnmpd-opts.c b/contrib/ntp/ntpsnmpd/ntpsnmpd-opts.c
index cb48b16..772f364 100644
--- a/contrib/ntp/ntpsnmpd/ntpsnmpd-opts.c
+++ b/contrib/ntp/ntpsnmpd/ntpsnmpd-opts.c
@@ -1,7 +1,7 @@
/*
* EDIT THIS FILE WITH CAUTION (ntpsnmpd-opts.c)
*
- * It has been AutoGen-ed January 7, 2016 at 11:32:05 PM by AutoGen 5.18.5
+ * It has been AutoGen-ed January 20, 2016 at 04:19:15 AM by AutoGen 5.18.5
* From the definitions ntpsnmpd-opts.def
* and the template file options
*
@@ -18,7 +18,7 @@
* The ntpsnmpd program is copyrighted and licensed
* under the following terms:
*
- * Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation, all rights reserved.
+ * Copyright (C) 1992-2016 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:
@@ -61,8 +61,8 @@ extern FILE * option_usage_fp;
* static const strings for ntpsnmpd options
*/
static char const ntpsnmpd_opt_strs[1610] =
-/* 0 */ "ntpsnmpd 4.2.8p5\n"
- "Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation, all rights reserved.\n"
+/* 0 */ "ntpsnmpd 4.2.8p6\n"
+ "Copyright (C) 1992-2016 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"
@@ -101,14 +101,14 @@ static char const ntpsnmpd_opt_strs[1610] =
/* 1414 */ "no-load-opts\0"
/* 1427 */ "no\0"
/* 1430 */ "NTPSNMPD\0"
-/* 1439 */ "ntpsnmpd - NTP SNMP MIB agent - Ver. 4.2.8p5\n"
+/* 1439 */ "ntpsnmpd - NTP SNMP MIB agent - Ver. 4.2.8p6\n"
"Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]...\n\0"
/* 1542 */ "$HOME\0"
/* 1548 */ ".\0"
/* 1550 */ ".ntprc\0"
/* 1557 */ "http://bugs.ntp.org, bugs@ntp.org\0"
/* 1591 */ "\n\0"
-/* 1593 */ "ntpsnmpd 4.2.8p5";
+/* 1593 */ "ntpsnmpd 4.2.8p6";
/**
* nofork option description:
@@ -554,8 +554,8 @@ static void bogus_function(void) {
translate option names.
*/
/* referenced via ntpsnmpdOptions.pzCopyright */
- puts(_("ntpsnmpd 4.2.8p5\n\
-Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation, all rights reserved.\n\
+ puts(_("ntpsnmpd 4.2.8p6\n\
+Copyright (C) 1992-2016 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"));
@@ -599,14 +599,14 @@ implied warranty.\n"));
puts(_("load options from a config file"));
/* referenced via ntpsnmpdOptions.pzUsageTitle */
- puts(_("ntpsnmpd - NTP SNMP MIB agent - Ver. 4.2.8p5\n\
+ puts(_("ntpsnmpd - NTP SNMP MIB agent - Ver. 4.2.8p6\n\
Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]...\n"));
/* referenced via ntpsnmpdOptions.pzExplain */
puts(_("\n"));
/* referenced via ntpsnmpdOptions.pzFullVersion */
- puts(_("ntpsnmpd 4.2.8p5"));
+ puts(_("ntpsnmpd 4.2.8p6"));
/* referenced via ntpsnmpdOptions.pzFullUsage */
puts(_("<<<NOT-FOUND>>>"));
diff --git a/contrib/ntp/ntpsnmpd/ntpsnmpd-opts.h b/contrib/ntp/ntpsnmpd/ntpsnmpd-opts.h
index 8146eb9..de27f4b 100644
--- a/contrib/ntp/ntpsnmpd/ntpsnmpd-opts.h
+++ b/contrib/ntp/ntpsnmpd/ntpsnmpd-opts.h
@@ -1,7 +1,7 @@
/*
* EDIT THIS FILE WITH CAUTION (ntpsnmpd-opts.h)
*
- * It has been AutoGen-ed January 7, 2016 at 11:32:04 PM by AutoGen 5.18.5
+ * It has been AutoGen-ed January 20, 2016 at 04:19:14 AM by AutoGen 5.18.5
* From the definitions ntpsnmpd-opts.def
* and the template file options
*
@@ -18,7 +18,7 @@
* The ntpsnmpd program is copyrighted and licensed
* under the following terms:
*
- * Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation, all rights reserved.
+ * Copyright (C) 1992-2016 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:
@@ -76,9 +76,9 @@ typedef enum {
/** count of all options for ntpsnmpd */
#define OPTION_CT 8
/** ntpsnmpd version */
-#define NTPSNMPD_VERSION "4.2.8p5"
+#define NTPSNMPD_VERSION "4.2.8p6"
/** Full ntpsnmpd version text */
-#define NTPSNMPD_FULL_VERSION "ntpsnmpd 4.2.8p5"
+#define NTPSNMPD_FULL_VERSION "ntpsnmpd 4.2.8p6"
/**
* Interface defines for all options. Replace "n" with the UPPER_CASED
diff --git a/contrib/ntp/ntpsnmpd/ntpsnmpd.1ntpsnmpdman b/contrib/ntp/ntpsnmpd/ntpsnmpd.1ntpsnmpdman
index e7fc2eb..d36ca07 100644
--- a/contrib/ntp/ntpsnmpd/ntpsnmpd.1ntpsnmpdman
+++ b/contrib/ntp/ntpsnmpd/ntpsnmpd.1ntpsnmpdman
@@ -10,11 +10,11 @@
.ds B-Font B
.ds I-Font I
.ds R-Font R
-.TH ntpsnmpd 1ntpsnmpdman "07 Jan 2016" "4.2.8p5" "User Commands"
+.TH ntpsnmpd 1ntpsnmpdman "20 Jan 2016" "4.2.8p6" "User Commands"
.\"
-.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-dZaaSu/ag-qZa4Qu)
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-FaaWZW/ag-SaaOYW)
.\"
-.\" It has been AutoGen-ed January 7, 2016 at 11:32:12 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed January 20, 2016 at 04:19:22 AM by AutoGen 5.18.5
.\" From the definitions ntpsnmpd-opts.def
.\" and the template file agman-cmd.tpl
.SH NAME
@@ -138,7 +138,7 @@ it to autogen-users@lists.sourceforge.net. Thank you.
.NOP "Heiko Gerstung"
.br
.SH "COPYRIGHT"
-Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation all rights reserved.
+Copyright (C) 1992-2016 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 --git a/contrib/ntp/ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc b/contrib/ntp/ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc
index ba8d82a..6b513dc 100644
--- a/contrib/ntp/ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc
+++ b/contrib/ntp/ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc
@@ -1,9 +1,9 @@
-.Dd January 7 2016
+.Dd January 20 2016
.Dt NTPSNMPD 1ntpsnmpdmdoc User Commands
.Os
.\" EDIT THIS FILE WITH CAUTION (ntpsnmpd-opts.mdoc)
.\"
-.\" It has been AutoGen-ed January 7, 2016 at 11:32:18 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed January 20, 2016 at 04:19:28 AM by AutoGen 5.18.5
.\" From the definitions ntpsnmpd-opts.def
.\" and the template file agmdoc-cmd.tpl
.Sh NAME
@@ -110,7 +110,7 @@ it to autogen\-users@lists.sourceforge.net. Thank you.
.Sh AUTHORS
.An "Heiko Gerstung"
.Sh "COPYRIGHT"
-Copyright (C) 1992\-2015 The University of Delaware and Network Time Foundation all rights reserved.
+Copyright (C) 1992\-2016 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 --git a/contrib/ntp/ntpsnmpd/ntpsnmpd.html b/contrib/ntp/ntpsnmpd/ntpsnmpd.html
index 94df056..9bd75b9 100644
--- a/contrib/ntp/ntpsnmpd/ntpsnmpd.html
+++ b/contrib/ntp/ntpsnmpd/ntpsnmpd.html
@@ -42,7 +42,7 @@ Up:&nbsp;<a rel="up" accesskey="u" href="#dir">(dir)</a>
<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.8p5 of <code>ntpsnmpd</code>.
+ <p>This document applies to version 4.2.8p6 of <code>ntpsnmpd</code>.
<ul class="menu">
<li><a accesskey="1" href="#ntpsnmpd-Description">ntpsnmpd Description</a>: Description
diff --git a/contrib/ntp/ntpsnmpd/ntpsnmpd.man.in b/contrib/ntp/ntpsnmpd/ntpsnmpd.man.in
index b5fe93d..3dbade2 100644
--- a/contrib/ntp/ntpsnmpd/ntpsnmpd.man.in
+++ b/contrib/ntp/ntpsnmpd/ntpsnmpd.man.in
@@ -10,11 +10,11 @@
.ds B-Font B
.ds I-Font I
.ds R-Font R
-.TH ntpsnmpd @NTPSNMPD_MS@ "07 Jan 2016" "4.2.8p5" "User Commands"
+.TH ntpsnmpd @NTPSNMPD_MS@ "20 Jan 2016" "4.2.8p6" "User Commands"
.\"
-.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-dZaaSu/ag-qZa4Qu)
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-FaaWZW/ag-SaaOYW)
.\"
-.\" It has been AutoGen-ed January 7, 2016 at 11:32:12 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed January 20, 2016 at 04:19:22 AM by AutoGen 5.18.5
.\" From the definitions ntpsnmpd-opts.def
.\" and the template file agman-cmd.tpl
.SH NAME
@@ -138,7 +138,7 @@ it to autogen-users@lists.sourceforge.net. Thank you.
.NOP "Heiko Gerstung"
.br
.SH "COPYRIGHT"
-Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation all rights reserved.
+Copyright (C) 1992-2016 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 --git a/contrib/ntp/ntpsnmpd/ntpsnmpd.mdoc.in b/contrib/ntp/ntpsnmpd/ntpsnmpd.mdoc.in
index 9349c2f..11ab184 100644
--- a/contrib/ntp/ntpsnmpd/ntpsnmpd.mdoc.in
+++ b/contrib/ntp/ntpsnmpd/ntpsnmpd.mdoc.in
@@ -1,9 +1,9 @@
-.Dd January 7 2016
+.Dd January 20 2016
.Dt NTPSNMPD @NTPSNMPD_MS@ User Commands
.Os
.\" EDIT THIS FILE WITH CAUTION (ntpsnmpd-opts.mdoc)
.\"
-.\" It has been AutoGen-ed January 7, 2016 at 11:32:18 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed January 20, 2016 at 04:19:28 AM by AutoGen 5.18.5
.\" From the definitions ntpsnmpd-opts.def
.\" and the template file agmdoc-cmd.tpl
.Sh NAME
@@ -110,7 +110,7 @@ it to autogen\-users@lists.sourceforge.net. Thank you.
.Sh AUTHORS
.An "Heiko Gerstung"
.Sh "COPYRIGHT"
-Copyright (C) 1992\-2015 The University of Delaware and Network Time Foundation all rights reserved.
+Copyright (C) 1992\-2016 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 --git a/contrib/ntp/packageinfo.sh b/contrib/ntp/packageinfo.sh
index 9b94198..1835576 100644
--- a/contrib/ntp/packageinfo.sh
+++ b/contrib/ntp/packageinfo.sh
@@ -83,7 +83,7 @@ CLTAG=NTP_4_2_0
# - Numeric values increment
# - empty 'increments' to 1
# - NEW 'increments' to empty
-point=5
+point=6
### betapoint is normally modified by script.
# ntp-stable Beta number (betapoint)
diff --git a/contrib/ntp/scripts/calc_tickadj/calc_tickadj.1calc_tickadjman b/contrib/ntp/scripts/calc_tickadj/calc_tickadj.1calc_tickadjman
index cfeca4d..8ec5024 100644
--- a/contrib/ntp/scripts/calc_tickadj/calc_tickadj.1calc_tickadjman
+++ b/contrib/ntp/scripts/calc_tickadj/calc_tickadj.1calc_tickadjman
@@ -10,11 +10,11 @@
.ds B-Font B
.ds I-Font I
.ds R-Font R
-.TH calc_tickadj 1calc_tickadjman "07 Jan 2016" "ntp (4.2.8p5)" "User Commands"
+.TH calc_tickadj 1calc_tickadjman "20 Jan 2016" "ntp (4.2.8p6)" "User Commands"
.\"
-.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-nyaOMf/ag-AyaWLf)
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-lWayEG/ag-yWaGDG)
.\"
-.\" It has been AutoGen-ed January 7, 2016 at 11:26:26 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed January 20, 2016 at 04:09:44 AM by AutoGen 5.18.5
.\" From the definitions calc_tickadj-opts.def
.\" and the template file agman-cmd.tpl
.SH NAME
diff --git a/contrib/ntp/scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc b/contrib/ntp/scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc
index 8aed38f..aef4ada 100644
--- a/contrib/ntp/scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc
+++ b/contrib/ntp/scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc
@@ -1,9 +1,9 @@
-.Dd January 7 2016
+.Dd January 20 2016
.Dt CALC_TICKADJ 1calc_tickadjmdoc User Commands
.Os
.\" EDIT THIS FILE WITH CAUTION (calc_tickadj-opts.mdoc)
.\"
-.\" It has been AutoGen-ed January 7, 2016 at 11:26:28 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed January 20, 2016 at 04:09:46 AM by AutoGen 5.18.5
.\" From the definitions calc_tickadj-opts.def
.\" and the template file agmdoc-cmd.tpl
.Sh NAME
diff --git a/contrib/ntp/scripts/calc_tickadj/calc_tickadj.html b/contrib/ntp/scripts/calc_tickadj/calc_tickadj.html
index 484e112..4869e66 100644
--- a/contrib/ntp/scripts/calc_tickadj/calc_tickadj.html
+++ b/contrib/ntp/scripts/calc_tickadj/calc_tickadj.html
@@ -31,7 +31,7 @@ Up:&nbsp;<a rel="up" accesskey="u" href="#dir">(dir)</a>
<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.8p5 of <code>calc_tickadj</code>.
+This document applies to version 4.2.8p6 of <code>calc_tickadj</code>.
<div class="shortcontents">
<h2>Short Contents</h2>
diff --git a/contrib/ntp/scripts/calc_tickadj/calc_tickadj.man.in b/contrib/ntp/scripts/calc_tickadj/calc_tickadj.man.in
index cfeca4d..8ec5024 100644
--- a/contrib/ntp/scripts/calc_tickadj/calc_tickadj.man.in
+++ b/contrib/ntp/scripts/calc_tickadj/calc_tickadj.man.in
@@ -10,11 +10,11 @@
.ds B-Font B
.ds I-Font I
.ds R-Font R
-.TH calc_tickadj 1calc_tickadjman "07 Jan 2016" "ntp (4.2.8p5)" "User Commands"
+.TH calc_tickadj 1calc_tickadjman "20 Jan 2016" "ntp (4.2.8p6)" "User Commands"
.\"
-.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-nyaOMf/ag-AyaWLf)
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-lWayEG/ag-yWaGDG)
.\"
-.\" It has been AutoGen-ed January 7, 2016 at 11:26:26 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed January 20, 2016 at 04:09:44 AM by AutoGen 5.18.5
.\" From the definitions calc_tickadj-opts.def
.\" and the template file agman-cmd.tpl
.SH NAME
diff --git a/contrib/ntp/scripts/calc_tickadj/calc_tickadj.mdoc.in b/contrib/ntp/scripts/calc_tickadj/calc_tickadj.mdoc.in
index 8aed38f..aef4ada 100644
--- a/contrib/ntp/scripts/calc_tickadj/calc_tickadj.mdoc.in
+++ b/contrib/ntp/scripts/calc_tickadj/calc_tickadj.mdoc.in
@@ -1,9 +1,9 @@
-.Dd January 7 2016
+.Dd January 20 2016
.Dt CALC_TICKADJ 1calc_tickadjmdoc User Commands
.Os
.\" EDIT THIS FILE WITH CAUTION (calc_tickadj-opts.mdoc)
.\"
-.\" It has been AutoGen-ed January 7, 2016 at 11:26:28 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed January 20, 2016 at 04:09:46 AM by AutoGen 5.18.5
.\" From the definitions calc_tickadj-opts.def
.\" and the template file agmdoc-cmd.tpl
.Sh NAME
diff --git a/contrib/ntp/scripts/calc_tickadj/invoke-calc_tickadj.texi b/contrib/ntp/scripts/calc_tickadj/invoke-calc_tickadj.texi
index c78d53d..418562f 100644
--- a/contrib/ntp/scripts/calc_tickadj/invoke-calc_tickadj.texi
+++ b/contrib/ntp/scripts/calc_tickadj/invoke-calc_tickadj.texi
@@ -6,7 +6,7 @@
#
# EDIT THIS FILE WITH CAUTION (invoke-calc_tickadj.texi)
#
-# It has been AutoGen-ed January 7, 2016 at 11:26:30 PM by AutoGen 5.18.5
+# It has been AutoGen-ed January 20, 2016 at 04:09:47 AM by AutoGen 5.18.5
# From the definitions calc_tickadj-opts.def
# and the template file agtexi-cmd.tpl
@end ignore
diff --git a/contrib/ntp/scripts/invoke-plot_summary.texi b/contrib/ntp/scripts/invoke-plot_summary.texi
index 93cc07a..96b5714 100644
--- a/contrib/ntp/scripts/invoke-plot_summary.texi
+++ b/contrib/ntp/scripts/invoke-plot_summary.texi
@@ -6,7 +6,7 @@
#
# EDIT THIS FILE WITH CAUTION (invoke-plot_summary.texi)
#
-# It has been AutoGen-ed January 7, 2016 at 11:27:16 PM by AutoGen 5.18.5
+# It has been AutoGen-ed January 20, 2016 at 04:10:34 AM by AutoGen 5.18.5
# From the definitions plot_summary-opts.def
# and the template file agtexi-cmd.tpl
@end ignore
@@ -41,7 +41,7 @@ with a status code of 0.
@exampleindent 0
@example
-plot_summary - plot statistics generated by summary script - Ver. 4.2.8p5
+plot_summary - plot statistics generated by summary script - Ver. 4.2.8p6
USAGE: plot_summary [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]...
--directory=str Where the summary files are
diff --git a/contrib/ntp/scripts/invoke-summary.texi b/contrib/ntp/scripts/invoke-summary.texi
index 521a7ff..9a05d51 100644
--- a/contrib/ntp/scripts/invoke-summary.texi
+++ b/contrib/ntp/scripts/invoke-summary.texi
@@ -6,7 +6,7 @@
#
# EDIT THIS FILE WITH CAUTION (invoke-summary.texi)
#
-# It has been AutoGen-ed January 7, 2016 at 11:27:22 PM by AutoGen 5.18.5
+# It has been AutoGen-ed January 20, 2016 at 04:10:40 AM by AutoGen 5.18.5
# From the definitions summary-opts.def
# and the template file agtexi-cmd.tpl
@end ignore
@@ -42,7 +42,7 @@ with a status code of 0.
@exampleindent 0
@example
-summary - compute various stastics from NTP stat files - Ver. 4.2.8p5
+summary - compute various stastics from NTP stat files - Ver. 4.2.8p6
USAGE: summary [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]...
--directory=str Directory containing stat files
diff --git a/contrib/ntp/scripts/ntp-wait/invoke-ntp-wait.texi b/contrib/ntp/scripts/ntp-wait/invoke-ntp-wait.texi
index f2de360..d2e964c 100644
--- a/contrib/ntp/scripts/ntp-wait/invoke-ntp-wait.texi
+++ b/contrib/ntp/scripts/ntp-wait/invoke-ntp-wait.texi
@@ -6,7 +6,7 @@
#
# EDIT THIS FILE WITH CAUTION (invoke-ntp-wait.texi)
#
-# It has been AutoGen-ed January 7, 2016 at 11:26:39 PM by AutoGen 5.18.5
+# It has been AutoGen-ed January 20, 2016 at 04:09:57 AM by AutoGen 5.18.5
# From the definitions ntp-wait-opts.def
# and the template file agtexi-cmd.tpl
@end ignore
@@ -61,7 +61,7 @@ with a status code of 0.
@exampleindent 0
@example
-ntp-wait - Wait for ntpd to stabilize the system clock - Ver. 4.2.8p5
+ntp-wait - Wait for ntpd to stabilize the system clock - Ver. 4.2.8p6
USAGE: ntp-wait [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]...
-n, --tries=num Number of times to check ntpd
diff --git a/contrib/ntp/scripts/ntp-wait/ntp-wait-opts b/contrib/ntp/scripts/ntp-wait/ntp-wait-opts
index 24db0a3..1c6a815 100644
--- a/contrib/ntp/scripts/ntp-wait/ntp-wait-opts
+++ b/contrib/ntp/scripts/ntp-wait/ntp-wait-opts
@@ -1,6 +1,6 @@
# EDIT THIS FILE WITH CAUTION (ntp-wait-opts)
#
-# It has been AutoGen-ed January 7, 2016 at 11:26:33 PM by AutoGen 5.18.5
+# It has been AutoGen-ed January 20, 2016 at 04:09:51 AM by AutoGen 5.18.5
# From the definitions ntp-wait-opts.def
# and the template file perlopt
@@ -40,7 +40,7 @@ sub processOptions {
'help|?', 'more-help'));
$usage = <<'USAGE';
-ntp-wait - Wait for ntpd to stabilize the system clock - Ver. 4.2.8p5
+ntp-wait - Wait for ntpd to stabilize the system clock - Ver. 4.2.8p6
USAGE: ntp-wait [ -<flag> [<val>] | --<name>[{=| }<val>] ]...
-n, --tries=num Number of times to check ntpd
diff --git a/contrib/ntp/scripts/ntp-wait/ntp-wait.1ntp-waitman b/contrib/ntp/scripts/ntp-wait/ntp-wait.1ntp-waitman
index b49cd94..44b0d00 100644
--- a/contrib/ntp/scripts/ntp-wait/ntp-wait.1ntp-waitman
+++ b/contrib/ntp/scripts/ntp-wait/ntp-wait.1ntp-waitman
@@ -10,11 +10,11 @@
.ds B-Font B
.ds I-Font I
.ds R-Font R
-.TH ntp-wait 1ntp-waitman "07 Jan 2016" "ntp (4.2.8p5)" "User Commands"
+.TH ntp-wait 1ntp-waitman "20 Jan 2016" "ntp (4.2.8p6)" "User Commands"
.\"
-.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-7OaOah/ag-iPaW_g)
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-4fay4H/ag-fgaG3H)
.\"
-.\" It has been AutoGen-ed January 7, 2016 at 11:26:35 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed January 20, 2016 at 04:09:53 AM by AutoGen 5.18.5
.\" From the definitions ntp-wait-opts.def
.\" and the template file agman-cmd.tpl
.SH NAME
diff --git a/contrib/ntp/scripts/ntp-wait/ntp-wait.1ntp-waitmdoc b/contrib/ntp/scripts/ntp-wait/ntp-wait.1ntp-waitmdoc
index 293bb0e..b052fcc 100644
--- a/contrib/ntp/scripts/ntp-wait/ntp-wait.1ntp-waitmdoc
+++ b/contrib/ntp/scripts/ntp-wait/ntp-wait.1ntp-waitmdoc
@@ -1,9 +1,9 @@
-.Dd January 7 2016
+.Dd January 20 2016
.Dt NTP_WAIT 1ntp-waitmdoc User Commands
.Os
.\" EDIT THIS FILE WITH CAUTION (ntp-wait-opts.mdoc)
.\"
-.\" It has been AutoGen-ed January 7, 2016 at 11:26:41 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed January 20, 2016 at 04:09:59 AM by AutoGen 5.18.5
.\" From the definitions ntp-wait-opts.def
.\" and the template file agmdoc-cmd.tpl
.Sh NAME
diff --git a/contrib/ntp/scripts/ntp-wait/ntp-wait.html b/contrib/ntp/scripts/ntp-wait/ntp-wait.html
index e8f08d4..53accf6 100644
--- a/contrib/ntp/scripts/ntp-wait/ntp-wait.html
+++ b/contrib/ntp/scripts/ntp-wait/ntp-wait.html
@@ -39,7 +39,7 @@ until the system's time has stabilized and synchronized,
and only then start any applicaitons (like database servers) that require
accurate and stable time.
- <p>This document applies to version 4.2.8p5 of <code>ntp-wait</code>.
+ <p>This document applies to version 4.2.8p6 of <code>ntp-wait</code>.
<div class="shortcontents">
<h2>Short Contents</h2>
@@ -114,7 +114,7 @@ the usage text by passing it through a pager program.
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.8p5
+<pre class="example">ntp-wait - Wait for ntpd to stabilize the system clock - Ver. 4.2.8p6
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 --git a/contrib/ntp/scripts/ntp-wait/ntp-wait.man.in b/contrib/ntp/scripts/ntp-wait/ntp-wait.man.in
index f7326de..693cea7 100644
--- a/contrib/ntp/scripts/ntp-wait/ntp-wait.man.in
+++ b/contrib/ntp/scripts/ntp-wait/ntp-wait.man.in
@@ -10,11 +10,11 @@
.ds B-Font B
.ds I-Font I
.ds R-Font R
-.TH ntp-wait @NTP_WAIT_MS@ "07 Jan 2016" "ntp (4.2.8p5)" "User Commands"
+.TH ntp-wait @NTP_WAIT_MS@ "20 Jan 2016" "ntp (4.2.8p6)" "User Commands"
.\"
-.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-7OaOah/ag-iPaW_g)
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-4fay4H/ag-fgaG3H)
.\"
-.\" It has been AutoGen-ed January 7, 2016 at 11:26:35 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed January 20, 2016 at 04:09:53 AM by AutoGen 5.18.5
.\" From the definitions ntp-wait-opts.def
.\" and the template file agman-cmd.tpl
.SH NAME
diff --git a/contrib/ntp/scripts/ntp-wait/ntp-wait.mdoc.in b/contrib/ntp/scripts/ntp-wait/ntp-wait.mdoc.in
index d3562ba..faa7361 100644
--- a/contrib/ntp/scripts/ntp-wait/ntp-wait.mdoc.in
+++ b/contrib/ntp/scripts/ntp-wait/ntp-wait.mdoc.in
@@ -1,9 +1,9 @@
-.Dd January 7 2016
+.Dd January 20 2016
.Dt NTP_WAIT @NTP_WAIT_MS@ User Commands
.Os
.\" EDIT THIS FILE WITH CAUTION (ntp-wait-opts.mdoc)
.\"
-.\" It has been AutoGen-ed January 7, 2016 at 11:26:41 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed January 20, 2016 at 04:09:59 AM by AutoGen 5.18.5
.\" From the definitions ntp-wait-opts.def
.\" and the template file agmdoc-cmd.tpl
.Sh NAME
diff --git a/contrib/ntp/scripts/ntpsweep/invoke-ntpsweep.texi b/contrib/ntp/scripts/ntpsweep/invoke-ntpsweep.texi
index 0556da8..5e90637 100644
--- a/contrib/ntp/scripts/ntpsweep/invoke-ntpsweep.texi
+++ b/contrib/ntp/scripts/ntpsweep/invoke-ntpsweep.texi
@@ -6,7 +6,7 @@
#
# EDIT THIS FILE WITH CAUTION (invoke-ntpsweep.texi)
#
-# It has been AutoGen-ed January 7, 2016 at 11:26:45 PM by AutoGen 5.18.5
+# It has been AutoGen-ed January 20, 2016 at 04:10:03 AM by AutoGen 5.18.5
# From the definitions ntpsweep-opts.def
# and the template file agtexi-cmd.tpl
@end ignore
@@ -45,7 +45,7 @@ with a status code of 0.
@exampleindent 0
@example
-ntpsweep - Print various informations about given ntp servers - Ver. 4.2.8p5
+ntpsweep - Print various informations about given ntp servers - Ver. 4.2.8p6
USAGE: ntpsweep [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]... [hostfile]
-l, --host-list=str Host to execute actions on
diff --git a/contrib/ntp/scripts/ntpsweep/ntpsweep-opts b/contrib/ntp/scripts/ntpsweep/ntpsweep-opts
index 2629d29..7cd1e3d 100644
--- a/contrib/ntp/scripts/ntpsweep/ntpsweep-opts
+++ b/contrib/ntp/scripts/ntpsweep/ntpsweep-opts
@@ -1,6 +1,6 @@
# EDIT THIS FILE WITH CAUTION (ntpsweep-opts)
#
-# It has been AutoGen-ed January 7, 2016 at 11:26:43 PM by AutoGen 5.18.5
+# It has been AutoGen-ed January 20, 2016 at 04:10:01 AM by AutoGen 5.18.5
# From the definitions ntpsweep-opts.def
# and the template file perlopt
@@ -43,7 +43,7 @@ sub processOptions {
'help|?', 'more-help'));
$usage = <<'USAGE';
-ntpsweep - Print various informations about given ntp servers - Ver. 4.2.8p5
+ntpsweep - Print various informations about given ntp servers - Ver. 4.2.8p6
USAGE: ntpsweep [ -<flag> [<val>] | --<name>[{=| }<val>] ]... [hostfile]
-l, --host-list=str Host to execute actions on
diff --git a/contrib/ntp/scripts/ntpsweep/ntpsweep.1ntpsweepman b/contrib/ntp/scripts/ntpsweep/ntpsweep.1ntpsweepman
index 0f61f64..0419a17 100644
--- a/contrib/ntp/scripts/ntpsweep/ntpsweep.1ntpsweepman
+++ b/contrib/ntp/scripts/ntpsweep/ntpsweep.1ntpsweepman
@@ -10,11 +10,11 @@
.ds B-Font B
.ds I-Font I
.ds R-Font R
-.TH ntpsweep 1ntpsweepman "07 Jan 2016" "ntp (4.2.8p5)" "User Commands"
+.TH ntpsweep 1ntpsweepman "20 Jan 2016" "ntp (4.2.8p6)" "User Commands"
.\"
-.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-eHaGCi/ag-rHaOBi)
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-3aaGuJ/ag-ebaOtJ)
.\"
-.\" It has been AutoGen-ed January 7, 2016 at 11:26:47 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed January 20, 2016 at 04:10:05 AM by AutoGen 5.18.5
.\" From the definitions ntpsweep-opts.def
.\" and the template file agman-cmd.tpl
.SH NAME
diff --git a/contrib/ntp/scripts/ntpsweep/ntpsweep.1ntpsweepmdoc b/contrib/ntp/scripts/ntpsweep/ntpsweep.1ntpsweepmdoc
index 6d0c357..8b1af98 100644
--- a/contrib/ntp/scripts/ntpsweep/ntpsweep.1ntpsweepmdoc
+++ b/contrib/ntp/scripts/ntpsweep/ntpsweep.1ntpsweepmdoc
@@ -1,9 +1,9 @@
-.Dd January 7 2016
+.Dd January 20 2016
.Dt NTPSWEEP 1ntpsweepmdoc User Commands
.Os
.\" EDIT THIS FILE WITH CAUTION (ntpsweep-opts.mdoc)
.\"
-.\" It has been AutoGen-ed January 7, 2016 at 11:26:50 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed January 20, 2016 at 04:10:09 AM by AutoGen 5.18.5
.\" From the definitions ntpsweep-opts.def
.\" and the template file agmdoc-cmd.tpl
.Sh NAME
diff --git a/contrib/ntp/scripts/ntpsweep/ntpsweep.html b/contrib/ntp/scripts/ntpsweep/ntpsweep.html
index aba6b5f..b5dac39 100644
--- a/contrib/ntp/scripts/ntpsweep/ntpsweep.html
+++ b/contrib/ntp/scripts/ntpsweep/ntpsweep.html
@@ -30,7 +30,7 @@ Up:&nbsp;<a rel="up" accesskey="u" href="#dir">(dir)</a>
<p>This document describes the use of the NTP Project's <code>ntpsweep</code> program.
- <p>This document applies to version 4.2.8p5 of <code>ntpsweep</code>.
+ <p>This document applies to version 4.2.8p6 of <code>ntpsweep</code>.
<div class="shortcontents">
<h2>Short Contents</h2>
@@ -90,7 +90,7 @@ the usage text by passing it through a pager program.
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.8p5
+<pre class="example">ntpsweep - Print various informations about given ntp servers - Ver. 4.2.8p6
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 --git a/contrib/ntp/scripts/ntpsweep/ntpsweep.man.in b/contrib/ntp/scripts/ntpsweep/ntpsweep.man.in
index 0f61f64..0419a17 100644
--- a/contrib/ntp/scripts/ntpsweep/ntpsweep.man.in
+++ b/contrib/ntp/scripts/ntpsweep/ntpsweep.man.in
@@ -10,11 +10,11 @@
.ds B-Font B
.ds I-Font I
.ds R-Font R
-.TH ntpsweep 1ntpsweepman "07 Jan 2016" "ntp (4.2.8p5)" "User Commands"
+.TH ntpsweep 1ntpsweepman "20 Jan 2016" "ntp (4.2.8p6)" "User Commands"
.\"
-.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-eHaGCi/ag-rHaOBi)
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-3aaGuJ/ag-ebaOtJ)
.\"
-.\" It has been AutoGen-ed January 7, 2016 at 11:26:47 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed January 20, 2016 at 04:10:05 AM by AutoGen 5.18.5
.\" From the definitions ntpsweep-opts.def
.\" and the template file agman-cmd.tpl
.SH NAME
diff --git a/contrib/ntp/scripts/ntpsweep/ntpsweep.mdoc.in b/contrib/ntp/scripts/ntpsweep/ntpsweep.mdoc.in
index 6d0c357..8b1af98 100644
--- a/contrib/ntp/scripts/ntpsweep/ntpsweep.mdoc.in
+++ b/contrib/ntp/scripts/ntpsweep/ntpsweep.mdoc.in
@@ -1,9 +1,9 @@
-.Dd January 7 2016
+.Dd January 20 2016
.Dt NTPSWEEP 1ntpsweepmdoc User Commands
.Os
.\" EDIT THIS FILE WITH CAUTION (ntpsweep-opts.mdoc)
.\"
-.\" It has been AutoGen-ed January 7, 2016 at 11:26:50 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed January 20, 2016 at 04:10:09 AM by AutoGen 5.18.5
.\" From the definitions ntpsweep-opts.def
.\" and the template file agmdoc-cmd.tpl
.Sh NAME
diff --git a/contrib/ntp/scripts/ntptrace/invoke-ntptrace.texi b/contrib/ntp/scripts/ntptrace/invoke-ntptrace.texi
index 29f48f4..0545b4a 100644
--- a/contrib/ntp/scripts/ntptrace/invoke-ntptrace.texi
+++ b/contrib/ntp/scripts/ntptrace/invoke-ntptrace.texi
@@ -6,7 +6,7 @@
#
# EDIT THIS FILE WITH CAUTION (invoke-ntptrace.texi)
#
-# It has been AutoGen-ed January 7, 2016 at 11:26:58 PM by AutoGen 5.18.5
+# It has been AutoGen-ed January 20, 2016 at 04:10:16 AM by AutoGen 5.18.5
# From the definitions ntptrace-opts.def
# and the template file agtexi-cmd.tpl
@end ignore
@@ -62,7 +62,7 @@ with a status code of 0.
@exampleindent 0
@example
-ntptrace - Trace peers of an NTP server - Ver. 4.2.8p5
+ntptrace - Trace peers of an NTP server - Ver. 4.2.8p6
USAGE: ntptrace [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]... [host]
-n, --numeric Print IP addresses instead of hostnames
diff --git a/contrib/ntp/scripts/ntptrace/ntptrace-opts b/contrib/ntp/scripts/ntptrace/ntptrace-opts
index d1cecf8..9744414 100644
--- a/contrib/ntp/scripts/ntptrace/ntptrace-opts
+++ b/contrib/ntp/scripts/ntptrace/ntptrace-opts
@@ -1,6 +1,6 @@
# EDIT THIS FILE WITH CAUTION (ntptrace-opts)
#
-# It has been AutoGen-ed January 7, 2016 at 11:26:52 PM by AutoGen 5.18.5
+# It has been AutoGen-ed January 20, 2016 at 04:10:10 AM by AutoGen 5.18.5
# From the definitions ntptrace-opts.def
# and the template file perlopt
@@ -40,7 +40,7 @@ sub processOptions {
'help|?', 'more-help'));
$usage = <<'USAGE';
-ntptrace - Trace peers of an NTP server - Ver. 4.2.8p5
+ntptrace - Trace peers of an NTP server - Ver. 4.2.8p6
USAGE: ntptrace [ -<flag> [<val>] | --<name>[{=| }<val>] ]... [host]
-n, --numeric Print IP addresses instead of hostnames
diff --git a/contrib/ntp/scripts/ntptrace/ntptrace.1ntptraceman b/contrib/ntp/scripts/ntptrace/ntptrace.1ntptraceman
index 33854e6..870d184 100644
--- a/contrib/ntp/scripts/ntptrace/ntptrace.1ntptraceman
+++ b/contrib/ntp/scripts/ntptrace/ntptrace.1ntptraceman
@@ -10,11 +10,11 @@
.ds B-Font B
.ds I-Font I
.ds R-Font R
-.TH ntptrace 1ntptraceman "07 Jan 2016" "ntp (4.2.8p5)" "User Commands"
+.TH ntptrace 1ntptraceman "20 Jan 2016" "ntp (4.2.8p6)" "User Commands"
.\"
-.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-tqaWUj/ag-Gqa4Tj)
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-s0aOMK/ag-G0aWLK)
.\"
-.\" It has been AutoGen-ed January 7, 2016 at 11:26:54 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed January 20, 2016 at 04:10:13 AM by AutoGen 5.18.5
.\" From the definitions ntptrace-opts.def
.\" and the template file agman-cmd.tpl
.SH NAME
diff --git a/contrib/ntp/scripts/ntptrace/ntptrace.1ntptracemdoc b/contrib/ntp/scripts/ntptrace/ntptrace.1ntptracemdoc
index eea1d62..0a8a83a 100644
--- a/contrib/ntp/scripts/ntptrace/ntptrace.1ntptracemdoc
+++ b/contrib/ntp/scripts/ntptrace/ntptrace.1ntptracemdoc
@@ -1,9 +1,9 @@
-.Dd January 7 2016
+.Dd January 20 2016
.Dt NTPTRACE 1ntptracemdoc User Commands
.Os
.\" EDIT THIS FILE WITH CAUTION (ntptrace-opts.mdoc)
.\"
-.\" It has been AutoGen-ed January 7, 2016 at 11:27:00 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed January 20, 2016 at 04:10:18 AM by AutoGen 5.18.5
.\" From the definitions ntptrace-opts.def
.\" and the template file agmdoc-cmd.tpl
.Sh NAME
diff --git a/contrib/ntp/scripts/ntptrace/ntptrace.html b/contrib/ntp/scripts/ntptrace/ntptrace.html
index fb96e71..2da3424 100644
--- a/contrib/ntp/scripts/ntptrace/ntptrace.html
+++ b/contrib/ntp/scripts/ntptrace/ntptrace.html
@@ -31,7 +31,7 @@ Up:&nbsp;<a rel="up" accesskey="u" href="#dir">(dir)</a>
<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.8p5 of <code>ntptrace</code>.
+This document applies to version 4.2.8p6 of <code>ntptrace</code>.
<div class="shortcontents">
<h2>Short Contents</h2>
@@ -107,7 +107,7 @@ the usage text by passing it through a pager program.
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.8p5
+<pre class="example">ntptrace - Trace peers of an NTP server - Ver. 4.2.8p6
USAGE: ntptrace [ -&lt;flag&gt; [&lt;val&gt;] | --&lt;name&gt;[{=| }&lt;val&gt;] ]... [host]
-n, --numeric Print IP addresses instead of hostnames
diff --git a/contrib/ntp/scripts/ntptrace/ntptrace.man.in b/contrib/ntp/scripts/ntptrace/ntptrace.man.in
index 04c8c91..d602938 100644
--- a/contrib/ntp/scripts/ntptrace/ntptrace.man.in
+++ b/contrib/ntp/scripts/ntptrace/ntptrace.man.in
@@ -10,11 +10,11 @@
.ds B-Font B
.ds I-Font I
.ds R-Font R
-.TH ntptrace @NTPTRACE_MS@ "07 Jan 2016" "ntp (4.2.8p5)" "User Commands"
+.TH ntptrace @NTPTRACE_MS@ "20 Jan 2016" "ntp (4.2.8p6)" "User Commands"
.\"
-.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-tqaWUj/ag-Gqa4Tj)
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-s0aOMK/ag-G0aWLK)
.\"
-.\" It has been AutoGen-ed January 7, 2016 at 11:26:54 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed January 20, 2016 at 04:10:13 AM by AutoGen 5.18.5
.\" From the definitions ntptrace-opts.def
.\" and the template file agman-cmd.tpl
.SH NAME
diff --git a/contrib/ntp/scripts/ntptrace/ntptrace.mdoc.in b/contrib/ntp/scripts/ntptrace/ntptrace.mdoc.in
index 6e8b389..b7be946 100644
--- a/contrib/ntp/scripts/ntptrace/ntptrace.mdoc.in
+++ b/contrib/ntp/scripts/ntptrace/ntptrace.mdoc.in
@@ -1,9 +1,9 @@
-.Dd January 7 2016
+.Dd January 20 2016
.Dt NTPTRACE @NTPTRACE_MS@ User Commands
.Os
.\" EDIT THIS FILE WITH CAUTION (ntptrace-opts.mdoc)
.\"
-.\" It has been AutoGen-ed January 7, 2016 at 11:27:00 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed January 20, 2016 at 04:10:18 AM by AutoGen 5.18.5
.\" From the definitions ntptrace-opts.def
.\" and the template file agmdoc-cmd.tpl
.Sh NAME
diff --git a/contrib/ntp/scripts/plot_summary-opts b/contrib/ntp/scripts/plot_summary-opts
index 28ea583..03c0dbb 100644
--- a/contrib/ntp/scripts/plot_summary-opts
+++ b/contrib/ntp/scripts/plot_summary-opts
@@ -1,6 +1,6 @@
# EDIT THIS FILE WITH CAUTION (plot_summary-opts)
#
-# It has been AutoGen-ed January 7, 2016 at 11:27:12 PM by AutoGen 5.18.5
+# It has been AutoGen-ed January 20, 2016 at 04:10:30 AM by AutoGen 5.18.5
# From the definitions plot_summary-opts.def
# and the template file perlopt
@@ -46,7 +46,7 @@ sub processOptions {
'help|?', 'more-help'));
$usage = <<'USAGE';
-plot_summary - plot statistics generated by summary script - Ver. 4.2.8p5
+plot_summary - plot statistics generated by summary script - Ver. 4.2.8p6
USAGE: plot_summary [ -<flag> [<val>] | --<name>[{=| }<val>] ]...
--directory=str Where the summary files are
diff --git a/contrib/ntp/scripts/plot_summary.1plot_summaryman b/contrib/ntp/scripts/plot_summary.1plot_summaryman
index 9094f8e..1aec5a7 100644
--- a/contrib/ntp/scripts/plot_summary.1plot_summaryman
+++ b/contrib/ntp/scripts/plot_summary.1plot_summaryman
@@ -10,11 +10,11 @@
.ds B-Font B
.ds I-Font I
.ds R-Font R
-.TH plot_summary 1plot_summaryman "07 Jan 2016" "ntp (4.2.8p5)" "User Commands"
+.TH plot_summary 1plot_summaryman "20 Jan 2016" "ntp (4.2.8p6)" "User Commands"
.\"
-.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-xiaqKm/ag-KiayJm)
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-CNaiCN/ag-PNaqBN)
.\"
-.\" It has been AutoGen-ed January 7, 2016 at 11:27:18 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed January 20, 2016 at 04:10:36 AM by AutoGen 5.18.5
.\" From the definitions plot_summary-opts.def
.\" and the template file agman-cmd.tpl
.SH NAME
diff --git a/contrib/ntp/scripts/plot_summary.1plot_summarymdoc b/contrib/ntp/scripts/plot_summary.1plot_summarymdoc
index 99c5d8c..e816434 100644
--- a/contrib/ntp/scripts/plot_summary.1plot_summarymdoc
+++ b/contrib/ntp/scripts/plot_summary.1plot_summarymdoc
@@ -1,9 +1,9 @@
-.Dd January 7 2016
+.Dd January 20 2016
.Dt PLOT_SUMMARY 1plot_summarymdoc User Commands
.Os
.\" EDIT THIS FILE WITH CAUTION (plot_summary-opts.mdoc)
.\"
-.\" It has been AutoGen-ed January 7, 2016 at 11:27:20 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed January 20, 2016 at 04:10:38 AM by AutoGen 5.18.5
.\" From the definitions plot_summary-opts.def
.\" and the template file agmdoc-cmd.tpl
.Sh NAME
diff --git a/contrib/ntp/scripts/plot_summary.html b/contrib/ntp/scripts/plot_summary.html
index 3cb2ed4..6d8e5a4 100644
--- a/contrib/ntp/scripts/plot_summary.html
+++ b/contrib/ntp/scripts/plot_summary.html
@@ -31,7 +31,7 @@ Up:&nbsp;<a rel="up" accesskey="u" href="#dir">(dir)</a>
<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.8p5 of <code>plot_summary</code>.
+This document applies to version 4.2.8p6 of <code>plot_summary</code>.
<div class="shortcontents">
<h2>Short Contents</h2>
@@ -89,7 +89,7 @@ the usage text by passing it through a pager program.
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.8p5
+<pre class="example">plot_summary - plot statistics generated by summary script - Ver. 4.2.8p6
USAGE: plot_summary [ -&lt;flag&gt; [&lt;val&gt;] | --&lt;name&gt;[{=| }&lt;val&gt;] ]...
--directory=str Where the summary files are
diff --git a/contrib/ntp/scripts/plot_summary.man.in b/contrib/ntp/scripts/plot_summary.man.in
index 9094f8e..1aec5a7 100644
--- a/contrib/ntp/scripts/plot_summary.man.in
+++ b/contrib/ntp/scripts/plot_summary.man.in
@@ -10,11 +10,11 @@
.ds B-Font B
.ds I-Font I
.ds R-Font R
-.TH plot_summary 1plot_summaryman "07 Jan 2016" "ntp (4.2.8p5)" "User Commands"
+.TH plot_summary 1plot_summaryman "20 Jan 2016" "ntp (4.2.8p6)" "User Commands"
.\"
-.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-xiaqKm/ag-KiayJm)
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-CNaiCN/ag-PNaqBN)
.\"
-.\" It has been AutoGen-ed January 7, 2016 at 11:27:18 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed January 20, 2016 at 04:10:36 AM by AutoGen 5.18.5
.\" From the definitions plot_summary-opts.def
.\" and the template file agman-cmd.tpl
.SH NAME
diff --git a/contrib/ntp/scripts/plot_summary.mdoc.in b/contrib/ntp/scripts/plot_summary.mdoc.in
index 99c5d8c..e816434 100644
--- a/contrib/ntp/scripts/plot_summary.mdoc.in
+++ b/contrib/ntp/scripts/plot_summary.mdoc.in
@@ -1,9 +1,9 @@
-.Dd January 7 2016
+.Dd January 20 2016
.Dt PLOT_SUMMARY 1plot_summarymdoc User Commands
.Os
.\" EDIT THIS FILE WITH CAUTION (plot_summary-opts.mdoc)
.\"
-.\" It has been AutoGen-ed January 7, 2016 at 11:27:20 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed January 20, 2016 at 04:10:38 AM by AutoGen 5.18.5
.\" From the definitions plot_summary-opts.def
.\" and the template file agmdoc-cmd.tpl
.Sh NAME
diff --git a/contrib/ntp/scripts/summary-opts b/contrib/ntp/scripts/summary-opts
index 47661ee..2fa6a7d 100644
--- a/contrib/ntp/scripts/summary-opts
+++ b/contrib/ntp/scripts/summary-opts
@@ -1,6 +1,6 @@
# EDIT THIS FILE WITH CAUTION (summary-opts)
#
-# It has been AutoGen-ed January 7, 2016 at 11:27:14 PM by AutoGen 5.18.5
+# It has been AutoGen-ed January 20, 2016 at 04:10:32 AM by AutoGen 5.18.5
# From the definitions summary-opts.def
# and the template file perlopt
@@ -44,7 +44,7 @@ sub processOptions {
'help|?', 'more-help'));
$usage = <<'USAGE';
-summary - compute various stastics from NTP stat files - Ver. 4.2.8p5
+summary - compute various stastics from NTP stat files - Ver. 4.2.8p6
USAGE: summary [ -<flag> [<val>] | --<name>[{=| }<val>] ]...
--directory=str Directory containing stat files
diff --git a/contrib/ntp/scripts/summary.1summaryman b/contrib/ntp/scripts/summary.1summaryman
index 0573b11..fd5d8d2 100644
--- a/contrib/ntp/scripts/summary.1summaryman
+++ b/contrib/ntp/scripts/summary.1summaryman
@@ -10,11 +10,11 @@
.ds B-Font B
.ds I-Font I
.ds R-Font R
-.TH summary 1summaryman "07 Jan 2016" "ntp (4.2.8p5)" "User Commands"
+.TH summary 1summaryman "20 Jan 2016" "ntp (4.2.8p6)" "User Commands"
.\"
-.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-.Ca4Xm/ag-lDaaXm)
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-z8aWPN/ag-M8a4ON)
.\"
-.\" It has been AutoGen-ed January 7, 2016 at 11:27:24 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed January 20, 2016 at 04:10:42 AM by AutoGen 5.18.5
.\" From the definitions summary-opts.def
.\" and the template file agman-cmd.tpl
.SH NAME
diff --git a/contrib/ntp/scripts/summary.1summarymdoc b/contrib/ntp/scripts/summary.1summarymdoc
index 5e28a57..f6fd0c1 100644
--- a/contrib/ntp/scripts/summary.1summarymdoc
+++ b/contrib/ntp/scripts/summary.1summarymdoc
@@ -1,9 +1,9 @@
-.Dd January 7 2016
+.Dd January 20 2016
.Dt SUMMARY 1summarymdoc User Commands
.Os
.\" EDIT THIS FILE WITH CAUTION (summary-opts.mdoc)
.\"
-.\" It has been AutoGen-ed January 7, 2016 at 11:27:25 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed January 20, 2016 at 04:10:44 AM by AutoGen 5.18.5
.\" From the definitions summary-opts.def
.\" and the template file agmdoc-cmd.tpl
.Sh NAME
diff --git a/contrib/ntp/scripts/summary.html b/contrib/ntp/scripts/summary.html
index 566531e..d9c57e9 100644
--- a/contrib/ntp/scripts/summary.html
+++ b/contrib/ntp/scripts/summary.html
@@ -31,7 +31,7 @@ Up:&nbsp;<a rel="up" accesskey="u" href="#dir">(dir)</a>
<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.8p5 of <code>summary</code>.
+This document applies to version 4.2.8p6 of <code>summary</code>.
<div class="shortcontents">
<h2>Short Contents</h2>
@@ -88,7 +88,7 @@ the usage text by passing it through a pager program.
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.8p5
+<pre class="example">summary - compute various stastics from NTP stat files - Ver. 4.2.8p6
USAGE: summary [ -&lt;flag&gt; [&lt;val&gt;] | --&lt;name&gt;[{=| }&lt;val&gt;] ]...
--directory=str Directory containing stat files
diff --git a/contrib/ntp/scripts/summary.man.in b/contrib/ntp/scripts/summary.man.in
index 0573b11..fd5d8d2 100644
--- a/contrib/ntp/scripts/summary.man.in
+++ b/contrib/ntp/scripts/summary.man.in
@@ -10,11 +10,11 @@
.ds B-Font B
.ds I-Font I
.ds R-Font R
-.TH summary 1summaryman "07 Jan 2016" "ntp (4.2.8p5)" "User Commands"
+.TH summary 1summaryman "20 Jan 2016" "ntp (4.2.8p6)" "User Commands"
.\"
-.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-.Ca4Xm/ag-lDaaXm)
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-z8aWPN/ag-M8a4ON)
.\"
-.\" It has been AutoGen-ed January 7, 2016 at 11:27:24 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed January 20, 2016 at 04:10:42 AM by AutoGen 5.18.5
.\" From the definitions summary-opts.def
.\" and the template file agman-cmd.tpl
.SH NAME
diff --git a/contrib/ntp/scripts/summary.mdoc.in b/contrib/ntp/scripts/summary.mdoc.in
index 5e28a57..f6fd0c1 100644
--- a/contrib/ntp/scripts/summary.mdoc.in
+++ b/contrib/ntp/scripts/summary.mdoc.in
@@ -1,9 +1,9 @@
-.Dd January 7 2016
+.Dd January 20 2016
.Dt SUMMARY 1summarymdoc User Commands
.Os
.\" EDIT THIS FILE WITH CAUTION (summary-opts.mdoc)
.\"
-.\" It has been AutoGen-ed January 7, 2016 at 11:27:25 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed January 20, 2016 at 04:10:44 AM by AutoGen 5.18.5
.\" From the definitions summary-opts.def
.\" and the template file agmdoc-cmd.tpl
.Sh NAME
diff --git a/contrib/ntp/scripts/update-leap/invoke-update-leap.texi b/contrib/ntp/scripts/update-leap/invoke-update-leap.texi
index 4231979..a3aa6b4 100644
--- a/contrib/ntp/scripts/update-leap/invoke-update-leap.texi
+++ b/contrib/ntp/scripts/update-leap/invoke-update-leap.texi
@@ -6,7 +6,7 @@
#
# EDIT THIS FILE WITH CAUTION (invoke-update-leap.texi)
#
-# It has been AutoGen-ed January 7, 2016 at 11:27:05 PM by AutoGen 5.18.5
+# It has been AutoGen-ed January 20, 2016 at 04:10:24 AM by AutoGen 5.18.5
# From the definitions update-leap-opts.def
# and the template file agtexi-cmd.tpl
@end ignore
diff --git a/contrib/ntp/scripts/update-leap/update-leap-opts b/contrib/ntp/scripts/update-leap/update-leap-opts
index 506a746..8b9827e 100644
--- a/contrib/ntp/scripts/update-leap/update-leap-opts
+++ b/contrib/ntp/scripts/update-leap/update-leap-opts
@@ -1,6 +1,6 @@
# EDIT THIS FILE WITH CAUTION (update-leap-opts)
#
-# It has been AutoGen-ed January 7, 2016 at 11:27:11 PM by AutoGen 5.18.5
+# It has been AutoGen-ed January 20, 2016 at 04:10:30 AM by AutoGen 5.18.5
# From the definitions update-leap-opts.def
# and the template file perlopt
@@ -46,7 +46,7 @@ sub processOptions {
'help|?', 'more-help'));
$usage = <<'USAGE';
-update-leap - leap-seconds file manager/updater - Ver. 4.2.8p5
+update-leap - leap-seconds file manager/updater - Ver. 4.2.8p6
USAGE: update-leap [ -<flag> [<val>] | --<name>[{=| }<val>] ]...
-s, --source-url=str The URL of the master copy of the leapseconds file
diff --git a/contrib/ntp/scripts/update-leap/update-leap.1update-leapman b/contrib/ntp/scripts/update-leap/update-leap.1update-leapman
index 4fdf467..891a2ab 100644
--- a/contrib/ntp/scripts/update-leap/update-leap.1update-leapman
+++ b/contrib/ntp/scripts/update-leap/update-leap.1update-leapman
@@ -10,11 +10,11 @@
.ds B-Font B
.ds I-Font I
.ds R-Font R
-.TH update-leap 1update-leapman "07 Jan 2016" "ntp (4.2.8p5)" "User Commands"
+.TH update-leap 1update-leapman "20 Jan 2016" "ntp (4.2.8p6)" "User Commands"
.\"
-.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-9hayKk/ag-kiaGJk)
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-iOaqCL/ag-uOayBL)
.\"
-.\" It has been AutoGen-ed January 7, 2016 at 11:27:02 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed January 20, 2016 at 04:10:20 AM by AutoGen 5.18.5
.\" From the definitions update-leap-opts.def
.\" and the template file agman-cmd.tpl
.SH NAME
diff --git a/contrib/ntp/scripts/update-leap/update-leap.1update-leapmdoc b/contrib/ntp/scripts/update-leap/update-leap.1update-leapmdoc
index 8827df7..1212586 100644
--- a/contrib/ntp/scripts/update-leap/update-leap.1update-leapmdoc
+++ b/contrib/ntp/scripts/update-leap/update-leap.1update-leapmdoc
@@ -1,9 +1,9 @@
-.Dd January 7 2016
+.Dd January 20 2016
.Dt UPDATE_LEAP 1update-leapmdoc User Commands
.Os
.\" EDIT THIS FILE WITH CAUTION (update-leap-opts.mdoc)
.\"
-.\" It has been AutoGen-ed January 7, 2016 at 11:27:10 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed January 20, 2016 at 04:10:28 AM by AutoGen 5.18.5
.\" From the definitions update-leap-opts.def
.\" and the template file agmdoc-cmd.tpl
.Sh NAME
diff --git a/contrib/ntp/scripts/update-leap/update-leap.html b/contrib/ntp/scripts/update-leap/update-leap.html
index a7d2a70..6013b1e 100644
--- a/contrib/ntp/scripts/update-leap/update-leap.html
+++ b/contrib/ntp/scripts/update-leap/update-leap.html
@@ -30,7 +30,7 @@ Up:&nbsp;<a rel="up" accesskey="u" href="#dir">(dir)</a>
<p>This document describes the use of the NTP Project's <code>update-leap</code> program.
- <p>This document applies to version 4.2.8p5 of <code>update-leap</code>.
+ <p>This document applies to version 4.2.8p6 of <code>update-leap</code>.
<div class="shortcontents">
<h2>Short Contents</h2>
diff --git a/contrib/ntp/scripts/update-leap/update-leap.man.in b/contrib/ntp/scripts/update-leap/update-leap.man.in
index 4fdf467..891a2ab 100644
--- a/contrib/ntp/scripts/update-leap/update-leap.man.in
+++ b/contrib/ntp/scripts/update-leap/update-leap.man.in
@@ -10,11 +10,11 @@
.ds B-Font B
.ds I-Font I
.ds R-Font R
-.TH update-leap 1update-leapman "07 Jan 2016" "ntp (4.2.8p5)" "User Commands"
+.TH update-leap 1update-leapman "20 Jan 2016" "ntp (4.2.8p6)" "User Commands"
.\"
-.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-9hayKk/ag-kiaGJk)
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-iOaqCL/ag-uOayBL)
.\"
-.\" It has been AutoGen-ed January 7, 2016 at 11:27:02 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed January 20, 2016 at 04:10:20 AM by AutoGen 5.18.5
.\" From the definitions update-leap-opts.def
.\" and the template file agman-cmd.tpl
.SH NAME
diff --git a/contrib/ntp/scripts/update-leap/update-leap.mdoc.in b/contrib/ntp/scripts/update-leap/update-leap.mdoc.in
index 8827df7..1212586 100644
--- a/contrib/ntp/scripts/update-leap/update-leap.mdoc.in
+++ b/contrib/ntp/scripts/update-leap/update-leap.mdoc.in
@@ -1,9 +1,9 @@
-.Dd January 7 2016
+.Dd January 20 2016
.Dt UPDATE_LEAP 1update-leapmdoc User Commands
.Os
.\" EDIT THIS FILE WITH CAUTION (update-leap-opts.mdoc)
.\"
-.\" It has been AutoGen-ed January 7, 2016 at 11:27:10 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed January 20, 2016 at 04:10:28 AM by AutoGen 5.18.5
.\" From the definitions update-leap-opts.def
.\" and the template file agmdoc-cmd.tpl
.Sh NAME
diff --git a/contrib/ntp/sntp/configure b/contrib/ntp/sntp/configure
index ce397ef..b4ce6de 100755
--- a/contrib/ntp/sntp/configure
+++ b/contrib/ntp/sntp/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for sntp 4.2.8p5.
+# Generated by GNU Autoconf 2.69 for sntp 4.2.8p6.
#
# Report bugs to <http://bugs.ntp.org./>.
#
@@ -590,8 +590,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='sntp'
PACKAGE_TARNAME='sntp'
-PACKAGE_VERSION='4.2.8p5'
-PACKAGE_STRING='sntp 4.2.8p5'
+PACKAGE_VERSION='4.2.8p6'
+PACKAGE_STRING='sntp 4.2.8p6'
PACKAGE_BUGREPORT='http://bugs.ntp.org./'
PACKAGE_URL='http://www.ntp.org./'
@@ -1491,7 +1491,7 @@ if test "$ac_init_help" = "long"; then
# 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.8p5 to adapt to many kinds of systems.
+\`configure' configures sntp 4.2.8p6 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1561,7 +1561,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of sntp 4.2.8p5:";;
+ short | recursive ) echo "Configuration of sntp 4.2.8p6:";;
esac
cat <<\_ACEOF
@@ -1706,7 +1706,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-sntp configure 4.2.8p5
+sntp configure 4.2.8p6
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2536,7 +2536,7 @@ cat >config.log <<_ACEOF
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.8p5, which was
+It was created by sntp $as_me 4.2.8p6, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -3533,7 +3533,7 @@ fi
# Define the identity of the package.
PACKAGE='sntp'
- VERSION='4.2.8p5'
+ VERSION='4.2.8p6'
cat >>confdefs.h <<_ACEOF
@@ -31110,7 +31110,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# 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.8p5, which was
+This file was extended by sntp $as_me 4.2.8p6, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -31177,7 +31177,7 @@ _ACEOF
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.8p5
+sntp config.status 4.2.8p6
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
diff --git a/contrib/ntp/sntp/crypto.c b/contrib/ntp/sntp/crypto.c
index b178f8c..234e137 100644
--- a/contrib/ntp/sntp/crypto.c
+++ b/contrib/ntp/sntp/crypto.c
@@ -7,11 +7,11 @@ size_t key_cnt = 0;
int
make_mac(
- char *pkt_data,
+ const void *pkt_data,
int pkt_size,
int mac_size,
- struct key *cmp_key,
- char * digest
+ const struct key *cmp_key,
+ void * digest
)
{
u_int len = mac_size;
@@ -26,39 +26,40 @@ make_mac(
INIT_SSL();
key_type = keytype_from_text(cmp_key->type, NULL);
EVP_DigestInit(&ctx, EVP_get_digestbynid(key_type));
- EVP_DigestUpdate(&ctx, (u_char *)cmp_key->key_seq, (u_int)cmp_key->key_len);
- EVP_DigestUpdate(&ctx, (u_char *)pkt_data, (u_int)pkt_size);
- EVP_DigestFinal(&ctx, (u_char *)digest, &len);
+ EVP_DigestUpdate(&ctx, (const u_char *)cmp_key->key_seq, (u_int)cmp_key->key_len);
+ EVP_DigestUpdate(&ctx, pkt_data, (u_int)pkt_size);
+ EVP_DigestFinal(&ctx, digest, &len);
return (int)len;
}
-/* Generates a md5 digest of the key specified in keyid concatinated with the
+/* Generates a md5 digest of the key specified in keyid concatenated with the
* ntp packet (exluding the MAC) and compares this digest to the digest in
* the packet's MAC. If they're equal this function returns 1 (packet is
* authentic) or else 0 (not authentic).
*/
int
auth_md5(
- char *pkt_data,
+ const void *pkt_data,
int pkt_size,
int mac_size,
- struct key *cmp_key
+ const struct key *cmp_key
)
{
int hash_len;
int authentic;
char digest[20];
-
+ const u_char *pkt_ptr;
if (mac_size > (int)sizeof(digest))
return 0;
- hash_len = make_mac(pkt_data, pkt_size, sizeof(digest), cmp_key,
+ pkt_ptr = pkt_data;
+ hash_len = make_mac(pkt_ptr, pkt_size, sizeof(digest), cmp_key,
digest);
if (!hash_len)
authentic = FALSE;
else
- authentic = !memcmp(digest, pkt_data + pkt_size + 4,
+ authentic = !memcmp(digest, pkt_ptr + pkt_size + 4,
hash_len);
return authentic;
}
diff --git a/contrib/ntp/sntp/crypto.h b/contrib/ntp/sntp/crypto.h
index 39e0e6b..19cdbc4 100644
--- a/contrib/ntp/sntp/crypto.h
+++ b/contrib/ntp/sntp/crypto.h
@@ -17,16 +17,18 @@
/* #include "sntp-opts.h" */
struct key {
- struct key *next;
- int key_id;
- int key_len;
- char type[10];
- char key_seq[64];
+ struct key * next;
+ int key_id;
+ int key_len;
+ char type[10];
+ char key_seq[64];
};
-int auth_init(const char *keyfile, struct key **keys);
-void get_key(int key_id, struct key **d_key);
-int make_mac(char *pkt_data, int pkt_size, int mac_size, struct key *cmp_key, char *digest);
-int auth_md5(char *pkt_data, int pkt_size, int mac_size, struct key *cmp_key);
+extern int auth_init(const char *keyfile, struct key **keys);
+extern void get_key(int key_id, struct key **d_key);
+extern int make_mac(const void *pkt_data, int pkt_size, int mac_size,
+ const struct key *cmp_key, void *digest);
+extern int auth_md5(const void *pkt_data, int pkt_size, int mac_size,
+ const struct key *cmp_key);
#endif
diff --git a/contrib/ntp/sntp/include/copyright.def b/contrib/ntp/sntp/include/copyright.def
index 1cc7ad2..4fb4461 100644
--- a/contrib/ntp/sntp/include/copyright.def
+++ b/contrib/ntp/sntp/include/copyright.def
@@ -1,7 +1,7 @@
/* -*- Mode: Text -*- */
copyright = {
- date = "1992-2015";
+ date = "1992-2016";
owner = "The University of Delaware and Network Time Foundation";
eaddr = "http://bugs.ntp.org, bugs@ntp.org";
type = ntp;
diff --git a/contrib/ntp/sntp/include/version.def b/contrib/ntp/sntp/include/version.def
index ddc02d4..5a08174 100644
--- a/contrib/ntp/sntp/include/version.def
+++ b/contrib/ntp/sntp/include/version.def
@@ -1 +1 @@
-version = '4.2.8p5';
+version = '4.2.8p6';
diff --git a/contrib/ntp/sntp/include/version.texi b/contrib/ntp/sntp/include/version.texi
index 28b9357..fa9aeb3 100644
--- a/contrib/ntp/sntp/include/version.texi
+++ b/contrib/ntp/sntp/include/version.texi
@@ -1,3 +1,3 @@
-@set UPDATED 07 January 2016
-@set EDITION 4.2.8p5
-@set VERSION 4.2.8p5
+@set UPDATED 20 January 2016
+@set EDITION 4.2.8p6
+@set VERSION 4.2.8p6
diff --git a/contrib/ntp/sntp/invoke-sntp.texi b/contrib/ntp/sntp/invoke-sntp.texi
index 6ca3b06..695c9eb 100644
--- a/contrib/ntp/sntp/invoke-sntp.texi
+++ b/contrib/ntp/sntp/invoke-sntp.texi
@@ -6,7 +6,7 @@
#
# EDIT THIS FILE WITH CAUTION (invoke-sntp.texi)
#
-# It has been AutoGen-ed January 7, 2016 at 11:23:24 PM by AutoGen 5.18.5
+# It has been AutoGen-ed January 20, 2016 at 04:06:42 AM by AutoGen 5.18.5
# From the definitions sntp-opts.def
# and the template file agtexi-cmd.tpl
@end ignore
@@ -101,7 +101,7 @@ with a status code of 0.
@exampleindent 0
@example
-sntp - standard Simple Network Time Protocol client program - Ver. 4.2.8p5
+sntp - standard Simple Network Time Protocol client program - Ver. 4.2.8p6
Usage: sntp [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]... \
[ hostname-or-IP ...]
Flg Arg Option-Name Description
diff --git a/contrib/ntp/sntp/libopts/configfile.c b/contrib/ntp/sntp/libopts/configfile.c
index 03156ca..8244371e 100644
--- a/contrib/ntp/sntp/libopts/configfile.c
+++ b/contrib/ntp/sntp/libopts/configfile.c
@@ -182,9 +182,9 @@ optionFindValue(const tOptDesc * odesc, char const * name, char const * val)
}
else do {
- tArgList * argl = odesc->optCookie;
- int argct = argl->useCt;
- void ** poptv = (void **)(argl->apzArgs);
+ tArgList * argl = odesc->optCookie;
+ int argct = argl->useCt;
+ const void ** poptv = VOIDP(argl->apzArgs);
if (argct == 0) {
errno = ENOENT;
@@ -192,7 +192,7 @@ optionFindValue(const tOptDesc * odesc, char const * name, char const * val)
}
if (name == NULL) {
- res = (tOptionValue *)*poptv;
+ res = (const tOptionValue *)*poptv;
break;
}
@@ -249,7 +249,7 @@ optionFindNextValue(const tOptDesc * odesc, const tOptionValue * pPrevVal,
char const * pzName, char const * pzVal)
{
bool old_found = false;
- tOptionValue * res = NULL;
+ const tOptionValue * res = NULL;
(void)pzName;
(void)pzVal;
@@ -264,12 +264,12 @@ optionFindNextValue(const tOptDesc * odesc, const tOptionValue * pPrevVal,
}
else do {
- tArgList * argl = odesc->optCookie;
- int ct = argl->useCt;
- void ** poptv = (void **)argl->apzArgs;
+ tArgList * argl = odesc->optCookie;
+ int ct = argl->useCt;
+ const void ** poptv = VOIDP(argl->apzArgs);
while (--ct >= 0) {
- tOptionValue * pOV = *(poptv++);
+ const tOptionValue * pOV = *(poptv++);
if (old_found) {
res = pOV;
break;
@@ -315,8 +315,8 @@ optionFindNextValue(const tOptDesc * odesc, const tOptionValue * pPrevVal,
tOptionValue const *
optionGetValue(tOptionValue const * oov, char const * vname)
{
- tArgList * arg_list;
- tOptionValue * res = NULL;
+ tArgList * arg_list;
+ const tOptionValue * res = NULL;
if ((oov == NULL) || (oov->valType != OPARG_TYPE_HIERARCHY)) {
errno = EINVAL;
@@ -325,14 +325,14 @@ optionGetValue(tOptionValue const * oov, char const * vname)
arg_list = oov->v.nestVal;
if (arg_list->useCt > 0) {
- int ct = arg_list->useCt;
- void ** ovlist = (void **)(arg_list->apzArgs);
+ int ct = arg_list->useCt;
+ const void ** ovlist = VOIDP(arg_list->apzArgs);
if (vname == NULL) {
- res = (tOptionValue *)*ovlist;
+ res = (const tOptionValue *)*ovlist;
} else do {
- tOptionValue * opt_val = *(ovlist++);
+ const tOptionValue * opt_val = *(ovlist++);
if (strcmp(opt_val->pzName, vname) == 0) {
res = opt_val;
break;
@@ -374,9 +374,9 @@ optionGetValue(tOptionValue const * oov, char const * vname)
tOptionValue const *
optionNextValue(tOptionValue const * ov_list,tOptionValue const * oov )
{
- tArgList * arg_list;
- tOptionValue * res = NULL;
- int err = EINVAL;
+ tArgList * arg_list;
+ const tOptionValue * res = NULL;
+ int err = EINVAL;
if ((ov_list == NULL) || (ov_list->valType != OPARG_TYPE_HIERARCHY)) {
errno = EINVAL;
@@ -384,18 +384,18 @@ optionNextValue(tOptionValue const * ov_list,tOptionValue const * oov )
}
arg_list = ov_list->v.nestVal;
{
- int ct = arg_list->useCt;
- void ** o_list = (void **)(arg_list->apzArgs);
+ int ct = arg_list->useCt;
+ const void ** o_list = VOIDP(arg_list->apzArgs);
while (ct-- > 0) {
- tOptionValue * nov = *(o_list++);
+ const tOptionValue * nov = *(o_list++);
if (nov == oov) {
if (ct == 0) {
err = ENOENT;
} else {
err = 0;
- res = (tOptionValue *)*o_list;
+ res = (const tOptionValue *)*o_list;
}
break;
}
diff --git a/contrib/ntp/sntp/libopts/enum.c b/contrib/ntp/sntp/libopts/enum.c
index 3345558..e9bba83 100644
--- a/contrib/ntp/sntp/libopts/enum.c
+++ b/contrib/ntp/sntp/libopts/enum.c
@@ -189,12 +189,12 @@ find_name(char const * name, tOptions * pOpts, tOptDesc * pOD,
* The result gets stashed in a char * pointer.
*/
uintptr_t res = name_ct;
- size_t len = strlen((char *)name);
+ size_t len = strlen(name);
uintptr_t idx;
if (IS_DEC_DIGIT_CHAR(*name)) {
- char * pz = VOIDP(name);
- unsigned long val = strtoul(pz, &pz, 0);
+ char * pz;
+ unsigned long val = strtoul(name, &pz, 0);
if ((*pz == NUL) && (val < name_ct))
return (uintptr_t)val;
pz_enum_err_fmt = znum_too_large;
@@ -215,7 +215,7 @@ find_name(char const * name, tOptions * pOpts, tOptDesc * pOD,
* Multiple partial matches means we have an ambiguous match.
*/
for (idx = 0; idx < name_ct; idx++) {
- if (strncmp((char *)paz_names[idx], (char *)name, len) == 0) {
+ if (strncmp(paz_names[idx], name, len) == 0) {
if (paz_names[idx][len] == NUL)
return idx; /* full match */
@@ -500,7 +500,7 @@ find_member_bit(tOptions * opts, tOptDesc * od, char const * pz, int len,
if (shift_ct >= nm_ct)
return 0UL;
- return 1UL << shift_ct;
+ return (uintptr_t)1U << shift_ct;
}
}
diff --git a/contrib/ntp/sntp/libopts/find.c b/contrib/ntp/sntp/libopts/find.c
index 90591cc..97a24df 100644
--- a/contrib/ntp/sntp/libopts/find.c
+++ b/contrib/ntp/sntp/libopts/find.c
@@ -80,7 +80,7 @@ parse_opt(char const ** nm_pp, char ** arg_pp, char * buf, size_t bufsz)
buf[res] = NUL;
*nm_pp = buf;
- *arg_pp = (char *)p;
+ *arg_pp = VOIDP(p);
return res;
default:
diff --git a/contrib/ntp/sntp/libopts/init.c b/contrib/ntp/sntp/libopts/init.c
index e02e1e1..81d4eee 100644
--- a/contrib/ntp/sntp/libopts/init.c
+++ b/contrib/ntp/sntp/libopts/init.c
@@ -97,15 +97,14 @@ validate_struct(tOptions * opts, char const * pname)
*/
if (opts->pzProgName == NULL) {
char const * pz = strrchr(pname, DIRCH);
- char const ** pp =
- (char const **)(void **)&(opts->pzProgName);
+ char const ** pp = VOIDP(&(opts->pzProgName));
if (pz != NULL)
*pp = pz+1;
else
*pp = pname;
- pz = pathfind(getenv("PATH"), (char *)pname, "rx");
+ pz = pathfind(getenv("PATH"), pname, "rx");
if (pz != NULL)
pname = VOIDP(pz);
diff --git a/contrib/ntp/sntp/libopts/load.c b/contrib/ntp/sntp/libopts/load.c
index b5230af..ccda5b4 100644
--- a/contrib/ntp/sntp/libopts/load.c
+++ b/contrib/ntp/sntp/libopts/load.c
@@ -225,7 +225,7 @@ add_prog_path(char * buf, int b_sz, char const * fname, char const * prg_path)
if (strchr(prg_path, DIRCH) != NULL)
path = prg_path;
else {
- path = pathfind(getenv("PATH"), (char *)prg_path, "rx");
+ path = pathfind(getenv("PATH"), prg_path, "rx");
if (path == NULL)
return false;
diff --git a/contrib/ntp/sntp/libopts/makeshell.c b/contrib/ntp/sntp/libopts/makeshell.c
index a61df42..fbe8e17 100644
--- a/contrib/ntp/sntp/libopts/makeshell.c
+++ b/contrib/ntp/sntp/libopts/makeshell.c
@@ -401,7 +401,7 @@ emit_usage(tOptions * opts)
/* Copy the program name into the time/name buffer */
for (;;) {
- if ((*pzPN++ = (char)tolower(*pz++)) == NUL)
+ if ((*pzPN++ = (char)tolower((unsigned char)*pz++)) == NUL)
break;
}
@@ -671,8 +671,8 @@ emit_match_expr(char const * name, tOptDesc * cod, tOptions * opts)
continue;
match_ct = 0;
- while ( toupper(od->pz_DisableName[match_ct])
- == toupper(name[match_ct]))
+ while ( toupper((unsigned char)od->pz_DisableName[match_ct])
+ == toupper((unsigned char)name[match_ct]))
match_ct++;
if (match_ct > min_match_ct)
min_match_ct = match_ct;
diff --git a/contrib/ntp/sntp/libopts/nested.c b/contrib/ntp/sntp/libopts/nested.c
index f4fb226..aaf089f 100644
--- a/contrib/ntp/sntp/libopts/nested.c
+++ b/contrib/ntp/sntp/libopts/nested.c
@@ -859,6 +859,7 @@ LOCAL int
get_special_char(char const ** ppz, int * ct)
{
char const * pz = *ppz;
+ char * rz;
if (*ct < 3)
return '&';
@@ -872,7 +873,8 @@ get_special_char(char const ** ppz, int * ct)
base = 16;
pz++;
}
- retch = (int)strtoul(pz, (char **)&pz, base);
+ retch = (int)strtoul(pz, &rz, base);
+ pz = rz;
if (*pz != ';')
return '&';
base = (int)(++pz - *ppz);
diff --git a/contrib/ntp/sntp/libopts/parse-duration.c b/contrib/ntp/sntp/libopts/parse-duration.c
index e072b7d..11e3d828 100644
--- a/contrib/ntp/sntp/libopts/parse-duration.c
+++ b/contrib/ntp/sntp/libopts/parse-duration.c
@@ -60,14 +60,20 @@ typedef enum {
static unsigned long
str_const_to_ul (cch_t * str, cch_t ** ppz, int base)
{
- return strtoul (str, (char **)ppz, base);
+ char * pz;
+ int rv = strtoul (str, &pz, base);
+ *ppz = pz;
+ return rv;
}
/* Wrapper around strtol that does not require a cast. */
static long
str_const_to_l (cch_t * str, cch_t ** ppz, int base)
{
- return strtol (str, (char **)ppz, base);
+ char * pz;
+ int rv = strtol (str, &pz, base);
+ *ppz = pz;
+ return rv;
}
/* Returns BASE + VAL * SCALE, interpreting BASE = BAD_TIME
diff --git a/contrib/ntp/sntp/libopts/reset.c b/contrib/ntp/sntp/libopts/reset.c
index 6ca2c05..97ecb52 100644
--- a/contrib/ntp/sntp/libopts/reset.c
+++ b/contrib/ntp/sntp/libopts/reset.c
@@ -113,7 +113,7 @@ optionResetOpt(tOptions * pOpts, tOptDesc * pOD)
assert(0 == 1);
}
} else {
- succ = opt_find_long(pOpts, (char *)pzArg, &opt_state);
+ succ = opt_find_long(pOpts, pzArg, &opt_state);
if (! SUCCESSFUL(succ)) {
fprintf(stderr, zIllOptStr, pOpts->pzProgPath, pzArg);
pOpts->pUsageProc(pOpts, EXIT_FAILURE);
diff --git a/contrib/ntp/sntp/libopts/save.c b/contrib/ntp/sntp/libopts/save.c
index f462ced..cdab05f 100644
--- a/contrib/ntp/sntp/libopts/save.c
+++ b/contrib/ntp/sntp/libopts/save.c
@@ -453,7 +453,7 @@ prt_val_list(FILE * fp, char const * name, tArgList * al)
if (al == NULL)
return;
opt_ct = al->useCt;
- opt_list = (void **)al->apzArgs;
+ opt_list = VOIDP(al->apzArgs);
if (opt_ct <= 0) {
fprintf(fp, OPEN_CLOSE_FMT, name);
@@ -488,7 +488,7 @@ prt_nested(FILE * fp, tOptDesc * p)
return;
opt_ct = al->useCt;
- opt_list = (void **)al->apzArgs;
+ opt_list = VOIDP(al->apzArgs);
if (opt_ct <= 0)
return;
diff --git a/contrib/ntp/sntp/libopts/tokenize.c b/contrib/ntp/sntp/libopts/tokenize.c
index cbff7fb..25550ea 100644
--- a/contrib/ntp/sntp/libopts/tokenize.c
+++ b/contrib/ntp/sntp/libopts/tokenize.c
@@ -57,7 +57,7 @@ copy_cooked(ch_t ** ppDest, char const ** ppSrc)
case NUL: *ppSrc = NULL; return;
case '"': goto done;
case '\\':
- pSrc += ao_string_cook_escape_char((char *)pSrc, (char *)&ch, 0x7F);
+ pSrc += ao_string_cook_escape_char((const char *)pSrc, (char *)&ch, 0x7F);
if (ch == 0x7F)
break;
/* FALLTHROUGH */
diff --git a/contrib/ntp/sntp/m4/version.m4 b/contrib/ntp/sntp/m4/version.m4
index b8f98b5..236cc18 100644
--- a/contrib/ntp/sntp/m4/version.m4
+++ b/contrib/ntp/sntp/m4/version.m4
@@ -1 +1 @@
-m4_define([VERSION_NUMBER],[4.2.8p5])
+m4_define([VERSION_NUMBER],[4.2.8p6])
diff --git a/contrib/ntp/sntp/main.c b/contrib/ntp/sntp/main.c
index 870db93..78ed7c2 100644
--- a/contrib/ntp/sntp/main.c
+++ b/contrib/ntp/sntp/main.c
@@ -1135,7 +1135,7 @@ generate_pkt (
if (pkt_key != NULL) {
x_pkt->exten[0] = htonl(key_id);
mac_size = 20; /* max room for MAC */
- mac_size = make_mac((char *)x_pkt, pkt_len, mac_size,
+ mac_size = make_mac(x_pkt, pkt_len, mac_size,
pkt_key, (char *)&x_pkt->exten[1]);
if (mac_size > 0)
pkt_len += mac_size + 4;
diff --git a/contrib/ntp/sntp/networking.c b/contrib/ntp/sntp/networking.c
index 6a176c5..21cf09a 100644
--- a/contrib/ntp/sntp/networking.c
+++ b/contrib/ntp/sntp/networking.c
@@ -184,7 +184,7 @@ process_pkt (
** keyfile and compare those md5sums.
*/
mac_size = exten_len << 2;
- if (!auth_md5((char *)rpkt, pkt_len - mac_size,
+ if (!auth_md5(rpkt, pkt_len - mac_size,
mac_size - 4, pkt_key)) {
is_authentic = FALSE;
break;
diff --git a/contrib/ntp/sntp/sntp-opts.c b/contrib/ntp/sntp/sntp-opts.c
index 69fb786..d11f0b2 100644
--- a/contrib/ntp/sntp/sntp-opts.c
+++ b/contrib/ntp/sntp/sntp-opts.c
@@ -1,7 +1,7 @@
/*
* EDIT THIS FILE WITH CAUTION (sntp-opts.c)
*
- * It has been AutoGen-ed January 7, 2016 at 11:22:49 PM by AutoGen 5.18.5
+ * It has been AutoGen-ed January 20, 2016 at 04:06:07 AM by AutoGen 5.18.5
* From the definitions sntp-opts.def
* and the template file options
*
@@ -18,7 +18,7 @@
* The sntp program is copyrighted and licensed
* under the following terms:
*
- * Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation, all rights reserved.
+ * Copyright (C) 1992-2016 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:
@@ -70,8 +70,8 @@ extern FILE * option_usage_fp;
* static const strings for sntp options
*/
static char const sntp_opt_strs[2549] =
-/* 0 */ "sntp 4.2.8p5\n"
- "Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation, all rights reserved.\n"
+/* 0 */ "sntp 4.2.8p6\n"
+ "Copyright (C) 1992-2016 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"
@@ -155,7 +155,7 @@ static char const sntp_opt_strs[2549] =
/* 2298 */ "LOAD_OPTS\0"
/* 2308 */ "no-load-opts\0"
/* 2321 */ "SNTP\0"
-/* 2326 */ "sntp - standard Simple Network Time Protocol client program - Ver. 4.2.8p5\n"
+/* 2326 */ "sntp - standard Simple Network Time Protocol client program - Ver. 4.2.8p6\n"
"Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... \\\n"
"\t\t[ hostname-or-IP ...]\n\0"
/* 2485 */ "$HOME\0"
@@ -163,7 +163,7 @@ static char const sntp_opt_strs[2549] =
/* 2493 */ ".ntprc\0"
/* 2500 */ "http://bugs.ntp.org, bugs@ntp.org\0"
/* 2534 */ "\n\0"
-/* 2536 */ "sntp 4.2.8p5";
+/* 2536 */ "sntp 4.2.8p6";
/**
* ipv4 option description with
@@ -1173,8 +1173,8 @@ static void bogus_function(void) {
translate option names.
*/
/* referenced via sntpOptions.pzCopyright */
- puts(_("sntp 4.2.8p5\n\
-Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation, all rights reserved.\n\
+ puts(_("sntp 4.2.8p6\n\
+Copyright (C) 1992-2016 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"));
@@ -1263,7 +1263,7 @@ implied warranty.\n"));
puts(_("load options from a config file"));
/* referenced via sntpOptions.pzUsageTitle */
- puts(_("sntp - standard Simple Network Time Protocol client program - Ver. 4.2.8p5\n\
+ puts(_("sntp - standard Simple Network Time Protocol client program - Ver. 4.2.8p6\n\
Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... \\\n\
\t\t[ hostname-or-IP ...]\n"));
@@ -1271,7 +1271,7 @@ Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... \\\n\
puts(_("\n"));
/* referenced via sntpOptions.pzFullVersion */
- puts(_("sntp 4.2.8p5"));
+ puts(_("sntp 4.2.8p6"));
/* referenced via sntpOptions.pzFullUsage */
puts(_("<<<NOT-FOUND>>>"));
diff --git a/contrib/ntp/sntp/sntp-opts.h b/contrib/ntp/sntp/sntp-opts.h
index 78951ab..ab741c7 100644
--- a/contrib/ntp/sntp/sntp-opts.h
+++ b/contrib/ntp/sntp/sntp-opts.h
@@ -1,7 +1,7 @@
/*
* EDIT THIS FILE WITH CAUTION (sntp-opts.h)
*
- * It has been AutoGen-ed January 7, 2016 at 11:22:48 PM by AutoGen 5.18.5
+ * It has been AutoGen-ed January 20, 2016 at 04:06:06 AM by AutoGen 5.18.5
* From the definitions sntp-opts.def
* and the template file options
*
@@ -18,7 +18,7 @@
* The sntp program is copyrighted and licensed
* under the following terms:
*
- * Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation, all rights reserved.
+ * Copyright (C) 1992-2016 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:
@@ -91,9 +91,9 @@ typedef enum {
/** count of all options for sntp */
#define OPTION_CT 23
/** sntp version */
-#define SNTP_VERSION "4.2.8p5"
+#define SNTP_VERSION "4.2.8p6"
/** Full sntp version text */
-#define SNTP_FULL_VERSION "sntp 4.2.8p5"
+#define SNTP_FULL_VERSION "sntp 4.2.8p6"
/**
* Interface defines for all options. Replace "n" with the UPPER_CASED
diff --git a/contrib/ntp/sntp/sntp.1sntpman b/contrib/ntp/sntp/sntp.1sntpman
index 792fc52..0a83bd3 100644
--- a/contrib/ntp/sntp/sntp.1sntpman
+++ b/contrib/ntp/sntp/sntp.1sntpman
@@ -10,11 +10,11 @@
.ds B-Font B
.ds I-Font I
.ds R-Font R
-.TH sntp 1sntpman "07 Jan 2016" "4.2.8p5" "User Commands"
+.TH sntp 1sntpman "20 Jan 2016" "4.2.8p6" "User Commands"
.\"
-.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-e.aO3S/ag-r.aG2S)
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-vxaitn/ag-Ixaasn)
.\"
-.\" It has been AutoGen-ed January 7, 2016 at 11:23:20 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed January 20, 2016 at 04:06:38 AM by AutoGen 5.18.5
.\" From the definitions sntp-opts.def
.\" and the template file agman-cmd.tpl
.SH NAME
@@ -348,7 +348,7 @@ it to autogen-users@lists.sourceforge.net. Thank you.
.NOP "Dave Hart"
.br
.SH "COPYRIGHT"
-Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation all rights reserved.
+Copyright (C) 1992-2016 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 --git a/contrib/ntp/sntp/sntp.1sntpmdoc b/contrib/ntp/sntp/sntp.1sntpmdoc
index 8005e9a..86b72ad 100644
--- a/contrib/ntp/sntp/sntp.1sntpmdoc
+++ b/contrib/ntp/sntp/sntp.1sntpmdoc
@@ -1,9 +1,9 @@
-.Dd January 7 2016
+.Dd January 20 2016
.Dt SNTP 1sntpmdoc User Commands
.Os
.\" EDIT THIS FILE WITH CAUTION (sntp-opts.mdoc)
.\"
-.\" It has been AutoGen-ed January 7, 2016 at 11:23:27 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed January 20, 2016 at 04:06:45 AM by AutoGen 5.18.5
.\" From the definitions sntp-opts.def
.\" and the template file agmdoc-cmd.tpl
.Sh NAME
@@ -303,7 +303,7 @@ it to autogen\-users@lists.sourceforge.net. Thank you.
.An "Harlan Stenn"
.An "Dave Hart"
.Sh "COPYRIGHT"
-Copyright (C) 1992\-2015 The University of Delaware and Network Time Foundation all rights reserved.
+Copyright (C) 1992\-2016 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 --git a/contrib/ntp/sntp/sntp.html b/contrib/ntp/sntp/sntp.html
index 6aa66fb..61efd50 100644
--- a/contrib/ntp/sntp/sntp.html
+++ b/contrib/ntp/sntp/sntp.html
@@ -36,7 +36,7 @@ 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 cron job.
- <p>This document applies to version 4.2.8p5 of <code>sntp</code>.
+ <p>This document applies to version 4.2.8p6 of <code>sntp</code>.
<p>The program implements the SNTP protocol as defined by RFC 5905, the NTPv4
IETF specification.
@@ -176,7 +176,7 @@ the usage text by passing it through a pager program.
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.8p5
+<pre class="example">sntp - standard Simple Network Time Protocol client program - Ver. 4.2.8p6
Usage: sntp [ -&lt;flag&gt; [&lt;val&gt;] | --&lt;name&gt;[{=| }&lt;val&gt;] ]... \
[ hostname-or-IP ...]
Flg Arg Option-Name Description
diff --git a/contrib/ntp/sntp/sntp.man.in b/contrib/ntp/sntp/sntp.man.in
index 1d5e571..c223eb5 100644
--- a/contrib/ntp/sntp/sntp.man.in
+++ b/contrib/ntp/sntp/sntp.man.in
@@ -10,11 +10,11 @@
.ds B-Font B
.ds I-Font I
.ds R-Font R
-.TH sntp @SNTP_MS@ "07 Jan 2016" "4.2.8p5" "User Commands"
+.TH sntp @SNTP_MS@ "20 Jan 2016" "4.2.8p6" "User Commands"
.\"
-.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-e.aO3S/ag-r.aG2S)
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-vxaitn/ag-Ixaasn)
.\"
-.\" It has been AutoGen-ed January 7, 2016 at 11:23:20 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed January 20, 2016 at 04:06:38 AM by AutoGen 5.18.5
.\" From the definitions sntp-opts.def
.\" and the template file agman-cmd.tpl
.SH NAME
@@ -348,7 +348,7 @@ it to autogen-users@lists.sourceforge.net. Thank you.
.NOP "Dave Hart"
.br
.SH "COPYRIGHT"
-Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation all rights reserved.
+Copyright (C) 1992-2016 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 --git a/contrib/ntp/sntp/sntp.mdoc.in b/contrib/ntp/sntp/sntp.mdoc.in
index 5168a99..2e15332 100644
--- a/contrib/ntp/sntp/sntp.mdoc.in
+++ b/contrib/ntp/sntp/sntp.mdoc.in
@@ -1,9 +1,9 @@
-.Dd January 7 2016
+.Dd January 20 2016
.Dt SNTP @SNTP_MS@ User Commands
.Os
.\" EDIT THIS FILE WITH CAUTION (sntp-opts.mdoc)
.\"
-.\" It has been AutoGen-ed January 7, 2016 at 11:23:27 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed January 20, 2016 at 04:06:45 AM by AutoGen 5.18.5
.\" From the definitions sntp-opts.def
.\" and the template file agmdoc-cmd.tpl
.Sh NAME
@@ -303,7 +303,7 @@ it to autogen\-users@lists.sourceforge.net. Thank you.
.An "Harlan Stenn"
.An "Dave Hart"
.Sh "COPYRIGHT"
-Copyright (C) 1992\-2015 The University of Delaware and Network Time Foundation all rights reserved.
+Copyright (C) 1992\-2016 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 --git a/contrib/ntp/sntp/tests/crypto.c b/contrib/ntp/sntp/tests/crypto.c
index 82d2859..fb2dc62 100644
--- a/contrib/ntp/sntp/tests/crypto.c
+++ b/contrib/ntp/sntp/tests/crypto.c
@@ -18,8 +18,8 @@ void test_PacketSizeNotMultipleOfFourBytes(void);
void
-test_MakeMd5Mac(void) {
-
+test_MakeMd5Mac(void)
+{
const char* PKT_DATA = "abcdefgh0123";
const int PKT_LEN = strlen(PKT_DATA);
const char* EXPECTED_DIGEST =
@@ -34,15 +34,17 @@ test_MakeMd5Mac(void) {
memcpy(&md5.type, "MD5", 4);
TEST_ASSERT_EQUAL(MD5_LENGTH,
- make_mac((char*)PKT_DATA, PKT_LEN, MD5_LENGTH, &md5, actual));
+ make_mac(PKT_DATA, PKT_LEN, MD5_LENGTH, &md5, actual));
TEST_ASSERT_TRUE(memcmp(EXPECTED_DIGEST, actual, MD5_LENGTH) == 0);
}
void
-test_MakeSHA1Mac(void) {
+test_MakeSHA1Mac(void)
+{
#ifdef OPENSSL
+
const char* PKT_DATA = "abcdefgh0123";
const int PKT_LEN = strlen(PKT_DATA);
const char* EXPECTED_DIGEST =
@@ -58,22 +60,26 @@ test_MakeSHA1Mac(void) {
memcpy(&sha1.type, "SHA1", 5);
TEST_ASSERT_EQUAL(SHA1_LENGTH,
- make_mac((char*)PKT_DATA, PKT_LEN, SHA1_LENGTH, &sha1, actual));
+ make_mac(PKT_DATA, PKT_LEN, SHA1_LENGTH, &sha1, actual));
TEST_ASSERT_EQUAL_MEMORY(EXPECTED_DIGEST, actual, SHA1_LENGTH);
+
#else
+
TEST_IGNORE_MESSAGE("OpenSSL not found, skipping...");
+
#endif /* OPENSSL */
}
void
-test_VerifyCorrectMD5(void) {
+test_VerifyCorrectMD5(void)
+{
const char* PKT_DATA =
- "sometestdata" // Data
- "\0\0\0\0" // Key-ID (unused)
- "\xc7\x58\x99\xdd\x99\x32\x0f\x71" // MAC
- "\x2b\x7b\xfe\x4f\xa2\x32\xcf\xac";
+ "sometestdata" /* Data */
+ "\0\0\0\0" /* Key-ID (unused) */
+ "\xc7\x58\x99\xdd\x99\x32\x0f\x71" /* MAC */
+ "\x2b\x7b\xfe\x4f\xa2\x32\xcf\xac";
const int PKT_LEN = 12;
struct key md5;
@@ -83,18 +89,20 @@ test_VerifyCorrectMD5(void) {
memcpy(&md5.key_seq, "md5key", md5.key_len);
memcpy(&md5.type, "MD5", 4);
- TEST_ASSERT_TRUE(auth_md5((char*)PKT_DATA, PKT_LEN, MD5_LENGTH, &md5));
+ TEST_ASSERT_TRUE(auth_md5(PKT_DATA, PKT_LEN, MD5_LENGTH, &md5));
}
void
-test_VerifySHA1(void) {
+test_VerifySHA1(void)
+{
#ifdef OPENSSL
+
const char* PKT_DATA =
- "sometestdata" // Data
- "\0\0\0\0" // Key-ID (unused)
- "\xad\x07\xde\x36\x39\xa6\x77\xfa\x5b\xce" // MAC
- "\x2d\x8a\x7d\x06\x96\xe6\x0c\xbc\xed\xe1";
+ "sometestdata" /* Data */
+ "\0\0\0\0" /* Key-ID (unused) */
+ "\xad\x07\xde\x36\x39\xa6\x77\xfa\x5b\xce" /* MAC */
+ "\x2d\x8a\x7d\x06\x96\xe6\x0c\xbc\xed\xe1";
const int PKT_LEN = 12;
struct key sha1;
@@ -104,21 +112,26 @@ test_VerifySHA1(void) {
memcpy(&sha1.key_seq, "sha1key", sha1.key_len);
memcpy(&sha1.type, "SHA1", 5);
- TEST_ASSERT_TRUE(auth_md5((char*)PKT_DATA, PKT_LEN, SHA1_LENGTH, &sha1));
+ TEST_ASSERT_TRUE(auth_md5(PKT_DATA, PKT_LEN, SHA1_LENGTH, &sha1));
+
#else
+
TEST_IGNORE_MESSAGE("OpenSSL not found, skipping...");
+
#endif /* OPENSSL */
}
void
-test_VerifyFailure(void) {
- /* We use a copy of the MD5 verification code, but modify
- * the last bit to make sure verification fails. */
+test_VerifyFailure(void)
+{
+ /* We use a copy of the MD5 verification code, but modify the
+ * last bit to make sure verification fails.
+ */
const char* PKT_DATA =
- "sometestdata" // Data
- "\0\0\0\0" // Key-ID (unused)
- "\xc7\x58\x99\xdd\x99\x32\x0f\x71" // MAC
- "\x2b\x7b\xfe\x4f\xa2\x32\xcf\x00"; // Last byte is wrong!
+ "sometestdata" /* Data */
+ "\0\0\0\0" /* Key-ID (unused) */
+ "\xc7\x58\x99\xdd\x99\x32\x0f\x71" /* MAC */
+ "\x2b\x7b\xfe\x4f\xa2\x32\xcf\x00"; /* Last byte is wrong! */
const int PKT_LEN = 12;
struct key md5;
@@ -128,12 +141,13 @@ test_VerifyFailure(void) {
memcpy(&md5.key_seq, "md5key", md5.key_len);
memcpy(&md5.type, "MD5", 4);
- TEST_ASSERT_FALSE(auth_md5((char*)PKT_DATA, PKT_LEN, MD5_LENGTH, &md5));
+ TEST_ASSERT_FALSE(auth_md5(PKT_DATA, PKT_LEN, MD5_LENGTH, &md5));
}
void
-test_PacketSizeNotMultipleOfFourBytes(void) {
+test_PacketSizeNotMultipleOfFourBytes(void)
+{
const char* PKT_DATA = "123456";
const int PKT_LEN = 6;
char actual[MD5_LENGTH];
@@ -145,5 +159,5 @@ test_PacketSizeNotMultipleOfFourBytes(void) {
memcpy(&md5.key_seq, "md5seq", md5.key_len);
memcpy(&md5.type, "MD5", 4);
- TEST_ASSERT_EQUAL(0, make_mac((char*)PKT_DATA, PKT_LEN, MD5_LENGTH, &md5, actual));
+ TEST_ASSERT_EQUAL(0, make_mac(PKT_DATA, PKT_LEN, MD5_LENGTH, &md5, actual));
}
diff --git a/contrib/ntp/sntp/tests/fileHandlingTest.c b/contrib/ntp/sntp/tests/fileHandlingTest.c
index ce3f0de..8acad54 100644
--- a/contrib/ntp/sntp/tests/fileHandlingTest.c
+++ b/contrib/ntp/sntp/tests/fileHandlingTest.c
@@ -3,35 +3,52 @@
#include "stdlib.h"
#include "sntptest.h"
-#include "fileHandlingTest.h" //required because of the h.in thingy
+#include "fileHandlingTest.h" /* required because of the h.in thingy */
#include <string.h>
#include <unistd.h>
-/*
-enum DirectoryType {
- INPUT_DIR = 0,
- OUTPUT_DIR = 1
-};
-*/
-//extern const char srcdir[];
-
const char *
-CreatePath(const char* filename, enum DirectoryType argument) {
- const char srcdir[] = SRCDIR_DEF;//"@abs_srcdir@/data/";
- char * path = emalloc (sizeof (char) * (strlen(srcdir) + 256));
-
- //char cwd[1024];
+CreatePath(
+ const char * filename,
+ enum DirectoryType argument
+ )
+{
+ const char srcdir[] = SRCDIR_DEF;//"@abs_srcdir@/data/";
+ size_t plen = sizeof(srcdir) + strlen(filename) + 1;
+ char * path = emalloc(plen);
+ ssize_t retc;
+
+ UNUSED_ARG(argument);
+
+ retc = snprintf(path, plen, "%s%s", srcdir, filename);
+ if (retc <= 0 || (size_t)retc >= plen)
+ exit(1);
+ return path;
+}
- strcpy(path, srcdir);
- strcat(path, filename);
- return path;
+void
+DestroyPath(
+ const char * pathname
+ )
+{
+ /* use a union to get terminally rid of the 'const' attribute */
+ union {
+ const char *ccp;
+ void *vp;
+ } any;
+
+ any.ccp = pathname;
+ free(any.vp);
}
int
-GetFileSize(FILE *file) {
+GetFileSize(
+ FILE * file
+ )
+{
fseek(file, 0L, SEEK_END);
int length = ftell(file);
fseek(file, 0L, SEEK_SET);
@@ -41,7 +58,11 @@ GetFileSize(FILE *file) {
bool
-CompareFileContent(FILE* expected, FILE* actual) {
+CompareFileContent(
+ FILE * expected,
+ FILE * actual
+ )
+{
int currentLine = 1;
char actualLine[1024];
@@ -67,8 +88,10 @@ CompareFileContent(FILE* expected, FILE* actual) {
void
-ClearFile(const char * filename) {
+ClearFile(
+ const char * filename
+ )
+{
if (!truncate(filename, 0))
exit(1);
}
-
diff --git a/contrib/ntp/sntp/tests/fileHandlingTest.h.in b/contrib/ntp/sntp/tests/fileHandlingTest.h.in
index e7d99ee..b93ed9e 100644
--- a/contrib/ntp/sntp/tests/fileHandlingTest.h.in
+++ b/contrib/ntp/sntp/tests/fileHandlingTest.h.in
@@ -15,21 +15,12 @@ enum DirectoryType {
};
#define SRCDIR_DEF "@abs_srcdir@/data/";
-//const char srcdir[] = "@abs_srcdir@/data/";
-
-const char *
-CreatePath(const char* filename, enum DirectoryType argument);
-
-
-int
-GetFileSize(FILE *file);
-
-
-bool
-CompareFileContent(FILE* expected, FILE* actual);
-
-void
-ClearFile(const char * filename) ;
+extern const char * CreatePath(const char* filename,
+ enum DirectoryType argument);
+extern void DestroyPath(const char* pathname);
+extern int GetFileSize(FILE *file);
+extern bool CompareFileContent(FILE* expected, FILE* actual);
+extern void ClearFile(const char * filename) ;
#endif // FILE_HANDLING_TEST_H
diff --git a/contrib/ntp/sntp/tests/keyFile.c b/contrib/ntp/sntp/tests/keyFile.c
index 883658a..395ca0d 100644
--- a/contrib/ntp/sntp/tests/keyFile.c
+++ b/contrib/ntp/sntp/tests/keyFile.c
@@ -17,24 +17,28 @@ void test_ReadKeyFileWithInvalidHex(void);
bool
-CompareKeys(struct key expected, struct key actual) {
- if (expected.key_id != actual.key_id){
- printf("Expected key_id: %d", expected.key_id);
- printf(" but was: %d\n", actual.key_id);
+CompareKeys(
+ struct key expected,
+ struct key actual
+ )
+{
+ if (expected.key_id != actual.key_id) {
+ printf("Expected key_id: %d but was: %d\n",
+ expected.key_id, actual.key_id);
return FALSE;
}
- if (expected.key_len != actual.key_len){
- printf("Expected key_len: %d", expected.key_len);
- printf(" but was: %d\n", actual.key_len);
+ if (expected.key_len != actual.key_len) {
+ printf("Expected key_len: %d but was: %d\n",
+ expected.key_len, actual.key_len);
return FALSE;
}
- if (strcmp(expected.type, actual.type) != 0){
- printf("Expected key_type: %s", expected.type);
- printf(" but was: %s\n", actual.type);
+ if (strcmp(expected.type, actual.type) != 0) {
+ printf("Expected key_type: %s but was: %s\n",
+ expected.type, actual.type);
return FALSE;
}
- if (memcmp(expected.key_seq, actual.key_seq, expected.key_len) != 0){
+ if (memcmp(expected.key_seq, actual.key_seq, expected.key_len) != 0) {
printf("Key mismatch!\n");
return FALSE;
}
@@ -43,12 +47,15 @@ CompareKeys(struct key expected, struct key actual) {
bool
-CompareKeysAlternative(int key_id,
- int key_len,
- const char* type,
- const char* key_seq,
- struct key actual) {
- struct key temp;
+CompareKeysAlternative(
+ int key_id,
+ int key_len,
+ const char * type,
+ const char * key_seq,
+ struct key actual
+ )
+{
+ struct key temp;
temp.key_id = key_id;
temp.key_len = key_len;
@@ -60,30 +67,32 @@ CompareKeysAlternative(int key_id,
void
-test_ReadEmptyKeyFile(void) {
- struct key* keys = NULL;
- const char *path = CreatePath("key-test-empty", INPUT_DIR);
+test_ReadEmptyKeyFile(void)
+{
+ struct key * keys = NULL;
+ const char * path = CreatePath("key-test-empty", INPUT_DIR);
TEST_ASSERT_NOT_NULL(path);
TEST_ASSERT_EQUAL(0, auth_init(path, &keys));
TEST_ASSERT_NULL(keys);
- free((void *)path);
+ DestroyPath(path);
}
void
-test_ReadASCIIKeys(void) {
- struct key* keys = NULL;
- const char *path = CreatePath("key-test-ascii", INPUT_DIR);
+test_ReadASCIIKeys(void)
+{
+ struct key * keys = NULL;
+ struct key * result = NULL;
+ const char * path = CreatePath("key-test-ascii", INPUT_DIR);
TEST_ASSERT_NOT_NULL(path);
TEST_ASSERT_EQUAL(2, auth_init(path, &keys));
TEST_ASSERT_NOT_NULL(keys);
- free((void *)path);
+ DestroyPath(path);
- struct key* result = NULL;
get_key(40, &result);
TEST_ASSERT_NOT_NULL(result);
TEST_ASSERT_TRUE(CompareKeysAlternative(40, 11, "MD5", "asciikeyTwo", *result));
@@ -96,16 +105,19 @@ test_ReadASCIIKeys(void) {
void
-test_ReadHexKeys(void) {
- struct key* keys = NULL;
- const char *path = CreatePath("key-test-hex", INPUT_DIR);
+test_ReadHexKeys(void)
+{
+ struct key * keys = NULL;
+ struct key * result = NULL;
+ const char * path = CreatePath("key-test-hex", INPUT_DIR);
+ char data1[15];
+ char data2[13];
TEST_ASSERT_NOT_NULL(path);
TEST_ASSERT_EQUAL(3, auth_init(path, &keys));
TEST_ASSERT_NOT_NULL(keys);
- free((void *)path);
+ DestroyPath(path);
- struct key* result = NULL;
get_key(10, &result);
TEST_ASSERT_NOT_NULL(result);
TEST_ASSERT_TRUE(CompareKeysAlternative(10, 13, "MD5",
@@ -114,31 +126,36 @@ test_ReadHexKeys(void) {
result = NULL;
get_key(20, &result);
TEST_ASSERT_NOT_NULL(result);
- char data1[15]; memset(data1, 0x11, 15);
+
+ memset(data1, 0x11, 15);
TEST_ASSERT_TRUE(CompareKeysAlternative(20, 15, "MD5", data1, *result));
result = NULL;
get_key(30, &result);
TEST_ASSERT_NOT_NULL(result);
- char data2[13]; memset(data2, 0x01, 13);
+
+ memset(data2, 0x01, 13);
TEST_ASSERT_TRUE(CompareKeysAlternative(30, 13, "MD5", data2, *result));
}
void
-test_ReadKeyFileWithComments(void) {
- struct key* keys = NULL;
- const char *path = CreatePath("key-test-comments", INPUT_DIR);
+test_ReadKeyFileWithComments(void)
+{
+ struct key * keys = NULL;
+ struct key * result = NULL;
+ const char * path = CreatePath("key-test-comments", INPUT_DIR);
+ char data[15];
TEST_ASSERT_NOT_NULL(path);
TEST_ASSERT_EQUAL(2, auth_init(path, &keys));
TEST_ASSERT_NOT_NULL(keys);
- free((void *)path);
+ DestroyPath(path);
- struct key* result = NULL;
get_key(10, &result);
TEST_ASSERT_NOT_NULL(result);
- char data[15]; memset(data, 0x01, 15);
+
+ memset(data, 0x01, 15);
TEST_ASSERT_TRUE(CompareKeysAlternative(10, 15, "MD5", data, *result));
result = NULL;
@@ -149,22 +166,25 @@ test_ReadKeyFileWithComments(void) {
void
-test_ReadKeyFileWithInvalidHex(void) {
- struct key* keys = NULL;
- const char *path = CreatePath("key-test-invalid-hex", INPUT_DIR);
+test_ReadKeyFileWithInvalidHex(void)
+{
+ struct key * keys = NULL;
+ struct key * result = NULL;
+ const char * path = CreatePath("key-test-invalid-hex", INPUT_DIR);
+ char data[15];
TEST_ASSERT_NOT_NULL(path);
TEST_ASSERT_EQUAL(1, auth_init(path, &keys));
TEST_ASSERT_NOT_NULL(keys);
- free((void *)path);
+ DestroyPath(path);
- struct key* result = NULL;
get_key(10, &result);
TEST_ASSERT_NOT_NULL(result);
- char data[15]; memset(data, 0x01, 15);
+
+ memset(data, 0x01, 15);
TEST_ASSERT_TRUE(CompareKeysAlternative(10, 15, "MD5", data, *result));
result = NULL;
- get_key(30, &result); // Should not exist, and result should remain NULL.
+ get_key(30, &result); /* Should not exist, and result should remain NULL. */
TEST_ASSERT_NULL(result);
}
diff --git a/contrib/ntp/sntp/tests/packetHandling.c b/contrib/ntp/sntp/tests/packetHandling.c
index 1036fc3..595efa3 100644
--- a/contrib/ntp/sntp/tests/packetHandling.c
+++ b/contrib/ntp/sntp/tests/packetHandling.c
@@ -27,25 +27,29 @@ void test_HandleCorrectPacket(void);
void
-setUp(void) {
+setUp(void)
+{
init_lib();
}
int
-LfpEquality(const l_fp expected, const l_fp actual) {
- if (L_ISEQU(&expected, &actual))
- return TRUE;
- else
- return FALSE;
+LfpEquality(
+ const l_fp expected,
+ const l_fp actual
+ )
+{
+ return !!(L_ISEQU(&expected, &actual));
}
void
-test_GenerateUnauthenticatedPacket(void) {
- struct pkt testpkt;
+test_GenerateUnauthenticatedPacket(void)
+{
+ struct pkt testpkt;
+ struct timeval xmt;
+ l_fp expected_xmt, actual_xmt;
- struct timeval xmt;
GETTIMEOFDAY(&xmt, NULL);
xmt.tv_sec += JAN_1970;
@@ -59,7 +63,6 @@ test_GenerateUnauthenticatedPacket(void) {
TEST_ASSERT_EQUAL(STRATUM_UNSPEC, PKT_TO_STRATUM(testpkt.stratum));
TEST_ASSERT_EQUAL(8, testpkt.ppoll);
- l_fp expected_xmt, actual_xmt;
TVTOTS(&xmt, &expected_xmt);
NTOHL_FP(&testpkt.xmt, &actual_xmt);
TEST_ASSERT_TRUE(LfpEquality(expected_xmt, actual_xmt));
@@ -67,22 +70,25 @@ test_GenerateUnauthenticatedPacket(void) {
void
-test_GenerateAuthenticatedPacket(void) {
- struct key testkey;
+test_GenerateAuthenticatedPacket(void)
+{
+ static const int EXPECTED_PKTLEN = LEN_PKT_NOMAC + MAX_MD5_LEN;
+
+ struct key testkey;
+ struct pkt testpkt;
+ struct timeval xmt;
+ l_fp expected_xmt, actual_xmt;
+ char expected_mac[MAX_MD5_LEN];
+
testkey.next = NULL;
testkey.key_id = 30;
testkey.key_len = 9;
memcpy(testkey.key_seq, "123456789", testkey.key_len);
memcpy(testkey.type, "MD5", 3);
- struct pkt testpkt;
-
- struct timeval xmt;
GETTIMEOFDAY(&xmt, NULL);
xmt.tv_sec += JAN_1970;
- const int EXPECTED_PKTLEN = LEN_PKT_NOMAC + MAX_MD5_LEN;
-
TEST_ASSERT_EQUAL(EXPECTED_PKTLEN,
generate_pkt(&testpkt, &xmt, testkey.key_id, &testkey));
@@ -93,103 +99,102 @@ test_GenerateAuthenticatedPacket(void) {
TEST_ASSERT_EQUAL(STRATUM_UNSPEC, PKT_TO_STRATUM(testpkt.stratum));
TEST_ASSERT_EQUAL(8, testpkt.ppoll);
- l_fp expected_xmt, actual_xmt;
TVTOTS(&xmt, &expected_xmt);
NTOHL_FP(&testpkt.xmt, &actual_xmt);
TEST_ASSERT_TRUE(LfpEquality(expected_xmt, actual_xmt));
TEST_ASSERT_EQUAL(testkey.key_id, ntohl(testpkt.exten[0]));
- char expected_mac[MAX_MD5_LEN];
- TEST_ASSERT_EQUAL(MAX_MD5_LEN - 4, // Remove the key_id, only keep the mac.
- make_mac((char*)&testpkt, LEN_PKT_NOMAC, MAX_MD5_LEN, &testkey, expected_mac));
+ TEST_ASSERT_EQUAL(MAX_MD5_LEN - 4, /* Remove the key_id, only keep the mac. */
+ make_mac(&testpkt, LEN_PKT_NOMAC, MAX_MD5_LEN, &testkey, expected_mac));
TEST_ASSERT_EQUAL_MEMORY(expected_mac, (char*)&testpkt.exten[1], MAX_MD5_LEN -4);
}
void
-test_OffsetCalculationPositiveOffset(void) {
- struct pkt rpkt;
-
- rpkt.precision = -16; // 0,000015259
+test_OffsetCalculationPositiveOffset(void)
+{
+ struct pkt rpkt;
+ l_fp reftime, tmp;
+ struct timeval dst;
+ double offset, precision, synch_distance;
+
+ rpkt.precision = -16; /* 0,000015259 */
rpkt.rootdelay = HTONS_FP(DTOUFP(0.125));
rpkt.rootdisp = HTONS_FP(DTOUFP(0.25));
- // Synch Distance: (0.125+0.25)/2.0 == 0.1875
- l_fp reftime;
+
+ /* Synch Distance: (0.125+0.25)/2.0 == 0.1875 */
get_systime(&reftime);
HTONL_FP(&reftime, &rpkt.reftime);
- l_fp tmp;
-
- // T1 - Originate timestamp
+ /* T1 - Originate timestamp */
tmp.l_ui = 1000000000UL;
tmp.l_uf = 0UL;
HTONL_FP(&tmp, &rpkt.org);
- // T2 - Receive timestamp
+ /* T2 - Receive timestamp */
tmp.l_ui = 1000000001UL;
tmp.l_uf = 2147483648UL;
HTONL_FP(&tmp, &rpkt.rec);
- // T3 - Transmit timestamp
+ /* T3 - Transmit timestamp */
tmp.l_ui = 1000000002UL;
tmp.l_uf = 0UL;
HTONL_FP(&tmp, &rpkt.xmt);
- // T4 - Destination timestamp as standard timeval
+ /* T4 - Destination timestamp as standard timeval */
tmp.l_ui = 1000000001UL;
tmp.l_uf = 0UL;
- struct timeval dst;
TSTOTV(&tmp, &dst);
dst.tv_sec -= JAN_1970;
- double offset, precision, synch_distance;
offset_calculation(&rpkt, LEN_PKT_NOMAC, &dst, &offset, &precision, &synch_distance);
TEST_ASSERT_EQUAL_DOUBLE(1.25, offset);
TEST_ASSERT_EQUAL_DOUBLE(1. / ULOGTOD(16), precision);
- // 1.1250150000000001 ?
+ /* 1.1250150000000001 ? */
TEST_ASSERT_EQUAL_DOUBLE(1.125015, synch_distance);
}
void
-test_OffsetCalculationNegativeOffset(void) {
- struct pkt rpkt;
+test_OffsetCalculationNegativeOffset(void)
+{
+ struct pkt rpkt;
+ l_fp reftime, tmp;
+ struct timeval dst;
+ double offset, precision, synch_distance;
rpkt.precision = -1;
rpkt.rootdelay = HTONS_FP(DTOUFP(0.5));
rpkt.rootdisp = HTONS_FP(DTOUFP(0.5));
- // Synch Distance is (0.5+0.5)/2.0, or 0.5
- l_fp reftime;
+
+ /* Synch Distance is (0.5+0.5)/2.0, or 0.5 */
get_systime(&reftime);
HTONL_FP(&reftime, &rpkt.reftime);
- l_fp tmp;
-
- // T1 - Originate timestamp
+ /* T1 - Originate timestamp */
tmp.l_ui = 1000000001UL;
tmp.l_uf = 0UL;
HTONL_FP(&tmp, &rpkt.org);
- // T2 - Receive timestamp
+ /* T2 - Receive timestamp */
tmp.l_ui = 1000000000UL;
tmp.l_uf = 2147483648UL;
HTONL_FP(&tmp, &rpkt.rec);
- // T3 - Transmit timestamp
+ /*/ T3 - Transmit timestamp */
tmp.l_ui = 1000000001UL;
tmp.l_uf = 2147483648UL;
HTONL_FP(&tmp, &rpkt.xmt);
- // T4 - Destination timestamp as standard timeval
+ /* T4 - Destination timestamp as standard timeval */
tmp.l_ui = 1000000003UL;
tmp.l_uf = 0UL;
- struct timeval dst;
+
TSTOTV(&tmp, &dst);
dst.tv_sec -= JAN_1970;
- double offset, precision, synch_distance;
offset_calculation(&rpkt, LEN_PKT_NOMAC, &dst, &offset, &precision, &synch_distance);
TEST_ASSERT_EQUAL_DOUBLE(-1, offset);
@@ -199,8 +204,9 @@ test_OffsetCalculationNegativeOffset(void) {
void
-test_HandleUnusableServer(void) {
- struct pkt rpkt;
+test_HandleUnusableServer(void)
+{
+ struct pkt rpkt;
sockaddr_u host;
int rpktl;
@@ -212,8 +218,9 @@ test_HandleUnusableServer(void) {
void
-test_HandleUnusablePacket(void) {
- struct pkt rpkt;
+test_HandleUnusablePacket(void)
+{
+ struct pkt rpkt;
sockaddr_u host;
int rpktl;
@@ -225,8 +232,9 @@ test_HandleUnusablePacket(void) {
void
-test_HandleServerAuthenticationFailure(void) {
- struct pkt rpkt;
+test_HandleServerAuthenticationFailure(void)
+{
+ struct pkt rpkt;
sockaddr_u host;
int rpktl;
@@ -238,12 +246,13 @@ test_HandleServerAuthenticationFailure(void) {
void
-test_HandleKodDemobilize(void) {
- const char * HOSTNAME = "192.0.2.1";
- const char * REASON = "DENY";
+test_HandleKodDemobilize(void)
+{
+ static const char * HOSTNAME = "192.0.2.1";
+ static const char * REASON = "DENY";
struct pkt rpkt;
- sockaddr_u host;
- int rpktl;
+ sockaddr_u host;
+ int rpktl;
struct kod_entry * entry;
rpktl = KOD_DEMOBILIZE;
@@ -253,7 +262,7 @@ test_HandleKodDemobilize(void) {
host.sa4.sin_family = AF_INET;
host.sa4.sin_addr.s_addr = inet_addr(HOSTNAME);
- // Test that the KOD-entry is added to the database.
+ /* Test that the KOD-entry is added to the database. */
kod_init_kod_db("/dev/null", TRUE);
TEST_ASSERT_EQUAL(1, handle_pkt(rpktl, &rpkt, &host, HOSTNAME));
@@ -264,8 +273,9 @@ test_HandleKodDemobilize(void) {
void
-test_HandleKodRate(void) {
- struct pkt rpkt;
+test_HandleKodRate(void)
+{
+ struct pkt rpkt;
sockaddr_u host;
int rpktl;
@@ -277,13 +287,14 @@ test_HandleKodRate(void) {
void
-test_HandleCorrectPacket(void) {
- struct pkt rpkt;
+test_HandleCorrectPacket(void)
+{
+ struct pkt rpkt;
sockaddr_u host;
int rpktl;
l_fp now;
- // We don't want our testing code to actually change the system clock.
+ /* We don't want our testing code to actually change the system clock. */
TEST_ASSERT_FALSE(ENABLED_OPT(STEP));
TEST_ASSERT_FALSE(ENABLED_OPT(SLEW));
diff --git a/contrib/ntp/sntp/tests/packetProcessing.c b/contrib/ntp/sntp/tests/packetProcessing.c
index 1fd649e..88e61cc 100644
--- a/contrib/ntp/sntp/tests/packetProcessing.c
+++ b/contrib/ntp/sntp/tests/packetProcessing.c
@@ -1,4 +1,10 @@
#include "config.h"
+
+/* need autokey for some of the tests, or the will create buffer overruns. */
+#ifndef AUTOKEY
+# define AUTOKEY 1
+#endif
+
#include "sntptest.h"
#include "networking.h"
#include "ntp_stdlib.h"
@@ -43,10 +49,13 @@ bool restoreKeyDb;
void
-PrepareAuthenticationTest(int key_id,
- int key_len,
- const char* type,
- const void* key_seq) {
+PrepareAuthenticationTest(
+ int key_id,
+ int key_len,
+ const char * type,
+ const void * key_seq
+ )
+{
char str[25];
snprintf(str, 25, "%d", key_id);
ActivateOption("-a", str);
@@ -66,28 +75,34 @@ PrepareAuthenticationTest(int key_id,
void
-PrepareAuthenticationTestMD5(int key_id,
- int key_len,
- const void* key_seq) {
+PrepareAuthenticationTestMD5(
+ int key_id,
+ int key_len,
+ const void * key_seq
+ )
+{
PrepareAuthenticationTest(key_id, key_len, "MD5", key_seq);
}
void
-setUp(void) {
+setUp(void)
+{
sntptest();
restoreKeyDb = false;
/* Initialize the test packet and socket,
- * so they contain at least some valid data. */
+ * so they contain at least some valid data.
+ */
testpkt.li_vn_mode = PKT_LI_VN_MODE(LEAP_NOWARNING, NTP_VERSION,
MODE_SERVER);
testpkt.stratum = STRATUM_REFCLOCK;
memcpy(&testpkt.refid, "GPS\0", 4);
/* Set the origin timestamp of the received packet to the
- * same value as the transmit timestamp of the sent packet. */
+ * same value as the transmit timestamp of the sent packet.
+ */
l_fp tmp;
tmp.l_ui = 1000UL;
tmp.l_uf = 0UL;
@@ -98,189 +113,202 @@ setUp(void) {
void
-tearDown(void) {
-
+tearDown(void)
+{
if (restoreKeyDb) {
key_cnt = 0;
free(key_ptr);
key_ptr = NULL;
}
- sntptest_destroy(); //only on the final test!! if counter == 0 etc...
+ sntptest_destroy(); /* only on the final test!! if counter == 0 etc... */
}
-
void
-test_TooShortLength(void) {
+test_TooShortLength(void)
+{
TEST_ASSERT_EQUAL(PACKET_UNUSEABLE,
process_pkt(&testpkt, &testsock, LEN_PKT_NOMAC - 1,
- MODE_SERVER, &testspkt, "UnitTest"));
+ MODE_SERVER, &testspkt, "UnitTest"));
TEST_ASSERT_EQUAL(PACKET_UNUSEABLE,
process_pkt(&testpkt, &testsock, LEN_PKT_NOMAC - 1,
- MODE_BROADCAST, &testspkt, "UnitTest"));
+ MODE_BROADCAST, &testspkt, "UnitTest"));
}
void
-test_LengthNotMultipleOfFour(void) {
+test_LengthNotMultipleOfFour(void)
+{
TEST_ASSERT_EQUAL(PACKET_UNUSEABLE,
process_pkt(&testpkt, &testsock, LEN_PKT_NOMAC + 6,
- MODE_SERVER, &testspkt, "UnitTest"));
+ MODE_SERVER, &testspkt, "UnitTest"));
TEST_ASSERT_EQUAL(PACKET_UNUSEABLE,
process_pkt(&testpkt, &testsock, LEN_PKT_NOMAC + 3,
- MODE_BROADCAST, &testspkt, "UnitTest"));
+ MODE_BROADCAST, &testspkt, "UnitTest"));
}
void
-test_TooShortExtensionFieldLength(void) {
+test_TooShortExtensionFieldLength(void)
+{
/* The lower 16-bits are the length of the extension field.
* This lengths must be multiples of 4 bytes, which gives
- * a minimum of 4 byte extension field length. */
- testpkt.exten[7] = htonl(3); // 3 bytes is too short.
+ * a minimum of 4 byte extension field length.
+ */
+ testpkt.exten[7] = htonl(3); /* 3 bytes is too short. */
/* We send in a pkt_len of header size + 4 byte extension
* header + 24 byte MAC, this prevents the length error to
- * be caught at an earlier stage */
+ * be caught at an earlier stage
+ */
int pkt_len = LEN_PKT_NOMAC + 4 + 24;
TEST_ASSERT_EQUAL(PACKET_UNUSEABLE,
process_pkt(&testpkt, &testsock, pkt_len,
- MODE_SERVER, &testspkt, "UnitTest"));
+ MODE_SERVER, &testspkt, "UnitTest"));
}
void
-test_UnauthenticatedPacketReject(void) {
- //sntptest();
- // Activate authentication option
+test_UnauthenticatedPacketReject(void)
+{
+ /* Activate authentication option */
ActivateOption("-a", "123");
TEST_ASSERT_TRUE(ENABLED_OPT(AUTHENTICATION));
int pkt_len = LEN_PKT_NOMAC;
- // We demand authentication, but no MAC header is present.
+ /* We demand authentication, but no MAC header is present. */
TEST_ASSERT_EQUAL(SERVER_AUTH_FAIL,
process_pkt(&testpkt, &testsock, pkt_len,
- MODE_SERVER, &testspkt, "UnitTest"));
+ MODE_SERVER, &testspkt, "UnitTest"));
}
void
-test_CryptoNAKPacketReject(void) {
- // Activate authentication option
+test_CryptoNAKPacketReject(void)
+{
+ /* Activate authentication option */
ActivateOption("-a", "123");
TEST_ASSERT_TRUE(ENABLED_OPT(AUTHENTICATION));
- int pkt_len = LEN_PKT_NOMAC + 4; // + 4 byte MAC = Crypto-NAK
+ int pkt_len = LEN_PKT_NOMAC + 4; /* + 4 byte MAC = Crypto-NAK */
TEST_ASSERT_EQUAL(SERVER_AUTH_FAIL,
process_pkt(&testpkt, &testsock, pkt_len,
- MODE_SERVER, &testspkt, "UnitTest"));
+ MODE_SERVER, &testspkt, "UnitTest"));
}
void
-test_AuthenticatedPacketInvalid(void) {
- // Activate authentication option
+test_AuthenticatedPacketInvalid(void)
+{
+ /* Activate authentication option */
PrepareAuthenticationTestMD5(50, 9, "123456789");
TEST_ASSERT_TRUE(ENABLED_OPT(AUTHENTICATION));
- // Prepare the packet.
+ /* Prepare the packet. */
int pkt_len = LEN_PKT_NOMAC;
testpkt.exten[0] = htonl(50);
- int mac_len = make_mac((char*)&testpkt, pkt_len,
- MAX_MD5_LEN, key_ptr,
- (char*)&testpkt.exten[1]);
+ int mac_len = make_mac(&testpkt, pkt_len,
+ MAX_MD5_LEN, key_ptr,
+ &testpkt.exten[1]);
pkt_len += 4 + mac_len;
- // Now, alter the MAC so it becomes invalid.
+ /* Now, alter the MAC so it becomes invalid. */
testpkt.exten[1] += 1;
TEST_ASSERT_EQUAL(SERVER_AUTH_FAIL,
process_pkt(&testpkt, &testsock, pkt_len,
- MODE_SERVER, &testspkt, "UnitTest"));
+ MODE_SERVER, &testspkt, "UnitTest"));
}
void
-test_AuthenticatedPacketUnknownKey(void) {
- // Activate authentication option
+test_AuthenticatedPacketUnknownKey(void)
+{
+ /* Activate authentication option */
PrepareAuthenticationTestMD5(30, 9, "123456789");
TEST_ASSERT_TRUE(ENABLED_OPT(AUTHENTICATION));
- // Prepare the packet. Observe that the Key-ID expected is 30,
- // but the packet has a key id of 50.
+ /* Prepare the packet. Note that the Key-ID expected is 30, but
+ * the packet has a key id of 50.
+ */
int pkt_len = LEN_PKT_NOMAC;
testpkt.exten[0] = htonl(50);
- int mac_len = make_mac((char*)&testpkt, pkt_len,
- MAX_MD5_LEN, key_ptr,
- (char*)&testpkt.exten[1]);
+ int mac_len = make_mac(&testpkt, pkt_len,
+ MAX_MD5_LEN, key_ptr,
+ &testpkt.exten[1]);
pkt_len += 4 + mac_len;
TEST_ASSERT_EQUAL(SERVER_AUTH_FAIL,
process_pkt(&testpkt, &testsock, pkt_len,
- MODE_SERVER, &testspkt, "UnitTest"));
+ MODE_SERVER, &testspkt, "UnitTest"));
}
void
-test_ServerVersionTooOld(void) {
+test_ServerVersionTooOld(void)
+{
TEST_ASSERT_FALSE(ENABLED_OPT(AUTHENTICATION));
testpkt.li_vn_mode = PKT_LI_VN_MODE(LEAP_NOWARNING,
- NTP_OLDVERSION - 1,
- MODE_CLIENT);
+ NTP_OLDVERSION - 1,
+ MODE_CLIENT);
TEST_ASSERT_TRUE(PKT_VERSION(testpkt.li_vn_mode) < NTP_OLDVERSION);
int pkt_len = LEN_PKT_NOMAC;
TEST_ASSERT_EQUAL(SERVER_UNUSEABLE,
process_pkt(&testpkt, &testsock, pkt_len,
- MODE_SERVER, &testspkt, "UnitTest"));
+ MODE_SERVER, &testspkt, "UnitTest"));
}
void
-test_ServerVersionTooNew(void) {
+test_ServerVersionTooNew(void)
+{
TEST_ASSERT_FALSE(ENABLED_OPT(AUTHENTICATION));
testpkt.li_vn_mode = PKT_LI_VN_MODE(LEAP_NOWARNING,
- NTP_VERSION + 1,
- MODE_CLIENT);
+ NTP_VERSION + 1,
+ MODE_CLIENT);
TEST_ASSERT_TRUE(PKT_VERSION(testpkt.li_vn_mode) > NTP_VERSION);
int pkt_len = LEN_PKT_NOMAC;
TEST_ASSERT_EQUAL(SERVER_UNUSEABLE,
process_pkt(&testpkt, &testsock, pkt_len,
- MODE_SERVER, &testspkt, "UnitTest"));
+ MODE_SERVER, &testspkt, "UnitTest"));
}
void
-test_NonWantedMode(void) {
+test_NonWantedMode(void)
+{
TEST_ASSERT_FALSE(ENABLED_OPT(AUTHENTICATION));
testpkt.li_vn_mode = PKT_LI_VN_MODE(LEAP_NOWARNING,
- NTP_VERSION,
- MODE_CLIENT);
-
- // The packet has a mode of MODE_CLIENT, but process_pkt expects MODE_SERVER
+ NTP_VERSION,
+ MODE_CLIENT);
+ /* The packet has a mode of MODE_CLIENT, but process_pkt expects
+ * MODE_SERVER
+ */
TEST_ASSERT_EQUAL(SERVER_UNUSEABLE,
process_pkt(&testpkt, &testsock, LEN_PKT_NOMAC,
- MODE_SERVER, &testspkt, "UnitTest"));
+ MODE_SERVER, &testspkt, "UnitTest"));
}
/* Tests bug 1597 */
void
-test_KoDRate(void) {
+test_KoDRate(void)
+{
TEST_ASSERT_FALSE(ENABLED_OPT(AUTHENTICATION));
testpkt.stratum = STRATUM_PKT_UNSPEC;
@@ -288,12 +316,13 @@ test_KoDRate(void) {
TEST_ASSERT_EQUAL(KOD_RATE,
process_pkt(&testpkt, &testsock, LEN_PKT_NOMAC,
- MODE_SERVER, &testspkt, "UnitTest"));
+ MODE_SERVER, &testspkt, "UnitTest"));
}
void
-test_KoDDeny(void) {
+test_KoDDeny(void)
+{
TEST_ASSERT_FALSE(ENABLED_OPT(AUTHENTICATION));
testpkt.stratum = STRATUM_PKT_UNSPEC;
@@ -301,26 +330,28 @@ test_KoDDeny(void) {
TEST_ASSERT_EQUAL(KOD_DEMOBILIZE,
process_pkt(&testpkt, &testsock, LEN_PKT_NOMAC,
- MODE_SERVER, &testspkt, "UnitTest"));
+ MODE_SERVER, &testspkt, "UnitTest"));
}
void
-test_RejectUnsyncedServer(void) {
+test_RejectUnsyncedServer(void)
+{
TEST_ASSERT_FALSE(ENABLED_OPT(AUTHENTICATION));
testpkt.li_vn_mode = PKT_LI_VN_MODE(LEAP_NOTINSYNC,
- NTP_VERSION,
- MODE_SERVER);
+ NTP_VERSION,
+ MODE_SERVER);
TEST_ASSERT_EQUAL(SERVER_UNUSEABLE,
process_pkt(&testpkt, &testsock, LEN_PKT_NOMAC,
- MODE_SERVER, &testspkt, "UnitTest"));
+ MODE_SERVER, &testspkt, "UnitTest"));
}
void
-test_RejectWrongResponseServerMode(void) {
+test_RejectWrongResponseServerMode(void)
+{
TEST_ASSERT_FALSE(ENABLED_OPT(AUTHENTICATION));
l_fp tmp;
@@ -334,12 +365,13 @@ test_RejectWrongResponseServerMode(void) {
TEST_ASSERT_EQUAL(PACKET_UNUSEABLE,
process_pkt(&testpkt, &testsock, LEN_PKT_NOMAC,
- MODE_SERVER, &testspkt, "UnitTest"));
+ MODE_SERVER, &testspkt, "UnitTest"));
}
void
-test_AcceptNoSentPacketBroadcastMode(void) {
+test_AcceptNoSentPacketBroadcastMode(void)
+{
TEST_ASSERT_FALSE(ENABLED_OPT(AUTHENTICATION));
testpkt.li_vn_mode = PKT_LI_VN_MODE(LEAP_NOWARNING,
@@ -353,53 +385,55 @@ test_AcceptNoSentPacketBroadcastMode(void) {
void
-test_CorrectUnauthenticatedPacket(void) {
+test_CorrectUnauthenticatedPacket(void)
+{
TEST_ASSERT_FALSE(ENABLED_OPT(AUTHENTICATION));
TEST_ASSERT_EQUAL(LEN_PKT_NOMAC,
process_pkt(&testpkt, &testsock, LEN_PKT_NOMAC,
- MODE_SERVER, &testspkt, "UnitTest"));
+ MODE_SERVER, &testspkt, "UnitTest"));
}
void
-test_CorrectAuthenticatedPacketMD5(void) {
+test_CorrectAuthenticatedPacketMD5(void)
+{
PrepareAuthenticationTestMD5(10, 15, "123456789abcdef");
TEST_ASSERT_TRUE(ENABLED_OPT(AUTHENTICATION));
int pkt_len = LEN_PKT_NOMAC;
- // Prepare the packet.
+ /* Prepare the packet. */
testpkt.exten[0] = htonl(10);
- int mac_len = make_mac((char*)&testpkt, pkt_len,
- MAX_MD5_LEN, key_ptr,
- (char*)&testpkt.exten[1]);
+ int mac_len = make_mac(&testpkt, pkt_len,
+ MAX_MD5_LEN, key_ptr,
+ &testpkt.exten[1]);
pkt_len += 4 + mac_len;
TEST_ASSERT_EQUAL(pkt_len,
process_pkt(&testpkt, &testsock, pkt_len,
- MODE_SERVER, &testspkt, "UnitTest"));
-
+ MODE_SERVER, &testspkt, "UnitTest"));
}
void
-test_CorrectAuthenticatedPacketSHA1(void) {
+test_CorrectAuthenticatedPacketSHA1(void)
+{
PrepareAuthenticationTest(20, 15, "SHA1", "abcdefghijklmno");
TEST_ASSERT_TRUE(ENABLED_OPT(AUTHENTICATION));
int pkt_len = LEN_PKT_NOMAC;
- // Prepare the packet.
+ /* Prepare the packet. */
testpkt.exten[0] = htonl(20);
- int mac_len = make_mac((char*)&testpkt, pkt_len,
- MAX_MAC_LEN, key_ptr,
- (char*)&testpkt.exten[1]);
+ int mac_len = make_mac(&testpkt, pkt_len,
+ MAX_MAC_LEN, key_ptr,
+ &testpkt.exten[1]);
pkt_len += 4 + mac_len;
TEST_ASSERT_EQUAL(pkt_len,
process_pkt(&testpkt, &testsock, pkt_len,
- MODE_SERVER, &testspkt, "UnitTest"));
+ MODE_SERVER, &testspkt, "UnitTest"));
}
diff --git a/contrib/ntp/sntp/tests/run-packetProcessing.c b/contrib/ntp/sntp/tests/run-packetProcessing.c
index bf3a63e..ad02b7a 100644
--- a/contrib/ntp/sntp/tests/run-packetProcessing.c
+++ b/contrib/ntp/sntp/tests/run-packetProcessing.c
@@ -66,24 +66,24 @@ int main(int argc, char *argv[])
{
progname = argv[0];
UnityBegin("packetProcessing.c");
- RUN_TEST(test_TooShortLength, 19);
- RUN_TEST(test_LengthNotMultipleOfFour, 20);
- RUN_TEST(test_TooShortExtensionFieldLength, 21);
- RUN_TEST(test_UnauthenticatedPacketReject, 22);
- RUN_TEST(test_CryptoNAKPacketReject, 23);
- RUN_TEST(test_AuthenticatedPacketInvalid, 24);
- RUN_TEST(test_AuthenticatedPacketUnknownKey, 25);
- RUN_TEST(test_ServerVersionTooOld, 26);
- RUN_TEST(test_ServerVersionTooNew, 27);
- RUN_TEST(test_NonWantedMode, 28);
- RUN_TEST(test_KoDRate, 29);
- RUN_TEST(test_KoDDeny, 30);
- RUN_TEST(test_RejectUnsyncedServer, 31);
- RUN_TEST(test_RejectWrongResponseServerMode, 32);
- RUN_TEST(test_AcceptNoSentPacketBroadcastMode, 33);
- RUN_TEST(test_CorrectUnauthenticatedPacket, 34);
- RUN_TEST(test_CorrectAuthenticatedPacketMD5, 35);
- RUN_TEST(test_CorrectAuthenticatedPacketSHA1, 36);
+ RUN_TEST(test_TooShortLength, 25);
+ RUN_TEST(test_LengthNotMultipleOfFour, 26);
+ RUN_TEST(test_TooShortExtensionFieldLength, 27);
+ RUN_TEST(test_UnauthenticatedPacketReject, 28);
+ RUN_TEST(test_CryptoNAKPacketReject, 29);
+ RUN_TEST(test_AuthenticatedPacketInvalid, 30);
+ RUN_TEST(test_AuthenticatedPacketUnknownKey, 31);
+ RUN_TEST(test_ServerVersionTooOld, 32);
+ RUN_TEST(test_ServerVersionTooNew, 33);
+ RUN_TEST(test_NonWantedMode, 34);
+ RUN_TEST(test_KoDRate, 35);
+ RUN_TEST(test_KoDDeny, 36);
+ RUN_TEST(test_RejectUnsyncedServer, 37);
+ RUN_TEST(test_RejectWrongResponseServerMode, 38);
+ RUN_TEST(test_AcceptNoSentPacketBroadcastMode, 39);
+ RUN_TEST(test_CorrectUnauthenticatedPacket, 40);
+ RUN_TEST(test_CorrectAuthenticatedPacketMD5, 41);
+ RUN_TEST(test_CorrectAuthenticatedPacketSHA1, 42);
return (UnityEnd());
}
diff --git a/contrib/ntp/sntp/unity/unity_internals.h b/contrib/ntp/sntp/unity/unity_internals.h
index bf1bf3d..f1cc400 100644
--- a/contrib/ntp/sntp/unity/unity_internals.h
+++ b/contrib/ntp/sntp/unity/unity_internals.h
@@ -614,7 +614,7 @@ extern const char UnityStrErr64[];
#define UNITY_TEST_ASSERT_EQUAL_PTR(expected, actual, line, message) UnityAssertEqualNumber((_U_SINT)(_UP)(expected), (_U_SINT)(_UP)(actual), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_POINTER)
#define UNITY_TEST_ASSERT_EQUAL_STRING(expected, actual, line, message) UnityAssertEqualString((const char*)(expected), (const char*)(actual), (message), (UNITY_LINE_TYPE)line)
-#define UNITY_TEST_ASSERT_EQUAL_MEMORY(expected, actual, len, line, message) UnityAssertEqualMemory((UNITY_PTR_ATTRIBUTE void*)(expected), (UNITY_PTR_ATTRIBUTE void*)(actual), (_UU32)(len), 1, (message), (UNITY_LINE_TYPE)line)
+#define UNITY_TEST_ASSERT_EQUAL_MEMORY(expected, actual, len, line, message) UnityAssertEqualMemory((UNITY_PTR_ATTRIBUTE const void*)(expected), (UNITY_PTR_ATTRIBUTE const void*)(actual), (_UU32)(len), 1, (message), (UNITY_LINE_TYPE)line)
#define UNITY_TEST_ASSERT_EQUAL_INT_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_PTR_ATTRIBUTE const void*)(expected), (UNITY_PTR_ATTRIBUTE const void*)(actual), (_UU32)(num_elements), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_INT)
#define UNITY_TEST_ASSERT_EQUAL_INT8_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_PTR_ATTRIBUTE const void*)(expected), (UNITY_PTR_ATTRIBUTE const void*)(actual), (_UU32)(num_elements), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_INT8)
diff --git a/contrib/ntp/sntp/version.c b/contrib/ntp/sntp/version.c
index eb0e92b..762eeb7 100644
--- a/contrib/ntp/sntp/version.c
+++ b/contrib/ntp/sntp/version.c
@@ -2,4 +2,4 @@
* version file for sntp
*/
#include <config.h>
-const char * Version = "sntp 4.2.8p4@1.3265-o Thu Jan 7 23:23:18 UTC 2016 (26)";
+const char * Version = "sntp 4.2.8p5@1.3265-o Wed Jan 20 09:06:36 UTC 2016 (27)";
diff --git a/contrib/ntp/tests/libntp/authkeys.c b/contrib/ntp/tests/libntp/authkeys.c
index 2ddbce5..fd11ef6 100644
--- a/contrib/ntp/tests/libntp/authkeys.c
+++ b/contrib/ntp/tests/libntp/authkeys.c
@@ -13,6 +13,7 @@
# include "openssl/rand.h"
# include "openssl/evp.h"
#endif
+#include <limits.h>
u_long current_time = 4;
int counter = 0;
@@ -27,6 +28,7 @@ void test_HaveKeyCorrect(void);
void test_HaveKeyIncorrect(void);
void test_AddWithAuthUseKey(void);
void test_EmptyKey(void);
+void test_auth_log2(void);
void
@@ -70,7 +72,7 @@ AddTrustedKey(keyid_t keyno)
* We need to add a MD5-key in addition to setting the
* trust, because authhavekey() requires type != 0.
*/
- MD5auth_setkey(keyno, KEYTYPE, NULL, 0);
+ MD5auth_setkey(keyno, KEYTYPE, NULL, 0, NULL);
authtrust(keyno, TRUE);
@@ -158,3 +160,39 @@ test_EmptyKey(void)
return;
}
+
+/* test the implementation of 'auth_log2' -- use a local copy of the code */
+
+static u_short
+auth_log2(
+ size_t x)
+{
+ int s;
+ int r = 0;
+ size_t m = ~(size_t)0;
+
+ for (s = sizeof(size_t) / 2 * CHAR_BIT; s != 0; s >>= 1) {
+ m <<= s;
+ if (x & m)
+ r += s;
+ else
+ x <<= s;
+ }
+ return (u_short)r;
+}
+
+void
+test_auth_log2(void)
+{
+ int l2;
+ size_t tv;
+
+ TEST_ASSERT_EQUAL_INT(0, auth_log2(0));
+ TEST_ASSERT_EQUAL_INT(0, auth_log2(1));
+ for (l2 = 1; l2 < sizeof(size_t)*CHAR_BIT; ++l2) {
+ tv = (size_t)1 << l2;
+ TEST_ASSERT_EQUAL_INT(l2, auth_log2( tv ));
+ TEST_ASSERT_EQUAL_INT(l2, auth_log2( tv + 1 ));
+ TEST_ASSERT_EQUAL_INT(l2, auth_log2(2*tv - 1));
+ }
+}
diff --git a/contrib/ntp/tests/libntp/decodenetnum.c b/contrib/ntp/tests/libntp/decodenetnum.c
index 0d2b0b5..64980fc 100644
--- a/contrib/ntp/tests/libntp/decodenetnum.c
+++ b/contrib/ntp/tests/libntp/decodenetnum.c
@@ -7,25 +7,30 @@
void setUp(void);
extern void test_IPv4AddressOnly(void);
extern void test_IPv4AddressWithPort(void);
-//#ifdef ISC_PLATFORM_HAVEIPV6
extern void test_IPv6AddressOnly(void);
extern void test_IPv6AddressWithPort(void);
-//#endif /* ISC_PLATFORM_HAVEIPV6 */
extern void test_IllegalAddress(void);
extern void test_IllegalCharInPort(void);
-
+/*
+ * NOTE: The IPv6 specific tests are reduced to stubs when IPv6 is
+ * disabled.
+ *
+ * ISC_PLATFORM_HAVEIPV6 checks if system has IPV6 capabilies. WANTIPV6
+ * ISC_PLATFORM_WANTIPV6 can be changed with build --disable-ipv6.
+ *
+ * If we want IPv6 but don't have it, the tests should fail, I think.
+ */
void
setUp(void)
{
init_lib();
-
- return;
}
void
-test_IPv4AddressOnly(void) {
+test_IPv4AddressOnly(void)
+{
const char *str = "192.0.2.1";
sockaddr_u actual;
@@ -39,7 +44,8 @@ test_IPv4AddressOnly(void) {
}
void
-test_IPv4AddressWithPort(void) {
+test_IPv4AddressWithPort(void)
+{
const char *str = "192.0.2.2:2000";
sockaddr_u actual;
@@ -54,15 +60,15 @@ test_IPv4AddressWithPort(void) {
void
-test_IPv6AddressOnly(void) {
-
-//#ifdef ISC_PLATFORM_HAVEIPV6 //looks like HAVEIPV6 checks if system has IPV6 capabilies. WANTIPV6 can be changed with build --disable-ipv6
+test_IPv6AddressOnly(void)
+{
#ifdef ISC_PLATFORM_WANTIPV6
+
const struct in6_addr address = {
0x20, 0x01, 0x0d, 0xb8,
- 0x85, 0xa3, 0x08, 0xd3,
- 0x13, 0x19, 0x8a, 0x2e,
- 0x03, 0x70, 0x73, 0x34
+ 0x85, 0xa3, 0x08, 0xd3,
+ 0x13, 0x19, 0x8a, 0x2e,
+ 0x03, 0x70, 0x73, 0x34
};
const char *str = "2001:0db8:85a3:08d3:1319:8a2e:0370:7334";
@@ -77,24 +83,23 @@ test_IPv6AddressOnly(void) {
TEST_ASSERT_TRUE(IsEqual(expected, actual));
#else
+
TEST_IGNORE_MESSAGE("IPV6 disabled in build, skipping.");
+
#endif /* ISC_PLATFORM_HAVEIPV6 */
-
-
}
-
void
-test_IPv6AddressWithPort(void) {
-
+test_IPv6AddressWithPort(void)
+{
#ifdef ISC_PLATFORM_WANTIPV6
const struct in6_addr address = {
0x20, 0x01, 0x0d, 0xb8,
- 0x85, 0xa3, 0x08, 0xd3,
- 0x13, 0x19, 0x8a, 0x2e,
- 0x03, 0x70, 0x73, 0x34
+ 0x85, 0xa3, 0x08, 0xd3,
+ 0x13, 0x19, 0x8a, 0x2e,
+ 0x03, 0x70, 0x73, 0x34
};
const char *str = "[2001:0db8:85a3:08d3:1319:8a2e:0370:7334]:3000";
@@ -109,21 +114,26 @@ test_IPv6AddressWithPort(void) {
TEST_ASSERT_TRUE(IsEqual(expected, actual));
#else
+
TEST_IGNORE_MESSAGE("IPV6 disabled in build, skipping.");
+
#endif /* ISC_PLATFORM_HAVEIPV6 */
}
void
-test_IllegalAddress(void) {
+test_IllegalAddress(void)
+{
const char *str = "192.0.2.270:2000";
sockaddr_u actual;
TEST_ASSERT_FALSE(decodenetnum(str, &actual));
}
+
void
-test_IllegalCharInPort(void) {
+test_IllegalCharInPort(void)
+{
/* An illegal port does not make the decodenetnum fail, but instead
* makes it use the standard port.
*/
diff --git a/contrib/ntp/tests/libntp/run-authkeys.c b/contrib/ntp/tests/libntp/run-authkeys.c
index 6a2b670..cc91876 100644
--- a/contrib/ntp/tests/libntp/run-authkeys.c
+++ b/contrib/ntp/tests/libntp/run-authkeys.c
@@ -26,6 +26,7 @@
#include "ntp.h"
#include "ntp_stdlib.h"
#include "ntp_calendar.h"
+#include <limits.h>
//=======External Functions This Runner Calls=====
extern void setUp(void);
@@ -36,6 +37,7 @@ extern void test_HaveKeyCorrect(void);
extern void test_HaveKeyIncorrect(void);
extern void test_AddWithAuthUseKey(void);
extern void test_EmptyKey(void);
+extern void test_auth_log2(void);
//=======Test Reset Option=====
@@ -54,12 +56,13 @@ int main(int argc, char *argv[])
{
progname = argv[0];
UnityBegin("authkeys.c");
- RUN_TEST(test_AddTrustedKeys, 24);
- RUN_TEST(test_AddUntrustedKey, 25);
- RUN_TEST(test_HaveKeyCorrect, 26);
- RUN_TEST(test_HaveKeyIncorrect, 27);
- RUN_TEST(test_AddWithAuthUseKey, 28);
- RUN_TEST(test_EmptyKey, 29);
+ RUN_TEST(test_AddTrustedKeys, 25);
+ RUN_TEST(test_AddUntrustedKey, 26);
+ RUN_TEST(test_HaveKeyCorrect, 27);
+ RUN_TEST(test_HaveKeyIncorrect, 28);
+ RUN_TEST(test_AddWithAuthUseKey, 29);
+ RUN_TEST(test_EmptyKey, 30);
+ RUN_TEST(test_auth_log2, 31);
return (UnityEnd());
}
diff --git a/contrib/ntp/tests/libntp/run-decodenetnum.c b/contrib/ntp/tests/libntp/run-decodenetnum.c
index 57b955c..d41f93e 100644
--- a/contrib/ntp/tests/libntp/run-decodenetnum.c
+++ b/contrib/ntp/tests/libntp/run-decodenetnum.c
@@ -55,10 +55,10 @@ int main(int argc, char *argv[])
UnityBegin("decodenetnum.c");
RUN_TEST(test_IPv4AddressOnly, 8);
RUN_TEST(test_IPv4AddressWithPort, 9);
- RUN_TEST(test_IPv6AddressOnly, 11);
- RUN_TEST(test_IPv6AddressWithPort, 12);
- RUN_TEST(test_IllegalAddress, 14);
- RUN_TEST(test_IllegalCharInPort, 15);
+ RUN_TEST(test_IPv6AddressOnly, 10);
+ RUN_TEST(test_IPv6AddressWithPort, 11);
+ RUN_TEST(test_IllegalAddress, 12);
+ RUN_TEST(test_IllegalCharInPort, 13);
return (UnityEnd());
}
diff --git a/contrib/ntp/tests/libntp/run-socktoa.c b/contrib/ntp/tests/libntp/run-socktoa.c
index df6ec9c..bde07ed 100644
--- a/contrib/ntp/tests/libntp/run-socktoa.c
+++ b/contrib/ntp/tests/libntp/run-socktoa.c
@@ -55,11 +55,11 @@ int main(int argc, char *argv[])
progname = argv[0];
UnityBegin("socktoa.c");
RUN_TEST(test_IPv4AddressWithPort, 11);
- RUN_TEST(test_IPv6AddressWithPort, 13);
- RUN_TEST(test_IgnoreIPv6Fields, 14);
- RUN_TEST(test_ScopedIPv6AddressWithPort, 16);
- RUN_TEST(test_HashEqual, 17);
- RUN_TEST(test_HashNotEqual, 18);
+ RUN_TEST(test_IPv6AddressWithPort, 12);
+ RUN_TEST(test_IgnoreIPv6Fields, 13);
+ RUN_TEST(test_ScopedIPv6AddressWithPort, 14);
+ RUN_TEST(test_HashEqual, 15);
+ RUN_TEST(test_HashNotEqual, 16);
return (UnityEnd());
}
diff --git a/contrib/ntp/tests/libntp/socktoa.c b/contrib/ntp/tests/libntp/socktoa.c
index 8423106..e9be182 100644
--- a/contrib/ntp/tests/libntp/socktoa.c
+++ b/contrib/ntp/tests/libntp/socktoa.c
@@ -9,10 +9,8 @@
void setUp(void);
void test_IPv4AddressWithPort(void);
-//#ifdef ISC_PLATFORM_HAVEIPV6
void test_IPv6AddressWithPort(void);
void test_IgnoreIPv6Fields(void);
-//#endif /* ISC_PLATFORM_HAVEIPV6 */
void test_ScopedIPv6AddressWithPort(void);
void test_HashEqual(void);
void test_HashNotEqual(void);
@@ -22,13 +20,12 @@ void
setUp(void)
{
init_lib();
-
- return;
}
void
-test_IPv4AddressWithPort(void) {
+test_IPv4AddressWithPort(void)
+{
sockaddr_u input = CreateSockaddr4("192.0.2.10", 123);
TEST_ASSERT_EQUAL_STRING("192.0.2.10", socktoa(&input));
@@ -37,8 +34,8 @@ test_IPv4AddressWithPort(void) {
void
-test_IPv6AddressWithPort(void) {
-
+test_IPv6AddressWithPort(void)
+{
#ifdef ISC_PLATFORM_WANTIPV6
const struct in6_addr address = {
@@ -63,16 +60,18 @@ test_IPv6AddressWithPort(void) {
TEST_ASSERT_EQUAL_STRING(expected_port, sockporttoa(&input));
#else
+
TEST_IGNORE_MESSAGE("IPV6 disabled in build, skipping.");
#endif /* ISC_PLATFORM_HAVEIPV6 */
-
}
void
-test_ScopedIPv6AddressWithPort(void) {
+test_ScopedIPv6AddressWithPort(void)
+{
#ifdef ISC_PLATFORM_HAVESCOPEID
+
const struct in6_addr address = { { {
0xfe, 0x80, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
@@ -95,12 +94,16 @@ test_ScopedIPv6AddressWithPort(void) {
TEST_ASSERT_EQUAL_STRING(expected, socktoa(&input));
TEST_ASSERT_EQUAL_STRING(expected_port, sockporttoa(&input));
#else
+
TEST_IGNORE_MESSAGE("Skipping because ISC_PLATFORM does not have Scope ID");
+
#endif
}
+
void
-test_HashEqual(void) {
+test_HashEqual(void)
+{
sockaddr_u input1 = CreateSockaddr4("192.00.2.2", 123);
sockaddr_u input2 = CreateSockaddr4("192.0.2.2", 123);
@@ -108,8 +111,10 @@ test_HashEqual(void) {
TEST_ASSERT_EQUAL(sock_hash(&input1), sock_hash(&input2));
}
+
void
-test_HashNotEqual(void) {
+test_HashNotEqual(void)
+{
/* These two addresses should not generate the same hash. */
sockaddr_u input1 = CreateSockaddr4("192.0.2.1", 123);
sockaddr_u input2 = CreateSockaddr4("192.0.2.2", 123);
@@ -120,15 +125,15 @@ test_HashNotEqual(void) {
void
-test_IgnoreIPv6Fields(void) {
-
+test_IgnoreIPv6Fields(void)
+{
#ifdef ISC_PLATFORM_WANTIPV6
const struct in6_addr address = {
0x20, 0x01, 0x0d, 0xb8,
- 0x85, 0xa3, 0x08, 0xd3,
- 0x13, 0x19, 0x8a, 0x2e,
- 0x03, 0x70, 0x73, 0x34
+ 0x85, 0xa3, 0x08, 0xd3,
+ 0x13, 0x19, 0x8a, 0x2e,
+ 0x03, 0x70, 0x73, 0x34
};
sockaddr_u input1, input2;
@@ -146,7 +151,8 @@ test_IgnoreIPv6Fields(void) {
TEST_ASSERT_EQUAL(sock_hash(&input1), sock_hash(&input2));
#else
+
TEST_IGNORE_MESSAGE("IPV6 disabled in build, skipping.");
+
#endif /* ISC_PLATFORM_HAVEIPV6 */
}
-
diff --git a/contrib/ntp/tests/ntpd/t-ntp_signd.c b/contrib/ntp/tests/ntpd/t-ntp_signd.c
index 534c940..40e7ac0 100644
--- a/contrib/ntp/tests/ntpd/t-ntp_signd.c
+++ b/contrib/ntp/tests/ntpd/t-ntp_signd.c
@@ -139,6 +139,7 @@ test_send_packet(void)
void
test_recv_packet(void)
{
+#if 0
int fd = ux_socket_connect("/socket");
TEST_ASSERT_TRUE(isGE(fd, 0));
@@ -152,6 +153,9 @@ test_recv_packet(void)
TEST_ASSERT_EQUAL(0,temp); //0 because nobody sent us anything (yet!)
(void)close(fd);
+#else
+ TEST_IGNORE_MESSAGE("test_recv_packet() needs work");
+#endif
return;
}
diff --git a/contrib/ntp/util/invoke-ntp-keygen.texi b/contrib/ntp/util/invoke-ntp-keygen.texi
index 36a1a42..f152453 100644
--- a/contrib/ntp/util/invoke-ntp-keygen.texi
+++ b/contrib/ntp/util/invoke-ntp-keygen.texi
@@ -6,7 +6,7 @@
#
# EDIT THIS FILE WITH CAUTION (invoke-ntp-keygen.texi)
#
-# It has been AutoGen-ed January 7, 2016 at 11:32:40 PM by AutoGen 5.18.5
+# It has been AutoGen-ed January 20, 2016 at 04:19:48 AM by AutoGen 5.18.5
# From the definitions ntp-keygen-opts.def
# and the template file agtexi-cmd.tpl
@end ignore
@@ -886,7 +886,7 @@ with a status code of 0.
@exampleindent 0
@example
-ntp-keygen (ntp) - Create a NTP host key - Ver. 4.2.8p5
+ntp-keygen (ntp) - Create a NTP host key - Ver. 4.2.8p6
Usage: ntp-keygen [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]...
Flg Arg Option-Name Description
-b Num imbits identity modulus bits
diff --git a/contrib/ntp/util/ntp-keygen-opts.c b/contrib/ntp/util/ntp-keygen-opts.c
index f41bff4..ee4f440 100644
--- a/contrib/ntp/util/ntp-keygen-opts.c
+++ b/contrib/ntp/util/ntp-keygen-opts.c
@@ -1,7 +1,7 @@
/*
* EDIT THIS FILE WITH CAUTION (ntp-keygen-opts.c)
*
- * It has been AutoGen-ed January 7, 2016 at 11:32:25 PM by AutoGen 5.18.5
+ * It has been AutoGen-ed January 20, 2016 at 04:19:33 AM by AutoGen 5.18.5
* From the definitions ntp-keygen-opts.def
* and the template file options
*
@@ -18,7 +18,7 @@
* The ntp-keygen program is copyrighted and licensed
* under the following terms:
*
- * Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation, all rights reserved.
+ * Copyright (C) 1992-2016 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:
@@ -72,8 +72,8 @@ extern FILE * option_usage_fp;
* static const strings for ntp-keygen options
*/
static char const ntp_keygen_opt_strs[2419] =
-/* 0 */ "ntp-keygen (ntp) 4.2.8p5\n"
- "Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation, all rights reserved.\n"
+/* 0 */ "ntp-keygen (ntp) 4.2.8p6\n"
+ "Copyright (C) 1992-2016 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"
@@ -164,14 +164,14 @@ static char const ntp_keygen_opt_strs[2419] =
/* 2202 */ "no-load-opts\0"
/* 2215 */ "no\0"
/* 2218 */ "NTP_KEYGEN\0"
-/* 2229 */ "ntp-keygen (ntp) - Create a NTP host key - Ver. 4.2.8p5\n"
+/* 2229 */ "ntp-keygen (ntp) - Create a NTP host key - Ver. 4.2.8p6\n"
"Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]...\n\0"
/* 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.8p5";
+/* 2394 */ "ntp-keygen (ntp) 4.2.8p6";
/**
* imbits option description:
@@ -1309,8 +1309,8 @@ static void bogus_function(void) {
translate option names.
*/
/* referenced via ntp_keygenOptions.pzCopyright */
- puts(_("ntp-keygen (ntp) 4.2.8p5\n\
-Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation, all rights reserved.\n\
+ puts(_("ntp-keygen (ntp) 4.2.8p6\n\
+Copyright (C) 1992-2016 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"));
@@ -1408,14 +1408,14 @@ implied warranty.\n"));
puts(_("load options from a config file"));
/* referenced via ntp_keygenOptions.pzUsageTitle */
- puts(_("ntp-keygen (ntp) - Create a NTP host key - Ver. 4.2.8p5\n\
+ puts(_("ntp-keygen (ntp) - Create a NTP host key - Ver. 4.2.8p6\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.8p5"));
+ puts(_("ntp-keygen (ntp) 4.2.8p6"));
/* referenced via ntp_keygenOptions.pzFullUsage */
puts(_("<<<NOT-FOUND>>>"));
diff --git a/contrib/ntp/util/ntp-keygen-opts.h b/contrib/ntp/util/ntp-keygen-opts.h
index 1205494..35e507f 100644
--- a/contrib/ntp/util/ntp-keygen-opts.h
+++ b/contrib/ntp/util/ntp-keygen-opts.h
@@ -1,7 +1,7 @@
/*
* EDIT THIS FILE WITH CAUTION (ntp-keygen-opts.h)
*
- * It has been AutoGen-ed January 7, 2016 at 11:32:24 PM by AutoGen 5.18.5
+ * It has been AutoGen-ed January 20, 2016 at 04:19:32 AM by AutoGen 5.18.5
* From the definitions ntp-keygen-opts.def
* and the template file options
*
@@ -18,7 +18,7 @@
* The ntp-keygen program is copyrighted and licensed
* under the following terms:
*
- * Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation, all rights reserved.
+ * Copyright (C) 1992-2016 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:
@@ -94,9 +94,9 @@ typedef enum {
/** count of all options for ntp-keygen */
#define OPTION_CT 26
/** ntp-keygen version */
-#define NTP_KEYGEN_VERSION "4.2.8p5"
+#define NTP_KEYGEN_VERSION "4.2.8p6"
/** Full ntp-keygen version text */
-#define NTP_KEYGEN_FULL_VERSION "ntp-keygen (ntp) 4.2.8p5"
+#define NTP_KEYGEN_FULL_VERSION "ntp-keygen (ntp) 4.2.8p6"
/**
* Interface defines for all options. Replace "n" with the UPPER_CASED
diff --git a/contrib/ntp/util/ntp-keygen.1ntp-keygenman b/contrib/ntp/util/ntp-keygen.1ntp-keygenman
index 195e3d2..7bd53bc 100644
--- a/contrib/ntp/util/ntp-keygen.1ntp-keygenman
+++ b/contrib/ntp/util/ntp-keygen.1ntp-keygenman
@@ -10,11 +10,11 @@
.ds B-Font B
.ds I-Font I
.ds R-Font R
-.TH ntp-keygen 1ntp-keygenman "07 Jan 2016" "ntp (4.2.8p5)" "User Commands"
+.TH ntp-keygen 1ntp-keygenman "20 Jan 2016" "ntp (4.2.8p6)" "User Commands"
.\"
-.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-LNaiiw/ag-XNaahw)
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-Dua4pY/ag-PuaWoY)
.\"
-.\" It has been AutoGen-ed January 7, 2016 at 11:32:36 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed January 20, 2016 at 04:19:44 AM by AutoGen 5.18.5
.\" From the definitions ntp-keygen-opts.def
.\" and the template file agman-cmd.tpl
.SH NAME
@@ -1197,7 +1197,7 @@ it to autogen-users@lists.sourceforge.net. Thank you.
.SH "AUTHORS"
The University of Delaware and Network Time Foundation
.SH "COPYRIGHT"
-Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation all rights reserved.
+Copyright (C) 1992-2016 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 --git a/contrib/ntp/util/ntp-keygen.1ntp-keygenmdoc b/contrib/ntp/util/ntp-keygen.1ntp-keygenmdoc
index 18c38fb..1c69520 100644
--- a/contrib/ntp/util/ntp-keygen.1ntp-keygenmdoc
+++ b/contrib/ntp/util/ntp-keygen.1ntp-keygenmdoc
@@ -1,9 +1,9 @@
-.Dd January 7 2016
+.Dd January 20 2016
.Dt NTP_KEYGEN 1ntp-keygenmdoc User Commands
.Os
.\" EDIT THIS FILE WITH CAUTION (ntp-keygen-opts.mdoc)
.\"
-.\" It has been AutoGen-ed January 7, 2016 at 11:32:43 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed January 20, 2016 at 04:19:51 AM by AutoGen 5.18.5
.\" From the definitions ntp-keygen-opts.def
.\" and the template file agmdoc-cmd.tpl
.Sh NAME
@@ -1053,7 +1053,7 @@ it to autogen\-users@lists.sourceforge.net. Thank you.
.Sh "AUTHORS"
The University of Delaware and Network Time Foundation
.Sh "COPYRIGHT"
-Copyright (C) 1992\-2015 The University of Delaware and Network Time Foundation all rights reserved.
+Copyright (C) 1992\-2016 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 --git a/contrib/ntp/util/ntp-keygen.html b/contrib/ntp/util/ntp-keygen.html
index f7a6073..76a7c09 100644
--- a/contrib/ntp/util/ntp-keygen.html
+++ b/contrib/ntp/util/ntp-keygen.html
@@ -70,7 +70,7 @@ All other files are in PEM-encoded
printable ASCII format so they can be embedded as MIME attachments in
mail to other sites.
- <p>This document applies to version 4.2.8p5 of <code>ntp-keygen</code>.
+ <p>This document applies to version 4.2.8p6 of <code>ntp-keygen</code>.
<div class="node">
<p><hr>
@@ -1085,7 +1085,7 @@ the usage text by passing it through a pager program.
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.8p4
+<pre class="example">ntp-keygen (ntp) - Create a NTP host key - Ver. 4.2.8p5
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 --git a/contrib/ntp/util/ntp-keygen.man.in b/contrib/ntp/util/ntp-keygen.man.in
index c76c4df..b5a741d 100644
--- a/contrib/ntp/util/ntp-keygen.man.in
+++ b/contrib/ntp/util/ntp-keygen.man.in
@@ -10,11 +10,11 @@
.ds B-Font B
.ds I-Font I
.ds R-Font R
-.TH ntp-keygen @NTP_KEYGEN_MS@ "07 Jan 2016" "ntp (4.2.8p5)" "User Commands"
+.TH ntp-keygen @NTP_KEYGEN_MS@ "20 Jan 2016" "ntp (4.2.8p6)" "User Commands"
.\"
-.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-LNaiiw/ag-XNaahw)
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-Dua4pY/ag-PuaWoY)
.\"
-.\" It has been AutoGen-ed January 7, 2016 at 11:32:36 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed January 20, 2016 at 04:19:44 AM by AutoGen 5.18.5
.\" From the definitions ntp-keygen-opts.def
.\" and the template file agman-cmd.tpl
.SH NAME
@@ -1197,7 +1197,7 @@ it to autogen-users@lists.sourceforge.net. Thank you.
.SH "AUTHORS"
The University of Delaware and Network Time Foundation
.SH "COPYRIGHT"
-Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation all rights reserved.
+Copyright (C) 1992-2016 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 --git a/contrib/ntp/util/ntp-keygen.mdoc.in b/contrib/ntp/util/ntp-keygen.mdoc.in
index 9e6675b..37ecafb 100644
--- a/contrib/ntp/util/ntp-keygen.mdoc.in
+++ b/contrib/ntp/util/ntp-keygen.mdoc.in
@@ -1,9 +1,9 @@
-.Dd January 7 2016
+.Dd January 20 2016
.Dt NTP_KEYGEN @NTP_KEYGEN_MS@ User Commands
.Os
.\" EDIT THIS FILE WITH CAUTION (ntp-keygen-opts.mdoc)
.\"
-.\" It has been AutoGen-ed January 7, 2016 at 11:32:43 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed January 20, 2016 at 04:19:51 AM by AutoGen 5.18.5
.\" From the definitions ntp-keygen-opts.def
.\" and the template file agmdoc-cmd.tpl
.Sh NAME
@@ -1053,7 +1053,7 @@ it to autogen\-users@lists.sourceforge.net. Thank you.
.Sh "AUTHORS"
The University of Delaware and Network Time Foundation
.Sh "COPYRIGHT"
-Copyright (C) 1992\-2015 The University of Delaware and Network Time Foundation all rights reserved.
+Copyright (C) 1992\-2016 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 --git a/contrib/openpam/CREDITS b/contrib/openpam/CREDITS
index 0a22fc4..c14f7ea 100644
--- a/contrib/openpam/CREDITS
+++ b/contrib/openpam/CREDITS
@@ -21,6 +21,7 @@ ideas:
Christos Zoulas <christos@netbsd.org>
Daniel Richard G. <skunk@iskunk.org>
Darren J. Moffat <darren.moffat@sun.com>
+ Dimitry Andric <dim@freebsd.org>
Dmitry V. Levin <ldv@altlinux.org>
Don Lewis <truckman@freebsd.org>
Emmanuel Dreyfus <manu@netbsd.org>
@@ -32,9 +33,9 @@ ideas:
Hubert Feyrer <hubert@feyrer.de>
Jason Evans <jasone@freebsd.org>
Joe Marcus Clarke <marcus@freebsd.org>
- Juli Mallett <jmallett@freebsd.org>
- Ankita Pal <pal.ankita.ankita@gmail.com>
Jörg Sonnenberger <joerg@britannica.bec.de>
+ Juli Mallett <jmallett@freebsd.org>
+ Larry Baird <lab@gta.com>
Maëlle Lesage <lesage.maelle@gmail.com>
Mark Murray <markm@freebsd.org>
Matthias Drochner <drochner@netbsd.org>
diff --git a/contrib/openpam/configure.ac b/contrib/openpam/configure.ac
index 1412b7a..bf7f905 100644
--- a/contrib/openpam/configure.ac
+++ b/contrib/openpam/configure.ac
@@ -110,7 +110,7 @@ AC_SUBST(CRYPTO_LIBS)
AC_ARG_ENABLE([developer-warnings],
AS_HELP_STRING([--enable-developer-warnings], [enable strict warnings (default is NO)]),
- [CFLAGS="${CFLAGS} -Wall -Wextra"])
+ [CFLAGS="${CFLAGS} -Wall -Wextra -Wcast-qual"])
AC_ARG_ENABLE([debugging-symbols],
AS_HELP_STRING([--enable-debugging-symbols], [enable debugging symbols (default is NO)]),
[CFLAGS="${CFLAGS} -O0 -g -fno-inline"])
diff --git a/contrib/openpam/lib/libpam/openpam_constants.c b/contrib/openpam/lib/libpam/openpam_constants.c
index 1cdd810..b718af9 100644
--- a/contrib/openpam/lib/libpam/openpam_constants.c
+++ b/contrib/openpam/lib/libpam/openpam_constants.c
@@ -137,6 +137,9 @@ const char *openpam_policy_path[] = {
const char *openpam_module_path[] = {
#ifdef OPENPAM_MODULES_DIRECTORY
OPENPAM_MODULES_DIRECTORY,
+#elif COMPAT_32BIT
+ "/usr/lib32",
+ "/usr/local/lib32",
#else
"/usr/lib",
"/usr/local/lib",
diff --git a/contrib/openpam/lib/libpam/openpam_ctype.h b/contrib/openpam/lib/libpam/openpam_ctype.h
index 5c62185..d99d34b 100644
--- a/contrib/openpam/lib/libpam/openpam_ctype.h
+++ b/contrib/openpam/lib/libpam/openpam_ctype.h
@@ -39,10 +39,18 @@
(ch >= '0' && ch <= '9')
/*
+ * Evaluates to non-zero if the argument is a hex digit.
+ */
+#define is_xdigit(ch) \
+ ((ch >= '0' && ch <= '9') || \
+ (ch >= 'a' && ch <= 'f') || \
+ (ch >= 'A' && ch <= 'F'))
+
+/*
* Evaluates to non-zero if the argument is an uppercase letter.
*/
#define is_upper(ch) \
- (ch >= 'A' && ch <= 'A')
+ (ch >= 'A' && ch <= 'Z')
/*
* Evaluates to non-zero if the argument is a lowercase letter.
diff --git a/contrib/openpam/lib/libpam/openpam_dispatch.c b/contrib/openpam/lib/libpam/openpam_dispatch.c
index 5fa068f..0cff631 100644
--- a/contrib/openpam/lib/libpam/openpam_dispatch.c
+++ b/contrib/openpam/lib/libpam/openpam_dispatch.c
@@ -117,7 +117,7 @@ openpam_dispatch(pam_handle_t *pamh,
openpam_log(PAM_LOG_LIBDEBUG, "calling %s() in %s",
pam_sm_func_name[primitive], chain->module->path);
r = (chain->module->func[primitive])(pamh, flags,
- chain->optc, (const char **)chain->optv);
+ chain->optc, (const char **)(intptr_t)chain->optv);
pamh->current = NULL;
openpam_log(PAM_LOG_LIBDEBUG, "%s: %s(): %s",
chain->module->path, pam_sm_func_name[primitive],
diff --git a/contrib/openpam/modules/pam_unix/pam_unix.c b/contrib/openpam/modules/pam_unix/pam_unix.c
index ad7dd1b..f76651d 100644
--- a/contrib/openpam/modules/pam_unix/pam_unix.c
+++ b/contrib/openpam/modules/pam_unix/pam_unix.c
@@ -74,7 +74,7 @@ pam_sm_authenticate(pam_handle_t *pamh, int flags,
#endif
struct passwd *pwd;
const char *user;
- char *crypt_password, *password;
+ const char *crypt_password, *password;
int pam_err, retry;
(void)argc;
@@ -98,7 +98,7 @@ pam_sm_authenticate(pam_handle_t *pamh, int flags,
for (retry = 0; retry < 3; ++retry) {
#ifdef OPENPAM
pam_err = pam_get_authtok(pamh, PAM_AUTHTOK,
- (const char **)&password, NULL);
+ &password, NULL);
#else
resp = NULL;
pam_err = (*conv->conv)(1, &msgp, &resp, conv->appdata_ptr);
diff --git a/contrib/openpam/t/Makefile.am b/contrib/openpam/t/Makefile.am
index 5f6a251..bf3801b 100644
--- a/contrib/openpam/t/Makefile.am
+++ b/contrib/openpam/t/Makefile.am
@@ -6,6 +6,7 @@ noinst_HEADERS = t.h
# tests
TESTS =
+TESTS += t_openpam_ctype
TESTS += t_openpam_readword
TESTS += t_openpam_readlinev
check_PROGRAMS = $(TESTS)
diff --git a/contrib/openpam/t/t_openpam_ctype.c b/contrib/openpam/t/t_openpam_ctype.c
new file mode 100644
index 0000000..e97a446
--- /dev/null
+++ b/contrib/openpam/t/t_openpam_ctype.c
@@ -0,0 +1,122 @@
+/*-
+ * Copyright (c) 2014 Dag-Erling Smørgrav
+ * 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.
+ * 3. The name of the author may not be used to endorse or promote
+ * products derived from this software without specific prior written
+ * permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``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 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.
+ *
+ * $Id$
+ */
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <stdio.h>
+#include <string.h>
+
+#include "openpam_ctype.h"
+
+#include "t.h"
+
+#define OC_DIGIT "0123456789"
+#define OC_XDIGIT OC_DIGIT "ABCDEFabcdef"
+#define OC_UPPER "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
+#define OC_LOWER "abcdefghijklmnopqrstuvwxyz"
+#define OC_LETTER OC_UPPER OC_LOWER
+#define OC_LWS " \t\f\r"
+#define OC_WS OC_LWS "\n"
+#define OC_P "!\"#$%&'()*+,-./" OC_DIGIT ":;<=>?@" OC_UPPER "[\\]^_`" OC_LOWER "{|}~"
+#define OC_PFCS OC_DIGIT OC_LETTER "._-"
+
+static const char oc_digit[] = OC_DIGIT;
+static const char oc_xdigit[] = OC_XDIGIT;
+static const char oc_upper[] = OC_UPPER;
+static const char oc_lower[] = OC_LOWER;
+static const char oc_letter[] = OC_LETTER;
+static const char oc_lws[] = OC_LWS;
+static const char oc_ws[] = OC_WS;
+static const char oc_p[] = OC_P;
+static const char oc_pfcs[] = OC_PFCS;
+
+#define T_OC(set) \
+ T_FUNC(t_oc_##set, "is_" #set) \
+ { \
+ char crib[256]; \
+ unsigned int i, ret; \
+ \
+ memset(crib, 0, sizeof crib); \
+ for (i = 0; oc_##set[i]; ++i) \
+ crib[(int)oc_##set[i]] = 1; \
+ for (i = ret = 0; i < sizeof crib; ++i) { \
+ if (is_##set(i) != crib[i]) { \
+ t_verbose("is_%s() incorrect " \
+ "for %#02x\n", #set, i); \
+ ++ret; \
+ } \
+ } \
+ return (ret == 0); \
+ }
+
+T_OC(digit)
+T_OC(xdigit)
+T_OC(upper)
+T_OC(lower)
+T_OC(letter)
+T_OC(lws)
+T_OC(ws)
+T_OC(p)
+T_OC(pfcs)
+
+
+/***************************************************************************
+ * Boilerplate
+ */
+
+static const struct t_test *t_plan[] = {
+ T(t_oc_digit),
+ T(t_oc_xdigit),
+ T(t_oc_upper),
+ T(t_oc_lower),
+ T(t_oc_letter),
+ T(t_oc_lws),
+ T(t_oc_ws),
+ T(t_oc_p),
+ T(t_oc_pfcs),
+ NULL
+};
+
+const struct t_test **
+t_prepare(int argc, char *argv[])
+{
+
+ (void)argc;
+ (void)argv;
+ return (t_plan);
+}
+
+void
+t_cleanup(void)
+{
+}
diff --git a/contrib/openpam/t/t_openpam_readlinev.c b/contrib/openpam/t/t_openpam_readlinev.c
index 59f2b10..9820f6e 100644
--- a/contrib/openpam/t/t_openpam_readlinev.c
+++ b/contrib/openpam/t/t_openpam_readlinev.c
@@ -255,7 +255,7 @@ T_FUNC(unterminated_line, "unterminated line")
* Boilerplate
*/
-const struct t_test *t_plan[] = {
+static const struct t_test *t_plan[] = {
T(empty_input),
T(empty_line),
T(unterminated_empty_line),
diff --git a/contrib/openpam/t/t_openpam_readword.c b/contrib/openpam/t/t_openpam_readword.c
index d2d6bd5..804c745 100644
--- a/contrib/openpam/t/t_openpam_readword.c
+++ b/contrib/openpam/t/t_openpam_readword.c
@@ -823,7 +823,7 @@ T_FUNC(escaped_double_quote_within_double_quotes,
* Boilerplate
*/
-const struct t_test *t_plan[] = {
+static const struct t_test *t_plan[] = {
T(empty_input),
T(empty_line),
T(single_whitespace),
diff --git a/contrib/smbfs/lib/smb/nb_name.c b/contrib/smbfs/lib/smb/nb_name.c
index 2346ec7..a953ce0 100644
--- a/contrib/smbfs/lib/smb/nb_name.c
+++ b/contrib/smbfs/lib/smb/nb_name.c
@@ -143,15 +143,13 @@ nb_encname_len(const char *str)
return len;
}
-#define NBENCODE(c) (htole16((u_short)(((u_char)(c) >> 4) | \
- (((u_char)(c) & 0xf) << 8)) + 0x4141))
-
-static void
-memsetw(char *dst, int n, u_short word)
+static inline void
+nb_char_encode(u_char **ptr, u_char c, int n)
{
+
while (n--) {
- *(u_short*)dst = word;
- dst += 2;
+ *(*ptr)++ = 0x41 + (c >> 4);
+ *(*ptr)++ = 0x41 + (c & 0x0f);
}
}
@@ -165,19 +163,15 @@ nb_name_encode(struct nb_name *np, u_char *dst)
*cp++ = NB_ENCNAMELEN;
name = np->nn_name;
if (name[0] == '*' && name[1] == 0) {
- *(u_short*)cp = NBENCODE('*');
- memsetw(cp + 2, NB_NAMELEN - 1, NBENCODE(' '));
- cp += NB_ENCNAMELEN;
+ nb_char_encode(&cp, '*', 1);
+ nb_char_encode(&cp, ' ', NB_NAMELEN - 1);
} else {
- for (i = 0; *name && i < NB_NAMELEN - 1; i++, cp += 2, name++)
- *(u_short*)cp = NBENCODE(toupper(*name));
- i = NB_NAMELEN - i - 1;
- if (i > 0) {
- memsetw(cp, i, NBENCODE(' '));
- cp += i * 2;
- }
- *(u_short*)cp = NBENCODE(np->nn_type);
- cp += 2;
+ for (i = 0; i < NB_NAMELEN - 1; i++)
+ if (*name != 0)
+ nb_char_encode(&cp, toupper(*name++), 1);
+ else
+ nb_char_encode(&cp, ' ', 1);
+ nb_char_encode(&cp, np->nn_type, 1);
}
*cp = 0;
if (np->nn_scope == NULL)
diff --git a/contrib/unbound/.gitignore b/contrib/unbound/.gitignore
new file mode 100644
index 0000000..7fed8d7
--- /dev/null
+++ b/contrib/unbound/.gitignore
@@ -0,0 +1,38 @@
+*.lo
+*.o
+/.libs/
+/Makefile
+/autom4te.cache/
+/config.h
+/config.log
+/config.status
+/dnstap/dnstap_config.h
+/doc/example.conf
+/doc/libunbound.3
+/doc/unbound-anchor.8
+/doc/unbound-checkconf.8
+/doc/unbound-control.8
+/doc/unbound-host.1
+/doc/unbound.8
+/doc/unbound.conf.5
+/libtool
+/libunbound.la
+/smallapp/unbound-control-setup.sh
+/unbound
+/unbound-anchor
+/unbound-checkconf
+/unbound-control
+/unbound-control-setup
+/unbound-host
+/unbound.h
+/asynclook
+/delayer
+/lock-verify
+/memstats
+/perf
+/petal
+/pktview
+/streamtcp
+/testbound
+/unittest
+
diff --git a/contrib/unbound/Makefile.in b/contrib/unbound/Makefile.in
index 20829d8..282c7d6 100644
--- a/contrib/unbound/Makefile.in
+++ b/contrib/unbound/Makefile.in
@@ -38,6 +38,7 @@ UNBOUND_VERSION_MINOR=@UNBOUND_VERSION_MINOR@
UNBOUND_VERSION_MICRO=@UNBOUND_VERSION_MICRO@
ALLTARGET=@ALLTARGET@
INSTALLTARGET=@INSTALLTARGET@
+SSLLIB=@SSLLIB@
# _unbound.la if pyunbound enabled.
PYUNBOUND_TARGET=@PYUNBOUND_TARGET@
@@ -132,7 +133,7 @@ compat/memcmp.c compat/memmove.c compat/snprintf.c compat/strlcat.c \
compat/strlcpy.c compat/strptime.c compat/getentropy_linux.c \
compat/getentropy_osx.c compat/getentropy_solaris.c compat/getentropy_win.c \
compat/explicit_bzero.c compat/arc4random.c compat/arc4random_uniform.c \
-compat/arc4_lock.c compat/sha512.c compat/reallocarray.c
+compat/arc4_lock.c compat/sha512.c compat/reallocarray.c compat/isblank.c
COMPAT_OBJ=$(LIBOBJS:.o=.lo)
COMPAT_OBJ_WITHOUT_CTIME=$(LIBOBJ_WITHOUT_CTIME:.o=.lo)
COMPAT_OBJ_WITHOUT_CTIMEARC4=$(LIBOBJ_WITHOUT_CTIMEARC4:.o=.lo)
@@ -295,22 +296,22 @@ longtest: tests
lib: libunbound.la unbound.h
libunbound.la: $(LIBUNBOUND_OBJ_LINK)
- $(LINK_LIB) $(UBSYMS) -o $@ $(LIBUNBOUND_OBJ_LINK) -rpath $(libdir) -lssl $(LIBS)
+ $(LINK_LIB) $(UBSYMS) -o $@ $(LIBUNBOUND_OBJ_LINK) -rpath $(libdir) $(SSLLIB) $(LIBS)
unbound$(EXEEXT): $(DAEMON_OBJ_LINK) libunbound.la
- $(LINK) -o $@ $(DAEMON_OBJ_LINK) $(EXTRALINK) -lssl $(LIBS)
+ $(LINK) -o $@ $(DAEMON_OBJ_LINK) $(EXTRALINK) $(SSLLIB) $(LIBS)
unbound-checkconf$(EXEEXT): $(CHECKCONF_OBJ_LINK) libunbound.la
- $(LINK) -o $@ $(CHECKCONF_OBJ_LINK) $(EXTRALINK) -lssl $(LIBS)
+ $(LINK) -o $@ $(CHECKCONF_OBJ_LINK) $(EXTRALINK) $(SSLLIB) $(LIBS)
unbound-control$(EXEEXT): $(CONTROL_OBJ_LINK) libunbound.la
- $(LINK) -o $@ $(CONTROL_OBJ_LINK) $(EXTRALINK) -lssl $(LIBS)
+ $(LINK) -o $@ $(CONTROL_OBJ_LINK) $(EXTRALINK) $(SSLLIB) $(LIBS)
unbound-host$(EXEEXT): $(HOST_OBJ_LINK) libunbound.la
$(LINK) -o $@ $(HOST_OBJ_LINK) -L. -L.libs -lunbound $(LIBS)
unbound-anchor$(EXEEXT): $(UBANCHOR_OBJ_LINK) libunbound.la
- $(LINK) -o $@ $(UBANCHOR_OBJ_LINK) -L. -L.libs -lunbound -lexpat -lssl $(LIBS)
+ $(LINK) -o $@ $(UBANCHOR_OBJ_LINK) -L. -L.libs -lunbound -lexpat $(SSLLIB) $(LIBS)
unbound-service-install$(EXEEXT): $(SVCINST_OBJ_LINK)
$(LINK) -o $@ $(SVCINST_OBJ_LINK) $(LIBS)
@@ -322,37 +323,37 @@ anchor-update$(EXEEXT): $(ANCHORUPD_OBJ_LINK) libunbound.la
$(LINK) -o $@ $(ANCHORUPD_OBJ_LINK) -L. -L.libs -lunbound $(LIBS)
unittest$(EXEEXT): $(UNITTEST_OBJ_LINK)
- $(LINK) -o $@ $(UNITTEST_OBJ_LINK) -lssl $(LIBS)
+ $(LINK) -o $@ $(UNITTEST_OBJ_LINK) $(SSLLIB) $(LIBS)
testbound$(EXEEXT): $(TESTBOUND_OBJ_LINK)
- $(LINK) -o $@ $(TESTBOUND_OBJ_LINK) -lssl $(LIBS)
+ $(LINK) -o $@ $(TESTBOUND_OBJ_LINK) $(SSLLIB) $(LIBS)
lock-verify$(EXEEXT): $(LOCKVERIFY_OBJ_LINK)
- $(LINK) -o $@ $(LOCKVERIFY_OBJ_LINK) -lssl $(LIBS)
+ $(LINK) -o $@ $(LOCKVERIFY_OBJ_LINK) $(SSLLIB) $(LIBS)
petal$(EXEEXT): $(PETAL_OBJ_LINK)
- $(LINK) -o $@ $(PETAL_OBJ_LINK) -lssl $(LIBS)
+ $(LINK) -o $@ $(PETAL_OBJ_LINK) $(SSLLIB) $(LIBS)
pktview$(EXEEXT): $(PKTVIEW_OBJ_LINK)
- $(LINK) -o $@ $(PKTVIEW_OBJ_LINK) -lssl $(LIBS)
+ $(LINK) -o $@ $(PKTVIEW_OBJ_LINK) $(SSLLIB) $(LIBS)
memstats$(EXEEXT): $(MEMSTATS_OBJ_LINK)
- $(LINK) -o $@ $(MEMSTATS_OBJ_LINK) -lssl $(LIBS)
+ $(LINK) -o $@ $(MEMSTATS_OBJ_LINK) $(SSLLIB) $(LIBS)
asynclook$(EXEEXT): $(ASYNCLOOK_OBJ_LINK) libunbound.la
$(LINK) -o $@ $(ASYNCLOOK_OBJ_LINK) $(LIBS) -L. -L.libs -lunbound
streamtcp$(EXEEXT): $(STREAMTCP_OBJ_LINK)
- $(LINK) -o $@ $(STREAMTCP_OBJ_LINK) -lssl $(LIBS)
+ $(LINK) -o $@ $(STREAMTCP_OBJ_LINK) $(SSLLIB) $(LIBS)
perf$(EXEEXT): $(PERF_OBJ_LINK)
- $(LINK) -o $@ $(PERF_OBJ_LINK) -lssl $(LIBS)
+ $(LINK) -o $@ $(PERF_OBJ_LINK) $(SSLLIB) $(LIBS)
delayer$(EXEEXT): $(DELAYER_OBJ_LINK)
- $(LINK) -o $@ $(DELAYER_OBJ_LINK) -lssl $(LIBS)
+ $(LINK) -o $@ $(DELAYER_OBJ_LINK) $(SSLLIB) $(LIBS)
signit$(EXEEXT): testcode/signit.c
- $(CC) $(CPPFLAGS) $(CFLAGS) -o $@ testcode/signit.c $(LDFLAGS) -lldns -lssl $(LIBS)
+ $(CC) $(CPPFLAGS) $(CFLAGS) -o $@ testcode/signit.c $(LDFLAGS) -lldns $(SSLLIB) $(LIBS)
unbound.h: $(srcdir)/libunbound/unbound.h
sed -e 's/@''UNBOUND_VERSION_MAJOR@/$(UNBOUND_VERSION_MAJOR)/' -e 's/@''UNBOUND_VERSION_MINOR@/$(UNBOUND_VERSION_MINOR)/' -e 's/@''UNBOUND_VERSION_MICRO@/$(UNBOUND_VERSION_MICRO)/' < $(srcdir)/libunbound/unbound.h > $@
@@ -644,7 +645,7 @@ iterator.lo iterator.o: $(srcdir)/iterator/iterator.c config.h $(srcdir)/iterato
$(srcdir)/util/rtt.h $(srcdir)/util/netevent.h $(srcdir)/util/net_help.h $(srcdir)/util/regional.h \
$(srcdir)/util/data/dname.h $(srcdir)/util/data/msgencode.h $(srcdir)/util/fptr_wlist.h $(srcdir)/util/tube.h \
$(srcdir)/services/mesh.h $(srcdir)/services/modstack.h $(srcdir)/util/config_file.h $(srcdir)/util/random.h \
- $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/parseutil.h $(srcdir)/sldns/sbuffer.h
+ $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/str2wire.h $(srcdir)/sldns/parseutil.h $(srcdir)/sldns/sbuffer.h
iter_delegpt.lo iter_delegpt.o: $(srcdir)/iterator/iter_delegpt.c config.h $(srcdir)/iterator/iter_delegpt.h \
$(srcdir)/util/log.h $(srcdir)/services/cache/dns.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h \
$(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/regional.h \
@@ -727,8 +728,7 @@ outside_network.lo outside_network.o: $(srcdir)/services/outside_network.c confi
$(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgencode.h \
$(srcdir)/util/data/dname.h $(srcdir)/util/net_help.h $(srcdir)/util/random.h $(srcdir)/util/fptr_wlist.h \
$(srcdir)/util/module.h $(srcdir)/util/tube.h $(srcdir)/services/mesh.h $(srcdir)/services/modstack.h \
- $(srcdir)/sldns/sbuffer.h $(srcdir)/dnstap/dnstap.h \
-
+ $(srcdir)/sldns/sbuffer.h $(srcdir)/dnstap/dnstap.h
alloc.lo alloc.o: $(srcdir)/util/alloc.c config.h $(srcdir)/util/alloc.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \
$(srcdir)/util/regional.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h \
$(srcdir)/util/fptr_wlist.h $(srcdir)/util/netevent.h $(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h \
@@ -776,14 +776,12 @@ netevent.lo netevent.o: $(srcdir)/util/netevent.c config.h $(srcdir)/util/neteve
$(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h \
$(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/tube.h \
$(srcdir)/services/mesh.h $(srcdir)/util/rbtree.h $(srcdir)/services/modstack.h $(srcdir)/sldns/sbuffer.h \
- $(srcdir)/dnstap/dnstap.h \
- $(srcdir)/util/mini_event.h $(srcdir)/util/rbtree.h
+ $(srcdir)/dnstap/dnstap.h $(srcdir)/util/mini_event.h $(srcdir)/util/rbtree.h
net_help.lo net_help.o: $(srcdir)/util/net_help.c config.h $(srcdir)/util/net_help.h $(srcdir)/util/log.h \
$(srcdir)/util/data/dname.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/module.h \
$(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h \
$(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/regional.h $(srcdir)/sldns/parseutil.h \
- $(srcdir)/sldns/wire2str.h \
-
+ $(srcdir)/sldns/wire2str.h
random.lo random.o: $(srcdir)/util/random.c config.h $(srcdir)/util/random.h $(srcdir)/util/log.h
rbtree.lo rbtree.o: $(srcdir)/util/rbtree.c config.h $(srcdir)/util/log.h $(srcdir)/util/fptr_wlist.h \
$(srcdir)/util/netevent.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \
@@ -818,8 +816,7 @@ autotrust.lo autotrust.o: $(srcdir)/validator/autotrust.c config.h $(srcdir)/val
$(srcdir)/util/net_help.h $(srcdir)/util/config_file.h $(srcdir)/util/regional.h $(srcdir)/util/random.h \
$(srcdir)/services/mesh.h $(srcdir)/util/netevent.h $(srcdir)/services/modstack.h \
$(srcdir)/services/cache/rrset.h $(srcdir)/util/storage/slabhash.h $(srcdir)/validator/val_kcache.h \
- $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/str2wire.h $(srcdir)/sldns/keyraw.h \
-
+ $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/str2wire.h $(srcdir)/sldns/keyraw.h
val_anchor.lo val_anchor.o: $(srcdir)/validator/val_anchor.c config.h $(srcdir)/validator/val_anchor.h \
$(srcdir)/util/rbtree.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/validator/val_sigcrypt.h \
$(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h $(srcdir)/validator/autotrust.h \
@@ -844,18 +841,16 @@ val_kcache.lo val_kcache.o: $(srcdir)/validator/val_kcache.c config.h $(srcdir)/
val_kentry.lo val_kentry.o: $(srcdir)/validator/val_kentry.c config.h $(srcdir)/validator/val_kentry.h \
$(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/data/packed_rrset.h \
$(srcdir)/util/data/dname.h $(srcdir)/util/storage/lookup3.h $(srcdir)/util/regional.h $(srcdir)/util/net_help.h \
- $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/keyraw.h \
-
-val_neg.lo val_neg.o: $(srcdir)/validator/val_neg.c config.h \
- $(srcdir)/validator/val_neg.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/rbtree.h \
- $(srcdir)/validator/val_nsec.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h \
- $(srcdir)/validator/val_nsec3.h $(srcdir)/validator/val_utils.h $(srcdir)/util/data/dname.h \
- $(srcdir)/util/data/msgreply.h $(srcdir)/util/net_help.h $(srcdir)/util/config_file.h \
- $(srcdir)/services/cache/rrset.h $(srcdir)/util/storage/slabhash.h $(srcdir)/services/cache/dns.h \
- $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/sbuffer.h
-val_nsec3.lo val_nsec3.o: $(srcdir)/validator/val_nsec3.c config.h \
- $(srcdir)/validator/val_nsec3.h $(srcdir)/util/rbtree.h $(srcdir)/util/data/packed_rrset.h \
- $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/validator/validator.h \
+ $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/keyraw.h
+val_neg.lo val_neg.o: $(srcdir)/validator/val_neg.c config.h $(srcdir)/validator/val_neg.h $(srcdir)/util/locks.h \
+ $(srcdir)/util/log.h $(srcdir)/util/rbtree.h $(srcdir)/validator/val_nsec.h $(srcdir)/util/data/packed_rrset.h \
+ $(srcdir)/util/storage/lruhash.h $(srcdir)/validator/val_nsec3.h $(srcdir)/validator/val_utils.h \
+ $(srcdir)/util/data/dname.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/net_help.h \
+ $(srcdir)/util/config_file.h $(srcdir)/services/cache/rrset.h $(srcdir)/util/storage/slabhash.h \
+ $(srcdir)/services/cache/dns.h $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/sbuffer.h
+val_nsec3.lo val_nsec3.o: $(srcdir)/validator/val_nsec3.c config.h $(srcdir)/validator/val_nsec3.h \
+ $(srcdir)/util/rbtree.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h \
+ $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/validator/val_secalgo.h $(srcdir)/validator/validator.h \
$(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \
$(srcdir)/sldns/rrdef.h $(srcdir)/validator/val_utils.h $(srcdir)/validator/val_kentry.h \
$(srcdir)/services/cache/rrset.h $(srcdir)/util/storage/slabhash.h $(srcdir)/util/regional.h \
@@ -867,17 +862,15 @@ val_nsec.lo val_nsec.o: $(srcdir)/validator/val_nsec.c config.h $(srcdir)/valida
$(srcdir)/sldns/rrdef.h $(srcdir)/services/cache/rrset.h $(srcdir)/util/storage/slabhash.h
val_secalgo.lo val_secalgo.o: $(srcdir)/validator/val_secalgo.c config.h $(srcdir)/util/data/packed_rrset.h \
$(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/validator/val_secalgo.h \
- $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/keyraw.h \
- $(srcdir)/sldns/sbuffer.h \
-
+ $(srcdir)/validator/val_nsec3.h $(srcdir)/util/rbtree.h $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/keyraw.h \
+ $(srcdir)/sldns/sbuffer.h
val_sigcrypt.lo val_sigcrypt.o: $(srcdir)/validator/val_sigcrypt.c config.h \
$(srcdir)/validator/val_sigcrypt.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h \
$(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/validator/val_secalgo.h $(srcdir)/validator/validator.h \
$(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \
$(srcdir)/sldns/rrdef.h $(srcdir)/validator/val_utils.h $(srcdir)/util/data/dname.h $(srcdir)/util/rbtree.h \
- $(srcdir)/util/net_help.h $(srcdir)/util/regional.h $(srcdir)/sldns/keyraw.h \
- $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/parseutil.h $(srcdir)/sldns/wire2str.h \
-
+ $(srcdir)/util/net_help.h $(srcdir)/util/regional.h $(srcdir)/sldns/keyraw.h $(srcdir)/sldns/sbuffer.h \
+ $(srcdir)/sldns/parseutil.h $(srcdir)/sldns/wire2str.h
val_utils.lo val_utils.o: $(srcdir)/validator/val_utils.c config.h $(srcdir)/validator/val_utils.h \
$(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \
$(srcdir)/validator/validator.h $(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h \
@@ -895,11 +888,6 @@ dns64.lo dns64.o: $(srcdir)/dns64/dns64.c config.h $(srcdir)/dns64/dns64.h $(src
$(srcdir)/services/modstack.h $(srcdir)/util/net_help.h $(srcdir)/util/regional.h
checklocks.lo checklocks.o: $(srcdir)/testcode/checklocks.c config.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \
$(srcdir)/testcode/checklocks.h
-dnstap.lo dnstap.o: $(srcdir)/dnstap/dnstap.c config.h $(srcdir)/sldns/sbuffer.h \
- $(srcdir)/util/config_file.h $(srcdir)/util/net_help.h $(srcdir)/util/log.h $(srcdir)/util/netevent.h \
- $(srcdir)/dnstap/dnstap.h \
- $(srcdir)/dnstap/dnstap.pb-c.h
-dnstap.pb-c.lo dnstap.pb-c.o: $(srcdir)/dnstap/dnstap.pb-c.c $(srcdir)/dnstap/dnstap.pb-c.h
unitanchor.lo unitanchor.o: $(srcdir)/testcode/unitanchor.c config.h $(srcdir)/util/log.h $(srcdir)/util/data/dname.h \
$(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/testcode/unitmain.h \
$(srcdir)/validator/val_anchor.h $(srcdir)/util/rbtree.h $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/rrdef.h
@@ -908,8 +896,7 @@ unitdname.lo unitdname.o: $(srcdir)/testcode/unitdname.c config.h $(srcdir)/util
$(srcdir)/sldns/str2wire.h $(srcdir)/sldns/rrdef.h
unitlruhash.lo unitlruhash.o: $(srcdir)/testcode/unitlruhash.c config.h $(srcdir)/testcode/unitmain.h \
$(srcdir)/util/log.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/storage/slabhash.h
-unitmain.lo unitmain.o: $(srcdir)/testcode/unitmain.c config.h \
- $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/keyraw.h \
+unitmain.lo unitmain.o: $(srcdir)/testcode/unitmain.c config.h $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/keyraw.h \
$(srcdir)/util/log.h $(srcdir)/testcode/unitmain.h $(srcdir)/util/alloc.h $(srcdir)/util/locks.h $(srcdir)/util/net_help.h \
$(srcdir)/util/config_file.h $(srcdir)/util/rtt.h $(srcdir)/services/cache/infra.h \
$(srcdir)/util/storage/lruhash.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h \
@@ -947,38 +934,35 @@ unitldns.lo unitldns.o: $(srcdir)/testcode/unitldns.c config.h $(srcdir)/util/lo
acl_list.lo acl_list.o: $(srcdir)/daemon/acl_list.c config.h $(srcdir)/daemon/acl_list.h \
$(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h $(srcdir)/util/regional.h $(srcdir)/util/log.h \
$(srcdir)/util/config_file.h $(srcdir)/util/net_help.h
-cachedump.lo cachedump.o: $(srcdir)/daemon/cachedump.c config.h \
- $(srcdir)/daemon/cachedump.h $(srcdir)/daemon/remote.h $(srcdir)/daemon/worker.h $(srcdir)/libunbound/worker.h \
- $(srcdir)/sldns/sbuffer.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h \
- $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/netevent.h $(srcdir)/util/alloc.h \
+cachedump.lo cachedump.o: $(srcdir)/daemon/cachedump.c config.h $(srcdir)/daemon/cachedump.h \
+ $(srcdir)/daemon/remote.h $(srcdir)/daemon/worker.h $(srcdir)/libunbound/worker.h $(srcdir)/sldns/sbuffer.h \
+ $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \
+ $(srcdir)/util/netevent.h $(srcdir)/util/alloc.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h \
+ $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h \
+ $(srcdir)/util/module.h $(srcdir)/dnstap/dnstap.h \
+ $(srcdir)/services/cache/rrset.h $(srcdir)/util/storage/slabhash.h $(srcdir)/services/cache/dns.h \
+ $(srcdir)/services/cache/infra.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h $(srcdir)/util/rtt.h \
+ $(srcdir)/util/regional.h $(srcdir)/util/net_help.h $(srcdir)/util/data/dname.h $(srcdir)/iterator/iterator.h \
+ $(srcdir)/services/outbound_list.h $(srcdir)/iterator/iter_delegpt.h $(srcdir)/iterator/iter_utils.h \
+ $(srcdir)/iterator/iter_resptype.h $(srcdir)/iterator/iter_fwd.h $(srcdir)/iterator/iter_hints.h \
+ $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/str2wire.h
+daemon.lo daemon.o: $(srcdir)/daemon/daemon.c config.h $(srcdir)/daemon/daemon.h $(srcdir)/util/locks.h \
+ $(srcdir)/util/log.h $(srcdir)/util/alloc.h $(srcdir)/services/modstack.h \
+ $(srcdir)/daemon/worker.h $(srcdir)/libunbound/worker.h $(srcdir)/sldns/sbuffer.h \
+ $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/netevent.h \
$(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h \
$(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/util/module.h $(srcdir)/dnstap/dnstap.h \
- $(srcdir)/services/cache/rrset.h $(srcdir)/util/storage/slabhash.h \
- $(srcdir)/services/cache/dns.h $(srcdir)/services/cache/infra.h $(srcdir)/util/storage/dnstree.h \
- $(srcdir)/util/rbtree.h $(srcdir)/util/rtt.h $(srcdir)/util/regional.h $(srcdir)/util/net_help.h \
- $(srcdir)/util/data/dname.h $(srcdir)/iterator/iterator.h $(srcdir)/services/outbound_list.h \
- $(srcdir)/iterator/iter_delegpt.h $(srcdir)/iterator/iter_utils.h $(srcdir)/iterator/iter_resptype.h \
- $(srcdir)/iterator/iter_fwd.h $(srcdir)/iterator/iter_hints.h $(srcdir)/sldns/wire2str.h \
- $(srcdir)/sldns/str2wire.h
-daemon.lo daemon.o: $(srcdir)/daemon/daemon.c config.h \
- $(srcdir)/daemon/daemon.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/alloc.h $(srcdir)/services/modstack.h \
- $(srcdir)/daemon/worker.h $(srcdir)/libunbound/worker.h \
- $(srcdir)/sldns/sbuffer.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h \
- $(srcdir)/util/netevent.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \
- $(srcdir)/sldns/rrdef.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/util/module.h \
- $(srcdir)/dnstap/dnstap.h $(srcdir)/daemon/remote.h \
- $(srcdir)/daemon/acl_list.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h \
+ $(srcdir)/daemon/remote.h $(srcdir)/daemon/acl_list.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h \
$(srcdir)/util/config_file.h $(srcdir)/util/storage/lookup3.h $(srcdir)/util/storage/slabhash.h \
$(srcdir)/services/listen_dnsport.h $(srcdir)/services/cache/rrset.h $(srcdir)/services/cache/infra.h \
$(srcdir)/util/rtt.h $(srcdir)/services/localzone.h $(srcdir)/util/random.h $(srcdir)/util/tube.h \
$(srcdir)/util/net_help.h $(srcdir)/sldns/keyraw.h
-remote.lo remote.o: $(srcdir)/daemon/remote.c config.h \
- $(srcdir)/daemon/remote.h \
- $(srcdir)/daemon/worker.h $(srcdir)/libunbound/worker.h $(srcdir)/sldns/sbuffer.h \
- $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \
- $(srcdir)/util/netevent.h $(srcdir)/util/alloc.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h \
- $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h \
- $(srcdir)/util/module.h $(srcdir)/dnstap/dnstap.h $(srcdir)/daemon/daemon.h \
+remote.lo remote.o: $(srcdir)/daemon/remote.c config.h $(srcdir)/daemon/remote.h $(srcdir)/daemon/worker.h \
+ $(srcdir)/libunbound/worker.h $(srcdir)/sldns/sbuffer.h $(srcdir)/util/data/packed_rrset.h \
+ $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/netevent.h \
+ $(srcdir)/util/alloc.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \
+ $(srcdir)/sldns/rrdef.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/util/module.h \
+ $(srcdir)/dnstap/dnstap.h $(srcdir)/daemon/daemon.h \
$(srcdir)/services/modstack.h $(srcdir)/daemon/cachedump.h $(srcdir)/util/config_file.h \
$(srcdir)/util/net_help.h $(srcdir)/services/listen_dnsport.h $(srcdir)/services/cache/rrset.h \
$(srcdir)/util/storage/slabhash.h $(srcdir)/services/cache/infra.h $(srcdir)/util/storage/dnstree.h \
@@ -1002,35 +986,33 @@ stats.lo stats.o: $(srcdir)/daemon/stats.c config.h $(srcdir)/daemon/stats.h $(s
$(srcdir)/util/rtt.h $(srcdir)/validator/val_kcache.h
unbound.lo unbound.o: $(srcdir)/daemon/unbound.c config.h $(srcdir)/util/log.h $(srcdir)/daemon/daemon.h \
$(srcdir)/util/locks.h $(srcdir)/util/alloc.h $(srcdir)/services/modstack.h \
- $(srcdir)/daemon/remote.h \
- $(srcdir)/util/config_file.h $(srcdir)/util/storage/slabhash.h $(srcdir)/util/storage/lruhash.h \
- $(srcdir)/services/listen_dnsport.h $(srcdir)/util/netevent.h $(srcdir)/services/cache/rrset.h \
- $(srcdir)/util/data/packed_rrset.h $(srcdir)/services/cache/infra.h $(srcdir)/util/storage/dnstree.h \
- $(srcdir)/util/rbtree.h $(srcdir)/util/rtt.h $(srcdir)/util/fptr_wlist.h $(srcdir)/util/module.h \
- $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h \
- $(srcdir)/util/tube.h $(srcdir)/services/mesh.h $(srcdir)/util/net_help.h $(srcdir)/util/mini_event.h \
- $(srcdir)/util/rbtree.h
+ $(srcdir)/daemon/remote.h $(srcdir)/util/config_file.h $(srcdir)/util/storage/slabhash.h \
+ $(srcdir)/util/storage/lruhash.h $(srcdir)/services/listen_dnsport.h $(srcdir)/util/netevent.h \
+ $(srcdir)/services/cache/rrset.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/services/cache/infra.h \
+ $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h $(srcdir)/util/rtt.h $(srcdir)/util/fptr_wlist.h \
+ $(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \
+ $(srcdir)/sldns/rrdef.h $(srcdir)/util/tube.h $(srcdir)/services/mesh.h $(srcdir)/util/net_help.h \
+ $(srcdir)/util/mini_event.h $(srcdir)/util/rbtree.h
worker.lo worker.o: $(srcdir)/daemon/worker.c config.h $(srcdir)/util/log.h $(srcdir)/util/net_help.h \
$(srcdir)/util/random.h $(srcdir)/daemon/worker.h $(srcdir)/libunbound/worker.h $(srcdir)/sldns/sbuffer.h \
$(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h \
$(srcdir)/util/netevent.h $(srcdir)/util/alloc.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h \
$(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h \
$(srcdir)/util/module.h $(srcdir)/dnstap/dnstap.h $(srcdir)/daemon/daemon.h \
- $(srcdir)/services/modstack.h $(srcdir)/daemon/remote.h \
- $(srcdir)/daemon/acl_list.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h \
- $(srcdir)/util/config_file.h $(srcdir)/util/regional.h $(srcdir)/util/storage/slabhash.h \
- $(srcdir)/services/listen_dnsport.h $(srcdir)/services/outside_network.h \
- $(srcdir)/services/outbound_list.h $(srcdir)/services/cache/rrset.h $(srcdir)/services/cache/infra.h \
- $(srcdir)/util/rtt.h $(srcdir)/services/cache/dns.h $(srcdir)/services/mesh.h $(srcdir)/services/localzone.h \
+ $(srcdir)/services/modstack.h $(srcdir)/daemon/remote.h $(srcdir)/daemon/acl_list.h \
+ $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h $(srcdir)/util/config_file.h $(srcdir)/util/regional.h \
+ $(srcdir)/util/storage/slabhash.h $(srcdir)/services/listen_dnsport.h \
+ $(srcdir)/services/outside_network.h $(srcdir)/services/outbound_list.h \
+ $(srcdir)/services/cache/rrset.h $(srcdir)/services/cache/infra.h $(srcdir)/util/rtt.h \
+ $(srcdir)/services/cache/dns.h $(srcdir)/services/mesh.h $(srcdir)/services/localzone.h \
$(srcdir)/util/data/msgencode.h $(srcdir)/util/data/dname.h $(srcdir)/util/fptr_wlist.h $(srcdir)/util/tube.h \
$(srcdir)/iterator/iter_fwd.h $(srcdir)/iterator/iter_hints.h $(srcdir)/validator/autotrust.h \
$(srcdir)/validator/val_anchor.h $(srcdir)/libunbound/context.h $(srcdir)/libunbound/unbound.h \
$(srcdir)/libunbound/libworker.h
testbound.lo testbound.o: $(srcdir)/testcode/testbound.c config.h $(srcdir)/testcode/testpkts.h \
$(srcdir)/testcode/replay.h $(srcdir)/util/netevent.h $(srcdir)/util/rbtree.h $(srcdir)/testcode/fake_event.h \
- $(srcdir)/daemon/remote.h \
- $(srcdir)/util/config_file.h $(srcdir)/sldns/keyraw.h $(srcdir)/daemon/unbound.c $(srcdir)/util/log.h \
- $(srcdir)/daemon/daemon.h $(srcdir)/util/locks.h $(srcdir)/util/alloc.h $(srcdir)/services/modstack.h \
+ $(srcdir)/daemon/remote.h $(srcdir)/util/config_file.h $(srcdir)/sldns/keyraw.h $(srcdir)/daemon/unbound.c \
+ $(srcdir)/util/log.h $(srcdir)/daemon/daemon.h $(srcdir)/util/locks.h $(srcdir)/util/alloc.h $(srcdir)/services/modstack.h \
$(srcdir)/util/storage/slabhash.h $(srcdir)/util/storage/lruhash.h \
$(srcdir)/services/listen_dnsport.h $(srcdir)/services/cache/rrset.h \
$(srcdir)/util/data/packed_rrset.h $(srcdir)/services/cache/infra.h $(srcdir)/util/storage/dnstree.h \
@@ -1046,12 +1028,12 @@ worker.lo worker.o: $(srcdir)/daemon/worker.c config.h $(srcdir)/util/log.h $(sr
$(srcdir)/util/netevent.h $(srcdir)/util/alloc.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h \
$(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h \
$(srcdir)/util/module.h $(srcdir)/dnstap/dnstap.h $(srcdir)/daemon/daemon.h \
- $(srcdir)/services/modstack.h $(srcdir)/daemon/remote.h \
- $(srcdir)/daemon/acl_list.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h \
- $(srcdir)/util/config_file.h $(srcdir)/util/regional.h $(srcdir)/util/storage/slabhash.h \
- $(srcdir)/services/listen_dnsport.h $(srcdir)/services/outside_network.h \
- $(srcdir)/services/outbound_list.h $(srcdir)/services/cache/rrset.h $(srcdir)/services/cache/infra.h \
- $(srcdir)/util/rtt.h $(srcdir)/services/cache/dns.h $(srcdir)/services/mesh.h $(srcdir)/services/localzone.h \
+ $(srcdir)/services/modstack.h $(srcdir)/daemon/remote.h $(srcdir)/daemon/acl_list.h \
+ $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h $(srcdir)/util/config_file.h $(srcdir)/util/regional.h \
+ $(srcdir)/util/storage/slabhash.h $(srcdir)/services/listen_dnsport.h \
+ $(srcdir)/services/outside_network.h $(srcdir)/services/outbound_list.h \
+ $(srcdir)/services/cache/rrset.h $(srcdir)/services/cache/infra.h $(srcdir)/util/rtt.h \
+ $(srcdir)/services/cache/dns.h $(srcdir)/services/mesh.h $(srcdir)/services/localzone.h \
$(srcdir)/util/data/msgencode.h $(srcdir)/util/data/dname.h $(srcdir)/util/fptr_wlist.h $(srcdir)/util/tube.h \
$(srcdir)/iterator/iter_fwd.h $(srcdir)/iterator/iter_hints.h $(srcdir)/validator/autotrust.h \
$(srcdir)/validator/val_anchor.h $(srcdir)/libunbound/context.h $(srcdir)/libunbound/unbound.h \
@@ -1059,14 +1041,13 @@ worker.lo worker.o: $(srcdir)/daemon/worker.c config.h $(srcdir)/util/log.h $(sr
acl_list.lo acl_list.o: $(srcdir)/daemon/acl_list.c config.h $(srcdir)/daemon/acl_list.h \
$(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h $(srcdir)/util/regional.h $(srcdir)/util/log.h \
$(srcdir)/util/config_file.h $(srcdir)/util/net_help.h
-daemon.lo daemon.o: $(srcdir)/daemon/daemon.c config.h \
- $(srcdir)/daemon/daemon.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/alloc.h $(srcdir)/services/modstack.h \
- $(srcdir)/daemon/worker.h $(srcdir)/libunbound/worker.h \
- $(srcdir)/sldns/sbuffer.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h \
- $(srcdir)/util/netevent.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \
- $(srcdir)/sldns/rrdef.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/util/module.h \
- $(srcdir)/dnstap/dnstap.h $(srcdir)/daemon/remote.h \
- $(srcdir)/daemon/acl_list.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h \
+daemon.lo daemon.o: $(srcdir)/daemon/daemon.c config.h $(srcdir)/daemon/daemon.h $(srcdir)/util/locks.h \
+ $(srcdir)/util/log.h $(srcdir)/util/alloc.h $(srcdir)/services/modstack.h \
+ $(srcdir)/daemon/worker.h $(srcdir)/libunbound/worker.h $(srcdir)/sldns/sbuffer.h \
+ $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/netevent.h \
+ $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h \
+ $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/util/module.h $(srcdir)/dnstap/dnstap.h \
+ $(srcdir)/daemon/remote.h $(srcdir)/daemon/acl_list.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h \
$(srcdir)/util/config_file.h $(srcdir)/util/storage/lookup3.h $(srcdir)/util/storage/slabhash.h \
$(srcdir)/services/listen_dnsport.h $(srcdir)/services/cache/rrset.h $(srcdir)/services/cache/infra.h \
$(srcdir)/util/rtt.h $(srcdir)/services/localzone.h $(srcdir)/util/random.h $(srcdir)/util/tube.h \
@@ -1141,19 +1122,18 @@ libunbound.lo libunbound.o: $(srcdir)/libunbound/libunbound.c $(srcdir)/libunbou
$(srcdir)/util/random.h $(srcdir)/util/net_help.h $(srcdir)/util/tube.h $(srcdir)/services/localzone.h \
$(srcdir)/services/cache/infra.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rtt.h \
$(srcdir)/services/cache/rrset.h $(srcdir)/util/storage/slabhash.h $(srcdir)/sldns/sbuffer.h
-libworker.lo libworker.o: $(srcdir)/libunbound/libworker.c config.h \
- $(srcdir)/libunbound/libworker.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h \
- $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/libunbound/context.h $(srcdir)/util/alloc.h $(srcdir)/util/rbtree.h \
- $(srcdir)/services/modstack.h $(srcdir)/libunbound/unbound.h $(srcdir)/libunbound/worker.h \
- $(srcdir)/sldns/sbuffer.h $(srcdir)/libunbound/unbound-event.h $(srcdir)/services/outside_network.h \
- $(srcdir)/util/netevent.h $(srcdir)/services/mesh.h \
- $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/module.h \
- $(srcdir)/util/data/msgreply.h $(srcdir)/services/localzone.h $(srcdir)/services/cache/rrset.h \
- $(srcdir)/util/storage/slabhash.h $(srcdir)/services/outbound_list.h $(srcdir)/util/fptr_wlist.h \
- $(srcdir)/util/tube.h $(srcdir)/util/regional.h $(srcdir)/util/random.h $(srcdir)/util/config_file.h \
- $(srcdir)/util/storage/lookup3.h $(srcdir)/util/net_help.h $(srcdir)/util/data/dname.h \
- $(srcdir)/util/data/msgencode.h $(srcdir)/iterator/iter_fwd.h $(srcdir)/iterator/iter_hints.h \
- $(srcdir)/util/storage/dnstree.h $(srcdir)/sldns/str2wire.h
+libworker.lo libworker.o: $(srcdir)/libunbound/libworker.c config.h $(srcdir)/libunbound/libworker.h \
+ $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \
+ $(srcdir)/libunbound/context.h $(srcdir)/util/alloc.h $(srcdir)/util/rbtree.h $(srcdir)/services/modstack.h \
+ $(srcdir)/libunbound/unbound.h $(srcdir)/libunbound/worker.h $(srcdir)/sldns/sbuffer.h \
+ $(srcdir)/libunbound/unbound-event.h $(srcdir)/services/outside_network.h $(srcdir)/util/netevent.h \
+ $(srcdir)/services/mesh.h $(srcdir)/util/data/msgparse.h \
+ $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h \
+ $(srcdir)/services/localzone.h $(srcdir)/services/cache/rrset.h $(srcdir)/util/storage/slabhash.h \
+ $(srcdir)/services/outbound_list.h $(srcdir)/util/fptr_wlist.h $(srcdir)/util/tube.h $(srcdir)/util/regional.h \
+ $(srcdir)/util/random.h $(srcdir)/util/config_file.h $(srcdir)/util/storage/lookup3.h $(srcdir)/util/net_help.h \
+ $(srcdir)/util/data/dname.h $(srcdir)/util/data/msgencode.h $(srcdir)/iterator/iter_fwd.h \
+ $(srcdir)/iterator/iter_hints.h $(srcdir)/util/storage/dnstree.h $(srcdir)/sldns/str2wire.h
unbound-host.lo unbound-host.o: $(srcdir)/smallapp/unbound-host.c config.h $(srcdir)/libunbound/unbound.h \
$(srcdir)/sldns/rrdef.h $(srcdir)/sldns/wire2str.h
asynclook.lo asynclook.o: $(srcdir)/testcode/asynclook.c config.h $(srcdir)/libunbound/unbound.h \
@@ -1164,21 +1144,18 @@ streamtcp.lo streamtcp.o: $(srcdir)/testcode/streamtcp.c config.h $(srcdir)/util
$(srcdir)/util/net_help.h $(srcdir)/util/data/msgencode.h $(srcdir)/util/data/msgparse.h \
$(srcdir)/util/storage/lruhash.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/data/msgreply.h \
$(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/dname.h $(srcdir)/sldns/sbuffer.h \
- $(srcdir)/sldns/str2wire.h $(srcdir)/sldns/wire2str.h \
-
+ $(srcdir)/sldns/str2wire.h $(srcdir)/sldns/wire2str.h
perf.lo perf.o: $(srcdir)/testcode/perf.c config.h $(srcdir)/util/log.h $(srcdir)/util/locks.h $(srcdir)/util/net_help.h \
$(srcdir)/util/data/msgencode.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/storage/lruhash.h \
$(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \
$(srcdir)/sldns/rrdef.h $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/str2wire.h
delayer.lo delayer.o: $(srcdir)/testcode/delayer.c config.h $(srcdir)/util/net_help.h $(srcdir)/util/log.h \
$(srcdir)/util/config_file.h $(srcdir)/sldns/sbuffer.h
-unbound-control.lo unbound-control.o: $(srcdir)/smallapp/unbound-control.c config.h \
- $(srcdir)/util/log.h $(srcdir)/util/config_file.h $(srcdir)/util/locks.h $(srcdir)/util/net_help.h
+unbound-control.lo unbound-control.o: $(srcdir)/smallapp/unbound-control.c config.h $(srcdir)/util/log.h \
+ $(srcdir)/util/config_file.h $(srcdir)/util/locks.h $(srcdir)/util/net_help.h
unbound-anchor.lo unbound-anchor.o: $(srcdir)/smallapp/unbound-anchor.c config.h $(srcdir)/libunbound/unbound.h \
- $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/parseutil.h \
-
-petal.lo petal.o: $(srcdir)/testcode/petal.c config.h \
-
+ $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/parseutil.h
+petal.lo petal.o: $(srcdir)/testcode/petal.c config.h
pythonmod_utils.lo pythonmod_utils.o: $(srcdir)/pythonmod/pythonmod_utils.c config.h $(srcdir)/util/module.h \
$(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/data/msgreply.h \
$(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \
@@ -1191,8 +1168,7 @@ win_svc.lo win_svc.o: $(srcdir)/winrc/win_svc.c config.h $(srcdir)/winrc/win_svc
$(srcdir)/sldns/sbuffer.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h \
$(srcdir)/util/netevent.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \
$(srcdir)/sldns/rrdef.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/util/module.h \
- $(srcdir)/dnstap/dnstap.h $(srcdir)/daemon/remote.h \
- $(srcdir)/util/config_file.h $(srcdir)/util/winsock_event.h
+ $(srcdir)/dnstap/dnstap.h $(srcdir)/daemon/remote.h $(srcdir)/util/config_file.h $(srcdir)/util/winsock_event.h
w_inst.lo w_inst.o: $(srcdir)/winrc/w_inst.c config.h $(srcdir)/winrc/w_inst.h $(srcdir)/winrc/win_svc.h
unbound-service-install.lo unbound-service-install.o: $(srcdir)/winrc/unbound-service-install.c config.h \
$(srcdir)/winrc/w_inst.h
@@ -1200,14 +1176,11 @@ unbound-service-remove.lo unbound-service-remove.o: $(srcdir)/winrc/unbound-serv
$(srcdir)/winrc/w_inst.h
anchor-update.lo anchor-update.o: $(srcdir)/winrc/anchor-update.c config.h $(srcdir)/libunbound/unbound.h \
$(srcdir)/sldns/rrdef.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/wire2str.h
-keyraw.lo keyraw.o: $(srcdir)/sldns/keyraw.c config.h $(srcdir)/sldns/keyraw.h \
- $(srcdir)/sldns/rrdef.h \
-
+keyraw.lo keyraw.o: $(srcdir)/sldns/keyraw.c config.h $(srcdir)/sldns/keyraw.h $(srcdir)/sldns/rrdef.h
sbuffer.lo sbuffer.o: $(srcdir)/sldns/sbuffer.c config.h $(srcdir)/sldns/sbuffer.h
wire2str.lo wire2str.o: $(srcdir)/sldns/wire2str.c config.h $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/str2wire.h \
$(srcdir)/sldns/rrdef.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/parseutil.h $(srcdir)/sldns/sbuffer.h \
- $(srcdir)/sldns/keyraw.h \
-
+ $(srcdir)/sldns/keyraw.h
parse.lo parse.o: $(srcdir)/sldns/parse.c config.h $(srcdir)/sldns/parse.h $(srcdir)/sldns/parseutil.h \
$(srcdir)/sldns/sbuffer.h
parseutil.lo parseutil.o: $(srcdir)/sldns/parseutil.c config.h $(srcdir)/sldns/parseutil.h
@@ -1227,8 +1200,7 @@ snprintf.lo snprintf.o: $(srcdir)/compat/snprintf.c config.h
strlcat.lo strlcat.o: $(srcdir)/compat/strlcat.c config.h
strlcpy.lo strlcpy.o: $(srcdir)/compat/strlcpy.c config.h
strptime.lo strptime.o: $(srcdir)/compat/strptime.c config.h
-getentropy_linux.lo getentropy_linux.o: $(srcdir)/compat/getentropy_linux.c config.h \
-
+getentropy_linux.lo getentropy_linux.o: $(srcdir)/compat/getentropy_linux.c config.h
getentropy_osx.lo getentropy_osx.o: $(srcdir)/compat/getentropy_osx.c config.h
getentropy_solaris.lo getentropy_solaris.o: $(srcdir)/compat/getentropy_solaris.c config.h
getentropy_win.lo getentropy_win.o: $(srcdir)/compat/getentropy_win.c
@@ -1238,3 +1210,4 @@ arc4random_uniform.lo arc4random_uniform.o: $(srcdir)/compat/arc4random_uniform.
arc4_lock.lo arc4_lock.o: $(srcdir)/compat/arc4_lock.c config.h $(srcdir)/util/locks.h
sha512.lo sha512.o: $(srcdir)/compat/sha512.c config.h
reallocarray.lo reallocarray.o: $(srcdir)/compat/reallocarray.c config.h
+isblank.lo isblank.o: $(srcdir)/compat/isblank.c config.h
diff --git a/contrib/unbound/acx_nlnetlabs.m4 b/contrib/unbound/acx_nlnetlabs.m4
index c9ca755..26513e4 100644
--- a/contrib/unbound/acx_nlnetlabs.m4
+++ b/contrib/unbound/acx_nlnetlabs.m4
@@ -2,7 +2,9 @@
# Copyright 2009, Wouter Wijngaards, NLnet Labs.
# BSD licensed.
#
-# Version 28
+# Version 30
+# 2015-11-18 spelling check fix.
+# 2015-11-05 ACX_SSL_CHECKS no longer adds -ldl needlessly.
# 2015-08-28 ACX_CHECK_PIE and ACX_CHECK_RELRO_NOW added.
# 2015-03-17 AHX_CONFIG_REALLOCARRAY added
# 2013-09-19 FLTO help text improved.
@@ -24,7 +26,7 @@
# 2010-07-02 Add check for ss_family (for minix).
# 2010-04-26 Fix to use CPPFLAGS for CHECK_COMPILER_FLAGS.
# 2010-03-01 Fix RPATH using CONFIG_COMMANDS to run at the very end.
-# 2010-02-18 WITH_SSL outputs the LIBSSL_LDFLAGS, LIBS, CPPFLAGS seperate, -ldl
+# 2010-02-18 WITH_SSL outputs the LIBSSL_LDFLAGS, LIBS, CPPFLAGS separate, -ldl
# 2010-02-01 added ACX_CHECK_MEMCMP_SIGNED, AHX_MEMCMP_BROKEN
# 2010-01-20 added AHX_COONFIG_STRLCAT
# 2009-07-14 U_CHAR detection improved for windows crosscompile.
@@ -715,12 +717,6 @@ AC_DEFUN([ACX_SSL_CHECKS], [
fi
AC_SUBST(HAVE_SSL)
AC_SUBST(RUNTIME_PATH)
- # openssl engine functionality needs dlopen().
- BAKLIBS="$LIBS"
- AC_SEARCH_LIBS([dlopen], [dl])
- if test "$LIBS" != "$BAKLIBS"; then
- LIBSSL_LIBS="$LIBSSL_LIBS -ldl"
- fi
fi
AC_CHECK_HEADERS([openssl/ssl.h],,, [AC_INCLUDES_DEFAULT])
AC_CHECK_HEADERS([openssl/err.h],,, [AC_INCLUDES_DEFAULT])
diff --git a/contrib/unbound/compat/arc4random.c b/contrib/unbound/compat/arc4random.c
index 27a626b..2c859f1 100644
--- a/contrib/unbound/compat/arc4random.c
+++ b/contrib/unbound/compat/arc4random.c
@@ -26,7 +26,9 @@
#include <fcntl.h>
#include <limits.h>
#include <signal.h>
+#ifdef HAVE_STDINT_H
#include <stdint.h>
+#endif
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
diff --git a/contrib/unbound/compat/getentropy_linux.c b/contrib/unbound/compat/getentropy_linux.c
index 76f0f9d..37d86a8 100644
--- a/contrib/unbound/compat/getentropy_linux.c
+++ b/contrib/unbound/compat/getentropy_linux.c
@@ -46,7 +46,12 @@
#include <errno.h>
#include <unistd.h>
#include <time.h>
+
+#if defined(HAVE_SSL)
#include <openssl/sha.h>
+#elif defined(HAVE_NETTLE)
+#include <nettle/sha.h>
+#endif
#include <linux/types.h>
#include <linux/random.h>
@@ -67,9 +72,21 @@
HD(b); \
} while (0)
+#if defined(HAVE_SSL)
+#define CRYPTO_SHA512_CTX SHA512_CTX
+#define CRYPTO_SHA512_INIT(x) SHA512_Init(x)
+#define CRYPTO_SHA512_FINAL(r, c) SHA512_Final(r, c)
#define HR(x, l) (SHA512_Update(&ctx, (char *)(x), (l)))
#define HD(x) (SHA512_Update(&ctx, (char *)&(x), sizeof (x)))
#define HF(x) (SHA512_Update(&ctx, (char *)&(x), sizeof (void*)))
+#elif defined(HAVE_NETTLE)
+#define CRYPTO_SHA512_CTX struct sha512_ctx
+#define CRYPTO_SHA512_INIT(x) sha512_init(x)
+#define CRYPTO_SHA512_FINAL(r, c) sha512_digest(c, SHA512_DIGEST_SIZE, r)
+#define HR(x, l) (sha512_update(&ctx, (l), (uint8_t *)(x)))
+#define HD(x) (sha512_update(&ctx, sizeof (x), (uint8_t *)&(x)))
+#define HF(x) (sha512_update(&ctx, sizeof (void*), (uint8_t *)&(x)))
+#endif
int getentropy(void *buf, size_t len);
@@ -122,7 +139,7 @@ getentropy(void *buf, size_t len)
* Try to use sysctl CTL_KERN, KERN_RANDOM, RANDOM_UUID.
* sysctl is a failsafe API, so it guarantees a result. This
* should work inside a chroot, or when file descriptors are
- * exhuasted.
+ * exhausted.
*
* However this can fail if the Linux kernel removes support
* for sysctl. Starting in 2007, there have been efforts to
@@ -337,7 +354,7 @@ getentropy_fallback(void *buf, size_t len)
struct rusage ru;
sigset_t sigset;
struct stat st;
- SHA512_CTX ctx;
+ CRYPTO_SHA512_CTX ctx;
static pid_t lastpid;
pid_t pid;
size_t i, ii, m;
@@ -354,7 +371,7 @@ getentropy_fallback(void *buf, size_t len)
}
for (i = 0; i < len; ) {
int j;
- SHA512_Init(&ctx);
+ CRYPTO_SHA512_INIT(&ctx);
for (j = 0; j < repeat; j++) {
HX((e = gettimeofday(&tv, NULL)) == -1, tv);
if (e != -1) {
@@ -526,7 +543,7 @@ getentropy_fallback(void *buf, size_t len)
# endif
#endif /* HAVE_GETAUXVAL */
- SHA512_Final(results, &ctx);
+ CRYPTO_SHA512_FINAL(results, &ctx);
memcpy((char*)buf + i, results, min(sizeof(results), len - i));
i += min(sizeof(results), len - i);
}
diff --git a/contrib/unbound/compat/getentropy_solaris.c b/contrib/unbound/compat/getentropy_solaris.c
index 8389573..810098a 100644
--- a/contrib/unbound/compat/getentropy_solaris.c
+++ b/contrib/unbound/compat/getentropy_solaris.c
@@ -30,7 +30,9 @@
#include <sys/stat.h>
#include <sys/time.h>
#include <stdlib.h>
+#ifdef HAVE_STDINT_H
#include <stdint.h>
+#endif
#include <stdio.h>
#include <termios.h>
#include <fcntl.h>
@@ -39,10 +41,14 @@
#include <errno.h>
#include <unistd.h>
#include <time.h>
+#ifdef HAVE_SYS_SHA2_H
#include <sys/sha2.h>
#define SHA512_Init SHA512Init
#define SHA512_Update SHA512Update
#define SHA512_Final SHA512Final
+#else
+#include "openssl/sha.h"
+#endif
#include <sys/vfs.h>
#include <sys/statfs.h>
diff --git a/contrib/unbound/compat/isblank.c b/contrib/unbound/compat/isblank.c
new file mode 100644
index 0000000..8feabed
--- /dev/null
+++ b/contrib/unbound/compat/isblank.c
@@ -0,0 +1,45 @@
+/* isblank - compatibility implementation of isblank
+ *
+ * Copyright (c) 2015, NLnet Labs. All rights reserved.
+ *
+ * This software is open source.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 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.
+ *
+ * Neither the name of the NLNET LABS nor the names of its contributors may
+ * be used to endorse or promote products derived from this software without
+ * specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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 COPYRIGHT
+ * HOLDER 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.
+ */
+
+#include "config.h"
+
+/* return true for a blank character: space or tab */
+int isblank(int c);
+
+/* implementation of isblank. unsigned char is the argument */
+int
+isblank(int c)
+{
+ return (c==' ' || c=='\t');
+}
diff --git a/contrib/unbound/compat/reallocarray.c b/contrib/unbound/compat/reallocarray.c
index 04d5d71..c969bd0 100644
--- a/contrib/unbound/compat/reallocarray.c
+++ b/contrib/unbound/compat/reallocarray.c
@@ -18,7 +18,10 @@
#include "config.h"
#include <sys/types.h>
#include <errno.h>
+#ifdef HAVE_STDINT_H
#include <stdint.h>
+#endif
+#include <limits.h>
#include <stdlib.h>
/*
diff --git a/contrib/unbound/compat/sha512.c b/contrib/unbound/compat/sha512.c
index ac046ab..744b7ac7b 100644
--- a/contrib/unbound/compat/sha512.c
+++ b/contrib/unbound/compat/sha512.c
@@ -70,7 +70,7 @@ unsigned char *SHA512(void *data, unsigned int data_len, unsigned char *digest);
* Please make sure that your system defines BYTE_ORDER. If your
* architecture is little-endian, make sure it also defines
* LITTLE_ENDIAN and that the two (BYTE_ORDER and LITTLE_ENDIAN) are
- * equivilent.
+ * equivalent.
*
* If your system does not define the above, then you can do so by
* hand like this:
diff --git a/contrib/unbound/compat/snprintf.c b/contrib/unbound/compat/snprintf.c
index 0663557..97cd706 100644
--- a/contrib/unbound/compat/snprintf.c
+++ b/contrib/unbound/compat/snprintf.c
@@ -42,6 +42,7 @@
#ifdef HAVE_STDINT_H
#include <stdint.h>
#endif
+#include <limits.h>
/* for test */
/* #define SNPRINTF_TEST 1 */
@@ -428,7 +429,7 @@ print_num_llp(char** at, size_t* left, int* ret, void* value,
char buf[PRINT_DEC_BUFSZ];
int negative = 0;
int zero = (value == 0);
-#if defined(UINTPTR_MAX) && defined(UINT32_MAX) && (UINTPTR_MAX == UINT32_MAX)
+#if defined(SIZE_MAX) && defined(UINT32_MAX) && (UINT32_MAX == SIZE_MAX || INT32_MAX == SIZE_MAX)
/* avoid warning about upcast on 32bit systems */
unsigned long long llvalue = (unsigned long)value;
#else
diff --git a/contrib/unbound/config.h b/contrib/unbound/config.h
index 6e322ea..5b38868 100644
--- a/contrib/unbound/config.h
+++ b/contrib/unbound/config.h
@@ -95,6 +95,10 @@
don't. */
/* #undef HAVE_DECL_STRLCPY */
+/* Define to 1 if you have the declaration of `XML_StopParser', and to 0 if
+ you don't. */
+#define HAVE_DECL_XML_STOPPARSER 1
+
/* Define to 1 if you have the <dlfcn.h> header file. */
#define HAVE_DLFCN_H 1
@@ -152,6 +156,9 @@
/* Define to 1 if fseeko (and presumably ftello) exists and is declared. */
#define HAVE_FSEEKO 1
+/* Define to 1 if you have the `fsync' function. */
+#define HAVE_FSYNC 1
+
/* Whether getaddrinfo is available */
#define HAVE_GETADDRINFO 1
@@ -206,6 +213,9 @@
/* Define to 1 if you have the <iphlpapi.h> header file. */
/* #undef HAVE_IPHLPAPI_H */
+/* Define to 1 if you have the `isblank' function. */
+#define HAVE_ISBLANK 1
+
/* Define to 1 if you have the `kill' function. */
#define HAVE_KILL 1
@@ -233,6 +243,9 @@
/* Define to 1 if you have the <netinet/in.h> header file. */
#define HAVE_NETINET_IN_H 1
+/* Use libnettle for crypto */
+/* #undef HAVE_NETTLE */
+
/* Use libnss for crypto */
/* #undef HAVE_NSS */
@@ -497,7 +510,7 @@
#define PACKAGE_NAME "unbound"
/* Define to the full name and version of this package. */
-#define PACKAGE_STRING "unbound 1.5.5"
+#define PACKAGE_STRING "unbound 1.5.7"
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "unbound"
@@ -506,7 +519,7 @@
#define PACKAGE_URL ""
/* Define to the version of this package. */
-#define PACKAGE_VERSION "1.5.5"
+#define PACKAGE_VERSION "1.5.7"
/* default pidfile location */
#define PIDFILE "/var/unbound/unbound.pid"
@@ -525,7 +538,7 @@
#define ROOT_CERT_FILE "/var/unbound/icannbundle.pem"
/* version number for resource files */
-#define RSRC_PACKAGE_VERSION 1,5,5,0
+#define RSRC_PACKAGE_VERSION 1,5,7,0
/* Directory to chdir to */
#define RUN_DIR "/var/unbound"
@@ -536,6 +549,9 @@
/* The size of `time_t', as computed by sizeof. */
#define SIZEOF_TIME_T 8
+/* define if (v)snprintf does not return length needed, (but length used) */
+/* #undef SNPRINTF_RET_BROKEN */
+
/* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1
@@ -570,7 +586,7 @@
/* #undef USE_ECDSA_EVP_WORKAROUND */
/* Define this to enable GOST support. */
-/* #undef USE_GOST */
+#define USE_GOST 1
/* Define if you want to use internal select based events */
#define USE_MINI_EVENT 1
@@ -849,15 +865,13 @@
#define MAXHOSTNAMELEN 256
#endif
-
-#ifndef HAVE_SNPRINTF
+#if !defined(HAVE_SNPRINTF) || defined(SNPRINTF_RET_BROKEN)
#define snprintf snprintf_unbound
#define vsnprintf vsnprintf_unbound
#include <stdarg.h>
int snprintf (char *str, size_t count, const char *fmt, ...);
int vsnprintf (char *str, size_t count, const char *fmt, va_list arg);
-#endif /* HAVE_SNPRINTF */
-
+#endif /* HAVE_SNPRINTF or SNPRINTF_RET_BROKEN */
#ifndef HAVE_INET_PTON
#define inet_pton inet_pton_unbound
@@ -953,6 +967,11 @@ int memcmp(const void *x, const void *y, size_t n);
char *ctime_r(const time_t *timep, char *buf);
#endif
+#ifndef HAVE_ISBLANK
+#define isblank unbound_isblank
+int isblank(int c);
+#endif
+
#if !defined(HAVE_STRPTIME) || !defined(STRPTIME_WORKS)
#define strptime unbound_strptime
struct tm;
diff --git a/contrib/unbound/config.h.in b/contrib/unbound/config.h.in
index 7576e15..e90f036 100644
--- a/contrib/unbound/config.h.in
+++ b/contrib/unbound/config.h.in
@@ -94,6 +94,10 @@
don't. */
#undef HAVE_DECL_STRLCPY
+/* Define to 1 if you have the declaration of `XML_StopParser', and to 0 if
+ you don't. */
+#undef HAVE_DECL_XML_STOPPARSER
+
/* Define to 1 if you have the <dlfcn.h> header file. */
#undef HAVE_DLFCN_H
@@ -151,6 +155,9 @@
/* Define to 1 if fseeko (and presumably ftello) exists and is declared. */
#undef HAVE_FSEEKO
+/* Define to 1 if you have the `fsync' function. */
+#undef HAVE_FSYNC
+
/* Whether getaddrinfo is available */
#undef HAVE_GETADDRINFO
@@ -205,6 +212,9 @@
/* Define to 1 if you have the <iphlpapi.h> header file. */
#undef HAVE_IPHLPAPI_H
+/* Define to 1 if you have the `isblank' function. */
+#undef HAVE_ISBLANK
+
/* Define to 1 if you have the `kill' function. */
#undef HAVE_KILL
@@ -232,6 +242,9 @@
/* Define to 1 if you have the <netinet/in.h> header file. */
#undef HAVE_NETINET_IN_H
+/* Use libnettle for crypto */
+#undef HAVE_NETTLE
+
/* Use libnss for crypto */
#undef HAVE_NSS
@@ -535,6 +548,9 @@
/* The size of `time_t', as computed by sizeof. */
#undef SIZEOF_TIME_T
+/* define if (v)snprintf does not return length needed, (but length used) */
+#undef SNPRINTF_RET_BROKEN
+
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
@@ -848,15 +864,13 @@
#define MAXHOSTNAMELEN 256
#endif
-
-#ifndef HAVE_SNPRINTF
+#if !defined(HAVE_SNPRINTF) || defined(SNPRINTF_RET_BROKEN)
#define snprintf snprintf_unbound
#define vsnprintf vsnprintf_unbound
#include <stdarg.h>
int snprintf (char *str, size_t count, const char *fmt, ...);
int vsnprintf (char *str, size_t count, const char *fmt, va_list arg);
-#endif /* HAVE_SNPRINTF */
-
+#endif /* HAVE_SNPRINTF or SNPRINTF_RET_BROKEN */
#ifndef HAVE_INET_PTON
#define inet_pton inet_pton_unbound
@@ -952,6 +966,11 @@ int memcmp(const void *x, const void *y, size_t n);
char *ctime_r(const time_t *timep, char *buf);
#endif
+#ifndef HAVE_ISBLANK
+#define isblank unbound_isblank
+int isblank(int c);
+#endif
+
#if !defined(HAVE_STRPTIME) || !defined(STRPTIME_WORKS)
#define strptime unbound_strptime
struct tm;
diff --git a/contrib/unbound/configure b/contrib/unbound/configure
index 7b0a7e6..acfb107 100755
--- a/contrib/unbound/configure
+++ b/contrib/unbound/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for unbound 1.5.5.
+# Generated by GNU Autoconf 2.69 for unbound 1.5.7.
#
# Report bugs to <unbound-bugs@nlnetlabs.nl>.
#
@@ -590,8 +590,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='unbound'
PACKAGE_TARNAME='unbound'
-PACKAGE_VERSION='1.5.5'
-PACKAGE_STRING='unbound 1.5.5'
+PACKAGE_VERSION='1.5.7'
+PACKAGE_STRING='unbound 1.5.7'
PACKAGE_BUGREPORT='unbound-bugs@nlnetlabs.nl'
PACKAGE_URL=''
@@ -661,6 +661,7 @@ CHECKLOCK_OBJ
staticexe
UNBOUND_EVENT_UNINSTALL
UNBOUND_EVENT_INSTALL
+SSLLIB
HAVE_SSL
CONFIG_DATE
NETBSD_LINTFLAGS
@@ -823,6 +824,7 @@ with_solaris_threads
with_pyunbound
with_pythonmodule
with_nss
+with_nettle
with_ssl
enable_sha2
enable_gost
@@ -1391,7 +1393,7 @@ if test "$ac_init_help" = "long"; then
# 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 unbound 1.5.5 to adapt to many kinds of systems.
+\`configure' configures unbound 1.5.7 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1456,7 +1458,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of unbound 1.5.5:";;
+ short | recursive ) echo "Configuration of unbound 1.5.7:";;
esac
cat <<\_ACEOF
@@ -1534,6 +1536,7 @@ Optional Packages:
--with-pythonmodule build Python module, or --without-pythonmodule to
disable script engine. (default=no)
--with-nss=path use libnss instead of openssl, installed at path.
+ --with-nettle=path use libnettle as crypto library, installed at path.
--with-ssl=pathname enable SSL (will check /usr/local/ssl /usr/lib/ssl
/usr/ssl /usr/pkg /usr/local /opt/local /usr/sfw
/usr)
@@ -1635,7 +1638,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-unbound configure 1.5.5
+unbound configure 1.5.7
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2344,7 +2347,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by unbound $as_me 1.5.5, which was
+It was created by unbound $as_me 1.5.7, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -2696,11 +2699,11 @@ UNBOUND_VERSION_MAJOR=1
UNBOUND_VERSION_MINOR=5
-UNBOUND_VERSION_MICRO=5
+UNBOUND_VERSION_MICRO=7
LIBUNBOUND_CURRENT=5
-LIBUNBOUND_REVISION=8
+LIBUNBOUND_REVISION=10
LIBUNBOUND_AGE=3
# 1.0.0 had 0:12:0
# 1.0.1 had 0:13:0
@@ -2745,6 +2748,8 @@ LIBUNBOUND_AGE=3
# 1.5.3 had 5:6:3
# 1.5.4 had 5:7:3
# 1.5.5 had 5:8:3
+# 1.5.6 had 5:9:3
+# 1.5.7 had 5:10:3
# Current -- the number of the binary API that we're implementing
# Revision -- which iteration of the implementation of the binary
@@ -16406,13 +16411,44 @@ $as_echo "#define HAVE_NSS 1" >>confdefs.h
CPPFLAGS="-I/usr/include/nspr4 $CPPFLAGS"
fi
LIBS="$LIBS -lnss3 -lnspr4"
+ SSLLIB=""
+
+
+fi
+
+
+# libnettle
+USE_NETTLE="no"
+
+# Check whether --with-nettle was given.
+if test "${with_nettle+set}" = set; then :
+ withval=$with_nettle;
+ USE_NETTLE="yes"
+
+$as_echo "#define HAVE_NETTLE 1" >>confdefs.h
+
+ if test "$withval" != "" -a "$withval" != "yes"; then
+ CPPFLAGS="$CPPFLAGS -I$withval/include/nettle"
+ LDFLAGS="$LDFLAGS -L$withval/lib"
+
+ if test "x$enable_rpath" = xyes; then
+ if echo "$withval/lib" | grep "^/" >/dev/null; then
+ RUNTIME_PATH="$RUNTIME_PATH -R$withval/lib"
+ fi
+ fi
+
+ else
+ CPPFLAGS="$CPPFLAGS -I/usr/include/nettle"
+ fi
+ LIBS="$LIBS -lhogweed -lnettle -lgmp"
+ SSLLIB=""
fi
# openssl
-if test $USE_NSS = "no"; then
+if test $USE_NSS = "no" -a $USE_NETTLE = "no"; then
# Check whether --with-ssl was given.
@@ -16581,67 +16617,6 @@ rm -f core conftest.err conftest.$ac_objext \
fi
- # openssl engine functionality needs dlopen().
- BAKLIBS="$LIBS"
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing dlopen" >&5
-$as_echo_n "checking for library containing dlopen... " >&6; }
-if ${ac_cv_search_dlopen+:} 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 dlopen ();
-int
-main ()
-{
-return dlopen ();
- ;
- return 0;
-}
-_ACEOF
-for ac_lib in '' dl; 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_dlopen=$ac_res
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext
- if ${ac_cv_search_dlopen+:} false; then :
- break
-fi
-done
-if ${ac_cv_search_dlopen+:} false; then :
-
-else
- ac_cv_search_dlopen=no
-fi
-rm conftest.$ac_ext
-LIBS=$ac_func_search_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_dlopen" >&5
-$as_echo "$ac_cv_search_dlopen" >&6; }
-ac_res=$ac_cv_search_dlopen
-if test "$ac_res" != no; then :
- test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
-
-fi
-
- if test "$LIBS" != "$BAKLIBS"; then
- LIBSSL_LIBS="$LIBSSL_LIBS -ldl"
- fi
fi
for ac_header in openssl/ssl.h
do :
@@ -16779,6 +16754,7 @@ fi
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
+SSLLIB="-lssl"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LibreSSL" >&5
$as_echo_n "checking for LibreSSL... " >&6; }
if grep VERSION_TEXT $ssldir/include/openssl/opensslv.h | grep "LibreSSL" >/dev/null; then
@@ -16976,6 +16952,7 @@ _ACEOF
fi
+
# Check whether --enable-sha2 was given.
if test "${enable_sha2+set}" = set; then :
enableval=$enable_sha2;
@@ -16999,7 +16976,7 @@ if test "${enable_gost+set}" = set; then :
fi
use_gost="no"
-if test $USE_NSS = "no"; then
+if test $USE_NSS = "no" -a $USE_NETTLE = "no"; then
case "$enable_gost" in
no)
;;
@@ -17152,7 +17129,7 @@ case "$enable_ecdsa" in
no)
;;
*)
- if test $USE_NSS = "no"; then
+ if test $USE_NSS = "no" -a $USE_NETTLE = "no"; then
ac_fn_c_check_func "$LINENO" "ECDSA_sign" "ac_cv_func_ECDSA_sign"
if test "x$ac_cv_func_ECDSA_sign" = xyes; then :
@@ -17643,6 +17620,20 @@ fi
done
+ac_fn_c_check_decl "$LINENO" "XML_StopParser" "ac_cv_have_decl_XML_StopParser" "$ac_includes_default
+#include <expat.h>
+
+"
+if test "x$ac_cv_have_decl_XML_StopParser" = xyes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_XML_STOPPARSER $ac_have_decl
+_ACEOF
+
# set static linking if requested
@@ -18100,7 +18091,7 @@ if test "$ac_res" != no; then :
fi
-for ac_func in tzset sigprocmask fcntl getpwnam getrlimit setrlimit setsid sbrk chroot kill chown sleep usleep random srandom recvmsg sendmsg writev socketpair glob initgroups strftime localtime_r setusercontext _beginthreadex endservent endprotoent
+for ac_func in tzset sigprocmask fcntl getpwnam getrlimit setrlimit setsid sbrk chroot kill chown sleep usleep random srandom recvmsg sendmsg writev socketpair glob initgroups strftime localtime_r setusercontext _beginthreadex endservent endprotoent fsync
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"
@@ -18221,6 +18212,48 @@ esac
fi
+# test if snprintf return the proper length
+if test "x$ac_cv_func_snprintf" = xyes; then
+ if test c${cross_compiling} = cno; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for correct snprintf return value" >&5
+$as_echo_n "checking for correct snprintf return value... " >&6; }
+ if test "$cross_compiling" = 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 $? "cannot run test program while cross compiling
+See \`config.log' for more details" "$LINENO" 5; }
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$ac_includes_default
+
+int main(void) { return !(snprintf(NULL, 0, "test") == 4); }
+
+_ACEOF
+if ac_fn_c_try_run "$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 SNPRINTF_RET_BROKEN /**/" >>confdefs.h
+
+ case " $LIBOBJS " in
+ *" snprintf.$ac_objext "* ) ;;
+ *) LIBOBJS="$LIBOBJS snprintf.$ac_objext"
+ ;;
+esac
+
+
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+ fi
+fi
ac_fn_c_check_func "$LINENO" "strlcat" "ac_cv_func_strlcat"
if test "x$ac_cv_func_strlcat" = xyes; then :
$as_echo "#define HAVE_STRLCAT 1" >>confdefs.h
@@ -18277,6 +18310,20 @@ esac
fi
+ac_fn_c_check_func "$LINENO" "isblank" "ac_cv_func_isblank"
+if test "x$ac_cv_func_isblank" = xyes; then :
+ $as_echo "#define HAVE_ISBLANK 1" >>confdefs.h
+
+else
+ case " $LIBOBJS " in
+ *" isblank.$ac_objext "* ) ;;
+ *) LIBOBJS="$LIBOBJS isblank.$ac_objext"
+ ;;
+esac
+
+fi
+
+
LIBOBJ_WITHOUT_CTIMEARC4="$LIBOBJS"
ac_fn_c_check_func "$LINENO" "reallocarray" "ac_cv_func_reallocarray"
@@ -19017,7 +19064,7 @@ _ACEOF
-version=1.5.5
+version=1.5.7
date=`date +'%b %e, %Y'`
@@ -19532,7 +19579,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by unbound $as_me 1.5.5, which was
+This file was extended by unbound $as_me 1.5.7, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -19598,7 +19645,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-unbound config.status 1.5.5
+unbound config.status 1.5.7
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
diff --git a/contrib/unbound/configure.ac b/contrib/unbound/configure.ac
index 871ea7c..13d8304 100644
--- a/contrib/unbound/configure.ac
+++ b/contrib/unbound/configure.ac
@@ -10,14 +10,14 @@ sinclude(dnstap/dnstap.m4)
# must be numbers. ac_defun because of later processing
m4_define([VERSION_MAJOR],[1])
m4_define([VERSION_MINOR],[5])
-m4_define([VERSION_MICRO],[5])
+m4_define([VERSION_MICRO],[7])
AC_INIT(unbound, m4_defn([VERSION_MAJOR]).m4_defn([VERSION_MINOR]).m4_defn([VERSION_MICRO]), unbound-bugs@nlnetlabs.nl, unbound)
AC_SUBST(UNBOUND_VERSION_MAJOR, [VERSION_MAJOR])
AC_SUBST(UNBOUND_VERSION_MINOR, [VERSION_MINOR])
AC_SUBST(UNBOUND_VERSION_MICRO, [VERSION_MICRO])
LIBUNBOUND_CURRENT=5
-LIBUNBOUND_REVISION=8
+LIBUNBOUND_REVISION=10
LIBUNBOUND_AGE=3
# 1.0.0 had 0:12:0
# 1.0.1 had 0:13:0
@@ -62,6 +62,8 @@ LIBUNBOUND_AGE=3
# 1.5.3 had 5:6:3
# 1.5.4 had 5:7:3
# 1.5.5 had 5:8:3
+# 1.5.6 had 5:9:3
+# 1.5.7 had 5:10:3
# Current -- the number of the binary API that we're implementing
# Revision -- which iteration of the implementation of the binary
@@ -561,13 +563,34 @@ AC_ARG_WITH([nss], AC_HELP_STRING([--with-nss=path],
CPPFLAGS="-I/usr/include/nspr4 $CPPFLAGS"
fi
LIBS="$LIBS -lnss3 -lnspr4"
+ SSLLIB=""
+ ]
+)
+
+# libnettle
+USE_NETTLE="no"
+AC_ARG_WITH([nettle], AC_HELP_STRING([--with-nettle=path],
+ [use libnettle as crypto library, installed at path.]),
+ [
+ USE_NETTLE="yes"
+ AC_DEFINE(HAVE_NETTLE, 1, [Use libnettle for crypto])
+ if test "$withval" != "" -a "$withval" != "yes"; then
+ CPPFLAGS="$CPPFLAGS -I$withval/include/nettle"
+ LDFLAGS="$LDFLAGS -L$withval/lib"
+ ACX_RUNTIME_PATH_ADD([$withval/lib])
+ else
+ CPPFLAGS="$CPPFLAGS -I/usr/include/nettle"
+ fi
+ LIBS="$LIBS -lhogweed -lnettle -lgmp"
+ SSLLIB=""
]
)
# openssl
-if test $USE_NSS = "no"; then
+if test $USE_NSS = "no" -a $USE_NETTLE = "no"; then
ACX_WITH_SSL
ACX_LIB_SSL
+SSLLIB="-lssl"
AC_MSG_CHECKING([for LibreSSL])
if grep VERSION_TEXT $ssldir/include/openssl/opensslv.h | grep "LibreSSL" >/dev/null; then
AC_MSG_RESULT([yes])
@@ -602,6 +625,7 @@ AC_INCLUDES_DEFAULT
#include <openssl/evp.h>
])
fi
+AC_SUBST(SSLLIB)
AC_ARG_ENABLE(sha2, AC_HELP_STRING([--disable-sha2], [Disable SHA256 and SHA512 RRSIG support]))
@@ -713,7 +737,7 @@ AC_MSG_RESULT($ac_cv_c_gost_works)
AC_ARG_ENABLE(gost, AC_HELP_STRING([--disable-gost], [Disable GOST support]))
use_gost="no"
-if test $USE_NSS = "no"; then
+if test $USE_NSS = "no" -a $USE_NETTLE = "no"; then
case "$enable_gost" in
no)
;;
@@ -727,7 +751,7 @@ case "$enable_gost" in
fi
;;
esac
-fi dnl !USE_NSS
+fi dnl !USE_NSS && !USE_NETTLE
AC_ARG_ENABLE(ecdsa, AC_HELP_STRING([--disable-ecdsa], [Disable ECDSA support]))
use_ecdsa="no"
@@ -735,7 +759,7 @@ case "$enable_ecdsa" in
no)
;;
*)
- if test $USE_NSS = "no"; then
+ if test $USE_NSS = "no" -a $USE_NETTLE = "no"; then
AC_CHECK_FUNC(ECDSA_sign, [], [AC_MSG_ERROR([OpenSSL does not support ECDSA: please upgrade or rerun with --disable-ecdsa])])
AC_CHECK_FUNC(SHA384_Init, [], [AC_MSG_ERROR([OpenSSL does not support SHA384: please upgrade or rerun with --disable-ecdsa])])
AC_CHECK_DECLS([NID_X9_62_prime256v1, NID_secp384r1], [], [AC_MSG_ERROR([OpenSSL does not support the ECDSA curves: please upgrade or rerun with --disable-ecdsa])], [AC_INCLUDES_DEFAULT
@@ -881,6 +905,9 @@ if test x_$found_libexpat != x_yes; then
AC_ERROR([Could not find libexpat, expat.h])
fi
AC_CHECK_HEADERS([expat.h],,, [AC_INCLUDES_DEFAULT])
+AC_CHECK_DECLS([XML_StopParser], [], [], [AC_INCLUDES_DEFAULT
+#include <expat.h>
+])
# set static linking if requested
AC_SUBST(staticexe)
@@ -985,7 +1012,7 @@ AC_INCLUDES_DEFAULT
#endif
])
AC_SEARCH_LIBS([setusercontext], [util])
-AC_CHECK_FUNCS([tzset sigprocmask fcntl getpwnam getrlimit setrlimit setsid sbrk chroot kill chown sleep usleep random srandom recvmsg sendmsg writev socketpair glob initgroups strftime localtime_r setusercontext _beginthreadex endservent endprotoent])
+AC_CHECK_FUNCS([tzset sigprocmask fcntl getpwnam getrlimit setrlimit setsid sbrk chroot kill chown sleep usleep random srandom recvmsg sendmsg writev socketpair glob initgroups strftime localtime_r setusercontext _beginthreadex endservent endprotoent fsync])
AC_CHECK_FUNCS([setresuid],,[AC_CHECK_FUNCS([setreuid])])
AC_CHECK_FUNCS([setresgid],,[AC_CHECK_FUNCS([setregid])])
@@ -997,10 +1024,25 @@ AC_REPLACE_FUNCS(inet_aton)
AC_REPLACE_FUNCS(inet_pton)
AC_REPLACE_FUNCS(inet_ntop)
AC_REPLACE_FUNCS(snprintf)
+# test if snprintf return the proper length
+if test "x$ac_cv_func_snprintf" = xyes; then
+ if test c${cross_compiling} = cno; then
+ AC_MSG_CHECKING([for correct snprintf return value])
+ AC_RUN_IFELSE([AC_LANG_SOURCE(AC_INCLUDES_DEFAULT
+[[
+int main(void) { return !(snprintf(NULL, 0, "test") == 4); }
+]])], [AC_MSG_RESULT(yes)], [
+ AC_MSG_RESULT(no)
+ AC_DEFINE([SNPRINTF_RET_BROKEN], [], [define if (v)snprintf does not return length needed, (but length used)])
+ AC_LIBOBJ(snprintf)
+ ])
+ fi
+fi
AC_REPLACE_FUNCS(strlcat)
AC_REPLACE_FUNCS(strlcpy)
AC_REPLACE_FUNCS(memmove)
AC_REPLACE_FUNCS(gmtime_r)
+AC_REPLACE_FUNCS(isblank)
dnl without CTIME, ARC4-functions and without reallocarray.
LIBOBJ_WITHOUT_CTIMEARC4="$LIBOBJS"
AC_SUBST(LIBOBJ_WITHOUT_CTIMEARC4)
@@ -1235,7 +1277,13 @@ AHX_CONFIG_FORMAT_ATTRIBUTE
AHX_CONFIG_UNUSED_ATTRIBUTE
AHX_CONFIG_FSEEKO
AHX_CONFIG_MAXHOSTNAMELEN
-AHX_CONFIG_SNPRINTF(unbound)
+#if !defined(HAVE_SNPRINTF) || defined(SNPRINTF_RET_BROKEN)
+#define snprintf snprintf_unbound
+#define vsnprintf vsnprintf_unbound
+#include <stdarg.h>
+int snprintf (char *str, size_t count, const char *fmt, ...);
+int vsnprintf (char *str, size_t count, const char *fmt, va_list arg);
+#endif /* HAVE_SNPRINTF or SNPRINTF_RET_BROKEN */
AHX_CONFIG_INET_PTON(unbound)
AHX_CONFIG_INET_NTOP(unbound)
AHX_CONFIG_INET_ATON(unbound)
@@ -1258,6 +1306,11 @@ AHX_MEMCMP_BROKEN(unbound)
char *ctime_r(const time_t *timep, char *buf);
#endif
+#ifndef HAVE_ISBLANK
+#define isblank unbound_isblank
+int isblank(int c);
+#endif
+
#if !defined(HAVE_STRPTIME) || !defined(STRPTIME_WORKS)
#define strptime unbound_strptime
struct tm;
diff --git a/contrib/unbound/daemon/remote.c b/contrib/unbound/daemon/remote.c
index c16e4e5..d533e08 100644
--- a/contrib/unbound/daemon/remote.c
+++ b/contrib/unbound/daemon/remote.c
@@ -208,12 +208,14 @@ daemon_remote_create(struct config_file* cfg)
return NULL;
}
/* no SSLv2, SSLv3 because has defects */
- if(!(SSL_CTX_set_options(rc->ctx, SSL_OP_NO_SSLv2) & SSL_OP_NO_SSLv2)){
+ if((SSL_CTX_set_options(rc->ctx, SSL_OP_NO_SSLv2) & SSL_OP_NO_SSLv2)
+ != SSL_OP_NO_SSLv2){
log_crypto_err("could not set SSL_OP_NO_SSLv2");
daemon_remote_delete(rc);
return NULL;
}
- if(!(SSL_CTX_set_options(rc->ctx, SSL_OP_NO_SSLv3) & SSL_OP_NO_SSLv3)){
+ if((SSL_CTX_set_options(rc->ctx, SSL_OP_NO_SSLv3) & SSL_OP_NO_SSLv3)
+ != SSL_OP_NO_SSLv3){
log_crypto_err("could not set SSL_OP_NO_SSLv3");
daemon_remote_delete(rc);
return NULL;
diff --git a/contrib/unbound/daemon/unbound.c b/contrib/unbound/daemon/unbound.c
index 8e07c38..0ceee53 100644
--- a/contrib/unbound/daemon/unbound.c
+++ b/contrib/unbound/daemon/unbound.c
@@ -180,6 +180,8 @@ static void usage()
SSLeay_version(SSLEAY_VERSION)
#elif defined(HAVE_NSS)
NSS_GetVersion()
+#elif defined(HAVE_NETTLE)
+ "nettle"
#endif
);
printf("linked modules:");
@@ -450,6 +452,9 @@ perform_setup(struct daemon* daemon, struct config_file* cfg, int debug_mode,
/* endpwent below, in case we need pwd for setusercontext */
}
#endif
+#ifdef UB_ON_WINDOWS
+ w_config_adjust_directory(cfg);
+#endif
/* init syslog (as root) if needed, before daemonize, otherwise
* a fork error could not be printed since daemonize closed stderr.*/
diff --git a/contrib/unbound/daemon/worker.c b/contrib/unbound/daemon/worker.c
index 79aec4d..c90a659 100644
--- a/contrib/unbound/daemon/worker.c
+++ b/contrib/unbound/daemon/worker.c
@@ -866,11 +866,16 @@ worker_handle_request(struct comm_point* c, void* arg, int error,
goto send_reply;
}
if((ret=parse_edns_from_pkt(c->buffer, &edns)) != 0) {
+ struct edns_data reply_edns;
verbose(VERB_ALGO, "worker parse edns: formerror.");
log_addr(VERB_CLIENT,"from",&repinfo->addr, repinfo->addrlen);
- sldns_buffer_rewind(c->buffer);
- LDNS_QR_SET(sldns_buffer_begin(c->buffer));
+ memset(&reply_edns, 0, sizeof(reply_edns));
+ reply_edns.edns_present = 1;
+ reply_edns.udp_size = EDNS_ADVERTISED_SIZE;
LDNS_RCODE_SET(sldns_buffer_begin(c->buffer), ret);
+ error_encode(c->buffer, ret, &qinfo,
+ *(uint16_t*)(void *)sldns_buffer_begin(c->buffer),
+ sldns_buffer_read_u16_at(c->buffer, 2), &reply_edns);
server_stats_insrcode(&worker->stats, c->buffer);
goto send_reply;
}
diff --git a/contrib/unbound/dns64/dns64.c b/contrib/unbound/dns64/dns64.c
index 63cc808..0de3f66 100644
--- a/contrib/unbound/dns64/dns64.c
+++ b/contrib/unbound/dns64/dns64.c
@@ -618,8 +618,10 @@ dns64_synth_aaaa_data(const struct ub_packed_rrset_key* fk,
dd->rr_ttl = (time_t*)&dd->rr_data[dd->count];
for(i = 0; i < fd->count; ++i) {
if (fd->rr_len[i] != 6 || fd->rr_data[i][0] != 0
- || fd->rr_data[i][1] != 4)
+ || fd->rr_data[i][1] != 4) {
+ *dd_out = NULL;
return;
+ }
dd->rr_len[i] = 18;
dd->rr_data[i] =
(uint8_t*)&dd->rr_ttl[dd->count] + 18*i;
@@ -638,6 +640,7 @@ dns64_synth_aaaa_data(const struct ub_packed_rrset_key* fk,
*/
if(!dk) {
log_err("no key");
+ *dd_out = NULL;
return;
}
@@ -646,6 +649,7 @@ dns64_synth_aaaa_data(const struct ub_packed_rrset_key* fk,
if(!dk->rk.dname) {
log_err("out of memory");
+ *dd_out = NULL;
return;
}
diff --git a/contrib/unbound/dnstap/dnstap.proto b/contrib/unbound/dnstap/dnstap.proto
index 3504d99e..32871f4 100644
--- a/contrib/unbound/dnstap/dnstap.proto
+++ b/contrib/unbound/dnstap/dnstap.proto
@@ -105,7 +105,7 @@ message Message {
enum Type {
// AUTH_QUERY is a DNS query message received from a resolver by an
- // authoritative name server, from the perspective of the authorative
+ // authoritative name server, from the perspective of the authoritative
// name server.
AUTH_QUERY = 1;
diff --git a/contrib/unbound/doc/Changelog b/contrib/unbound/doc/Changelog
index 3f3b245..6824b1d 100644
--- a/contrib/unbound/doc/Changelog
+++ b/contrib/unbound/doc/Changelog
@@ -1,3 +1,121 @@
+8 December 2015: Wouter
+ - Fixup 724 for unbound-control.
+
+7 December 2015: Ralph
+ - Do not minimise forwarded requests.
+
+4 December 2015: Wouter
+ - Removed unneeded whitespace from example.conf.
+
+3 December 2015: Ralph
+ - (after rc1 tag)
+ - Committed fix to qname minimisation and unit test case for it.
+
+3 December 2015: Wouter
+ - iana portlist update.
+ - 1.5.7rc1 prerelease tag.
+
+2 December 2015: Wouter
+ - Fixup 724: Fix PCA prompt for unbound-service-install.exe.
+ re-enable stdout printout.
+ - For 724: Add Changelog to windows binary dist.
+
+1 December 2015: Ralph
+ - Qname minimisation review fixes
+
+1 December 2015: Wouter
+ - Fixup 724 fix for fname_after_chroot() calls.
+ - Remove stdout printout for unbound-service-install.exe
+ - .gitignore for git users.
+
+30 November 2015: Ralph
+ - Implemented qname minimisation
+
+30 November 2015: Wouter
+ - Fix for #724: conf syntax to read files from run dir (on Windows).
+
+25 November 2015: Wouter
+ - Fix for #720, fix unbound-control-setup windows batch file.
+
+24 November 2015: Wouter
+ - Fix #720: add windows scripts to zip bundle.
+ - iana portlist update.
+
+20 November 2015: Wouter
+ - Added assert on rrset cache correctness.
+ - Fix that malformed EDNS query gets a response without malformed EDNS.
+
+18 November 2015: Wouter
+ - newer acx_nlnetlabs.m4.
+ - spelling fixes from Igor Sobrado Delgado.
+
+17 November 2015: Wouter
+ - Fix #594. libunbound: optionally use libnettle for crypto.
+ Contributed by Luca Bruno. Added --with-nettle for use with
+ --with-libunbound-only.
+ - refactor nsec3 hash implementation to be more library-portable.
+ - iana portlist update.
+ - Fixup DER encoded DSA signatures for libnettle.
+
+16 November 2015: Wouter
+ - Fix for lenient accept of reverse order DNAME and CNAME.
+
+6 November 2015: Wouter
+ - Change example.conf: ftp.internic.net to https://www.internic.net
+
+5 November 2015: Wouter
+ - ACX_SSL_CHECKS no longer adds -ldl needlessly.
+
+3 November 2015: Wouter
+ - Fix #718: Fix unbound-control-setup with support for env
+ without HEREDOC bash support.
+
+29 October 2015: Wouter
+ - patch from Doug Hogan for SSL_OP_NO_SSLvx options.
+ - Fix #716: nodata proof with empty non-terminals and wildcards.
+
+28 October 2015: Wouter
+ - Fix checklock testcode for linux threads on exit.
+
+27 October 2015: Wouter
+ - isblank() compat implementation.
+ - detect libexpat without xml_StopParser function.
+ - portability fixes.
+ - portability, replace snprintf if return value broken.
+
+23 October 2015: Wouter
+ - Fix #714: Document config to block private-address for IPv4
+ mapped IPv6 addresses.
+
+22 October 2015: Wouter
+ - Fix #712: unbound-anchor appears to not fsync root.key.
+
+20 October 2015: Wouter
+ - 1.5.6 release.
+ - trunk tracks development of 1.5.7.
+
+15 October 2015: Wouter
+ - Fix segfault in the dns64 module in the formaterror error path.
+ - Fix sldns_wire2str_rdata_scan for malformed RRs.
+ - tag for 1.5.6rc1 release.
+
+14 October 2015: Wouter
+ - ANY responses include DNAME records if present, as per Evan Hunt's
+ remark in dnsop.
+ - Fix manpage to suggest using SIGTERM to terminate the server.
+
+9 October 2015: Wouter
+ - Default for ssl-port is port 853, the temporary port assignment
+ for secure domain name system traffic.
+ If you used to rely on the older default of port 443, you have
+ to put a clause in unbound.conf for that. The new value is likely
+ going to be the standardised port number for this traffic.
+ - iana portlist update.
+
+6 October 2015: Wouter
+ - 1.5.5 release.
+ - trunk tracks the development of 1.5.6.
+
28 September 2015: Wouter
- MAX_TARGET_COUNT increased to 64, to fix up sporadic resolution
failures.
@@ -731,7 +849,7 @@
existence in 4592. NSEC empty non-terminals exist and thus the
RCODE should have been NOERROR. If this occurs, and the RRsets
are secure, we set the RCODE to NOERROR and the security status
- of the reponse is also considered secure.
+ of the response is also considered secure.
14 February 2014: Wouter
- Works on Minix (3.2.1).
@@ -1503,7 +1621,7 @@
- Fix getaddrinfowithincludes on windows with fedora16 mingw32-gcc.
- Fix warnings with gcc 4.6 in compat/inet_ntop.c.
- Fix warning unused in compat/strptime.c.
- - Fix malloc detection and double defintion.
+ - Fix malloc detection and double definition.
2 December 2011: Wouter
- configure generated with autoconf 2.68.
@@ -4948,7 +5066,7 @@
- Advertise builtin select libevent alternative when no libevent
is found.
- signit can generate NSEC3 hashes, for generating tests.
- - multiple nsec3 paramaters in message test.
+ - multiple nsec3 parameters in message test.
- too high nsec3 iterations becomes insecure test.
21 September 2007: Wouter
@@ -5019,7 +5137,7 @@
- testbound can replay a TCP query (set MATCH TCP in the QUERY).
- DS and noDS referral validation test.
- if you configure many trust anchors, parent trust anchors can
- securely deny existance of child trust anchors, if validated.
+ securely deny existence of child trust anchors, if validated.
- not all *.name NSECs are present because a wildcard was matched,
and *.name NSECs can prove nodata for empty nonterminals.
Also, for wildcard name NSECs, check they are not from the parent
@@ -5326,7 +5444,7 @@
17 July 2007: Wouter
- forward zone options in config file.
- - forward per zone in iterator. takes precendence over stubs.
+ - forward per zone in iterator. takes precedence over stubs.
- fixup commithooks.
- removed forward-to and forward-to-port features, subsumed by
new forward zones.
@@ -5427,7 +5545,7 @@
ldns and libevent are linked statically. Default is off.
- make install and make uninstall. Works with static-exe and without.
installation of unbound binary and manual pages.
- - alignement problem fix on solaris 64.
+ - alignment problem fix on solaris 64.
- fixup address in case of TCP error.
12 June 2007: Wouter
@@ -5510,7 +5628,7 @@
- removed FLAG_CD from message and rrset caches. This was useful for
an agnostic forwarder, but not for a sophisticated (trust value per
rrset enabled) cache.
- - iterator reponse typing.
+ - iterator response typing.
- iterator cname handle.
- iterator prime start.
- subquery work.
@@ -5530,7 +5648,7 @@
- Acknowledge use of unbound-java code in iterator. Nicer readme.
- services/cache/dns.c DNS Cache. Hybrid cache uses msgcache and
rrset cache from module environment.
- - packed rrset key has type and class as easily accessable struct
+ - packed rrset key has type and class as easily accessible struct
members. They are still kept in network format for fast msg encode.
- dns cache find_delegation routine.
- iterator main functions setup.
@@ -5614,7 +5732,7 @@
- EDNS read from query, used to make reply smaller.
- advertised edns value constants.
- EDNS BADVERS response, if asked for too high edns version.
- - EDNS extended error reponses once the EDNS record from the query
+ - EDNS extended error responses once the EDNS record from the query
has successfully been parsed.
4 May 2007: Wouter
diff --git a/contrib/unbound/doc/README b/contrib/unbound/doc/README
index c8bddcc..8235ea2 100644
--- a/contrib/unbound/doc/README
+++ b/contrib/unbound/doc/README
@@ -1,4 +1,4 @@
-README for Unbound 1.5.5
+README for Unbound 1.5.7
Copyright 2007 NLnet Labs
http://unbound.net
diff --git a/contrib/unbound/doc/example.conf b/contrib/unbound/doc/example.conf
index 87bbebe..11c3ba9 100644
--- a/contrib/unbound/doc/example.conf
+++ b/contrib/unbound/doc/example.conf
@@ -1,14 +1,14 @@
#
# Example configuration file.
#
-# See unbound.conf(5) man page, version 1.5.5.
+# See unbound.conf(5) man page, version 1.5.7.
#
# this is a comment.
#Use this to include other text into the file.
#include: "otherfile.conf"
-# The server clause sets the main parameters.
+# The server clause sets the main parameters.
server:
# whitespace is not necessary, but looks cleaner.
@@ -40,7 +40,7 @@ server:
# interface: 2001:DB8::5
# enable this feature to copy the source address of queries to reply.
- # Socket options are not supported on all platforms. experimental.
+ # Socket options are not supported on all platforms. experimental.
# interface-automatic: no
# port to answer queries from
@@ -84,10 +84,10 @@ server:
# buffer size for UDP port 53 outgoing (SO_SNDBUF socket option).
# 0 is system default. Use 4m to handle spikes on very busy servers.
# so-sndbuf: 0
-
+
# use SO_REUSEPORT to distribute queries over threads.
# so-reuseport: no
-
+
# use IP_TRANSPARENT so the interface: addresses can be non-local
# and you can config non-existing IPs that are going to work later on
# ip-transparent: no
@@ -105,7 +105,7 @@ server:
# msg-buffer-size: 65552
# the amount of memory to use for the message cache.
- # plain value in bytes or you can append k, m or G. default is "4Mb".
+ # plain value in bytes or you can append k, m or G. default is "4Mb".
# msg-cache-size: 4m
# the number of slabs to use for the message cache.
@@ -118,12 +118,12 @@ server:
# if very busy, 50% queries run to completion, 50% get timeout in msec
# jostle-timeout: 200
-
+
# msec to wait before close of port on timeout UDP. 0 disables.
# delay-close: 0
# the amount of memory to use for the RRset cache.
- # plain value in bytes or you can append k, m or G. default is "4Mb".
+ # plain value in bytes or you can append k, m or G. default is "4Mb".
# rrset-cache-size: 4m
# the number of slabs to use for the RRset cache.
@@ -145,7 +145,7 @@ server:
# the time to live (TTL) value for cached roundtrip times, lameness and
# EDNS version information for hosts. In seconds.
# infra-host-ttl: 900
-
+
# minimum wait time for responses, increase if uplink is long. In msec.
# infra-cache-min-rtt: 50
@@ -195,8 +195,8 @@ server:
#
# If chroot is enabled, you should pass the configfile (from the
# commandline) as a full path from the original root. After the
- # chroot has been performed the now defunct portion of the config
- # file path is removed to be able to reread the config after a reload.
+ # chroot has been performed the now defunct portion of the config
+ # file path is removed to be able to reread the config after a reload.
#
# All other file paths (working dir, logfile, roothints, and
# key files) can be specified in several ways:
@@ -205,7 +205,7 @@ server:
# o as an absolute path relative to the original root.
# In the last case the path is adjusted to remove the unused portion.
#
- # The pid file can be absolute and outside of the chroot, it is
+ # The pid file can be absolute and outside of the chroot, it is
# written just prior to performing the chroot and dropping permissions.
#
# Additionally, unbound may need to access /dev/random (for entropy).
@@ -219,22 +219,22 @@ server:
# If you give "" no privileges are dropped.
# username: "unbound"
- # the working directory. The relative files in this config are
+ # the working directory. The relative files in this config are
# relative to this directory. If you give "" the working directory
# is not changed.
# directory: "/var/unbound"
- # the log file, "" means log to stderr.
+ # the log file, "" means log to stderr.
# Use of this option sets use-syslog to "no".
# logfile: ""
- # Log to syslog(3) if yes. The log facility LOG_DAEMON is used to
+ # Log to syslog(3) if yes. The log facility LOG_DAEMON is used to
# log to, with identity "unbound". If yes, it overrides the logfile.
- # use-syslog: yes
+ # use-syslog: yes
# print UTC timestamp in ascii to logfile, default is epoch in seconds.
# log-time-ascii: no
-
+
# print one line with time, IP, name, type, class for every query.
# log-queries: no
@@ -242,7 +242,7 @@ server:
# pidfile: "/var/unbound/unbound.pid"
# file to read root hints from.
- # get one from ftp://FTP.INTERNIC.NET/domain/named.cache
+ # get one from https://www.internic.net/domain/named.cache
# root-hints: ""
# enable to not answer id.server and hostname.bind queries.
@@ -258,8 +258,8 @@ server:
# version: ""
# the target fetch policy.
- # series of integers describing the policy per dependency depth.
- # The number of values in the list determines the maximum dependency
+ # series of integers describing the policy per dependency depth.
+ # The number of values in the list determines the maximum dependency
# depth the recursor will pursue before giving up. Each integer means:
# -1 : fetch all targets opportunistically,
# 0: fetch on demand,
@@ -267,17 +267,17 @@ server:
# Enclose the list of numbers between quotes ("").
# target-fetch-policy: "3 2 1 0 0"
- # Harden against very small EDNS buffer sizes.
+ # Harden against very small EDNS buffer sizes.
# harden-short-bufsize: no
# Harden against unseemly large queries.
# harden-large-queries: no
- # Harden against out of zone rrsets, to avoid spoofing attempts.
+ # Harden against out of zone rrsets, to avoid spoofing attempts.
# harden-glue: yes
# Harden against receiving dnssec-stripped data. If you turn it
- # off, failing to validate dnskey data for a trustanchor will
+ # off, failing to validate dnskey data for a trustanchor will
# trigger insecure mode for that zone (like without a trustanchor).
# Default on, which insists on dnssec data for trust-anchored zones.
# harden-dnssec-stripped: yes
@@ -287,7 +287,7 @@ server:
# Harden the referral path by performing additional queries for
# infrastructure data. Validates the replies (if possible).
- # Default off, because the lookups burden the server. Experimental
+ # Default off, because the lookups burden the server. Experimental
# implementation of draft-wijngaards-dnsext-resolver-side-mitigation.
# harden-referral-path: no
@@ -296,18 +296,23 @@ server:
# to validate the zone.
# harden-algo-downgrade: no
+ # Sent minimum amount of information to upstream servers to enhance
+ # privacy. Only sent minimum required labels of the QNAME and set QTYPE
+ # to NS when possible.
+ # qname-minimisation: no
+
# Use 0x20-encoded random bits in the query to foil spoof attempts.
# This feature is an experimental implementation of draft dns-0x20.
# use-caps-for-id: no
-
+
# Domains (and domains in them) without support for dns-0x20 and
# the fallback fails because they keep sending different answers.
# caps-whitelist: "licdn.com"
- # Enforce privacy of these addresses. Strips them away from answers.
- # It may cause DNSSEC validation to additionally mark it as bogus.
- # Protects against 'DNS Rebinding' (uses browser as network proxy).
- # Only 'private-domain' and 'local-data' names are allowed to have
+ # Enforce privacy of these addresses. Strips them away from answers.
+ # It may cause DNSSEC validation to additionally mark it as bogus.
+ # Protects against 'DNS Rebinding' (uses browser as network proxy).
+ # Only 'private-domain' and 'local-data' names are allowed to have
# these private addresses. No default.
# private-address: 10.0.0.0/8
# private-address: 172.16.0.0/12
@@ -315,6 +320,7 @@ server:
# private-address: 169.254.0.0/16
# private-address: fd00::/8
# private-address: fe80::/10
+ # private-address: ::ffff:0:0/96
# Allow the domain (and its subdomains) to contain private addresses.
# local-data statements are allowed to contain private addresses too.
@@ -373,7 +379,7 @@ server:
# Zone file format, with DS and DNSKEY entries.
# Note this gets out of date, use auto-trust-anchor-file please.
# trust-anchor-file: ""
-
+
# Trusted key for validation. DS or DNSKEY. specify the RR on a
# single line, surrounded by "". TTL is ignored. class is IN default.
# Note this gets out of date, use auto-trust-anchor-file please.
@@ -383,7 +389,7 @@ server:
# File with trusted keys for validation. Specify more than one file
# with several entries, one file per entry. Like trust-anchor-file
- # but has a different file format. Format is BIND-9 style format,
+ # but has a different file format. Format is BIND-9 style format,
# the trusted-keys { name flag proto algo "key"; }; clauses are read.
# you need external update procedures to track changes in keys.
# trusted-keys-file: ""
@@ -408,7 +414,7 @@ server:
# Should additional section of secure message also be kept clean of
# unsecure data. Useful to shield the users of this validator from
- # potential bogus data in the additional section. All unsigned data
+ # potential bogus data in the additional section. All unsigned data
# in the additional section is removed from secure messages.
# val-clean-additional: yes
@@ -433,7 +439,7 @@ server:
# A message with an NSEC3 with larger count is marked insecure.
# List in ascending order the keysize and count values.
# val-nsec3-keysize-iterations: "1024 150 2048 500 4096 2500"
-
+
# instruct the auto-trust-anchor-file probing to add anchors after ttl.
# add-holddown: 2592000 # 30 days
@@ -448,7 +454,7 @@ server:
# permit-small-holddown: no
# the amount of memory to use for the key cache.
- # plain value in bytes or you can append k, m or G. default is "4Mb".
+ # plain value in bytes or you can append k, m or G. default is "4Mb".
# key-cache-size: 4m
# the number of slabs to use for the key cache.
@@ -457,7 +463,7 @@ server:
# key-cache-slabs: 4
# the amount of memory to use for the negative cache (used for DLV).
- # plain value in bytes or you can append k, m or G. default is "1Mb".
+ # plain value in bytes or you can append k, m or G. default is "1Mb".
# neg-cache-size: 1m
# By default, for a number of zones a small default 'nothing here'
@@ -501,7 +507,7 @@ server:
# local-zone: "b.e.f.ip6.arpa." nodefault
# local-zone: "8.b.d.0.1.0.0.2.ip6.arpa." nodefault
# And for 64.100.in-addr.arpa. to 127.100.in-addr.arpa.
-
+
# if unbound is running service for the local host then it is useful
# to perform lan-wide lookups to the upstream, and unblock the
# long list of local-zones above. If this unbound is a dns server
@@ -512,7 +518,7 @@ server:
# a number of locally served zones can be configured.
# local-zone: <zone> <type>
# local-data: "<resource record string>"
- # o deny serves local data (if any), else, drops queries.
+ # o deny serves local data (if any), else, drops queries.
# o refuse serves local data (if any), else, replies with error.
# o static serves local data, else, nxdomain or nodata answer.
# o transparent gives local data, but resolves normally for other names
@@ -525,7 +531,7 @@ server:
# defaults are localhost address, reverse for 127.0.0.1 and ::1
# and nxdomain for AS112 zones. If you configure one of these zones
# the default content is omitted, or you can omit it with 'nodefault'.
- #
+ #
# If you configure local-data without specifying local-zone, by
# default a transparent local-zone is created for the data.
#
@@ -552,7 +558,7 @@ server:
# default is "" (disabled). requires restart to take effect.
# ssl-service-key: "path/to/privatekeyfile.key"
# ssl-service-pem: "path/to/publiccertfile.pem"
- # ssl-port: 443
+ # ssl-port: 853
# request upstream over SSL (with plain DNS inside the SSL stream).
# Default is no. Can be turned on and off with unbound-control.
@@ -571,7 +577,7 @@ server:
# ratelimit-size: 4m
# ratelimit cache slabs, reduces lock contention if equal to cpucount.
# ratelimit-slabs: 4
-
+
# 0 blocks when ratelimited, otherwise let 1/xth traffic through
# ratelimit-factor: 10
@@ -590,7 +596,7 @@ python:
# Script file to load
# python-script: "/var/unbound/ubmodule-tst.py"
-# Remote control config section.
+# Remote control config section.
remote-control:
# Enable remote control with unbound-control(8) here.
# set up the keys and certificates with unbound-control-setup.
@@ -621,9 +627,9 @@ remote-control:
# control-cert-file: "/var/unbound/unbound_control.pem"
# Stub zones.
-# Create entries like below, to make all queries for 'example.com' and
-# 'example.org' go to the given list of nameservers. list zero or more
-# nameservers by hostname or by ipaddress. If you set stub-prime to yes,
+# Create entries like below, to make all queries for 'example.com' and
+# 'example.org' go to the given list of nameservers. list zero or more
+# nameservers by hostname or by ipaddress. If you set stub-prime to yes,
# the list is treated as priming hints (default is no).
# With stub-first yes, it attempts without the stub if it fails.
# Consider adding domain-insecure: name and local-zone: name nodefault
diff --git a/contrib/unbound/doc/example.conf.in b/contrib/unbound/doc/example.conf.in
index 399aa80..ff90e3b 100644
--- a/contrib/unbound/doc/example.conf.in
+++ b/contrib/unbound/doc/example.conf.in
@@ -1,14 +1,14 @@
#
# Example configuration file.
#
-# See unbound.conf(5) man page, version 1.5.5.
+# See unbound.conf(5) man page, version 1.5.7.
#
# this is a comment.
#Use this to include other text into the file.
#include: "otherfile.conf"
-# The server clause sets the main parameters.
+# The server clause sets the main parameters.
server:
# whitespace is not necessary, but looks cleaner.
@@ -40,7 +40,7 @@ server:
# interface: 2001:DB8::5
# enable this feature to copy the source address of queries to reply.
- # Socket options are not supported on all platforms. experimental.
+ # Socket options are not supported on all platforms. experimental.
# interface-automatic: no
# port to answer queries from
@@ -84,10 +84,10 @@ server:
# buffer size for UDP port 53 outgoing (SO_SNDBUF socket option).
# 0 is system default. Use 4m to handle spikes on very busy servers.
# so-sndbuf: 0
-
+
# use SO_REUSEPORT to distribute queries over threads.
# so-reuseport: no
-
+
# use IP_TRANSPARENT so the interface: addresses can be non-local
# and you can config non-existing IPs that are going to work later on
# ip-transparent: no
@@ -105,7 +105,7 @@ server:
# msg-buffer-size: 65552
# the amount of memory to use for the message cache.
- # plain value in bytes or you can append k, m or G. default is "4Mb".
+ # plain value in bytes or you can append k, m or G. default is "4Mb".
# msg-cache-size: 4m
# the number of slabs to use for the message cache.
@@ -118,12 +118,12 @@ server:
# if very busy, 50% queries run to completion, 50% get timeout in msec
# jostle-timeout: 200
-
+
# msec to wait before close of port on timeout UDP. 0 disables.
# delay-close: 0
# the amount of memory to use for the RRset cache.
- # plain value in bytes or you can append k, m or G. default is "4Mb".
+ # plain value in bytes or you can append k, m or G. default is "4Mb".
# rrset-cache-size: 4m
# the number of slabs to use for the RRset cache.
@@ -145,7 +145,7 @@ server:
# the time to live (TTL) value for cached roundtrip times, lameness and
# EDNS version information for hosts. In seconds.
# infra-host-ttl: 900
-
+
# minimum wait time for responses, increase if uplink is long. In msec.
# infra-cache-min-rtt: 50
@@ -195,8 +195,8 @@ server:
#
# If chroot is enabled, you should pass the configfile (from the
# commandline) as a full path from the original root. After the
- # chroot has been performed the now defunct portion of the config
- # file path is removed to be able to reread the config after a reload.
+ # chroot has been performed the now defunct portion of the config
+ # file path is removed to be able to reread the config after a reload.
#
# All other file paths (working dir, logfile, roothints, and
# key files) can be specified in several ways:
@@ -205,7 +205,7 @@ server:
# o as an absolute path relative to the original root.
# In the last case the path is adjusted to remove the unused portion.
#
- # The pid file can be absolute and outside of the chroot, it is
+ # The pid file can be absolute and outside of the chroot, it is
# written just prior to performing the chroot and dropping permissions.
#
# Additionally, unbound may need to access /dev/random (for entropy).
@@ -219,22 +219,22 @@ server:
# If you give "" no privileges are dropped.
# username: "@UNBOUND_USERNAME@"
- # the working directory. The relative files in this config are
+ # the working directory. The relative files in this config are
# relative to this directory. If you give "" the working directory
# is not changed.
# directory: "@UNBOUND_RUN_DIR@"
- # the log file, "" means log to stderr.
+ # the log file, "" means log to stderr.
# Use of this option sets use-syslog to "no".
# logfile: ""
- # Log to syslog(3) if yes. The log facility LOG_DAEMON is used to
+ # Log to syslog(3) if yes. The log facility LOG_DAEMON is used to
# log to, with identity "unbound". If yes, it overrides the logfile.
- # use-syslog: yes
+ # use-syslog: yes
# print UTC timestamp in ascii to logfile, default is epoch in seconds.
# log-time-ascii: no
-
+
# print one line with time, IP, name, type, class for every query.
# log-queries: no
@@ -242,7 +242,7 @@ server:
# pidfile: "@UNBOUND_PIDFILE@"
# file to read root hints from.
- # get one from ftp://FTP.INTERNIC.NET/domain/named.cache
+ # get one from https://www.internic.net/domain/named.cache
# root-hints: ""
# enable to not answer id.server and hostname.bind queries.
@@ -258,8 +258,8 @@ server:
# version: ""
# the target fetch policy.
- # series of integers describing the policy per dependency depth.
- # The number of values in the list determines the maximum dependency
+ # series of integers describing the policy per dependency depth.
+ # The number of values in the list determines the maximum dependency
# depth the recursor will pursue before giving up. Each integer means:
# -1 : fetch all targets opportunistically,
# 0: fetch on demand,
@@ -267,17 +267,17 @@ server:
# Enclose the list of numbers between quotes ("").
# target-fetch-policy: "3 2 1 0 0"
- # Harden against very small EDNS buffer sizes.
+ # Harden against very small EDNS buffer sizes.
# harden-short-bufsize: no
# Harden against unseemly large queries.
# harden-large-queries: no
- # Harden against out of zone rrsets, to avoid spoofing attempts.
+ # Harden against out of zone rrsets, to avoid spoofing attempts.
# harden-glue: yes
# Harden against receiving dnssec-stripped data. If you turn it
- # off, failing to validate dnskey data for a trustanchor will
+ # off, failing to validate dnskey data for a trustanchor will
# trigger insecure mode for that zone (like without a trustanchor).
# Default on, which insists on dnssec data for trust-anchored zones.
# harden-dnssec-stripped: yes
@@ -287,7 +287,7 @@ server:
# Harden the referral path by performing additional queries for
# infrastructure data. Validates the replies (if possible).
- # Default off, because the lookups burden the server. Experimental
+ # Default off, because the lookups burden the server. Experimental
# implementation of draft-wijngaards-dnsext-resolver-side-mitigation.
# harden-referral-path: no
@@ -296,18 +296,23 @@ server:
# to validate the zone.
# harden-algo-downgrade: no
+ # Sent minimum amount of information to upstream servers to enhance
+ # privacy. Only sent minimum required labels of the QNAME and set QTYPE
+ # to NS when possible.
+ # qname-minimisation: no
+
# Use 0x20-encoded random bits in the query to foil spoof attempts.
# This feature is an experimental implementation of draft dns-0x20.
# use-caps-for-id: no
-
+
# Domains (and domains in them) without support for dns-0x20 and
# the fallback fails because they keep sending different answers.
# caps-whitelist: "licdn.com"
- # Enforce privacy of these addresses. Strips them away from answers.
- # It may cause DNSSEC validation to additionally mark it as bogus.
- # Protects against 'DNS Rebinding' (uses browser as network proxy).
- # Only 'private-domain' and 'local-data' names are allowed to have
+ # Enforce privacy of these addresses. Strips them away from answers.
+ # It may cause DNSSEC validation to additionally mark it as bogus.
+ # Protects against 'DNS Rebinding' (uses browser as network proxy).
+ # Only 'private-domain' and 'local-data' names are allowed to have
# these private addresses. No default.
# private-address: 10.0.0.0/8
# private-address: 172.16.0.0/12
@@ -315,6 +320,7 @@ server:
# private-address: 169.254.0.0/16
# private-address: fd00::/8
# private-address: fe80::/10
+ # private-address: ::ffff:0:0/96
# Allow the domain (and its subdomains) to contain private addresses.
# local-data statements are allowed to contain private addresses too.
@@ -373,7 +379,7 @@ server:
# Zone file format, with DS and DNSKEY entries.
# Note this gets out of date, use auto-trust-anchor-file please.
# trust-anchor-file: ""
-
+
# Trusted key for validation. DS or DNSKEY. specify the RR on a
# single line, surrounded by "". TTL is ignored. class is IN default.
# Note this gets out of date, use auto-trust-anchor-file please.
@@ -383,7 +389,7 @@ server:
# File with trusted keys for validation. Specify more than one file
# with several entries, one file per entry. Like trust-anchor-file
- # but has a different file format. Format is BIND-9 style format,
+ # but has a different file format. Format is BIND-9 style format,
# the trusted-keys { name flag proto algo "key"; }; clauses are read.
# you need external update procedures to track changes in keys.
# trusted-keys-file: ""
@@ -408,7 +414,7 @@ server:
# Should additional section of secure message also be kept clean of
# unsecure data. Useful to shield the users of this validator from
- # potential bogus data in the additional section. All unsigned data
+ # potential bogus data in the additional section. All unsigned data
# in the additional section is removed from secure messages.
# val-clean-additional: yes
@@ -433,7 +439,7 @@ server:
# A message with an NSEC3 with larger count is marked insecure.
# List in ascending order the keysize and count values.
# val-nsec3-keysize-iterations: "1024 150 2048 500 4096 2500"
-
+
# instruct the auto-trust-anchor-file probing to add anchors after ttl.
# add-holddown: 2592000 # 30 days
@@ -448,7 +454,7 @@ server:
# permit-small-holddown: no
# the amount of memory to use for the key cache.
- # plain value in bytes or you can append k, m or G. default is "4Mb".
+ # plain value in bytes or you can append k, m or G. default is "4Mb".
# key-cache-size: 4m
# the number of slabs to use for the key cache.
@@ -457,7 +463,7 @@ server:
# key-cache-slabs: 4
# the amount of memory to use for the negative cache (used for DLV).
- # plain value in bytes or you can append k, m or G. default is "1Mb".
+ # plain value in bytes or you can append k, m or G. default is "1Mb".
# neg-cache-size: 1m
# By default, for a number of zones a small default 'nothing here'
@@ -501,7 +507,7 @@ server:
# local-zone: "b.e.f.ip6.arpa." nodefault
# local-zone: "8.b.d.0.1.0.0.2.ip6.arpa." nodefault
# And for 64.100.in-addr.arpa. to 127.100.in-addr.arpa.
-
+
# if unbound is running service for the local host then it is useful
# to perform lan-wide lookups to the upstream, and unblock the
# long list of local-zones above. If this unbound is a dns server
@@ -512,7 +518,7 @@ server:
# a number of locally served zones can be configured.
# local-zone: <zone> <type>
# local-data: "<resource record string>"
- # o deny serves local data (if any), else, drops queries.
+ # o deny serves local data (if any), else, drops queries.
# o refuse serves local data (if any), else, replies with error.
# o static serves local data, else, nxdomain or nodata answer.
# o transparent gives local data, but resolves normally for other names
@@ -525,7 +531,7 @@ server:
# defaults are localhost address, reverse for 127.0.0.1 and ::1
# and nxdomain for AS112 zones. If you configure one of these zones
# the default content is omitted, or you can omit it with 'nodefault'.
- #
+ #
# If you configure local-data without specifying local-zone, by
# default a transparent local-zone is created for the data.
#
@@ -552,7 +558,7 @@ server:
# default is "" (disabled). requires restart to take effect.
# ssl-service-key: "path/to/privatekeyfile.key"
# ssl-service-pem: "path/to/publiccertfile.pem"
- # ssl-port: 443
+ # ssl-port: 853
# request upstream over SSL (with plain DNS inside the SSL stream).
# Default is no. Can be turned on and off with unbound-control.
@@ -571,7 +577,7 @@ server:
# ratelimit-size: 4m
# ratelimit cache slabs, reduces lock contention if equal to cpucount.
# ratelimit-slabs: 4
-
+
# 0 blocks when ratelimited, otherwise let 1/xth traffic through
# ratelimit-factor: 10
@@ -590,7 +596,7 @@ python:
# Script file to load
# python-script: "@UNBOUND_SHARE_DIR@/ubmodule-tst.py"
-# Remote control config section.
+# Remote control config section.
remote-control:
# Enable remote control with unbound-control(8) here.
# set up the keys and certificates with unbound-control-setup.
@@ -621,9 +627,9 @@ remote-control:
# control-cert-file: "@UNBOUND_RUN_DIR@/unbound_control.pem"
# Stub zones.
-# Create entries like below, to make all queries for 'example.com' and
-# 'example.org' go to the given list of nameservers. list zero or more
-# nameservers by hostname or by ipaddress. If you set stub-prime to yes,
+# Create entries like below, to make all queries for 'example.com' and
+# 'example.org' go to the given list of nameservers. list zero or more
+# nameservers by hostname or by ipaddress. If you set stub-prime to yes,
# the list is treated as priming hints (default is no).
# With stub-first yes, it attempts without the stub if it fails.
# Consider adding domain-insecure: name and local-zone: name nodefault
diff --git a/contrib/unbound/doc/libunbound.3 b/contrib/unbound/doc/libunbound.3
index 9ef367f..d299330 100644
--- a/contrib/unbound/doc/libunbound.3
+++ b/contrib/unbound/doc/libunbound.3
@@ -1,4 +1,4 @@
-.TH "libunbound" "3" "Oct 6, 2015" "NLnet Labs" "unbound 1.5.5"
+.TH "libunbound" "3" "Dec 10, 2015" "NLnet Labs" "unbound 1.5.7"
.\"
.\" libunbound.3 -- unbound library functions manual
.\"
@@ -42,7 +42,7 @@
.B ub_ctx_zone_remove,
.B ub_ctx_data_add,
.B ub_ctx_data_remove
-\- Unbound DNS validating resolver 1.5.5 functions.
+\- Unbound DNS validating resolver 1.5.7 functions.
.SH "SYNOPSIS"
.B #include <unbound.h>
.LP
diff --git a/contrib/unbound/doc/libunbound.3.in b/contrib/unbound/doc/libunbound.3.in
index 9ef367f..d299330 100644
--- a/contrib/unbound/doc/libunbound.3.in
+++ b/contrib/unbound/doc/libunbound.3.in
@@ -1,4 +1,4 @@
-.TH "libunbound" "3" "Oct 6, 2015" "NLnet Labs" "unbound 1.5.5"
+.TH "libunbound" "3" "Dec 10, 2015" "NLnet Labs" "unbound 1.5.7"
.\"
.\" libunbound.3 -- unbound library functions manual
.\"
@@ -42,7 +42,7 @@
.B ub_ctx_zone_remove,
.B ub_ctx_data_add,
.B ub_ctx_data_remove
-\- Unbound DNS validating resolver 1.5.5 functions.
+\- Unbound DNS validating resolver 1.5.7 functions.
.SH "SYNOPSIS"
.B #include <unbound.h>
.LP
diff --git a/contrib/unbound/doc/unbound-anchor.8 b/contrib/unbound/doc/unbound-anchor.8
index 7fbb0a7..5200d18 100644
--- a/contrib/unbound/doc/unbound-anchor.8
+++ b/contrib/unbound/doc/unbound-anchor.8
@@ -1,4 +1,4 @@
-.TH "unbound-anchor" "8" "Oct 6, 2015" "NLnet Labs" "unbound 1.5.5"
+.TH "unbound-anchor" "8" "Dec 10, 2015" "NLnet Labs" "unbound 1.5.7"
.\"
.\" unbound-anchor.8 -- unbound anchor maintenance utility manual
.\"
diff --git a/contrib/unbound/doc/unbound-anchor.8.in b/contrib/unbound/doc/unbound-anchor.8.in
index e89be5b..e5e6364 100644
--- a/contrib/unbound/doc/unbound-anchor.8.in
+++ b/contrib/unbound/doc/unbound-anchor.8.in
@@ -1,4 +1,4 @@
-.TH "unbound-anchor" "8" "Oct 6, 2015" "NLnet Labs" "unbound 1.5.5"
+.TH "unbound-anchor" "8" "Dec 10, 2015" "NLnet Labs" "unbound 1.5.7"
.\"
.\" unbound-anchor.8 -- unbound anchor maintenance utility manual
.\"
diff --git a/contrib/unbound/doc/unbound-checkconf.8 b/contrib/unbound/doc/unbound-checkconf.8
index eaa406b..19ecb1e 100644
--- a/contrib/unbound/doc/unbound-checkconf.8
+++ b/contrib/unbound/doc/unbound-checkconf.8
@@ -1,4 +1,4 @@
-.TH "unbound-checkconf" "8" "Oct 6, 2015" "NLnet Labs" "unbound 1.5.5"
+.TH "unbound-checkconf" "8" "Dec 10, 2015" "NLnet Labs" "unbound 1.5.7"
.\"
.\" unbound-checkconf.8 -- unbound configuration checker manual
.\"
diff --git a/contrib/unbound/doc/unbound-checkconf.8.in b/contrib/unbound/doc/unbound-checkconf.8.in
index 234a04a..2d3c4ae 100644
--- a/contrib/unbound/doc/unbound-checkconf.8.in
+++ b/contrib/unbound/doc/unbound-checkconf.8.in
@@ -1,4 +1,4 @@
-.TH "unbound-checkconf" "8" "Oct 6, 2015" "NLnet Labs" "unbound 1.5.5"
+.TH "unbound-checkconf" "8" "Dec 10, 2015" "NLnet Labs" "unbound 1.5.7"
.\"
.\" unbound-checkconf.8 -- unbound configuration checker manual
.\"
diff --git a/contrib/unbound/doc/unbound-control.8 b/contrib/unbound/doc/unbound-control.8
index 5de37cf..e1fa36ab 100644
--- a/contrib/unbound/doc/unbound-control.8
+++ b/contrib/unbound/doc/unbound-control.8
@@ -1,4 +1,4 @@
-.TH "unbound-control" "8" "Oct 6, 2015" "NLnet Labs" "unbound 1.5.5"
+.TH "unbound-control" "8" "Dec 10, 2015" "NLnet Labs" "unbound 1.5.7"
.\"
.\" unbound-control.8 -- unbound remote control manual
.\"
@@ -169,7 +169,7 @@ therefore not flushed. The option must end with a ':' and whitespace
must be between the option and the value. Some values may not have an
effect if set this way, the new values are not written to the config file,
not all options are supported. This is different from the set_option call
-in libunbound, where all values work because unbound has not been inited.
+in libunbound, where all values work because unbound has not been initialized.
.IP
The values that work are: statistics\-interval, statistics\-cumulative,
do\-not\-query\-localhost, harden\-short\-bufsize, harden\-large\-queries,
diff --git a/contrib/unbound/doc/unbound-control.8.in b/contrib/unbound/doc/unbound-control.8.in
index eefd207..57742ae 100644
--- a/contrib/unbound/doc/unbound-control.8.in
+++ b/contrib/unbound/doc/unbound-control.8.in
@@ -1,4 +1,4 @@
-.TH "unbound-control" "8" "Oct 6, 2015" "NLnet Labs" "unbound 1.5.5"
+.TH "unbound-control" "8" "Dec 10, 2015" "NLnet Labs" "unbound 1.5.7"
.\"
.\" unbound-control.8 -- unbound remote control manual
.\"
@@ -169,7 +169,7 @@ therefore not flushed. The option must end with a ':' and whitespace
must be between the option and the value. Some values may not have an
effect if set this way, the new values are not written to the config file,
not all options are supported. This is different from the set_option call
-in libunbound, where all values work because unbound has not been inited.
+in libunbound, where all values work because unbound has not been initialized.
.IP
The values that work are: statistics\-interval, statistics\-cumulative,
do\-not\-query\-localhost, harden\-short\-bufsize, harden\-large\-queries,
diff --git a/contrib/unbound/doc/unbound-host.1 b/contrib/unbound/doc/unbound-host.1
index d600ee6..70b697f 100644
--- a/contrib/unbound/doc/unbound-host.1
+++ b/contrib/unbound/doc/unbound-host.1
@@ -1,4 +1,4 @@
-.TH "unbound\-host" "1" "Oct 6, 2015" "NLnet Labs" "unbound 1.5.5"
+.TH "unbound\-host" "1" "Dec 10, 2015" "NLnet Labs" "unbound 1.5.7"
.\"
.\" unbound-host.1 -- unbound DNS lookup utility
.\"
diff --git a/contrib/unbound/doc/unbound-host.1.in b/contrib/unbound/doc/unbound-host.1.in
index a4742d7..eeb25f0 100644
--- a/contrib/unbound/doc/unbound-host.1.in
+++ b/contrib/unbound/doc/unbound-host.1.in
@@ -1,4 +1,4 @@
-.TH "unbound\-host" "1" "Oct 6, 2015" "NLnet Labs" "unbound 1.5.5"
+.TH "unbound\-host" "1" "Dec 10, 2015" "NLnet Labs" "unbound 1.5.7"
.\"
.\" unbound-host.1 -- unbound DNS lookup utility
.\"
diff --git a/contrib/unbound/doc/unbound.8 b/contrib/unbound/doc/unbound.8
index 3935e61..86fcb59 100644
--- a/contrib/unbound/doc/unbound.8
+++ b/contrib/unbound/doc/unbound.8
@@ -1,4 +1,4 @@
-.TH "unbound" "8" "Oct 6, 2015" "NLnet Labs" "unbound 1.5.5"
+.TH "unbound" "8" "Dec 10, 2015" "NLnet Labs" "unbound 1.5.7"
.\"
.\" unbound.8 -- unbound manual
.\"
@@ -9,7 +9,7 @@
.\"
.SH "NAME"
.B unbound
-\- Unbound DNS validating resolver 1.5.5.
+\- Unbound DNS validating resolver 1.5.7.
.SH "SYNOPSIS"
.B unbound
.RB [ \-h ]
diff --git a/contrib/unbound/doc/unbound.8.in b/contrib/unbound/doc/unbound.8.in
index df9baa0..ed139a7 100644
--- a/contrib/unbound/doc/unbound.8.in
+++ b/contrib/unbound/doc/unbound.8.in
@@ -1,4 +1,4 @@
-.TH "unbound" "8" "Oct 6, 2015" "NLnet Labs" "unbound 1.5.5"
+.TH "unbound" "8" "Dec 10, 2015" "NLnet Labs" "unbound 1.5.7"
.\"
.\" unbound.8 -- unbound manual
.\"
@@ -9,7 +9,7 @@
.\"
.SH "NAME"
.B unbound
-\- Unbound DNS validating resolver 1.5.5.
+\- Unbound DNS validating resolver 1.5.7.
.SH "SYNOPSIS"
.B unbound
.RB [ \-h ]
diff --git a/contrib/unbound/doc/unbound.conf.5 b/contrib/unbound/doc/unbound.conf.5
index 990a0a6..16155de 100644
--- a/contrib/unbound/doc/unbound.conf.5
+++ b/contrib/unbound/doc/unbound.conf.5
@@ -1,4 +1,4 @@
-.TH "unbound.conf" "5" "Oct 6, 2015" "NLnet Labs" "unbound 1.5.5"
+.TH "unbound.conf" "5" "Dec 10, 2015" "NLnet Labs" "unbound 1.5.7"
.\"
.\" unbound.conf.5 -- unbound.conf manual
.\"
@@ -362,7 +362,7 @@ The public key certificate pem file for the ssl service. Default is "",
turned off.
.TP
.B ssl\-port: \fI<number>
-The port number on which to provide TCP SSL service, default 443, only
+The port number on which to provide TCP SSL service, default 853, only
interfaces configured with that port number as @number get the SSL service.
.TP
.B do\-daemonize: \fI<yes or no>
@@ -444,6 +444,8 @@ requires privileges, then a reload will fail; a restart is needed.
.TP
.B directory: \fI<directory>
Sets the working directory for the program. Default is "/var/unbound".
+On Windows the string "%EXECUTABLE%" tries to change to the directory
+that unbound.exe resides in.
.TP
.B logfile: \fI<filename>
If "" is given, logging goes to stderr, or nowhere once daemonized.
@@ -585,23 +587,30 @@ queries. For domains that do not support 0x20 and also fail with fallback
because they keep sending different answers, like some load balancers.
Can be given multiple times, for different domains.
.TP
+.B qname\-minimisation: \fI<yes or no>
+Send minimum amount of information to upstream servers to enhance privacy.
+Only sent minimum required labels of the QNAME and set QTYPE to NS when
+possible. Best effort approach, full QNAME and original QTYPE will be sent when
+upstream replies with a RCODE other than NOERROR. Default is off.
+.TP
.B private\-address: \fI<IP address or subnet>
Give IPv4 of IPv6 addresses or classless subnets. These are addresses
-on your private network, and are not allowed to be returned for public
-internet names. Any occurence of such addresses are removed from
-DNS answers. Additionally, the DNSSEC validator may mark the answers
-bogus. This protects against so\-called DNS Rebinding, where a user browser
-is turned into a network proxy, allowing remote access through the browser
-to other parts of your private network. Some names can be allowed to
-contain your private addresses, by default all the \fBlocal\-data\fR
-that you configured is allowed to, and you can specify additional
-names using \fBprivate\-domain\fR. No private addresses are enabled
-by default. We consider to enable this for the RFC1918 private IP
-address space by default in later releases. That would enable private
-addresses for 10.0.0.0/8 172.16.0.0/12 192.168.0.0/16 169.254.0.0/16
-fd00::/8 and fe80::/10, since the RFC standards say these addresses
-should not be visible on the public internet. Turning on 127.0.0.0/8
-would hinder many spamblocklists as they use that.
+on your private network, and are not allowed to be returned for
+public internet names. Any occurrence of such addresses are removed
+from DNS answers. Additionally, the DNSSEC validator may mark the
+answers bogus. This protects against so\-called DNS Rebinding, where
+a user browser is turned into a network proxy, allowing remote access
+through the browser to other parts of your private network. Some names
+can be allowed to contain your private addresses, by default all the
+\fBlocal\-data\fR that you configured is allowed to, and you can specify
+additional names using \fBprivate\-domain\fR. No private addresses are
+enabled by default. We consider to enable this for the RFC1918 private
+IP address space by default in later releases. That would enable private
+addresses for 10.0.0.0/8 172.16.0.0/12 192.168.0.0/16 169.254.0.0/16
+fd00::/8 and fe80::/10, since the RFC standards say these addresses
+should not be visible on the public internet. Turning on 127.0.0.0/8
+would hinder many spamblocklists as they use that. Adding ::ffff:0:0/96
+stops IPv4-mapped IPv6 addresses from bypassing the filter.
.TP
.B private\-domain: \fI<domain name>
Allow this domain, and all its subdomains to contain private addresses.
@@ -746,7 +755,7 @@ Instruct the validator to remove data from the additional section of secure
messages that are not signed properly. Messages that are insecure, bogus,
indeterminate or unchecked are not affected. Default is yes. Use this setting
to protect the users that rely on this validator for authentication from
-protentially bad data in the additional section.
+potentially bad data in the additional section.
.TP
.B val\-log\-level: \fI<number>
Have the validator print validation failures to the log. Regardless of
@@ -1033,7 +1042,7 @@ If set to 0, all queries are dropped for domains where the limit is
exceeded. If set to another value, 1 in that number is allowed through
to complete. Default is 10, allowing 1/10 traffic to flow normally.
This can make ordinary queries complete (if repeatedly queried for),
-and enter the cache, whilst also mitigiting the traffic flow by the
+and enter the cache, whilst also mitigating the traffic flow by the
factor given.
.TP 5
.B ratelimit\-for\-domain: \fI<domain> <number qps>
diff --git a/contrib/unbound/doc/unbound.conf.5.in b/contrib/unbound/doc/unbound.conf.5.in
index 42653a5..51f7c4e 100644
--- a/contrib/unbound/doc/unbound.conf.5.in
+++ b/contrib/unbound/doc/unbound.conf.5.in
@@ -1,4 +1,4 @@
-.TH "unbound.conf" "5" "Oct 6, 2015" "NLnet Labs" "unbound 1.5.5"
+.TH "unbound.conf" "5" "Dec 10, 2015" "NLnet Labs" "unbound 1.5.7"
.\"
.\" unbound.conf.5 -- unbound.conf manual
.\"
@@ -362,7 +362,7 @@ The public key certificate pem file for the ssl service. Default is "",
turned off.
.TP
.B ssl\-port: \fI<number>
-The port number on which to provide TCP SSL service, default 443, only
+The port number on which to provide TCP SSL service, default 853, only
interfaces configured with that port number as @number get the SSL service.
.TP
.B do\-daemonize: \fI<yes or no>
@@ -444,6 +444,8 @@ requires privileges, then a reload will fail; a restart is needed.
.TP
.B directory: \fI<directory>
Sets the working directory for the program. Default is "@UNBOUND_RUN_DIR@".
+On Windows the string "%EXECUTABLE%" tries to change to the directory
+that unbound.exe resides in.
.TP
.B logfile: \fI<filename>
If "" is given, logging goes to stderr, or nowhere once daemonized.
@@ -585,23 +587,30 @@ queries. For domains that do not support 0x20 and also fail with fallback
because they keep sending different answers, like some load balancers.
Can be given multiple times, for different domains.
.TP
+.B qname\-minimisation: \fI<yes or no>
+Send minimum amount of information to upstream servers to enhance privacy.
+Only sent minimum required labels of the QNAME and set QTYPE to NS when
+possible. Best effort approach, full QNAME and original QTYPE will be sent when
+upstream replies with a RCODE other than NOERROR. Default is off.
+.TP
.B private\-address: \fI<IP address or subnet>
Give IPv4 of IPv6 addresses or classless subnets. These are addresses
-on your private network, and are not allowed to be returned for public
-internet names. Any occurence of such addresses are removed from
-DNS answers. Additionally, the DNSSEC validator may mark the answers
-bogus. This protects against so\-called DNS Rebinding, where a user browser
-is turned into a network proxy, allowing remote access through the browser
-to other parts of your private network. Some names can be allowed to
-contain your private addresses, by default all the \fBlocal\-data\fR
-that you configured is allowed to, and you can specify additional
-names using \fBprivate\-domain\fR. No private addresses are enabled
-by default. We consider to enable this for the RFC1918 private IP
-address space by default in later releases. That would enable private
-addresses for 10.0.0.0/8 172.16.0.0/12 192.168.0.0/16 169.254.0.0/16
-fd00::/8 and fe80::/10, since the RFC standards say these addresses
-should not be visible on the public internet. Turning on 127.0.0.0/8
-would hinder many spamblocklists as they use that.
+on your private network, and are not allowed to be returned for
+public internet names. Any occurrence of such addresses are removed
+from DNS answers. Additionally, the DNSSEC validator may mark the
+answers bogus. This protects against so\-called DNS Rebinding, where
+a user browser is turned into a network proxy, allowing remote access
+through the browser to other parts of your private network. Some names
+can be allowed to contain your private addresses, by default all the
+\fBlocal\-data\fR that you configured is allowed to, and you can specify
+additional names using \fBprivate\-domain\fR. No private addresses are
+enabled by default. We consider to enable this for the RFC1918 private
+IP address space by default in later releases. That would enable private
+addresses for 10.0.0.0/8 172.16.0.0/12 192.168.0.0/16 169.254.0.0/16
+fd00::/8 and fe80::/10, since the RFC standards say these addresses
+should not be visible on the public internet. Turning on 127.0.0.0/8
+would hinder many spamblocklists as they use that. Adding ::ffff:0:0/96
+stops IPv4-mapped IPv6 addresses from bypassing the filter.
.TP
.B private\-domain: \fI<domain name>
Allow this domain, and all its subdomains to contain private addresses.
@@ -746,7 +755,7 @@ Instruct the validator to remove data from the additional section of secure
messages that are not signed properly. Messages that are insecure, bogus,
indeterminate or unchecked are not affected. Default is yes. Use this setting
to protect the users that rely on this validator for authentication from
-protentially bad data in the additional section.
+potentially bad data in the additional section.
.TP
.B val\-log\-level: \fI<number>
Have the validator print validation failures to the log. Regardless of
@@ -1033,7 +1042,7 @@ If set to 0, all queries are dropped for domains where the limit is
exceeded. If set to another value, 1 in that number is allowed through
to complete. Default is 10, allowing 1/10 traffic to flow normally.
This can make ordinary queries complete (if repeatedly queried for),
-and enter the cache, whilst also mitigiting the traffic flow by the
+and enter the cache, whilst also mitigating the traffic flow by the
factor given.
.TP 5
.B ratelimit\-for\-domain: \fI<domain> <number qps>
diff --git a/contrib/unbound/freebsd-configure.sh b/contrib/unbound/freebsd-configure.sh
index c8852e7..e698878 100755
--- a/contrib/unbound/freebsd-configure.sh
+++ b/contrib/unbound/freebsd-configure.sh
@@ -24,6 +24,9 @@ ldnsobj=$(realpath $(make -C$ldnsbld -V.OBJDIR))
[ -f $ldnsobj/libldns.a ] || error "can't find LDNS object directory"
export LDFLAGS="-L$ldnsobj"
+export CC=$(echo ".include <bsd.lib.mk>" | make -f /dev/stdin -VCC)
+export CPP=$(echo ".include <bsd.lib.mk>" | make -f /dev/stdin -VCPP)
+
autoconf
autoheader
./configure \
diff --git a/contrib/unbound/iterator/iter_scrub.c b/contrib/unbound/iterator/iter_scrub.c
index cc05867..8a3fc17 100644
--- a/contrib/unbound/iterator/iter_scrub.c
+++ b/contrib/unbound/iterator/iter_scrub.c
@@ -405,7 +405,43 @@ scrub_normalize(sldns_buffer* pkt, struct msg_parse* msg,
/* Follow the CNAME chain. */
if(rrset->type == LDNS_RR_TYPE_CNAME) {
+ struct rrset_parse* nx = rrset->rrset_all_next;
uint8_t* oldsname = sname;
+ /* see if the next one is a DNAME, if so, swap them */
+ if(nx && nx->section == LDNS_SECTION_ANSWER &&
+ nx->type == LDNS_RR_TYPE_DNAME &&
+ nx->rr_count == 1 &&
+ pkt_strict_sub(pkt, sname, nx->dname)) {
+ /* there is a DNAME after this CNAME, it
+ * is in the ANSWER section, and the DNAME
+ * applies to the name we cover */
+ /* check if the alias of the DNAME equals
+ * this CNAME */
+ uint8_t alias[LDNS_MAX_DOMAINLEN+1];
+ size_t aliaslen = 0;
+ uint8_t* t = NULL;
+ size_t tlen = 0;
+ if(synth_cname(sname, snamelen, nx, alias,
+ &aliaslen, pkt) &&
+ parse_get_cname_target(rrset, &t, &tlen) &&
+ dname_pkt_compare(pkt, alias, t) == 0) {
+ /* the synthesized CNAME equals the
+ * current CNAME. This CNAME is the
+ * one that the DNAME creates, and this
+ * CNAME is better capitalised */
+ verbose(VERB_ALGO, "normalize: re-order of DNAME and its CNAME");
+ if(prev) prev->rrset_all_next = nx;
+ else msg->rrset_first = nx;
+ if(nx->rrset_all_next == NULL)
+ msg->rrset_last = rrset;
+ rrset->rrset_all_next =
+ nx->rrset_all_next;
+ nx->rrset_all_next = rrset;
+ prev = nx;
+ }
+ }
+
+ /* move to next name in CNAME chain */
if(!parse_get_cname_target(rrset, &sname, &snamelen))
return 0;
prev = rrset;
@@ -638,7 +674,7 @@ scrub_sanitize(sldns_buffer* pkt, struct msg_parse* msg,
* children of the originating zone. The idea here is that,
* as far as we know, the server that we contacted is ONLY
* authoritative for the originating zone. It, of course, MAY
- * be authoriative for any other zones, and of course, MAY
+ * be authoritative for any other zones, and of course, MAY
* NOT be authoritative for some subdomains of the originating
* zone. */
prev = NULL;
diff --git a/contrib/unbound/iterator/iter_utils.c b/contrib/unbound/iterator/iter_utils.c
index bc94ef6..58e62fb 100644
--- a/contrib/unbound/iterator/iter_utils.c
+++ b/contrib/unbound/iterator/iter_utils.c
@@ -255,7 +255,7 @@ iter_filter_unsuitable(struct iter_env* iter_env, struct module_env* env,
return -1; /* server is lame */
else if(rtt >= USEFUL_SERVER_TOP_TIMEOUT)
/* server is unresponsive,
- * we used to return TOP_TIMOUT, but fairly useless,
+ * we used to return TOP_TIMEOUT, but fairly useless,
* because if == TOP_TIMEOUT is dropped because
* blacklisted later, instead, remove it here, so
* other choices (that are not blacklisted) can be
@@ -306,7 +306,7 @@ iter_fill_rtt(struct iter_env* iter_env, struct module_env* env,
return got_it;
}
-/** filter the addres list, putting best targets at front,
+/** filter the address list, putting best targets at front,
* returns number of best targets (or 0, no suitable targets) */
static int
iter_filter_order(struct iter_env* iter_env, struct module_env* env,
diff --git a/contrib/unbound/iterator/iterator.c b/contrib/unbound/iterator/iterator.c
index 96918fa..b1bf902 100644
--- a/contrib/unbound/iterator/iterator.c
+++ b/contrib/unbound/iterator/iterator.c
@@ -64,6 +64,7 @@
#include "util/random.h"
#include "sldns/rrdef.h"
#include "sldns/wire2str.h"
+#include "sldns/str2wire.h"
#include "sldns/parseutil.h"
#include "sldns/sbuffer.h"
@@ -81,6 +82,21 @@ iter_init(struct module_env* env, int id)
log_err("iterator: could not apply configuration settings.");
return 0;
}
+ if(env->cfg->qname_minimisation) {
+ uint8_t dname[LDNS_MAX_DOMAINLEN+1];
+ size_t len = sizeof(dname);
+ if(sldns_str2wire_dname_buf("ip6.arpa.", dname, &len) != 0) {
+ log_err("ip6.arpa. parse error");
+ return 0;
+ }
+ iter_env->ip6arpa_dname = (uint8_t*)malloc(len);
+ if(!iter_env->ip6arpa_dname) {
+ log_err("malloc failure");
+ return 0;
+ }
+ memcpy(iter_env->ip6arpa_dname, dname, len);
+ }
+
return 1;
}
@@ -101,6 +117,7 @@ iter_deinit(struct module_env* env, int id)
if(!env || !env->modinfo[id])
return;
iter_env = (struct iter_env*)env->modinfo[id];
+ free(iter_env->ip6arpa_dname);
free(iter_env->target_fetch_policy);
priv_delete(iter_env->priv);
donotq_delete(iter_env->donotq);
@@ -145,6 +162,12 @@ iter_new(struct module_qstate* qstate, int id)
/* Start with the (current) qname. */
iq->qchase = qstate->qinfo;
outbound_list_init(&iq->outlist);
+ if (qstate->env->cfg->qname_minimisation)
+ iq->minimisation_state = INIT_MINIMISE_STATE;
+ else
+ iq->minimisation_state = DONOT_MINIMISE_STATE;
+
+ memset(&iq->qinfo_out, 0, sizeof(struct query_info));
return 1;
}
@@ -176,7 +199,7 @@ next_state(struct iter_qstate* iq, enum iter_state nextstate)
/**
* Transition an event to its final state. Final states always either return
* a result up the module chain, or reactivate a dependent event. Which
- * final state to transtion to is set in the module state for the event when
+ * final state to transition to is set in the module state for the event when
* it was created, and depends on the original purpose of the event.
*
* The response is stored in the qstate->buf buffer.
@@ -506,7 +529,7 @@ target_count_increase(struct iter_qstate* iq, int num)
/**
* Generate a subrequest.
* Generate a local request event. Local events are tied to this module, and
- * have a correponding (first tier) event that is waiting for this event to
+ * have a corresponding (first tier) event that is waiting for this event to
* resolve to continue.
*
* @param qname The query name for this request.
@@ -590,6 +613,11 @@ generate_sub_request(uint8_t* qname, size_t qnamelen, uint16_t qtype,
subiq->qchase = subq->qinfo;
subiq->chase_flags = subq->query_flags;
subiq->refetch_glue = 0;
+ if(qstate->env->cfg->qname_minimisation)
+ subiq->minimisation_state = INIT_MINIMISE_STATE;
+ else
+ subiq->minimisation_state = DONOT_MINIMISE_STATE;
+ memset(&subiq->qinfo_out, 0, sizeof(struct query_info));
}
return 1;
}
@@ -1042,6 +1070,8 @@ processInitRequest(struct module_qstate* qstate, struct iter_qstate* iq,
iq->query_restart_count++;
iq->sent_count = 0;
sock_list_insert(&qstate->reply_origin, NULL, 0, qstate->region);
+ if(qstate->env->cfg->qname_minimisation)
+ iq->minimisation_state = INIT_MINIMISE_STATE;
return next_state(iq, INIT_REQUEST_STATE);
}
@@ -1062,6 +1092,7 @@ processInitRequest(struct module_qstate* qstate, struct iter_qstate* iq,
return error_response(qstate, id, LDNS_RCODE_SERVFAIL);
}
iq->refetch_glue = 0;
+ iq->minimisation_state = DONOT_MINIMISE_STATE;
/* the request has been forwarded.
* forwarded requests need to be immediately sent to the
* next state, QUERYTARGETS. */
@@ -1599,6 +1630,8 @@ processLastResort(struct module_qstate* qstate, struct iter_qstate* iq,
iq->refetch_glue = 1;
iq->query_restart_count++;
iq->sent_count = 0;
+ if(qstate->env->cfg->qname_minimisation)
+ iq->minimisation_state = INIT_MINIMISE_STATE;
return next_state(iq, INIT_REQUEST_STATE);
}
}
@@ -1975,9 +2008,78 @@ processQueryTargets(struct module_qstate* qstate, struct iter_qstate* iq,
}
}
+ if(iq->minimisation_state == INIT_MINIMISE_STATE) {
+ /* (Re)set qinfo_out to (new) delegation point, except
+ * when qinfo_out is already a subdomain of dp. This happens
+ * when resolving ip6.arpa dnames. */
+ if(!(iq->qinfo_out.qname_len
+ && dname_subdomain_c(iq->qchase.qname,
+ iq->qinfo_out.qname)
+ && dname_subdomain_c(iq->qinfo_out.qname,
+ iq->dp->name))) {
+ iq->qinfo_out.qname = iq->dp->name;
+ iq->qinfo_out.qname_len = iq->dp->namelen;
+ iq->qinfo_out.qtype = LDNS_RR_TYPE_NS;
+ iq->qinfo_out.qclass = iq->qchase.qclass;
+ }
+
+ iq->minimisation_state = MINIMISE_STATE;
+ }
+ if(iq->minimisation_state == MINIMISE_STATE) {
+ int labdiff = dname_count_labels(iq->qchase.qname) -
+ dname_count_labels(iq->qinfo_out.qname);
+
+ iq->qinfo_out.qname = iq->qchase.qname;
+ iq->qinfo_out.qname_len = iq->qchase.qname_len;
+
+ /* Special treatment for ip6.arpa lookups.
+ * Reverse IPv6 dname has 34 labels, increment the IP part
+ * (usually first 32 labels) by 8 labels (7 more than the
+ * default 1 label increment). */
+ if(labdiff <= 32 &&
+ dname_subdomain_c(iq->qchase.qname, ie->ip6arpa_dname)) {
+ labdiff -= 7;
+ /* Small chance of zone cut after first label. Stop
+ * minimising */
+ if(labdiff <= 1)
+ labdiff = 0;
+ }
+
+ if(labdiff > 1) {
+ verbose(VERB_QUERY, "removing %d labels", labdiff-1);
+ dname_remove_labels(&iq->qinfo_out.qname,
+ &iq->qinfo_out.qname_len,
+ labdiff-1);
+ }
+ if(labdiff < 1 ||
+ (labdiff < 2 && iq->qchase.qtype == LDNS_RR_TYPE_DS))
+ /* Stop minimising this query, resolve "as usual" */
+ iq->minimisation_state = DONOT_MINIMISE_STATE;
+ else {
+ struct dns_msg* msg = dns_cache_lookup(qstate->env,
+ iq->qinfo_out.qname, iq->qinfo_out.qname_len,
+ iq->qinfo_out.qtype, iq->qinfo_out.qclass,
+ qstate->query_flags, qstate->region,
+ qstate->env->scratch);
+ if(msg && msg->rep->an_numrrsets == 0
+ && FLAGS_GET_RCODE(msg->rep->flags) ==
+ LDNS_RCODE_NOERROR)
+ /* no need to send query if it is already
+ * cached as NOERROR/NODATA */
+ return 1;
+ }
+
+ }
+ if(iq->minimisation_state == SKIP_MINIMISE_STATE)
+ /* Do not increment qname, continue incrementing next
+ * iteration */
+ iq->minimisation_state = MINIMISE_STATE;
+ if(iq->minimisation_state == DONOT_MINIMISE_STATE)
+ iq->qinfo_out = iq->qchase;
+
/* We have a valid target. */
if(verbosity >= VERB_QUERY) {
- log_query_info(VERB_QUERY, "sending query:", &iq->qchase);
+ log_query_info(VERB_QUERY, "sending query:", &iq->qinfo_out);
log_name_addr(VERB_QUERY, "sending to target:", iq->dp->name,
&target->addr, target->addrlen);
verbose(VERB_ALGO, "dnssec status: %s%s",
@@ -1986,8 +2088,8 @@ processQueryTargets(struct module_qstate* qstate, struct iter_qstate* iq,
}
fptr_ok(fptr_whitelist_modenv_send_query(qstate->env->send_query));
outq = (*qstate->env->send_query)(
- iq->qchase.qname, iq->qchase.qname_len,
- iq->qchase.qtype, iq->qchase.qclass,
+ iq->qinfo_out.qname, iq->qinfo_out.qname_len,
+ iq->qinfo_out.qtype, iq->qinfo_out.qclass,
iq->chase_flags | (iq->chase_to_rd?BIT_RD:0), EDNS_DO|BIT_CD,
iq->dnssec_expected, iq->caps_fallback || is_caps_whitelisted(
ie, iq), &target->addr, target->addrlen, iq->dp->name,
@@ -2042,6 +2144,9 @@ processQueryResponse(struct module_qstate* qstate, struct iter_qstate* iq,
enum response_type type;
iq->num_current_queries--;
if(iq->response == NULL) {
+ /* Don't increment qname when QNAME minimisation is enabled */
+ if (qstate->env->cfg->qname_minimisation)
+ iq->minimisation_state = SKIP_MINIMISE_STATE;
iq->chase_to_rd = 0;
iq->dnssec_lame_query = 0;
verbose(VERB_ALGO, "query response was timeout");
@@ -2142,6 +2247,15 @@ processQueryResponse(struct module_qstate* qstate, struct iter_qstate* iq,
sock_list_insert(&qstate->reply_origin,
&qstate->reply->addr, qstate->reply->addrlen,
qstate->region);
+ if(iq->minimisation_state != DONOT_MINIMISE_STATE) {
+ /* Best effort qname-minimisation.
+ * Stop minimising and send full query when RCODE
+ * is not NOERROR */
+ if(FLAGS_GET_RCODE(iq->response->rep->flags) !=
+ LDNS_RCODE_NOERROR)
+ iq->minimisation_state = DONOT_MINIMISE_STATE;
+ return next_state(iq, QUERYTARGETS_STATE);
+ }
return final_state(iq);
} else if(type == RESPONSE_TYPE_REFERRAL) {
/* REFERRAL type responses get a reset of the
@@ -2201,6 +2315,8 @@ processQueryResponse(struct module_qstate* qstate, struct iter_qstate* iq,
* point to the referral. */
iq->deleg_msg = iq->response;
iq->dp = delegpt_from_message(iq->response, qstate->region);
+ if (qstate->env->cfg->qname_minimisation)
+ iq->minimisation_state = INIT_MINIMISE_STATE;
if(!iq->dp)
return error_response(qstate, id, LDNS_RCODE_SERVFAIL);
if(!cache_fill_missing(qstate->env, iq->qchase.qclass,
@@ -2280,6 +2396,8 @@ processQueryResponse(struct module_qstate* qstate, struct iter_qstate* iq,
/* set the current request's qname to the new value. */
iq->qchase.qname = sname;
iq->qchase.qname_len = snamelen;
+ if (qstate->env->cfg->qname_minimisation)
+ iq->minimisation_state = INIT_MINIMISE_STATE;
/* Clear the query state, since this is a query restart. */
iq->deleg_msg = NULL;
iq->dp = NULL;
@@ -2353,6 +2471,8 @@ processQueryResponse(struct module_qstate* qstate, struct iter_qstate* iq,
/* LAME, THROWAWAY and "unknown" all end up here.
* Recycle to the QUERYTARGETS state to hopefully try a
* different target. */
+ if (qstate->env->cfg->qname_minimisation)
+ iq->minimisation_state = DONOT_MINIMISE_STATE;
return next_state(iq, QUERYTARGETS_STATE);
}
@@ -2968,7 +3088,7 @@ process_response(struct module_qstate* qstate, struct iter_qstate* iq,
prs->flags &= ~BIT_CD;
/* normalize and sanitize: easy to delete items from linked lists */
- if(!scrub_message(pkt, prs, &iq->qchase, iq->dp->name,
+ if(!scrub_message(pkt, prs, &iq->qinfo_out, iq->dp->name,
qstate->env->scratch, qstate->env, ie)) {
/* if 0x20 enabled, start fallback, but we have no message */
if(event == module_event_capsfail && !iq->caps_fallback) {
diff --git a/contrib/unbound/iterator/iterator.h b/contrib/unbound/iterator/iterator.h
index 9cf53b2..b7aa82e 100644
--- a/contrib/unbound/iterator/iterator.h
+++ b/contrib/unbound/iterator/iterator.h
@@ -112,6 +112,32 @@ struct iter_env {
* array of max_dependency_depth+1 size.
*/
int* target_fetch_policy;
+
+ /** ip6.arpa dname in wireformat, used for qname-minimisation */
+ uint8_t* ip6arpa_dname;
+};
+
+/**
+ * QNAME minimisation state
+ */
+enum minimisation_state {
+ /**
+ * (Re)start minimisation. Outgoing QNAME should be set to dp->name.
+ * State entered on new query or after following refferal or CNAME.
+ */
+ INIT_MINIMISE_STATE = 0,
+ /**
+ * QNAME minimisataion ongoing. Increase QNAME on every iteration.
+ */
+ MINIMISE_STATE,
+ /**
+ * Don't increment QNAME this iteration
+ */
+ SKIP_MINIMISE_STATE,
+ /**
+ * Send out full QNAME + original QTYPE
+ */
+ DONOT_MINIMISE_STATE,
};
/**
@@ -322,6 +348,15 @@ struct iter_qstate {
/** list of pending queries to authoritative servers. */
struct outbound_list outlist;
+
+ /** QNAME minimisation state */
+ enum minimisation_state minimisation_state;
+
+ /**
+ * The query info that is sent upstream. Will be a subset of qchase
+ * when qname minimisation is enabled.
+ */
+ struct query_info qinfo_out;
};
/**
diff --git a/contrib/unbound/libunbound/libunbound.c b/contrib/unbound/libunbound/libunbound.c
index 7c2509b..17f50e8 100644
--- a/contrib/unbound/libunbound/libunbound.c
+++ b/contrib/unbound/libunbound/libunbound.c
@@ -68,6 +68,9 @@
#ifdef HAVE_SYS_WAIT_H
#include <sys/wait.h>
#endif
+#ifdef HAVE_TIME_H
+#include <time.h>
+#endif
#if defined(UB_ON_WINDOWS) && defined (HAVE_WINDOWS_H)
#include <windows.h>
diff --git a/contrib/unbound/libunbound/python/Makefile b/contrib/unbound/libunbound/python/Makefile
index 01b0577..9a98ef5 100644
--- a/contrib/unbound/libunbound/python/Makefile
+++ b/contrib/unbound/libunbound/python/Makefile
@@ -36,7 +36,7 @@
help:
@echo "Please use \`make <target>' where <target> is one of"
@echo " testenv to make test environment and run bash "
- @echo " usefull in case you don't want to install unbound but want to test examples"
+ @echo " useful in case you don't want to install unbound but want to test examples"
@echo " doc to make documentation"
@echo " clean clean all"
diff --git a/contrib/unbound/libunbound/python/doc/install.rst b/contrib/unbound/libunbound/python/doc/install.rst
index f638ed1..a073a5c 100644
--- a/contrib/unbound/libunbound/python/doc/install.rst
+++ b/contrib/unbound/libunbound/python/doc/install.rst
@@ -22,7 +22,7 @@ You need GNU make to compile sources; SWIG and Python devel libraries to compile
**Testing**
-If the compilation is successfull, you can test the python LDNS extension module by::
+If the compilation is successful, you can test the python LDNS extension module by::
> cd contrib/python
> make testenv
diff --git a/contrib/unbound/libunbound/python/doc/modules/unbound.rst b/contrib/unbound/libunbound/python/doc/modules/unbound.rst
index 21f4a12..77e4cd1 100644
--- a/contrib/unbound/libunbound/python/doc/modules/unbound.rst
+++ b/contrib/unbound/libunbound/python/doc/modules/unbound.rst
@@ -42,7 +42,7 @@ Class ub_result
False, if validation failed or domain queried has no security info.
It is possible to get a result with no data (havedata is false),
- and secure is true. This means that the non-existance of the data
+ and secure is true. This means that the non-existence of the data
was cryptographically proven (with signatures).
.. attribute:: bogus
diff --git a/contrib/unbound/libunbound/python/examples/dnssec-valid.py b/contrib/unbound/libunbound/python/examples/dnssec-valid.py
index 386f4c2..c5517ef 100644
--- a/contrib/unbound/libunbound/python/examples/dnssec-valid.py
+++ b/contrib/unbound/libunbound/python/examples/dnssec-valid.py
@@ -44,7 +44,7 @@ ctx.debugout(fw)
ctx.debuglevel(2)
if os.path.isfile("keys"):
- ctx.add_ta_file("keys") #read public keys for DNSSEC verificatio
+ ctx.add_ta_file("keys") #read public keys for DNSSEC verification
status, result = ctx.resolve("www.nic.cz", RR_TYPE_A, RR_CLASS_IN)
if status == 0 and result.havedata:
diff --git a/contrib/unbound/libunbound/python/libunbound.i b/contrib/unbound/libunbound/python/libunbound.i
index 3c0e45b..50a9b67 100644
--- a/contrib/unbound/libunbound/python/libunbound.i
+++ b/contrib/unbound/libunbound/python/libunbound.i
@@ -1,5 +1,5 @@
/*
- * libounbound.i: pyUnbound module (libunbound wrapper for Python)
+ * libunbound.i: pyUnbound module (libunbound wrapper for Python)
*
* Copyright (c) 2009, Zdenek Vasicek (vasicek AT fit.vutbr.cz)
* Marek Vavrusa (xvavru00 AT stud.fit.vutbr.cz)
@@ -455,7 +455,7 @@ Result: ['74.125.43.147', '74.125.43.99', '74.125.43.103', '74.125.43.104']
#_UB_CTX_METHODS#
def zone_print(self):
- """Print local zones using debougout"""
+ """Print local zones using debugout"""
_unbound.ub_ctx_print_local_zones(self)
def zone_add(self,zonename,zonetype):
diff --git a/contrib/unbound/ltmain.sh b/contrib/unbound/ltmain.sh
index 63ae69d..6fdf4ba 100755
--- a/contrib/unbound/ltmain.sh
+++ b/contrib/unbound/ltmain.sh
@@ -4394,7 +4394,7 @@ EOF
{
/* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
namespace, but it is not one of the ones we know about and
- have already dealt with, above (inluding dump-script), then
+ have already dealt with, above (including dump-script), then
report an error. Otherwise, targets might begin to believe
they are allowed to use options in the LTWRAPPER_OPTION_PREFIX
namespace. The first time any user complains about this, we'll
diff --git a/contrib/unbound/services/cache/dns.c b/contrib/unbound/services/cache/dns.c
index ba81afd..e14e636 100644
--- a/contrib/unbound/services/cache/dns.c
+++ b/contrib/unbound/services/cache/dns.c
@@ -656,8 +656,9 @@ fill_any(struct module_env* env,
time_t now = *env->now;
struct dns_msg* msg = NULL;
uint16_t lookup[] = {LDNS_RR_TYPE_A, LDNS_RR_TYPE_AAAA,
- LDNS_RR_TYPE_MX, LDNS_RR_TYPE_SOA, LDNS_RR_TYPE_NS, 0};
- int i, num=5; /* number of RR types to look up */
+ LDNS_RR_TYPE_MX, LDNS_RR_TYPE_SOA, LDNS_RR_TYPE_NS,
+ LDNS_RR_TYPE_DNAME, 0};
+ int i, num=6; /* number of RR types to look up */
log_assert(lookup[num] == 0);
for(i=0; i<num; i++) {
diff --git a/contrib/unbound/services/cache/rrset.c b/contrib/unbound/services/cache/rrset.c
index 2c85529..2f6a1b5 100644
--- a/contrib/unbound/services/cache/rrset.c
+++ b/contrib/unbound/services/cache/rrset.c
@@ -190,6 +190,7 @@ rrset_cache_update(struct rrset_cache* r, struct rrset_ref* ref,
uint16_t rrset_type = ntohs(k->rk.type);
int equal = 0;
log_assert(ref->id != 0 && k->id != 0);
+ log_assert(k->rk.dname != NULL);
/* looks up item with a readlock - no editing! */
if((e=slabhash_lookup(&r->table, h, k, 0)) != 0) {
/* return id and key as they will be used in the cache
diff --git a/contrib/unbound/sldns/parseutil.h b/contrib/unbound/sldns/parseutil.h
index dfa1c2a..c5238bc 100644
--- a/contrib/unbound/sldns/parseutil.h
+++ b/contrib/unbound/sldns/parseutil.h
@@ -56,13 +56,13 @@ time_t sldns_mktime_from_utc(const struct tm *tm);
/**
* The function interprets time as the number of seconds since epoch
- * with respect to now using serial arithmitics (rfc1982).
+ * with respect to now using serial arithmetics (rfc1982).
* That number of seconds is then converted to broken-out time information.
* This is especially usefull when converting the inception and expiration
* fields of RRSIG records.
*
* \param[in] time number of seconds since epoch (midnight, January 1st, 1970)
- * to be intepreted as a serial arithmitics number relative to now.
+ * to be intepreted as a serial arithmetics number relative to now.
* \param[in] now number of seconds since epoch (midnight, January 1st, 1970)
* to which the time value is compared to determine the final value.
* \param[out] result the struct with the broken-out time information
diff --git a/contrib/unbound/sldns/wire2str.c b/contrib/unbound/sldns/wire2str.c
index cec3bc7..5cbd78e 100644
--- a/contrib/unbound/sldns/wire2str.c
+++ b/contrib/unbound/sldns/wire2str.c
@@ -697,6 +697,9 @@ int sldns_wire2str_rdata_scan(uint8_t** d, size_t* dlen, char** s,
}
w += n;
}
+ if(*dlen != 0) {
+ goto failed;
+ }
return w;
}
diff --git a/contrib/unbound/smallapp/unbound-anchor.c b/contrib/unbound/smallapp/unbound-anchor.c
index 92bfa84..81bb896 100644
--- a/contrib/unbound/smallapp/unbound-anchor.c
+++ b/contrib/unbound/smallapp/unbound-anchor.c
@@ -95,7 +95,7 @@
* signed yet; avoids attacks on system clock). The
* last-successful-RFC5011-probe (if available) has to be more than 30 days
* in the past (otherwise, RFC5011 should have worked). This keeps
- * unneccesary https traffic down. If the main certificate is expired, it
+ * unnecessary https traffic down. If the main certificate is expired, it
* fails.
*
* The dates on the keys in the xml are checked (uses the libexpat xml
@@ -1520,7 +1520,11 @@ xml_entitydeclhandler(void *userData,
const XML_Char *ATTR_UNUSED(publicId),
const XML_Char *ATTR_UNUSED(notationName))
{
+#if HAVE_DECL_XML_STOPPARSER
(void)XML_StopParser((XML_Parser)userData, XML_FALSE);
+#else
+ (void)userData;
+#endif
}
/**
@@ -1828,6 +1832,12 @@ write_unsigned_root(const char* root_anchor_file)
root_anchor_file);
if(verb && errno != 0) printf("%s\n", strerror(errno));
}
+ fflush(out);
+#ifdef HAVE_FSYNC
+ fsync(fileno(out));
+#else
+ FlushFileBuffers((HANDLE)_fileno(out));
+#endif
fclose(out);
}
@@ -1854,6 +1864,12 @@ write_root_anchor(const char* root_anchor_file, BIO* ds)
root_anchor_file);
if(verb && errno != 0) printf("%s\n", strerror(errno));
}
+ fflush(out);
+#ifdef HAVE_FSYNC
+ fsync(fileno(out));
+#else
+ FlushFileBuffers((HANDLE)_fileno(out));
+#endif
fclose(out);
}
diff --git a/contrib/unbound/smallapp/unbound-checkconf.c b/contrib/unbound/smallapp/unbound-checkconf.c
index 0524ede..ec07713 100644
--- a/contrib/unbound/smallapp/unbound-checkconf.c
+++ b/contrib/unbound/smallapp/unbound-checkconf.c
@@ -335,7 +335,9 @@ morechecks(struct config_file* cfg, const char* fname)
if(cfg->edns_buffer_size > cfg->msg_buffer_size)
fatal_exit("edns-buffer-size larger than msg-buffer-size, "
"answers will not fit in processing buffer");
-
+#ifdef UB_ON_WINDOWS
+ w_config_adjust_directory(cfg);
+#endif
if(cfg->chrootdir && cfg->chrootdir[0] &&
cfg->chrootdir[strlen(cfg->chrootdir)-1] == '/')
fatal_exit("chootdir %s has trailing slash '/' please remove.",
diff --git a/contrib/unbound/smallapp/unbound-control-setup.sh b/contrib/unbound/smallapp/unbound-control-setup.sh
index 816b4f5..28690b3 100755
--- a/contrib/unbound/smallapp/unbound-control-setup.sh
+++ b/contrib/unbound/smallapp/unbound-control-setup.sh
@@ -107,16 +107,15 @@ else
fi
# create self-signed cert for server
-cat >request.cfg <<EOF
-[req]
-default_bits=$BITS
-default_md=$HASH
-prompt=no
-distinguished_name=req_distinguished_name
-
-[req_distinguished_name]
-commonName=$SERVERNAME
-EOF
+echo "[req]\n" > request.cfg
+echo "default_bits=$BITS\n" >> request.cfg
+echo "default_md=$HASH\n" >> request.cfg
+echo "prompt=no\n" >> request.cfg
+echo "distinguished_name=req_distinguished_name\n" >> request.cfg
+echo "\n" >> request.cfg
+echo "[req_distinguished_name]\n" >> request.cfg
+echo "commonName=$SERVERNAME\n" >> request.cfg
+
test -f request.cfg || error "could not create request.cfg"
echo "create $SVR_BASE.pem (self signed certificate)"
@@ -125,16 +124,15 @@ openssl req -key $SVR_BASE.key -config request.cfg -new -x509 -days $DAYS -out
openssl x509 -in $SVR_BASE.pem -addtrust serverAuth -out $SVR_BASE"_trust.pem"
# create client request and sign it, piped
-cat >request.cfg <<EOF
-[req]
-default_bits=$BITS
-default_md=$HASH
-prompt=no
-distinguished_name=req_distinguished_name
-
-[req_distinguished_name]
-commonName=$CLIENTNAME
-EOF
+echo "[req]\n" > request.cfg
+echo "default_bits=$BITS\n" >> request.cfg
+echo "default_md=$HASH\n" >> request.cfg
+echo "prompt=no\n" >> request.cfg
+echo "distinguished_name=req_distinguished_name\n" >> request.cfg
+echo "\n" >> request.cfg
+echo "[req_distinguished_name]\n" >> request.cfg
+echo "commonName=$CLIENTNAME" >> request.cfg
+
test -f request.cfg || error "could not create request.cfg"
echo "create $CTL_BASE.pem (signed client certificate)"
diff --git a/contrib/unbound/smallapp/unbound-control-setup.sh.in b/contrib/unbound/smallapp/unbound-control-setup.sh.in
index 682ab26..f99d7bc 100755
--- a/contrib/unbound/smallapp/unbound-control-setup.sh.in
+++ b/contrib/unbound/smallapp/unbound-control-setup.sh.in
@@ -107,16 +107,15 @@ else
fi
# create self-signed cert for server
-cat >request.cfg <<EOF
-[req]
-default_bits=$BITS
-default_md=$HASH
-prompt=no
-distinguished_name=req_distinguished_name
-
-[req_distinguished_name]
-commonName=$SERVERNAME
-EOF
+echo "[req]\n" > request.cfg
+echo "default_bits=$BITS\n" >> request.cfg
+echo "default_md=$HASH\n" >> request.cfg
+echo "prompt=no\n" >> request.cfg
+echo "distinguished_name=req_distinguished_name\n" >> request.cfg
+echo "\n" >> request.cfg
+echo "[req_distinguished_name]\n" >> request.cfg
+echo "commonName=$SERVERNAME\n" >> request.cfg
+
test -f request.cfg || error "could not create request.cfg"
echo "create $SVR_BASE.pem (self signed certificate)"
@@ -125,16 +124,15 @@ openssl req -key $SVR_BASE.key -config request.cfg -new -x509 -days $DAYS -out
openssl x509 -in $SVR_BASE.pem -addtrust serverAuth -out $SVR_BASE"_trust.pem"
# create client request and sign it, piped
-cat >request.cfg <<EOF
-[req]
-default_bits=$BITS
-default_md=$HASH
-prompt=no
-distinguished_name=req_distinguished_name
-
-[req_distinguished_name]
-commonName=$CLIENTNAME
-EOF
+echo "[req]\n" > request.cfg
+echo "default_bits=$BITS\n" >> request.cfg
+echo "default_md=$HASH\n" >> request.cfg
+echo "prompt=no\n" >> request.cfg
+echo "distinguished_name=req_distinguished_name\n" >> request.cfg
+echo "\n" >> request.cfg
+echo "[req_distinguished_name]\n" >> request.cfg
+echo "commonName=$CLIENTNAME" >> request.cfg
+
test -f request.cfg || error "could not create request.cfg"
echo "create $CTL_BASE.pem (signed client certificate)"
diff --git a/contrib/unbound/smallapp/unbound-control.c b/contrib/unbound/smallapp/unbound-control.c
index 571b4d0..fac73b0 100644
--- a/contrib/unbound/smallapp/unbound-control.c
+++ b/contrib/unbound/smallapp/unbound-control.c
@@ -156,10 +156,12 @@ setup_ctx(struct config_file* cfg)
ctx = SSL_CTX_new(SSLv23_client_method());
if(!ctx)
ssl_err("could not allocate SSL_CTX pointer");
- if(!(SSL_CTX_set_options(ctx, SSL_OP_NO_SSLv2) & SSL_OP_NO_SSLv2))
+ if((SSL_CTX_set_options(ctx, SSL_OP_NO_SSLv2) & SSL_OP_NO_SSLv2)
+ != SSL_OP_NO_SSLv2)
ssl_err("could not set SSL_OP_NO_SSLv2");
if(cfg->remote_control_use_cert) {
- if(!(SSL_CTX_set_options(ctx, SSL_OP_NO_SSLv3) & SSL_OP_NO_SSLv3))
+ if((SSL_CTX_set_options(ctx, SSL_OP_NO_SSLv3) & SSL_OP_NO_SSLv3)
+ != SSL_OP_NO_SSLv3)
ssl_err("could not set SSL_OP_NO_SSLv3");
if(!SSL_CTX_use_certificate_chain_file(ctx,c_cert) ||
!SSL_CTX_use_PrivateKey_file(ctx,c_key,SSL_FILETYPE_PEM)
@@ -361,6 +363,9 @@ go(const char* cfgfile, char* svr, int quiet, int argc, char* argv[])
fatal_exit("could not read config file");
if(!cfg->remote_control_enable)
log_warn("control-enable is 'no' in the config file.");
+#ifdef UB_ON_WINDOWS
+ w_config_adjust_directory(cfg);
+#endif
ctx = setup_ctx(cfg);
/* contact server */
diff --git a/contrib/unbound/util/config_file.c b/contrib/unbound/util/config_file.c
index 062d12d..6354e99 100644
--- a/contrib/unbound/util/config_file.c
+++ b/contrib/unbound/util/config_file.c
@@ -100,7 +100,7 @@ config_create(void)
cfg->tcp_upstream = 0;
cfg->ssl_service_key = NULL;
cfg->ssl_service_pem = NULL;
- cfg->ssl_port = 443;
+ cfg->ssl_port = 853;
cfg->ssl_upstream = 0;
cfg->use_syslog = 1;
cfg->log_time_ascii = 0;
@@ -240,6 +240,7 @@ config_create(void)
cfg->ratelimit_for_domain = NULL;
cfg->ratelimit_below_domain = NULL;
cfg->ratelimit_factor = 10;
+ cfg->qname_minimisation = 0;
return cfg;
error_exit:
config_delete(cfg);
@@ -473,6 +474,7 @@ int config_set_option(struct config_file* cfg, const char* opt,
else S_MEMSIZE("ratelimit-size:", ratelimit_size)
else S_POW2("ratelimit-slabs:", ratelimit_slabs)
else S_NUMBER_OR_ZERO("ratelimit-factor:", ratelimit_factor)
+ else S_YNO("qname-minimisation:", qname_minimisation)
/* val_sig_skew_min and max are copied into val_env during init,
* so this does not update val_env with set_option */
else if(strcmp(opt, "val-sig-skew-min:") == 0)
@@ -747,6 +749,7 @@ config_get_option(struct config_file* cfg, const char* opt,
else O_DEC(opt, "ratelimit-factor", ratelimit_factor)
else O_DEC(opt, "val-sig-skew-min", val_sig_skew_min)
else O_DEC(opt, "val-sig-skew-max", val_sig_skew_max)
+ else O_YNO(opt, "qname-minimisation", qname_minimisation)
/* not here:
* outgoing-permit, outgoing-avoid - have list of ports
* local-zone - zones and nodefault variables
@@ -1555,6 +1558,28 @@ w_lookup_reg_str(const char* key, const char* name)
}
return result;
}
+
+void w_config_adjust_directory(struct config_file* cfg)
+{
+ if(cfg->directory && cfg->directory[0]) {
+ TCHAR dirbuf[2*MAX_PATH+4];
+ if(strcmp(cfg->directory, "%EXECUTABLE%") == 0) {
+ /* get executable path, and if that contains
+ * directories, snip off the filename part */
+ dirbuf[0] = 0;
+ if(!GetModuleFileName(NULL, dirbuf, MAX_PATH))
+ log_err("could not GetModuleFileName");
+ if(strrchr(dirbuf, '\\')) {
+ (strrchr(dirbuf, '\\'))[0] = 0;
+ } else log_err("GetModuleFileName had no path");
+ if(dirbuf[0]) {
+ /* adjust directory for later lookups to work*/
+ free(cfg->directory);
+ cfg->directory = memdup(dirbuf, strlen(dirbuf)+1);
+ }
+ }
+ }
+}
#endif /* UB_ON_WINDOWS */
void errinf(struct module_qstate* qstate, const char* str)
diff --git a/contrib/unbound/util/config_file.h b/contrib/unbound/util/config_file.h
index 99b15e0..8fa163e 100644
--- a/contrib/unbound/util/config_file.h
+++ b/contrib/unbound/util/config_file.h
@@ -283,7 +283,7 @@ struct config_file {
struct config_str2list* local_zones;
/** local zones nodefault list */
struct config_strlist* local_zones_nodefault;
- /** local data RRs configged */
+ /** local data RRs configured */
struct config_strlist* local_data;
/** unblock lan zones (reverse lookups for 10/8 and so on) */
int unblock_lan_zones;
@@ -364,6 +364,8 @@ struct config_file {
struct config_str2list* ratelimit_below_domain;
/** ratelimit factor, 0 blocks all, 10 allows 1/10 of traffic */
int ratelimit_factor;
+ /** minimise outgoing QNAME and hide original QTYPE if possible */
+ int qname_minimisation;
};
/** from cfg username, after daemonise setup performed */
@@ -739,6 +741,9 @@ void ub_c_error_msg(const char* fmt, ...) ATTR_FORMAT(printf, 1, 2);
* exist on an error (logged with log_err) was encountered.
*/
char* w_lookup_reg_str(const char* key, const char* name);
+
+/** Modify directory in options for module file name */
+void w_config_adjust_directory(struct config_file* cfg);
#endif /* UB_ON_WINDOWS */
#endif /* UTIL_CONFIG_FILE_H */
diff --git a/contrib/unbound/util/configlexer.lex b/contrib/unbound/util/configlexer.lex
index 1aea22e..a368066 100644
--- a/contrib/unbound/util/configlexer.lex
+++ b/contrib/unbound/util/configlexer.lex
@@ -207,6 +207,7 @@ SQANY [^\'\n\r\\]|\\.
/* note that flex makes the longest match and '.' is any but not nl */
LEXOUT(("comment(%s) ", ub_c_text)); /* ignore */ }
server{COLON} { YDVAR(0, VAR_SERVER) }
+qname-minimisation{COLON} { YDVAR(1, VAR_QNAME_MINIMISATION) }
num-threads{COLON} { YDVAR(1, VAR_NUM_THREADS) }
verbosity{COLON} { YDVAR(1, VAR_VERBOSITY) }
port{COLON} { YDVAR(1, VAR_PORT) }
diff --git a/contrib/unbound/util/configparser.y b/contrib/unbound/util/configparser.y
index d6db3c8..abc0bb0 100644
--- a/contrib/unbound/util/configparser.y
+++ b/contrib/unbound/util/configparser.y
@@ -122,6 +122,7 @@ extern struct config_parser_state* cfg_parser;
%token VAR_RATELIMIT VAR_RATELIMIT_SLABS VAR_RATELIMIT_SIZE
%token VAR_RATELIMIT_FOR_DOMAIN VAR_RATELIMIT_BELOW_DOMAIN VAR_RATELIMIT_FACTOR
%token VAR_CAPS_WHITELIST VAR_CACHE_MAX_NEGATIVE_TTL VAR_PERMIT_SMALL_HOLDDOWN
+%token VAR_QNAME_MINIMISATION
%%
toplevelvars: /* empty */ | toplevelvars toplevelvar ;
@@ -186,7 +187,7 @@ content_server: server_num_threads | server_verbosity | server_port |
server_ratelimit_size | server_ratelimit_for_domain |
server_ratelimit_below_domain | server_ratelimit_factor |
server_caps_whitelist | server_cache_max_negative_ttl |
- server_permit_small_holddown
+ server_permit_small_holddown | server_qname_minimisation
;
stubstart: VAR_STUB_ZONE
{
@@ -1318,6 +1319,16 @@ server_ratelimit_factor: VAR_RATELIMIT_FACTOR STRING_ARG
free($2);
}
;
+server_qname_minimisation: VAR_QNAME_MINIMISATION STRING_ARG
+ {
+ OUTYY(("P(server_qname_minimisation:%s)\n", $2));
+ if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
+ yyerror("expected yes or no.");
+ else cfg_parser->cfg->qname_minimisation =
+ (strcmp($2, "yes")==0);
+ free($2);
+ }
+ ;
stub_name: VAR_NAME STRING_ARG
{
OUTYY(("P(name:%s)\n", $2));
diff --git a/contrib/unbound/util/iana_ports.inc b/contrib/unbound/util/iana_ports.inc
index 64edf0b..b09a9ad 100644
--- a/contrib/unbound/util/iana_ports.inc
+++ b/contrib/unbound/util/iana_ports.inc
@@ -660,6 +660,7 @@
833,
847,
848,
+853,
860,
861,
862,
@@ -3842,6 +3843,7 @@
4406,
4412,
4413,
+4416,
4425,
4426,
4430,
@@ -4572,6 +4574,7 @@
7070,
7071,
7080,
+7088,
7095,
7099,
7100,
@@ -5383,6 +5386,7 @@
38203,
39681,
40000,
+40023,
40841,
40842,
40843,
diff --git a/contrib/unbound/util/locks.c b/contrib/unbound/util/locks.c
index 509895d..adfb6c0 100644
--- a/contrib/unbound/util/locks.c
+++ b/contrib/unbound/util/locks.c
@@ -232,7 +232,7 @@ void ub_thread_create(ub_thread_t* thr, void* (*func)(void*), void* arg)
0, /* default flags, run immediately */
NULL); /* do not store thread identifier anywhere */
#else
- /* the begintheadex routine setups for the C lib; aligns stack */
+ /* the beginthreadex routine setups for the C lib; aligns stack */
*thr=(ub_thread_t)_beginthreadex(NULL, 0, (void*)func, arg, 0, NULL);
#endif
if(*thr == NULL) {
diff --git a/contrib/unbound/util/net_help.c b/contrib/unbound/util/net_help.c
index 07605b1..eb03cd0 100644
--- a/contrib/unbound/util/net_help.c
+++ b/contrib/unbound/util/net_help.c
@@ -619,12 +619,14 @@ void* listen_sslctx_create(char* key, char* pem, char* verifypem)
return NULL;
}
/* no SSLv2, SSLv3 because has defects */
- if(!(SSL_CTX_set_options(ctx, SSL_OP_NO_SSLv2) & SSL_OP_NO_SSLv2)){
+ if((SSL_CTX_set_options(ctx, SSL_OP_NO_SSLv2) & SSL_OP_NO_SSLv2)
+ != SSL_OP_NO_SSLv2){
log_crypto_err("could not set SSL_OP_NO_SSLv2");
SSL_CTX_free(ctx);
return NULL;
}
- if(!(SSL_CTX_set_options(ctx, SSL_OP_NO_SSLv3) & SSL_OP_NO_SSLv3)){
+ if((SSL_CTX_set_options(ctx, SSL_OP_NO_SSLv3) & SSL_OP_NO_SSLv3)
+ != SSL_OP_NO_SSLv3){
log_crypto_err("could not set SSL_OP_NO_SSLv3");
SSL_CTX_free(ctx);
return NULL;
@@ -690,12 +692,14 @@ void* connect_sslctx_create(char* key, char* pem, char* verifypem)
log_crypto_err("could not allocate SSL_CTX pointer");
return NULL;
}
- if(!(SSL_CTX_set_options(ctx, SSL_OP_NO_SSLv2) & SSL_OP_NO_SSLv2)) {
+ if((SSL_CTX_set_options(ctx, SSL_OP_NO_SSLv2) & SSL_OP_NO_SSLv2)
+ != SSL_OP_NO_SSLv2) {
log_crypto_err("could not set SSL_OP_NO_SSLv2");
SSL_CTX_free(ctx);
return NULL;
}
- if(!(SSL_CTX_set_options(ctx, SSL_OP_NO_SSLv3) & SSL_OP_NO_SSLv3)) {
+ if((SSL_CTX_set_options(ctx, SSL_OP_NO_SSLv3) & SSL_OP_NO_SSLv3)
+ != SSL_OP_NO_SSLv3) {
log_crypto_err("could not set SSL_OP_NO_SSLv3");
SSL_CTX_free(ctx);
return NULL;
diff --git a/contrib/unbound/util/random.c b/contrib/unbound/util/random.c
index 71f0ba5..684464e 100644
--- a/contrib/unbound/util/random.c
+++ b/contrib/unbound/util/random.c
@@ -68,6 +68,8 @@
/* nss3 */
#include "secport.h"
#include "pk11pub.h"
+#elif defined(HAVE_NETTLE)
+#include "yarrow.h"
#endif
/**
@@ -76,7 +78,7 @@
*/
#define MAX_VALUE 0x7fffffff
-#ifndef HAVE_NSS
+#if defined(HAVE_SSL)
void
ub_systemseed(unsigned int ATTR_UNUSED(seed))
{
@@ -110,7 +112,7 @@ ub_random_max(struct ub_randstate* state, long int x)
return (long)arc4random_uniform((uint32_t)x);
}
-#else
+#elif defined(HAVE_NSS)
/* not much to remember for NSS since we use its pk11_random, placeholder */
struct ub_randstate {
@@ -144,6 +146,72 @@ long int ub_random(struct ub_randstate* ATTR_UNUSED(state))
return x & MAX_VALUE;
}
+#elif defined(HAVE_NETTLE)
+
+/**
+ * libnettle implements a Yarrow-256 generator (SHA256 + AES),
+ * and we have to ensure it is seeded before use.
+ */
+struct ub_randstate {
+ struct yarrow256_ctx ctx;
+ int seeded;
+};
+
+void ub_systemseed(unsigned int ATTR_UNUSED(seed))
+{
+/**
+ * We seed on init and not here, as we need the ctx to re-seed.
+ * This also means that re-seeding is not supported.
+ */
+ log_err("Re-seeding not supported, generator untouched");
+}
+
+struct ub_randstate* ub_initstate(unsigned int seed,
+ struct ub_randstate* ATTR_UNUSED(from))
+{
+ struct ub_randstate* s = (struct ub_randstate*)calloc(1, sizeof(*s));
+ uint8_t buf[YARROW256_SEED_FILE_SIZE];
+ if(!s) {
+ log_err("malloc failure in random init");
+ return NULL;
+ }
+ /* Setup Yarrow context */
+ yarrow256_init(&s->ctx, 0, NULL);
+
+ if(getentropy(buf, sizeof(buf)) != -1) {
+ /* got entropy */
+ yarrow256_seed(&s->ctx, YARROW256_SEED_FILE_SIZE, buf);
+ s->seeded = yarrow256_is_seeded(&s->ctx);
+ } else {
+ /* Stretch the uint32 input seed and feed it to Yarrow */
+ uint32_t v = seed;
+ size_t i;
+ for(i=0; i < (YARROW256_SEED_FILE_SIZE/sizeof(seed)); i++) {
+ memmove(buf+i*sizeof(seed), &v, sizeof(seed));
+ v = v*seed + (uint32_t)i;
+ }
+ yarrow256_seed(&s->ctx, YARROW256_SEED_FILE_SIZE, buf);
+ s->seeded = yarrow256_is_seeded(&s->ctx);
+ }
+
+ return s;
+}
+
+long int ub_random(struct ub_randstate* s)
+{
+ /* random 31 bit value. */
+ long int x = 0;
+ if (!s || !s->seeded) {
+ log_err("Couldn't generate randomness, Yarrow-256 generator not yet seeded");
+ } else {
+ yarrow256_random(&s->ctx, sizeof(x), (uint8_t *)&x);
+ }
+ return x & MAX_VALUE;
+}
+#endif /* HAVE_SSL or HAVE_NSS or HAVE_NETTLE */
+
+
+#if defined(HAVE_NSS) || defined(HAVE_NETTLE)
long int
ub_random_max(struct ub_randstate* state, long int x)
{
@@ -155,7 +223,7 @@ ub_random_max(struct ub_randstate* state, long int x)
v = ub_random(state);
return (v % x);
}
-#endif /* HAVE_NSS */
+#endif /* HAVE_NSS or HAVE_NETTLE */
void
ub_randfree(struct ub_randstate* s)
diff --git a/contrib/unbound/util/rbtree.c b/contrib/unbound/util/rbtree.c
index a898f13..ee5446f 100644
--- a/contrib/unbound/util/rbtree.c
+++ b/contrib/unbound/util/rbtree.c
@@ -68,7 +68,7 @@ static void rbtree_insert_fixup(rbtree_t *rbtree, rbnode_t *node);
static void rbtree_delete_fixup(rbtree_t* rbtree, rbnode_t* child, rbnode_t* child_parent);
/*
- * Creates a new red black tree, intializes and returns a pointer to it.
+ * Creates a new red black tree, initializes and returns a pointer to it.
*
* Return NULL on failure.
*
diff --git a/contrib/unbound/util/rtt.h b/contrib/unbound/util/rtt.h
index d6da986..07e65ee 100644
--- a/contrib/unbound/util/rtt.h
+++ b/contrib/unbound/util/rtt.h
@@ -96,7 +96,7 @@ int rtt_notimeout(const struct rtt_info* rtt);
void rtt_update(struct rtt_info* rtt, int ms);
/**
- * Update the statistics with a new timout expired observation.
+ * Update the statistics with a new timeout expired observation.
* @param rtt: round trip statistics structure.
* @param orig: original rtt time given for the query that timed out.
* Used to calculate the maximum responsible backed off time that
diff --git a/contrib/unbound/util/storage/lookup3.c b/contrib/unbound/util/storage/lookup3.c
index de28858..ddcb56e 100644
--- a/contrib/unbound/util/storage/lookup3.c
+++ b/contrib/unbound/util/storage/lookup3.c
@@ -356,7 +356,7 @@ uint32_t hashlittle( const void *key, size_t length, uint32_t initval)
* rest of the string. Every machine with memory protection I've seen
* does it on word boundaries, so is OK with this. But VALGRIND will
* still catch it and complain. The masking trick does make the hash
- * noticably faster for short strings (like English words).
+ * noticeably faster for short strings (like English words).
*/
#ifndef VALGRIND
@@ -544,7 +544,7 @@ void hashlittle2(
* rest of the string. Every machine with memory protection I've seen
* does it on word boundaries, so is OK with this. But VALGRIND will
* still catch it and complain. The masking trick does make the hash
- * noticably faster for short strings (like English words).
+ * noticeably faster for short strings (like English words).
*/
#ifndef VALGRIND
@@ -725,7 +725,7 @@ uint32_t hashbig( const void *key, size_t length, uint32_t initval)
* rest of the string. Every machine with memory protection I've seen
* does it on word boundaries, so is OK with this. But VALGRIND will
* still catch it and complain. The masking trick does make the hash
- * noticably faster for short strings (like English words).
+ * noticeably faster for short strings (like English words).
*/
#ifndef VALGRIND
@@ -858,7 +858,7 @@ void driver2()
{
for (j=0; j<8; ++j) /*------------------------ for each input bit, */
{
- for (m=1; m<8; ++m) /*------------ for serveral possible initvals, */
+ for (m=1; m<8; ++m) /*------------ for several possible initvals, */
{
for (l=0; l<HASHSTATE; ++l)
e[l]=f[l]=g[l]=h[l]=x[l]=y[l]=~((uint32_t)0);
diff --git a/contrib/unbound/util/tube.h b/contrib/unbound/util/tube.h
index 9ec50af..6cc6050 100644
--- a/contrib/unbound/util/tube.h
+++ b/contrib/unbound/util/tube.h
@@ -83,7 +83,7 @@ struct tube {
/** background write queue, commpoint to write results back */
struct comm_point* res_com;
- /** are we curently writing a result, 0 if not, else bytecount into
+ /** are we currently writing a result, 0 if not, else bytecount into
* the res_list first entry. */
size_t res_write;
/** list of outstanding results to be written back */
diff --git a/contrib/unbound/util/winsock_event.h b/contrib/unbound/util/winsock_event.h
index f642657..d386a69 100644
--- a/contrib/unbound/util/winsock_event.h
+++ b/contrib/unbound/util/winsock_event.h
@@ -201,7 +201,7 @@ struct event {
int stick_events;
/** true if this event is a signaling WSAEvent by the user.
- * User created and user closed WSAEvent. Only signaled/unsigneled,
+ * User created and user closed WSAEvent. Only signaled/unsignaled,
* no read/write/distinctions needed. */
int is_signal;
/** used during callbacks to see which events were just checked */
diff --git a/contrib/unbound/validator/autotrust.c b/contrib/unbound/validator/autotrust.c
index e63b086..f8c9c8c 100644
--- a/contrib/unbound/validator/autotrust.c
+++ b/contrib/unbound/validator/autotrust.c
@@ -1195,6 +1195,14 @@ void autr_write_file(struct module_env* env, struct trust_anchor* tp)
fatal_exit("could not completely write: %s", fname);
return;
}
+ if(fflush(out) != 0)
+ log_err("could not fflush(%s): %s", fname, strerror(errno));
+#ifdef HAVE_FSYNC
+ if(fsync(fileno(out)) != 0)
+ log_err("could not fsync(%s): %s", fname, strerror(errno));
+#else
+ FlushFileBuffers((HANDLE)_fileno(out));
+#endif
if(fclose(out) != 0) {
fatal_exit("could not complete write: %s: %s",
fname, strerror(errno));
@@ -2162,7 +2170,7 @@ int autr_process_prime(struct module_env* env, struct val_env* ve,
if(!verify_dnskey(env, ve, tp, dnskey_rrset)) {
verbose(VERB_ALGO, "autotrust: dnskey did not verify.");
/* only increase failure count if this is not the first prime,
- * this means there was a previous succesful probe */
+ * this means there was a previous successful probe */
if(tp->autr->last_success) {
tp->autr->query_failed += 1;
autr_write_file(env, tp);
diff --git a/contrib/unbound/validator/val_neg.c b/contrib/unbound/validator/val_neg.c
index b1ff8d9..ab31f48 100644
--- a/contrib/unbound/validator/val_neg.c
+++ b/contrib/unbound/validator/val_neg.c
@@ -38,7 +38,7 @@
*
* This file contains helper functions for the validator module.
* The functions help with aggressive negative caching.
- * This creates new denials of existance, and proofs for absence of types
+ * This creates new denials of existence, and proofs for absence of types
* from cached NSEC records.
*/
#include "config.h"
diff --git a/contrib/unbound/validator/val_neg.h b/contrib/unbound/validator/val_neg.h
index 967d1a7..bf3a247 100644
--- a/contrib/unbound/validator/val_neg.h
+++ b/contrib/unbound/validator/val_neg.h
@@ -38,7 +38,7 @@
*
* This file contains helper functions for the validator module.
* The functions help with aggressive negative caching.
- * This creates new denials of existance, and proofs for absence of types
+ * This creates new denials of existence, and proofs for absence of types
* from cached NSEC records.
*/
diff --git a/contrib/unbound/validator/val_nsec.c b/contrib/unbound/validator/val_nsec.c
index bdfe3c8..f104a34 100644
--- a/contrib/unbound/validator/val_nsec.c
+++ b/contrib/unbound/validator/val_nsec.c
@@ -1,5 +1,5 @@
/*
- * validator/val_nsec.c - validator NSEC denial of existance functions.
+ * validator/val_nsec.c - validator NSEC denial of existence functions.
*
* Copyright (c) 2007, NLnet Labs. All rights reserved.
*
@@ -38,7 +38,7 @@
*
* This file contains helper functions for the validator module.
* The functions help with NSEC checking, the different NSEC proofs
- * for denial of existance, and proofs for presence of types.
+ * for denial of existence, and proofs for presence of types.
*/
#include "config.h"
#include "validator/val_nsec.h"
@@ -279,7 +279,7 @@ val_nsec_prove_nodata_dsreply(struct module_env* env, struct val_env* ve,
return sec_status_insecure;
}
- /* NSEC proof did not conlusively point to DS or no DS */
+ /* NSEC proof did not conclusively point to DS or no DS */
return sec_status_unchecked;
}
@@ -340,6 +340,28 @@ int nsec_proves_nodata(struct ub_packed_rrset_key* nsec,
*wc = ce;
return 1;
}
+ } else {
+ /* See if the next owner name covers a wildcard
+ * empty non-terminal. */
+ while (dname_strict_subdomain_c(nm, nsec->rk.dname)) {
+ /* wildcard does not apply if qname below
+ * the name that exists under the '*' */
+ if (dname_subdomain_c(qinfo->qname, nm))
+ break;
+ /* but if it is a wildcard and qname is below
+ * it, then the wildcard applies. The wildcard
+ * is an empty nonterminal. nodata proven. */
+ if (dname_is_wild(nm)) {
+ size_t ce_len = ln;
+ uint8_t* ce = nm;
+ dname_remove_label(&ce, &ce_len);
+ if(dname_strict_subdomain_c(qinfo->qname, ce)) {
+ *wc = ce;
+ return 1;
+ }
+ }
+ dname_remove_label(&nm, &ln);
+ }
}
/* Otherwise, this NSEC does not prove ENT and is not a
diff --git a/contrib/unbound/validator/val_nsec.h b/contrib/unbound/validator/val_nsec.h
index f680d08..c031c9a 100644
--- a/contrib/unbound/validator/val_nsec.h
+++ b/contrib/unbound/validator/val_nsec.h
@@ -1,5 +1,5 @@
/*
- * validator/val_nsec.h - validator NSEC denial of existance functions.
+ * validator/val_nsec.h - validator NSEC denial of existence functions.
*
* Copyright (c) 2007, NLnet Labs. All rights reserved.
*
@@ -38,7 +38,7 @@
*
* This file contains helper functions for the validator module.
* The functions help with NSEC checking, the different NSEC proofs
- * for denial of existance, and proofs for presence of types.
+ * for denial of existence, and proofs for presence of types.
*/
#ifndef VALIDATOR_VAL_NSEC_H
@@ -54,7 +54,7 @@ struct key_entry_key;
/**
* Check DS absence.
* There is a NODATA reply to a DS that needs checking.
- * NSECs can prove this is not a delegation point, or sucessfully prove
+ * NSECs can prove this is not a delegation point, or successfully prove
* that there is no DS. Or this fails.
*
* @param env: module env for rrsig verification routines.
diff --git a/contrib/unbound/validator/val_nsec3.c b/contrib/unbound/validator/val_nsec3.c
index 80ca4d0..22867d1 100644
--- a/contrib/unbound/validator/val_nsec3.c
+++ b/contrib/unbound/validator/val_nsec3.c
@@ -1,5 +1,5 @@
/*
- * validator/val_nsec3.c - validator NSEC3 denial of existance functions.
+ * validator/val_nsec3.c - validator NSEC3 denial of existence functions.
*
* Copyright (c) 2007, NLnet Labs. All rights reserved.
*
@@ -38,18 +38,12 @@
*
* This file contains helper functions for the validator module.
* The functions help with NSEC3 checking, the different NSEC3 proofs
- * for denial of existance, and proofs for presence of types.
+ * for denial of existence, and proofs for presence of types.
*/
#include "config.h"
#include <ctype.h>
-#ifdef HAVE_OPENSSL_SSL_H
-#include "openssl/ssl.h"
-#endif
-#ifdef HAVE_NSS
-/* nss3 */
-#include "sechash.h"
-#endif
#include "validator/val_nsec3.h"
+#include "validator/val_secalgo.h"
#include "validator/validator.h"
#include "validator/val_kentry.h"
#include "services/cache/rrset.h"
@@ -370,8 +364,8 @@ filter_next(struct nsec3_filter* filter, size_t* rrsetnum, int* rrnum)
/**
* Start iterating over NSEC3 records.
* @param filter: the filter structure, must have been filter_init-ed.
- * @param rrsetnum: can be undefined on call, inited.
- * @param rrnum: can be undefined on call, inited.
+ * @param rrsetnum: can be undefined on call, initialised.
+ * @param rrnum: can be undefined on call, initialised.
* @return first rrset of an NSEC3, together with rrnum this points to
* the first RR to examine. Is NULL on empty list.
*/
@@ -545,46 +539,24 @@ nsec3_get_hashed(sldns_buffer* buf, uint8_t* nm, size_t nmlen, int algo,
query_dname_tolower(sldns_buffer_begin(buf));
sldns_buffer_write(buf, salt, saltlen);
sldns_buffer_flip(buf);
- switch(algo) {
-#if defined(HAVE_EVP_SHA1) || defined(HAVE_NSS)
- case NSEC3_HASH_SHA1:
-#ifdef HAVE_SSL
- hash_len = SHA_DIGEST_LENGTH;
-#else
- hash_len = SHA1_LENGTH;
-#endif
- if(hash_len > max)
- return 0;
-# ifdef HAVE_SSL
- (void)SHA1((unsigned char*)sldns_buffer_begin(buf),
- (unsigned long)sldns_buffer_limit(buf),
- (unsigned char*)res);
-# else
- (void)HASH_HashBuf(HASH_AlgSHA1, (unsigned char*)res,
- (unsigned char*)sldns_buffer_begin(buf),
- (unsigned long)sldns_buffer_limit(buf));
-# endif
- for(i=0; i<iter; i++) {
- sldns_buffer_clear(buf);
- sldns_buffer_write(buf, res, hash_len);
- sldns_buffer_write(buf, salt, saltlen);
- sldns_buffer_flip(buf);
-# ifdef HAVE_SSL
- (void)SHA1(
- (unsigned char*)sldns_buffer_begin(buf),
- (unsigned long)sldns_buffer_limit(buf),
- (unsigned char*)res);
-# else
- (void)HASH_HashBuf(HASH_AlgSHA1,
- (unsigned char*)res,
- (unsigned char*)sldns_buffer_begin(buf),
- (unsigned long)sldns_buffer_limit(buf));
-# endif
- }
- break;
-#endif /* HAVE_EVP_SHA1 or NSS */
- default:
- log_err("nsec3 hash of unknown algo %d", algo);
+ hash_len = nsec3_hash_algo_size_supported(algo);
+ if(hash_len == 0) {
+ log_err("nsec3 hash of unknown algo %d", algo);
+ return 0;
+ }
+ if(hash_len > max)
+ return 0;
+ if(!secalgo_nsec3_hash(algo, (unsigned char*)sldns_buffer_begin(buf),
+ sldns_buffer_limit(buf), (unsigned char*)res))
+ return 0;
+ for(i=0; i<iter; i++) {
+ sldns_buffer_clear(buf);
+ sldns_buffer_write(buf, res, hash_len);
+ sldns_buffer_write(buf, salt, saltlen);
+ sldns_buffer_flip(buf);
+ if(!secalgo_nsec3_hash(algo,
+ (unsigned char*)sldns_buffer_begin(buf),
+ sldns_buffer_limit(buf), (unsigned char*)res))
return 0;
}
return hash_len;
@@ -607,50 +579,24 @@ nsec3_calc_hash(struct regional* region, sldns_buffer* buf,
query_dname_tolower(sldns_buffer_begin(buf));
sldns_buffer_write(buf, salt, saltlen);
sldns_buffer_flip(buf);
- switch(algo) {
-#if defined(HAVE_EVP_SHA1) || defined(HAVE_NSS)
- case NSEC3_HASH_SHA1:
-#ifdef HAVE_SSL
- c->hash_len = SHA_DIGEST_LENGTH;
-#else
- c->hash_len = SHA1_LENGTH;
-#endif
- c->hash = (uint8_t*)regional_alloc(region,
- c->hash_len);
- if(!c->hash)
- return 0;
-# ifdef HAVE_SSL
- (void)SHA1((unsigned char*)sldns_buffer_begin(buf),
- (unsigned long)sldns_buffer_limit(buf),
- (unsigned char*)c->hash);
-# else
- (void)HASH_HashBuf(HASH_AlgSHA1,
- (unsigned char*)c->hash,
- (unsigned char*)sldns_buffer_begin(buf),
- (unsigned long)sldns_buffer_limit(buf));
-# endif
- for(i=0; i<iter; i++) {
- sldns_buffer_clear(buf);
- sldns_buffer_write(buf, c->hash, c->hash_len);
- sldns_buffer_write(buf, salt, saltlen);
- sldns_buffer_flip(buf);
-# ifdef HAVE_SSL
- (void)SHA1(
- (unsigned char*)sldns_buffer_begin(buf),
- (unsigned long)sldns_buffer_limit(buf),
- (unsigned char*)c->hash);
-# else
- (void)HASH_HashBuf(HASH_AlgSHA1,
- (unsigned char*)c->hash,
- (unsigned char*)sldns_buffer_begin(buf),
- (unsigned long)sldns_buffer_limit(buf));
-# endif
- }
- break;
-#endif /* HAVE_EVP_SHA1 or NSS */
- default:
- log_err("nsec3 hash of unknown algo %d", algo);
- return -1;
+ c->hash_len = nsec3_hash_algo_size_supported(algo);
+ if(c->hash_len == 0) {
+ log_err("nsec3 hash of unknown algo %d", algo);
+ return -1;
+ }
+ c->hash = (uint8_t*)regional_alloc(region, c->hash_len);
+ if(!c->hash)
+ return 0;
+ (void)secalgo_nsec3_hash(algo, (unsigned char*)sldns_buffer_begin(buf),
+ sldns_buffer_limit(buf), (unsigned char*)c->hash);
+ for(i=0; i<iter; i++) {
+ sldns_buffer_clear(buf);
+ sldns_buffer_write(buf, c->hash, c->hash_len);
+ sldns_buffer_write(buf, salt, saltlen);
+ sldns_buffer_flip(buf);
+ (void)secalgo_nsec3_hash(algo,
+ (unsigned char*)sldns_buffer_begin(buf),
+ sldns_buffer_limit(buf), (unsigned char*)c->hash);
}
return 1;
}
diff --git a/contrib/unbound/validator/val_nsec3.h b/contrib/unbound/validator/val_nsec3.h
index d619d67..69ba78d 100644
--- a/contrib/unbound/validator/val_nsec3.h
+++ b/contrib/unbound/validator/val_nsec3.h
@@ -1,5 +1,5 @@
/*
- * validator/val_nsec3.h - validator NSEC3 denial of existance functions.
+ * validator/val_nsec3.h - validator NSEC3 denial of existence functions.
*
* Copyright (c) 2007, NLnet Labs. All rights reserved.
*
@@ -38,7 +38,7 @@
*
* This file contains helper functions for the validator module.
* The functions help with NSEC3 checking, the different NSEC3 proofs
- * for denial of existance, and proofs for presence of types.
+ * for denial of existence, and proofs for presence of types.
*
* NSEC3
* 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3
@@ -256,7 +256,7 @@ int nsec3_hash_cmp(const void* c1, const void* c2);
* Used internally by the nsec3 proof functions in this file.
* published to enable unit testing of hash algorithms and cache.
*
- * @param table: the cache table. Must be inited at start.
+ * @param table: the cache table. Must be initialised at start.
* @param region: scratch region to use for allocation.
* This region holds the tree, if you wipe the region, reinit the tree.
* @param buf: temporary buffer.
diff --git a/contrib/unbound/validator/val_secalgo.c b/contrib/unbound/validator/val_secalgo.c
index 8ed403d..7c8d7b2 100644
--- a/contrib/unbound/validator/val_secalgo.c
+++ b/contrib/unbound/validator/val_secalgo.c
@@ -44,12 +44,13 @@
/* packed_rrset on top to define enum types (forced by c99 standard) */
#include "util/data/packed_rrset.h"
#include "validator/val_secalgo.h"
+#include "validator/val_nsec3.h"
#include "util/log.h"
#include "sldns/rrdef.h"
#include "sldns/keyraw.h"
#include "sldns/sbuffer.h"
-#if !defined(HAVE_SSL) && !defined(HAVE_NSS)
+#if !defined(HAVE_SSL) && !defined(HAVE_NSS) && !defined(HAVE_NETTLE)
#error "Need crypto library to do digital signature cryptography"
#endif
@@ -71,10 +72,36 @@
#include <openssl/engine.h>
#endif
+/* return size of digest if supported, or 0 otherwise */
+size_t
+nsec3_hash_algo_size_supported(int id)
+{
+ switch(id) {
+ case NSEC3_HASH_SHA1:
+ return SHA_DIGEST_LENGTH;
+ default:
+ return 0;
+ }
+}
+
+/* perform nsec3 hash. return false on failure */
+int
+secalgo_nsec3_hash(int algo, unsigned char* buf, size_t len,
+ unsigned char* res)
+{
+ switch(algo) {
+ case NSEC3_HASH_SHA1:
+ (void)SHA1(buf, len, res);
+ return 1;
+ default:
+ return 0;
+ }
+}
+
/**
* Return size of DS digest according to its hash algorithm.
* @param algo: DS digest algo.
- * @return size in bytes of digest, or 0 if not supported.
+ * @return size in bytes of digest, or 0 if not supported.
*/
size_t
ds_digest_size_supported(int algo)
@@ -565,6 +592,32 @@ verify_canonrrset(sldns_buffer* buf, int algo, unsigned char* sigblock,
/* nspr4 */
#include "prerror.h"
+/* return size of digest if supported, or 0 otherwise */
+size_t
+nsec3_hash_algo_size_supported(int id)
+{
+ switch(id) {
+ case NSEC3_HASH_SHA1:
+ return SHA1_LENGTH;
+ default:
+ return 0;
+ }
+}
+
+/* perform nsec3 hash. return false on failure */
+int
+secalgo_nsec3_hash(int algo, unsigned char* buf, size_t len,
+ unsigned char* res)
+{
+ switch(algo) {
+ case NSEC3_HASH_SHA1:
+ (void)HASH_HashBuf(HASH_AlgSHA1, res, buf, (unsigned long)len);
+ return 1;
+ default:
+ return 0;
+ }
+}
+
size_t
ds_digest_size_supported(int algo)
{
@@ -1069,5 +1122,466 @@ verify_canonrrset(sldns_buffer* buf, int algo, unsigned char* sigblock,
return sec_status_bogus;
}
+#elif defined(HAVE_NETTLE)
+
+#include "sha.h"
+#include "bignum.h"
+#include "macros.h"
+#include "rsa.h"
+#include "dsa.h"
+#include "asn1.h"
+#ifdef USE_ECDSA
+#include "ecdsa.h"
+#include "ecc-curve.h"
+#endif
+
+static int
+_digest_nettle(int algo, uint8_t* buf, size_t len,
+ unsigned char* res)
+{
+ switch(algo) {
+ case SHA1_DIGEST_SIZE:
+ {
+ struct sha1_ctx ctx;
+ sha1_init(&ctx);
+ sha1_update(&ctx, len, buf);
+ sha1_digest(&ctx, SHA1_DIGEST_SIZE, res);
+ return 1;
+ }
+ case SHA256_DIGEST_SIZE:
+ {
+ struct sha256_ctx ctx;
+ sha256_init(&ctx);
+ sha256_update(&ctx, len, buf);
+ sha256_digest(&ctx, SHA256_DIGEST_SIZE, res);
+ return 1;
+ }
+ case SHA384_DIGEST_SIZE:
+ {
+ struct sha384_ctx ctx;
+ sha384_init(&ctx);
+ sha384_update(&ctx, len, buf);
+ sha384_digest(&ctx, SHA384_DIGEST_SIZE, res);
+ return 1;
+ }
+ case SHA512_DIGEST_SIZE:
+ {
+ struct sha512_ctx ctx;
+ sha512_init(&ctx);
+ sha512_update(&ctx, len, buf);
+ sha512_digest(&ctx, SHA512_DIGEST_SIZE, res);
+ return 1;
+ }
+ default:
+ break;
+ }
+ return 0;
+}
+
+/* return size of digest if supported, or 0 otherwise */
+size_t
+nsec3_hash_algo_size_supported(int id)
+{
+ switch(id) {
+ case NSEC3_HASH_SHA1:
+ return SHA1_DIGEST_SIZE;
+ default:
+ return 0;
+ }
+}
+
+/* perform nsec3 hash. return false on failure */
+int
+secalgo_nsec3_hash(int algo, unsigned char* buf, size_t len,
+ unsigned char* res)
+{
+ switch(algo) {
+ case NSEC3_HASH_SHA1:
+ return _digest_nettle(SHA1_DIGEST_SIZE, (uint8_t*)buf, len,
+ res);
+ default:
+ return 0;
+ }
+}
+
+/**
+ * Return size of DS digest according to its hash algorithm.
+ * @param algo: DS digest algo.
+ * @return size in bytes of digest, or 0 if not supported.
+ */
+size_t
+ds_digest_size_supported(int algo)
+{
+ switch(algo) {
+ case LDNS_SHA1:
+ return SHA1_DIGEST_SIZE;
+#ifdef USE_SHA2
+ case LDNS_SHA256:
+ return SHA256_DIGEST_SIZE;
+#endif
+#ifdef USE_ECDSA
+ case LDNS_SHA384:
+ return SHA384_DIGEST_SIZE;
+#endif
+ /* GOST not supported */
+ case LDNS_HASH_GOST:
+ default:
+ break;
+ }
+ return 0;
+}
+
+int
+secalgo_ds_digest(int algo, unsigned char* buf, size_t len,
+ unsigned char* res)
+{
+ switch(algo) {
+ case LDNS_SHA1:
+ return _digest_nettle(SHA1_DIGEST_SIZE, buf, len, res);
+#if defined(USE_SHA2)
+ case LDNS_SHA256:
+ return _digest_nettle(SHA256_DIGEST_SIZE, buf, len, res);
+#endif
+#ifdef USE_ECDSA
+ case LDNS_SHA384:
+ return _digest_nettle(SHA384_DIGEST_SIZE, buf, len, res);
+
+#endif
+ case LDNS_HASH_GOST:
+ default:
+ verbose(VERB_QUERY, "unknown DS digest algorithm %d",
+ algo);
+ break;
+ }
+ return 0;
+}
+
+int
+dnskey_algo_id_is_supported(int id)
+{
+ /* uses libnettle */
+ switch(id) {
+ case LDNS_DSA:
+ case LDNS_DSA_NSEC3:
+ case LDNS_RSASHA1:
+ case LDNS_RSASHA1_NSEC3:
+#ifdef USE_SHA2
+ case LDNS_RSASHA256:
+ case LDNS_RSASHA512:
+#endif
+#ifdef USE_ECDSA
+ case LDNS_ECDSAP256SHA256:
+ case LDNS_ECDSAP384SHA384:
+#endif
+ return 1;
+ case LDNS_RSAMD5: /* RFC 6725 deprecates RSAMD5 */
+ case LDNS_ECC_GOST:
+ default:
+ return 0;
+ }
+}
+
+static char *
+_verify_nettle_dsa(sldns_buffer* buf, unsigned char* sigblock,
+ unsigned int sigblock_len, unsigned char* key, unsigned int keylen)
+{
+ uint8_t digest[SHA1_DIGEST_SIZE];
+ uint8_t key_t;
+ int res = 0;
+ size_t offset;
+ struct dsa_public_key pubkey;
+ struct dsa_signature signature;
+ unsigned int expected_len;
+
+ /* Extract DSA signature from the record */
+ nettle_dsa_signature_init(&signature);
+ /* Signature length: 41 bytes - RFC 2536 sec. 3 */
+ if(sigblock_len == 41) {
+ if(key[0] != sigblock[0])
+ return "invalid T value in DSA signature or pubkey";
+ nettle_mpz_set_str_256_u(signature.r, 20, sigblock+1);
+ nettle_mpz_set_str_256_u(signature.s, 20, sigblock+1+20);
+ } else {
+ /* DER encoded, decode the ASN1 notated R and S bignums */
+ /* SEQUENCE { r INTEGER, s INTEGER } */
+ struct asn1_der_iterator i, seq;
+ if(asn1_der_iterator_first(&i, sigblock_len,
+ (uint8_t*)sigblock) != ASN1_ITERATOR_CONSTRUCTED
+ || i.type != ASN1_SEQUENCE)
+ return "malformed DER encoded DSA signature";
+ /* decode this element of i using the seq iterator */
+ if(asn1_der_decode_constructed(&i, &seq) !=
+ ASN1_ITERATOR_PRIMITIVE || seq.type != ASN1_INTEGER)
+ return "malformed DER encoded DSA signature";
+ if(!asn1_der_get_bignum(&seq, signature.r, 20*8))
+ return "malformed DER encoded DSA signature";
+ if(asn1_der_iterator_next(&seq) != ASN1_ITERATOR_PRIMITIVE
+ || seq.type != ASN1_INTEGER)
+ return "malformed DER encoded DSA signature";
+ if(!asn1_der_get_bignum(&seq, signature.s, 20*8))
+ return "malformed DER encoded DSA signature";
+ if(asn1_der_iterator_next(&i) != ASN1_ITERATOR_END)
+ return "malformed DER encoded DSA signature";
+ }
+
+ /* Validate T values constraints - RFC 2536 sec. 2 & sec. 3 */
+ key_t = key[0];
+ if (key_t > 8) {
+ return "invalid T value in DSA pubkey";
+ }
+
+ /* Pubkey minimum length: 21 bytes - RFC 2536 sec. 2 */
+ if (keylen < 21) {
+ return "DSA pubkey too short";
+ }
+
+ expected_len = 1 + /* T */
+ 20 + /* Q */
+ (64 + key_t*8) + /* P */
+ (64 + key_t*8) + /* G */
+ (64 + key_t*8); /* Y */
+ if (keylen != expected_len ) {
+ return "invalid DSA pubkey length";
+ }
+
+ /* Extract DSA pubkey from the record */
+ nettle_dsa_public_key_init(&pubkey);
+ offset = 1;
+ nettle_mpz_set_str_256_u(pubkey.q, 20, key+offset);
+ offset += 20;
+ nettle_mpz_set_str_256_u(pubkey.p, (64 + key_t*8), key+offset);
+ offset += (64 + key_t*8);
+ nettle_mpz_set_str_256_u(pubkey.g, (64 + key_t*8), key+offset);
+ offset += (64 + key_t*8);
+ nettle_mpz_set_str_256_u(pubkey.y, (64 + key_t*8), key+offset);
+
+ /* Digest content of "buf" and verify its DSA signature in "sigblock"*/
+ res = _digest_nettle(SHA1_DIGEST_SIZE, (unsigned char*)sldns_buffer_begin(buf),
+ (unsigned int)sldns_buffer_limit(buf), (unsigned char*)digest);
+ res &= dsa_sha1_verify_digest(&pubkey, digest, &signature);
+
+ /* Clear and return */
+ nettle_dsa_signature_clear(&signature);
+ nettle_dsa_public_key_clear(&pubkey);
+ if (!res)
+ return "DSA signature verification failed";
+ else
+ return NULL;
+}
+
+static char *
+_verify_nettle_rsa(sldns_buffer* buf, unsigned int digest_size, char* sigblock,
+ unsigned int sigblock_len, uint8_t* key, unsigned int keylen)
+{
+ uint16_t exp_len = 0;
+ size_t exp_offset = 0, mod_offset = 0;
+ struct rsa_public_key pubkey;
+ mpz_t signature;
+ int res = 0;
+
+ /* RSA pubkey parsing as per RFC 3110 sec. 2 */
+ if( keylen <= 1) {
+ return "null RSA key";
+ }
+ if (key[0] != 0) {
+ /* 1-byte length */
+ exp_len = key[0];
+ exp_offset = 1;
+ } else {
+ /* 1-byte NUL + 2-bytes exponent length */
+ if (keylen < 3) {
+ return "incorrect RSA key length";
+ }
+ exp_len = READ_UINT16(key+1);
+ if (exp_len == 0)
+ return "null RSA exponent length";
+ exp_offset = 3;
+ }
+ /* Check that we are not over-running input length */
+ if (keylen < exp_offset + exp_len + 1) {
+ return "RSA key content shorter than expected";
+ }
+ mod_offset = exp_offset + exp_len;
+ nettle_rsa_public_key_init(&pubkey);
+ pubkey.size = keylen - mod_offset;
+ nettle_mpz_set_str_256_u(pubkey.e, exp_len, &key[exp_offset]);
+ nettle_mpz_set_str_256_u(pubkey.n, pubkey.size, &key[mod_offset]);
+
+ /* Digest content of "buf" and verify its RSA signature in "sigblock"*/
+ nettle_mpz_init_set_str_256_u(signature, sigblock_len, (uint8_t*)sigblock);
+ switch (digest_size) {
+ case SHA1_DIGEST_SIZE:
+ {
+ uint8_t digest[SHA1_DIGEST_SIZE];
+ res = _digest_nettle(SHA1_DIGEST_SIZE, (unsigned char*)sldns_buffer_begin(buf),
+ (unsigned int)sldns_buffer_limit(buf), (unsigned char*)digest);
+ res &= rsa_sha1_verify_digest(&pubkey, digest, signature);
+ break;
+ }
+ case SHA256_DIGEST_SIZE:
+ {
+ uint8_t digest[SHA256_DIGEST_SIZE];
+ res = _digest_nettle(SHA256_DIGEST_SIZE, (unsigned char*)sldns_buffer_begin(buf),
+ (unsigned int)sldns_buffer_limit(buf), (unsigned char*)digest);
+ res &= rsa_sha256_verify_digest(&pubkey, digest, signature);
+ break;
+ }
+ case SHA512_DIGEST_SIZE:
+ {
+ uint8_t digest[SHA512_DIGEST_SIZE];
+ res = _digest_nettle(SHA512_DIGEST_SIZE, (unsigned char*)sldns_buffer_begin(buf),
+ (unsigned int)sldns_buffer_limit(buf), (unsigned char*)digest);
+ res &= rsa_sha512_verify_digest(&pubkey, digest, signature);
+ break;
+ }
+ default:
+ break;
+ }
+
+ /* Clear and return */
+ nettle_rsa_public_key_clear(&pubkey);
+ mpz_clear(signature);
+ if (!res) {
+ return "RSA signature verification failed";
+ } else {
+ return NULL;
+ }
+}
+
+#ifdef USE_ECDSA
+static char *
+_verify_nettle_ecdsa(sldns_buffer* buf, unsigned int digest_size, unsigned char* sigblock,
+ unsigned int sigblock_len, unsigned char* key, unsigned int keylen)
+{
+ int res = 0;
+ struct ecc_point pubkey;
+ struct dsa_signature signature;
+
+ /* Always matched strength, as per RFC 6605 sec. 1 */
+ if (sigblock_len != 2*digest_size || keylen != 2*digest_size) {
+ return "wrong ECDSA signature length";
+ }
+
+ /* Parse ECDSA signature as per RFC 6605 sec. 4 */
+ nettle_dsa_signature_init(&signature);
+ switch (digest_size) {
+ case SHA256_DIGEST_SIZE:
+ {
+ uint8_t digest[SHA256_DIGEST_SIZE];
+ mpz_t x, y;
+ nettle_ecc_point_init(&pubkey, &nettle_secp_256r1);
+ nettle_mpz_init_set_str_256_u(x, SHA256_DIGEST_SIZE, key);
+ nettle_mpz_init_set_str_256_u(y, SHA256_DIGEST_SIZE, key+SHA256_DIGEST_SIZE);
+ nettle_mpz_set_str_256_u(signature.r, SHA256_DIGEST_SIZE, sigblock);
+ nettle_mpz_set_str_256_u(signature.s, SHA256_DIGEST_SIZE, sigblock+SHA256_DIGEST_SIZE);
+ res = _digest_nettle(SHA256_DIGEST_SIZE, (unsigned char*)sldns_buffer_begin(buf),
+ (unsigned int)sldns_buffer_limit(buf), (unsigned char*)digest);
+ res &= nettle_ecc_point_set(&pubkey, x, y);
+ res &= nettle_ecdsa_verify (&pubkey, SHA256_DIGEST_SIZE, digest, &signature);
+ mpz_clear(x);
+ mpz_clear(y);
+ break;
+ }
+ case SHA384_DIGEST_SIZE:
+ {
+ uint8_t digest[SHA384_DIGEST_SIZE];
+ mpz_t x, y;
+ nettle_ecc_point_init(&pubkey, &nettle_secp_384r1);
+ nettle_mpz_init_set_str_256_u(x, SHA384_DIGEST_SIZE, key);
+ nettle_mpz_init_set_str_256_u(y, SHA384_DIGEST_SIZE, key+SHA384_DIGEST_SIZE);
+ nettle_mpz_set_str_256_u(signature.r, SHA384_DIGEST_SIZE, sigblock);
+ nettle_mpz_set_str_256_u(signature.s, SHA384_DIGEST_SIZE, sigblock+SHA384_DIGEST_SIZE);
+ res = _digest_nettle(SHA384_DIGEST_SIZE, (unsigned char*)sldns_buffer_begin(buf),
+ (unsigned int)sldns_buffer_limit(buf), (unsigned char*)digest);
+ res &= nettle_ecc_point_set(&pubkey, x, y);
+ res &= nettle_ecdsa_verify (&pubkey, SHA384_DIGEST_SIZE, digest, &signature);
+ mpz_clear(x);
+ mpz_clear(y);
+ nettle_ecc_point_clear(&pubkey);
+ break;
+ }
+ default:
+ return "unknown ECDSA algorithm";
+ }
+
+ /* Clear and return */
+ nettle_dsa_signature_clear(&signature);
+ if (!res)
+ return "ECDSA signature verification failed";
+ else
+ return NULL;
+}
+#endif
+
+/**
+ * Check a canonical sig+rrset and signature against a dnskey
+ * @param buf: buffer with data to verify, the first rrsig part and the
+ * canonicalized rrset.
+ * @param algo: DNSKEY algorithm.
+ * @param sigblock: signature rdata field from RRSIG
+ * @param sigblock_len: length of sigblock data.
+ * @param key: public key data from DNSKEY RR.
+ * @param keylen: length of keydata.
+ * @param reason: bogus reason in more detail.
+ * @return secure if verification succeeded, bogus on crypto failure,
+ * unchecked on format errors and alloc failures.
+ */
+enum sec_status
+verify_canonrrset(sldns_buffer* buf, int algo, unsigned char* sigblock,
+ unsigned int sigblock_len, unsigned char* key, unsigned int keylen,
+ char** reason)
+{
+ unsigned int digest_size = 0;
+
+ if (sigblock_len == 0 || keylen == 0) {
+ *reason = "null signature";
+ return sec_status_bogus;
+ }
+
+ switch(algo) {
+ case LDNS_DSA:
+ case LDNS_DSA_NSEC3:
+ *reason = _verify_nettle_dsa(buf, sigblock, sigblock_len, key, keylen);
+ if (*reason != NULL)
+ return sec_status_bogus;
+ else
+ return sec_status_secure;
+
+ case LDNS_RSASHA1:
+ case LDNS_RSASHA1_NSEC3:
+ digest_size = (digest_size ? digest_size : SHA1_DIGEST_SIZE);
+#ifdef USE_SHA2
+ case LDNS_RSASHA256:
+ digest_size = (digest_size ? digest_size : SHA256_DIGEST_SIZE);
+ case LDNS_RSASHA512:
+ digest_size = (digest_size ? digest_size : SHA512_DIGEST_SIZE);
+
+#endif
+ *reason = _verify_nettle_rsa(buf, digest_size, (char*)sigblock,
+ sigblock_len, key, keylen);
+ if (*reason != NULL)
+ return sec_status_bogus;
+ else
+ return sec_status_secure;
+
+#ifdef USE_ECDSA
+ case LDNS_ECDSAP256SHA256:
+ digest_size = (digest_size ? digest_size : SHA256_DIGEST_SIZE);
+ case LDNS_ECDSAP384SHA384:
+ digest_size = (digest_size ? digest_size : SHA384_DIGEST_SIZE);
+ *reason = _verify_nettle_ecdsa(buf, digest_size, sigblock,
+ sigblock_len, key, keylen);
+ if (*reason != NULL)
+ return sec_status_bogus;
+ else
+ return sec_status_secure;
+#endif
+ case LDNS_RSAMD5:
+ case LDNS_ECC_GOST:
+ default:
+ *reason = "unable to verify signature, unknown algorithm";
+ return sec_status_bogus;
+ }
+}
-#endif /* HAVE_SSL or HAVE_NSS */
+#endif /* HAVE_SSL or HAVE_NSS or HAVE_NETTLE */
diff --git a/contrib/unbound/validator/val_secalgo.h b/contrib/unbound/validator/val_secalgo.h
index 085fbc5..589f1f1 100644
--- a/contrib/unbound/validator/val_secalgo.h
+++ b/contrib/unbound/validator/val_secalgo.h
@@ -44,6 +44,21 @@
#define VALIDATOR_VAL_SECALGO_H
struct sldns_buffer;
+/** Return size of nsec3 hash algorithm, 0 if not supported */
+size_t nsec3_hash_algo_size_supported(int id);
+
+/**
+ * Hash a single hash call of an NSEC3 hash algorithm.
+ * Iterations and salt are done by the caller.
+ * @param algo: nsec3 hash algorithm.
+ * @param buf: the buffer to digest
+ * @param len: length of buffer to digest.
+ * @param res: result stored here (must have sufficient space).
+ * @return false on failure.
+*/
+int secalgo_nsec3_hash(int algo, unsigned char* buf, size_t len,
+ unsigned char* res);
+
/**
* Return size of DS digest according to its hash algorithm.
* @param algo: DS digest algo.
diff --git a/contrib/unbound/validator/val_sigcrypt.c b/contrib/unbound/validator/val_sigcrypt.c
index a2f1265..1dd07b4 100644
--- a/contrib/unbound/validator/val_sigcrypt.c
+++ b/contrib/unbound/validator/val_sigcrypt.c
@@ -57,7 +57,7 @@
#include "sldns/wire2str.h"
#include <ctype.h>
-#if !defined(HAVE_SSL) && !defined(HAVE_NSS)
+#if !defined(HAVE_SSL) && !defined(HAVE_NSS) && !defined(HAVE_NETTLE)
#error "Need crypto library to do digital signature cryptography"
#endif
diff --git a/contrib/unbound/validator/val_utils.h b/contrib/unbound/validator/val_utils.h
index cdb8769..051824a 100644
--- a/contrib/unbound/validator/val_utils.h
+++ b/contrib/unbound/validator/val_utils.h
@@ -391,7 +391,7 @@ int val_favorite_ds_algo(struct ub_packed_rrset_key* ds_rrset);
* Find DS denial message in cache. Saves new qstate allocation and allows
* the validator to use partial content which is not enough to construct a
* message for network (or user) consumption. Without SOA for example,
- * which is a common occurence in the unbound code since the referrals contain
+ * which is a common occurrence in the unbound code since the referrals contain
* NSEC/NSEC3 rrs without the SOA element, thus do not allow synthesis of a
* full negative reply, but do allow synthesis of sufficient proof.
* @param env: query env with caches and time.
diff --git a/contrib/unbound/validator/validator.c b/contrib/unbound/validator/validator.c
index f8b429e..db4383b 100644
--- a/contrib/unbound/validator/validator.c
+++ b/contrib/unbound/validator/validator.c
@@ -749,7 +749,7 @@ validate_nodata_response(struct module_env* env, struct val_env* ve,
/* Since we are here, there must be nothing in the ANSWER section to
* validate. */
/* (Note: CNAME/DNAME responses will not directly get here --
- * instead, they are chased down into indiviual CNAME validations,
+ * instead, they are chased down into individual CNAME validations,
* and at the end of the cname chain a POSITIVE, or CNAME_NOANSWER
* validation.) */
@@ -1597,7 +1597,7 @@ processFindKey(struct module_qstate* qstate, struct val_qstate* vq, int id)
target_key_name) != 0) {
/* check if there is a cache entry : pick up an NSEC if
* there is no DS, check if that NSEC has DS-bit unset, and
- * thus can disprove the secure delagation we seek.
+ * thus can disprove the secure delegation we seek.
* We can then use that NSEC even in the absence of a SOA
* record that would be required by the iterator to supply
* a completely protocol-correct response.
@@ -1829,7 +1829,7 @@ processValidate(struct module_qstate* qstate, struct val_qstate* vq,
* @return true if there is no DLV.
* false: processing is finished for the validator operate().
* This function may exit in three ways:
- * o no DLV (agressive cache), so insecure. (true)
+ * o no DLV (aggressive cache), so insecure. (true)
* o error - stop processing (false)
* o DLV lookup was started, stop processing (false)
*/
diff --git a/crypto/openssh/FREEBSD-tricks b/crypto/openssh/FREEBSD-tricks
deleted file mode 100644
index 480bffc..0000000
--- a/crypto/openssh/FREEBSD-tricks
+++ /dev/null
@@ -1,14 +0,0 @@
-# $FreeBSD$
-
-# Shell code to remove FreeBSD tags before merging
-grep -rl '\$Fre[e]BSD:' . | grep -v FREEBSD >tags
-cat tags | while read f ; do
- sed -i.orig -e '/\$Fre[e]BSD:/d' $f
-done
-
-# Shell + Perl code to add FreeBSD tags wherever an OpenBSD or Id tag occurs
-cat tags |
-xargs perl -n -i.orig -e 'print; s/\$(Id|OpenBSD): [^\$]*/\$FreeBSD/ && print'
-
-# Diff against vendor branch
-svn diff --no-diff-deleted --old=$FSVN/vendor-crypto/openssh/dist/ --new=.
diff --git a/crypto/openssh/FREEBSD-upgrade b/crypto/openssh/FREEBSD-upgrade
index 2a3dc7f..11f9bda 100644
--- a/crypto/openssh/FREEBSD-upgrade
+++ b/crypto/openssh/FREEBSD-upgrade
@@ -3,81 +3,97 @@
FreeBSD maintainer's guide to OpenSSH-portable
==============================================
-XXX
-XXX this needs a complete rewrite
-XXX svn merge from vendor branch, resolve conflicts manually
-XXX (see FREEBSD-tricks for tips on how to reduce conflicts)
-XXX run freebsd-configure.sh to generate config.h and krb5_config.h
-XXX svn diff Makefile.in to see if the Makefiles need adjusting
-XXX
+00) Make sure your mail spool has plenty of free space. It'll fill up
+ pretty fast once you're done with this checklist.
-0) Make sure your mail spool has plenty of free space. It'll fill up
- pretty fast once you're done with this checklist.
+01) Download the latest OpenSSH-portable tarball and signature from
+ OpenBSD (ftp://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/).
-1) Grab the latest OpenSSH-portable tarball from the OpenBSD FTP
- site (ftp://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/)
+02) Verify the signature:
-2) Unpack the tarball in a suitable directory.
+ $ gpg --verify openssh-X.YpZ.tar.gz.asc
- $ tar xf openssh-X.YpZ.tar.gz \
- -X /usr/src/crypto/openssh/FREEBSD-Xlist
+03) Unpack the tarball in a suitable directory:
-3) Remove trash:
+ $ tar xf openssh-X.YpZ.tar.gz
- Make sure -X took care of everything, and if it didn't, make sure
- to update FREEBSD-Xlist so you won't miss it the next time. A good
- way to do this is to run a test import and see if any new files
- show up:
+04) Copy to the vendor directory:
- $ cvs -n import src/crypto/openssh OPENSSH x | grep \^N
+ $ svn co svn+ssh://svn.freebsd.org/base/vendor-crypto/openssh/dist
+ $ rsync --archive --delete openssh-X.YpZ/ dist/
-4) Import the sources:
+05) Take care of added / deleted files:
- $ cvs import src/crypto/openssh OPENSSH OpenSSH_X_YpZ
+ $ svn rm $(svn stat dist | awk '$1 == "!" { print $2 }')
+ $ svn add --no-auto-props $(svn stat dist | awk '$1 == "?" { print $2 }')
-5) Resolve conflicts. Remember to bump the version number and
- addendum in version.h, and update the default value in
- ssh{,d}_config and ssh{,d}_config.5.
+06) Commit:
-6) Generate configure and config.h.in:
+ $ svn commit -m "Vendor import of OpenSSH X.YpZ." dist
- $ autoconf
- $ autoheader
+07) Tag:
- Note: this requires a recent version of autoconf, not autoconf213.
+ $ svn copy -m "Tag OpenSSH X.YpZ." \
+ svn+ssh://svn.freebsd.org/base/vendor-crypto/openssh/dist \
+ svn+ssh://svn.freebsd.org/base/vendor-crypto/openssh/X.YpZ
-7) Run configure with the appropriate arguments:
+08) Check out head and run the pre-merge script:
- $ ./configure --prefix=/usr --sysconfdir=/etc/ssh \
- --with-pam --with-tcp-wrappers --with-libedit \
- --with-ssl-engine
+ $ svn co svn+ssh://svn.freebsd.org/base/head
+ $ cd head/crypto/openssh
+ $ sh freebsd-pre-merge.sh
- This will regenerate config.h, which must be committed along with
- the rest.
+09) Merge from the vendor branch:
- Note that we don't want to configure OpenSSH for Kerberos using
- configure since we have to be able to turn it on or off depending
- on the value of MK_KERBEROS. Our Makefiles take care of this.
+ $ svn merge -cNNNNNN \^/vendor-crypto/openssh/dist .
-8) If source files have been added or removed, update the appropriate
- makefiles to reflect changes in the vendor's Makefile.in.
+0A) Resolve conflicts. Remember to bump the version addendum in
+ version.h, and update the default value in ssh{,d}_config and
+ ssh{,d}_config.5.
-9) Build libssh. Follow the instructions in ssh_namespace.h to get a
- list of new symbols. Update ssh_namespace.h, build everything,
- install and test.
+0B) Diff against the vendor branch:
-A) Build and test the pam_ssh PAM module. It gropes around libssh's
- internals and will break if something significant changes or if
- ssh_namespace.h is out of whack.
+ $ svn diff \^/vendor-crypto/openssh/dist .
-B) Re-commit everything on repoman (you *did* use a test repo for
- this, didn't you?)
+ Files that have modifications relative to the vendor code, and
+ only those files, must have the svn:keywords property set to
+ FreeBSD=%H and be listed in the 'keywords' file created by the
+ pre-merge script.
+
+0C) Run the post-merge script:
+
+ $ sh freebsd-post-merge.sh
+
+0D) Run the configure script:
+
+ $ sh freebsd-configure.sh
+
+0E) Check config.h very carefully.
+
+0F) If source files have been added or removed, update the appropriate
+ makefiles to reflect changes in the vendor's Makefile.in.
+
+10) Build libssh:
+
+ $ cd ../../secure/lib/libssh && make obj && make depend && make
+
+11) Follow the instructions in ssh_namespace.h to get a list of new
+ symbols, and them to ssh_namespace.h. Keep it sorted!
+
+12) Build and install world, reboot, test. Pay particular attention
+ to pam_ssh(8), which gropes inside libssh and will break if
+ something significant changes or if ssh_namespace.h is out of
+ whack.
+
+13) Commit, and hunker down for the inevitable storm of complaints.
An overview of FreeBSD changes to OpenSSH-portable
==================================================
+XXX This section is out of date
+
0) VersionAddendum
The SSH protocol allows for a human-readable version string of up
diff --git a/crypto/openssh/README.hpn b/crypto/openssh/README.hpn
deleted file mode 100644
index 674827f..0000000
--- a/crypto/openssh/README.hpn
+++ /dev/null
@@ -1,120 +0,0 @@
-Notes:
-
-NONE CIPHER:
- To use the NONE option you must have the NoneEnabled switch set on the server
- and you MUST have *both* NoneEnabled and NoneSwitch set to yes on the client.
- The NONE feature works with ALL ssh subsystems (as far as we can tell)
- as long as there is no tty allocated.
- If a user uses the -T switch to prevent a tty being created the NONE cipher
- will be disabled.
-
-
-PERFORMANCE:
- The performance increase will only be as good as the network and TCP stack
- tuning on the reciever side of the connection allows. As a rule of thumb a
- user will need at least 10Mb/s connection with a 100ms RTT to see a doubling
- of performance.
- The HPN-SSH home page http://www.psc.edu/networking/projects/hpn-ssh
- describes this in greater detail.
-
-
-BUFFER SIZES:
-- if HPN is disabled the receive buffer size will be set to the OpenSSH default
- of 64K.
-
-- if a HPN system connects to a non-HPN system the receive buffer will
- be set to the HPNBufferSize value. The default is 2MB but user adjustable.
-
-- If a HPN to HPN connection is established a number of different things might
- happen based on the user options and conditions.
-
- Conditions: HPNBufferSize NOT Set, TCPRcvBufPoll enabled, TCPRcvBuf NOT Set
- Result: HPN Buffer Size = up to 64MB
- This is the default state. The HPN buffer size will grow to a maximum of
- 64MB as the TCP receive buffer grows. The maximum HPN Buffer size of 64MB
- is geared towards 10GigE transcontinental connections.
-
- Conditions: HPNBufferSize NOT Set, TCPRcvBufPoll disabled, TCPRcvBuf NOT Set
- Result: HPN Buffer Size = TCP receive buffer value.
- Users on non-autotuning systesm should disable TCPRcvBufPoll in the
- ssh_cofig and sshd_config
-
- Conditions: HPNBufferSize SET, TCPRcvBufPoll disabled, TCPRcvBuf NOT Set
- Result: HPN Buffer Size = minmum of TCP receive buffer and HPNBufferSize.
- This would be the system defined TCP receive buffer (RWIN).
-
- Conditions: HPNBufferSize SET, TCPRcvBufPoll disabled, TCPRcvBuf SET
- Result: HPN Buffer Size = minmum of TCPRcvBuf and HPNBufferSize.
- Generally there is no need to set both.
-
- Conditions: HPNBufferSize SET, TCPRcvBufPoll enabled, TCPRcvBuf NOT Set
- Result: HPN Buffer Size = grows to HPNBufferSize
- The buffer will grow up to the maximum size specified here.
-
- Conditions: HPNBufferSize SET, TCPRcvBufPoll enabled, TCPRcvBuf SET
- Result: HPN Buffer Size = minmum of TCPRcvBuf and HPNBufferSize.
- Generally there is no need to set both of these, especially on autotuning
- systems. However, if the users wishes to override the autotuning this would
- be one way to do it.
-
- Conditions: HPNBufferSize NOT Set, TCPRcvBufPoll enabled, TCPRcvBuf SET
- Result: HPN Buffer Size = TCPRcvBuf.
- This will override autotuning and set the TCP recieve buffer to the user
- defined value.
-
-
-HPN SPECIFIC CONFIGURATION OPTIONS:
-
-- HPNDisabled=[yes/no] client/server
- In some situations, such as transfers on a local area network, the impact
- of the HPN code produces a net decrease in performance. In these cases it is
- helpful to disable the HPN functionality. By default HPNDisabled is set to no.
-
-- HPNBufferSize=[int]KB client/server
- This is the default buffer size the HPN functionality uses when interacting
- with non-HPN SSH installations. Conceptually this is similar to the TcpRcvBuf
- option as applied to the internal SSH flow control. This value can range from
- 1KB to 64MB (1-65536). Use of oversized or undersized buffers can cause
- performance problems depending on the roud trip time of the network path.
- The default size of this buffer is 2MB.
-
-- TcpRcvBufPoll=[yes/no] client/server
- Enable or disable the polling of the TCP receive buffer through the life
- of the connection. You would want to make sure that this option is enabled
- for systems making use of autotuning kernels (linux 2.4.24+, 2.6, MS Vista,
- FreeBSD 7.x and later). Default is yes.
-
-- TcpRcvBuf=[int]KB client
- Set the TCP socket receive buffer to n Kilobytes. It can be set up to the
- maximum socket size allowed by the system. This is useful in situations where
- the TCP receive window is set low but the maximum buffer size is set higher
- (as is typical). This works on a per TCP connection basis. You can also use
- this to artifically limit the transfer rate of the connection. In these cases
- the throughput will be no more than n/RTT. The minimum buffer size is 1KB.
- Default is the current system wide TCP receive buffer size.
-
-- NoneEnabled=[yes/no] client/server
- Enable or disable the use of the None cipher. Care must always be used when
- enabling this as it will allow users to send data in the clear. However, it
- is important to note that authentication information remains encrypted even
- if this option is enabled. Set to no by default.
-
-- NoneSwitch=[yes/no] client
- Switch the encryption cipher being used to the None cipher after
- authentication takes place. NoneEnabled must be enabled on both the client
- and server side of the connection. When the connection switches to the NONE
- cipher a warning is sent to STDERR. The connection attempt will fail with an
- error if a client requests a NoneSwitch from the server that does not
- explicitly have NoneEnabled set to yes.
- Note: The NONE cipher cannot be used in interactive (shell) sessions and it
- will fail silently. Set to no by default.
-
-
-CREDITS:
-
- This patch was conceived, designed, and led by Chris Rapier (rapier@psc.edu)
- The majority of the actual coding for versions up to HPN12v1 was performed
- by Michael Stevens (mstevens@andrew.cmu.edu).
- The MT-AES-CTR cipher was implemented by Ben Bennet (ben@psc.edu).
- This work was financed, in part, by Cisco System, Inc., the National Library
- of Medicine, and the National Science Foundation.
diff --git a/crypto/openssh/auth-krb5.c b/crypto/openssh/auth-krb5.c
index 6c62bdf..b97fcf1 100644
--- a/crypto/openssh/auth-krb5.c
+++ b/crypto/openssh/auth-krb5.c
@@ -2,7 +2,7 @@
/*
* Kerberos v5 authentication and ticket-passing routines.
*
- * $FreeBSD: src/crypto/openssh/auth-krb5.c,v 1.6 2001/02/13 16:58:04 assar Exp $
+ * $FreeBSD$
*/
/*
* Copyright (c) 2002 Daniel Kouril. All rights reserved.
diff --git a/crypto/openssh/buffer.c b/crypto/openssh/buffer.c
index 95bbf0c..d240f67 100644
--- a/crypto/openssh/buffer.c
+++ b/crypto/openssh/buffer.c
@@ -1,5 +1,4 @@
/* $OpenBSD: buffer.c,v 1.35 2014/02/02 03:44:31 djm Exp $ */
-/* $FreeBSD$ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -27,7 +26,7 @@
#include "log.h"
#define BUFFER_MAX_CHUNK 0x100000
-#define BUFFER_MAX_LEN 0x4000000 /* 64MB */
+#define BUFFER_MAX_LEN 0xa00000
#define BUFFER_ALLOCSZ 0x008000
/* Initializes the buffer structure. */
@@ -167,13 +166,6 @@ buffer_len(const Buffer *buffer)
return buffer->end - buffer->offset;
}
-/* Returns the maximum number of bytes of data that may be in the buffer. */
-u_int
-buffer_get_max_len(void)
-{
- return (BUFFER_MAX_LEN);
-}
-
/* Gets data from the beginning of the buffer. */
int
diff --git a/crypto/openssh/buffer.h b/crypto/openssh/buffer.h
index 39e04f9..7df8a38 100644
--- a/crypto/openssh/buffer.h
+++ b/crypto/openssh/buffer.h
@@ -1,5 +1,4 @@
/* $OpenBSD: buffer.h,v 1.23 2014/01/12 08:13:13 djm Exp $ */
-/* $FreeBSD$ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
@@ -47,8 +46,6 @@ int buffer_get_ret(Buffer *, void *, u_int);
int buffer_consume_ret(Buffer *, u_int);
int buffer_consume_end_ret(Buffer *, u_int);
-u_int buffer_get_max_len(void);
-
#include <openssl/bn.h>
void buffer_put_bignum(Buffer *, const BIGNUM *);
diff --git a/crypto/openssh/channels.c b/crypto/openssh/channels.c
index 73e8896..9efe89c 100644
--- a/crypto/openssh/channels.c
+++ b/crypto/openssh/channels.c
@@ -1,5 +1,4 @@
/* $OpenBSD: channels.c,v 1.331 2014/02/26 20:29:29 djm Exp $ */
-/* $FreeBSD$ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -174,11 +173,6 @@ static void port_open_helper(Channel *c, char *rtype);
static int connect_next(struct channel_connect *);
static void channel_connect_ctx_free(struct channel_connect *);
-/* -- HPN */
-
-static int hpn_disabled = 0;
-static u_int buffer_size = CHAN_HPN_MIN_WINDOW_DEFAULT;
-
/* -- channel core */
Channel *
@@ -325,7 +319,6 @@ channel_new(char *ctype, int type, int rfd, int wfd, int efd,
c->self = found;
c->type = type;
c->ctype = ctype;
- c->dynamic_window = 0;
c->local_window = window;
c->local_window_max = window;
c->local_consumed = 0;
@@ -826,45 +819,10 @@ channel_pre_open_13(Channel *c, fd_set *readset, fd_set *writeset)
FD_SET(c->sock, writeset);
}
-static u_int
-channel_tcpwinsz(void)
-{
- u_int32_t tcpwinsz;
- socklen_t optsz;
- int ret, sd;
- u_int maxlen;
-
- /* If we are not on a socket return 128KB. */
- if (!packet_connection_is_on_socket())
- return (128 * 1024);
-
- tcpwinsz = 0;
- optsz = sizeof(tcpwinsz);
- sd = packet_get_connection_in();
- ret = getsockopt(sd, SOL_SOCKET, SO_RCVBUF, &tcpwinsz, &optsz);
-
- /* Return no more than the maximum buffer size. */
- maxlen = buffer_get_max_len();
- if ((ret == 0) && tcpwinsz > maxlen)
- tcpwinsz = maxlen;
- /* In case getsockopt() failed return a minimum. */
- if (tcpwinsz == 0)
- tcpwinsz = CHAN_TCP_WINDOW_DEFAULT;
- debug2("tcpwinsz: %d for connection: %d", tcpwinsz, sd);
- return (tcpwinsz);
-}
-
static void
channel_pre_open(Channel *c, fd_set *readset, fd_set *writeset)
{
- u_int limit;
-
- /* Check buffer limits. */
- if (!c->tcpwinsz || c->dynamic_window > 0)
- c->tcpwinsz = channel_tcpwinsz();
-
- limit = MIN(compat20 ? c->remote_window : packet_get_maxsize(),
- 2 * c->tcpwinsz);
+ u_int limit = compat20 ? c->remote_window : packet_get_maxsize();
if (c->istate == CHAN_INPUT_OPEN &&
limit > 0 &&
@@ -1857,25 +1815,14 @@ channel_check_window(Channel *c)
c->local_maxpacket*3) ||
c->local_window < c->local_window_max/2) &&
c->local_consumed > 0) {
- u_int addition = 0;
-
- /* Adjust max window size if we are in a dynamic environment. */
- if (c->dynamic_window && c->tcpwinsz > c->local_window_max) {
- /*
- * Grow the window somewhat aggressively to maintain
- * pressure.
- */
- addition = 1.5 * (c->tcpwinsz - c->local_window_max);
- c->local_window_max += addition;
- }
packet_start(SSH2_MSG_CHANNEL_WINDOW_ADJUST);
packet_put_int(c->remote_id);
- packet_put_int(c->local_consumed + addition);
+ packet_put_int(c->local_consumed);
packet_send();
debug2("channel %d: window %d sent adjust %d",
c->self, c->local_window,
c->local_consumed);
- c->local_window += c->local_consumed + addition;
+ c->local_window += c->local_consumed;
c->local_consumed = 0;
}
return 1;
@@ -2739,14 +2686,6 @@ channel_set_af(int af)
IPv4or6 = af;
}
-void
-channel_set_hpn(int disabled, u_int buf_size)
-{
- hpn_disabled = disabled;
- buffer_size = buf_size;
- debug("HPN Disabled: %d, HPN Buffer Size: %d",
- hpn_disabled, buffer_size);
-}
/*
* Determine whether or not a port forward listens to loopback, the
@@ -2924,18 +2863,10 @@ channel_setup_fwd_listener(int type, const char *listen_addr,
*allocated_listen_port);
}
- /*
- * Allocate a channel number for the socket. Explicitly test
- * for hpn disabled option. If true use smaller window size.
- */
- if (hpn_disabled)
- c = channel_new("port listener", type, sock, sock, -1,
- CHAN_TCP_WINDOW_DEFAULT, CHAN_TCP_PACKET_DEFAULT,
- 0, "port listener", 1);
- else
- c = channel_new("port listener", type, sock, sock, -1,
- buffer_size, CHAN_TCP_PACKET_DEFAULT,
- 0, "port listener", 1);
+ /* Allocate a channel number for the socket. */
+ c = channel_new("port listener", type, sock, sock, -1,
+ CHAN_TCP_WINDOW_DEFAULT, CHAN_TCP_PACKET_DEFAULT,
+ 0, "port listener", 1);
c->path = xstrdup(host);
c->host_port = port_to_connect;
c->listening_addr = addr == NULL ? NULL : xstrdup(addr);
@@ -3583,16 +3514,10 @@ x11_create_display_inet(int x11_display_offset, int x11_use_localhost,
*chanids = xcalloc(num_socks + 1, sizeof(**chanids));
for (n = 0; n < num_socks; n++) {
sock = socks[n];
- if (hpn_disabled)
- nc = channel_new("x11 listener",
- SSH_CHANNEL_X11_LISTENER, sock, sock, -1,
- CHAN_X11_WINDOW_DEFAULT, CHAN_X11_PACKET_DEFAULT,
- 0, "X11 inet listener", 1);
- else
- nc = channel_new("x11 listener",
- SSH_CHANNEL_X11_LISTENER, sock, sock, -1,
- buffer_size, CHAN_X11_PACKET_DEFAULT,
- 0, "X11 inet listener", 1);
+ nc = channel_new("x11 listener",
+ SSH_CHANNEL_X11_LISTENER, sock, sock, -1,
+ CHAN_X11_WINDOW_DEFAULT, CHAN_X11_PACKET_DEFAULT,
+ 0, "X11 inet listener", 1);
nc->single_connection = single_connection;
(*chanids)[n] = nc->self;
}
diff --git a/crypto/openssh/channels.h b/crypto/openssh/channels.h
index 68ebf09..4fab9d7 100644
--- a/crypto/openssh/channels.h
+++ b/crypto/openssh/channels.h
@@ -1,5 +1,4 @@
/* $OpenBSD: channels.h,v 1.113 2013/06/07 15:37:52 dtucker Exp $ */
-/* $FreeBSD$ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
@@ -133,8 +132,6 @@ struct Channel {
u_int local_window_max;
u_int local_consumed;
u_int local_maxpacket;
- u_int tcpwinsz;
- int dynamic_window;
int extended_usage;
int single_connection;
@@ -176,7 +173,6 @@ struct Channel {
#define CHAN_TCP_WINDOW_DEFAULT (64*CHAN_TCP_PACKET_DEFAULT)
#define CHAN_X11_PACKET_DEFAULT (16*1024)
#define CHAN_X11_WINDOW_DEFAULT (4*CHAN_X11_PACKET_DEFAULT)
-#define CHAN_HPN_MIN_WINDOW_DEFAULT (2*1024*1024)
/* possible input states */
#define CHAN_INPUT_OPEN 0
@@ -310,8 +306,4 @@ void chan_rcvd_ieof(Channel *);
void chan_write_failed(Channel *);
void chan_obuf_empty(Channel *);
-/* hpn handler */
-
-void channel_set_hpn(int, u_int);
-
#endif
diff --git a/crypto/openssh/cipher.c b/crypto/openssh/cipher.c
index b1b18a9..53d9b4f 100644
--- a/crypto/openssh/cipher.c
+++ b/crypto/openssh/cipher.c
@@ -1,5 +1,4 @@
/* $OpenBSD: cipher.c,v 1.97 2014/02/07 06:55:54 djm Exp $ */
-/* $FreeBSD$ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -225,12 +224,7 @@ ciphers_valid(const char *names)
for ((p = strsep(&cp, CIPHER_SEP)); p && *p != '\0';
(p = strsep(&cp, CIPHER_SEP))) {
c = cipher_by_name(p);
-#ifdef NONE_CIPHER_ENABLED
- if (c == NULL || (c->number != SSH_CIPHER_SSH2 &&
- c->number != SSH_CIPHER_NONE)) {
-#else
- if (c == NULL || (c->number != SSH_CIPHER_SSH2)) {
-#endif
+ if (c == NULL || c->number != SSH_CIPHER_SSH2) {
debug("bad cipher %s [%s]", p, names);
free(cipher_list);
return 0;
@@ -485,9 +479,6 @@ cipher_get_keyiv(CipherContext *cc, u_char *iv, u_int len)
}
switch (c->number) {
-#ifdef NONE_CIPHER_ENABLED
- case SSH_CIPHER_NONE:
-#endif
case SSH_CIPHER_SSH2:
case SSH_CIPHER_DES:
case SSH_CIPHER_BLOWFISH:
@@ -527,9 +518,6 @@ cipher_set_keyiv(CipherContext *cc, u_char *iv)
return;
switch (c->number) {
-#ifdef NONE_CIPHER_ENABLED
- case SSH_CIPHER_NONE:
-#endif
case SSH_CIPHER_SSH2:
case SSH_CIPHER_DES:
case SSH_CIPHER_BLOWFISH:
diff --git a/crypto/openssh/clientloop.c b/crypto/openssh/clientloop.c
index 3946a9f..59ad3a2 100644
--- a/crypto/openssh/clientloop.c
+++ b/crypto/openssh/clientloop.c
@@ -1,5 +1,4 @@
/* $OpenBSD: clientloop.c,v 1.258 2014/02/02 03:44:31 djm Exp $ */
-/* $FreeBSD$ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -1892,14 +1891,9 @@ client_request_x11(const char *request_type, int rchan)
sock = x11_connect_display();
if (sock < 0)
return NULL;
- if (options.hpn_disabled)
- c = channel_new("x11", SSH_CHANNEL_X11_OPEN, sock, sock, -1,
- CHAN_TCP_WINDOW_DEFAULT, CHAN_X11_PACKET_DEFAULT,
- 0, "x11", 1);
- else
- c = channel_new("x11", SSH_CHANNEL_X11_OPEN, sock, sock, -1,
- options.hpn_buffer_size, CHAN_X11_PACKET_DEFAULT,
- 0, "x11", 1);
+ c = channel_new("x11",
+ SSH_CHANNEL_X11_OPEN, sock, sock, -1,
+ CHAN_TCP_WINDOW_DEFAULT, CHAN_X11_PACKET_DEFAULT, 0, "x11", 1);
c->force_drain = 1;
return c;
}
@@ -1919,16 +1913,10 @@ client_request_agent(const char *request_type, int rchan)
sock = ssh_get_authentication_socket();
if (sock < 0)
return NULL;
- if (options.hpn_disabled)
- c = channel_new("authentication agent connection",
- SSH_CHANNEL_OPEN, sock, sock, -1,
- CHAN_X11_WINDOW_DEFAULT, CHAN_TCP_PACKET_DEFAULT, 0,
- "authentication agent connection", 1);
- else
- c = channel_new("authentication agent connection",
- SSH_CHANNEL_OPEN, sock, sock, -1,
- options.hpn_buffer_size, options.hpn_buffer_size, 0,
- "authentication agent connection", 1);
+ c = channel_new("authentication agent connection",
+ SSH_CHANNEL_OPEN, sock, sock, -1,
+ CHAN_X11_WINDOW_DEFAULT, CHAN_TCP_PACKET_DEFAULT, 0,
+ "authentication agent connection", 1);
c->force_drain = 1;
return c;
}
@@ -1955,14 +1943,8 @@ client_request_tun_fwd(int tun_mode, int local_tun, int remote_tun)
return -1;
}
- if (options.hpn_disabled)
- c = channel_new("tun", SSH_CHANNEL_OPENING, fd, fd, -1,
- CHAN_TCP_WINDOW_DEFAULT, CHAN_TCP_PACKET_DEFAULT,
- 0, "tun", 1);
- else
- c = channel_new("tun", SSH_CHANNEL_OPENING, fd, fd, -1,
- options.hpn_buffer_size, CHAN_TCP_PACKET_DEFAULT,
- 0, "tun", 1);
+ c = channel_new("tun", SSH_CHANNEL_OPENING, fd, fd, -1,
+ CHAN_TCP_WINDOW_DEFAULT, CHAN_TCP_PACKET_DEFAULT, 0, "tun", 1);
c->datagram = 1;
#if defined(SSH_TUN_FILTER)
diff --git a/crypto/openssh/compat.c b/crypto/openssh/compat.c
index a0ea2e7..2709dc5 100644
--- a/crypto/openssh/compat.c
+++ b/crypto/openssh/compat.c
@@ -1,5 +1,4 @@
/* $OpenBSD: compat.c,v 1.82 2013/12/30 23:52:27 djm Exp $ */
-/* $FreeBSD$ */
/*
* Copyright (c) 1999, 2000, 2001, 2002 Markus Friedl. All rights reserved.
*
@@ -178,16 +177,6 @@ compat_datafellows(const char *version)
datafellows = check[i].bugs;
debug("match: %s pat %s compat 0x%08x",
version, check[i].pat, datafellows);
- /*
- * Check to see if the remote side is OpenSSH and not
- * HPN. It is utterly strange to check it from the
- * version string and expose the option that way.
- */
- if (strstr(version,"OpenSSH") != NULL &&
- strstr(version,"hpn") == NULL) {
- datafellows |= SSH_BUG_LARGEWINDOW;
- debug("Remote is not HPN-aware");
- }
return;
}
}
diff --git a/crypto/openssh/compat.h b/crypto/openssh/compat.h
index 4af221f..a6c3f3d 100644
--- a/crypto/openssh/compat.h
+++ b/crypto/openssh/compat.h
@@ -1,5 +1,4 @@
/* $OpenBSD: compat.h,v 1.44 2013/12/30 23:52:27 djm Exp $ */
-/* $FreeBSD$ */
/*
* Copyright (c) 1999, 2000, 2001 Markus Friedl. All rights reserved.
@@ -62,8 +61,6 @@
#define SSH_BUG_DYNAMIC_RPORT 0x08000000
#define SSH_BUG_CURVE25519PAD 0x10000000
-#define SSH_BUG_LARGEWINDOW 0x80000000
-
void enable_compat13(void);
void enable_compat20(void);
void compat_datafellows(const char *);
diff --git a/crypto/openssh/config.h b/crypto/openssh/config.h
index af6466e..77c8e18 100644
--- a/crypto/openssh/config.h
+++ b/crypto/openssh/config.h
@@ -1681,6 +1681,11 @@
/* Define if xauth is found in your path */
/* #undef XAUTH_PATH */
+/* Enable large inode numbers on Mac OS X 10.5. */
+#ifndef _DARWIN_USE_64_BIT_INODE
+# define _DARWIN_USE_64_BIT_INODE 1
+#endif
+
/* Number of bits in a file offset, on hosts where this is settable. */
/* #undef _FILE_OFFSET_BITS */
diff --git a/crypto/openssh/config.h.in b/crypto/openssh/config.h.in
deleted file mode 100644
index 0401ad1..0000000
--- a/crypto/openssh/config.h.in
+++ /dev/null
@@ -1,1708 +0,0 @@
-/* config.h.in. Generated from configure.ac by autoheader. */
-
-/* Define if building universal (internal helper macro) */
-#undef AC_APPLE_UNIVERSAL_BUILD
-
-/* Define if you have a getaddrinfo that fails for the all-zeros IPv6 address
- */
-#undef AIX_GETNAMEINFO_HACK
-
-/* Define if your AIX loginfailed() function takes 4 arguments (AIX >= 5.2) */
-#undef AIX_LOGINFAILED_4ARG
-
-/* System only supports IPv4 audit records */
-#undef AU_IPv4
-
-/* Define if your resolver libs need this for getrrsetbyname */
-#undef BIND_8_COMPAT
-
-/* The system has incomplete BSM API */
-#undef BROKEN_BSM_API
-
-/* Define if cmsg_type is not passed correctly */
-#undef BROKEN_CMSG_TYPE
-
-/* getaddrinfo is broken (if present) */
-#undef BROKEN_GETADDRINFO
-
-/* getgroups(0,NULL) will return -1 */
-#undef BROKEN_GETGROUPS
-
-/* FreeBSD glob does not do what we need */
-#undef BROKEN_GLOB
-
-/* Define if you system's inet_ntoa is busted (e.g. Irix gcc issue) */
-#undef BROKEN_INET_NTOA
-
-/* ia_uinfo routines not supported by OS yet */
-#undef BROKEN_LIBIAF
-
-/* Ultrix mmap can't map files */
-#undef BROKEN_MMAP
-
-/* Define if your struct dirent expects you to allocate extra space for d_name
- */
-#undef BROKEN_ONE_BYTE_DIRENT_D_NAME
-
-/* Can't do comparisons on readv */
-#undef BROKEN_READV_COMPARISON
-
-/* NetBSD read function is sometimes redirected, breaking atomicio comparisons
- against it */
-#undef BROKEN_READ_COMPARISON
-
-/* Define if you have a broken realpath. */
-#undef BROKEN_REALPATH
-
-/* Needed for NeXT */
-#undef BROKEN_SAVED_UIDS
-
-/* Define if your setregid() is broken */
-#undef BROKEN_SETREGID
-
-/* Define if your setresgid() is broken */
-#undef BROKEN_SETRESGID
-
-/* Define if your setresuid() is broken */
-#undef BROKEN_SETRESUID
-
-/* Define if your setreuid() is broken */
-#undef BROKEN_SETREUID
-
-/* LynxOS has broken setvbuf() implementation */
-#undef BROKEN_SETVBUF
-
-/* QNX shadow support is broken */
-#undef BROKEN_SHADOW_EXPIRE
-
-/* Define if your snprintf is busted */
-#undef BROKEN_SNPRINTF
-
-/* FreeBSD strnvis argument order is swapped compared to OpenBSD */
-#undef BROKEN_STRNVIS
-
-/* tcgetattr with ICANON may hang */
-#undef BROKEN_TCGETATTR_ICANON
-
-/* updwtmpx is broken (if present) */
-#undef BROKEN_UPDWTMPX
-
-/* Define if you have BSD auth support */
-#undef BSD_AUTH
-
-/* Define if you want to specify the path to your lastlog file */
-#undef CONF_LASTLOG_FILE
-
-/* Define if you want to specify the path to your utmp file */
-#undef CONF_UTMP_FILE
-
-/* Define if you want to specify the path to your wtmpx file */
-#undef CONF_WTMPX_FILE
-
-/* Define if you want to specify the path to your wtmp file */
-#undef CONF_WTMP_FILE
-
-/* Define if your platform needs to skip post auth file descriptor passing */
-#undef DISABLE_FD_PASSING
-
-/* Define if you don't want to use lastlog */
-#undef DISABLE_LASTLOG
-
-/* Define if you don't want to use your system's login() call */
-#undef DISABLE_LOGIN
-
-/* Define if you don't want to use pututline() etc. to write [uw]tmp */
-#undef DISABLE_PUTUTLINE
-
-/* Define if you don't want to use pututxline() etc. to write [uw]tmpx */
-#undef DISABLE_PUTUTXLINE
-
-/* Define if you want to disable shadow passwords */
-#undef DISABLE_SHADOW
-
-/* Define if you don't want to use utmp */
-#undef DISABLE_UTMP
-
-/* Define if you don't want to use utmpx */
-#undef DISABLE_UTMPX
-
-/* Define if you don't want to use wtmp */
-#undef DISABLE_WTMP
-
-/* Define if you don't want to use wtmpx */
-#undef DISABLE_WTMPX
-
-/* Enable for PKCS#11 support */
-#undef ENABLE_PKCS11
-
-/* File names may not contain backslash characters */
-#undef FILESYSTEM_NO_BACKSLASH
-
-/* fsid_t has member val */
-#undef FSID_HAS_VAL
-
-/* fsid_t has member __val */
-#undef FSID_HAS___VAL
-
-/* Define to 1 if the `getpgrp' function requires zero arguments. */
-#undef GETPGRP_VOID
-
-/* Conflicting defs for getspnam */
-#undef GETSPNAM_CONFLICTING_DEFS
-
-/* Define if your system glob() function has the GLOB_ALTDIRFUNC extension */
-#undef GLOB_HAS_ALTDIRFUNC
-
-/* Define if your system glob() function has gl_matchc options in glob_t */
-#undef GLOB_HAS_GL_MATCHC
-
-/* Define if your system glob() function has gl_statv options in glob_t */
-#undef GLOB_HAS_GL_STATV
-
-/* Define this if you want GSSAPI support in the version 2 protocol */
-#undef GSSAPI
-
-/* Define if you want to use shadow password expire field */
-#undef HAS_SHADOW_EXPIRE
-
-/* Define if your system uses access rights style file descriptor passing */
-#undef HAVE_ACCRIGHTS_IN_MSGHDR
-
-/* Define if you have ut_addr in utmp.h */
-#undef HAVE_ADDR_IN_UTMP
-
-/* Define if you have ut_addr in utmpx.h */
-#undef HAVE_ADDR_IN_UTMPX
-
-/* Define if you have ut_addr_v6 in utmp.h */
-#undef HAVE_ADDR_V6_IN_UTMP
-
-/* Define if you have ut_addr_v6 in utmpx.h */
-#undef HAVE_ADDR_V6_IN_UTMPX
-
-/* Define to 1 if you have the `arc4random' function. */
-#undef HAVE_ARC4RANDOM
-
-/* Define to 1 if you have the `arc4random_buf' function. */
-#undef HAVE_ARC4RANDOM_BUF
-
-/* Define to 1 if you have the `arc4random_stir' function. */
-#undef HAVE_ARC4RANDOM_STIR
-
-/* Define to 1 if you have the `arc4random_uniform' function. */
-#undef HAVE_ARC4RANDOM_UNIFORM
-
-/* Define to 1 if you have the `asprintf' function. */
-#undef HAVE_ASPRINTF
-
-/* OpenBSD's gcc has bounded */
-#undef HAVE_ATTRIBUTE__BOUNDED__
-
-/* Have attribute nonnull */
-#undef HAVE_ATTRIBUTE__NONNULL__
-
-/* OpenBSD's gcc has sentinel */
-#undef HAVE_ATTRIBUTE__SENTINEL__
-
-/* Define to 1 if you have the `aug_get_machine' function. */
-#undef HAVE_AUG_GET_MACHINE
-
-/* Define to 1 if you have the `b64_ntop' function. */
-#undef HAVE_B64_NTOP
-
-/* Define to 1 if you have the `b64_pton' function. */
-#undef HAVE_B64_PTON
-
-/* Define if you have the basename function. */
-#undef HAVE_BASENAME
-
-/* Define to 1 if you have the `bcopy' function. */
-#undef HAVE_BCOPY
-
-/* Define to 1 if you have the `bcrypt_pbkdf' function. */
-#undef HAVE_BCRYPT_PBKDF
-
-/* Define to 1 if you have the `bindresvport_sa' function. */
-#undef HAVE_BINDRESVPORT_SA
-
-/* Define to 1 if you have the `blf_enc' function. */
-#undef HAVE_BLF_ENC
-
-/* Define to 1 if you have the <blf.h> header file. */
-#undef HAVE_BLF_H
-
-/* Define to 1 if you have the `Blowfish_expand0state' function. */
-#undef HAVE_BLOWFISH_EXPAND0STATE
-
-/* Define to 1 if you have the `Blowfish_expandstate' function. */
-#undef HAVE_BLOWFISH_EXPANDSTATE
-
-/* Define to 1 if you have the `Blowfish_initstate' function. */
-#undef HAVE_BLOWFISH_INITSTATE
-
-/* Define to 1 if you have the `Blowfish_stream2word' function. */
-#undef HAVE_BLOWFISH_STREAM2WORD
-
-/* Define to 1 if you have the `BN_is_prime_ex' function. */
-#undef HAVE_BN_IS_PRIME_EX
-
-/* Define to 1 if you have the <bsd/libutil.h> header file. */
-#undef HAVE_BSD_LIBUTIL_H
-
-/* Define to 1 if you have the <bsm/audit.h> header file. */
-#undef HAVE_BSM_AUDIT_H
-
-/* Define to 1 if you have the <bstring.h> header file. */
-#undef HAVE_BSTRING_H
-
-/* Define to 1 if you have the `cap_rights_limit' function. */
-#undef HAVE_CAP_RIGHTS_LIMIT
-
-/* Define to 1 if you have the `clock' function. */
-#undef HAVE_CLOCK
-
-/* Have clock_gettime */
-#undef HAVE_CLOCK_GETTIME
-
-/* define if you have clock_t data type */
-#undef HAVE_CLOCK_T
-
-/* Define to 1 if you have the `closefrom' function. */
-#undef HAVE_CLOSEFROM
-
-/* Define if gai_strerror() returns const char * */
-#undef HAVE_CONST_GAI_STRERROR_PROTO
-
-/* Define if your system uses ancillary data style file descriptor passing */
-#undef HAVE_CONTROL_IN_MSGHDR
-
-/* Define to 1 if you have the `crypt' function. */
-#undef HAVE_CRYPT
-
-/* Define to 1 if you have the <crypto/sha2.h> header file. */
-#undef HAVE_CRYPTO_SHA2_H
-
-/* Define to 1 if you have the <crypt.h> header file. */
-#undef HAVE_CRYPT_H
-
-/* Define if you are on Cygwin */
-#undef HAVE_CYGWIN
-
-/* Define if your libraries define daemon() */
-#undef HAVE_DAEMON
-
-/* Define to 1 if you have the declaration of `authenticate', and to 0 if you
- don't. */
-#undef HAVE_DECL_AUTHENTICATE
-
-/* Define to 1 if you have the declaration of `GLOB_NOMATCH', and to 0 if you
- don't. */
-#undef HAVE_DECL_GLOB_NOMATCH
-
-/* Define to 1 if you have the declaration of `GSS_C_NT_HOSTBASED_SERVICE',
- and to 0 if you don't. */
-#undef HAVE_DECL_GSS_C_NT_HOSTBASED_SERVICE
-
-/* Define to 1 if you have the declaration of `howmany', and to 0 if you
- don't. */
-#undef HAVE_DECL_HOWMANY
-
-/* Define to 1 if you have the declaration of `h_errno', and to 0 if you
- don't. */
-#undef HAVE_DECL_H_ERRNO
-
-/* Define to 1 if you have the declaration of `loginfailed', and to 0 if you
- don't. */
-#undef HAVE_DECL_LOGINFAILED
-
-/* Define to 1 if you have the declaration of `loginrestrictions', and to 0 if
- you don't. */
-#undef HAVE_DECL_LOGINRESTRICTIONS
-
-/* Define to 1 if you have the declaration of `loginsuccess', and to 0 if you
- don't. */
-#undef HAVE_DECL_LOGINSUCCESS
-
-/* Define to 1 if you have the declaration of `MAXSYMLINKS', and to 0 if you
- don't. */
-#undef HAVE_DECL_MAXSYMLINKS
-
-/* Define to 1 if you have the declaration of `NFDBITS', and to 0 if you
- don't. */
-#undef HAVE_DECL_NFDBITS
-
-/* Define to 1 if you have the declaration of `offsetof', and to 0 if you
- don't. */
-#undef HAVE_DECL_OFFSETOF
-
-/* Define to 1 if you have the declaration of `O_NONBLOCK', and to 0 if you
- don't. */
-#undef HAVE_DECL_O_NONBLOCK
-
-/* Define to 1 if you have the declaration of `passwdexpired', and to 0 if you
- don't. */
-#undef HAVE_DECL_PASSWDEXPIRED
-
-/* Define to 1 if you have the declaration of `setauthdb', and to 0 if you
- don't. */
-#undef HAVE_DECL_SETAUTHDB
-
-/* Define to 1 if you have the declaration of `SHUT_RD', and to 0 if you
- don't. */
-#undef HAVE_DECL_SHUT_RD
-
-/* Define to 1 if you have the declaration of `writev', and to 0 if you don't.
- */
-#undef HAVE_DECL_WRITEV
-
-/* Define to 1 if you have the declaration of `_getlong', and to 0 if you
- don't. */
-#undef HAVE_DECL__GETLONG
-
-/* Define to 1 if you have the declaration of `_getshort', and to 0 if you
- don't. */
-#undef HAVE_DECL__GETSHORT
-
-/* Define to 1 if you have the `DES_crypt' function. */
-#undef HAVE_DES_CRYPT
-
-/* Define if you have /dev/ptmx */
-#undef HAVE_DEV_PTMX
-
-/* Define if you have /dev/ptc */
-#undef HAVE_DEV_PTS_AND_PTC
-
-/* Define to 1 if you have the <dirent.h> header file. */
-#undef HAVE_DIRENT_H
-
-/* Define to 1 if you have the `dirfd' function. */
-#undef HAVE_DIRFD
-
-/* Define to 1 if you have the `dirname' function. */
-#undef HAVE_DIRNAME
-
-/* Define to 1 if you have the `DSA_generate_parameters_ex' function. */
-#undef HAVE_DSA_GENERATE_PARAMETERS_EX
-
-/* Define to 1 if you have the <elf.h> header file. */
-#undef HAVE_ELF_H
-
-/* Define to 1 if you have the `endgrent' function. */
-#undef HAVE_ENDGRENT
-
-/* Define to 1 if you have the <endian.h> header file. */
-#undef HAVE_ENDIAN_H
-
-/* Define to 1 if you have the `endutent' function. */
-#undef HAVE_ENDUTENT
-
-/* Define to 1 if you have the `endutxent' function. */
-#undef HAVE_ENDUTXENT
-
-/* Define if your system has /etc/default/login */
-#undef HAVE_ETC_DEFAULT_LOGIN
-
-/* Define if libcrypto has EVP_CIPHER_CTX_ctrl */
-#undef HAVE_EVP_CIPHER_CTX_CTRL
-
-/* Define to 1 if you have the `EVP_DigestFinal_ex' function. */
-#undef HAVE_EVP_DIGESTFINAL_EX
-
-/* Define to 1 if you have the `EVP_DigestInit_ex' function. */
-#undef HAVE_EVP_DIGESTINIT_EX
-
-/* Define to 1 if you have the `EVP_MD_CTX_cleanup' function. */
-#undef HAVE_EVP_MD_CTX_CLEANUP
-
-/* Define to 1 if you have the `EVP_MD_CTX_copy_ex' function. */
-#undef HAVE_EVP_MD_CTX_COPY_EX
-
-/* Define to 1 if you have the `EVP_MD_CTX_init' function. */
-#undef HAVE_EVP_MD_CTX_INIT
-
-/* Define to 1 if you have the `EVP_sha256' function. */
-#undef HAVE_EVP_SHA256
-
-/* Define if you have ut_exit in utmp.h */
-#undef HAVE_EXIT_IN_UTMP
-
-/* Define to 1 if you have the `explicit_bzero' function. */
-#undef HAVE_EXPLICIT_BZERO
-
-/* Define to 1 if you have the `fchmod' function. */
-#undef HAVE_FCHMOD
-
-/* Define to 1 if you have the `fchown' function. */
-#undef HAVE_FCHOWN
-
-/* Use F_CLOSEM fcntl for closefrom */
-#undef HAVE_FCNTL_CLOSEM
-
-/* Define to 1 if you have the <fcntl.h> header file. */
-#undef HAVE_FCNTL_H
-
-/* Define to 1 if the system has the type `fd_mask'. */
-#undef HAVE_FD_MASK
-
-/* Define to 1 if you have the <features.h> header file. */
-#undef HAVE_FEATURES_H
-
-/* Define to 1 if you have the <floatingpoint.h> header file. */
-#undef HAVE_FLOATINGPOINT_H
-
-/* Define to 1 if you have the `fmt_scaled' function. */
-#undef HAVE_FMT_SCALED
-
-/* Define to 1 if you have the `freeaddrinfo' function. */
-#undef HAVE_FREEADDRINFO
-
-/* Define to 1 if the system has the type `fsblkcnt_t'. */
-#undef HAVE_FSBLKCNT_T
-
-/* Define to 1 if the system has the type `fsfilcnt_t'. */
-#undef HAVE_FSFILCNT_T
-
-/* Define to 1 if you have the `fstatfs' function. */
-#undef HAVE_FSTATFS
-
-/* Define to 1 if you have the `fstatvfs' function. */
-#undef HAVE_FSTATVFS
-
-/* Define to 1 if you have the `futimes' function. */
-#undef HAVE_FUTIMES
-
-/* Define to 1 if you have the `gai_strerror' function. */
-#undef HAVE_GAI_STRERROR
-
-/* Define to 1 if you have the `getaddrinfo' function. */
-#undef HAVE_GETADDRINFO
-
-/* Define to 1 if you have the `getaudit' function. */
-#undef HAVE_GETAUDIT
-
-/* Define to 1 if you have the `getaudit_addr' function. */
-#undef HAVE_GETAUDIT_ADDR
-
-/* Define to 1 if you have the `getcwd' function. */
-#undef HAVE_GETCWD
-
-/* Define to 1 if you have the `getgrouplist' function. */
-#undef HAVE_GETGROUPLIST
-
-/* Define to 1 if you have the `getgrset' function. */
-#undef HAVE_GETGRSET
-
-/* Define to 1 if you have the `getlastlogxbyname' function. */
-#undef HAVE_GETLASTLOGXBYNAME
-
-/* Define to 1 if you have the `getluid' function. */
-#undef HAVE_GETLUID
-
-/* Define to 1 if you have the `getnameinfo' function. */
-#undef HAVE_GETNAMEINFO
-
-/* Define to 1 if you have the `getopt' function. */
-#undef HAVE_GETOPT
-
-/* Define to 1 if you have the <getopt.h> header file. */
-#undef HAVE_GETOPT_H
-
-/* Define if your getopt(3) defines and uses optreset */
-#undef HAVE_GETOPT_OPTRESET
-
-/* Define if your libraries define getpagesize() */
-#undef HAVE_GETPAGESIZE
-
-/* Define to 1 if you have the `getpeereid' function. */
-#undef HAVE_GETPEEREID
-
-/* Define to 1 if you have the `getpeerucred' function. */
-#undef HAVE_GETPEERUCRED
-
-/* Define to 1 if you have the `getpgid' function. */
-#undef HAVE_GETPGID
-
-/* Define to 1 if you have the `getpgrp' function. */
-#undef HAVE_GETPGRP
-
-/* Define to 1 if you have the `getpwanam' function. */
-#undef HAVE_GETPWANAM
-
-/* Define to 1 if you have the `getrlimit' function. */
-#undef HAVE_GETRLIMIT
-
-/* Define if getrrsetbyname() exists */
-#undef HAVE_GETRRSETBYNAME
-
-/* Define to 1 if you have the `getrusage' function. */
-#undef HAVE_GETRUSAGE
-
-/* Define to 1 if you have the `getseuserbyname' function. */
-#undef HAVE_GETSEUSERBYNAME
-
-/* Define to 1 if you have the `gettimeofday' function. */
-#undef HAVE_GETTIMEOFDAY
-
-/* Define to 1 if you have the `getttyent' function. */
-#undef HAVE_GETTTYENT
-
-/* Define to 1 if you have the `getutent' function. */
-#undef HAVE_GETUTENT
-
-/* Define to 1 if you have the `getutid' function. */
-#undef HAVE_GETUTID
-
-/* Define to 1 if you have the `getutline' function. */
-#undef HAVE_GETUTLINE
-
-/* Define to 1 if you have the `getutxent' function. */
-#undef HAVE_GETUTXENT
-
-/* Define to 1 if you have the `getutxid' function. */
-#undef HAVE_GETUTXID
-
-/* Define to 1 if you have the `getutxline' function. */
-#undef HAVE_GETUTXLINE
-
-/* Define to 1 if you have the `getutxuser' function. */
-#undef HAVE_GETUTXUSER
-
-/* Define to 1 if you have the `get_default_context_with_level' function. */
-#undef HAVE_GET_DEFAULT_CONTEXT_WITH_LEVEL
-
-/* Define to 1 if you have the `glob' function. */
-#undef HAVE_GLOB
-
-/* Define to 1 if you have the <glob.h> header file. */
-#undef HAVE_GLOB_H
-
-/* Define to 1 if you have the `group_from_gid' function. */
-#undef HAVE_GROUP_FROM_GID
-
-/* Define to 1 if you have the <gssapi_generic.h> header file. */
-#undef HAVE_GSSAPI_GENERIC_H
-
-/* Define to 1 if you have the <gssapi/gssapi_generic.h> header file. */
-#undef HAVE_GSSAPI_GSSAPI_GENERIC_H
-
-/* Define to 1 if you have the <gssapi/gssapi.h> header file. */
-#undef HAVE_GSSAPI_GSSAPI_H
-
-/* Define to 1 if you have the <gssapi/gssapi_krb5.h> header file. */
-#undef HAVE_GSSAPI_GSSAPI_KRB5_H
-
-/* Define to 1 if you have the <gssapi.h> header file. */
-#undef HAVE_GSSAPI_H
-
-/* Define to 1 if you have the <gssapi_krb5.h> header file. */
-#undef HAVE_GSSAPI_KRB5_H
-
-/* Define if HEADER.ad exists in arpa/nameser.h */
-#undef HAVE_HEADER_AD
-
-/* Define to 1 if you have the `HMAC_CTX_init' function. */
-#undef HAVE_HMAC_CTX_INIT
-
-/* Define if you have ut_host in utmp.h */
-#undef HAVE_HOST_IN_UTMP
-
-/* Define if you have ut_host in utmpx.h */
-#undef HAVE_HOST_IN_UTMPX
-
-/* Define to 1 if you have the <iaf.h> header file. */
-#undef HAVE_IAF_H
-
-/* Define to 1 if you have the <ia.h> header file. */
-#undef HAVE_IA_H
-
-/* Define if you have ut_id in utmp.h */
-#undef HAVE_ID_IN_UTMP
-
-/* Define if you have ut_id in utmpx.h */
-#undef HAVE_ID_IN_UTMPX
-
-/* Define to 1 if you have the `inet_aton' function. */
-#undef HAVE_INET_ATON
-
-/* Define to 1 if you have the `inet_ntoa' function. */
-#undef HAVE_INET_NTOA
-
-/* Define to 1 if you have the `inet_ntop' function. */
-#undef HAVE_INET_NTOP
-
-/* Define to 1 if you have the `innetgr' function. */
-#undef HAVE_INNETGR
-
-/* define if you have int64_t data type */
-#undef HAVE_INT64_T
-
-/* Define to 1 if the system has the type `intmax_t'. */
-#undef HAVE_INTMAX_T
-
-/* Define to 1 if you have the <inttypes.h> header file. */
-#undef HAVE_INTTYPES_H
-
-/* define if you have intxx_t data type */
-#undef HAVE_INTXX_T
-
-/* Define to 1 if the system has the type `in_addr_t'. */
-#undef HAVE_IN_ADDR_T
-
-/* Define to 1 if the system has the type `in_port_t'. */
-#undef HAVE_IN_PORT_T
-
-/* Define if you have isblank(3C). */
-#undef HAVE_ISBLANK
-
-/* Define to 1 if you have the `krb5_cc_new_unique' function. */
-#undef HAVE_KRB5_CC_NEW_UNIQUE
-
-/* Define to 1 if you have the `krb5_free_error_message' function. */
-#undef HAVE_KRB5_FREE_ERROR_MESSAGE
-
-/* Define to 1 if you have the `krb5_get_error_message' function. */
-#undef HAVE_KRB5_GET_ERROR_MESSAGE
-
-/* Define to 1 if you have the <lastlog.h> header file. */
-#undef HAVE_LASTLOG_H
-
-/* Define if you want ldns support */
-#undef HAVE_LDNS
-
-/* Define to 1 if you have the <libaudit.h> header file. */
-#undef HAVE_LIBAUDIT_H
-
-/* Define to 1 if you have the `bsm' library (-lbsm). */
-#undef HAVE_LIBBSM
-
-/* Define to 1 if you have the `crypt' library (-lcrypt). */
-#undef HAVE_LIBCRYPT
-
-/* Define to 1 if you have the `dl' library (-ldl). */
-#undef HAVE_LIBDL
-
-/* Define to 1 if you have the <libgen.h> header file. */
-#undef HAVE_LIBGEN_H
-
-/* Define if system has libiaf that supports set_id */
-#undef HAVE_LIBIAF
-
-/* Define to 1 if you have the `network' library (-lnetwork). */
-#undef HAVE_LIBNETWORK
-
-/* Define to 1 if you have the `nsl' library (-lnsl). */
-#undef HAVE_LIBNSL
-
-/* Define to 1 if you have the `pam' library (-lpam). */
-#undef HAVE_LIBPAM
-
-/* Define to 1 if you have the `socket' library (-lsocket). */
-#undef HAVE_LIBSOCKET
-
-/* Define to 1 if you have the <libutil.h> header file. */
-#undef HAVE_LIBUTIL_H
-
-/* Define to 1 if you have the `xnet' library (-lxnet). */
-#undef HAVE_LIBXNET
-
-/* Define to 1 if you have the `z' library (-lz). */
-#undef HAVE_LIBZ
-
-/* Define to 1 if you have the <limits.h> header file. */
-#undef HAVE_LIMITS_H
-
-/* Define to 1 if you have the <linux/audit.h> header file. */
-#undef HAVE_LINUX_AUDIT_H
-
-/* Define to 1 if you have the <linux/filter.h> header file. */
-#undef HAVE_LINUX_FILTER_H
-
-/* Define to 1 if you have the <linux/if_tun.h> header file. */
-#undef HAVE_LINUX_IF_TUN_H
-
-/* Define to 1 if you have the <linux/seccomp.h> header file. */
-#undef HAVE_LINUX_SECCOMP_H
-
-/* Define to 1 if you have the <locale.h> header file. */
-#undef HAVE_LOCALE_H
-
-/* Define to 1 if you have the `login' function. */
-#undef HAVE_LOGIN
-
-/* Define to 1 if you have the <login_cap.h> header file. */
-#undef HAVE_LOGIN_CAP_H
-
-/* Define to 1 if you have the `login_getcapbool' function. */
-#undef HAVE_LOGIN_GETCAPBOOL
-
-/* Define to 1 if you have the <login.h> header file. */
-#undef HAVE_LOGIN_H
-
-/* Define to 1 if you have the `logout' function. */
-#undef HAVE_LOGOUT
-
-/* Define to 1 if you have the `logwtmp' function. */
-#undef HAVE_LOGWTMP
-
-/* Define to 1 if the system has the type `long double'. */
-#undef HAVE_LONG_DOUBLE
-
-/* Define to 1 if the system has the type `long long'. */
-#undef HAVE_LONG_LONG
-
-/* Define to 1 if you have the <maillock.h> header file. */
-#undef HAVE_MAILLOCK_H
-
-/* Define to 1 if you have the `mblen' function. */
-#undef HAVE_MBLEN
-
-/* Define to 1 if you have the `md5_crypt' function. */
-#undef HAVE_MD5_CRYPT
-
-/* Define if you want to allow MD5 passwords */
-#undef HAVE_MD5_PASSWORDS
-
-/* Define to 1 if you have the `memmove' function. */
-#undef HAVE_MEMMOVE
-
-/* Define to 1 if you have the <memory.h> header file. */
-#undef HAVE_MEMORY_H
-
-/* Define to 1 if you have the `mkdtemp' function. */
-#undef HAVE_MKDTEMP
-
-/* Define to 1 if you have the `mmap' function. */
-#undef HAVE_MMAP
-
-/* define if you have mode_t data type */
-#undef HAVE_MODE_T
-
-/* Some systems put nanosleep outside of libc */
-#undef HAVE_NANOSLEEP
-
-/* Define to 1 if you have the <ndir.h> header file. */
-#undef HAVE_NDIR_H
-
-/* Define to 1 if you have the <netdb.h> header file. */
-#undef HAVE_NETDB_H
-
-/* Define to 1 if you have the <netgroup.h> header file. */
-#undef HAVE_NETGROUP_H
-
-/* Define to 1 if you have the <net/if_tun.h> header file. */
-#undef HAVE_NET_IF_TUN_H
-
-/* Define if you are on NeXT */
-#undef HAVE_NEXT
-
-/* Define to 1 if you have the `ngetaddrinfo' function. */
-#undef HAVE_NGETADDRINFO
-
-/* Define to 1 if you have the `nsleep' function. */
-#undef HAVE_NSLEEP
-
-/* Define to 1 if you have the `ogetaddrinfo' function. */
-#undef HAVE_OGETADDRINFO
-
-/* Define if you have an old version of PAM which takes only one argument to
- pam_strerror */
-#undef HAVE_OLD_PAM
-
-/* Define to 1 if you have the `openlog_r' function. */
-#undef HAVE_OPENLOG_R
-
-/* Define to 1 if you have the `openpty' function. */
-#undef HAVE_OPENPTY
-
-/* Define if your ssl headers are included with #include <openssl/header.h> */
-#undef HAVE_OPENSSL
-
-/* Define if you have Digital Unix Security Integration Architecture */
-#undef HAVE_OSF_SIA
-
-/* Define to 1 if you have the `pam_getenvlist' function. */
-#undef HAVE_PAM_GETENVLIST
-
-/* Define to 1 if you have the <pam/pam_appl.h> header file. */
-#undef HAVE_PAM_PAM_APPL_H
-
-/* Define to 1 if you have the `pam_putenv' function. */
-#undef HAVE_PAM_PUTENV
-
-/* Define to 1 if you have the <paths.h> header file. */
-#undef HAVE_PATHS_H
-
-/* Define if you have ut_pid in utmp.h */
-#undef HAVE_PID_IN_UTMP
-
-/* define if you have pid_t data type */
-#undef HAVE_PID_T
-
-/* Define to 1 if you have the `poll' function. */
-#undef HAVE_POLL
-
-/* Define to 1 if you have the <poll.h> header file. */
-#undef HAVE_POLL_H
-
-/* Define to 1 if you have the `prctl' function. */
-#undef HAVE_PRCTL
-
-/* Define if you have /proc/$pid/fd */
-#undef HAVE_PROC_PID
-
-/* Define to 1 if you have the `pstat' function. */
-#undef HAVE_PSTAT
-
-/* Define to 1 if you have the <pty.h> header file. */
-#undef HAVE_PTY_H
-
-/* Define to 1 if you have the `pututline' function. */
-#undef HAVE_PUTUTLINE
-
-/* Define to 1 if you have the `pututxline' function. */
-#undef HAVE_PUTUTXLINE
-
-/* Define to 1 if you have the `readpassphrase' function. */
-#undef HAVE_READPASSPHRASE
-
-/* Define to 1 if you have the <readpassphrase.h> header file. */
-#undef HAVE_READPASSPHRASE_H
-
-/* Define to 1 if you have the `realpath' function. */
-#undef HAVE_REALPATH
-
-/* Define to 1 if you have the `recvmsg' function. */
-#undef HAVE_RECVMSG
-
-/* sys/resource.h has RLIMIT_NPROC */
-#undef HAVE_RLIMIT_NPROC
-
-/* Define to 1 if you have the <rpc/types.h> header file. */
-#undef HAVE_RPC_TYPES_H
-
-/* Define to 1 if you have the `rresvport_af' function. */
-#undef HAVE_RRESVPORT_AF
-
-/* Define to 1 if you have the `RSA_generate_key_ex' function. */
-#undef HAVE_RSA_GENERATE_KEY_EX
-
-/* Define to 1 if you have the `RSA_get_default_method' function. */
-#undef HAVE_RSA_GET_DEFAULT_METHOD
-
-/* Define to 1 if you have the <sandbox.h> header file. */
-#undef HAVE_SANDBOX_H
-
-/* Define to 1 if you have the `sandbox_init' function. */
-#undef HAVE_SANDBOX_INIT
-
-/* define if you have sa_family_t data type */
-#undef HAVE_SA_FAMILY_T
-
-/* Define to 1 if you have the `scan_scaled' function. */
-#undef HAVE_SCAN_SCALED
-
-/* Define if you have SecureWare-based protected password database */
-#undef HAVE_SECUREWARE
-
-/* Define to 1 if you have the <security/pam_appl.h> header file. */
-#undef HAVE_SECURITY_PAM_APPL_H
-
-/* Define to 1 if you have the `sendmsg' function. */
-#undef HAVE_SENDMSG
-
-/* Define to 1 if you have the `setauthdb' function. */
-#undef HAVE_SETAUTHDB
-
-/* Define to 1 if you have the `setdtablesize' function. */
-#undef HAVE_SETDTABLESIZE
-
-/* Define to 1 if you have the `setegid' function. */
-#undef HAVE_SETEGID
-
-/* Define to 1 if you have the `setenv' function. */
-#undef HAVE_SETENV
-
-/* Define to 1 if you have the `seteuid' function. */
-#undef HAVE_SETEUID
-
-/* Define to 1 if you have the `setgroupent' function. */
-#undef HAVE_SETGROUPENT
-
-/* Define to 1 if you have the `setgroups' function. */
-#undef HAVE_SETGROUPS
-
-/* Define to 1 if you have the `setlinebuf' function. */
-#undef HAVE_SETLINEBUF
-
-/* Define to 1 if you have the `setlogin' function. */
-#undef HAVE_SETLOGIN
-
-/* Define to 1 if you have the `setluid' function. */
-#undef HAVE_SETLUID
-
-/* Define to 1 if you have the `setpassent' function. */
-#undef HAVE_SETPASSENT
-
-/* Define to 1 if you have the `setpcred' function. */
-#undef HAVE_SETPCRED
-
-/* Define to 1 if you have the `setproctitle' function. */
-#undef HAVE_SETPROCTITLE
-
-/* Define to 1 if you have the `setregid' function. */
-#undef HAVE_SETREGID
-
-/* Define to 1 if you have the `setresgid' function. */
-#undef HAVE_SETRESGID
-
-/* Define to 1 if you have the `setresuid' function. */
-#undef HAVE_SETRESUID
-
-/* Define to 1 if you have the `setreuid' function. */
-#undef HAVE_SETREUID
-
-/* Define to 1 if you have the `setrlimit' function. */
-#undef HAVE_SETRLIMIT
-
-/* Define to 1 if you have the `setsid' function. */
-#undef HAVE_SETSID
-
-/* Define to 1 if you have the `setutent' function. */
-#undef HAVE_SETUTENT
-
-/* Define to 1 if you have the `setutxdb' function. */
-#undef HAVE_SETUTXDB
-
-/* Define to 1 if you have the `setutxent' function. */
-#undef HAVE_SETUTXENT
-
-/* Define to 1 if you have the `setvbuf' function. */
-#undef HAVE_SETVBUF
-
-/* Define to 1 if you have the `set_id' function. */
-#undef HAVE_SET_ID
-
-/* Define to 1 if you have the `SHA256_Update' function. */
-#undef HAVE_SHA256_UPDATE
-
-/* Define to 1 if you have the <sha2.h> header file. */
-#undef HAVE_SHA2_H
-
-/* Define to 1 if you have the <shadow.h> header file. */
-#undef HAVE_SHADOW_H
-
-/* Define to 1 if you have the `sigaction' function. */
-#undef HAVE_SIGACTION
-
-/* Define to 1 if you have the `sigvec' function. */
-#undef HAVE_SIGVEC
-
-/* Define to 1 if the system has the type `sig_atomic_t'. */
-#undef HAVE_SIG_ATOMIC_T
-
-/* define if you have size_t data type */
-#undef HAVE_SIZE_T
-
-/* Define to 1 if you have the `snprintf' function. */
-#undef HAVE_SNPRINTF
-
-/* Define to 1 if you have the `socketpair' function. */
-#undef HAVE_SOCKETPAIR
-
-/* Have PEERCRED socket option */
-#undef HAVE_SO_PEERCRED
-
-/* define if you have ssize_t data type */
-#undef HAVE_SSIZE_T
-
-/* Fields in struct sockaddr_storage */
-#undef HAVE_SS_FAMILY_IN_SS
-
-/* Define to 1 if you have the `statfs' function. */
-#undef HAVE_STATFS
-
-/* Define to 1 if you have the `statvfs' function. */
-#undef HAVE_STATVFS
-
-/* Define to 1 if you have the <stddef.h> header file. */
-#undef HAVE_STDDEF_H
-
-/* Define to 1 if you have the <stdint.h> header file. */
-#undef HAVE_STDINT_H
-
-/* Define to 1 if you have the <stdlib.h> header file. */
-#undef HAVE_STDLIB_H
-
-/* Define to 1 if you have the `strdup' function. */
-#undef HAVE_STRDUP
-
-/* Define to 1 if you have the `strerror' function. */
-#undef HAVE_STRERROR
-
-/* Define to 1 if you have the `strftime' function. */
-#undef HAVE_STRFTIME
-
-/* Silly mkstemp() */
-#undef HAVE_STRICT_MKSTEMP
-
-/* Define to 1 if you have the <strings.h> header file. */
-#undef HAVE_STRINGS_H
-
-/* Define to 1 if you have the <string.h> header file. */
-#undef HAVE_STRING_H
-
-/* Define to 1 if you have the `strlcat' function. */
-#undef HAVE_STRLCAT
-
-/* Define to 1 if you have the `strlcpy' function. */
-#undef HAVE_STRLCPY
-
-/* Define to 1 if you have the `strmode' function. */
-#undef HAVE_STRMODE
-
-/* Define to 1 if you have the `strnlen' function. */
-#undef HAVE_STRNLEN
-
-/* Define to 1 if you have the `strnvis' function. */
-#undef HAVE_STRNVIS
-
-/* Define to 1 if you have the `strptime' function. */
-#undef HAVE_STRPTIME
-
-/* Define to 1 if you have the `strsep' function. */
-#undef HAVE_STRSEP
-
-/* Define to 1 if you have the `strtoll' function. */
-#undef HAVE_STRTOLL
-
-/* Define to 1 if you have the `strtonum' function. */
-#undef HAVE_STRTONUM
-
-/* Define to 1 if you have the `strtoul' function. */
-#undef HAVE_STRTOUL
-
-/* Define to 1 if you have the `strtoull' function. */
-#undef HAVE_STRTOULL
-
-/* define if you have struct addrinfo data type */
-#undef HAVE_STRUCT_ADDRINFO
-
-/* define if you have struct in6_addr data type */
-#undef HAVE_STRUCT_IN6_ADDR
-
-/* Define to 1 if `pw_change' is a member of `struct passwd'. */
-#undef HAVE_STRUCT_PASSWD_PW_CHANGE
-
-/* Define to 1 if `pw_class' is a member of `struct passwd'. */
-#undef HAVE_STRUCT_PASSWD_PW_CLASS
-
-/* Define to 1 if `pw_expire' is a member of `struct passwd'. */
-#undef HAVE_STRUCT_PASSWD_PW_EXPIRE
-
-/* Define to 1 if `pw_gecos' is a member of `struct passwd'. */
-#undef HAVE_STRUCT_PASSWD_PW_GECOS
-
-/* define if you have struct sockaddr_in6 data type */
-#undef HAVE_STRUCT_SOCKADDR_IN6
-
-/* Define to 1 if `sin6_scope_id' is a member of `struct sockaddr_in6'. */
-#undef HAVE_STRUCT_SOCKADDR_IN6_SIN6_SCOPE_ID
-
-/* define if you have struct sockaddr_storage data type */
-#undef HAVE_STRUCT_SOCKADDR_STORAGE
-
-/* Define to 1 if `st_blksize' is a member of `struct stat'. */
-#undef HAVE_STRUCT_STAT_ST_BLKSIZE
-
-/* Define to 1 if the system has the type `struct timespec'. */
-#undef HAVE_STRUCT_TIMESPEC
-
-/* define if you have struct timeval */
-#undef HAVE_STRUCT_TIMEVAL
-
-/* Define to 1 if you have the `swap32' function. */
-#undef HAVE_SWAP32
-
-/* Define to 1 if you have the `sysconf' function. */
-#undef HAVE_SYSCONF
-
-/* Define if you have syslen in utmpx.h */
-#undef HAVE_SYSLEN_IN_UTMPX
-
-/* Define to 1 if you have the <sys/audit.h> header file. */
-#undef HAVE_SYS_AUDIT_H
-
-/* Define to 1 if you have the <sys/bitypes.h> header file. */
-#undef HAVE_SYS_BITYPES_H
-
-/* Define to 1 if you have the <sys/bsdtty.h> header file. */
-#undef HAVE_SYS_BSDTTY_H
-
-/* Define to 1 if you have the <sys/capability.h> header file. */
-#undef HAVE_SYS_CAPABILITY_H
-
-/* Define to 1 if you have the <sys/cdefs.h> header file. */
-#undef HAVE_SYS_CDEFS_H
-
-/* Define to 1 if you have the <sys/dir.h> header file. */
-#undef HAVE_SYS_DIR_H
-
-/* Define if your system defines sys_errlist[] */
-#undef HAVE_SYS_ERRLIST
-
-/* Define to 1 if you have the <sys/mman.h> header file. */
-#undef HAVE_SYS_MMAN_H
-
-/* Define to 1 if you have the <sys/mount.h> header file. */
-#undef HAVE_SYS_MOUNT_H
-
-/* Define to 1 if you have the <sys/ndir.h> header file. */
-#undef HAVE_SYS_NDIR_H
-
-/* Define if your system defines sys_nerr */
-#undef HAVE_SYS_NERR
-
-/* Define to 1 if you have the <sys/poll.h> header file. */
-#undef HAVE_SYS_POLL_H
-
-/* Define to 1 if you have the <sys/prctl.h> header file. */
-#undef HAVE_SYS_PRCTL_H
-
-/* Define to 1 if you have the <sys/pstat.h> header file. */
-#undef HAVE_SYS_PSTAT_H
-
-/* Define to 1 if you have the <sys/ptms.h> header file. */
-#undef HAVE_SYS_PTMS_H
-
-/* Define to 1 if you have the <sys/select.h> header file. */
-#undef HAVE_SYS_SELECT_H
-
-/* Define to 1 if you have the <sys/statvfs.h> header file. */
-#undef HAVE_SYS_STATVFS_H
-
-/* Define to 1 if you have the <sys/stat.h> header file. */
-#undef HAVE_SYS_STAT_H
-
-/* Define to 1 if you have the <sys/stream.h> header file. */
-#undef HAVE_SYS_STREAM_H
-
-/* Define to 1 if you have the <sys/stropts.h> header file. */
-#undef HAVE_SYS_STROPTS_H
-
-/* Define to 1 if you have the <sys/strtio.h> header file. */
-#undef HAVE_SYS_STRTIO_H
-
-/* Force use of sys/syslog.h on Ultrix */
-#undef HAVE_SYS_SYSLOG_H
-
-/* Define to 1 if you have the <sys/sysmacros.h> header file. */
-#undef HAVE_SYS_SYSMACROS_H
-
-/* Define to 1 if you have the <sys/timers.h> header file. */
-#undef HAVE_SYS_TIMERS_H
-
-/* Define to 1 if you have the <sys/time.h> header file. */
-#undef HAVE_SYS_TIME_H
-
-/* Define to 1 if you have the <sys/types.h> header file. */
-#undef HAVE_SYS_TYPES_H
-
-/* Define to 1 if you have the <sys/un.h> header file. */
-#undef HAVE_SYS_UN_H
-
-/* Define to 1 if you have the `tcgetpgrp' function. */
-#undef HAVE_TCGETPGRP
-
-/* Define to 1 if you have the `tcsendbreak' function. */
-#undef HAVE_TCSENDBREAK
-
-/* Define to 1 if you have the `time' function. */
-#undef HAVE_TIME
-
-/* Define to 1 if you have the <time.h> header file. */
-#undef HAVE_TIME_H
-
-/* Define if you have ut_time in utmp.h */
-#undef HAVE_TIME_IN_UTMP
-
-/* Define if you have ut_time in utmpx.h */
-#undef HAVE_TIME_IN_UTMPX
-
-/* Define to 1 if you have the `timingsafe_bcmp' function. */
-#undef HAVE_TIMINGSAFE_BCMP
-
-/* Define to 1 if you have the <tmpdir.h> header file. */
-#undef HAVE_TMPDIR_H
-
-/* Define to 1 if you have the `truncate' function. */
-#undef HAVE_TRUNCATE
-
-/* Define to 1 if you have the <ttyent.h> header file. */
-#undef HAVE_TTYENT_H
-
-/* Define if you have ut_tv in utmp.h */
-#undef HAVE_TV_IN_UTMP
-
-/* Define if you have ut_tv in utmpx.h */
-#undef HAVE_TV_IN_UTMPX
-
-/* Define if you have ut_type in utmp.h */
-#undef HAVE_TYPE_IN_UTMP
-
-/* Define if you have ut_type in utmpx.h */
-#undef HAVE_TYPE_IN_UTMPX
-
-/* Define to 1 if you have the <ucred.h> header file. */
-#undef HAVE_UCRED_H
-
-/* Define to 1 if the system has the type `uintmax_t'. */
-#undef HAVE_UINTMAX_T
-
-/* define if you have uintxx_t data type */
-#undef HAVE_UINTXX_T
-
-/* Define to 1 if you have the <unistd.h> header file. */
-#undef HAVE_UNISTD_H
-
-/* Define to 1 if you have the `unsetenv' function. */
-#undef HAVE_UNSETENV
-
-/* Define to 1 if the system has the type `unsigned long long'. */
-#undef HAVE_UNSIGNED_LONG_LONG
-
-/* Define to 1 if you have the `updwtmp' function. */
-#undef HAVE_UPDWTMP
-
-/* Define to 1 if you have the `updwtmpx' function. */
-#undef HAVE_UPDWTMPX
-
-/* Define to 1 if you have the <usersec.h> header file. */
-#undef HAVE_USERSEC_H
-
-/* Define to 1 if you have the `user_from_uid' function. */
-#undef HAVE_USER_FROM_UID
-
-/* Define to 1 if you have the `usleep' function. */
-#undef HAVE_USLEEP
-
-/* Define to 1 if you have the <util.h> header file. */
-#undef HAVE_UTIL_H
-
-/* Define to 1 if you have the `utimes' function. */
-#undef HAVE_UTIMES
-
-/* Define to 1 if you have the <utime.h> header file. */
-#undef HAVE_UTIME_H
-
-/* Define to 1 if you have the `utmpname' function. */
-#undef HAVE_UTMPNAME
-
-/* Define to 1 if you have the `utmpxname' function. */
-#undef HAVE_UTMPXNAME
-
-/* Define to 1 if you have the <utmpx.h> header file. */
-#undef HAVE_UTMPX_H
-
-/* Define to 1 if you have the <utmp.h> header file. */
-#undef HAVE_UTMP_H
-
-/* define if you have u_char data type */
-#undef HAVE_U_CHAR
-
-/* define if you have u_int data type */
-#undef HAVE_U_INT
-
-/* define if you have u_int64_t data type */
-#undef HAVE_U_INT64_T
-
-/* define if you have u_intxx_t data type */
-#undef HAVE_U_INTXX_T
-
-/* Define to 1 if you have the `vasprintf' function. */
-#undef HAVE_VASPRINTF
-
-/* Define if va_copy exists */
-#undef HAVE_VA_COPY
-
-/* Define to 1 if you have the `vhangup' function. */
-#undef HAVE_VHANGUP
-
-/* Define to 1 if you have the <vis.h> header file. */
-#undef HAVE_VIS_H
-
-/* Define to 1 if you have the `vsnprintf' function. */
-#undef HAVE_VSNPRINTF
-
-/* Define to 1 if you have the `waitpid' function. */
-#undef HAVE_WAITPID
-
-/* Define to 1 if you have the `_getlong' function. */
-#undef HAVE__GETLONG
-
-/* Define to 1 if you have the `_getpty' function. */
-#undef HAVE__GETPTY
-
-/* Define to 1 if you have the `_getshort' function. */
-#undef HAVE__GETSHORT
-
-/* Define if you have struct __res_state _res as an extern */
-#undef HAVE__RES_EXTERN
-
-/* Define to 1 if you have the `__b64_ntop' function. */
-#undef HAVE___B64_NTOP
-
-/* Define to 1 if you have the `__b64_pton' function. */
-#undef HAVE___B64_PTON
-
-/* Define if compiler implements __FUNCTION__ */
-#undef HAVE___FUNCTION__
-
-/* Define if libc defines __progname */
-#undef HAVE___PROGNAME
-
-/* Fields in struct sockaddr_storage */
-#undef HAVE___SS_FAMILY_IN_SS
-
-/* Define if __va_copy exists */
-#undef HAVE___VA_COPY
-
-/* Define if compiler implements __func__ */
-#undef HAVE___func__
-
-/* Define this if you are using the Heimdal version of Kerberos V5 */
-#undef HEIMDAL
-
-/* Define if you need to use IP address instead of hostname in $DISPLAY */
-#undef IPADDR_IN_DISPLAY
-
-/* Detect IPv4 in IPv6 mapped addresses and treat as IPv4 */
-#undef IPV4_IN_IPV6
-
-/* Define if your system choked on IP TOS setting */
-#undef IP_TOS_IS_BROKEN
-
-/* Define if you want Kerberos 5 support */
-#undef KRB5
-
-/* Define if pututxline updates lastlog too */
-#undef LASTLOG_WRITE_PUTUTXLINE
-
-/* Define if you want TCP Wrappers support */
-#undef LIBWRAP
-
-/* Define to whatever link() returns for "not supported" if it doesn't return
- EOPNOTSUPP. */
-#undef LINK_OPNOTSUPP_ERRNO
-
-/* Adjust Linux out-of-memory killer */
-#undef LINUX_OOM_ADJUST
-
-/* max value of long long calculated by configure */
-#undef LLONG_MAX
-
-/* min value of long long calculated by configure */
-#undef LLONG_MIN
-
-/* Account locked with pw(1) */
-#undef LOCKED_PASSWD_PREFIX
-
-/* String used in /etc/passwd to denote locked account */
-#undef LOCKED_PASSWD_STRING
-
-/* String used in /etc/passwd to denote locked account */
-#undef LOCKED_PASSWD_SUBSTR
-
-/* Some versions of /bin/login need the TERM supplied on the commandline */
-#undef LOGIN_NEEDS_TERM
-
-/* Some systems need a utmpx entry for /bin/login to work */
-#undef LOGIN_NEEDS_UTMPX
-
-/* Define if your login program cannot handle end of options ("--") */
-#undef LOGIN_NO_ENDOPT
-
-/* If your header files don't define LOGIN_PROGRAM, then use this (detected)
- from environment and PATH */
-#undef LOGIN_PROGRAM_FALLBACK
-
-/* Set this to your mail directory if you do not have _PATH_MAILDIR */
-#undef MAIL_DIRECTORY
-
-/* Need setpgrp to acquire controlling tty */
-#undef NEED_SETPGRP
-
-/* compiler does not accept __attribute__ on return types */
-#undef NO_ATTRIBUTE_ON_RETURN_TYPE
-
-/* Define if the concept of ports only accessible to superusers isn't known */
-#undef NO_IPPORT_RESERVED_CONCEPT
-
-/* Define if you don't want to use lastlog in session.c */
-#undef NO_SSH_LASTLOG
-
-/* Define if X11 doesn't support AF_UNIX sockets on that system */
-#undef NO_X11_UNIX_SOCKETS
-
-/* Define if EVP_DigestUpdate returns void */
-#undef OPENSSL_EVP_DIGESTUPDATE_VOID
-
-/* OpenSSL has ECC */
-#undef OPENSSL_HAS_ECC
-
-/* libcrypto has NID_X9_62_prime256v1 */
-#undef OPENSSL_HAS_NISTP256
-
-/* libcrypto has NID_secp384r1 */
-#undef OPENSSL_HAS_NISTP384
-
-/* libcrypto has NID_secp521r1 */
-#undef OPENSSL_HAS_NISTP521
-
-/* libcrypto has EVP AES CTR */
-#undef OPENSSL_HAVE_EVPCTR
-
-/* libcrypto has EVP AES GCM */
-#undef OPENSSL_HAVE_EVPGCM
-
-/* libcrypto is missing AES 192 and 256 bit functions */
-#undef OPENSSL_LOBOTOMISED_AES
-
-/* Define if you want OpenSSL's internally seeded PRNG only */
-#undef OPENSSL_PRNG_ONLY
-
-/* Define to the address where bug reports for this package should be sent. */
-#undef PACKAGE_BUGREPORT
-
-/* Define to the full name of this package. */
-#undef PACKAGE_NAME
-
-/* Define to the full name and version of this package. */
-#undef PACKAGE_STRING
-
-/* Define to the one symbol short name of this package. */
-#undef PACKAGE_TARNAME
-
-/* Define to the home page for this package. */
-#undef PACKAGE_URL
-
-/* Define to the version of this package. */
-#undef PACKAGE_VERSION
-
-/* Define if you are using Solaris-derived PAM which passes pam_messages to
- the conversation function with an extra level of indirection */
-#undef PAM_SUN_CODEBASE
-
-/* Work around problematic Linux PAM modules handling of PAM_TTY */
-#undef PAM_TTY_KLUDGE
-
-/* must supply username to passwd */
-#undef PASSWD_NEEDS_USERNAME
-
-/* System dirs owned by bin (uid 2) */
-#undef PLATFORM_SYS_DIR_UID
-
-/* Port number of PRNGD/EGD random number socket */
-#undef PRNGD_PORT
-
-/* Location of PRNGD/EGD random number socket */
-#undef PRNGD_SOCKET
-
-/* read(1) can return 0 for a non-closed fd */
-#undef PTY_ZEROREAD
-
-/* Sandbox using capsicum */
-#undef SANDBOX_CAPSICUM
-
-/* Sandbox using Darwin sandbox_init(3) */
-#undef SANDBOX_DARWIN
-
-/* no privsep sandboxing */
-#undef SANDBOX_NULL
-
-/* Sandbox using setrlimit(2) */
-#undef SANDBOX_RLIMIT
-
-/* Sandbox using seccomp filter */
-#undef SANDBOX_SECCOMP_FILTER
-
-/* setrlimit RLIMIT_FSIZE works */
-#undef SANDBOX_SKIP_RLIMIT_FSIZE
-
-/* define if setrlimit RLIMIT_NOFILE breaks things */
-#undef SANDBOX_SKIP_RLIMIT_NOFILE
-
-/* Sandbox using systrace(4) */
-#undef SANDBOX_SYSTRACE
-
-/* Specify the system call convention in use */
-#undef SECCOMP_AUDIT_ARCH
-
-/* Define if your platform breaks doing a seteuid before a setuid */
-#undef SETEUID_BREAKS_SETUID
-
-/* The size of `int', as computed by sizeof. */
-#undef SIZEOF_INT
-
-/* The size of `long int', as computed by sizeof. */
-#undef SIZEOF_LONG_INT
-
-/* The size of `long long int', as computed by sizeof. */
-#undef SIZEOF_LONG_LONG_INT
-
-/* The size of `short int', as computed by sizeof. */
-#undef SIZEOF_SHORT_INT
-
-/* Define if you want S/Key support */
-#undef SKEY
-
-/* Define if your skeychallenge() function takes 4 arguments (NetBSD) */
-#undef SKEYCHALLENGE_4ARG
-
-/* Define as const if snprintf() can declare const char *fmt */
-#undef SNPRINTF_CONST
-
-/* Define to a Set Process Title type if your system is supported by
- bsd-setproctitle.c */
-#undef SPT_TYPE
-
-/* Define if sshd somehow reacquires a controlling TTY after setsid() */
-#undef SSHD_ACQUIRES_CTTY
-
-/* Define if pam_chauthtok wants real uid set to the unpriv'ed user */
-#undef SSHPAM_CHAUTHTOK_NEEDS_RUID
-
-/* Use audit debugging module */
-#undef SSH_AUDIT_EVENTS
-
-/* Windows is sensitive to read buffer size */
-#undef SSH_IOBUFSZ
-
-/* non-privileged user for privilege separation */
-#undef SSH_PRIVSEP_USER
-
-/* Use tunnel device compatibility to OpenBSD */
-#undef SSH_TUN_COMPAT_AF
-
-/* Open tunnel devices the FreeBSD way */
-#undef SSH_TUN_FREEBSD
-
-/* Open tunnel devices the Linux tun/tap way */
-#undef SSH_TUN_LINUX
-
-/* No layer 2 tunnel support */
-#undef SSH_TUN_NO_L2
-
-/* Open tunnel devices the OpenBSD way */
-#undef SSH_TUN_OPENBSD
-
-/* Prepend the address family to IP tunnel traffic */
-#undef SSH_TUN_PREPEND_AF
-
-/* Define to 1 if you have the ANSI C header files. */
-#undef STDC_HEADERS
-
-/* Define if you want a different $PATH for the superuser */
-#undef SUPERUSER_PATH
-
-/* syslog_r function is safe to use in in a signal handler */
-#undef SYSLOG_R_SAFE_IN_SIGHAND
-
-/* Support passwords > 8 chars */
-#undef UNIXWARE_LONG_PASSWORDS
-
-/* Specify default $PATH */
-#undef USER_PATH
-
-/* Define this if you want to use libkafs' AFS support */
-#undef USE_AFS
-
-/* Use BSM audit module */
-#undef USE_BSM_AUDIT
-
-/* Use btmp to log bad logins */
-#undef USE_BTMP
-
-/* Use libedit for sftp */
-#undef USE_LIBEDIT
-
-/* Use Linux audit module */
-#undef USE_LINUX_AUDIT
-
-/* Enable OpenSSL engine support */
-#undef USE_OPENSSL_ENGINE
-
-/* Define if you want to enable PAM support */
-#undef USE_PAM
-
-/* Use PIPES instead of a socketpair() */
-#undef USE_PIPES
-
-/* Define if you have Solaris process contracts */
-#undef USE_SOLARIS_PROCESS_CONTRACTS
-
-/* Define if you have Solaris projects */
-#undef USE_SOLARIS_PROJECTS
-
-/* Define if you shouldn't strip 'tty' from your ttyname in [uw]tmp */
-#undef WITH_ABBREV_NO_TTY
-
-/* Define if you want to enable AIX4's authenticate function */
-#undef WITH_AIXAUTHENTICATE
-
-/* Define if you have/want arrays (cluster-wide session managment, not C
- arrays) */
-#undef WITH_IRIX_ARRAY
-
-/* Define if you want IRIX audit trails */
-#undef WITH_IRIX_AUDIT
-
-/* Define if you want IRIX kernel jobs */
-#undef WITH_IRIX_JOBS
-
-/* Define if you want IRIX project management */
-#undef WITH_IRIX_PROJECT
-
-/* Define if you want SELinux support. */
-#undef WITH_SELINUX
-
-/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
- significant byte first (like Motorola and SPARC, unlike Intel). */
-#if defined AC_APPLE_UNIVERSAL_BUILD
-# if defined __BIG_ENDIAN__
-# define WORDS_BIGENDIAN 1
-# endif
-#else
-# ifndef WORDS_BIGENDIAN
-# undef WORDS_BIGENDIAN
-# endif
-#endif
-
-/* Define if xauth is found in your path */
-#undef XAUTH_PATH
-
-/* Number of bits in a file offset, on hosts where this is settable. */
-#undef _FILE_OFFSET_BITS
-
-/* Define for large files, on AIX-style hosts. */
-#undef _LARGE_FILES
-
-/* log for bad login attempts */
-#undef _PATH_BTMP
-
-/* Full path of your "passwd" program */
-#undef _PATH_PASSWD_PROG
-
-/* Specify location of ssh.pid */
-#undef _PATH_SSH_PIDDIR
-
-/* Define if we don't have struct __res_state in resolv.h */
-#undef __res_state
-
-/* 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 __cplusplus
-#undef inline
-#endif
-
-/* type to use in place of socklen_t if not defined */
-#undef socklen_t
diff --git a/crypto/openssh/configure b/crypto/openssh/configure
deleted file mode 100755
index d690393..0000000
--- a/crypto/openssh/configure
+++ /dev/null
@@ -1,19741 +0,0 @@
-#! /bin/sh
-# From configure.ac Revision: 1.571 .
-# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.68 for OpenSSH Portable.
-#
-# Report bugs to <openssh-unix-dev@mindrot.org>.
-#
-#
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
-# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software
-# Foundation, Inc.
-#
-#
-# This configure script is free software; the Free Software Foundation
-# gives unlimited permission to copy, distribute and modify it.
-## -------------------- ##
-## M4sh Initialization. ##
-## -------------------- ##
-
-# Be more Bourne compatible
-DUALCASE=1; export DUALCASE # for MKS sh
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
- emulate sh
- NULLCMD=:
- # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
- # is contrary to our usage. Disable this feature.
- alias -g '${1+"$@"}'='"$@"'
- setopt NO_GLOB_SUBST
-else
- case `(set -o) 2>/dev/null` in #(
- *posix*) :
- set -o posix ;; #(
- *) :
- ;;
-esac
-fi
-
-
-as_nl='
-'
-export as_nl
-# Printing a long string crashes Solaris 7 /usr/bin/printf.
-as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
-# Prefer a ksh shell builtin over an external printf program on Solaris,
-# but without wasting forks for bash or zsh.
-if test -z "$BASH_VERSION$ZSH_VERSION" \
- && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
- as_echo='print -r --'
- as_echo_n='print -rn --'
-elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
- as_echo='printf %s\n'
- as_echo_n='printf %s'
-else
- if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
- as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
- as_echo_n='/usr/ucb/echo -n'
- else
- as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
- as_echo_n_body='eval
- arg=$1;
- case $arg in #(
- *"$as_nl"*)
- expr "X$arg" : "X\\(.*\\)$as_nl";
- arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
- esac;
- expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
- '
- export as_echo_n_body
- as_echo_n='sh -c $as_echo_n_body as_echo'
- fi
- export as_echo_body
- as_echo='sh -c $as_echo_body as_echo'
-fi
-
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
- PATH_SEPARATOR=:
- (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
- (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
- PATH_SEPARATOR=';'
- }
-fi
-
-
-# IFS
-# We need space, tab and new line, in precisely that order. Quoting is
-# there to prevent editors from complaining about space-tab.
-# (If _AS_PATH_WALK were called with IFS unset, it would disable word
-# splitting by setting IFS to empty value.)
-IFS=" "" $as_nl"
-
-# Find who we are. Look in the path if we contain no directory separator.
-as_myself=
-case $0 in #((
- *[\\/]* ) as_myself=$0 ;;
- *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
- done
-IFS=$as_save_IFS
-
- ;;
-esac
-# We did not find ourselves, most probably we were run as `sh COMMAND'
-# in which case we are not to be found in the path.
-if test "x$as_myself" = x; then
- as_myself=$0
-fi
-if test ! -f "$as_myself"; then
- $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
- exit 1
-fi
-
-# Unset variables that we do not need and which cause bugs (e.g. in
-# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
-# suppresses any "Segmentation fault" message there. '((' could
-# trigger a bug in pdksh 5.2.14.
-for as_var in BASH_ENV ENV MAIL MAILPATH
-do eval test x\${$as_var+set} = xset \
- && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
-done
-PS1='$ '
-PS2='> '
-PS4='+ '
-
-# NLS nuisances.
-LC_ALL=C
-export LC_ALL
-LANGUAGE=C
-export LANGUAGE
-
-# CDPATH.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-if test "x$CONFIG_SHELL" = x; then
- as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
- emulate sh
- NULLCMD=:
- # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
- # is contrary to our usage. Disable this feature.
- alias -g '\${1+\"\$@\"}'='\"\$@\"'
- setopt NO_GLOB_SUBST
-else
- case \`(set -o) 2>/dev/null\` in #(
- *posix*) :
- set -o posix ;; #(
- *) :
- ;;
-esac
-fi
-"
- as_required="as_fn_return () { (exit \$1); }
-as_fn_success () { as_fn_return 0; }
-as_fn_failure () { as_fn_return 1; }
-as_fn_ret_success () { return 0; }
-as_fn_ret_failure () { return 1; }
-
-exitcode=0
-as_fn_success || { exitcode=1; echo as_fn_success failed.; }
-as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
-as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
-as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
-if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
-
-else
- exitcode=1; echo positional parameters were not saved.
-fi
-test x\$exitcode = x0 || exit 1"
- as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
- as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
- eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
- test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
-test \$(( 1 + 1 )) = 2 || exit 1"
- if (eval "$as_required") 2>/dev/null; then :
- as_have_required=yes
-else
- as_have_required=no
-fi
- if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
-
-else
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-as_found=false
-for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- as_found=:
- case $as_dir in #(
- /*)
- for as_base in sh bash ksh sh5; do
- # Try only shells that exist, to save several forks.
- as_shell=$as_dir/$as_base
- if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
- { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
- CONFIG_SHELL=$as_shell as_have_required=yes
- if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
- break 2
-fi
-fi
- done;;
- esac
- as_found=false
-done
-$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
- { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
- CONFIG_SHELL=$SHELL as_have_required=yes
-fi; }
-IFS=$as_save_IFS
-
-
- if test "x$CONFIG_SHELL" != x; then :
- # We cannot yet assume a decent shell, so we have to provide a
- # neutralization value for shells without unset; and this also
- # works around shells that cannot unset nonexistent variables.
- # Preserve -v and -x to the replacement shell.
- BASH_ENV=/dev/null
- ENV=/dev/null
- (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
- export CONFIG_SHELL
- case $- in # ((((
- *v*x* | *x*v* ) as_opts=-vx ;;
- *v* ) as_opts=-v ;;
- *x* ) as_opts=-x ;;
- * ) as_opts= ;;
- esac
- exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"}
-fi
-
- if test x$as_have_required = xno; then :
- $as_echo "$0: This script requires a shell more modern than all"
- $as_echo "$0: the shells that I found on your system."
- if test x${ZSH_VERSION+set} = xset ; then
- $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
- $as_echo "$0: be upgraded to zsh 4.3.4 or later."
- else
- $as_echo "$0: Please tell bug-autoconf@gnu.org and
-$0: openssh-unix-dev@mindrot.org about your system,
-$0: including any error possibly output before this
-$0: message. Then install a modern shell, or manually run
-$0: the script under such a shell if you do have one."
- fi
- exit 1
-fi
-fi
-fi
-SHELL=${CONFIG_SHELL-/bin/sh}
-export SHELL
-# Unset more variables known to interfere with behavior of common tools.
-CLICOLOR_FORCE= GREP_OPTIONS=
-unset CLICOLOR_FORCE GREP_OPTIONS
-
-## --------------------- ##
-## M4sh Shell Functions. ##
-## --------------------- ##
-# as_fn_unset VAR
-# ---------------
-# Portably unset VAR.
-as_fn_unset ()
-{
- { eval $1=; unset $1;}
-}
-as_unset=as_fn_unset
-
-# as_fn_set_status STATUS
-# -----------------------
-# Set $? to STATUS, without forking.
-as_fn_set_status ()
-{
- return $1
-} # as_fn_set_status
-
-# as_fn_exit STATUS
-# -----------------
-# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
-as_fn_exit ()
-{
- set +e
- as_fn_set_status $1
- exit $1
-} # as_fn_exit
-
-# as_fn_mkdir_p
-# -------------
-# Create "$as_dir" as a directory, including parents if necessary.
-as_fn_mkdir_p ()
-{
-
- case $as_dir in #(
- -*) as_dir=./$as_dir;;
- esac
- test -d "$as_dir" || eval $as_mkdir_p || {
- as_dirs=
- while :; do
- case $as_dir in #(
- *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
- *) as_qdir=$as_dir;;
- esac
- as_dirs="'$as_qdir' $as_dirs"
- as_dir=`$as_dirname -- "$as_dir" ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$as_dir" : 'X\(//\)[^/]' \| \
- X"$as_dir" : 'X\(//\)$' \| \
- X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$as_dir" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- test -d "$as_dir" && break
- done
- test -z "$as_dirs" || eval "mkdir $as_dirs"
- } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
-
-
-} # as_fn_mkdir_p
-# as_fn_append VAR VALUE
-# ----------------------
-# Append the text in VALUE to the end of the definition contained in VAR. Take
-# advantage of any shell optimizations that allow amortized linear growth over
-# repeated appends, instead of the typical quadratic growth present in naive
-# implementations.
-if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
- eval 'as_fn_append ()
- {
- eval $1+=\$2
- }'
-else
- as_fn_append ()
- {
- eval $1=\$$1\$2
- }
-fi # as_fn_append
-
-# as_fn_arith ARG...
-# ------------------
-# Perform arithmetic evaluation on the ARGs, and store the result in the
-# global $as_val. Take advantage of shells that can avoid forks. The arguments
-# must be portable across $(()) and expr.
-if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
- eval 'as_fn_arith ()
- {
- as_val=$(( $* ))
- }'
-else
- as_fn_arith ()
- {
- as_val=`expr "$@" || test $? -eq 1`
- }
-fi # as_fn_arith
-
-
-# as_fn_error STATUS ERROR [LINENO LOG_FD]
-# ----------------------------------------
-# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
-# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
-# script with STATUS, using 1 if that was 0.
-as_fn_error ()
-{
- as_status=$1; test $as_status -eq 0 && as_status=1
- if test "$4"; then
- as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
- fi
- $as_echo "$as_me: error: $2" >&2
- as_fn_exit $as_status
-} # as_fn_error
-
-if expr a : '\(a\)' >/dev/null 2>&1 &&
- test "X`expr 00001 : '.*\(...\)'`" = X001; then
- as_expr=expr
-else
- as_expr=false
-fi
-
-if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
- as_basename=basename
-else
- as_basename=false
-fi
-
-if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
- as_dirname=dirname
-else
- as_dirname=false
-fi
-
-as_me=`$as_basename -- "$0" ||
-$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
- X"$0" : 'X\(//\)$' \| \
- X"$0" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X/"$0" |
- sed '/^.*\/\([^/][^/]*\)\/*$/{
- s//\1/
- q
- }
- /^X\/\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\/\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
-
-# Avoid depending upon Character Ranges.
-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
-
-
- as_lineno_1=$LINENO as_lineno_1a=$LINENO
- as_lineno_2=$LINENO as_lineno_2a=$LINENO
- eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
- test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
- # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-)
- sed -n '
- p
- /[$]LINENO/=
- ' <$as_myself |
- sed '
- s/[$]LINENO.*/&-/
- t lineno
- b
- :lineno
- N
- :loop
- s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
- t loop
- s/-\n.*//
- ' >$as_me.lineno &&
- chmod +x "$as_me.lineno" ||
- { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
-
- # Don't try to exec as it changes $[0], causing all sort of problems
- # (the dirname of $[0] is not the place where we might find the
- # original and so on. Autoconf is especially sensitive to this).
- . "./$as_me.lineno"
- # Exit status is that of the last command.
- exit
-}
-
-ECHO_C= ECHO_N= ECHO_T=
-case `echo -n x` in #(((((
--n*)
- case `echo 'xy\c'` in
- *c*) ECHO_T=' ';; # ECHO_T is single tab character.
- xy) ECHO_C='\c';;
- *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
- ECHO_T=' ';;
- esac;;
-*)
- ECHO_N='-n';;
-esac
-
-rm -f conf$$ conf$$.exe conf$$.file
-if test -d conf$$.dir; then
- rm -f conf$$.dir/conf$$.file
-else
- rm -f conf$$.dir
- mkdir conf$$.dir 2>/dev/null
-fi
-if (echo >conf$$.file) 2>/dev/null; then
- if ln -s conf$$.file conf$$ 2>/dev/null; then
- as_ln_s='ln -s'
- # ... but there are two gotchas:
- # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
- # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
- # In both cases, we have to default to `cp -p'.
- ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
- as_ln_s='cp -p'
- elif ln conf$$.file conf$$ 2>/dev/null; then
- as_ln_s=ln
- else
- as_ln_s='cp -p'
- fi
-else
- as_ln_s='cp -p'
-fi
-rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
-rmdir conf$$.dir 2>/dev/null
-
-if mkdir -p . 2>/dev/null; then
- as_mkdir_p='mkdir -p "$as_dir"'
-else
- test -d ./-p && rmdir ./-p
- as_mkdir_p=false
-fi
-
-if test -x / >/dev/null 2>&1; then
- as_test_x='test -x'
-else
- if ls -dL / >/dev/null 2>&1; then
- as_ls_L_option=L
- else
- as_ls_L_option=
- fi
- as_test_x='
- eval sh -c '\''
- if test -d "$1"; then
- test -d "$1/.";
- else
- case $1 in #(
- -*)set "./$1";;
- esac;
- case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
- ???[sx]*):;;*)false;;esac;fi
- '\'' sh
- '
-fi
-as_executable_p=$as_test_x
-
-# Sed expression to map a string onto a valid CPP name.
-as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
-
-# Sed expression to map a string onto a valid variable name.
-as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
-
-
-test -n "$DJDIR" || exec 7<&0 </dev/null
-exec 6>&1
-
-# Name of the host.
-# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
-# so uname gets run too.
-ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
-
-#
-# Initializations.
-#
-ac_default_prefix=/usr/local
-ac_clean_files=
-ac_config_libobj_dir=.
-LIBOBJS=
-cross_compiling=no
-subdirs=
-MFLAGS=
-MAKEFLAGS=
-
-# Identity of this package.
-PACKAGE_NAME='OpenSSH'
-PACKAGE_TARNAME='openssh'
-PACKAGE_VERSION='Portable'
-PACKAGE_STRING='OpenSSH Portable'
-PACKAGE_BUGREPORT='openssh-unix-dev@mindrot.org'
-PACKAGE_URL=''
-
-ac_unique_file="ssh.c"
-# Factoring default headers for most tests.
-ac_includes_default="\
-#include <stdio.h>
-#ifdef HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-#ifdef HAVE_SYS_STAT_H
-# include <sys/stat.h>
-#endif
-#ifdef STDC_HEADERS
-# include <stdlib.h>
-# include <stddef.h>
-#else
-# ifdef HAVE_STDLIB_H
-# include <stdlib.h>
-# endif
-#endif
-#ifdef HAVE_STRING_H
-# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
-# include <memory.h>
-# endif
-# include <string.h>
-#endif
-#ifdef HAVE_STRINGS_H
-# include <strings.h>
-#endif
-#ifdef HAVE_INTTYPES_H
-# include <inttypes.h>
-#endif
-#ifdef HAVE_STDINT_H
-# include <stdint.h>
-#endif
-#ifdef HAVE_UNISTD_H
-# include <unistd.h>
-#endif"
-
-ac_subst_vars='LTLIBOBJS
-LIBOBJS
-UNSUPPORTED_ALGORITHMS
-TEST_MALLOC_OPTIONS
-TEST_SSH_IPV6
-piddir
-user_path
-mansubdir
-MANTYPE
-XAUTH_PATH
-STRIP_OPT
-xauth_path
-PRIVSEP_PATH
-K5LIBS
-GSSLIBS
-KRB5CONF
-SSHDLIBS
-SSHLIBS
-SSH_PRIVSEP_USER
-COMMENT_OUT_ECC
-TEST_SSH_ECC
-LIBEDIT
-PKGCONFIG
-LD
-PATH_PASSWD_PROG
-LOGIN_PROGRAM_FALLBACK
-STARTUP_SCRIPT_SHELL
-MAKE_PACKAGE_SUPPORTED
-PATH_USERADD_PROG
-PATH_GROUPADD_PROG
-MANFMT
-TEST_SHELL
-MANDOC
-NROFF
-GROFF
-SH
-TEST_MINUS_S_SH
-ENT
-SED
-PERL
-KILL
-CAT
-AR
-INSTALL_DATA
-INSTALL_SCRIPT
-INSTALL_PROGRAM
-RANLIB
-AWK
-EGREP
-GREP
-CPP
-host_os
-host_vendor
-host_cpu
-host
-build_os
-build_vendor
-build_cpu
-build
-OBJEXT
-EXEEXT
-ac_ct_CC
-CPPFLAGS
-LDFLAGS
-CFLAGS
-CC
-target_alias
-host_alias
-build_alias
-LIBS
-ECHO_T
-ECHO_N
-ECHO_C
-DEFS
-mandir
-localedir
-libdir
-psdir
-pdfdir
-dvidir
-htmldir
-infodir
-docdir
-oldincludedir
-includedir
-localstatedir
-sharedstatedir
-sysconfdir
-datadir
-datarootdir
-libexecdir
-sbindir
-bindir
-program_transform_name
-prefix
-exec_prefix
-PACKAGE_URL
-PACKAGE_BUGREPORT
-PACKAGE_STRING
-PACKAGE_VERSION
-PACKAGE_TARNAME
-PACKAGE_NAME
-PATH_SEPARATOR
-SHELL'
-ac_subst_files=''
-ac_user_opts='
-enable_option_checking
-enable_largefile
-with_stackprotect
-with_hardening
-with_rpath
-with_cflags
-with_cppflags
-with_ldflags
-with_libs
-with_Werror
-with_solaris_contracts
-with_solaris_projects
-with_osfsia
-with_zlib
-with_zlib_version_check
-with_skey
-with_tcp_wrappers
-with_ldns
-with_libedit
-with_audit
-with_pie
-with_ssl_dir
-with_openssl_header_check
-with_ssl_engine
-with_prngd_port
-with_prngd_socket
-with_pam
-with_privsep_user
-with_sandbox
-with_selinux
-with_kerberos5
-with_privsep_path
-with_xauth
-enable_strip
-with_maildir
-with_mantype
-with_md5_passwords
-with_shadow
-with_ipaddr_display
-enable_etc_default_login
-with_default_path
-with_superuser_path
-with_4in6
-with_bsd_auth
-with_pid_dir
-enable_lastlog
-enable_utmp
-enable_utmpx
-enable_wtmp
-enable_wtmpx
-enable_libutil
-enable_pututline
-enable_pututxline
-with_lastlog
-'
- ac_precious_vars='build_alias
-host_alias
-target_alias
-CC
-CFLAGS
-LDFLAGS
-LIBS
-CPPFLAGS
-CPP'
-
-
-# Initialize some variables set by options.
-ac_init_help=
-ac_init_version=false
-ac_unrecognized_opts=
-ac_unrecognized_sep=
-# The variables have the same names as the options, with
-# dashes changed to underlines.
-cache_file=/dev/null
-exec_prefix=NONE
-no_create=
-no_recursion=
-prefix=NONE
-program_prefix=NONE
-program_suffix=NONE
-program_transform_name=s,x,x,
-silent=
-site=
-srcdir=
-verbose=
-x_includes=NONE
-x_libraries=NONE
-
-# Installation directory options.
-# These are left unexpanded so users can "make install exec_prefix=/foo"
-# and all the variables that are supposed to be based on exec_prefix
-# by default will actually change.
-# Use braces instead of parens because sh, perl, etc. also accept them.
-# (The list follows the same order as the GNU Coding Standards.)
-bindir='${exec_prefix}/bin'
-sbindir='${exec_prefix}/sbin'
-libexecdir='${exec_prefix}/libexec'
-datarootdir='${prefix}/share'
-datadir='${datarootdir}'
-sysconfdir='${prefix}/etc'
-sharedstatedir='${prefix}/com'
-localstatedir='${prefix}/var'
-includedir='${prefix}/include'
-oldincludedir='/usr/include'
-docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
-infodir='${datarootdir}/info'
-htmldir='${docdir}'
-dvidir='${docdir}'
-pdfdir='${docdir}'
-psdir='${docdir}'
-libdir='${exec_prefix}/lib'
-localedir='${datarootdir}/locale'
-mandir='${datarootdir}/man'
-
-ac_prev=
-ac_dashdash=
-for ac_option
-do
- # If the previous option needs an argument, assign it.
- if test -n "$ac_prev"; then
- eval $ac_prev=\$ac_option
- ac_prev=
- continue
- fi
-
- case $ac_option in
- *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
- *=) ac_optarg= ;;
- *) ac_optarg=yes ;;
- esac
-
- # Accept the important Cygnus configure options, so we can diagnose typos.
-
- case $ac_dashdash$ac_option in
- --)
- ac_dashdash=yes ;;
-
- -bindir | --bindir | --bindi | --bind | --bin | --bi)
- ac_prev=bindir ;;
- -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
- bindir=$ac_optarg ;;
-
- -build | --build | --buil | --bui | --bu)
- ac_prev=build_alias ;;
- -build=* | --build=* | --buil=* | --bui=* | --bu=*)
- build_alias=$ac_optarg ;;
-
- -cache-file | --cache-file | --cache-fil | --cache-fi \
- | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
- ac_prev=cache_file ;;
- -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
- | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
- cache_file=$ac_optarg ;;
-
- --config-cache | -C)
- cache_file=config.cache ;;
-
- -datadir | --datadir | --datadi | --datad)
- ac_prev=datadir ;;
- -datadir=* | --datadir=* | --datadi=* | --datad=*)
- datadir=$ac_optarg ;;
-
- -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
- | --dataroo | --dataro | --datar)
- ac_prev=datarootdir ;;
- -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
- | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
- datarootdir=$ac_optarg ;;
-
- -disable-* | --disable-*)
- ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
- # Reject names that are not valid shell variable names.
- expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
- as_fn_error $? "invalid feature name: $ac_useropt"
- ac_useropt_orig=$ac_useropt
- ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
- case $ac_user_opts in
- *"
-"enable_$ac_useropt"
-"*) ;;
- *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
- ac_unrecognized_sep=', ';;
- esac
- eval enable_$ac_useropt=no ;;
-
- -docdir | --docdir | --docdi | --doc | --do)
- ac_prev=docdir ;;
- -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
- docdir=$ac_optarg ;;
-
- -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
- ac_prev=dvidir ;;
- -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
- dvidir=$ac_optarg ;;
-
- -enable-* | --enable-*)
- ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
- # Reject names that are not valid shell variable names.
- expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
- as_fn_error $? "invalid feature name: $ac_useropt"
- ac_useropt_orig=$ac_useropt
- ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
- case $ac_user_opts in
- *"
-"enable_$ac_useropt"
-"*) ;;
- *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
- ac_unrecognized_sep=', ';;
- esac
- eval enable_$ac_useropt=\$ac_optarg ;;
-
- -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
- | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
- | --exec | --exe | --ex)
- ac_prev=exec_prefix ;;
- -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
- | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
- | --exec=* | --exe=* | --ex=*)
- exec_prefix=$ac_optarg ;;
-
- -gas | --gas | --ga | --g)
- # Obsolete; use --with-gas.
- with_gas=yes ;;
-
- -help | --help | --hel | --he | -h)
- ac_init_help=long ;;
- -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
- ac_init_help=recursive ;;
- -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
- ac_init_help=short ;;
-
- -host | --host | --hos | --ho)
- ac_prev=host_alias ;;
- -host=* | --host=* | --hos=* | --ho=*)
- host_alias=$ac_optarg ;;
-
- -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
- ac_prev=htmldir ;;
- -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
- | --ht=*)
- htmldir=$ac_optarg ;;
-
- -includedir | --includedir | --includedi | --included | --include \
- | --includ | --inclu | --incl | --inc)
- ac_prev=includedir ;;
- -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
- | --includ=* | --inclu=* | --incl=* | --inc=*)
- includedir=$ac_optarg ;;
-
- -infodir | --infodir | --infodi | --infod | --info | --inf)
- ac_prev=infodir ;;
- -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
- infodir=$ac_optarg ;;
-
- -libdir | --libdir | --libdi | --libd)
- ac_prev=libdir ;;
- -libdir=* | --libdir=* | --libdi=* | --libd=*)
- libdir=$ac_optarg ;;
-
- -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
- | --libexe | --libex | --libe)
- ac_prev=libexecdir ;;
- -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
- | --libexe=* | --libex=* | --libe=*)
- libexecdir=$ac_optarg ;;
-
- -localedir | --localedir | --localedi | --localed | --locale)
- ac_prev=localedir ;;
- -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
- localedir=$ac_optarg ;;
-
- -localstatedir | --localstatedir | --localstatedi | --localstated \
- | --localstate | --localstat | --localsta | --localst | --locals)
- ac_prev=localstatedir ;;
- -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
- | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
- localstatedir=$ac_optarg ;;
-
- -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
- ac_prev=mandir ;;
- -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
- mandir=$ac_optarg ;;
-
- -nfp | --nfp | --nf)
- # Obsolete; use --without-fp.
- with_fp=no ;;
-
- -no-create | --no-create | --no-creat | --no-crea | --no-cre \
- | --no-cr | --no-c | -n)
- no_create=yes ;;
-
- -no-recursion | --no-recursion | --no-recursio | --no-recursi \
- | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
- no_recursion=yes ;;
-
- -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
- | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
- | --oldin | --oldi | --old | --ol | --o)
- ac_prev=oldincludedir ;;
- -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
- | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
- | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
- oldincludedir=$ac_optarg ;;
-
- -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
- ac_prev=prefix ;;
- -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
- prefix=$ac_optarg ;;
-
- -program-prefix | --program-prefix | --program-prefi | --program-pref \
- | --program-pre | --program-pr | --program-p)
- ac_prev=program_prefix ;;
- -program-prefix=* | --program-prefix=* | --program-prefi=* \
- | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
- program_prefix=$ac_optarg ;;
-
- -program-suffix | --program-suffix | --program-suffi | --program-suff \
- | --program-suf | --program-su | --program-s)
- ac_prev=program_suffix ;;
- -program-suffix=* | --program-suffix=* | --program-suffi=* \
- | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
- program_suffix=$ac_optarg ;;
-
- -program-transform-name | --program-transform-name \
- | --program-transform-nam | --program-transform-na \
- | --program-transform-n | --program-transform- \
- | --program-transform | --program-transfor \
- | --program-transfo | --program-transf \
- | --program-trans | --program-tran \
- | --progr-tra | --program-tr | --program-t)
- ac_prev=program_transform_name ;;
- -program-transform-name=* | --program-transform-name=* \
- | --program-transform-nam=* | --program-transform-na=* \
- | --program-transform-n=* | --program-transform-=* \
- | --program-transform=* | --program-transfor=* \
- | --program-transfo=* | --program-transf=* \
- | --program-trans=* | --program-tran=* \
- | --progr-tra=* | --program-tr=* | --program-t=*)
- program_transform_name=$ac_optarg ;;
-
- -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
- ac_prev=pdfdir ;;
- -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
- pdfdir=$ac_optarg ;;
-
- -psdir | --psdir | --psdi | --psd | --ps)
- ac_prev=psdir ;;
- -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
- psdir=$ac_optarg ;;
-
- -q | -quiet | --quiet | --quie | --qui | --qu | --q \
- | -silent | --silent | --silen | --sile | --sil)
- silent=yes ;;
-
- -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
- ac_prev=sbindir ;;
- -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
- | --sbi=* | --sb=*)
- sbindir=$ac_optarg ;;
-
- -sharedstatedir | --sharedstatedir | --sharedstatedi \
- | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
- | --sharedst | --shareds | --shared | --share | --shar \
- | --sha | --sh)
- ac_prev=sharedstatedir ;;
- -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
- | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
- | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
- | --sha=* | --sh=*)
- sharedstatedir=$ac_optarg ;;
-
- -site | --site | --sit)
- ac_prev=site ;;
- -site=* | --site=* | --sit=*)
- site=$ac_optarg ;;
-
- -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
- ac_prev=srcdir ;;
- -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
- srcdir=$ac_optarg ;;
-
- -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
- | --syscon | --sysco | --sysc | --sys | --sy)
- ac_prev=sysconfdir ;;
- -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
- | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
- sysconfdir=$ac_optarg ;;
-
- -target | --target | --targe | --targ | --tar | --ta | --t)
- ac_prev=target_alias ;;
- -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
- target_alias=$ac_optarg ;;
-
- -v | -verbose | --verbose | --verbos | --verbo | --verb)
- verbose=yes ;;
-
- -version | --version | --versio | --versi | --vers | -V)
- ac_init_version=: ;;
-
- -with-* | --with-*)
- ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
- # Reject names that are not valid shell variable names.
- expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
- as_fn_error $? "invalid package name: $ac_useropt"
- ac_useropt_orig=$ac_useropt
- ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
- case $ac_user_opts in
- *"
-"with_$ac_useropt"
-"*) ;;
- *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
- ac_unrecognized_sep=', ';;
- esac
- eval with_$ac_useropt=\$ac_optarg ;;
-
- -without-* | --without-*)
- ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
- # Reject names that are not valid shell variable names.
- expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
- as_fn_error $? "invalid package name: $ac_useropt"
- ac_useropt_orig=$ac_useropt
- ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
- case $ac_user_opts in
- *"
-"with_$ac_useropt"
-"*) ;;
- *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
- ac_unrecognized_sep=', ';;
- esac
- eval with_$ac_useropt=no ;;
-
- --x)
- # Obsolete; use --with-x.
- with_x=yes ;;
-
- -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
- | --x-incl | --x-inc | --x-in | --x-i)
- ac_prev=x_includes ;;
- -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
- | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
- x_includes=$ac_optarg ;;
-
- -x-libraries | --x-libraries | --x-librarie | --x-librari \
- | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
- ac_prev=x_libraries ;;
- -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
- | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
- x_libraries=$ac_optarg ;;
-
- -*) as_fn_error $? "unrecognized option: \`$ac_option'
-Try \`$0 --help' for more information"
- ;;
-
- *=*)
- ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
- # Reject names that are not valid shell variable names.
- case $ac_envvar in #(
- '' | [0-9]* | *[!_$as_cr_alnum]* )
- as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
- esac
- eval $ac_envvar=\$ac_optarg
- export $ac_envvar ;;
-
- *)
- # FIXME: should be removed in autoconf 3.0.
- $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
- expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
- $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
- : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
- ;;
-
- esac
-done
-
-if test -n "$ac_prev"; then
- ac_option=--`echo $ac_prev | sed 's/_/-/g'`
- as_fn_error $? "missing argument to $ac_option"
-fi
-
-if test -n "$ac_unrecognized_opts"; then
- case $enable_option_checking in
- no) ;;
- fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
- *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
- esac
-fi
-
-# Check all directory arguments for consistency.
-for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
- datadir sysconfdir sharedstatedir localstatedir includedir \
- oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
- libdir localedir mandir
-do
- eval ac_val=\$$ac_var
- # Remove trailing slashes.
- case $ac_val in
- */ )
- ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
- eval $ac_var=\$ac_val;;
- esac
- # Be sure to have absolute directory names.
- case $ac_val in
- [\\/$]* | ?:[\\/]* ) continue;;
- NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
- esac
- as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
-done
-
-# There might be people who depend on the old broken behavior: `$host'
-# used to hold the argument of --host etc.
-# FIXME: To remove some day.
-build=$build_alias
-host=$host_alias
-target=$target_alias
-
-# FIXME: To remove some day.
-if test "x$host_alias" != x; then
- if test "x$build_alias" = x; then
- cross_compiling=maybe
- $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host.
- If a cross compiler is detected then cross compile mode will be used" >&2
- elif test "x$build_alias" != "x$host_alias"; then
- cross_compiling=yes
- fi
-fi
-
-ac_tool_prefix=
-test -n "$host_alias" && ac_tool_prefix=$host_alias-
-
-test "$silent" = yes && exec 6>/dev/null
-
-
-ac_pwd=`pwd` && test -n "$ac_pwd" &&
-ac_ls_di=`ls -di .` &&
-ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
- as_fn_error $? "working directory cannot be determined"
-test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
- as_fn_error $? "pwd does not report name of working directory"
-
-
-# Find the source files, if location was not specified.
-if test -z "$srcdir"; then
- ac_srcdir_defaulted=yes
- # Try the directory containing this script, then the parent directory.
- ac_confdir=`$as_dirname -- "$as_myself" ||
-$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$as_myself" : 'X\(//\)[^/]' \| \
- X"$as_myself" : 'X\(//\)$' \| \
- X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$as_myself" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- srcdir=$ac_confdir
- if test ! -r "$srcdir/$ac_unique_file"; then
- srcdir=..
- fi
-else
- ac_srcdir_defaulted=no
-fi
-if test ! -r "$srcdir/$ac_unique_file"; then
- test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
- as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
-fi
-ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
-ac_abs_confdir=`(
- cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
- pwd)`
-# When building in place, set srcdir=.
-if test "$ac_abs_confdir" = "$ac_pwd"; then
- srcdir=.
-fi
-# Remove unnecessary trailing slashes from srcdir.
-# Double slashes in file names in object file debugging info
-# mess up M-x gdb in Emacs.
-case $srcdir in
-*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
-esac
-for ac_var in $ac_precious_vars; do
- eval ac_env_${ac_var}_set=\${${ac_var}+set}
- eval ac_env_${ac_var}_value=\$${ac_var}
- eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
- eval ac_cv_env_${ac_var}_value=\$${ac_var}
-done
-
-#
-# Report the --help message.
-#
-if test "$ac_init_help" = "long"; then
- # 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 OpenSSH Portable to adapt to many kinds of systems.
-
-Usage: $0 [OPTION]... [VAR=VALUE]...
-
-To assign environment variables (e.g., CC, CFLAGS...), specify them as
-VAR=VALUE. See below for descriptions of some of the useful variables.
-
-Defaults for the options are specified in brackets.
-
-Configuration:
- -h, --help display this help and exit
- --help=short display options specific to this package
- --help=recursive display the short help of all the included packages
- -V, --version display version information and exit
- -q, --quiet, --silent do not print \`checking ...' messages
- --cache-file=FILE cache test results in FILE [disabled]
- -C, --config-cache alias for \`--cache-file=config.cache'
- -n, --no-create do not create output files
- --srcdir=DIR find the sources in DIR [configure dir or \`..']
-
-Installation directories:
- --prefix=PREFIX install architecture-independent files in PREFIX
- [$ac_default_prefix]
- --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
- [PREFIX]
-
-By default, \`make install' will install all the files in
-\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
-an installation prefix other than \`$ac_default_prefix' using \`--prefix',
-for instance \`--prefix=\$HOME'.
-
-For better control, use the options below.
-
-Fine tuning of the installation directories:
- --bindir=DIR user executables [EPREFIX/bin]
- --sbindir=DIR system admin executables [EPREFIX/sbin]
- --libexecdir=DIR program executables [EPREFIX/libexec]
- --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
- --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
- --localstatedir=DIR modifiable single-machine data [PREFIX/var]
- --libdir=DIR object code libraries [EPREFIX/lib]
- --includedir=DIR C header files [PREFIX/include]
- --oldincludedir=DIR C header files for non-gcc [/usr/include]
- --datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
- --datadir=DIR read-only architecture-independent data [DATAROOTDIR]
- --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/openssh]
- --htmldir=DIR html documentation [DOCDIR]
- --dvidir=DIR dvi documentation [DOCDIR]
- --pdfdir=DIR pdf documentation [DOCDIR]
- --psdir=DIR ps documentation [DOCDIR]
-_ACEOF
-
- cat <<\_ACEOF
-
-System types:
- --build=BUILD configure for building on BUILD [guessed]
- --host=HOST cross-compile to build programs to run on HOST [BUILD]
-_ACEOF
-fi
-
-if test -n "$ac_init_help"; then
- case $ac_init_help in
- short | recursive ) echo "Configuration of OpenSSH Portable:";;
- esac
- cat <<\_ACEOF
-
-Optional Features:
- --disable-option-checking ignore unrecognized --enable/--with options
- --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
- --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
- --disable-largefile omit support for large files
- --disable-strip Disable calling strip(1) on install
- --disable-etc-default-login Disable using PATH from /etc/default/login no
- --disable-lastlog disable use of lastlog even if detected no
- --disable-utmp disable use of utmp even if detected no
- --disable-utmpx disable use of utmpx even if detected no
- --disable-wtmp disable use of wtmp even if detected no
- --disable-wtmpx disable use of wtmpx even if detected no
- --disable-libutil disable use of libutil (login() etc.) no
- --disable-pututline disable use of pututline() etc. (uwtmp) no
- --disable-pututxline disable use of pututxline() etc. (uwtmpx) no
-
-Optional Packages:
- --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
- --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
- --without-stackprotect Don't use compiler's stack protection
- --without-hardening Don't use toolchain hardening flags
- --without-rpath Disable auto-added -R linker paths
- --with-cflags Specify additional flags to pass to compiler
- --with-cppflags Specify additional flags to pass to preprocessor
- --with-ldflags Specify additional flags to pass to linker
- --with-libs Specify additional libraries to link with
- --with-Werror Build main code with -Werror
- --with-solaris-contracts Enable Solaris process contracts (experimental)
- --with-solaris-projects Enable Solaris projects (experimental)
- --with-osfsia Enable Digital Unix SIA
- --with-zlib=PATH Use zlib in PATH
- --without-zlib-version-check Disable zlib version check
- --with-skey[=PATH] Enable S/Key support (optionally in PATH)
- --with-tcp-wrappers[=PATH] Enable tcpwrappers support (optionally in PATH)
- --with-ldns[=PATH] Use ldns for DNSSEC support (optionally in PATH)
- --with-libedit[=PATH] Enable libedit support for sftp
- --with-audit=module Enable audit support (modules=debug,bsm,linux)
- --with-pie Build Position Independent Executables if possible
- --with-ssl-dir=PATH Specify path to OpenSSL installation
- --without-openssl-header-check Disable OpenSSL version consistency check
- --with-ssl-engine Enable OpenSSL (hardware) ENGINE support
- --with-prngd-port=PORT read entropy from PRNGD/EGD TCP localhost:PORT
- --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)
- --with-pam Enable PAM support
- --with-privsep-user=user Specify non-privileged user for privilege separation
- --with-sandbox=style Specify privilege separation sandbox (no, darwin, rlimit, systrace, seccomp_filter, capsicum)
- --with-selinux Enable SELinux support
- --with-kerberos5=PATH Enable Kerberos 5 support
- --with-privsep-path=xxx Path for privilege separation chroot (default=/var/empty)
- --with-xauth=PATH Specify path to xauth program
- --with-maildir=/path/to/mail Specify your system mail directory
- --with-mantype=man|cat|doc Set man page type
- --with-md5-passwords Enable use of MD5 passwords
- --without-shadow Disable shadow password support
- --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY
- --with-default-path= Specify default \$PATH environment for server
- --with-superuser-path= Specify different path for super-user
- --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses
- --with-bsd-auth Enable BSD auth support
- --with-pid-dir=PATH Specify location of ssh.pid file
- --with-lastlog=FILE|DIR specify lastlog location common locations
-
-Some influential environment variables:
- CC C compiler command
- CFLAGS C compiler flags
- LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
- nonstandard directory <lib dir>
- LIBS libraries to pass to the linker, e.g. -l<library>
- CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
- you have headers in a nonstandard directory <include dir>
- CPP C preprocessor
-
-Use these variables to override the choices made by `configure' or to help
-it to find libraries and programs with nonstandard names/locations.
-
-Report bugs to <openssh-unix-dev@mindrot.org>.
-_ACEOF
-ac_status=$?
-fi
-
-if test "$ac_init_help" = "recursive"; then
- # If there are subdirs, report their specific --help.
- for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
- test -d "$ac_dir" ||
- { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
- continue
- ac_builddir=.
-
-case "$ac_dir" in
-.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
-*)
- ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
- # A ".." for each directory in $ac_dir_suffix.
- ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
- case $ac_top_builddir_sub in
- "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
- *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
- esac ;;
-esac
-ac_abs_top_builddir=$ac_pwd
-ac_abs_builddir=$ac_pwd$ac_dir_suffix
-# for backward compatibility:
-ac_top_builddir=$ac_top_build_prefix
-
-case $srcdir in
- .) # We are building in place.
- ac_srcdir=.
- ac_top_srcdir=$ac_top_builddir_sub
- ac_abs_top_srcdir=$ac_pwd ;;
- [\\/]* | ?:[\\/]* ) # Absolute name.
- ac_srcdir=$srcdir$ac_dir_suffix;
- ac_top_srcdir=$srcdir
- ac_abs_top_srcdir=$srcdir ;;
- *) # Relative name.
- ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
- ac_top_srcdir=$ac_top_build_prefix$srcdir
- ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
-esac
-ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
-
- cd "$ac_dir" || { ac_status=$?; continue; }
- # Check for guested configure.
- if test -f "$ac_srcdir/configure.gnu"; then
- echo &&
- $SHELL "$ac_srcdir/configure.gnu" --help=recursive
- elif test -f "$ac_srcdir/configure"; then
- echo &&
- $SHELL "$ac_srcdir/configure" --help=recursive
- else
- $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
- fi || ac_status=$?
- cd "$ac_pwd" || { ac_status=$?; break; }
- done
-fi
-
-test -n "$ac_init_help" && exit $ac_status
-if $ac_init_version; then
- cat <<\_ACEOF
-OpenSSH configure Portable
-generated by GNU Autoconf 2.68
-
-Copyright (C) 2010 Free Software Foundation, Inc.
-This configure script is free software; the Free Software Foundation
-gives unlimited permission to copy, distribute and modify it.
-_ACEOF
- exit
-fi
-
-## ------------------------ ##
-## Autoconf initialization. ##
-## ------------------------ ##
-
-# ac_fn_c_try_compile LINENO
-# --------------------------
-# Try to compile conftest.$ac_ext, and return whether this succeeded.
-ac_fn_c_try_compile ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- rm -f conftest.$ac_objext
- if { { ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_compile") 2>conftest.err
- ac_status=$?
- if test -s conftest.err; then
- grep -v '^ *+' conftest.err >conftest.er1
- cat conftest.er1 >&5
- mv -f conftest.er1 conftest.err
- fi
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then :
- ac_retval=0
-else
- $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_retval=1
-fi
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
- as_fn_set_status $ac_retval
-
-} # ac_fn_c_try_compile
-
-# ac_fn_c_try_run LINENO
-# ----------------------
-# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
-# that executables *can* be run.
-ac_fn_c_try_run ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- if { { ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_link") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
- { { case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; }; then :
- ac_retval=0
-else
- $as_echo "$as_me: program exited with status $ac_status" >&5
- $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_retval=$ac_status
-fi
- rm -rf conftest.dSYM conftest_ipa8_conftest.oo
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
- as_fn_set_status $ac_retval
-
-} # ac_fn_c_try_run
-
-# ac_fn_c_try_cpp LINENO
-# ----------------------
-# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
-ac_fn_c_try_cpp ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- if { { ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
- ac_status=$?
- if test -s conftest.err; then
- grep -v '^ *+' conftest.err >conftest.er1
- cat conftest.er1 >&5
- mv -f conftest.er1 conftest.err
- fi
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } > conftest.i && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then :
- ac_retval=0
-else
- $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_retval=1
-fi
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
- as_fn_set_status $ac_retval
-
-} # ac_fn_c_try_cpp
-
-# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
-# -------------------------------------------------------
-# Tests whether HEADER exists and can be compiled using the include files in
-# INCLUDES, setting the cache variable VAR accordingly.
-ac_fn_c_check_header_compile ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-$4
-#include <$2>
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- eval "$3=yes"
-else
- eval "$3=no"
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-eval ac_res=\$$3
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-
-} # ac_fn_c_check_header_compile
-
-# ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES
-# ---------------------------------------------
-# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR
-# accordingly.
-ac_fn_c_check_decl ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- as_decl_name=`echo $2|sed 's/ *(.*//'`
- as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'`
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5
-$as_echo_n "checking whether $as_decl_name is declared... " >&6; }
-if eval \${$3+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-$4
-int
-main ()
-{
-#ifndef $as_decl_name
-#ifdef __cplusplus
- (void) $as_decl_use;
-#else
- (void) $as_decl_name;
-#endif
-#endif
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- eval "$3=yes"
-else
- eval "$3=no"
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-eval ac_res=\$$3
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-
-} # ac_fn_c_check_decl
-
-# ac_fn_c_try_link LINENO
-# -----------------------
-# Try to link conftest.$ac_ext, and return whether this succeeded.
-ac_fn_c_try_link ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- rm -f conftest.$ac_objext conftest$ac_exeext
- if { { ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_link") 2>conftest.err
- ac_status=$?
- if test -s conftest.err; then
- grep -v '^ *+' conftest.err >conftest.er1
- cat conftest.er1 >&5
- mv -f conftest.er1 conftest.err
- fi
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext && {
- test "$cross_compiling" = yes ||
- $as_test_x conftest$ac_exeext
- }; then :
- ac_retval=0
-else
- $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_retval=1
-fi
- # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
- # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
- # interfere with the next link command; also delete a directory that is
- # left behind by Apple's compiler. We do this before executing the actions.
- rm -rf conftest.dSYM conftest_ipa8_conftest.oo
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
- as_fn_set_status $ac_retval
-
-} # ac_fn_c_try_link
-
-# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES
-# -------------------------------------------------------
-# Tests whether HEADER exists, giving a warning if it cannot be compiled using
-# the include files in INCLUDES and setting the cache variable VAR
-# accordingly.
-ac_fn_c_check_header_mongrel ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- if eval \${$3+:} false; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
- $as_echo_n "(cached) " >&6
-fi
-eval ac_res=\$$3
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-else
- # Is the header compilable?
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5
-$as_echo_n "checking $2 usability... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-$4
-#include <$2>
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_header_compiler=yes
-else
- ac_header_compiler=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5
-$as_echo "$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5
-$as_echo_n "checking $2 presence... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <$2>
-_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
- ac_header_preproc=yes
-else
- ac_header_preproc=no
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5
-$as_echo "$ac_header_preproc" >&6; }
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #((
- yes:no: )
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5
-$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
-$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
- ;;
- no:yes:* )
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5
-$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5
-$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5
-$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5
-$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
-$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
-( $as_echo "## ------------------------------------------- ##
-## Report this to openssh-unix-dev@mindrot.org ##
-## ------------------------------------------- ##"
- ) | sed "s/^/$as_me: WARNING: /" >&2
- ;;
-esac
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- eval "$3=\$ac_header_compiler"
-fi
-eval ac_res=\$$3
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-fi
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-
-} # ac_fn_c_check_header_mongrel
-
-# ac_fn_c_check_func LINENO FUNC VAR
-# ----------------------------------
-# Tests whether FUNC exists, setting the cache variable VAR accordingly
-ac_fn_c_check_func ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-/* Define $2 to an innocuous variant, in case <limits.h> declares $2.
- For example, HP-UX 11i <limits.h> declares gettimeofday. */
-#define $2 innocuous_$2
-
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $2 (); below.
- Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $2
-
-/* 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 $2 ();
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined __stub_$2 || defined __stub___$2
-choke me
-#endif
-
-int
-main ()
-{
-return $2 ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- eval "$3=yes"
-else
- eval "$3=no"
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-fi
-eval ac_res=\$$3
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-
-} # ac_fn_c_check_func
-
-# ac_fn_c_check_type LINENO TYPE VAR INCLUDES
-# -------------------------------------------
-# Tests whether TYPE exists after having included INCLUDES, setting cache
-# variable VAR accordingly.
-ac_fn_c_check_type ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- eval "$3=no"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-$4
-int
-main ()
-{
-if (sizeof ($2))
- return 0;
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-$4
-int
-main ()
-{
-if (sizeof (($2)))
- return 0;
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-else
- eval "$3=yes"
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-eval ac_res=\$$3
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-
-} # ac_fn_c_check_type
-
-# ac_fn_c_compute_int LINENO EXPR VAR INCLUDES
-# --------------------------------------------
-# Tries to find the compile-time value of EXPR in a program that includes
-# INCLUDES, setting VAR accordingly. Returns whether the value could be
-# computed
-ac_fn_c_compute_int ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- if test "$cross_compiling" = yes; then
- # Depending upon the size, compute the lo and hi bounds.
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-$4
-int
-main ()
-{
-static int test_array [1 - 2 * !(($2) >= 0)];
-test_array [0] = 0
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_lo=0 ac_mid=0
- while :; do
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-$4
-int
-main ()
-{
-static int test_array [1 - 2 * !(($2) <= $ac_mid)];
-test_array [0] = 0
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_hi=$ac_mid; break
-else
- as_fn_arith $ac_mid + 1 && ac_lo=$as_val
- if test $ac_lo -le $ac_mid; then
- ac_lo= ac_hi=
- break
- fi
- as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- done
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-$4
-int
-main ()
-{
-static int test_array [1 - 2 * !(($2) < 0)];
-test_array [0] = 0
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_hi=-1 ac_mid=-1
- while :; do
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-$4
-int
-main ()
-{
-static int test_array [1 - 2 * !(($2) >= $ac_mid)];
-test_array [0] = 0
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_lo=$ac_mid; break
-else
- as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val
- if test $ac_mid -le $ac_hi; then
- ac_lo= ac_hi=
- break
- fi
- as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- done
-else
- ac_lo= ac_hi=
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-# Binary search between lo and hi bounds.
-while test "x$ac_lo" != "x$ac_hi"; do
- as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-$4
-int
-main ()
-{
-static int test_array [1 - 2 * !(($2) <= $ac_mid)];
-test_array [0] = 0
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_hi=$ac_mid
-else
- as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-done
-case $ac_lo in #((
-?*) eval "$3=\$ac_lo"; ac_retval=0 ;;
-'') ac_retval=1 ;;
-esac
- else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-$4
-static long int longval () { return $2; }
-static unsigned long int ulongval () { return $2; }
-#include <stdio.h>
-#include <stdlib.h>
-int
-main ()
-{
-
- FILE *f = fopen ("conftest.val", "w");
- if (! f)
- return 1;
- if (($2) < 0)
- {
- long int i = longval ();
- if (i != ($2))
- return 1;
- fprintf (f, "%ld", i);
- }
- else
- {
- unsigned long int i = ulongval ();
- if (i != ($2))
- return 1;
- fprintf (f, "%lu", i);
- }
- /* Do not output a trailing newline, as this causes \r\n confusion
- on some platforms. */
- return ferror (f) || fclose (f) != 0;
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
- echo >>conftest.val; read $3 <conftest.val; ac_retval=0
-else
- ac_retval=1
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
-rm -f conftest.val
-
- fi
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
- as_fn_set_status $ac_retval
-
-} # ac_fn_c_compute_int
-
-# ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES
-# ----------------------------------------------------
-# Tries to find if the field MEMBER exists in type AGGR, after including
-# INCLUDES, setting cache variable VAR accordingly.
-ac_fn_c_check_member ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5
-$as_echo_n "checking for $2.$3... " >&6; }
-if eval \${$4+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-$5
-int
-main ()
-{
-static $2 ac_aggr;
-if (ac_aggr.$3)
-return 0;
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- eval "$4=yes"
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-$5
-int
-main ()
-{
-static $2 ac_aggr;
-if (sizeof ac_aggr.$3)
-return 0;
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- eval "$4=yes"
-else
- eval "$4=no"
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-eval ac_res=\$$4
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-
-} # ac_fn_c_check_member
-cat >config.log <<_ACEOF
-This file contains any messages produced by compilers while
-running configure, to aid debugging if configure makes a mistake.
-
-It was created by OpenSSH $as_me Portable, which was
-generated by GNU Autoconf 2.68. Invocation command line was
-
- $ $0 $@
-
-_ACEOF
-exec 5>>config.log
-{
-cat <<_ASUNAME
-## --------- ##
-## Platform. ##
-## --------- ##
-
-hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
-uname -m = `(uname -m) 2>/dev/null || echo unknown`
-uname -r = `(uname -r) 2>/dev/null || echo unknown`
-uname -s = `(uname -s) 2>/dev/null || echo unknown`
-uname -v = `(uname -v) 2>/dev/null || echo unknown`
-
-/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
-/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`
-
-/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
-/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
-/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
-/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown`
-/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
-/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
-/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
-
-_ASUNAME
-
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- $as_echo "PATH: $as_dir"
- done
-IFS=$as_save_IFS
-
-} >&5
-
-cat >&5 <<_ACEOF
-
-
-## ----------- ##
-## Core tests. ##
-## ----------- ##
-
-_ACEOF
-
-
-# Keep a trace of the command line.
-# Strip out --no-create and --no-recursion so they do not pile up.
-# Strip out --silent because we don't want to record it for future runs.
-# Also quote any args containing shell meta-characters.
-# Make two passes to allow for proper duplicate-argument suppression.
-ac_configure_args=
-ac_configure_args0=
-ac_configure_args1=
-ac_must_keep_next=false
-for ac_pass in 1 2
-do
- for ac_arg
- do
- case $ac_arg in
- -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
- -q | -quiet | --quiet | --quie | --qui | --qu | --q \
- | -silent | --silent | --silen | --sile | --sil)
- continue ;;
- *\'*)
- ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
- esac
- case $ac_pass in
- 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
- 2)
- as_fn_append ac_configure_args1 " '$ac_arg'"
- if test $ac_must_keep_next = true; then
- ac_must_keep_next=false # Got value, back to normal.
- else
- case $ac_arg in
- *=* | --config-cache | -C | -disable-* | --disable-* \
- | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
- | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
- | -with-* | --with-* | -without-* | --without-* | --x)
- case "$ac_configure_args0 " in
- "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
- esac
- ;;
- -* ) ac_must_keep_next=true ;;
- esac
- fi
- as_fn_append ac_configure_args " '$ac_arg'"
- ;;
- esac
- done
-done
-{ ac_configure_args0=; unset ac_configure_args0;}
-{ ac_configure_args1=; unset ac_configure_args1;}
-
-# When interrupted or exit'd, cleanup temporary files, and complete
-# config.log. We remove comments because anyway the quotes in there
-# would cause problems or look ugly.
-# WARNING: Use '\'' to represent an apostrophe within the trap.
-# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
-trap 'exit_status=$?
- # Save into config.log some information that might help in debugging.
- {
- echo
-
- $as_echo "## ---------------- ##
-## Cache variables. ##
-## ---------------- ##"
- echo
- # The following way of writing the cache mishandles newlines in values,
-(
- for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
- eval ac_val=\$$ac_var
- case $ac_val in #(
- *${as_nl}*)
- case $ac_var in #(
- *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
-$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
- esac
- case $ac_var in #(
- _ | IFS | as_nl) ;; #(
- BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
- *) { eval $ac_var=; unset $ac_var;} ;;
- esac ;;
- esac
- done
- (set) 2>&1 |
- case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
- *${as_nl}ac_space=\ *)
- sed -n \
- "s/'\''/'\''\\\\'\'''\''/g;
- s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
- ;; #(
- *)
- sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
- ;;
- esac |
- sort
-)
- echo
-
- $as_echo "## ----------------- ##
-## Output variables. ##
-## ----------------- ##"
- echo
- for ac_var in $ac_subst_vars
- do
- eval ac_val=\$$ac_var
- case $ac_val in
- *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
- esac
- $as_echo "$ac_var='\''$ac_val'\''"
- done | sort
- echo
-
- if test -n "$ac_subst_files"; then
- $as_echo "## ------------------- ##
-## File substitutions. ##
-## ------------------- ##"
- echo
- for ac_var in $ac_subst_files
- do
- eval ac_val=\$$ac_var
- case $ac_val in
- *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
- esac
- $as_echo "$ac_var='\''$ac_val'\''"
- done | sort
- echo
- fi
-
- if test -s confdefs.h; then
- $as_echo "## ----------- ##
-## confdefs.h. ##
-## ----------- ##"
- echo
- cat confdefs.h
- echo
- fi
- test "$ac_signal" != 0 &&
- $as_echo "$as_me: caught signal $ac_signal"
- $as_echo "$as_me: exit $exit_status"
- } >&5
- rm -f core *.core core.conftest.* &&
- rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
- exit $exit_status
-' 0
-for ac_signal in 1 2 13 15; do
- trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal
-done
-ac_signal=0
-
-# confdefs.h avoids OS command line length limits that DEFS can exceed.
-rm -f -r conftest* confdefs.h
-
-$as_echo "/* confdefs.h */" > confdefs.h
-
-# Predefined preprocessor variables.
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_NAME "$PACKAGE_NAME"
-_ACEOF
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
-_ACEOF
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_VERSION "$PACKAGE_VERSION"
-_ACEOF
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_STRING "$PACKAGE_STRING"
-_ACEOF
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
-_ACEOF
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_URL "$PACKAGE_URL"
-_ACEOF
-
-
-# Let the site file select an alternate cache file if it wants to.
-# Prefer an explicitly selected file to automatically selected ones.
-ac_site_file1=NONE
-ac_site_file2=NONE
-if test -n "$CONFIG_SITE"; then
- # We do not want a PATH search for config.site.
- case $CONFIG_SITE in #((
- -*) ac_site_file1=./$CONFIG_SITE;;
- */*) ac_site_file1=$CONFIG_SITE;;
- *) ac_site_file1=./$CONFIG_SITE;;
- esac
-elif test "x$prefix" != xNONE; then
- ac_site_file1=$prefix/share/config.site
- ac_site_file2=$prefix/etc/config.site
-else
- ac_site_file1=$ac_default_prefix/share/config.site
- ac_site_file2=$ac_default_prefix/etc/config.site
-fi
-for ac_site_file in "$ac_site_file1" "$ac_site_file2"
-do
- test "x$ac_site_file" = xNONE && continue
- if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
-$as_echo "$as_me: loading site script $ac_site_file" >&6;}
- sed 's/^/| /' "$ac_site_file" >&5
- . "$ac_site_file" \
- || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "failed to load site script $ac_site_file
-See \`config.log' for more details" "$LINENO" 5; }
- fi
-done
-
-if test -r "$cache_file"; then
- # Some versions of bash will fail to source /dev/null (special files
- # actually), so we avoid doing that. DJGPP emulates it as a regular file.
- if test /dev/null != "$cache_file" && test -f "$cache_file"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
-$as_echo "$as_me: loading cache $cache_file" >&6;}
- case $cache_file in
- [\\/]* | ?:[\\/]* ) . "$cache_file";;
- *) . "./$cache_file";;
- esac
- fi
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
-$as_echo "$as_me: creating cache $cache_file" >&6;}
- >$cache_file
-fi
-
-# Check that the precious variables saved in the cache have kept the same
-# value.
-ac_cache_corrupted=false
-for ac_var in $ac_precious_vars; do
- eval ac_old_set=\$ac_cv_env_${ac_var}_set
- eval ac_new_set=\$ac_env_${ac_var}_set
- eval ac_old_val=\$ac_cv_env_${ac_var}_value
- eval ac_new_val=\$ac_env_${ac_var}_value
- case $ac_old_set,$ac_new_set in
- set,)
- { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
-$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
- ac_cache_corrupted=: ;;
- ,set)
- { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
-$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
- ac_cache_corrupted=: ;;
- ,);;
- *)
- if test "x$ac_old_val" != "x$ac_new_val"; then
- # differences in whitespace do not lead to failure.
- ac_old_val_w=`echo x $ac_old_val`
- ac_new_val_w=`echo x $ac_new_val`
- if test "$ac_old_val_w" != "$ac_new_val_w"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
-$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
- ac_cache_corrupted=:
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
-$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
- eval $ac_var=\$ac_old_val
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5
-$as_echo "$as_me: former value: \`$ac_old_val'" >&2;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5
-$as_echo "$as_me: current value: \`$ac_new_val'" >&2;}
- fi;;
- esac
- # Pass precious variables to config.status.
- if test "$ac_new_set" = set; then
- case $ac_new_val in
- *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
- *) ac_arg=$ac_var=$ac_new_val ;;
- esac
- case " $ac_configure_args " in
- *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
- *) as_fn_append ac_configure_args " '$ac_arg'" ;;
- esac
- fi
-done
-if $ac_cache_corrupted; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
-$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
- as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
-fi
-## -------------------- ##
-## Main body of script. ##
-## -------------------- ##
-
-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
-
-
-
-
-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
-
-
-ac_config_headers="$ac_config_headers config.h"
-
-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
-if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
-set dummy ${ac_tool_prefix}gcc; 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 :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$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_CC="${ac_tool_prefix}gcc"
- $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
-
-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; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_CC"; then
- ac_ct_CC=$CC
- # Extract the first word of "gcc", so it can be a program name with args.
-set dummy gcc; 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_ac_ct_CC+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_CC"; then
- ac_cv_prog_ac_ct_CC="$ac_ct_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_ac_ct_CC="gcc"
- $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
-
-fi
-fi
-ac_ct_CC=$ac_cv_prog_ac_ct_CC
-if test -n "$ac_ct_CC"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
-$as_echo "$ac_ct_CC" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
- if test "x$ac_ct_CC" = x; then
- CC=""
- 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
- CC=$ac_ct_CC
- fi
-else
- CC="$ac_cv_prog_CC"
-fi
-
-if test -z "$CC"; then
- if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
-set dummy ${ac_tool_prefix}cc; 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 :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$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_CC="${ac_tool_prefix}cc"
- $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
-
-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; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- fi
-fi
-if test -z "$CC"; then
- # Extract the first word of "cc", so it can be a program name with args.
-set dummy cc; 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 :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
- ac_prog_rejected=no
-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
- if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
- ac_prog_rejected=yes
- continue
- fi
- ac_cv_prog_CC="cc"
- $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
-
-if test $ac_prog_rejected = yes; then
- # We found a bogon in the path, so make sure we never use it.
- set dummy $ac_cv_prog_CC
- shift
- if test $# != 0; then
- # We chose a different compiler from the bogus one.
- # However, it has the same basename, so the bogon will be chosen
- # first if we set CC to just the basename; use the full file name.
- shift
- ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
- fi
-fi
-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; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$CC"; then
- if test -n "$ac_tool_prefix"; then
- for ac_prog in cl.exe
- do
- # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
-set dummy $ac_tool_prefix$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_CC+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$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_CC="$ac_tool_prefix$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
-
-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; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- test -n "$CC" && break
- done
-fi
-if test -z "$CC"; then
- ac_ct_CC=$CC
- for ac_prog in cl.exe
-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_ac_ct_CC+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_CC"; then
- ac_cv_prog_ac_ct_CC="$ac_ct_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_ac_ct_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
-
-fi
-fi
-ac_ct_CC=$ac_cv_prog_ac_ct_CC
-if test -n "$ac_ct_CC"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
-$as_echo "$ac_ct_CC" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- test -n "$ac_ct_CC" && break
-done
-
- if test "x$ac_ct_CC" = x; then
- CC=""
- 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
- CC=$ac_ct_CC
- fi
-fi
-
-fi
-
-
-test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "no acceptable C compiler found in \$PATH
-See \`config.log' for more details" "$LINENO" 5; }
-
-# Provide some information about the compiler.
-$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
-set X $ac_compile
-ac_compiler=$2
-for ac_option in --version -v -V -qversion; do
- { { ac_try="$ac_compiler $ac_option >&5"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_compiler $ac_option >&5") 2>conftest.err
- ac_status=$?
- if test -s conftest.err; then
- sed '10a\
-... rest of stderr output deleted ...
- 10q' conftest.err >conftest.er1
- cat conftest.er1 >&5
- fi
- rm -f conftest.er1 conftest.err
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }
-done
-
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-ac_clean_files_save=$ac_clean_files
-ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
-# Try to create an executable without -o first, disregard a.out.
-# It will help us diagnose broken compilers, and finding out an intuition
-# of exeext.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
-$as_echo_n "checking whether the C compiler works... " >&6; }
-ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
-
-# The possible output files:
-ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
-
-ac_rmfiles=
-for ac_file in $ac_files
-do
- case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
- * ) ac_rmfiles="$ac_rmfiles $ac_file";;
- esac
-done
-rm -f $ac_rmfiles
-
-if { { ac_try="$ac_link_default"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_link_default") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then :
- # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
-# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
-# in a Makefile. We should not override ac_cv_exeext if it was cached,
-# so that the user can short-circuit this test for compilers unknown to
-# Autoconf.
-for ac_file in $ac_files ''
-do
- test -f "$ac_file" || continue
- case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
- ;;
- [ab].out )
- # We found the default executable, but exeext='' is most
- # certainly right.
- break;;
- *.* )
- if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
- then :; else
- ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
- fi
- # We set ac_cv_exeext here because the later test for it is not
- # safe: cross compilers may not add the suffix if given an `-o'
- # argument, so we may need to know it at that point already.
- # Even if this section looks crufty: it has the advantage of
- # actually working.
- break;;
- * )
- break;;
- esac
-done
-test "$ac_cv_exeext" = no && ac_cv_exeext=
-
-else
- ac_file=''
-fi
-if test -z "$ac_file"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-$as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-{ { $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 "C compiler cannot create executables
-See \`config.log' for more details" "$LINENO" 5; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
-$as_echo_n "checking for C compiler default output file name... " >&6; }
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
-$as_echo "$ac_file" >&6; }
-ac_exeext=$ac_cv_exeext
-
-rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
-ac_clean_files=$ac_clean_files_save
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
-$as_echo_n "checking for suffix of executables... " >&6; }
-if { { ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_link") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then :
- # If both `conftest.exe' and `conftest' are `present' (well, observable)
-# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will
-# work properly (i.e., refer to `conftest.exe'), while it won't with
-# `rm'.
-for ac_file in conftest.exe conftest conftest.*; do
- test -f "$ac_file" || continue
- case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
- *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
- break;;
- * ) break;;
- esac
-done
-else
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "cannot compute suffix of executables: cannot compile and link
-See \`config.log' for more details" "$LINENO" 5; }
-fi
-rm -f conftest conftest$ac_cv_exeext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
-$as_echo "$ac_cv_exeext" >&6; }
-
-rm -f conftest.$ac_ext
-EXEEXT=$ac_cv_exeext
-ac_exeext=$EXEEXT
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <stdio.h>
-int
-main ()
-{
-FILE *f = fopen ("conftest.out", "w");
- return ferror (f) || fclose (f) != 0;
-
- ;
- return 0;
-}
-_ACEOF
-ac_clean_files="$ac_clean_files conftest.out"
-# Check that the compiler produces executables we can run. If not, either
-# the compiler is broken, or we cross compile.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
-$as_echo_n "checking whether we are cross compiling... " >&6; }
-if test "$cross_compiling" != yes; then
- { { ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_link") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }
- if { ac_try='./conftest$ac_cv_exeext'
- { { case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; }; then
- cross_compiling=no
- else
- if test "$cross_compiling" = maybe; then
- cross_compiling=yes
- else
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "cannot run C compiled programs.
-If you meant to cross compile, use \`--host'.
-See \`config.log' for more details" "$LINENO" 5; }
- fi
- fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
-$as_echo "$cross_compiling" >&6; }
-
-rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
-ac_clean_files=$ac_clean_files_save
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
-$as_echo_n "checking for suffix of object files... " >&6; }
-if ${ac_cv_objext+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.o conftest.obj
-if { { ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_compile") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then :
- for ac_file in conftest.o conftest.obj conftest.*; do
- test -f "$ac_file" || continue;
- case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
- *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
- break;;
- esac
-done
-else
- $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "cannot compute suffix of object files: cannot compile
-See \`config.log' for more details" "$LINENO" 5; }
-fi
-rm -f conftest.$ac_cv_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
-$as_echo "$ac_cv_objext" >&6; }
-OBJEXT=$ac_cv_objext
-ac_objext=$OBJEXT
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
-$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
-if ${ac_cv_c_compiler_gnu+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-#ifndef __GNUC__
- choke me
-#endif
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_compiler_gnu=yes
-else
- ac_compiler_gnu=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-ac_cv_c_compiler_gnu=$ac_compiler_gnu
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
-$as_echo "$ac_cv_c_compiler_gnu" >&6; }
-if test $ac_compiler_gnu = yes; then
- GCC=yes
-else
- GCC=
-fi
-ac_test_CFLAGS=${CFLAGS+set}
-ac_save_CFLAGS=$CFLAGS
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
-$as_echo_n "checking whether $CC accepts -g... " >&6; }
-if ${ac_cv_prog_cc_g+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_save_c_werror_flag=$ac_c_werror_flag
- ac_c_werror_flag=yes
- ac_cv_prog_cc_g=no
- CFLAGS="-g"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_prog_cc_g=yes
-else
- CFLAGS=""
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-else
- ac_c_werror_flag=$ac_save_c_werror_flag
- CFLAGS="-g"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_prog_cc_g=yes
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- ac_c_werror_flag=$ac_save_c_werror_flag
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
-$as_echo "$ac_cv_prog_cc_g" >&6; }
-if test "$ac_test_CFLAGS" = set; then
- CFLAGS=$ac_save_CFLAGS
-elif test $ac_cv_prog_cc_g = yes; then
- if test "$GCC" = yes; then
- CFLAGS="-g -O2"
- else
- CFLAGS="-g"
- fi
-else
- if test "$GCC" = yes; then
- CFLAGS="-O2"
- else
- CFLAGS=
- fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
-$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
-if ${ac_cv_prog_cc_c89+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_cv_prog_cc_c89=no
-ac_save_CC=$CC
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <stdarg.h>
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
-struct buf { int x; };
-FILE * (*rcsopen) (struct buf *, struct stat *, int);
-static char *e (p, i)
- char **p;
- int i;
-{
- return p[i];
-}
-static char *f (char * (*g) (char **, int), char **p, ...)
-{
- char *s;
- va_list v;
- va_start (v,p);
- s = g (p, va_arg (v,int));
- va_end (v);
- return s;
-}
-
-/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
- function prototypes and stuff, but not '\xHH' hex character constants.
- These don't provoke an error unfortunately, instead are silently treated
- as 'x'. The following induces an error, until -std is added to get
- proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
- array size at least. It's necessary to write '\x00'==0 to get something
- that's true only with -std. */
-int osf4_cc_array ['\x00' == 0 ? 1 : -1];
-
-/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
- inside strings and character constants. */
-#define FOO(x) 'x'
-int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
-
-int test (int i, double x);
-struct s1 {int (*f) (int a);};
-struct s2 {int (*f) (double a);};
-int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
-int argc;
-char **argv;
-int
-main ()
-{
-return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
- ;
- return 0;
-}
-_ACEOF
-for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
- -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
-do
- CC="$ac_save_CC $ac_arg"
- if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_prog_cc_c89=$ac_arg
-fi
-rm -f core conftest.err conftest.$ac_objext
- test "x$ac_cv_prog_cc_c89" != "xno" && break
-done
-rm -f conftest.$ac_ext
-CC=$ac_save_CC
-
-fi
-# AC_CACHE_VAL
-case "x$ac_cv_prog_cc_c89" 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_c89"
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
-$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
-esac
-if test "x$ac_cv_prog_cc_c89" != xno; then :
-
-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
-
-ac_aux_dir=
-for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
- if test -f "$ac_dir/install-sh"; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/install-sh -c"
- break
- elif test -f "$ac_dir/install.sh"; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/install.sh -c"
- break
- elif test -f "$ac_dir/shtool"; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/shtool install -c"
- break
- fi
-done
-if test -z "$ac_aux_dir"; then
- as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5
-fi
-
-# These three variables are undocumented and unsupported,
-# and are intended to be withdrawn in a future Autoconf release.
-# They can cause serious problems if a builder's source tree is in a directory
-# whose full name contains unusual characters.
-ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var.
-ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var.
-ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
-
-
-# Make sure we can run config.sub.
-$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
- as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
-$as_echo_n "checking build system type... " >&6; }
-if ${ac_cv_build+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_build_alias=$build_alias
-test "x$ac_build_alias" = x &&
- ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
-test "x$ac_build_alias" = x &&
- as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
-ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
- as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
-$as_echo "$ac_cv_build" >&6; }
-case $ac_cv_build in
-*-*-*) ;;
-*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
-esac
-build=$ac_cv_build
-ac_save_IFS=$IFS; IFS='-'
-set x $ac_cv_build
-shift
-build_cpu=$1
-build_vendor=$2
-shift; shift
-# Remember, the first character of IFS is used to create $*,
-# except with old shells:
-build_os=$*
-IFS=$ac_save_IFS
-case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
-$as_echo_n "checking host system type... " >&6; }
-if ${ac_cv_host+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test "x$host_alias" = x; then
- ac_cv_host=$ac_cv_build
-else
- ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
- as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
-$as_echo "$ac_cv_host" >&6; }
-case $ac_cv_host in
-*-*-*) ;;
-*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
-esac
-host=$ac_cv_host
-ac_save_IFS=$IFS; IFS='-'
-set x $ac_cv_host
-shift
-host_cpu=$1
-host_vendor=$2
-shift; shift
-# Remember, the first character of IFS is used to create $*,
-# except with old shells:
-host_os=$*
-IFS=$ac_save_IFS
-case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; 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
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
-$as_echo_n "checking how to run the C preprocessor... " >&6; }
-# On Suns, sometimes $CPP names a directory.
-if test -n "$CPP" && test -d "$CPP"; then
- CPP=
-fi
-if test -z "$CPP"; then
- if ${ac_cv_prog_CPP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- # Double quotes because CPP needs to be expanded
- for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
- do
- ac_preproc_ok=false
-for ac_c_preproc_warn_flag in '' yes
-do
- # Use a header file that comes with gcc, so configuring glibc
- # with a fresh cross-compiler works.
- # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- # <limits.h> exists even on freestanding compilers.
- # On the NeXT, cc -E runs the code through the compiler's parser,
- # not just through cpp. "Syntax error" is here to catch this case.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
- Syntax error
-_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
-
-else
- # Broken: fails on valid input.
-continue
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-
- # OK, works on sane cases. Now check whether nonexistent headers
- # can be detected and how.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <ac_nonexistent.h>
-_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
- # Broken: success on invalid input.
-continue
-else
- # Passes both tests.
-ac_preproc_ok=:
-break
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-
-done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.i conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then :
- break
-fi
-
- done
- ac_cv_prog_CPP=$CPP
-
-fi
- CPP=$ac_cv_prog_CPP
-else
- ac_cv_prog_CPP=$CPP
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
-$as_echo "$CPP" >&6; }
-ac_preproc_ok=false
-for ac_c_preproc_warn_flag in '' yes
-do
- # Use a header file that comes with gcc, so configuring glibc
- # with a fresh cross-compiler works.
- # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- # <limits.h> exists even on freestanding compilers.
- # On the NeXT, cc -E runs the code through the compiler's parser,
- # not just through cpp. "Syntax error" is here to catch this case.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
- Syntax error
-_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
-
-else
- # Broken: fails on valid input.
-continue
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-
- # OK, works on sane cases. Now check whether nonexistent headers
- # can be detected and how.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <ac_nonexistent.h>
-_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
- # Broken: success on invalid input.
-continue
-else
- # Passes both tests.
-ac_preproc_ok=:
-break
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-
-done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.i conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then :
-
-else
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
-See \`config.log' for more details" "$LINENO" 5; }
-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 grep that handles long lines and -e" >&5
-$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
-if ${ac_cv_path_GREP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -z "$GREP"; then
- ac_path_GREP_found=false
- # Loop through the user's path and test for each of PROGNAME-LIST
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_prog in grep ggrep; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
- { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
-# Check for GNU ac_path_GREP and select it if it is found.
- # Check for GNU $ac_path_GREP
-case `"$ac_path_GREP" --version 2>&1` in
-*GNU*)
- ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
-*)
- ac_count=0
- $as_echo_n 0123456789 >"conftest.in"
- while :
- do
- cat "conftest.in" "conftest.in" >"conftest.tmp"
- mv "conftest.tmp" "conftest.in"
- cp "conftest.in" "conftest.nl"
- $as_echo 'GREP' >> "conftest.nl"
- "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
- diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
- as_fn_arith $ac_count + 1 && ac_count=$as_val
- if test $ac_count -gt ${ac_path_GREP_max-0}; then
- # Best one so far, save it but keep looking for a better one
- ac_cv_path_GREP="$ac_path_GREP"
- ac_path_GREP_max=$ac_count
- fi
- # 10*(2^10) chars as input seems more than enough
- test $ac_count -gt 10 && break
- done
- rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
-esac
-
- $ac_path_GREP_found && break 3
- done
- done
- done
-IFS=$as_save_IFS
- if test -z "$ac_cv_path_GREP"; then
- as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
- fi
-else
- ac_cv_path_GREP=$GREP
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
-$as_echo "$ac_cv_path_GREP" >&6; }
- GREP="$ac_cv_path_GREP"
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
-$as_echo_n "checking for egrep... " >&6; }
-if ${ac_cv_path_EGREP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
- then ac_cv_path_EGREP="$GREP -E"
- else
- if test -z "$EGREP"; then
- ac_path_EGREP_found=false
- # Loop through the user's path and test for each of PROGNAME-LIST
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_prog in egrep; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
- { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
-# Check for GNU ac_path_EGREP and select it if it is found.
- # Check for GNU $ac_path_EGREP
-case `"$ac_path_EGREP" --version 2>&1` in
-*GNU*)
- ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
-*)
- ac_count=0
- $as_echo_n 0123456789 >"conftest.in"
- while :
- do
- cat "conftest.in" "conftest.in" >"conftest.tmp"
- mv "conftest.tmp" "conftest.in"
- cp "conftest.in" "conftest.nl"
- $as_echo 'EGREP' >> "conftest.nl"
- "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
- diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
- as_fn_arith $ac_count + 1 && ac_count=$as_val
- if test $ac_count -gt ${ac_path_EGREP_max-0}; then
- # Best one so far, save it but keep looking for a better one
- ac_cv_path_EGREP="$ac_path_EGREP"
- ac_path_EGREP_max=$ac_count
- fi
- # 10*(2^10) chars as input seems more than enough
- test $ac_count -gt 10 && break
- done
- rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
-esac
-
- $ac_path_EGREP_found && break 3
- done
- done
- done
-IFS=$as_save_IFS
- if test -z "$ac_cv_path_EGREP"; then
- as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
- fi
-else
- ac_cv_path_EGREP=$EGREP
-fi
-
- fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
-$as_echo "$ac_cv_path_EGREP" >&6; }
- EGREP="$ac_cv_path_EGREP"
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
-$as_echo_n "checking for ANSI C header files... " >&6; }
-if ${ac_cv_header_stdc+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-#include <float.h>
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_header_stdc=yes
-else
- ac_cv_header_stdc=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-if test $ac_cv_header_stdc = yes; then
- # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <string.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "memchr" >/dev/null 2>&1; then :
-
-else
- ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-fi
-
-if test $ac_cv_header_stdc = yes; then
- # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <stdlib.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "free" >/dev/null 2>&1; then :
-
-else
- ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-fi
-
-if test $ac_cv_header_stdc = yes; then
- # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
- if test "$cross_compiling" = yes; then :
- :
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <ctype.h>
-#include <stdlib.h>
-#if ((' ' & 0x0FF) == 0x020)
-# 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))
- return 2;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-
-else
- ac_cv_header_stdc=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
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
-$as_echo "$ac_cv_header_stdc" >&6; }
-if test $ac_cv_header_stdc = yes; then
-
-$as_echo "#define STDC_HEADERS 1" >>confdefs.h
-
-fi
-
-# On IRIX 5.3, sys/types and inttypes.h are conflicting.
-for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
- inttypes.h stdint.h unistd.h
-do :
- as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_compile "$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
-
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5
-$as_echo_n "checking whether byte ordering is bigendian... " >&6; }
-if ${ac_cv_c_bigendian+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_cv_c_bigendian=unknown
- # See if we're dealing with a universal compiler.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#ifndef __APPLE_CC__
- not a universal capable compiler
- #endif
- typedef int dummy;
-
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
- # Check for potential -arch flags. It is not universal unless
- # there are at least two -arch flags with different values.
- ac_arch=
- ac_prev=
- for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do
- if test -n "$ac_prev"; then
- case $ac_word in
- i?86 | x86_64 | ppc | ppc64)
- if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then
- ac_arch=$ac_word
- else
- ac_cv_c_bigendian=universal
- break
- fi
- ;;
- esac
- ac_prev=
- elif test "x$ac_word" = "x-arch"; then
- ac_prev=arch
- fi
- done
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- if test $ac_cv_c_bigendian = unknown; then
- # See if sys/param.h defines the BYTE_ORDER macro.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <sys/types.h>
- #include <sys/param.h>
-
-int
-main ()
-{
-#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \
- && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \
- && LITTLE_ENDIAN)
- bogus endian macros
- #endif
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- # It does; now see whether it defined to BIG_ENDIAN or not.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <sys/types.h>
- #include <sys/param.h>
-
-int
-main ()
-{
-#if BYTE_ORDER != BIG_ENDIAN
- not big endian
- #endif
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_c_bigendian=yes
-else
- ac_cv_c_bigendian=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- fi
- if test $ac_cv_c_bigendian = unknown; then
- # See if <limits.h> defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris).
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <limits.h>
-
-int
-main ()
-{
-#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN)
- bogus endian macros
- #endif
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- # It does; now see whether it defined to _BIG_ENDIAN or not.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <limits.h>
-
-int
-main ()
-{
-#ifndef _BIG_ENDIAN
- not big endian
- #endif
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_c_bigendian=yes
-else
- ac_cv_c_bigendian=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- fi
- if test $ac_cv_c_bigendian = unknown; then
- # Compile a test program.
- if test "$cross_compiling" = yes; then :
- # Try to guess by grepping values from an object file.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-short int ascii_mm[] =
- { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
- short int ascii_ii[] =
- { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
- int use_ascii (int i) {
- return ascii_mm[i] + ascii_ii[i];
- }
- short int ebcdic_ii[] =
- { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
- short int ebcdic_mm[] =
- { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
- int use_ebcdic (int i) {
- return ebcdic_mm[i] + ebcdic_ii[i];
- }
- extern int foo;
-
-int
-main ()
-{
-return use_ascii (foo) == use_ebcdic (foo);
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then
- ac_cv_c_bigendian=yes
- fi
- if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
- if test "$ac_cv_c_bigendian" = unknown; then
- ac_cv_c_bigendian=no
- else
- # finding both strings is unlikely to happen, but who knows?
- ac_cv_c_bigendian=unknown
- fi
- fi
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-$ac_includes_default
-int
-main ()
-{
-
- /* Are we little or big endian? From Harbison&Steele. */
- union
- {
- long int l;
- char c[sizeof (long int)];
- } u;
- u.l = 1;
- return u.c[sizeof (long int) - 1] == 1;
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
- ac_cv_c_bigendian=no
-else
- ac_cv_c_bigendian=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
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5
-$as_echo "$ac_cv_c_bigendian" >&6; }
- case $ac_cv_c_bigendian in #(
- yes)
- $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h
-;; #(
- no)
- ;; #(
- universal)
-
-$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h
-
- ;; #(
- *)
- as_fn_error $? "unknown endianness
- presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;;
- esac
-
-
-# Checks for programs.
-for ac_prog in gawk mawk nawk awk
-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_AWK+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$AWK"; then
- ac_cv_prog_AWK="$AWK" # 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_AWK="$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
-
-fi
-fi
-AWK=$ac_cv_prog_AWK
-if test -n "$AWK"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
-$as_echo "$AWK" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- test -n "$AWK" && break
-done
-
-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 how to run the C preprocessor" >&5
-$as_echo_n "checking how to run the C preprocessor... " >&6; }
-# On Suns, sometimes $CPP names a directory.
-if test -n "$CPP" && test -d "$CPP"; then
- CPP=
-fi
-if test -z "$CPP"; then
- if ${ac_cv_prog_CPP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- # Double quotes because CPP needs to be expanded
- for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
- do
- ac_preproc_ok=false
-for ac_c_preproc_warn_flag in '' yes
-do
- # Use a header file that comes with gcc, so configuring glibc
- # with a fresh cross-compiler works.
- # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- # <limits.h> exists even on freestanding compilers.
- # On the NeXT, cc -E runs the code through the compiler's parser,
- # not just through cpp. "Syntax error" is here to catch this case.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
- Syntax error
-_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
-
-else
- # Broken: fails on valid input.
-continue
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-
- # OK, works on sane cases. Now check whether nonexistent headers
- # can be detected and how.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <ac_nonexistent.h>
-_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
- # Broken: success on invalid input.
-continue
-else
- # Passes both tests.
-ac_preproc_ok=:
-break
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-
-done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.i conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then :
- break
-fi
-
- done
- ac_cv_prog_CPP=$CPP
-
-fi
- CPP=$ac_cv_prog_CPP
-else
- ac_cv_prog_CPP=$CPP
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
-$as_echo "$CPP" >&6; }
-ac_preproc_ok=false
-for ac_c_preproc_warn_flag in '' yes
-do
- # Use a header file that comes with gcc, so configuring glibc
- # with a fresh cross-compiler works.
- # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- # <limits.h> exists even on freestanding compilers.
- # On the NeXT, cc -E runs the code through the compiler's parser,
- # not just through cpp. "Syntax error" is here to catch this case.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
- Syntax error
-_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
-
-else
- # Broken: fails on valid input.
-continue
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-
- # OK, works on sane cases. Now check whether nonexistent headers
- # can be detected and how.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <ac_nonexistent.h>
-_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
- # Broken: success on invalid input.
-continue
-else
- # Passes both tests.
-ac_preproc_ok=:
-break
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-
-done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.i conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then :
-
-else
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
-See \`config.log' for more details" "$LINENO" 5; }
-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
-
-if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
-set dummy ${ac_tool_prefix}ranlib; 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_RANLIB+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$RANLIB"; then
- ac_cv_prog_RANLIB="$RANLIB" # 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_RANLIB="${ac_tool_prefix}ranlib"
- $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
-
-fi
-fi
-RANLIB=$ac_cv_prog_RANLIB
-if test -n "$RANLIB"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
-$as_echo "$RANLIB" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_RANLIB"; then
- ac_ct_RANLIB=$RANLIB
- # Extract the first word of "ranlib", so it can be a program name with args.
-set dummy ranlib; 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_ac_ct_RANLIB+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_RANLIB"; then
- ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # 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_ac_ct_RANLIB="ranlib"
- $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
-
-fi
-fi
-ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
-if test -n "$ac_ct_RANLIB"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
-$as_echo "$ac_ct_RANLIB" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
- if test "x$ac_ct_RANLIB" = x; then
- RANLIB=":"
- 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
- RANLIB=$ac_ct_RANLIB
- fi
-else
- RANLIB="$ac_cv_prog_RANLIB"
-fi
-
-# Find a good install program. We prefer a C program (faster),
-# so one script is as good as another. But avoid the broken or
-# incompatible versions:
-# SysV /etc/install, /usr/sbin/install
-# SunOS /usr/etc/install
-# IRIX /sbin/install
-# AIX /bin/install
-# AmigaOS /C/install, which installs bootblocks on floppy discs
-# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
-# AFS /usr/afsws/bin/install, which mishandles nonexistent args
-# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
-# OS/2's system install, which has a completely different semantic
-# ./install, which can be erroneously created by make from ./install.sh.
-# Reject install programs that cannot install multiple files.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
-$as_echo_n "checking for a BSD-compatible install... " >&6; }
-if test -z "$INSTALL"; then
-if ${ac_cv_path_install+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- # Account for people who put trailing slashes in PATH elements.
-case $as_dir/ in #((
- ./ | .// | /[cC]/* | \
- /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
- ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \
- /usr/ucb/* ) ;;
- *)
- # OSF1 and SCO ODT 3.0 have their own names for install.
- # Don't use installbsd from OSF since it installs stuff as root
- # by default.
- for ac_prog in ginstall scoinst install; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then
- if test $ac_prog = install &&
- grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
- # AIX install. It has an incompatible calling convention.
- :
- elif test $ac_prog = install &&
- grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
- # program-specific install script used by HP pwplus--don't use.
- :
- else
- rm -rf conftest.one conftest.two conftest.dir
- echo one > conftest.one
- echo two > conftest.two
- mkdir conftest.dir
- if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
- test -s conftest.one && test -s conftest.two &&
- test -s conftest.dir/conftest.one &&
- test -s conftest.dir/conftest.two
- then
- ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
- break 3
- fi
- fi
- fi
- done
- done
- ;;
-esac
-
- done
-IFS=$as_save_IFS
-
-rm -rf conftest.one conftest.two conftest.dir
-
-fi
- if test "${ac_cv_path_install+set}" = set; then
- INSTALL=$ac_cv_path_install
- else
- # As a last resort, use the slow shell script. Don't cache a
- # value for INSTALL within a source directory, because that will
- # break other packages using the cache if that directory is
- # removed, or if the value is a relative name.
- INSTALL=$ac_install_sh
- fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
-$as_echo "$INSTALL" >&6; }
-
-# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
-# It thinks the first close brace ends the variable substitution.
-test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
-
-test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
-
-test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
-$as_echo_n "checking for egrep... " >&6; }
-if ${ac_cv_path_EGREP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
- then ac_cv_path_EGREP="$GREP -E"
- else
- if test -z "$EGREP"; then
- ac_path_EGREP_found=false
- # Loop through the user's path and test for each of PROGNAME-LIST
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_prog in egrep; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
- { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
-# Check for GNU ac_path_EGREP and select it if it is found.
- # Check for GNU $ac_path_EGREP
-case `"$ac_path_EGREP" --version 2>&1` in
-*GNU*)
- ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
-*)
- ac_count=0
- $as_echo_n 0123456789 >"conftest.in"
- while :
- do
- cat "conftest.in" "conftest.in" >"conftest.tmp"
- mv "conftest.tmp" "conftest.in"
- cp "conftest.in" "conftest.nl"
- $as_echo 'EGREP' >> "conftest.nl"
- "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
- diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
- as_fn_arith $ac_count + 1 && ac_count=$as_val
- if test $ac_count -gt ${ac_path_EGREP_max-0}; then
- # Best one so far, save it but keep looking for a better one
- ac_cv_path_EGREP="$ac_path_EGREP"
- ac_path_EGREP_max=$ac_count
- fi
- # 10*(2^10) chars as input seems more than enough
- test $ac_count -gt 10 && break
- done
- rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
-esac
-
- $ac_path_EGREP_found && break 3
- done
- done
- done
-IFS=$as_save_IFS
- if test -z "$ac_cv_path_EGREP"; then
- as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
- fi
-else
- ac_cv_path_EGREP=$EGREP
-fi
-
- fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
-$as_echo "$ac_cv_path_EGREP" >&6; }
- EGREP="$ac_cv_path_EGREP"
-
-
-# Extract the first word of "ar", so it can be a program name with args.
-set dummy ar; 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_AR+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- case $AR in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_AR="$AR" # 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_AR="$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
-AR=$ac_cv_path_AR
-if test -n "$AR"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
-$as_echo "$AR" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-# Extract the first word of "cat", so it can be a program name with args.
-set dummy cat; 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_CAT+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- case $CAT in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_CAT="$CAT" # 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_CAT="$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
-CAT=$ac_cv_path_CAT
-if test -n "$CAT"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CAT" >&5
-$as_echo "$CAT" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-# Extract the first word of "kill", so it can be a program name with args.
-set dummy kill; 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_KILL+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- case $KILL in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_KILL="$KILL" # 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_KILL="$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
-KILL=$ac_cv_path_KILL
-if test -n "$KILL"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $KILL" >&5
-$as_echo "$KILL" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-for ac_prog in perl5 perl
-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_path_PERL+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- case $PERL in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_PERL="$PERL" # 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_PERL="$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
-PERL=$ac_cv_path_PERL
-if test -n "$PERL"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PERL" >&5
-$as_echo "$PERL" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- test -n "$PERL" && break
-done
-
-# Extract the first word of "sed", so it can be a program name with args.
-set dummy sed; 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_SED+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- case $SED in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_SED="$SED" # 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_SED="$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
-SED=$ac_cv_path_SED
-if test -n "$SED"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SED" >&5
-$as_echo "$SED" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-
-# Extract the first word of "ent", so it can be a program name with args.
-set dummy ent; 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_ENT+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- case $ENT in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_ENT="$ENT" # 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_ENT="$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
-ENT=$ac_cv_path_ENT
-if test -n "$ENT"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ENT" >&5
-$as_echo "$ENT" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-
-# Extract the first word of "bash", so it can be a program name with args.
-set dummy bash; 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_TEST_MINUS_S_SH+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- case $TEST_MINUS_S_SH in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_TEST_MINUS_S_SH="$TEST_MINUS_S_SH" # 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_TEST_MINUS_S_SH="$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
-TEST_MINUS_S_SH=$ac_cv_path_TEST_MINUS_S_SH
-if test -n "$TEST_MINUS_S_SH"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TEST_MINUS_S_SH" >&5
-$as_echo "$TEST_MINUS_S_SH" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-# Extract the first word of "ksh", so it can be a program name with args.
-set dummy ksh; 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_TEST_MINUS_S_SH+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- case $TEST_MINUS_S_SH in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_TEST_MINUS_S_SH="$TEST_MINUS_S_SH" # 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_TEST_MINUS_S_SH="$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
-TEST_MINUS_S_SH=$ac_cv_path_TEST_MINUS_S_SH
-if test -n "$TEST_MINUS_S_SH"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TEST_MINUS_S_SH" >&5
-$as_echo "$TEST_MINUS_S_SH" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-# Extract the first word of "sh", so it can be a program name with args.
-set dummy sh; 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_TEST_MINUS_S_SH+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- case $TEST_MINUS_S_SH in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_TEST_MINUS_S_SH="$TEST_MINUS_S_SH" # 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_TEST_MINUS_S_SH="$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
-TEST_MINUS_S_SH=$ac_cv_path_TEST_MINUS_S_SH
-if test -n "$TEST_MINUS_S_SH"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TEST_MINUS_S_SH" >&5
-$as_echo "$TEST_MINUS_S_SH" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-# Extract the first word of "sh", so it can be a program name with args.
-set dummy sh; 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_SH+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- case $SH in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_SH="$SH" # 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_SH="$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
-SH=$ac_cv_path_SH
-if test -n "$SH"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SH" >&5
-$as_echo "$SH" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-# Extract the first word of "groff", so it can be a program name with args.
-set dummy groff; 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_GROFF+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- case $GROFF in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_GROFF="$GROFF" # 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_GROFF="$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
-GROFF=$ac_cv_path_GROFF
-if test -n "$GROFF"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GROFF" >&5
-$as_echo "$GROFF" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-# Extract the first word of "nroff", so it can be a program name with args.
-set dummy nroff; 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_NROFF+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- case $NROFF in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_NROFF="$NROFF" # 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_NROFF="$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
-NROFF=$ac_cv_path_NROFF
-if test -n "$NROFF"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NROFF" >&5
-$as_echo "$NROFF" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-# Extract the first word of "mandoc", so it can be a program name with args.
-set dummy mandoc; 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_MANDOC+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- case $MANDOC in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_MANDOC="$MANDOC" # 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_MANDOC="$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
-MANDOC=$ac_cv_path_MANDOC
-if test -n "$MANDOC"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANDOC" >&5
-$as_echo "$MANDOC" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-TEST_SHELL=sh
-
-
-if test "x$MANDOC" != "x" ; then
- MANFMT="$MANDOC"
-elif test "x$NROFF" != "x" ; then
- MANFMT="$NROFF -mandoc"
-elif test "x$GROFF" != "x" ; then
- MANFMT="$GROFF -mandoc -Tascii"
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: no manpage formatted found" >&5
-$as_echo "$as_me: WARNING: no manpage formatted found" >&2;}
- MANFMT="false"
-fi
-
-
-# Extract the first word of "groupadd", so it can be a program name with args.
-set dummy groupadd; 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_PATH_GROUPADD_PROG+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- case $PATH_GROUPADD_PROG in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_PATH_GROUPADD_PROG="$PATH_GROUPADD_PROG" # Let the user override the test with a path.
- ;;
- *)
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in /usr/sbin${PATH_SEPARATOR}/etc
-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_PATH_GROUPADD_PROG="$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
-
- test -z "$ac_cv_path_PATH_GROUPADD_PROG" && ac_cv_path_PATH_GROUPADD_PROG="groupadd"
- ;;
-esac
-fi
-PATH_GROUPADD_PROG=$ac_cv_path_PATH_GROUPADD_PROG
-if test -n "$PATH_GROUPADD_PROG"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PATH_GROUPADD_PROG" >&5
-$as_echo "$PATH_GROUPADD_PROG" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-# Extract the first word of "useradd", so it can be a program name with args.
-set dummy useradd; 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_PATH_USERADD_PROG+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- case $PATH_USERADD_PROG in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_PATH_USERADD_PROG="$PATH_USERADD_PROG" # Let the user override the test with a path.
- ;;
- *)
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in /usr/sbin${PATH_SEPARATOR}/etc
-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_PATH_USERADD_PROG="$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
-
- test -z "$ac_cv_path_PATH_USERADD_PROG" && ac_cv_path_PATH_USERADD_PROG="useradd"
- ;;
-esac
-fi
-PATH_USERADD_PROG=$ac_cv_path_PATH_USERADD_PROG
-if test -n "$PATH_USERADD_PROG"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PATH_USERADD_PROG" >&5
-$as_echo "$PATH_USERADD_PROG" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-# Extract the first word of "pkgmk", so it can be a program name with args.
-set dummy pkgmk; 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_MAKE_PACKAGE_SUPPORTED+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$MAKE_PACKAGE_SUPPORTED"; then
- ac_cv_prog_MAKE_PACKAGE_SUPPORTED="$MAKE_PACKAGE_SUPPORTED" # 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_MAKE_PACKAGE_SUPPORTED="yes"
- $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
-
- test -z "$ac_cv_prog_MAKE_PACKAGE_SUPPORTED" && ac_cv_prog_MAKE_PACKAGE_SUPPORTED="no"
-fi
-fi
-MAKE_PACKAGE_SUPPORTED=$ac_cv_prog_MAKE_PACKAGE_SUPPORTED
-if test -n "$MAKE_PACKAGE_SUPPORTED"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAKE_PACKAGE_SUPPORTED" >&5
-$as_echo "$MAKE_PACKAGE_SUPPORTED" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-if test -x /sbin/sh; then
- STARTUP_SCRIPT_SHELL=/sbin/sh
-
-else
- STARTUP_SCRIPT_SHELL=/bin/sh
-
-fi
-
-# System features
-# Check whether --enable-largefile was given.
-if test "${enable_largefile+set}" = set; then :
- enableval=$enable_largefile;
-fi
-
-if test "$enable_largefile" != no; then
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5
-$as_echo_n "checking for special C compiler options needed for large files... " >&6; }
-if ${ac_cv_sys_largefile_CC+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_cv_sys_largefile_CC=no
- if test "$GCC" != yes; then
- ac_save_CC=$CC
- while :; do
- # IRIX 6.2 and later do not support large files by default,
- # so use the C compiler's -n32 option if that helps.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <sys/types.h>
- /* Check that off_t can represent 2**63 - 1 correctly.
- We can't simply define LARGE_OFF_T to be 9223372036854775807,
- since some C++ compilers masquerading as C compilers
- incorrectly reject 9223372036854775807. */
-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
- int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
- && LARGE_OFF_T % 2147483647 == 1)
- ? 1 : -1];
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
- if ac_fn_c_try_compile "$LINENO"; then :
- break
-fi
-rm -f core conftest.err conftest.$ac_objext
- CC="$CC -n32"
- if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_sys_largefile_CC=' -n32'; break
-fi
-rm -f core conftest.err conftest.$ac_objext
- break
- done
- CC=$ac_save_CC
- rm -f conftest.$ac_ext
- fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5
-$as_echo "$ac_cv_sys_largefile_CC" >&6; }
- if test "$ac_cv_sys_largefile_CC" != no; then
- CC=$CC$ac_cv_sys_largefile_CC
- fi
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5
-$as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; }
-if ${ac_cv_sys_file_offset_bits+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- while :; do
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <sys/types.h>
- /* Check that off_t can represent 2**63 - 1 correctly.
- We can't simply define LARGE_OFF_T to be 9223372036854775807,
- since some C++ compilers masquerading as C compilers
- incorrectly reject 9223372036854775807. */
-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
- int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
- && LARGE_OFF_T % 2147483647 == 1)
- ? 1 : -1];
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_sys_file_offset_bits=no; break
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#define _FILE_OFFSET_BITS 64
-#include <sys/types.h>
- /* Check that off_t can represent 2**63 - 1 correctly.
- We can't simply define LARGE_OFF_T to be 9223372036854775807,
- since some C++ compilers masquerading as C compilers
- incorrectly reject 9223372036854775807. */
-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
- int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
- && LARGE_OFF_T % 2147483647 == 1)
- ? 1 : -1];
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_sys_file_offset_bits=64; break
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- ac_cv_sys_file_offset_bits=unknown
- break
-done
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5
-$as_echo "$ac_cv_sys_file_offset_bits" >&6; }
-case $ac_cv_sys_file_offset_bits in #(
- no | unknown) ;;
- *)
-cat >>confdefs.h <<_ACEOF
-#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
-_ACEOF
-;;
-esac
-rm -rf conftest*
- if test $ac_cv_sys_file_offset_bits = unknown; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5
-$as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; }
-if ${ac_cv_sys_large_files+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- while :; do
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <sys/types.h>
- /* Check that off_t can represent 2**63 - 1 correctly.
- We can't simply define LARGE_OFF_T to be 9223372036854775807,
- since some C++ compilers masquerading as C compilers
- incorrectly reject 9223372036854775807. */
-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
- int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
- && LARGE_OFF_T % 2147483647 == 1)
- ? 1 : -1];
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_sys_large_files=no; break
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#define _LARGE_FILES 1
-#include <sys/types.h>
- /* Check that off_t can represent 2**63 - 1 correctly.
- We can't simply define LARGE_OFF_T to be 9223372036854775807,
- since some C++ compilers masquerading as C compilers
- incorrectly reject 9223372036854775807. */
-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
- int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
- && LARGE_OFF_T % 2147483647 == 1)
- ? 1 : -1];
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_sys_large_files=1; break
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- ac_cv_sys_large_files=unknown
- break
-done
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5
-$as_echo "$ac_cv_sys_large_files" >&6; }
-case $ac_cv_sys_large_files in #(
- no | unknown) ;;
- *)
-cat >>confdefs.h <<_ACEOF
-#define _LARGE_FILES $ac_cv_sys_large_files
-_ACEOF
-;;
-esac
-rm -rf conftest*
- fi
-fi
-
-
-if test -z "$AR" ; then
- as_fn_error $? "*** 'ar' missing, please install or fix your \$PATH ***" "$LINENO" 5
-fi
-
-# Use LOGIN_PROGRAM from environment if possible
-if test ! -z "$LOGIN_PROGRAM" ; then
-
-cat >>confdefs.h <<_ACEOF
-#define LOGIN_PROGRAM_FALLBACK "$LOGIN_PROGRAM"
-_ACEOF
-
-else
- # Search for login
- # Extract the first word of "login", so it can be a program name with args.
-set dummy login; 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_LOGIN_PROGRAM_FALLBACK+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- case $LOGIN_PROGRAM_FALLBACK in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_LOGIN_PROGRAM_FALLBACK="$LOGIN_PROGRAM_FALLBACK" # 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_LOGIN_PROGRAM_FALLBACK="$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
-LOGIN_PROGRAM_FALLBACK=$ac_cv_path_LOGIN_PROGRAM_FALLBACK
-if test -n "$LOGIN_PROGRAM_FALLBACK"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LOGIN_PROGRAM_FALLBACK" >&5
-$as_echo "$LOGIN_PROGRAM_FALLBACK" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- if test ! -z "$LOGIN_PROGRAM_FALLBACK" ; then
- cat >>confdefs.h <<_ACEOF
-#define LOGIN_PROGRAM_FALLBACK "$LOGIN_PROGRAM_FALLBACK"
-_ACEOF
-
- fi
-fi
-
-# Extract the first word of "passwd", so it can be a program name with args.
-set dummy passwd; 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_PATH_PASSWD_PROG+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- case $PATH_PASSWD_PROG in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_PATH_PASSWD_PROG="$PATH_PASSWD_PROG" # 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_PATH_PASSWD_PROG="$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
-PATH_PASSWD_PROG=$ac_cv_path_PATH_PASSWD_PROG
-if test -n "$PATH_PASSWD_PROG"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PATH_PASSWD_PROG" >&5
-$as_echo "$PATH_PASSWD_PROG" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-if test ! -z "$PATH_PASSWD_PROG" ; then
-
-cat >>confdefs.h <<_ACEOF
-#define _PATH_PASSWD_PROG "$PATH_PASSWD_PROG"
-_ACEOF
-
-fi
-
-if test -z "$LD" ; then
- LD=$CC
-fi
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5
-$as_echo_n "checking for inline... " >&6; }
-if ${ac_cv_c_inline+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_cv_c_inline=no
-for ac_kw in inline __inline__ __inline; do
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#ifndef __cplusplus
-typedef int foo_t;
-static $ac_kw foo_t static_foo () {return 0; }
-$ac_kw foo_t foo () {return 0; }
-#endif
-
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_c_inline=$ac_kw
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- test "$ac_cv_c_inline" != no && break
-done
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5
-$as_echo "$ac_cv_c_inline" >&6; }
-
-case $ac_cv_c_inline in
- inline | yes) ;;
- *)
- case $ac_cv_c_inline in
- no) ac_val=;;
- *) ac_val=$ac_cv_c_inline;;
- esac
- cat >>confdefs.h <<_ACEOF
-#ifndef __cplusplus
-#define inline $ac_val
-#endif
-_ACEOF
- ;;
-esac
-
-
-ac_fn_c_check_decl "$LINENO" "LLONG_MAX" "ac_cv_have_decl_LLONG_MAX" "#include <limits.h>
-"
-if test "x$ac_cv_have_decl_LLONG_MAX" = xyes; then :
- have_llong_max=1
-fi
-
-ac_fn_c_check_decl "$LINENO" "SYSTR_POLICY_KILL" "ac_cv_have_decl_SYSTR_POLICY_KILL" "
- #include <sys/types.h>
- #include <sys/param.h>
- #include <dev/systrace.h>
-
-"
-if test "x$ac_cv_have_decl_SYSTR_POLICY_KILL" = xyes; then :
- have_systr_policy_kill=1
-fi
-
-ac_fn_c_check_decl "$LINENO" "RLIMIT_NPROC" "ac_cv_have_decl_RLIMIT_NPROC" "
- #include <sys/types.h>
- #include <sys/resource.h>
-
-"
-if test "x$ac_cv_have_decl_RLIMIT_NPROC" = xyes; then :
-
-$as_echo "#define HAVE_RLIMIT_NPROC /**/" >>confdefs.h
-
-fi
-
-ac_fn_c_check_decl "$LINENO" "PR_SET_NO_NEW_PRIVS" "ac_cv_have_decl_PR_SET_NO_NEW_PRIVS" "
- #include <sys/types.h>
- #include <linux/prctl.h>
-
-"
-if test "x$ac_cv_have_decl_PR_SET_NO_NEW_PRIVS" = xyes; then :
- have_linux_no_new_privs=1
-fi
-
-
-use_stack_protector=1
-use_toolchain_hardening=1
-
-# Check whether --with-stackprotect was given.
-if test "${with_stackprotect+set}" = set; then :
- withval=$with_stackprotect;
- if test "x$withval" = "xno"; then
- use_stack_protector=0
- fi
-fi
-
-
-# Check whether --with-hardening was given.
-if test "${with_hardening+set}" = set; then :
- withval=$with_hardening;
- if test "x$withval" = "xno"; then
- use_toolchain_hardening=0
- fi
-fi
-
-
-# We use -Werror for the tests only so that we catch warnings like "this is
-# on by default" for things like -fPIE.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror" >&5
-$as_echo_n "checking if $CC supports -Werror... " >&6; }
-saved_CFLAGS="$CFLAGS"
-CFLAGS="$CFLAGS -Werror"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-int main(void) { return 0; }
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
- WERROR="-Werror"
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- WERROR=""
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-CFLAGS="$saved_CFLAGS"
-
-if test "$GCC" = "yes" || test "$GCC" = "egcs"; then
- {
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports compile flag -Qunused-arguments" >&5
-$as_echo_n "checking if $CC supports compile flag -Qunused-arguments... " >&6; }
- saved_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS $WERROR -Qunused-arguments"
- _define_flag=""
- test "x$_define_flag" = "x" && _define_flag="-Qunused-arguments"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <stdlib.h>
-#include <stdio.h>
-int main(int argc, char **argv) {
- /* Some math to catch -ftrapv problems in the toolchain */
- int i = 123 * argc, j = 456 + argc, k = 789 - argc;
- float l = i * 2.1;
- double m = l / 0.5;
- long long int n = argc * 12345LL, o = 12345LL * (long long int)argc;
- printf("%d %d %d %f %f %lld %lld\n", i, j, k, l, m, n, o);
- exit(0);
-}
-
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-if `grep -i "unrecognized option" conftest.err >/dev/null`
-then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- CFLAGS="$saved_CFLAGS"
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
- CFLAGS="$saved_CFLAGS $_define_flag"
-fi
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- CFLAGS="$saved_CFLAGS"
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-}
- {
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports compile flag -Wunknown-warning-option" >&5
-$as_echo_n "checking if $CC supports compile flag -Wunknown-warning-option... " >&6; }
- saved_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS $WERROR -Wunknown-warning-option"
- _define_flag=""
- test "x$_define_flag" = "x" && _define_flag="-Wunknown-warning-option"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <stdlib.h>
-#include <stdio.h>
-int main(int argc, char **argv) {
- /* Some math to catch -ftrapv problems in the toolchain */
- int i = 123 * argc, j = 456 + argc, k = 789 - argc;
- float l = i * 2.1;
- double m = l / 0.5;
- long long int n = argc * 12345LL, o = 12345LL * (long long int)argc;
- printf("%d %d %d %f %f %lld %lld\n", i, j, k, l, m, n, o);
- exit(0);
-}
-
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-if `grep -i "unrecognized option" conftest.err >/dev/null`
-then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- CFLAGS="$saved_CFLAGS"
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
- CFLAGS="$saved_CFLAGS $_define_flag"
-fi
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- CFLAGS="$saved_CFLAGS"
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-}
- {
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports compile flag -Wall" >&5
-$as_echo_n "checking if $CC supports compile flag -Wall... " >&6; }
- saved_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS $WERROR -Wall"
- _define_flag=""
- test "x$_define_flag" = "x" && _define_flag="-Wall"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <stdlib.h>
-#include <stdio.h>
-int main(int argc, char **argv) {
- /* Some math to catch -ftrapv problems in the toolchain */
- int i = 123 * argc, j = 456 + argc, k = 789 - argc;
- float l = i * 2.1;
- double m = l / 0.5;
- long long int n = argc * 12345LL, o = 12345LL * (long long int)argc;
- printf("%d %d %d %f %f %lld %lld\n", i, j, k, l, m, n, o);
- exit(0);
-}
-
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-if `grep -i "unrecognized option" conftest.err >/dev/null`
-then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- CFLAGS="$saved_CFLAGS"
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
- CFLAGS="$saved_CFLAGS $_define_flag"
-fi
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- CFLAGS="$saved_CFLAGS"
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-}
- {
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports compile flag -Wpointer-arith" >&5
-$as_echo_n "checking if $CC supports compile flag -Wpointer-arith... " >&6; }
- saved_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS $WERROR -Wpointer-arith"
- _define_flag=""
- test "x$_define_flag" = "x" && _define_flag="-Wpointer-arith"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <stdlib.h>
-#include <stdio.h>
-int main(int argc, char **argv) {
- /* Some math to catch -ftrapv problems in the toolchain */
- int i = 123 * argc, j = 456 + argc, k = 789 - argc;
- float l = i * 2.1;
- double m = l / 0.5;
- long long int n = argc * 12345LL, o = 12345LL * (long long int)argc;
- printf("%d %d %d %f %f %lld %lld\n", i, j, k, l, m, n, o);
- exit(0);
-}
-
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-if `grep -i "unrecognized option" conftest.err >/dev/null`
-then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- CFLAGS="$saved_CFLAGS"
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
- CFLAGS="$saved_CFLAGS $_define_flag"
-fi
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- CFLAGS="$saved_CFLAGS"
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-}
- {
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports compile flag -Wuninitialized" >&5
-$as_echo_n "checking if $CC supports compile flag -Wuninitialized... " >&6; }
- saved_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS $WERROR -Wuninitialized"
- _define_flag=""
- test "x$_define_flag" = "x" && _define_flag="-Wuninitialized"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <stdlib.h>
-#include <stdio.h>
-int main(int argc, char **argv) {
- /* Some math to catch -ftrapv problems in the toolchain */
- int i = 123 * argc, j = 456 + argc, k = 789 - argc;
- float l = i * 2.1;
- double m = l / 0.5;
- long long int n = argc * 12345LL, o = 12345LL * (long long int)argc;
- printf("%d %d %d %f %f %lld %lld\n", i, j, k, l, m, n, o);
- exit(0);
-}
-
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-if `grep -i "unrecognized option" conftest.err >/dev/null`
-then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- CFLAGS="$saved_CFLAGS"
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
- CFLAGS="$saved_CFLAGS $_define_flag"
-fi
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- CFLAGS="$saved_CFLAGS"
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-}
- {
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports compile flag -Wsign-compare" >&5
-$as_echo_n "checking if $CC supports compile flag -Wsign-compare... " >&6; }
- saved_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS $WERROR -Wsign-compare"
- _define_flag=""
- test "x$_define_flag" = "x" && _define_flag="-Wsign-compare"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <stdlib.h>
-#include <stdio.h>
-int main(int argc, char **argv) {
- /* Some math to catch -ftrapv problems in the toolchain */
- int i = 123 * argc, j = 456 + argc, k = 789 - argc;
- float l = i * 2.1;
- double m = l / 0.5;
- long long int n = argc * 12345LL, o = 12345LL * (long long int)argc;
- printf("%d %d %d %f %f %lld %lld\n", i, j, k, l, m, n, o);
- exit(0);
-}
-
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-if `grep -i "unrecognized option" conftest.err >/dev/null`
-then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- CFLAGS="$saved_CFLAGS"
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
- CFLAGS="$saved_CFLAGS $_define_flag"
-fi
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- CFLAGS="$saved_CFLAGS"
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-}
- {
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports compile flag -Wformat-security" >&5
-$as_echo_n "checking if $CC supports compile flag -Wformat-security... " >&6; }
- saved_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS $WERROR -Wformat-security"
- _define_flag=""
- test "x$_define_flag" = "x" && _define_flag="-Wformat-security"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <stdlib.h>
-#include <stdio.h>
-int main(int argc, char **argv) {
- /* Some math to catch -ftrapv problems in the toolchain */
- int i = 123 * argc, j = 456 + argc, k = 789 - argc;
- float l = i * 2.1;
- double m = l / 0.5;
- long long int n = argc * 12345LL, o = 12345LL * (long long int)argc;
- printf("%d %d %d %f %f %lld %lld\n", i, j, k, l, m, n, o);
- exit(0);
-}
-
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-if `grep -i "unrecognized option" conftest.err >/dev/null`
-then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- CFLAGS="$saved_CFLAGS"
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
- CFLAGS="$saved_CFLAGS $_define_flag"
-fi
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- CFLAGS="$saved_CFLAGS"
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-}
- {
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports compile flag -Wsizeof-pointer-memaccess" >&5
-$as_echo_n "checking if $CC supports compile flag -Wsizeof-pointer-memaccess... " >&6; }
- saved_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS $WERROR -Wsizeof-pointer-memaccess"
- _define_flag=""
- test "x$_define_flag" = "x" && _define_flag="-Wsizeof-pointer-memaccess"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <stdlib.h>
-#include <stdio.h>
-int main(int argc, char **argv) {
- /* Some math to catch -ftrapv problems in the toolchain */
- int i = 123 * argc, j = 456 + argc, k = 789 - argc;
- float l = i * 2.1;
- double m = l / 0.5;
- long long int n = argc * 12345LL, o = 12345LL * (long long int)argc;
- printf("%d %d %d %f %f %lld %lld\n", i, j, k, l, m, n, o);
- exit(0);
-}
-
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-if `grep -i "unrecognized option" conftest.err >/dev/null`
-then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- CFLAGS="$saved_CFLAGS"
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
- CFLAGS="$saved_CFLAGS $_define_flag"
-fi
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- CFLAGS="$saved_CFLAGS"
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-}
- {
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports compile flag -Wpointer-sign" >&5
-$as_echo_n "checking if $CC supports compile flag -Wpointer-sign... " >&6; }
- saved_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS $WERROR -Wpointer-sign"
- _define_flag="-Wno-pointer-sign"
- test "x$_define_flag" = "x" && _define_flag="-Wpointer-sign"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <stdlib.h>
-#include <stdio.h>
-int main(int argc, char **argv) {
- /* Some math to catch -ftrapv problems in the toolchain */
- int i = 123 * argc, j = 456 + argc, k = 789 - argc;
- float l = i * 2.1;
- double m = l / 0.5;
- long long int n = argc * 12345LL, o = 12345LL * (long long int)argc;
- printf("%d %d %d %f %f %lld %lld\n", i, j, k, l, m, n, o);
- exit(0);
-}
-
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-if `grep -i "unrecognized option" conftest.err >/dev/null`
-then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- CFLAGS="$saved_CFLAGS"
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
- CFLAGS="$saved_CFLAGS $_define_flag"
-fi
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- CFLAGS="$saved_CFLAGS"
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-}
- {
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports compile flag -Wunused-result" >&5
-$as_echo_n "checking if $CC supports compile flag -Wunused-result... " >&6; }
- saved_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS $WERROR -Wunused-result"
- _define_flag="-Wno-unused-result"
- test "x$_define_flag" = "x" && _define_flag="-Wunused-result"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <stdlib.h>
-#include <stdio.h>
-int main(int argc, char **argv) {
- /* Some math to catch -ftrapv problems in the toolchain */
- int i = 123 * argc, j = 456 + argc, k = 789 - argc;
- float l = i * 2.1;
- double m = l / 0.5;
- long long int n = argc * 12345LL, o = 12345LL * (long long int)argc;
- printf("%d %d %d %f %f %lld %lld\n", i, j, k, l, m, n, o);
- exit(0);
-}
-
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-if `grep -i "unrecognized option" conftest.err >/dev/null`
-then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- CFLAGS="$saved_CFLAGS"
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
- CFLAGS="$saved_CFLAGS $_define_flag"
-fi
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- CFLAGS="$saved_CFLAGS"
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-}
- {
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports compile flag -fno-strict-aliasing" >&5
-$as_echo_n "checking if $CC supports compile flag -fno-strict-aliasing... " >&6; }
- saved_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS $WERROR -fno-strict-aliasing"
- _define_flag=""
- test "x$_define_flag" = "x" && _define_flag="-fno-strict-aliasing"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <stdlib.h>
-#include <stdio.h>
-int main(int argc, char **argv) {
- /* Some math to catch -ftrapv problems in the toolchain */
- int i = 123 * argc, j = 456 + argc, k = 789 - argc;
- float l = i * 2.1;
- double m = l / 0.5;
- long long int n = argc * 12345LL, o = 12345LL * (long long int)argc;
- printf("%d %d %d %f %f %lld %lld\n", i, j, k, l, m, n, o);
- exit(0);
-}
-
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-if `grep -i "unrecognized option" conftest.err >/dev/null`
-then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- CFLAGS="$saved_CFLAGS"
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
- CFLAGS="$saved_CFLAGS $_define_flag"
-fi
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- CFLAGS="$saved_CFLAGS"
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-}
- {
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports compile flag -D_FORTIFY_SOURCE=2" >&5
-$as_echo_n "checking if $CC supports compile flag -D_FORTIFY_SOURCE=2... " >&6; }
- saved_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS $WERROR -D_FORTIFY_SOURCE=2"
- _define_flag=""
- test "x$_define_flag" = "x" && _define_flag="-D_FORTIFY_SOURCE=2"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <stdlib.h>
-#include <stdio.h>
-int main(int argc, char **argv) {
- /* Some math to catch -ftrapv problems in the toolchain */
- int i = 123 * argc, j = 456 + argc, k = 789 - argc;
- float l = i * 2.1;
- double m = l / 0.5;
- long long int n = argc * 12345LL, o = 12345LL * (long long int)argc;
- printf("%d %d %d %f %f %lld %lld\n", i, j, k, l, m, n, o);
- exit(0);
-}
-
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-if `grep -i "unrecognized option" conftest.err >/dev/null`
-then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- CFLAGS="$saved_CFLAGS"
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
- CFLAGS="$saved_CFLAGS $_define_flag"
-fi
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- CFLAGS="$saved_CFLAGS"
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-}
- if test "x$use_toolchain_hardening" = "x1"; then
- {
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $LD supports link flag -Wl,-z,relro" >&5
-$as_echo_n "checking if $LD supports link flag -Wl,-z,relro... " >&6; }
- saved_LDFLAGS="$LDFLAGS"
- LDFLAGS="$LDFLAGS $WERROR -Wl,-z,relro"
- _define_flag=""
- test "x$_define_flag" = "x" && _define_flag="-Wl,-z,relro"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <stdlib.h>
-#include <stdio.h>
-int main(int argc, char **argv) {
- /* Some math to catch -ftrapv problems in the toolchain */
- int i = 123 * argc, j = 456 + argc, k = 789 - argc;
- float l = i * 2.1;
- double m = l / 0.5;
- long long int n = argc * 12345LL, o = 12345LL * (long long int)argc;
- printf("%d %d %d %f %f %lld %lld\n", i, j, k, l, m, n, o);
- exit(0);
-}
-
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
- LDFLAGS="$saved_LDFLAGS $_define_flag"
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- LDFLAGS="$saved_LDFLAGS"
-
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-}
- {
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $LD supports link flag -Wl,-z,now" >&5
-$as_echo_n "checking if $LD supports link flag -Wl,-z,now... " >&6; }
- saved_LDFLAGS="$LDFLAGS"
- LDFLAGS="$LDFLAGS $WERROR -Wl,-z,now"
- _define_flag=""
- test "x$_define_flag" = "x" && _define_flag="-Wl,-z,now"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <stdlib.h>
-#include <stdio.h>
-int main(int argc, char **argv) {
- /* Some math to catch -ftrapv problems in the toolchain */
- int i = 123 * argc, j = 456 + argc, k = 789 - argc;
- float l = i * 2.1;
- double m = l / 0.5;
- long long int n = argc * 12345LL, o = 12345LL * (long long int)argc;
- printf("%d %d %d %f %f %lld %lld\n", i, j, k, l, m, n, o);
- exit(0);
-}
-
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
- LDFLAGS="$saved_LDFLAGS $_define_flag"
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- LDFLAGS="$saved_LDFLAGS"
-
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-}
- {
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $LD supports link flag -Wl,-z,noexecstack" >&5
-$as_echo_n "checking if $LD supports link flag -Wl,-z,noexecstack... " >&6; }
- saved_LDFLAGS="$LDFLAGS"
- LDFLAGS="$LDFLAGS $WERROR -Wl,-z,noexecstack"
- _define_flag=""
- test "x$_define_flag" = "x" && _define_flag="-Wl,-z,noexecstack"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <stdlib.h>
-#include <stdio.h>
-int main(int argc, char **argv) {
- /* Some math to catch -ftrapv problems in the toolchain */
- int i = 123 * argc, j = 456 + argc, k = 789 - argc;
- float l = i * 2.1;
- double m = l / 0.5;
- long long int n = argc * 12345LL, o = 12345LL * (long long int)argc;
- printf("%d %d %d %f %f %lld %lld\n", i, j, k, l, m, n, o);
- exit(0);
-}
-
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
- LDFLAGS="$saved_LDFLAGS $_define_flag"
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- LDFLAGS="$saved_LDFLAGS"
-
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-}
- # NB. -ftrapv expects certain support functions to be present in
- # the compiler library (libgcc or similar) to detect integer operations
- # that can overflow. We must check that the result of enabling it
- # actually links. The test program compiled/linked includes a number
- # of integer operations that should exercise this.
- {
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports compile flag -ftrapv and linking succeeds" >&5
-$as_echo_n "checking if $CC supports compile flag -ftrapv and linking succeeds... " >&6; }
- saved_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS $WERROR -ftrapv"
- _define_flag=""
- test "x$_define_flag" = "x" && _define_flag="-ftrapv"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <stdlib.h>
-#include <stdio.h>
-int main(int argc, char **argv) {
- /* Some math to catch -ftrapv problems in the toolchain */
- int i = 123 * argc, j = 456 + argc, k = 789 - argc;
- float l = i * 2.1;
- double m = l / 0.5;
- long long int n = argc * 12345LL, o = 12345LL * (long long int)argc;
- printf("%d %d %d %f %f %lld %lld\n", i, j, k, l, m, n, o);
- exit(0);
-}
-
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-
-if `grep -i "unrecognized option" conftest.err >/dev/null`
-then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- CFLAGS="$saved_CFLAGS"
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
- CFLAGS="$saved_CFLAGS $_define_flag"
-fi
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- CFLAGS="$saved_CFLAGS"
-
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-}
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking gcc version" >&5
-$as_echo_n "checking gcc version... " >&6; }
- GCC_VER=`$CC -v 2>&1 | $AWK '/gcc version /{print $3}'`
- case $GCC_VER in
- 1.*) no_attrib_nonnull=1 ;;
- 2.8* | 2.9*)
- no_attrib_nonnull=1
- ;;
- 2.*) no_attrib_nonnull=1 ;;
- *) ;;
- esac
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GCC_VER" >&5
-$as_echo "$GCC_VER" >&6; }
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC accepts -fno-builtin-memset" >&5
-$as_echo_n "checking if $CC accepts -fno-builtin-memset... " >&6; }
- saved_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS -fno-builtin-memset"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
- #include <string.h>
-int
-main ()
-{
- char b[10]; memset(b, 0, sizeof(b));
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$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; }
- CFLAGS="$saved_CFLAGS"
-
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-
- # -fstack-protector-all doesn't always work for some GCC versions
- # and/or platforms, so we test if we can. If it's not supported
- # on a given platform gcc will emit a warning so we use -Werror.
- if test "x$use_stack_protector" = "x1"; then
- for t in -fstack-protector-strong -fstack-protector-all \
- -fstack-protector; do
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports $t" >&5
-$as_echo_n "checking if $CC supports $t... " >&6; }
- saved_CFLAGS="$CFLAGS"
- saved_LDFLAGS="$LDFLAGS"
- CFLAGS="$CFLAGS $t -Werror"
- LDFLAGS="$LDFLAGS $t -Werror"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
- #include <stdio.h>
-int
-main ()
-{
-
- char x[256];
- snprintf(x, sizeof(x), "XXX");
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
- CFLAGS="$saved_CFLAGS $t"
- LDFLAGS="$saved_LDFLAGS $t"
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $t works" >&5
-$as_echo_n "checking if $t works... " >&6; }
- if test "$cross_compiling" = yes; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cross compiling: cannot test" >&5
-$as_echo "$as_me: WARNING: cross compiling: cannot test" >&2;}
- break
-
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
- #include <stdio.h>
-int
-main ()
-{
-
- char x[256];
- snprintf(x, sizeof(x), "XXX");
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
- break
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
- CFLAGS="$saved_CFLAGS"
- LDFLAGS="$saved_LDFLAGS"
- done
- fi
-
- if test -z "$have_llong_max"; then
- # retry LLONG_MAX with -std=gnu99, needed on some Linuxes
- unset ac_cv_have_decl_LLONG_MAX
- saved_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS -std=gnu99"
- ac_fn_c_check_decl "$LINENO" "LLONG_MAX" "ac_cv_have_decl_LLONG_MAX" "#include <limits.h>
-
-"
-if test "x$ac_cv_have_decl_LLONG_MAX" = xyes; then :
- have_llong_max=1
-else
- CFLAGS="$saved_CFLAGS"
-fi
-
- fi
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler allows __attribute__ on return types" >&5
-$as_echo_n "checking if compiler allows __attribute__ on return types... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <stdlib.h>
-__attribute__((__unused__)) static void foo(void){return;}
-int
-main ()
-{
- exit(0);
- ;
- return 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 NO_ATTRIBUTE_ON_RETURN_TYPE 1" >>confdefs.h
-
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-if test "x$no_attrib_nonnull" != "x1" ; then
-
-$as_echo "#define HAVE_ATTRIBUTE__NONNULL__ 1" >>confdefs.h
-
-fi
-
-
-# Check whether --with-rpath was given.
-if test "${with_rpath+set}" = set; then :
- withval=$with_rpath;
- if test "x$withval" = "xno" ; then
- need_dash_r=""
- fi
- if test "x$withval" = "xyes" ; then
- need_dash_r=1
- fi
-
-
-fi
-
-
-# Allow user to specify flags
-
-# Check whether --with-cflags was given.
-if test "${with_cflags+set}" = set; then :
- withval=$with_cflags;
- if test -n "$withval" && test "x$withval" != "xno" && \
- test "x${withval}" != "xyes"; then
- CFLAGS="$CFLAGS $withval"
- fi
-
-
-fi
-
-
-# Check whether --with-cppflags was given.
-if test "${with_cppflags+set}" = set; then :
- withval=$with_cppflags;
- if test -n "$withval" && test "x$withval" != "xno" && \
- test "x${withval}" != "xyes"; then
- CPPFLAGS="$CPPFLAGS $withval"
- fi
-
-
-fi
-
-
-# Check whether --with-ldflags was given.
-if test "${with_ldflags+set}" = set; then :
- withval=$with_ldflags;
- if test -n "$withval" && test "x$withval" != "xno" && \
- test "x${withval}" != "xyes"; then
- LDFLAGS="$LDFLAGS $withval"
- fi
-
-
-fi
-
-
-# Check whether --with-libs was given.
-if test "${with_libs+set}" = set; then :
- withval=$with_libs;
- if test -n "$withval" && test "x$withval" != "xno" && \
- test "x${withval}" != "xyes"; then
- LIBS="$LIBS $withval"
- fi
-
-
-fi
-
-
-# Check whether --with-Werror was given.
-if test "${with_Werror+set}" = set; then :
- withval=$with_Werror;
- if test -n "$withval" && test "x$withval" != "xno"; then
- werror_flags="-Werror"
- if test "x${withval}" != "xyes"; then
- werror_flags="$withval"
- fi
- fi
-
-
-fi
-
-
-for ac_header in \
- blf.h \
- bstring.h \
- crypt.h \
- crypto/sha2.h \
- dirent.h \
- endian.h \
- elf.h \
- features.h \
- fcntl.h \
- floatingpoint.h \
- getopt.h \
- glob.h \
- ia.h \
- iaf.h \
- inttypes.h \
- limits.h \
- locale.h \
- login.h \
- maillock.h \
- ndir.h \
- net/if_tun.h \
- netdb.h \
- netgroup.h \
- pam/pam_appl.h \
- paths.h \
- poll.h \
- pty.h \
- readpassphrase.h \
- rpc/types.h \
- security/pam_appl.h \
- sha2.h \
- shadow.h \
- stddef.h \
- stdint.h \
- string.h \
- strings.h \
- sys/audit.h \
- sys/bitypes.h \
- sys/bsdtty.h \
- sys/capability.h \
- sys/cdefs.h \
- sys/dir.h \
- sys/mman.h \
- sys/ndir.h \
- sys/poll.h \
- sys/prctl.h \
- sys/pstat.h \
- sys/select.h \
- sys/stat.h \
- sys/stream.h \
- sys/stropts.h \
- sys/strtio.h \
- sys/statvfs.h \
- sys/sysmacros.h \
- sys/time.h \
- sys/timers.h \
- time.h \
- tmpdir.h \
- ttyent.h \
- ucred.h \
- unistd.h \
- usersec.h \
- util.h \
- utime.h \
- utmp.h \
- utmpx.h \
- vis.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
-
-
-# lastlog.h requires sys/time.h to be included first on Solaris
-for ac_header in lastlog.h
-do :
- ac_fn_c_check_header_compile "$LINENO" "lastlog.h" "ac_cv_header_lastlog_h" "
-#ifdef HAVE_SYS_TIME_H
-# include <sys/time.h>
-#endif
-
-"
-if test "x$ac_cv_header_lastlog_h" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_LASTLOG_H 1
-_ACEOF
-
-fi
-
-done
-
-
-# sys/ptms.h requires sys/stream.h to be included first on Solaris
-for ac_header in sys/ptms.h
-do :
- ac_fn_c_check_header_compile "$LINENO" "sys/ptms.h" "ac_cv_header_sys_ptms_h" "
-#ifdef HAVE_SYS_STREAM_H
-# include <sys/stream.h>
-#endif
-
-"
-if test "x$ac_cv_header_sys_ptms_h" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_SYS_PTMS_H 1
-_ACEOF
-
-fi
-
-done
-
-
-# login_cap.h requires sys/types.h on NetBSD
-for ac_header in login_cap.h
-do :
- ac_fn_c_check_header_compile "$LINENO" "login_cap.h" "ac_cv_header_login_cap_h" "
-#include <sys/types.h>
-
-"
-if test "x$ac_cv_header_login_cap_h" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_LOGIN_CAP_H 1
-_ACEOF
-
-fi
-
-done
-
-
-# older BSDs need sys/param.h before sys/mount.h
-for ac_header in sys/mount.h
-do :
- ac_fn_c_check_header_compile "$LINENO" "sys/mount.h" "ac_cv_header_sys_mount_h" "
-#include <sys/param.h>
-
-"
-if test "x$ac_cv_header_sys_mount_h" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_SYS_MOUNT_H 1
-_ACEOF
-
-fi
-
-done
-
-
-# Android requires sys/socket.h to be included before sys/un.h
-for ac_header in sys/un.h
-do :
- ac_fn_c_check_header_compile "$LINENO" "sys/un.h" "ac_cv_header_sys_un_h" "
-#include <sys/types.h>
-#include <sys/socket.h>
-
-"
-if test "x$ac_cv_header_sys_un_h" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_SYS_UN_H 1
-_ACEOF
-
-fi
-
-done
-
-
-# Messages for features tested for in target-specific section
-SIA_MSG="no"
-SPC_MSG="no"
-SP_MSG="no"
-
-# Check for some target-specific stuff
-case "$host" in
-*-*-aix*)
- # Some versions of VAC won't allow macro redefinitions at
- # -qlanglevel=ansi, and autoconf 2.60 sometimes insists on using that
- # particularly with older versions of vac or xlc.
- # It also throws errors about null macro argments, but these are
- # not fatal.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler allows macro redefinitions" >&5
-$as_echo_n "checking if compiler allows macro redefinitions... " >&6; }
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#define testmacro foo
-#define testmacro bar
-int
-main ()
-{
- exit(0);
- ;
- return 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; }
- CC="`echo $CC | sed 's/-qlanglvl\=ansi//g'`"
- LD="`echo $LD | sed 's/-qlanglvl\=ansi//g'`"
- CFLAGS="`echo $CFLAGS | sed 's/-qlanglvl\=ansi//g'`"
- CPPFLAGS="`echo $CPPFLAGS | sed 's/-qlanglvl\=ansi//g'`"
-
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to specify blibpath for linker ($LD)" >&5
-$as_echo_n "checking how to specify blibpath for linker ($LD)... " >&6; }
- if (test -z "$blibpath"); then
- blibpath="/usr/lib:/lib"
- fi
- saved_LDFLAGS="$LDFLAGS"
- if test "$GCC" = "yes"; then
- flags="-Wl,-blibpath: -Wl,-rpath, -blibpath:"
- else
- flags="-blibpath: -Wl,-blibpath: -Wl,-rpath,"
- fi
- for tryflags in $flags ;do
- if (test -z "$blibflags"); then
- LDFLAGS="$saved_LDFLAGS $tryflags$blibpath"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- blibflags=$tryflags
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
- fi
- done
- if (test -z "$blibflags"); then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
-$as_echo "not found" >&6; }
- as_fn_error $? "*** must be able to specify blibpath on AIX - check config.log" "$LINENO" 5
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $blibflags" >&5
-$as_echo "$blibflags" >&6; }
- fi
- LDFLAGS="$saved_LDFLAGS"
- ac_fn_c_check_func "$LINENO" "authenticate" "ac_cv_func_authenticate"
-if test "x$ac_cv_func_authenticate" = xyes; then :
-
-$as_echo "#define WITH_AIXAUTHENTICATE 1" >>confdefs.h
-
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for authenticate in -ls" >&5
-$as_echo_n "checking for authenticate in -ls... " >&6; }
-if ${ac_cv_lib_s_authenticate+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-ls $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 authenticate ();
-int
-main ()
-{
-return authenticate ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_s_authenticate=yes
-else
- ac_cv_lib_s_authenticate=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_s_authenticate" >&5
-$as_echo "$ac_cv_lib_s_authenticate" >&6; }
-if test "x$ac_cv_lib_s_authenticate" = xyes; then :
- $as_echo "#define WITH_AIXAUTHENTICATE 1" >>confdefs.h
-
- LIBS="$LIBS -ls"
-
-fi
-
-
-fi
-
- ac_fn_c_check_decl "$LINENO" "authenticate" "ac_cv_have_decl_authenticate" "#include <usersec.h>
-"
-if test "x$ac_cv_have_decl_authenticate" = xyes; then :
- ac_have_decl=1
-else
- ac_have_decl=0
-fi
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_AUTHENTICATE $ac_have_decl
-_ACEOF
-ac_fn_c_check_decl "$LINENO" "loginrestrictions" "ac_cv_have_decl_loginrestrictions" "#include <usersec.h>
-"
-if test "x$ac_cv_have_decl_loginrestrictions" = xyes; then :
- ac_have_decl=1
-else
- ac_have_decl=0
-fi
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_LOGINRESTRICTIONS $ac_have_decl
-_ACEOF
-ac_fn_c_check_decl "$LINENO" "loginsuccess" "ac_cv_have_decl_loginsuccess" "#include <usersec.h>
-"
-if test "x$ac_cv_have_decl_loginsuccess" = xyes; then :
- ac_have_decl=1
-else
- ac_have_decl=0
-fi
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_LOGINSUCCESS $ac_have_decl
-_ACEOF
-ac_fn_c_check_decl "$LINENO" "passwdexpired" "ac_cv_have_decl_passwdexpired" "#include <usersec.h>
-"
-if test "x$ac_cv_have_decl_passwdexpired" = xyes; then :
- ac_have_decl=1
-else
- ac_have_decl=0
-fi
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_PASSWDEXPIRED $ac_have_decl
-_ACEOF
-ac_fn_c_check_decl "$LINENO" "setauthdb" "ac_cv_have_decl_setauthdb" "#include <usersec.h>
-"
-if test "x$ac_cv_have_decl_setauthdb" = xyes; then :
- ac_have_decl=1
-else
- ac_have_decl=0
-fi
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_SETAUTHDB $ac_have_decl
-_ACEOF
-
- ac_fn_c_check_decl "$LINENO" "loginfailed" "ac_cv_have_decl_loginfailed" "#include <usersec.h>
-
-"
-if test "x$ac_cv_have_decl_loginfailed" = xyes; then :
- ac_have_decl=1
-else
- ac_have_decl=0
-fi
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_LOGINFAILED $ac_have_decl
-_ACEOF
-if test $ac_have_decl = 1; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if loginfailed takes 4 arguments" >&5
-$as_echo_n "checking if loginfailed takes 4 arguments... " >&6; }
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
- #include <usersec.h>
-int
-main ()
-{
- (void)loginfailed("user","host","tty",0);
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-
-$as_echo "#define AIX_LOGINFAILED_4ARG 1" >>confdefs.h
-
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
- for ac_func in getgrset setauthdb
-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
-
- ac_fn_c_check_decl "$LINENO" "F_CLOSEM" "ac_cv_have_decl_F_CLOSEM" " #include <limits.h>
- #include <fcntl.h>
-
-"
-if test "x$ac_cv_have_decl_F_CLOSEM" = xyes; then :
-
-$as_echo "#define HAVE_FCNTL_CLOSEM 1" >>confdefs.h
-
-fi
-
- check_for_aix_broken_getaddrinfo=1
-
-$as_echo "#define BROKEN_REALPATH 1" >>confdefs.h
-
-
-$as_echo "#define SETEUID_BREAKS_SETUID 1" >>confdefs.h
-
-
-$as_echo "#define BROKEN_SETREUID 1" >>confdefs.h
-
-
-$as_echo "#define BROKEN_SETREGID 1" >>confdefs.h
-
-
-$as_echo "#define DISABLE_LASTLOG 1" >>confdefs.h
-
-
-$as_echo "#define LOGIN_NEEDS_UTMPX 1" >>confdefs.h
-
-
-$as_echo "#define SPT_TYPE SPT_REUSEARGV" >>confdefs.h
-
-
-$as_echo "#define SSHPAM_CHAUTHTOK_NEEDS_RUID 1" >>confdefs.h
-
-
-$as_echo "#define PTY_ZEROREAD 1" >>confdefs.h
-
-
-$as_echo "#define PLATFORM_SYS_DIR_UID 2" >>confdefs.h
-
- ;;
-*-*-android*)
-
-$as_echo "#define DISABLE_UTMP 1" >>confdefs.h
-
-
-$as_echo "#define DISABLE_WTMP 1" >>confdefs.h
-
- ;;
-*-*-cygwin*)
- check_for_libcrypt_later=1
- LIBS="$LIBS /usr/lib/textreadmode.o"
-
-$as_echo "#define HAVE_CYGWIN 1" >>confdefs.h
-
-
-$as_echo "#define USE_PIPES 1" >>confdefs.h
-
-
-$as_echo "#define DISABLE_SHADOW 1" >>confdefs.h
-
-
-$as_echo "#define NO_X11_UNIX_SOCKETS 1" >>confdefs.h
-
-
-$as_echo "#define NO_IPPORT_RESERVED_CONCEPT 1" >>confdefs.h
-
-
-$as_echo "#define DISABLE_FD_PASSING 1" >>confdefs.h
-
-
-$as_echo "#define SSH_IOBUFSZ 65535" >>confdefs.h
-
-
-$as_echo "#define FILESYSTEM_NO_BACKSLASH 1" >>confdefs.h
-
- # Cygwin defines optargs, optargs as declspec(dllimport) for historical
- # reasons which cause compile warnings, so we disable those warnings.
- {
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports compile flag -Wno-attributes" >&5
-$as_echo_n "checking if $CC supports compile flag -Wno-attributes... " >&6; }
- saved_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS $WERROR -Wno-attributes"
- _define_flag=""
- test "x$_define_flag" = "x" && _define_flag="-Wno-attributes"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <stdlib.h>
-#include <stdio.h>
-int main(int argc, char **argv) {
- /* Some math to catch -ftrapv problems in the toolchain */
- int i = 123 * argc, j = 456 + argc, k = 789 - argc;
- float l = i * 2.1;
- double m = l / 0.5;
- long long int n = argc * 12345LL, o = 12345LL * (long long int)argc;
- printf("%d %d %d %f %f %lld %lld\n", i, j, k, l, m, n, o);
- exit(0);
-}
-
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-if `grep -i "unrecognized option" conftest.err >/dev/null`
-then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- CFLAGS="$saved_CFLAGS"
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
- CFLAGS="$saved_CFLAGS $_define_flag"
-fi
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- CFLAGS="$saved_CFLAGS"
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-}
- ;;
-*-*-dgux*)
-
-$as_echo "#define IP_TOS_IS_BROKEN 1" >>confdefs.h
-
- $as_echo "#define SETEUID_BREAKS_SETUID 1" >>confdefs.h
-
- $as_echo "#define BROKEN_SETREUID 1" >>confdefs.h
-
- $as_echo "#define BROKEN_SETREGID 1" >>confdefs.h
-
- ;;
-*-*-darwin*)
- use_pie=auto
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we have working getaddrinfo" >&5
-$as_echo_n "checking if we have working getaddrinfo... " >&6; }
- if test "$cross_compiling" = yes; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: assume it is working" >&5
-$as_echo "assume it is working" >&6; }
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
- #include <mach-o/dyld.h>
-main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16))
- exit(0);
- else
- exit(1);
-}
-
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: working" >&5
-$as_echo "working" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: buggy" >&5
-$as_echo "buggy" >&6; }
-
-$as_echo "#define BROKEN_GETADDRINFO 1" >>confdefs.h
-
-
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
- $as_echo "#define SETEUID_BREAKS_SETUID 1" >>confdefs.h
-
- $as_echo "#define BROKEN_SETREUID 1" >>confdefs.h
-
- $as_echo "#define BROKEN_SETREGID 1" >>confdefs.h
-
-
-$as_echo "#define BROKEN_GLOB 1" >>confdefs.h
-
-
-cat >>confdefs.h <<_ACEOF
-#define BIND_8_COMPAT 1
-_ACEOF
-
-
-$as_echo "#define SSH_TUN_FREEBSD 1" >>confdefs.h
-
-
-$as_echo "#define SSH_TUN_COMPAT_AF 1" >>confdefs.h
-
-
-$as_echo "#define SSH_TUN_PREPEND_AF 1" >>confdefs.h
-
-
- ac_fn_c_check_decl "$LINENO" "AU_IPv4" "ac_cv_have_decl_AU_IPv4" "$ac_includes_default"
-if test "x$ac_cv_have_decl_AU_IPv4" = xyes; then :
-
-else
-
-$as_echo "#define AU_IPv4 0" >>confdefs.h
-
- #include <bsm/audit.h>
-
-$as_echo "#define LASTLOG_WRITE_PUTUTXLINE 1" >>confdefs.h
-
-
-fi
-
-
-$as_echo "#define SPT_TYPE SPT_REUSEARGV" >>confdefs.h
-
- for ac_func in sandbox_init
-do :
- ac_fn_c_check_func "$LINENO" "sandbox_init" "ac_cv_func_sandbox_init"
-if test "x$ac_cv_func_sandbox_init" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_SANDBOX_INIT 1
-_ACEOF
-
-fi
-done
-
- for ac_header in sandbox.h
-do :
- ac_fn_c_check_header_mongrel "$LINENO" "sandbox.h" "ac_cv_header_sandbox_h" "$ac_includes_default"
-if test "x$ac_cv_header_sandbox_h" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_SANDBOX_H 1
-_ACEOF
-
-fi
-
-done
-
- ;;
-*-*-dragonfly*)
- SSHDLIBS="$SSHDLIBS -lcrypt"
- TEST_MALLOC_OPTIONS="AFGJPRX"
- ;;
-*-*-haiku*)
- LIBS="$LIBS -lbsd "
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for socket in -lnetwork" >&5
-$as_echo_n "checking for socket in -lnetwork... " >&6; }
-if ${ac_cv_lib_network_socket+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lnetwork $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 socket ();
-int
-main ()
-{
-return socket ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_network_socket=yes
-else
- ac_cv_lib_network_socket=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_network_socket" >&5
-$as_echo "$ac_cv_lib_network_socket" >&6; }
-if test "x$ac_cv_lib_network_socket" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBNETWORK 1
-_ACEOF
-
- LIBS="-lnetwork $LIBS"
-
-fi
-
- $as_echo "#define HAVE_U_INT64_T 1" >>confdefs.h
-
- MANTYPE=man
- ;;
-*-*-hpux*)
- # first we define all of the options common to all HP-UX releases
- CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
- IPADDR_IN_DISPLAY=yes
- $as_echo "#define USE_PIPES 1" >>confdefs.h
-
-
-$as_echo "#define LOGIN_NO_ENDOPT 1" >>confdefs.h
-
- $as_echo "#define LOGIN_NEEDS_UTMPX 1" >>confdefs.h
-
-
-$as_echo "#define LOCKED_PASSWD_STRING \"*\"" >>confdefs.h
-
- $as_echo "#define SPT_TYPE SPT_PSTAT" >>confdefs.h
-
-
-$as_echo "#define PLATFORM_SYS_DIR_UID 2" >>confdefs.h
-
- maildir="/var/mail"
- LIBS="$LIBS -lsec"
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for t_error in -lxnet" >&5
-$as_echo_n "checking for t_error in -lxnet... " >&6; }
-if ${ac_cv_lib_xnet_t_error+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lxnet $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 t_error ();
-int
-main ()
-{
-return t_error ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_xnet_t_error=yes
-else
- ac_cv_lib_xnet_t_error=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_xnet_t_error" >&5
-$as_echo "$ac_cv_lib_xnet_t_error" >&6; }
-if test "x$ac_cv_lib_xnet_t_error" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBXNET 1
-_ACEOF
-
- LIBS="-lxnet $LIBS"
-
-else
- as_fn_error $? "*** -lxnet needed on HP-UX - check config.log ***" "$LINENO" 5
-fi
-
-
- # next, we define all of the options specific to major releases
- case "$host" in
- *-*-hpux10*)
- if test -z "$GCC"; then
- CFLAGS="$CFLAGS -Ae"
- fi
- ;;
- *-*-hpux11*)
-
-$as_echo "#define PAM_SUN_CODEBASE 1" >>confdefs.h
-
-
-$as_echo "#define DISABLE_UTMP 1" >>confdefs.h
-
-
-$as_echo "#define USE_BTMP 1" >>confdefs.h
-
- check_for_hpux_broken_getaddrinfo=1
- check_for_conflicting_getspnam=1
- ;;
- esac
-
- # lastly, we define options specific to minor releases
- case "$host" in
- *-*-hpux10.26)
-
-$as_echo "#define HAVE_SECUREWARE 1" >>confdefs.h
-
- disable_ptmx_check=yes
- LIBS="$LIBS -lsecpw"
- ;;
- esac
- ;;
-*-*-irix5*)
- PATH="$PATH:/usr/etc"
-
-$as_echo "#define BROKEN_INET_NTOA 1" >>confdefs.h
-
- $as_echo "#define SETEUID_BREAKS_SETUID 1" >>confdefs.h
-
- $as_echo "#define BROKEN_SETREUID 1" >>confdefs.h
-
- $as_echo "#define BROKEN_SETREGID 1" >>confdefs.h
-
-
-$as_echo "#define WITH_ABBREV_NO_TTY 1" >>confdefs.h
-
- $as_echo "#define LOCKED_PASSWD_STRING \"*LK*\"" >>confdefs.h
-
- ;;
-*-*-irix6*)
- PATH="$PATH:/usr/etc"
-
-$as_echo "#define WITH_IRIX_ARRAY 1" >>confdefs.h
-
-
-$as_echo "#define WITH_IRIX_PROJECT 1" >>confdefs.h
-
-
-$as_echo "#define WITH_IRIX_AUDIT 1" >>confdefs.h
-
- ac_fn_c_check_func "$LINENO" "jlimit_startjob" "ac_cv_func_jlimit_startjob"
-if test "x$ac_cv_func_jlimit_startjob" = xyes; then :
-
-$as_echo "#define WITH_IRIX_JOBS 1" >>confdefs.h
-
-fi
-
- $as_echo "#define BROKEN_INET_NTOA 1" >>confdefs.h
-
- $as_echo "#define SETEUID_BREAKS_SETUID 1" >>confdefs.h
-
- $as_echo "#define BROKEN_SETREUID 1" >>confdefs.h
-
- $as_echo "#define BROKEN_SETREGID 1" >>confdefs.h
-
-
-$as_echo "#define BROKEN_UPDWTMPX 1" >>confdefs.h
-
- $as_echo "#define WITH_ABBREV_NO_TTY 1" >>confdefs.h
-
- $as_echo "#define LOCKED_PASSWD_STRING \"*LK*\"" >>confdefs.h
-
- ;;
-*-*-k*bsd*-gnu | *-*-kopensolaris*-gnu)
- check_for_libcrypt_later=1
- $as_echo "#define PAM_TTY_KLUDGE 1" >>confdefs.h
-
- $as_echo "#define LOCKED_PASSWD_PREFIX \"!\"" >>confdefs.h
-
- $as_echo "#define SPT_TYPE SPT_REUSEARGV" >>confdefs.h
-
-
-$as_echo "#define _PATH_BTMP \"/var/log/btmp\"" >>confdefs.h
-
-
-$as_echo "#define USE_BTMP 1" >>confdefs.h
-
- ;;
-*-*-linux*)
- no_dev_ptmx=1
- use_pie=auto
- check_for_libcrypt_later=1
- check_for_openpty_ctty_bug=1
-
-$as_echo "#define PAM_TTY_KLUDGE 1" >>confdefs.h
-
-
-$as_echo "#define LOCKED_PASSWD_PREFIX \"!\"" >>confdefs.h
-
- $as_echo "#define SPT_TYPE SPT_REUSEARGV" >>confdefs.h
-
-
-$as_echo "#define LINK_OPNOTSUPP_ERRNO EPERM" >>confdefs.h
-
-
-$as_echo "#define _PATH_BTMP \"/var/log/btmp\"" >>confdefs.h
-
- $as_echo "#define USE_BTMP 1" >>confdefs.h
-
-
-$as_echo "#define LINUX_OOM_ADJUST 1" >>confdefs.h
-
- inet6_default_4in6=yes
- case `uname -r` in
- 1.*|2.0.*)
-
-$as_echo "#define BROKEN_CMSG_TYPE 1" >>confdefs.h
-
- ;;
- esac
- # tun(4) forwarding compat code
- for ac_header in linux/if_tun.h
-do :
- ac_fn_c_check_header_mongrel "$LINENO" "linux/if_tun.h" "ac_cv_header_linux_if_tun_h" "$ac_includes_default"
-if test "x$ac_cv_header_linux_if_tun_h" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_LINUX_IF_TUN_H 1
-_ACEOF
-
-fi
-
-done
-
- if test "x$ac_cv_header_linux_if_tun_h" = "xyes" ; then
-
-$as_echo "#define SSH_TUN_LINUX 1" >>confdefs.h
-
-
-$as_echo "#define SSH_TUN_COMPAT_AF 1" >>confdefs.h
-
-
-$as_echo "#define SSH_TUN_PREPEND_AF 1" >>confdefs.h
-
- fi
- for ac_header in linux/seccomp.h linux/filter.h linux/audit.h
-do :
- as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "#include <linux/types.h>
-"
-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 prctl
-do :
- ac_fn_c_check_func "$LINENO" "prctl" "ac_cv_func_prctl"
-if test "x$ac_cv_func_prctl" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_PRCTL 1
-_ACEOF
-
-fi
-done
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for seccomp architecture" >&5
-$as_echo_n "checking for seccomp architecture... " >&6; }
- seccomp_audit_arch=
- case "$host" in
- x86_64-*)
- seccomp_audit_arch=AUDIT_ARCH_X86_64
- ;;
- i*86-*)
- seccomp_audit_arch=AUDIT_ARCH_I386
- ;;
- arm*-*)
- seccomp_audit_arch=AUDIT_ARCH_ARM
- ;;
- esac
- if test "x$seccomp_audit_arch" != "x" ; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: \"$seccomp_audit_arch\"" >&5
-$as_echo "\"$seccomp_audit_arch\"" >&6; }
-
-cat >>confdefs.h <<_ACEOF
-#define SECCOMP_AUDIT_ARCH $seccomp_audit_arch
-_ACEOF
-
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: architecture not supported" >&5
-$as_echo "architecture not supported" >&6; }
- fi
- ;;
-mips-sony-bsd|mips-sony-newsos4)
-
-$as_echo "#define NEED_SETPGRP 1" >>confdefs.h
-
- SONY=1
- ;;
-*-*-netbsd*)
- check_for_libcrypt_before=1
- if test "x$withval" != "xno" ; then
- need_dash_r=1
- fi
-
-$as_echo "#define SSH_TUN_FREEBSD 1" >>confdefs.h
-
- ac_fn_c_check_header_mongrel "$LINENO" "net/if_tap.h" "ac_cv_header_net_if_tap_h" "$ac_includes_default"
-if test "x$ac_cv_header_net_if_tap_h" = xyes; then :
-
-else
-
-$as_echo "#define SSH_TUN_NO_L2 1" >>confdefs.h
-
-fi
-
-
-
-$as_echo "#define SSH_TUN_PREPEND_AF 1" >>confdefs.h
-
- TEST_MALLOC_OPTIONS="AJRX"
-
-$as_echo "#define BROKEN_STRNVIS 1" >>confdefs.h
-
-
-$as_echo "#define BROKEN_READ_COMPARISON 1" >>confdefs.h
-
- ;;
-*-*-freebsd*)
- check_for_libcrypt_later=1
-
-$as_echo "#define LOCKED_PASSWD_PREFIX \"*LOCKED*\"" >>confdefs.h
-
-
-$as_echo "#define SSH_TUN_FREEBSD 1" >>confdefs.h
-
- ac_fn_c_check_header_mongrel "$LINENO" "net/if_tap.h" "ac_cv_header_net_if_tap_h" "$ac_includes_default"
-if test "x$ac_cv_header_net_if_tap_h" = xyes; then :
-
-else
-
-$as_echo "#define SSH_TUN_NO_L2 1" >>confdefs.h
-
-fi
-
-
-
-$as_echo "#define BROKEN_GLOB 1" >>confdefs.h
-
-
-$as_echo "#define BROKEN_STRNVIS 1" >>confdefs.h
-
- TEST_MALLOC_OPTIONS="AJRX"
- # Preauth crypto occasionally uses file descriptors for crypto offload
- # and will crash if they cannot be opened.
-
-$as_echo "#define SANDBOX_SKIP_RLIMIT_NOFILE 1" >>confdefs.h
-
- ;;
-*-*-bsdi*)
- $as_echo "#define SETEUID_BREAKS_SETUID 1" >>confdefs.h
-
- $as_echo "#define BROKEN_SETREUID 1" >>confdefs.h
-
- $as_echo "#define BROKEN_SETREGID 1" >>confdefs.h
-
- ;;
-*-next-*)
- conf_lastlog_location="/usr/adm/lastlog"
- conf_utmp_location=/etc/utmp
- conf_wtmp_location=/usr/adm/wtmp
- maildir=/usr/spool/mail
-
-$as_echo "#define HAVE_NEXT 1" >>confdefs.h
-
- $as_echo "#define BROKEN_REALPATH 1" >>confdefs.h
-
- $as_echo "#define USE_PIPES 1" >>confdefs.h
-
-
-$as_echo "#define BROKEN_SAVED_UIDS 1" >>confdefs.h
-
- ;;
-*-*-openbsd*)
- use_pie=auto
-
-$as_echo "#define HAVE_ATTRIBUTE__SENTINEL__ 1" >>confdefs.h
-
-
-$as_echo "#define HAVE_ATTRIBUTE__BOUNDED__ 1" >>confdefs.h
-
-
-$as_echo "#define SSH_TUN_OPENBSD 1" >>confdefs.h
-
-
-$as_echo "#define SYSLOG_R_SAFE_IN_SIGHAND 1" >>confdefs.h
-
- TEST_MALLOC_OPTIONS="AFGJPRX"
- ;;
-*-*-solaris*)
- if test "x$withval" != "xno" ; then
- need_dash_r=1
- fi
- $as_echo "#define PAM_SUN_CODEBASE 1" >>confdefs.h
-
- $as_echo "#define LOGIN_NEEDS_UTMPX 1" >>confdefs.h
-
-
-$as_echo "#define LOGIN_NEEDS_TERM 1" >>confdefs.h
-
- $as_echo "#define PAM_TTY_KLUDGE 1" >>confdefs.h
-
-
-$as_echo "#define SSHPAM_CHAUTHTOK_NEEDS_RUID 1" >>confdefs.h
-
- $as_echo "#define LOCKED_PASSWD_STRING \"*LK*\"" >>confdefs.h
-
- # Pushing STREAMS modules will cause sshd to acquire a controlling tty.
-
-$as_echo "#define SSHD_ACQUIRES_CTTY 1" >>confdefs.h
-
-
-$as_echo "#define PASSWD_NEEDS_USERNAME 1" >>confdefs.h
-
-
-$as_echo "#define BROKEN_TCGETATTR_ICANON 1" >>confdefs.h
-
- external_path_file=/etc/default/login
- # hardwire lastlog location (can't detect it on some versions)
- conf_lastlog_location="/var/adm/lastlog"
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for obsolete utmp and wtmp in solaris2.x" >&5
-$as_echo_n "checking for obsolete utmp and wtmp in solaris2.x... " >&6; }
- sol2ver=`echo "$host"| sed -e 's/.*[0-9]\.//'`
- if test "$sol2ver" -ge 8; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
- $as_echo "#define DISABLE_UTMP 1" >>confdefs.h
-
-
-$as_echo "#define DISABLE_WTMP 1" >>confdefs.h
-
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- fi
-
-# Check whether --with-solaris-contracts was given.
-if test "${with_solaris_contracts+set}" = set; then :
- withval=$with_solaris_contracts;
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ct_tmpl_activate in -lcontract" >&5
-$as_echo_n "checking for ct_tmpl_activate in -lcontract... " >&6; }
-if ${ac_cv_lib_contract_ct_tmpl_activate+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lcontract $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 ct_tmpl_activate ();
-int
-main ()
-{
-return ct_tmpl_activate ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_contract_ct_tmpl_activate=yes
-else
- ac_cv_lib_contract_ct_tmpl_activate=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_contract_ct_tmpl_activate" >&5
-$as_echo "$ac_cv_lib_contract_ct_tmpl_activate" >&6; }
-if test "x$ac_cv_lib_contract_ct_tmpl_activate" = xyes; then :
-
-$as_echo "#define USE_SOLARIS_PROCESS_CONTRACTS 1" >>confdefs.h
-
- SSHDLIBS="$SSHDLIBS -lcontract"
- SPC_MSG="yes"
-fi
-
-
-fi
-
-
-# Check whether --with-solaris-projects was given.
-if test "${with_solaris_projects+set}" = set; then :
- withval=$with_solaris_projects;
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for setproject in -lproject" >&5
-$as_echo_n "checking for setproject in -lproject... " >&6; }
-if ${ac_cv_lib_project_setproject+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lproject $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 setproject ();
-int
-main ()
-{
-return setproject ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_project_setproject=yes
-else
- ac_cv_lib_project_setproject=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_project_setproject" >&5
-$as_echo "$ac_cv_lib_project_setproject" >&6; }
-if test "x$ac_cv_lib_project_setproject" = xyes; then :
-
-$as_echo "#define USE_SOLARIS_PROJECTS 1" >>confdefs.h
-
- SSHDLIBS="$SSHDLIBS -lproject"
- SP_MSG="yes"
-fi
-
-
-fi
-
- TEST_SHELL=$SHELL # let configure find us a capable shell
- ;;
-*-*-sunos4*)
- CPPFLAGS="$CPPFLAGS -DSUNOS4"
- for ac_func in getpwanam
-do :
- ac_fn_c_check_func "$LINENO" "getpwanam" "ac_cv_func_getpwanam"
-if test "x$ac_cv_func_getpwanam" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_GETPWANAM 1
-_ACEOF
-
-fi
-done
-
- $as_echo "#define PAM_SUN_CODEBASE 1" >>confdefs.h
-
- conf_utmp_location=/etc/utmp
- conf_wtmp_location=/var/adm/wtmp
- conf_lastlog_location=/var/adm/lastlog
- $as_echo "#define USE_PIPES 1" >>confdefs.h
-
- ;;
-*-ncr-sysv*)
- LIBS="$LIBS -lc89"
- $as_echo "#define USE_PIPES 1" >>confdefs.h
-
- $as_echo "#define SSHD_ACQUIRES_CTTY 1" >>confdefs.h
-
- $as_echo "#define SETEUID_BREAKS_SETUID 1" >>confdefs.h
-
- $as_echo "#define BROKEN_SETREUID 1" >>confdefs.h
-
- $as_echo "#define BROKEN_SETREGID 1" >>confdefs.h
-
- ;;
-*-sni-sysv*)
- # /usr/ucblib MUST NOT be searched on ReliantUNIX
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlsym in -ldl" >&5
-$as_echo_n "checking for dlsym in -ldl... " >&6; }
-if ${ac_cv_lib_dl_dlsym+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldl $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 dlsym ();
-int
-main ()
-{
-return dlsym ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_dl_dlsym=yes
-else
- ac_cv_lib_dl_dlsym=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_dl_dlsym" >&5
-$as_echo "$ac_cv_lib_dl_dlsym" >&6; }
-if test "x$ac_cv_lib_dl_dlsym" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBDL 1
-_ACEOF
-
- LIBS="-ldl $LIBS"
-
-fi
-
- # -lresolv needs to be at the end of LIBS or DNS lookups break
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for res_query in -lresolv" >&5
-$as_echo_n "checking for res_query in -lresolv... " >&6; }
-if ${ac_cv_lib_resolv_res_query+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lresolv $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 res_query ();
-int
-main ()
-{
-return res_query ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_resolv_res_query=yes
-else
- ac_cv_lib_resolv_res_query=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_resolv_res_query" >&5
-$as_echo "$ac_cv_lib_resolv_res_query" >&6; }
-if test "x$ac_cv_lib_resolv_res_query" = xyes; then :
- LIBS="$LIBS -lresolv"
-fi
-
- IPADDR_IN_DISPLAY=yes
- $as_echo "#define USE_PIPES 1" >>confdefs.h
-
- $as_echo "#define IP_TOS_IS_BROKEN 1" >>confdefs.h
-
- $as_echo "#define SETEUID_BREAKS_SETUID 1" >>confdefs.h
-
- $as_echo "#define BROKEN_SETREUID 1" >>confdefs.h
-
- $as_echo "#define BROKEN_SETREGID 1" >>confdefs.h
-
- $as_echo "#define SSHD_ACQUIRES_CTTY 1" >>confdefs.h
-
- external_path_file=/etc/default/login
- # /usr/ucblib/libucb.a no longer needed on ReliantUNIX
- # Attention: always take care to bind libsocket and libnsl before libc,
- # otherwise you will find lots of "SIOCGPGRP errno 22" on syslog
- ;;
-# UnixWare 1.x, UnixWare 2.x, and others based on code from Univel.
-*-*-sysv4.2*)
- $as_echo "#define USE_PIPES 1" >>confdefs.h
-
- $as_echo "#define SETEUID_BREAKS_SETUID 1" >>confdefs.h
-
- $as_echo "#define BROKEN_SETREUID 1" >>confdefs.h
-
- $as_echo "#define BROKEN_SETREGID 1" >>confdefs.h
-
-
-$as_echo "#define PASSWD_NEEDS_USERNAME 1" >>confdefs.h
-
- $as_echo "#define LOCKED_PASSWD_STRING \"*LK*\"" >>confdefs.h
-
- TEST_SHELL=$SHELL # let configure find us a capable shell
- ;;
-# UnixWare 7.x, OpenUNIX 8
-*-*-sysv5*)
- CPPFLAGS="$CPPFLAGS -Dvsnprintf=_xvsnprintf -Dsnprintf=_xsnprintf"
-
-$as_echo "#define UNIXWARE_LONG_PASSWORDS 1" >>confdefs.h
-
- $as_echo "#define USE_PIPES 1" >>confdefs.h
-
- $as_echo "#define SETEUID_BREAKS_SETUID 1" >>confdefs.h
-
- $as_echo "#define BROKEN_GETADDRINFO 1" >>confdefs.h
-
- $as_echo "#define BROKEN_SETREUID 1" >>confdefs.h
-
- $as_echo "#define BROKEN_SETREGID 1" >>confdefs.h
-
- $as_echo "#define PASSWD_NEEDS_USERNAME 1" >>confdefs.h
-
- TEST_SHELL=$SHELL # let configure find us a capable shell
- case "$host" in
- *-*-sysv5SCO_SV*) # SCO OpenServer 6.x
- maildir=/var/spool/mail
-
-$as_echo "#define BROKEN_LIBIAF 1" >>confdefs.h
-
- $as_echo "#define BROKEN_UPDWTMPX 1" >>confdefs.h
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getluid in -lprot" >&5
-$as_echo_n "checking for getluid in -lprot... " >&6; }
-if ${ac_cv_lib_prot_getluid+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lprot $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 getluid ();
-int
-main ()
-{
-return getluid ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_prot_getluid=yes
-else
- ac_cv_lib_prot_getluid=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_prot_getluid" >&5
-$as_echo "$ac_cv_lib_prot_getluid" >&6; }
-if test "x$ac_cv_lib_prot_getluid" = xyes; then :
- LIBS="$LIBS -lprot"
- for ac_func in getluid setluid
-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 "#define HAVE_SECUREWARE 1" >>confdefs.h
-
- $as_echo "#define DISABLE_SHADOW 1" >>confdefs.h
-
-
-fi
-
- ;;
- *) $as_echo "#define LOCKED_PASSWD_STRING \"*LK*\"" >>confdefs.h
-
- check_for_libcrypt_later=1
- ;;
- esac
- ;;
-*-*-sysv*)
- ;;
-# SCO UNIX and OEM versions of SCO UNIX
-*-*-sco3.2v4*)
- as_fn_error $? "\"This Platform is no longer supported.\"" "$LINENO" 5
- ;;
-# SCO OpenServer 5.x
-*-*-sco3.2v5*)
- if test -z "$GCC"; then
- CFLAGS="$CFLAGS -belf"
- fi
- LIBS="$LIBS -lprot -lx -ltinfo -lm"
- no_dev_ptmx=1
- $as_echo "#define USE_PIPES 1" >>confdefs.h
-
- $as_echo "#define HAVE_SECUREWARE 1" >>confdefs.h
-
- $as_echo "#define DISABLE_SHADOW 1" >>confdefs.h
-
- $as_echo "#define DISABLE_FD_PASSING 1" >>confdefs.h
-
- $as_echo "#define SETEUID_BREAKS_SETUID 1" >>confdefs.h
-
- $as_echo "#define BROKEN_GETADDRINFO 1" >>confdefs.h
-
- $as_echo "#define BROKEN_SETREUID 1" >>confdefs.h
-
- $as_echo "#define BROKEN_SETREGID 1" >>confdefs.h
-
- $as_echo "#define WITH_ABBREV_NO_TTY 1" >>confdefs.h
-
- $as_echo "#define BROKEN_UPDWTMPX 1" >>confdefs.h
-
- $as_echo "#define PASSWD_NEEDS_USERNAME 1" >>confdefs.h
-
- for ac_func in getluid setluid
-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
-
- MANTYPE=man
- TEST_SHELL=$SHELL # let configure find us a capable shell
- SKIP_DISABLE_LASTLOG_DEFINE=yes
- ;;
-*-*-unicosmk*)
-
-$as_echo "#define NO_SSH_LASTLOG 1" >>confdefs.h
-
- $as_echo "#define SETEUID_BREAKS_SETUID 1" >>confdefs.h
-
- $as_echo "#define BROKEN_SETREUID 1" >>confdefs.h
-
- $as_echo "#define BROKEN_SETREGID 1" >>confdefs.h
-
- $as_echo "#define USE_PIPES 1" >>confdefs.h
-
- $as_echo "#define DISABLE_FD_PASSING 1" >>confdefs.h
-
- LDFLAGS="$LDFLAGS"
- LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm"
- MANTYPE=cat
- ;;
-*-*-unicosmp*)
- $as_echo "#define SETEUID_BREAKS_SETUID 1" >>confdefs.h
-
- $as_echo "#define BROKEN_SETREUID 1" >>confdefs.h
-
- $as_echo "#define BROKEN_SETREGID 1" >>confdefs.h
-
- $as_echo "#define WITH_ABBREV_NO_TTY 1" >>confdefs.h
-
- $as_echo "#define USE_PIPES 1" >>confdefs.h
-
- $as_echo "#define DISABLE_FD_PASSING 1" >>confdefs.h
-
- LDFLAGS="$LDFLAGS"
- LIBS="$LIBS -lgen -lacid -ldb"
- MANTYPE=cat
- ;;
-*-*-unicos*)
- $as_echo "#define SETEUID_BREAKS_SETUID 1" >>confdefs.h
-
- $as_echo "#define BROKEN_SETREUID 1" >>confdefs.h
-
- $as_echo "#define BROKEN_SETREGID 1" >>confdefs.h
-
- $as_echo "#define USE_PIPES 1" >>confdefs.h
-
- $as_echo "#define DISABLE_FD_PASSING 1" >>confdefs.h
-
- $as_echo "#define NO_SSH_LASTLOG 1" >>confdefs.h
-
- LDFLAGS="$LDFLAGS -Wl,-Dmsglevel=334:fatal"
- LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm"
- MANTYPE=cat
- ;;
-*-dec-osf*)
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Digital Unix SIA" >&5
-$as_echo_n "checking for Digital Unix SIA... " >&6; }
- no_osfsia=""
-
-# Check whether --with-osfsia was given.
-if test "${with_osfsia+set}" = set; then :
- withval=$with_osfsia;
- if test "x$withval" = "xno" ; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5
-$as_echo "disabled" >&6; }
- no_osfsia=1
- fi
-
-fi
-
- if test -z "$no_osfsia" ; then
- if test -f /etc/sia/matrix.conf; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-
-$as_echo "#define HAVE_OSF_SIA 1" >>confdefs.h
-
-
-$as_echo "#define DISABLE_LOGIN 1" >>confdefs.h
-
- $as_echo "#define DISABLE_FD_PASSING 1" >>confdefs.h
-
- LIBS="$LIBS -lsecurity -ldb -lm -laud"
- SIA_MSG="yes"
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-
-$as_echo "#define LOCKED_PASSWD_SUBSTR \"Nologin\"" >>confdefs.h
-
- fi
- fi
- $as_echo "#define BROKEN_GETADDRINFO 1" >>confdefs.h
-
- $as_echo "#define SETEUID_BREAKS_SETUID 1" >>confdefs.h
-
- $as_echo "#define BROKEN_SETREUID 1" >>confdefs.h
-
- $as_echo "#define BROKEN_SETREGID 1" >>confdefs.h
-
-
-$as_echo "#define BROKEN_READV_COMPARISON 1" >>confdefs.h
-
- ;;
-
-*-*-nto-qnx*)
- $as_echo "#define USE_PIPES 1" >>confdefs.h
-
- $as_echo "#define NO_X11_UNIX_SOCKETS 1" >>confdefs.h
-
- $as_echo "#define DISABLE_LASTLOG 1" >>confdefs.h
-
- $as_echo "#define SSHD_ACQUIRES_CTTY 1" >>confdefs.h
-
-
-$as_echo "#define BROKEN_SHADOW_EXPIRE 1" >>confdefs.h
-
- enable_etc_default_login=no # has incompatible /etc/default/login
- case "$host" in
- *-*-nto-qnx6*)
- $as_echo "#define DISABLE_FD_PASSING 1" >>confdefs.h
-
- ;;
- esac
- ;;
-
-*-*-ultrix*)
-
-$as_echo "#define BROKEN_GETGROUPS 1" >>confdefs.h
-
-
-$as_echo "#define BROKEN_MMAP 1" >>confdefs.h
-
- $as_echo "#define NEED_SETPGRP 1" >>confdefs.h
-
-
-$as_echo "#define HAVE_SYS_SYSLOG_H 1" >>confdefs.h
-
- ;;
-
-*-*-lynxos)
- CFLAGS="$CFLAGS -D__NO_INCLUDE_WARN__"
-
-$as_echo "#define BROKEN_SETVBUF 1" >>confdefs.h
-
- ;;
-esac
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking compiler and flags for sanity" >&5
-$as_echo_n "checking compiler and flags for sanity... " >&6; }
-if test "$cross_compiling" = yes; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cross compiling: not checking compiler sanity" >&5
-$as_echo "$as_me: WARNING: cross compiling: not checking compiler sanity" >&2;}
-
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
- #include <stdio.h>
-int
-main ()
-{
- exit(0);
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$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_fn_error $? "*** compiler cannot create working executables, check config.log ***" "$LINENO" 5
-
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-
-# Checks for libraries.
-ac_fn_c_check_func "$LINENO" "yp_match" "ac_cv_func_yp_match"
-if test "x$ac_cv_func_yp_match" = xyes; then :
-
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for yp_match in -lnsl" >&5
-$as_echo_n "checking for yp_match in -lnsl... " >&6; }
-if ${ac_cv_lib_nsl_yp_match+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lnsl $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 yp_match ();
-int
-main ()
-{
-return yp_match ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_nsl_yp_match=yes
-else
- ac_cv_lib_nsl_yp_match=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_nsl_yp_match" >&5
-$as_echo "$ac_cv_lib_nsl_yp_match" >&6; }
-if test "x$ac_cv_lib_nsl_yp_match" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBNSL 1
-_ACEOF
-
- LIBS="-lnsl $LIBS"
-
-fi
-
-fi
-
-ac_fn_c_check_func "$LINENO" "setsockopt" "ac_cv_func_setsockopt"
-if test "x$ac_cv_func_setsockopt" = xyes; then :
-
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for setsockopt in -lsocket" >&5
-$as_echo_n "checking for setsockopt in -lsocket... " >&6; }
-if ${ac_cv_lib_socket_setsockopt+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lsocket $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 setsockopt ();
-int
-main ()
-{
-return setsockopt ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_socket_setsockopt=yes
-else
- ac_cv_lib_socket_setsockopt=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_socket_setsockopt" >&5
-$as_echo "$ac_cv_lib_socket_setsockopt" >&6; }
-if test "x$ac_cv_lib_socket_setsockopt" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBSOCKET 1
-_ACEOF
-
- LIBS="-lsocket $LIBS"
-
-fi
-
-fi
-
-
-for ac_func in dirname
-do :
- ac_fn_c_check_func "$LINENO" "dirname" "ac_cv_func_dirname"
-if test "x$ac_cv_func_dirname" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_DIRNAME 1
-_ACEOF
- for ac_header in libgen.h
-do :
- ac_fn_c_check_header_mongrel "$LINENO" "libgen.h" "ac_cv_header_libgen_h" "$ac_includes_default"
-if test "x$ac_cv_header_libgen_h" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBGEN_H 1
-_ACEOF
-
-fi
-
-done
-
-else
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dirname in -lgen" >&5
-$as_echo_n "checking for dirname in -lgen... " >&6; }
-if ${ac_cv_lib_gen_dirname+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lgen $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 dirname ();
-int
-main ()
-{
-return dirname ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_gen_dirname=yes
-else
- ac_cv_lib_gen_dirname=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_gen_dirname" >&5
-$as_echo "$ac_cv_lib_gen_dirname" >&6; }
-if test "x$ac_cv_lib_gen_dirname" = xyes; then :
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for broken dirname" >&5
-$as_echo_n "checking for broken dirname... " >&6; }
-if ${ac_cv_have_broken_dirname+:} false; then :
- $as_echo_n "(cached) " >&6
-else
-
- save_LIBS="$LIBS"
- LIBS="$LIBS -lgen"
- if test "$cross_compiling" = yes; then :
- ac_cv_have_broken_dirname="no"
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <libgen.h>
-#include <string.h>
-
-int main(int argc, char **argv) {
- char *s, buf[32];
-
- strncpy(buf,"/etc", 32);
- s = dirname(buf);
- if (!s || strncmp(s, "/", 32) != 0) {
- exit(1);
- } else {
- exit(0);
- }
-}
-
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
- ac_cv_have_broken_dirname="no"
-else
- ac_cv_have_broken_dirname="yes"
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
- LIBS="$save_LIBS"
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_broken_dirname" >&5
-$as_echo "$ac_cv_have_broken_dirname" >&6; }
- if test "x$ac_cv_have_broken_dirname" = "xno" ; then
- LIBS="$LIBS -lgen"
- $as_echo "#define HAVE_DIRNAME 1" >>confdefs.h
-
- for ac_header in libgen.h
-do :
- ac_fn_c_check_header_mongrel "$LINENO" "libgen.h" "ac_cv_header_libgen_h" "$ac_includes_default"
-if test "x$ac_cv_header_libgen_h" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBGEN_H 1
-_ACEOF
-
-fi
-
-done
-
- fi
-
-fi
-
-
-fi
-done
-
-
-ac_fn_c_check_func "$LINENO" "getspnam" "ac_cv_func_getspnam"
-if test "x$ac_cv_func_getspnam" = xyes; then :
-
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getspnam in -lgen" >&5
-$as_echo_n "checking for getspnam in -lgen... " >&6; }
-if ${ac_cv_lib_gen_getspnam+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lgen $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 getspnam ();
-int
-main ()
-{
-return getspnam ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_gen_getspnam=yes
-else
- ac_cv_lib_gen_getspnam=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_gen_getspnam" >&5
-$as_echo "$ac_cv_lib_gen_getspnam" >&6; }
-if test "x$ac_cv_lib_gen_getspnam" = xyes; then :
- LIBS="$LIBS -lgen"
-fi
-
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing basename" >&5
-$as_echo_n "checking for library containing basename... " >&6; }
-if ${ac_cv_search_basename+:} 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 basename ();
-int
-main ()
-{
-return basename ();
- ;
- return 0;
-}
-_ACEOF
-for ac_lib in '' gen; 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_basename=$ac_res
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext
- if ${ac_cv_search_basename+:} false; then :
- break
-fi
-done
-if ${ac_cv_search_basename+:} false; then :
-
-else
- ac_cv_search_basename=no
-fi
-rm conftest.$ac_ext
-LIBS=$ac_func_search_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_basename" >&5
-$as_echo "$ac_cv_search_basename" >&6; }
-ac_res=$ac_cv_search_basename
-if test "$ac_res" != no; then :
- test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
-
-$as_echo "#define HAVE_BASENAME 1" >>confdefs.h
-
-fi
-
-
-
-# Check whether --with-zlib was given.
-if test "${with_zlib+set}" = set; then :
- withval=$with_zlib; if test "x$withval" = "xno" ; then
- as_fn_error $? "*** zlib is required ***" "$LINENO" 5
- elif test "x$withval" != "xyes"; then
- if test -d "$withval/lib"; then
- if test -n "${need_dash_r}"; then
- LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
- else
- LDFLAGS="-L${withval}/lib ${LDFLAGS}"
- fi
- else
- if test -n "${need_dash_r}"; then
- LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
- else
- LDFLAGS="-L${withval} ${LDFLAGS}"
- fi
- fi
- if test -d "$withval/include"; then
- CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
- else
- CPPFLAGS="-I${withval} ${CPPFLAGS}"
- fi
- fi
-
-fi
-
-
-ac_fn_c_check_header_mongrel "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default"
-if test "x$ac_cv_header_zlib_h" = xyes; then :
-
-else
- as_fn_error $? "*** zlib.h missing - please install first or check config.log ***" "$LINENO" 5
-fi
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for deflate in -lz" >&5
-$as_echo_n "checking for deflate in -lz... " >&6; }
-if ${ac_cv_lib_z_deflate+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lz $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 deflate ();
-int
-main ()
-{
-return deflate ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_z_deflate=yes
-else
- ac_cv_lib_z_deflate=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_z_deflate" >&5
-$as_echo "$ac_cv_lib_z_deflate" >&6; }
-if test "x$ac_cv_lib_z_deflate" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBZ 1
-_ACEOF
-
- LIBS="-lz $LIBS"
-
-else
-
- saved_CPPFLAGS="$CPPFLAGS"
- saved_LDFLAGS="$LDFLAGS"
- save_LIBS="$LIBS"
- if test -n "${need_dash_r}"; then
- LDFLAGS="-L/usr/local/lib -R/usr/local/lib ${saved_LDFLAGS}"
- else
- LDFLAGS="-L/usr/local/lib ${saved_LDFLAGS}"
- fi
- CPPFLAGS="-I/usr/local/include ${saved_CPPFLAGS}"
- LIBS="$LIBS -lz"
- 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 deflate ();
-int
-main ()
-{
-return deflate ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- $as_echo "#define HAVE_LIBZ 1" >>confdefs.h
-
-else
-
- as_fn_error $? "*** zlib missing - please install first or check config.log ***" "$LINENO" 5
-
-
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-
-
-fi
-
-
-
-# Check whether --with-zlib-version-check was given.
-if test "${with_zlib_version_check+set}" = set; then :
- withval=$with_zlib_version_check; if test "x$withval" = "xno" ; then
- zlib_check_nonfatal=1
- fi
-
-
-fi
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for possibly buggy zlib" >&5
-$as_echo_n "checking for possibly buggy zlib... " >&6; }
-if test "$cross_compiling" = yes; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cross compiling: not checking zlib version" >&5
-$as_echo "$as_me: WARNING: cross compiling: not checking zlib version" >&2;}
-
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <zlib.h>
-
-int
-main ()
-{
-
- int a=0, b=0, c=0, d=0, n, v;
- n = sscanf(ZLIB_VERSION, "%d.%d.%d.%d", &a, &b, &c, &d);
- if (n != 3 && n != 4)
- exit(1);
- v = a*1000000 + b*10000 + c*100 + d;
- fprintf(stderr, "found zlib version %s (%d)\n", ZLIB_VERSION, v);
-
- /* 1.1.4 is OK */
- if (a == 1 && b == 1 && c >= 4)
- exit(0);
-
- /* 1.2.3 and up are OK */
- if (v >= 1020300)
- exit(0);
-
- exit(2);
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
- if test -z "$zlib_check_nonfatal" ; then
- as_fn_error $? "*** zlib too old - check config.log ***
-Your reported zlib version has known security problems. It's possible your
-vendor has fixed these problems without changing the version number. If you
-are sure this is the case, you can disable the check by running
-\"./configure --without-zlib-version-check\".
-If you are in doubt, upgrade zlib to version 1.2.3 or greater.
-See http://www.gzip.org/zlib/ for details." "$LINENO" 5
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: zlib version may have security problems" >&5
-$as_echo "$as_me: WARNING: zlib version may have security problems" >&2;}
- fi
-
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-
-ac_fn_c_check_func "$LINENO" "strcasecmp" "ac_cv_func_strcasecmp"
-if test "x$ac_cv_func_strcasecmp" = xyes; then :
-
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for strcasecmp in -lresolv" >&5
-$as_echo_n "checking for strcasecmp in -lresolv... " >&6; }
-if ${ac_cv_lib_resolv_strcasecmp+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lresolv $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 strcasecmp ();
-int
-main ()
-{
-return strcasecmp ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_resolv_strcasecmp=yes
-else
- ac_cv_lib_resolv_strcasecmp=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_resolv_strcasecmp" >&5
-$as_echo "$ac_cv_lib_resolv_strcasecmp" >&6; }
-if test "x$ac_cv_lib_resolv_strcasecmp" = xyes; then :
- LIBS="$LIBS -lresolv"
-fi
-
-
-fi
-
-for ac_func in utimes
-do :
- ac_fn_c_check_func "$LINENO" "utimes" "ac_cv_func_utimes"
-if test "x$ac_cv_func_utimes" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_UTIMES 1
-_ACEOF
-
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for utimes in -lc89" >&5
-$as_echo_n "checking for utimes in -lc89... " >&6; }
-if ${ac_cv_lib_c89_utimes+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lc89 $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 utimes ();
-int
-main ()
-{
-return utimes ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_c89_utimes=yes
-else
- ac_cv_lib_c89_utimes=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_c89_utimes" >&5
-$as_echo "$ac_cv_lib_c89_utimes" >&6; }
-if test "x$ac_cv_lib_c89_utimes" = xyes; then :
- $as_echo "#define HAVE_UTIMES 1" >>confdefs.h
-
- LIBS="$LIBS -lc89"
-fi
-
-
-fi
-done
-
-
-for ac_header in bsd/libutil.h libutil.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
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing fmt_scaled" >&5
-$as_echo_n "checking for library containing fmt_scaled... " >&6; }
-if ${ac_cv_search_fmt_scaled+:} 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 fmt_scaled ();
-int
-main ()
-{
-return fmt_scaled ();
- ;
- return 0;
-}
-_ACEOF
-for ac_lib in '' util bsd; 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_fmt_scaled=$ac_res
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext
- if ${ac_cv_search_fmt_scaled+:} false; then :
- break
-fi
-done
-if ${ac_cv_search_fmt_scaled+:} false; then :
-
-else
- ac_cv_search_fmt_scaled=no
-fi
-rm conftest.$ac_ext
-LIBS=$ac_func_search_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_fmt_scaled" >&5
-$as_echo "$ac_cv_search_fmt_scaled" >&6; }
-ac_res=$ac_cv_search_fmt_scaled
-if test "$ac_res" != no; then :
- test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
-
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing scan_scaled" >&5
-$as_echo_n "checking for library containing scan_scaled... " >&6; }
-if ${ac_cv_search_scan_scaled+:} 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 scan_scaled ();
-int
-main ()
-{
-return scan_scaled ();
- ;
- return 0;
-}
-_ACEOF
-for ac_lib in '' util bsd; 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_scan_scaled=$ac_res
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext
- if ${ac_cv_search_scan_scaled+:} false; then :
- break
-fi
-done
-if ${ac_cv_search_scan_scaled+:} false; then :
-
-else
- ac_cv_search_scan_scaled=no
-fi
-rm conftest.$ac_ext
-LIBS=$ac_func_search_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_scan_scaled" >&5
-$as_echo "$ac_cv_search_scan_scaled" >&6; }
-ac_res=$ac_cv_search_scan_scaled
-if test "$ac_res" != no; then :
- test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
-
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing login" >&5
-$as_echo_n "checking for library containing login... " >&6; }
-if ${ac_cv_search_login+:} 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 login ();
-int
-main ()
-{
-return login ();
- ;
- return 0;
-}
-_ACEOF
-for ac_lib in '' util bsd; 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_login=$ac_res
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext
- if ${ac_cv_search_login+:} false; then :
- break
-fi
-done
-if ${ac_cv_search_login+:} false; then :
-
-else
- ac_cv_search_login=no
-fi
-rm conftest.$ac_ext
-LIBS=$ac_func_search_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_login" >&5
-$as_echo "$ac_cv_search_login" >&6; }
-ac_res=$ac_cv_search_login
-if test "$ac_res" != no; then :
- test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
-
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing logout" >&5
-$as_echo_n "checking for library containing logout... " >&6; }
-if ${ac_cv_search_logout+:} 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 logout ();
-int
-main ()
-{
-return logout ();
- ;
- return 0;
-}
-_ACEOF
-for ac_lib in '' util bsd; 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_logout=$ac_res
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext
- if ${ac_cv_search_logout+:} false; then :
- break
-fi
-done
-if ${ac_cv_search_logout+:} false; then :
-
-else
- ac_cv_search_logout=no
-fi
-rm conftest.$ac_ext
-LIBS=$ac_func_search_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_logout" >&5
-$as_echo "$ac_cv_search_logout" >&6; }
-ac_res=$ac_cv_search_logout
-if test "$ac_res" != no; then :
- test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
-
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing logwtmp" >&5
-$as_echo_n "checking for library containing logwtmp... " >&6; }
-if ${ac_cv_search_logwtmp+:} 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 logwtmp ();
-int
-main ()
-{
-return logwtmp ();
- ;
- return 0;
-}
-_ACEOF
-for ac_lib in '' util bsd; 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_logwtmp=$ac_res
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext
- if ${ac_cv_search_logwtmp+:} false; then :
- break
-fi
-done
-if ${ac_cv_search_logwtmp+:} false; then :
-
-else
- ac_cv_search_logwtmp=no
-fi
-rm conftest.$ac_ext
-LIBS=$ac_func_search_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_logwtmp" >&5
-$as_echo "$ac_cv_search_logwtmp" >&6; }
-ac_res=$ac_cv_search_logwtmp
-if test "$ac_res" != no; then :
- test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
-
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing openpty" >&5
-$as_echo_n "checking for library containing openpty... " >&6; }
-if ${ac_cv_search_openpty+:} 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 openpty ();
-int
-main ()
-{
-return openpty ();
- ;
- return 0;
-}
-_ACEOF
-for ac_lib in '' util bsd; 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_openpty=$ac_res
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext
- if ${ac_cv_search_openpty+:} false; then :
- break
-fi
-done
-if ${ac_cv_search_openpty+:} false; then :
-
-else
- ac_cv_search_openpty=no
-fi
-rm conftest.$ac_ext
-LIBS=$ac_func_search_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_openpty" >&5
-$as_echo "$ac_cv_search_openpty" >&6; }
-ac_res=$ac_cv_search_openpty
-if test "$ac_res" != no; then :
- test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
-
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing updwtmp" >&5
-$as_echo_n "checking for library containing updwtmp... " >&6; }
-if ${ac_cv_search_updwtmp+:} 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 updwtmp ();
-int
-main ()
-{
-return updwtmp ();
- ;
- return 0;
-}
-_ACEOF
-for ac_lib in '' util bsd; 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_updwtmp=$ac_res
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext
- if ${ac_cv_search_updwtmp+:} false; then :
- break
-fi
-done
-if ${ac_cv_search_updwtmp+:} false; then :
-
-else
- ac_cv_search_updwtmp=no
-fi
-rm conftest.$ac_ext
-LIBS=$ac_func_search_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_updwtmp" >&5
-$as_echo "$ac_cv_search_updwtmp" >&6; }
-ac_res=$ac_cv_search_updwtmp
-if test "$ac_res" != no; then :
- test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
-
-fi
-
-for ac_func in fmt_scaled scan_scaled login logout openpty updwtmp logwtmp
-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
-
-
-# On some platforms, inet_ntop may be found in libresolv or libnsl.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing inet_ntop" >&5
-$as_echo_n "checking for library containing inet_ntop... " >&6; }
-if ${ac_cv_search_inet_ntop+:} 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 inet_ntop ();
-int
-main ()
-{
-return inet_ntop ();
- ;
- return 0;
-}
-_ACEOF
-for ac_lib in '' resolv nsl; 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_inet_ntop=$ac_res
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext
- if ${ac_cv_search_inet_ntop+:} false; then :
- break
-fi
-done
-if ${ac_cv_search_inet_ntop+:} false; then :
-
-else
- ac_cv_search_inet_ntop=no
-fi
-rm conftest.$ac_ext
-LIBS=$ac_func_search_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_inet_ntop" >&5
-$as_echo "$ac_cv_search_inet_ntop" >&6; }
-ac_res=$ac_cv_search_inet_ntop
-if test "$ac_res" != no; then :
- test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
-
-fi
-
-
-for ac_func in strftime
-do :
- ac_fn_c_check_func "$LINENO" "strftime" "ac_cv_func_strftime"
-if test "x$ac_cv_func_strftime" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_STRFTIME 1
-_ACEOF
-
-else
- # strftime is in -lintl on SCO UNIX.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for strftime in -lintl" >&5
-$as_echo_n "checking for strftime in -lintl... " >&6; }
-if ${ac_cv_lib_intl_strftime+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lintl $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 strftime ();
-int
-main ()
-{
-return strftime ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_intl_strftime=yes
-else
- ac_cv_lib_intl_strftime=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_intl_strftime" >&5
-$as_echo "$ac_cv_lib_intl_strftime" >&6; }
-if test "x$ac_cv_lib_intl_strftime" = xyes; then :
- $as_echo "#define HAVE_STRFTIME 1" >>confdefs.h
-
-LIBS="-lintl $LIBS"
-fi
-
-fi
-done
-
-
-# Check for ALTDIRFUNC glob() extension
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GLOB_ALTDIRFUNC support" >&5
-$as_echo_n "checking for GLOB_ALTDIRFUNC support... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
- #include <glob.h>
- #ifdef GLOB_ALTDIRFUNC
- FOUNDIT
- #endif
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "FOUNDIT" >/dev/null 2>&1; then :
-
-
-$as_echo "#define GLOB_HAS_ALTDIRFUNC 1" >>confdefs.h
-
- { $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; }
-
-
-fi
-rm -f conftest*
-
-
-# Check for g.gl_matchc glob() extension
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for gl_matchc field in glob_t" >&5
-$as_echo_n "checking for gl_matchc field in glob_t... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
- #include <glob.h>
-int
-main ()
-{
- glob_t g; g.gl_matchc = 1;
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-
-$as_echo "#define GLOB_HAS_GL_MATCHC 1" >>confdefs.h
-
- { $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; }
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-# Check for g.gl_statv glob() extension
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for gl_statv and GLOB_KEEPSTAT extensions for glob" >&5
-$as_echo_n "checking for gl_statv and GLOB_KEEPSTAT extensions for glob... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
- #include <glob.h>
-int
-main ()
-{
-
-#ifndef GLOB_KEEPSTAT
-#error "glob does not support GLOB_KEEPSTAT extension"
-#endif
-glob_t g;
-g.gl_statv = NULL;
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-
-$as_echo "#define GLOB_HAS_GL_STATV 1" >>confdefs.h
-
- { $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; }
-
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-ac_fn_c_check_decl "$LINENO" "GLOB_NOMATCH" "ac_cv_have_decl_GLOB_NOMATCH" "#include <glob.h>
-"
-if test "x$ac_cv_have_decl_GLOB_NOMATCH" = xyes; then :
- ac_have_decl=1
-else
- ac_have_decl=0
-fi
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_GLOB_NOMATCH $ac_have_decl
-_ACEOF
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct dirent allocates space for d_name" >&5
-$as_echo_n "checking whether struct dirent allocates space for d_name... " >&6; }
-if test "$cross_compiling" = yes; then :
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cross compiling: assuming BROKEN_ONE_BYTE_DIRENT_D_NAME" >&5
-$as_echo "$as_me: WARNING: cross compiling: assuming BROKEN_ONE_BYTE_DIRENT_D_NAME" >&2;}
- $as_echo "#define BROKEN_ONE_BYTE_DIRENT_D_NAME 1" >>confdefs.h
-
-
-
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <sys/types.h>
-#include <dirent.h>
-int
-main ()
-{
-
- struct dirent d;
- exit(sizeof(d.d_name)<=sizeof(char));
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$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 BROKEN_ONE_BYTE_DIRENT_D_NAME 1" >>confdefs.h
-
-
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for /proc/pid/fd directory" >&5
-$as_echo_n "checking for /proc/pid/fd directory... " >&6; }
-if test -d "/proc/$$/fd" ; then
-
-$as_echo "#define HAVE_PROC_PID 1" >>confdefs.h
-
- { $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; }
-fi
-
-# Check whether user wants S/Key support
-SKEY_MSG="no"
-
-# Check whether --with-skey was given.
-if test "${with_skey+set}" = set; then :
- withval=$with_skey;
- if test "x$withval" != "xno" ; then
-
- if test "x$withval" != "xyes" ; then
- CPPFLAGS="$CPPFLAGS -I${withval}/include"
- LDFLAGS="$LDFLAGS -L${withval}/lib"
- fi
-
-
-$as_echo "#define SKEY 1" >>confdefs.h
-
- LIBS="-lskey $LIBS"
- SKEY_MSG="yes"
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for s/key support" >&5
-$as_echo_n "checking for s/key support... " >&6; }
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <stdio.h>
-#include <skey.h>
-
-int
-main ()
-{
-
- char *ff = skey_keyinfo(""); ff="";
- exit(0);
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$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_fn_error $? "** Incomplete or missing s/key libraries." "$LINENO" 5
-
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if skeychallenge takes 4 arguments" >&5
-$as_echo_n "checking if skeychallenge takes 4 arguments... " >&6; }
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <stdio.h>
-#include <skey.h>
-
-int
-main ()
-{
-
- (void)skeychallenge(NULL,"name","",0);
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-
-$as_echo "#define SKEYCHALLENGE_4ARG 1" >>confdefs.h
-
-else
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- fi
-
-
-fi
-
-
-# Check whether user wants TCP wrappers support
-TCPW_MSG="no"
-
-# Check whether --with-tcp-wrappers was given.
-if test "${with_tcp_wrappers+set}" = set; then :
- withval=$with_tcp_wrappers;
- if test "x$withval" != "xno" ; then
- saved_LIBS="$LIBS"
- saved_LDFLAGS="$LDFLAGS"
- saved_CPPFLAGS="$CPPFLAGS"
- if test -n "${withval}" && \
- test "x${withval}" != "xyes"; then
- if test -d "${withval}/lib"; then
- if test -n "${need_dash_r}"; then
- LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
- else
- LDFLAGS="-L${withval}/lib ${LDFLAGS}"
- fi
- else
- if test -n "${need_dash_r}"; then
- LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
- else
- LDFLAGS="-L${withval} ${LDFLAGS}"
- fi
- fi
- if test -d "${withval}/include"; then
- CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
- else
- CPPFLAGS="-I${withval} ${CPPFLAGS}"
- fi
- fi
- LIBS="-lwrap $LIBS"
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libwrap" >&5
-$as_echo_n "checking for libwrap... " >&6; }
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <tcpd.h>
-int deny_severity = 0, allow_severity = 0;
-
-int
-main ()
-{
-
- hosts_access(0);
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-
-$as_echo "#define LIBWRAP 1" >>confdefs.h
-
- SSHDLIBS="$SSHDLIBS -lwrap"
- TCPW_MSG="yes"
-
-else
-
- as_fn_error $? "*** libwrap missing" "$LINENO" 5
-
-
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
- LIBS="$saved_LIBS"
- fi
-
-
-fi
-
-
-# Check whether user wants to use ldns
-LDNS_MSG="no"
-
-# Check whether --with-ldns was given.
-if test "${with_ldns+set}" = set; then :
- withval=$with_ldns;
- if test "x$withval" != "xno" ; then
-
- if test "x$withval" != "xyes" ; then
- CPPFLAGS="$CPPFLAGS -I${withval}/include"
- LDFLAGS="$LDFLAGS -L${withval}/lib"
- fi
-
-
-$as_echo "#define HAVE_LDNS 1" >>confdefs.h
-
- LIBS="-lldns $LIBS"
- LDNS_MSG="yes"
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ldns support" >&5
-$as_echo_n "checking for ldns support... " >&6; }
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdint.h>
-#include <ldns/ldns.h>
-int main() { ldns_status status = ldns_verify_trusted(NULL, NULL, NULL, NULL); status=LDNS_STATUS_OK; exit(0); }
-
-
-_ACEOF
-if ac_fn_c_try_link "$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_fn_error $? "** Incomplete or missing ldns libraries." "$LINENO" 5
-
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
- fi
-
-
-fi
-
-
-# Check whether user wants libedit support
-LIBEDIT_MSG="no"
-
-# Check whether --with-libedit was given.
-if test "${with_libedit+set}" = set; then :
- withval=$with_libedit; if test "x$withval" != "xno" ; then
- if test "x$withval" = "xyes" ; then
- 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_PKGCONFIG+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- case $PKGCONFIG in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_PKGCONFIG="$PKGCONFIG" # 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_PKGCONFIG="$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
-PKGCONFIG=$ac_cv_path_PKGCONFIG
-if test -n "$PKGCONFIG"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKGCONFIG" >&5
-$as_echo "$PKGCONFIG" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_path_PKGCONFIG"; then
- ac_pt_PKGCONFIG=$PKGCONFIG
- # 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_PKGCONFIG+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- case $ac_pt_PKGCONFIG in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_ac_pt_PKGCONFIG="$ac_pt_PKGCONFIG" # 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_PKGCONFIG="$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_PKGCONFIG=$ac_cv_path_ac_pt_PKGCONFIG
-if test -n "$ac_pt_PKGCONFIG"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKGCONFIG" >&5
-$as_echo "$ac_pt_PKGCONFIG" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
- if test "x$ac_pt_PKGCONFIG" = x; then
- PKGCONFIG="no"
- 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
- PKGCONFIG=$ac_pt_PKGCONFIG
- fi
-else
- PKGCONFIG="$ac_cv_path_PKGCONFIG"
-fi
-
- if test "x$PKGCONFIG" != "xno"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $PKGCONFIG knows about libedit" >&5
-$as_echo_n "checking if $PKGCONFIG knows about libedit... " >&6; }
- if "$PKGCONFIG" libedit; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
- use_pkgconfig_for_libedit=yes
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- fi
- fi
- else
- CPPFLAGS="$CPPFLAGS -I${withval}/include"
- if test -n "${need_dash_r}"; then
- LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
- else
- LDFLAGS="-L${withval}/lib ${LDFLAGS}"
- fi
- fi
- if test "x$use_pkgconfig_for_libedit" = "xyes"; then
- LIBEDIT=`$PKGCONFIG --libs libedit`
- CPPFLAGS="$CPPFLAGS `$PKGCONFIG --cflags libedit`"
- else
- LIBEDIT="-ledit -lcurses"
- fi
- OTHERLIBS=`echo $LIBEDIT | sed 's/-ledit//'`
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for el_init in -ledit" >&5
-$as_echo_n "checking for el_init in -ledit... " >&6; }
-if ${ac_cv_lib_edit_el_init+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-ledit $OTHERLIBS
- $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 el_init ();
-int
-main ()
-{
-return el_init ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_edit_el_init=yes
-else
- ac_cv_lib_edit_el_init=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_edit_el_init" >&5
-$as_echo "$ac_cv_lib_edit_el_init" >&6; }
-if test "x$ac_cv_lib_edit_el_init" = xyes; then :
-
-$as_echo "#define USE_LIBEDIT 1" >>confdefs.h
-
- LIBEDIT_MSG="yes"
-
-
-else
- as_fn_error $? "libedit not found" "$LINENO" 5
-fi
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libedit version is compatible" >&5
-$as_echo_n "checking if libedit version is compatible... " >&6; }
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
- #include <histedit.h>
-int
-main ()
-{
-
- int i = H_SETSIZE;
- el_init("", NULL, NULL, NULL);
- exit(0);
-
- ;
- return 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_fn_error $? "libedit version is not compatible" "$LINENO" 5
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- fi
-
-fi
-
-
-AUDIT_MODULE=none
-
-# Check whether --with-audit was given.
-if test "${with_audit+set}" = set; then :
- withval=$with_audit;
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for supported audit module" >&5
-$as_echo_n "checking for supported audit module... " >&6; }
- case "$withval" in
- bsm)
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: bsm" >&5
-$as_echo "bsm" >&6; }
- AUDIT_MODULE=bsm
- for ac_header in bsm/audit.h
-do :
- ac_fn_c_check_header_compile "$LINENO" "bsm/audit.h" "ac_cv_header_bsm_audit_h" "
-#ifdef HAVE_TIME_H
-# include <time.h>
-#endif
-
-
-"
-if test "x$ac_cv_header_bsm_audit_h" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_BSM_AUDIT_H 1
-_ACEOF
-
-else
- as_fn_error $? "BSM enabled and bsm/audit.h not found" "$LINENO" 5
-fi
-
-done
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getaudit in -lbsm" >&5
-$as_echo_n "checking for getaudit in -lbsm... " >&6; }
-if ${ac_cv_lib_bsm_getaudit+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lbsm $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 getaudit ();
-int
-main ()
-{
-return getaudit ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_bsm_getaudit=yes
-else
- ac_cv_lib_bsm_getaudit=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_bsm_getaudit" >&5
-$as_echo "$ac_cv_lib_bsm_getaudit" >&6; }
-if test "x$ac_cv_lib_bsm_getaudit" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBBSM 1
-_ACEOF
-
- LIBS="-lbsm $LIBS"
-
-else
- as_fn_error $? "BSM enabled and required library not found" "$LINENO" 5
-fi
-
- for ac_func in getaudit
-do :
- ac_fn_c_check_func "$LINENO" "getaudit" "ac_cv_func_getaudit"
-if test "x$ac_cv_func_getaudit" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_GETAUDIT 1
-_ACEOF
-
-else
- as_fn_error $? "BSM enabled and required function not found" "$LINENO" 5
-fi
-done
-
- # These are optional
- for ac_func in getaudit_addr aug_get_machine
-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 "#define USE_BSM_AUDIT 1" >>confdefs.h
-
- if test "$sol2ver" -ge 11; then
- SSHDLIBS="$SSHDLIBS -lscf"
-
-$as_echo "#define BROKEN_BSM_API 1" >>confdefs.h
-
- fi
- ;;
- linux)
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: linux" >&5
-$as_echo "linux" >&6; }
- AUDIT_MODULE=linux
- for ac_header in libaudit.h
-do :
- ac_fn_c_check_header_mongrel "$LINENO" "libaudit.h" "ac_cv_header_libaudit_h" "$ac_includes_default"
-if test "x$ac_cv_header_libaudit_h" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBAUDIT_H 1
-_ACEOF
-
-fi
-
-done
-
- SSHDLIBS="$SSHDLIBS -laudit"
-
-$as_echo "#define USE_LINUX_AUDIT 1" >>confdefs.h
-
- ;;
- debug)
- AUDIT_MODULE=debug
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: debug" >&5
-$as_echo "debug" >&6; }
-
-$as_echo "#define SSH_AUDIT_EVENTS 1" >>confdefs.h
-
- ;;
- no)
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- ;;
- *)
- as_fn_error $? "Unknown audit module $withval" "$LINENO" 5
- ;;
- esac
-
-fi
-
-
-
-# Check whether --with-pie was given.
-if test "${with_pie+set}" = set; then :
- withval=$with_pie;
- if test "x$withval" = "xno"; then
- use_pie=no
- fi
- if test "x$withval" = "xyes"; then
- use_pie=yes
- fi
-
-
-fi
-
-if test "x$use_pie" = "x"; then
- use_pie=no
-fi
-if test "x$use_toolchain_hardening" != "x1" && test "x$use_pie" = "xauto"; then
- # Turn off automatic PIE when toolchain hardening is off.
- use_pie=no
-fi
-if test "x$use_pie" = "xauto"; then
- # Automatic PIE requires gcc >= 4.x
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gcc >= 4.x" >&5
-$as_echo_n "checking for gcc >= 4.x... " >&6; }
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#if !defined(__GNUC__) || __GNUC__ < 4
-#error gcc is too old
-#endif
-
-_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; }
- use_pie=no
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-if test "x$use_pie" != "xno"; then
- SAVED_CFLAGS="$CFLAGS"
- SAVED_LDFLAGS="$LDFLAGS"
- {
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports compile flag -fPIE" >&5
-$as_echo_n "checking if $CC supports compile flag -fPIE... " >&6; }
- saved_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS $WERROR -fPIE"
- _define_flag=""
- test "x$_define_flag" = "x" && _define_flag="-fPIE"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <stdlib.h>
-#include <stdio.h>
-int main(int argc, char **argv) {
- /* Some math to catch -ftrapv problems in the toolchain */
- int i = 123 * argc, j = 456 + argc, k = 789 - argc;
- float l = i * 2.1;
- double m = l / 0.5;
- long long int n = argc * 12345LL, o = 12345LL * (long long int)argc;
- printf("%d %d %d %f %f %lld %lld\n", i, j, k, l, m, n, o);
- exit(0);
-}
-
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-if `grep -i "unrecognized option" conftest.err >/dev/null`
-then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- CFLAGS="$saved_CFLAGS"
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
- CFLAGS="$saved_CFLAGS $_define_flag"
-fi
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- CFLAGS="$saved_CFLAGS"
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-}
- {
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $LD supports link flag -pie" >&5
-$as_echo_n "checking if $LD supports link flag -pie... " >&6; }
- saved_LDFLAGS="$LDFLAGS"
- LDFLAGS="$LDFLAGS $WERROR -pie"
- _define_flag=""
- test "x$_define_flag" = "x" && _define_flag="-pie"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <stdlib.h>
-#include <stdio.h>
-int main(int argc, char **argv) {
- /* Some math to catch -ftrapv problems in the toolchain */
- int i = 123 * argc, j = 456 + argc, k = 789 - argc;
- float l = i * 2.1;
- double m = l / 0.5;
- long long int n = argc * 12345LL, o = 12345LL * (long long int)argc;
- printf("%d %d %d %f %f %lld %lld\n", i, j, k, l, m, n, o);
- exit(0);
-}
-
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
- LDFLAGS="$saved_LDFLAGS $_define_flag"
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- LDFLAGS="$saved_LDFLAGS"
-
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-}
- # We use both -fPIE and -pie or neither.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether both -fPIE and -pie are supported" >&5
-$as_echo_n "checking whether both -fPIE and -pie are supported... " >&6; }
- if echo "x $CFLAGS" | grep ' -fPIE' >/dev/null 2>&1 && \
- echo "x $LDFLAGS" | grep ' -pie' >/dev/null 2>&1 ; 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; }
- CFLAGS="$SAVED_CFLAGS"
- LDFLAGS="$SAVED_LDFLAGS"
- fi
-fi
-
-for ac_func in \
- Blowfish_initstate \
- Blowfish_expandstate \
- Blowfish_expand0state \
- Blowfish_stream2word \
- arc4random \
- arc4random_buf \
- arc4random_stir \
- arc4random_uniform \
- asprintf \
- b64_ntop \
- __b64_ntop \
- b64_pton \
- __b64_pton \
- bcopy \
- bcrypt_pbkdf \
- bindresvport_sa \
- blf_enc \
- cap_rights_limit \
- clock \
- closefrom \
- dirfd \
- endgrent \
- explicit_bzero \
- fchmod \
- fchown \
- freeaddrinfo \
- fstatfs \
- fstatvfs \
- futimes \
- getaddrinfo \
- getcwd \
- getgrouplist \
- getnameinfo \
- getopt \
- getpeereid \
- getpeerucred \
- getpgid \
- getpgrp \
- _getpty \
- getrlimit \
- getttyent \
- glob \
- group_from_gid \
- inet_aton \
- inet_ntoa \
- inet_ntop \
- innetgr \
- login_getcapbool \
- mblen \
- md5_crypt \
- memmove \
- mkdtemp \
- mmap \
- ngetaddrinfo \
- nsleep \
- ogetaddrinfo \
- openlog_r \
- poll \
- prctl \
- pstat \
- readpassphrase \
- realpath \
- recvmsg \
- rresvport_af \
- sendmsg \
- setdtablesize \
- setegid \
- setenv \
- seteuid \
- setgroupent \
- setgroups \
- setlinebuf \
- setlogin \
- setpassent\
- setpcred \
- setproctitle \
- setregid \
- setreuid \
- setrlimit \
- setsid \
- setvbuf \
- sigaction \
- sigvec \
- snprintf \
- socketpair \
- statfs \
- statvfs \
- strdup \
- strerror \
- strlcat \
- strlcpy \
- strmode \
- strnlen \
- strnvis \
- strptime \
- strtonum \
- strtoll \
- strtoul \
- strtoull \
- swap32 \
- sysconf \
- tcgetpgrp \
- timingsafe_bcmp \
- truncate \
- unsetenv \
- updwtmpx \
- user_from_uid \
- usleep \
- vasprintf \
- vhangup \
- vsnprintf \
- waitpid \
-
-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
-
-
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
- #include <ctype.h>
-int
-main ()
-{
- return (isblank('a'));
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-
-$as_echo "#define HAVE_ISBLANK 1" >>confdefs.h
-
-
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-
-# PKCS#11 support requires dlopen() and co
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing dlopen" >&5
-$as_echo_n "checking for library containing dlopen... " >&6; }
-if ${ac_cv_search_dlopen+:} 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 dlopen ();
-int
-main ()
-{
-return dlopen ();
- ;
- return 0;
-}
-_ACEOF
-for ac_lib in '' dl; 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_dlopen=$ac_res
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext
- if ${ac_cv_search_dlopen+:} false; then :
- break
-fi
-done
-if ${ac_cv_search_dlopen+:} false; then :
-
-else
- ac_cv_search_dlopen=no
-fi
-rm conftest.$ac_ext
-LIBS=$ac_func_search_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_dlopen" >&5
-$as_echo "$ac_cv_search_dlopen" >&6; }
-ac_res=$ac_cv_search_dlopen
-if test "$ac_res" != no; then :
- test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
-
-$as_echo "#define ENABLE_PKCS11 /**/" >>confdefs.h
-
-
-fi
-
-
-# IRIX has a const char return value for gai_strerror()
-for ac_func in gai_strerror
-do :
- ac_fn_c_check_func "$LINENO" "gai_strerror" "ac_cv_func_gai_strerror"
-if test "x$ac_cv_func_gai_strerror" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_GAI_STRERROR 1
-_ACEOF
-
- $as_echo "#define HAVE_GAI_STRERROR 1" >>confdefs.h
-
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netdb.h>
-
-const char *gai_strerror(int);
-
-int
-main ()
-{
-
- char *str;
- str = gai_strerror(0);
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-
-$as_echo "#define HAVE_CONST_GAI_STRERROR_PROTO 1" >>confdefs.h
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-done
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing nanosleep" >&5
-$as_echo_n "checking for library containing nanosleep... " >&6; }
-if ${ac_cv_search_nanosleep+:} 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 nanosleep ();
-int
-main ()
-{
-return nanosleep ();
- ;
- return 0;
-}
-_ACEOF
-for ac_lib in '' rt posix4; 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_nanosleep=$ac_res
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext
- if ${ac_cv_search_nanosleep+:} false; then :
- break
-fi
-done
-if ${ac_cv_search_nanosleep+:} false; then :
-
-else
- ac_cv_search_nanosleep=no
-fi
-rm conftest.$ac_ext
-LIBS=$ac_func_search_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_nanosleep" >&5
-$as_echo "$ac_cv_search_nanosleep" >&6; }
-ac_res=$ac_cv_search_nanosleep
-if test "$ac_res" != no; then :
- test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
-
-$as_echo "#define HAVE_NANOSLEEP 1" >>confdefs.h
-
-fi
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing clock_gettime" >&5
-$as_echo_n "checking for library containing clock_gettime... " >&6; }
-if ${ac_cv_search_clock_gettime+:} 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 clock_gettime ();
-int
-main ()
-{
-return clock_gettime ();
- ;
- return 0;
-}
-_ACEOF
-for ac_lib in '' rt; 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_clock_gettime=$ac_res
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext
- if ${ac_cv_search_clock_gettime+:} false; then :
- break
-fi
-done
-if ${ac_cv_search_clock_gettime+:} false; then :
-
-else
- ac_cv_search_clock_gettime=no
-fi
-rm conftest.$ac_ext
-LIBS=$ac_func_search_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_clock_gettime" >&5
-$as_echo "$ac_cv_search_clock_gettime" >&6; }
-ac_res=$ac_cv_search_clock_gettime
-if test "$ac_res" != no; then :
- test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
-
-$as_echo "#define HAVE_CLOCK_GETTIME 1" >>confdefs.h
-
-fi
-
-
-ac_fn_c_check_decl "$LINENO" "getrusage" "ac_cv_have_decl_getrusage" "$ac_includes_default"
-if test "x$ac_cv_have_decl_getrusage" = xyes; then :
- for ac_func in getrusage
-do :
- ac_fn_c_check_func "$LINENO" "getrusage" "ac_cv_func_getrusage"
-if test "x$ac_cv_func_getrusage" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_GETRUSAGE 1
-_ACEOF
-
-fi
-done
-
-fi
-
-ac_fn_c_check_decl "$LINENO" "strsep" "ac_cv_have_decl_strsep" "
-#ifdef HAVE_STRING_H
-# include <string.h>
-#endif
-
-"
-if test "x$ac_cv_have_decl_strsep" = xyes; then :
- for ac_func in strsep
-do :
- ac_fn_c_check_func "$LINENO" "strsep" "ac_cv_func_strsep"
-if test "x$ac_cv_func_strsep" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_STRSEP 1
-_ACEOF
-
-fi
-done
-
-fi
-
-
-ac_fn_c_check_decl "$LINENO" "tcsendbreak" "ac_cv_have_decl_tcsendbreak" "#include <termios.h>
-
-"
-if test "x$ac_cv_have_decl_tcsendbreak" = xyes; then :
- $as_echo "#define HAVE_TCSENDBREAK 1" >>confdefs.h
-
-else
- for ac_func in tcsendbreak
-do :
- ac_fn_c_check_func "$LINENO" "tcsendbreak" "ac_cv_func_tcsendbreak"
-if test "x$ac_cv_func_tcsendbreak" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_TCSENDBREAK 1
-_ACEOF
-
-fi
-done
-
-fi
-
-
-ac_fn_c_check_decl "$LINENO" "h_errno" "ac_cv_have_decl_h_errno" "#include <netdb.h>
-"
-if test "x$ac_cv_have_decl_h_errno" = xyes; then :
- ac_have_decl=1
-else
- ac_have_decl=0
-fi
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_H_ERRNO $ac_have_decl
-_ACEOF
-
-
-ac_fn_c_check_decl "$LINENO" "SHUT_RD" "ac_cv_have_decl_SHUT_RD" "
-#include <sys/types.h>
-#include <sys/socket.h>
-
-"
-if test "x$ac_cv_have_decl_SHUT_RD" = xyes; then :
- ac_have_decl=1
-else
- ac_have_decl=0
-fi
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_SHUT_RD $ac_have_decl
-_ACEOF
-
-
-ac_fn_c_check_decl "$LINENO" "O_NONBLOCK" "ac_cv_have_decl_O_NONBLOCK" "
-#include <sys/types.h>
-#ifdef HAVE_SYS_STAT_H
-# include <sys/stat.h>
-#endif
-#ifdef HAVE_FCNTL_H
-# include <fcntl.h>
-#endif
-
-"
-if test "x$ac_cv_have_decl_O_NONBLOCK" = xyes; then :
- ac_have_decl=1
-else
- ac_have_decl=0
-fi
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_O_NONBLOCK $ac_have_decl
-_ACEOF
-
-
-ac_fn_c_check_decl "$LINENO" "writev" "ac_cv_have_decl_writev" "
-#include <sys/types.h>
-#include <sys/uio.h>
-#include <unistd.h>
-
-"
-if test "x$ac_cv_have_decl_writev" = xyes; then :
- ac_have_decl=1
-else
- ac_have_decl=0
-fi
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_WRITEV $ac_have_decl
-_ACEOF
-
-
-ac_fn_c_check_decl "$LINENO" "MAXSYMLINKS" "ac_cv_have_decl_MAXSYMLINKS" "
-#include <sys/param.h>
-
-"
-if test "x$ac_cv_have_decl_MAXSYMLINKS" = xyes; then :
- ac_have_decl=1
-else
- ac_have_decl=0
-fi
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_MAXSYMLINKS $ac_have_decl
-_ACEOF
-
-
-ac_fn_c_check_decl "$LINENO" "offsetof" "ac_cv_have_decl_offsetof" "
-#include <stddef.h>
-
-"
-if test "x$ac_cv_have_decl_offsetof" = xyes; then :
- ac_have_decl=1
-else
- ac_have_decl=0
-fi
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_OFFSETOF $ac_have_decl
-_ACEOF
-
-
-# extra bits for select(2)
-ac_fn_c_check_decl "$LINENO" "howmany" "ac_cv_have_decl_howmany" "
-#include <sys/param.h>
-#include <sys/types.h>
-#ifdef HAVE_SYS_SYSMACROS_H
-#include <sys/sysmacros.h>
-#endif
-#ifdef HAVE_SYS_SELECT_H
-#include <sys/select.h>
-#endif
-#ifdef HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-
-"
-if test "x$ac_cv_have_decl_howmany" = xyes; then :
- ac_have_decl=1
-else
- ac_have_decl=0
-fi
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_HOWMANY $ac_have_decl
-_ACEOF
-ac_fn_c_check_decl "$LINENO" "NFDBITS" "ac_cv_have_decl_NFDBITS" "
-#include <sys/param.h>
-#include <sys/types.h>
-#ifdef HAVE_SYS_SYSMACROS_H
-#include <sys/sysmacros.h>
-#endif
-#ifdef HAVE_SYS_SELECT_H
-#include <sys/select.h>
-#endif
-#ifdef HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-
-"
-if test "x$ac_cv_have_decl_NFDBITS" = xyes; then :
- ac_have_decl=1
-else
- ac_have_decl=0
-fi
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_NFDBITS $ac_have_decl
-_ACEOF
-
-ac_fn_c_check_type "$LINENO" "fd_mask" "ac_cv_type_fd_mask" "
-#include <sys/param.h>
-#include <sys/types.h>
-#ifdef HAVE_SYS_SELECT_H
-#include <sys/select.h>
-#endif
-#ifdef HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-
-"
-if test "x$ac_cv_type_fd_mask" = xyes; then :
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_FD_MASK 1
-_ACEOF
-
-
-fi
-
-
-for ac_func in setresuid
-do :
- ac_fn_c_check_func "$LINENO" "setresuid" "ac_cv_func_setresuid"
-if test "x$ac_cv_func_setresuid" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_SETRESUID 1
-_ACEOF
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if setresuid seems to work" >&5
-$as_echo_n "checking if setresuid seems to work... " >&6; }
- if test "$cross_compiling" = yes; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cross compiling: not checking setresuid" >&5
-$as_echo "$as_me: WARNING: cross compiling: not checking setresuid" >&2;}
-
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <stdlib.h>
-#include <errno.h>
-
-int
-main ()
-{
-
- errno=0;
- setresuid(0,0,0);
- if (errno==ENOSYS)
- exit(1);
- else
- exit(0);
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-else
-
-$as_echo "#define BROKEN_SETRESUID 1" >>confdefs.h
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: not implemented" >&5
-$as_echo "not implemented" >&6; }
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-
-fi
-done
-
-
-for ac_func in setresgid
-do :
- ac_fn_c_check_func "$LINENO" "setresgid" "ac_cv_func_setresgid"
-if test "x$ac_cv_func_setresgid" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_SETRESGID 1
-_ACEOF
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if setresgid seems to work" >&5
-$as_echo_n "checking if setresgid seems to work... " >&6; }
- if test "$cross_compiling" = yes; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cross compiling: not checking setresuid" >&5
-$as_echo "$as_me: WARNING: cross compiling: not checking setresuid" >&2;}
-
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <stdlib.h>
-#include <errno.h>
-
-int
-main ()
-{
-
- errno=0;
- setresgid(0,0,0);
- if (errno==ENOSYS)
- exit(1);
- else
- exit(0);
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-else
-
-$as_echo "#define BROKEN_SETRESGID 1" >>confdefs.h
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: not implemented" >&5
-$as_echo "not implemented" >&6; }
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-
-fi
-done
-
-
-for ac_func in gettimeofday time
-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 endutent getutent getutid getutline pututline setutent
-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 utmpname
-do :
- ac_fn_c_check_func "$LINENO" "utmpname" "ac_cv_func_utmpname"
-if test "x$ac_cv_func_utmpname" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_UTMPNAME 1
-_ACEOF
-
-fi
-done
-
-for ac_func in endutxent getutxent getutxid getutxline getutxuser pututxline
-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 setutxdb setutxent utmpxname
-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 getlastlogxbyname
-do :
- ac_fn_c_check_func "$LINENO" "getlastlogxbyname" "ac_cv_func_getlastlogxbyname"
-if test "x$ac_cv_func_getlastlogxbyname" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_GETLASTLOGXBYNAME 1
-_ACEOF
-
-fi
-done
-
-
-ac_fn_c_check_func "$LINENO" "daemon" "ac_cv_func_daemon"
-if test "x$ac_cv_func_daemon" = xyes; then :
-
-$as_echo "#define HAVE_DAEMON 1" >>confdefs.h
-
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for daemon in -lbsd" >&5
-$as_echo_n "checking for daemon in -lbsd... " >&6; }
-if ${ac_cv_lib_bsd_daemon+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lbsd $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 daemon ();
-int
-main ()
-{
-return daemon ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_bsd_daemon=yes
-else
- ac_cv_lib_bsd_daemon=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_bsd_daemon" >&5
-$as_echo "$ac_cv_lib_bsd_daemon" >&6; }
-if test "x$ac_cv_lib_bsd_daemon" = xyes; then :
- LIBS="$LIBS -lbsd"; $as_echo "#define HAVE_DAEMON 1" >>confdefs.h
-
-fi
-
-
-fi
-
-
-ac_fn_c_check_func "$LINENO" "getpagesize" "ac_cv_func_getpagesize"
-if test "x$ac_cv_func_getpagesize" = xyes; then :
-
-$as_echo "#define HAVE_GETPAGESIZE 1" >>confdefs.h
-
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getpagesize in -lucb" >&5
-$as_echo_n "checking for getpagesize in -lucb... " >&6; }
-if ${ac_cv_lib_ucb_getpagesize+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lucb $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 getpagesize ();
-int
-main ()
-{
-return getpagesize ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_ucb_getpagesize=yes
-else
- ac_cv_lib_ucb_getpagesize=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_ucb_getpagesize" >&5
-$as_echo "$ac_cv_lib_ucb_getpagesize" >&6; }
-if test "x$ac_cv_lib_ucb_getpagesize" = xyes; then :
- LIBS="$LIBS -lucb"; $as_echo "#define HAVE_GETPAGESIZE 1" >>confdefs.h
-
-fi
-
-
-fi
-
-
-# Check for broken snprintf
-if test "x$ac_cv_func_snprintf" = "xyes" ; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether snprintf correctly terminates long strings" >&5
-$as_echo_n "checking whether snprintf correctly terminates long strings... " >&6; }
- if test "$cross_compiling" = yes; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cross compiling: Assuming working snprintf()" >&5
-$as_echo "$as_me: WARNING: cross compiling: Assuming working snprintf()" >&2;}
-
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
- #include <stdio.h>
-int
-main ()
-{
-
- char b[5];
- snprintf(b,5,"123456789");
- exit(b[4]!='\0');
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$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 BROKEN_SNPRINTF 1" >>confdefs.h
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ****** Your snprintf() function is broken, complain to your vendor" >&5
-$as_echo "$as_me: WARNING: ****** Your snprintf() function is broken, complain to your vendor" >&2;}
-
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-fi
-
-# If we don't have a working asprintf, then we strongly depend on vsnprintf
-# returning the right thing on overflow: the number of characters it tried to
-# create (as per SUSv3)
-if test "x$ac_cv_func_asprintf" != "xyes" && \
- test "x$ac_cv_func_vsnprintf" = "xyes" ; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether vsnprintf returns correct values on overflow" >&5
-$as_echo_n "checking whether vsnprintf returns correct values on overflow... " >&6; }
- if test "$cross_compiling" = yes; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cross compiling: Assuming working vsnprintf()" >&5
-$as_echo "$as_me: WARNING: cross compiling: Assuming working vsnprintf()" >&2;}
-
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <sys/types.h>
-#include <stdio.h>
-#include <stdarg.h>
-
-int x_snprintf(char *str,size_t count,const char *fmt,...)
-{
- size_t ret; va_list ap;
- va_start(ap, fmt); ret = vsnprintf(str, count, fmt, ap); va_end(ap);
- return ret;
-}
-
-int
-main ()
-{
-
- char x[1];
- exit(x_snprintf(x, 1, "%s %d", "hello", 12345) == 11 ? 0 : 1);
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$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 BROKEN_SNPRINTF 1" >>confdefs.h
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ****** Your vsnprintf() function is broken, complain to your vendor" >&5
-$as_echo "$as_me: WARNING: ****** Your vsnprintf() function is broken, complain to your vendor" >&2;}
-
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-fi
-
-# On systems where [v]snprintf is broken, but is declared in stdio,
-# check that the fmt argument is const char * or just char *.
-# This is only useful for when BROKEN_SNPRINTF
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether snprintf can declare const char *fmt" >&5
-$as_echo_n "checking whether snprintf can declare const char *fmt... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <stdio.h>
-int snprintf(char *a, size_t b, const char *c, ...) { return 0; }
-
-int
-main ()
-{
-
- snprintf(0, 0, 0);
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-
-$as_echo "#define SNPRINTF_CONST const" >>confdefs.h
-
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- $as_echo "#define SNPRINTF_CONST /* not const */" >>confdefs.h
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-# Check for missing getpeereid (or equiv) support
-NO_PEERCHECK=""
-if test "x$ac_cv_func_getpeereid" != "xyes" -a "x$ac_cv_func_getpeerucred" != "xyes"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether system supports SO_PEERCRED getsockopt" >&5
-$as_echo_n "checking whether system supports SO_PEERCRED getsockopt... " >&6; }
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <sys/types.h>
-#include <sys/socket.h>
-int
-main ()
-{
-int i = SO_PEERCRED;
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-
-$as_echo "#define HAVE_SO_PEERCRED 1" >>confdefs.h
-
-
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- NO_PEERCHECK=1
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-if test "x$ac_cv_func_mkdtemp" = "xyes" ; then
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for (overly) strict mkstemp" >&5
-$as_echo_n "checking for (overly) strict mkstemp... " >&6; }
-if test "$cross_compiling" = yes; then :
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
- $as_echo "#define HAVE_STRICT_MKSTEMP 1" >>confdefs.h
-
-
-
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <stdlib.h>
-
-int
-main ()
-{
-
- char template[]="conftest.mkstemp-test";
- if (mkstemp(template) == -1)
- exit(1);
- unlink(template);
- exit(0);
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-
-else
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-
-$as_echo "#define HAVE_STRICT_MKSTEMP 1" >>confdefs.h
-
-
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-fi
-
-if test ! -z "$check_for_openpty_ctty_bug"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if openpty correctly handles controlling tty" >&5
-$as_echo_n "checking if openpty correctly handles controlling tty... " >&6; }
- if test "$cross_compiling" = yes; then :
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: cross-compiling, assuming yes" >&5
-$as_echo "cross-compiling, assuming yes" >&6; }
-
-
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <stdio.h>
-#include <sys/fcntl.h>
-#include <sys/types.h>
-#include <sys/wait.h>
-
-int
-main ()
-{
-
- pid_t pid;
- int fd, ptyfd, ttyfd, status;
-
- pid = fork();
- if (pid < 0) { /* failed */
- exit(1);
- } else if (pid > 0) { /* parent */
- waitpid(pid, &status, 0);
- if (WIFEXITED(status))
- exit(WEXITSTATUS(status));
- else
- exit(2);
- } else { /* child */
- close(0); close(1); close(2);
- setsid();
- openpty(&ptyfd, &ttyfd, NULL, NULL, NULL);
- fd = open("/dev/tty", O_RDWR | O_NOCTTY);
- if (fd >= 0)
- exit(3); /* Acquired ctty: broken */
- else
- exit(0); /* Did not acquire ctty: OK */
- }
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$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 SSHD_ACQUIRES_CTTY 1" >>confdefs.h
-
-
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-fi
-
-if test "x$ac_cv_func_getaddrinfo" = "xyes" && \
- test "x$check_for_hpux_broken_getaddrinfo" = "x1"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if getaddrinfo seems to work" >&5
-$as_echo_n "checking if getaddrinfo seems to work... " >&6; }
- if test "$cross_compiling" = yes; then :
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: cross-compiling, assuming yes" >&5
-$as_echo "cross-compiling, assuming yes" >&6; }
-
-
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <stdio.h>
-#include <sys/socket.h>
-#include <netdb.h>
-#include <errno.h>
-#include <netinet/in.h>
-
-#define TEST_PORT "2222"
-
-int
-main ()
-{
-
- int err, sock;
- struct addrinfo *gai_ai, *ai, hints;
- char ntop[NI_MAXHOST], strport[NI_MAXSERV], *name = NULL;
-
- memset(&hints, 0, sizeof(hints));
- hints.ai_family = PF_UNSPEC;
- hints.ai_socktype = SOCK_STREAM;
- hints.ai_flags = AI_PASSIVE;
-
- err = getaddrinfo(name, TEST_PORT, &hints, &gai_ai);
- if (err != 0) {
- fprintf(stderr, "getaddrinfo failed (%s)", gai_strerror(err));
- exit(1);
- }
-
- for (ai = gai_ai; ai != NULL; ai = ai->ai_next) {
- if (ai->ai_family != AF_INET6)
- continue;
-
- err = getnameinfo(ai->ai_addr, ai->ai_addrlen, ntop,
- sizeof(ntop), strport, sizeof(strport),
- NI_NUMERICHOST|NI_NUMERICSERV);
-
- if (err != 0) {
- if (err == EAI_SYSTEM)
- perror("getnameinfo EAI_SYSTEM");
- else
- fprintf(stderr, "getnameinfo failed: %s\n",
- gai_strerror(err));
- exit(2);
- }
-
- sock = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol);
- if (sock < 0)
- perror("socket");
- if (bind(sock, ai->ai_addr, ai->ai_addrlen) < 0) {
- if (errno == EBADF)
- exit(3);
- }
- }
- exit(0);
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$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 BROKEN_GETADDRINFO 1" >>confdefs.h
-
-
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-fi
-
-if test "x$ac_cv_func_getaddrinfo" = "xyes" && \
- test "x$check_for_aix_broken_getaddrinfo" = "x1"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if getaddrinfo seems to work" >&5
-$as_echo_n "checking if getaddrinfo seems to work... " >&6; }
- if test "$cross_compiling" = yes; then :
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: cross-compiling, assuming no" >&5
-$as_echo "cross-compiling, assuming no" >&6; }
-
-
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <stdio.h>
-#include <sys/socket.h>
-#include <netdb.h>
-#include <errno.h>
-#include <netinet/in.h>
-
-#define TEST_PORT "2222"
-
-int
-main ()
-{
-
- int err, sock;
- struct addrinfo *gai_ai, *ai, hints;
- char ntop[NI_MAXHOST], strport[NI_MAXSERV], *name = NULL;
-
- memset(&hints, 0, sizeof(hints));
- hints.ai_family = PF_UNSPEC;
- hints.ai_socktype = SOCK_STREAM;
- hints.ai_flags = AI_PASSIVE;
-
- err = getaddrinfo(name, TEST_PORT, &hints, &gai_ai);
- if (err != 0) {
- fprintf(stderr, "getaddrinfo failed (%s)", gai_strerror(err));
- exit(1);
- }
-
- for (ai = gai_ai; ai != NULL; ai = ai->ai_next) {
- if (ai->ai_family != AF_INET && ai->ai_family != AF_INET6)
- continue;
-
- err = getnameinfo(ai->ai_addr, ai->ai_addrlen, ntop,
- sizeof(ntop), strport, sizeof(strport),
- NI_NUMERICHOST|NI_NUMERICSERV);
-
- if (ai->ai_family == AF_INET && err != 0) {
- perror("getnameinfo");
- exit(2);
- }
- }
- exit(0);
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-
-$as_echo "#define AIX_GETNAMEINFO_HACK 1" >>confdefs.h
-
-
-else
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- $as_echo "#define BROKEN_GETADDRINFO 1" >>confdefs.h
-
-
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-fi
-
-if test "x$check_for_conflicting_getspnam" = "x1"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for conflicting getspnam in shadow.h" >&5
-$as_echo_n "checking for conflicting getspnam in shadow.h... " >&6; }
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
- #include <shadow.h>
-int
-main ()
-{
- exit(0);
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-
-else
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-
-$as_echo "#define GETSPNAM_CONFLICTING_DEFS 1" >>confdefs.h
-
-
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether getpgrp requires zero arguments" >&5
-$as_echo_n "checking whether getpgrp requires zero arguments... " >&6; }
-if ${ac_cv_func_getpgrp_void+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- # Use it with a single arg.
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-$ac_includes_default
-int
-main ()
-{
-getpgrp (0);
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_func_getpgrp_void=no
-else
- ac_cv_func_getpgrp_void=yes
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_getpgrp_void" >&5
-$as_echo "$ac_cv_func_getpgrp_void" >&6; }
-if test $ac_cv_func_getpgrp_void = yes; then
-
-$as_echo "#define GETPGRP_VOID 1" >>confdefs.h
-
-fi
-
-
-# Search for OpenSSL
-saved_CPPFLAGS="$CPPFLAGS"
-saved_LDFLAGS="$LDFLAGS"
-
-# Check whether --with-ssl-dir was given.
-if test "${with_ssl_dir+set}" = set; then :
- withval=$with_ssl_dir;
- if test "x$withval" != "xno" ; then
- case "$withval" in
- # Relative paths
- ./*|../*) withval="`pwd`/$withval"
- esac
- if test -d "$withval/lib"; then
- if test -n "${need_dash_r}"; then
- LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
- else
- LDFLAGS="-L${withval}/lib ${LDFLAGS}"
- fi
- elif test -d "$withval/lib64"; then
- if test -n "${need_dash_r}"; then
- LDFLAGS="-L${withval}/lib64 -R${withval}/lib64 ${LDFLAGS}"
- else
- LDFLAGS="-L${withval}/lib64 ${LDFLAGS}"
- fi
- else
- if test -n "${need_dash_r}"; then
- LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
- else
- LDFLAGS="-L${withval} ${LDFLAGS}"
- fi
- fi
- if test -d "$withval/include"; then
- CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
- else
- CPPFLAGS="-I${withval} ${CPPFLAGS}"
- fi
- fi
-
-
-fi
-
-LIBS="-lcrypto $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 RAND_add ();
-int
-main ()
-{
-return RAND_add ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-
-$as_echo "#define HAVE_OPENSSL 1" >>confdefs.h
-
-else
-
- if test -n "${need_dash_r}"; then
- LDFLAGS="-L/usr/local/ssl/lib -R/usr/local/ssl/lib ${saved_LDFLAGS}"
- else
- LDFLAGS="-L/usr/local/ssl/lib ${saved_LDFLAGS}"
- fi
- CPPFLAGS="-I/usr/local/ssl/include ${saved_CPPFLAGS}"
- ac_fn_c_check_header_mongrel "$LINENO" "openssl/opensslv.h" "ac_cv_header_openssl_opensslv_h" "$ac_includes_default"
-if test "x$ac_cv_header_openssl_opensslv_h" = xyes; then :
-
-else
- as_fn_error $? "*** OpenSSL headers missing - please install first or check config.log ***" "$LINENO" 5
-fi
-
-
- 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 RAND_add ();
-int
-main ()
-{
-return RAND_add ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- $as_echo "#define HAVE_OPENSSL 1" >>confdefs.h
-
-else
-
- as_fn_error $? "*** Can't find recent OpenSSL libcrypto (see config.log for details) ***" "$LINENO" 5
-
-
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-
-
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-
-# Determine OpenSSL header version
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking OpenSSL header version" >&5
-$as_echo_n "checking OpenSSL header version... " >&6; }
-if test "$cross_compiling" = yes; then :
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cross compiling: not checking" >&5
-$as_echo "$as_me: WARNING: cross compiling: not checking" >&2;}
-
-
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <stdio.h>
-#include <string.h>
-#include <openssl/opensslv.h>
-#define DATA "conftest.sslincver"
-
-int
-main ()
-{
-
- FILE *fd;
- int rc;
-
- fd = fopen(DATA,"w");
- if(fd == NULL)
- exit(1);
-
- if ((rc = fprintf(fd ,"%x (%s)\n", OPENSSL_VERSION_NUMBER, OPENSSL_VERSION_TEXT)) <0)
- exit(1);
-
- exit(0);
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-
- ssl_header_ver=`cat conftest.sslincver`
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ssl_header_ver" >&5
-$as_echo "$ssl_header_ver" >&6; }
-
-else
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
-$as_echo "not found" >&6; }
- as_fn_error $? "OpenSSL version header not found." "$LINENO" 5
-
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-
-# Determine OpenSSL library version
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking OpenSSL library version" >&5
-$as_echo_n "checking OpenSSL library version... " >&6; }
-if test "$cross_compiling" = yes; then :
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cross compiling: not checking" >&5
-$as_echo "$as_me: WARNING: cross compiling: not checking" >&2;}
-
-
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <stdio.h>
-#include <string.h>
-#include <openssl/opensslv.h>
-#include <openssl/crypto.h>
-#define DATA "conftest.ssllibver"
-
-int
-main ()
-{
-
- FILE *fd;
- int rc;
-
- fd = fopen(DATA,"w");
- if(fd == NULL)
- exit(1);
-
- if ((rc = fprintf(fd ,"%x (%s)\n", SSLeay(), SSLeay_version(SSLEAY_VERSION))) <0)
- exit(1);
-
- exit(0);
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-
- ssl_library_ver=`cat conftest.ssllibver`
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ssl_library_ver" >&5
-$as_echo "$ssl_library_ver" >&6; }
-
-else
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
-$as_echo "not found" >&6; }
- as_fn_error $? "OpenSSL library not found." "$LINENO" 5
-
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-
-
-# Check whether --with-openssl-header-check was given.
-if test "${with_openssl_header_check+set}" = set; then :
- withval=$with_openssl_header_check; if test "x$withval" = "xno" ; then
- openssl_check_nonfatal=1
- fi
-
-
-fi
-
-
-# Sanity check OpenSSL headers
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether OpenSSL's headers match the library" >&5
-$as_echo_n "checking whether OpenSSL's headers match the library... " >&6; }
-if test "$cross_compiling" = yes; then :
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cross compiling: not checking" >&5
-$as_echo "$as_me: WARNING: cross compiling: not checking" >&2;}
-
-
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <string.h>
-#include <openssl/opensslv.h>
-
-int
-main ()
-{
-
- exit(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1);
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$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; }
- if test "x$openssl_check_nonfatal" = "x"; then
- as_fn_error $? "Your OpenSSL headers do not match your
-library. Check config.log for details.
-If you are sure your installation is consistent, you can disable the check
-by running \"./configure --without-openssl-header-check\".
-Also see contrib/findssl.sh for help identifying header/library mismatches.
-" "$LINENO" 5
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Your OpenSSL headers do not match your
-library. Check config.log for details.
-Also see contrib/findssl.sh for help identifying header/library mismatches." >&5
-$as_echo "$as_me: WARNING: Your OpenSSL headers do not match your
-library. Check config.log for details.
-Also see contrib/findssl.sh for help identifying header/library mismatches." >&2;}
- fi
-
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if programs using OpenSSL functions will link" >&5
-$as_echo_n "checking if programs using OpenSSL functions will link... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
- #include <openssl/evp.h>
-int
-main ()
-{
- SSLeay_add_all_algorithms();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$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; }
- saved_LIBS="$LIBS"
- LIBS="$LIBS -ldl"
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if programs using OpenSSL need -ldl" >&5
-$as_echo_n "checking if programs using OpenSSL need -ldl... " >&6; }
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
- #include <openssl/evp.h>
-int
-main ()
-{
- SSLeay_add_all_algorithms();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$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; }
- LIBS="$saved_LIBS"
-
-
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-
-
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-
-for ac_func in \
- BN_is_prime_ex \
- DSA_generate_parameters_ex \
- EVP_DigestInit_ex \
- EVP_DigestFinal_ex \
- EVP_MD_CTX_init \
- EVP_MD_CTX_cleanup \
- EVP_MD_CTX_copy_ex \
- HMAC_CTX_init \
- RSA_generate_key_ex \
- RSA_get_default_method \
-
-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
-
-
-
-# Check whether --with-ssl-engine was given.
-if test "${with_ssl_engine+set}" = set; then :
- withval=$with_ssl_engine; if test "x$withval" != "xno" ; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OpenSSL ENGINE support" >&5
-$as_echo_n "checking for OpenSSL ENGINE support... " >&6; }
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <openssl/engine.h>
-
-int
-main ()
-{
-
- ENGINE_load_builtin_engines();
- ENGINE_register_all_complete();
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-
-$as_echo "#define USE_OPENSSL_ENGINE 1" >>confdefs.h
-
-
-else
- as_fn_error $? "OpenSSL ENGINE support not found" "$LINENO" 5
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- fi
-
-fi
-
-
-# Check for OpenSSL without EVP_aes_{192,256}_cbc
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether OpenSSL has crippled AES support" >&5
-$as_echo_n "checking whether OpenSSL has crippled AES support... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <string.h>
-#include <openssl/evp.h>
-
-int
-main ()
-{
-
- exit(EVP_aes_192_cbc() == NULL || EVP_aes_256_cbc() == NULL);
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-
-else
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-
-$as_echo "#define OPENSSL_LOBOTOMISED_AES 1" >>confdefs.h
-
-
-
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-
-# Check for OpenSSL with EVP_aes_*ctr
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether OpenSSL has AES CTR via EVP" >&5
-$as_echo_n "checking whether OpenSSL has AES CTR via EVP... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <string.h>
-#include <openssl/evp.h>
-
-int
-main ()
-{
-
- exit(EVP_aes_128_ctr() == NULL ||
- EVP_aes_192_cbc() == NULL ||
- EVP_aes_256_cbc() == NULL);
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-
-$as_echo "#define OPENSSL_HAVE_EVPCTR 1" >>confdefs.h
-
-
-else
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-
-
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-
-# Check for OpenSSL with EVP_aes_*gcm
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether OpenSSL has AES GCM via EVP" >&5
-$as_echo_n "checking whether OpenSSL has AES GCM via EVP... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <string.h>
-#include <openssl/evp.h>
-
-int
-main ()
-{
-
- exit(EVP_aes_128_gcm() == NULL ||
- EVP_aes_256_gcm() == NULL ||
- EVP_CTRL_GCM_SET_IV_FIXED == 0 ||
- EVP_CTRL_GCM_IV_GEN == 0 ||
- EVP_CTRL_GCM_SET_TAG == 0 ||
- EVP_CTRL_GCM_GET_TAG == 0 ||
- EVP_CIPHER_CTX_ctrl(NULL, 0, 0, NULL) == 0);
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-
-$as_echo "#define OPENSSL_HAVE_EVPGCM 1" >>confdefs.h
-
-
-else
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- unsupported_algorithms="$unsupported_cipers \
- aes128-gcm@openssh.com aes256-gcm@openssh.com"
-
-
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing EVP_CIPHER_CTX_ctrl" >&5
-$as_echo_n "checking for library containing EVP_CIPHER_CTX_ctrl... " >&6; }
-if ${ac_cv_search_EVP_CIPHER_CTX_ctrl+:} 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 EVP_CIPHER_CTX_ctrl ();
-int
-main ()
-{
-return EVP_CIPHER_CTX_ctrl ();
- ;
- return 0;
-}
-_ACEOF
-for ac_lib in '' crypto; 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_EVP_CIPHER_CTX_ctrl=$ac_res
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext
- if ${ac_cv_search_EVP_CIPHER_CTX_ctrl+:} false; then :
- break
-fi
-done
-if ${ac_cv_search_EVP_CIPHER_CTX_ctrl+:} false; then :
-
-else
- ac_cv_search_EVP_CIPHER_CTX_ctrl=no
-fi
-rm conftest.$ac_ext
-LIBS=$ac_func_search_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_EVP_CIPHER_CTX_ctrl" >&5
-$as_echo "$ac_cv_search_EVP_CIPHER_CTX_ctrl" >&6; }
-ac_res=$ac_cv_search_EVP_CIPHER_CTX_ctrl
-if test "$ac_res" != no; then :
- test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
-
-$as_echo "#define HAVE_EVP_CIPHER_CTX_CTRL 1" >>confdefs.h
-
-fi
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if EVP_DigestUpdate returns an int" >&5
-$as_echo_n "checking if EVP_DigestUpdate returns an int... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <string.h>
-#include <openssl/evp.h>
-
-int
-main ()
-{
-
- if(EVP_DigestUpdate(NULL, NULL,0))
- exit(0);
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$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 OPENSSL_EVP_DIGESTUPDATE_VOID 1" >>confdefs.h
-
-
-
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-
-# Some systems want crypt() from libcrypt, *not* the version in OpenSSL,
-# because the system crypt() is more featureful.
-if test "x$check_for_libcrypt_before" = "x1"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for crypt in -lcrypt" >&5
-$as_echo_n "checking for crypt in -lcrypt... " >&6; }
-if ${ac_cv_lib_crypt_crypt+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lcrypt $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 crypt ();
-int
-main ()
-{
-return crypt ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_crypt_crypt=yes
-else
- ac_cv_lib_crypt_crypt=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_crypt_crypt" >&5
-$as_echo "$ac_cv_lib_crypt_crypt" >&6; }
-if test "x$ac_cv_lib_crypt_crypt" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBCRYPT 1
-_ACEOF
-
- LIBS="-lcrypt $LIBS"
-
-fi
-
-fi
-
-# Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
-# version in OpenSSL.
-if test "x$check_for_libcrypt_later" = "x1"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for crypt in -lcrypt" >&5
-$as_echo_n "checking for crypt in -lcrypt... " >&6; }
-if ${ac_cv_lib_crypt_crypt+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lcrypt $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 crypt ();
-int
-main ()
-{
-return crypt ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_crypt_crypt=yes
-else
- ac_cv_lib_crypt_crypt=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_crypt_crypt" >&5
-$as_echo "$ac_cv_lib_crypt_crypt" >&6; }
-if test "x$ac_cv_lib_crypt_crypt" = xyes; then :
- LIBS="$LIBS -lcrypt"
-fi
-
-fi
-for ac_func in crypt DES_crypt
-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
-
-
-# Search for SHA256 support in libc and/or OpenSSL
-for ac_func in SHA256_Update EVP_sha256
-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
-
-else
- unsupported_algorithms="$unsupported_algorithms \
- hmac-sha2-256 hmac-sha2-512 \
- diffie-hellman-group-exchange-sha256 \
- hmac-sha2-256-etm@openssh.com hmac-sha2-512-etm@openssh.com"
-
-
-fi
-done
-
-
-# Check complete ECC support in OpenSSL
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether OpenSSL has NID_X9_62_prime256v1" >&5
-$as_echo_n "checking whether OpenSSL has NID_X9_62_prime256v1... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <openssl/ec.h>
-#include <openssl/ecdh.h>
-#include <openssl/ecdsa.h>
-#include <openssl/evp.h>
-#include <openssl/objects.h>
-#include <openssl/opensslv.h>
-#if OPENSSL_VERSION_NUMBER < 0x0090807f /* 0.9.8g */
-# error "OpenSSL < 0.9.8g has unreliable ECC code"
-#endif
-
-int
-main ()
-{
-
- EC_KEY *e = EC_KEY_new_by_curve_name(NID_X9_62_prime256v1);
- const EVP_MD *m = EVP_sha256(); /* We need this too */
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
- enable_nistp256=1
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether OpenSSL has NID_secp384r1" >&5
-$as_echo_n "checking whether OpenSSL has NID_secp384r1... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <openssl/ec.h>
-#include <openssl/ecdh.h>
-#include <openssl/ecdsa.h>
-#include <openssl/evp.h>
-#include <openssl/objects.h>
-#include <openssl/opensslv.h>
-#if OPENSSL_VERSION_NUMBER < 0x0090807f /* 0.9.8g */
-# error "OpenSSL < 0.9.8g has unreliable ECC code"
-#endif
-
-int
-main ()
-{
-
- EC_KEY *e = EC_KEY_new_by_curve_name(NID_secp384r1);
- const EVP_MD *m = EVP_sha384(); /* We need this too */
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
- enable_nistp384=1
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether OpenSSL has NID_secp521r1" >&5
-$as_echo_n "checking whether OpenSSL has NID_secp521r1... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <openssl/ec.h>
-#include <openssl/ecdh.h>
-#include <openssl/ecdsa.h>
-#include <openssl/evp.h>
-#include <openssl/objects.h>
-#include <openssl/opensslv.h>
-#if OPENSSL_VERSION_NUMBER < 0x0090807f /* 0.9.8g */
-# error "OpenSSL < 0.9.8g has unreliable ECC code"
-#endif
-
-int
-main ()
-{
-
- EC_KEY *e = EC_KEY_new_by_curve_name(NID_secp521r1);
- const EVP_MD *m = EVP_sha512(); /* We need this too */
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if OpenSSL's NID_secp521r1 is functional" >&5
-$as_echo_n "checking if OpenSSL's NID_secp521r1 is functional... " >&6; }
- if test "$cross_compiling" = yes; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cross-compiling: assuming yes" >&5
-$as_echo "$as_me: WARNING: cross-compiling: assuming yes" >&2;}
- enable_nistp521=1
-
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <openssl/ec.h>
-#include <openssl/ecdh.h>
-#include <openssl/ecdsa.h>
-#include <openssl/evp.h>
-#include <openssl/objects.h>
-#include <openssl/opensslv.h>
-
-int
-main ()
-{
-
- EC_KEY *e = EC_KEY_new_by_curve_name(NID_secp521r1);
- const EVP_MD *m = EVP_sha512(); /* We need this too */
- exit(e == NULL || m == NULL);
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
- enable_nistp521=1
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-
-COMMENT_OUT_ECC="#no ecc#"
-TEST_SSH_ECC=no
-
-if test x$enable_nistp256 = x1 || test x$enable_nistp384 = x1 || \
- test x$enable_nistp521 = x1; then
-
-$as_echo "#define OPENSSL_HAS_ECC 1" >>confdefs.h
-
-fi
-if test x$enable_nistp256 = x1; then
-
-$as_echo "#define OPENSSL_HAS_NISTP256 1" >>confdefs.h
-
- TEST_SSH_ECC=yes
- COMMENT_OUT_ECC=""
-else
- unsupported_algorithms="$unsupported_algorithms ecdsa-sha2-nistp256 \
- ecdh-sha2-nistp256 ecdsa-sha2-nistp256-cert-v01@openssh.com"
-fi
-if test x$enable_nistp384 = x1; then
-
-$as_echo "#define OPENSSL_HAS_NISTP384 1" >>confdefs.h
-
- TEST_SSH_ECC=yes
- COMMENT_OUT_ECC=""
-else
- unsupported_algorithms="$unsupported_algorithms ecdsa-sha2-nistp384 \
- ecdh-sha2-nistp384 ecdsa-sha2-nistp384-cert-v01@openssh.com"
-fi
-if test x$enable_nistp521 = x1; then
-
-$as_echo "#define OPENSSL_HAS_NISTP521 1" >>confdefs.h
-
- TEST_SSH_ECC=yes
- COMMENT_OUT_ECC=""
-else
- unsupported_algorithms="$unsupported_algorithms ecdh-sha2-nistp521 \
- ecdsa-sha2-nistp521 ecdsa-sha2-nistp521-cert-v01@openssh.com"
-fi
-
-
-
-
-saved_LIBS="$LIBS"
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ia_openinfo in -liaf" >&5
-$as_echo_n "checking for ia_openinfo in -liaf... " >&6; }
-if ${ac_cv_lib_iaf_ia_openinfo+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-liaf $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 ia_openinfo ();
-int
-main ()
-{
-return ia_openinfo ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_iaf_ia_openinfo=yes
-else
- ac_cv_lib_iaf_ia_openinfo=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_iaf_ia_openinfo" >&5
-$as_echo "$ac_cv_lib_iaf_ia_openinfo" >&6; }
-if test "x$ac_cv_lib_iaf_ia_openinfo" = xyes; then :
-
- LIBS="$LIBS -liaf"
- for ac_func in set_id
-do :
- ac_fn_c_check_func "$LINENO" "set_id" "ac_cv_func_set_id"
-if test "x$ac_cv_func_set_id" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_SET_ID 1
-_ACEOF
- SSHDLIBS="$SSHDLIBS -liaf"
-
-$as_echo "#define HAVE_LIBIAF 1" >>confdefs.h
-
-
-fi
-done
-
-
-fi
-
-LIBS="$saved_LIBS"
-
-### Configure cryptographic random number support
-
-# Check wheter OpenSSL seeds itself
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether OpenSSL's PRNG is internally seeded" >&5
-$as_echo_n "checking whether OpenSSL's PRNG is internally seeded... " >&6; }
-if test "$cross_compiling" = yes; then :
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cross compiling: assuming yes" >&5
-$as_echo "$as_me: WARNING: cross compiling: assuming yes" >&2;}
- # This is safe, since we will fatal() at runtime if
- # OpenSSL is not seeded correctly.
- OPENSSL_SEEDS_ITSELF=yes
-
-
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <string.h>
-#include <openssl/rand.h>
-
-int
-main ()
-{
-
- exit(RAND_status() == 1 ? 0 : 1);
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-
- OPENSSL_SEEDS_ITSELF=yes
- { $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; }
-
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-
-# PRNGD TCP socket
-
-# Check whether --with-prngd-port was given.
-if test "${with_prngd_port+set}" = set; then :
- withval=$with_prngd_port;
- case "$withval" in
- no)
- withval=""
- ;;
- [0-9]*)
- ;;
- *)
- as_fn_error $? "You must specify a numeric port number for --with-prngd-port" "$LINENO" 5
- ;;
- esac
- if test ! -z "$withval" ; then
- PRNGD_PORT="$withval"
-
-cat >>confdefs.h <<_ACEOF
-#define PRNGD_PORT $PRNGD_PORT
-_ACEOF
-
- fi
-
-
-fi
-
-
-# PRNGD Unix domain socket
-
-# Check whether --with-prngd-socket was given.
-if test "${with_prngd_socket+set}" = set; then :
- withval=$with_prngd_socket;
- case "$withval" in
- yes)
- withval="/var/run/egd-pool"
- ;;
- no)
- withval=""
- ;;
- /*)
- ;;
- *)
- as_fn_error $? "You must specify an absolute path to the entropy socket" "$LINENO" 5
- ;;
- esac
-
- if test ! -z "$withval" ; then
- if test ! -z "$PRNGD_PORT" ; then
- as_fn_error $? "You may not specify both a PRNGD/EGD port and socket" "$LINENO" 5
- fi
- if test ! -r "$withval" ; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Entropy socket is not readable" >&5
-$as_echo "$as_me: WARNING: Entropy socket is not readable" >&2;}
- fi
- PRNGD_SOCKET="$withval"
-
-cat >>confdefs.h <<_ACEOF
-#define PRNGD_SOCKET "$PRNGD_SOCKET"
-_ACEOF
-
- fi
-
-else
-
- # Check for existing socket only if we don't have a random device already
- if test "x$OPENSSL_SEEDS_ITSELF" != "xyes" ; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PRNGD/EGD socket" >&5
-$as_echo_n "checking for PRNGD/EGD socket... " >&6; }
- # Insert other locations here
- for sock in /var/run/egd-pool /dev/egd-pool /etc/entropy; do
- if test -r $sock && $TEST_MINUS_S_SH -c "test -S $sock -o -p $sock" ; then
- PRNGD_SOCKET="$sock"
- cat >>confdefs.h <<_ACEOF
-#define PRNGD_SOCKET "$PRNGD_SOCKET"
-_ACEOF
-
- break;
- fi
- done
- if test ! -z "$PRNGD_SOCKET" ; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PRNGD_SOCKET" >&5
-$as_echo "$PRNGD_SOCKET" >&6; }
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
-$as_echo "not found" >&6; }
- fi
- fi
-
-
-fi
-
-
-# Which randomness source do we use?
-if test ! -z "$PRNGD_PORT" ; then
- RAND_MSG="PRNGd port $PRNGD_PORT"
-elif test ! -z "$PRNGD_SOCKET" ; then
- RAND_MSG="PRNGd socket $PRNGD_SOCKET"
-elif test ! -z "$OPENSSL_SEEDS_ITSELF" ; then
-
-$as_echo "#define OPENSSL_PRNG_ONLY 1" >>confdefs.h
-
- RAND_MSG="OpenSSL internal ONLY"
-else
- as_fn_error $? "OpenSSH has no source of random numbers. Please configure OpenSSL with an entropy source or re-run configure using one of the --with-prngd-port or --with-prngd-socket options" "$LINENO" 5
-fi
-
-# Check for PAM libs
-PAM_MSG="no"
-
-# Check whether --with-pam was given.
-if test "${with_pam+set}" = set; then :
- withval=$with_pam;
- if test "x$withval" != "xno" ; then
- if test "x$ac_cv_header_security_pam_appl_h" != "xyes" && \
- test "x$ac_cv_header_pam_pam_appl_h" != "xyes" ; then
- as_fn_error $? "PAM headers not found" "$LINENO" 5
- fi
-
- saved_LIBS="$LIBS"
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
-$as_echo_n "checking for dlopen in -ldl... " >&6; }
-if ${ac_cv_lib_dl_dlopen+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldl $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 dlopen ();
-int
-main ()
-{
-return dlopen ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_dl_dlopen=yes
-else
- ac_cv_lib_dl_dlopen=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_dl_dlopen" >&5
-$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
-if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBDL 1
-_ACEOF
-
- LIBS="-ldl $LIBS"
-
-fi
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pam_set_item in -lpam" >&5
-$as_echo_n "checking for pam_set_item in -lpam... " >&6; }
-if ${ac_cv_lib_pam_pam_set_item+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lpam $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 pam_set_item ();
-int
-main ()
-{
-return pam_set_item ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_pam_pam_set_item=yes
-else
- ac_cv_lib_pam_pam_set_item=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_pam_pam_set_item" >&5
-$as_echo "$ac_cv_lib_pam_pam_set_item" >&6; }
-if test "x$ac_cv_lib_pam_pam_set_item" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBPAM 1
-_ACEOF
-
- LIBS="-lpam $LIBS"
-
-else
- as_fn_error $? "*** libpam missing" "$LINENO" 5
-fi
-
- for ac_func in pam_getenvlist
-do :
- ac_fn_c_check_func "$LINENO" "pam_getenvlist" "ac_cv_func_pam_getenvlist"
-if test "x$ac_cv_func_pam_getenvlist" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_PAM_GETENVLIST 1
-_ACEOF
-
-fi
-done
-
- for ac_func in pam_putenv
-do :
- ac_fn_c_check_func "$LINENO" "pam_putenv" "ac_cv_func_pam_putenv"
-if test "x$ac_cv_func_pam_putenv" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_PAM_PUTENV 1
-_ACEOF
-
-fi
-done
-
- LIBS="$saved_LIBS"
-
- PAM_MSG="yes"
-
- SSHDLIBS="$SSHDLIBS -lpam"
-
-$as_echo "#define USE_PAM 1" >>confdefs.h
-
-
- if test $ac_cv_lib_dl_dlopen = yes; then
- case "$LIBS" in
- *-ldl*)
- # libdl already in LIBS
- ;;
- *)
- SSHDLIBS="$SSHDLIBS -ldl"
- ;;
- esac
- fi
- fi
-
-
-fi
-
-
-# Check for older PAM
-if test "x$PAM_MSG" = "xyes" ; then
- # Check PAM strerror arguments (old PAM)
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pam_strerror takes only one argument" >&5
-$as_echo_n "checking whether pam_strerror takes only one argument... " >&6; }
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <stdlib.h>
-#if defined(HAVE_SECURITY_PAM_APPL_H)
-#include <security/pam_appl.h>
-#elif defined (HAVE_PAM_PAM_APPL_H)
-#include <pam/pam_appl.h>
-#endif
-
-int
-main ()
-{
-
-(void)pam_strerror((pam_handle_t *)NULL, -1);
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-else
-
-
-$as_echo "#define HAVE_OLD_PAM 1" >>confdefs.h
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
- PAM_MSG="yes (old library)"
-
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-SSH_PRIVSEP_USER=sshd
-
-# Check whether --with-privsep-user was given.
-if test "${with_privsep_user+set}" = set; then :
- withval=$with_privsep_user;
- if test -n "$withval" && test "x$withval" != "xno" && \
- test "x${withval}" != "xyes"; then
- SSH_PRIVSEP_USER=$withval
- fi
-
-
-fi
-
-
-cat >>confdefs.h <<_ACEOF
-#define SSH_PRIVSEP_USER "$SSH_PRIVSEP_USER"
-_ACEOF
-
-
-
-if test "x$have_linux_no_new_privs" = "x1" ; then
-ac_fn_c_check_decl "$LINENO" "SECCOMP_MODE_FILTER" "ac_cv_have_decl_SECCOMP_MODE_FILTER" "
- #include <sys/types.h>
- #include <linux/seccomp.h>
-
-"
-if test "x$ac_cv_have_decl_SECCOMP_MODE_FILTER" = xyes; then :
- have_seccomp_filter=1
-fi
-
-fi
-if test "x$have_seccomp_filter" = "x1" ; then
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking kernel for seccomp_filter support" >&5
-$as_echo_n "checking kernel for seccomp_filter support... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
- #include <errno.h>
- #include <elf.h>
- #include <linux/audit.h>
- #include <linux/seccomp.h>
- #include <stdlib.h>
- #include <sys/prctl.h>
-
-int
-main ()
-{
- int i = $seccomp_audit_arch;
- errno = 0;
- prctl(PR_SET_SECCOMP, SECCOMP_MODE_FILTER, NULL, 0, 0);
- exit(errno == EFAULT ? 0 : 1);
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$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; }
- # Disable seccomp filter as a target
- have_seccomp_filter=0
-
-
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-fi
-
-# Decide which sandbox style to use
-sandbox_arg=""
-
-# Check whether --with-sandbox was given.
-if test "${with_sandbox+set}" = set; then :
- withval=$with_sandbox;
- if test "x$withval" = "xyes" ; then
- sandbox_arg=""
- else
- sandbox_arg="$withval"
- fi
-
-
-fi
-
-
-# Some platforms (seems to be the ones that have a kernel poll(2)-type
-# function with which they implement select(2)) use an extra file descriptor
-# when calling select(2), which means we can't use the rlimit sandbox.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if select works with descriptor rlimit" >&5
-$as_echo_n "checking if select works with descriptor rlimit... " >&6; }
-if test "$cross_compiling" = yes; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cross compiling: assuming yes" >&5
-$as_echo "$as_me: WARNING: cross compiling: assuming yes" >&2;}
-
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <sys/types.h>
-#ifdef HAVE_SYS_TIME_H
-# include <sys/time.h>
-#endif
-#include <sys/resource.h>
-#ifdef HAVE_SYS_SELECT_H
-# include <sys/select.h>
-#endif
-#include <errno.h>
-#include <fcntl.h>
-#include <stdlib.h>
-
-int
-main ()
-{
-
- struct rlimit rl_zero;
- int fd, r;
- fd_set fds;
- struct timeval tv;
-
- fd = open("/dev/null", O_RDONLY);
- FD_ZERO(&fds);
- FD_SET(fd, &fds);
- rl_zero.rlim_cur = rl_zero.rlim_max = 0;
- setrlimit(RLIMIT_FSIZE, &rl_zero);
- setrlimit(RLIMIT_NOFILE, &rl_zero);
- tv.tv_sec = 1;
- tv.tv_usec = 0;
- r = select(fd+1, &fds, NULL, NULL, &tv);
- exit (r == -1 ? 1 : 0);
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
- select_works_with_rlimit=yes
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- select_works_with_rlimit=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if setrlimit(RLIMIT_NOFILE,{0,0}) works" >&5
-$as_echo_n "checking if setrlimit(RLIMIT_NOFILE,{0,0}) works... " >&6; }
-if test "$cross_compiling" = yes; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cross compiling: assuming yes" >&5
-$as_echo "$as_me: WARNING: cross compiling: assuming yes" >&2;}
-
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <sys/types.h>
-#ifdef HAVE_SYS_TIME_H
-# include <sys/time.h>
-#endif
-#include <sys/resource.h>
-#include <errno.h>
-#include <stdlib.h>
-
-int
-main ()
-{
-
- struct rlimit rl_zero;
- int fd, r;
- fd_set fds;
-
- rl_zero.rlim_cur = rl_zero.rlim_max = 0;
- r = setrlimit(RLIMIT_NOFILE, &rl_zero);
- exit (r == -1 ? 1 : 0);
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
- rlimit_nofile_zero_works=yes
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- rlimit_nofile_zero_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
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if setrlimit RLIMIT_FSIZE works" >&5
-$as_echo_n "checking if setrlimit RLIMIT_FSIZE works... " >&6; }
-if test "$cross_compiling" = yes; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cross compiling: assuming yes" >&5
-$as_echo "$as_me: WARNING: cross compiling: assuming yes" >&2;}
-
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <sys/types.h>
-#include <sys/resource.h>
-#include <stdlib.h>
-
-int
-main ()
-{
-
- struct rlimit rl_zero;
-
- rl_zero.rlim_cur = rl_zero.rlim_max = 0;
- exit(setrlimit(RLIMIT_FSIZE, &rl_zero) != 0);
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$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 SANDBOX_SKIP_RLIMIT_FSIZE 1" >>confdefs.h
-
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-
-if test "x$sandbox_arg" = "xsystrace" || \
- ( test -z "$sandbox_arg" && test "x$have_systr_policy_kill" = "x1" ) ; then
- test "x$have_systr_policy_kill" != "x1" && \
- as_fn_error $? "systrace sandbox requires systrace headers and SYSTR_POLICY_KILL support" "$LINENO" 5
- SANDBOX_STYLE="systrace"
-
-$as_echo "#define SANDBOX_SYSTRACE 1" >>confdefs.h
-
-elif test "x$sandbox_arg" = "xdarwin" || \
- ( test -z "$sandbox_arg" && test "x$ac_cv_func_sandbox_init" = "xyes" && \
- test "x$ac_cv_header_sandbox_h" = "xyes") ; then
- test "x$ac_cv_func_sandbox_init" != "xyes" -o \
- "x$ac_cv_header_sandbox_h" != "xyes" && \
- as_fn_error $? "Darwin seatbelt sandbox requires sandbox.h and sandbox_init function" "$LINENO" 5
- SANDBOX_STYLE="darwin"
-
-$as_echo "#define SANDBOX_DARWIN 1" >>confdefs.h
-
-elif test "x$sandbox_arg" = "xseccomp_filter" || \
- ( test -z "$sandbox_arg" && \
- test "x$have_seccomp_filter" = "x1" && \
- test "x$ac_cv_header_elf_h" = "xyes" && \
- test "x$ac_cv_header_linux_audit_h" = "xyes" && \
- test "x$ac_cv_header_linux_filter_h" = "xyes" && \
- test "x$seccomp_audit_arch" != "x" && \
- test "x$have_linux_no_new_privs" = "x1" && \
- test "x$ac_cv_func_prctl" = "xyes" ) ; then
- test "x$seccomp_audit_arch" = "x" && \
- as_fn_error $? "seccomp_filter sandbox not supported on $host" "$LINENO" 5
- test "x$have_linux_no_new_privs" != "x1" && \
- as_fn_error $? "seccomp_filter sandbox requires PR_SET_NO_NEW_PRIVS" "$LINENO" 5
- test "x$have_seccomp_filter" != "x1" && \
- as_fn_error $? "seccomp_filter sandbox requires seccomp headers" "$LINENO" 5
- test "x$ac_cv_func_prctl" != "xyes" && \
- as_fn_error $? "seccomp_filter sandbox requires prctl function" "$LINENO" 5
- SANDBOX_STYLE="seccomp_filter"
-
-$as_echo "#define SANDBOX_SECCOMP_FILTER 1" >>confdefs.h
-
-elif test "x$sandbox_arg" = "xcapsicum" || \
- ( test -z "$sandbox_arg" && \
- test "x$ac_cv_header_sys_capability_h" = "xyes" && \
- test "x$ac_cv_func_cap_rights_limit" = "xyes") ; then
- test "x$ac_cv_header_sys_capability_h" != "xyes" && \
- as_fn_error $? "capsicum sandbox requires sys/capability.h header" "$LINENO" 5
- test "x$ac_cv_func_cap_rights_limit" != "xyes" && \
- as_fn_error $? "capsicum sandbox requires cap_rights_limit function" "$LINENO" 5
- SANDBOX_STYLE="capsicum"
-
-$as_echo "#define SANDBOX_CAPSICUM 1" >>confdefs.h
-
-elif test "x$sandbox_arg" = "xrlimit" || \
- ( test -z "$sandbox_arg" && test "x$ac_cv_func_setrlimit" = "xyes" && \
- test "x$select_works_with_rlimit" = "xyes" && \
- test "x$rlimit_nofile_zero_works" = "xyes" ) ; then
- test "x$ac_cv_func_setrlimit" != "xyes" && \
- as_fn_error $? "rlimit sandbox requires setrlimit function" "$LINENO" 5
- test "x$select_works_with_rlimit" != "xyes" && \
- as_fn_error $? "rlimit sandbox requires select to work with rlimit" "$LINENO" 5
- SANDBOX_STYLE="rlimit"
-
-$as_echo "#define SANDBOX_RLIMIT 1" >>confdefs.h
-
-elif test -z "$sandbox_arg" || test "x$sandbox_arg" = "xno" || \
- test "x$sandbox_arg" = "xnone" || test "x$sandbox_arg" = "xnull" ; then
- SANDBOX_STYLE="none"
-
-$as_echo "#define SANDBOX_NULL 1" >>confdefs.h
-
-else
- as_fn_error $? "unsupported --with-sandbox" "$LINENO" 5
-fi
-
-# Cheap hack to ensure NEWS-OS libraries are arranged right.
-if test ! -z "$SONY" ; then
- LIBS="$LIBS -liberty";
-fi
-
-# Check for long long datatypes
-ac_fn_c_check_type "$LINENO" "long long" "ac_cv_type_long_long" "$ac_includes_default"
-if test "x$ac_cv_type_long_long" = xyes; then :
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_LONG_LONG 1
-_ACEOF
-
-
-fi
-ac_fn_c_check_type "$LINENO" "unsigned long long" "ac_cv_type_unsigned_long_long" "$ac_includes_default"
-if test "x$ac_cv_type_unsigned_long_long" = xyes; then :
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_UNSIGNED_LONG_LONG 1
-_ACEOF
-
-
-fi
-ac_fn_c_check_type "$LINENO" "long double" "ac_cv_type_long_double" "$ac_includes_default"
-if test "x$ac_cv_type_long_double" = xyes; then :
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_LONG_DOUBLE 1
-_ACEOF
-
-
-fi
-
-
-# Check datatype sizes
-# 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 short int" >&5
-$as_echo_n "checking size of short int... " >&6; }
-if ${ac_cv_sizeof_short_int+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (short int))" "ac_cv_sizeof_short_int" "$ac_includes_default"; then :
-
-else
- if test "$ac_cv_type_short_int" = 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 (short int)
-See \`config.log' for more details" "$LINENO" 5; }
- else
- ac_cv_sizeof_short_int=0
- fi
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_short_int" >&5
-$as_echo "$ac_cv_sizeof_short_int" >&6; }
-
-
-
-cat >>confdefs.h <<_ACEOF
-#define SIZEOF_SHORT_INT $ac_cv_sizeof_short_int
-_ACEOF
-
-
-# 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 int" >&5
-$as_echo_n "checking size of int... " >&6; }
-if ${ac_cv_sizeof_int+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (int))" "ac_cv_sizeof_int" "$ac_includes_default"; then :
-
-else
- if test "$ac_cv_type_int" = 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 (int)
-See \`config.log' for more details" "$LINENO" 5; }
- else
- ac_cv_sizeof_int=0
- fi
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_int" >&5
-$as_echo "$ac_cv_sizeof_int" >&6; }
-
-
-
-cat >>confdefs.h <<_ACEOF
-#define SIZEOF_INT $ac_cv_sizeof_int
-_ACEOF
-
-
-# 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 long int" >&5
-$as_echo_n "checking size of long int... " >&6; }
-if ${ac_cv_sizeof_long_int+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long int))" "ac_cv_sizeof_long_int" "$ac_includes_default"; then :
-
-else
- if test "$ac_cv_type_long_int" = 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 (long int)
-See \`config.log' for more details" "$LINENO" 5; }
- else
- ac_cv_sizeof_long_int=0
- fi
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long_int" >&5
-$as_echo "$ac_cv_sizeof_long_int" >&6; }
-
-
-
-cat >>confdefs.h <<_ACEOF
-#define SIZEOF_LONG_INT $ac_cv_sizeof_long_int
-_ACEOF
-
-
-# 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 long long int" >&5
-$as_echo_n "checking size of long long int... " >&6; }
-if ${ac_cv_sizeof_long_long_int+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long long int))" "ac_cv_sizeof_long_long_int" "$ac_includes_default"; then :
-
-else
- if test "$ac_cv_type_long_long_int" = 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 (long long int)
-See \`config.log' for more details" "$LINENO" 5; }
- else
- ac_cv_sizeof_long_long_int=0
- fi
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long_long_int" >&5
-$as_echo "$ac_cv_sizeof_long_long_int" >&6; }
-
-
-
-cat >>confdefs.h <<_ACEOF
-#define SIZEOF_LONG_LONG_INT $ac_cv_sizeof_long_long_int
-_ACEOF
-
-
-
-# Sanity check long long for some platforms (AIX)
-if test "x$ac_cv_sizeof_long_long_int" = "x4" ; then
- ac_cv_sizeof_long_long_int=0
-fi
-
-# compute LLONG_MIN and LLONG_MAX if we don't know them.
-if test -z "$have_llong_max"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for max value of long long" >&5
-$as_echo_n "checking for max value of long long... " >&6; }
- if test "$cross_compiling" = yes; then :
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cross compiling: not checking" >&5
-$as_echo "$as_me: WARNING: cross compiling: not checking" >&2;}
-
-
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <stdio.h>
-/* Why is this so damn hard? */
-#ifdef __GNUC__
-# undef __GNUC__
-#endif
-#define __USE_ISOC99
-#include <limits.h>
-#define DATA "conftest.llminmax"
-#define my_abs(a) ((a) < 0 ? ((a) * -1) : (a))
-
-/*
- * printf in libc on some platforms (eg old Tru64) does not understand %lld so
- * we do this the hard way.
- */
-static int
-fprint_ll(FILE *f, long long n)
-{
- unsigned int i;
- int l[sizeof(long long) * 8];
-
- if (n < 0)
- if (fprintf(f, "-") < 0)
- return -1;
- for (i = 0; n != 0; i++) {
- l[i] = my_abs(n % 10);
- n /= 10;
- }
- do {
- if (fprintf(f, "%d", l[--i]) < 0)
- return -1;
- } while (i != 0);
- if (fprintf(f, " ") < 0)
- return -1;
- return 0;
-}
-
-int
-main ()
-{
-
- FILE *f;
- long long i, llmin, llmax = 0;
-
- if((f = fopen(DATA,"w")) == NULL)
- exit(1);
-
-#if defined(LLONG_MIN) && defined(LLONG_MAX)
- fprintf(stderr, "Using system header for LLONG_MIN and LLONG_MAX\n");
- llmin = LLONG_MIN;
- llmax = LLONG_MAX;
-#else
- fprintf(stderr, "Calculating LLONG_MIN and LLONG_MAX\n");
- /* This will work on one's complement and two's complement */
- for (i = 1; i > llmax; i <<= 1, i++)
- llmax = i;
- llmin = llmax + 1LL; /* wrap */
-#endif
-
- /* Sanity check */
- if (llmin + 1 < llmin || llmin - 1 < llmin || llmax + 1 > llmax
- || llmax - 1 > llmax || llmin == llmax || llmin == 0
- || llmax == 0 || llmax < LONG_MAX || llmin > LONG_MIN) {
- fprintf(f, "unknown unknown\n");
- exit(2);
- }
-
- if (fprint_ll(f, llmin) < 0)
- exit(3);
- if (fprint_ll(f, llmax) < 0)
- exit(4);
- if (fclose(f) < 0)
- exit(5);
- exit(0);
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-
- llong_min=`$AWK '{print $1}' conftest.llminmax`
- llong_max=`$AWK '{print $2}' conftest.llminmax`
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $llong_max" >&5
-$as_echo "$llong_max" >&6; }
-
-cat >>confdefs.h <<_ACEOF
-#define LLONG_MAX ${llong_max}LL
-_ACEOF
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for min value of long long" >&5
-$as_echo_n "checking for min value of long long... " >&6; }
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $llong_min" >&5
-$as_echo "$llong_min" >&6; }
-
-cat >>confdefs.h <<_ACEOF
-#define LLONG_MIN ${llong_min}LL
-_ACEOF
-
-
-else
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
-$as_echo "not found" >&6; }
-
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-fi
-
-
-# More checks for data types
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for u_int type" >&5
-$as_echo_n "checking for u_int type... " >&6; }
-if ${ac_cv_have_u_int+:} false; then :
- $as_echo_n "(cached) " >&6
-else
-
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
- #include <sys/types.h>
-int
-main ()
-{
- u_int a; a = 1;
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_have_u_int="yes"
-else
- ac_cv_have_u_int="no"
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_u_int" >&5
-$as_echo "$ac_cv_have_u_int" >&6; }
-if test "x$ac_cv_have_u_int" = "xyes" ; then
-
-$as_echo "#define HAVE_U_INT 1" >>confdefs.h
-
- have_u_int=1
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for intXX_t types" >&5
-$as_echo_n "checking for intXX_t types... " >&6; }
-if ${ac_cv_have_intxx_t+:} false; then :
- $as_echo_n "(cached) " >&6
-else
-
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
- #include <sys/types.h>
-int
-main ()
-{
- int8_t a; int16_t b; int32_t c; a = b = c = 1;
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_have_intxx_t="yes"
-else
- ac_cv_have_intxx_t="no"
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_intxx_t" >&5
-$as_echo "$ac_cv_have_intxx_t" >&6; }
-if test "x$ac_cv_have_intxx_t" = "xyes" ; then
-
-$as_echo "#define HAVE_INTXX_T 1" >>confdefs.h
-
- have_intxx_t=1
-fi
-
-if (test -z "$have_intxx_t" && \
- test "x$ac_cv_header_stdint_h" = "xyes")
-then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for intXX_t types in stdint.h" >&5
-$as_echo_n "checking for intXX_t types in stdint.h... " >&6; }
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
- #include <stdint.h>
-int
-main ()
-{
- int8_t a; int16_t b; int32_t c; a = b = c = 1;
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
- $as_echo "#define HAVE_INTXX_T 1" >>confdefs.h
-
- { $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; }
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for int64_t type" >&5
-$as_echo_n "checking for int64_t type... " >&6; }
-if ${ac_cv_have_int64_t+:} false; then :
- $as_echo_n "(cached) " >&6
-else
-
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <sys/types.h>
-#ifdef HAVE_STDINT_H
-# include <stdint.h>
-#endif
-#include <sys/socket.h>
-#ifdef HAVE_SYS_BITYPES_H
-# include <sys/bitypes.h>
-#endif
-
-int
-main ()
-{
-
-int64_t a; a = 1;
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_have_int64_t="yes"
-else
- ac_cv_have_int64_t="no"
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_int64_t" >&5
-$as_echo "$ac_cv_have_int64_t" >&6; }
-if test "x$ac_cv_have_int64_t" = "xyes" ; then
-
-$as_echo "#define HAVE_INT64_T 1" >>confdefs.h
-
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for u_intXX_t types" >&5
-$as_echo_n "checking for u_intXX_t types... " >&6; }
-if ${ac_cv_have_u_intxx_t+:} false; then :
- $as_echo_n "(cached) " >&6
-else
-
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
- #include <sys/types.h>
-int
-main ()
-{
- u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_have_u_intxx_t="yes"
-else
- ac_cv_have_u_intxx_t="no"
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_u_intxx_t" >&5
-$as_echo "$ac_cv_have_u_intxx_t" >&6; }
-if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
-
-$as_echo "#define HAVE_U_INTXX_T 1" >>confdefs.h
-
- have_u_intxx_t=1
-fi
-
-if test -z "$have_u_intxx_t" ; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for u_intXX_t types in sys/socket.h" >&5
-$as_echo_n "checking for u_intXX_t types in sys/socket.h... " >&6; }
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
- #include <sys/socket.h>
-int
-main ()
-{
- u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
- $as_echo "#define HAVE_U_INTXX_T 1" >>confdefs.h
-
- { $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; }
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for u_int64_t types" >&5
-$as_echo_n "checking for u_int64_t types... " >&6; }
-if ${ac_cv_have_u_int64_t+:} false; then :
- $as_echo_n "(cached) " >&6
-else
-
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
- #include <sys/types.h>
-int
-main ()
-{
- u_int64_t a; a = 1;
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_have_u_int64_t="yes"
-else
- ac_cv_have_u_int64_t="no"
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_u_int64_t" >&5
-$as_echo "$ac_cv_have_u_int64_t" >&6; }
-if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
-
-$as_echo "#define HAVE_U_INT64_T 1" >>confdefs.h
-
- have_u_int64_t=1
-fi
-
-if (test -z "$have_u_int64_t" && \
- test "x$ac_cv_header_sys_bitypes_h" = "xyes")
-then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for u_int64_t type in sys/bitypes.h" >&5
-$as_echo_n "checking for u_int64_t type in sys/bitypes.h... " >&6; }
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
- #include <sys/bitypes.h>
-int
-main ()
-{
- u_int64_t a; a = 1
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
- $as_echo "#define HAVE_U_INT64_T 1" >>confdefs.h
-
- { $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; }
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-if test -z "$have_u_intxx_t" ; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uintXX_t types" >&5
-$as_echo_n "checking for uintXX_t types... " >&6; }
-if ${ac_cv_have_uintxx_t+:} false; then :
- $as_echo_n "(cached) " >&6
-else
-
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <sys/types.h>
-
-int
-main ()
-{
-
- uint8_t a;
- uint16_t b;
- uint32_t c;
- a = b = c = 1;
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_have_uintxx_t="yes"
-else
- ac_cv_have_uintxx_t="no"
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_uintxx_t" >&5
-$as_echo "$ac_cv_have_uintxx_t" >&6; }
- if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
-
-$as_echo "#define HAVE_UINTXX_T 1" >>confdefs.h
-
- fi
-fi
-
-if (test -z "$have_uintxx_t" && \
- test "x$ac_cv_header_stdint_h" = "xyes")
-then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uintXX_t types in stdint.h" >&5
-$as_echo_n "checking for uintXX_t types in stdint.h... " >&6; }
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
- #include <stdint.h>
-int
-main ()
-{
- uint8_t a; uint16_t b; uint32_t c; a = b = c = 1;
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
- $as_echo "#define HAVE_UINTXX_T 1" >>confdefs.h
-
- { $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; }
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-if (test -z "$have_uintxx_t" && \
- test "x$ac_cv_header_inttypes_h" = "xyes")
-then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uintXX_t types in inttypes.h" >&5
-$as_echo_n "checking for uintXX_t types in inttypes.h... " >&6; }
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
- #include <inttypes.h>
-int
-main ()
-{
- uint8_t a; uint16_t b; uint32_t c; a = b = c = 1;
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
- $as_echo "#define HAVE_UINTXX_T 1" >>confdefs.h
-
- { $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; }
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
- test "x$ac_cv_header_sys_bitypes_h" = "xyes")
-then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for intXX_t and u_intXX_t types in sys/bitypes.h" >&5
-$as_echo_n "checking for intXX_t and u_intXX_t types in sys/bitypes.h... " >&6; }
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <sys/bitypes.h>
-
-int
-main ()
-{
-
- int8_t a; int16_t b; int32_t c;
- u_int8_t e; u_int16_t f; u_int32_t g;
- a = b = c = e = f = g = 1;
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
- $as_echo "#define HAVE_U_INTXX_T 1" >>confdefs.h
-
- $as_echo "#define HAVE_INTXX_T 1" >>confdefs.h
-
- { $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; }
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for u_char" >&5
-$as_echo_n "checking for u_char... " >&6; }
-if ${ac_cv_have_u_char+:} false; then :
- $as_echo_n "(cached) " >&6
-else
-
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
- #include <sys/types.h>
-int
-main ()
-{
- u_char foo; foo = 125;
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_have_u_char="yes"
-else
- ac_cv_have_u_char="no"
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_u_char" >&5
-$as_echo "$ac_cv_have_u_char" >&6; }
-if test "x$ac_cv_have_u_char" = "xyes" ; then
-
-$as_echo "#define HAVE_U_CHAR 1" >>confdefs.h
-
-fi
-
-ac_fn_c_check_type "$LINENO" "intmax_t" "ac_cv_type_intmax_t" "
-#include <sys/types.h>
-#include <stdint.h>
-
-"
-if test "x$ac_cv_type_intmax_t" = xyes; then :
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_INTMAX_T 1
-_ACEOF
-
-
-fi
-ac_fn_c_check_type "$LINENO" "uintmax_t" "ac_cv_type_uintmax_t" "
-#include <sys/types.h>
-#include <stdint.h>
-
-"
-if test "x$ac_cv_type_uintmax_t" = xyes; then :
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_UINTMAX_T 1
-_ACEOF
-
-
-fi
-
-
-
- ac_fn_c_check_type "$LINENO" "socklen_t" "ac_cv_type_socklen_t" "#include <sys/types.h>
-#include <sys/socket.h>
-"
-if test "x$ac_cv_type_socklen_t" = xyes; then :
-
-else
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for socklen_t equivalent" >&5
-$as_echo_n "checking for socklen_t equivalent... " >&6; }
- if ${curl_cv_socklen_t_equiv+:} false; then :
- $as_echo_n "(cached) " >&6
-else
-
- # Systems have either "struct sockaddr *" or
- # "void *" as the second argument to getpeername
- curl_cv_socklen_t_equiv=
- for arg2 in "struct sockaddr" void; do
- for t in int size_t unsigned long "unsigned long"; do
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
- #include <sys/types.h>
- #include <sys/socket.h>
-
- int getpeername (int, $arg2 *, $t *);
-
-int
-main ()
-{
-
- $t len;
- getpeername(0,0,&len);
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
- curl_cv_socklen_t_equiv="$t"
- break
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- done
- done
-
- if test "x$curl_cv_socklen_t_equiv" = x; then
- as_fn_error $? "Cannot find a type to use in place of socklen_t" "$LINENO" 5
- fi
-
-fi
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $curl_cv_socklen_t_equiv" >&5
-$as_echo "$curl_cv_socklen_t_equiv" >&6; }
-
-cat >>confdefs.h <<_ACEOF
-#define socklen_t $curl_cv_socklen_t_equiv
-_ACEOF
-
-fi
-
-
-
-ac_fn_c_check_type "$LINENO" "sig_atomic_t" "ac_cv_type_sig_atomic_t" "#include <signal.h>
-"
-if test "x$ac_cv_type_sig_atomic_t" = xyes; then :
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_SIG_ATOMIC_T 1
-_ACEOF
-
-
-fi
-
-ac_fn_c_check_type "$LINENO" "fsblkcnt_t" "ac_cv_type_fsblkcnt_t" "
-#include <sys/types.h>
-#ifdef HAVE_SYS_BITYPES_H
-#include <sys/bitypes.h>
-#endif
-#ifdef HAVE_SYS_STATFS_H
-#include <sys/statfs.h>
-#endif
-#ifdef HAVE_SYS_STATVFS_H
-#include <sys/statvfs.h>
-#endif
-
-"
-if test "x$ac_cv_type_fsblkcnt_t" = xyes; then :
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_FSBLKCNT_T 1
-_ACEOF
-
-
-fi
-ac_fn_c_check_type "$LINENO" "fsfilcnt_t" "ac_cv_type_fsfilcnt_t" "
-#include <sys/types.h>
-#ifdef HAVE_SYS_BITYPES_H
-#include <sys/bitypes.h>
-#endif
-#ifdef HAVE_SYS_STATFS_H
-#include <sys/statfs.h>
-#endif
-#ifdef HAVE_SYS_STATVFS_H
-#include <sys/statvfs.h>
-#endif
-
-"
-if test "x$ac_cv_type_fsfilcnt_t" = xyes; then :
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_FSFILCNT_T 1
-_ACEOF
-
-
-fi
-
-
-ac_fn_c_check_type "$LINENO" "in_addr_t" "ac_cv_type_in_addr_t" "#include <sys/types.h>
-#include <netinet/in.h>
-"
-if test "x$ac_cv_type_in_addr_t" = xyes; then :
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_IN_ADDR_T 1
-_ACEOF
-
-
-fi
-ac_fn_c_check_type "$LINENO" "in_port_t" "ac_cv_type_in_port_t" "#include <sys/types.h>
-#include <netinet/in.h>
-"
-if test "x$ac_cv_type_in_port_t" = xyes; then :
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_IN_PORT_T 1
-_ACEOF
-
-
-fi
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for size_t" >&5
-$as_echo_n "checking for size_t... " >&6; }
-if ${ac_cv_have_size_t+:} false; then :
- $as_echo_n "(cached) " >&6
-else
-
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
- #include <sys/types.h>
-int
-main ()
-{
- size_t foo; foo = 1235;
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_have_size_t="yes"
-else
- ac_cv_have_size_t="no"
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_size_t" >&5
-$as_echo "$ac_cv_have_size_t" >&6; }
-if test "x$ac_cv_have_size_t" = "xyes" ; then
-
-$as_echo "#define HAVE_SIZE_T 1" >>confdefs.h
-
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ssize_t" >&5
-$as_echo_n "checking for ssize_t... " >&6; }
-if ${ac_cv_have_ssize_t+:} false; then :
- $as_echo_n "(cached) " >&6
-else
-
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
- #include <sys/types.h>
-int
-main ()
-{
- ssize_t foo; foo = 1235;
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_have_ssize_t="yes"
-else
- ac_cv_have_ssize_t="no"
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_ssize_t" >&5
-$as_echo "$ac_cv_have_ssize_t" >&6; }
-if test "x$ac_cv_have_ssize_t" = "xyes" ; then
-
-$as_echo "#define HAVE_SSIZE_T 1" >>confdefs.h
-
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for clock_t" >&5
-$as_echo_n "checking for clock_t... " >&6; }
-if ${ac_cv_have_clock_t+:} false; then :
- $as_echo_n "(cached) " >&6
-else
-
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
- #include <time.h>
-int
-main ()
-{
- clock_t foo; foo = 1235;
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_have_clock_t="yes"
-else
- ac_cv_have_clock_t="no"
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_clock_t" >&5
-$as_echo "$ac_cv_have_clock_t" >&6; }
-if test "x$ac_cv_have_clock_t" = "xyes" ; then
-
-$as_echo "#define HAVE_CLOCK_T 1" >>confdefs.h
-
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sa_family_t" >&5
-$as_echo_n "checking for sa_family_t... " >&6; }
-if ${ac_cv_have_sa_family_t+:} false; then :
- $as_echo_n "(cached) " >&6
-else
-
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <sys/types.h>
-#include <sys/socket.h>
-
-int
-main ()
-{
- sa_family_t foo; foo = 1235;
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_have_sa_family_t="yes"
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-
-int
-main ()
-{
- sa_family_t foo; foo = 1235;
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_have_sa_family_t="yes"
-else
- ac_cv_have_sa_family_t="no"
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_sa_family_t" >&5
-$as_echo "$ac_cv_have_sa_family_t" >&6; }
-if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
-
-$as_echo "#define HAVE_SA_FAMILY_T 1" >>confdefs.h
-
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pid_t" >&5
-$as_echo_n "checking for pid_t... " >&6; }
-if ${ac_cv_have_pid_t+:} false; then :
- $as_echo_n "(cached) " >&6
-else
-
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
- #include <sys/types.h>
-int
-main ()
-{
- pid_t foo; foo = 1235;
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_have_pid_t="yes"
-else
- ac_cv_have_pid_t="no"
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_pid_t" >&5
-$as_echo "$ac_cv_have_pid_t" >&6; }
-if test "x$ac_cv_have_pid_t" = "xyes" ; then
-
-$as_echo "#define HAVE_PID_T 1" >>confdefs.h
-
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for mode_t" >&5
-$as_echo_n "checking for mode_t... " >&6; }
-if ${ac_cv_have_mode_t+:} false; then :
- $as_echo_n "(cached) " >&6
-else
-
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
- #include <sys/types.h>
-int
-main ()
-{
- mode_t foo; foo = 1235;
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_have_mode_t="yes"
-else
- ac_cv_have_mode_t="no"
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_mode_t" >&5
-$as_echo "$ac_cv_have_mode_t" >&6; }
-if test "x$ac_cv_have_mode_t" = "xyes" ; then
-
-$as_echo "#define HAVE_MODE_T 1" >>confdefs.h
-
-fi
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct sockaddr_storage" >&5
-$as_echo_n "checking for struct sockaddr_storage... " >&6; }
-if ${ac_cv_have_struct_sockaddr_storage+:} false; then :
- $as_echo_n "(cached) " >&6
-else
-
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <sys/types.h>
-#include <sys/socket.h>
-
-int
-main ()
-{
- struct sockaddr_storage s;
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_have_struct_sockaddr_storage="yes"
-else
- ac_cv_have_struct_sockaddr_storage="no"
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_struct_sockaddr_storage" >&5
-$as_echo "$ac_cv_have_struct_sockaddr_storage" >&6; }
-if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
-
-$as_echo "#define HAVE_STRUCT_SOCKADDR_STORAGE 1" >>confdefs.h
-
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct sockaddr_in6" >&5
-$as_echo_n "checking for struct sockaddr_in6... " >&6; }
-if ${ac_cv_have_struct_sockaddr_in6+:} false; then :
- $as_echo_n "(cached) " >&6
-else
-
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <sys/types.h>
-#include <netinet/in.h>
-
-int
-main ()
-{
- struct sockaddr_in6 s; s.sin6_family = 0;
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_have_struct_sockaddr_in6="yes"
-else
- ac_cv_have_struct_sockaddr_in6="no"
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_struct_sockaddr_in6" >&5
-$as_echo "$ac_cv_have_struct_sockaddr_in6" >&6; }
-if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
-
-$as_echo "#define HAVE_STRUCT_SOCKADDR_IN6 1" >>confdefs.h
-
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct in6_addr" >&5
-$as_echo_n "checking for struct in6_addr... " >&6; }
-if ${ac_cv_have_struct_in6_addr+:} false; then :
- $as_echo_n "(cached) " >&6
-else
-
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <sys/types.h>
-#include <netinet/in.h>
-
-int
-main ()
-{
- struct in6_addr s; s.s6_addr[0] = 0;
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_have_struct_in6_addr="yes"
-else
- ac_cv_have_struct_in6_addr="no"
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_struct_in6_addr" >&5
-$as_echo "$ac_cv_have_struct_in6_addr" >&6; }
-if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
-
-$as_echo "#define HAVE_STRUCT_IN6_ADDR 1" >>confdefs.h
-
-
- ac_fn_c_check_member "$LINENO" "struct sockaddr_in6" "sin6_scope_id" "ac_cv_member_struct_sockaddr_in6_sin6_scope_id" "
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#include <netinet/in.h>
-
-"
-if test "x$ac_cv_member_struct_sockaddr_in6_sin6_scope_id" = xyes; then :
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_STRUCT_SOCKADDR_IN6_SIN6_SCOPE_ID 1
-_ACEOF
-
-
-fi
-
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct addrinfo" >&5
-$as_echo_n "checking for struct addrinfo... " >&6; }
-if ${ac_cv_have_struct_addrinfo+:} false; then :
- $as_echo_n "(cached) " >&6
-else
-
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netdb.h>
-
-int
-main ()
-{
- struct addrinfo s; s.ai_flags = AI_PASSIVE;
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_have_struct_addrinfo="yes"
-else
- ac_cv_have_struct_addrinfo="no"
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_struct_addrinfo" >&5
-$as_echo "$ac_cv_have_struct_addrinfo" >&6; }
-if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
-
-$as_echo "#define HAVE_STRUCT_ADDRINFO 1" >>confdefs.h
-
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timeval" >&5
-$as_echo_n "checking for struct timeval... " >&6; }
-if ${ac_cv_have_struct_timeval+:} false; then :
- $as_echo_n "(cached) " >&6
-else
-
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
- #include <sys/time.h>
-int
-main ()
-{
- struct timeval tv; tv.tv_sec = 1;
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_have_struct_timeval="yes"
-else
- ac_cv_have_struct_timeval="no"
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_struct_timeval" >&5
-$as_echo "$ac_cv_have_struct_timeval" >&6; }
-if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
-
-$as_echo "#define HAVE_STRUCT_TIMEVAL 1" >>confdefs.h
-
- have_struct_timeval=1
-fi
-
-ac_fn_c_check_type "$LINENO" "struct timespec" "ac_cv_type_struct_timespec" "$ac_includes_default"
-if test "x$ac_cv_type_struct_timespec" = xyes; then :
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_STRUCT_TIMESPEC 1
-_ACEOF
-
-
-fi
-
-
-# We need int64_t or else certian parts of the compile will fail.
-if test "x$ac_cv_have_int64_t" = "xno" && \
- test "x$ac_cv_sizeof_long_int" != "x8" && \
- test "x$ac_cv_sizeof_long_long_int" = "x0" ; then
- echo "OpenSSH requires int64_t support. Contact your vendor or install"
- echo "an alternative compiler (I.E., GCC) before continuing."
- echo ""
- exit 1;
-else
- if test "$cross_compiling" = yes; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cross compiling: Assuming working snprintf()" >&5
-$as_echo "$as_me: WARNING: cross compiling: Assuming working snprintf()" >&2;}
-
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <stdio.h>
-#include <string.h>
-#ifdef HAVE_SNPRINTF
-main()
-{
- char buf[50];
- char expected_out[50];
- int mazsize = 50 ;
-#if (SIZEOF_LONG_INT == 8)
- long int num = 0x7fffffffffffffff;
-#else
- long long num = 0x7fffffffffffffffll;
-#endif
- strcpy(expected_out, "9223372036854775807");
- snprintf(buf, mazsize, "%lld", num);
- if(strcmp(buf, expected_out) != 0)
- exit(1);
- exit(0);
-}
-#else
-main() { exit(0); }
-#endif
-
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
- true
-else
- $as_echo "#define BROKEN_SNPRINTF 1" >>confdefs.h
-
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-fi
-
-
-# look for field 'ut_host' in header 'utmp.h'
- ossh_safe=`echo "utmp.h" | sed 'y%./+-%__p_%'`
- ossh_varname="ossh_cv_$ossh_safe""_has_"ut_host
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ut_host field in utmp.h" >&5
-$as_echo_n "checking for ut_host field in utmp.h... " >&6; }
- if eval \${$ossh_varname+:} false; then :
- $as_echo_n "(cached) " >&6
-else
-
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <utmp.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "ut_host" >/dev/null 2>&1; then :
- eval "$ossh_varname=yes"
-else
- eval "$ossh_varname=no"
-fi
-rm -f conftest*
-
-fi
-
- ossh_result=`eval 'echo $'"$ossh_varname"`
- if test -n "`echo $ossh_varname`"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ossh_result" >&5
-$as_echo "$ossh_result" >&6; }
- if test "x$ossh_result" = "xyes"; then
-
-$as_echo "#define HAVE_HOST_IN_UTMP 1" >>confdefs.h
-
- fi
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- fi
-
-
-# look for field 'ut_host' in header 'utmpx.h'
- ossh_safe=`echo "utmpx.h" | sed 'y%./+-%__p_%'`
- ossh_varname="ossh_cv_$ossh_safe""_has_"ut_host
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ut_host field in utmpx.h" >&5
-$as_echo_n "checking for ut_host field in utmpx.h... " >&6; }
- if eval \${$ossh_varname+:} false; then :
- $as_echo_n "(cached) " >&6
-else
-
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <utmpx.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "ut_host" >/dev/null 2>&1; then :
- eval "$ossh_varname=yes"
-else
- eval "$ossh_varname=no"
-fi
-rm -f conftest*
-
-fi
-
- ossh_result=`eval 'echo $'"$ossh_varname"`
- if test -n "`echo $ossh_varname`"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ossh_result" >&5
-$as_echo "$ossh_result" >&6; }
- if test "x$ossh_result" = "xyes"; then
-
-$as_echo "#define HAVE_HOST_IN_UTMPX 1" >>confdefs.h
-
- fi
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- fi
-
-
-# look for field 'syslen' in header 'utmpx.h'
- ossh_safe=`echo "utmpx.h" | sed 'y%./+-%__p_%'`
- ossh_varname="ossh_cv_$ossh_safe""_has_"syslen
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for syslen field in utmpx.h" >&5
-$as_echo_n "checking for syslen field in utmpx.h... " >&6; }
- if eval \${$ossh_varname+:} false; then :
- $as_echo_n "(cached) " >&6
-else
-
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <utmpx.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "syslen" >/dev/null 2>&1; then :
- eval "$ossh_varname=yes"
-else
- eval "$ossh_varname=no"
-fi
-rm -f conftest*
-
-fi
-
- ossh_result=`eval 'echo $'"$ossh_varname"`
- if test -n "`echo $ossh_varname`"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ossh_result" >&5
-$as_echo "$ossh_result" >&6; }
- if test "x$ossh_result" = "xyes"; then
-
-$as_echo "#define HAVE_SYSLEN_IN_UTMPX 1" >>confdefs.h
-
- fi
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- fi
-
-
-# look for field 'ut_pid' in header 'utmp.h'
- ossh_safe=`echo "utmp.h" | sed 'y%./+-%__p_%'`
- ossh_varname="ossh_cv_$ossh_safe""_has_"ut_pid
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ut_pid field in utmp.h" >&5
-$as_echo_n "checking for ut_pid field in utmp.h... " >&6; }
- if eval \${$ossh_varname+:} false; then :
- $as_echo_n "(cached) " >&6
-else
-
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <utmp.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "ut_pid" >/dev/null 2>&1; then :
- eval "$ossh_varname=yes"
-else
- eval "$ossh_varname=no"
-fi
-rm -f conftest*
-
-fi
-
- ossh_result=`eval 'echo $'"$ossh_varname"`
- if test -n "`echo $ossh_varname`"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ossh_result" >&5
-$as_echo "$ossh_result" >&6; }
- if test "x$ossh_result" = "xyes"; then
-
-$as_echo "#define HAVE_PID_IN_UTMP 1" >>confdefs.h
-
- fi
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- fi
-
-
-# look for field 'ut_type' in header 'utmp.h'
- ossh_safe=`echo "utmp.h" | sed 'y%./+-%__p_%'`
- ossh_varname="ossh_cv_$ossh_safe""_has_"ut_type
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ut_type field in utmp.h" >&5
-$as_echo_n "checking for ut_type field in utmp.h... " >&6; }
- if eval \${$ossh_varname+:} false; then :
- $as_echo_n "(cached) " >&6
-else
-
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <utmp.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "ut_type" >/dev/null 2>&1; then :
- eval "$ossh_varname=yes"
-else
- eval "$ossh_varname=no"
-fi
-rm -f conftest*
-
-fi
-
- ossh_result=`eval 'echo $'"$ossh_varname"`
- if test -n "`echo $ossh_varname`"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ossh_result" >&5
-$as_echo "$ossh_result" >&6; }
- if test "x$ossh_result" = "xyes"; then
-
-$as_echo "#define HAVE_TYPE_IN_UTMP 1" >>confdefs.h
-
- fi
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- fi
-
-
-# look for field 'ut_type' in header 'utmpx.h'
- ossh_safe=`echo "utmpx.h" | sed 'y%./+-%__p_%'`
- ossh_varname="ossh_cv_$ossh_safe""_has_"ut_type
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ut_type field in utmpx.h" >&5
-$as_echo_n "checking for ut_type field in utmpx.h... " >&6; }
- if eval \${$ossh_varname+:} false; then :
- $as_echo_n "(cached) " >&6
-else
-
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <utmpx.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "ut_type" >/dev/null 2>&1; then :
- eval "$ossh_varname=yes"
-else
- eval "$ossh_varname=no"
-fi
-rm -f conftest*
-
-fi
-
- ossh_result=`eval 'echo $'"$ossh_varname"`
- if test -n "`echo $ossh_varname`"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ossh_result" >&5
-$as_echo "$ossh_result" >&6; }
- if test "x$ossh_result" = "xyes"; then
-
-$as_echo "#define HAVE_TYPE_IN_UTMPX 1" >>confdefs.h
-
- fi
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- fi
-
-
-# look for field 'ut_tv' in header 'utmp.h'
- ossh_safe=`echo "utmp.h" | sed 'y%./+-%__p_%'`
- ossh_varname="ossh_cv_$ossh_safe""_has_"ut_tv
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ut_tv field in utmp.h" >&5
-$as_echo_n "checking for ut_tv field in utmp.h... " >&6; }
- if eval \${$ossh_varname+:} false; then :
- $as_echo_n "(cached) " >&6
-else
-
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <utmp.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "ut_tv" >/dev/null 2>&1; then :
- eval "$ossh_varname=yes"
-else
- eval "$ossh_varname=no"
-fi
-rm -f conftest*
-
-fi
-
- ossh_result=`eval 'echo $'"$ossh_varname"`
- if test -n "`echo $ossh_varname`"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ossh_result" >&5
-$as_echo "$ossh_result" >&6; }
- if test "x$ossh_result" = "xyes"; then
-
-$as_echo "#define HAVE_TV_IN_UTMP 1" >>confdefs.h
-
- fi
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- fi
-
-
-# look for field 'ut_id' in header 'utmp.h'
- ossh_safe=`echo "utmp.h" | sed 'y%./+-%__p_%'`
- ossh_varname="ossh_cv_$ossh_safe""_has_"ut_id
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ut_id field in utmp.h" >&5
-$as_echo_n "checking for ut_id field in utmp.h... " >&6; }
- if eval \${$ossh_varname+:} false; then :
- $as_echo_n "(cached) " >&6
-else
-
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <utmp.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "ut_id" >/dev/null 2>&1; then :
- eval "$ossh_varname=yes"
-else
- eval "$ossh_varname=no"
-fi
-rm -f conftest*
-
-fi
-
- ossh_result=`eval 'echo $'"$ossh_varname"`
- if test -n "`echo $ossh_varname`"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ossh_result" >&5
-$as_echo "$ossh_result" >&6; }
- if test "x$ossh_result" = "xyes"; then
-
-$as_echo "#define HAVE_ID_IN_UTMP 1" >>confdefs.h
-
- fi
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- fi
-
-
-# look for field 'ut_id' in header 'utmpx.h'
- ossh_safe=`echo "utmpx.h" | sed 'y%./+-%__p_%'`
- ossh_varname="ossh_cv_$ossh_safe""_has_"ut_id
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ut_id field in utmpx.h" >&5
-$as_echo_n "checking for ut_id field in utmpx.h... " >&6; }
- if eval \${$ossh_varname+:} false; then :
- $as_echo_n "(cached) " >&6
-else
-
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <utmpx.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "ut_id" >/dev/null 2>&1; then :
- eval "$ossh_varname=yes"
-else
- eval "$ossh_varname=no"
-fi
-rm -f conftest*
-
-fi
-
- ossh_result=`eval 'echo $'"$ossh_varname"`
- if test -n "`echo $ossh_varname`"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ossh_result" >&5
-$as_echo "$ossh_result" >&6; }
- if test "x$ossh_result" = "xyes"; then
-
-$as_echo "#define HAVE_ID_IN_UTMPX 1" >>confdefs.h
-
- fi
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- fi
-
-
-# look for field 'ut_addr' in header 'utmp.h'
- ossh_safe=`echo "utmp.h" | sed 'y%./+-%__p_%'`
- ossh_varname="ossh_cv_$ossh_safe""_has_"ut_addr
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ut_addr field in utmp.h" >&5
-$as_echo_n "checking for ut_addr field in utmp.h... " >&6; }
- if eval \${$ossh_varname+:} false; then :
- $as_echo_n "(cached) " >&6
-else
-
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <utmp.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "ut_addr" >/dev/null 2>&1; then :
- eval "$ossh_varname=yes"
-else
- eval "$ossh_varname=no"
-fi
-rm -f conftest*
-
-fi
-
- ossh_result=`eval 'echo $'"$ossh_varname"`
- if test -n "`echo $ossh_varname`"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ossh_result" >&5
-$as_echo "$ossh_result" >&6; }
- if test "x$ossh_result" = "xyes"; then
-
-$as_echo "#define HAVE_ADDR_IN_UTMP 1" >>confdefs.h
-
- fi
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- fi
-
-
-# look for field 'ut_addr' in header 'utmpx.h'
- ossh_safe=`echo "utmpx.h" | sed 'y%./+-%__p_%'`
- ossh_varname="ossh_cv_$ossh_safe""_has_"ut_addr
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ut_addr field in utmpx.h" >&5
-$as_echo_n "checking for ut_addr field in utmpx.h... " >&6; }
- if eval \${$ossh_varname+:} false; then :
- $as_echo_n "(cached) " >&6
-else
-
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <utmpx.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "ut_addr" >/dev/null 2>&1; then :
- eval "$ossh_varname=yes"
-else
- eval "$ossh_varname=no"
-fi
-rm -f conftest*
-
-fi
-
- ossh_result=`eval 'echo $'"$ossh_varname"`
- if test -n "`echo $ossh_varname`"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ossh_result" >&5
-$as_echo "$ossh_result" >&6; }
- if test "x$ossh_result" = "xyes"; then
-
-$as_echo "#define HAVE_ADDR_IN_UTMPX 1" >>confdefs.h
-
- fi
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- fi
-
-
-# look for field 'ut_addr_v6' in header 'utmp.h'
- ossh_safe=`echo "utmp.h" | sed 'y%./+-%__p_%'`
- ossh_varname="ossh_cv_$ossh_safe""_has_"ut_addr_v6
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ut_addr_v6 field in utmp.h" >&5
-$as_echo_n "checking for ut_addr_v6 field in utmp.h... " >&6; }
- if eval \${$ossh_varname+:} false; then :
- $as_echo_n "(cached) " >&6
-else
-
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <utmp.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "ut_addr_v6" >/dev/null 2>&1; then :
- eval "$ossh_varname=yes"
-else
- eval "$ossh_varname=no"
-fi
-rm -f conftest*
-
-fi
-
- ossh_result=`eval 'echo $'"$ossh_varname"`
- if test -n "`echo $ossh_varname`"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ossh_result" >&5
-$as_echo "$ossh_result" >&6; }
- if test "x$ossh_result" = "xyes"; then
-
-$as_echo "#define HAVE_ADDR_V6_IN_UTMP 1" >>confdefs.h
-
- fi
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- fi
-
-
-# look for field 'ut_addr_v6' in header 'utmpx.h'
- ossh_safe=`echo "utmpx.h" | sed 'y%./+-%__p_%'`
- ossh_varname="ossh_cv_$ossh_safe""_has_"ut_addr_v6
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ut_addr_v6 field in utmpx.h" >&5
-$as_echo_n "checking for ut_addr_v6 field in utmpx.h... " >&6; }
- if eval \${$ossh_varname+:} false; then :
- $as_echo_n "(cached) " >&6
-else
-
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <utmpx.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "ut_addr_v6" >/dev/null 2>&1; then :
- eval "$ossh_varname=yes"
-else
- eval "$ossh_varname=no"
-fi
-rm -f conftest*
-
-fi
-
- ossh_result=`eval 'echo $'"$ossh_varname"`
- if test -n "`echo $ossh_varname`"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ossh_result" >&5
-$as_echo "$ossh_result" >&6; }
- if test "x$ossh_result" = "xyes"; then
-
-$as_echo "#define HAVE_ADDR_V6_IN_UTMPX 1" >>confdefs.h
-
- fi
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- fi
-
-
-# look for field 'ut_exit' in header 'utmp.h'
- ossh_safe=`echo "utmp.h" | sed 'y%./+-%__p_%'`
- ossh_varname="ossh_cv_$ossh_safe""_has_"ut_exit
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ut_exit field in utmp.h" >&5
-$as_echo_n "checking for ut_exit field in utmp.h... " >&6; }
- if eval \${$ossh_varname+:} false; then :
- $as_echo_n "(cached) " >&6
-else
-
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <utmp.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "ut_exit" >/dev/null 2>&1; then :
- eval "$ossh_varname=yes"
-else
- eval "$ossh_varname=no"
-fi
-rm -f conftest*
-
-fi
-
- ossh_result=`eval 'echo $'"$ossh_varname"`
- if test -n "`echo $ossh_varname`"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ossh_result" >&5
-$as_echo "$ossh_result" >&6; }
- if test "x$ossh_result" = "xyes"; then
-
-$as_echo "#define HAVE_EXIT_IN_UTMP 1" >>confdefs.h
-
- fi
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- fi
-
-
-# look for field 'ut_time' in header 'utmp.h'
- ossh_safe=`echo "utmp.h" | sed 'y%./+-%__p_%'`
- ossh_varname="ossh_cv_$ossh_safe""_has_"ut_time
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ut_time field in utmp.h" >&5
-$as_echo_n "checking for ut_time field in utmp.h... " >&6; }
- if eval \${$ossh_varname+:} false; then :
- $as_echo_n "(cached) " >&6
-else
-
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <utmp.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "ut_time" >/dev/null 2>&1; then :
- eval "$ossh_varname=yes"
-else
- eval "$ossh_varname=no"
-fi
-rm -f conftest*
-
-fi
-
- ossh_result=`eval 'echo $'"$ossh_varname"`
- if test -n "`echo $ossh_varname`"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ossh_result" >&5
-$as_echo "$ossh_result" >&6; }
- if test "x$ossh_result" = "xyes"; then
-
-$as_echo "#define HAVE_TIME_IN_UTMP 1" >>confdefs.h
-
- fi
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- fi
-
-
-# look for field 'ut_time' in header 'utmpx.h'
- ossh_safe=`echo "utmpx.h" | sed 'y%./+-%__p_%'`
- ossh_varname="ossh_cv_$ossh_safe""_has_"ut_time
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ut_time field in utmpx.h" >&5
-$as_echo_n "checking for ut_time field in utmpx.h... " >&6; }
- if eval \${$ossh_varname+:} false; then :
- $as_echo_n "(cached) " >&6
-else
-
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <utmpx.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "ut_time" >/dev/null 2>&1; then :
- eval "$ossh_varname=yes"
-else
- eval "$ossh_varname=no"
-fi
-rm -f conftest*
-
-fi
-
- ossh_result=`eval 'echo $'"$ossh_varname"`
- if test -n "`echo $ossh_varname`"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ossh_result" >&5
-$as_echo "$ossh_result" >&6; }
- if test "x$ossh_result" = "xyes"; then
-
-$as_echo "#define HAVE_TIME_IN_UTMPX 1" >>confdefs.h
-
- fi
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- fi
-
-
-# look for field 'ut_tv' in header 'utmpx.h'
- ossh_safe=`echo "utmpx.h" | sed 'y%./+-%__p_%'`
- ossh_varname="ossh_cv_$ossh_safe""_has_"ut_tv
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ut_tv field in utmpx.h" >&5
-$as_echo_n "checking for ut_tv field in utmpx.h... " >&6; }
- if eval \${$ossh_varname+:} false; then :
- $as_echo_n "(cached) " >&6
-else
-
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <utmpx.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "ut_tv" >/dev/null 2>&1; then :
- eval "$ossh_varname=yes"
-else
- eval "$ossh_varname=no"
-fi
-rm -f conftest*
-
-fi
-
- ossh_result=`eval 'echo $'"$ossh_varname"`
- if test -n "`echo $ossh_varname`"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ossh_result" >&5
-$as_echo "$ossh_result" >&6; }
- if test "x$ossh_result" = "xyes"; then
-
-$as_echo "#define HAVE_TV_IN_UTMPX 1" >>confdefs.h
-
- fi
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- fi
-
-
-ac_fn_c_check_member "$LINENO" "struct stat" "st_blksize" "ac_cv_member_struct_stat_st_blksize" "$ac_includes_default"
-if test "x$ac_cv_member_struct_stat_st_blksize" = xyes; then :
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_STRUCT_STAT_ST_BLKSIZE 1
-_ACEOF
-
-
-fi
-
-ac_fn_c_check_member "$LINENO" "struct passwd" "pw_gecos" "ac_cv_member_struct_passwd_pw_gecos" "
-#include <sys/types.h>
-#include <pwd.h>
-
-"
-if test "x$ac_cv_member_struct_passwd_pw_gecos" = xyes; then :
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_STRUCT_PASSWD_PW_GECOS 1
-_ACEOF
-
-
-fi
-ac_fn_c_check_member "$LINENO" "struct passwd" "pw_class" "ac_cv_member_struct_passwd_pw_class" "
-#include <sys/types.h>
-#include <pwd.h>
-
-"
-if test "x$ac_cv_member_struct_passwd_pw_class" = xyes; then :
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_STRUCT_PASSWD_PW_CLASS 1
-_ACEOF
-
-
-fi
-ac_fn_c_check_member "$LINENO" "struct passwd" "pw_change" "ac_cv_member_struct_passwd_pw_change" "
-#include <sys/types.h>
-#include <pwd.h>
-
-"
-if test "x$ac_cv_member_struct_passwd_pw_change" = xyes; then :
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_STRUCT_PASSWD_PW_CHANGE 1
-_ACEOF
-
-
-fi
-ac_fn_c_check_member "$LINENO" "struct passwd" "pw_expire" "ac_cv_member_struct_passwd_pw_expire" "
-#include <sys/types.h>
-#include <pwd.h>
-
-"
-if test "x$ac_cv_member_struct_passwd_pw_expire" = xyes; then :
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_STRUCT_PASSWD_PW_EXPIRE 1
-_ACEOF
-
-
-fi
-
-
-ac_fn_c_check_member "$LINENO" "struct __res_state" "retrans" "ac_cv_member_struct___res_state_retrans" "
-#include <stdio.h>
-#if HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-#include <netinet/in.h>
-#include <arpa/nameser.h>
-#include <resolv.h>
-
-"
-if test "x$ac_cv_member_struct___res_state_retrans" = xyes; then :
-
-else
-
-$as_echo "#define __res_state state" >>confdefs.h
-
-fi
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ss_family field in struct sockaddr_storage" >&5
-$as_echo_n "checking for ss_family field in struct sockaddr_storage... " >&6; }
-if ${ac_cv_have_ss_family_in_struct_ss+:} false; then :
- $as_echo_n "(cached) " >&6
-else
-
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <sys/types.h>
-#include <sys/socket.h>
-
-int
-main ()
-{
- struct sockaddr_storage s; s.ss_family = 1;
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_have_ss_family_in_struct_ss="yes"
-else
- ac_cv_have_ss_family_in_struct_ss="no"
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_ss_family_in_struct_ss" >&5
-$as_echo "$ac_cv_have_ss_family_in_struct_ss" >&6; }
-if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
-
-$as_echo "#define HAVE_SS_FAMILY_IN_SS 1" >>confdefs.h
-
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for __ss_family field in struct sockaddr_storage" >&5
-$as_echo_n "checking for __ss_family field in struct sockaddr_storage... " >&6; }
-if ${ac_cv_have___ss_family_in_struct_ss+:} false; then :
- $as_echo_n "(cached) " >&6
-else
-
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <sys/types.h>
-#include <sys/socket.h>
-
-int
-main ()
-{
- struct sockaddr_storage s; s.__ss_family = 1;
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_have___ss_family_in_struct_ss="yes"
-else
- ac_cv_have___ss_family_in_struct_ss="no"
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have___ss_family_in_struct_ss" >&5
-$as_echo "$ac_cv_have___ss_family_in_struct_ss" >&6; }
-if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
-
-$as_echo "#define HAVE___SS_FAMILY_IN_SS 1" >>confdefs.h
-
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for msg_accrights field in struct msghdr" >&5
-$as_echo_n "checking for msg_accrights field in struct msghdr... " >&6; }
-if ${ac_cv_have_accrights_in_msghdr+:} false; then :
- $as_echo_n "(cached) " >&6
-else
-
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <sys/uio.h>
-
-int
-main ()
-{
-
-#ifdef msg_accrights
-#error "msg_accrights is a macro"
-exit(1);
-#endif
-struct msghdr m;
-m.msg_accrights = 0;
-exit(0);
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_have_accrights_in_msghdr="yes"
-else
- ac_cv_have_accrights_in_msghdr="no"
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_accrights_in_msghdr" >&5
-$as_echo "$ac_cv_have_accrights_in_msghdr" >&6; }
-if test "x$ac_cv_have_accrights_in_msghdr" = "xyes" ; then
-
-$as_echo "#define HAVE_ACCRIGHTS_IN_MSGHDR 1" >>confdefs.h
-
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if struct statvfs.f_fsid is integral type" >&5
-$as_echo_n "checking if struct statvfs.f_fsid is integral type... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <sys/param.h>
-#include <sys/stat.h>
-#ifdef HAVE_SYS_TIME_H
-# include <sys/time.h>
-#endif
-#ifdef HAVE_SYS_MOUNT_H
-#include <sys/mount.h>
-#endif
-#ifdef HAVE_SYS_STATVFS_H
-#include <sys/statvfs.h>
-#endif
-
-int
-main ()
-{
- struct statvfs s; s.f_fsid = 0;
- ;
- return 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 "$as_me:${as_lineno-$LINENO}: checking if fsid_t has member val" >&5
-$as_echo_n "checking if fsid_t has member val... " >&6; }
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <sys/types.h>
-#include <sys/statvfs.h>
-
-int
-main ()
-{
- fsid_t t; t.val[0] = 0;
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-
-$as_echo "#define FSID_HAS_VAL 1" >>confdefs.h
-
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if f_fsid has member __val" >&5
-$as_echo_n "checking if f_fsid has member __val... " >&6; }
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <sys/types.h>
-#include <sys/statvfs.h>
-
-int
-main ()
-{
- fsid_t t; t.__val[0] = 0;
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-
-$as_echo "#define FSID_HAS___VAL 1" >>confdefs.h
-
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for msg_control field in struct msghdr" >&5
-$as_echo_n "checking for msg_control field in struct msghdr... " >&6; }
-if ${ac_cv_have_control_in_msghdr+:} false; then :
- $as_echo_n "(cached) " >&6
-else
-
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <sys/uio.h>
-
-int
-main ()
-{
-
-#ifdef msg_control
-#error "msg_control is a macro"
-exit(1);
-#endif
-struct msghdr m;
-m.msg_control = 0;
-exit(0);
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_have_control_in_msghdr="yes"
-else
- ac_cv_have_control_in_msghdr="no"
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_control_in_msghdr" >&5
-$as_echo "$ac_cv_have_control_in_msghdr" >&6; }
-if test "x$ac_cv_have_control_in_msghdr" = "xyes" ; then
-
-$as_echo "#define HAVE_CONTROL_IN_MSGHDR 1" >>confdefs.h
-
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if libc defines __progname" >&5
-$as_echo_n "checking if libc defines __progname... " >&6; }
-if ${ac_cv_libc_defines___progname+:} false; then :
- $as_echo_n "(cached) " >&6
-else
-
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
- extern char *__progname; printf("%s", __progname);
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_libc_defines___progname="yes"
-else
- ac_cv_libc_defines___progname="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: $ac_cv_libc_defines___progname" >&5
-$as_echo "$ac_cv_libc_defines___progname" >&6; }
-if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
-
-$as_echo "#define HAVE___PROGNAME 1" >>confdefs.h
-
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC implements __FUNCTION__" >&5
-$as_echo_n "checking whether $CC implements __FUNCTION__... " >&6; }
-if ${ac_cv_cc_implements___FUNCTION__+:} false; then :
- $as_echo_n "(cached) " >&6
-else
-
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
- #include <stdio.h>
-int
-main ()
-{
- printf("%s", __FUNCTION__);
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_cc_implements___FUNCTION__="yes"
-else
- ac_cv_cc_implements___FUNCTION__="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: $ac_cv_cc_implements___FUNCTION__" >&5
-$as_echo "$ac_cv_cc_implements___FUNCTION__" >&6; }
-if test "x$ac_cv_cc_implements___FUNCTION__" = "xyes" ; then
-
-$as_echo "#define HAVE___FUNCTION__ 1" >>confdefs.h
-
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC implements __func__" >&5
-$as_echo_n "checking whether $CC implements __func__... " >&6; }
-if ${ac_cv_cc_implements___func__+:} false; then :
- $as_echo_n "(cached) " >&6
-else
-
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
- #include <stdio.h>
-int
-main ()
-{
- printf("%s", __func__);
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_cc_implements___func__="yes"
-else
- ac_cv_cc_implements___func__="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: $ac_cv_cc_implements___func__" >&5
-$as_echo "$ac_cv_cc_implements___func__" >&6; }
-if test "x$ac_cv_cc_implements___func__" = "xyes" ; then
-
-$as_echo "#define HAVE___func__ 1" >>confdefs.h
-
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether va_copy exists" >&5
-$as_echo_n "checking whether va_copy exists... " >&6; }
-if ${ac_cv_have_va_copy+:} false; then :
- $as_echo_n "(cached) " >&6
-else
-
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <stdarg.h>
-va_list x,y;
-
-int
-main ()
-{
- va_copy(x,y);
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_have_va_copy="yes"
-else
- ac_cv_have_va_copy="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: $ac_cv_have_va_copy" >&5
-$as_echo "$ac_cv_have_va_copy" >&6; }
-if test "x$ac_cv_have_va_copy" = "xyes" ; then
-
-$as_echo "#define HAVE_VA_COPY 1" >>confdefs.h
-
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether __va_copy exists" >&5
-$as_echo_n "checking whether __va_copy exists... " >&6; }
-if ${ac_cv_have___va_copy+:} false; then :
- $as_echo_n "(cached) " >&6
-else
-
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <stdarg.h>
-va_list x,y;
-
-int
-main ()
-{
- __va_copy(x,y);
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_have___va_copy="yes"
-else
- ac_cv_have___va_copy="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: $ac_cv_have___va_copy" >&5
-$as_echo "$ac_cv_have___va_copy" >&6; }
-if test "x$ac_cv_have___va_copy" = "xyes" ; then
-
-$as_echo "#define HAVE___VA_COPY 1" >>confdefs.h
-
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether getopt has optreset support" >&5
-$as_echo_n "checking whether getopt has optreset support... " >&6; }
-if ${ac_cv_have_getopt_optreset+:} false; then :
- $as_echo_n "(cached) " >&6
-else
-
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
- #include <getopt.h>
-int
-main ()
-{
- extern int optreset; optreset = 0;
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_have_getopt_optreset="yes"
-else
- ac_cv_have_getopt_optreset="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: $ac_cv_have_getopt_optreset" >&5
-$as_echo "$ac_cv_have_getopt_optreset" >&6; }
-if test "x$ac_cv_have_getopt_optreset" = "xyes" ; then
-
-$as_echo "#define HAVE_GETOPT_OPTRESET 1" >>confdefs.h
-
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if libc defines sys_errlist" >&5
-$as_echo_n "checking if libc defines sys_errlist... " >&6; }
-if ${ac_cv_libc_defines_sys_errlist+:} false; then :
- $as_echo_n "(cached) " >&6
-else
-
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
- extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_libc_defines_sys_errlist="yes"
-else
- ac_cv_libc_defines_sys_errlist="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: $ac_cv_libc_defines_sys_errlist" >&5
-$as_echo "$ac_cv_libc_defines_sys_errlist" >&6; }
-if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
-
-$as_echo "#define HAVE_SYS_ERRLIST 1" >>confdefs.h
-
-fi
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if libc defines sys_nerr" >&5
-$as_echo_n "checking if libc defines sys_nerr... " >&6; }
-if ${ac_cv_libc_defines_sys_nerr+:} false; then :
- $as_echo_n "(cached) " >&6
-else
-
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
- extern int sys_nerr; printf("%i", sys_nerr);
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_libc_defines_sys_nerr="yes"
-else
- ac_cv_libc_defines_sys_nerr="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: $ac_cv_libc_defines_sys_nerr" >&5
-$as_echo "$ac_cv_libc_defines_sys_nerr" >&6; }
-if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
-
-$as_echo "#define HAVE_SYS_NERR 1" >>confdefs.h
-
-fi
-
-# Check libraries needed by DNS fingerprint support
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing getrrsetbyname" >&5
-$as_echo_n "checking for library containing getrrsetbyname... " >&6; }
-if ${ac_cv_search_getrrsetbyname+:} 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 getrrsetbyname ();
-int
-main ()
-{
-return getrrsetbyname ();
- ;
- return 0;
-}
-_ACEOF
-for ac_lib in '' resolv; 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_getrrsetbyname=$ac_res
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext
- if ${ac_cv_search_getrrsetbyname+:} false; then :
- break
-fi
-done
-if ${ac_cv_search_getrrsetbyname+:} false; then :
-
-else
- ac_cv_search_getrrsetbyname=no
-fi
-rm conftest.$ac_ext
-LIBS=$ac_func_search_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_getrrsetbyname" >&5
-$as_echo "$ac_cv_search_getrrsetbyname" >&6; }
-ac_res=$ac_cv_search_getrrsetbyname
-if test "$ac_res" != no; then :
- test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
-
-$as_echo "#define HAVE_GETRRSETBYNAME 1" >>confdefs.h
-
-else
-
- # Needed by our getrrsetbyname()
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing res_query" >&5
-$as_echo_n "checking for library containing res_query... " >&6; }
-if ${ac_cv_search_res_query+:} 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 res_query ();
-int
-main ()
-{
-return res_query ();
- ;
- return 0;
-}
-_ACEOF
-for ac_lib in '' resolv; 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_res_query=$ac_res
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext
- if ${ac_cv_search_res_query+:} false; then :
- break
-fi
-done
-if ${ac_cv_search_res_query+:} false; then :
-
-else
- ac_cv_search_res_query=no
-fi
-rm conftest.$ac_ext
-LIBS=$ac_func_search_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_res_query" >&5
-$as_echo "$ac_cv_search_res_query" >&6; }
-ac_res=$ac_cv_search_res_query
-if test "$ac_res" != no; then :
- test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
-
-fi
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing dn_expand" >&5
-$as_echo_n "checking for library containing dn_expand... " >&6; }
-if ${ac_cv_search_dn_expand+:} 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 dn_expand ();
-int
-main ()
-{
-return dn_expand ();
- ;
- return 0;
-}
-_ACEOF
-for ac_lib in '' resolv; 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_dn_expand=$ac_res
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext
- if ${ac_cv_search_dn_expand+:} false; then :
- break
-fi
-done
-if ${ac_cv_search_dn_expand+:} false; then :
-
-else
- ac_cv_search_dn_expand=no
-fi
-rm conftest.$ac_ext
-LIBS=$ac_func_search_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_dn_expand" >&5
-$as_echo "$ac_cv_search_dn_expand" >&6; }
-ac_res=$ac_cv_search_dn_expand
-if test "$ac_res" != no; then :
- test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
-
-fi
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if res_query will link" >&5
-$as_echo_n "checking if res_query will link... " >&6; }
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <sys/types.h>
-#include <netinet/in.h>
-#include <arpa/nameser.h>
-#include <netdb.h>
-#include <resolv.h>
-
-int
-main ()
-{
-
- res_query (0, 0, 0, 0, 0);
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$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; }
- saved_LIBS="$LIBS"
- LIBS="$LIBS -lresolv"
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for res_query in -lresolv" >&5
-$as_echo_n "checking for res_query in -lresolv... " >&6; }
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <sys/types.h>
-#include <netinet/in.h>
-#include <arpa/nameser.h>
-#include <netdb.h>
-#include <resolv.h>
-
-int
-main ()
-{
-
- res_query (0, 0, 0, 0, 0);
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-else
- LIBS="$saved_LIBS"
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
- for ac_func in _getshort _getlong
-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
-
- ac_fn_c_check_decl "$LINENO" "_getshort" "ac_cv_have_decl__getshort" "#include <sys/types.h>
- #include <arpa/nameser.h>
-"
-if test "x$ac_cv_have_decl__getshort" = xyes; then :
- ac_have_decl=1
-else
- ac_have_decl=0
-fi
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL__GETSHORT $ac_have_decl
-_ACEOF
-ac_fn_c_check_decl "$LINENO" "_getlong" "ac_cv_have_decl__getlong" "#include <sys/types.h>
- #include <arpa/nameser.h>
-"
-if test "x$ac_cv_have_decl__getlong" = xyes; then :
- ac_have_decl=1
-else
- ac_have_decl=0
-fi
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL__GETLONG $ac_have_decl
-_ACEOF
-
- ac_fn_c_check_member "$LINENO" "HEADER" "ad" "ac_cv_member_HEADER_ad" "#include <arpa/nameser.h>
-"
-if test "x$ac_cv_member_HEADER_ad" = xyes; then :
-
-$as_echo "#define HAVE_HEADER_AD 1" >>confdefs.h
-
-fi
-
-
-fi
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if struct __res_state _res is an extern" >&5
-$as_echo_n "checking if struct __res_state _res is an extern... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <stdio.h>
-#if HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-#include <netinet/in.h>
-#include <arpa/nameser.h>
-#include <resolv.h>
-extern struct __res_state _res;
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-
-$as_echo "#define HAVE__RES_EXTERN 1" >>confdefs.h
-
-
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-
-# Check whether user wants SELinux support
-SELINUX_MSG="no"
-LIBSELINUX=""
-
-# Check whether --with-selinux was given.
-if test "${with_selinux+set}" = set; then :
- withval=$with_selinux; if test "x$withval" != "xno" ; then
- save_LIBS="$LIBS"
-
-$as_echo "#define WITH_SELINUX 1" >>confdefs.h
-
- SELINUX_MSG="yes"
- ac_fn_c_check_header_mongrel "$LINENO" "selinux/selinux.h" "ac_cv_header_selinux_selinux_h" "$ac_includes_default"
-if test "x$ac_cv_header_selinux_selinux_h" = xyes; then :
-
-else
- as_fn_error $? "SELinux support requires selinux.h header" "$LINENO" 5
-fi
-
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for setexeccon in -lselinux" >&5
-$as_echo_n "checking for setexeccon in -lselinux... " >&6; }
-if ${ac_cv_lib_selinux_setexeccon+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lselinux $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 setexeccon ();
-int
-main ()
-{
-return setexeccon ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_selinux_setexeccon=yes
-else
- ac_cv_lib_selinux_setexeccon=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_selinux_setexeccon" >&5
-$as_echo "$ac_cv_lib_selinux_setexeccon" >&6; }
-if test "x$ac_cv_lib_selinux_setexeccon" = xyes; then :
- LIBSELINUX="-lselinux"
- LIBS="$LIBS -lselinux"
-
-else
- as_fn_error $? "SELinux support requires libselinux library" "$LINENO" 5
-fi
-
- SSHLIBS="$SSHLIBS $LIBSELINUX"
- SSHDLIBS="$SSHDLIBS $LIBSELINUX"
- for ac_func in getseuserbyname get_default_context_with_level
-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
-
- LIBS="$save_LIBS"
- fi
-
-fi
-
-
-
-
-# Check whether user wants Kerberos 5 support
-KRB5_MSG="no"
-
-# Check whether --with-kerberos5 was given.
-if test "${with_kerberos5+set}" = set; then :
- withval=$with_kerberos5; if test "x$withval" != "xno" ; then
- if test "x$withval" = "xyes" ; then
- KRB5ROOT="/usr/local"
- else
- KRB5ROOT=${withval}
- fi
-
-
-$as_echo "#define KRB5 1" >>confdefs.h
-
- KRB5_MSG="yes"
-
- # Extract the first word of "krb5-config", so it can be a program name with args.
-set dummy krb5-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_KRB5CONF+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- case $KRB5CONF in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_KRB5CONF="$KRB5CONF" # Let the user override the test with a path.
- ;;
- *)
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-as_dummy="$KRB5ROOT/bin:$PATH"
-for as_dir in $as_dummy
-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_KRB5CONF="$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
-
- test -z "$ac_cv_path_KRB5CONF" && ac_cv_path_KRB5CONF="$KRB5ROOT/bin/krb5-config"
- ;;
-esac
-fi
-KRB5CONF=$ac_cv_path_KRB5CONF
-if test -n "$KRB5CONF"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $KRB5CONF" >&5
-$as_echo "$KRB5CONF" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- if test -x $KRB5CONF ; then
- K5CFLAGS="`$KRB5CONF --cflags`"
- K5LIBS="`$KRB5CONF --libs`"
- CPPFLAGS="$CPPFLAGS $K5CFLAGS"
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gssapi support" >&5
-$as_echo_n "checking for gssapi support... " >&6; }
- if $KRB5CONF | grep gssapi >/dev/null ; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-
-$as_echo "#define GSSAPI 1" >>confdefs.h
-
- GSSCFLAGS="`$KRB5CONF --cflags gssapi`"
- GSSLIBS="`$KRB5CONF --libs gssapi`"
- CPPFLAGS="$CPPFLAGS $GSSCFLAGS"
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using Heimdal" >&5
-$as_echo_n "checking whether we are using Heimdal... " >&6; }
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
- #include <krb5.h>
-
-int
-main ()
-{
- char *tmp = heimdal_version;
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-
-$as_echo "#define HEIMDAL 1" >>confdefs.h
-
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- else
- CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include"
- LDFLAGS="$LDFLAGS -L${KRB5ROOT}/lib"
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using Heimdal" >&5
-$as_echo_n "checking whether we are using Heimdal... " >&6; }
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
- #include <krb5.h>
-
-int
-main ()
-{
- char *tmp = heimdal_version;
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
- $as_echo "#define HEIMDAL 1" >>confdefs.h
-
- K5LIBS="-lkrb5"
- K5LIBS="$K5LIBS -lcom_err -lasn1"
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for net_write in -lroken" >&5
-$as_echo_n "checking for net_write in -lroken... " >&6; }
-if ${ac_cv_lib_roken_net_write+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lroken $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 net_write ();
-int
-main ()
-{
-return net_write ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_roken_net_write=yes
-else
- ac_cv_lib_roken_net_write=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_roken_net_write" >&5
-$as_echo "$ac_cv_lib_roken_net_write" >&6; }
-if test "x$ac_cv_lib_roken_net_write" = xyes; then :
- K5LIBS="$K5LIBS -lroken"
-fi
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for des_cbc_encrypt in -ldes" >&5
-$as_echo_n "checking for des_cbc_encrypt in -ldes... " >&6; }
-if ${ac_cv_lib_des_des_cbc_encrypt+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldes $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 des_cbc_encrypt ();
-int
-main ()
-{
-return des_cbc_encrypt ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_des_des_cbc_encrypt=yes
-else
- ac_cv_lib_des_des_cbc_encrypt=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_des_des_cbc_encrypt" >&5
-$as_echo "$ac_cv_lib_des_des_cbc_encrypt" >&6; }
-if test "x$ac_cv_lib_des_des_cbc_encrypt" = xyes; then :
- K5LIBS="$K5LIBS -ldes"
-fi
-
-
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- K5LIBS="-lkrb5 -lk5crypto -lcom_err"
-
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing dn_expand" >&5
-$as_echo_n "checking for library containing dn_expand... " >&6; }
-if ${ac_cv_search_dn_expand+:} 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 dn_expand ();
-int
-main ()
-{
-return dn_expand ();
- ;
- return 0;
-}
-_ACEOF
-for ac_lib in '' resolv; 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_dn_expand=$ac_res
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext
- if ${ac_cv_search_dn_expand+:} false; then :
- break
-fi
-done
-if ${ac_cv_search_dn_expand+:} false; then :
-
-else
- ac_cv_search_dn_expand=no
-fi
-rm conftest.$ac_ext
-LIBS=$ac_func_search_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_dn_expand" >&5
-$as_echo "$ac_cv_search_dn_expand" >&6; }
-ac_res=$ac_cv_search_dn_expand
-if test "$ac_res" != no; then :
- test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
-
-fi
-
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gss_init_sec_context in -lgssapi_krb5" >&5
-$as_echo_n "checking for gss_init_sec_context in -lgssapi_krb5... " >&6; }
-if ${ac_cv_lib_gssapi_krb5_gss_init_sec_context+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lgssapi_krb5 $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 gss_init_sec_context ();
-int
-main ()
-{
-return gss_init_sec_context ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_gssapi_krb5_gss_init_sec_context=yes
-else
- ac_cv_lib_gssapi_krb5_gss_init_sec_context=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_gssapi_krb5_gss_init_sec_context" >&5
-$as_echo "$ac_cv_lib_gssapi_krb5_gss_init_sec_context" >&6; }
-if test "x$ac_cv_lib_gssapi_krb5_gss_init_sec_context" = xyes; then :
- $as_echo "#define GSSAPI 1" >>confdefs.h
-
- GSSLIBS="-lgssapi_krb5"
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gss_init_sec_context in -lgssapi" >&5
-$as_echo_n "checking for gss_init_sec_context in -lgssapi... " >&6; }
-if ${ac_cv_lib_gssapi_gss_init_sec_context+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lgssapi $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 gss_init_sec_context ();
-int
-main ()
-{
-return gss_init_sec_context ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_gssapi_gss_init_sec_context=yes
-else
- ac_cv_lib_gssapi_gss_init_sec_context=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_gssapi_gss_init_sec_context" >&5
-$as_echo "$ac_cv_lib_gssapi_gss_init_sec_context" >&6; }
-if test "x$ac_cv_lib_gssapi_gss_init_sec_context" = xyes; then :
- $as_echo "#define GSSAPI 1" >>confdefs.h
-
- GSSLIBS="-lgssapi"
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gss_init_sec_context in -lgss" >&5
-$as_echo_n "checking for gss_init_sec_context in -lgss... " >&6; }
-if ${ac_cv_lib_gss_gss_init_sec_context+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lgss $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 gss_init_sec_context ();
-int
-main ()
-{
-return gss_init_sec_context ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_gss_gss_init_sec_context=yes
-else
- ac_cv_lib_gss_gss_init_sec_context=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_gss_gss_init_sec_context" >&5
-$as_echo "$ac_cv_lib_gss_gss_init_sec_context" >&6; }
-if test "x$ac_cv_lib_gss_gss_init_sec_context" = xyes; then :
- $as_echo "#define GSSAPI 1" >>confdefs.h
-
- GSSLIBS="-lgss"
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Cannot find any suitable gss-api library - build may fail" >&5
-$as_echo "$as_me: WARNING: Cannot find any suitable gss-api library - build may fail" >&2;}
-fi
-
-
-fi
-
-
-fi
-
-
- ac_fn_c_check_header_mongrel "$LINENO" "gssapi.h" "ac_cv_header_gssapi_h" "$ac_includes_default"
-if test "x$ac_cv_header_gssapi_h" = xyes; then :
-
-else
- unset ac_cv_header_gssapi_h
- CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi"
- for ac_header in gssapi.h
-do :
- ac_fn_c_check_header_mongrel "$LINENO" "gssapi.h" "ac_cv_header_gssapi_h" "$ac_includes_default"
-if test "x$ac_cv_header_gssapi_h" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_GSSAPI_H 1
-_ACEOF
-
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Cannot find any suitable gss-api header - build may fail" >&5
-$as_echo "$as_me: WARNING: Cannot find any suitable gss-api header - build may fail" >&2;}
-
-fi
-
-done
-
-
-
-fi
-
-
-
- oldCPP="$CPPFLAGS"
- CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi"
- ac_fn_c_check_header_mongrel "$LINENO" "gssapi_krb5.h" "ac_cv_header_gssapi_krb5_h" "$ac_includes_default"
-if test "x$ac_cv_header_gssapi_krb5_h" = xyes; then :
-
-else
- CPPFLAGS="$oldCPP"
-fi
-
-
-
- fi
- if test ! -z "$need_dash_r" ; then
- LDFLAGS="$LDFLAGS -R${KRB5ROOT}/lib"
- fi
- if test ! -z "$blibpath" ; then
- blibpath="$blibpath:${KRB5ROOT}/lib"
- fi
-
- for ac_header in gssapi.h gssapi/gssapi.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_header in gssapi_krb5.h gssapi/gssapi_krb5.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_header in gssapi_generic.h gssapi/gssapi_generic.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
-
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing k_hasafs" >&5
-$as_echo_n "checking for library containing k_hasafs... " >&6; }
-if ${ac_cv_search_k_hasafs+:} 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 k_hasafs ();
-int
-main ()
-{
-return k_hasafs ();
- ;
- return 0;
-}
-_ACEOF
-for ac_lib in '' kafs; 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_k_hasafs=$ac_res
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext
- if ${ac_cv_search_k_hasafs+:} false; then :
- break
-fi
-done
-if ${ac_cv_search_k_hasafs+:} false; then :
-
-else
- ac_cv_search_k_hasafs=no
-fi
-rm conftest.$ac_ext
-LIBS=$ac_func_search_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_k_hasafs" >&5
-$as_echo "$ac_cv_search_k_hasafs" >&6; }
-ac_res=$ac_cv_search_k_hasafs
-if test "$ac_res" != no; then :
- test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
-
-$as_echo "#define USE_AFS 1" >>confdefs.h
-
-fi
-
-
- ac_fn_c_check_decl "$LINENO" "GSS_C_NT_HOSTBASED_SERVICE" "ac_cv_have_decl_GSS_C_NT_HOSTBASED_SERVICE" "
-#ifdef HAVE_GSSAPI_H
-# include <gssapi.h>
-#elif defined(HAVE_GSSAPI_GSSAPI_H)
-# include <gssapi/gssapi.h>
-#endif
-
-#ifdef HAVE_GSSAPI_GENERIC_H
-# include <gssapi_generic.h>
-#elif defined(HAVE_GSSAPI_GSSAPI_GENERIC_H)
-# include <gssapi/gssapi_generic.h>
-#endif
-
-"
-if test "x$ac_cv_have_decl_GSS_C_NT_HOSTBASED_SERVICE" = xyes; then :
- ac_have_decl=1
-else
- ac_have_decl=0
-fi
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_GSS_C_NT_HOSTBASED_SERVICE $ac_have_decl
-_ACEOF
-
- saved_LIBS="$LIBS"
- LIBS="$LIBS $K5LIBS"
- for ac_func in krb5_cc_new_unique krb5_get_error_message krb5_free_error_message
-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
-
- LIBS="$saved_LIBS"
-
- fi
-
-
-fi
-
-
-
-
-# Looking for programs, paths and files
-
-PRIVSEP_PATH=/var/empty
-
-# Check whether --with-privsep-path was given.
-if test "${with_privsep_path+set}" = set; then :
- withval=$with_privsep_path;
- if test -n "$withval" && test "x$withval" != "xno" && \
- test "x${withval}" != "xyes"; then
- PRIVSEP_PATH=$withval
- fi
-
-
-fi
-
-
-
-
-# Check whether --with-xauth was given.
-if test "${with_xauth+set}" = set; then :
- withval=$with_xauth;
- if test -n "$withval" && test "x$withval" != "xno" && \
- test "x${withval}" != "xyes"; then
- xauth_path=$withval
- fi
-
-else
-
- TestPath="$PATH"
- TestPath="${TestPath}${PATH_SEPARATOR}/usr/X/bin"
- TestPath="${TestPath}${PATH_SEPARATOR}/usr/bin/X11"
- TestPath="${TestPath}${PATH_SEPARATOR}/usr/X11R6/bin"
- TestPath="${TestPath}${PATH_SEPARATOR}/usr/openwin/bin"
- # Extract the first word of "xauth", so it can be a program name with args.
-set dummy xauth; 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_xauth_path+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- case $xauth_path in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_xauth_path="$xauth_path" # Let the user override the test with a path.
- ;;
- *)
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $TestPath
-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_xauth_path="$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
-xauth_path=$ac_cv_path_xauth_path
-if test -n "$xauth_path"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xauth_path" >&5
-$as_echo "$xauth_path" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
- xauth_path="/usr/openwin/bin/xauth"
- fi
-
-
-fi
-
-
-STRIP_OPT=-s
-# Check whether --enable-strip was given.
-if test "${enable_strip+set}" = set; then :
- enableval=$enable_strip;
- if test "x$enableval" = "xno" ; then
- STRIP_OPT=
- fi
-
-
-fi
-
-
-
-if test -z "$xauth_path" ; then
- XAUTH_PATH="undefined"
-
-else
-
-cat >>confdefs.h <<_ACEOF
-#define XAUTH_PATH "$xauth_path"
-_ACEOF
-
- XAUTH_PATH=$xauth_path
-
-fi
-
-# Check for mail directory
-
-# Check whether --with-maildir was given.
-if test "${with_maildir+set}" = set; then :
- withval=$with_maildir;
- if test "X$withval" != X && test "x$withval" != xno && \
- test "x${withval}" != xyes; then
-
-cat >>confdefs.h <<_ACEOF
-#define MAIL_DIRECTORY "$withval"
-_ACEOF
-
- fi
-
-else
-
- if test "X$maildir" != "X"; then
- cat >>confdefs.h <<_ACEOF
-#define MAIL_DIRECTORY "$maildir"
-_ACEOF
-
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking Discovering system mail directory" >&5
-$as_echo_n "checking Discovering system mail directory... " >&6; }
- if test "$cross_compiling" = yes; then :
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cross compiling: use --with-maildir=/path/to/mail" >&5
-$as_echo "$as_me: WARNING: cross compiling: use --with-maildir=/path/to/mail" >&2;}
-
-
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <stdio.h>
-#include <string.h>
-#ifdef HAVE_PATHS_H
-#include <paths.h>
-#endif
-#ifdef HAVE_MAILLOCK_H
-#include <maillock.h>
-#endif
-#define DATA "conftest.maildir"
-
-int
-main ()
-{
-
- FILE *fd;
- int rc;
-
- fd = fopen(DATA,"w");
- if(fd == NULL)
- exit(1);
-
-#if defined (_PATH_MAILDIR)
- if ((rc = fprintf(fd ,"_PATH_MAILDIR:%s\n", _PATH_MAILDIR)) <0)
- exit(1);
-#elif defined (MAILDIR)
- if ((rc = fprintf(fd ,"MAILDIR:%s\n", MAILDIR)) <0)
- exit(1);
-#elif defined (_PATH_MAIL)
- if ((rc = fprintf(fd ,"_PATH_MAIL:%s\n", _PATH_MAIL)) <0)
- exit(1);
-#else
- exit (2);
-#endif
-
- exit(0);
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-
- maildir_what=`awk -F: '{print $1}' conftest.maildir`
- maildir=`awk -F: '{print $2}' conftest.maildir \
- | sed 's|/$||'`
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: Using: $maildir from $maildir_what" >&5
-$as_echo "Using: $maildir from $maildir_what" >&6; }
- if test "x$maildir_what" != "x_PATH_MAILDIR"; then
- cat >>confdefs.h <<_ACEOF
-#define MAIL_DIRECTORY "$maildir"
-_ACEOF
-
- fi
-
-else
-
- if test "X$ac_status" = "X2";then
-# our test program didn't find it. Default to /var/spool/mail
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: Using: default value of /var/spool/mail" >&5
-$as_echo "Using: default value of /var/spool/mail" >&6; }
- cat >>confdefs.h <<_ACEOF
-#define MAIL_DIRECTORY "/var/spool/mail"
-_ACEOF
-
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: *** not found ***" >&5
-$as_echo "*** not found ***" >&6; }
- fi
-
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
- fi
-
-
-fi
- # maildir
-
-if test ! -z "$cross_compiling" && test "x$cross_compiling" = "xyes"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cross compiling: Disabling /dev/ptmx test" >&5
-$as_echo "$as_me: WARNING: cross compiling: Disabling /dev/ptmx test" >&2;}
- disable_ptmx_check=yes
-fi
-if test -z "$no_dev_ptmx" ; then
- if test "x$disable_ptmx_check" != "xyes" ; then
- as_ac_File=`$as_echo "ac_cv_file_"/dev/ptmx"" | $as_tr_sh`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for \"/dev/ptmx\"" >&5
-$as_echo_n "checking for \"/dev/ptmx\"... " >&6; }
-if eval \${$as_ac_File+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- test "$cross_compiling" = yes &&
- as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5
-if test -r ""/dev/ptmx""; then
- eval "$as_ac_File=yes"
-else
- eval "$as_ac_File=no"
-fi
-fi
-eval ac_res=\$$as_ac_File
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-if eval test \"x\$"$as_ac_File"\" = x"yes"; then :
-
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DEV_PTMX 1
-_ACEOF
-
- have_dev_ptmx=1
-
-
-fi
-
- fi
-fi
-
-if test ! -z "$cross_compiling" && test "x$cross_compiling" != "xyes"; then
- as_ac_File=`$as_echo "ac_cv_file_"/dev/ptc"" | $as_tr_sh`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for \"/dev/ptc\"" >&5
-$as_echo_n "checking for \"/dev/ptc\"... " >&6; }
-if eval \${$as_ac_File+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- test "$cross_compiling" = yes &&
- as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5
-if test -r ""/dev/ptc""; then
- eval "$as_ac_File=yes"
-else
- eval "$as_ac_File=no"
-fi
-fi
-eval ac_res=\$$as_ac_File
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-if eval test \"x\$"$as_ac_File"\" = x"yes"; then :
-
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DEV_PTS_AND_PTC 1
-_ACEOF
-
- have_dev_ptc=1
-
-
-fi
-
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cross compiling: Disabling /dev/ptc test" >&5
-$as_echo "$as_me: WARNING: cross compiling: Disabling /dev/ptc test" >&2;}
-fi
-
-# Options from here on. Some of these are preset by platform above
-
-# Check whether --with-mantype was given.
-if test "${with_mantype+set}" = set; then :
- withval=$with_mantype;
- case "$withval" in
- man|cat|doc)
- MANTYPE=$withval
- ;;
- *)
- as_fn_error $? "invalid man type: $withval" "$LINENO" 5
- ;;
- esac
-
-
-fi
-
-if test -z "$MANTYPE"; then
- TestPath="/usr/bin${PATH_SEPARATOR}/usr/ucb"
- for ac_prog in nroff awf
-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_path_NROFF+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- case $NROFF in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_NROFF="$NROFF" # Let the user override the test with a path.
- ;;
- *)
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $TestPath
-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_NROFF="$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
-NROFF=$ac_cv_path_NROFF
-if test -n "$NROFF"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NROFF" >&5
-$as_echo "$NROFF" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- test -n "$NROFF" && break
-done
-test -n "$NROFF" || NROFF="/bin/false"
-
- if ${NROFF} -mdoc ${srcdir}/ssh.1 >/dev/null 2>&1; then
- MANTYPE=doc
- elif ${NROFF} -man ${srcdir}/ssh.1 >/dev/null 2>&1; then
- MANTYPE=man
- else
- MANTYPE=cat
- fi
-fi
-
-if test "$MANTYPE" = "doc"; then
- mansubdir=man;
-else
- mansubdir=$MANTYPE;
-fi
-
-
-# Check whether to enable MD5 passwords
-MD5_MSG="no"
-
-# Check whether --with-md5-passwords was given.
-if test "${with_md5_passwords+set}" = set; then :
- withval=$with_md5_passwords;
- if test "x$withval" != "xno" ; then
-
-$as_echo "#define HAVE_MD5_PASSWORDS 1" >>confdefs.h
-
- MD5_MSG="yes"
- fi
-
-
-fi
-
-
-# Whether to disable shadow password support
-
-# Check whether --with-shadow was given.
-if test "${with_shadow+set}" = set; then :
- withval=$with_shadow;
- if test "x$withval" = "xno" ; then
- $as_echo "#define DISABLE_SHADOW 1" >>confdefs.h
-
- disable_shadow=yes
- fi
-
-
-fi
-
-
-if test -z "$disable_shadow" ; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the systems has expire shadow information" >&5
-$as_echo_n "checking if the systems has expire shadow information... " >&6; }
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <sys/types.h>
-#include <shadow.h>
-struct spwd sp;
-
-int
-main ()
-{
- sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0;
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- sp_expire_available=yes
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
- if test "x$sp_expire_available" = "xyes" ; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-
-$as_echo "#define HAS_SHADOW_EXPIRE 1" >>confdefs.h
-
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- fi
-fi
-
-# Use ip address instead of hostname in $DISPLAY
-if test ! -z "$IPADDR_IN_DISPLAY" ; then
- DISPLAY_HACK_MSG="yes"
-
-$as_echo "#define IPADDR_IN_DISPLAY 1" >>confdefs.h
-
-else
- DISPLAY_HACK_MSG="no"
-
-# Check whether --with-ipaddr-display was given.
-if test "${with_ipaddr_display+set}" = set; then :
- withval=$with_ipaddr_display;
- if test "x$withval" != "xno" ; then
- $as_echo "#define IPADDR_IN_DISPLAY 1" >>confdefs.h
-
- DISPLAY_HACK_MSG="yes"
- fi
-
-
-fi
-
-fi
-
-# check for /etc/default/login and use it if present.
-# Check whether --enable-etc-default-login was given.
-if test "${enable_etc_default_login+set}" = set; then :
- enableval=$enable_etc_default_login; if test "x$enableval" = "xno"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: /etc/default/login handling disabled" >&5
-$as_echo "$as_me: /etc/default/login handling disabled" >&6;}
- etc_default_login=no
- else
- etc_default_login=yes
- fi
-else
- if test ! -z "$cross_compiling" && test "x$cross_compiling" = "xyes";
- then
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cross compiling: not checking /etc/default/login" >&5
-$as_echo "$as_me: WARNING: cross compiling: not checking /etc/default/login" >&2;}
- etc_default_login=no
- else
- etc_default_login=yes
- fi
-
-fi
-
-
-if test "x$etc_default_login" != "xno"; then
- as_ac_File=`$as_echo "ac_cv_file_"/etc/default/login"" | $as_tr_sh`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for \"/etc/default/login\"" >&5
-$as_echo_n "checking for \"/etc/default/login\"... " >&6; }
-if eval \${$as_ac_File+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- test "$cross_compiling" = yes &&
- as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5
-if test -r ""/etc/default/login""; then
- eval "$as_ac_File=yes"
-else
- eval "$as_ac_File=no"
-fi
-fi
-eval ac_res=\$$as_ac_File
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-if eval test \"x\$"$as_ac_File"\" = x"yes"; then :
- external_path_file=/etc/default/login
-fi
-
- if test "x$external_path_file" = "x/etc/default/login"; then
-
-$as_echo "#define HAVE_ETC_DEFAULT_LOGIN 1" >>confdefs.h
-
- fi
-fi
-
-if test $ac_cv_func_login_getcapbool = "yes" && \
- test $ac_cv_header_login_cap_h = "yes" ; then
- external_path_file=/etc/login.conf
-fi
-
-# Whether to mess with the default path
-SERVER_PATH_MSG="(default)"
-
-# Check whether --with-default-path was given.
-if test "${with_default_path+set}" = set; then :
- withval=$with_default_path;
- if test "x$external_path_file" = "x/etc/login.conf" ; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
---with-default-path=PATH has no effect on this system.
-Edit /etc/login.conf instead." >&5
-$as_echo "$as_me: WARNING:
---with-default-path=PATH has no effect on this system.
-Edit /etc/login.conf instead." >&2;}
- elif test "x$withval" != "xno" ; then
- if test ! -z "$external_path_file" ; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
---with-default-path=PATH will only be used if PATH is not defined in
-$external_path_file ." >&5
-$as_echo "$as_me: WARNING:
---with-default-path=PATH will only be used if PATH is not defined in
-$external_path_file ." >&2;}
- fi
- user_path="$withval"
- SERVER_PATH_MSG="$withval"
- fi
-
-else
- if test "x$external_path_file" = "x/etc/login.conf" ; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Make sure the path to scp is in /etc/login.conf" >&5
-$as_echo "$as_me: WARNING: Make sure the path to scp is in /etc/login.conf" >&2;}
- else
- if test ! -z "$external_path_file" ; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
-If PATH is defined in $external_path_file, ensure the path to scp is included,
-otherwise scp will not work." >&5
-$as_echo "$as_me: WARNING:
-If PATH is defined in $external_path_file, ensure the path to scp is included,
-otherwise scp will not work." >&2;}
- fi
- if test "$cross_compiling" = yes; then :
- user_path="/usr/bin:/bin:/usr/sbin:/sbin"
-
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-/* find out what STDPATH is */
-#include <stdio.h>
-#ifdef HAVE_PATHS_H
-# include <paths.h>
-#endif
-#ifndef _PATH_STDPATH
-# ifdef _PATH_USERPATH /* Irix */
-# define _PATH_STDPATH _PATH_USERPATH
-# else
-# define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
-# endif
-#endif
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#define DATA "conftest.stdpath"
-
-int
-main ()
-{
-
- FILE *fd;
- int rc;
-
- fd = fopen(DATA,"w");
- if(fd == NULL)
- exit(1);
-
- if ((rc = fprintf(fd,"%s", _PATH_STDPATH)) < 0)
- exit(1);
-
- exit(0);
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
- user_path=`cat conftest.stdpath`
-else
- user_path="/usr/bin:/bin:/usr/sbin:/sbin"
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-# make sure $bindir is in USER_PATH so scp will work
- t_bindir="${bindir}"
- while echo "${t_bindir}" | egrep '\$\{|NONE/' >/dev/null 2>&1; do
- t_bindir=`eval echo ${t_bindir}`
- case $t_bindir in
- NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$prefix~"` ;;
- esac
- case $t_bindir in
- NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$ac_default_prefix~"` ;;
- esac
- done
- echo $user_path | grep ":$t_bindir" > /dev/null 2>&1
- if test $? -ne 0 ; then
- echo $user_path | grep "^$t_bindir" > /dev/null 2>&1
- if test $? -ne 0 ; then
- user_path=$user_path:$t_bindir
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: Adding $t_bindir to USER_PATH so scp will work" >&5
-$as_echo "Adding $t_bindir to USER_PATH so scp will work" >&6; }
- fi
- fi
- fi
-
-fi
-
-if test "x$external_path_file" != "x/etc/login.conf" ; then
-
-cat >>confdefs.h <<_ACEOF
-#define USER_PATH "$user_path"
-_ACEOF
-
-
-fi
-
-# Set superuser path separately to user path
-
-# Check whether --with-superuser-path was given.
-if test "${with_superuser_path+set}" = set; then :
- withval=$with_superuser_path;
- if test -n "$withval" && test "x$withval" != "xno" && \
- test "x${withval}" != "xyes"; then
-
-cat >>confdefs.h <<_ACEOF
-#define SUPERUSER_PATH "$withval"
-_ACEOF
-
- superuser_path=$withval
- fi
-
-
-fi
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we need to convert IPv4 in IPv6-mapped addresses" >&5
-$as_echo_n "checking if we need to convert IPv4 in IPv6-mapped addresses... " >&6; }
-IPV4_IN6_HACK_MSG="no"
-
-# Check whether --with-4in6 was given.
-if test "${with_4in6+set}" = set; then :
- withval=$with_4in6;
- if test "x$withval" != "xno" ; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-
-$as_echo "#define IPV4_IN_IPV6 1" >>confdefs.h
-
- IPV4_IN6_HACK_MSG="yes"
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- fi
-
-else
-
- if test "x$inet6_default_4in6" = "xyes"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (default)" >&5
-$as_echo "yes (default)" >&6; }
- $as_echo "#define IPV4_IN_IPV6 1" >>confdefs.h
-
- IPV4_IN6_HACK_MSG="yes"
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no (default)" >&5
-$as_echo "no (default)" >&6; }
- fi
-
-
-fi
-
-
-# Whether to enable BSD auth support
-BSD_AUTH_MSG=no
-
-# Check whether --with-bsd-auth was given.
-if test "${with_bsd_auth+set}" = set; then :
- withval=$with_bsd_auth;
- if test "x$withval" != "xno" ; then
-
-$as_echo "#define BSD_AUTH 1" >>confdefs.h
-
- BSD_AUTH_MSG=yes
- fi
-
-
-fi
-
-
-# Where to place sshd.pid
-piddir=/var/run
-# make sure the directory exists
-if test ! -d $piddir ; then
- piddir=`eval echo ${sysconfdir}`
- case $piddir in
- NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
- esac
-fi
-
-
-# Check whether --with-pid-dir was given.
-if test "${with_pid_dir+set}" = set; then :
- withval=$with_pid_dir;
- if test -n "$withval" && test "x$withval" != "xno" && \
- test "x${withval}" != "xyes"; then
- piddir=$withval
- if test ! -d $piddir ; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ** no $piddir directory on this system **" >&5
-$as_echo "$as_me: WARNING: ** no $piddir directory on this system **" >&2;}
- fi
- fi
-
-
-fi
-
-
-
-cat >>confdefs.h <<_ACEOF
-#define _PATH_SSH_PIDDIR "$piddir"
-_ACEOF
-
-
-
-# Check whether --enable-lastlog was given.
-if test "${enable_lastlog+set}" = set; then :
- enableval=$enable_lastlog;
- if test "x$enableval" = "xno" ; then
- $as_echo "#define DISABLE_LASTLOG 1" >>confdefs.h
-
- fi
-
-
-fi
-
-# Check whether --enable-utmp was given.
-if test "${enable_utmp+set}" = set; then :
- enableval=$enable_utmp;
- if test "x$enableval" = "xno" ; then
- $as_echo "#define DISABLE_UTMP 1" >>confdefs.h
-
- fi
-
-
-fi
-
-# Check whether --enable-utmpx was given.
-if test "${enable_utmpx+set}" = set; then :
- enableval=$enable_utmpx;
- if test "x$enableval" = "xno" ; then
-
-$as_echo "#define DISABLE_UTMPX 1" >>confdefs.h
-
- fi
-
-
-fi
-
-# Check whether --enable-wtmp was given.
-if test "${enable_wtmp+set}" = set; then :
- enableval=$enable_wtmp;
- if test "x$enableval" = "xno" ; then
- $as_echo "#define DISABLE_WTMP 1" >>confdefs.h
-
- fi
-
-
-fi
-
-# Check whether --enable-wtmpx was given.
-if test "${enable_wtmpx+set}" = set; then :
- enableval=$enable_wtmpx;
- if test "x$enableval" = "xno" ; then
-
-$as_echo "#define DISABLE_WTMPX 1" >>confdefs.h
-
- fi
-
-
-fi
-
-# Check whether --enable-libutil was given.
-if test "${enable_libutil+set}" = set; then :
- enableval=$enable_libutil;
- if test "x$enableval" = "xno" ; then
- $as_echo "#define DISABLE_LOGIN 1" >>confdefs.h
-
- fi
-
-
-fi
-
-# Check whether --enable-pututline was given.
-if test "${enable_pututline+set}" = set; then :
- enableval=$enable_pututline;
- if test "x$enableval" = "xno" ; then
-
-$as_echo "#define DISABLE_PUTUTLINE 1" >>confdefs.h
-
- fi
-
-
-fi
-
-# Check whether --enable-pututxline was given.
-if test "${enable_pututxline+set}" = set; then :
- enableval=$enable_pututxline;
- if test "x$enableval" = "xno" ; then
-
-$as_echo "#define DISABLE_PUTUTXLINE 1" >>confdefs.h
-
- fi
-
-
-fi
-
-
-# Check whether --with-lastlog was given.
-if test "${with_lastlog+set}" = set; then :
- withval=$with_lastlog;
- if test "x$withval" = "xno" ; then
- $as_echo "#define DISABLE_LASTLOG 1" >>confdefs.h
-
- elif test -n "$withval" && test "x${withval}" != "xyes"; then
- conf_lastlog_location=$withval
- fi
-
-
-fi
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if your system defines LASTLOG_FILE" >&5
-$as_echo_n "checking if your system defines LASTLOG_FILE... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <sys/types.h>
-#include <utmp.h>
-#ifdef HAVE_LASTLOG_H
-# include <lastlog.h>
-#endif
-#ifdef HAVE_PATHS_H
-# include <paths.h>
-#endif
-#ifdef HAVE_LOGIN_H
-# include <login.h>
-#endif
-
-int
-main ()
-{
- char *lastlog = LASTLOG_FILE;
- ;
- return 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 "$as_me:${as_lineno-$LINENO}: checking if your system defines _PATH_LASTLOG" >&5
-$as_echo_n "checking if your system defines _PATH_LASTLOG... " >&6; }
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <sys/types.h>
-#include <utmp.h>
-#ifdef HAVE_LASTLOG_H
-# include <lastlog.h>
-#endif
-#ifdef HAVE_PATHS_H
-# include <paths.h>
-#endif
-
-int
-main ()
-{
- char *lastlog = _PATH_LASTLOG;
- ;
- return 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; }
- system_lastlog_path=no
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-if test -z "$conf_lastlog_location"; then
- if test x"$system_lastlog_path" = x"no" ; then
- for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
- if (test -d "$f" || test -f "$f") ; then
- conf_lastlog_location=$f
- fi
- done
- if test -z "$conf_lastlog_location"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ** Cannot find lastlog **" >&5
-$as_echo "$as_me: WARNING: ** Cannot find lastlog **" >&2;}
- fi
- fi
-fi
-
-if test -n "$conf_lastlog_location"; then
-
-cat >>confdefs.h <<_ACEOF
-#define CONF_LASTLOG_FILE "$conf_lastlog_location"
-_ACEOF
-
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if your system defines UTMP_FILE" >&5
-$as_echo_n "checking if your system defines UTMP_FILE... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <sys/types.h>
-#include <utmp.h>
-#ifdef HAVE_PATHS_H
-# include <paths.h>
-#endif
-
-int
-main ()
-{
- char *utmp = UTMP_FILE;
- ;
- return 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; }
- system_utmp_path=no
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-if test -z "$conf_utmp_location"; then
- if test x"$system_utmp_path" = x"no" ; then
- for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
- if test -f $f ; then
- conf_utmp_location=$f
- fi
- done
- if test -z "$conf_utmp_location"; then
- $as_echo "#define DISABLE_UTMP 1" >>confdefs.h
-
- fi
- fi
-fi
-if test -n "$conf_utmp_location"; then
-
-cat >>confdefs.h <<_ACEOF
-#define CONF_UTMP_FILE "$conf_utmp_location"
-_ACEOF
-
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if your system defines WTMP_FILE" >&5
-$as_echo_n "checking if your system defines WTMP_FILE... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <sys/types.h>
-#include <utmp.h>
-#ifdef HAVE_PATHS_H
-# include <paths.h>
-#endif
-
-int
-main ()
-{
- char *wtmp = WTMP_FILE;
- ;
- return 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; }
- system_wtmp_path=no
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-if test -z "$conf_wtmp_location"; then
- if test x"$system_wtmp_path" = x"no" ; then
- for f in /usr/adm/wtmp /var/log/wtmp; do
- if test -f $f ; then
- conf_wtmp_location=$f
- fi
- done
- if test -z "$conf_wtmp_location"; then
- $as_echo "#define DISABLE_WTMP 1" >>confdefs.h
-
- fi
- fi
-fi
-if test -n "$conf_wtmp_location"; then
-
-cat >>confdefs.h <<_ACEOF
-#define CONF_WTMP_FILE "$conf_wtmp_location"
-_ACEOF
-
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if your system defines WTMPX_FILE" >&5
-$as_echo_n "checking if your system defines WTMPX_FILE... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <sys/types.h>
-#include <utmp.h>
-#ifdef HAVE_UTMPX_H
-#include <utmpx.h>
-#endif
-#ifdef HAVE_PATHS_H
-# include <paths.h>
-#endif
-
-int
-main ()
-{
- char *wtmpx = WTMPX_FILE;
- ;
- return 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; }
- system_wtmpx_path=no
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-if test -z "$conf_wtmpx_location"; then
- if test x"$system_wtmpx_path" = x"no" ; then
- $as_echo "#define DISABLE_WTMPX 1" >>confdefs.h
-
- fi
-else
-
-cat >>confdefs.h <<_ACEOF
-#define CONF_WTMPX_FILE "$conf_wtmpx_location"
-_ACEOF
-
-fi
-
-
-if test ! -z "$blibpath" ; then
- LDFLAGS="$LDFLAGS $blibflags$blibpath"
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Please check and edit blibpath in LDFLAGS in Makefile" >&5
-$as_echo "$as_me: WARNING: Please check and edit blibpath in LDFLAGS in Makefile" >&2;}
-fi
-
-ac_fn_c_check_member "$LINENO" "struct lastlog" "ll_line" "ac_cv_member_struct_lastlog_ll_line" "
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#ifdef HAVE_UTMP_H
-#include <utmp.h>
-#endif
-#ifdef HAVE_UTMPX_H
-#include <utmpx.h>
-#endif
-#ifdef HAVE_LASTLOG_H
-#include <lastlog.h>
-#endif
-
-"
-if test "x$ac_cv_member_struct_lastlog_ll_line" = xyes; then :
-
-else
-
- if test x$SKIP_DISABLE_LASTLOG_DEFINE != "xyes" ; then
- $as_echo "#define DISABLE_LASTLOG 1" >>confdefs.h
-
- fi
-
-fi
-
-
-ac_fn_c_check_member "$LINENO" "struct utmp" "ut_line" "ac_cv_member_struct_utmp_ut_line" "
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#ifdef HAVE_UTMP_H
-#include <utmp.h>
-#endif
-#ifdef HAVE_UTMPX_H
-#include <utmpx.h>
-#endif
-#ifdef HAVE_LASTLOG_H
-#include <lastlog.h>
-#endif
-
-"
-if test "x$ac_cv_member_struct_utmp_ut_line" = xyes; then :
-
-else
-
- $as_echo "#define DISABLE_UTMP 1" >>confdefs.h
-
- $as_echo "#define DISABLE_WTMP 1" >>confdefs.h
-
-
-fi
-
-
-CFLAGS="$CFLAGS $werror_flags"
-
-if test "x$ac_cv_func_getaddrinfo" != "xyes" ; then
- TEST_SSH_IPV6=no
-else
- TEST_SSH_IPV6=yes
-fi
-ac_fn_c_check_decl "$LINENO" "BROKEN_GETADDRINFO" "ac_cv_have_decl_BROKEN_GETADDRINFO" "$ac_includes_default"
-if test "x$ac_cv_have_decl_BROKEN_GETADDRINFO" = xyes; then :
- TEST_SSH_IPV6=no
-fi
-
-TEST_SSH_IPV6=$TEST_SSH_IPV6
-
-TEST_MALLOC_OPTIONS=$TEST_MALLOC_OPTIONS
-
-UNSUPPORTED_ALGORITHMS=$unsupported_algorithms
-
-
-
-ac_config_files="$ac_config_files Makefile buildpkg.sh opensshd.init openssh.xml openbsd-compat/Makefile openbsd-compat/regress/Makefile survey.sh"
-
-cat >confcache <<\_ACEOF
-# This file is a shell script that caches the results of configure
-# tests run on this system so they can be shared between configure
-# scripts and configure runs, see configure's option --config-cache.
-# It is not useful on other systems. If it contains results you don't
-# want to keep, you may remove or edit it.
-#
-# config.status only pays attention to the cache file if you give it
-# the --recheck option to rerun configure.
-#
-# `ac_cv_env_foo' variables (set or unset) will be overridden when
-# loading this file, other *unset* `ac_cv_foo' will be assigned the
-# following values.
-
-_ACEOF
-
-# The following way of writing the cache mishandles newlines in values,
-# but we know of no workaround that is simple, portable, and efficient.
-# So, we kill variables containing newlines.
-# Ultrix sh set writes to stderr and can't be redirected directly,
-# and sets the high bit in the cache file unless we assign to the vars.
-(
- for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
- eval ac_val=\$$ac_var
- case $ac_val in #(
- *${as_nl}*)
- case $ac_var in #(
- *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
-$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
- esac
- case $ac_var in #(
- _ | IFS | as_nl) ;; #(
- BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
- *) { eval $ac_var=; unset $ac_var;} ;;
- esac ;;
- esac
- done
-
- (set) 2>&1 |
- case $as_nl`(ac_space=' '; set) 2>&1` in #(
- *${as_nl}ac_space=\ *)
- # `set' does not quote correctly, so add quotes: double-quote
- # substitution turns \\\\ into \\, and sed turns \\ into \.
- sed -n \
- "s/'/'\\\\''/g;
- s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
- ;; #(
- *)
- # `set' quotes correctly as required by POSIX, so do not add quotes.
- sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
- ;;
- esac |
- sort
-) |
- sed '
- /^ac_cv_env_/b end
- t clear
- :clear
- s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
- t end
- s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
- :end' >>confcache
-if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
- if test -w "$cache_file"; then
- if test "x$cache_file" != "x/dev/null"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
-$as_echo "$as_me: updating cache $cache_file" >&6;}
- if test ! -f "$cache_file" || test -h "$cache_file"; then
- cat confcache >"$cache_file"
- else
- case $cache_file in #(
- */* | ?:*)
- mv -f confcache "$cache_file"$$ &&
- mv -f "$cache_file"$$ "$cache_file" ;; #(
- *)
- mv -f confcache "$cache_file" ;;
- esac
- fi
- fi
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
-$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
- fi
-fi
-rm -f confcache
-
-test "x$prefix" = xNONE && prefix=$ac_default_prefix
-# Let make expand exec_prefix.
-test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
-
-DEFS=-DHAVE_CONFIG_H
-
-ac_libobjs=
-ac_ltlibobjs=
-U=
-for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
- # 1. Remove the extension, and $U if already installed.
- ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
- ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
- # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR
- # will be set to the directory where LIBOBJS objects are built.
- as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
- as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
-done
-LIBOBJS=$ac_libobjs
-
-LTLIBOBJS=$ac_ltlibobjs
-
-
-
-
-: "${CONFIG_STATUS=./config.status}"
-ac_write_fail=0
-ac_clean_files_save=$ac_clean_files
-ac_clean_files="$ac_clean_files $CONFIG_STATUS"
-{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
-$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
-as_write_fail=0
-cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
-#! $SHELL
-# Generated by $as_me.
-# Run this file to recreate the current configuration.
-# Compiler output produced by configure, useful for debugging
-# configure, is in config.log if it exists.
-
-debug=false
-ac_cs_recheck=false
-ac_cs_silent=false
-
-SHELL=\${CONFIG_SHELL-$SHELL}
-export SHELL
-_ASEOF
-cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
-## -------------------- ##
-## M4sh Initialization. ##
-## -------------------- ##
-
-# Be more Bourne compatible
-DUALCASE=1; export DUALCASE # for MKS sh
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
- emulate sh
- NULLCMD=:
- # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
- # is contrary to our usage. Disable this feature.
- alias -g '${1+"$@"}'='"$@"'
- setopt NO_GLOB_SUBST
-else
- case `(set -o) 2>/dev/null` in #(
- *posix*) :
- set -o posix ;; #(
- *) :
- ;;
-esac
-fi
-
-
-as_nl='
-'
-export as_nl
-# Printing a long string crashes Solaris 7 /usr/bin/printf.
-as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
-# Prefer a ksh shell builtin over an external printf program on Solaris,
-# but without wasting forks for bash or zsh.
-if test -z "$BASH_VERSION$ZSH_VERSION" \
- && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
- as_echo='print -r --'
- as_echo_n='print -rn --'
-elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
- as_echo='printf %s\n'
- as_echo_n='printf %s'
-else
- if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
- as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
- as_echo_n='/usr/ucb/echo -n'
- else
- as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
- as_echo_n_body='eval
- arg=$1;
- case $arg in #(
- *"$as_nl"*)
- expr "X$arg" : "X\\(.*\\)$as_nl";
- arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
- esac;
- expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
- '
- export as_echo_n_body
- as_echo_n='sh -c $as_echo_n_body as_echo'
- fi
- export as_echo_body
- as_echo='sh -c $as_echo_body as_echo'
-fi
-
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
- PATH_SEPARATOR=:
- (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
- (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
- PATH_SEPARATOR=';'
- }
-fi
-
-
-# IFS
-# We need space, tab and new line, in precisely that order. Quoting is
-# there to prevent editors from complaining about space-tab.
-# (If _AS_PATH_WALK were called with IFS unset, it would disable word
-# splitting by setting IFS to empty value.)
-IFS=" "" $as_nl"
-
-# Find who we are. Look in the path if we contain no directory separator.
-as_myself=
-case $0 in #((
- *[\\/]* ) as_myself=$0 ;;
- *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
- done
-IFS=$as_save_IFS
-
- ;;
-esac
-# We did not find ourselves, most probably we were run as `sh COMMAND'
-# in which case we are not to be found in the path.
-if test "x$as_myself" = x; then
- as_myself=$0
-fi
-if test ! -f "$as_myself"; then
- $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
- exit 1
-fi
-
-# Unset variables that we do not need and which cause bugs (e.g. in
-# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
-# suppresses any "Segmentation fault" message there. '((' could
-# trigger a bug in pdksh 5.2.14.
-for as_var in BASH_ENV ENV MAIL MAILPATH
-do eval test x\${$as_var+set} = xset \
- && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
-done
-PS1='$ '
-PS2='> '
-PS4='+ '
-
-# NLS nuisances.
-LC_ALL=C
-export LC_ALL
-LANGUAGE=C
-export LANGUAGE
-
-# CDPATH.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-
-# as_fn_error STATUS ERROR [LINENO LOG_FD]
-# ----------------------------------------
-# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
-# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
-# script with STATUS, using 1 if that was 0.
-as_fn_error ()
-{
- as_status=$1; test $as_status -eq 0 && as_status=1
- if test "$4"; then
- as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
- fi
- $as_echo "$as_me: error: $2" >&2
- as_fn_exit $as_status
-} # as_fn_error
-
-
-# as_fn_set_status STATUS
-# -----------------------
-# Set $? to STATUS, without forking.
-as_fn_set_status ()
-{
- return $1
-} # as_fn_set_status
-
-# as_fn_exit STATUS
-# -----------------
-# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
-as_fn_exit ()
-{
- set +e
- as_fn_set_status $1
- exit $1
-} # as_fn_exit
-
-# as_fn_unset VAR
-# ---------------
-# Portably unset VAR.
-as_fn_unset ()
-{
- { eval $1=; unset $1;}
-}
-as_unset=as_fn_unset
-# as_fn_append VAR VALUE
-# ----------------------
-# Append the text in VALUE to the end of the definition contained in VAR. Take
-# advantage of any shell optimizations that allow amortized linear growth over
-# repeated appends, instead of the typical quadratic growth present in naive
-# implementations.
-if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
- eval 'as_fn_append ()
- {
- eval $1+=\$2
- }'
-else
- as_fn_append ()
- {
- eval $1=\$$1\$2
- }
-fi # as_fn_append
-
-# as_fn_arith ARG...
-# ------------------
-# Perform arithmetic evaluation on the ARGs, and store the result in the
-# global $as_val. Take advantage of shells that can avoid forks. The arguments
-# must be portable across $(()) and expr.
-if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
- eval 'as_fn_arith ()
- {
- as_val=$(( $* ))
- }'
-else
- as_fn_arith ()
- {
- as_val=`expr "$@" || test $? -eq 1`
- }
-fi # as_fn_arith
-
-
-if expr a : '\(a\)' >/dev/null 2>&1 &&
- test "X`expr 00001 : '.*\(...\)'`" = X001; then
- as_expr=expr
-else
- as_expr=false
-fi
-
-if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
- as_basename=basename
-else
- as_basename=false
-fi
-
-if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
- as_dirname=dirname
-else
- as_dirname=false
-fi
-
-as_me=`$as_basename -- "$0" ||
-$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
- X"$0" : 'X\(//\)$' \| \
- X"$0" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X/"$0" |
- sed '/^.*\/\([^/][^/]*\)\/*$/{
- s//\1/
- q
- }
- /^X\/\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\/\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
-
-# Avoid depending upon Character Ranges.
-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
-
-ECHO_C= ECHO_N= ECHO_T=
-case `echo -n x` in #(((((
--n*)
- case `echo 'xy\c'` in
- *c*) ECHO_T=' ';; # ECHO_T is single tab character.
- xy) ECHO_C='\c';;
- *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
- ECHO_T=' ';;
- esac;;
-*)
- ECHO_N='-n';;
-esac
-
-rm -f conf$$ conf$$.exe conf$$.file
-if test -d conf$$.dir; then
- rm -f conf$$.dir/conf$$.file
-else
- rm -f conf$$.dir
- mkdir conf$$.dir 2>/dev/null
-fi
-if (echo >conf$$.file) 2>/dev/null; then
- if ln -s conf$$.file conf$$ 2>/dev/null; then
- as_ln_s='ln -s'
- # ... but there are two gotchas:
- # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
- # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
- # In both cases, we have to default to `cp -p'.
- ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
- as_ln_s='cp -p'
- elif ln conf$$.file conf$$ 2>/dev/null; then
- as_ln_s=ln
- else
- as_ln_s='cp -p'
- fi
-else
- as_ln_s='cp -p'
-fi
-rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
-rmdir conf$$.dir 2>/dev/null
-
-
-# as_fn_mkdir_p
-# -------------
-# Create "$as_dir" as a directory, including parents if necessary.
-as_fn_mkdir_p ()
-{
-
- case $as_dir in #(
- -*) as_dir=./$as_dir;;
- esac
- test -d "$as_dir" || eval $as_mkdir_p || {
- as_dirs=
- while :; do
- case $as_dir in #(
- *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
- *) as_qdir=$as_dir;;
- esac
- as_dirs="'$as_qdir' $as_dirs"
- as_dir=`$as_dirname -- "$as_dir" ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$as_dir" : 'X\(//\)[^/]' \| \
- X"$as_dir" : 'X\(//\)$' \| \
- X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$as_dir" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- test -d "$as_dir" && break
- done
- test -z "$as_dirs" || eval "mkdir $as_dirs"
- } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
-
-
-} # as_fn_mkdir_p
-if mkdir -p . 2>/dev/null; then
- as_mkdir_p='mkdir -p "$as_dir"'
-else
- test -d ./-p && rmdir ./-p
- as_mkdir_p=false
-fi
-
-if test -x / >/dev/null 2>&1; then
- as_test_x='test -x'
-else
- if ls -dL / >/dev/null 2>&1; then
- as_ls_L_option=L
- else
- as_ls_L_option=
- fi
- as_test_x='
- eval sh -c '\''
- if test -d "$1"; then
- test -d "$1/.";
- else
- case $1 in #(
- -*)set "./$1";;
- esac;
- case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
- ???[sx]*):;;*)false;;esac;fi
- '\'' sh
- '
-fi
-as_executable_p=$as_test_x
-
-# Sed expression to map a string onto a valid CPP name.
-as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
-
-# Sed expression to map a string onto a valid variable name.
-as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
-
-
-exec 6>&1
-## ----------------------------------- ##
-## Main body of $CONFIG_STATUS script. ##
-## ----------------------------------- ##
-_ASEOF
-test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
-
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-# Save the log message, to keep $0 and so on meaningful, and to
-# report actual input values of CONFIG_FILES etc. instead of their
-# values after options handling.
-ac_log="
-This file was extended by OpenSSH $as_me Portable, which was
-generated by GNU Autoconf 2.68. Invocation command line was
-
- CONFIG_FILES = $CONFIG_FILES
- CONFIG_HEADERS = $CONFIG_HEADERS
- CONFIG_LINKS = $CONFIG_LINKS
- CONFIG_COMMANDS = $CONFIG_COMMANDS
- $ $0 $@
-
-on `(hostname || uname -n) 2>/dev/null | sed 1q`
-"
-
-_ACEOF
-
-case $ac_config_files in *"
-"*) set x $ac_config_files; shift; ac_config_files=$*;;
-esac
-
-case $ac_config_headers in *"
-"*) set x $ac_config_headers; shift; ac_config_headers=$*;;
-esac
-
-
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-# Files that config.status was made for.
-config_files="$ac_config_files"
-config_headers="$ac_config_headers"
-
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-ac_cs_usage="\
-\`$as_me' instantiates files and other configuration actions
-from templates according to the current configuration. Unless the files
-and actions are specified as TAGs, all are instantiated by default.
-
-Usage: $0 [OPTION]... [TAG]...
-
- -h, --help print this help, then exit
- -V, --version print version number and configuration settings, then exit
- --config print configuration, then exit
- -q, --quiet, --silent
- do not print progress messages
- -d, --debug don't remove temporary files
- --recheck update $as_me by reconfiguring in the same conditions
- --file=FILE[:TEMPLATE]
- instantiate the configuration file FILE
- --header=FILE[:TEMPLATE]
- instantiate the configuration header FILE
-
-Configuration files:
-$config_files
-
-Configuration headers:
-$config_headers
-
-Report bugs to <openssh-unix-dev@mindrot.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="\\
-OpenSSH config.status Portable
-configured by $0, generated by GNU Autoconf 2.68,
- with options \\"\$ac_cs_config\\"
-
-Copyright (C) 2010 Free Software Foundation, Inc.
-This config.status script is free software; the Free Software Foundation
-gives unlimited permission to copy, distribute and modify it."
-
-ac_pwd='$ac_pwd'
-srcdir='$srcdir'
-INSTALL='$INSTALL'
-AWK='$AWK'
-test -n "\$AWK" || AWK=awk
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-# The default lists apply if the user does not specify any file.
-ac_need_defaults=:
-while test $# != 0
-do
- case $1 in
- --*=?*)
- ac_option=`expr "X$1" : 'X\([^=]*\)='`
- ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
- ac_shift=:
- ;;
- --*=)
- ac_option=`expr "X$1" : 'X\([^=]*\)='`
- ac_optarg=
- ac_shift=:
- ;;
- *)
- ac_option=$1
- ac_optarg=$2
- ac_shift=shift
- ;;
- esac
-
- case $ac_option in
- # Handling of the options.
- -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
- ac_cs_recheck=: ;;
- --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
- $as_echo "$ac_cs_version"; exit ;;
- --config | --confi | --conf | --con | --co | --c )
- $as_echo "$ac_cs_config"; exit ;;
- --debug | --debu | --deb | --de | --d | -d )
- debug=: ;;
- --file | --fil | --fi | --f )
- $ac_shift
- case $ac_optarg in
- *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
- '') as_fn_error $? "missing file argument" ;;
- esac
- as_fn_append CONFIG_FILES " '$ac_optarg'"
- ac_need_defaults=false;;
- --header | --heade | --head | --hea )
- $ac_shift
- case $ac_optarg in
- *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
- esac
- as_fn_append CONFIG_HEADERS " '$ac_optarg'"
- ac_need_defaults=false;;
- --he | --h)
- # Conflict between --help and --header
- as_fn_error $? "ambiguous option: \`$1'
-Try \`$0 --help' for more information.";;
- --help | --hel | -h )
- $as_echo "$ac_cs_usage"; exit ;;
- -q | -quiet | --quiet | --quie | --qui | --qu | --q \
- | -silent | --silent | --silen | --sile | --sil | --si | --s)
- ac_cs_silent=: ;;
-
- # This is an error.
- -*) as_fn_error $? "unrecognized option: \`$1'
-Try \`$0 --help' for more information." ;;
-
- *) as_fn_append ac_config_targets " $1"
- ac_need_defaults=false ;;
-
- esac
- shift
-done
-
-ac_configure_extra_args=
-
-if $ac_cs_silent; then
- exec 6>/dev/null
- ac_configure_extra_args="$ac_configure_extra_args --silent"
-fi
-
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-if \$ac_cs_recheck; then
- set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
- shift
- \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
- CONFIG_SHELL='$SHELL'
- export CONFIG_SHELL
- exec "\$@"
-fi
-
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-exec 5>>config.log
-{
- echo
- sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
-## Running $as_me. ##
-_ASBOX
- $as_echo "$ac_log"
-} >&5
-
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-
-# Handling of arguments.
-for ac_config_target in $ac_config_targets
-do
- case $ac_config_target in
- "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
- "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
- "buildpkg.sh") CONFIG_FILES="$CONFIG_FILES buildpkg.sh" ;;
- "opensshd.init") CONFIG_FILES="$CONFIG_FILES opensshd.init" ;;
- "openssh.xml") CONFIG_FILES="$CONFIG_FILES openssh.xml" ;;
- "openbsd-compat/Makefile") CONFIG_FILES="$CONFIG_FILES openbsd-compat/Makefile" ;;
- "openbsd-compat/regress/Makefile") CONFIG_FILES="$CONFIG_FILES openbsd-compat/regress/Makefile" ;;
- "survey.sh") CONFIG_FILES="$CONFIG_FILES survey.sh" ;;
-
- *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
- esac
-done
-
-
-# If the user did not use the arguments to specify the items to instantiate,
-# then the envvar interface is used. Set only those that are not.
-# We use the long form for the default assignment because of an extremely
-# bizarre bug on SunOS 4.1.3.
-if $ac_need_defaults; then
- test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
- test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
-fi
-
-# Have a temporary directory for convenience. Make it in the build tree
-# simply because there is no reason against having it here, and in addition,
-# creating and moving files from /tmp can sometimes cause problems.
-# Hook for its removal unless debugging.
-# Note that there is a small window in which the directory will not be cleaned:
-# after its creation but before its name has been assigned to `$tmp'.
-$debug ||
-{
- tmp= ac_tmp=
- trap 'exit_status=$?
- : "${ac_tmp:=$tmp}"
- { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
-' 0
- trap 'as_fn_exit 1' 1 2 13 15
-}
-# Create a (secure) tmp directory for tmp files.
-
-{
- tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
- test -d "$tmp"
-} ||
-{
- tmp=./conf$$-$RANDOM
- (umask 077 && mkdir "$tmp")
-} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
-ac_tmp=$tmp
-
-# Set up the scripts for CONFIG_FILES section.
-# No need to generate them if there are no CONFIG_FILES.
-# This happens for instance with `./config.status config.h'.
-if test -n "$CONFIG_FILES"; then
-
-
-ac_cr=`echo X | tr X '\015'`
-# On cygwin, bash can eat \r inside `` if the user requested igncr.
-# But we know of no other shell where ac_cr would be empty at this
-# point, so we can use a bashism as a fallback.
-if test "x$ac_cr" = x; then
- eval ac_cr=\$\'\\r\'
-fi
-ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
-if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
- ac_cs_awk_cr='\\r'
-else
- ac_cs_awk_cr=$ac_cr
-fi
-
-echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
-_ACEOF
-
-
-{
- echo "cat >conf$$subs.awk <<_ACEOF" &&
- echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
- echo "_ACEOF"
-} >conf$$subs.sh ||
- as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
-ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
-ac_delim='%!_!# '
-for ac_last_try in false false false false false :; do
- . ./conf$$subs.sh ||
- as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
-
- ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
- if test $ac_delim_n = $ac_delim_num; then
- break
- elif $ac_last_try; then
- as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
- else
- ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
- fi
-done
-rm -f conf$$subs.sh
-
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
-_ACEOF
-sed -n '
-h
-s/^/S["/; s/!.*/"]=/
-p
-g
-s/^[^!]*!//
-:repl
-t repl
-s/'"$ac_delim"'$//
-t delim
-:nl
-h
-s/\(.\{148\}\)..*/\1/
-t more1
-s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
-p
-n
-b repl
-:more1
-s/["\\]/\\&/g; s/^/"/; s/$/"\\/
-p
-g
-s/.\{148\}//
-t nl
-:delim
-h
-s/\(.\{148\}\)..*/\1/
-t more2
-s/["\\]/\\&/g; s/^/"/; s/$/"/
-p
-b
-:more2
-s/["\\]/\\&/g; s/^/"/; s/$/"\\/
-p
-g
-s/.\{148\}//
-t delim
-' <conf$$subs.awk | sed '
-/^[^""]/{
- N
- s/\n//
-}
-' >>$CONFIG_STATUS || ac_write_fail=1
-rm -f conf$$subs.awk
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-_ACAWK
-cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
- for (key in S) S_is_set[key] = 1
- FS = ""
-
-}
-{
- line = $ 0
- nfields = split(line, field, "@")
- substed = 0
- len = length(field[1])
- for (i = 2; i < nfields; i++) {
- key = field[i]
- keylen = length(key)
- if (S_is_set[key]) {
- value = S[key]
- line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
- len += length(value) + length(field[++i])
- substed = 1
- } else
- len += 1 + keylen
- }
-
- print line
-}
-
-_ACAWK
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
- sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
-else
- cat
-fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
- || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
-_ACEOF
-
-# VPATH may cause trouble with some makes, so we remove sole $(srcdir),
-# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and
-# trailing colons and then remove the whole line if VPATH becomes empty
-# (actually we leave an empty line to preserve line numbers).
-if test "x$srcdir" = x.; then
- ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{
-h
-s///
-s/^/:/
-s/[ ]*$/:/
-s/:\$(srcdir):/:/g
-s/:\${srcdir}:/:/g
-s/:@srcdir@:/:/g
-s/^:*//
-s/:*$//
-x
-s/\(=[ ]*\).*/\1/
-G
-s/\n//
-s/^[^=]*=[ ]*$//
-}'
-fi
-
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-fi # test -n "$CONFIG_FILES"
-
-# Set up the scripts for CONFIG_HEADERS section.
-# No need to generate them if there are no CONFIG_HEADERS.
-# This happens for instance with `./config.status Makefile'.
-if test -n "$CONFIG_HEADERS"; then
-cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
-BEGIN {
-_ACEOF
-
-# Transform confdefs.h into an awk script `defines.awk', embedded as
-# here-document in config.status, that substitutes the proper values into
-# config.h.in to produce config.h.
-
-# Create a delimiter string that does not exist in confdefs.h, to ease
-# handling of long lines.
-ac_delim='%!_!# '
-for ac_last_try in false false :; do
- ac_tt=`sed -n "/$ac_delim/p" confdefs.h`
- if test -z "$ac_tt"; then
- break
- elif $ac_last_try; then
- as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
- else
- ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
- fi
-done
-
-# For the awk script, D is an array of macro values keyed by name,
-# likewise P contains macro parameters if any. Preserve backslash
-# newline sequences.
-
-ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
-sed -n '
-s/.\{148\}/&'"$ac_delim"'/g
-t rset
-:rset
-s/^[ ]*#[ ]*define[ ][ ]*/ /
-t def
-d
-:def
-s/\\$//
-t bsnl
-s/["\\]/\\&/g
-s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\
-D["\1"]=" \3"/p
-s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p
-d
-:bsnl
-s/["\\]/\\&/g
-s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\
-D["\1"]=" \3\\\\\\n"\\/p
-t cont
-s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
-t cont
-d
-:cont
-n
-s/.\{148\}/&'"$ac_delim"'/g
-t clear
-:clear
-s/\\$//
-t bsnlc
-s/["\\]/\\&/g; s/^/"/; s/$/"/p
-d
-:bsnlc
-s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
-b cont
-' <confdefs.h | sed '
-s/'"$ac_delim"'/"\\\
-"/g' >>$CONFIG_STATUS || ac_write_fail=1
-
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
- for (key in D) D_is_set[key] = 1
- FS = ""
-}
-/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
- line = \$ 0
- split(line, arg, " ")
- if (arg[1] == "#") {
- defundef = arg[2]
- mac1 = arg[3]
- } else {
- defundef = substr(arg[1], 2)
- mac1 = arg[2]
- }
- split(mac1, mac2, "(") #)
- macro = mac2[1]
- prefix = substr(line, 1, index(line, defundef) - 1)
- if (D_is_set[macro]) {
- # Preserve the white space surrounding the "#".
- print prefix "define", macro P[macro] D[macro]
- next
- } else {
- # Replace #undef with comments. This is necessary, for example,
- # in the case of _POSIX_SOURCE, which is predefined and required
- # on some systems where configure will not decide to define it.
- if (defundef == "undef") {
- print "/*", prefix defundef, macro, "*/"
- next
- }
- }
-}
-{ print }
-_ACAWK
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
- as_fn_error $? "could not setup config headers machinery" "$LINENO" 5
-fi # test -n "$CONFIG_HEADERS"
-
-
-eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS "
-shift
-for ac_tag
-do
- case $ac_tag in
- :[FHLC]) ac_mode=$ac_tag; continue;;
- esac
- case $ac_mode$ac_tag in
- :[FHL]*:*);;
- :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
- :[FH]-) ac_tag=-:-;;
- :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
- esac
- ac_save_IFS=$IFS
- IFS=:
- set x $ac_tag
- IFS=$ac_save_IFS
- shift
- ac_file=$1
- shift
-
- case $ac_mode in
- :L) ac_source=$1;;
- :[FH])
- ac_file_inputs=
- for ac_f
- do
- case $ac_f in
- -) ac_f="$ac_tmp/stdin";;
- *) # Look for the file first in the build tree, then in the source tree
- # (if the path is not absolute). The absolute path cannot be DOS-style,
- # because $ac_f cannot contain `:'.
- test -f "$ac_f" ||
- case $ac_f in
- [\\/$]*) false;;
- *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
- esac ||
- as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
- esac
- case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
- as_fn_append ac_file_inputs " '$ac_f'"
- done
-
- # Let's still pretend it is `configure' which instantiates (i.e., don't
- # use $as_me), people would be surprised to read:
- # /* config.h. Generated by config.status. */
- configure_input='Generated from '`
- $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
- `' by configure.'
- if test x"$ac_file" != x-; then
- configure_input="$ac_file. $configure_input"
- { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
-$as_echo "$as_me: creating $ac_file" >&6;}
- fi
- # Neutralize special characters interpreted by sed in replacement strings.
- case $configure_input in #(
- *\&* | *\|* | *\\* )
- ac_sed_conf_input=`$as_echo "$configure_input" |
- sed 's/[\\\\&|]/\\\\&/g'`;; #(
- *) ac_sed_conf_input=$configure_input;;
- esac
-
- case $ac_tag in
- *:-:* | *:-) cat >"$ac_tmp/stdin" \
- || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
- esac
- ;;
- esac
-
- ac_dir=`$as_dirname -- "$ac_file" ||
-$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$ac_file" : 'X\(//\)[^/]' \| \
- X"$ac_file" : 'X\(//\)$' \| \
- X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$ac_file" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- as_dir="$ac_dir"; as_fn_mkdir_p
- ac_builddir=.
-
-case "$ac_dir" in
-.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
-*)
- ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
- # A ".." for each directory in $ac_dir_suffix.
- ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
- case $ac_top_builddir_sub in
- "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
- *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
- esac ;;
-esac
-ac_abs_top_builddir=$ac_pwd
-ac_abs_builddir=$ac_pwd$ac_dir_suffix
-# for backward compatibility:
-ac_top_builddir=$ac_top_build_prefix
-
-case $srcdir in
- .) # We are building in place.
- ac_srcdir=.
- ac_top_srcdir=$ac_top_builddir_sub
- ac_abs_top_srcdir=$ac_pwd ;;
- [\\/]* | ?:[\\/]* ) # Absolute name.
- ac_srcdir=$srcdir$ac_dir_suffix;
- ac_top_srcdir=$srcdir
- ac_abs_top_srcdir=$srcdir ;;
- *) # Relative name.
- ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
- ac_top_srcdir=$ac_top_build_prefix$srcdir
- ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
-esac
-ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
-
-
- case $ac_mode in
- :F)
- #
- # CONFIG_FILE
- #
-
- case $INSTALL in
- [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
- *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
- esac
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-# If the template does not know about datarootdir, expand it.
-# FIXME: This hack should be removed a few years after 2.60.
-ac_datarootdir_hack=; ac_datarootdir_seen=
-ac_sed_dataroot='
-/datarootdir/ {
- p
- q
-}
-/@datadir@/p
-/@docdir@/p
-/@infodir@/p
-/@localedir@/p
-/@mandir@/p'
-case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
-*datarootdir*) ac_datarootdir_seen=yes;;
-*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
-$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
- ac_datarootdir_hack='
- s&@datadir@&$datadir&g
- s&@docdir@&$docdir&g
- s&@infodir@&$infodir&g
- s&@localedir@&$localedir&g
- s&@mandir@&$mandir&g
- s&\\\${datarootdir}&$datarootdir&g' ;;
-esac
-_ACEOF
-
-# Neutralize VPATH when `$srcdir' = `.'.
-# Shell code in configure.ac might set extrasub.
-# FIXME: do we really want to maintain this feature?
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-ac_sed_extra="$ac_vpsub
-$extrasub
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-:t
-/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
-s|@configure_input@|$ac_sed_conf_input|;t t
-s&@top_builddir@&$ac_top_builddir_sub&;t t
-s&@top_build_prefix@&$ac_top_build_prefix&;t t
-s&@srcdir@&$ac_srcdir&;t t
-s&@abs_srcdir@&$ac_abs_srcdir&;t t
-s&@top_srcdir@&$ac_top_srcdir&;t t
-s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
-s&@builddir@&$ac_builddir&;t t
-s&@abs_builddir@&$ac_abs_builddir&;t t
-s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
-s&@INSTALL@&$ac_INSTALL&;t t
-$ac_datarootdir_hack
-"
-eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
- >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
-
-test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
- { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
- { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \
- "$ac_tmp/out"`; test -z "$ac_out"; } &&
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
-which seems to be undefined. Please make sure it is defined" >&5
-$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
-which seems to be undefined. Please make sure it is defined" >&2;}
-
- rm -f "$ac_tmp/stdin"
- case $ac_file in
- -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
- *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
- esac \
- || as_fn_error $? "could not create $ac_file" "$LINENO" 5
- ;;
- :H)
- #
- # CONFIG_HEADER
- #
- if test x"$ac_file" != x-; then
- {
- $as_echo "/* $configure_input */" \
- && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs"
- } >"$ac_tmp/config.h" \
- || as_fn_error $? "could not create $ac_file" "$LINENO" 5
- if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
-$as_echo "$as_me: $ac_file is unchanged" >&6;}
- else
- rm -f "$ac_file"
- mv "$ac_tmp/config.h" "$ac_file" \
- || as_fn_error $? "could not create $ac_file" "$LINENO" 5
- fi
- else
- $as_echo "/* $configure_input */" \
- && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \
- || as_fn_error $? "could not create -" "$LINENO" 5
- fi
- ;;
-
-
- esac
-
-done # for ac_tag
-
-
-as_fn_exit 0
-_ACEOF
-ac_clean_files=$ac_clean_files_save
-
-test $ac_write_fail = 0 ||
- as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
-
-
-# configure is writing to config.log, and then calls config.status.
-# config.status does its own redirection, appending to config.log.
-# Unfortunately, on DOS this fails, as config.log is still kept open
-# by configure, so config.status won't be able to write to it; its
-# output is simply discarded. So we exec the FD to /dev/null,
-# effectively closing config.log, so it can be properly (re)opened and
-# appended to by config.status. When coming back to configure, we
-# need to make the FD available again.
-if test "$no_create" != yes; then
- ac_cs_success=:
- ac_config_status_args=
- test "$silent" = yes &&
- ac_config_status_args="$ac_config_status_args --quiet"
- exec 5>/dev/null
- $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
- exec 5>>config.log
- # Use ||, not &&, to avoid exiting from the if with $? = 1, which
- # would make configure fail if this is the last instruction.
- $ac_cs_success || as_fn_exit 1
-fi
-if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
-$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
-fi
-
-
-# Print summary of options
-
-# Someone please show me a better way :)
-A=`eval echo ${prefix}` ; A=`eval echo ${A}`
-B=`eval echo ${bindir}` ; B=`eval echo ${B}`
-C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
-D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
-E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
-F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
-G=`eval echo ${piddir}` ; G=`eval echo ${G}`
-H=`eval echo ${PRIVSEP_PATH}` ; H=`eval echo ${H}`
-I=`eval echo ${user_path}` ; I=`eval echo ${I}`
-J=`eval echo ${superuser_path}` ; J=`eval echo ${J}`
-
-echo ""
-echo "OpenSSH has been configured with the following options:"
-echo " User binaries: $B"
-echo " System binaries: $C"
-echo " Configuration files: $D"
-echo " Askpass program: $E"
-echo " Manual pages: $F"
-echo " PID file: $G"
-echo " Privilege separation chroot path: $H"
-if test "x$external_path_file" = "x/etc/login.conf" ; then
-echo " At runtime, sshd will use the path defined in $external_path_file"
-echo " Make sure the path to scp is present, otherwise scp will not work"
-else
-echo " sshd default user PATH: $I"
- if test ! -z "$external_path_file"; then
-echo " (If PATH is set in $external_path_file it will be used instead. If"
-echo " used, ensure the path to scp is present, otherwise scp will not work.)"
- fi
-fi
-if test ! -z "$superuser_path" ; then
-echo " sshd superuser user PATH: $J"
-fi
-echo " Manpage format: $MANTYPE"
-echo " PAM support: $PAM_MSG"
-echo " OSF SIA support: $SIA_MSG"
-echo " KerberosV support: $KRB5_MSG"
-echo " SELinux support: $SELINUX_MSG"
-echo " Smartcard support: $SCARD_MSG"
-echo " S/KEY support: $SKEY_MSG"
-echo " TCP Wrappers support: $TCPW_MSG"
-echo " MD5 password support: $MD5_MSG"
-echo " libedit support: $LIBEDIT_MSG"
-echo " Solaris process contract support: $SPC_MSG"
-echo " Solaris project support: $SP_MSG"
-echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
-echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
-echo " BSD Auth support: $BSD_AUTH_MSG"
-echo " Random number source: $RAND_MSG"
-echo " Privsep sandbox style: $SANDBOX_STYLE"
-
-echo ""
-
-echo " Host: ${host}"
-echo " Compiler: ${CC}"
-echo " Compiler flags: ${CFLAGS}"
-echo "Preprocessor flags: ${CPPFLAGS}"
-echo " Linker flags: ${LDFLAGS}"
-echo " Libraries: ${LIBS}"
-if test ! -z "${SSHDLIBS}"; then
-echo " +for sshd: ${SSHDLIBS}"
-fi
-if test ! -z "${SSHLIBS}"; then
-echo " +for ssh: ${SSHLIBS}"
-fi
-
-echo ""
-
-if test "x$MAKE_PACKAGE_SUPPORTED" = "xyes" ; then
- echo "SVR4 style packages are supported with \"make package\""
- echo ""
-fi
-
-if test "x$PAM_MSG" = "xyes" ; then
- echo "PAM is enabled. You may need to install a PAM control file "
- echo "for sshd, otherwise password authentication may fail. "
- echo "Example PAM control files can be found in the contrib/ "
- echo "subdirectory"
- echo ""
-fi
-
-if test ! -z "$NO_PEERCHECK" ; then
- echo "WARNING: the operating system that you are using does not"
- echo "appear to support getpeereid(), getpeerucred() or the"
- echo "SO_PEERCRED getsockopt() option. These facilities are used to"
- echo "enforce security checks to prevent unauthorised connections to"
- echo "ssh-agent. Their absence increases the risk that a malicious"
- echo "user can connect to your agent."
- echo ""
-fi
-
-if test "$AUDIT_MODULE" = "bsm" ; then
- echo "WARNING: BSM audit support is currently considered EXPERIMENTAL."
- echo "See the Solaris section in README.platform for details."
-fi
diff --git a/crypto/openssh/configure.ac b/crypto/openssh/configure.ac
index 7c6ce08..aeec10f 100644
--- a/crypto/openssh/configure.ac
+++ b/crypto/openssh/configure.ac
@@ -1,4 +1,5 @@
# $Id: configure.ac,v 1.571 2014/02/21 17:09:34 tim Exp $
+# $FreeBSD$
#
# Copyright (c) 1999-2004 Damien Miller
#
diff --git a/crypto/openssh/digest-libc.c b/crypto/openssh/digest-libc.c
index 1804b06..9377c77 100644
--- a/crypto/openssh/digest-libc.c
+++ b/crypto/openssh/digest-libc.c
@@ -147,7 +147,7 @@ ssh_digest_start(int alg)
const struct ssh_digest *digest = ssh_digest_by_alg(alg);
struct ssh_digest_ctx *ret;
- if (digest == NULL || (ret = calloc(1, sizeof(ret))) == NULL)
+ if (digest == NULL || (ret = calloc(1, sizeof(*ret))) == NULL)
return NULL;
if ((ret->mdctx = calloc(1, digest->ctx_len)) == NULL) {
free(ret);
diff --git a/crypto/openssh/freebsd-configure.sh b/crypto/openssh/freebsd-configure.sh
index 8004880..0f37eb9 100755
--- a/crypto/openssh/freebsd-configure.sh
+++ b/crypto/openssh/freebsd-configure.sh
@@ -7,6 +7,7 @@ configure_args="
--prefix=/usr
--sysconfdir=/etc/ssh
--with-pam
+ --with-ssl-dir=/usr
--with-tcp-wrappers
--with-libedit
--with-ssl-engine
@@ -15,6 +16,19 @@ configure_args="
set -e
+# make sure configure uses the correct compiler
+export CC=$(echo ".include <bsd.lib.mk>" | make -f /dev/stdin -VCC)
+export CPP=$(echo ".include <bsd.lib.mk>" | make -f /dev/stdin -VCPP)
+unset CFLAGS CPPFLAGS LDFLAGS LIBS
+
+# regenerate configure and config.h.in
+autoheader
+autoconf
+
+# reset PATH to avoid picking up the wrong libraries
+export PATH=/bin:/sbin:/usr/bin:/usr/sbin
+unset LD_LIBRARY_PATH
+
# generate config.h with krb5 and stash it
sh configure $configure_args --with-kerberos5
mv config.log config.log.orig
diff --git a/crypto/openssh/freebsd-post-merge.sh b/crypto/openssh/freebsd-post-merge.sh
new file mode 100755
index 0000000..b9e4cbd
--- /dev/null
+++ b/crypto/openssh/freebsd-post-merge.sh
@@ -0,0 +1,14 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+xargs perl -n -i -e '
+ print;
+ s/\$(Id|OpenBSD): [^\$]*/\$FreeBSD/ && print;
+' <keywords
+
+xargs perl -n -i -e '
+ print;
+ m/^\#include "includes.h"/ && print "__RCSID(\"\$FreeBSD\$\");\n";
+' <rcsid
diff --git a/crypto/openssh/freebsd-pre-merge.sh b/crypto/openssh/freebsd-pre-merge.sh
new file mode 100755
index 0000000..473474c
--- /dev/null
+++ b/crypto/openssh/freebsd-pre-merge.sh
@@ -0,0 +1,17 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+:>keywords
+:>rcsid
+svn list -R | grep -v '/$' | \
+while read f ; do
+ svn proplist -v $f | grep -q 'FreeBSD=%H' || continue
+ egrep -l '^(#|\.\\"|/\*)[[:space:]]+\$FreeBSD[:\$]' $f >>keywords
+ egrep -l '__RCSID\("\$FreeBSD[:\$]' $f >>rcsid
+done
+sort -u keywords rcsid | xargs perl -n -i -e '
+ $strip = $ARGV if /\$(Id|OpenBSD):.*\$/;
+ print unless (($strip eq $ARGV || /__RCSID/) && /\$FreeBSD[:\$]/);
+'
diff --git a/crypto/openssh/kex.c b/crypto/openssh/kex.c
index 6c7b20c..74e2b86 100644
--- a/crypto/openssh/kex.c
+++ b/crypto/openssh/kex.c
@@ -1,5 +1,4 @@
/* $OpenBSD: kex.c,v 1.98 2014/02/02 03:44:31 djm Exp $ */
-/* $FreeBSD$ */
/*
* Copyright (c) 2000, 2001 Markus Friedl. All rights reserved.
*
@@ -146,13 +145,8 @@ kex_names_valid(const char *names)
return 1;
}
-/* put algorithm proposal into buffer. */
-#ifndef NONE_CIPHER_ENABLED
+/* put algorithm proposal into buffer */
static void
-#else
-/* Also used in sshconnect2.c. */
-void
-#endif
kex_prop2buf(Buffer *b, char *proposal[PROPOSAL_MAX])
{
u_int i;
@@ -466,9 +460,6 @@ kex_choose_conf(Kex *kex)
int nenc, nmac, ncomp;
u_int mode, ctos, need, dh_need, authlen;
int first_kex_follows, type;
-#ifdef NONE_CIPHER_ENABLED
- int auth_flag;
-#endif
my = kex_buf2prop(&kex->my, NULL);
peer = kex_buf2prop(&kex->peer, &first_kex_follows);
@@ -492,10 +483,6 @@ kex_choose_conf(Kex *kex)
}
/* Algorithm Negotiation */
-#ifdef NONE_CIPHER_ENABLED
- auth_flag = packet_get_authentication_state();
- debug ("AUTH STATE is %d", auth_flag);
-#endif
for (mode = 0; mode < MODE_MAX; mode++) {
newkeys = xcalloc(1, sizeof(*newkeys));
kex->newkeys[mode] = newkeys;
@@ -510,17 +497,6 @@ kex_choose_conf(Kex *kex)
if (authlen == 0)
choose_mac(&newkeys->mac, cprop[nmac], sprop[nmac]);
choose_comp(&newkeys->comp, cprop[ncomp], sprop[ncomp]);
-#ifdef NONE_CIPHER_ENABLED
- debug("REQUESTED ENC.NAME is '%s'", newkeys->enc.name);
- if (strcmp(newkeys->enc.name, "none") == 0) {
- debug("Requesting NONE. Authflag is %d", auth_flag);
- if (auth_flag == 1)
- debug("None requested post authentication.");
- else
- fatal("Pre-authentication none cipher requests "
- "are not allowed.");
- }
-#endif
debug("kex: %s %s %s %s",
ctos ? "client->server" : "server->client",
newkeys->enc.name,
diff --git a/crypto/openssh/kex.h b/crypto/openssh/kex.h
index 0d5c362..c85680e 100644
--- a/crypto/openssh/kex.h
+++ b/crypto/openssh/kex.h
@@ -1,5 +1,4 @@
/* $OpenBSD: kex.h,v 1.62 2014/01/27 18:58:14 markus Exp $ */
-/* $FreeBSD$ */
/*
* Copyright (c) 2000, 2001 Markus Friedl. All rights reserved.
@@ -149,10 +148,6 @@ struct Kex {
int kex_names_valid(const char *);
char *kex_alg_list(char);
-#ifdef NONE_CIPHER_ENABLED
-void kex_prop2buf(Buffer *, char *[PROPOSAL_MAX]);
-#endif
-
Kex *kex_setup(char *[PROPOSAL_MAX]);
void kex_finish(Kex *);
diff --git a/crypto/openssh/misc.c b/crypto/openssh/misc.c
index b7dbe50..e4c8c32 100644
--- a/crypto/openssh/misc.c
+++ b/crypto/openssh/misc.c
@@ -1,5 +1,4 @@
/* $OpenBSD: misc.c,v 1.92 2013/10/14 23:28:23 djm Exp $ */
-/* $FreeBSD$ */
/*
* Copyright (c) 2000 Markus Friedl. All rights reserved.
* Copyright (c) 2005,2006 Damien Miller. All rights reserved.
@@ -1037,34 +1036,3 @@ sock_set_v6only(int s)
error("setsockopt IPV6_V6ONLY: %s", strerror(errno));
#endif
}
-
-void
-sock_get_rcvbuf(int *size, int rcvbuf)
-{
- int sock, socksize;
- socklen_t socksizelen = sizeof(socksize);
-
- /*
- * Create a socket but do not connect it. We use it
- * only to get the rcv socket size.
- */
- sock = socket(AF_INET6, SOCK_STREAM, 0);
- if (sock < 0)
- sock = socket(AF_INET, SOCK_STREAM, 0);
- if (sock < 0)
- return;
-
- /*
- * If the tcp_rcv_buf option is set and passed in, attempt to set the
- * buffer size to its value.
- */
- if (rcvbuf)
- setsockopt(sock, SOL_SOCKET, SO_RCVBUF, (void *)&rcvbuf,
- sizeof(rcvbuf));
-
- if (getsockopt(sock, SOL_SOCKET, SO_RCVBUF,
- &socksize, &socksizelen) == 0)
- if (size != NULL)
- *size = socksize;
- close(sock);
-}
diff --git a/crypto/openssh/misc.h b/crypto/openssh/misc.h
index ce4d78c..d4df619 100644
--- a/crypto/openssh/misc.h
+++ b/crypto/openssh/misc.h
@@ -1,5 +1,4 @@
/* $OpenBSD: misc.h,v 1.50 2013/10/14 23:28:23 djm Exp $ */
-/* $FreeBSD$ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
@@ -40,7 +39,6 @@ time_t monotime(void);
void lowercase(char *s);
void sock_set_v6only(int);
-void sock_get_rcvbuf(int *, int);
struct passwd *pwcopy(struct passwd *);
const char *ssh_gai_strerror(int);
diff --git a/crypto/openssh/moduli.5 b/crypto/openssh/moduli.5
index d272d18..ef0de08 100644
--- a/crypto/openssh/moduli.5
+++ b/crypto/openssh/moduli.5
@@ -13,7 +13,7 @@
.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-.Dd September 26, 2012
+.Dd $Mdocdate: September 26 2012 $
.Dt MODULI 5
.Os
.Sh NAME
diff --git a/crypto/openssh/mux.c b/crypto/openssh/mux.c
index e8700e1..4ebb033 100644
--- a/crypto/openssh/mux.c
+++ b/crypto/openssh/mux.c
@@ -31,6 +31,7 @@
*/
#include "includes.h"
+__RCSID("$FreeBSD$");
#include <sys/types.h>
#include <sys/param.h>
diff --git a/crypto/openssh/myproposal.h b/crypto/openssh/myproposal.h
index db25064..89479e6 100644
--- a/crypto/openssh/myproposal.h
+++ b/crypto/openssh/myproposal.h
@@ -110,10 +110,6 @@
"chacha20-poly1305@openssh.com," \
"aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc," \
"aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se"
-#ifdef NONE_CIPHER_ENABLED
-#define KEX_ENCRYPT_INCLUDE_NONE KEX_DEFAULT_ENCRYPT \
- ",none"
-#endif
#define KEX_DEFAULT_MAC \
"hmac-md5-etm@openssh.com," \
diff --git a/crypto/openssh/packet.c b/crypto/openssh/packet.c
index f5fe989..ff70e60 100644
--- a/crypto/openssh/packet.c
+++ b/crypto/openssh/packet.c
@@ -38,6 +38,7 @@
*/
#include "includes.h"
+__RCSID("$FreeBSD$");
#include <sys/types.h>
#include "openbsd-compat/sys-queue.h"
@@ -201,9 +202,6 @@ struct session_state {
};
static struct session_state *active_state, *backup_state;
-#ifdef NONE_CIPHER_ENABLED
-static int rekey_requested = 0;
-#endif
static struct session_state *
alloc_session_state(void)
@@ -1315,7 +1313,6 @@ packet_read_poll2(u_int32_t *seqnr_p)
buffer_ptr(&active_state->input), block_size, 0, 0) != 0)
fatal("Decryption integrity check failed");
cp = buffer_ptr(&active_state->incoming_packet);
-
active_state->packlen = get_u32(cp);
if (active_state->packlen < 1 + 4 ||
active_state->packlen > PACKET_MAX_SIZE) {
@@ -1942,26 +1939,12 @@ packet_send_ignore(int nbytes)
}
}
-#ifdef NONE_CIPHER_ENABLED
-void
-packet_request_rekeying(void)
-{
- rekey_requested = 1;
-}
-#endif
-
#define MAX_PACKETS (1U<<31)
int
packet_need_rekeying(void)
{
if (datafellows & SSH_BUG_NOREKEY)
return 0;
-#ifdef NONE_CIPHER_ENABLED
- if (rekey_requested == 1) {
- rekey_requested = 0;
- return 1;
- }
-#endif
return
(active_state->p_send.packets > MAX_PACKETS) ||
(active_state->p_read.packets > MAX_PACKETS) ||
@@ -2073,11 +2056,3 @@ packet_restore_state(void)
add_recv_bytes(len);
}
}
-
-#ifdef NONE_CIPHER_ENABLED
-int
-packet_get_authentication_state(void)
-{
- return (active_state->after_authentication);
-}
-#endif
diff --git a/crypto/openssh/packet.h b/crypto/openssh/packet.h
index 524b920..f8edf85 100644
--- a/crypto/openssh/packet.h
+++ b/crypto/openssh/packet.h
@@ -1,5 +1,4 @@
/* $OpenBSD: packet.h,v 1.59 2013/07/12 00:19:59 djm Exp $ */
-/* $FreeBSD$ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
@@ -39,9 +38,6 @@ void packet_set_interactive(int, int, int);
int packet_is_interactive(void);
void packet_set_server(void);
void packet_set_authenticated(void);
-#ifdef NONE_CIPHER_ENABLED
-int packet_get_authentication_state(void);
-#endif
void packet_start(u_char);
void packet_put_char(int ch);
@@ -119,9 +115,6 @@ do { \
} while (0)
int packet_need_rekeying(void);
-#ifdef NONE_CIPHER_ENABLED
-void packet_request_rekeying(void);
-#endif
void packet_set_rekey_limits(u_int32_t, time_t);
time_t packet_get_rekey_timeout(void);
diff --git a/crypto/openssh/pathnames.h b/crypto/openssh/pathnames.h
index 0029e4a..e53d67a 100644
--- a/crypto/openssh/pathnames.h
+++ b/crypto/openssh/pathnames.h
@@ -1,4 +1,5 @@
/* $OpenBSD: pathnames.h,v 1.24 2013/12/06 13:39:49 markus Exp $ */
+/* $FreeBSD$ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
diff --git a/crypto/openssh/readconf.c b/crypto/openssh/readconf.c
index 16f62fe..df8387c 100644
--- a/crypto/openssh/readconf.c
+++ b/crypto/openssh/readconf.c
@@ -1,5 +1,4 @@
/* $OpenBSD: readconf.c,v 1.218 2014/02/23 20:11:36 djm Exp $ */
-/* $FreeBSD$ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -153,12 +152,8 @@ typedef enum {
oKexAlgorithms, oIPQoS, oRequestTTY, oIgnoreUnknown, oProxyUseFdpass,
oCanonicalDomains, oCanonicalizeHostname, oCanonicalizeMaxDots,
oCanonicalizeFallbackLocal, oCanonicalizePermittedCNAMEs,
- oIgnoredUnknownOption,
- oHPNDisabled, oHPNBufferSize, oTcpRcvBufPoll, oTcpRcvBuf,
-#ifdef NONE_CIPHER_ENABLED
- oNoneEnabled, oNoneSwitch,
-#endif
- oVersionAddendum, oDeprecated, oUnsupported
+ oVersionAddendum,
+ oIgnoredUnknownOption, oDeprecated, oUnsupported
} OpCodes;
/* Textual representations of the tokens. */
@@ -271,14 +266,10 @@ static struct {
{ "canonicalizemaxdots", oCanonicalizeMaxDots },
{ "canonicalizepermittedcnames", oCanonicalizePermittedCNAMEs },
{ "ignoreunknown", oIgnoreUnknown },
- { "hpndisabled", oHPNDisabled },
- { "hpnbuffersize", oHPNBufferSize },
- { "tcprcvbufpoll", oTcpRcvBufPoll },
- { "tcprcvbuf", oTcpRcvBuf },
-#ifdef NONE_CIPHER_ENABLED
- { "noneenabled", oNoneEnabled },
- { "noneswitch", oNoneSwitch },
-#endif
+ { "hpndisabled", oDeprecated },
+ { "hpnbuffersize", oDeprecated },
+ { "tcprcvbufpoll", oDeprecated },
+ { "tcprcvbuf", oDeprecated },
{ "versionaddendum", oVersionAddendum },
{ NULL, oBadOption }
@@ -1360,47 +1351,6 @@ parse_int:
multistate_ptr = multistate_requesttty;
goto parse_multistate;
- case oHPNDisabled:
- intptr = &options->hpn_disabled;
- goto parse_flag;
-
- case oHPNBufferSize:
- intptr = &options->hpn_buffer_size;
- goto parse_int;
-
- case oTcpRcvBufPoll:
- intptr = &options->tcp_rcv_buf_poll;
- goto parse_flag;
-
- case oTcpRcvBuf:
- intptr = &options->tcp_rcv_buf;
- goto parse_int;
-
-#ifdef NONE_CIPHER_ENABLED
- case oNoneEnabled:
- intptr = &options->none_enabled;
- goto parse_flag;
-
- /*
- * We check to see if the command comes from the command line or not.
- * If it does then enable it otherwise fail. NONE must never be a
- * default configuration.
- */
- case oNoneSwitch:
- if (strcmp(filename,"command-line") == 0) {
- intptr = &options->none_switch;
- goto parse_flag;
- } else {
- debug("NoneSwitch directive found in %.200s.",
- filename);
- error("NoneSwitch is found in %.200s.\n"
- "You may only use this configuration option "
- "from the command line", filename);
- error("Continuing...");
- return 0;
- }
-#endif
-
case oVersionAddendum:
if (s == NULL)
fatal("%.200s line %d: Missing argument.", filename,
@@ -1656,14 +1606,6 @@ initialize_options(Options * options)
options->canonicalize_fallback_local = -1;
options->canonicalize_hostname = -1;
options->version_addendum = NULL;
- options->hpn_disabled = -1;
- options->hpn_buffer_size = -1;
- options->tcp_rcv_buf_poll = -1;
- options->tcp_rcv_buf = -1;
-#ifdef NONE_CIPHER_ENABLED
- options->none_enabled = -1;
- options->none_switch = -1;
-#endif
}
/*
@@ -1858,36 +1800,6 @@ fill_default_options(Options * options)
/* options->preferred_authentications will be set in ssh */
if (options->version_addendum == NULL)
options->version_addendum = xstrdup(SSH_VERSION_FREEBSD);
- if (options->hpn_disabled == -1)
- options->hpn_disabled = 0;
- if (options->hpn_buffer_size > -1)
- {
- u_int maxlen;
-
- /* If a user tries to set the size to 0 set it to 1KB. */
- if (options->hpn_buffer_size == 0)
- options->hpn_buffer_size = 1024;
- /* Limit the buffer to BUFFER_MAX_LEN. */
- maxlen = buffer_get_max_len();
- if (options->hpn_buffer_size > (maxlen / 1024)) {
- debug("User requested buffer larger than %ub: %ub. "
- "Request reverted to %ub", maxlen,
- options->hpn_buffer_size * 1024, maxlen);
- options->hpn_buffer_size = maxlen;
- }
- debug("hpn_buffer_size set to %d", options->hpn_buffer_size);
- }
- if (options->tcp_rcv_buf == 0)
- options->tcp_rcv_buf = 1;
- if (options->tcp_rcv_buf > -1)
- options->tcp_rcv_buf *= 1024;
- if (options->tcp_rcv_buf_poll == -1)
- options->tcp_rcv_buf_poll = 1;
-#ifdef NONE_CIPHER_ENABLED
- /* options->none_enabled must not be set by default */
- if (options->none_switch == -1)
- options->none_switch = 0;
-#endif
}
/*
diff --git a/crypto/openssh/readconf.h b/crypto/openssh/readconf.h
index 17a6003..8ce8fec 100644
--- a/crypto/openssh/readconf.h
+++ b/crypto/openssh/readconf.h
@@ -154,21 +154,9 @@ typedef struct {
int num_permitted_cnames;
struct allowed_cname permitted_cnames[MAX_CANON_DOMAINS];
- char *ignored_unknown; /* Pattern list of unknown tokens to ignore */
-
char *version_addendum; /* Appended to SSH banner */
- int hpn_disabled; /* Switch to disable HPN buffer management. */
- int hpn_buffer_size; /* User definable size for HPN buffer
- * window. */
- int tcp_rcv_buf_poll; /* Option to poll recv buf every window
- * transfer. */
- int tcp_rcv_buf; /* User switch to set tcp recv buffer. */
-
-#ifdef NONE_CIPHER_ENABLED
- int none_enabled; /* Allow none to be used */
- int none_switch; /* Use none cipher */
-#endif
+ char *ignored_unknown; /* Pattern list of unknown tokens to ignore */
} Options;
#define SSH_CANONICALISE_NO 0
diff --git a/crypto/openssh/schnorr.c b/crypto/openssh/schnorr.c
deleted file mode 100644
index 7714182..0000000
--- a/crypto/openssh/schnorr.c
+++ /dev/null
@@ -1,672 +0,0 @@
-/* $OpenBSD: schnorr.c,v 1.9 2014/01/09 23:20:00 djm Exp $ */
-/* $FreeBSD$ */
-/*
- * Copyright (c) 2008 Damien Miller. All rights reserved.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-/*
- * Implementation of Schnorr signatures / zero-knowledge proofs, based on
- * description in:
- *
- * F. Hao, P. Ryan, "Password Authenticated Key Exchange by Juggling",
- * 16th Workshop on Security Protocols, Cambridge, April 2008
- *
- * http://grouper.ieee.org/groups/1363/Research/contributions/hao-ryan-2008.pdf
- */
-
-#include "includes.h"
-
-#include <sys/types.h>
-
-#include <string.h>
-#include <stdarg.h>
-#include <stdio.h>
-
-#include <openssl/evp.h>
-#include <openssl/bn.h>
-
-#include "xmalloc.h"
-#include "buffer.h"
-#include "log.h"
-
-#include "schnorr.h"
-#include "digest.h"
-
-#ifdef JPAKE
-
-#include "openbsd-compat/openssl-compat.h"
-
-/* #define SCHNORR_DEBUG */ /* Privacy-violating debugging */
-/* #define SCHNORR_MAIN */ /* Include main() selftest */
-
-#ifndef SCHNORR_DEBUG
-# define SCHNORR_DEBUG_BN(a)
-# define SCHNORR_DEBUG_BUF(a)
-#else
-# define SCHNORR_DEBUG_BN(a) debug3_bn a
-# define SCHNORR_DEBUG_BUF(a) debug3_buf a
-#endif /* SCHNORR_DEBUG */
-
-/*
- * Calculate hash component of Schnorr signature H(g || g^v || g^x || id)
- * using the hash function defined by "hash_alg". Returns signature as
- * bignum or NULL on error.
- */
-static BIGNUM *
-schnorr_hash(const BIGNUM *p, const BIGNUM *q, const BIGNUM *g,
- int hash_alg, const BIGNUM *g_v, const BIGNUM *g_x,
- const u_char *id, u_int idlen)
-{
- u_char *digest;
- u_int digest_len;
- BIGNUM *h;
- Buffer b;
- int success = -1;
-
- if ((h = BN_new()) == NULL) {
- error("%s: BN_new", __func__);
- return NULL;
- }
-
- buffer_init(&b);
-
- /* h = H(g || p || q || g^v || g^x || id) */
- buffer_put_bignum2(&b, g);
- buffer_put_bignum2(&b, p);
- buffer_put_bignum2(&b, q);
- buffer_put_bignum2(&b, g_v);
- buffer_put_bignum2(&b, g_x);
- buffer_put_string(&b, id, idlen);
-
- SCHNORR_DEBUG_BUF((buffer_ptr(&b), buffer_len(&b),
- "%s: hashblob", __func__));
- if (hash_buffer(buffer_ptr(&b), buffer_len(&b), hash_alg,
- &digest, &digest_len) != 0) {
- error("%s: hash_buffer", __func__);
- goto out;
- }
- if (BN_bin2bn(digest, (int)digest_len, h) == NULL) {
- error("%s: BN_bin2bn", __func__);
- goto out;
- }
- success = 0;
- SCHNORR_DEBUG_BN((h, "%s: h = ", __func__));
- out:
- buffer_free(&b);
- bzero(digest, digest_len);
- free(digest);
- digest_len = 0;
- if (success == 0)
- return h;
- BN_clear_free(h);
- return NULL;
-}
-
-/*
- * Generate Schnorr signature to prove knowledge of private value 'x' used
- * in public exponent g^x, under group defined by 'grp_p', 'grp_q' and 'grp_g'
- * using the hash function "hash_alg".
- * 'idlen' bytes from 'id' will be included in the signature hash as an anti-
- * replay salt.
- *
- * On success, 0 is returned. The signature values are returned as *e_p
- * (g^v mod p) and *r_p (v - xh mod q). The caller must free these values.
- * On failure, -1 is returned.
- */
-int
-schnorr_sign(const BIGNUM *grp_p, const BIGNUM *grp_q, const BIGNUM *grp_g,
- int hash_alg, const BIGNUM *x, const BIGNUM *g_x,
- const u_char *id, u_int idlen, BIGNUM **r_p, BIGNUM **e_p)
-{
- int success = -1;
- BIGNUM *h, *tmp, *v, *g_v, *r;
- BN_CTX *bn_ctx;
-
- SCHNORR_DEBUG_BN((x, "%s: x = ", __func__));
- SCHNORR_DEBUG_BN((g_x, "%s: g_x = ", __func__));
-
- /* Avoid degenerate cases: g^0 yields a spoofable signature */
- if (BN_cmp(g_x, BN_value_one()) <= 0) {
- error("%s: g_x < 1", __func__);
- return -1;
- }
- if (BN_cmp(g_x, grp_p) >= 0) {
- error("%s: g_x > g", __func__);
- return -1;
- }
-
- h = g_v = r = tmp = v = NULL;
- if ((bn_ctx = BN_CTX_new()) == NULL) {
- error("%s: BN_CTX_new", __func__);
- goto out;
- }
- if ((g_v = BN_new()) == NULL ||
- (r = BN_new()) == NULL ||
- (tmp = BN_new()) == NULL) {
- error("%s: BN_new", __func__);
- goto out;
- }
-
- /*
- * v must be a random element of Zq, so 1 <= v < q
- * we also exclude v = 1, since g^1 looks dangerous
- */
- if ((v = bn_rand_range_gt_one(grp_p)) == NULL) {
- error("%s: bn_rand_range2", __func__);
- goto out;
- }
- SCHNORR_DEBUG_BN((v, "%s: v = ", __func__));
-
- /* g_v = g^v mod p */
- if (BN_mod_exp(g_v, grp_g, v, grp_p, bn_ctx) == -1) {
- error("%s: BN_mod_exp (g^v mod p)", __func__);
- goto out;
- }
- SCHNORR_DEBUG_BN((g_v, "%s: g_v = ", __func__));
-
- /* h = H(g || g^v || g^x || id) */
- if ((h = schnorr_hash(grp_p, grp_q, grp_g, hash_alg, g_v, g_x,
- id, idlen)) == NULL) {
- error("%s: schnorr_hash failed", __func__);
- goto out;
- }
-
- /* r = v - xh mod q */
- if (BN_mod_mul(tmp, x, h, grp_q, bn_ctx) == -1) {
- error("%s: BN_mod_mul (tmp = xv mod q)", __func__);
- goto out;
- }
- if (BN_mod_sub(r, v, tmp, grp_q, bn_ctx) == -1) {
- error("%s: BN_mod_mul (r = v - tmp)", __func__);
- goto out;
- }
- SCHNORR_DEBUG_BN((g_v, "%s: e = ", __func__));
- SCHNORR_DEBUG_BN((r, "%s: r = ", __func__));
-
- *e_p = g_v;
- *r_p = r;
-
- success = 0;
- out:
- BN_CTX_free(bn_ctx);
- if (h != NULL)
- BN_clear_free(h);
- if (v != NULL)
- BN_clear_free(v);
- BN_clear_free(tmp);
-
- return success;
-}
-
-/*
- * Generate Schnorr signature to prove knowledge of private value 'x' used
- * in public exponent g^x, under group defined by 'grp_p', 'grp_q' and 'grp_g'
- * using a SHA256 hash.
- * 'idlen' bytes from 'id' will be included in the signature hash as an anti-
- * replay salt.
- * On success, 0 is returned and *siglen bytes of signature are returned in
- * *sig (caller to free). Returns -1 on failure.
- */
-int
-schnorr_sign_buf(const BIGNUM *grp_p, const BIGNUM *grp_q, const BIGNUM *grp_g,
- const BIGNUM *x, const BIGNUM *g_x, const u_char *id, u_int idlen,
- u_char **sig, u_int *siglen)
-{
- Buffer b;
- BIGNUM *r, *e;
-
- if (schnorr_sign(grp_p, grp_q, grp_g, SSH_DIGEST_SHA256,
- x, g_x, id, idlen, &r, &e) != 0)
- return -1;
-
- /* Signature is (e, r) */
- buffer_init(&b);
- /* XXX sigtype-hash as string? */
- buffer_put_bignum2(&b, e);
- buffer_put_bignum2(&b, r);
- *siglen = buffer_len(&b);
- *sig = xmalloc(*siglen);
- memcpy(*sig, buffer_ptr(&b), *siglen);
- SCHNORR_DEBUG_BUF((buffer_ptr(&b), buffer_len(&b),
- "%s: sigblob", __func__));
- buffer_free(&b);
-
- BN_clear_free(r);
- BN_clear_free(e);
-
- return 0;
-}
-
-/*
- * Verify Schnorr signature { r (v - xh mod q), e (g^v mod p) } against
- * public exponent g_x (g^x) under group defined by 'grp_p', 'grp_q' and
- * 'grp_g' using hash "hash_alg".
- * Signature hash will be salted with 'idlen' bytes from 'id'.
- * Returns -1 on failure, 0 on incorrect signature or 1 on matching signature.
- */
-int
-schnorr_verify(const BIGNUM *grp_p, const BIGNUM *grp_q, const BIGNUM *grp_g,
- int hash_alg, const BIGNUM *g_x, const u_char *id, u_int idlen,
- const BIGNUM *r, const BIGNUM *e)
-{
- int success = -1;
- BIGNUM *h = NULL, *g_xh = NULL, *g_r = NULL, *gx_q = NULL;
- BIGNUM *expected = NULL;
- BN_CTX *bn_ctx;
-
- SCHNORR_DEBUG_BN((g_x, "%s: g_x = ", __func__));
-
- /* Avoid degenerate cases: g^0 yields a spoofable signature */
- if (BN_cmp(g_x, BN_value_one()) <= 0) {
- error("%s: g_x <= 1", __func__);
- return -1;
- }
- if (BN_cmp(g_x, grp_p) >= 0) {
- error("%s: g_x >= p", __func__);
- return -1;
- }
-
- h = g_xh = g_r = expected = NULL;
- if ((bn_ctx = BN_CTX_new()) == NULL) {
- error("%s: BN_CTX_new", __func__);
- goto out;
- }
- if ((g_xh = BN_new()) == NULL ||
- (g_r = BN_new()) == NULL ||
- (gx_q = BN_new()) == NULL ||
- (expected = BN_new()) == NULL) {
- error("%s: BN_new", __func__);
- goto out;
- }
-
- SCHNORR_DEBUG_BN((e, "%s: e = ", __func__));
- SCHNORR_DEBUG_BN((r, "%s: r = ", __func__));
-
- /* gx_q = (g^x)^q must === 1 mod p */
- if (BN_mod_exp(gx_q, g_x, grp_q, grp_p, bn_ctx) == -1) {
- error("%s: BN_mod_exp (g_x^q mod p)", __func__);
- goto out;
- }
- if (BN_cmp(gx_q, BN_value_one()) != 0) {
- error("%s: Invalid signature (g^x)^q != 1 mod p", __func__);
- goto out;
- }
-
- SCHNORR_DEBUG_BN((g_xh, "%s: g_xh = ", __func__));
- /* h = H(g || g^v || g^x || id) */
- if ((h = schnorr_hash(grp_p, grp_q, grp_g, hash_alg, e, g_x,
- id, idlen)) == NULL) {
- error("%s: schnorr_hash failed", __func__);
- goto out;
- }
-
- /* g_xh = (g^x)^h */
- if (BN_mod_exp(g_xh, g_x, h, grp_p, bn_ctx) == -1) {
- error("%s: BN_mod_exp (g_x^h mod p)", __func__);
- goto out;
- }
- SCHNORR_DEBUG_BN((g_xh, "%s: g_xh = ", __func__));
-
- /* g_r = g^r */
- if (BN_mod_exp(g_r, grp_g, r, grp_p, bn_ctx) == -1) {
- error("%s: BN_mod_exp (g_x^h mod p)", __func__);
- goto out;
- }
- SCHNORR_DEBUG_BN((g_r, "%s: g_r = ", __func__));
-
- /* expected = g^r * g_xh */
- if (BN_mod_mul(expected, g_r, g_xh, grp_p, bn_ctx) == -1) {
- error("%s: BN_mod_mul (expected = g_r mod p)", __func__);
- goto out;
- }
- SCHNORR_DEBUG_BN((expected, "%s: expected = ", __func__));
-
- /* Check e == expected */
- success = BN_cmp(expected, e) == 0;
- out:
- BN_CTX_free(bn_ctx);
- if (h != NULL)
- BN_clear_free(h);
- if (gx_q != NULL)
- BN_clear_free(gx_q);
- if (g_xh != NULL)
- BN_clear_free(g_xh);
- if (g_r != NULL)
- BN_clear_free(g_r);
- if (expected != NULL)
- BN_clear_free(expected);
- return success;
-}
-
-/*
- * Verify Schnorr signature 'sig' of length 'siglen' against public exponent
- * g_x (g^x) under group defined by 'grp_p', 'grp_q' and 'grp_g' using a
- * SHA256 hash.
- * Signature hash will be salted with 'idlen' bytes from 'id'.
- * Returns -1 on failure, 0 on incorrect signature or 1 on matching signature.
- */
-int
-schnorr_verify_buf(const BIGNUM *grp_p, const BIGNUM *grp_q,
- const BIGNUM *grp_g,
- const BIGNUM *g_x, const u_char *id, u_int idlen,
- const u_char *sig, u_int siglen)
-{
- Buffer b;
- int ret = -1;
- u_int rlen;
- BIGNUM *r, *e;
-
- e = r = NULL;
- if ((e = BN_new()) == NULL ||
- (r = BN_new()) == NULL) {
- error("%s: BN_new", __func__);
- goto out;
- }
-
- /* Extract g^v and r from signature blob */
- buffer_init(&b);
- buffer_append(&b, sig, siglen);
- SCHNORR_DEBUG_BUF((buffer_ptr(&b), buffer_len(&b),
- "%s: sigblob", __func__));
- buffer_get_bignum2(&b, e);
- buffer_get_bignum2(&b, r);
- rlen = buffer_len(&b);
- buffer_free(&b);
- if (rlen != 0) {
- error("%s: remaining bytes in signature %d", __func__, rlen);
- goto out;
- }
-
- ret = schnorr_verify(grp_p, grp_q, grp_g, SSH_DIGEST_SHA256,
- g_x, id, idlen, r, e);
- out:
- BN_clear_free(e);
- BN_clear_free(r);
-
- return ret;
-}
-
-/* Helper functions */
-
-/*
- * Generate uniformly distributed random number in range (1, high).
- * Return number on success, NULL on failure.
- */
-BIGNUM *
-bn_rand_range_gt_one(const BIGNUM *high)
-{
- BIGNUM *r, *tmp;
- int success = -1;
-
- if ((tmp = BN_new()) == NULL) {
- error("%s: BN_new", __func__);
- return NULL;
- }
- if ((r = BN_new()) == NULL) {
- error("%s: BN_new failed", __func__);
- goto out;
- }
- if (BN_set_word(tmp, 2) != 1) {
- error("%s: BN_set_word(tmp, 2)", __func__);
- goto out;
- }
- if (BN_sub(tmp, high, tmp) == -1) {
- error("%s: BN_sub failed (tmp = high - 2)", __func__);
- goto out;
- }
- if (BN_rand_range(r, tmp) == -1) {
- error("%s: BN_rand_range failed", __func__);
- goto out;
- }
- if (BN_set_word(tmp, 2) != 1) {
- error("%s: BN_set_word(tmp, 2)", __func__);
- goto out;
- }
- if (BN_add(r, r, tmp) == -1) {
- error("%s: BN_add failed (r = r + 2)", __func__);
- goto out;
- }
- success = 0;
- out:
- BN_clear_free(tmp);
- if (success == 0)
- return r;
- BN_clear_free(r);
- return NULL;
-}
-
-/* XXX convert all callers of this to use ssh_digest_memory() directly */
-/*
- * Hash contents of buffer 'b' with hash 'md'. Returns 0 on success,
- * with digest via 'digestp' (caller to free) and length via 'lenp'.
- * Returns -1 on failure.
- */
-int
-hash_buffer(const u_char *buf, u_int len, int hash_alg,
- u_char **digestp, u_int *lenp)
-{
- u_char digest[SSH_DIGEST_MAX_LENGTH];
- u_int digest_len = ssh_digest_bytes(hash_alg);
-
- if (digest_len == 0) {
- error("%s: invalid hash", __func__);
- return -1;
- }
- if (ssh_digest_memory(hash_alg, buf, len, digest, digest_len) != 0) {
- error("%s: digest_memory failed", __func__);
- return -1;
- }
- *digestp = xmalloc(digest_len);
- *lenp = digest_len;
- memcpy(*digestp, digest, *lenp);
- bzero(digest, sizeof(digest));
- digest_len = 0;
- return 0;
-}
-
-/* print formatted string followed by bignum */
-void
-debug3_bn(const BIGNUM *n, const char *fmt, ...)
-{
- char *out, *h;
- va_list args;
- int ret;
-
- out = NULL;
- va_start(args, fmt);
- ret = vasprintf(&out, fmt, args);
- va_end(args);
- if (ret == -1 || out == NULL)
- fatal("%s: vasprintf failed", __func__);
-
- if (n == NULL)
- debug3("%s(null)", out);
- else {
- h = BN_bn2hex(n);
- debug3("%s0x%s", out, h);
- free(h);
- }
- free(out);
-}
-
-/* print formatted string followed by buffer contents in hex */
-void
-debug3_buf(const u_char *buf, u_int len, const char *fmt, ...)
-{
- char *out, h[65];
- u_int i, j;
- va_list args;
- int ret;
-
- out = NULL;
- va_start(args, fmt);
- ret = vasprintf(&out, fmt, args);
- va_end(args);
- if (ret == -1 || out == NULL)
- fatal("%s: vasprintf failed", __func__);
-
- debug3("%s length %u%s", out, len, buf == NULL ? " (null)" : "");
- free(out);
- if (buf == NULL)
- return;
-
- *h = '\0';
- for (i = j = 0; i < len; i++) {
- snprintf(h + j, sizeof(h) - j, "%02x", buf[i]);
- j += 2;
- if (j >= sizeof(h) - 1 || i == len - 1) {
- debug3(" %s", h);
- *h = '\0';
- j = 0;
- }
- }
-}
-
-/*
- * Construct a MODP group from hex strings p (which must be a safe
- * prime) and g, automatically calculating subgroup q as (p / 2)
- */
-struct modp_group *
-modp_group_from_g_and_safe_p(const char *grp_g, const char *grp_p)
-{
- struct modp_group *ret;
-
- ret = xcalloc(1, sizeof(*ret));
- ret->p = ret->q = ret->g = NULL;
- if (BN_hex2bn(&ret->p, grp_p) == 0 ||
- BN_hex2bn(&ret->g, grp_g) == 0)
- fatal("%s: BN_hex2bn", __func__);
- /* Subgroup order is p/2 (p is a safe prime) */
- if ((ret->q = BN_new()) == NULL)
- fatal("%s: BN_new", __func__);
- if (BN_rshift1(ret->q, ret->p) != 1)
- fatal("%s: BN_rshift1", __func__);
-
- return ret;
-}
-
-void
-modp_group_free(struct modp_group *grp)
-{
- if (grp->g != NULL)
- BN_clear_free(grp->g);
- if (grp->p != NULL)
- BN_clear_free(grp->p);
- if (grp->q != NULL)
- BN_clear_free(grp->q);
- bzero(grp, sizeof(*grp));
- free(grp);
-}
-
-/* main() function for self-test */
-
-#ifdef SCHNORR_MAIN
-static void
-schnorr_selftest_one(const BIGNUM *grp_p, const BIGNUM *grp_q,
- const BIGNUM *grp_g, const BIGNUM *x)
-{
- BIGNUM *g_x;
- u_char *sig;
- u_int siglen;
- BN_CTX *bn_ctx;
-
- if ((bn_ctx = BN_CTX_new()) == NULL)
- fatal("%s: BN_CTX_new", __func__);
- if ((g_x = BN_new()) == NULL)
- fatal("%s: BN_new", __func__);
-
- if (BN_mod_exp(g_x, grp_g, x, grp_p, bn_ctx) == -1)
- fatal("%s: g_x", __func__);
- if (schnorr_sign_buf(grp_p, grp_q, grp_g, x, g_x, "junk", 4,
- &sig, &siglen))
- fatal("%s: schnorr_sign", __func__);
- if (schnorr_verify_buf(grp_p, grp_q, grp_g, g_x, "junk", 4,
- sig, siglen) != 1)
- fatal("%s: verify fail", __func__);
- if (schnorr_verify_buf(grp_p, grp_q, grp_g, g_x, "JUNK", 4,
- sig, siglen) != 0)
- fatal("%s: verify should have failed (bad ID)", __func__);
- sig[4] ^= 1;
- if (schnorr_verify_buf(grp_p, grp_q, grp_g, g_x, "junk", 4,
- sig, siglen) != 0)
- fatal("%s: verify should have failed (bit error)", __func__);
- free(sig);
- BN_free(g_x);
- BN_CTX_free(bn_ctx);
-}
-
-static void
-schnorr_selftest(void)
-{
- BIGNUM *x;
- struct modp_group *grp;
- u_int i;
- char *hh;
-
- grp = jpake_default_group();
- if ((x = BN_new()) == NULL)
- fatal("%s: BN_new", __func__);
- SCHNORR_DEBUG_BN((grp->p, "%s: grp->p = ", __func__));
- SCHNORR_DEBUG_BN((grp->q, "%s: grp->q = ", __func__));
- SCHNORR_DEBUG_BN((grp->g, "%s: grp->g = ", __func__));
-
- /* [1, 20) */
- for (i = 1; i < 20; i++) {
- printf("x = %u\n", i);
- fflush(stdout);
- if (BN_set_word(x, i) != 1)
- fatal("%s: set x word", __func__);
- schnorr_selftest_one(grp->p, grp->q, grp->g, x);
- }
-
- /* 100 x random [0, p) */
- for (i = 0; i < 100; i++) {
- if (BN_rand_range(x, grp->p) != 1)
- fatal("%s: BN_rand_range", __func__);
- hh = BN_bn2hex(x);
- printf("x = (random) 0x%s\n", hh);
- free(hh);
- fflush(stdout);
- schnorr_selftest_one(grp->p, grp->q, grp->g, x);
- }
-
- /* [q-20, q) */
- if (BN_set_word(x, 20) != 1)
- fatal("%s: BN_set_word (x = 20)", __func__);
- if (BN_sub(x, grp->q, x) != 1)
- fatal("%s: BN_sub (q - x)", __func__);
- for (i = 0; i < 19; i++) {
- hh = BN_bn2hex(x);
- printf("x = (q - %d) 0x%s\n", 20 - i, hh);
- free(hh);
- fflush(stdout);
- schnorr_selftest_one(grp->p, grp->q, grp->g, x);
- if (BN_add(x, x, BN_value_one()) != 1)
- fatal("%s: BN_add (x + 1)", __func__);
- }
- BN_free(x);
-}
-
-int
-main(int argc, char **argv)
-{
- log_init(argv[0], SYSLOG_LEVEL_DEBUG3, SYSLOG_FACILITY_USER, 1);
-
- schnorr_selftest();
- return 0;
-}
-#endif
-
-#endif
diff --git a/crypto/openssh/scp.1 b/crypto/openssh/scp.1
index c23e372..3b67cff 100644
--- a/crypto/openssh/scp.1
+++ b/crypto/openssh/scp.1
@@ -10,7 +10,7 @@
.\"
.\" $OpenBSD: scp.1,v 1.61 2013/10/20 09:51:26 djm Exp $
.\"
-.Dd October 20, 2013
+.Dd $Mdocdate: October 20 2013 $
.Dt SCP 1
.Os
.Sh NAME
diff --git a/crypto/openssh/servconf.c b/crypto/openssh/servconf.c
index 42f5e4b..61fe7a9 100644
--- a/crypto/openssh/servconf.c
+++ b/crypto/openssh/servconf.c
@@ -1,6 +1,5 @@
/* $OpenBSD: servconf.c,v 1.249 2014/01/29 06:18:35 djm Exp $ */
-/* $FreeBSD$ */
/*
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
* All rights reserved
@@ -156,12 +155,6 @@ initialize_server_options(ServerOptions *options)
options->ip_qos_interactive = -1;
options->ip_qos_bulk = -1;
options->version_addendum = NULL;
- options->hpn_disabled = -1;
- options->hpn_buffer_size = -1;
- options->tcp_rcv_buf_poll = -1;
-#ifdef NONE_CIPHER_ENABLED
- options->none_enabled = -1;
-#endif
}
void
@@ -322,38 +315,6 @@ fill_default_server_options(ServerOptions *options)
}
#endif
- if (options->hpn_disabled == -1)
- options->hpn_disabled = 0;
- if (options->hpn_buffer_size == -1) {
- /*
- * HPN buffer size option not explicitly set. Try to figure
- * out what value to use or resort to default.
- */
- options->hpn_buffer_size = CHAN_SES_WINDOW_DEFAULT;
- if (!options->hpn_disabled) {
- sock_get_rcvbuf(&options->hpn_buffer_size, 0);
- debug ("HPN Buffer Size: %d", options->hpn_buffer_size);
- }
- } else {
- /*
- * In the case that the user sets both values in a
- * contradictory manner hpn_disabled overrrides hpn_buffer_size.
- */
- if (options->hpn_disabled <= 0) {
- u_int maxlen;
-
- maxlen = buffer_get_max_len();
- if (options->hpn_buffer_size == 0)
- options->hpn_buffer_size = 1;
- /* Limit the maximum buffer to BUFFER_MAX_LEN. */
- if (options->hpn_buffer_size > maxlen / 1024)
- options->hpn_buffer_size = maxlen;
- else
- options->hpn_buffer_size *= 1024;
- } else {
- options->hpn_buffer_size = CHAN_TCP_WINDOW_DEFAULT;
- }
- }
}
/* Keyword tokens. */
@@ -389,10 +350,6 @@ typedef enum {
sKexAlgorithms, sIPQoS, sVersionAddendum,
sAuthorizedKeysCommand, sAuthorizedKeysCommandUser,
sAuthenticationMethods, sHostKeyAgent,
- sHPNDisabled, sHPNBufferSize, sTcpRcvBufPoll,
-#ifdef NONE_CIPHER_ENABLED
- sNoneEnabled,
-#endif
sDeprecated, sUnsupported
} ServerOpCodes;
@@ -519,12 +476,10 @@ static struct {
{ "authorizedkeyscommanduser", sAuthorizedKeysCommandUser, SSHCFG_ALL },
{ "versionaddendum", sVersionAddendum, SSHCFG_GLOBAL },
{ "authenticationmethods", sAuthenticationMethods, SSHCFG_ALL },
- { "hpndisabled", sHPNDisabled, SSHCFG_ALL },
- { "hpnbuffersize", sHPNBufferSize, SSHCFG_ALL },
- { "tcprcvbufpoll", sTcpRcvBufPoll, SSHCFG_ALL },
-#ifdef NONE_CIPHER_ENABLED
- { "noneenabled", sNoneEnabled, SSHCFG_ALL },
-#endif
+ { "noneenabled", sUnsupported, SSHCFG_ALL },
+ { "hpndisabled", sDeprecated, SSHCFG_ALL },
+ { "hpnbuffersize", sDeprecated, SSHCFG_ALL },
+ { "tcprcvbufpoll", sDeprecated, SSHCFG_ALL },
{ NULL, sBadOption, 0 }
};
@@ -1671,24 +1626,6 @@ process_server_config_line(ServerOptions *options, char *line,
}
return 0;
- case sHPNDisabled:
- intptr = &options->hpn_disabled;
- goto parse_flag;
-
- case sHPNBufferSize:
- intptr = &options->hpn_buffer_size;
- goto parse_int;
-
- case sTcpRcvBufPoll:
- intptr = &options->tcp_rcv_buf_poll;
- goto parse_flag;
-
-#ifdef NONE_CIPHER_ENABLED
- case sNoneEnabled:
- intptr = &options->none_enabled;
- goto parse_flag;
-#endif
-
case sDeprecated:
logit("%s line %d: Deprecated option %s",
filename, linenum, arg);
diff --git a/crypto/openssh/servconf.h b/crypto/openssh/servconf.h
index 36d9966..752d1c5 100644
--- a/crypto/openssh/servconf.h
+++ b/crypto/openssh/servconf.h
@@ -1,5 +1,4 @@
/* $OpenBSD: servconf.h,v 1.112 2014/01/29 06:18:35 djm Exp $ */
-/* $FreeBSD$ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
@@ -182,16 +181,8 @@ typedef struct {
char *version_addendum; /* Appended to SSH banner */
- int hpn_disabled; /* Disable HPN functionality. */
- int hpn_buffer_size; /* Set HPN buffer size - default 2MB.*/
- int tcp_rcv_buf_poll; /* Poll TCP rcv window in autotuning
- * kernels. */
u_int num_auth_methods;
char *auth_methods[MAX_AUTH_METHODS];
-
-#ifdef NONE_CIPHER_ENABLED
- int none_enabled; /* Enable NONE cipher switch. */
-#endif
} ServerOptions;
/* Information about the incoming connection as used by Match */
diff --git a/crypto/openssh/serverloop.c b/crypto/openssh/serverloop.c
index 769bfec..2f8e3a0 100644
--- a/crypto/openssh/serverloop.c
+++ b/crypto/openssh/serverloop.c
@@ -1,5 +1,4 @@
/* $OpenBSD: serverloop.c,v 1.170 2014/02/02 03:44:31 djm Exp $ */
-/* $FreeBSD$ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -1016,14 +1015,8 @@ server_request_tun(void)
sock = tun_open(tun, mode);
if (sock < 0)
goto done;
- if (options.hpn_disabled)
- c = channel_new("tun", SSH_CHANNEL_OPEN, sock, sock, -1,
- CHAN_TCP_WINDOW_DEFAULT, CHAN_TCP_PACKET_DEFAULT, 0,
- "tun", 1);
- else
- c = channel_new("tun", SSH_CHANNEL_OPEN, sock, sock, -1,
- options.hpn_buffer_size, CHAN_TCP_PACKET_DEFAULT, 0,
- "tun", 1);
+ c = channel_new("tun", SSH_CHANNEL_OPEN, sock, sock, -1,
+ CHAN_TCP_WINDOW_DEFAULT, CHAN_TCP_PACKET_DEFAULT, 0, "tun", 1);
c->datagram = 1;
#if defined(SSH_TUN_FILTER)
if (mode == SSH_TUNMODE_POINTOPOINT)
@@ -1059,8 +1052,6 @@ server_request_session(void)
c = channel_new("session", SSH_CHANNEL_LARVAL,
-1, -1, -1, /*window size*/0, CHAN_SES_PACKET_DEFAULT,
0, "server-session", 1);
- if (!options.hpn_disabled && options.tcp_rcv_buf_poll)
- c->dynamic_window = 1;
if (session_open(the_authctxt, c->self) != 1) {
debug("session open failed, free channel %d", c->self);
channel_free(c);
diff --git a/crypto/openssh/session.c b/crypto/openssh/session.c
index 9fe6a1a..1de0c60 100644
--- a/crypto/openssh/session.c
+++ b/crypto/openssh/session.c
@@ -1,5 +1,4 @@
/* $OpenBSD: session.c,v 1.270 2014/01/31 16:39:19 tedu Exp $ */
-/* $FreeBSD$ */
/*
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
* All rights reserved
@@ -238,10 +237,7 @@ auth_input_request_forwarding(struct passwd * pw)
goto authsock_err;
}
- /*
- * Allocate a channel for the authentication agent socket.
- * Ignore HPN on that one given no improvement expected.
- */
+ /* Allocate a channel for the authentication agent socket. */
nc = channel_new("auth socket",
SSH_CHANNEL_AUTH_SOCKET, sock, sock, -1,
CHAN_X11_WINDOW_DEFAULT, CHAN_X11_PACKET_DEFAULT,
@@ -2347,14 +2343,10 @@ session_set_fds(Session *s, int fdin, int fdout, int fderr, int ignore_fderr,
*/
if (s->chanid == -1)
fatal("no channel for session %d", s->self);
- if (options.hpn_disabled)
- channel_set_fds(s->chanid, fdout, fdin, fderr,
- ignore_fderr ? CHAN_EXTENDED_IGNORE : CHAN_EXTENDED_READ,
- 1, is_tty, CHAN_SES_WINDOW_DEFAULT);
- else
- channel_set_fds(s->chanid, fdout, fdin, fderr,
- ignore_fderr ? CHAN_EXTENDED_IGNORE : CHAN_EXTENDED_READ,
- 1, is_tty, options.hpn_buffer_size);
+ channel_set_fds(s->chanid,
+ fdout, fdin, fderr,
+ ignore_fderr ? CHAN_EXTENDED_IGNORE : CHAN_EXTENDED_READ,
+ 1, is_tty, CHAN_SES_WINDOW_DEFAULT);
}
/*
diff --git a/crypto/openssh/sftp-common.c b/crypto/openssh/sftp-common.c
index d7f8837..b546a9f 100644
--- a/crypto/openssh/sftp-common.c
+++ b/crypto/openssh/sftp-common.c
@@ -25,6 +25,7 @@
*/
#include "includes.h"
+__RCSID("$FreeBSD$");
#include <sys/types.h>
#include <sys/stat.h>
diff --git a/crypto/openssh/sftp-server.8 b/crypto/openssh/sftp-server.8
index 4407045..1e0b277 100644
--- a/crypto/openssh/sftp-server.8
+++ b/crypto/openssh/sftp-server.8
@@ -1,5 +1,4 @@
.\" $OpenBSD: sftp-server.8,v 1.25 2013/10/14 14:18:56 jmc Exp $
-.\" $FreeBSD$
.\"
.\" Copyright (c) 2000 Markus Friedl. All rights reserved.
.\"
@@ -23,7 +22,7 @@
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.Dd October 14, 2013
+.Dd $Mdocdate: October 14 2013 $
.Dt SFTP-SERVER 8
.Os
.Sh NAME
diff --git a/crypto/openssh/sftp.1 b/crypto/openssh/sftp.1
index b97f62c..a700c2a 100644
--- a/crypto/openssh/sftp.1
+++ b/crypto/openssh/sftp.1
@@ -1,5 +1,4 @@
.\" $OpenBSD: sftp.1,v 1.97 2013/10/20 09:51:26 djm Exp $
-.\" $FreeBSD$
.\"
.\" Copyright (c) 2001 Damien Miller. All rights reserved.
.\"
@@ -23,7 +22,7 @@
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.Dd October 20, 2013
+.Dd $Mdocdate: October 20 2013 $
.Dt SFTP 1
.Os
.Sh NAME
@@ -262,8 +261,7 @@ diagnostic messages from
Specify how many requests may be outstanding at any one time.
Increasing this may slightly improve file transfer speed
but will increase memory usage.
-The default is 256 outstanding requests providing for 8MB
-of outstanding data with a 32KB buffer.
+The default is 64 outstanding requests.
.It Fl r
Recursively copy entire directories when uploading and downloading.
Note that
diff --git a/crypto/openssh/sftp.c b/crypto/openssh/sftp.c
index c6c88ef..ad1f8c8 100644
--- a/crypto/openssh/sftp.c
+++ b/crypto/openssh/sftp.c
@@ -1,5 +1,4 @@
/* $OpenBSD: sftp.c,v 1.158 2013/11/20 20:54:10 deraadt Exp $ */
-/* $FreeBSD$ */
/*
* Copyright (c) 2001-2004 Damien Miller <djm@openbsd.org>
*
@@ -69,7 +68,7 @@ typedef void EditLine;
#include "sftp-client.h"
#define DEFAULT_COPY_BUFLEN 32768 /* Size of buffer for up/download */
-#define DEFAULT_NUM_REQUESTS 256 /* # concurrent outstanding requests */
+#define DEFAULT_NUM_REQUESTS 64 /* # concurrent outstanding requests */
/* File to read commands from */
FILE* infile;
diff --git a/crypto/openssh/ssh-add.1 b/crypto/openssh/ssh-add.1
index b2d5c5d..4812448 100644
--- a/crypto/openssh/ssh-add.1
+++ b/crypto/openssh/ssh-add.1
@@ -35,7 +35,7 @@
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.Dd December 7, 2013
+.Dd $Mdocdate: December 7 2013 $
.Dt SSH-ADD 1
.Os
.Sh NAME
diff --git a/crypto/openssh/ssh-agent.1 b/crypto/openssh/ssh-agent.1
index 2a1c58e..90b8fe5 100644
--- a/crypto/openssh/ssh-agent.1
+++ b/crypto/openssh/ssh-agent.1
@@ -35,7 +35,7 @@
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.Dd December 7, 2013
+.Dd $Mdocdate: December 7 2013 $
.Dt SSH-AGENT 1
.Os
.Sh NAME
diff --git a/crypto/openssh/ssh-gss.h b/crypto/openssh/ssh-gss.h
index a2f556c..64d1551 100644
--- a/crypto/openssh/ssh-gss.h
+++ b/crypto/openssh/ssh-gss.h
@@ -1,4 +1,5 @@
/* $OpenBSD: ssh-gss.h,v 1.11 2014/02/26 20:28:44 djm Exp $ */
+/* $FreeBSD$ */
/*
* Copyright (c) 2001-2003 Simon Wilkinson. All rights reserved.
*
diff --git a/crypto/openssh/ssh-keygen.1 b/crypto/openssh/ssh-keygen.1
index 6adb202..12e00d4 100644
--- a/crypto/openssh/ssh-keygen.1
+++ b/crypto/openssh/ssh-keygen.1
@@ -1,5 +1,4 @@
.\" $OpenBSD: ssh-keygen.1,v 1.120 2014/02/05 20:13:25 naddy Exp $
-.\" $FreeBSD$
.\"
.\" Author: Tatu Ylonen <ylo@cs.hut.fi>
.\" Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -36,7 +35,7 @@
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.Dd February 5, 2014
+.Dd $Mdocdate: February 5 2014 $
.Dt SSH-KEYGEN 1
.Os
.Sh NAME
diff --git a/crypto/openssh/ssh-keyscan.1 b/crypto/openssh/ssh-keyscan.1
index 1b2fd40..dae4fd9 100644
--- a/crypto/openssh/ssh-keyscan.1
+++ b/crypto/openssh/ssh-keyscan.1
@@ -1,5 +1,4 @@
.\" $OpenBSD: ssh-keyscan.1,v 1.34 2014/01/28 14:13:39 jmc Exp $
-.\" $FreeBSD$
.\"
.\" Copyright 1995, 1996 by David Mazieres <dm@lcs.mit.edu>.
.\"
@@ -7,7 +6,7 @@
.\" permitted provided that due credit is given to the author and the
.\" OpenBSD project by leaving this copyright notice intact.
.\"
-.Dd January 28, 2014
+.Dd $Mdocdate: January 28 2014 $
.Dt SSH-KEYSCAN 1
.Os
.Sh NAME
diff --git a/crypto/openssh/ssh-keysign.8 b/crypto/openssh/ssh-keysign.8
index 5b10f29..69d0829 100644
--- a/crypto/openssh/ssh-keysign.8
+++ b/crypto/openssh/ssh-keysign.8
@@ -22,7 +22,7 @@
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.Dd December 7, 2013
+.Dd $Mdocdate: December 7 2013 $
.Dt SSH-KEYSIGN 8
.Os
.Sh NAME
diff --git a/crypto/openssh/ssh-pkcs11-helper.8 b/crypto/openssh/ssh-pkcs11-helper.8
index a5380a3..3728c4e 100644
--- a/crypto/openssh/ssh-pkcs11-helper.8
+++ b/crypto/openssh/ssh-pkcs11-helper.8
@@ -14,7 +14,7 @@
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
-.Dd July 16, 2013
+.Dd $Mdocdate: July 16 2013 $
.Dt SSH-PKCS11-HELPER 8
.Os
.Sh NAME
diff --git a/crypto/openssh/ssh.1 b/crypto/openssh/ssh.1
index 48aa748..00785ef 100644
--- a/crypto/openssh/ssh.1
+++ b/crypto/openssh/ssh.1
@@ -35,7 +35,7 @@
.\"
.\" $OpenBSD: ssh.1,v 1.343 2013/12/07 11:58:46 naddy Exp $
.\" $FreeBSD$
-.Dd December 7, 2013
+.Dd $Mdocdate: December 7 2013 $
.Dt SSH 1
.Os
.Sh NAME
diff --git a/crypto/openssh/ssh.c b/crypto/openssh/ssh.c
index 1c0784a..eaeb5c7 100644
--- a/crypto/openssh/ssh.c
+++ b/crypto/openssh/ssh.c
@@ -1,5 +1,4 @@
/* $OpenBSD: ssh.c,v 1.401 2014/02/26 20:18:37 djm Exp $ */
-/* $FreeBSD$ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -634,13 +633,11 @@ main(int ac, char **av)
case 'V':
if (options.version_addendum &&
*options.version_addendum != '\0')
- fprintf(stderr, "%s%s %s, %s\n", SSH_RELEASE,
- options.hpn_disabled ? "" : SSH_VERSION_HPN,
+ fprintf(stderr, "%s %s, %s\n", SSH_RELEASE,
options.version_addendum,
SSLeay_version(SSLEAY_VERSION));
else
- fprintf(stderr, "%s%s, %s\n", SSH_RELEASE,
- options.hpn_disabled ? "" : SSH_VERSION_HPN,
+ fprintf(stderr, "%s, %s\n", SSH_RELEASE,
SSLeay_version(SSLEAY_VERSION));
if (opt == 'V')
exit(0);
@@ -783,15 +780,6 @@ main(int ac, char **av)
break;
case 'T':
options.request_tty = REQUEST_TTY_NO;
-#ifdef NONE_CIPHER_ENABLED
- /*
- * Ensure that the user does not try to backdoor a
- * NONE cipher switch on an interactive session by
- * explicitly disabling it if the user asks for a
- * session without a tty.
- */
- options.none_switch = 0;
-#endif
break;
case 'o':
line = xstrdup(optarg);
@@ -1667,46 +1655,9 @@ ssh_session2_open(void)
if (!isatty(err))
set_nonblock(err);
- /*
- * We need to check to see what to do about buffer sizes here.
- * - In an HPN to non-HPN connection we want to limit the window size to
- * something reasonable in case the far side has the large window bug.
- * - In an HPN to HPN connection we want to use the max window size but
- * allow the user to override it.
- * - Lastly if HPN is disabled then use the ssh standard window size.
- *
- * We cannot just do a getsockopt() here and set the ssh window to that
- * as in case of autotuning of socket buffers the window would get stuck
- * at the initial buffer size, generally less than 96k. Therefore we
- * need to set the maximum ssh window size to the maximum HPN buffer
- * size unless the user has set TcpRcvBufPoll to no. In that case we
- * can just set the window to the minimum of HPN buffer size and TCP
- * receive buffer size.
- */
- if (tty_flag)
- options.hpn_buffer_size = CHAN_SES_WINDOW_DEFAULT;
- else
- options.hpn_buffer_size = CHAN_HPN_MIN_WINDOW_DEFAULT;
-
- if (datafellows & SSH_BUG_LARGEWINDOW) {
- debug("HPN to Non-HPN Connection");
- } else if (options.tcp_rcv_buf_poll <= 0) {
- sock_get_rcvbuf(&options.hpn_buffer_size, 0);
- debug("HPNBufferSize set to TCP RWIN: %d",
- options.hpn_buffer_size);
- } else if (options.tcp_rcv_buf > 0) {
- sock_get_rcvbuf(&options.hpn_buffer_size,
- options.tcp_rcv_buf);
- debug("HPNBufferSize set to user TCPRcvBuf: %d",
- options.hpn_buffer_size);
- }
- debug("Final hpn_buffer_size = %d", options.hpn_buffer_size);
- channel_set_hpn(options.hpn_disabled, options.hpn_buffer_size);
- window = options.hpn_buffer_size;
-
+ window = CHAN_SES_WINDOW_DEFAULT;
packetmax = CHAN_SES_PACKET_DEFAULT;
if (tty_flag) {
- window = CHAN_SES_WINDOW_DEFAULT;
window >>= 1;
packetmax >>= 1;
}
@@ -1714,10 +1665,6 @@ ssh_session2_open(void)
"session", SSH_CHANNEL_OPENING, in, out, err,
window, packetmax, CHAN_EXTENDED_WRITE,
"client-session", /*nonblock*/0);
- if (!options.hpn_disabled && options.tcp_rcv_buf_poll > 0) {
- c->dynamic_window = 1;
- debug("Enabled Dynamic Window Scaling\n");
- }
debug3("ssh_session2_open: channel_new: %d", c->self);
diff --git a/crypto/openssh/ssh_config b/crypto/openssh/ssh_config
index 2d0297b..459f4ef 100644
--- a/crypto/openssh/ssh_config
+++ b/crypto/openssh/ssh_config
@@ -48,4 +48,4 @@
# ProxyCommand ssh -q -W %h:%p gateway.example.com
# RekeyLimit 1G 1h
# VerifyHostKeyDNS yes
-# VersionAddendum FreeBSD-20140420
+# VersionAddendum FreeBSD-20160124
diff --git a/crypto/openssh/ssh_config.5 b/crypto/openssh/ssh_config.5
index b844384..fec66d2 100644
--- a/crypto/openssh/ssh_config.5
+++ b/crypto/openssh/ssh_config.5
@@ -35,7 +35,7 @@
.\"
.\" $OpenBSD: ssh_config.5,v 1.185 2014/02/23 20:11:36 djm Exp $
.\" $FreeBSD$
-.Dd March 22, 2015
+.Dd $Mdocdate: February 23 2014 $
.Dt SSH_CONFIG 5
.Os
.Sh NAME
@@ -1423,7 +1423,7 @@ See also VERIFYING HOST KEYS in
Specifies a string to append to the regular version string to identify
OS- or site-specific modifications.
The default is
-.Dq FreeBSD-20140420 .
+.Dq FreeBSD-20160124 .
The value
.Dq none
may be used to disable this.
diff --git a/crypto/openssh/ssh_namespace.h b/crypto/openssh/ssh_namespace.h
index 50f9b18..8b5e416 100644
--- a/crypto/openssh/ssh_namespace.h
+++ b/crypto/openssh/ssh_namespace.h
@@ -7,7 +7,11 @@
*
* A list of symbols which need munging is obtained as follows:
*
- * nm libssh.a | awk '/[0-9a-z] [A-Z] / && $3 !~ /^ssh_/ { printf("#define %-39s ssh_%s\n", $3, $3) }' | unexpand -a | sort -u
+ # nm libprivatessh.a | LC_ALL=C awk '
+ /^[0-9a-z]+ [Tt] [A-Za-z_][0-9A-Za-z_]*$/ && $3 !~ /^ssh_/ {
+ printf("#define %-39s ssh_%s\n", $3, $3)
+ }' | unexpand -a | LC_ALL=C sort -u
+ *
* $FreeBSD$
*/
@@ -20,9 +24,13 @@
#define a2port ssh_a2port
#define a2tun ssh_a2tun
#define add_host_to_hostfile ssh_add_host_to_hostfile
+#define add_p1p1 ssh_add_p1p1
#define addargs ssh_addargs
#define addr_match_cidr_list ssh_addr_match_cidr_list
#define addr_match_list ssh_addr_match_list
+#define addr_netmatch ssh_addr_netmatch
+#define addr_pton ssh_addr_pton
+#define addr_pton_cidr ssh_addr_pton_cidr
#define ask_permission ssh_ask_permission
#define atomicio ssh_atomicio
#define atomicio6 ssh_atomicio6
@@ -31,7 +39,10 @@
#define auth_request_forwarding ssh_auth_request_forwarding
#define bandwidth_limit ssh_bandwidth_limit
#define bandwidth_limit_init ssh_bandwidth_limit_init
+#define barrett_reduce ssh_barrett_reduce
+#define bcrypt_hash ssh_bcrypt_hash
#define bcrypt_pbkdf ssh_bcrypt_pbkdf
+#define bf_ssh1_cipher ssh_bf_ssh1_cipher
#define blf_cbc_decrypt ssh_blf_cbc_decrypt
#define blf_cbc_encrypt ssh_blf_cbc_encrypt
#define blf_dec ssh_blf_dec
@@ -70,7 +81,6 @@
#define buffer_get_int64 ssh_buffer_get_int64
#define buffer_get_int64_ret ssh_buffer_get_int64_ret
#define buffer_get_int_ret ssh_buffer_get_int_ret
-#define buffer_get_max_len ssh_buffer_get_max_len
#define buffer_get_ret ssh_buffer_get_ret
#define buffer_get_short ssh_buffer_get_short
#define buffer_get_short_ret ssh_buffer_get_short_ret
@@ -95,6 +105,7 @@
#define buffer_put_short ssh_buffer_put_short
#define buffer_put_string ssh_buffer_put_string
#define buffer_uncompress ssh_buffer_uncompress
+#define cert_free ssh_cert_free
#define chacha_encrypt_bytes ssh_chacha_encrypt_bytes
#define chacha_ivsetup ssh_chacha_ivsetup
#define chacha_keysetup ssh_chacha_keysetup
@@ -109,6 +120,10 @@
#define chan_rcvd_ieof ssh_chan_rcvd_ieof
#define chan_rcvd_oclose ssh_chan_rcvd_oclose
#define chan_read_failed ssh_chan_read_failed
+#define chan_send_eof2 ssh_chan_send_eof2
+#define chan_send_oclose1 ssh_chan_send_oclose1
+#define chan_shutdown_read ssh_chan_shutdown_read
+#define chan_shutdown_write ssh_chan_shutdown_write
#define chan_write_failed ssh_chan_write_failed
#define channel_add_adm_permitted_opens ssh_channel_add_adm_permitted_opens
#define channel_add_permitted_opens ssh_channel_add_permitted_opens
@@ -121,6 +136,7 @@
#define channel_clear_permitted_opens ssh_channel_clear_permitted_opens
#define channel_close_all ssh_channel_close_all
#define channel_close_fd ssh_channel_close_fd
+#define channel_close_fds ssh_channel_close_fds
#define channel_connect_by_listen_address ssh_channel_connect_by_listen_address
#define channel_connect_stdio_fwd ssh_channel_connect_stdio_fwd
#define channel_connect_to ssh_channel_connect_to
@@ -128,6 +144,8 @@
#define channel_find_open ssh_channel_find_open
#define channel_free ssh_channel_free
#define channel_free_all ssh_channel_free_all
+#define channel_fwd_bind_addr ssh_channel_fwd_bind_addr
+#define channel_handler ssh_channel_handler
#define channel_input_close ssh_channel_input_close
#define channel_input_close_confirmation ssh_channel_input_close_confirmation
#define channel_input_data ssh_channel_input_data
@@ -146,11 +164,28 @@
#define channel_open_message ssh_channel_open_message
#define channel_output_poll ssh_channel_output_poll
#define channel_permit_all_opens ssh_channel_permit_all_opens
-#define channel_post ssh_channel_post
-#define channel_pre ssh_channel_pre
+#define channel_post_auth_listener ssh_channel_post_auth_listener
+#define channel_post_connecting ssh_channel_post_connecting
+#define channel_post_mux_client ssh_channel_post_mux_client
+#define channel_post_mux_listener ssh_channel_post_mux_listener
+#define channel_post_open ssh_channel_post_open
+#define channel_post_output_drain_13 ssh_channel_post_output_drain_13
+#define channel_post_port_listener ssh_channel_post_port_listener
+#define channel_post_x11_listener ssh_channel_post_x11_listener
+#define channel_pre_connecting ssh_channel_pre_connecting
+#define channel_pre_dynamic ssh_channel_pre_dynamic
+#define channel_pre_input_draining ssh_channel_pre_input_draining
+#define channel_pre_listener ssh_channel_pre_listener
+#define channel_pre_mux_client ssh_channel_pre_mux_client
+#define channel_pre_open ssh_channel_pre_open
+#define channel_pre_open_13 ssh_channel_pre_open_13
+#define channel_pre_output_draining ssh_channel_pre_output_draining
+#define channel_pre_x11_open ssh_channel_pre_x11_open
+#define channel_pre_x11_open_13 ssh_channel_pre_x11_open_13
#define channel_prepare_select ssh_channel_prepare_select
#define channel_print_adm_permitted_opens ssh_channel_print_adm_permitted_opens
#define channel_register_cleanup ssh_channel_register_cleanup
+#define channel_register_fds ssh_channel_register_fds
#define channel_register_filter ssh_channel_register_filter
#define channel_register_open_confirm ssh_channel_register_open_confirm
#define channel_register_status_confirm ssh_channel_register_status_confirm
@@ -161,14 +196,17 @@
#define channel_send_window_changes ssh_channel_send_window_changes
#define channel_set_af ssh_channel_set_af
#define channel_set_fds ssh_channel_set_fds
-#define channel_set_hpn ssh_channel_set_hpn
+#define channel_setup_fwd_listener ssh_channel_setup_fwd_listener
#define channel_setup_local_fwd_listener ssh_channel_setup_local_fwd_listener
#define channel_setup_remote_fwd_listener ssh_channel_setup_remote_fwd_listener
#define channel_still_open ssh_channel_still_open
#define channel_stop_listening ssh_channel_stop_listening
#define channel_update_permitted_opens ssh_channel_update_permitted_opens
+#define check_crc ssh_check_crc
+#define check_hostkeys_by_key_or_type ssh_check_hostkeys_by_key_or_type
#define check_key_in_hostkeys ssh_check_key_in_hostkeys
#define choose_dh ssh_choose_dh
+#define choose_t ssh_choose_t
#define chop ssh_chop
#define cipher_alg_list ssh_cipher_alg_list
#define cipher_authlen ssh_cipher_authlen
@@ -198,15 +236,17 @@
#define cleanup_exit ssh_cleanup_exit
#define clear_cached_addr ssh_clear_cached_addr
#define colon ssh_colon
-#define compat13 ssh_compat13
-#define compat20 ssh_compat20
+#define compare ssh_compare
+#define compare_gps ssh_compare_gps
#define compat_cipher_proposal ssh_compat_cipher_proposal
#define compat_datafellows ssh_compat_datafellows
+#define compat_kex_proposal ssh_compat_kex_proposal
#define compat_pkalg_proposal ssh_compat_pkalg_proposal
+#define connect_next ssh_connect_next
+#define connect_to ssh_connect_to
#define convtime ssh_convtime
#define crypto_hash_sha512 ssh_crypto_hash_sha512
#define crypto_hashblocks_sha512 ssh_crypto_hashblocks_sha512
-#define crypto_scalarmult_curve25519 ssh_crypto_scalarmult_curve25519
#define crypto_sign_ed25519 ssh_crypto_sign_ed25519
#define crypto_sign_ed25519_keypair ssh_crypto_sign_ed25519_keypair
#define crypto_sign_ed25519_open ssh_crypto_sign_ed25519_open
@@ -227,7 +267,6 @@
#define crypto_sign_ed25519_ref_fe25519_square ssh_crypto_sign_ed25519_ref_fe25519_square
#define crypto_sign_ed25519_ref_fe25519_sub ssh_crypto_sign_ed25519_ref_fe25519_sub
#define crypto_sign_ed25519_ref_fe25519_unpack ssh_crypto_sign_ed25519_ref_fe25519_unpack
-#define crypto_sign_ed25519_ref_ge25519_base ssh_crypto_sign_ed25519_ref_ge25519_base
#define crypto_sign_ed25519_ref_isneutral_vartime ssh_crypto_sign_ed25519_ref_isneutral_vartime
#define crypto_sign_ed25519_ref_pack ssh_crypto_sign_ed25519_ref_pack
#define crypto_sign_ed25519_ref_sc25519_2interleave2 ssh_crypto_sign_ed25519_ref_sc25519_2interleave2
@@ -248,8 +287,7 @@
#define crypto_sign_ed25519_ref_shortsc25519_from16bytes ssh_crypto_sign_ed25519_ref_shortsc25519_from16bytes
#define crypto_sign_ed25519_ref_unpackneg_vartime ssh_crypto_sign_ed25519_ref_unpackneg_vartime
#define crypto_verify_32 ssh_crypto_verify_32
-#define current_keys ssh_current_keys
-#define datafellows ssh_datafellows
+#define dbl_p1p1 ssh_dbl_p1p1
#define debug ssh_debug
#define debug2 ssh_debug2
#define debug3 ssh_debug3
@@ -264,8 +302,6 @@
#define dh_new_group14 ssh_dh_new_group14
#define dh_new_group_asc ssh_dh_new_group_asc
#define dh_pub_is_valid ssh_dh_pub_is_valid
-#define digests ssh_digests
-#define dispatch ssh_dispatch
#define dispatch_init ssh_dispatch_init
#define dispatch_protocol_error ssh_dispatch_protocol_error
#define dispatch_protocol_ignore ssh_dispatch_protocol_ignore
@@ -283,6 +319,7 @@
#define explicit_bzero ssh_explicit_bzero
#define export_dns_rr ssh_export_dns_rr
#define fatal ssh_fatal
+#define filter_proposal ssh_filter_proposal
#define fmt_scaled ssh_fmt_scaled
#define free_hostkeys ssh_free_hostkeys
#define freeargs ssh_freeargs
@@ -298,20 +335,27 @@
#define get_remote_name_or_ip ssh_get_remote_name_or_ip
#define get_remote_port ssh_get_remote_port
#define get_sock_port ssh_get_sock_port
+#define get_socket_address ssh_get_socket_address
#define get_u16 ssh_get_u16
#define get_u32 ssh_get_u32
#define get_u64 ssh_get_u64
#define getrrsetbyname ssh_getrrsetbyname
#define glob ssh_glob
+#define glob0 ssh_glob0
+#define glob2 ssh_glob2
+#define globexp1 ssh_globexp1
+#define globextend ssh_globextend
#define globfree ssh_globfree
#define host_hash ssh_host_hash
#define hostfile_read_key ssh_hostfile_read_key
#define hpdelim ssh_hpdelim
-#define incoming_stream ssh_incoming_stream
#define init_hostkeys ssh_init_hostkeys
#define iptos2str ssh_iptos2str
#define ipv64_normalise_mapped ssh_ipv64_normalise_mapped
+#define is_key_revoked ssh_is_key_revoked
+#define kex_alg_by_name ssh_kex_alg_by_name
#define kex_alg_list ssh_kex_alg_list
+#define kex_buf2prop ssh_kex_buf2prop
#define kex_c25519_hash ssh_kex_c25519_hash
#define kex_derive_keys ssh_kex_derive_keys
#define kex_derive_keys_bn ssh_kex_derive_keys_bn
@@ -321,6 +365,8 @@
#define kex_get_newkeys ssh_kex_get_newkeys
#define kex_input_kexinit ssh_kex_input_kexinit
#define kex_names_valid ssh_kex_names_valid
+#define kex_prop_free ssh_kex_prop_free
+#define kex_protocol_error ssh_kex_protocol_error
#define kex_send_kexinit ssh_kex_send_kexinit
#define kex_setup ssh_kex_setup
#define kexc25519_client ssh_kexc25519_client
@@ -354,6 +400,7 @@
#define key_fingerprint_raw ssh_key_fingerprint_raw
#define key_free ssh_key_free
#define key_from_blob ssh_key_from_blob
+#define key_from_blob2 ssh_key_from_blob2
#define key_from_private ssh_key_from_private
#define key_generate ssh_key_generate
#define key_in_file ssh_key_in_file
@@ -370,9 +417,14 @@
#define key_new ssh_key_new
#define key_new_private ssh_key_new_private
#define key_parse_private ssh_key_parse_private
+#define key_parse_private2 ssh_key_parse_private2
+#define key_parse_private_pem ssh_key_parse_private_pem
+#define key_parse_private_type ssh_key_parse_private_type
+#define key_parse_public_rsa1 ssh_key_parse_public_rsa1
#define key_perm_ok ssh_key_perm_ok
#define key_private_deserialize ssh_key_private_deserialize
#define key_private_serialize ssh_key_private_serialize
+#define key_private_to_blob2 ssh_key_private_to_blob2
#define key_read ssh_key_read
#define key_save_private ssh_key_save_private
#define key_sign ssh_key_sign
@@ -381,6 +433,7 @@
#define key_ssh_name_plain ssh_key_ssh_name_plain
#define key_to_blob ssh_key_to_blob
#define key_to_certified ssh_key_to_certified
+#define key_try_load_public ssh_key_try_load_public
#define key_type ssh_key_type
#define key_type_from_name ssh_key_type_from_name
#define key_type_is_cert ssh_key_type_is_cert
@@ -405,6 +458,7 @@
#define mac_init ssh_mac_init
#define mac_setup ssh_mac_setup
#define mac_valid ssh_mac_valid
+#define match ssh_match
#define match_host_and_ip ssh_match_host_and_ip
#define match_hostname ssh_match_hostname
#define match_list ssh_match_list
@@ -417,13 +471,16 @@
#define monotime ssh_monotime
#define ms_subtract_diff ssh_ms_subtract_diff
#define ms_to_timeval ssh_ms_to_timeval
+#define mult ssh_mult
#define mysignal ssh_mysignal
-#define outgoing_stream ssh_outgoing_stream
+#define nh_aux ssh_nh_aux
+#define nh_final ssh_nh_final
#define packet_add_padding ssh_packet_add_padding
#define packet_backup_state ssh_packet_backup_state
#define packet_close ssh_packet_close
#define packet_connection_is_on_socket ssh_packet_connection_is_on_socket
#define packet_disconnect ssh_packet_disconnect
+#define packet_enable_delayed_compress ssh_packet_enable_delayed_compress
#define packet_get_bignum ssh_packet_get_bignum
#define packet_get_bignum2 ssh_packet_get_bignum2
#define packet_get_char ssh_packet_get_char
@@ -470,6 +527,7 @@
#define packet_remaining ssh_packet_remaining
#define packet_restore_state ssh_packet_restore_state
#define packet_send ssh_packet_send
+#define packet_send2_wrapped ssh_packet_send2_wrapped
#define packet_send_debug ssh_packet_send_debug
#define packet_send_ignore ssh_packet_send_ignore
#define packet_set_alive_timeouts ssh_packet_set_alive_timeouts
@@ -488,20 +546,32 @@
#define packet_set_timeout ssh_packet_set_timeout
#define packet_start ssh_packet_start
#define packet_start_compression ssh_packet_start_compression
+#define packet_start_discard ssh_packet_start_discard
+#define packet_stop_discard ssh_packet_stop_discard
#define packet_write_poll ssh_packet_write_poll
#define packet_write_wait ssh_packet_write_wait
#define parse_ipqos ssh_parse_ipqos
+#define parse_prime ssh_parse_prime
#define percent_expand ssh_percent_expand
#define permanently_drop_suid ssh_permanently_drop_suid
#define permanently_set_uid ssh_permanently_set_uid
#define permitopen_port ssh_permitopen_port
#define pkcs11_add_provider ssh_pkcs11_add_provider
#define pkcs11_del_provider ssh_pkcs11_del_provider
+#define pkcs11_fetch_keys_filter ssh_pkcs11_fetch_keys_filter
+#define pkcs11_find ssh_pkcs11_find
#define pkcs11_init ssh_pkcs11_init
-#define pkcs11_interactive ssh_pkcs11_interactive
-#define pkcs11_providers ssh_pkcs11_providers
+#define pkcs11_provider_finalize ssh_pkcs11_provider_finalize
+#define pkcs11_provider_unref ssh_pkcs11_provider_unref
+#define pkcs11_rsa_finish ssh_pkcs11_rsa_finish
+#define pkcs11_rsa_private_decrypt ssh_pkcs11_rsa_private_decrypt
+#define pkcs11_rsa_private_encrypt ssh_pkcs11_rsa_private_encrypt
#define pkcs11_terminate ssh_pkcs11_terminate
+#define plain_key_blob ssh_plain_key_blob
#define poly1305_auth ssh_poly1305_auth
+#define poly64 ssh_poly64
+#define poly_hash ssh_poly_hash
+#define port_open_helper ssh_port_open_helper
#define prime_test ssh_prime_test
#define proto_spec ssh_proto_spec
#define put_host_port ssh_put_host_port
@@ -509,11 +579,19 @@
#define put_u32 ssh_put_u32
#define put_u64 ssh_put_u64
#define pwcopy ssh_pwcopy
+#define qfileout ssh_qfileout
#define read_keyfile_line ssh_read_keyfile_line
+#define read_mux ssh_read_mux
#define read_passphrase ssh_read_passphrase
+#define reduce_add_sub ssh_reduce_add_sub
#define refresh_progress_meter ssh_refresh_progress_meter
#define replacearg ssh_replacearg
#define restore_uid ssh_restore_uid
+#define revoke_blob ssh_revoke_blob
+#define revoked_blob_tree_RB_REMOVE ssh_revoked_blob_tree_RB_REMOVE
+#define revoked_certs_for_ca_key ssh_revoked_certs_for_ca_key
+#define revoked_serial_tree_RB_REMOVE ssh_revoked_serial_tree_RB_REMOVE
+#define rijndaelKeySetupEnc ssh_rijndaelKeySetupEnc
#define rijndael_decrypt ssh_rijndael_decrypt
#define rijndael_encrypt ssh_rijndael_encrypt
#define rijndael_set_key ssh_rijndael_set_key
@@ -528,9 +606,14 @@
#define set_nodelay ssh_set_nodelay
#define set_nonblock ssh_set_nonblock
#define shadow_pw ssh_shadow_pw
+#define sieve_large ssh_sieve_large
+#define sig_winch ssh_sig_winch
#define sigdie ssh_sigdie
-#define sock_get_rcvbuf ssh_sock_get_rcvbuf
#define sock_set_v6only ssh_sock_set_v6only
+#define square ssh_square
+#define ssh1_3des_cbc ssh_ssh1_3des_cbc
+#define ssh1_3des_cleanup ssh_ssh1_3des_cleanup
+#define ssh1_3des_init ssh_ssh1_3des_init
#define ssh1_3des_iv ssh_ssh1_3des_iv
#define start_progress_meter ssh_start_progress_meter
#define stop_progress_meter ssh_stop_progress_meter
@@ -542,21 +625,21 @@
#define temporarily_use_uid ssh_temporarily_use_uid
#define tilde_expand_filename ssh_tilde_expand_filename
#define timingsafe_bcmp ssh_timingsafe_bcmp
+#define to_blob ssh_to_blob
#define tohex ssh_tohex
#define tty_make_modes ssh_tty_make_modes
#define tty_parse_modes ssh_tty_parse_modes
#define tun_open ssh_tun_open
-#define umac128_ctx ssh_umac128_ctx
#define umac128_delete ssh_umac128_delete
#define umac128_final ssh_umac128_final
#define umac128_new ssh_umac128_new
#define umac128_update ssh_umac128_update
-#define umac_ctx ssh_umac_ctx
#define umac_delete ssh_umac_delete
#define umac_final ssh_umac_final
#define umac_new ssh_umac_new
#define umac_update ssh_umac_update
#define unset_nonblock ssh_unset_nonblock
+#define update_progress_meter ssh_update_progress_meter
#define uudecode ssh_uudecode
#define uuencode ssh_uuencode
#define verbose ssh_verbose
@@ -565,6 +648,7 @@
#define x11_connect_display ssh_x11_connect_display
#define x11_create_display_inet ssh_x11_create_display_inet
#define x11_input_open ssh_x11_input_open
+#define x11_open_helper ssh_x11_open_helper
#define x11_request_forwarding_with_spoofing ssh_x11_request_forwarding_with_spoofing
#define xasprintf ssh_xasprintf
#define xcalloc ssh_xcalloc
diff --git a/crypto/openssh/sshconnect.c b/crypto/openssh/sshconnect.c
index 65ee91f..3384de6 100644
--- a/crypto/openssh/sshconnect.c
+++ b/crypto/openssh/sshconnect.c
@@ -1,5 +1,4 @@
/* $OpenBSD: sshconnect.c,v 1.246 2014/02/06 22:21:01 djm Exp $ */
-/* $FreeBSD$ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -15,6 +14,7 @@
*/
#include "includes.h"
+__RCSID("$FreeBSD$");
#include <sys/types.h>
#include <sys/wait.h>
@@ -265,29 +265,6 @@ ssh_kill_proxy_command(void)
}
/*
- * Set TCP receive buffer if requested.
- * Note: tuning needs to happen after the socket is created but before the
- * connection happens so winscale is negotiated properly.
- */
-static void
-ssh_set_socket_recvbuf(int sock)
-{
- void *buf = (void *)&options.tcp_rcv_buf;
- int socksize, sz = sizeof(options.tcp_rcv_buf);
- socklen_t len = sizeof(int);
-
- debug("setsockopt attempting to set SO_RCVBUF to %d",
- options.tcp_rcv_buf);
- if (setsockopt(sock, SOL_SOCKET, SO_RCVBUF, buf, sz) >= 0) {
- getsockopt(sock, SOL_SOCKET, SO_RCVBUF, &socksize, &len);
- debug("setsockopt SO_RCVBUF: %.100s %d", strerror(errno),
- socksize);
- } else
- error("Couldn't set socket receive buffer to %d: %.100s",
- options.tcp_rcv_buf, strerror(errno));
-}
-
-/*
* Creates a (possibly privileged) socket for use as the ssh connection.
*/
static int
@@ -303,9 +280,6 @@ ssh_create_socket(int privileged, struct addrinfo *ai)
}
fcntl(sock, F_SETFD, FD_CLOEXEC);
- if (options.tcp_rcv_buf > 0)
- ssh_set_socket_recvbuf(sock);
-
/* Bind the socket to an alternative local IP address */
if (options.bind_address == NULL && !privileged)
return sock;
@@ -546,10 +520,10 @@ static void
send_client_banner(int connection_out, int minor1)
{
/* Send our own protocol version identification. */
- xasprintf(&client_version_string, "SSH-%d.%d-%.100s%s%s%s%s",
+ xasprintf(&client_version_string, "SSH-%d.%d-%.100s%s%s%s",
compat20 ? PROTOCOL_MAJOR_2 : PROTOCOL_MAJOR_1,
compat20 ? PROTOCOL_MINOR_2 : minor1,
- SSH_VERSION, options.hpn_disabled ? "" : SSH_VERSION_HPN,
+ SSH_VERSION,
*options.version_addendum == '\0' ? "" : " ",
options.version_addendum, compat20 ? "\r\n" : "\n");
if (roaming_atomicio(vwrite, connection_out, client_version_string,
diff --git a/crypto/openssh/sshconnect2.c b/crypto/openssh/sshconnect2.c
index 23984ba..ec3ad6a 100644
--- a/crypto/openssh/sshconnect2.c
+++ b/crypto/openssh/sshconnect2.c
@@ -1,5 +1,4 @@
/* $OpenBSD: sshconnect2.c,v 1.204 2014/02/02 03:44:32 djm Exp $ */
-/* $FreeBSD$ */
/*
* Copyright (c) 2000 Markus Friedl. All rights reserved.
* Copyright (c) 2008 Damien Miller. All rights reserved.
@@ -80,16 +79,6 @@
extern char *client_version_string;
extern char *server_version_string;
extern Options options;
-#ifdef NONE_CIPHER_ENABLED
-extern Kex *xxx_kex;
-
-/*
- * tty_flag is set in ssh.c so we can use it here. If set then prevent
- * the switch to the null cipher.
- */
-
-extern int tty_flag;
-#endif
/*
* SSH2 key exchange
@@ -422,29 +411,6 @@ ssh_userauth2(const char *local_user, const char *server_user, char *host,
pubkey_cleanup(&authctxt);
dispatch_range(SSH2_MSG_USERAUTH_MIN, SSH2_MSG_USERAUTH_MAX, NULL);
-#ifdef NONE_CIPHER_ENABLED
- /*
- * If the user explicitly requests to use the none cipher enable it
- * post authentication and only if the right conditions are met: both
- * of the NONE switches must be true and there must be no tty allocated.
- */
- if (options.none_switch == 1 && options.none_enabled == 1) {
- if (!tty_flag) {
- debug("Requesting none cipher re-keying...");
- myproposal[PROPOSAL_ENC_ALGS_STOC] = "none";
- myproposal[PROPOSAL_ENC_ALGS_CTOS] = "none";
- kex_prop2buf(&xxx_kex->my, myproposal);
- packet_request_rekeying();
- fprintf(stderr, "WARNING: enabled NONE cipher\n");
- } else {
- /* Requested NONE cipher on an interactive session. */
- debug("Cannot switch to NONE cipher with tty "
- "allocated");
- fprintf(stderr, "NONE cipher switch disabled given "
- "a TTY is allocated\n");
- }
- }
-#endif
debug("Authentication succeeded (%s).", authctxt.method->name);
}
diff --git a/crypto/openssh/sshd.8 b/crypto/openssh/sshd.8
index b9ae6ff..56aa37c 100644
--- a/crypto/openssh/sshd.8
+++ b/crypto/openssh/sshd.8
@@ -35,7 +35,7 @@
.\"
.\" $OpenBSD: sshd.8,v 1.273 2013/12/07 11:58:46 naddy Exp $
.\" $FreeBSD$
-.Dd December 7, 2013
+.Dd $Mdocdate: December 7 2013 $
.Dt SSHD 8
.Os
.Sh NAME
diff --git a/crypto/openssh/sshd.c b/crypto/openssh/sshd.c
index 032061e..838ed89 100644
--- a/crypto/openssh/sshd.c
+++ b/crypto/openssh/sshd.c
@@ -1,5 +1,4 @@
/* $OpenBSD: sshd.c,v 1.420 2014/02/26 21:53:37 markus Exp $ */
-/* $FreeBSD$ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -447,9 +446,8 @@ sshd_exchange_identification(int sock_in, int sock_out)
minor = PROTOCOL_MINOR_1;
}
- xasprintf(&server_version_string, "SSH-%d.%d-%.100s%s%s%s%s",
+ xasprintf(&server_version_string, "SSH-%d.%d-%.100s%s%s%s",
major, minor, SSH_VERSION,
- options.hpn_disabled ? "" : SSH_VERSION_HPN,
*options.version_addendum == '\0' ? "" : " ",
options.version_addendum, newline);
@@ -951,13 +949,12 @@ static void
usage(void)
{
if (options.version_addendum && *options.version_addendum != '\0')
- fprintf(stderr, "%s%s %s, %s\n",
- SSH_RELEASE, options.hpn_disabled ? "" : SSH_VERSION_HPN,
+ fprintf(stderr, "%s %s, %s\n",
+ SSH_RELEASE,
options.version_addendum, SSLeay_version(SSLEAY_VERSION));
else
- fprintf(stderr, "%s%s, %s\n",
- SSH_RELEASE, options.hpn_disabled ? "" : SSH_VERSION_HPN,
- SSLeay_version(SSLEAY_VERSION));
+ fprintf(stderr, "%s, %s\n",
+ SSH_RELEASE, SSLeay_version(SSLEAY_VERSION));
fprintf(stderr,
"usage: sshd [-46DdeiqTt] [-b bits] [-C connection_spec] [-c host_cert_file]\n"
" [-E log_file] [-f config_file] [-g login_grace_time]\n"
@@ -1146,7 +1143,6 @@ server_listen(void)
len = sizeof(socksize);
getsockopt(listen_sock, SOL_SOCKET, SO_RCVBUF, &socksize, &len);
debug("Server TCP RWIN socket size: %d", socksize);
- debug("HPN Buffer Size: %d", options.hpn_buffer_size);
/* Bind the socket to the desired port. */
if (bind(listen_sock, ai->ai_addr, ai->ai_addrlen) < 0) {
@@ -1680,11 +1676,7 @@ main(int ac, char **av)
exit(1);
}
- debug("sshd version %.100s%.100s%s%.100s, %.100s",
- SSH_RELEASE,
- options.hpn_disabled ? "" : SSH_VERSION_HPN,
- *options.version_addendum == '\0' ? "" : " ",
- options.version_addendum,
+ debug("sshd version %s, %s", SSH_VERSION,
SSLeay_version(SSLEAY_VERSION));
/* Store privilege separation user for later use if required. */
@@ -2115,9 +2107,6 @@ main(int ac, char **av)
remote_ip, remote_port,
get_local_ipaddr(sock_in), get_local_port());
- /* Set HPN options for the child. */
- channel_set_hpn(options.hpn_disabled, options.hpn_buffer_size);
-
/*
* We don't want to listen forever unless the other side
* successfully authenticates itself. So we set up an alarm which is
@@ -2502,12 +2491,6 @@ do_ssh2_kex(void)
if (options.ciphers != NULL) {
myproposal[PROPOSAL_ENC_ALGS_CTOS] =
myproposal[PROPOSAL_ENC_ALGS_STOC] = options.ciphers;
-#ifdef NONE_CIPHER_ENABLED
- } else if (options.none_enabled == 1) {
- debug ("WARNING: None cipher enabled");
- myproposal[PROPOSAL_ENC_ALGS_CTOS] =
- myproposal[PROPOSAL_ENC_ALGS_STOC] = KEX_ENCRYPT_INCLUDE_NONE;
-#endif
}
myproposal[PROPOSAL_ENC_ALGS_CTOS] =
compat_cipher_proposal(myproposal[PROPOSAL_ENC_ALGS_CTOS]);
diff --git a/crypto/openssh/sshd_config b/crypto/openssh/sshd_config
index 202da5f..011c714 100644
--- a/crypto/openssh/sshd_config
+++ b/crypto/openssh/sshd_config
@@ -120,7 +120,7 @@
#MaxStartups 10:30:100
#PermitTunnel no
#ChrootDirectory none
-#VersionAddendum FreeBSD-20140420
+#VersionAddendum FreeBSD-20160124
# no default banner path
#Banner none
@@ -128,18 +128,6 @@
# override default of no subsystems
Subsystem sftp /usr/libexec/sftp-server
-# Disable HPN tuning improvements.
-#HPNDisabled no
-
-# Buffer size for HPN to non-HPN connections.
-#HPNBufferSize 2048
-
-# TCP receive socket buffer polling for HPN. Disable on non autotuning kernels.
-#TcpRcvBufPoll yes
-
-# Allow the use of the NONE cipher.
-#NoneEnabled no
-
# Example of overriding settings on a per-user basis
#Match User anoncvs
# X11Forwarding no
diff --git a/crypto/openssh/sshd_config.5 b/crypto/openssh/sshd_config.5
index 14fa41c..6796b9d 100644
--- a/crypto/openssh/sshd_config.5
+++ b/crypto/openssh/sshd_config.5
@@ -35,7 +35,7 @@
.\"
.\" $OpenBSD: sshd_config.5,v 1.172 2014/02/27 22:47:07 djm Exp $
.\" $FreeBSD$
-.Dd March 22, 2015
+.Dd $Mdocdate: February 27 2014 $
.Dt SSHD_CONFIG 5
.Os
.Sh NAME
@@ -1253,7 +1253,7 @@ restrictions.
Optionally specifies additional text to append to the SSH protocol banner
sent by the server upon connection.
The default is
-.Dq FreeBSD-20140420 .
+.Dq FreeBSD-20160124 .
The value
.Dq none
may be used to disable this.
diff --git a/crypto/openssh/version.h b/crypto/openssh/version.h
index f62c526..0909146 100644
--- a/crypto/openssh/version.h
+++ b/crypto/openssh/version.h
@@ -6,5 +6,4 @@
#define SSH_PORTABLE "p1"
#define SSH_RELEASE SSH_VERSION SSH_PORTABLE
-#define SSH_VERSION_FREEBSD "FreeBSD-20140420"
-#define SSH_VERSION_HPN "_hpn13v11"
+#define SSH_VERSION_FREEBSD "FreeBSD-20160124"
diff --git a/etc/defaults/rc.conf b/etc/defaults/rc.conf
index d4e9701..da3158c 100644
--- a/etc/defaults/rc.conf
+++ b/etc/defaults/rc.conf
@@ -452,9 +452,9 @@ ubthidhci_enable="NO" # Switch an USB BT controller present on
### Network link/usability verification options
netwait_enable="NO" # Enable rc.d/netwait (or NO)
-#netwait_ip="" # IP addresses to be pinged by netwait.
+#netwait_ip="" # Wait for ping response from any IP in this list.
netwait_timeout="60" # Total number of seconds to perform pings.
-#netwait_if="" # Interface name to watch link state on.
+#netwait_if="" # Wait for active link on each intf in this list.
netwait_if_timeout="30" # Total number of seconds to monitor link state.
### Miscellaneous network options: ###
diff --git a/etc/rc.d/NETWORKING b/etc/rc.d/NETWORKING
index 71cf26d..ff63c0c 100755
--- a/etc/rc.d/NETWORKING
+++ b/etc/rc.d/NETWORKING
@@ -4,7 +4,7 @@
#
# PROVIDE: NETWORKING NETWORK
-# REQUIRE: netif netoptions routing ppp ipfw stf faith
+# REQUIRE: netif netwait netoptions routing ppp ipfw stf faith
# REQUIRE: defaultroute routed mrouted route6d mroute6d resolv bridge
# REQUIRE: static_arp static_ndp
diff --git a/etc/rc.d/netwait b/etc/rc.d/netwait
index 7ea7a4c..6ccca04 100755
--- a/etc/rc.d/netwait
+++ b/etc/rc.d/netwait
@@ -3,13 +3,20 @@
# $FreeBSD$
#
# PROVIDE: netwait
-# REQUIRE: NETWORKING
+# REQUIRE: devd routing
# KEYWORD: nojail
#
-# The netwait script is intended to be used by systems which have
-# statically-configured IP addresses in rc.conf(5). If your system
-# uses DHCP, you should use synchronous_dhclient="YES" in your
-# /etc/rc.conf instead of using netwait.
+# The netwait script helps handle two situations:
+# - Systems with USB or other late-attaching network hardware which
+# is initialized by devd events. The script waits for all the
+# interfaces named in the netwait_if list to appear.
+# - Systems with statically-configured IP addresses in rc.conf(5).
+# The IP addresses in the netwait_ip list are pinged. The script
+# waits for any single IP in the list to respond to the ping. If your
+# system uses DHCP, you should probably use synchronous_dhclient="YES"
+# in your /etc/rc.conf instead of netwait_ip.
+# Either or both of the wait lists can be used (at least one must be
+# non-empty if netwait is enabled).
. /etc/rc.subr
@@ -21,77 +28,87 @@ stop_cmd=":"
netwait_start()
{
- local ip rc count output link
+ local ip rc count output link wait_if got_if any_error
- if [ -z "${netwait_ip}" ]; then
- err 1 "You must define one or more IP addresses in netwait_ip"
+ if [ -z "${netwait_if}" ] && [ -z "${netwait_ip}" ]; then
+ err 1 "No interface or IP addresses listed, nothing to wait for"
fi
if [ ${netwait_timeout} -lt 1 ]; then
err 1 "netwait_timeout must be >= 1"
fi
- # Handle SIGINT (Ctrl-C); force abort of while() loop
- trap break SIGINT
-
if [ -n "${netwait_if}" ]; then
- echo -n "Waiting for $netwait_if to have link"
-
- count=1
- while [ ${count} -le ${netwait_if_timeout} ]; do
- if output=`/sbin/ifconfig ${netwait_if} 2>/dev/null`; then
- link=`expr "${output}" : '.*[[:blank:]]status: \(no carrier\)'`
- if [ -z "${link}" ]; then
- echo '.'
- break
+ any_error=0
+ for wait_if in ${netwait_if}; do
+ echo -n "Waiting for ${wait_if}"
+ link=""
+ got_if=0
+ count=1
+ # Handle SIGINT (Ctrl-C); force abort of while() loop
+ trap break SIGINT
+ while [ ${count} -le ${netwait_if_timeout} ]; do
+ if output=`/sbin/ifconfig ${wait_if} 2>/dev/null`; then
+ if [ ${got_if} -eq 0 ]; then
+ echo -n ", interface present"
+ got_if=1
+ fi
+ link=`expr "${output}" : '.*[[:blank:]]status: \(no carrier\)'`
+ if [ -z "${link}" ]; then
+ echo ', got link.'
+ break
+ fi
fi
- else
- echo ''
- err 1 "ifconfig ${netwait_if} failed"
- fi
- sleep 1
- count=$((count+1))
- done
- if [ -n "${link}" ]; then
+ sleep 1
+ count=$((count+1))
+ done
# Restore default SIGINT handler
trap - SIGINT
-
- echo ''
- warn "Interface still has no link. Continuing with startup, but"
- warn "be aware you may not have a fully functional networking"
- warn "layer at this point."
- return
+ if [ ${got_if} -eq 0 ]; then
+ echo ", wait failed: interface never appeared."
+ any_error=1
+ elif [ -n "${link}" ]; then
+ echo ", wait failed: interface still has no link."
+ any_error=1
+ fi
+ done
+ if [ ${any_error} -eq 1 ]; then
+ warn "Continuing with startup, but be aware you may not have "
+ warn "a fully functional networking layer at this point."
fi
fi
+
+ if [ -n "${netwait_ip}" ]; then
+ # Handle SIGINT (Ctrl-C); force abort of for() loop
+ trap break SIGINT
- # Handle SIGINT (Ctrl-C); force abort of while() loop
- trap break SIGINT
+ for ip in ${netwait_ip}; do
+ echo -n "Waiting for ${ip} to respond to ICMP ping"
- for ip in ${netwait_ip}; do
- echo -n "Waiting for ${ip} to respond to ICMP"
+ count=1
+ while [ ${count} -le ${netwait_timeout} ]; do
+ /sbin/ping -t 1 -c 1 -o ${ip} >/dev/null 2>&1
+ rc=$?
- count=1
- while [ ${count} -le ${netwait_timeout} ]; do
- /sbin/ping -t 1 -c 1 -o ${ip} >/dev/null 2>&1
- rc=$?
+ if [ $rc -eq 0 ]; then
+ # Restore default SIGINT handler
+ trap - SIGINT
- if [ $rc -eq 0 ]; then
- # Restore default SIGINT handler
- trap - SIGINT
-
- echo '.'
- return
- fi
- count=$((count+1))
+ echo ', got response.'
+ return
+ fi
+ count=$((count+1))
+ done
+ echo ', failed: No response from host.'
done
- echo ': No response from host.'
- done
- # Restore default SIGINT handler
- trap - SIGINT
+ # Restore default SIGINT handler
+ trap - SIGINT
+
+ warn "Exhausted IP list. Continuing with startup, but be aware you may"
+ warn "not have a fully functional networking layer at this point."
+ fi
- warn "Exhausted IP list. Continuing with startup, but be aware you may"
- warn "not have a fully functional networking layer at this point."
}
load_rc_config $name
diff --git a/lib/Makefile b/lib/Makefile
index 250d583..742bd5e 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -84,7 +84,7 @@ SUBDIR= ${SUBDIR_ORDERED} \
libsbuf \
${_libsdp} \
${_libsm} \
- ${_libsmb} \
+ libsmb \
${_libsmdb} \
${_libsmutil} \
libstand \
@@ -214,7 +214,6 @@ _libypclnt= libypclnt
.endif
.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
-_libsmb= libsmb
_libvgl= libvgl
_libproc= libproc
_librtld_db= librtld_db
@@ -228,7 +227,6 @@ _libvmmapi= libvmmapi
.if ${MACHINE_CPUARCH} == "ia64"
_libefi= libefi
-_libsmb= libsmb
.endif
.if ${MACHINE_CPUARCH} == "mips"
@@ -239,11 +237,6 @@ _librtld_db= librtld_db
.if ${MACHINE_CPUARCH} == "powerpc"
_libproc= libproc
_librtld_db= librtld_db
-_libsmb= libsmb
-.endif
-
-.if ${MACHINE_CPUARCH} == "sparc64"
-_libsmb= libsmb
.endif
.if ${MK_OPENSSL} != "no"
diff --git a/lib/libc/net/if_nametoindex.c b/lib/libc/net/if_nametoindex.c
index 8f04921..debf3fa 100644
--- a/lib/libc/net/if_nametoindex.c
+++ b/lib/libc/net/if_nametoindex.c
@@ -70,9 +70,7 @@ if_nametoindex(const char *ifname)
s = _socket(AF_INET, SOCK_DGRAM | SOCK_CLOEXEC, 0);
if (s != -1) {
-#ifdef PURIFY
memset(&ifr, 0, sizeof(ifr));
-#endif
strlcpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name));
if (_ioctl(s, SIOCGIFINDEX, &ifr) != -1) {
_close(s);
diff --git a/lib/libc/rpc/rpc_soc.c b/lib/libc/rpc/rpc_soc.c
index 8d0f34e..ff7a289 100644
--- a/lib/libc/rpc/rpc_soc.c
+++ b/lib/libc/rpc/rpc_soc.c
@@ -525,7 +525,7 @@ svcunix_create(sock, sendsize, recvsize, path)
break;
}
if (nconf == NULL)
- return(xprt);
+ goto done;
if ((sock = __rpc_nconf2fd(nconf)) < 0)
goto done;
diff --git a/lib/libc/rpc/rpcb_clnt.c b/lib/libc/rpc/rpcb_clnt.c
index 943d7c8..117ee0f 100644
--- a/lib/libc/rpc/rpcb_clnt.c
+++ b/lib/libc/rpc/rpcb_clnt.c
@@ -675,11 +675,11 @@ __rpcbind_is_up()
strcmp(nconf->nc_protofmly, NC_LOOPBACK) == 0)
break;
}
+ endnetconfig(localhandle);
+
if (nconf == NULL)
return (FALSE);
- endnetconfig(localhandle);
-
memset(&sun, 0, sizeof sun);
sock = _socket(AF_LOCAL, SOCK_STREAM, 0);
if (sock < 0)
diff --git a/lib/libc/rpc/rpcb_prot.c b/lib/libc/rpc/rpcb_prot.c
index f543aaf..92463c0 100644
--- a/lib/libc/rpc/rpcb_prot.c
+++ b/lib/libc/rpc/rpcb_prot.c
@@ -217,14 +217,14 @@ xdr_rpcb_entry_list_ptr(xdrs, rp)
* the case of freeing we must remember the next object
* before we free the current object ...
*/
- if (freeing)
+ if (freeing && *rp)
next = (*rp)->rpcb_entry_next;
if (! xdr_reference(xdrs, (caddr_t *)rp,
(u_int)sizeof (rpcb_entry_list),
(xdrproc_t)xdr_rpcb_entry)) {
return (FALSE);
}
- if (freeing && *rp) {
+ if (freeing) {
next_copy = next;
rp = &next_copy;
/*
diff --git a/lib/libc/string/wcslcat.c b/lib/libc/string/wcslcat.c
index f5f1e1e..2df9477 100644
--- a/lib/libc/string/wcslcat.c
+++ b/lib/libc/string/wcslcat.c
@@ -54,7 +54,7 @@ wcslcat(wchar_t *dst, const wchar_t *src, size_t siz)
size_t dlen;
/* Find the end of dst and adjust bytes left but don't go past end */
- while (*d != '\0' && n-- != 0)
+ while (n-- != 0 && *d != '\0')
d++;
dlen = d - dst;
n = siz - dlen;
diff --git a/lib/libc/string/wcsncat.c b/lib/libc/string/wcsncat.c
index 44f1ff9..5a24347 100644
--- a/lib/libc/string/wcsncat.c
+++ b/lib/libc/string/wcsncat.c
@@ -48,7 +48,7 @@ wcsncat(wchar_t * __restrict s1, const wchar_t * __restrict s2, size_t n)
p++;
q = p;
r = s2;
- while (*r && n) {
+ while (n && *r) {
*q++ = *r++;
n--;
}
diff --git a/lib/libc/sys/futimens.c b/lib/libc/sys/futimens.c
index 2014cc5..59fb37f 100644
--- a/lib/libc/sys/futimens.c
+++ b/lib/libc/sys/futimens.c
@@ -42,8 +42,11 @@ futimens(int fd, const struct timespec times[2])
{
struct timeval now, tv[2], *tvp;
struct stat sb;
+ int osreldate;
- if (__getosreldate() >= 1100056)
+ osreldate = __getosreldate();
+ if (osreldate >= 1100056 ||
+ (osreldate >= 1002506 && osreldate < 1100000))
return (__sys_futimens(fd, times));
if (times == NULL || (times[0].tv_nsec == UTIME_NOW &&
diff --git a/lib/libc/sys/utimensat.2 b/lib/libc/sys/utimensat.2
index 0f397c6..a714b34 100644
--- a/lib/libc/sys/utimensat.2
+++ b/lib/libc/sys/utimensat.2
@@ -31,7 +31,7 @@
.\" @(#)utimes.2 8.1 (Berkeley) 6/4/93
.\" $FreeBSD$
.\"
-.Dd January 23, 2015
+.Dd January 17, 2016
.Dt UTIMENSAT 2
.Os
.Sh NAME
@@ -183,10 +183,13 @@ argument
points outside the process's allocated address space.
.It Bq Er EINVAL
The
-.Va tv_usec
+.Va tv_nsec
component of at least one of the values specified by the
.Fa times
-argument has a value less than 0 or greater than 999999.
+argument has a value less than 0 or greater than 999999999 and is not equal to
+.Dv UTIME_NOW
+or
+.Dv UTIME_OMIT .
.It Bq Er EIO
An I/O error occurred while reading or writing the affected inode.
.It Bq Er EPERM
@@ -289,4 +292,4 @@ The
and
.Fn utimensat
system calls appeared in
-.Fx 11.0 .
+.Fx 10.3 .
diff --git a/lib/libc/sys/utimensat.c b/lib/libc/sys/utimensat.c
index 67d19cb..a1c3c21 100644
--- a/lib/libc/sys/utimensat.c
+++ b/lib/libc/sys/utimensat.c
@@ -42,8 +42,11 @@ utimensat(int fd, const char *path, const struct timespec times[2], int flag)
{
struct timeval now, tv[2], *tvp;
struct stat sb;
+ int osreldate;
- if (__getosreldate() >= 1100056)
+ osreldate = __getosreldate();
+ if (osreldate >= 1100056 ||
+ (osreldate >= 1002506 && osreldate < 1100000))
return (__sys_utimensat(fd, path, times, flag));
if ((flag & ~AT_SYMLINK_NOFOLLOW) != 0) {
diff --git a/lib/libc/tests/net/Makefile b/lib/libc/tests/net/Makefile
index a88f44f..fb76f26 100644
--- a/lib/libc/tests/net/Makefile
+++ b/lib/libc/tests/net/Makefile
@@ -28,6 +28,8 @@ PROGS+= h_dns_server
DPADD.h_nsd_recurse+= ${LIBPTHREAD}
LDADD.h_nsd_recurse+= -lpthread
+__MAKE_SHELL?= /bin/sh
+
CLEANFILES+= aton_ether_subr.c
aton_ether_subr.c: gen_ether_subr ${.CURDIR:H:H:H:H}/sys/net/if_ethersubr.c
${__MAKE_SHELL} ${.ALLSRC} ${.TARGET}
diff --git a/lib/libfetch/common.c b/lib/libfetch/common.c
index eabea2b..ae8b79d 100644
--- a/lib/libfetch/common.c
+++ b/lib/libfetch/common.c
@@ -495,7 +495,8 @@ fetch_ssl_get_numeric_addrinfo(const char *hostname, size_t len)
hints.ai_protocol = 0;
hints.ai_flags = AI_NUMERICHOST;
/* port is not relevant for this purpose */
- getaddrinfo(host, "443", &hints, &res);
+ if (getaddrinfo(host, "443", &hints, &res) != 0)
+ res = NULL;
free(host);
return res;
}
@@ -672,9 +673,7 @@ fetch_ssl_setup_transport_layer(SSL_CTX *ctx, int verbose)
{
long ssl_ctx_options;
- ssl_ctx_options = SSL_OP_ALL | SSL_OP_NO_TICKET;
- if (getenv("SSL_ALLOW_SSL2") == NULL)
- ssl_ctx_options |= SSL_OP_NO_SSLv2;
+ ssl_ctx_options = SSL_OP_ALL | SSL_OP_NO_SSLv2 | SSL_OP_NO_TICKET;
if (getenv("SSL_ALLOW_SSL3") == NULL)
ssl_ctx_options |= SSL_OP_NO_SSLv3;
if (getenv("SSL_NO_TLS1") != NULL)
diff --git a/lib/libfetch/fetch.3 b/lib/libfetch/fetch.3
index 139363f..0ddc2c2 100644
--- a/lib/libfetch/fetch.3
+++ b/lib/libfetch/fetch.3
@@ -26,7 +26,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd October 15, 2014
+.Dd November 29, 2015
.Dt FETCH 3
.Os
.Sh NAME
@@ -441,10 +441,8 @@ By default
allows TLSv1 and newer when negotiating the connecting with the remote
peer.
You can change this behavior by setting the
-.Ev SSL_ALLOW_SSL2
-and
.Ev SSL_ALLOW_SSL3
-environment variables to allow SSLv2 and SSLv3, respectively, and
+environment variable to allow SSLv3 and
.Ev SSL_NO_TLS1 ,
.Ev SSL_NO_TLS1_1 and
.Ev SSL_NO_TLS1_2
@@ -633,11 +631,11 @@ If defined but empty, no User-Agent header is sent.
.It Ev NETRC
Specifies a file to use instead of
.Pa ~/.netrc
-to look up login names and passwords for FTP sites.
+to look up login names and passwords for FTP and HTTP sites as well as
+HTTP proxies.
See
.Xr ftp 1
for a description of the file format.
-This feature is experimental.
.It Ev NO_PROXY
Either a single asterisk, which disables the use of proxies
altogether, or a comma- or whitespace-separated list of hosts for
@@ -646,8 +644,6 @@ which proxies should not be used.
Same as
.Ev NO_PROXY ,
for compatibility.
-.It Ev SSL_ALLOW_SSL2
-Allow SSL version 2 when negotiating the connection (not recommended).
.It Ev SSL_ALLOW_SSL3
Allow SSL version 3 when negotiating the connection (not recommended).
.It Ev SSL_CA_CERT_FILE
diff --git a/lib/libfetch/file.c b/lib/libfetch/file.c
index 8c1d404..7b6462f 100644
--- a/lib/libfetch/file.c
+++ b/lib/libfetch/file.c
@@ -48,7 +48,7 @@ fetchXGetFile(struct url *u, struct url_stat *us, const char *flags)
if (us && fetchStatFile(u, us, flags) == -1)
return (NULL);
- f = fopen(u->doc, "r");
+ f = fopen(u->doc, "re");
if (f == NULL) {
fetch_syserr();
@@ -61,7 +61,6 @@ fetchXGetFile(struct url *u, struct url_stat *us, const char *flags)
return (NULL);
}
- fcntl(fileno(f), F_SETFD, FD_CLOEXEC);
return (f);
}
@@ -77,9 +76,9 @@ fetchPutFile(struct url *u, const char *flags)
FILE *f;
if (CHECK_FLAG('a'))
- f = fopen(u->doc, "a");
+ f = fopen(u->doc, "ae");
else
- f = fopen(u->doc, "w+");
+ f = fopen(u->doc, "w+e");
if (f == NULL) {
fetch_syserr();
@@ -92,7 +91,6 @@ fetchPutFile(struct url *u, const char *flags)
return (NULL);
}
- fcntl(fileno(f), F_SETFD, FD_CLOEXEC);
return (f);
}
diff --git a/lib/libfetch/http.c b/lib/libfetch/http.c
index e0c2979..206648d 100644
--- a/lib/libfetch/http.c
+++ b/lib/libfetch/http.c
@@ -130,8 +130,8 @@ struct httpio
int chunked; /* chunked mode */
char *buf; /* chunk buffer */
size_t bufsize; /* size of chunk buffer */
- ssize_t buflen; /* amount of data currently in buffer */
- int bufpos; /* current read offset in buffer */
+ size_t buflen; /* amount of data currently in buffer */
+ size_t bufpos; /* current read offset in buffer */
int eof; /* end-of-file flag */
int error; /* error flag */
size_t chunksize; /* remaining size of current chunk */
@@ -215,6 +215,7 @@ http_fillbuf(struct httpio *io, size_t len)
if (io->eof)
return (0);
+ /* not chunked: just fetch the requested amount */
if (io->chunked == 0) {
if (http_growbuf(io, len) == -1)
return (-1);
@@ -227,6 +228,7 @@ http_fillbuf(struct httpio *io, size_t len)
return (io->buflen);
}
+ /* chunked, but we ran out: get the next chunk header */
if (io->chunksize == 0) {
switch (http_new_chunk(io)) {
case -1:
@@ -238,6 +240,7 @@ http_fillbuf(struct httpio *io, size_t len)
}
}
+ /* fetch the requested amount, but no more than the current chunk */
if (len > io->chunksize)
len = io->chunksize;
if (http_growbuf(io, len) == -1)
@@ -246,8 +249,9 @@ http_fillbuf(struct httpio *io, size_t len)
io->error = errno;
return (-1);
}
+ io->bufpos = 0;
io->buflen = nbytes;
- io->chunksize -= io->buflen;
+ io->chunksize -= nbytes;
if (io->chunksize == 0) {
if (fetch_read(io->conn, &ch, 1) != 1 || ch != '\r' ||
@@ -255,8 +259,6 @@ http_fillbuf(struct httpio *io, size_t len)
return (-1);
}
- io->bufpos = 0;
-
return (io->buflen);
}
@@ -1330,7 +1332,6 @@ static int
http_authorize(conn_t *conn, const char *hdr, http_auth_challenges_t *cs,
http_auth_params_t *parms, struct url *url)
{
- http_auth_challenge_t *basic = NULL;
http_auth_challenge_t *digest = NULL;
int i;
@@ -1340,10 +1341,8 @@ http_authorize(conn_t *conn, const char *hdr, http_auth_challenges_t *cs,
return (-1);
}
- /* Look for a Digest and a Basic challenge */
+ /* Look for a Digest */
for (i = 0; i < cs->count; i++) {
- if (cs->challenges[i]->scheme == HTTPAS_BASIC)
- basic = cs->challenges[i];
if (cs->challenges[i]->scheme == HTTPAS_DIGEST)
digest = cs->challenges[i];
}
@@ -1379,8 +1378,12 @@ http_connect(struct url *URL, struct url *purl, const char *flags)
{
struct url *curl;
conn_t *conn;
+ hdr_t h;
+ http_headerbuf_t headerbuf;
+ const char *p;
int verbose;
int af, val;
+ int serrno;
#ifdef INET6
af = AF_UNSPEC;
@@ -1401,6 +1404,7 @@ http_connect(struct url *URL, struct url *purl, const char *flags)
if ((conn = fetch_connect(curl->host, curl->port, af, verbose)) == NULL)
/* fetch_connect() has already set an error code */
return (NULL);
+ init_http_headerbuf(&headerbuf);
if (strcasecmp(URL->scheme, SCHEME_HTTPS) == 0 && purl) {
http_cmd(conn, "CONNECT %s:%d HTTP/1.1",
URL->host, URL->port);
@@ -1408,10 +1412,26 @@ http_connect(struct url *URL, struct url *purl, const char *flags)
URL->host, URL->port);
http_cmd(conn, "");
if (http_get_reply(conn) != HTTP_OK) {
- fetch_close(conn);
- return (NULL);
+ http_seterr(conn->err);
+ goto ouch;
+ }
+ /* Read and discard the rest of the proxy response */
+ if (fetch_getln(conn) < 0) {
+ fetch_syserr();
+ goto ouch;
}
- http_get_reply(conn);
+ do {
+ switch ((h = http_next_header(conn, &headerbuf, &p))) {
+ case hdr_syserror:
+ fetch_syserr();
+ goto ouch;
+ case hdr_error:
+ http_seterr(HTTP_PROTOCOL_ERROR);
+ goto ouch;
+ default:
+ /* ignore */ ;
+ }
+ } while (h < hdr_end);
}
if (strcasecmp(URL->scheme, SCHEME_HTTPS) == 0 &&
fetch_ssl(conn, URL, verbose) == -1) {
@@ -1419,13 +1439,20 @@ http_connect(struct url *URL, struct url *purl, const char *flags)
/* grrr */
errno = EAUTH;
fetch_syserr();
- return (NULL);
+ goto ouch;
}
val = 1;
setsockopt(conn->sd, IPPROTO_TCP, TCP_NOPUSH, &val, sizeof(val));
+ clean_http_headerbuf(&headerbuf);
return (conn);
+ouch:
+ serrno = errno;
+ clean_http_headerbuf(&headerbuf);
+ fetch_close(conn);
+ errno = serrno;
+ return (NULL);
}
static struct url *
@@ -1633,6 +1660,9 @@ http_request_body(struct url *URL, const char *op, struct url_stat *us,
http_seterr(HTTP_NEED_PROXY_AUTH);
goto ouch;
}
+ } else if (fetch_netrc_auth(purl) == 0) {
+ aparams.user = strdup(purl->user);
+ aparams.password = strdup(purl->pwd);
}
http_authorize(conn, "Proxy-Authorization",
&proxy_challenges, &aparams, url);
@@ -1660,6 +1690,9 @@ http_request_body(struct url *URL, const char *op, struct url_stat *us,
http_seterr(HTTP_NEED_AUTH);
goto ouch;
}
+ } else if (fetch_netrc_auth(url) == 0) {
+ aparams.user = strdup(url->user);
+ aparams.password = strdup(url->pwd);
} else if (fetchAuthMethod &&
fetchAuthMethod(url) == 0) {
aparams.user = strdup(url->user);
diff --git a/lib/libpam/Makefile.inc b/lib/libpam/Makefile.inc
index d2d1d42..59a8ced 100644
--- a/lib/libpam/Makefile.inc
+++ b/lib/libpam/Makefile.inc
@@ -27,7 +27,6 @@
CFLAGS+= -DOPENPAM_DEBUG
SHLIB_MAJOR= 5
-PAM_MOD_DIR= ${LIBDIR}
STATIC_CFLAGS+= -DOPENPAM_STATIC_MODULES
diff --git a/lib/libpam/libpam/Makefile b/lib/libpam/libpam/Makefile
index 62293e3..105748e 100644
--- a/lib/libpam/libpam/Makefile
+++ b/lib/libpam/libpam/Makefile
@@ -155,7 +155,6 @@ MLINKS= pam.conf.5 pam.d.5
CSTD?= c99
CFLAGS+= -I${.CURDIR} -I${OPENPAM}/include
CFLAGS+= -DLIB_MAJ=${SHLIB_MAJOR}
-CFLAGS+= -DOPENPAM_MODULES_DIR='"${PAM_MOD_DIR:C/\/*$//}/"'
CFLAGS+= -DHAVE_DLFUNC=1
CFLAGS+= -DHAVE_FDLOPEN=1
CFLAGS+= -DHAVE_FPURGE=1
diff --git a/lib/libstand/Makefile b/lib/libstand/Makefile
index 7c253c8..893ed68 100644
--- a/lib/libstand/Makefile
+++ b/lib/libstand/Makefile
@@ -59,8 +59,8 @@ SRCS+= ntoh.c
.if ${MACHINE_CPUARCH} != "ia64"
SRCS+= bcmp.c bcopy.c bzero.c ffs.c memccpy.c memchr.c memcmp.c memcpy.c \
memmove.c memset.c qdivrem.c strcat.c strchr.c strcmp.c strcpy.c \
- strcspn.c strlen.c strncat.c strncmp.c strncpy.c strpbrk.c \
- strrchr.c strsep.c strspn.c strstr.c strtok.c swab.c
+ strcspn.c strlcat.c strlcpy.c strlen.c strncat.c strncmp.c strncpy.c \
+ strpbrk.c strrchr.c strsep.c strspn.c strstr.c strtok.c swab.c
.endif
.if ${MACHINE_CPUARCH} == "arm"
.PATH: ${.CURDIR}/../libc/arm/gen
@@ -86,6 +86,7 @@ SRCS+= aeabi_memcmp.S aeabi_memcpy.S aeabi_memmove.S aeabi_memset.S
.PATH: ${.CURDIR}/../libc/ia64/string
SRCS+= bcmp.c bcopy.S bzero.S ffs.S memccpy.c memchr.c memcmp.c memcpy.S \
memmove.S memset.c strcat.c strchr.c strcmp.c strcpy.c strcspn.c \
+ strlcat.c strlcpy.c \
strlen.c strncat.c strncmp.c strncpy.c strpbrk.c strrchr.c strsep.c \
strspn.c strstr.c strtok.c swab.c
diff --git a/lib/libstand/bootp.c b/lib/libstand/bootp.c
index 904b3ba..1af7bd5 100644
--- a/lib/libstand/bootp.c
+++ b/lib/libstand/bootp.c
@@ -354,6 +354,7 @@ vend_rfc1048(cp, len)
u_char *ep;
int size;
u_char tag;
+ const char *val;
#ifdef BOOTP_DEBUG
if (debug)
@@ -380,15 +381,17 @@ vend_rfc1048(cp, len)
}
if (tag == TAG_SWAPSERVER) {
/* let it override bp_siaddr */
- bcopy(cp, &rootip.s_addr, sizeof(swapip.s_addr));
+ bcopy(cp, &rootip.s_addr, sizeof(rootip.s_addr));
}
if (tag == TAG_ROOTPATH) {
- strncpy(rootpath, (char *)cp, sizeof(rootpath));
- rootpath[size] = '\0';
+ if ((val = getenv("dhcp.root-path")) == NULL)
+ val = (const char *)cp;
+ strlcpy(rootpath, val, sizeof(rootpath));
}
if (tag == TAG_HOSTNAME) {
- strncpy(hostname, (char *)cp, sizeof(hostname));
- hostname[size] = '\0';
+ if ((val = getenv("dhcp.host-name")) == NULL)
+ val = (const char *)cp;
+ strlcpy(hostname, val, sizeof(hostname));
}
#ifdef SUPPORT_DHCP
if (tag == TAG_DHCP_MSGTYPE) {
@@ -730,7 +733,11 @@ setenv_(u_char *cp, u_char *ep, struct dhcp_opt *opts)
sprintf(env, op->desc, opts[0].desc, tag);
else
sprintf(env, "%s%s", opts[0].desc, op->desc);
- setenv(env, buf, 1);
+ /*
+ * Do not replace existing values in the environment, so that
+ * locally-obtained values can override server-provided values.
+ */
+ setenv(env, buf, 0);
}
}
if (tp != tags) {
diff --git a/lib/libthr/thread/thr_umtx.c b/lib/libthr/thread/thr_umtx.c
index a61dab0..37e5df1 100644
--- a/lib/libthr/thread/thr_umtx.c
+++ b/lib/libthr/thread/thr_umtx.c
@@ -42,7 +42,7 @@ int _umtx_op_err(void *obj, int op, u_long val, void *uaddr, void *uaddr2)
void
_thr_umutex_init(struct umutex *mtx)
{
- static struct umutex default_mtx = DEFAULT_UMUTEX;
+ static const struct umutex default_mtx = DEFAULT_UMUTEX;
*mtx = default_mtx;
}
@@ -50,7 +50,8 @@ _thr_umutex_init(struct umutex *mtx)
void
_thr_urwlock_init(struct urwlock *rwl)
{
- static struct urwlock default_rwl = DEFAULT_URWLOCK;
+ static const struct urwlock default_rwl = DEFAULT_URWLOCK;
+
*rwl = default_rwl;
}
diff --git a/lib/msun/tests/Makefile b/lib/msun/tests/Makefile
index ffa1765..2561ef7 100644
--- a/lib/msun/tests/Makefile
+++ b/lib/msun/tests/Makefile
@@ -39,12 +39,19 @@ NETBSD_ATF_TESTS_C+= tanh_test
TAP_TESTS_C+= cexp_test
TAP_TESTS_C+= conj_test
TAP_TESTS_C+= csqrt_test
+TAP_TESTS_C+= ctrig_test
+TAP_TESTS_C+= exponential_test
TAP_TESTS_C+= fenv_test
+TAP_TESTS_C+= fma_test
TAP_TESTS_C+= fmaxmin_test
TAP_TESTS_C+= ilogb_test
+TAP_TESTS_C+= invtrig_test
TAP_TESTS_C+= invctrig_test
TAP_TESTS_C+= logarithm_test
TAP_TESTS_C+= lrint_test
+# XXX: the testcase crashes on all platforms, but only on head
+# (bug 205451)
+#TAP_TESTS_C+= lround_test
TAP_TESTS_C+= nan_test
TAP_TESTS_C+= nearbyint_test
TAP_TESTS_C+= next_test
@@ -53,7 +60,6 @@ TAP_TESTS_C+= trig_test
.for t in ${TAP_TESTS_C}
CFLAGS.$t+= -O0
-CFLAGS.$t+= -I${SRCTOP}/tools/regression/lib/msun
.endfor
CSTD= c99
diff --git a/tools/regression/lib/msun/test-ctrig.c b/lib/msun/tests/ctrig_test.c
index 475b6c5..475b6c5 100644
--- a/tools/regression/lib/msun/test-ctrig.c
+++ b/lib/msun/tests/ctrig_test.c
diff --git a/tools/regression/lib/msun/test-exponential.c b/lib/msun/tests/exponential_test.c
index df552ee..df552ee 100644
--- a/tools/regression/lib/msun/test-exponential.c
+++ b/lib/msun/tests/exponential_test.c
diff --git a/tools/regression/lib/msun/test-fma.c b/lib/msun/tests/fma_test.c
index 7adbd81..af7910e 100644
--- a/tools/regression/lib/msun/test-fma.c
+++ b/lib/msun/tests/fma_test.c
@@ -494,6 +494,11 @@ main(int argc, char *argv[])
}
for (i = 0; i < nitems(rmodes); i++, j++) {
+#if defined(__amd64__)
+ printf("ok %d # SKIP testcase fails assertion on "
+ "amd64\n", j);
+ continue;
+#endif
printf("rmode = %d\n", rmodes[i]);
fesetround(rmodes[i]);
test_infinities();
@@ -502,8 +507,7 @@ main(int argc, char *argv[])
fesetround(FE_TONEAREST);
test_nans();
- printf("ok %d - fma NaNs\n", j);
- j++;
+ printf("ok 9 - fma NaNs\n");
for (i = 0; i < nitems(rmodes); i++, j++) {
printf("rmode = %d\n", rmodes[i]);
diff --git a/tools/regression/lib/msun/test-invtrig.c b/lib/msun/tests/invtrig_test.c
index 2110df4..01b0379 100644
--- a/tools/regression/lib/msun/test-invtrig.c
+++ b/lib/msun/tests/invtrig_test.c
@@ -41,8 +41,6 @@ __FBSDID("$FreeBSD$");
#include "test-utils.h"
-#define LEN(a) (sizeof(a) / sizeof((a)[0]))
-
#pragma STDC FENV_ACCESS ON
/*
diff --git a/tools/regression/lib/msun/test-lround.c b/lib/msun/tests/lround_test.c
index 2a37367..2a37367 100644
--- a/tools/regression/lib/msun/test-lround.c
+++ b/lib/msun/tests/lround_test.c
diff --git a/tools/regression/lib/msun/test-ctrig.t b/lib/msun/tests/lround_test.t
index 8bdfd03..8bdfd03 100644
--- a/tools/regression/lib/msun/test-ctrig.t
+++ b/lib/msun/tests/lround_test.t
diff --git a/tools/regression/lib/msun/test-utils.h b/lib/msun/tests/test-utils.h
index bf0d6de..bf0d6de 100644
--- a/tools/regression/lib/msun/test-utils.h
+++ b/lib/msun/tests/test-utils.h
diff --git a/sbin/ifconfig/sfp.c b/sbin/ifconfig/sfp.c
index 7c090e1..306140a 100644
--- a/sbin/ifconfig/sfp.c
+++ b/sbin/ifconfig/sfp.c
@@ -171,7 +171,7 @@ static struct _nv fc_speed[] = {
/* 10/40G Ethernet compliance codes, byte 128 + 3 */
static struct _nv eth_1040g[] = {
- { 0x80, "Reserved" },
+ { 0x80, "Extended" },
{ 0x40, "10GBASE-LRM" },
{ 0x20, "10GBASE-LR" },
{ 0x10, "10GBASE-SR" },
@@ -181,6 +181,38 @@ static struct _nv eth_1040g[] = {
{ 0x01, "40G Active Cable" },
{ 0, NULL }
};
+#define SFF_8636_EXT_COMPLIANCE 0x80
+
+/* SFF-8024 Rev. 3.4 table 4.4: Extended Specification Compliance */
+static struct _nv eth_extended_comp[] = {
+ { 0xFF, "Reserved" },
+ { 0x1A, "2 lambda DWDM 100G" },
+ { 0x19, "100G ACC or 25GAUI C2M ACC" },
+ { 0x18, "100G AOC or 25GAUI C2M AOC" },
+ { 0x17, "100G CLR4" },
+ { 0x16, "10GBASE-T with SFI electrical interface" },
+ { 0x15, "G959.1 profile P1L1-2D2" },
+ { 0x14, "G959.1 profile P1S1-2D2" },
+ { 0x13, "G959.1 profile P1I1-2D1" },
+ { 0x12, "40G PSM4 Parallel SMF" },
+ { 0x11, "4 x 10GBASE-SR" },
+ { 0x10, "40GBASE-ER4" },
+ { 0x0F, "Reserved" },
+ { 0x0D, "25GBASE-CR CA-N" },
+ { 0x0C, "25GBASE-CR CA-S" },
+ { 0x0B, "100GBASE-CR4 or 25GBASE-CR CA-L" },
+ { 0x0A, "Reserved" },
+ { 0x09, "100G CWDM4 MSA without FEC" },
+ { 0x08, "100G ACC (Active Copper Cable)" },
+ { 0x07, "100G PSM4 Parallel SMF" },
+ { 0x06, "100G CWDM4 MSA with FEC" },
+ { 0x05, "100GBASE-SR10" },
+ { 0x04, "100GBASE-ER4" },
+ { 0x03, "100GBASE-LR4" },
+ { 0x02, "100GBASE-SR4" },
+ { 0x01, "100G AOC (Active Optical Cable) or 25GAUI C2M ACC" },
+ { 0x00, "Unspecified" }
+};
/* SFF-8636 Rev. 2.5 table 6.3: Revision compliance */
static struct _nv rev_compl[] = {
@@ -371,9 +403,16 @@ get_qsfp_transceiver_class(struct i2c_info *ii, char *buf, size_t size)
const char *tech_class;
uint8_t code;
- /* Check 10/40G Ethernet class only */
- read_i2c(ii, SFF_8436_BASE, SFF_8436_CODE_E1040G, 1, &code);
- tech_class = find_zero_bit(eth_1040g, code, 1);
+ read_i2c(ii, SFF_8436_BASE, SFF_8436_CODE_E1040100G, 1, &code);
+
+ /* Check for extended specification compliance */
+ if (code & SFF_8636_EXT_COMPLIANCE) {
+ read_i2c(ii, SFF_8436_BASE, SFF_8436_OPTIONS_START, 1, &code);
+ tech_class = find_value(eth_extended_comp, code);
+ } else
+ /* Check 10/40G Ethernet class only */
+ tech_class = find_zero_bit(eth_1040g, code, 1);
+
if (tech_class == NULL)
tech_class = "Unknown";
@@ -873,6 +912,7 @@ sfp_status(int s, struct ifreq *ifr, int verbose)
switch (id_byte) {
case SFF_8024_ID_QSFP:
case SFF_8024_ID_QSFPPLUS:
+ case SFF_8024_ID_QSFP28:
print_qsfp_status(&ii, verbose);
break;
default:
diff --git a/sbin/mount/mount.c b/sbin/mount/mount.c
index 5ea45df..1d35f3e 100644
--- a/sbin/mount/mount.c
+++ b/sbin/mount/mount.c
@@ -485,10 +485,18 @@ ismounted(struct fstab *fs, struct statfs *mntbuf, int mntsize)
strlcpy(realfsfile, fs->fs_file, sizeof(realfsfile));
}
+ /*
+ * Consider the filesystem to be mounted if:
+ * It has the same mountpoint as a mounted filesytem, and
+ * It has the same type as that same mounted filesystem, and
+ * It has the same device name as that same mounted filesystem, OR
+ * It is a nonremountable filesystem
+ */
for (i = mntsize - 1; i >= 0; --i)
if (strcmp(realfsfile, mntbuf[i].f_mntonname) == 0 &&
+ strcmp(fs->fs_vfstype, mntbuf[i].f_fstypename) == 0 &&
(!isremountable(fs->fs_vfstype) ||
- strcmp(fs->fs_spec, mntbuf[i].f_mntfromname) == 0))
+ (strcmp(fs->fs_spec, mntbuf[i].f_mntfromname) == 0)))
return (1);
return (0);
}
diff --git a/secure/lib/libssh/Makefile b/secure/lib/libssh/Makefile
index 9fd0871..2f73b4c 100644
--- a/secure/lib/libssh/Makefile
+++ b/secure/lib/libssh/Makefile
@@ -49,10 +49,6 @@ DPADD+= ${LIBGSSAPI} ${LIBKRB5} ${LIBHX509} ${LIBASN1} ${LIBCOM_ERR} ${LIBMD} ${
LDADD+= -lgssapi -lkrb5 -lhx509 -lasn1 -lcom_err -lmd -lroken
.endif
-.if ${MK_OPENSSH_NONE_CIPHER} != "no"
-CFLAGS+= -DNONE_CIPHER_ENABLED
-.endif
-
NO_LINT=
DPADD+= ${LIBCRYPTO} ${LIBCRYPT} ${LIBZ}
diff --git a/secure/usr.bin/ssh/Makefile b/secure/usr.bin/ssh/Makefile
index be5861f..a019ec1 100644
--- a/secure/usr.bin/ssh/Makefile
+++ b/secure/usr.bin/ssh/Makefile
@@ -35,10 +35,6 @@ DPADD+= ${LIBGSSAPI}
LDADD+= -lgssapi
.endif
-.if ${MK_OPENSSH_NONE_CIPHER} != "no"
-CFLAGS+= -DNONE_CIPHER_ENABLED
-.endif
-
DPADD+= ${LIBCRYPT} ${LIBCRYPTO} ${LIBZ}
LDADD+= -lcrypt -lcrypto -lz
diff --git a/secure/usr.sbin/sshd/Makefile b/secure/usr.sbin/sshd/Makefile
index 04da063..7e7143a 100644
--- a/secure/usr.sbin/sshd/Makefile
+++ b/secure/usr.sbin/sshd/Makefile
@@ -52,10 +52,6 @@ LDADD+= -lgssapi_krb5 -lgssapi -lkrb5 -lhx509 -lasn1 \
-lcom_err -lroken -lwind -lheimbase -lheimipcc
.endif
-.if ${MK_OPENSSH_NONE_CIPHER} != "no"
-CFLAGS+= -DNONE_CIPHER_ENABLED
-.endif
-
DPADD+= ${LIBCRYPT} ${LIBCRYPTO} ${LIBZ}
LDADD+= -lcrypt -lcrypto -lz
diff --git a/share/man/man4/sfxge.4 b/share/man/man4/sfxge.4
index b924986..9057fa8 100644
--- a/share/man/man4/sfxge.4
+++ b/share/man/man4/sfxge.4
@@ -121,8 +121,10 @@ If a packet is dropped, the
counter is incremented and the local sender receives ENOBUFS.
The value must be greater than or equal to 0.
.It Va hw.sfxge.tso_fw_assisted
-Enable/disable usage of FW-assisted TSO if supported by NIC firmware.
-Enabled by default.
+Bitmask to enable/disable usage of FW-assisted TSO version if supported
+by NIC firmware.
+FATSOv1 (bit 0) and FATSOv2 (bit 1) are supported.
+All enabled by default.
.It Va hw.sfxge.N.max_rss_channels
The maximum number of allocated RSS channels for the Nth adapter.
If set to 0 or unset, the number of channels is determined by the number
diff --git a/share/man/man4/uart.4 b/share/man/man4/uart.4
index d520409..c0f49a1 100644
--- a/share/man/man4/uart.4
+++ b/share/man/man4/uart.4
@@ -25,7 +25,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd August 10, 2015
+.Dd December 9, 2015
.Dt UART 4
.Os
.Sh NAME
@@ -160,7 +160,9 @@ The API, accessed via
is available on the tty device.
To use the PPS capture feature with
.Xr ntpd 8 ,
-symlink the tty device to
+symlink the tty callout device
+.Va /dev/cuau?
+to
.Va /dev/pps0.
.Pp
The
@@ -175,15 +177,54 @@ it can be set in
.Xr loader.conf 5
or
.Xr sysctl.conf 5 .
+.Pp
The following capture modes are available:
.Bl -tag -compact -offset "mmmm" -width "mmmm"
-.It 0
+.It 0x00
Capture disabled.
-.It 1
+.It 0x01
Capture pulses on the CTS line.
-.It 2
-Capture pulses on the DCD line (default).
+.It 0x02
+Capture pulses on the DCD line.
+.El
+.Pp
+The following values may be ORed with the capture mode to configure
+capture processing options:
+.Bl -tag -compact -offset "mmmm" -width "mmmm"
+.It 0x10
+Invert the pulse (RS-232 logic low = ASSERT, high = CLEAR).
+.It 0x20
+Attempt to capture narrow pulses.
.El
+.Pp
+Add the narrow pulse option when the incoming PPS pulse width is small
+enough to prevent reliable capture in normal mode.
+In narrow mode the driver uses the hardware's ability to latch a line
+state change; not all hardware has this capability.
+The hardware latch provides a reliable indication that a pulse occurred,
+but prevents distinguishing between the CLEAR and ASSERT edges of the pulse.
+For each detected pulse, the driver synthesizes both an ASSERT and a CLEAR
+event, using the same timestamp for each.
+To prevent spurious events when the hardware is intermittently able to
+see both edges of a pulse, the driver will not generate a new pair of
+events within a half second of the prior pair.
+Both normal and narrow pulse modes work with
+.Xr ntpd 8 .
+.Pp
+Add the invert option when the connection to the uart device uses TTL
+level signals, or when the PPS source emits inverted pulses.
+RFC 2783 defines an ASSERT event as a higher-voltage line level, and a CLEAR
+event as a lower-voltage line level, in the context of the RS-232 protocol.
+The modem control signals on a TTL-level connection are typically
+inverted from the RS-232 levels.
+For example, carrier presence is indicated by a high signal on an RS-232
+DCD line, and by a low signal on a TTL DCD line.
+This is due to the use of inverting line driver buffers to convert between
+TTL and RS-232 line levels in most hardware designs.
+Generally speaking, a connection to a DB-9 style connector is an RS-232
+level signal at up to 12 volts.
+A connection to header pins or an edge-connector on an embedded board
+is typically a TTL signal at 3.3 or 5 volts.
.Sh FILES
.Bl -tag -width ".Pa /dev/ttyu?.init" -compact
.It Pa /dev/ttyu?
diff --git a/share/man/man7/ascii.7 b/share/man/man7/ascii.7
index feba2338..6b4a7ce 100644
--- a/share/man/man7/ascii.7
+++ b/share/man/man7/ascii.7
@@ -32,7 +32,7 @@
.\" @(#)ascii.7 8.1 (Berkeley) 6/5/93
.\" $FreeBSD$
.\"
-.Dd June 5, 1993
+.Dd January 20, 2016
.Dt ASCII 7
.Os
.Sh NAME
@@ -46,7 +46,7 @@ The
set:
.Bd -literal -offset left
000 NUL 001 SOH 002 STX 003 ETX 004 EOT 005 ENQ 006 ACK 007 BEL
-010 BS 011 HT 012 NL 013 VT 014 NP 015 CR 016 SO 017 SI
+010 BS 011 HT 012 LF 013 VT 014 FF 015 CR 016 SO 017 SI
020 DLE 021 DC1 022 DC2 023 DC3 024 DC4 025 NAK 026 SYN 027 ETB
030 CAN 031 EM 032 SUB 033 ESC 034 FS 035 GS 036 RS 037 US
040 SP 041 ! 042 " 043 # 044 $ 045 % 046 & 047 '
@@ -68,7 +68,7 @@ The
set:
.Bd -literal -offset left
00 NUL 01 SOH 02 STX 03 ETX 04 EOT 05 ENQ 06 ACK 07 BEL
-08 BS 09 HT 0A NL 0B VT 0C NP 0D CR 0E SO 0F SI
+08 BS 09 HT 0A LF 0B VT 0C FF 0D CR 0E SO 0F SI
10 DLE 11 DC1 12 DC2 13 DC3 14 DC4 15 NAK 16 SYN 17 ETB
18 CAN 19 EM 1A SUB 1B ESC 1C FS 1D GS 1E RS 1F US
20 SP 21 ! 22 " 23 # 24 $ 25 % 26 & 27 '
@@ -90,7 +90,7 @@ The
set:
.Bd -literal -offset left
0 NUL 1 SOH 2 STX 3 ETX 4 EOT 5 ENQ 6 ACK 7 BEL
- 8 BS 9 HT 10 NL 11 VT 12 NP 13 CR 14 SO 15 SI
+ 8 BS 9 HT 10 LF 11 VT 12 FF 13 CR 14 SO 15 SI
16 DLE 17 DC1 18 DC2 19 DC3 20 DC4 21 NAK 22 SYN 23 ETB
24 CAN 25 EM 26 SUB 27 ESC 28 FS 29 GS 30 RS 31 US
32 SP 33 ! 34 " 35 # 36 $ 37 % 38 & 39 '
diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile
index a6a13fd..53e0753 100644
--- a/share/man/man9/Makefile
+++ b/share/man/man9/Makefile
@@ -1022,6 +1022,8 @@ MLINKS+=pci.9 pci_alloc_msi.9 \
pci.9 pci_get_vpd_readonly.9 \
pci.9 pci_msi_count.9 \
pci.9 pci_msix_count.9 \
+ pci.9 pci_msix_pba_bar.9 \
+ pci.9 pci_msix_table_bar.9 \
pci.9 pci_pending_msix.9 \
pci.9 pci_read_config.9 \
pci.9 pci_release_msi.9 \
diff --git a/share/man/man9/devfs_set_cdevpriv.9 b/share/man/man9/devfs_set_cdevpriv.9
index 736a007..c33c175 100644
--- a/share/man/man9/devfs_set_cdevpriv.9
+++ b/share/man/man9/devfs_set_cdevpriv.9
@@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd August 15, 2012
+.Dd December 2, 2015
.Dt DEVFS_CDEVPRIV 9
.Os
.Sh NAME
@@ -36,12 +36,12 @@
.In sys/param.h
.In sys/conf.h
.Bd -literal
-typedef void (*cdevpriv_dtr_t)(void *data);
+typedef void d_priv_dtor_t(void *data);
.Ed
.Ft int
.Fn devfs_get_cdevpriv "void **datap"
.Ft int
-.Fn devfs_set_cdevpriv "void *priv" "cdevpriv_dtr_t dtr"
+.Fn devfs_set_cdevpriv "void *priv" "d_priv_dtor_t *dtr"
.Ft void
.Fn devfs_clear_cdevpriv "void"
.Sh DESCRIPTION
@@ -116,8 +116,7 @@ was called.
.Sh SEE ALSO
.Xr open 2 ,
.Xr close 2 ,
-.Xr devfs 5 ,
-.Xr kern_openat 9
+.Xr devfs 5
.Sh HISTORY
The
.Fn devfs_cdevpriv
diff --git a/share/man/man9/pci.9 b/share/man/man9/pci.9
index 6599e28..108ddc4 100644
--- a/share/man/man9/pci.9
+++ b/share/man/man9/pci.9
@@ -25,7 +25,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd November 5, 2015
+.Dd December 23, 2015
.Dt PCI 9
.Os
.Sh NAME
@@ -49,6 +49,8 @@
.Nm pci_get_vpd_readonly ,
.Nm pci_msi_count ,
.Nm pci_msix_count ,
+.Nm pci_msix_pba_bar ,
+.Nm pci_msix_table_bar ,
.Nm pci_pending_msix ,
.Nm pci_read_config ,
.Nm pci_release_msi ,
@@ -105,6 +107,10 @@
.Ft int
.Fn pci_msix_count "device_t dev"
.Ft int
+.Fn pci_msix_pba_bar "device_t dev"
+.Ft int
+.Fn pci_msix_table_bar "device_t dev"
+.Ft int
.Fn pci_pending_msix "device_t dev" "u_int index"
.Ft uint32_t
.Fn pci_read_config "device_t dev" "int reg" "int width"
@@ -618,6 +624,37 @@ then
returns zero.
.Pp
The
+.Fn pci_msix_pba_bar
+function returns the offset in configuration space of the Base Address Register
+.Pq BAR
+containing the MSI-X Pending Bit Array (PBA) for device
+.Fa dev .
+The returned value can be used as the resource ID with
+.Xr bus_alloc_resource 9
+and
+.Xr bus_release_resource 9
+to allocate the BAR.
+If the device does not support MSI-X,
+then
+.Fn pci_msix_pba_bar
+returns -1.
+.Pp
+The
+.Fn pci_msix_table_bar
+function returns the offset in configuration space of the BAR
+containing the MSI-X vector table for device
+.Fa dev .
+The returned value can be used as the resource ID with
+.Xr bus_alloc_resource 9
+and
+.Xr bus_release_resource 9
+to allocate the BAR.
+If the device does not support MSI-X,
+then
+.Fn pci_msix_table_bar
+returns -1.
+.Pp
+The
.Fn pci_alloc_msix
function attempts to allocate
.Fa *count
@@ -656,12 +693,21 @@ it returns an error.
Unlike MSI,
MSI-X does not require message counts that are powers of two.
.Pp
+The BARs containing the MSI-X vector table and PBA must be
+allocated via
+.Xr bus_alloc_resource 9
+before calling
+.Fn pci_alloc_msix
+and must not be released until after calling
+.Fn pci_release_msi .
+Note that the vector table and PBA may be stored in the same BAR or in
+different BARs.
+.Pp
The
.Fn pci_pending_msix
function examines the
.Fa dev
-device's Pending Bit Array
-.Pq PBA
+device's PBA
to determine the pending status of the MSI-X message at table index
.Fa index .
If the indicated message is pending,
@@ -776,3 +822,6 @@ These do not refer to the geographic location of PCI devices,
but to the device number assigned by the combination of the PCI IDSEL
mechanism and the platform firmware.
This should be taken note of when working with the kernel PCI code.
+.Pp
+The PCI bus driver should allocate the MSI-X vector table and PBA internally
+as necessary rather than requiring the caller to do so.
diff --git a/share/misc/ascii b/share/misc/ascii
index b7bcef5..2a71a43 100644
--- a/share/misc/ascii
+++ b/share/misc/ascii
@@ -1,5 +1,5 @@
|000 nul|001 soh|002 stx|003 etx|004 eot|005 enq|006 ack|007 bel|
-|010 bs |011 ht |012 nl |013 vt |014 np |015 cr |016 so |017 si |
+|010 bs |011 ht |012 lf |013 vt |014 ff |015 cr |016 so |017 si |
|020 dle|021 dc1|022 dc2|023 dc3|024 dc4|025 nak|026 syn|027 etb|
|030 can|031 em |032 sub|033 esc|034 fs |035 gs |036 rs |037 us |
|040 sp |041 ! |042 " |043 # |044 $ |045 % |046 & |047 ' |
@@ -16,7 +16,7 @@
|170 x |171 y |172 z |173 { |174 | |175 } |176 ~ |177 del|
| 00 nul| 01 soh| 02 stx| 03 etx| 04 eot| 05 enq| 06 ack| 07 bel|
-| 08 bs | 09 ht | 0a nl | 0b vt | 0c np | 0d cr | 0e so | 0f si |
+| 08 bs | 09 ht | 0a lf | 0b vt | 0c ff | 0d cr | 0e so | 0f si |
| 10 dle| 11 dc1| 12 dc2| 13 dc3| 14 dc4| 15 nak| 16 syn| 17 etb|
| 18 can| 19 em | 1a sub| 1b esc| 1c fs | 1d gs | 1e rs | 1f us |
| 20 sp | 21 ! | 22 " | 23 # | 24 $ | 25 % | 26 & | 27 ' |
@@ -33,7 +33,7 @@
| 78 x | 79 y | 7a z | 7b { | 7c | | 7d } | 7e ~ | 7f del|
| 0 nul| 1 soh| 2 stx| 3 etx| 4 eot| 5 enq| 6 ack| 7 bel|
-| 8 bs | 9 ht | 10 nl | 11 vt | 12 np | 13 cr | 14 so | 15 si |
+| 8 bs | 9 ht | 10 lf | 11 vt | 12 ff | 13 cr | 14 so | 15 si |
| 16 dle| 17 dc1| 18 dc2| 19 dc3| 20 dc4| 21 nak| 22 syn| 23 etb|
| 24 can| 25 em | 26 sub| 27 esc| 28 fs | 29 gs | 30 rs | 31 us |
| 32 sp | 33 ! | 34 " | 35 # | 36 $ | 37 % | 38 & | 39 ' |
diff --git a/share/mk/bsd.own.mk b/share/mk/bsd.own.mk
index ef200d8..23ffa24 100644
--- a/share/mk/bsd.own.mk
+++ b/share/mk/bsd.own.mk
@@ -405,7 +405,6 @@ __DEFAULT_NO_OPTIONS = \
LLDB \
NAND \
OFED \
- OPENSSH_NONE_CIPHER \
PKGTOOLS \
SHARED_TOOLCHAIN \
SVN \
diff --git a/sys/amd64/amd64/elf_machdep.c b/sys/amd64/amd64/elf_machdep.c
index d961f09..d7c9fef 100644
--- a/sys/amd64/amd64/elf_machdep.c
+++ b/sys/amd64/amd64/elf_machdep.c
@@ -83,6 +83,7 @@ struct sysentvec elf64_freebsd_sysvec = {
.sv_shared_page_len = PAGE_SIZE,
.sv_schedtail = NULL,
.sv_thread_detach = NULL,
+ .sv_trap = NULL,
};
INIT_SYSENTVEC(elf64_sysvec, &elf64_freebsd_sysvec);
diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c
index 03334f1..15265aa 100644
--- a/sys/amd64/amd64/machdep.c
+++ b/sys/amd64/amd64/machdep.c
@@ -1847,7 +1847,7 @@ hammer_time(u_int64_t modulep, u_int64_t physfree)
if (kmdp == NULL)
kmdp = preload_search_by_type("elf64 kernel");
boothowto = MD_FETCH(kmdp, MODINFOMD_HOWTO, int);
- kern_envp = MD_FETCH(kmdp, MODINFOMD_ENVP, char *) + KERNBASE;
+ init_static_kenv(MD_FETCH(kmdp, MODINFOMD_ENVP, char *) + KERNBASE, 0);
#ifdef DDB
ksym_start = MD_FETCH(kmdp, MODINFOMD_SSYM, uintptr_t);
ksym_end = MD_FETCH(kmdp, MODINFOMD_ESYM, uintptr_t);
diff --git a/sys/amd64/amd64/trap.c b/sys/amd64/amd64/trap.c
index 3ecfabe..218c8cf 100644
--- a/sys/amd64/amd64/trap.c
+++ b/sys/amd64/amd64/trap.c
@@ -327,6 +327,13 @@ trap(struct trapframe *frame)
break;
case T_PAGEFLT: /* page fault */
+ /*
+ * Emulator can take care about this trap?
+ */
+ if (*p->p_sysent->sv_trap != NULL &&
+ (*p->p_sysent->sv_trap)(td) == 0)
+ goto userout;
+
addr = frame->tf_addr;
i = trap_pfault(frame, TRUE);
if (i == -1)
diff --git a/sys/amd64/include/metadata.h b/sys/amd64/include/metadata.h
index 7dc22bf..98d0272 100644
--- a/sys/amd64/include/metadata.h
+++ b/sys/amd64/include/metadata.h
@@ -1,56 +1,6 @@
/*-
- * Copyright (c) 2003 Peter Wemm <peter@FreeBSD.org>
- * 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 AND CONTRIBUTORS ``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 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.
- *
- * $FreeBSD$
+ * This file is in the public domain.
*/
+/* $FreeBSD$ */
-#ifndef _MACHINE_METADATA_H_
-#define _MACHINE_METADATA_H_
-
-#define MODINFOMD_SMAP 0x1001
-#define MODINFOMD_SMAP_XATTR 0x1002
-#define MODINFOMD_DTBP 0x1003
-#define MODINFOMD_EFI_MAP 0x1004
-#define MODINFOMD_EFI_FB 0x1005
-
-struct efi_map_header {
- size_t memory_size;
- size_t descriptor_size;
- uint32_t descriptor_version;
-};
-
-struct efi_fb {
- uint64_t fb_addr;
- uint64_t fb_size;
- int fb_height;
- int fb_width;
- int fb_stride;
- uint32_t fb_mask_red;
- uint32_t fb_mask_green;
- uint32_t fb_mask_blue;
- uint32_t fb_mask_reserved;
-};
-
-#endif /* !_MACHINE_METADATA_H_ */
+#include <x86/metadata.h>
diff --git a/sys/amd64/include/pcb.h b/sys/amd64/include/pcb.h
index 4bf9a4f..3f8d4c7 100644
--- a/sys/amd64/include/pcb.h
+++ b/sys/amd64/include/pcb.h
@@ -44,15 +44,19 @@
#include <machine/segments.h>
#ifdef __amd64__
+/*
+ * NB: The fields marked with (*) are used by kernel debuggers. Their
+ * ABI should be preserved.
+ */
struct pcb {
- register_t pcb_r15;
- register_t pcb_r14;
- register_t pcb_r13;
- register_t pcb_r12;
- register_t pcb_rbp;
- register_t pcb_rsp;
- register_t pcb_rbx;
- register_t pcb_rip;
+ register_t pcb_r15; /* (*) */
+ register_t pcb_r14; /* (*) */
+ register_t pcb_r13; /* (*) */
+ register_t pcb_r12; /* (*) */
+ register_t pcb_rbp; /* (*) */
+ register_t pcb_rsp; /* (*) */
+ register_t pcb_rbx; /* (*) */
+ register_t pcb_rip; /* (*) */
register_t pcb_fsbase;
register_t pcb_gsbase;
register_t pcb_kgsbase;
diff --git a/sys/amd64/linux/linux_proto.h b/sys/amd64/linux/linux_proto.h
index eedd423..0a0cbe6 100644
--- a/sys/amd64/linux/linux_proto.h
+++ b/sys/amd64/linux/linux_proto.h
@@ -3,7 +3,7 @@
*
* DO NOT EDIT-- this file is automatically generated.
* $FreeBSD$
- * created from FreeBSD: stable/10/sys/amd64/linux/syscalls.master 293592 2016-01-09 17:54:37Z dchagin
+ * created from FreeBSD: stable/10/sys/amd64/linux/syscalls.master 294368 2016-01-20 01:09:53Z jhb
*/
#ifndef _LINUX_SYSPROTO_H_
diff --git a/sys/amd64/linux/linux_syscall.h b/sys/amd64/linux/linux_syscall.h
index c8d811a..874651c 100644
--- a/sys/amd64/linux/linux_syscall.h
+++ b/sys/amd64/linux/linux_syscall.h
@@ -3,7 +3,7 @@
*
* DO NOT EDIT-- this file is automatically generated.
* $FreeBSD$
- * created from FreeBSD: stable/10/sys/amd64/linux/syscalls.master 293592 2016-01-09 17:54:37Z dchagin
+ * created from FreeBSD: stable/10/sys/amd64/linux/syscalls.master 294368 2016-01-20 01:09:53Z jhb
*/
#define LINUX_SYS_read 0
diff --git a/sys/amd64/linux/linux_syscalls.c b/sys/amd64/linux/linux_syscalls.c
index 5c1e1a2..fcea91e 100644
--- a/sys/amd64/linux/linux_syscalls.c
+++ b/sys/amd64/linux/linux_syscalls.c
@@ -3,7 +3,7 @@
*
* DO NOT EDIT-- this file is automatically generated.
* $FreeBSD$
- * created from FreeBSD: stable/10/sys/amd64/linux/syscalls.master 293592 2016-01-09 17:54:37Z dchagin
+ * created from FreeBSD: stable/10/sys/amd64/linux/syscalls.master 294368 2016-01-20 01:09:53Z jhb
*/
const char *linux_syscallnames[] = {
diff --git a/sys/amd64/linux/linux_sysent.c b/sys/amd64/linux/linux_sysent.c
index 97a15cc..14d5c87 100644
--- a/sys/amd64/linux/linux_sysent.c
+++ b/sys/amd64/linux/linux_sysent.c
@@ -3,7 +3,7 @@
*
* DO NOT EDIT-- this file is automatically generated.
* $FreeBSD$
- * created from FreeBSD: stable/10/sys/amd64/linux/syscalls.master 293592 2016-01-09 17:54:37Z dchagin
+ * created from FreeBSD: stable/10/sys/amd64/linux/syscalls.master 294368 2016-01-20 01:09:53Z jhb
*/
#include <sys/param.h>
diff --git a/sys/amd64/linux/linux_systrace_args.c b/sys/amd64/linux/linux_systrace_args.c
index 529e768..d649eed 100644
--- a/sys/amd64/linux/linux_systrace_args.c
+++ b/sys/amd64/linux/linux_systrace_args.c
@@ -73,8 +73,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
/* poll */
case 7: {
struct poll_args *p = params;
- iarg[0] = p->*; /* struct pollfd */
- uarg[1] = p->nfds; /* unsigned int */
+ uarg[0] = (intptr_t) p->fds; /* struct pollfd * */
+ uarg[1] = p->nfds; /* u_int */
iarg[2] = p->timeout; /* int */
*n_args = 3;
break;
@@ -591,7 +591,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
iarg[0] = p->semid; /* l_int */
iarg[1] = p->semnum; /* l_int */
iarg[2] = p->cmd; /* l_int */
- uarg[3] = p->arg; /* union l_semun */
+ uarg[3] = p->arg.buf; /* union l_semun */
*n_args = 4;
break;
}
@@ -1327,7 +1327,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
/* settimeofday */
case 164: {
struct settimeofday_args *p = params;
- uarg[0] = (intptr_t) p->tp; /* struct l_timeval * */
+ uarg[0] = (intptr_t) p->tv; /* struct l_timeval * */
uarg[1] = (intptr_t) p->tzp; /* struct timezone * */
*n_args = 2;
break;
@@ -2380,10 +2380,10 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
case 7:
switch(ndx) {
case 0:
- p = "struct pollfd";
+ p = "struct pollfd *";
break;
case 1:
- p = "unsigned int";
+ p = "u_int";
break;
case 2:
p = "int";
diff --git a/sys/amd64/linux/linux_sysvec.c b/sys/amd64/linux/linux_sysvec.c
index 37c1b69..d53a266 100644
--- a/sys/amd64/linux/linux_sysvec.c
+++ b/sys/amd64/linux/linux_sysvec.c
@@ -129,6 +129,7 @@ static void linux_set_syscall_retval(struct thread *td, int error);
static int linux_fetch_syscall_args(struct thread *td, struct syscall_args *sa);
static void linux_exec_setregs(struct thread *td, struct image_params *imgp,
u_long stack);
+static int linux_vsyscall(struct thread *td);
/*
* Linux syscalls return negative errno's, we do positive and map them
@@ -746,6 +747,53 @@ exec_linux_imgact_try(struct image_params *imgp)
return(error);
}
+#define LINUX_VSYSCALL_START (-10UL << 20)
+#define LINUX_VSYSCALL_SZ 1024
+
+const unsigned long linux_vsyscall_vector[] = {
+ LINUX_SYS_gettimeofday,
+ LINUX_SYS_linux_time,
+ /* getcpu not implemented */
+};
+
+static int
+linux_vsyscall(struct thread *td)
+{
+ struct trapframe *frame;
+ uint64_t retqaddr;
+ int code, traced;
+ int error;
+
+ frame = td->td_frame;
+
+ /* Check %rip for vsyscall area */
+ if (__predict_true(frame->tf_rip < LINUX_VSYSCALL_START))
+ return (EINVAL);
+ if ((frame->tf_rip & (LINUX_VSYSCALL_SZ - 1)) != 0)
+ return (EINVAL);
+ code = (frame->tf_rip - LINUX_VSYSCALL_START) / LINUX_VSYSCALL_SZ;
+ if (code >= nitems(linux_vsyscall_vector))
+ return (EINVAL);
+
+ /*
+ * vsyscall called as callq *(%rax), so we must
+ * use return address from %rsp and also fixup %rsp
+ */
+ error = copyin((void *)frame->tf_rsp, &retqaddr, sizeof(retqaddr));
+ if (error)
+ return (error);
+
+ frame->tf_rip = retqaddr;
+ frame->tf_rax = linux_vsyscall_vector[code];
+ frame->tf_rsp += 8;
+
+ traced = (frame->tf_flags & PSL_T);
+
+ amd64_syscall(td, traced);
+
+ return (0);
+}
+
struct sysentvec elf_linux_sysvec = {
.sv_size = LINUX_SYS_MAXSYSCALL,
.sv_table = linux_sysent,
@@ -781,7 +829,8 @@ struct sysentvec elf_linux_sysvec = {
.sv_shared_page_base = SHAREDPAGE,
.sv_shared_page_len = PAGE_SIZE,
.sv_schedtail = linux_schedtail,
- .sv_thread_detach = linux_thread_detach
+ .sv_thread_detach = linux_thread_detach,
+ .sv_trap = linux_vsyscall,
};
static void
diff --git a/sys/amd64/linux/syscalls.master b/sys/amd64/linux/syscalls.master
index d840f88..87c8000 100644
--- a/sys/amd64/linux/syscalls.master
+++ b/sys/amd64/linux/syscalls.master
@@ -49,8 +49,8 @@
struct l_newstat *buf); }
6 AUE_LSTAT STD { int linux_newlstat(char *path, \
struct l_newstat *buf); }
-7 AUE_POLL NOPROTO { int poll(struct pollfd*, \
- unsigned int nfds, int timeout); }
+7 AUE_POLL NOPROTO { int poll(struct pollfd *fds, u_int nfds, \
+ int timeout); }
8 AUE_LSEEK STD { int linux_lseek(l_uint fdes, l_off_t off, \
l_int whence); }
9 AUE_MMAP STD { int linux_mmap2(l_ulong addr, l_ulong len, \
@@ -316,7 +316,7 @@
161 AUE_CHROOT NOPROTO { int chroot(char *path); }
162 AUE_SYNC NOPROTO { int sync(void); }
163 AUE_ACCT NOPROTO { int acct(char *path); }
-164 AUE_SETTIMEOFDAY NOPROTO { int settimeofday(struct l_timeval *tp, struct timezone *tzp); }
+164 AUE_SETTIMEOFDAY NOPROTO { int settimeofday(struct l_timeval *tv, struct timezone *tzp); }
165 AUE_MOUNT STD { int linux_mount(char *specialfile, \
char *dir, char *filesystemtype, \
l_ulong rwflag, void *data); }
diff --git a/sys/amd64/linux32/linux.h b/sys/amd64/linux32/linux.h
index e3b9f11..02d12f5 100644
--- a/sys/amd64/linux32/linux.h
+++ b/sys/amd64/linux32/linux.h
@@ -40,7 +40,7 @@
* debugging support
*/
extern u_char linux_debug_map[];
-#define ldebug(name) isclr(linux_debug_map, LINUX_SYS_linux_ ## name)
+#define ldebug(name) isclr(linux_debug_map, LINUX32_SYS_linux_ ## name)
#define ARGS(nm, fmt) "linux(%ld/%ld): "#nm"("fmt")\n", \
(long)td->td_proc->p_pid, (long)td->td_tid
#define LMSG(fmt) "linux(%ld/%ld): "fmt"\n", \
diff --git a/sys/amd64/linux32/linux32_locore.s b/sys/amd64/linux32/linux32_locore.s
index 4edbdf3..7bbd69a 100644
--- a/sys/amd64/linux32/linux32_locore.s
+++ b/sys/amd64/linux32/linux32_locore.s
@@ -28,7 +28,7 @@ NON_GPROF_ENTRY(linux32_sigcode)
jmp *LINUX_SIGF_HANDLER(%ebx)
.startsigcode:
popl %eax
- movl $LINUX_SYS_linux_sigreturn,%eax /* linux_sigreturn() */
+ movl $LINUX32_SYS_linux_sigreturn,%eax /* linux_sigreturn() */
int $0x80 /* enter kernel with args */
.endsigcode:
0: jmp 0b
@@ -44,7 +44,7 @@ NON_GPROF_ENTRY(linux32_rt_sigcode)
push %eax
jmp *LINUX_RT_SIGF_HANDLER(%edi)
.startrtsigcode:
- movl $LINUX_SYS_linux_rt_sigreturn,%eax /* linux_rt_sigreturn() */
+ movl $LINUX32_SYS_linux_rt_sigreturn,%eax /* linux_rt_sigreturn() */
int $0x80 /* enter kernel with args */
.endrtsigcode:
0: jmp 0b
diff --git a/sys/amd64/linux32/linux32_proto.h b/sys/amd64/linux32/linux32_proto.h
index 56106d7..124abb1 100644
--- a/sys/amd64/linux32/linux32_proto.h
+++ b/sys/amd64/linux32/linux32_proto.h
@@ -3,11 +3,11 @@
*
* DO NOT EDIT-- this file is automatically generated.
* $FreeBSD$
- * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293592 2016-01-09 17:54:37Z dchagin
+ * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 294368 2016-01-20 01:09:53Z jhb
*/
-#ifndef _LINUX_SYSPROTO_H_
-#define _LINUX_SYSPROTO_H_
+#ifndef _LINUX32_SYSPROTO_H_
+#define _LINUX32_SYSPROTO_H_
#include <sys/signal.h>
#include <sys/acl.h>
@@ -1464,286 +1464,286 @@ int linux_process_vm_writev(struct thread *, struct linux_process_vm_writev_args
#endif /* COMPAT_FREEBSD7 */
-#define LINUX_SYS_AUE_linux_exit AUE_EXIT
-#define LINUX_SYS_AUE_linux_fork AUE_FORK
-#define LINUX_SYS_AUE_linux_open AUE_OPEN_RWTC
-#define LINUX_SYS_AUE_linux_waitpid AUE_WAIT4
-#define LINUX_SYS_AUE_linux_creat AUE_CREAT
-#define LINUX_SYS_AUE_linux_link AUE_LINK
-#define LINUX_SYS_AUE_linux_unlink AUE_UNLINK
-#define LINUX_SYS_AUE_linux_execve AUE_EXECVE
-#define LINUX_SYS_AUE_linux_chdir AUE_CHDIR
-#define LINUX_SYS_AUE_linux_time AUE_NULL
-#define LINUX_SYS_AUE_linux_mknod AUE_MKNOD
-#define LINUX_SYS_AUE_linux_chmod AUE_CHMOD
-#define LINUX_SYS_AUE_linux_lchown16 AUE_LCHOWN
-#define LINUX_SYS_AUE_linux_stat AUE_STAT
-#define LINUX_SYS_AUE_linux_lseek AUE_LSEEK
-#define LINUX_SYS_AUE_linux_getpid AUE_GETPID
-#define LINUX_SYS_AUE_linux_mount AUE_MOUNT
-#define LINUX_SYS_AUE_linux_oldumount AUE_UMOUNT
-#define LINUX_SYS_AUE_linux_setuid16 AUE_SETUID
-#define LINUX_SYS_AUE_linux_getuid16 AUE_GETUID
-#define LINUX_SYS_AUE_linux_stime AUE_SETTIMEOFDAY
-#define LINUX_SYS_AUE_linux_ptrace AUE_PTRACE
-#define LINUX_SYS_AUE_linux_alarm AUE_NULL
-#define LINUX_SYS_AUE_linux_pause AUE_NULL
-#define LINUX_SYS_AUE_linux_utime AUE_UTIME
-#define LINUX_SYS_AUE_linux_access AUE_ACCESS
-#define LINUX_SYS_AUE_linux_nice AUE_NICE
-#define LINUX_SYS_AUE_linux_kill AUE_KILL
-#define LINUX_SYS_AUE_linux_rename AUE_RENAME
-#define LINUX_SYS_AUE_linux_mkdir AUE_MKDIR
-#define LINUX_SYS_AUE_linux_rmdir AUE_RMDIR
-#define LINUX_SYS_AUE_linux_pipe AUE_PIPE
-#define LINUX_SYS_AUE_linux_times AUE_NULL
-#define LINUX_SYS_AUE_linux_brk AUE_NULL
-#define LINUX_SYS_AUE_linux_setgid16 AUE_SETGID
-#define LINUX_SYS_AUE_linux_getgid16 AUE_GETGID
-#define LINUX_SYS_AUE_linux_signal AUE_NULL
-#define LINUX_SYS_AUE_linux_geteuid16 AUE_GETEUID
-#define LINUX_SYS_AUE_linux_getegid16 AUE_GETEGID
-#define LINUX_SYS_AUE_linux_umount AUE_UMOUNT
-#define LINUX_SYS_AUE_linux_ioctl AUE_IOCTL
-#define LINUX_SYS_AUE_linux_fcntl AUE_FCNTL
-#define LINUX_SYS_AUE_linux_olduname AUE_NULL
-#define LINUX_SYS_AUE_linux_ustat AUE_NULL
-#define LINUX_SYS_AUE_linux_getppid AUE_GETPPID
-#define LINUX_SYS_AUE_linux_sigaction AUE_NULL
-#define LINUX_SYS_AUE_linux_sgetmask AUE_NULL
-#define LINUX_SYS_AUE_linux_ssetmask AUE_NULL
-#define LINUX_SYS_AUE_linux_setreuid16 AUE_SETREUID
-#define LINUX_SYS_AUE_linux_setregid16 AUE_SETREGID
-#define LINUX_SYS_AUE_linux_sigsuspend AUE_NULL
-#define LINUX_SYS_AUE_linux_sigpending AUE_NULL
-#define LINUX_SYS_AUE_linux_sethostname AUE_SYSCTL
-#define LINUX_SYS_AUE_linux_setrlimit AUE_SETRLIMIT
-#define LINUX_SYS_AUE_linux_old_getrlimit AUE_GETRLIMIT
-#define LINUX_SYS_AUE_linux_getrusage AUE_GETRUSAGE
-#define LINUX_SYS_AUE_linux_gettimeofday AUE_NULL
-#define LINUX_SYS_AUE_linux_settimeofday AUE_SETTIMEOFDAY
-#define LINUX_SYS_AUE_linux_getgroups16 AUE_GETGROUPS
-#define LINUX_SYS_AUE_linux_setgroups16 AUE_SETGROUPS
-#define LINUX_SYS_AUE_linux_old_select AUE_SELECT
-#define LINUX_SYS_AUE_linux_symlink AUE_SYMLINK
-#define LINUX_SYS_AUE_linux_lstat AUE_LSTAT
-#define LINUX_SYS_AUE_linux_readlink AUE_READLINK
-#define LINUX_SYS_AUE_linux_reboot AUE_REBOOT
-#define LINUX_SYS_AUE_linux_readdir AUE_GETDIRENTRIES
-#define LINUX_SYS_AUE_linux_mmap AUE_MMAP
-#define LINUX_SYS_AUE_linux_truncate AUE_TRUNCATE
-#define LINUX_SYS_AUE_linux_ftruncate AUE_FTRUNCATE
-#define LINUX_SYS_AUE_linux_getpriority AUE_GETPRIORITY
-#define LINUX_SYS_AUE_linux_statfs AUE_STATFS
-#define LINUX_SYS_AUE_linux_fstatfs AUE_FSTATFS
-#define LINUX_SYS_AUE_linux_socketcall AUE_NULL
-#define LINUX_SYS_AUE_linux_syslog AUE_NULL
-#define LINUX_SYS_AUE_linux_setitimer AUE_SETITIMER
-#define LINUX_SYS_AUE_linux_getitimer AUE_GETITIMER
-#define LINUX_SYS_AUE_linux_newstat AUE_STAT
-#define LINUX_SYS_AUE_linux_newlstat AUE_LSTAT
-#define LINUX_SYS_AUE_linux_newfstat AUE_FSTAT
-#define LINUX_SYS_AUE_linux_uname AUE_NULL
-#define LINUX_SYS_AUE_linux_iopl AUE_NULL
-#define LINUX_SYS_AUE_linux_vhangup AUE_NULL
-#define LINUX_SYS_AUE_linux_wait4 AUE_WAIT4
-#define LINUX_SYS_AUE_linux_swapoff AUE_SWAPOFF
-#define LINUX_SYS_AUE_linux_sysinfo AUE_NULL
-#define LINUX_SYS_AUE_linux_ipc AUE_NULL
-#define LINUX_SYS_AUE_linux_sigreturn AUE_SIGRETURN
-#define LINUX_SYS_AUE_linux_clone AUE_RFORK
-#define LINUX_SYS_AUE_linux_setdomainname AUE_SYSCTL
-#define LINUX_SYS_AUE_linux_newuname AUE_NULL
-#define LINUX_SYS_AUE_linux_adjtimex AUE_ADJTIME
-#define LINUX_SYS_AUE_linux_mprotect AUE_MPROTECT
-#define LINUX_SYS_AUE_linux_sigprocmask AUE_SIGPROCMASK
-#define LINUX_SYS_AUE_linux_create_module AUE_NULL
-#define LINUX_SYS_AUE_linux_init_module AUE_NULL
-#define LINUX_SYS_AUE_linux_delete_module AUE_NULL
-#define LINUX_SYS_AUE_linux_get_kernel_syms AUE_NULL
-#define LINUX_SYS_AUE_linux_quotactl AUE_QUOTACTL
-#define LINUX_SYS_AUE_linux_bdflush AUE_BDFLUSH
-#define LINUX_SYS_AUE_linux_sysfs AUE_NULL
-#define LINUX_SYS_AUE_linux_personality AUE_PERSONALITY
-#define LINUX_SYS_AUE_linux_setfsuid16 AUE_SETFSUID
-#define LINUX_SYS_AUE_linux_setfsgid16 AUE_SETFSGID
-#define LINUX_SYS_AUE_linux_llseek AUE_LSEEK
-#define LINUX_SYS_AUE_linux_getdents AUE_GETDIRENTRIES
-#define LINUX_SYS_AUE_linux_select AUE_SELECT
-#define LINUX_SYS_AUE_linux_msync AUE_MSYNC
-#define LINUX_SYS_AUE_linux_readv AUE_READV
-#define LINUX_SYS_AUE_linux_writev AUE_WRITEV
-#define LINUX_SYS_AUE_linux_getsid AUE_GETSID
-#define LINUX_SYS_AUE_linux_fdatasync AUE_NULL
-#define LINUX_SYS_AUE_linux_sysctl AUE_SYSCTL
-#define LINUX_SYS_AUE_linux_sched_setparam AUE_SCHED_SETPARAM
-#define LINUX_SYS_AUE_linux_sched_getparam AUE_SCHED_GETPARAM
-#define LINUX_SYS_AUE_linux_sched_setscheduler AUE_SCHED_SETSCHEDULER
-#define LINUX_SYS_AUE_linux_sched_getscheduler AUE_SCHED_GETSCHEDULER
-#define LINUX_SYS_AUE_linux_sched_get_priority_max AUE_SCHED_GET_PRIORITY_MAX
-#define LINUX_SYS_AUE_linux_sched_get_priority_min AUE_SCHED_GET_PRIORITY_MIN
-#define LINUX_SYS_AUE_linux_sched_rr_get_interval AUE_SCHED_RR_GET_INTERVAL
-#define LINUX_SYS_AUE_linux_nanosleep AUE_NULL
-#define LINUX_SYS_AUE_linux_mremap AUE_NULL
-#define LINUX_SYS_AUE_linux_setresuid16 AUE_SETRESUID
-#define LINUX_SYS_AUE_linux_getresuid16 AUE_GETRESUID
-#define LINUX_SYS_AUE_linux_query_module AUE_NULL
-#define LINUX_SYS_AUE_linux_nfsservctl AUE_NULL
-#define LINUX_SYS_AUE_linux_setresgid16 AUE_SETRESGID
-#define LINUX_SYS_AUE_linux_getresgid16 AUE_GETRESGID
-#define LINUX_SYS_AUE_linux_prctl AUE_PRCTL
-#define LINUX_SYS_AUE_linux_rt_sigreturn AUE_NULL
-#define LINUX_SYS_AUE_linux_rt_sigaction AUE_NULL
-#define LINUX_SYS_AUE_linux_rt_sigprocmask AUE_NULL
-#define LINUX_SYS_AUE_linux_rt_sigpending AUE_NULL
-#define LINUX_SYS_AUE_linux_rt_sigtimedwait AUE_NULL
-#define LINUX_SYS_AUE_linux_rt_sigqueueinfo AUE_NULL
-#define LINUX_SYS_AUE_linux_rt_sigsuspend AUE_NULL
-#define LINUX_SYS_AUE_linux_pread AUE_PREAD
-#define LINUX_SYS_AUE_linux_pwrite AUE_PWRITE
-#define LINUX_SYS_AUE_linux_chown16 AUE_CHOWN
-#define LINUX_SYS_AUE_linux_getcwd AUE_GETCWD
-#define LINUX_SYS_AUE_linux_capget AUE_CAPGET
-#define LINUX_SYS_AUE_linux_capset AUE_CAPSET
-#define LINUX_SYS_AUE_linux_sigaltstack AUE_NULL
-#define LINUX_SYS_AUE_linux_sendfile AUE_SENDFILE
-#define LINUX_SYS_AUE_linux_vfork AUE_VFORK
-#define LINUX_SYS_AUE_linux_getrlimit AUE_GETRLIMIT
-#define LINUX_SYS_AUE_linux_mmap2 AUE_MMAP
-#define LINUX_SYS_AUE_linux_truncate64 AUE_TRUNCATE
-#define LINUX_SYS_AUE_linux_ftruncate64 AUE_FTRUNCATE
-#define LINUX_SYS_AUE_linux_stat64 AUE_STAT
-#define LINUX_SYS_AUE_linux_lstat64 AUE_LSTAT
-#define LINUX_SYS_AUE_linux_fstat64 AUE_FSTAT
-#define LINUX_SYS_AUE_linux_lchown AUE_LCHOWN
-#define LINUX_SYS_AUE_linux_getuid AUE_GETUID
-#define LINUX_SYS_AUE_linux_getgid AUE_GETGID
-#define LINUX_SYS_AUE_linux_getgroups AUE_GETGROUPS
-#define LINUX_SYS_AUE_linux_setgroups AUE_SETGROUPS
-#define LINUX_SYS_AUE_linux_chown AUE_CHOWN
-#define LINUX_SYS_AUE_linux_setfsuid AUE_SETFSUID
-#define LINUX_SYS_AUE_linux_setfsgid AUE_SETFSGID
-#define LINUX_SYS_AUE_linux_pivot_root AUE_PIVOT_ROOT
-#define LINUX_SYS_AUE_linux_mincore AUE_MINCORE
-#define LINUX_SYS_AUE_linux_getdents64 AUE_GETDIRENTRIES
-#define LINUX_SYS_AUE_linux_fcntl64 AUE_FCNTL
-#define LINUX_SYS_AUE_linux_gettid AUE_NULL
-#define LINUX_SYS_AUE_linux_setxattr AUE_NULL
-#define LINUX_SYS_AUE_linux_lsetxattr AUE_NULL
-#define LINUX_SYS_AUE_linux_fsetxattr AUE_NULL
-#define LINUX_SYS_AUE_linux_getxattr AUE_NULL
-#define LINUX_SYS_AUE_linux_lgetxattr AUE_NULL
-#define LINUX_SYS_AUE_linux_fgetxattr AUE_NULL
-#define LINUX_SYS_AUE_linux_listxattr AUE_NULL
-#define LINUX_SYS_AUE_linux_llistxattr AUE_NULL
-#define LINUX_SYS_AUE_linux_flistxattr AUE_NULL
-#define LINUX_SYS_AUE_linux_removexattr AUE_NULL
-#define LINUX_SYS_AUE_linux_lremovexattr AUE_NULL
-#define LINUX_SYS_AUE_linux_fremovexattr AUE_NULL
-#define LINUX_SYS_AUE_linux_tkill AUE_NULL
-#define LINUX_SYS_AUE_linux_sys_futex AUE_NULL
-#define LINUX_SYS_AUE_linux_sched_setaffinity AUE_NULL
-#define LINUX_SYS_AUE_linux_sched_getaffinity AUE_NULL
-#define LINUX_SYS_AUE_linux_set_thread_area AUE_NULL
-#define LINUX_SYS_AUE_linux_fadvise64 AUE_NULL
-#define LINUX_SYS_AUE_linux_exit_group AUE_EXIT
-#define LINUX_SYS_AUE_linux_lookup_dcookie AUE_NULL
-#define LINUX_SYS_AUE_linux_epoll_create AUE_NULL
-#define LINUX_SYS_AUE_linux_epoll_ctl AUE_NULL
-#define LINUX_SYS_AUE_linux_epoll_wait AUE_NULL
-#define LINUX_SYS_AUE_linux_remap_file_pages AUE_NULL
-#define LINUX_SYS_AUE_linux_set_tid_address AUE_NULL
-#define LINUX_SYS_AUE_linux_timer_create AUE_NULL
-#define LINUX_SYS_AUE_linux_timer_settime AUE_NULL
-#define LINUX_SYS_AUE_linux_timer_gettime AUE_NULL
-#define LINUX_SYS_AUE_linux_timer_getoverrun AUE_NULL
-#define LINUX_SYS_AUE_linux_timer_delete AUE_NULL
-#define LINUX_SYS_AUE_linux_clock_settime AUE_CLOCK_SETTIME
-#define LINUX_SYS_AUE_linux_clock_gettime AUE_NULL
-#define LINUX_SYS_AUE_linux_clock_getres AUE_NULL
-#define LINUX_SYS_AUE_linux_clock_nanosleep AUE_NULL
-#define LINUX_SYS_AUE_linux_statfs64 AUE_STATFS
-#define LINUX_SYS_AUE_linux_fstatfs64 AUE_FSTATFS
-#define LINUX_SYS_AUE_linux_tgkill AUE_NULL
-#define LINUX_SYS_AUE_linux_utimes AUE_UTIMES
-#define LINUX_SYS_AUE_linux_fadvise64_64 AUE_NULL
-#define LINUX_SYS_AUE_linux_mbind AUE_NULL
-#define LINUX_SYS_AUE_linux_get_mempolicy AUE_NULL
-#define LINUX_SYS_AUE_linux_set_mempolicy AUE_NULL
-#define LINUX_SYS_AUE_linux_mq_open AUE_NULL
-#define LINUX_SYS_AUE_linux_mq_unlink AUE_NULL
-#define LINUX_SYS_AUE_linux_mq_timedsend AUE_NULL
-#define LINUX_SYS_AUE_linux_mq_timedreceive AUE_NULL
-#define LINUX_SYS_AUE_linux_mq_notify AUE_NULL
-#define LINUX_SYS_AUE_linux_mq_getsetattr AUE_NULL
-#define LINUX_SYS_AUE_linux_kexec_load AUE_NULL
-#define LINUX_SYS_AUE_linux_waitid AUE_WAIT6
-#define LINUX_SYS_AUE_linux_add_key AUE_NULL
-#define LINUX_SYS_AUE_linux_request_key AUE_NULL
-#define LINUX_SYS_AUE_linux_keyctl AUE_NULL
-#define LINUX_SYS_AUE_linux_ioprio_set AUE_NULL
-#define LINUX_SYS_AUE_linux_ioprio_get AUE_NULL
-#define LINUX_SYS_AUE_linux_inotify_init AUE_NULL
-#define LINUX_SYS_AUE_linux_inotify_add_watch AUE_NULL
-#define LINUX_SYS_AUE_linux_inotify_rm_watch AUE_NULL
-#define LINUX_SYS_AUE_linux_migrate_pages AUE_NULL
-#define LINUX_SYS_AUE_linux_openat AUE_OPEN_RWTC
-#define LINUX_SYS_AUE_linux_mkdirat AUE_MKDIRAT
-#define LINUX_SYS_AUE_linux_mknodat AUE_MKNODAT
-#define LINUX_SYS_AUE_linux_fchownat AUE_FCHOWNAT
-#define LINUX_SYS_AUE_linux_futimesat AUE_FUTIMESAT
-#define LINUX_SYS_AUE_linux_fstatat64 AUE_FSTATAT
-#define LINUX_SYS_AUE_linux_unlinkat AUE_UNLINKAT
-#define LINUX_SYS_AUE_linux_renameat AUE_RENAMEAT
-#define LINUX_SYS_AUE_linux_linkat AUE_LINKAT
-#define LINUX_SYS_AUE_linux_symlinkat AUE_SYMLINKAT
-#define LINUX_SYS_AUE_linux_readlinkat AUE_READLINKAT
-#define LINUX_SYS_AUE_linux_fchmodat AUE_FCHMODAT
-#define LINUX_SYS_AUE_linux_faccessat AUE_FACCESSAT
-#define LINUX_SYS_AUE_linux_pselect6 AUE_SELECT
-#define LINUX_SYS_AUE_linux_ppoll AUE_POLL
-#define LINUX_SYS_AUE_linux_unshare AUE_NULL
-#define LINUX_SYS_AUE_linux_set_robust_list AUE_NULL
-#define LINUX_SYS_AUE_linux_get_robust_list AUE_NULL
-#define LINUX_SYS_AUE_linux_splice AUE_NULL
-#define LINUX_SYS_AUE_linux_sync_file_range AUE_NULL
-#define LINUX_SYS_AUE_linux_tee AUE_NULL
-#define LINUX_SYS_AUE_linux_vmsplice AUE_NULL
-#define LINUX_SYS_AUE_linux_move_pages AUE_NULL
-#define LINUX_SYS_AUE_linux_getcpu AUE_NULL
-#define LINUX_SYS_AUE_linux_epoll_pwait AUE_NULL
-#define LINUX_SYS_AUE_linux_utimensat AUE_FUTIMESAT
-#define LINUX_SYS_AUE_linux_signalfd AUE_NULL
-#define LINUX_SYS_AUE_linux_timerfd_create AUE_NULL
-#define LINUX_SYS_AUE_linux_eventfd AUE_NULL
-#define LINUX_SYS_AUE_linux_fallocate AUE_NULL
-#define LINUX_SYS_AUE_linux_timerfd_settime AUE_NULL
-#define LINUX_SYS_AUE_linux_timerfd_gettime AUE_NULL
-#define LINUX_SYS_AUE_linux_signalfd4 AUE_NULL
-#define LINUX_SYS_AUE_linux_eventfd2 AUE_NULL
-#define LINUX_SYS_AUE_linux_epoll_create1 AUE_NULL
-#define LINUX_SYS_AUE_linux_dup3 AUE_NULL
-#define LINUX_SYS_AUE_linux_pipe2 AUE_NULL
-#define LINUX_SYS_AUE_linux_inotify_init1 AUE_NULL
-#define LINUX_SYS_AUE_linux_preadv AUE_NULL
-#define LINUX_SYS_AUE_linux_pwritev AUE_NULL
-#define LINUX_SYS_AUE_linux_rt_tsigqueueinfo AUE_NULL
-#define LINUX_SYS_AUE_linux_perf_event_open AUE_NULL
-#define LINUX_SYS_AUE_linux_recvmmsg AUE_NULL
-#define LINUX_SYS_AUE_linux_fanotify_init AUE_NULL
-#define LINUX_SYS_AUE_linux_fanotify_mark AUE_NULL
-#define LINUX_SYS_AUE_linux_prlimit64 AUE_NULL
-#define LINUX_SYS_AUE_linux_name_to_handle_at AUE_NULL
-#define LINUX_SYS_AUE_linux_open_by_handle_at AUE_NULL
-#define LINUX_SYS_AUE_linux_clock_adjtime AUE_NULL
-#define LINUX_SYS_AUE_linux_syncfs AUE_SYNC
-#define LINUX_SYS_AUE_linux_sendmmsg AUE_NULL
-#define LINUX_SYS_AUE_linux_setns AUE_NULL
-#define LINUX_SYS_AUE_linux_process_vm_readv AUE_NULL
-#define LINUX_SYS_AUE_linux_process_vm_writev AUE_NULL
+#define LINUX32_SYS_AUE_linux_exit AUE_EXIT
+#define LINUX32_SYS_AUE_linux_fork AUE_FORK
+#define LINUX32_SYS_AUE_linux_open AUE_OPEN_RWTC
+#define LINUX32_SYS_AUE_linux_waitpid AUE_WAIT4
+#define LINUX32_SYS_AUE_linux_creat AUE_CREAT
+#define LINUX32_SYS_AUE_linux_link AUE_LINK
+#define LINUX32_SYS_AUE_linux_unlink AUE_UNLINK
+#define LINUX32_SYS_AUE_linux_execve AUE_EXECVE
+#define LINUX32_SYS_AUE_linux_chdir AUE_CHDIR
+#define LINUX32_SYS_AUE_linux_time AUE_NULL
+#define LINUX32_SYS_AUE_linux_mknod AUE_MKNOD
+#define LINUX32_SYS_AUE_linux_chmod AUE_CHMOD
+#define LINUX32_SYS_AUE_linux_lchown16 AUE_LCHOWN
+#define LINUX32_SYS_AUE_linux_stat AUE_STAT
+#define LINUX32_SYS_AUE_linux_lseek AUE_LSEEK
+#define LINUX32_SYS_AUE_linux_getpid AUE_GETPID
+#define LINUX32_SYS_AUE_linux_mount AUE_MOUNT
+#define LINUX32_SYS_AUE_linux_oldumount AUE_UMOUNT
+#define LINUX32_SYS_AUE_linux_setuid16 AUE_SETUID
+#define LINUX32_SYS_AUE_linux_getuid16 AUE_GETUID
+#define LINUX32_SYS_AUE_linux_stime AUE_SETTIMEOFDAY
+#define LINUX32_SYS_AUE_linux_ptrace AUE_PTRACE
+#define LINUX32_SYS_AUE_linux_alarm AUE_NULL
+#define LINUX32_SYS_AUE_linux_pause AUE_NULL
+#define LINUX32_SYS_AUE_linux_utime AUE_UTIME
+#define LINUX32_SYS_AUE_linux_access AUE_ACCESS
+#define LINUX32_SYS_AUE_linux_nice AUE_NICE
+#define LINUX32_SYS_AUE_linux_kill AUE_KILL
+#define LINUX32_SYS_AUE_linux_rename AUE_RENAME
+#define LINUX32_SYS_AUE_linux_mkdir AUE_MKDIR
+#define LINUX32_SYS_AUE_linux_rmdir AUE_RMDIR
+#define LINUX32_SYS_AUE_linux_pipe AUE_PIPE
+#define LINUX32_SYS_AUE_linux_times AUE_NULL
+#define LINUX32_SYS_AUE_linux_brk AUE_NULL
+#define LINUX32_SYS_AUE_linux_setgid16 AUE_SETGID
+#define LINUX32_SYS_AUE_linux_getgid16 AUE_GETGID
+#define LINUX32_SYS_AUE_linux_signal AUE_NULL
+#define LINUX32_SYS_AUE_linux_geteuid16 AUE_GETEUID
+#define LINUX32_SYS_AUE_linux_getegid16 AUE_GETEGID
+#define LINUX32_SYS_AUE_linux_umount AUE_UMOUNT
+#define LINUX32_SYS_AUE_linux_ioctl AUE_IOCTL
+#define LINUX32_SYS_AUE_linux_fcntl AUE_FCNTL
+#define LINUX32_SYS_AUE_linux_olduname AUE_NULL
+#define LINUX32_SYS_AUE_linux_ustat AUE_NULL
+#define LINUX32_SYS_AUE_linux_getppid AUE_GETPPID
+#define LINUX32_SYS_AUE_linux_sigaction AUE_NULL
+#define LINUX32_SYS_AUE_linux_sgetmask AUE_NULL
+#define LINUX32_SYS_AUE_linux_ssetmask AUE_NULL
+#define LINUX32_SYS_AUE_linux_setreuid16 AUE_SETREUID
+#define LINUX32_SYS_AUE_linux_setregid16 AUE_SETREGID
+#define LINUX32_SYS_AUE_linux_sigsuspend AUE_NULL
+#define LINUX32_SYS_AUE_linux_sigpending AUE_NULL
+#define LINUX32_SYS_AUE_linux_sethostname AUE_SYSCTL
+#define LINUX32_SYS_AUE_linux_setrlimit AUE_SETRLIMIT
+#define LINUX32_SYS_AUE_linux_old_getrlimit AUE_GETRLIMIT
+#define LINUX32_SYS_AUE_linux_getrusage AUE_GETRUSAGE
+#define LINUX32_SYS_AUE_linux_gettimeofday AUE_NULL
+#define LINUX32_SYS_AUE_linux_settimeofday AUE_SETTIMEOFDAY
+#define LINUX32_SYS_AUE_linux_getgroups16 AUE_GETGROUPS
+#define LINUX32_SYS_AUE_linux_setgroups16 AUE_SETGROUPS
+#define LINUX32_SYS_AUE_linux_old_select AUE_SELECT
+#define LINUX32_SYS_AUE_linux_symlink AUE_SYMLINK
+#define LINUX32_SYS_AUE_linux_lstat AUE_LSTAT
+#define LINUX32_SYS_AUE_linux_readlink AUE_READLINK
+#define LINUX32_SYS_AUE_linux_reboot AUE_REBOOT
+#define LINUX32_SYS_AUE_linux_readdir AUE_GETDIRENTRIES
+#define LINUX32_SYS_AUE_linux_mmap AUE_MMAP
+#define LINUX32_SYS_AUE_linux_truncate AUE_TRUNCATE
+#define LINUX32_SYS_AUE_linux_ftruncate AUE_FTRUNCATE
+#define LINUX32_SYS_AUE_linux_getpriority AUE_GETPRIORITY
+#define LINUX32_SYS_AUE_linux_statfs AUE_STATFS
+#define LINUX32_SYS_AUE_linux_fstatfs AUE_FSTATFS
+#define LINUX32_SYS_AUE_linux_socketcall AUE_NULL
+#define LINUX32_SYS_AUE_linux_syslog AUE_NULL
+#define LINUX32_SYS_AUE_linux_setitimer AUE_SETITIMER
+#define LINUX32_SYS_AUE_linux_getitimer AUE_GETITIMER
+#define LINUX32_SYS_AUE_linux_newstat AUE_STAT
+#define LINUX32_SYS_AUE_linux_newlstat AUE_LSTAT
+#define LINUX32_SYS_AUE_linux_newfstat AUE_FSTAT
+#define LINUX32_SYS_AUE_linux_uname AUE_NULL
+#define LINUX32_SYS_AUE_linux_iopl AUE_NULL
+#define LINUX32_SYS_AUE_linux_vhangup AUE_NULL
+#define LINUX32_SYS_AUE_linux_wait4 AUE_WAIT4
+#define LINUX32_SYS_AUE_linux_swapoff AUE_SWAPOFF
+#define LINUX32_SYS_AUE_linux_sysinfo AUE_NULL
+#define LINUX32_SYS_AUE_linux_ipc AUE_NULL
+#define LINUX32_SYS_AUE_linux_sigreturn AUE_SIGRETURN
+#define LINUX32_SYS_AUE_linux_clone AUE_RFORK
+#define LINUX32_SYS_AUE_linux_setdomainname AUE_SYSCTL
+#define LINUX32_SYS_AUE_linux_newuname AUE_NULL
+#define LINUX32_SYS_AUE_linux_adjtimex AUE_ADJTIME
+#define LINUX32_SYS_AUE_linux_mprotect AUE_MPROTECT
+#define LINUX32_SYS_AUE_linux_sigprocmask AUE_SIGPROCMASK
+#define LINUX32_SYS_AUE_linux_create_module AUE_NULL
+#define LINUX32_SYS_AUE_linux_init_module AUE_NULL
+#define LINUX32_SYS_AUE_linux_delete_module AUE_NULL
+#define LINUX32_SYS_AUE_linux_get_kernel_syms AUE_NULL
+#define LINUX32_SYS_AUE_linux_quotactl AUE_QUOTACTL
+#define LINUX32_SYS_AUE_linux_bdflush AUE_BDFLUSH
+#define LINUX32_SYS_AUE_linux_sysfs AUE_NULL
+#define LINUX32_SYS_AUE_linux_personality AUE_PERSONALITY
+#define LINUX32_SYS_AUE_linux_setfsuid16 AUE_SETFSUID
+#define LINUX32_SYS_AUE_linux_setfsgid16 AUE_SETFSGID
+#define LINUX32_SYS_AUE_linux_llseek AUE_LSEEK
+#define LINUX32_SYS_AUE_linux_getdents AUE_GETDIRENTRIES
+#define LINUX32_SYS_AUE_linux_select AUE_SELECT
+#define LINUX32_SYS_AUE_linux_msync AUE_MSYNC
+#define LINUX32_SYS_AUE_linux_readv AUE_READV
+#define LINUX32_SYS_AUE_linux_writev AUE_WRITEV
+#define LINUX32_SYS_AUE_linux_getsid AUE_GETSID
+#define LINUX32_SYS_AUE_linux_fdatasync AUE_NULL
+#define LINUX32_SYS_AUE_linux_sysctl AUE_SYSCTL
+#define LINUX32_SYS_AUE_linux_sched_setparam AUE_SCHED_SETPARAM
+#define LINUX32_SYS_AUE_linux_sched_getparam AUE_SCHED_GETPARAM
+#define LINUX32_SYS_AUE_linux_sched_setscheduler AUE_SCHED_SETSCHEDULER
+#define LINUX32_SYS_AUE_linux_sched_getscheduler AUE_SCHED_GETSCHEDULER
+#define LINUX32_SYS_AUE_linux_sched_get_priority_max AUE_SCHED_GET_PRIORITY_MAX
+#define LINUX32_SYS_AUE_linux_sched_get_priority_min AUE_SCHED_GET_PRIORITY_MIN
+#define LINUX32_SYS_AUE_linux_sched_rr_get_interval AUE_SCHED_RR_GET_INTERVAL
+#define LINUX32_SYS_AUE_linux_nanosleep AUE_NULL
+#define LINUX32_SYS_AUE_linux_mremap AUE_NULL
+#define LINUX32_SYS_AUE_linux_setresuid16 AUE_SETRESUID
+#define LINUX32_SYS_AUE_linux_getresuid16 AUE_GETRESUID
+#define LINUX32_SYS_AUE_linux_query_module AUE_NULL
+#define LINUX32_SYS_AUE_linux_nfsservctl AUE_NULL
+#define LINUX32_SYS_AUE_linux_setresgid16 AUE_SETRESGID
+#define LINUX32_SYS_AUE_linux_getresgid16 AUE_GETRESGID
+#define LINUX32_SYS_AUE_linux_prctl AUE_PRCTL
+#define LINUX32_SYS_AUE_linux_rt_sigreturn AUE_NULL
+#define LINUX32_SYS_AUE_linux_rt_sigaction AUE_NULL
+#define LINUX32_SYS_AUE_linux_rt_sigprocmask AUE_NULL
+#define LINUX32_SYS_AUE_linux_rt_sigpending AUE_NULL
+#define LINUX32_SYS_AUE_linux_rt_sigtimedwait AUE_NULL
+#define LINUX32_SYS_AUE_linux_rt_sigqueueinfo AUE_NULL
+#define LINUX32_SYS_AUE_linux_rt_sigsuspend AUE_NULL
+#define LINUX32_SYS_AUE_linux_pread AUE_PREAD
+#define LINUX32_SYS_AUE_linux_pwrite AUE_PWRITE
+#define LINUX32_SYS_AUE_linux_chown16 AUE_CHOWN
+#define LINUX32_SYS_AUE_linux_getcwd AUE_GETCWD
+#define LINUX32_SYS_AUE_linux_capget AUE_CAPGET
+#define LINUX32_SYS_AUE_linux_capset AUE_CAPSET
+#define LINUX32_SYS_AUE_linux_sigaltstack AUE_NULL
+#define LINUX32_SYS_AUE_linux_sendfile AUE_SENDFILE
+#define LINUX32_SYS_AUE_linux_vfork AUE_VFORK
+#define LINUX32_SYS_AUE_linux_getrlimit AUE_GETRLIMIT
+#define LINUX32_SYS_AUE_linux_mmap2 AUE_MMAP
+#define LINUX32_SYS_AUE_linux_truncate64 AUE_TRUNCATE
+#define LINUX32_SYS_AUE_linux_ftruncate64 AUE_FTRUNCATE
+#define LINUX32_SYS_AUE_linux_stat64 AUE_STAT
+#define LINUX32_SYS_AUE_linux_lstat64 AUE_LSTAT
+#define LINUX32_SYS_AUE_linux_fstat64 AUE_FSTAT
+#define LINUX32_SYS_AUE_linux_lchown AUE_LCHOWN
+#define LINUX32_SYS_AUE_linux_getuid AUE_GETUID
+#define LINUX32_SYS_AUE_linux_getgid AUE_GETGID
+#define LINUX32_SYS_AUE_linux_getgroups AUE_GETGROUPS
+#define LINUX32_SYS_AUE_linux_setgroups AUE_SETGROUPS
+#define LINUX32_SYS_AUE_linux_chown AUE_CHOWN
+#define LINUX32_SYS_AUE_linux_setfsuid AUE_SETFSUID
+#define LINUX32_SYS_AUE_linux_setfsgid AUE_SETFSGID
+#define LINUX32_SYS_AUE_linux_pivot_root AUE_PIVOT_ROOT
+#define LINUX32_SYS_AUE_linux_mincore AUE_MINCORE
+#define LINUX32_SYS_AUE_linux_getdents64 AUE_GETDIRENTRIES
+#define LINUX32_SYS_AUE_linux_fcntl64 AUE_FCNTL
+#define LINUX32_SYS_AUE_linux_gettid AUE_NULL
+#define LINUX32_SYS_AUE_linux_setxattr AUE_NULL
+#define LINUX32_SYS_AUE_linux_lsetxattr AUE_NULL
+#define LINUX32_SYS_AUE_linux_fsetxattr AUE_NULL
+#define LINUX32_SYS_AUE_linux_getxattr AUE_NULL
+#define LINUX32_SYS_AUE_linux_lgetxattr AUE_NULL
+#define LINUX32_SYS_AUE_linux_fgetxattr AUE_NULL
+#define LINUX32_SYS_AUE_linux_listxattr AUE_NULL
+#define LINUX32_SYS_AUE_linux_llistxattr AUE_NULL
+#define LINUX32_SYS_AUE_linux_flistxattr AUE_NULL
+#define LINUX32_SYS_AUE_linux_removexattr AUE_NULL
+#define LINUX32_SYS_AUE_linux_lremovexattr AUE_NULL
+#define LINUX32_SYS_AUE_linux_fremovexattr AUE_NULL
+#define LINUX32_SYS_AUE_linux_tkill AUE_NULL
+#define LINUX32_SYS_AUE_linux_sys_futex AUE_NULL
+#define LINUX32_SYS_AUE_linux_sched_setaffinity AUE_NULL
+#define LINUX32_SYS_AUE_linux_sched_getaffinity AUE_NULL
+#define LINUX32_SYS_AUE_linux_set_thread_area AUE_NULL
+#define LINUX32_SYS_AUE_linux_fadvise64 AUE_NULL
+#define LINUX32_SYS_AUE_linux_exit_group AUE_EXIT
+#define LINUX32_SYS_AUE_linux_lookup_dcookie AUE_NULL
+#define LINUX32_SYS_AUE_linux_epoll_create AUE_NULL
+#define LINUX32_SYS_AUE_linux_epoll_ctl AUE_NULL
+#define LINUX32_SYS_AUE_linux_epoll_wait AUE_NULL
+#define LINUX32_SYS_AUE_linux_remap_file_pages AUE_NULL
+#define LINUX32_SYS_AUE_linux_set_tid_address AUE_NULL
+#define LINUX32_SYS_AUE_linux_timer_create AUE_NULL
+#define LINUX32_SYS_AUE_linux_timer_settime AUE_NULL
+#define LINUX32_SYS_AUE_linux_timer_gettime AUE_NULL
+#define LINUX32_SYS_AUE_linux_timer_getoverrun AUE_NULL
+#define LINUX32_SYS_AUE_linux_timer_delete AUE_NULL
+#define LINUX32_SYS_AUE_linux_clock_settime AUE_CLOCK_SETTIME
+#define LINUX32_SYS_AUE_linux_clock_gettime AUE_NULL
+#define LINUX32_SYS_AUE_linux_clock_getres AUE_NULL
+#define LINUX32_SYS_AUE_linux_clock_nanosleep AUE_NULL
+#define LINUX32_SYS_AUE_linux_statfs64 AUE_STATFS
+#define LINUX32_SYS_AUE_linux_fstatfs64 AUE_FSTATFS
+#define LINUX32_SYS_AUE_linux_tgkill AUE_NULL
+#define LINUX32_SYS_AUE_linux_utimes AUE_UTIMES
+#define LINUX32_SYS_AUE_linux_fadvise64_64 AUE_NULL
+#define LINUX32_SYS_AUE_linux_mbind AUE_NULL
+#define LINUX32_SYS_AUE_linux_get_mempolicy AUE_NULL
+#define LINUX32_SYS_AUE_linux_set_mempolicy AUE_NULL
+#define LINUX32_SYS_AUE_linux_mq_open AUE_NULL
+#define LINUX32_SYS_AUE_linux_mq_unlink AUE_NULL
+#define LINUX32_SYS_AUE_linux_mq_timedsend AUE_NULL
+#define LINUX32_SYS_AUE_linux_mq_timedreceive AUE_NULL
+#define LINUX32_SYS_AUE_linux_mq_notify AUE_NULL
+#define LINUX32_SYS_AUE_linux_mq_getsetattr AUE_NULL
+#define LINUX32_SYS_AUE_linux_kexec_load AUE_NULL
+#define LINUX32_SYS_AUE_linux_waitid AUE_WAIT6
+#define LINUX32_SYS_AUE_linux_add_key AUE_NULL
+#define LINUX32_SYS_AUE_linux_request_key AUE_NULL
+#define LINUX32_SYS_AUE_linux_keyctl AUE_NULL
+#define LINUX32_SYS_AUE_linux_ioprio_set AUE_NULL
+#define LINUX32_SYS_AUE_linux_ioprio_get AUE_NULL
+#define LINUX32_SYS_AUE_linux_inotify_init AUE_NULL
+#define LINUX32_SYS_AUE_linux_inotify_add_watch AUE_NULL
+#define LINUX32_SYS_AUE_linux_inotify_rm_watch AUE_NULL
+#define LINUX32_SYS_AUE_linux_migrate_pages AUE_NULL
+#define LINUX32_SYS_AUE_linux_openat AUE_OPEN_RWTC
+#define LINUX32_SYS_AUE_linux_mkdirat AUE_MKDIRAT
+#define LINUX32_SYS_AUE_linux_mknodat AUE_MKNODAT
+#define LINUX32_SYS_AUE_linux_fchownat AUE_FCHOWNAT
+#define LINUX32_SYS_AUE_linux_futimesat AUE_FUTIMESAT
+#define LINUX32_SYS_AUE_linux_fstatat64 AUE_FSTATAT
+#define LINUX32_SYS_AUE_linux_unlinkat AUE_UNLINKAT
+#define LINUX32_SYS_AUE_linux_renameat AUE_RENAMEAT
+#define LINUX32_SYS_AUE_linux_linkat AUE_LINKAT
+#define LINUX32_SYS_AUE_linux_symlinkat AUE_SYMLINKAT
+#define LINUX32_SYS_AUE_linux_readlinkat AUE_READLINKAT
+#define LINUX32_SYS_AUE_linux_fchmodat AUE_FCHMODAT
+#define LINUX32_SYS_AUE_linux_faccessat AUE_FACCESSAT
+#define LINUX32_SYS_AUE_linux_pselect6 AUE_SELECT
+#define LINUX32_SYS_AUE_linux_ppoll AUE_POLL
+#define LINUX32_SYS_AUE_linux_unshare AUE_NULL
+#define LINUX32_SYS_AUE_linux_set_robust_list AUE_NULL
+#define LINUX32_SYS_AUE_linux_get_robust_list AUE_NULL
+#define LINUX32_SYS_AUE_linux_splice AUE_NULL
+#define LINUX32_SYS_AUE_linux_sync_file_range AUE_NULL
+#define LINUX32_SYS_AUE_linux_tee AUE_NULL
+#define LINUX32_SYS_AUE_linux_vmsplice AUE_NULL
+#define LINUX32_SYS_AUE_linux_move_pages AUE_NULL
+#define LINUX32_SYS_AUE_linux_getcpu AUE_NULL
+#define LINUX32_SYS_AUE_linux_epoll_pwait AUE_NULL
+#define LINUX32_SYS_AUE_linux_utimensat AUE_FUTIMESAT
+#define LINUX32_SYS_AUE_linux_signalfd AUE_NULL
+#define LINUX32_SYS_AUE_linux_timerfd_create AUE_NULL
+#define LINUX32_SYS_AUE_linux_eventfd AUE_NULL
+#define LINUX32_SYS_AUE_linux_fallocate AUE_NULL
+#define LINUX32_SYS_AUE_linux_timerfd_settime AUE_NULL
+#define LINUX32_SYS_AUE_linux_timerfd_gettime AUE_NULL
+#define LINUX32_SYS_AUE_linux_signalfd4 AUE_NULL
+#define LINUX32_SYS_AUE_linux_eventfd2 AUE_NULL
+#define LINUX32_SYS_AUE_linux_epoll_create1 AUE_NULL
+#define LINUX32_SYS_AUE_linux_dup3 AUE_NULL
+#define LINUX32_SYS_AUE_linux_pipe2 AUE_NULL
+#define LINUX32_SYS_AUE_linux_inotify_init1 AUE_NULL
+#define LINUX32_SYS_AUE_linux_preadv AUE_NULL
+#define LINUX32_SYS_AUE_linux_pwritev AUE_NULL
+#define LINUX32_SYS_AUE_linux_rt_tsigqueueinfo AUE_NULL
+#define LINUX32_SYS_AUE_linux_perf_event_open AUE_NULL
+#define LINUX32_SYS_AUE_linux_recvmmsg AUE_NULL
+#define LINUX32_SYS_AUE_linux_fanotify_init AUE_NULL
+#define LINUX32_SYS_AUE_linux_fanotify_mark AUE_NULL
+#define LINUX32_SYS_AUE_linux_prlimit64 AUE_NULL
+#define LINUX32_SYS_AUE_linux_name_to_handle_at AUE_NULL
+#define LINUX32_SYS_AUE_linux_open_by_handle_at AUE_NULL
+#define LINUX32_SYS_AUE_linux_clock_adjtime AUE_NULL
+#define LINUX32_SYS_AUE_linux_syncfs AUE_SYNC
+#define LINUX32_SYS_AUE_linux_sendmmsg AUE_NULL
+#define LINUX32_SYS_AUE_linux_setns AUE_NULL
+#define LINUX32_SYS_AUE_linux_process_vm_readv AUE_NULL
+#define LINUX32_SYS_AUE_linux_process_vm_writev AUE_NULL
#undef PAD_
#undef PADL_
#undef PADR_
-#endif /* !_LINUX_SYSPROTO_H_ */
+#endif /* !_LINUX32_SYSPROTO_H_ */
diff --git a/sys/amd64/linux32/linux32_syscall.h b/sys/amd64/linux32/linux32_syscall.h
index e3424b4..29c78a6 100644
--- a/sys/amd64/linux32/linux32_syscall.h
+++ b/sys/amd64/linux32/linux32_syscall.h
@@ -3,322 +3,322 @@
*
* DO NOT EDIT-- this file is automatically generated.
* $FreeBSD$
- * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293592 2016-01-09 17:54:37Z dchagin
+ * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 294368 2016-01-20 01:09:53Z jhb
*/
-#define LINUX_SYS_linux_exit 1
-#define LINUX_SYS_linux_fork 2
-#define LINUX_SYS_read 3
-#define LINUX_SYS_write 4
-#define LINUX_SYS_linux_open 5
-#define LINUX_SYS_close 6
-#define LINUX_SYS_linux_waitpid 7
-#define LINUX_SYS_linux_creat 8
-#define LINUX_SYS_linux_link 9
-#define LINUX_SYS_linux_unlink 10
-#define LINUX_SYS_linux_execve 11
-#define LINUX_SYS_linux_chdir 12
-#define LINUX_SYS_linux_time 13
-#define LINUX_SYS_linux_mknod 14
-#define LINUX_SYS_linux_chmod 15
-#define LINUX_SYS_linux_lchown16 16
-#define LINUX_SYS_linux_stat 18
-#define LINUX_SYS_linux_lseek 19
-#define LINUX_SYS_linux_getpid 20
-#define LINUX_SYS_linux_mount 21
-#define LINUX_SYS_linux_oldumount 22
-#define LINUX_SYS_linux_setuid16 23
-#define LINUX_SYS_linux_getuid16 24
-#define LINUX_SYS_linux_stime 25
-#define LINUX_SYS_linux_ptrace 26
-#define LINUX_SYS_linux_alarm 27
-#define LINUX_SYS_linux_pause 29
-#define LINUX_SYS_linux_utime 30
-#define LINUX_SYS_linux_access 33
-#define LINUX_SYS_linux_nice 34
-#define LINUX_SYS_sync 36
-#define LINUX_SYS_linux_kill 37
-#define LINUX_SYS_linux_rename 38
-#define LINUX_SYS_linux_mkdir 39
-#define LINUX_SYS_linux_rmdir 40
-#define LINUX_SYS_dup 41
-#define LINUX_SYS_linux_pipe 42
-#define LINUX_SYS_linux_times 43
-#define LINUX_SYS_linux_brk 45
-#define LINUX_SYS_linux_setgid16 46
-#define LINUX_SYS_linux_getgid16 47
-#define LINUX_SYS_linux_signal 48
-#define LINUX_SYS_linux_geteuid16 49
-#define LINUX_SYS_linux_getegid16 50
-#define LINUX_SYS_acct 51
-#define LINUX_SYS_linux_umount 52
-#define LINUX_SYS_linux_ioctl 54
-#define LINUX_SYS_linux_fcntl 55
-#define LINUX_SYS_setpgid 57
-#define LINUX_SYS_linux_olduname 59
-#define LINUX_SYS_umask 60
-#define LINUX_SYS_chroot 61
-#define LINUX_SYS_linux_ustat 62
-#define LINUX_SYS_dup2 63
-#define LINUX_SYS_linux_getppid 64
-#define LINUX_SYS_getpgrp 65
-#define LINUX_SYS_setsid 66
-#define LINUX_SYS_linux_sigaction 67
-#define LINUX_SYS_linux_sgetmask 68
-#define LINUX_SYS_linux_ssetmask 69
-#define LINUX_SYS_linux_setreuid16 70
-#define LINUX_SYS_linux_setregid16 71
-#define LINUX_SYS_linux_sigsuspend 72
-#define LINUX_SYS_linux_sigpending 73
-#define LINUX_SYS_linux_sethostname 74
-#define LINUX_SYS_linux_setrlimit 75
-#define LINUX_SYS_linux_old_getrlimit 76
-#define LINUX_SYS_linux_getrusage 77
-#define LINUX_SYS_linux_gettimeofday 78
-#define LINUX_SYS_linux_settimeofday 79
-#define LINUX_SYS_linux_getgroups16 80
-#define LINUX_SYS_linux_setgroups16 81
-#define LINUX_SYS_linux_old_select 82
-#define LINUX_SYS_linux_symlink 83
-#define LINUX_SYS_linux_lstat 84
-#define LINUX_SYS_linux_readlink 85
-#define LINUX_SYS_swapon 87
-#define LINUX_SYS_linux_reboot 88
-#define LINUX_SYS_linux_readdir 89
-#define LINUX_SYS_linux_mmap 90
-#define LINUX_SYS_munmap 91
-#define LINUX_SYS_linux_truncate 92
-#define LINUX_SYS_linux_ftruncate 93
-#define LINUX_SYS_fchmod 94
-#define LINUX_SYS_fchown 95
-#define LINUX_SYS_linux_getpriority 96
-#define LINUX_SYS_setpriority 97
-#define LINUX_SYS_linux_statfs 99
-#define LINUX_SYS_linux_fstatfs 100
-#define LINUX_SYS_linux_socketcall 102
-#define LINUX_SYS_linux_syslog 103
-#define LINUX_SYS_linux_setitimer 104
-#define LINUX_SYS_linux_getitimer 105
-#define LINUX_SYS_linux_newstat 106
-#define LINUX_SYS_linux_newlstat 107
-#define LINUX_SYS_linux_newfstat 108
-#define LINUX_SYS_linux_uname 109
-#define LINUX_SYS_linux_iopl 110
-#define LINUX_SYS_linux_vhangup 111
-#define LINUX_SYS_linux_wait4 114
-#define LINUX_SYS_linux_swapoff 115
-#define LINUX_SYS_linux_sysinfo 116
-#define LINUX_SYS_linux_ipc 117
-#define LINUX_SYS_fsync 118
-#define LINUX_SYS_linux_sigreturn 119
-#define LINUX_SYS_linux_clone 120
-#define LINUX_SYS_linux_setdomainname 121
-#define LINUX_SYS_linux_newuname 122
-#define LINUX_SYS_linux_adjtimex 124
-#define LINUX_SYS_linux_mprotect 125
-#define LINUX_SYS_linux_sigprocmask 126
-#define LINUX_SYS_linux_create_module 127
-#define LINUX_SYS_linux_init_module 128
-#define LINUX_SYS_linux_delete_module 129
-#define LINUX_SYS_linux_get_kernel_syms 130
-#define LINUX_SYS_linux_quotactl 131
-#define LINUX_SYS_getpgid 132
-#define LINUX_SYS_fchdir 133
-#define LINUX_SYS_linux_bdflush 134
-#define LINUX_SYS_linux_sysfs 135
-#define LINUX_SYS_linux_personality 136
-#define LINUX_SYS_linux_setfsuid16 138
-#define LINUX_SYS_linux_setfsgid16 139
-#define LINUX_SYS_linux_llseek 140
-#define LINUX_SYS_linux_getdents 141
-#define LINUX_SYS_linux_select 142
-#define LINUX_SYS_flock 143
-#define LINUX_SYS_linux_msync 144
-#define LINUX_SYS_linux_readv 145
-#define LINUX_SYS_linux_writev 146
-#define LINUX_SYS_linux_getsid 147
-#define LINUX_SYS_linux_fdatasync 148
-#define LINUX_SYS_linux_sysctl 149
-#define LINUX_SYS_mlock 150
-#define LINUX_SYS_munlock 151
-#define LINUX_SYS_mlockall 152
-#define LINUX_SYS_munlockall 153
-#define LINUX_SYS_linux_sched_setparam 154
-#define LINUX_SYS_linux_sched_getparam 155
-#define LINUX_SYS_linux_sched_setscheduler 156
-#define LINUX_SYS_linux_sched_getscheduler 157
-#define LINUX_SYS_sched_yield 158
-#define LINUX_SYS_linux_sched_get_priority_max 159
-#define LINUX_SYS_linux_sched_get_priority_min 160
-#define LINUX_SYS_linux_sched_rr_get_interval 161
-#define LINUX_SYS_linux_nanosleep 162
-#define LINUX_SYS_linux_mremap 163
-#define LINUX_SYS_linux_setresuid16 164
-#define LINUX_SYS_linux_getresuid16 165
-#define LINUX_SYS_linux_query_module 167
-#define LINUX_SYS_poll 168
-#define LINUX_SYS_linux_nfsservctl 169
-#define LINUX_SYS_linux_setresgid16 170
-#define LINUX_SYS_linux_getresgid16 171
-#define LINUX_SYS_linux_prctl 172
-#define LINUX_SYS_linux_rt_sigreturn 173
-#define LINUX_SYS_linux_rt_sigaction 174
-#define LINUX_SYS_linux_rt_sigprocmask 175
-#define LINUX_SYS_linux_rt_sigpending 176
-#define LINUX_SYS_linux_rt_sigtimedwait 177
-#define LINUX_SYS_linux_rt_sigqueueinfo 178
-#define LINUX_SYS_linux_rt_sigsuspend 179
-#define LINUX_SYS_linux_pread 180
-#define LINUX_SYS_linux_pwrite 181
-#define LINUX_SYS_linux_chown16 182
-#define LINUX_SYS_linux_getcwd 183
-#define LINUX_SYS_linux_capget 184
-#define LINUX_SYS_linux_capset 185
-#define LINUX_SYS_linux_sigaltstack 186
-#define LINUX_SYS_linux_sendfile 187
-#define LINUX_SYS_linux_vfork 190
-#define LINUX_SYS_linux_getrlimit 191
-#define LINUX_SYS_linux_mmap2 192
-#define LINUX_SYS_linux_truncate64 193
-#define LINUX_SYS_linux_ftruncate64 194
-#define LINUX_SYS_linux_stat64 195
-#define LINUX_SYS_linux_lstat64 196
-#define LINUX_SYS_linux_fstat64 197
-#define LINUX_SYS_linux_lchown 198
-#define LINUX_SYS_linux_getuid 199
-#define LINUX_SYS_linux_getgid 200
-#define LINUX_SYS_geteuid 201
-#define LINUX_SYS_getegid 202
-#define LINUX_SYS_setreuid 203
-#define LINUX_SYS_setregid 204
-#define LINUX_SYS_linux_getgroups 205
-#define LINUX_SYS_linux_setgroups 206
-#define LINUX_SYS_setresuid 208
-#define LINUX_SYS_getresuid 209
-#define LINUX_SYS_setresgid 210
-#define LINUX_SYS_getresgid 211
-#define LINUX_SYS_linux_chown 212
-#define LINUX_SYS_setuid 213
-#define LINUX_SYS_setgid 214
-#define LINUX_SYS_linux_setfsuid 215
-#define LINUX_SYS_linux_setfsgid 216
-#define LINUX_SYS_linux_pivot_root 217
-#define LINUX_SYS_linux_mincore 218
-#define LINUX_SYS_madvise 219
-#define LINUX_SYS_linux_getdents64 220
-#define LINUX_SYS_linux_fcntl64 221
-#define LINUX_SYS_linux_gettid 224
-#define LINUX_SYS_linux_setxattr 226
-#define LINUX_SYS_linux_lsetxattr 227
-#define LINUX_SYS_linux_fsetxattr 228
-#define LINUX_SYS_linux_getxattr 229
-#define LINUX_SYS_linux_lgetxattr 230
-#define LINUX_SYS_linux_fgetxattr 231
-#define LINUX_SYS_linux_listxattr 232
-#define LINUX_SYS_linux_llistxattr 233
-#define LINUX_SYS_linux_flistxattr 234
-#define LINUX_SYS_linux_removexattr 235
-#define LINUX_SYS_linux_lremovexattr 236
-#define LINUX_SYS_linux_fremovexattr 237
-#define LINUX_SYS_linux_tkill 238
-#define LINUX_SYS_linux_sys_futex 240
-#define LINUX_SYS_linux_sched_setaffinity 241
-#define LINUX_SYS_linux_sched_getaffinity 242
-#define LINUX_SYS_linux_set_thread_area 243
-#define LINUX_SYS_linux_fadvise64 250
-#define LINUX_SYS_linux_exit_group 252
-#define LINUX_SYS_linux_lookup_dcookie 253
-#define LINUX_SYS_linux_epoll_create 254
-#define LINUX_SYS_linux_epoll_ctl 255
-#define LINUX_SYS_linux_epoll_wait 256
-#define LINUX_SYS_linux_remap_file_pages 257
-#define LINUX_SYS_linux_set_tid_address 258
-#define LINUX_SYS_linux_timer_create 259
-#define LINUX_SYS_linux_timer_settime 260
-#define LINUX_SYS_linux_timer_gettime 261
-#define LINUX_SYS_linux_timer_getoverrun 262
-#define LINUX_SYS_linux_timer_delete 263
-#define LINUX_SYS_linux_clock_settime 264
-#define LINUX_SYS_linux_clock_gettime 265
-#define LINUX_SYS_linux_clock_getres 266
-#define LINUX_SYS_linux_clock_nanosleep 267
-#define LINUX_SYS_linux_statfs64 268
-#define LINUX_SYS_linux_fstatfs64 269
-#define LINUX_SYS_linux_tgkill 270
-#define LINUX_SYS_linux_utimes 271
-#define LINUX_SYS_linux_fadvise64_64 272
-#define LINUX_SYS_linux_mbind 274
-#define LINUX_SYS_linux_get_mempolicy 275
-#define LINUX_SYS_linux_set_mempolicy 276
-#define LINUX_SYS_linux_mq_open 277
-#define LINUX_SYS_linux_mq_unlink 278
-#define LINUX_SYS_linux_mq_timedsend 279
-#define LINUX_SYS_linux_mq_timedreceive 280
-#define LINUX_SYS_linux_mq_notify 281
-#define LINUX_SYS_linux_mq_getsetattr 282
-#define LINUX_SYS_linux_kexec_load 283
-#define LINUX_SYS_linux_waitid 284
-#define LINUX_SYS_linux_add_key 286
-#define LINUX_SYS_linux_request_key 287
-#define LINUX_SYS_linux_keyctl 288
-#define LINUX_SYS_linux_ioprio_set 289
-#define LINUX_SYS_linux_ioprio_get 290
-#define LINUX_SYS_linux_inotify_init 291
-#define LINUX_SYS_linux_inotify_add_watch 292
-#define LINUX_SYS_linux_inotify_rm_watch 293
-#define LINUX_SYS_linux_migrate_pages 294
-#define LINUX_SYS_linux_openat 295
-#define LINUX_SYS_linux_mkdirat 296
-#define LINUX_SYS_linux_mknodat 297
-#define LINUX_SYS_linux_fchownat 298
-#define LINUX_SYS_linux_futimesat 299
-#define LINUX_SYS_linux_fstatat64 300
-#define LINUX_SYS_linux_unlinkat 301
-#define LINUX_SYS_linux_renameat 302
-#define LINUX_SYS_linux_linkat 303
-#define LINUX_SYS_linux_symlinkat 304
-#define LINUX_SYS_linux_readlinkat 305
-#define LINUX_SYS_linux_fchmodat 306
-#define LINUX_SYS_linux_faccessat 307
-#define LINUX_SYS_linux_pselect6 308
-#define LINUX_SYS_linux_ppoll 309
-#define LINUX_SYS_linux_unshare 310
-#define LINUX_SYS_linux_set_robust_list 311
-#define LINUX_SYS_linux_get_robust_list 312
-#define LINUX_SYS_linux_splice 313
-#define LINUX_SYS_linux_sync_file_range 314
-#define LINUX_SYS_linux_tee 315
-#define LINUX_SYS_linux_vmsplice 316
-#define LINUX_SYS_linux_move_pages 317
-#define LINUX_SYS_linux_getcpu 318
-#define LINUX_SYS_linux_epoll_pwait 319
-#define LINUX_SYS_linux_utimensat 320
-#define LINUX_SYS_linux_signalfd 321
-#define LINUX_SYS_linux_timerfd_create 322
-#define LINUX_SYS_linux_eventfd 323
-#define LINUX_SYS_linux_fallocate 324
-#define LINUX_SYS_linux_timerfd_settime 325
-#define LINUX_SYS_linux_timerfd_gettime 326
-#define LINUX_SYS_linux_signalfd4 327
-#define LINUX_SYS_linux_eventfd2 328
-#define LINUX_SYS_linux_epoll_create1 329
-#define LINUX_SYS_linux_dup3 330
-#define LINUX_SYS_linux_pipe2 331
-#define LINUX_SYS_linux_inotify_init1 332
-#define LINUX_SYS_linux_preadv 333
-#define LINUX_SYS_linux_pwritev 334
-#define LINUX_SYS_linux_rt_tsigqueueinfo 335
-#define LINUX_SYS_linux_perf_event_open 336
-#define LINUX_SYS_linux_recvmmsg 337
-#define LINUX_SYS_linux_fanotify_init 338
-#define LINUX_SYS_linux_fanotify_mark 339
-#define LINUX_SYS_linux_prlimit64 340
-#define LINUX_SYS_linux_name_to_handle_at 341
-#define LINUX_SYS_linux_open_by_handle_at 342
-#define LINUX_SYS_linux_clock_adjtime 343
-#define LINUX_SYS_linux_syncfs 344
-#define LINUX_SYS_linux_sendmmsg 345
-#define LINUX_SYS_linux_setns 346
-#define LINUX_SYS_linux_process_vm_readv 347
-#define LINUX_SYS_linux_process_vm_writev 348
-#define LINUX_SYS_MAXSYSCALL 350
+#define LINUX32_SYS_linux_exit 1
+#define LINUX32_SYS_linux_fork 2
+#define LINUX32_SYS_read 3
+#define LINUX32_SYS_write 4
+#define LINUX32_SYS_linux_open 5
+#define LINUX32_SYS_close 6
+#define LINUX32_SYS_linux_waitpid 7
+#define LINUX32_SYS_linux_creat 8
+#define LINUX32_SYS_linux_link 9
+#define LINUX32_SYS_linux_unlink 10
+#define LINUX32_SYS_linux_execve 11
+#define LINUX32_SYS_linux_chdir 12
+#define LINUX32_SYS_linux_time 13
+#define LINUX32_SYS_linux_mknod 14
+#define LINUX32_SYS_linux_chmod 15
+#define LINUX32_SYS_linux_lchown16 16
+#define LINUX32_SYS_linux_stat 18
+#define LINUX32_SYS_linux_lseek 19
+#define LINUX32_SYS_linux_getpid 20
+#define LINUX32_SYS_linux_mount 21
+#define LINUX32_SYS_linux_oldumount 22
+#define LINUX32_SYS_linux_setuid16 23
+#define LINUX32_SYS_linux_getuid16 24
+#define LINUX32_SYS_linux_stime 25
+#define LINUX32_SYS_linux_ptrace 26
+#define LINUX32_SYS_linux_alarm 27
+#define LINUX32_SYS_linux_pause 29
+#define LINUX32_SYS_linux_utime 30
+#define LINUX32_SYS_linux_access 33
+#define LINUX32_SYS_linux_nice 34
+#define LINUX32_SYS_sync 36
+#define LINUX32_SYS_linux_kill 37
+#define LINUX32_SYS_linux_rename 38
+#define LINUX32_SYS_linux_mkdir 39
+#define LINUX32_SYS_linux_rmdir 40
+#define LINUX32_SYS_dup 41
+#define LINUX32_SYS_linux_pipe 42
+#define LINUX32_SYS_linux_times 43
+#define LINUX32_SYS_linux_brk 45
+#define LINUX32_SYS_linux_setgid16 46
+#define LINUX32_SYS_linux_getgid16 47
+#define LINUX32_SYS_linux_signal 48
+#define LINUX32_SYS_linux_geteuid16 49
+#define LINUX32_SYS_linux_getegid16 50
+#define LINUX32_SYS_acct 51
+#define LINUX32_SYS_linux_umount 52
+#define LINUX32_SYS_linux_ioctl 54
+#define LINUX32_SYS_linux_fcntl 55
+#define LINUX32_SYS_setpgid 57
+#define LINUX32_SYS_linux_olduname 59
+#define LINUX32_SYS_umask 60
+#define LINUX32_SYS_chroot 61
+#define LINUX32_SYS_linux_ustat 62
+#define LINUX32_SYS_dup2 63
+#define LINUX32_SYS_linux_getppid 64
+#define LINUX32_SYS_getpgrp 65
+#define LINUX32_SYS_setsid 66
+#define LINUX32_SYS_linux_sigaction 67
+#define LINUX32_SYS_linux_sgetmask 68
+#define LINUX32_SYS_linux_ssetmask 69
+#define LINUX32_SYS_linux_setreuid16 70
+#define LINUX32_SYS_linux_setregid16 71
+#define LINUX32_SYS_linux_sigsuspend 72
+#define LINUX32_SYS_linux_sigpending 73
+#define LINUX32_SYS_linux_sethostname 74
+#define LINUX32_SYS_linux_setrlimit 75
+#define LINUX32_SYS_linux_old_getrlimit 76
+#define LINUX32_SYS_linux_getrusage 77
+#define LINUX32_SYS_linux_gettimeofday 78
+#define LINUX32_SYS_linux_settimeofday 79
+#define LINUX32_SYS_linux_getgroups16 80
+#define LINUX32_SYS_linux_setgroups16 81
+#define LINUX32_SYS_linux_old_select 82
+#define LINUX32_SYS_linux_symlink 83
+#define LINUX32_SYS_linux_lstat 84
+#define LINUX32_SYS_linux_readlink 85
+#define LINUX32_SYS_swapon 87
+#define LINUX32_SYS_linux_reboot 88
+#define LINUX32_SYS_linux_readdir 89
+#define LINUX32_SYS_linux_mmap 90
+#define LINUX32_SYS_munmap 91
+#define LINUX32_SYS_linux_truncate 92
+#define LINUX32_SYS_linux_ftruncate 93
+#define LINUX32_SYS_fchmod 94
+#define LINUX32_SYS_fchown 95
+#define LINUX32_SYS_linux_getpriority 96
+#define LINUX32_SYS_setpriority 97
+#define LINUX32_SYS_linux_statfs 99
+#define LINUX32_SYS_linux_fstatfs 100
+#define LINUX32_SYS_linux_socketcall 102
+#define LINUX32_SYS_linux_syslog 103
+#define LINUX32_SYS_linux_setitimer 104
+#define LINUX32_SYS_linux_getitimer 105
+#define LINUX32_SYS_linux_newstat 106
+#define LINUX32_SYS_linux_newlstat 107
+#define LINUX32_SYS_linux_newfstat 108
+#define LINUX32_SYS_linux_uname 109
+#define LINUX32_SYS_linux_iopl 110
+#define LINUX32_SYS_linux_vhangup 111
+#define LINUX32_SYS_linux_wait4 114
+#define LINUX32_SYS_linux_swapoff 115
+#define LINUX32_SYS_linux_sysinfo 116
+#define LINUX32_SYS_linux_ipc 117
+#define LINUX32_SYS_fsync 118
+#define LINUX32_SYS_linux_sigreturn 119
+#define LINUX32_SYS_linux_clone 120
+#define LINUX32_SYS_linux_setdomainname 121
+#define LINUX32_SYS_linux_newuname 122
+#define LINUX32_SYS_linux_adjtimex 124
+#define LINUX32_SYS_linux_mprotect 125
+#define LINUX32_SYS_linux_sigprocmask 126
+#define LINUX32_SYS_linux_create_module 127
+#define LINUX32_SYS_linux_init_module 128
+#define LINUX32_SYS_linux_delete_module 129
+#define LINUX32_SYS_linux_get_kernel_syms 130
+#define LINUX32_SYS_linux_quotactl 131
+#define LINUX32_SYS_getpgid 132
+#define LINUX32_SYS_fchdir 133
+#define LINUX32_SYS_linux_bdflush 134
+#define LINUX32_SYS_linux_sysfs 135
+#define LINUX32_SYS_linux_personality 136
+#define LINUX32_SYS_linux_setfsuid16 138
+#define LINUX32_SYS_linux_setfsgid16 139
+#define LINUX32_SYS_linux_llseek 140
+#define LINUX32_SYS_linux_getdents 141
+#define LINUX32_SYS_linux_select 142
+#define LINUX32_SYS_flock 143
+#define LINUX32_SYS_linux_msync 144
+#define LINUX32_SYS_linux_readv 145
+#define LINUX32_SYS_linux_writev 146
+#define LINUX32_SYS_linux_getsid 147
+#define LINUX32_SYS_linux_fdatasync 148
+#define LINUX32_SYS_linux_sysctl 149
+#define LINUX32_SYS_mlock 150
+#define LINUX32_SYS_munlock 151
+#define LINUX32_SYS_mlockall 152
+#define LINUX32_SYS_munlockall 153
+#define LINUX32_SYS_linux_sched_setparam 154
+#define LINUX32_SYS_linux_sched_getparam 155
+#define LINUX32_SYS_linux_sched_setscheduler 156
+#define LINUX32_SYS_linux_sched_getscheduler 157
+#define LINUX32_SYS_sched_yield 158
+#define LINUX32_SYS_linux_sched_get_priority_max 159
+#define LINUX32_SYS_linux_sched_get_priority_min 160
+#define LINUX32_SYS_linux_sched_rr_get_interval 161
+#define LINUX32_SYS_linux_nanosleep 162
+#define LINUX32_SYS_linux_mremap 163
+#define LINUX32_SYS_linux_setresuid16 164
+#define LINUX32_SYS_linux_getresuid16 165
+#define LINUX32_SYS_linux_query_module 167
+#define LINUX32_SYS_poll 168
+#define LINUX32_SYS_linux_nfsservctl 169
+#define LINUX32_SYS_linux_setresgid16 170
+#define LINUX32_SYS_linux_getresgid16 171
+#define LINUX32_SYS_linux_prctl 172
+#define LINUX32_SYS_linux_rt_sigreturn 173
+#define LINUX32_SYS_linux_rt_sigaction 174
+#define LINUX32_SYS_linux_rt_sigprocmask 175
+#define LINUX32_SYS_linux_rt_sigpending 176
+#define LINUX32_SYS_linux_rt_sigtimedwait 177
+#define LINUX32_SYS_linux_rt_sigqueueinfo 178
+#define LINUX32_SYS_linux_rt_sigsuspend 179
+#define LINUX32_SYS_linux_pread 180
+#define LINUX32_SYS_linux_pwrite 181
+#define LINUX32_SYS_linux_chown16 182
+#define LINUX32_SYS_linux_getcwd 183
+#define LINUX32_SYS_linux_capget 184
+#define LINUX32_SYS_linux_capset 185
+#define LINUX32_SYS_linux_sigaltstack 186
+#define LINUX32_SYS_linux_sendfile 187
+#define LINUX32_SYS_linux_vfork 190
+#define LINUX32_SYS_linux_getrlimit 191
+#define LINUX32_SYS_linux_mmap2 192
+#define LINUX32_SYS_linux_truncate64 193
+#define LINUX32_SYS_linux_ftruncate64 194
+#define LINUX32_SYS_linux_stat64 195
+#define LINUX32_SYS_linux_lstat64 196
+#define LINUX32_SYS_linux_fstat64 197
+#define LINUX32_SYS_linux_lchown 198
+#define LINUX32_SYS_linux_getuid 199
+#define LINUX32_SYS_linux_getgid 200
+#define LINUX32_SYS_geteuid 201
+#define LINUX32_SYS_getegid 202
+#define LINUX32_SYS_setreuid 203
+#define LINUX32_SYS_setregid 204
+#define LINUX32_SYS_linux_getgroups 205
+#define LINUX32_SYS_linux_setgroups 206
+#define LINUX32_SYS_setresuid 208
+#define LINUX32_SYS_getresuid 209
+#define LINUX32_SYS_setresgid 210
+#define LINUX32_SYS_getresgid 211
+#define LINUX32_SYS_linux_chown 212
+#define LINUX32_SYS_setuid 213
+#define LINUX32_SYS_setgid 214
+#define LINUX32_SYS_linux_setfsuid 215
+#define LINUX32_SYS_linux_setfsgid 216
+#define LINUX32_SYS_linux_pivot_root 217
+#define LINUX32_SYS_linux_mincore 218
+#define LINUX32_SYS_madvise 219
+#define LINUX32_SYS_linux_getdents64 220
+#define LINUX32_SYS_linux_fcntl64 221
+#define LINUX32_SYS_linux_gettid 224
+#define LINUX32_SYS_linux_setxattr 226
+#define LINUX32_SYS_linux_lsetxattr 227
+#define LINUX32_SYS_linux_fsetxattr 228
+#define LINUX32_SYS_linux_getxattr 229
+#define LINUX32_SYS_linux_lgetxattr 230
+#define LINUX32_SYS_linux_fgetxattr 231
+#define LINUX32_SYS_linux_listxattr 232
+#define LINUX32_SYS_linux_llistxattr 233
+#define LINUX32_SYS_linux_flistxattr 234
+#define LINUX32_SYS_linux_removexattr 235
+#define LINUX32_SYS_linux_lremovexattr 236
+#define LINUX32_SYS_linux_fremovexattr 237
+#define LINUX32_SYS_linux_tkill 238
+#define LINUX32_SYS_linux_sys_futex 240
+#define LINUX32_SYS_linux_sched_setaffinity 241
+#define LINUX32_SYS_linux_sched_getaffinity 242
+#define LINUX32_SYS_linux_set_thread_area 243
+#define LINUX32_SYS_linux_fadvise64 250
+#define LINUX32_SYS_linux_exit_group 252
+#define LINUX32_SYS_linux_lookup_dcookie 253
+#define LINUX32_SYS_linux_epoll_create 254
+#define LINUX32_SYS_linux_epoll_ctl 255
+#define LINUX32_SYS_linux_epoll_wait 256
+#define LINUX32_SYS_linux_remap_file_pages 257
+#define LINUX32_SYS_linux_set_tid_address 258
+#define LINUX32_SYS_linux_timer_create 259
+#define LINUX32_SYS_linux_timer_settime 260
+#define LINUX32_SYS_linux_timer_gettime 261
+#define LINUX32_SYS_linux_timer_getoverrun 262
+#define LINUX32_SYS_linux_timer_delete 263
+#define LINUX32_SYS_linux_clock_settime 264
+#define LINUX32_SYS_linux_clock_gettime 265
+#define LINUX32_SYS_linux_clock_getres 266
+#define LINUX32_SYS_linux_clock_nanosleep 267
+#define LINUX32_SYS_linux_statfs64 268
+#define LINUX32_SYS_linux_fstatfs64 269
+#define LINUX32_SYS_linux_tgkill 270
+#define LINUX32_SYS_linux_utimes 271
+#define LINUX32_SYS_linux_fadvise64_64 272
+#define LINUX32_SYS_linux_mbind 274
+#define LINUX32_SYS_linux_get_mempolicy 275
+#define LINUX32_SYS_linux_set_mempolicy 276
+#define LINUX32_SYS_linux_mq_open 277
+#define LINUX32_SYS_linux_mq_unlink 278
+#define LINUX32_SYS_linux_mq_timedsend 279
+#define LINUX32_SYS_linux_mq_timedreceive 280
+#define LINUX32_SYS_linux_mq_notify 281
+#define LINUX32_SYS_linux_mq_getsetattr 282
+#define LINUX32_SYS_linux_kexec_load 283
+#define LINUX32_SYS_linux_waitid 284
+#define LINUX32_SYS_linux_add_key 286
+#define LINUX32_SYS_linux_request_key 287
+#define LINUX32_SYS_linux_keyctl 288
+#define LINUX32_SYS_linux_ioprio_set 289
+#define LINUX32_SYS_linux_ioprio_get 290
+#define LINUX32_SYS_linux_inotify_init 291
+#define LINUX32_SYS_linux_inotify_add_watch 292
+#define LINUX32_SYS_linux_inotify_rm_watch 293
+#define LINUX32_SYS_linux_migrate_pages 294
+#define LINUX32_SYS_linux_openat 295
+#define LINUX32_SYS_linux_mkdirat 296
+#define LINUX32_SYS_linux_mknodat 297
+#define LINUX32_SYS_linux_fchownat 298
+#define LINUX32_SYS_linux_futimesat 299
+#define LINUX32_SYS_linux_fstatat64 300
+#define LINUX32_SYS_linux_unlinkat 301
+#define LINUX32_SYS_linux_renameat 302
+#define LINUX32_SYS_linux_linkat 303
+#define LINUX32_SYS_linux_symlinkat 304
+#define LINUX32_SYS_linux_readlinkat 305
+#define LINUX32_SYS_linux_fchmodat 306
+#define LINUX32_SYS_linux_faccessat 307
+#define LINUX32_SYS_linux_pselect6 308
+#define LINUX32_SYS_linux_ppoll 309
+#define LINUX32_SYS_linux_unshare 310
+#define LINUX32_SYS_linux_set_robust_list 311
+#define LINUX32_SYS_linux_get_robust_list 312
+#define LINUX32_SYS_linux_splice 313
+#define LINUX32_SYS_linux_sync_file_range 314
+#define LINUX32_SYS_linux_tee 315
+#define LINUX32_SYS_linux_vmsplice 316
+#define LINUX32_SYS_linux_move_pages 317
+#define LINUX32_SYS_linux_getcpu 318
+#define LINUX32_SYS_linux_epoll_pwait 319
+#define LINUX32_SYS_linux_utimensat 320
+#define LINUX32_SYS_linux_signalfd 321
+#define LINUX32_SYS_linux_timerfd_create 322
+#define LINUX32_SYS_linux_eventfd 323
+#define LINUX32_SYS_linux_fallocate 324
+#define LINUX32_SYS_linux_timerfd_settime 325
+#define LINUX32_SYS_linux_timerfd_gettime 326
+#define LINUX32_SYS_linux_signalfd4 327
+#define LINUX32_SYS_linux_eventfd2 328
+#define LINUX32_SYS_linux_epoll_create1 329
+#define LINUX32_SYS_linux_dup3 330
+#define LINUX32_SYS_linux_pipe2 331
+#define LINUX32_SYS_linux_inotify_init1 332
+#define LINUX32_SYS_linux_preadv 333
+#define LINUX32_SYS_linux_pwritev 334
+#define LINUX32_SYS_linux_rt_tsigqueueinfo 335
+#define LINUX32_SYS_linux_perf_event_open 336
+#define LINUX32_SYS_linux_recvmmsg 337
+#define LINUX32_SYS_linux_fanotify_init 338
+#define LINUX32_SYS_linux_fanotify_mark 339
+#define LINUX32_SYS_linux_prlimit64 340
+#define LINUX32_SYS_linux_name_to_handle_at 341
+#define LINUX32_SYS_linux_open_by_handle_at 342
+#define LINUX32_SYS_linux_clock_adjtime 343
+#define LINUX32_SYS_linux_syncfs 344
+#define LINUX32_SYS_linux_sendmmsg 345
+#define LINUX32_SYS_linux_setns 346
+#define LINUX32_SYS_linux_process_vm_readv 347
+#define LINUX32_SYS_linux_process_vm_writev 348
+#define LINUX32_SYS_MAXSYSCALL 350
diff --git a/sys/amd64/linux32/linux32_syscalls.c b/sys/amd64/linux32/linux32_syscalls.c
index 6d81d6b..8e7585a 100644
--- a/sys/amd64/linux32/linux32_syscalls.c
+++ b/sys/amd64/linux32/linux32_syscalls.c
@@ -3,10 +3,10 @@
*
* DO NOT EDIT-- this file is automatically generated.
* $FreeBSD$
- * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293592 2016-01-09 17:54:37Z dchagin
+ * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 294368 2016-01-20 01:09:53Z jhb
*/
-const char *linux_syscallnames[] = {
+const char *linux32_syscallnames[] = {
#define nosys linux_nosys
"#0", /* 0 = setup */
"linux_exit", /* 1 = linux_exit */
diff --git a/sys/amd64/linux32/linux32_sysent.c b/sys/amd64/linux32/linux32_sysent.c
index a4d3075..f254a86 100644
--- a/sys/amd64/linux32/linux32_sysent.c
+++ b/sys/amd64/linux32/linux32_sysent.c
@@ -3,7 +3,7 @@
*
* DO NOT EDIT-- this file is automatically generated.
* $FreeBSD$
- * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293592 2016-01-09 17:54:37Z dchagin
+ * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 294368 2016-01-20 01:09:53Z jhb
*/
#include "opt_compat.h"
@@ -17,7 +17,7 @@
#define AS(name) (sizeof(struct name) / sizeof(register_t))
/* The casts are bogus but will do for now. */
-struct sysent linux_sysent[] = {
+struct sysent linux32_sysent[] = {
#define nosys linux_nosys
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 0 = setup */
{ AS(linux_exit_args), (sy_call_t *)linux_exit, AUE_EXIT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 1 = linux_exit */
diff --git a/sys/amd64/linux32/linux32_sysvec.c b/sys/amd64/linux32/linux32_sysvec.c
index 250e16b..73949d9 100644
--- a/sys/amd64/linux32/linux32_sysvec.c
+++ b/sys/amd64/linux32/linux32_sysvec.c
@@ -105,8 +105,8 @@ MODULE_VERSION(linux, 1);
* to syscall 0. This is slightly less bogus than using
* ldebug(sigreturn).
*/
-#define LINUX_SYS_linux_rt_sendsig 0
-#define LINUX_SYS_linux_sendsig 0
+#define LINUX32_SYS_linux_rt_sendsig 0
+#define LINUX32_SYS_linux_sendsig 0
const char *linux_kplatform;
static int linux_szsigcode;
@@ -115,7 +115,7 @@ static char *linux_shared_page_mapping;
extern char _binary_linux32_locore_o_start;
extern char _binary_linux32_locore_o_end;
-extern struct sysent linux_sysent[LINUX_SYS_MAXSYSCALL];
+extern struct sysent linux32_sysent[LINUX32_SYS_MAXSYSCALL];
SET_DECLARE(linux_ioctl_handler_set, struct linux_ioctl_handler);
@@ -1008,8 +1008,8 @@ linux32_fixlimit(struct rlimit *rl, int which)
}
struct sysentvec elf_linux_sysvec = {
- .sv_size = LINUX_SYS_MAXSYSCALL,
- .sv_table = linux_sysent,
+ .sv_size = LINUX32_SYS_MAXSYSCALL,
+ .sv_table = linux32_sysent,
.sv_mask = 0,
.sv_sigsize = 0,
.sv_sigtbl = NULL,
@@ -1043,6 +1043,7 @@ struct sysentvec elf_linux_sysvec = {
.sv_shared_page_len = PAGE_SIZE,
.sv_schedtail = linux_schedtail,
.sv_thread_detach = linux_thread_detach,
+ .sv_trap = NULL,
};
static void
diff --git a/sys/amd64/linux32/syscalls.conf b/sys/amd64/linux32/syscalls.conf
index dc0ad82..7d096b5 100644
--- a/sys/amd64/linux32/syscalls.conf
+++ b/sys/amd64/linux32/syscalls.conf
@@ -1,11 +1,11 @@
# $FreeBSD$
sysnames="linux32_syscalls.c"
sysproto="linux32_proto.h"
-sysproto_h=_LINUX_SYSPROTO_H_
+sysproto_h=_LINUX32_SYSPROTO_H_
syshdr="linux32_syscall.h"
syssw="linux32_sysent.c"
sysmk="/dev/null"
-syscallprefix="LINUX_SYS_"
-switchname="linux_sysent"
-namesname="linux_syscallnames"
+syscallprefix="LINUX32_SYS_"
+switchname="linux32_sysent"
+namesname="linux32_syscallnames"
systrace="linux32_systrace_args.c"
diff --git a/sys/amd64/linux32/syscalls.master b/sys/amd64/linux32/syscalls.master
index 6e09c5a..0396b30 100644
--- a/sys/amd64/linux32/syscalls.master
+++ b/sys/amd64/linux32/syscalls.master
@@ -2,7 +2,7 @@
; @(#)syscalls.master 8.1 (Berkeley) 7/19/93
; System call name/number master file (or rather, slave, from LINUX).
-; Processed to create linux_sysent.c, linux_proto.h and linux_syscall.h.
+; Processed to create linux32_sysent.c, linux32_proto.h and linux32_syscall.h.
; Columns: number audit type nargs name alt{name,tag,rtyp}/comments
; number system call number, must be in order
diff --git a/sys/arm/arm/bcopyinout.S b/sys/arm/arm/bcopyinout.S
index 3624f92..0a12e45 100644
--- a/sys/arm/arm/bcopyinout.S
+++ b/sys/arm/arm/bcopyinout.S
@@ -38,6 +38,7 @@
#include "assym.s"
+#include <machine/acle-compat.h>
#include <machine/asm.h>
#include <sys/errno.h>
@@ -54,7 +55,7 @@ __FBSDID("$FreeBSD$");
.text
.align 2
-#ifdef _ARM_ARCH_6
+#if __ARM_ARCH >= 6
#define GET_PCB(tmp) \
mrc p15, 0, tmp, c13, c0, 4; \
add tmp, tmp, #(TD_PCB)
diff --git a/sys/arm/arm/bcopyinout_xscale.S b/sys/arm/arm/bcopyinout_xscale.S
index 487737e..b4204f6 100644
--- a/sys/arm/arm/bcopyinout_xscale.S
+++ b/sys/arm/arm/bcopyinout_xscale.S
@@ -38,11 +38,13 @@
#include <machine/asm.h>
__FBSDID("$FreeBSD$");
+#include <machine/acle-compat.h>
+
.syntax unified
.text
.align 2
-#ifdef _ARM_ARCH_6
+#if __ARM_ARCH >= 6
#define GET_PCB(tmp) \
mrc p15, 0, tmp, c13, c0, 4; \
add tmp, tmp, #(TD_PCB)
diff --git a/sys/arm/arm/busdma_machdep.c b/sys/arm/arm/busdma_machdep.c
index d24f2d2..c130731 100644
--- a/sys/arm/arm/busdma_machdep.c
+++ b/sys/arm/arm/busdma_machdep.c
@@ -786,10 +786,9 @@ bus_dmamem_free(bus_dma_tag_t dmat, void *vaddr, bus_dmamap_t map)
ba = coherent_allocator;
else
ba = standard_allocator;
- uma_zfree(dmamap_zone, map);
free(map->slist, M_DEVBUF);
- /* Be careful not to access map from here on. */
+ uma_zfree(dmamap_zone, map);
bufzone = busdma_bufalloc_findzone(ba, dmat->maxsize);
diff --git a/sys/arm/arm/copystr.S b/sys/arm/arm/copystr.S
index 57c9e70..89b1708 100644
--- a/sys/arm/arm/copystr.S
+++ b/sys/arm/arm/copystr.S
@@ -40,6 +40,7 @@
#include "assym.s"
+#include <machine/acle-compat.h>
#include <machine/asm.h>
#include <machine/armreg.h>
__FBSDID("$FreeBSD$");
@@ -49,7 +50,7 @@ __FBSDID("$FreeBSD$");
.text
.align 2
-#ifdef _ARM_ARCH_6
+#if __ARM_ARCH >= 6
#define GET_PCB(tmp) \
mrc p15, 0, tmp, c13, c0, 4; \
add tmp, tmp, #(TD_PCB)
diff --git a/sys/arm/arm/elf_machdep.c b/sys/arm/arm/elf_machdep.c
index 8472858..55d4a41 100644
--- a/sys/arm/arm/elf_machdep.c
+++ b/sys/arm/arm/elf_machdep.c
@@ -80,6 +80,7 @@ struct sysentvec elf32_freebsd_sysvec = {
.sv_syscallnames = syscallnames,
.sv_schedtail = NULL,
.sv_thread_detach = NULL,
+ .sv_trap = NULL,
};
static Elf32_Brandinfo freebsd_brand_info = {
diff --git a/sys/arm/arm/fusu.S b/sys/arm/arm/fusu.S
index dec49ed..7bc3a98 100644
--- a/sys/arm/arm/fusu.S
+++ b/sys/arm/arm/fusu.S
@@ -131,8 +131,8 @@ EENTRY_NP(fuword32)
str r1, [r2, #PCB_ONFAULT]
mov r0, r3
RET
-EEND(fuword32)
-END(fuword)
+EEND(fueword32)
+END(fueword)
/*
* fusword(caddr_t uaddr);
diff --git a/sys/arm/arm/locore-v4.S b/sys/arm/arm/locore-v4.S
index 6c20b68..c46c0bf 100644
--- a/sys/arm/arm/locore-v4.S
+++ b/sys/arm/arm/locore-v4.S
@@ -42,20 +42,8 @@
__FBSDID("$FreeBSD$");
-/*
- * Sanity check the configuration.
- * FLASHADDR and LOADERRAMADDR depend on PHYSADDR in some cases.
- * ARMv4 and ARMv5 make assumptions on where they are loaded.
- *
- * TODO: Fix the ARMv4/v5 case.
- */
-#if (defined(FLASHADDR) || defined(LOADERRAMADDR) || !defined(_ARM_ARCH_6)) && \
- !defined(PHYSADDR)
-#error PHYSADDR must be defined for this configuration
-#endif
-
-/* What size should this really be ? It is only used by initarm() */
-#define INIT_ARM_STACK_SIZE (2048 * 4)
+/* 2K initial stack is plenty, it is only used by initarm() */
+#define INIT_ARM_STACK_SIZE 2048
#define CPWAIT_BRANCH \
sub pc, pc, #4
@@ -110,13 +98,23 @@ ASENTRY_NP(_start)
msr cpsr_c, r7
#if defined (FLASHADDR) && defined(LOADERRAMADDR)
+/*
+ * Sanity check the configuration.
+ * FLASHADDR and LOADERRAMADDR depend on PHYSADDR in some cases.
+ * ARMv4 and ARMv5 make assumptions on where they are loaded.
+ * TODO: Fix the ARMv4/v5 case.
+ */
+#ifndef PHYSADDR
+#error PHYSADDR must be defined for this configuration
+#endif
+
/* Check if we're running from flash. */
ldr r7, =FLASHADDR
/*
* If we're running with MMU disabled, test against the
* physical address instead.
*/
- mrc p15, 0, r2, c1, c0, 0
+ mrc p15, 0, r2, c1, c0, 0
ands r2, r2, #CPU_CONTROL_MMU_ENABLE
ldreq r6, =PHYSADDR
ldrne r6, =LOADERRAMADDR
@@ -125,7 +123,7 @@ ASENTRY_NP(_start)
cmp r7, pc
bhi from_ram
b do_copy
-
+
flash_lower:
cmp r6, pc
bls from_ram
@@ -148,12 +146,12 @@ from_ram:
disable_mmu:
/* Disable MMU for a while */
- mrc p15, 0, r2, c1, c0, 0
+ mrc p15, 0, r2, c1, c0, 0
bic r2, r2, #(CPU_CONTROL_MMU_ENABLE | CPU_CONTROL_DC_ENABLE |\
CPU_CONTROL_WBUF_ENABLE)
bic r2, r2, #(CPU_CONTROL_IC_ENABLE)
bic r2, r2, #(CPU_CONTROL_BPRD_ENABLE)
- mcr p15, 0, r2, c1, c0, 0
+ mcr p15, 0, r2, c1, c0, 0
nop
nop
@@ -165,85 +163,57 @@ Lunmapped:
* Build page table from scratch.
*/
- /* Find the delta between VA and PA */
+ /*
+ * Figure out the physical address we're loaded at by assuming this
+ * entry point code is in the first L1 section and so if we clear the
+ * offset bits of the pc that will give us the section-aligned load
+ * address, which remains in r5 throughout all the following code.
+ */
+ ldr r2, =(L1_S_OFFSET)
+ bic r5, pc, r2
+
+ /* Find the delta between VA and PA, result stays in r0 throughout. */
adr r0, Lpagetable
bl translate_va_to_pa
-#ifndef _ARM_ARCH_6
- /*
- * Some of the older ports (the various XScale, mostly) assume
- * that the memory before the kernel is mapped, and use it for
- * the various stacks, page tables, etc. For those CPUs, map the
- * 64 first MB of RAM, as it used to be.
+ /*
+ * First map the entire 4GB address space as VA=PA. It's mapped as
+ * normal (cached) memory because it's for things like accessing the
+ * parameters passed in from the bootloader, which might be at any
+ * physical address, different for every platform.
*/
- /*
- * Map PA == VA
- */
- ldr r5, =PHYSADDR
- mov r1, r5
- mov r2, r5
- /* Map 64MiB, preserved over calls to build_pagetables */
- mov r3, #64
- bl build_pagetables
-
- /* Create the kernel map to jump to */
- mov r1, r5
- ldr r2, =(KERNBASE)
- bl build_pagetables
- ldr r5, =(KERNPHYSADDR)
-#else
- /*
- * Map PA == VA
- */
- /* Find the start kernels load address */
- adr r5, _start
- ldr r2, =(L1_S_OFFSET)
- bic r5, r2
- mov r1, r5
- mov r2, r5
- /* Map 64MiB, preserved over calls to build_pagetables */
- mov r3, #64
+ mov r1, #0
+ mov r2, #0
+ mov r3, #4096
bl build_pagetables
- /* Create the kernel map to jump to */
+ /*
+ * Next we do 64MiB starting at the physical load address, mapped to
+ * the VA the kernel is linked for.
+ */
mov r1, r5
ldr r2, =(KERNVIRTADDR)
+ mov r3, #64
bl build_pagetables
-#endif
-
+
+ /* Create a device mapping for early_printf if specified. */
#if defined(SOCDEV_PA) && defined(SOCDEV_VA)
- /* Create the custom map */
ldr r1, =SOCDEV_PA
ldr r2, =SOCDEV_VA
- bl build_pagetables
+ mov r3, #1
+ bl build_device_pagetables
#endif
-#if defined(SMP)
- orr r0, r0, #2 /* Set TTB shared memory flag */
-#endif
mcr p15, 0, r0, c2, c0, 0 /* Set TTB */
mcr p15, 0, r0, c8, c7, 0 /* Flush TLB */
-#if defined(CPU_ARM1136) || defined(CPU_ARM1176) || defined(CPU_CORTEXA) || defined(CPU_MV_PJ4B) || defined(CPU_KRAIT)
- mov r0, #0
- mcr p15, 0, r0, c13, c0, 1 /* Set ASID to 0 */
-#endif
-
/* Set the Domain Access register. Very important! */
- mov r0, #((DOMAIN_CLIENT << (PMAP_DOMAIN_KERNEL*2)) | DOMAIN_CLIENT)
+ mov r0, #((DOMAIN_CLIENT << (PMAP_DOMAIN_KERNEL*2)) | DOMAIN_CLIENT)
mcr p15, 0, r0, c3, c0, 0
- /*
+ /*
* Enable MMU.
- * On armv6 enable extended page tables, and set alignment checking
- * to modulo-4 (CPU_CONTROL_UNAL_ENABLE) for the ldrd/strd
- * instructions emitted by clang.
*/
mrc p15, 0, r0, c1, c0, 0
-#ifdef _ARM_ARCH_6
- orr r0, r0, #(CPU_CONTROL_V6_EXTPAGE | CPU_CONTROL_UNAL_ENABLE)
- orr r0, r0, #(CPU_CONTROL_AFLT_ENABLE)
- orr r0, r0, #(CPU_CONTROL_AF_ENABLE)
-#endif
orr r0, r0, #(CPU_CONTROL_MMU_ENABLE)
mcr p15, 0, r0, c1, c0, 0
nop
@@ -251,6 +221,9 @@ Lunmapped:
nop
CPWAIT(r0)
+ /* Transition the PC from physical to virtual addressing. */
+ ldr pc,=mmu_done
+
mmu_done:
nop
adr r1, .Lstart
@@ -261,7 +234,6 @@ mmu_done:
str r3, [r1], #0x0004 /* get zero init data */
subs r2, r2, #4
bgt .L1
- ldr pc, .Lvirt_done
virt_done:
mov r1, #28 /* loader info size is 28 bytes also second arg */
@@ -283,7 +255,7 @@ virt_done:
/* init arm will return the new stack pointer. */
mov sp, r0
- bl _C_LABEL(mi_startup) /* call mi_startup()! */
+ bl _C_LABEL(mi_startup) /* call mi_startup()! */
adr r0, .Lmainreturned
b _C_LABEL(panic)
@@ -335,24 +307,25 @@ translate_va_to_pa:
*
* Addresses must be 1MiB aligned
*/
+build_device_pagetables:
+ ldr r4, =(L1_TYPE_S|L1_S_AP(AP_KRW))
+ b 1f
build_pagetables:
/* Set the required page attributed */
ldr r4, =(L1_TYPE_S|L1_S_C|L1_S_AP(AP_KRW))
-#if defined(SMP)
- orr r4, #(L1_SHARED)
-#endif
+1:
orr r1, r4
/* Move the virtual address to the correct bit location */
lsr r2, #(L1_S_SHIFT - 2)
mov r4, r3
-1:
+2:
str r1, [r0, r2]
add r2, r2, #4
add r1, r1, #(L1_S_SIZE)
adds r4, r4, #-1
- bhi 1b
+ bhi 2b
RET
@@ -394,98 +367,12 @@ pagetable:
.Lcpufuncs:
.word _C_LABEL(cpufuncs)
-#if defined(SMP)
-
-.Lmpvirt_done:
- .word mpvirt_done
-VA_TO_PA_POINTER(Lstartup_pagetable_secondary, temp_pagetable)
-
-ASENTRY_NP(mpentry)
-
- /* Make sure interrupts are disabled. */
- mrs r7, cpsr
- orr r7, r7, #(PSR_I | PSR_F)
- msr cpsr_c, r7
-
- /* Disable MMU. It should be disabled already, but make sure. */
- mrc p15, 0, r2, c1, c0, 0
- bic r2, r2, #(CPU_CONTROL_MMU_ENABLE | CPU_CONTROL_DC_ENABLE |\
- CPU_CONTROL_WBUF_ENABLE)
- bic r2, r2, #(CPU_CONTROL_IC_ENABLE)
- bic r2, r2, #(CPU_CONTROL_BPRD_ENABLE)
- mcr p15, 0, r2, c1, c0, 0
- nop
- nop
- nop
- CPWAIT(r0)
-
-#if ARM_MMU_V6
- bl armv6_idcache_inv_all /* Modifies r0 only */
-#elif ARM_MMU_V7
- bl armv7_idcache_inv_all /* Modifies r0-r3, ip */
-#endif
-
- /* Load the page table physical address */
- adr r0, Lstartup_pagetable_secondary
- bl translate_va_to_pa
- /* Load the address the secondary page table */
- ldr r0, [r0]
-
- orr r0, r0, #2 /* Set TTB shared memory flag */
- mcr p15, 0, r0, c2, c0, 0 /* Set TTB */
- mcr p15, 0, r0, c8, c7, 0 /* Flush TLB */
-
- mov r0, #0
- mcr p15, 0, r0, c13, c0, 1 /* Set ASID to 0 */
-
- /* Set the Domain Access register. Very important! */
- mov r0, #((DOMAIN_CLIENT << (PMAP_DOMAIN_KERNEL*2)) | DOMAIN_CLIENT)
- mcr p15, 0, r0, c3, c0, 0
- /* Enable MMU */
- mrc p15, 0, r0, c1, c0, 0
- orr r0, r0, #CPU_CONTROL_V6_EXTPAGE
- orr r0, r0, #CPU_CONTROL_AF_ENABLE
- orr r0, r0, #(CPU_CONTROL_MMU_ENABLE | CPU_CONTROL_DC_ENABLE |\
- CPU_CONTROL_WBUF_ENABLE)
- orr r0, r0, #(CPU_CONTROL_IC_ENABLE)
- orr r0, r0, #(CPU_CONTROL_BPRD_ENABLE)
- mcr p15, 0, r0, c1, c0, 0
- nop
- nop
- nop
- CPWAIT(r0)
-
- adr r1, .Lstart
- ldmia r1, {r1, r2, sp} /* Set initial stack and */
- mrc p15, 0, r0, c0, c0, 5
- and r0, r0, #15
- mov r1, #2048
- mul r2, r1, r0
- sub sp, sp, r2
- str r1, [sp]
- ldr pc, .Lmpvirt_done
-
-mpvirt_done:
-
- mov fp, #0 /* trace back starts here */
- bl _C_LABEL(init_secondary) /* Off we go */
-
- adr r0, .Lmpreturned
- b _C_LABEL(panic)
- /* NOTREACHED */
-
-.Lmpreturned:
- .asciz "init_secondary() returned"
- .align 2
-END(mpentry)
-#endif
-
ENTRY_NP(cpu_halt)
- mrs r2, cpsr
+ mrs r2, cpsr
bic r2, r2, #(PSR_MODE)
- orr r2, r2, #(PSR_SVC32_MODE)
+ orr r2, r2, #(PSR_SVC32_MODE)
orr r2, r2, #(PSR_I | PSR_F)
- msr cpsr_fsxc, r2
+ msr cpsr_fsxc, r2
ldr r4, .Lcpu_reset_address
ldr r4, [r4]
@@ -511,9 +398,9 @@ ENTRY_NP(cpu_halt)
* Hurl ourselves into the ROM
*/
mov r0, #(CPU_CONTROL_32BP_ENABLE | CPU_CONTROL_32BD_ENABLE)
- mcr p15, 0, r0, c1, c0, 0
- mcrne p15, 0, r2, c8, c7, 0 /* nail I+D TLB on ARMv4 and greater */
- mov pc, r4
+ mcr p15, 0, r0, c1, c0, 0
+ mcrne p15, 0, r2, c8, c7, 0 /* nail I+D TLB on ARMv4 and greater */
+ mov pc, r4
/*
* _cpu_reset_address contains the address to branch to, to complete
@@ -550,7 +437,7 @@ ENTRY(longjmp)
END(longjmp)
.data
- .global _C_LABEL(esym)
+ .global _C_LABEL(esym)
_C_LABEL(esym): .word _C_LABEL(end)
ENTRY_NP(abort)
@@ -563,7 +450,7 @@ ENTRY_NP(sigcode)
/*
* Call the sigreturn system call.
- *
+ *
* We have to load r7 manually rather than using
* "ldr r7, =SYS_sigreturn" to ensure the value of szsigcode is
* correct. Using the alternative places esigcode at the address
diff --git a/sys/arm/arm/locore-v6.S b/sys/arm/arm/locore-v6.S
index 55b4311..510af6c 100644
--- a/sys/arm/arm/locore-v6.S
+++ b/sys/arm/arm/locore-v6.S
@@ -39,7 +39,7 @@
__FBSDID("$FreeBSD$");
-#ifndef ARM_NEW_PMAP
+#ifndef ARM_NEW_PMAP
#define PTE1_OFFSET L1_S_OFFSET
#define PTE1_SHIFT L1_S_SHIFT
#define PTE1_SIZE L1_S_SIZE
@@ -52,13 +52,13 @@ __FBSDID("$FreeBSD$");
.align 2
/*
- * On entry for FreeBSD boot ABI:
- * r0 - metadata pointer or 0 (boothowto on AT91's boot2)
- * r1 - if (r0 == 0) then metadata pointer
- * On entry for Linux boot ABI:
+ * On entry for FreeBSD boot ABI:
+ * r0 - metadata pointer or 0 (boothowto on AT91's boot2)
+ * r1 - if (r0 == 0) then metadata pointer
+ * On entry for Linux boot ABI:
* r0 - 0
* r1 - machine type (passed as arg2 to initarm)
- * r2 - Pointer to a tagged list or dtb image (phys addr) (passed as arg1 initarm)
+ * r2 - Pointer to a tagged list or dtb image (phys addr) (passed as arg1 initarm)
*
* For both types of boot we gather up the args, put them in a struct arm_boot_params
* structure and pass that to initarm.
@@ -66,17 +66,17 @@ __FBSDID("$FreeBSD$");
.globl btext
btext:
ASENTRY_NP(_start)
- STOP_UNWINDING /* Can't unwind into the bootloader! */
+ STOP_UNWINDING /* Can't unwind into the bootloader! */
- /* Make sure interrupts are disabled. */
+ /* Make sure interrupts are disabled. */
cpsid ifa
- mov r8, r0 /* 0 or boot mode from boot2 */
- mov r9, r1 /* Save Machine type */
- mov r10, r2 /* Save meta data */
+ mov r8, r0 /* 0 or boot mode from boot2 */
+ mov r9, r1 /* Save Machine type */
+ mov r10, r2 /* Save meta data */
mov r11, r3 /* Future expansion */
- /*
+ /*
* Check whether data cache is enabled. If it is, then we know
* current tags are valid (not power-on garbage values) and there
* might be dirty lines that need cleaning. Disable cache to prevent
@@ -93,7 +93,7 @@ ASENTRY_NP(_start)
* valid. Disable all caches and the MMU, and invalidate everything
* before setting up new page tables and re-enabling the mmu.
*/
-1:
+1:
bic r7, #CPU_CONTROL_DC_ENABLE
bic r7, #CPU_CONTROL_MMU_ENABLE
bic r7, #CPU_CONTROL_IC_ENABLE
@@ -103,80 +103,94 @@ ASENTRY_NP(_start)
orr r7, #CPU_CONTROL_AFLT_ENABLE
orr r7, #CPU_CONTROL_VECRELOC
mcr CP15_SCTLR(r7)
+ DSB
ISB
bl dcache_inv_poc_all
mcr CP15_ICIALLU
+ DSB
ISB
/*
* Build page table from scratch.
*/
- /* Calculate the physical address of the startup pagetable. */
+ /*
+ * Figure out the physical address we're loaded at by assuming this
+ * entry point code is in the first L1 section and so if we clear the
+ * offset bits of the pc that will give us the section-aligned load
+ * address, which remains in r5 throughout all the following code.
+ */
+ ldr r2, =(L1_S_OFFSET)
+ bic r5, pc, r2
+
+ /* Find the delta between VA and PA, result stays in r0 throughout. */
adr r0, Lpagetable
bl translate_va_to_pa
- /*
- * Map PA == VA
+ /*
+ * First map the entire 4GB address space as VA=PA. It's mapped as
+ * normal (cached) memory because it's for things like accessing the
+ * parameters passed in from the bootloader, which might be at any
+ * physical address, different for every platform.
*/
- /* Find the start kernels load address */
- adr r5, _start
- ldr r2, =(PTE1_OFFSET)
- bic r5, r2
- mov r1, r5
- mov r2, r5
- /* Map 64MiB, preserved over calls to build_pagetables */
- mov r3, #64
+ mov r1, #0
+ mov r2, #0
+ mov r3, #4096
bl build_pagetables
- /* Create the kernel map to jump to */
+ /*
+ * Next we do 64MiB starting at the physical load address, mapped to
+ * the VA the kernel is linked for.
+ */
mov r1, r5
ldr r2, =(KERNVIRTADDR)
+ mov r3, #64
bl build_pagetables
+ /* Create a device mapping for early_printf if specified. */
#if defined(SOCDEV_PA) && defined(SOCDEV_VA)
- /* Create the custom map used for early_printf(). */
ldr r1, =SOCDEV_PA
ldr r2, =SOCDEV_VA
- bl build_pagetables
+ mov r3, #1
+ bl build_device_pagetables
#endif
bl init_mmu
- /* Switch to virtual addresses. */
+ /* Transition the PC from physical to virtual addressing. */
ldr pc, =1f
1:
- /* Setup stack, clear BSS */
+ /* Setup stack, clear BSS */
ldr r1, =.Lstart
ldmia r1, {r1, r2, sp} /* Set initial stack and */
add sp, sp, #INIT_ARM_STACK_SIZE
- sub r2, r2, r1 /* get zero init data */
+ sub r2, r2, r1 /* get zero init data */
mov r3, #0
2:
str r3, [r1], #0x0004 /* get zero init data */
- subs r2, r2, #4
+ subs r2, r2, #4
bgt 2b
- mov r1, #28 /* loader info size is 28 bytes also second arg */
- subs sp, sp, r1 /* allocate arm_boot_params struct on stack */
- mov r0, sp /* loader info pointer is first arg */
- bic sp, sp, #7 /* align stack to 8 bytes */
- str r1, [r0] /* Store length of loader info */
+ mov r1, #28 /* loader info size is 28 bytes also second arg */
+ subs sp, sp, r1 /* allocate arm_boot_params struct on stack */
+ mov r0, sp /* loader info pointer is first arg */
+ bic sp, sp, #7 /* align stack to 8 bytes */
+ str r1, [r0] /* Store length of loader info */
str r8, [r0, #4] /* Store r0 from boot loader */
str r9, [r0, #8] /* Store r1 from boot loader */
str r10, [r0, #12] /* store r2 from boot loader */
str r11, [r0, #16] /* store r3 from boot loader */
str r5, [r0, #20] /* store the physical address */
- adr r4, Lpagetable /* load the pagetable address */
+ adr r4, Lpagetable /* load the pagetable address */
ldr r5, [r4, #4]
str r5, [r0, #24] /* store the pagetable address */
mov fp, #0 /* trace back starts here */
bl _C_LABEL(initarm) /* Off we go */
- /* init arm will return the new stack pointer. */
+ /* init arm will return the new stack pointer. */
mov sp, r0
- bl _C_LABEL(mi_startup) /* call mi_startup()! */
+ bl _C_LABEL(mi_startup) /* call mi_startup()! */
ldr r0, =.Lmainreturned
b _C_LABEL(panic)
@@ -219,8 +233,8 @@ translate_va_to_pa:
mov pc, lr
/*
- * Init MMU
- * r0 - The table base address
+ * Init MMU
+ * r0 - the table base address
*/
ASENTRY_NP(init_mmu)
@@ -261,17 +275,19 @@ ASENTRY_NP(init_mmu)
ISB
mcr CP15_TLBIALL /* Flush TLB */
mcr CP15_BPIALL /* Flush Branch predictor */
+ DSB
ISB
+
mov pc, lr
END(init_mmu)
/*
- * Init SMP coherent mode, enable caching and switch to final MMU table.
- * Called with disabled caches
- * r0 - The table base address
- * r1 - clear bits for aux register
- * r2 - set bits for aux register
+ * Init SMP coherent mode, enable caching and switch to final MMU table.
+ * Called with disabled caches
+ * r0 - The table base address
+ * r1 - clear bits for aux register
+ * r2 - set bits for aux register
*/
ASENTRY_NP(reinit_mmu)
push {r4-r11, lr}
@@ -289,6 +305,7 @@ ASENTRY_NP(reinit_mmu)
bl dcache_inv_pou_all
#endif
mcr CP15_ICIALLU
+ DSB
ISB
/* Set auxiliary register */
@@ -297,6 +314,7 @@ ASENTRY_NP(reinit_mmu)
eor r8, r8, r6 /* Set bits */
teq r7, r8
mcrne CP15_ACTLR(r8)
+ DSB
ISB
/* Enable caches. */
@@ -311,8 +329,8 @@ ASENTRY_NP(reinit_mmu)
DSB
ISB
- /* Flush all TLBs */
- mcr CP15_TLBIALL
+ mcr CP15_TLBIALL /* Flush TLB */
+ mcr CP15_BPIALL /* Flush Branch predictor */
DSB
ISB
@@ -323,6 +341,7 @@ ASENTRY_NP(reinit_mmu)
bl dcache_inv_pou_all
#endif
mcr CP15_ICIALLU
+ DSB
ISB
pop {r4-r11, pc}
@@ -331,14 +350,23 @@ END(reinit_mmu)
/*
* Builds the page table
- * r0 - The table base address
- * r1 - The physical address (trashed)
- * r2 - The virtual address (trashed)
- * r3 - The number of 1MiB sections
- * r4 - Trashed
+ * r0 - The table base address
+ * r1 - The physical address (trashed)
+ * r2 - The virtual address (trashed)
+ * r3 - The number of 1MiB sections
+ * r4 - Trashed
*
* Addresses must be 1MiB aligned
*/
+build_device_pagetables:
+#if defined(ARM_NEW_PMAP)
+ ldr r4, =PTE1_V|PTE1_A|PTE1_AP_KRW|TEX1_CLASS_0
+#elif defined(SMP)
+ ldr r4, =(L1_TYPE_S|L1_S_AP(AP_KRW)|L1_SHARED)
+#else
+ ldr r4, =(L1_TYPE_S|L1_S_AP(AP_KRW))
+#endif
+ b 1f
build_pagetables:
/* Set the required page attributed */
#if defined(ARM_NEW_PMAP)
@@ -348,18 +376,19 @@ build_pagetables:
#else
ldr r4, =(L1_TYPE_S|L1_S_C|L1_S_AP(AP_KRW))
#endif
+1:
orr r1, r4
- /* Move the virtual address to the correct bit location */
+ /* Move the virtual address to the correct bit location */
lsr r2, #(PTE1_SHIFT - 2)
mov r4, r3
-1:
+2:
str r1, [r0, r2]
- add r2, r2, #4
- add r1, r1, #(PTE1_SIZE)
- adds r4, r4, #-1
- bhi 1b
+ add r2, r2, #4
+ add r1, r1, #(PTE1_SIZE)
+ adds r4, r4, #-1
+ bhi 2b
mov pc, lr
@@ -372,7 +401,7 @@ VA_TO_PA_POINTER(Lpagetable, boot_pt1)
.word svcstk /* must remain in order together. */
.Lmainreturned:
- .asciz "main() returned"
+ .asciz "main() returned"
.align 2
.bss
@@ -380,8 +409,8 @@ svcstk:
.space INIT_ARM_STACK_SIZE * MAXCPU
/*
- * Memory for the initial pagetable. We are unable to place this in
- * the bss as this will be cleared after the table is loaded.
+ * Memory for the initial pagetable. We are unable to place this in
+ * the bss as this will be cleared after the table is loaded.
*/
.section ".init_pagetable"
.align 14 /* 16KiB aligned */
@@ -398,7 +427,7 @@ boot_pt1:
#if defined(SMP)
ASENTRY_NP(mpentry)
- /* Make sure interrupts are disabled. */
+ /* Make sure interrupts are disabled. */
cpsid ifa
/* Setup core, disable all caches. */
@@ -412,17 +441,19 @@ ASENTRY_NP(mpentry)
orr r0, #CPU_CONTROL_AFLT_ENABLE
orr r0, #CPU_CONTROL_VECRELOC
mcr CP15_SCTLR(r0)
+ DSB
ISB
/* Invalidate L1 cache I+D cache */
bl dcache_inv_pou_all
mcr CP15_ICIALLU
+ DSB
ISB
- /* Find the delta between VA and PA */
+ /* Find the delta between VA and PA */
adr r0, Lpagetable
bl translate_va_to_pa
-
+
bl init_mmu
adr r1, .Lstart+8 /* Get initstack pointer from */
@@ -433,7 +464,7 @@ ASENTRY_NP(mpentry)
mul r2, r1, r0 /* Point sp to initstack */
add sp, sp, r2 /* area for this processor. */
- /* Switch to virtual addresses. */
+ /* Switch to virtual addresses. */
ldr pc, =1f
1:
mov fp, #0 /* trace back starts here */
@@ -459,14 +490,14 @@ ENTRY_NP(cpu_halt)
ldr r4, [r4]
teq r4, #0
movne pc, r4
-1:
+1:
WFI
b 1b
/*
* _cpu_reset_address contains the address to branch to, to complete
* the cpu reset after turning the MMU off
- * This variable is provided by the hardware specific code
+ * This variable is provided by the hardware specific code
*/
.Lcpu_reset_address:
.word _C_LABEL(cpu_reset_address)
@@ -498,38 +529,37 @@ END(abort)
ENTRY_NP(sigcode)
mov r0, sp
- add r0, r0, #SIGF_UC
+ add r0, r0, #SIGF_UC
/*
- * Call the sigreturn system call.
+ * Call the sigreturn system call.
*
* We have to load r7 manually rather than using
- * "ldr r7, =SYS_sigreturn" to ensure the value of szsigcode is
+ * "ldr r7, =SYS_sigreturn" to ensure the value of szsigcode is
* correct. Using the alternative places esigcode at the address
- * of the data rather than the address one past the data.
+ * of the data rather than the address one past the data.
*/
- ldr r7, [pc, #12] /* Load SYS_sigreturn */
+ ldr r7, [pc, #12] /* Load SYS_sigreturn */
swi SYS_sigreturn
- /* Well if that failed we better exit quick ! */
+ /* Well if that failed we better exit quick ! */
- ldr r7, [pc, #8] /* Load SYS_exit */
+ ldr r7, [pc, #8] /* Load SYS_exit */
swi SYS_exit
- /* Branch back to retry SYS_sigreturn */
+ /* Branch back to retry SYS_sigreturn */
b . - 16
END(sigcode)
-
.word SYS_sigreturn
.word SYS_exit
.align 2
- .global _C_LABEL(esigcode)
+ .global _C_LABEL(esigcode)
_C_LABEL(esigcode):
.data
- .global szsigcode
+ .global szsigcode
szsigcode:
.long esigcode-sigcode
diff --git a/sys/arm/arm/machdep.c b/sys/arm/arm/machdep.c
index 66dae32..443cc5b 100644
--- a/sys/arm/arm/machdep.c
+++ b/sys/arm/arm/machdep.c
@@ -826,13 +826,15 @@ fake_preload_metadata(struct arm_boot_params *abp __unused)
fake_preload[i] = 0;
preload_metadata = (void *)fake_preload;
+ init_static_kenv(NULL, 0);
+
return (lastaddr);
}
void
pcpu0_init(void)
{
-#if ARM_ARCH_6 || ARM_ARCH_7A || defined(CPU_MV_PJ4B)
+#if __ARM_ARCH >= 6
set_curthread(&thread0);
#endif
pcpu_init(pcpup, 0, sizeof(struct pcpu));
@@ -901,6 +903,8 @@ linux_parse_boot_param(struct arm_boot_params *abp)
bcopy(atag_list, atags,
(char *)walker - (char *)atag_list + ATAG_SIZE(walker));
+ init_static_kenv(NULL, 0);
+
return fake_preload_metadata(abp);
}
#endif
@@ -929,7 +933,7 @@ freebsd_parse_boot_param(struct arm_boot_params *abp)
return 0;
boothowto = MD_FETCH(kmdp, MODINFOMD_HOWTO, int);
- kern_envp = MD_FETCH(kmdp, MODINFOMD_ENVP, char *);
+ init_static_kenv(MD_FETCH(kmdp, MODINFOMD_ENVP, char *), 0);
lastaddr = MD_FETCH(kmdp, MODINFOMD_KERNEND, vm_offset_t);
#ifdef DDB
ksym_start = MD_FETCH(kmdp, MODINFOMD_SSYM, uintptr_t);
diff --git a/sys/arm/arm/physmem.c b/sys/arm/arm/physmem.c
index bc72ce2..8c41fbb 100644
--- a/sys/arm/arm/physmem.c
+++ b/sys/arm/arm/physmem.c
@@ -161,7 +161,7 @@ static size_t
regions_to_avail(vm_paddr_t *avail, uint32_t exflags, long *pavail)
{
size_t acnt, exi, hwi;
- vm_paddr_t end, start, xend, xstart;
+ uint64_t end, start, xend, xstart;
long availmem;
const struct region *exp, *hwp;
@@ -171,7 +171,7 @@ regions_to_avail(vm_paddr_t *avail, uint32_t exflags, long *pavail)
for (hwi = 0, hwp = hwregions; hwi < hwcnt; ++hwi, ++hwp) {
start = hwp->addr;
end = hwp->size + start;
- realmem += arm32_btop(end - start);
+ realmem += arm32_btop((vm_offset_t)(end - start));
for (exi = 0, exp = exregions; exi < excnt; ++exi, ++exp) {
/*
* If the excluded region does not match given flags,
@@ -212,9 +212,10 @@ regions_to_avail(vm_paddr_t *avail, uint32_t exflags, long *pavail)
* could affect the remainder of this hw region.
*/
if ((xstart > start) && (xend < end)) {
- avail[acnt++] = start;
- avail[acnt++] = xstart;
- availmem += arm32_btop(xstart - start);
+ avail[acnt++] = (vm_paddr_t)start;
+ avail[acnt++] = (vm_paddr_t)xstart;
+ availmem +=
+ arm32_btop((vm_offset_t)(xstart - start));
start = xend;
continue;
}
@@ -233,9 +234,9 @@ regions_to_avail(vm_paddr_t *avail, uint32_t exflags, long *pavail)
* available entry for it.
*/
if (end > start) {
- avail[acnt++] = start;
- avail[acnt++] = end;
- availmem += arm32_btop(end - start);
+ avail[acnt++] = (vm_paddr_t)start;
+ avail[acnt++] = (vm_paddr_t)end;
+ availmem += arm32_btop((vm_offset_t)(end - start));
}
if (acnt >= MAX_AVAIL_ENTRIES)
panic("Not enough space in the dump/phys_avail arrays");
@@ -279,10 +280,22 @@ arm_physmem_hardware_region(vm_paddr_t pa, vm_size_t sz)
/*
* Filter out the page at PA 0x00000000. The VM can't handle it, as
* pmap_extract() == 0 means failure.
+ *
+ * Also filter out the page at the end of the physical address space --
+ * if addr is non-zero and addr+size is zero we wrapped to the next byte
+ * beyond what vm_paddr_t can express. That leads to a NULL pointer
+ * deref early in startup; work around it by leaving the last page out.
+ *
+ * XXX This just in: subtract out a whole megabyte, not just 1 page.
+ * Reducing the size by anything less than 1MB results in the NULL
+ * pointer deref in _vm_map_lock_read(). Better to give up a megabyte
+ * than leave some folks with an unusable system while we investigate.
*/
if (pa == 0) {
pa = PAGE_SIZE;
sz -= PAGE_SIZE;
+ } else if (pa + sz == 0) {
+ sz -= 1024 * 1024;
}
/*
diff --git a/sys/arm/arm/trap.c b/sys/arm/arm/trap.c
index 82d2f0f..726b718 100644
--- a/sys/arm/arm/trap.c
+++ b/sys/arm/arm/trap.c
@@ -95,6 +95,7 @@ __FBSDID("$FreeBSD$");
#include <vm/vm_map.h>
#include <vm/vm_extern.h>
+#include <machine/acle-compat.h>
#include <machine/cpu.h>
#include <machine/frame.h>
#include <machine/machdep.h>
@@ -322,7 +323,7 @@ abort_handler(struct trapframe *tf, int type)
* location, so we can deal with those quickly. Otherwise we need to
* disassemble the faulting instruction to determine if it was a write.
*/
-#if ARM_ARCH_6 || ARM_ARCH_7A
+#if __ARM_ARCH >= 6
ftype = (fsr & FAULT_WNR) ? VM_PROT_READ | VM_PROT_WRITE : VM_PROT_READ;
#else
if (IS_PERMISSION_FAULT(fsr))
diff --git a/sys/arm/at91/at91_mci.c b/sys/arm/at91/at91_mci.c
index 5d58228..a506715 100644
--- a/sys/arm/at91/at91_mci.c
+++ b/sys/arm/at91/at91_mci.c
@@ -446,6 +446,9 @@ at91_mci_attach(device_t dev)
CTLFLAG_RW, &sc->allow_overclock, 0,
"Allow up to 30MHz clock for 25MHz request when next highest speed 15MHz or less.");
+ SYSCTL_ADD_UINT(sctx, SYSCTL_CHILDREN(soid), OID_AUTO, "debug",
+ CTLFLAG_RWTUN, &mci_debug, 0, "enable debug output");
+
/*
* Our real min freq is master_clock/512, but upper driver layers are
* going to set the min speed during card discovery, and the right speed
@@ -783,15 +786,6 @@ at91_mci_start_cmd(struct at91_mci_softc *sc, struct mmc_command *cmd)
WR4(sc, PDC_PTCR, PDC_PTCR_RXTEN);
} else {
len = min(BBSIZE, remaining);
- /*
- * If this is MCI1 revision 2xx controller, apply
- * a work-around for the "Data Write Operation and
- * number of bytes" erratum.
- */
- if ((sc->sc_cap & CAP_MCI1_REV2XX) && len < 12) {
- len = 12;
- memset(sc->bbuf_vaddr[0], 0, 12);
- }
at91_bswap_buf(sc, sc->bbuf_vaddr[0], data->data, len);
err = bus_dmamap_load(sc->dmatag, sc->bbuf_map[0],
sc->bbuf_vaddr[0], len, at91_mci_getaddr,
@@ -800,8 +794,13 @@ at91_mci_start_cmd(struct at91_mci_softc *sc, struct mmc_command *cmd)
panic("IO write dmamap_load failed\n");
bus_dmamap_sync(sc->dmatag, sc->bbuf_map[0],
BUS_DMASYNC_PREWRITE);
+ /*
+ * Erratum workaround: PDC transfer length on a write
+ * must not be smaller than 12 bytes (3 words); only
+ * blklen bytes (set above) are actually transferred.
+ */
WR4(sc, PDC_TPR,paddr);
- WR4(sc, PDC_TCR, len / 4);
+ WR4(sc, PDC_TCR, (len < 12) ? 3 : len / 4);
sc->bbuf_len[0] = len;
remaining -= len;
if (remaining == 0) {
@@ -818,7 +817,7 @@ at91_mci_start_cmd(struct at91_mci_softc *sc, struct mmc_command *cmd)
bus_dmamap_sync(sc->dmatag, sc->bbuf_map[1],
BUS_DMASYNC_PREWRITE);
WR4(sc, PDC_TNPR, paddr);
- WR4(sc, PDC_TNCR, len / 4);
+ WR4(sc, PDC_TNCR, (len < 12) ? 3 : len / 4);
sc->bbuf_len[1] = len;
remaining -= len;
}
diff --git a/sys/arm/freescale/imx/imx6_anatop.c b/sys/arm/freescale/imx/imx6_anatop.c
index e7abb9e..d38d432 100644
--- a/sys/arm/freescale/imx/imx6_anatop.c
+++ b/sys/arm/freescale/imx/imx6_anatop.c
@@ -73,11 +73,10 @@ __FBSDID("$FreeBSD$");
#include <arm/freescale/fsl_ocotpreg.h>
#include <arm/freescale/fsl_ocotpvar.h>
#include <arm/freescale/imx/imx_ccmvar.h>
+#include <arm/freescale/imx/imx_machdep.h>
#include <arm/freescale/imx/imx6_anatopreg.h>
#include <arm/freescale/imx/imx6_anatopvar.h>
-static SYSCTL_NODE(_hw, OID_AUTO, imx6, CTLFLAG_RW, NULL, "i.MX6 container");
-
static struct resource_spec imx6_anatop_spec[] = {
{ SYS_RES_MEMORY, 0, RF_ACTIVE },
{ SYS_RES_IRQ, 0, RF_ACTIVE },
@@ -396,23 +395,23 @@ cpufreq_initialize(struct imx6_anatop_softc *sc)
uint32_t cfg3speed;
struct oppt * op;
- SYSCTL_ADD_INT(NULL, SYSCTL_STATIC_CHILDREN(_hw_imx6),
+ SYSCTL_ADD_INT(NULL, SYSCTL_STATIC_CHILDREN(_hw_imx),
OID_AUTO, "cpu_mhz", CTLFLAG_RD, &sc->cpu_curmhz, 0,
"CPU frequency");
- SYSCTL_ADD_PROC(NULL, SYSCTL_STATIC_CHILDREN(_hw_imx6),
+ SYSCTL_ADD_PROC(NULL, SYSCTL_STATIC_CHILDREN(_hw_imx),
OID_AUTO, "cpu_minmhz", CTLTYPE_INT | CTLFLAG_RWTUN, sc, 0,
cpufreq_sysctl_minmhz, "IU", "Minimum CPU frequency");
- SYSCTL_ADD_PROC(NULL, SYSCTL_STATIC_CHILDREN(_hw_imx6),
+ SYSCTL_ADD_PROC(NULL, SYSCTL_STATIC_CHILDREN(_hw_imx),
OID_AUTO, "cpu_maxmhz", CTLTYPE_INT | CTLFLAG_RWTUN, sc, 0,
cpufreq_sysctl_maxmhz, "IU", "Maximum CPU frequency");
- SYSCTL_ADD_INT(NULL, SYSCTL_STATIC_CHILDREN(_hw_imx6),
+ SYSCTL_ADD_INT(NULL, SYSCTL_STATIC_CHILDREN(_hw_imx),
OID_AUTO, "cpu_maxmhz_hw", CTLFLAG_RD, &sc->cpu_maxmhz_hw, 0,
"Maximum CPU frequency allowed by hardware");
- SYSCTL_ADD_INT(NULL, SYSCTL_STATIC_CHILDREN(_hw_imx6),
+ SYSCTL_ADD_INT(NULL, SYSCTL_STATIC_CHILDREN(_hw_imx),
OID_AUTO, "cpu_overclock_enable", CTLFLAG_RWTUN,
&sc->cpu_overclock_enable, 0,
"Allow setting CPU frequency higher than cpu_maxmhz_hw");
@@ -630,10 +629,10 @@ initialize_tempmon(struct imx6_anatop_softc *sc)
callout_reset_sbt(&sc->temp_throttle_callout, sc->temp_throttle_delay,
0, tempmon_throttle_check, sc, 0);
- SYSCTL_ADD_PROC(NULL, SYSCTL_STATIC_CHILDREN(_hw_imx6),
+ SYSCTL_ADD_PROC(NULL, SYSCTL_STATIC_CHILDREN(_hw_imx),
OID_AUTO, "temperature", CTLTYPE_INT | CTLFLAG_RD, sc, 0,
temp_sysctl_handler, "IK", "Current die temperature");
- SYSCTL_ADD_PROC(NULL, SYSCTL_STATIC_CHILDREN(_hw_imx6),
+ SYSCTL_ADD_PROC(NULL, SYSCTL_STATIC_CHILDREN(_hw_imx),
OID_AUTO, "throttle_temperature", CTLTYPE_INT | CTLFLAG_RW, sc,
0, temp_throttle_sysctl_handler, "IK",
"Throttle CPU when exceeding this temperature");
diff --git a/sys/arm/freescale/imx/imx6_machdep.c b/sys/arm/freescale/imx/imx6_machdep.c
index 2335f7d..a5539ea 100644
--- a/sys/arm/freescale/imx/imx6_machdep.c
+++ b/sys/arm/freescale/imx/imx6_machdep.c
@@ -99,7 +99,6 @@ initarm_lastaddr(void)
void
initarm_early_init(void)
{
-
/* Inform the MPCore timer driver that its clock is variable. */
arm_tmr_change_frequency(ARM_TMR_FREQUENCY_VARIES);
}
@@ -113,6 +112,9 @@ initarm_gpio_init(void)
void
initarm_late_init(void)
{
+ const uint32_t IMX6_WDOG_SR_PHYS = 0x020bc004;
+
+ imx_wdog_init_last_reset(IMX6_WDOG_SR_PHYS);
/* Cache the gpio1 node handle for imx6_decode_fdt() workaround code. */
gpio1_node = OF_node_from_xref(
diff --git a/sys/arm/freescale/imx/imx_machdep.c b/sys/arm/freescale/imx/imx_machdep.c
index 3618637..002651a 100644
--- a/sys/arm/freescale/imx/imx_machdep.c
+++ b/sys/arm/freescale/imx/imx_machdep.c
@@ -45,6 +45,15 @@ __FBSDID("$FreeBSD$");
#include <arm/freescale/imx/imx_machdep.h>
#include <arm/freescale/imx/imx_wdogreg.h>
+SYSCTL_NODE(_hw, OID_AUTO, imx, CTLFLAG_RW, NULL, "i.MX container");
+
+static int last_reset_status;
+SYSCTL_UINT(_hw_imx, OID_AUTO, last_reset_status, CTLFLAG_RD,
+ &last_reset_status, 0, "Last reset status register");
+
+SYSCTL_STRING(_hw_imx, OID_AUTO, last_reset_reason, CTLFLAG_RD,
+ "unknown", 0, "Last reset reason");
+
struct arm32_dma_range *
bus_dma_get_range(void)
{
@@ -72,21 +81,36 @@ imx_wdog_cpu_reset(vm_offset_t wdcr_physaddr)
volatile uint16_t * pcr;
/*
- * The deceptively simple write of WDOG_CR_WDE enables the watchdog,
- * sets the timeout to its minimum value (half a second), and also
- * clears the SRS bit which results in the SFTW (software-requested
- * reset) bit being set in the watchdog status register after the reset.
- * This is how software can distinguish a reset from a wdog timeout.
+ * Trigger an immediate reset by clearing the SRS bit in the watchdog
+ * control register. The reset happens on the next cycle of the wdog
+ * 32KHz clock, so hang out in a spin loop until the reset takes effect.
*/
if ((pcr = arm_devmap_ptov(wdcr_physaddr, sizeof(*pcr))) == NULL) {
printf("cpu_reset() can't find its control register... locking up now.");
} else {
- *pcr = WDOG_CR_WDE;
+ *pcr &= ~WDOG_CR_SRS;
}
for (;;)
continue;
}
+void
+imx_wdog_init_last_reset(vm_offset_t wdsr_phys)
+{
+ volatile uint16_t * psr;
+
+ if ((psr = arm_devmap_ptov(wdsr_phys, sizeof(*psr))) == NULL)
+ return;
+ last_reset_status = *psr;
+ if (last_reset_status & WDOG_RSR_SFTW) {
+ sysctl___hw_imx_last_reset_reason.oid_arg1 = "SoftwareReset";
+ } else if (last_reset_status & WDOG_RSR_TOUT) {
+ sysctl___hw_imx_last_reset_reason.oid_arg1 = "WatchdogTimeout";
+ } else if (last_reset_status & WDOG_RSR_POR) {
+ sysctl___hw_imx_last_reset_reason.oid_arg1 = "PowerOnReset";
+ }
+}
+
u_int
imx_soc_family(void)
{
diff --git a/sys/arm/freescale/imx/imx_machdep.h b/sys/arm/freescale/imx/imx_machdep.h
index 6909e51..2bb8bb3 100644
--- a/sys/arm/freescale/imx/imx_machdep.h
+++ b/sys/arm/freescale/imx/imx_machdep.h
@@ -30,10 +30,14 @@
#define IMX_MACHDEP_H
#include <sys/types.h>
+#include <sys/sysctl.h>
+
+SYSCTL_DECL(_hw_imx);
/* Common functions, implemented in imx_machdep.c. */
void imx_wdog_cpu_reset(vm_offset_t _wdcr_phys) __attribute__((__noreturn__));
+void imx_wdog_init_last_reset(vm_offset_t _wdsr_phys);
/* From here down, routines are implemented in imxNN_machdep.c. */
diff --git a/sys/arm/freescale/imx/imx_sdhci.c b/sys/arm/freescale/imx/imx_sdhci.c
index 7d982c5..98d5e23 100644
--- a/sys/arm/freescale/imx/imx_sdhci.c
+++ b/sys/arm/freescale/imx/imx_sdhci.c
@@ -429,6 +429,7 @@ imx_sdhci_write_2(device_t dev, struct sdhci_slot *slot, bus_size_t off, uint16_
} else {
imx_sdhc_set_clock(sc, false);
}
+ return;
}
/*
@@ -522,12 +523,19 @@ imx_sdhc_set_clock(struct imx_sdhci_softc *sc, int enable)
else
freq = sc->baseclk_hz / (2 * divisor);
- for (prescale = 2; prescale < freq / prescale / 16;)
+ for (prescale = 2; freq < sc->baseclk_hz / (prescale * 16);)
prescale <<= 1;
- for (divisor = 1; freq < freq / prescale / divisor;)
+ for (divisor = 1; freq < sc->baseclk_hz / (prescale * divisor);)
++divisor;
+#ifdef DEBUG
+ device_printf(sc->dev,
+ "desired SD freq: %d, actual: %d; base %d prescale %d divisor %d\n",
+ freq, sc->baseclk_hz / (prescale * divisor), sc->baseclk_hz,
+ prescale, divisor);
+#endif
+
prescale >>= 1;
divisor -= 1;
diff --git a/sys/arm/freescale/imx/imx_wdogreg.h b/sys/arm/freescale/imx/imx_wdogreg.h
index 1bff106..030cee8 100644
--- a/sys/arm/freescale/imx/imx_wdogreg.h
+++ b/sys/arm/freescale/imx/imx_wdogreg.h
@@ -47,6 +47,7 @@
#define WDOG_SR_STEP2 0xaaaa
#define WDOG_RSR_REG 0x04 /* Reset Status Register */
+#define WDOG_RSR_POR (1 << 4) /* Due to Power-On Reset */
#define WDOG_RSR_TOUT (1 << 1) /* Due WDog timeout reset */
#define WDOG_RSR_SFTW (1 << 0) /* Due Soft reset */
diff --git a/sys/arm/mv/std-pj4b.mv b/sys/arm/mv/std-pj4b.mv
index 1053ff0..cc14abc 100644
--- a/sys/arm/mv/std-pj4b.mv
+++ b/sys/arm/mv/std-pj4b.mv
@@ -5,4 +5,8 @@ cpu CPU_MV_PJ4B
machine arm armv6
makeoptions CONF_CFLAGS="-march=armv7a -Wa,-march=armv7a"
-options VM_MAXUSER_ADDRESS="(KERNBASE-(1024*1024*1024))"
+# This was originally defined as "(KERNBASE-(1024*1024*1024))" but that
+# (in opt_global.h) clashed with the value emitted by genassym which
+# reduces the original macro text to its numeric value. The only way
+# to avoid that is to define it here as the numeric value genassym emits.
+options VM_MAXUSER_ADDRESS="0x80000000"
diff --git a/sys/arm/xscale/ixp425/avila_machdep.c b/sys/arm/xscale/ixp425/avila_machdep.c
index b1d6734..e72798a 100644
--- a/sys/arm/xscale/ixp425/avila_machdep.c
+++ b/sys/arm/xscale/ixp425/avila_machdep.c
@@ -223,8 +223,8 @@ initarm(struct arm_boot_params *abp)
pcpu_init(pcpup, 0, sizeof(struct pcpu));
PCPU_SET(curthread, &thread0);
- if (envmode == 1)
- kern_envp = static_env;
+ init_static_kenv(NULL, 0);
+
/* Do basic tuning, hz etc */
init_param1();
@@ -420,10 +420,6 @@ initarm(struct arm_boot_params *abp)
init_param2(physmem);
kdb_init();
- /* use static kernel environment if so configured */
- if (envmode == 1)
- kern_envp = static_env;
-
return ((void *)(kernelstack.pv_va + USPACE_SVC_STACK_TOP -
sizeof(struct pcb)));
#undef next_page
diff --git a/sys/boot/common/bootstrap.h b/sys/boot/common/bootstrap.h
index c9bcc52..de77c7b 100644
--- a/sys/boot/common/bootstrap.h
+++ b/sys/boot/common/bootstrap.h
@@ -231,9 +231,9 @@ int mod_load(char *name, struct mod_depend *verinfo, int argc, char *argv[]);
int mod_loadkld(const char *name, int argc, char *argv[]);
struct preloaded_file *file_alloc(void);
-struct preloaded_file *file_findfile(char *name, char *type);
+struct preloaded_file *file_findfile(const char *name, const char *type);
struct file_metadata *file_findmetadata(struct preloaded_file *fp, int type);
-struct preloaded_file *file_loadraw(char *name, char *type);
+struct preloaded_file *file_loadraw(char *name, char *type, int insert);
void file_discard(struct preloaded_file *fp);
void file_addmetadata(struct preloaded_file *fp, int type, size_t size, void *p);
int file_addmodule(struct preloaded_file *fp, char *modname, int version,
@@ -257,6 +257,9 @@ int __elfN(obj_loadfile)(char *filename, u_int64_t dest,
int __elfN(reloc)(struct elf_file *ef, symaddr_fn *symaddr,
const void *reldata, int reltype, Elf_Addr relbase,
Elf_Addr dataaddr, void *data, size_t len);
+int __elfN(loadfile_raw)(char *filename, u_int64_t dest,
+ struct preloaded_file **result, int multiboot);
+int __elfN(load_modmetadata)(struct preloaded_file *fp, u_int64_t dest);
#endif
/*
diff --git a/sys/boot/common/load_elf.c b/sys/boot/common/load_elf.c
index edbad05..200a29c 100644
--- a/sys/boot/common/load_elf.c
+++ b/sys/boot/common/load_elf.c
@@ -76,7 +76,8 @@ static int __elfN(loadimage)(struct preloaded_file *mp, elf_file_t ef, u_int64_t
static int __elfN(lookup_symbol)(struct preloaded_file *mp, elf_file_t ef, const char* name, Elf_Sym* sym);
static int __elfN(reloc_ptr)(struct preloaded_file *mp, elf_file_t ef,
Elf_Addr p, void *val, size_t len);
-static int __elfN(parse_modmetadata)(struct preloaded_file *mp, elf_file_t ef);
+static int __elfN(parse_modmetadata)(struct preloaded_file *mp, elf_file_t ef,
+ Elf_Addr p_start, Elf_Addr p_end);
static symaddr_fn __elfN(symaddr);
static char *fake_modname(const char *name);
@@ -85,6 +86,61 @@ const char *__elfN(moduletype) = "elf module";
u_int64_t __elfN(relocation_offset) = 0;
+static int
+__elfN(load_elf_header)(char *filename, elf_file_t ef)
+{
+ ssize_t bytes_read;
+ Elf_Ehdr *ehdr;
+ int err;
+
+ /*
+ * Open the image, read and validate the ELF header
+ */
+ if (filename == NULL) /* can't handle nameless */
+ return (EFTYPE);
+ if ((ef->fd = open(filename, O_RDONLY)) == -1)
+ return (errno);
+ ef->firstpage = malloc(PAGE_SIZE);
+ if (ef->firstpage == NULL) {
+ close(ef->fd);
+ return (ENOMEM);
+ }
+ bytes_read = read(ef->fd, ef->firstpage, PAGE_SIZE);
+ ef->firstlen = (size_t)bytes_read;
+ if (bytes_read < 0 || ef->firstlen <= sizeof(Elf_Ehdr)) {
+ err = EFTYPE; /* could be EIO, but may be small file */
+ goto error;
+ }
+ ehdr = ef->ehdr = (Elf_Ehdr *)ef->firstpage;
+
+ /* Is it ELF? */
+ if (!IS_ELF(*ehdr)) {
+ err = EFTYPE;
+ goto error;
+ }
+ if (ehdr->e_ident[EI_CLASS] != ELF_TARG_CLASS || /* Layout ? */
+ ehdr->e_ident[EI_DATA] != ELF_TARG_DATA ||
+ ehdr->e_ident[EI_VERSION] != EV_CURRENT || /* Version ? */
+ ehdr->e_version != EV_CURRENT ||
+ ehdr->e_machine != ELF_TARG_MACH) { /* Machine ? */
+ err = EFTYPE;
+ goto error;
+ }
+
+ return (0);
+
+error:
+ if (ef->firstpage != NULL) {
+ free(ef->firstpage);
+ ef->firstpage = NULL;
+ }
+ if (ef->fd != -1) {
+ close(ef->fd);
+ ef->fd = -1;
+ }
+ return (err);
+}
+
/*
* Attempt to load the file (file) as an ELF module. It will be stored at
* (dest), and a pointer to a module structure describing the loaded object
@@ -93,54 +149,32 @@ u_int64_t __elfN(relocation_offset) = 0;
int
__elfN(loadfile)(char *filename, u_int64_t dest, struct preloaded_file **result)
{
+ return (__elfN(loadfile_raw)(filename, dest, result, 0));
+}
+
+int
+__elfN(loadfile_raw)(char *filename, u_int64_t dest,
+ struct preloaded_file **result, int multiboot)
+{
struct preloaded_file *fp, *kfp;
struct elf_file ef;
Elf_Ehdr *ehdr;
int err;
- ssize_t bytes_read;
fp = NULL;
bzero(&ef, sizeof(struct elf_file));
+ ef.fd = -1;
- /*
- * Open the image, read and validate the ELF header
- */
- if (filename == NULL) /* can't handle nameless */
- return(EFTYPE);
- if ((ef.fd = open(filename, O_RDONLY)) == -1)
- return(errno);
- ef.firstpage = malloc(PAGE_SIZE);
- if (ef.firstpage == NULL) {
- close(ef.fd);
- return(ENOMEM);
- }
- bytes_read = read(ef.fd, ef.firstpage, PAGE_SIZE);
- ef.firstlen = (size_t)bytes_read;
- if (bytes_read < 0 || ef.firstlen <= sizeof(Elf_Ehdr)) {
- err = EFTYPE; /* could be EIO, but may be small file */
- goto oerr;
- }
- ehdr = ef.ehdr = (Elf_Ehdr *)ef.firstpage;
-
- /* Is it ELF? */
- if (!IS_ELF(*ehdr)) {
- err = EFTYPE;
- goto oerr;
- }
- if (ehdr->e_ident[EI_CLASS] != ELF_TARG_CLASS || /* Layout ? */
- ehdr->e_ident[EI_DATA] != ELF_TARG_DATA ||
- ehdr->e_ident[EI_VERSION] != EV_CURRENT || /* Version ? */
- ehdr->e_version != EV_CURRENT ||
- ehdr->e_machine != ELF_TARG_MACH) { /* Machine ? */
- err = EFTYPE;
- goto oerr;
- }
+ err = __elfN(load_elf_header)(filename, &ef);
+ if (err != 0)
+ return (err);
+ ehdr = ef.ehdr;
/*
* Check to see what sort of module we are.
*/
- kfp = file_findfile(NULL, NULL);
+ kfp = file_findfile(NULL, __elfN(kerneltype));
#ifdef __powerpc__
/*
* Kernels can be ET_DYN, so just assume the first loaded object is the
@@ -177,6 +211,11 @@ __elfN(loadfile)(char *filename, u_int64_t dest, struct preloaded_file **result)
} else if (ehdr->e_type == ET_DYN) {
/* Looks like a kld module */
+ if (multiboot != 0) {
+ printf("elf" __XSTRING(__ELF_WORD_SIZE) "_loadfile: can't load module as multiboot\n");
+ err = EPERM;
+ goto oerr;
+ }
if (kfp == NULL) {
printf("elf" __XSTRING(__ELF_WORD_SIZE) "_loadfile: can't load module before kernel\n");
err = EPERM;
@@ -209,10 +248,14 @@ __elfN(loadfile)(char *filename, u_int64_t dest, struct preloaded_file **result)
err = EPERM;
goto out;
}
- if (ef.kernel)
+ if (ef.kernel == 1 && multiboot == 0)
setenv("kernelname", filename, 1);
fp->f_name = strdup(filename);
- fp->f_type = strdup(ef.kernel ? __elfN(kerneltype) : __elfN(moduletype));
+ if (multiboot == 0)
+ fp->f_type = strdup(ef.kernel ?
+ __elfN(kerneltype) : __elfN(moduletype));
+ else
+ fp->f_type = strdup("elf multiboot kernel");
#ifdef ELF_VERBOSE
if (ef.kernel)
@@ -240,7 +283,8 @@ __elfN(loadfile)(char *filename, u_int64_t dest, struct preloaded_file **result)
out:
if (ef.firstpage)
free(ef.firstpage);
- close(ef.fd);
+ if (ef.fd != -1)
+ close(ef.fd);
return(err);
}
@@ -269,6 +313,8 @@ __elfN(loadimage)(struct preloaded_file *fp, elf_file_t ef, u_int64_t off)
int symtabindex;
Elf_Size size;
u_int fpcopy;
+ Elf_Sym sym;
+ Elf_Addr p_start, p_end;
dp = NULL;
shdr = NULL;
@@ -571,7 +617,15 @@ nosyms:
COPYOUT(ef->hashtab + 1, &ef->nchains, sizeof(ef->nchains));
ef->buckets = ef->hashtab + 2;
ef->chains = ef->buckets + ef->nbuckets;
- if (__elfN(parse_modmetadata)(fp, ef) == 0)
+
+ if (__elfN(lookup_symbol)(fp, ef, "__start_set_modmetadata_set", &sym) != 0)
+ return 0;
+ p_start = sym.st_value + ef->off;
+ if (__elfN(lookup_symbol)(fp, ef, "__stop_set_modmetadata_set", &sym) != 0)
+ return ENOENT;
+ p_end = sym.st_value + ef->off;
+
+ if (__elfN(parse_modmetadata)(fp, ef, p_start, p_end) == 0)
goto out;
if (ef->kernel) /* kernel must not depend on anything */
@@ -634,7 +688,123 @@ struct mod_metadata32 {
#endif
int
-__elfN(parse_modmetadata)(struct preloaded_file *fp, elf_file_t ef)
+__elfN(load_modmetadata)(struct preloaded_file *fp, u_int64_t dest)
+{
+ struct elf_file ef;
+ int err, i, j;
+ Elf_Shdr *sh_meta, *shdr = NULL;
+ Elf_Shdr *sh_data[2];
+ char *shstrtab = NULL;
+ size_t size;
+ Elf_Addr p_start, p_end;
+
+ bzero(&ef, sizeof(struct elf_file));
+ ef.fd = -1;
+
+ err = __elfN(load_elf_header)(fp->f_name, &ef);
+ if (err != 0)
+ goto out;
+
+ if (ef.ehdr->e_type == ET_EXEC) {
+ ef.kernel = 1;
+ } else if (ef.ehdr->e_type != ET_DYN) {
+ err = EFTYPE;
+ goto out;
+ }
+
+ size = ef.ehdr->e_shnum * ef.ehdr->e_shentsize;
+ shdr = alloc_pread(ef.fd, ef.ehdr->e_shoff, size);
+ if (shdr == NULL) {
+ err = ENOMEM;
+ goto out;
+ }
+
+ /* Load shstrtab. */
+ shstrtab = alloc_pread(ef.fd, shdr[ef.ehdr->e_shstrndx].sh_offset,
+ shdr[ef.ehdr->e_shstrndx].sh_size);
+ if (shstrtab == NULL) {
+ printf("\nelf" __XSTRING(__ELF_WORD_SIZE)
+ "load_modmetadata: unable to load shstrtab\n");
+ err = EFTYPE;
+ goto out;
+ }
+
+ /* Find set_modmetadata_set and data sections. */
+ sh_data[0] = sh_data[1] = sh_meta = NULL;
+ for (i = 0, j = 0; i < ef.ehdr->e_shnum; i++) {
+ if (strcmp(&shstrtab[shdr[i].sh_name],
+ "set_modmetadata_set") == 0) {
+ sh_meta = &shdr[i];
+ }
+ if ((strcmp(&shstrtab[shdr[i].sh_name], ".data") == 0) ||
+ (strcmp(&shstrtab[shdr[i].sh_name], ".rodata") == 0)) {
+ sh_data[j++] = &shdr[i];
+ }
+ }
+ if (sh_meta == NULL || sh_data[0] == NULL || sh_data[1] == NULL) {
+ printf("\nelf" __XSTRING(__ELF_WORD_SIZE)
+ "load_modmetadata: unable to find set_modmetadata_set or data sections\n");
+ err = EFTYPE;
+ goto out;
+ }
+
+ /* Load set_modmetadata_set into memory */
+ err = kern_pread(ef.fd, dest, sh_meta->sh_size, sh_meta->sh_offset);
+ if (err != 0) {
+ printf("\nelf" __XSTRING(__ELF_WORD_SIZE)
+ "load_modmetadata: unable to load set_modmetadata_set: %d\n", err);
+ goto out;
+ }
+ p_start = dest;
+ p_end = dest + sh_meta->sh_size;
+ dest += sh_meta->sh_size;
+
+ /* Load data sections into memory. */
+ err = kern_pread(ef.fd, dest, sh_data[0]->sh_size,
+ sh_data[0]->sh_offset);
+ if (err != 0) {
+ printf("\nelf" __XSTRING(__ELF_WORD_SIZE)
+ "load_modmetadata: unable to load data: %d\n", err);
+ goto out;
+ }
+
+ /*
+ * We have to increment the dest, so that the offset is the same into
+ * both the .rodata and .data sections.
+ */
+ ef.off = -(sh_data[0]->sh_addr - dest);
+ dest += (sh_data[1]->sh_addr - sh_data[0]->sh_addr);
+
+ err = kern_pread(ef.fd, dest, sh_data[1]->sh_size,
+ sh_data[1]->sh_offset);
+ if (err != 0) {
+ printf("\nelf" __XSTRING(__ELF_WORD_SIZE)
+ "load_modmetadata: unable to load data: %d\n", err);
+ goto out;
+ }
+
+ err = __elfN(parse_modmetadata)(fp, &ef, p_start, p_end);
+ if (err != 0) {
+ printf("\nelf" __XSTRING(__ELF_WORD_SIZE)
+ "load_modmetadata: unable to parse metadata: %d\n", err);
+ goto out;
+ }
+
+out:
+ if (shstrtab != NULL)
+ free(shstrtab);
+ if (shdr != NULL)
+ free(shdr);
+ if (ef.firstpage != NULL)
+ free(ef.firstpage);
+ if (ef.fd != -1)
+ close(ef.fd);
+ return (err);
+}
+
+int
+__elfN(parse_modmetadata)(struct preloaded_file *fp, elf_file_t ef,
+ Elf_Addr p_start, Elf_Addr p_end)
{
struct mod_metadata md;
#if (defined(__i386__) || defined(__powerpc__)) && __ELF_WORD_SIZE == 64
@@ -644,20 +814,13 @@ __elfN(parse_modmetadata)(struct preloaded_file *fp, elf_file_t ef)
#endif
struct mod_depend *mdepend;
struct mod_version mver;
- Elf_Sym sym;
char *s;
int error, modcnt, minfolen;
- Elf_Addr v, p, p_stop;
-
- if (__elfN(lookup_symbol)(fp, ef, "__start_set_modmetadata_set", &sym) != 0)
- return 0;
- p = sym.st_value + ef->off;
- if (__elfN(lookup_symbol)(fp, ef, "__stop_set_modmetadata_set", &sym) != 0)
- return ENOENT;
- p_stop = sym.st_value + ef->off;
+ Elf_Addr v, p;
modcnt = 0;
- while (p < p_stop) {
+ p = p_start;
+ while (p < p_end) {
COPYOUT(p, &v, sizeof(v));
error = __elfN(reloc_ptr)(fp, ef, p, &v, sizeof(v));
if (error == EOPNOTSUPP)
diff --git a/sys/boot/common/load_elf_obj.c b/sys/boot/common/load_elf_obj.c
index 2c8e184..3d8b02a 100644
--- a/sys/boot/common/load_elf_obj.c
+++ b/sys/boot/common/load_elf_obj.c
@@ -129,20 +129,13 @@ __elfN(obj_loadfile)(char *filename, u_int64_t dest,
goto oerr;
}
- kfp = file_findfile(NULL, NULL);
+ kfp = file_findfile(NULL, __elfN(obj_kerneltype));
if (kfp == NULL) {
printf("elf" __XSTRING(__ELF_WORD_SIZE)
"_obj_loadfile: can't load module before kernel\n");
err = EPERM;
goto oerr;
}
- if (strcmp(__elfN(obj_kerneltype), kfp->f_type)) {
- printf("elf" __XSTRING(__ELF_WORD_SIZE)
- "_obj_loadfile: can't load module with kernel type '%s'\n",
- kfp->f_type);
- err = EPERM;
- goto oerr;
- }
if (archsw.arch_loadaddr != NULL)
dest = archsw.arch_loadaddr(LOAD_ELF, hdr, dest);
diff --git a/sys/boot/common/module.c b/sys/boot/common/module.c
index c7d19d1..2af9c20 100644
--- a/sys/boot/common/module.c
+++ b/sys/boot/common/module.c
@@ -138,7 +138,7 @@ command_load(int argc, char *argv[])
command_errmsg = "invalid load type";
return(CMD_ERROR);
}
- return(file_loadraw(argv[1], typestr) ? CMD_OK : CMD_ERROR);
+ return (file_loadraw(argv[1], typestr, 1) ? CMD_OK : CMD_ERROR);
}
/*
* Do we have explicit KLD load ?
@@ -193,7 +193,7 @@ command_load_geli(int argc, char *argv[])
argv += (optind - 1);
argc -= (optind - 1);
sprintf(typestr, "%s:geli_keyfile%d", argv[1], num);
- return(file_loadraw(argv[2], typestr) ? CMD_OK : CMD_ERROR);
+ return (file_loadraw(argv[2], typestr, 1) ? CMD_OK : CMD_ERROR);
}
COMMAND_SET(unload, "unload", "unload all modules", command_unload);
@@ -362,7 +362,7 @@ file_load_dependencies(struct preloaded_file *base_file)
* no arguments or anything.
*/
struct preloaded_file *
-file_loadraw(char *name, char *type)
+file_loadraw(char *name, char *type, int insert)
{
struct preloaded_file *fp;
char *cp;
@@ -421,7 +421,8 @@ file_loadraw(char *name, char *type)
loadaddr = laddr;
/* Add to the list of loaded files */
- file_insert_tail(fp);
+ if (insert != 0)
+ file_insert_tail(fp);
close(fd);
return(fp);
}
@@ -524,7 +525,7 @@ mod_loadkld(const char *kldname, int argc, char *argv[])
* NULL may be passed as a wildcard to either.
*/
struct preloaded_file *
-file_findfile(char *name, char *type)
+file_findfile(const char *name, const char *type)
{
struct preloaded_file *fp;
diff --git a/sys/boot/efi/boot1/Makefile b/sys/boot/efi/boot1/Makefile
index ddf3147..8cb6c62 100644
--- a/sys/boot/efi/boot1/Makefile
+++ b/sys/boot/efi/boot1/Makefile
@@ -9,7 +9,7 @@ MAN=
MK_SSP= no
-PROG= loader.sym
+PROG= boot1.sym
INTERNALPROG=
# architecture-specific loader code
@@ -38,7 +38,7 @@ LDFLAGS= -Wl,-T${LDSCRIPT} -Wl,-Bsymbolic -shared
LDFLAGS+= -Wl,-znocombreloc
.endif
-${PROG}: ${LDSCRIPT}
+DPADD+= ${LDSCRIPT}
OBJCOPY?= objcopy
OBJDUMP?= objdump
@@ -49,19 +49,19 @@ EFI_TARGET= efi-app-x86_64
EFI_TARGET= efi-app-ia32
.endif
-boot1.efi: loader.sym
+boot1.efi: ${PROG}
if [ `${OBJDUMP} -t ${.ALLSRC} | fgrep '*UND*' | wc -l` != 0 ]; then \
${OBJDUMP} -t ${.ALLSRC} | fgrep '*UND*'; \
exit 1; \
fi
${OBJCOPY} -j .text -j .sdata -j .data \
-j .dynamic -j .dynsym -j .rel.dyn \
- -j .rela.dyn -j .reloc -j .eh_frame -j set_Xcommand_set \
+ -j .rela.dyn -j .reloc -j .eh_frame \
--output-target=${EFI_TARGET} ${.ALLSRC} ${.TARGET}
boot1.o: ${.CURDIR}/../../common/ufsread.c
-# The following inserts out objects into a template FAT file system
+# The following inserts our objects into a template FAT file system
# created by generate-fat.sh
.include "${.CURDIR}/Makefile.fat"
@@ -73,7 +73,7 @@ boot1.efifat: boot1.efi
bzip2 -f -d ${.TARGET}.bz2
dd if=boot1.efi of=${.TARGET} seek=${BOOT1_OFFSET} conv=notrunc
-CLEANFILES= boot1.efifat
+CLEANFILES= boot1.efi boot1.efifat
.endif # ${COMPILER_TYPE} != "gcc"
@@ -82,7 +82,7 @@ CLEANFILES= boot1.efifat
.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386"
beforedepend ${OBJS}: machine x86
-CLEANFILES+= machine x86 boot1.efi
+CLEANFILES+= machine x86
machine:
ln -sf ${.CURDIR}/../../../amd64/include machine
diff --git a/sys/boot/efi/boot1/boot1.c b/sys/boot/efi/boot1/boot1.c
index e0c26da..1e3821b 100644
--- a/sys/boot/efi/boot1/boot1.c
+++ b/sys/boot/efi/boot1/boot1.c
@@ -30,7 +30,7 @@ __FBSDID("$FreeBSD$");
#define _PATH_LOADER "/boot/loader.efi"
#define _PATH_KERNEL "/boot/kernel/kernel"
-
+
#define BSIZEMAX 16384
typedef int putc_func_t(char c, void *arg);
@@ -40,7 +40,7 @@ struct sp_data {
u_int sp_len;
u_int sp_size;
};
-
+
static const char digits[] = "0123456789abcdef";
static void panic(const char *fmt, ...) __dead2;
@@ -62,7 +62,7 @@ static void load(const char *fname);
EFI_SYSTEM_TABLE *systab;
EFI_HANDLE *image;
-static void
+static void
bcopy(const void *src, void *dst, size_t len)
{
const char *s = src;
@@ -71,12 +71,12 @@ bcopy(const void *src, void *dst, size_t len)
while (len-- != 0)
*d++ = *s++;
}
-
+
static void
memcpy(void *dst, const void *src, size_t len)
{
bcopy(src, dst, len);
-}
+}
static void
bzero(void *b, size_t len)
@@ -86,7 +86,7 @@ bzero(void *b, size_t len)
while (len-- != 0)
*p++ = 0;
}
-
+
static int
strcmp(const char *s1, const char *s2)
{
@@ -134,7 +134,7 @@ EFI_STATUS efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE* Xsystab)
for (i = 0; i < nparts; i++) {
status = systab->BootServices->HandleProtocol(handles[i],
- &DevicePathGUID, (void **)&devpath);
+ &DevicePathGUID, (void **)&devpath);
if (EFI_ERROR(status))
continue;
@@ -142,7 +142,7 @@ EFI_STATUS efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE* Xsystab)
devpath = NextDevicePathNode(devpath);
status = systab->BootServices->HandleProtocol(handles[i],
- &BlockIoProtocolGUID, (void **)&blkio);
+ &BlockIoProtocolGUID, (void **)&blkio);
if (EFI_ERROR(status))
continue;
@@ -158,7 +158,7 @@ EFI_STATUS efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE* Xsystab)
bootdevhandle = handles[i];
load(path);
-
+
panic("Load failed");
return EFI_SUCCESS;
@@ -266,7 +266,7 @@ fsstat(ufs_ino_t inode)
}
static struct dmadat __dmadat;
-
+
static int
domount(EFI_DEVICE_PATH *device, EFI_BLOCK_IO *blkio, int quiet)
{
@@ -278,7 +278,7 @@ domount(EFI_DEVICE_PATH *device, EFI_BLOCK_IO *blkio, int quiet)
if (!quiet)
printf("domount: can't read superblock\n");
return (-1);
- }
+ }
if (!quiet)
printf("Succesfully mounted UFS filesystem\n");
return (0);
@@ -303,26 +303,26 @@ load(const char *fname)
status = systab->BootServices->AllocatePool(EfiLoaderData,
bufsize, &buffer);
fsread(ino, buffer, bufsize);
-
+
/* XXX: For secure boot, we need our own loader here */
status = systab->BootServices->LoadImage(TRUE, image, bootdevpath,
buffer, bufsize, &loaderhandle);
if (EFI_ERROR(status))
printf("LoadImage failed with error %lu\n",
- status & ~EFI_ERROR_MASK);
+ EFI_ERROR_CODE(status));
status = systab->BootServices->HandleProtocol(loaderhandle,
&LoadedImageGUID, (VOID**)&loaded_image);
if (EFI_ERROR(status))
printf("HandleProtocol failed with error %lu\n",
- status & ~EFI_ERROR_MASK);
+ EFI_ERROR_CODE(status));
loaded_image->DeviceHandle = bootdevhandle;
status = systab->BootServices->StartImage(loaderhandle, NULL, NULL);
if (EFI_ERROR(status))
printf("StartImage failed with error %lu\n",
- status & ~EFI_ERROR_MASK);
+ EFI_ERROR_CODE(status));
}
static void
@@ -552,4 +552,3 @@ __ultoa(char *buf, u_long ul, int base)
while ((ul /= base) != 0);
return (p);
}
-
diff --git a/sys/boot/efi/include/efierr.h b/sys/boot/efi/include/efierr.h
index dc57f0e..921b297 100644
--- a/sys/boot/efi/include/efierr.h
+++ b/sys/boot/efi/include/efierr.h
@@ -30,7 +30,8 @@ Revision History
#define EFIWARN(a) (a)
-#define EFI_ERROR(a) (((INTN) a) < 0)
+#define EFI_ERROR(a) (((INTN) a) < 0)
+#define EFI_ERROR_CODE(a) (a & ~EFI_ERROR_MASK)
#define EFI_SUCCESS 0
diff --git a/sys/boot/efi/libefi/Makefile b/sys/boot/efi/libefi/Makefile
index 8180d9e..900b230 100644
--- a/sys/boot/efi/libefi/Makefile
+++ b/sys/boot/efi/libefi/Makefile
@@ -19,5 +19,6 @@ CFLAGS+= -I${.CURDIR}/../../common
# Suppress warning from clang for FreeBSD %b and %D formats
CFLAGS+= -fformat-extensions
+CFLAGS+= -DTERM_EMU
.include <bsd.lib.mk>
diff --git a/sys/boot/efi/libefi/efi_console.c b/sys/boot/efi/libefi/efi_console.c
index 3538994..52a3725 100644
--- a/sys/boot/efi/libefi/efi_console.c
+++ b/sys/boot/efi/libefi/efi_console.c
@@ -35,6 +35,69 @@ __FBSDID("$FreeBSD$");
static SIMPLE_TEXT_OUTPUT_INTERFACE *conout;
static SIMPLE_INPUT_INTERFACE *conin;
+#ifdef TERM_EMU
+#define DEFAULT_FGCOLOR EFI_LIGHTGRAY
+#define DEFAULT_BGCOLOR EFI_BLACK
+
+#define MAXARGS 8
+static int args[MAXARGS], argc;
+static int fg_c, bg_c, curx, cury;
+static int esc;
+
+void get_pos(int *x, int *y);
+void curs_move(int *_x, int *_y, int x, int y);
+static void CL(int);
+#endif
+
+static void efi_cons_probe(struct console *);
+static int efi_cons_init(int);
+void efi_cons_putchar(int);
+int efi_cons_getchar(void);
+void efi_cons_efiputchar(int);
+int efi_cons_poll(void);
+
+struct console efi_console = {
+ "efi",
+ "EFI console",
+ 0,
+ efi_cons_probe,
+ efi_cons_init,
+ efi_cons_putchar,
+ efi_cons_getchar,
+ efi_cons_poll
+};
+
+#ifdef TERM_EMU
+
+/* Get cursor position. */
+void
+get_pos(int *x, int *y)
+{
+ *x = conout->Mode->CursorColumn;
+ *y = conout->Mode->CursorRow;
+}
+
+/* Move cursor to x rows and y cols (0-based). */
+void
+curs_move(int *_x, int *_y, int x, int y)
+{
+ conout->SetCursorPosition(conout, x, y);
+ if (_x != NULL)
+ *_x = conout->Mode->CursorColumn;
+ if (_y != NULL)
+ *_y = conout->Mode->CursorRow;
+}
+
+/* Clear internal state of the terminal emulation code. */
+void
+end_term(void)
+{
+ esc = 0;
+ argc = -1;
+}
+
+#endif
+
static void
efi_cons_probe(struct console *cp)
{
@@ -46,22 +109,314 @@ efi_cons_probe(struct console *cp)
static int
efi_cons_init(int arg)
{
- conout->SetAttribute(conout, EFI_TEXT_ATTR(EFI_LIGHTGRAY, EFI_BLACK));
+ conout->SetAttribute(conout, EFI_TEXT_ATTR(DEFAULT_FGCOLOR,
+ DEFAULT_BGCOLOR));
+#ifdef TERM_EMU
+ end_term();
+ get_pos(&curx, &cury);
+ curs_move(&curx, &cury, curx, cury);
+ fg_c = DEFAULT_FGCOLOR;
+ bg_c = DEFAULT_BGCOLOR;
+#endif
+ conout->EnableCursor(conout, TRUE);
return 0;
}
+static void
+efi_cons_rawputchar(int c)
+{
+ int i;
+ UINTN x, y;
+ conout->QueryMode(conout, conout->Mode->Mode, &x, &y);
+
+ if (c == '\t')
+ /* XXX lame tab expansion */
+ for (i = 0; i < 8; i++)
+ efi_cons_rawputchar(' ');
+ else {
+#ifndef TERM_EMU
+ if (c == '\n')
+ efi_cons_efiputchar('\r');
+ else
+ efi_cons_efiputchar(c);
+#else
+ switch (c) {
+ case '\r':
+ curx = 0;
+ curs_move(&curx, &cury, curx, cury);
+ return;
+ case '\n':
+ cury++;
+ if (cury >= y) {
+ efi_cons_efiputchar('\n');
+ cury--;
+ } else
+ curs_move(&curx, &cury, curx, cury);
+ return;
+ case '\b':
+ if (curx > 0) {
+ curx--;
+ curs_move(&curx, &cury, curx, cury);
+ }
+ return;
+ default:
+ efi_cons_efiputchar(c);
+ curx++;
+ if (curx > x-1) {
+ curx = 0;
+ cury++;
+ }
+ if (cury > y-1) {
+ curx = 0;
+ cury--;
+ }
+ }
+ curs_move(&curx, &cury, curx, cury);
+#endif
+ }
+}
+
+/* Gracefully exit ESC-sequence processing in case of misunderstanding. */
+static void
+bail_out(int c)
+{
+ char buf[16], *ch;
+ int i;
+
+ if (esc) {
+ efi_cons_rawputchar('\033');
+ if (esc != '\033')
+ efi_cons_rawputchar(esc);
+ for (i = 0; i <= argc; ++i) {
+ sprintf(buf, "%d", args[i]);
+ ch = buf;
+ while (*ch)
+ efi_cons_rawputchar(*ch++);
+ }
+ }
+ efi_cons_rawputchar(c);
+ end_term();
+}
+
+/* Clear display from current position to end of screen. */
+static void
+CD(void) {
+ int i;
+ UINTN x, y;
+
+ get_pos(&curx, &cury);
+ if (curx == 0 && cury == 0) {
+ conout->ClearScreen(conout);
+ end_term();
+ return;
+ }
+
+ conout->QueryMode(conout, conout->Mode->Mode, &x, &y);
+ CL(0); /* clear current line from cursor to end */
+ for (i = cury + 1; i < y-1; i++) {
+ curs_move(NULL, NULL, 0, i);
+ CL(0);
+ }
+ curs_move(NULL, NULL, curx, cury);
+ end_term();
+}
+
+/*
+ * Absolute cursor move to args[0] rows and args[1] columns
+ * (the coordinates are 1-based).
+ */
+static void
+CM(void)
+{
+ if (args[0] > 0)
+ args[0]--;
+ if (args[1] > 0)
+ args[1]--;
+ curs_move(&curx, &cury, args[1], args[0]);
+ end_term();
+}
+
+/* Home cursor (left top corner), also called from mode command. */
void
-efi_cons_putchar(int c)
+HO(void)
{
- CHAR16 buf[2];
+ argc = 1;
+ args[0] = args[1] = 1;
+ CM();
+}
- if (c == '\n')
- efi_cons_putchar('\r');
+/* Clear line from current position to end of line */
+static void
+CL(int direction)
+{
+ int i, len;
+ UINTN x, y;
+ CHAR16 *line;
- buf[0] = c;
- buf[1] = 0;
+ conout->QueryMode(conout, conout->Mode->Mode, &x, &y);
+ switch (direction) {
+ case 0: /* from cursor to end */
+ len = x - curx + 1;
+ break;
+ case 1: /* from beginning to cursor */
+ len = curx;
+ break;
+ case 2: /* entire line */
+ len = x;
+ break;
+ }
- conout->OutputString(conout, buf);
+ if (cury == y - 1)
+ len--;
+
+ line = malloc(len * sizeof (CHAR16));
+ if (line == NULL) {
+ printf("out of memory\n");
+ return;
+ }
+ for (i = 0; i < len; i++)
+ line[i] = ' ';
+ line[len-1] = 0;
+
+ if (direction != 0)
+ curs_move(NULL, NULL, 0, cury);
+
+ conout->OutputString(conout, line);
+ /* restore cursor position */
+ curs_move(NULL, NULL, curx, cury);
+ free(line);
+ end_term();
+}
+
+static void
+get_arg(int c)
+{
+ if (argc < 0)
+ argc = 0;
+ args[argc] *= 10;
+ args[argc] += c - '0';
+}
+
+/* Emulate basic capabilities of cons25 terminal */
+static void
+efi_term_emu(int c)
+{
+ static int ansi_col[] = {
+ 0, 4, 2, 6, 1, 5, 3, 7
+ };
+ int t, i;
+
+ switch (esc) {
+ case 0:
+ switch (c) {
+ case '\033':
+ esc = c;
+ break;
+ default:
+ efi_cons_rawputchar(c);
+ break;
+ }
+ break;
+ case '\033':
+ switch (c) {
+ case '[':
+ esc = c;
+ args[0] = 0;
+ argc = -1;
+ break;
+ default:
+ bail_out(c);
+ break;
+ }
+ break;
+ case '[':
+ switch (c) {
+ case ';':
+ if (argc < 0)
+ argc = 0;
+ else if (argc + 1 >= MAXARGS)
+ bail_out(c);
+ else
+ args[++argc] = 0;
+ break;
+ case 'H': /* ho = \E[H */
+ if (argc < 0)
+ HO();
+ else if (argc == 1)
+ CM();
+ else
+ bail_out(c);
+ break;
+ case 'J': /* cd = \E[J */
+ if (argc < 0)
+ CD();
+ else
+ bail_out(c);
+ break;
+ case 'm':
+ if (argc < 0) {
+ fg_c = DEFAULT_FGCOLOR;
+ bg_c = DEFAULT_BGCOLOR;
+ }
+ for (i = 0; i <= argc; ++i) {
+ switch (args[i]) {
+ case 0: /* back to normal */
+ fg_c = DEFAULT_FGCOLOR;
+ bg_c = DEFAULT_BGCOLOR;
+ break;
+ case 1: /* bold */
+ fg_c |= 0x8;
+ break;
+ case 4: /* underline */
+ case 5: /* blink */
+ bg_c |= 0x8;
+ break;
+ case 7: /* reverse */
+ t = fg_c;
+ fg_c = bg_c;
+ bg_c = t;
+ break;
+ case 30: case 31: case 32: case 33:
+ case 34: case 35: case 36: case 37:
+ fg_c = ansi_col[args[i] - 30];
+ break;
+ case 39: /* normal */
+ fg_c = DEFAULT_FGCOLOR;
+ break;
+ case 40: case 41: case 42: case 43:
+ case 44: case 45: case 46: case 47:
+ bg_c = ansi_col[args[i] - 40];
+ break;
+ case 49: /* normal */
+ bg_c = DEFAULT_BGCOLOR;
+ break;
+ }
+ }
+ conout->SetAttribute(conout, EFI_TEXT_ATTR(fg_c, bg_c));
+ end_term();
+ break;
+ default:
+ if (isdigit(c))
+ get_arg(c);
+ else
+ bail_out(c);
+ break;
+ }
+ break;
+ default:
+ bail_out(c);
+ break;
+ }
+}
+
+void
+efi_cons_putchar(int c)
+{
+#ifdef TERM_EMU
+ efi_term_emu(c);
+#else
+ efi_cons_rawputchar(c);
+#endif
}
int
@@ -77,6 +432,12 @@ efi_cons_getchar()
BS->WaitForEvent(1, &conin->WaitForKey, &junk);
status = conin->ReadKeyStroke(conin, &key);
}
+ switch (key.ScanCode) {
+ case 0x17: /* ESC */
+ return (0x1b); /* esc */
+ }
+
+ /* this can return */
return (key.UnicodeChar);
}
@@ -87,13 +448,36 @@ efi_cons_poll()
return (BS->CheckEvent(conin->WaitForKey) == EFI_SUCCESS);
}
-struct console efi_console = {
- "efi",
- "EFI console",
- 0,
- efi_cons_probe,
- efi_cons_init,
- efi_cons_putchar,
- efi_cons_getchar,
- efi_cons_poll
-};
+/* Plain direct access to EFI OutputString(). */
+void
+efi_cons_efiputchar(int c)
+{
+ CHAR16 buf[2];
+
+ /*
+ * translate box chars to unicode
+ */
+ switch (c) {
+ /* single frame */
+ case 0xb3: buf[0] = BOXDRAW_VERTICAL; break;
+ case 0xbf: buf[0] = BOXDRAW_DOWN_LEFT; break;
+ case 0xc0: buf[0] = BOXDRAW_UP_RIGHT; break;
+ case 0xc4: buf[0] = BOXDRAW_HORIZONTAL; break;
+ case 0xda: buf[0] = BOXDRAW_DOWN_RIGHT; break;
+ case 0xd9: buf[0] = BOXDRAW_UP_LEFT; break;
+
+ /* double frame */
+ case 0xba: buf[0] = BOXDRAW_DOUBLE_VERTICAL; break;
+ case 0xbb: buf[0] = BOXDRAW_DOUBLE_DOWN_LEFT; break;
+ case 0xbc: buf[0] = BOXDRAW_DOUBLE_UP_LEFT; break;
+ case 0xc8: buf[0] = BOXDRAW_DOUBLE_UP_RIGHT; break;
+ case 0xc9: buf[0] = BOXDRAW_DOUBLE_DOWN_RIGHT; break;
+ case 0xcd: buf[0] = BOXDRAW_DOUBLE_HORIZONTAL; break;
+
+ default:
+ buf[0] = c;
+ }
+ buf[1] = 0; /* terminate string */
+
+ conout->OutputString(conout, buf);
+}
diff --git a/sys/boot/efi/loader/Makefile b/sys/boot/efi/loader/Makefile
index 8d3fe87..268edce 100644
--- a/sys/boot/efi/loader/Makefile
+++ b/sys/boot/efi/loader/Makefile
@@ -12,7 +12,6 @@ MK_SSP= no
PROG= loader.sym
INTERNALPROG=
-.PATH: ${.CURDIR}/../../efi/loader
# architecture-specific loader code
SRCS= autoload.c \
bootinfo.c \
@@ -80,7 +79,7 @@ EFI_TARGET= efi-app-x86_64
EFI_TARGET= efi-app-ia32
.endif
-loader.efi: loader.sym
+loader.efi: ${PROG}
if [ `${OBJDUMP} -t ${.ALLSRC} | fgrep '*UND*' | wc -l` != 0 ]; then \
${OBJDUMP} -t ${.ALLSRC} | fgrep '*UND*'; \
exit 1; \
diff --git a/sys/boot/efi/loader/bootinfo.c b/sys/boot/efi/loader/bootinfo.c
index f3bb9cc..18837f8 100644
--- a/sys/boot/efi/loader/bootinfo.c
+++ b/sys/boot/efi/loader/bootinfo.c
@@ -275,7 +275,7 @@ bi_load_efi_data(struct preloaded_file *kfp)
pages, &addr);
if (EFI_ERROR(status)) {
printf("%s: AllocatePages error %lu\n", __func__,
- (unsigned long)(status & ~EFI_ERROR_MASK));
+ EFI_ERROR_CODE(status));
return (ENOMEM);
}
@@ -291,7 +291,7 @@ bi_load_efi_data(struct preloaded_file *kfp)
status = BS->GetMemoryMap(&sz, mm, &efi_mapkey, &mmsz, &mmver);
if (EFI_ERROR(status)) {
printf("%s: GetMemoryMap error %lu\n", __func__,
- (unsigned long)(status & ~EFI_ERROR_MASK));
+ EFI_ERROR_CODE(status));
return (EINVAL);
}
status = BS->ExitBootServices(IH, efi_mapkey);
@@ -305,8 +305,7 @@ bi_load_efi_data(struct preloaded_file *kfp)
}
BS->FreePages(addr, pages);
}
- printf("ExitBootServices error %lu\n",
- (unsigned long)(status & ~EFI_ERROR_MASK));
+ printf("ExitBootServices error %lu\n", EFI_ERROR_CODE(status));
return (EINVAL);
}
diff --git a/sys/boot/efi/loader/copy.c b/sys/boot/efi/loader/copy.c
index a7d6bf1..363d95d 100644
--- a/sys/boot/efi/loader/copy.c
+++ b/sys/boot/efi/loader/copy.c
@@ -56,7 +56,7 @@ efi_copy_init(void)
STAGE_PAGES, &staging);
if (EFI_ERROR(status)) {
printf("failed to allocate staging area: %lu\n",
- (unsigned long)(status & EFI_ERROR_MASK));
+ EFI_ERROR_CODE(status));
return (status);
}
staging_end = staging + STAGE_PAGES * EFI_PAGE_SIZE;
diff --git a/sys/boot/efi/loader/main.c b/sys/boot/efi/loader/main.c
index e6e13f1..ec9f9af 100644
--- a/sys/boot/efi/loader/main.c
+++ b/sys/boot/efi/loader/main.c
@@ -63,10 +63,10 @@ EFI_GUID debugimg = DEBUG_IMAGE_INFO_TABLE_GUID;
EFI_STATUS
main(int argc, CHAR16 *argv[])
{
- char vendor[128];
+ char var[128];
EFI_LOADED_IMAGE *img;
EFI_GUID *guid;
- int i;
+ int i, j, vargood;
/*
* XXX Chicken-and-egg problem; we want to have console output
@@ -76,6 +76,29 @@ main(int argc, CHAR16 *argv[])
*/
cons_probe();
+ /*
+ * Loop through the args, and for each one that contains an '=' that is
+ * not the first character, add it to the environment. This allows
+ * loader and kernel env vars to be passed on the command line. Convert
+ * args from UCS-2 to ASCII (16 to 8 bit) as they are copied.
+ */
+ for (i = 1; i < argc; i++) {
+ vargood = 0;
+ for (j = 0; argv[i][j] != 0; j++) {
+ if (j == sizeof(var)) {
+ vargood = 0;
+ break;
+ }
+ if (j > 0 && argv[i][j] == '=')
+ vargood = 1;
+ var[j] = (char)argv[i][j];
+ }
+ if (vargood) {
+ var[j] = 0;
+ putenv(var);
+ }
+ }
+
if (efi_copy_init()) {
printf("failed to allocate staging area\n");
return (EFI_BUFFER_TOO_SMALL);
@@ -203,50 +226,47 @@ command_memmap(int argc, char *argv[])
status = BS->GetMemoryMap(&sz, 0, &key, &dsz, &dver);
if (status != EFI_BUFFER_TOO_SMALL) {
printf("Can't determine memory map size\n");
- return CMD_ERROR;
+ return (CMD_ERROR);
}
map = malloc(sz);
status = BS->GetMemoryMap(&sz, map, &key, &dsz, &dver);
if (EFI_ERROR(status)) {
printf("Can't read memory map\n");
- return CMD_ERROR;
+ return (CMD_ERROR);
}
ndesc = sz / dsz;
printf("%23s %12s %12s %8s %4s\n",
- "Type", "Physical", "Virtual", "#Pages", "Attr");
+ "Type", "Physical", "Virtual", "#Pages", "Attr");
for (i = 0, p = map; i < ndesc;
i++, p = NextMemoryDescriptor(p, dsz)) {
- printf("%23s %012lx %012lx %08lx ",
- types[p->Type],
- p->PhysicalStart,
- p->VirtualStart,
- p->NumberOfPages);
- if (p->Attribute & EFI_MEMORY_UC)
- printf("UC ");
- if (p->Attribute & EFI_MEMORY_WC)
- printf("WC ");
- if (p->Attribute & EFI_MEMORY_WT)
- printf("WT ");
- if (p->Attribute & EFI_MEMORY_WB)
- printf("WB ");
- if (p->Attribute & EFI_MEMORY_UCE)
- printf("UCE ");
- if (p->Attribute & EFI_MEMORY_WP)
- printf("WP ");
- if (p->Attribute & EFI_MEMORY_RP)
- printf("RP ");
- if (p->Attribute & EFI_MEMORY_XP)
- printf("XP ");
- printf("\n");
+ printf("%23s %012lx %012lx %08lx ", types[p->Type],
+ p->PhysicalStart, p->VirtualStart, p->NumberOfPages);
+ if (p->Attribute & EFI_MEMORY_UC)
+ printf("UC ");
+ if (p->Attribute & EFI_MEMORY_WC)
+ printf("WC ");
+ if (p->Attribute & EFI_MEMORY_WT)
+ printf("WT ");
+ if (p->Attribute & EFI_MEMORY_WB)
+ printf("WB ");
+ if (p->Attribute & EFI_MEMORY_UCE)
+ printf("UCE ");
+ if (p->Attribute & EFI_MEMORY_WP)
+ printf("WP ");
+ if (p->Attribute & EFI_MEMORY_RP)
+ printf("RP ");
+ if (p->Attribute & EFI_MEMORY_XP)
+ printf("XP ");
+ printf("\n");
}
- return CMD_OK;
+ return (CMD_OK);
}
-COMMAND_SET(configuration, "configuration",
- "print configuration tables", command_configuration);
+COMMAND_SET(configuration, "configuration", "print configuration tables",
+ command_configuration);
static const char *
guid_to_string(EFI_GUID *guid)
@@ -292,7 +312,7 @@ command_configuration(int argc, char *argv[])
printf(" at %p\n", ST->ConfigurationTable[i].VendorTable);
}
- return CMD_OK;
+ return (CMD_OK);
}
@@ -308,6 +328,7 @@ command_mode(int argc, char *argv[])
char rowenv[8];
EFI_STATUS status;
SIMPLE_TEXT_OUTPUT_INTERFACE *conout;
+ extern void HO(void);
conout = ST->ConOut;
@@ -329,14 +350,15 @@ command_mode(int argc, char *argv[])
}
sprintf(rowenv, "%u", (unsigned)rows);
setenv("LINES", rowenv, 1);
-
+ HO(); /* set cursor */
return (CMD_OK);
}
- for (i = 0; ; i++) {
+ printf("Current mode: %d\n", conout->Mode->Mode);
+ for (i = 0; i <= conout->Mode->MaxMode; i++) {
status = conout->QueryMode(conout, i, &cols, &rows);
if (EFI_ERROR(status))
- break;
+ continue;
printf("Mode %d: %u columns, %u rows\n", i, (unsigned)cols,
(unsigned)rows);
}
@@ -367,20 +389,17 @@ command_nvram(int argc, char *argv[])
status = RS->GetNextVariableName(&varsz, NULL, NULL);
for (; status != EFI_NOT_FOUND; ) {
- status = RS->GetNextVariableName(&varsz, var,
- &varguid);
+ status = RS->GetNextVariableName(&varsz, var, &varguid);
//if (EFI_ERROR(status))
//break;
conout->OutputString(conout, var);
printf("=");
datasz = 0;
- status = RS->GetVariable(var, &varguid, NULL, &datasz,
- NULL);
+ status = RS->GetVariable(var, &varguid, NULL, &datasz, NULL);
/* XXX: check status */
data = malloc(datasz);
- status = RS->GetVariable(var, &varguid, NULL, &datasz,
- data);
+ status = RS->GetVariable(var, &varguid, NULL, &datasz, data);
if (EFI_ERROR(status))
printf("<error retrieving variable>");
else {
diff --git a/sys/boot/fdt/dts/arm/beaglebone-black.dts b/sys/boot/fdt/dts/arm/beaglebone-black.dts
index ff25f9d..0e35a7a 100644
--- a/sys/boot/fdt/dts/arm/beaglebone-black.dts
+++ b/sys/boot/fdt/dts/arm/beaglebone-black.dts
@@ -146,9 +146,9 @@
};
i2c@44e0b000 {
- pmic@48 {
+ pmic@24 {
compatible = "ti,am335x-pmic";
- reg = <0x48>;
+ reg = <0x24>;
};
};
};
diff --git a/sys/boot/fdt/dts/arm/beaglebone.dts b/sys/boot/fdt/dts/arm/beaglebone.dts
index 83b948f..3f8e022 100644
--- a/sys/boot/fdt/dts/arm/beaglebone.dts
+++ b/sys/boot/fdt/dts/arm/beaglebone.dts
@@ -133,7 +133,7 @@
i2c@44e0b000 {
pmic@24 {
compatible = "ti,am335x-pmic";
- reg = <0x48>;
+ reg = <0x24>;
};
};
};
diff --git a/sys/boot/fdt/fdt_loader_cmd.c b/sys/boot/fdt/fdt_loader_cmd.c
index 0f63776..98a0388 100644
--- a/sys/boot/fdt/fdt_loader_cmd.c
+++ b/sys/boot/fdt/fdt_loader_cmd.c
@@ -261,7 +261,7 @@ fdt_load_dtb_file(const char * filename)
oldbfp = file_findfile(NULL, "dtb");
/* Attempt to load and validate a new dtb from a file. */
- if ((bfp = file_loadraw(filename, "dtb")) == NULL) {
+ if ((bfp = file_loadraw(filename, "dtb", 1)) == NULL) {
sprintf(command_errbuf, "failed to load file '%s'", filename);
return (1);
}
diff --git a/sys/boot/ficl/amd64/sysdep.c b/sys/boot/ficl/amd64/sysdep.c
index 00b0d4a..6031094 100644
--- a/sys/boot/ficl/amd64/sysdep.c
+++ b/sys/boot/ficl/amd64/sysdep.c
@@ -55,7 +55,7 @@ void ficlTextOut(FICL_VM *pVM, char *msg, int fNewline)
IGNORE(pVM);
while(*msg != 0)
- putchar(*(msg++));
+ putchar((unsigned char)*(msg++));
if (fNewline)
putchar('\n');
diff --git a/sys/boot/forth/beastie.4th b/sys/boot/forth/beastie.4th
index 9ede592..752cce2 100644
--- a/sys/boot/forth/beastie.4th
+++ b/sys/boot/forth/beastie.4th
@@ -85,14 +85,10 @@ variable logoY
also support-functions
: beastie-start ( -- ) \ starts the menu
- s" console" getenv dup -1 <> if
- s" efi" 2swap contains? if
- s" set beastie_disable=YES" evaluate
- then
- else drop then
s" beastie_disable" getenv dup -1 <> if
s" YES" compare-insensitive 0= if
any_conf_read? if
+ load_xen_throw
load_kernel
load_modules
then
diff --git a/sys/boot/forth/beastie.4th.8 b/sys/boot/forth/beastie.4th.8
index 534a60c..70d8694 100644
--- a/sys/boot/forth/beastie.4th.8
+++ b/sys/boot/forth/beastie.4th.8
@@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd April 27, 2014
+.Dd January 20, 2016
.Dt BEASTIE.4TH 8
.Os
.Sh NAME
@@ -119,8 +119,7 @@ Sets the desired row position of the logo. Default is 4.
If set to
.Dq YES ,
the beastie boot menu will be skipped.
-The beastie boot menu is always skipped if booting UEFI or running non-x86
-hardware.
+The beastie boot menu is always skipped if running non-x86 hardware.
.It Va loader_delay
If set to a number higher than zero, introduces a delay before starting the
beastie boot menu. During the delay the user can press either Ctrl-C to skip
diff --git a/sys/boot/forth/loader.4th b/sys/boot/forth/loader.4th
index 43d2a8e..ad4042e 100644
--- a/sys/boot/forth/loader.4th
+++ b/sys/boot/forth/loader.4th
@@ -147,13 +147,14 @@ only forth definitions also support-functions
\ was succesfully loaded!
any_conf_read? if
s" loader_delay" getenv -1 = if
+ load_xen_throw
load_kernel
load_modules
else
drop
." Loading Kernel and Modules (Ctrl-C to Abort)" cr
s" also support-functions" evaluate
- s" set delay_command='load_kernel load_modules'" evaluate
+ s" set delay_command='load_xen_throw load_kernel load_modules'" evaluate
s" set delay_showdots" evaluate
delay_execute
then
diff --git a/sys/boot/forth/loader.conf.5 b/sys/boot/forth/loader.conf.5
index 3c1ce1d..c574a92 100644
--- a/sys/boot/forth/loader.conf.5
+++ b/sys/boot/forth/loader.conf.5
@@ -23,7 +23,7 @@
.\" SUCH DAMAGE.
.\"
.\" $FreeBSD$
-.Dd April 27, 2014
+.Dd January 20, 2016
.Dt LOADER.CONF 5
.Os
.Sh NAME
@@ -236,8 +236,7 @@ be displayed.
If set to
.Dq YES ,
the beastie boot menu will be skipped.
-The beastie boot menu is always skipped if booting UEFI or running non-x86
-hardware.
+The beastie boot menu is always skipped if running non-x86 hardware.
.It Va loader_logo Pq Dq Li orbbw
Selects a desired logo in the beastie boot menu.
Possible values are:
diff --git a/sys/boot/forth/support.4th b/sys/boot/forth/support.4th
index 1acef70..3d9990d 100644
--- a/sys/boot/forth/support.4th
+++ b/sys/boot/forth/support.4th
@@ -1460,6 +1460,20 @@ also builtins
abort" Unable to load a kernel!"
;
+: load_xen ( -- )
+ s" xen_kernel" getenv dup -1 <> if
+ 1 1 load
+ else
+ drop
+ 0
+ then
+;
+
+: load_xen_throw ( -- ) ( throws: abort )
+ load_xen
+ abort" Unable to load Xen!"
+;
+
: set_defaultoptions ( -- )
s" kernel_options" getenv dup -1 = if
drop
@@ -1578,12 +1592,15 @@ also builtins
else
drop
then
- r> if ( a path was passed )
- load_directory_or_file
- else
- standard_kernel_search
+ load_xen
+ ?dup 0= if ( success )
+ r> if ( a path was passed )
+ load_directory_or_file
+ else
+ standard_kernel_search
+ then
+ ?dup 0= if ['] load_modules catch then
then
- ?dup 0= if ['] load_modules catch then
;
only forth definitions
diff --git a/sys/boot/i386/libi386/Makefile b/sys/boot/i386/libi386/Makefile
index 1c4f049..d4fea80 100644
--- a/sys/boot/i386/libi386/Makefile
+++ b/sys/boot/i386/libi386/Makefile
@@ -6,7 +6,7 @@ INTERNALLIB=
SRCS= biosacpi.c bioscd.c biosdisk.c biosmem.c biospnp.c \
biospci.c biossmap.c bootinfo.c bootinfo32.c bootinfo64.c \
comconsole.c devicename.c elf32_freebsd.c \
- elf64_freebsd.c \
+ elf64_freebsd.c multiboot.c multiboot_tramp.S \
i386_copy.c i386_module.c nullconsole.c pxe.c pxetramp.s \
smbios.c time.c vidconsole.c amd64_tramp.S spinconsole.c
.PATH: ${.CURDIR}/../../zfs
@@ -65,6 +65,7 @@ machine:
# XXX: clang integrated-as doesn't grok .codeNN directives yet
CFLAGS.amd64_tramp.S= ${CLANG_NO_IAS}
+CFLAGS.multiboot_tramp.S= ${CLANG_NO_IAS}
CFLAGS+= ${CFLAGS.${.IMPSRC:T}}
.if ${MACHINE_CPUARCH} == "amd64"
diff --git a/sys/boot/i386/libi386/bootinfo64.c b/sys/boot/i386/libi386/bootinfo64.c
index 617414e..751e806 100644
--- a/sys/boot/i386/libi386/bootinfo64.c
+++ b/sys/boot/i386/libi386/bootinfo64.c
@@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$");
#include <sys/linker.h>
#include <machine/bootinfo.h>
#include <machine/cpufunc.h>
+#include <machine/metadata.h>
#include <machine/psl.h>
#include <machine/specialreg.h>
#include "bootstrap.h"
@@ -176,14 +177,15 @@ bi_checkcpu(void)
* - Module metadata are formatted and placed in kernel space.
*/
int
-bi_load64(char *args, vm_offset_t *modulep, vm_offset_t *kernendp)
+bi_load64(char *args, vm_offset_t addr, vm_offset_t *modulep,
+ vm_offset_t *kernendp, int add_smap)
{
struct preloaded_file *xp, *kfp;
struct i386_devdesc *rootdev;
struct file_metadata *md;
- vm_offset_t addr;
u_int64_t kernend;
u_int64_t envp;
+ u_int64_t module;
vm_offset_t size;
char *rootdevname;
int howto;
@@ -210,21 +212,18 @@ bi_load64(char *args, vm_offset_t *modulep, vm_offset_t *kernendp)
/* Try reading the /etc/fstab file to select the root device */
getrootmount(i386_fmtdev((void *)rootdev));
- /* find the last module in the chain */
- addr = 0;
- for (xp = file_findfile(NULL, NULL); xp != NULL; xp = xp->f_next) {
- if (addr < (xp->f_addr + xp->f_size))
- addr = xp->f_addr + xp->f_size;
+ if (addr == 0) {
+ /* find the last module in the chain */
+ for (xp = file_findfile(NULL, NULL); xp != NULL; xp = xp->f_next) {
+ if (addr < (xp->f_addr + xp->f_size))
+ addr = xp->f_addr + xp->f_size;
+ }
}
/* pad to a page boundary */
addr = roundup(addr, PAGE_SIZE);
- /* copy our environment */
- envp = addr;
- addr = bi_copyenv(addr);
-
- /* pad to a page boundary */
- addr = roundup(addr, PAGE_SIZE);
+ /* place the metadata before anything */
+ module = *modulep = addr;
kfp = file_findfile(NULL, "elf kernel");
if (kfp == NULL)
@@ -235,20 +234,30 @@ bi_load64(char *args, vm_offset_t *modulep, vm_offset_t *kernendp)
file_addmetadata(kfp, MODINFOMD_HOWTO, sizeof howto, &howto);
file_addmetadata(kfp, MODINFOMD_ENVP, sizeof envp, &envp);
file_addmetadata(kfp, MODINFOMD_KERNEND, sizeof kernend, &kernend);
- bios_addsmapdata(kfp);
+ file_addmetadata(kfp, MODINFOMD_MODULEP, sizeof module, &module);
+ if (add_smap != 0)
+ bios_addsmapdata(kfp);
- /* Figure out the size and location of the metadata */
- *modulep = addr;
size = bi_copymodules64(0);
- kernend = roundup(addr + size, PAGE_SIZE);
+
+ /* copy our environment */
+ envp = roundup(addr + size, PAGE_SIZE);
+ addr = bi_copyenv(envp);
+
+ /* set kernend */
+ kernend = roundup(addr, PAGE_SIZE);
*kernendp = kernend;
/* patch MODINFOMD_KERNEND */
md = file_findmetadata(kfp, MODINFOMD_KERNEND);
bcopy(&kernend, md->md_data, sizeof kernend);
+ /* patch MODINFOMD_ENVP */
+ md = file_findmetadata(kfp, MODINFOMD_ENVP);
+ bcopy(&envp, md->md_data, sizeof envp);
+
/* copy module list and metadata */
- (void)bi_copymodules64(addr);
+ (void)bi_copymodules64(*modulep);
return(0);
}
diff --git a/sys/boot/i386/libi386/elf64_freebsd.c b/sys/boot/i386/libi386/elf64_freebsd.c
index 627d416..338a745 100644
--- a/sys/boot/i386/libi386/elf64_freebsd.c
+++ b/sys/boot/i386/libi386/elf64_freebsd.c
@@ -81,7 +81,7 @@ elf64_exec(struct preloaded_file *fp)
return(EFTYPE);
ehdr = (Elf_Ehdr *)&(md->md_data);
- err = bi_load64(fp->f_args, &modulep, &kernend);
+ err = bi_load64(fp->f_args, 0, &modulep, &kernend, 1);
if (err != 0)
return(err);
diff --git a/sys/boot/i386/libi386/libi386.h b/sys/boot/i386/libi386/libi386.h
index 357b8fd..e8bdf65 100644
--- a/sys/boot/i386/libi386/libi386.h
+++ b/sys/boot/i386/libi386/libi386.h
@@ -117,6 +117,7 @@ void bi_setboothowto(int howto);
vm_offset_t bi_copyenv(vm_offset_t addr);
int bi_load32(char *args, int *howtop, int *bootdevp, vm_offset_t *bip,
vm_offset_t *modulep, vm_offset_t *kernend);
-int bi_load64(char *args, vm_offset_t *modulep, vm_offset_t *kernend);
+int bi_load64(char *args, vm_offset_t addr, vm_offset_t *modulep,
+ vm_offset_t *kernend, int add_smap);
void pxe_enable(void *pxeinfo);
diff --git a/sys/boot/i386/libi386/multiboot.c b/sys/boot/i386/libi386/multiboot.c
new file mode 100644
index 0000000..00e36f2
--- /dev/null
+++ b/sys/boot/i386/libi386/multiboot.c
@@ -0,0 +1,425 @@
+/*-
+ * Copyright (c) 2014 Roger Pau Monné <royger@FreeBSD.org>
+ * 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 AND CONTRIBUTORS ``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 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.
+ */
+
+/*
+ * This multiboot implementation only implements a subset of the full
+ * multiboot specification in order to be able to boot Xen and a
+ * FreeBSD Dom0. Trying to use it to boot other multiboot compliant
+ * kernels will most surely fail.
+ *
+ * The full multiboot specification can be found here:
+ * http://www.gnu.org/software/grub/manual/multiboot/multiboot.html
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <sys/param.h>
+#include <sys/exec.h>
+#include <sys/linker.h>
+#include <sys/module.h>
+#include <sys/stdint.h>
+#define _MACHINE_ELF_WANT_32BIT
+#include <machine/elf.h>
+#include <string.h>
+#include <stand.h>
+
+#include "bootstrap.h"
+#include "multiboot.h"
+#include "../i386/libi386/libi386.h"
+#include "../i386/btx/lib/btxv86.h"
+
+#define MULTIBOOT_SUPPORTED_FLAGS \
+ (MULTIBOOT_PAGE_ALIGN|MULTIBOOT_MEMORY_INFO)
+#define NUM_MODULES 2
+#define METADATA_FIXED_SIZE (PAGE_SIZE*4)
+#define METADATA_MODULE_SIZE PAGE_SIZE
+
+#define METADATA_RESV_SIZE(mod_num) \
+ roundup(METADATA_FIXED_SIZE + METADATA_MODULE_SIZE * mod_num, PAGE_SIZE)
+
+extern int elf32_loadfile_raw(char *filename, u_int64_t dest,
+ struct preloaded_file **result, int multiboot);
+extern int elf64_load_modmetadata(struct preloaded_file *fp, u_int64_t dest);
+extern int elf64_obj_loadfile(char *filename, u_int64_t dest,
+ struct preloaded_file **result);
+
+static int multiboot_loadfile(char *, u_int64_t, struct preloaded_file **);
+static int multiboot_exec(struct preloaded_file *);
+
+static int multiboot_obj_loadfile(char *, u_int64_t, struct preloaded_file **);
+static int multiboot_obj_exec(struct preloaded_file *fp);
+
+struct file_format multiboot = { multiboot_loadfile, multiboot_exec };
+struct file_format multiboot_obj =
+ { multiboot_obj_loadfile, multiboot_obj_exec };
+
+extern void multiboot_tramp();
+
+static const char mbl_name[] = "FreeBSD Loader";
+
+static int
+num_modules(struct preloaded_file *kfp)
+{
+ struct kernel_module *kmp;
+ int mod_num = 0;
+
+ for (kmp = kfp->f_modules; kmp != NULL; kmp = kmp->m_next)
+ mod_num++;
+
+ return (mod_num);
+}
+
+static vm_offset_t
+max_addr(void)
+{
+ struct preloaded_file *fp;
+ vm_offset_t addr = 0;
+
+ for (fp = file_findfile(NULL, NULL); fp != NULL; fp = fp->f_next) {
+ if (addr < (fp->f_addr + fp->f_size))
+ addr = fp->f_addr + fp->f_size;
+ }
+
+ return (addr);
+}
+
+static int
+multiboot_loadfile(char *filename, u_int64_t dest,
+ struct preloaded_file **result)
+{
+ uint32_t *magic;
+ int i, error;
+ caddr_t header_search;
+ ssize_t search_size;
+ int fd;
+ struct multiboot_header *header;
+ char *cmdline;
+
+ /*
+ * Read MULTIBOOT_SEARCH size in order to search for the
+ * multiboot magic header.
+ */
+ if (filename == NULL)
+ return (EFTYPE);
+ if ((fd = open(filename, O_RDONLY)) == -1)
+ return (errno);
+ header_search = malloc(MULTIBOOT_SEARCH);
+ if (header_search == NULL) {
+ close(fd);
+ return (ENOMEM);
+ }
+ search_size = read(fd, header_search, MULTIBOOT_SEARCH);
+ magic = (uint32_t *)header_search;
+
+ header = NULL;
+ for (i = 0; i < (search_size / sizeof(uint32_t)); i++) {
+ if (magic[i] == MULTIBOOT_HEADER_MAGIC) {
+ header = (struct multiboot_header *)&magic[i];
+ break;
+ }
+ }
+
+ if (header == NULL) {
+ error = EFTYPE;
+ goto out;
+ }
+
+ /* Valid multiboot header has been found, validate checksum */
+ if (header->magic + header->flags + header->checksum != 0) {
+ printf(
+ "Multiboot checksum failed, magic: 0x%x flags: 0x%x checksum: 0x%x\n",
+ header->magic, header->flags, header->checksum);
+ error = EFTYPE;
+ goto out;
+ }
+
+ if ((header->flags & ~MULTIBOOT_SUPPORTED_FLAGS) != 0) {
+ printf("Unsupported multiboot flags found: 0x%x\n",
+ header->flags);
+ error = EFTYPE;
+ goto out;
+ }
+
+ error = elf32_loadfile_raw(filename, dest, result, 1);
+ if (error != 0) {
+ printf(
+ "elf32_loadfile_raw failed: %d unable to load multiboot kernel\n",
+ error);
+ goto out;
+ }
+
+ /*
+ * f_addr is already aligned to PAGE_SIZE, make sure
+ * f_size it's also aligned so when the modules are loaded
+ * they are aligned to PAGE_SIZE.
+ */
+ (*result)->f_size = roundup((*result)->f_size, PAGE_SIZE);
+
+out:
+ free(header_search);
+ close(fd);
+ return (error);
+}
+
+static int
+multiboot_exec(struct preloaded_file *fp)
+{
+ vm_offset_t module_start, last_addr, metadata_size;
+ vm_offset_t modulep, kernend, entry;
+ struct file_metadata *md;
+ Elf_Ehdr *ehdr;
+ struct multiboot_info *mb_info = NULL;
+ struct multiboot_mod_list *mb_mod = NULL;
+ char *cmdline = NULL;
+ size_t len;
+ int error, mod_num;
+
+ /*
+ * Don't pass the memory size found by the bootloader, the memory
+ * available to Dom0 will be lower than that.
+ */
+ unsetenv("smbios.memory.enabled");
+
+ /* Allocate the multiboot struct and fill the basic details. */
+ mb_info = malloc(sizeof(struct multiboot_info));
+ if (mb_info == NULL) {
+ error = ENOMEM;
+ goto error;
+ }
+ bzero(mb_info, sizeof(struct multiboot_info));
+ mb_info->flags = MULTIBOOT_INFO_MEMORY|MULTIBOOT_INFO_BOOT_LOADER_NAME;
+ mb_info->mem_lower = bios_basemem / 1024;
+ mb_info->mem_upper = bios_extmem / 1024;
+ mb_info->boot_loader_name = VTOP(mbl_name);
+
+ /* Set the Xen command line. */
+ if (fp->f_args == NULL) {
+ /* Add the Xen command line if it is set. */
+ cmdline = getenv("xen_cmdline");
+ if (cmdline != NULL) {
+ fp->f_args = strdup(cmdline);
+ if (fp->f_args == NULL) {
+ error = ENOMEM;
+ goto error;
+ }
+ }
+ }
+ if (fp->f_args != NULL) {
+ len = strlen(fp->f_name) + 1 + strlen(fp->f_args) + 1;
+ cmdline = malloc(len);
+ if (cmdline == NULL) {
+ error = ENOMEM;
+ goto error;
+ }
+ snprintf(cmdline, len, "%s %s", fp->f_name, fp->f_args);
+ mb_info->cmdline = VTOP(cmdline);
+ mb_info->flags |= MULTIBOOT_INFO_CMDLINE;
+ }
+
+ /* Find the entry point of the Xen kernel and save it for later */
+ if ((md = file_findmetadata(fp, MODINFOMD_ELFHDR)) == NULL) {
+ printf("Unable to find %s entry point\n", fp->f_name);
+ error = EINVAL;
+ goto error;
+ }
+ ehdr = (Elf_Ehdr *)&(md->md_data);
+ entry = ehdr->e_entry & 0xffffff;
+
+ /*
+ * Prepare the multiboot module list, Xen assumes the first
+ * module is the Dom0 kernel, and the second one is the initramfs.
+ * This is not optimal for FreeBSD, that doesn't have a initramfs
+ * but instead loads modules dynamically and creates the metadata
+ * info on-the-fly.
+ *
+ * As expected, the first multiboot module is going to be the
+ * FreeBSD kernel loaded as a raw file. The second module is going
+ * to contain the metadata info and the loaded modules.
+ *
+ * On native FreeBSD loads all the modules and then places the
+ * metadata info at the end, but this is painful when running on Xen,
+ * because it relocates the second multiboot module wherever it
+ * likes. In order to workaround this limitation the metadata
+ * information is placed at the start of the second module and
+ * the original modulep value is saved together with the other
+ * metadata, so we can relocate everything.
+ */
+ fp = file_findfile(NULL, "elf kernel");
+ if (fp == NULL) {
+ printf("No FreeBSD kernel provided, aborting\n");
+ error = EINVAL;
+ goto error;
+ }
+
+ mb_mod = malloc(sizeof(struct multiboot_mod_list) * NUM_MODULES);
+ if (mb_mod == NULL) {
+ error = ENOMEM;
+ goto error;
+ }
+
+ bzero(mb_mod, sizeof(struct multiboot_mod_list) * NUM_MODULES);
+
+ /*
+ * Calculate how much memory is needed for the metatdata. We did
+ * an approximation of the maximum size when loading the kernel,
+ * but now we know the exact size, so we can release some of this
+ * preallocated memory if not needed.
+ */
+ last_addr = roundup(max_addr(), PAGE_SIZE);
+ mod_num = num_modules(fp);
+
+ /*
+ * Place the metadata after the last used address in order to
+ * calculate it's size, this will not be used.
+ */
+ error = bi_load64(fp->f_args, last_addr, &modulep, &kernend, 0);
+ if (error != 0) {
+ printf("bi_load64 failed: %d\n", error);
+ goto error;
+ }
+ metadata_size = roundup(kernend - last_addr, PAGE_SIZE);
+
+ /* Check that the size is not greater than what we have reserved */
+ if (metadata_size > METADATA_RESV_SIZE(mod_num)) {
+ printf("Required memory for metadata is greater than reserved "
+ "space, please increase METADATA_FIXED_SIZE and "
+ "METADATA_MODULE_SIZE and rebuild the loader\n");
+ error = ENOMEM;
+ goto error;
+ }
+
+ /*
+ * This is the position where the second multiboot module
+ * will be placed.
+ */
+ module_start = fp->f_addr + fp->f_size - metadata_size;
+
+ error = bi_load64(fp->f_args, module_start, &modulep, &kernend, 0);
+ if (error != 0) {
+ printf("bi_load64 failed: %d\n", error);
+ goto error;
+ }
+
+ mb_mod[0].mod_start = fp->f_addr;
+ mb_mod[0].mod_end = fp->f_addr + fp->f_size;
+ mb_mod[0].mod_end -= METADATA_RESV_SIZE(mod_num);
+
+ mb_mod[1].mod_start = module_start;
+ mb_mod[1].mod_end = last_addr;
+
+ mb_info->mods_count = NUM_MODULES;
+ mb_info->mods_addr = VTOP(mb_mod);
+ mb_info->flags |= MULTIBOOT_INFO_MODS;
+
+ dev_cleanup();
+ __exec((void *)VTOP(multiboot_tramp), (void *)entry,
+ (void *)VTOP(mb_info));
+
+ panic("exec returned");
+
+error:
+ if (mb_mod)
+ free(mb_mod);
+ if (mb_info)
+ free(mb_info);
+ if (cmdline)
+ free(cmdline);
+ return (error);
+}
+
+static int
+multiboot_obj_loadfile(char *filename, u_int64_t dest,
+ struct preloaded_file **result)
+{
+ struct preloaded_file *mfp, *kfp, *rfp;
+ struct kernel_module *kmp;
+ int error, mod_num;
+
+ /* See if there's a multiboot kernel loaded */
+ mfp = file_findfile(NULL, "elf multiboot kernel");
+ if (mfp == NULL)
+ return (EFTYPE);
+
+ /*
+ * We have a multiboot kernel loaded, see if there's a FreeBSD
+ * kernel loaded also.
+ */
+ kfp = file_findfile(NULL, "elf kernel");
+ if (kfp == NULL) {
+ /*
+ * No kernel loaded, this must be it. The kernel has to
+ * be loaded as a raw file, it will be processed by
+ * Xen and correctly loaded as an ELF file.
+ */
+ rfp = file_loadraw(filename, "elf kernel", 0);
+ if (rfp == NULL) {
+ printf(
+ "Unable to load %s as a multiboot payload kernel\n",
+ filename);
+ return (EINVAL);
+ }
+
+ /* Load kernel metadata... */
+ setenv("kernelname", filename, 1);
+ error = elf64_load_modmetadata(rfp, rfp->f_addr + rfp->f_size);
+ if (error) {
+ printf("Unable to load kernel %s metadata error: %d\n",
+ rfp->f_name, error);
+ return (EINVAL);
+ }
+
+ /*
+ * Save space at the end of the kernel in order to place
+ * the metadata information. We do an approximation of the
+ * max metadata size, this is not optimal but it's probably
+ * the best we can do at this point. Once all modules are
+ * loaded and the size of the metadata is known this
+ * space will be recovered if not used.
+ */
+ mod_num = num_modules(rfp);
+ rfp->f_size = roundup(rfp->f_size, PAGE_SIZE);
+ rfp->f_size += METADATA_RESV_SIZE(mod_num);
+ *result = rfp;
+ } else {
+ /* The rest should be loaded as regular modules */
+ error = elf64_obj_loadfile(filename, dest, result);
+ if (error != 0) {
+ printf("Unable to load %s as an object file, error: %d",
+ filename, error);
+ return (error);
+ }
+ }
+
+ return (0);
+}
+
+static int
+multiboot_obj_exec(struct preloaded_file *fp)
+{
+
+ return (EFTYPE);
+}
diff --git a/sys/boot/i386/libi386/multiboot.h b/sys/boot/i386/libi386/multiboot.h
new file mode 100644
index 0000000..819fa2e
--- /dev/null
+++ b/sys/boot/i386/libi386/multiboot.h
@@ -0,0 +1,225 @@
+/* multiboot.h - Multiboot header file. */
+/* Copyright (C) 1999,2003,2007,2008,2009 Free Software Foundation, Inc.
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the "Software"), to
+* deal in the Software without restriction, including without limitation the
+* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+* sell copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ANY
+* DEVELOPER OR DISTRIBUTOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+* IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+*
+* $FreeBSD$
+*/
+
+#ifndef MULTIBOOT_HEADER
+#define MULTIBOOT_HEADER 1
+
+/* How many bytes from the start of the file we search for the header. */
+#define MULTIBOOT_SEARCH 8192
+
+/* The magic field should contain this. */
+#define MULTIBOOT_HEADER_MAGIC 0x1BADB002
+
+/* This should be in %eax. */
+#define MULTIBOOT_BOOTLOADER_MAGIC 0x2BADB002
+
+/* The bits in the required part of flags field we don't support. */
+#define MULTIBOOT_UNSUPPORTED 0x0000fffc
+
+/* Alignment of multiboot modules. */
+#define MULTIBOOT_MOD_ALIGN 0x00001000
+
+/* Alignment of the multiboot info structure. */
+#define MULTIBOOT_INFO_ALIGN 0x00000004
+
+/* Flags set in the 'flags' member of the multiboot header. */
+
+/* Align all boot modules on i386 page (4KB) boundaries. */
+#define MULTIBOOT_PAGE_ALIGN 0x00000001
+
+/* Must pass memory information to OS. */
+#define MULTIBOOT_MEMORY_INFO 0x00000002
+
+/* Must pass video information to OS. */
+#define MULTIBOOT_VIDEO_MODE 0x00000004
+
+/* This flag indicates the use of the address fields in the header. */
+#define MULTIBOOT_AOUT_KLUDGE 0x00010000
+
+/* Flags to be set in the 'flags' member of the multiboot info structure. */
+
+/* is there basic lower/upper memory information? */
+#define MULTIBOOT_INFO_MEMORY 0x00000001
+/* is there a boot device set? */
+#define MULTIBOOT_INFO_BOOTDEV 0x00000002
+/* is the command-line defined? */
+#define MULTIBOOT_INFO_CMDLINE 0x00000004
+/* are there modules to do something with? */
+#define MULTIBOOT_INFO_MODS 0x00000008
+
+/* These next two are mutually exclusive */
+
+/* is there a symbol table loaded? */
+#define MULTIBOOT_INFO_AOUT_SYMS 0x00000010
+/* is there an ELF section header table? */
+#define MULTIBOOT_INFO_ELF_SHDR 0X00000020
+
+/* is there a full memory map? */
+#define MULTIBOOT_INFO_MEM_MAP 0x00000040
+
+/* Is there drive info? */
+#define MULTIBOOT_INFO_DRIVE_INFO 0x00000080
+
+/* Is there a config table? */
+#define MULTIBOOT_INFO_CONFIG_TABLE 0x00000100
+
+/* Is there a boot loader name? */
+#define MULTIBOOT_INFO_BOOT_LOADER_NAME 0x00000200
+
+/* Is there a APM table? */
+#define MULTIBOOT_INFO_APM_TABLE 0x00000400
+
+/* Is there video information? */
+#define MULTIBOOT_INFO_VIDEO_INFO 0x00000800
+
+#ifndef ASM_FILE
+
+typedef unsigned short multiboot_uint16_t;
+typedef unsigned int multiboot_uint32_t;
+typedef unsigned long long multiboot_uint64_t;
+
+struct multiboot_header
+{
+/* Must be MULTIBOOT_MAGIC - see above. */
+ multiboot_uint32_t magic;
+
+/* Feature flags. */
+ multiboot_uint32_t flags;
+
+/* The above fields plus this one must equal 0 mod 2^32. */
+ multiboot_uint32_t checksum;
+
+/* These are only valid if MULTIBOOT_AOUT_KLUDGE is set. */
+ multiboot_uint32_t header_addr;
+ multiboot_uint32_t load_addr;
+ multiboot_uint32_t load_end_addr;
+ multiboot_uint32_t bss_end_addr;
+ multiboot_uint32_t entry_addr;
+
+/* These are only valid if MULTIBOOT_VIDEO_MODE is set. */
+ multiboot_uint32_t mode_type;
+ multiboot_uint32_t width;
+ multiboot_uint32_t height;
+ multiboot_uint32_t depth;
+};
+
+/* The symbol table for a.out. */
+struct multiboot_aout_symbol_table
+{
+ multiboot_uint32_t tabsize;
+ multiboot_uint32_t strsize;
+ multiboot_uint32_t addr;
+ multiboot_uint32_t reserved;
+};
+typedef struct multiboot_aout_symbol_table multiboot_aout_symbol_table_t;
+
+/* The section header table for ELF. */
+struct multiboot_elf_section_header_table
+{
+ multiboot_uint32_t num;
+ multiboot_uint32_t size;
+ multiboot_uint32_t addr;
+ multiboot_uint32_t shndx;
+};
+typedef struct multiboot_elf_section_header_table multiboot_elf_section_header_table_t;
+
+struct multiboot_info
+{
+/* Multiboot info version number */
+ multiboot_uint32_t flags;
+
+/* Available memory from BIOS */
+ multiboot_uint32_t mem_lower;
+ multiboot_uint32_t mem_upper;
+
+/* "root" partition */
+ multiboot_uint32_t boot_device;
+
+/* Kernel command line */
+ multiboot_uint32_t cmdline;
+
+/* Boot-Module list */
+ multiboot_uint32_t mods_count;
+ multiboot_uint32_t mods_addr;
+
+ union
+ {
+ multiboot_aout_symbol_table_t aout_sym;
+ multiboot_elf_section_header_table_t elf_sec;
+ } u;
+
+/* Memory Mapping buffer */
+ multiboot_uint32_t mmap_length;
+ multiboot_uint32_t mmap_addr;
+
+/* Drive Info buffer */
+ multiboot_uint32_t drives_length;
+ multiboot_uint32_t drives_addr;
+
+/* ROM configuration table */
+ multiboot_uint32_t config_table;
+
+/* Boot Loader Name */
+ multiboot_uint32_t boot_loader_name;
+
+/* APM table */
+ multiboot_uint32_t apm_table;
+
+/* Video */
+ multiboot_uint32_t vbe_control_info;
+ multiboot_uint32_t vbe_mode_info;
+ multiboot_uint16_t vbe_mode;
+ multiboot_uint16_t vbe_interface_seg;
+ multiboot_uint16_t vbe_interface_off;
+ multiboot_uint16_t vbe_interface_len;
+};
+typedef struct multiboot_info multiboot_info_t;
+
+struct multiboot_mmap_entry
+{
+ multiboot_uint32_t size;
+ multiboot_uint64_t addr;
+ multiboot_uint64_t len;
+#define MULTIBOOT_MEMORY_AVAILABLE 1
+#define MULTIBOOT_MEMORY_RESERVED 2
+ multiboot_uint32_t type;
+} __attribute__((packed));
+typedef struct multiboot_mmap_entry multiboot_memory_map_t;
+
+struct multiboot_mod_list
+{
+/* the memory used goes from bytes 'mod_start' to 'mod_end-1' inclusive */
+ multiboot_uint32_t mod_start;
+ multiboot_uint32_t mod_end;
+
+/* Module command line */
+ multiboot_uint32_t cmdline;
+
+/* padding to take it to 16 bytes (must be zero) */
+ multiboot_uint32_t pad;
+};
+typedef struct multiboot_mod_list multiboot_module_t;
+
+#endif /* ! ASM_FILE */
+
+#endif /* ! MULTIBOOT_HEADER */
diff --git a/sys/boot/i386/libi386/multiboot_tramp.S b/sys/boot/i386/libi386/multiboot_tramp.S
new file mode 100644
index 0000000..0bd6043
--- /dev/null
+++ b/sys/boot/i386/libi386/multiboot_tramp.S
@@ -0,0 +1,51 @@
+/*-
+ * Copyright (c) 2014 Roger Pau Monné <royger@FreeBSD.org>
+ * 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 AND CONTRIBUTORS ``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 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.
+ *
+ * $FreeBSD$
+ */
+
+#define ASM_FILE
+#include "multiboot.h"
+
+/*
+ * The multiboot specification requires the executable to be launched
+ * with %cs set to a flat read/execute segment with offset 0 and limit
+ * 0xFFFFFFFF, and the rest of the segment registers (%ds, %es, %fs,
+ * %gs, %ss) to flat read/write segments with the same offset and limit.
+ * This is already done by the BTX code before calling multiboot_tramp,
+ * so there is no need to do anything here.
+ */
+
+ .globl multiboot_tramp
+multiboot_tramp:
+ /* Be sure that interrupts are disabled. */
+ cli
+
+ movl $MULTIBOOT_BOOTLOADER_MAGIC, %eax
+ /* Get the entry point and address of the multiboot_info parameter. */
+ movl 8(%esp), %ebx
+ movl 4(%esp), %ecx
+
+ call *%ecx
diff --git a/sys/boot/i386/loader/conf.c b/sys/boot/i386/loader/conf.c
index fda6fd2..38df74d 100644
--- a/sys/boot/i386/loader/conf.c
+++ b/sys/boot/i386/loader/conf.c
@@ -107,8 +107,12 @@ extern struct file_format i386_elf;
extern struct file_format i386_elf_obj;
extern struct file_format amd64_elf;
extern struct file_format amd64_elf_obj;
+extern struct file_format multiboot;
+extern struct file_format multiboot_obj;
struct file_format *file_formats[] = {
+ &multiboot,
+ &multiboot_obj,
#ifdef LOADER_PREFER_AMD64
&amd64_elf,
&amd64_elf_obj,
diff --git a/sys/boot/i386/zfsboot/zfsboot.c b/sys/boot/i386/zfsboot/zfsboot.c
index afb77b2..ca82c63 100644
--- a/sys/boot/i386/zfsboot/zfsboot.c
+++ b/sys/boot/i386/zfsboot/zfsboot.c
@@ -238,7 +238,7 @@ bios_getmem(void)
v86.es = VTOPSEG(&smap);
v86.edi = VTOPOFF(&smap);
v86int();
- if ((v86.efl & 1) || (v86.eax != SMAP_SIG))
+ if (V86_CY(v86.efl) || (v86.eax != SMAP_SIG))
break;
/* look for a low-memory segment that's large enough */
if ((smap.type == SMAP_TYPE_MEMORY) && (smap.base == 0) &&
@@ -285,7 +285,7 @@ bios_getmem(void)
v86.addr = 0x15; /* int 0x15 function 0xe801*/
v86.eax = 0xe801;
v86int();
- if (!(v86.efl & 1)) {
+ if (!V86_CY(v86.efl)) {
bios_extmem = ((v86.ecx & 0xffff) + ((v86.edx & 0xffff) * 64)) * 1024;
}
}
@@ -320,7 +320,7 @@ int13probe(int drive)
v86.edx = drive;
v86int();
- if (!(v86.efl & 0x1) && /* carry clear */
+ if (!V86_CY(v86.efl) && /* carry clear */
((v86.edx & 0xff) != (drive & DRV_MASK))) { /* unit # OK */
if ((v86.ecx & 0x3f) == 0) { /* absurd sector size */
return(0); /* skip device */
diff --git a/sys/boot/ia64/efi/Makefile b/sys/boot/ia64/efi/Makefile
index 6bb53b5..18b6d3a 100644
--- a/sys/boot/ia64/efi/Makefile
+++ b/sys/boot/ia64/efi/Makefile
@@ -37,7 +37,6 @@ FILESMODE_loader.efi= ${BINMODE}
loader.efi: loader.sym
if [ `${OBJDUMP} -t ${.ALLSRC} | fgrep '*UND*' | wc -l` != 0 ]; then \
${OBJDUMP} -t ${.ALLSRC} | fgrep '*UND*'; \
- rm ${.ALLSRC}; \
exit 1; \
fi
${OBJCOPY} -j .data -j .dynamic -j .dynstr -j .dynsym -j .hash \
diff --git a/sys/boot/libstand32/Makefile b/sys/boot/libstand32/Makefile
index 1fc04a2..4ee8690 100644
--- a/sys/boot/libstand32/Makefile
+++ b/sys/boot/libstand32/Makefile
@@ -63,8 +63,8 @@ SRCS+= ntoh.c
.if ${MACHINE_CPUARCH} != "ia64"
SRCS+= bcmp.c bcopy.c bzero.c ffs.c memccpy.c memchr.c memcmp.c memcpy.c \
memmove.c memset.c qdivrem.c strcat.c strchr.c strcmp.c strcpy.c \
- strcspn.c strlen.c strncat.c strncmp.c strncpy.c strpbrk.c \
- strrchr.c strsep.c strspn.c strstr.c strtok.c swab.c
+ strcspn.c strlcat.c strlcpy.c strlen.c strncat.c strncmp.c strncpy.c \
+ strpbrk.c strrchr.c strsep.c strspn.c strstr.c strtok.c swab.c
.endif
.if ${MACHINE_CPUARCH} == "arm"
.PATH: ${LIBC}/arm/gen
diff --git a/sys/boot/pc98/boot2/boot2.c b/sys/boot/pc98/boot2/boot2.c
index 69a422e..72aae7d 100644
--- a/sys/boot/pc98/boot2/boot2.c
+++ b/sys/boot/pc98/boot2/boot2.c
@@ -326,7 +326,7 @@ bd_getbigeom(int bunit)
v86.addr = 0x1b;
v86.eax = 0x8400 | unit;
v86int();
- if (v86.efl & 0x1)
+ if (V86_CY(v86.efl))
return 0x4F020F; /* 1200KB FD C:80 H:2 S:15 */
return ((v86.ecx & 0xffff) << 16) | (v86.edx & 0xffff);
}
diff --git a/sys/boot/pc98/libpc98/biosdisk.c b/sys/boot/pc98/libpc98/biosdisk.c
index 96dbd1f..b777d25 100644
--- a/sys/boot/pc98/libpc98/biosdisk.c
+++ b/sys/boot/pc98/libpc98/biosdisk.c
@@ -824,7 +824,7 @@ bd_chs_io(struct open_disk *od, daddr_t dblk, int blks, caddr_t dest, int write)
v86.es = VTOPSEG(dest);
v86.ebp = VTOPOFF(dest);
v86int();
- return (v86.efl & 0x1);
+ return (V86_CY(v86.efl));
}
static int
@@ -959,7 +959,7 @@ bd_getgeom(struct open_disk *od)
od->od_cyl = v86.ecx;
od->od_hds = (v86.edx >> 8) & 0xff;
od->od_sec = v86.edx & 0xff;
- if (v86.efl & 0x1)
+ if (V86_CY(v86.efl))
return(1);
}
@@ -1010,7 +1010,7 @@ bd_getbigeom(int bunit)
v86.addr = 0x1b;
v86.eax = 0x8400 | unit;
v86int();
- if (v86.efl & 0x1)
+ if (V86_CY(v86.efl))
return 0x4F020F; /* 1200KB FD C:80 H:2 S:15 */
return ((v86.ecx & 0xffff) << 16) | (v86.edx & 0xffff);
}
diff --git a/sys/boot/uboot/common/main.c b/sys/boot/uboot/common/main.c
index b830354..d860d97 100644
--- a/sys/boot/uboot/common/main.c
+++ b/sys/boot/uboot/common/main.c
@@ -315,7 +315,7 @@ print_disk_probe_info()
else
strcpy(slice, "<auto>");
- if (currdev.d_disk.partition > 0)
+ if (currdev.d_disk.partition >= 0)
sprintf(partition, "%d", currdev.d_disk.partition);
else
strcpy(partition, "<auto>");
@@ -382,7 +382,7 @@ probe_disks(int devidx, int load_type, int load_unit, int load_slice,
printf("\n");
}
- printf(" Requested disk type/unit not found\n");
+ printf(" Requested disk type/unit/slice/partition not found\n");
return (-1);
}
@@ -392,7 +392,7 @@ main(void)
struct api_signature *sig = NULL;
int load_type, load_unit, load_slice, load_partition;
int i;
- const char * loaderdev;
+ const char *ldev;
/*
* If we can't find the magic signature and related info, exit with a
@@ -485,10 +485,10 @@ main(void)
return (0xbadef1ce);
}
- env_setenv("currdev", EV_VOLATILE, uboot_fmtdev(&currdev),
- uboot_setcurrdev, env_nounset);
- env_setenv("loaddev", EV_VOLATILE, uboot_fmtdev(&currdev),
- env_noset, env_nounset);
+ ldev = uboot_fmtdev(&currdev);
+ env_setenv("currdev", EV_VOLATILE, ldev, uboot_setcurrdev, env_nounset);
+ env_setenv("loaddev", EV_VOLATILE, ldev, env_noset, env_nounset);
+ printf("Booting from %s\n", ldev);
setenv("LINES", "24", 1); /* optional */
setenv("prompt", "loader>", 1);
@@ -573,17 +573,47 @@ enum ubenv_action {
static void
handle_uboot_env_var(enum ubenv_action action, const char * var)
{
- const char * val;
- char ubv[128];
+ char ldvar[128];
+ const char *val;
+ char *wrk;
+ int len;
+
+ /*
+ * On an import with the variable name formatted as ldname=ubname,
+ * import the uboot variable ubname into the loader variable ldname,
+ * otherwise the historical behavior is to import to uboot.ubname.
+ */
+ if (action == UBENV_IMPORT) {
+ len = strcspn(var, "=");
+ if (len == 0) {
+ printf("name cannot start with '=': '%s'\n", var);
+ return;
+ }
+ if (var[len] == 0) {
+ strcpy(ldvar, "uboot.");
+ strncat(ldvar, var, sizeof(ldvar) - 7);
+ } else {
+ len = MIN(len, sizeof(ldvar) - 1);
+ strncpy(ldvar, var, len);
+ ldvar[len] = 0;
+ var = &var[len + 1];
+ }
+ }
/*
* If the user prepended "uboot." (which is how they usually see these
* names) strip it off as a convenience.
*/
if (strncmp(var, "uboot.", 6) == 0) {
- snprintf(ubv, sizeof(ubv), "%s", &var[6]);
- var = ubv;
+ var = &var[6];
}
+
+ /* If there is no variable name left, punt. */
+ if (var[0] == 0) {
+ printf("empty variable name\n");
+ return;
+ }
+
val = ub_env_get(var);
if (action == UBENV_SHOW) {
if (val == NULL)
@@ -592,8 +622,7 @@ handle_uboot_env_var(enum ubenv_action action, const char * var)
printf("uboot.%s=%s\n", var, val);
} else if (action == UBENV_IMPORT) {
if (val != NULL) {
- snprintf(ubv, sizeof(ubv), "uboot.%s", var);
- setenv(ubv, val, 1);
+ setenv(ldvar, val, 1);
}
}
}
diff --git a/sys/boot/uboot/lib/copy.c b/sys/boot/uboot/lib/copy.c
index bb658e3..76f2faf 100644
--- a/sys/boot/uboot/lib/copy.c
+++ b/sys/boot/uboot/lib/copy.c
@@ -69,11 +69,11 @@ uint64_t
uboot_loadaddr(u_int type, void *data, uint64_t addr)
{
struct sys_info *si;
- uintptr_t sblock, eblock, subldr, eubldr;
- uintptr_t biggest_block, this_block;
- size_t biggest_size, this_size;
+ uint64_t sblock, eblock, subldr, eubldr;
+ uint64_t biggest_block, this_block;
+ uint64_t biggest_size, this_size;
int i;
- char * envstr;
+ char *envstr;
if (addr == 0) {
/*
@@ -101,13 +101,14 @@ uboot_loadaddr(u_int type, void *data, uint64_t addr)
biggest_block = 0;
biggest_size = 0;
subldr = rounddown2((uintptr_t)_start, KERN_ALIGN);
- eubldr = roundup2(uboot_heap_end, KERN_ALIGN);
+ eubldr = roundup2((uint64_t)uboot_heap_end, KERN_ALIGN);
for (i = 0; i < si->mr_no; i++) {
if (si->mr[i].flags != MR_ATTR_DRAM)
continue;
- sblock = roundup2(si->mr[i].start, KERN_ALIGN);
- eblock = rounddown2(si->mr[i].start + si->mr[i].size,
+ sblock = roundup2((uint64_t)si->mr[i].start,
KERN_ALIGN);
+ eblock = rounddown2((uint64_t)si->mr[i].start +
+ si->mr[i].size, KERN_ALIGN);
if (biggest_size == 0)
sblock += KERN_MINADDR;
if (subldr >= sblock && subldr < eblock) {
@@ -127,9 +128,10 @@ uboot_loadaddr(u_int type, void *data, uint64_t addr)
if (biggest_size == 0)
panic("Not enough DRAM to load kernel\n");
#if 0
- printf("Loading kernel into region 0x%08x-0x%08x (%u MiB)\n",
- biggest_block, biggest_block + biggest_size - 1,
- biggest_size / 1024 / 1024);
+ printf("Loading kernel into region 0x%08jx-0x%08jx (%ju MiB)\n",
+ (uintmax_t)biggest_block,
+ (uintmax_t)biggest_block + biggest_size - 1,
+ (uintmax_t)biggest_size / 1024 / 1024);
#endif
return (biggest_block);
}
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c
index fd3e537..ee0b52f 100644
--- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c
+++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c
@@ -607,7 +607,6 @@ spa_prop_validate(spa_t *spa, nvlist_t *props)
error = SET_ERROR(EINVAL);
break;
}
- check++;
}
if (strlen(strval) > ZPROP_MAX_COMMENT)
error = E2BIG;
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c
index 49d87e6..9f83abb 100644
--- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c
+++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c
@@ -520,7 +520,7 @@ vdev_queue_class_min_active(zio_priority_t p)
}
}
-static int
+static __noinline int
vdev_queue_max_async_writes(spa_t *spa)
{
int writes;
diff --git a/sys/cddl/dev/systrace/systrace.c b/sys/cddl/dev/systrace/systrace.c
index 921393c..1796091 100644
--- a/sys/cddl/dev/systrace/systrace.c
+++ b/sys/cddl/dev/systrace/systrace.c
@@ -60,24 +60,37 @@
#ifdef LINUX_SYSTRACE
#if defined(__amd64__)
-#include <amd64/linux32/linux.h>
-#include <amd64/linux32/linux32_proto.h>
-#include <amd64/linux32/linux32_syscalls.c>
-#include <amd64/linux32/linux32_systrace_args.c>
-#define MODNAME "linux32"
+#include <amd64/linux/linux.h>
+#include <amd64/linux/linux_proto.h>
+#include <amd64/linux/linux_syscalls.c>
+#include <amd64/linux/linux_systrace_args.c>
#elif defined(__i386__)
#include <i386/linux/linux.h>
#include <i386/linux/linux_proto.h>
#include <i386/linux/linux_syscalls.c>
#include <i386/linux/linux_systrace_args.c>
-#define MODNAME "linux"
#else
#error Only i386 and amd64 are supported.
#endif
+#define MODNAME "linux"
extern struct sysent linux_sysent[];
#define MAXSYSCALL LINUX_SYS_MAXSYSCALL
#define SYSCALLNAMES linux_syscallnames
#define SYSENT linux_sysent
+#elif defined(LINUX32_SYSTRACE)
+#if defined(__amd64__)
+#include <amd64/linux32/linux.h>
+#include <amd64/linux32/linux32_proto.h>
+#include <amd64/linux32/linux32_syscalls.c>
+#include <amd64/linux32/linux32_systrace_args.c>
+#else
+#error Only amd64 is supported.
+#endif
+#define MODNAME "linux32"
+extern struct sysent linux32_sysent[];
+#define MAXSYSCALL LINUX32_SYS_MAXSYSCALL
+#define SYSCALLNAMES linux32_syscallnames
+#define SYSENT linux32_sysent
#elif defined(FREEBSD32_SYSTRACE)
/*
* The syscall arguments are processed into a DTrace argument array
@@ -103,6 +116,7 @@ extern const char *freebsd32_syscallnames[];
#define MAXSYSCALL SYS_MAXSYSCALL
#define SYSCALLNAMES syscallnames
#define SYSENT sysent
+#define NATIVE_ABI
#endif
#define PROVNAME "syscall"
@@ -132,7 +146,7 @@ static void systrace_load(void *);
static struct cdevsw systrace_cdevsw = {
.d_version = D_VERSION,
.d_open = systrace_open,
-#ifdef LINUX_SYSTRACE
+#ifndef NATIVE_ABI
.d_name = "systrace_" MODNAME,
#else
.d_name = "systrace",
@@ -171,7 +185,7 @@ static dtrace_provider_id_t systrace_id;
typedef void (*systrace_dtrace_probe_t)(dtrace_id_t, uintptr_t, uintptr_t,
uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t);
-#if !defined(LINUX_SYSTRACE)
+#ifdef NATIVE_ABI
/*
* Probe callback function.
*
@@ -314,7 +328,7 @@ systrace_load(void *dummy)
NULL, &systrace_pops, NULL, &systrace_id) != 0)
return;
-#if !defined(LINUX_SYSTRACE)
+#ifdef NATIVE_ABI
systrace_probe_func = systrace_probe;
#endif
}
@@ -328,7 +342,7 @@ systrace_unload()
if ((error = dtrace_unregister(systrace_id)) != 0)
return (error);
-#if !defined(LINUX_SYSTRACE)
+#ifdef NATIVE_ABI
systrace_probe_func = NULL;
#endif
@@ -370,6 +384,16 @@ SYSINIT(systrace_load, SI_SUB_DTRACE_PROVIDER, SI_ORDER_ANY, systrace_load, NULL
SYSUNINIT(systrace_unload, SI_SUB_DTRACE_PROVIDER, SI_ORDER_ANY, systrace_unload, NULL);
#ifdef LINUX_SYSTRACE
+DEV_MODULE(systrace_linux, systrace_modevent, NULL);
+MODULE_VERSION(systrace_linux, 1);
+#ifdef __amd64__
+MODULE_DEPEND(systrace_linux, linux64, 1, 1, 1);
+#else
+MODULE_DEPEND(systrace_linux, linux, 1, 1, 1);
+#endif
+MODULE_DEPEND(systrace_linux, dtrace, 1, 1, 1);
+MODULE_DEPEND(systrace_linux, opensolaris, 1, 1, 1);
+#elif defined(LINUX32_SYSTRACE)
DEV_MODULE(systrace_linux32, systrace_modevent, NULL);
MODULE_VERSION(systrace_linux32, 1);
MODULE_DEPEND(systrace_linux32, linux, 1, 1, 1);
diff --git a/sys/compat/ia32/ia32_sysvec.c b/sys/compat/ia32/ia32_sysvec.c
index 206935a..d2870ce 100644
--- a/sys/compat/ia32/ia32_sysvec.c
+++ b/sys/compat/ia32/ia32_sysvec.c
@@ -140,6 +140,7 @@ struct sysentvec ia32_freebsd_sysvec = {
.sv_shared_page_len = PAGE_SIZE,
.sv_schedtail = NULL,
.sv_thread_detach = NULL,
+ .sv_trap = NULL,
};
INIT_SYSENTVEC(elf_ia32_sysvec, &ia32_freebsd_sysvec);
diff --git a/sys/compat/linux/linux_misc.c b/sys/compat/linux/linux_misc.c
index 8f2a687..538b9dc 100644
--- a/sys/compat/linux/linux_misc.c
+++ b/sys/compat/linux/linux_misc.c
@@ -2362,7 +2362,13 @@ linux_ppoll(struct thread *td, struct linux_ppoll_args *args)
#if defined(DEBUG) || defined(KTR)
/* XXX: can be removed when every ldebug(...) and KTR stuff are removed. */
-u_char linux_debug_map[howmany(LINUX_SYS_MAXSYSCALL, sizeof(u_char))];
+#ifdef COMPAT_LINUX32
+#define L_MAXSYSCALL LINUX32_SYS_MAXSYSCALL
+#else
+#define L_MAXSYSCALL LINUX_SYS_MAXSYSCALL
+#endif
+
+u_char linux_debug_map[howmany(L_MAXSYSCALL, sizeof(u_char))];
static int
linux_debug(int syscall, int toggle, int global)
@@ -2374,7 +2380,7 @@ linux_debug(int syscall, int toggle, int global)
memset(linux_debug_map, c, sizeof(linux_debug_map));
return (0);
}
- if (syscall < 0 || syscall >= LINUX_SYS_MAXSYSCALL)
+ if (syscall < 0 || syscall >= L_MAXSYSCALL)
return (EINVAL);
if (toggle)
clrbit(linux_debug_map, syscall);
@@ -2382,6 +2388,7 @@ linux_debug(int syscall, int toggle, int global)
setbit(linux_debug_map, syscall);
return (0);
}
+#undef L_MAXSYSCALL
/*
* Usage: sysctl linux.debug=<syscall_nr>.<0/1>
diff --git a/sys/compat/linux/linux_socket.c b/sys/compat/linux/linux_socket.c
index 34af9da..dee4093 100644
--- a/sys/compat/linux/linux_socket.c
+++ b/sys/compat/linux/linux_socket.c
@@ -1164,6 +1164,7 @@ linux_sendmsg_common(struct thread *td, l_int s, struct l_msghdr *msghdr,
msg.msg_iov = iov;
msg.msg_flags = 0;
error = linux_sendit(td, s, &msg, flags, control, UIO_USERSPACE);
+ control = NULL;
bad:
m_freem(control);
diff --git a/sys/compat/svr4/svr4_sysvec.c b/sys/compat/svr4/svr4_sysvec.c
index 125a7d8..8b339c8 100644
--- a/sys/compat/svr4/svr4_sysvec.c
+++ b/sys/compat/svr4/svr4_sysvec.c
@@ -197,6 +197,7 @@ struct sysentvec svr4_sysvec = {
.sv_syscallnames = NULL,
.sv_schedtail = NULL,
.sv_thread_detach = NULL,
+ .sv_trap = NULL,
};
const char svr4_emul_path[] = "/compat/svr4";
diff --git a/sys/conf/files.amd64 b/sys/conf/files.amd64
index 268892b..445912a 100644
--- a/sys/conf/files.amd64
+++ b/sys/conf/files.amd64
@@ -322,6 +322,7 @@ dev/sfxge/common/efx_ev.c optional sfxge pci
dev/sfxge/common/efx_filter.c optional sfxge pci
dev/sfxge/common/efx_hash.c optional sfxge pci
dev/sfxge/common/efx_intr.c optional sfxge pci
+dev/sfxge/common/efx_lic.c optional sfxge pci
dev/sfxge/common/efx_mac.c optional sfxge pci
dev/sfxge/common/efx_mcdi.c optional sfxge pci
dev/sfxge/common/efx_mon.c optional sfxge pci
diff --git a/sys/dev/drm2/i915/intel_iic.c b/sys/dev/drm2/i915/intel_iic.c
index 36a5b9e..30be2efb 100644
--- a/sys/dev/drm2/i915/intel_iic.c
+++ b/sys/dev/drm2/i915/intel_iic.c
@@ -467,8 +467,7 @@ timeout:
* Try GPIO bitbanging instead.
*/
sc->force_bit_dev = true;
- error = -IICBUS_TRANSFER(idev, msgs, nmsgs);
- goto out;
+ error = -IICBUS_TRANSFER(dev_priv->bbbus[unit], msgs, nmsgs);
out:
sx_xunlock(&dev_priv->gmbus_sx);
diff --git a/sys/dev/e1000/if_igb.c b/sys/dev/e1000/if_igb.c
index 088ba1e..c4dc51d 100644
--- a/sys/dev/e1000/if_igb.c
+++ b/sys/dev/e1000/if_igb.c
@@ -1313,7 +1313,8 @@ igb_init_locked(struct adapter *adapter)
if (ifp->if_capenable & IFCAP_TXCSUM) {
ifp->if_hwassist |= (CSUM_TCP | CSUM_UDP);
#if __FreeBSD_version >= 800000
- if (adapter->hw.mac.type == e1000_82576)
+ if ((adapter->hw.mac.type == e1000_82576) ||
+ (adapter->hw.mac.type == e1000_82580))
ifp->if_hwassist |= CSUM_SCTP;
#endif
}
@@ -4587,8 +4588,9 @@ igb_initialize_receive_units(struct adapter *adapter)
rxcsum |= E1000_RXCSUM_PCSD;
#if __FreeBSD_version >= 800000
/* For SCTP Offload */
- if ((hw->mac.type == e1000_82576)
- && (ifp->if_capenable & IFCAP_RXCSUM))
+ if (((hw->mac.type == e1000_82576) ||
+ (hw->mac.type == e1000_82580)) &&
+ (ifp->if_capenable & IFCAP_RXCSUM))
rxcsum |= E1000_RXCSUM_CRCOFL;
#endif
} else {
@@ -4596,7 +4598,8 @@ igb_initialize_receive_units(struct adapter *adapter)
if (ifp->if_capenable & IFCAP_RXCSUM) {
rxcsum |= E1000_RXCSUM_IPPCSE;
#if __FreeBSD_version >= 800000
- if (adapter->hw.mac.type == e1000_82576)
+ if ((adapter->hw.mac.type == e1000_82576) ||
+ (adapter->hw.mac.type == e1000_82580))
rxcsum |= E1000_RXCSUM_CRCOFL;
#endif
} else
diff --git a/sys/dev/iicbus/icee.c b/sys/dev/iicbus/icee.c
index 800ec4c..fffb356 100644
--- a/sys/dev/iicbus/icee.c
+++ b/sys/dev/iicbus/icee.c
@@ -27,6 +27,9 @@ __FBSDID("$FreeBSD$");
/*
* Generic IIC eeprom support, modeled after the AT24C family of products.
*/
+
+#include "opt_platform.h"
+
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/bus.h>
@@ -37,26 +40,73 @@ __FBSDID("$FreeBSD$");
#include <sys/sx.h>
#include <sys/uio.h>
#include <machine/bus.h>
+
+#ifdef FDT
+#include <dev/ofw/ofw_bus.h>
+#include <dev/ofw/ofw_bus_subr.h>
+#endif
+
#include <dev/iicbus/iiconf.h>
#include <dev/iicbus/iicbus.h>
#include "iicbus_if.h"
-#define IIC_M_WR 0 /* write operation */
+/*
+ * AT24 parts have a "write page size" that differs per-device, and a "read page
+ * size" that is always equal to the full device size. We define maximum values
+ * here to limit how long we occupy the bus with a single transfer, and because
+ * there are temporary buffers of these sizes allocated on the stack.
+ */
#define MAX_RD_SZ 256 /* Largest read size we support */
-#define MAX_WR_SZ 256 /* Largest write size we support */
+#define MAX_WR_SZ 256 /* Largest write size we support */
struct icee_softc {
- device_t sc_dev; /* Myself */
- device_t sc_busdev; /* Parent bus */
+ device_t dev; /* Myself */
struct cdev *cdev; /* user interface */
- int addr;
+ int addr; /* Slave address on the bus */
int size; /* How big am I? */
- int type; /* What type 8 or 16 bit? */
- int rd_sz; /* What's the read page size */
+ int type; /* What address type 8 or 16 bit? */
int wr_sz; /* What's the write page size */
};
+#ifdef FDT
+struct eeprom_desc {
+ int type;
+ int size;
+ int wr_sz;
+ const char *name;
+};
+
+static struct eeprom_desc type_desc[] = {
+ { 8, 128, 8, "AT24C01"},
+ { 8, 256, 8, "AT24C02"},
+ { 8, 512, 16, "AT24C04"},
+ { 8, 1024, 16, "AT24C08"},
+ { 8, 2 * 1024, 16, "AT24C16"},
+ {16, 4 * 1024, 32, "AT24C32"},
+ {16, 8 * 1024, 32, "AT24C64"},
+ {16, 16 * 1024, 64, "AT24C128"},
+ {16, 32 * 1024, 64, "AT24C256"},
+ {16, 64 * 1024, 128, "AT24C512"},
+ {16, 128 * 1024, 256, "AT24CM01"},
+};
+
+static struct ofw_compat_data compat_data[] = {
+ {"atmel,24c01", (uintptr_t)(&type_desc[0])},
+ {"atmel,24c02", (uintptr_t)(&type_desc[1])},
+ {"atmel,24c04", (uintptr_t)(&type_desc[2])},
+ {"atmel,24c08", (uintptr_t)(&type_desc[3])},
+ {"atmel,24c16", (uintptr_t)(&type_desc[4])},
+ {"atmel,24c32", (uintptr_t)(&type_desc[5])},
+ {"atmel,24c64", (uintptr_t)(&type_desc[6])},
+ {"atmel,24c128", (uintptr_t)(&type_desc[7])},
+ {"atmel,24c256", (uintptr_t)(&type_desc[8])},
+ {"atmel,24c512", (uintptr_t)(&type_desc[9])},
+ {"atmel,24c1024", (uintptr_t)(&type_desc[10])},
+ {NULL, (uintptr_t)NULL},
+};
+#endif
+
#define CDEV2SOFTC(dev) ((dev)->si_drv1)
/* cdev routines */
@@ -75,6 +125,39 @@ static struct cdevsw icee_cdevsw =
.d_write = icee_write
};
+#ifdef FDT
+static int
+icee_probe(device_t dev)
+{
+ struct eeprom_desc *d;
+
+ if (!ofw_bus_status_okay(dev))
+ return (ENXIO);
+
+ d = (struct eeprom_desc *)
+ ofw_bus_search_compatible(dev, compat_data)->ocd_data;
+ if (d == NULL)
+ return (ENXIO);
+
+ device_set_desc(dev, d->name);
+ return (BUS_PROBE_DEFAULT);
+}
+
+static void
+icee_init(struct icee_softc *sc)
+{
+ struct eeprom_desc *d;
+
+ d = (struct eeprom_desc *)
+ ofw_bus_search_compatible(sc->dev, compat_data)->ocd_data;
+ if (d == NULL)
+ return; /* attach will see sc->size == 0 and return error */
+
+ sc->size = d->size;
+ sc->type = d->type;
+ sc->wr_sz = d->wr_sz;
+}
+#else /* !FDT */
static int
icee_probe(device_t dev)
{
@@ -83,37 +166,44 @@ icee_probe(device_t dev)
return (BUS_PROBE_NOWILDCARD);
}
-static int
-icee_attach(device_t dev)
+static void
+icee_init(struct icee_softc *sc)
{
- struct icee_softc *sc = device_get_softc(dev);
const char *dname;
- int dunit, err;
+ int dunit;
- sc->sc_dev = dev;
- sc->sc_busdev = device_get_parent(sc->sc_dev);
- sc->addr = iicbus_get_addr(dev);
- err = 0;
- dname = device_get_name(dev);
- dunit = device_get_unit(dev);
+ dname = device_get_name(sc->dev);
+ dunit = device_get_unit(sc->dev);
resource_int_value(dname, dunit, "size", &sc->size);
resource_int_value(dname, dunit, "type", &sc->type);
- resource_int_value(dname, dunit, "rd_sz", &sc->rd_sz);
- if (sc->rd_sz > MAX_RD_SZ)
- sc->rd_sz = MAX_RD_SZ;
resource_int_value(dname, dunit, "wr_sz", &sc->wr_sz);
+}
+#endif /* FDT */
+
+static int
+icee_attach(device_t dev)
+{
+ struct icee_softc *sc = device_get_softc(dev);
+
+ sc->dev = dev;
+ sc->addr = iicbus_get_addr(dev);
+ icee_init(sc);
+ if (sc->size == 0 || sc->type == 0 || sc->wr_sz == 0) {
+ device_printf(sc->dev, "Missing config data, "
+ "these cannot be zero: size %d type %d wr_sz %d\n",
+ sc->size, sc->type, sc->wr_sz);
+ return (EINVAL);
+ }
if (bootverbose)
- device_printf(dev, "size: %d bytes bus_width: %d-bits\n",
+ device_printf(dev, "size: %d bytes, addressing: %d-bits\n",
sc->size, sc->type);
sc->cdev = make_dev(&icee_cdevsw, device_get_unit(dev), UID_ROOT,
GID_WHEEL, 0600, "icee%d", device_get_unit(dev));
if (sc->cdev == NULL) {
- err = ENOMEM;
- goto out;
+ return (ENOMEM);
}
sc->cdev->si_drv1 = sc;
-out:
- return (err);
+ return (0);
}
static int
@@ -149,14 +239,11 @@ icee_read(struct cdev *dev, struct uio *uio, int ioflag)
return (EIO);
if (sc->type != 8 && sc->type != 16)
return (EINVAL);
- error = iicbus_request_bus(sc->sc_busdev, sc->sc_dev, IIC_INTRWAIT);
- if (error!= 0)
- return (iic2errno(error));
slave = error = 0;
while (uio->uio_resid > 0) {
if (uio->uio_offset >= sc->size)
break;
- len = MIN(sc->rd_sz - (uio->uio_offset & (sc->rd_sz - 1)),
+ len = MIN(MAX_RD_SZ - (uio->uio_offset & (MAX_RD_SZ - 1)),
uio->uio_resid);
switch (sc->type) {
case 8:
@@ -175,7 +262,7 @@ icee_read(struct cdev *dev, struct uio *uio, int ioflag)
}
for (i = 0; i < 2; i++)
msgs[i].slave = slave;
- error = iicbus_transfer(sc->sc_dev, msgs, 2);
+ error = iicbus_transfer_excl(sc->dev, msgs, 2, IIC_INTRWAIT);
if (error) {
error = iic2errno(error);
break;
@@ -184,7 +271,6 @@ icee_read(struct cdev *dev, struct uio *uio, int ioflag)
if (error)
break;
}
- iicbus_release_bus(sc->sc_busdev, sc->sc_dev);
return (error);
}
@@ -213,9 +299,6 @@ icee_write(struct cdev *dev, struct uio *uio, int ioflag)
if (sc->type != 8 && sc->type != 16)
return (EINVAL);
- error = iicbus_request_bus(sc->sc_busdev, sc->sc_dev, IIC_INTRWAIT);
- if (error!= 0)
- return (iic2errno(error));
slave = error = 0;
while (uio->uio_resid > 0) {
if (uio->uio_offset >= sc->size)
@@ -239,7 +322,7 @@ icee_write(struct cdev *dev, struct uio *uio, int ioflag)
error = uiomove(data + sc->type / 8, len, uio);
if (error)
break;
- error = iicbus_transfer(sc->sc_dev, wr, 1);
+ error = iicbus_transfer_excl(sc->dev, wr, 1, IIC_INTRWAIT);
if (error) {
error = iic2errno(error);
break;
@@ -248,14 +331,14 @@ icee_write(struct cdev *dev, struct uio *uio, int ioflag)
waitlimit = 10000;
rd[0].slave = slave;
do {
- error = iicbus_transfer(sc->sc_dev, rd, 1);
+ error = iicbus_transfer_excl(sc->dev, rd, 1,
+ IIC_INTRWAIT);
} while (waitlimit-- > 0 && error != 0);
if (error) {
error = iic2errno(error);
break;
}
}
- iicbus_release_bus(sc->sc_busdev, sc->sc_dev);
return error;
}
diff --git a/sys/dev/iicbus/iicbb.c b/sys/dev/iicbus/iicbb.c
index 977d52a..ed1d7b8 100644
--- a/sys/dev/iicbus/iicbb.c
+++ b/sys/dev/iicbus/iicbb.c
@@ -149,22 +149,9 @@ iicbb_attach(device_t dev)
static int
iicbb_detach(device_t dev)
{
- struct iicbb_softc *sc = (struct iicbb_softc *)device_get_softc(dev);
- device_t child;
-
- /*
- * We need to save child because the detach indirectly causes
- * sc->iicbus to be zeroed. Since we added the device
- * unconditionally in iicbb_attach, we need to make sure we
- * delete it here. See iicbb_child_detached. We need that
- * callback in case newbus detached our children w/o detaching
- * us (say iicbus is a module and unloaded w/o iicbb being
- * unloaded).
- */
- child = sc->iicbus;
+
bus_generic_detach(dev);
- if (child)
- device_delete_child(dev, child);
+ device_delete_children(dev);
return (0);
}
diff --git a/sys/dev/iicbus/iicbus.c b/sys/dev/iicbus/iicbus.c
index dc56760..e377383 100644
--- a/sys/dev/iicbus/iicbus.c
+++ b/sys/dev/iicbus/iicbus.c
@@ -39,7 +39,7 @@ __FBSDID("$FreeBSD$");
#include <sys/module.h>
#include <sys/mutex.h>
#include <sys/sysctl.h>
-#include <sys/bus.h>
+#include <sys/bus.h>
#include <dev/iicbus/iiconf.h>
#include <dev/iicbus/iicbus.h>
@@ -60,7 +60,7 @@ iicbus_probe(device_t dev)
}
#if SCAN_IICBUS
-static int
+static int
iic_probe_device(device_t dev, u_char addr)
{
int count;
@@ -126,7 +126,7 @@ iicbus_attach(device_t dev)
bus_generic_attach(dev);
return (0);
}
-
+
static int
iicbus_detach(device_t dev)
{
@@ -134,10 +134,11 @@ iicbus_detach(device_t dev)
iicbus_reset(dev, IIC_FASTEST, 0, NULL);
bus_generic_detach(dev);
+ device_delete_children(dev);
mtx_destroy(&sc->lock);
return (0);
}
-
+
static int
iicbus_print_child(device_t dev, device_t child)
{
diff --git a/sys/dev/iicbus/iicoc.c b/sys/dev/iicbus/iicoc.c
index 45f1692..c55d6fe 100644
--- a/sys/dev/iicbus/iicoc.c
+++ b/sys/dev/iicbus/iicoc.c
@@ -229,6 +229,7 @@ static int
iicoc_detach(device_t dev)
{
bus_generic_detach(dev);
+ device_delete_children(dev);
return (0);
}
diff --git a/sys/dev/iicbus/iiconf.c b/sys/dev/iicbus/iiconf.c
index e28d341..8ac8a47 100644
--- a/sys/dev/iicbus/iiconf.c
+++ b/sys/dev/iicbus/iiconf.c
@@ -395,6 +395,21 @@ iicbus_transfer(device_t bus, struct iic_msg *msgs, uint32_t nmsgs)
return (IICBUS_TRANSFER(device_get_parent(bus), msgs, nmsgs));
}
+int
+iicbus_transfer_excl(device_t dev, struct iic_msg *msgs, uint32_t nmsgs,
+ int how)
+{
+ device_t bus;
+ int error;
+
+ bus = device_get_parent(dev);
+ error = iicbus_request_bus(bus, dev, how);
+ if (error == 0)
+ error = IICBUS_TRANSFER(bus, msgs, nmsgs);
+ iicbus_release_bus(bus, dev);
+ return (error);
+}
+
/*
* Generic version of iicbus_transfer that calls the appropriate
* routines to accomplish this. See note above about acceptable
diff --git a/sys/dev/iicbus/iiconf.h b/sys/dev/iicbus/iiconf.h
index aca0137..12ac0d7 100644
--- a/sys/dev/iicbus/iiconf.h
+++ b/sys/dev/iicbus/iiconf.h
@@ -129,6 +129,8 @@ extern int iicbus_block_read(device_t, u_char, char *, int, int *);
/* vectors of iic operations to pass to bridge */
int iicbus_transfer(device_t bus, struct iic_msg *msgs, uint32_t nmsgs);
+int iicbus_transfer_excl(device_t bus, struct iic_msg *msgs, uint32_t nmsgs,
+ int how);
int iicbus_transfer_gen(device_t bus, struct iic_msg *msgs, uint32_t nmsgs);
#define IICBUS_MODVER 1
diff --git a/sys/dev/iicbus/iicsmb.c b/sys/dev/iicbus/iicsmb.c
index 27f1d2b..d8f35c6 100644
--- a/sys/dev/iicbus/iicsmb.c
+++ b/sys/dev/iicbus/iicsmb.c
@@ -167,11 +167,9 @@ static int
iicsmb_detach(device_t dev)
{
struct iicsmb_softc *sc = (struct iicsmb_softc *)device_get_softc(dev);
-
+
bus_generic_detach(dev);
- if (sc->smbus) {
- device_delete_child(dev, sc->smbus);
- }
+ device_delete_children(dev);
mtx_destroy(&sc->lock);
return (0);
diff --git a/sys/dev/iscsi/iscsi.c b/sys/dev/iscsi/iscsi.c
index 63abafc..b0c9448 100644
--- a/sys/dev/iscsi/iscsi.c
+++ b/sys/dev/iscsi/iscsi.c
@@ -102,6 +102,9 @@ static int fail_on_disconnection = 0;
TUNABLE_INT("kern.iscsi.fail_on_disconnection", &fail_on_disconnection);
SYSCTL_INT(_kern_iscsi, OID_AUTO, fail_on_disconnection, CTLFLAG_RWTUN,
&fail_on_disconnection, 0, "Destroy CAM SIM on connection failure");
+static int fail_on_shutdown = 1;
+SYSCTL_INT(_kern_iscsi, OID_AUTO, fail_on_shutdown, CTLFLAG_RWTUN,
+ &fail_on_shutdown, 0, "Fail disconnected sessions on shutdown");
static MALLOC_DEFINE(M_ISCSI, "iSCSI", "iSCSI initiator");
static uma_zone_t iscsi_outstanding_zone;
@@ -421,8 +424,6 @@ iscsi_maintenance_thread_terminate(struct iscsi_session *is)
sc = is->is_softc;
sx_xlock(&sc->sc_lock);
- TAILQ_REMOVE(&sc->sc_sessions, is, is_next);
- sx_xunlock(&sc->sc_lock);
icl_conn_close(is->is_conn);
callout_drain(&is->is_callout);
@@ -454,6 +455,9 @@ iscsi_maintenance_thread_terminate(struct iscsi_session *is)
#ifdef ICL_KERNEL_PROXY
cv_destroy(&is->is_login_cv);
#endif
+ TAILQ_REMOVE(&sc->sc_sessions, is, is_next);
+ sx_xunlock(&sc->sc_lock);
+
ISCSI_SESSION_DEBUG(is, "terminated");
free(is, M_ISCSI);
@@ -477,12 +481,7 @@ iscsi_maintenance_thread(void *arg)
STAILQ_EMPTY(&is->is_postponed))
cv_wait(&is->is_maintenance_cv, &is->is_lock);
- if (is->is_reconnecting) {
- ISCSI_SESSION_UNLOCK(is);
- iscsi_maintenance_thread_reconnect(is);
- continue;
- }
-
+ /* Terminate supersedes reconnect. */
if (is->is_terminating) {
ISCSI_SESSION_UNLOCK(is);
iscsi_maintenance_thread_terminate(is);
@@ -490,6 +489,12 @@ iscsi_maintenance_thread(void *arg)
return;
}
+ if (is->is_reconnecting) {
+ ISCSI_SESSION_UNLOCK(is);
+ iscsi_maintenance_thread_reconnect(is);
+ continue;
+ }
+
iscsi_session_send_postponed(is);
ISCSI_SESSION_UNLOCK(is);
}
@@ -609,6 +614,11 @@ iscsi_callout(void *context)
return;
out:
+ if (is->is_terminating) {
+ ISCSI_SESSION_UNLOCK(is);
+ return;
+ }
+
ISCSI_SESSION_UNLOCK(is);
if (reconnect_needed)
@@ -2320,30 +2330,62 @@ iscsi_poll(struct cam_sim *sim)
}
static void
-iscsi_shutdown(struct iscsi_softc *sc)
+iscsi_terminate_sessions(struct iscsi_softc *sc)
{
struct iscsi_session *is;
- /*
- * Trying to reconnect during system shutdown would lead to hang.
- */
- fail_on_disconnection = 1;
+ sx_slock(&sc->sc_lock);
+ TAILQ_FOREACH(is, &sc->sc_sessions, is_next)
+ iscsi_session_terminate(is);
+ while(!TAILQ_EMPTY(&sc->sc_sessions)) {
+ ISCSI_DEBUG("waiting for sessions to terminate");
+ cv_wait(&sc->sc_cv, &sc->sc_lock);
+ }
+ ISCSI_DEBUG("all sessions terminated");
+ sx_sunlock(&sc->sc_lock);
+}
+
+static void
+iscsi_shutdown_pre(struct iscsi_softc *sc)
+{
+ struct iscsi_session *is;
+
+ if (!fail_on_shutdown)
+ return;
/*
* If we have any sessions waiting for reconnection, request
* maintenance thread to fail them immediately instead of waiting
* for reconnect timeout.
+ *
+ * This prevents LUNs with mounted filesystems that are supported
+ * by disconnected iSCSI sessions from hanging, however it will
+ * fail all queued BIOs.
*/
+ ISCSI_DEBUG("forcing failing all disconnected sessions due to shutdown");
+
+ fail_on_disconnection = 1;
+
sx_slock(&sc->sc_lock);
TAILQ_FOREACH(is, &sc->sc_sessions, is_next) {
ISCSI_SESSION_LOCK(is);
- if (is->is_waiting_for_iscsid)
+ if (!is->is_connected) {
+ ISCSI_SESSION_DEBUG(is, "force failing disconnected session early");
iscsi_session_reconnect(is);
+ }
ISCSI_SESSION_UNLOCK(is);
}
sx_sunlock(&sc->sc_lock);
}
+static void
+iscsi_shutdown_post(struct iscsi_softc *sc)
+{
+
+ ISCSI_DEBUG("removing all sessions due to shutdown");
+ iscsi_terminate_sessions(sc);
+}
+
static int
iscsi_load(void)
{
@@ -2366,8 +2408,16 @@ iscsi_load(void)
}
sc->sc_cdev->si_drv1 = sc;
- sc->sc_shutdown_eh = EVENTHANDLER_REGISTER(shutdown_pre_sync,
- iscsi_shutdown, sc, SHUTDOWN_PRI_FIRST);
+ sc->sc_shutdown_pre_eh = EVENTHANDLER_REGISTER(shutdown_pre_sync,
+ iscsi_shutdown_pre, sc, SHUTDOWN_PRI_FIRST);
+ /*
+ * shutdown_post_sync needs to run after filesystem shutdown and before
+ * CAM shutdown - otherwise when rebooting with an iSCSI session that is
+ * disconnected but has outstanding requests, dashutdown() will hang on
+ * cam_periph_runccb().
+ */
+ sc->sc_shutdown_post_eh = EVENTHANDLER_REGISTER(shutdown_post_sync,
+ iscsi_shutdown_post, sc, SHUTDOWN_PRI_DEFAULT - 1);
return (0);
}
@@ -2375,7 +2425,6 @@ iscsi_load(void)
static int
iscsi_unload(void)
{
- struct iscsi_session *is, *tmp;
if (sc->sc_cdev != NULL) {
ISCSI_DEBUG("removing device node");
@@ -2383,18 +2432,12 @@ iscsi_unload(void)
ISCSI_DEBUG("device node removed");
}
- if (sc->sc_shutdown_eh != NULL)
- EVENTHANDLER_DEREGISTER(shutdown_pre_sync, sc->sc_shutdown_eh);
+ if (sc->sc_shutdown_pre_eh != NULL)
+ EVENTHANDLER_DEREGISTER(shutdown_pre_sync, sc->sc_shutdown_pre_eh);
+ if (sc->sc_shutdown_post_eh != NULL)
+ EVENTHANDLER_DEREGISTER(shutdown_post_sync, sc->sc_shutdown_post_eh);
- sx_slock(&sc->sc_lock);
- TAILQ_FOREACH_SAFE(is, &sc->sc_sessions, is_next, tmp)
- iscsi_session_terminate(is);
- while(!TAILQ_EMPTY(&sc->sc_sessions)) {
- ISCSI_DEBUG("waiting for sessions to terminate");
- cv_wait(&sc->sc_cv, &sc->sc_lock);
- }
- ISCSI_DEBUG("all sessions terminated");
- sx_sunlock(&sc->sc_lock);
+ iscsi_terminate_sessions(sc);
uma_zdestroy(iscsi_outstanding_zone);
sx_destroy(&sc->sc_lock);
diff --git a/sys/dev/iscsi/iscsi.h b/sys/dev/iscsi/iscsi.h
index 0fe1515..11ecc42 100644
--- a/sys/dev/iscsi/iscsi.h
+++ b/sys/dev/iscsi/iscsi.h
@@ -130,7 +130,8 @@ struct iscsi_softc {
TAILQ_HEAD(, iscsi_session) sc_sessions;
struct cv sc_cv;
unsigned int sc_last_session_id;
- eventhandler_tag sc_shutdown_eh;
+ eventhandler_tag sc_shutdown_pre_eh;
+ eventhandler_tag sc_shutdown_post_eh;
};
#endif /* !ISCSI_H */
diff --git a/sys/dev/nvd/nvd.c b/sys/dev/nvd/nvd.c
index 7be8a18..24ee075 100644
--- a/sys/dev/nvd/nvd.c
+++ b/sys/dev/nvd/nvd.c
@@ -295,7 +295,7 @@ nvd_new_disk(struct nvme_namespace *ns, void *ctrlr_arg)
disk->d_sectorsize = nvme_ns_get_sector_size(ns);
disk->d_mediasize = (off_t)nvme_ns_get_size(ns);
disk->d_delmaxsize = (off_t)nvme_ns_get_size(ns);
- disk->d_stripesize = nvme_ns_get_stripesize(ns);
+ disk->d_stripesize = nvme_ns_get_optimal_sector_size(ns);
if (TAILQ_EMPTY(&disk_head))
disk->d_unit = 0;
diff --git a/sys/dev/nvme/nvme.h b/sys/dev/nvme/nvme.h
index 7e41e77..227a89e 100644
--- a/sys/dev/nvme/nvme.h
+++ b/sys/dev/nvme/nvme.h
@@ -870,6 +870,7 @@ const char * nvme_ns_get_serial_number(struct nvme_namespace *ns);
const char * nvme_ns_get_model_number(struct nvme_namespace *ns);
const struct nvme_namespace_data *
nvme_ns_get_data(struct nvme_namespace *ns);
+uint32_t nvme_ns_get_optimal_sector_size(struct nvme_namespace *ns);
uint32_t nvme_ns_get_stripesize(struct nvme_namespace *ns);
int nvme_ns_bio_process(struct nvme_namespace *ns, struct bio *bp,
diff --git a/sys/dev/nvme/nvme_ns.c b/sys/dev/nvme/nvme_ns.c
index 754d074..4580e66 100644
--- a/sys/dev/nvme/nvme_ns.c
+++ b/sys/dev/nvme/nvme_ns.c
@@ -45,6 +45,8 @@ __FBSDID("$FreeBSD$");
#include "nvme_private.h"
+extern int nvme_max_optimal_sectorsize;
+
static void nvme_bio_child_inbed(struct bio *parent, int bio_error);
static void nvme_bio_child_done(void *arg,
const struct nvme_completion *cpl);
@@ -217,6 +219,22 @@ nvme_ns_get_stripesize(struct nvme_namespace *ns)
return (ns->stripesize);
}
+uint32_t
+nvme_ns_get_optimal_sector_size(struct nvme_namespace *ns)
+{
+ uint32_t stripesize;
+
+ stripesize = nvme_ns_get_stripesize(ns);
+
+ if (stripesize == 0)
+ return nvme_ns_get_sector_size(ns);
+
+ if (nvme_max_optimal_sectorsize == 0)
+ return (stripesize);
+
+ return (MIN(stripesize, nvme_max_optimal_sectorsize));
+}
+
static void
nvme_ns_bio_done(void *arg, const struct nvme_completion *status)
{
diff --git a/sys/dev/nvme/nvme_sysctl.c b/sys/dev/nvme/nvme_sysctl.c
index 44b0ab7..08cd15e 100644
--- a/sys/dev/nvme/nvme_sysctl.c
+++ b/sys/dev/nvme/nvme_sysctl.c
@@ -33,6 +33,22 @@ __FBSDID("$FreeBSD$");
#include "nvme_private.h"
+SYSCTL_NODE(_kern, OID_AUTO, nvme, CTLFLAG_RD, 0, "NVM Express");
+/*
+ * Intel NVMe controllers have a slow path for I/Os that span a 128KB
+ * stripe boundary but ZFS limits ashift, which is derived from
+ * d_stripesize, to 13 (8KB) so we limit the stripesize reported to
+ * geom(8) to 4KB by default.
+ *
+ * This may result in a small number of additional I/Os to require
+ * splitting in nvme(4), however the NVMe I/O path is very efficient
+ * so these additional I/Os will cause very minimal (if any) difference
+ * in performance or CPU utilisation.
+ */
+int nvme_max_optimal_sectorsize = 1<<12;
+SYSCTL_INT(_kern_nvme, OID_AUTO, max_optimal_sectorsize, CTLFLAG_RWTUN,
+ &nvme_max_optimal_sectorsize, 0, "The maximum optimal sectorsize reported");
+
/*
* CTLTYPE_S64 and sysctl_handle_64 were added in r217616. Define these
* explicitly here for older kernels that don't include the r217616
diff --git a/sys/dev/ofw/ofw_iicbus.c b/sys/dev/ofw/ofw_iicbus.c
index f6d1be5..98fc060 100644
--- a/sys/dev/ofw/ofw_iicbus.c
+++ b/sys/dev/ofw/ofw_iicbus.c
@@ -147,7 +147,11 @@ ofw_iicbus_attach(device_t dev)
M_NOWAIT | M_ZERO);
if (dinfo == NULL)
continue;
- dinfo->opd_dinfo.addr = paddr;
+ /*
+ * OFW uses 7-bit I2C address format (see ePAPR),
+ * but system expect 8-bit.
+ */
+ dinfo->opd_dinfo.addr = paddr << 1;
if (ofw_bus_gen_setup_devinfo(&dinfo->opd_obdinfo, child) !=
0) {
free(dinfo, M_DEVBUF);
diff --git a/sys/dev/pci/pci.c b/sys/dev/pci/pci.c
index e08237b..cef2db4 100644
--- a/sys/dev/pci/pci.c
+++ b/sys/dev/pci/pci.c
@@ -182,6 +182,8 @@ static device_method_t pci_methods[] = {
DEVMETHOD(pci_release_msi, pci_release_msi_method),
DEVMETHOD(pci_msi_count, pci_msi_count_method),
DEVMETHOD(pci_msix_count, pci_msix_count_method),
+ DEVMETHOD(pci_msix_pba_bar, pci_msix_pba_bar_method),
+ DEVMETHOD(pci_msix_table_bar, pci_msix_table_bar_method),
DEVMETHOD(pci_get_rid, pci_get_rid_method),
DEVMETHOD(pci_child_added, pci_child_added_method),
@@ -1827,6 +1829,28 @@ pci_msix_count_method(device_t dev, device_t child)
return (0);
}
+int
+pci_msix_pba_bar_method(device_t dev, device_t child)
+{
+ struct pci_devinfo *dinfo = device_get_ivars(child);
+ struct pcicfg_msix *msix = &dinfo->cfg.msix;
+
+ if (pci_do_msix && msix->msix_location != 0)
+ return (msix->msix_pba_bar);
+ return (-1);
+}
+
+int
+pci_msix_table_bar_method(device_t dev, device_t child)
+{
+ struct pci_devinfo *dinfo = device_get_ivars(child);
+ struct pcicfg_msix *msix = &dinfo->cfg.msix;
+
+ if (pci_do_msix && msix->msix_location != 0)
+ return (msix->msix_table_bar);
+ return (-1);
+}
+
/*
* HyperTransport MSI mapping control
*/
diff --git a/sys/dev/pci/pci_if.m b/sys/dev/pci/pci_if.m
index 227d362..a44a641 100644
--- a/sys/dev/pci/pci_if.m
+++ b/sys/dev/pci/pci_if.m
@@ -36,6 +36,12 @@ CODE {
{
return (0);
}
+
+ static int
+ null_msix_bar(device_t dev, device_t child)
+ {
+ return (-1);
+ }
};
@@ -180,6 +186,16 @@ METHOD int msix_count {
device_t child;
} DEFAULT null_msi_count;
+METHOD int msix_pba_bar {
+ device_t dev;
+ device_t child;
+} DEFAULT null_msix_bar;
+
+METHOD int msix_table_bar {
+ device_t dev;
+ device_t child;
+} DEFAULT null_msix_bar;
+
METHOD uint16_t get_rid {
device_t dev;
device_t child;
diff --git a/sys/dev/pci/pci_private.h b/sys/dev/pci/pci_private.h
index 5a90ce9..e446dc5 100644
--- a/sys/dev/pci/pci_private.h
+++ b/sys/dev/pci/pci_private.h
@@ -100,6 +100,8 @@ int pci_remap_msix_method(device_t dev, device_t child,
int pci_release_msi_method(device_t dev, device_t child);
int pci_msi_count_method(device_t dev, device_t child);
int pci_msix_count_method(device_t dev, device_t child);
+int pci_msix_pba_bar_method(device_t dev, device_t child);
+int pci_msix_table_bar_method(device_t dev, device_t child);
struct resource *pci_alloc_resource(device_t dev, device_t child,
int type, int *rid, u_long start, u_long end, u_long count,
u_int flags);
diff --git a/sys/dev/pci/pcireg.h b/sys/dev/pci/pcireg.h
index 73ce5e9..5453a53 100644
--- a/sys/dev/pci/pcireg.h
+++ b/sys/dev/pci/pcireg.h
@@ -260,6 +260,11 @@
#define PCIR_BIOS_1 0x38
#define PCIR_BRIDGECTL_1 0x3e
+#define PCI_PPBMEMBASE(h,l) ((((uint64_t)(h) << 32) + ((l)<<16)) & ~0xfffff)
+#define PCI_PPBMEMLIMIT(h,l) ((((uint64_t)(h) << 32) + ((l)<<16)) | 0xfffff)
+#define PCI_PPBIOBASE(h,l) ((((h)<<16) + ((l)<<8)) & ~0xfff)
+#define PCI_PPBIOLIMIT(h,l) ((((h)<<16) + ((l)<<8)) | 0xfff)
+
/* config registers for header type 2 (CardBus) devices */
#define PCIR_MAX_BAR_2 0
@@ -279,6 +284,9 @@
#define PCIR_IOLIMIT0_2 0x30
#define PCIR_IOBASE1_2 0x34
#define PCIR_IOLIMIT1_2 0x38
+#define PCIM_CBBIO_16 0x0
+#define PCIM_CBBIO_32 0x1
+#define PCIM_CBBIO_MASK 0x3
#define PCIR_BRIDGECTL_2 0x3e
@@ -287,6 +295,11 @@
#define PCIR_PCCARDIF_2 0x44
+#define PCI_CBBMEMBASE(l) ((l) & ~0xfffff)
+#define PCI_CBBMEMLIMIT(l) ((l) | 0xfffff)
+#define PCI_CBBIOBASE(l) ((l) & ~0x3)
+#define PCI_CBBIOLIMIT(l) ((l) | 0x3)
+
/* PCI device class, subclass and programming interface definitions */
#define PCIC_OLD 0x00
@@ -474,6 +487,17 @@
#define PCIB_BCR_DISCARD_TIMER_STATUS 0x0400
#define PCIB_BCR_DISCARD_TIMER_SERREN 0x0800
+#define CBB_BCR_PERR_ENABLE 0x0001
+#define CBB_BCR_SERR_ENABLE 0x0002
+#define CBB_BCR_ISA_ENABLE 0x0004
+#define CBB_BCR_VGA_ENABLE 0x0008
+#define CBB_BCR_MASTER_ABORT_MODE 0x0020
+#define CBB_BCR_CARDBUS_RESET 0x0040
+#define CBB_BCR_IREQ_INT_ENABLE 0x0080
+#define CBB_BCR_PREFETCH_0_ENABLE 0x0100
+#define CBB_BCR_PREFETCH_1_ENABLE 0x0200
+#define CBB_BCR_WRITE_POSTING_ENABLE 0x0400
+
/* PCI power manangement */
#define PCIR_POWER_CAP 0x2
#define PCIM_PCAP_SPEC 0x0007
diff --git a/sys/dev/pci/pcivar.h b/sys/dev/pci/pcivar.h
index 2bb26bd..14132bf 100644
--- a/sys/dev/pci/pcivar.h
+++ b/sys/dev/pci/pcivar.h
@@ -190,11 +190,6 @@ typedef struct pcicfg {
/* additional type 1 device config header information (PCI to PCI bridge) */
-#define PCI_PPBMEMBASE(h,l) ((((pci_addr_t)(h) << 32) + ((l)<<16)) & ~0xfffff)
-#define PCI_PPBMEMLIMIT(h,l) ((((pci_addr_t)(h) << 32) + ((l)<<16)) | 0xfffff)
-#define PCI_PPBIOBASE(h,l) ((((h)<<16) + ((l)<<8)) & ~0xfff)
-#define PCI_PPBIOLIMIT(h,l) ((((h)<<16) + ((l)<<8)) | 0xfff)
-
typedef struct {
pci_addr_t pmembase; /* base address of prefetchable memory */
pci_addr_t pmemlimit; /* topmost address of prefetchable memory */
@@ -500,6 +495,18 @@ pci_msix_count(device_t dev)
return (PCI_MSIX_COUNT(device_get_parent(dev), dev));
}
+static __inline int
+pci_msix_pba_bar(device_t dev)
+{
+ return (PCI_MSIX_PBA_BAR(device_get_parent(dev), dev));
+}
+
+static __inline int
+pci_msix_table_bar(device_t dev)
+{
+ return (PCI_MSIX_TABLE_BAR(device_get_parent(dev), dev));
+}
+
static __inline uint16_t
pci_get_rid(device_t dev)
{
diff --git a/sys/dev/rt/if_rt.c b/sys/dev/rt/if_rt.c
index ea252d1..814698c 100644
--- a/sys/dev/rt/if_rt.c
+++ b/sys/dev/rt/if_rt.c
@@ -176,20 +176,6 @@ macaddr_atoi(const char *str, uint8_t *mac)
}
#ifdef USE_GENERATED_MAC_ADDRESS
-static char *
-kernenv_next(char *cp)
-{
-
- if (cp != NULL) {
- while (*cp != 0)
- cp++;
- cp++;
- if (*cp == 0)
- cp = NULL;
- }
- return (cp);
-}
-
/*
* generate_mac(uin8_t *mac)
* This is MAC address generator for cases when real device MAC address
@@ -208,14 +194,8 @@ generate_mac(uint8_t *mac)
uint32_t crc = 0xffffffff;
/* Generate CRC32 on kenv */
- if (dynamic_kenv) {
- for (cp = kenvp[0]; cp != NULL; cp = kenvp[++i]) {
- crc = calculate_crc32c(crc, cp, strlen(cp) + 1);
- }
- } else {
- for (cp = kern_envp; cp != NULL; cp = kernenv_next(cp)) {
- crc = calculate_crc32c(crc, cp, strlen(cp) + 1);
- }
+ for (cp = kenvp[0]; cp != NULL; cp = kenvp[++i]) {
+ crc = calculate_crc32c(crc, cp, strlen(cp) + 1);
}
crc = ~crc;
diff --git a/sys/dev/sfxge/common/ef10_impl.h b/sys/dev/sfxge/common/ef10_impl.h
index 9b9f0aa..0c687ae 100644
--- a/sys/dev/sfxge/common/ef10_impl.h
+++ b/sys/dev/sfxge/common/ef10_impl.h
@@ -45,6 +45,52 @@ extern "C" {
#define EF10_MAX_PIOBUF_NBUFS MEDFORD_PIOBUF_NBUFS
#endif
+extern __checkReturn efx_rc_t
+efx_mcdi_get_port_assignment(
+ __in efx_nic_t *enp,
+ __out uint32_t *portp);
+
+extern __checkReturn efx_rc_t
+efx_mcdi_get_port_modes(
+ __in efx_nic_t *enp,
+ __out uint32_t *modesp);
+
+extern __checkReturn efx_rc_t
+efx_mcdi_get_mac_address_pf(
+ __in efx_nic_t *enp,
+ __out_ecount_opt(6) uint8_t mac_addrp[6]);
+
+extern __checkReturn efx_rc_t
+efx_mcdi_get_mac_address_vf(
+ __in efx_nic_t *enp,
+ __out_ecount_opt(6) uint8_t mac_addrp[6]);
+
+extern __checkReturn efx_rc_t
+efx_mcdi_get_clock(
+ __in efx_nic_t *enp,
+ __out uint32_t *sys_freqp);
+
+extern __checkReturn efx_rc_t
+efx_mcdi_get_vector_cfg(
+ __in efx_nic_t *enp,
+ __out_opt uint32_t *vec_basep,
+ __out_opt uint32_t *pf_nvecp,
+ __out_opt uint32_t *vf_nvecp);
+
+extern __checkReturn efx_rc_t
+ef10_get_datapath_caps(
+ __in efx_nic_t *enp);
+
+extern __checkReturn efx_rc_t
+ef10_get_privilege_mask(
+ __in efx_nic_t *enp,
+ __out uint32_t *maskp);
+
+extern __checkReturn efx_rc_t
+ef10_external_port_mapping(
+ __in efx_nic_t *enp,
+ __in uint32_t port,
+ __out uint8_t *external_portp);
#ifdef __cplusplus
diff --git a/sys/dev/sfxge/common/ef10_tlv_layout.h b/sys/dev/sfxge/common/ef10_tlv_layout.h
index 4063165..80364ce 100644
--- a/sys/dev/sfxge/common/ef10_tlv_layout.h
+++ b/sys/dev/sfxge/common/ef10_tlv_layout.h
@@ -113,7 +113,11 @@ struct tlv_partition_header {
uint32_t tag;
uint32_t length;
uint16_t type_id;
- uint16_t reserved;
+/* 0 indicates the default segment (always located at offset 0), while other values
+ * are for RFID-selectable presets that should immediately follow the default segment.
+ * The default segment may also have preset > 0, which means that it is a preset
+ * selected through an RFID command and copied by FW to the location at offset 0. */
+ uint16_t preset;
uint32_t generation;
uint32_t total_length;
};
@@ -376,7 +380,7 @@ struct tlv_tmp_gubbins {
int8_t with_rmon; /* 0 -> off, 1 -> on, -1 -> leave alone */
/* Consumed by clocks_hunt.c */
int8_t clk_mode; /* 0 -> off, 1 -> on, -1 -> leave alone */
- /* Consumed by sram.c */
+ /* No longer used, superseded by TLV_TAG_DESCRIPTOR_CACHE_CONFIG. */
int8_t rx_dc_size; /* -1 -> leave alone */
int8_t tx_dc_size;
int16_t num_q_allocs;
@@ -690,7 +694,6 @@ struct tlv_mcast_filter_chaining {
#define TLV_MCAST_FILTER_CHAINING_ENABLED (1)
};
-
/* Pacer rate limit per PF */
#define TLV_TAG_RATE_LIMIT(pf) (0x101b0000 + (pf))
@@ -700,7 +703,6 @@ struct tlv_rate_limit {
uint32_t rate_mbps;
};
-
/* OCSD Enable/Disable
*
* This setting allows OCSD to be disabled. This is a requirement for HP
diff --git a/sys/dev/sfxge/common/efsys.h b/sys/dev/sfxge/common/efsys.h
index 7bc1fe0..14238ad 100644
--- a/sys/dev/sfxge/common/efsys.h
+++ b/sys/dev/sfxge/common/efsys.h
@@ -211,6 +211,8 @@ sfxge_map_mbuf_fast(bus_dma_tag_t tag, bus_dmamap_t map,
#define __out_ecount_opt(_n)
#define __out_bcount(_n)
#define __out_bcount_opt(_n)
+#define __out_bcount_part(_n, _l)
+#define __out_bcount_part_opt(_n, _l)
#define __deref_out
@@ -293,6 +295,8 @@ sfxge_map_mbuf_fast(bus_dma_tag_t tag, bus_dmamap_t map,
#define EFSYS_OPT_DECODE_INTR_FATAL 1
+#define EFSYS_OPT_LICENSING 0
+
/* ID */
typedef struct __efsys_identifier_s efsys_identifier_t;
diff --git a/sys/dev/sfxge/common/efx.h b/sys/dev/sfxge/common/efx.h
index 0483c9a..ce70546 100644
--- a/sys/dev/sfxge/common/efx.h
+++ b/sys/dev/sfxge/common/efx.h
@@ -1071,6 +1071,7 @@ efx_bist_stop(
#define EFX_FEATURE_TX_SRC_FILTERS 0x00000400
#define EFX_FEATURE_PIO_BUFFERS 0x00000800
#define EFX_FEATURE_FW_ASSISTED_TSO 0x00001000
+#define EFX_FEATURE_FW_ASSISTED_TSO_V2 0x00002000
typedef struct efx_nic_cfg_s {
uint32_t enc_board_type;
@@ -1152,14 +1153,18 @@ typedef struct efx_nic_cfg_s {
*/
uint32_t enc_tx_tso_tcp_header_offset_limit;
boolean_t enc_fw_assisted_tso_enabled;
+ boolean_t enc_fw_assisted_tso_v2_enabled;
boolean_t enc_hw_tx_insert_vlan_enabled;
/* Datapath firmware vadapter/vport/vswitch support */
boolean_t enc_datapath_cap_evb;
boolean_t enc_rx_disable_scatter_supported;
boolean_t enc_allow_set_mac_with_installed_filters;
+ boolean_t enc_enhanced_set_mac_supported;
/* External port identifier */
uint8_t enc_external_port;
uint32_t enc_mcdi_max_payload_length;
+ /* VPD may be per-PF or global */
+ boolean_t enc_vpd_is_global;
} efx_nic_cfg_t;
#define EFX_PCI_FUNCTION_IS_PF(_encp) ((_encp)->enc_vf == 0xffff)
@@ -1315,6 +1320,7 @@ typedef enum efx_nvram_type_e {
EFX_NVRAM_CPLD,
EFX_NVRAM_FPGA_BACKUP,
EFX_NVRAM_DYNAMIC_CFG,
+ EFX_NVRAM_LICENSE,
EFX_NVRAM_NTYPES,
} efx_nvram_type_t;
@@ -2002,6 +2008,7 @@ efx_tx_fini(
#define EFX_TXQ_CKSUM_IPV4 0x0001
#define EFX_TXQ_CKSUM_TCPUDP 0x0002
+#define EFX_TXQ_FATSOV2 0x0004
extern __checkReturn efx_rc_t
efx_tx_qcreate(
@@ -2089,6 +2096,21 @@ efx_tx_qdesc_tso_create(
__in uint8_t tcp_flags,
__out efx_desc_t *edp);
+/* Number of FATSOv2 option descriptors */
+#define EFX_TX_FATSOV2_OPT_NDESCS 2
+
+/* Maximum number of DMA segments per TSO packet (not superframe) */
+#define EFX_TX_FATSOV2_DMA_SEGS_PER_PKT_MAX 24
+
+extern void
+efx_tx_qdesc_tso2_create(
+ __in efx_txq_t *etp,
+ __in uint16_t ipv4_id,
+ __in uint32_t tcp_seq,
+ __in uint16_t tcp_mss,
+ __out_ecount(count) efx_desc_t *edp,
+ __in int count);
+
extern void
efx_tx_qdesc_vlantci_create(
__in efx_txq_t *etp,
@@ -2291,6 +2313,57 @@ efx_hash_bytes(
__in size_t length,
__in uint32_t init);
+#if EFSYS_OPT_LICENSING
+
+/* LICENSING */
+
+typedef struct efx_key_stats_s {
+ uint32_t eks_valid;
+ uint32_t eks_invalid;
+ uint32_t eks_blacklisted;
+ uint32_t eks_unverifiable;
+ uint32_t eks_wrong_node;
+ uint32_t eks_licensed_apps_lo;
+ uint32_t eks_licensed_apps_hi;
+ uint32_t eks_licensed_features_lo;
+ uint32_t eks_licensed_features_hi;
+} efx_key_stats_t;
+
+extern __checkReturn efx_rc_t
+efx_lic_init(
+ __in efx_nic_t *enp);
+
+extern void
+efx_lic_fini(
+ __in efx_nic_t *enp);
+
+extern __checkReturn efx_rc_t
+efx_lic_update_licenses(
+ __in efx_nic_t *enp);
+
+extern __checkReturn efx_rc_t
+efx_lic_get_key_stats(
+ __in efx_nic_t *enp,
+ __out efx_key_stats_t *ksp);
+
+extern __checkReturn efx_rc_t
+efx_lic_app_state(
+ __in efx_nic_t *enp,
+ __in uint64_t app_id,
+ __out boolean_t *licensedp);
+
+extern __checkReturn efx_rc_t
+efx_lic_get_id(
+ __in efx_nic_t *enp,
+ __in size_t buffer_size,
+ __out uint32_t *typep,
+ __out size_t *lengthp,
+ __out_opt uint8_t *bufferp);
+
+
+#endif /* EFSYS_OPT_LICENSING */
+
+
#ifdef __cplusplus
}
diff --git a/sys/dev/sfxge/common/efx_check.h b/sys/dev/sfxge/common/efx_check.h
index 199fab0..d6b7cf4 100644
--- a/sys/dev/sfxge/common/efx_check.h
+++ b/sys/dev/sfxge/common/efx_check.h
@@ -401,4 +401,15 @@
# endif
#endif /* EFSYS_OPT_BIST */
+/* Support MCDI licensing API */
+#if EFSYS_OPT_LICENSING
+# if !EFSYS_OPT_MCDI
+# error "LICENSING requires MCDI"
+# endif
+# if !EFSYS_HAS_UINT64
+# error "LICENSING requires UINT64"
+# endif
+#endif /* EFSYS_OPT_LICENSING */
+
+
#endif /* _SYS_EFX_CHECK_H */
diff --git a/sys/dev/sfxge/common/efx_impl.h b/sys/dev/sfxge/common/efx_impl.h
index 5397ffe..5495b15 100644
--- a/sys/dev/sfxge/common/efx_impl.h
+++ b/sys/dev/sfxge/common/efx_impl.h
@@ -84,6 +84,7 @@ extern "C" {
#define EFX_MOD_WOL 0x00000800
#define EFX_MOD_FILTER 0x00001000
#define EFX_MOD_PKTFILTER 0x00002000
+#define EFX_MOD_LIC 0x00004000
#define EFX_RESET_MAC 0x00000001
#define EFX_RESET_PHY 0x00000002
@@ -96,6 +97,7 @@ typedef enum efx_mac_type_e {
EFX_MAC_FALCON_XMAC,
EFX_MAC_SIENA,
EFX_MAC_HUNTINGTON,
+ EFX_MAC_MEDFORD,
EFX_MAC_NTYPES
} efx_mac_type_t;
@@ -146,6 +148,9 @@ typedef struct efx_tx_ops_s {
void (*etxo_qdesc_tso_create)(efx_txq_t *, uint16_t,
uint32_t, uint8_t,
efx_desc_t *);
+ void (*etxo_qdesc_tso2_create)(efx_txq_t *, uint16_t,
+ uint32_t, uint16_t,
+ efx_desc_t *, int);
void (*etxo_qdesc_vlantci_create)(efx_txq_t *, uint16_t,
efx_desc_t *);
#if EFSYS_OPT_QSTATS
@@ -189,6 +194,7 @@ typedef struct efx_mac_ops_s {
efx_rc_t (*emo_poll)(efx_nic_t *, efx_link_mode_t *);
efx_rc_t (*emo_up)(efx_nic_t *, boolean_t *);
efx_rc_t (*emo_addr_set)(efx_nic_t *);
+ efx_rc_t (*emo_pdu_set)(efx_nic_t *);
efx_rc_t (*emo_reconfigure)(efx_nic_t *);
efx_rc_t (*emo_multicast_list_set)(efx_nic_t *);
efx_rc_t (*emo_filter_default_rxq_set)(efx_nic_t *,
@@ -358,6 +364,7 @@ typedef struct efx_intr_s {
typedef struct efx_nic_ops_s {
efx_rc_t (*eno_probe)(efx_nic_t *);
+ efx_rc_t (*eno_board_cfg)(efx_nic_t *);
efx_rc_t (*eno_set_drv_limits)(efx_nic_t *, efx_drv_limits_t*);
efx_rc_t (*eno_reset)(efx_nic_t *);
efx_rc_t (*eno_init)(efx_nic_t *);
@@ -456,9 +463,8 @@ falconsiena_filter_tbl_clear(
typedef struct efx_mcdi_ops_s {
efx_rc_t (*emco_init)(efx_nic_t *, const efx_mcdi_transport_t *);
- void (*emco_request_copyin)(efx_nic_t *, efx_mcdi_req_t *,
- unsigned int, boolean_t, boolean_t);
- void (*emco_request_copyout)(efx_nic_t *, efx_mcdi_req_t *);
+ void (*emco_send_request)(efx_nic_t *, void *, size_t,
+ void *, size_t);
efx_rc_t (*emco_poll_reboot)(efx_nic_t *);
boolean_t (*emco_poll_response)(efx_nic_t *);
void (*emco_read_response)(efx_nic_t *, void *, size_t, size_t);
@@ -479,21 +485,21 @@ typedef struct efx_nvram_ops_s {
#if EFSYS_OPT_DIAG
efx_rc_t (*envo_test)(efx_nic_t *);
#endif /* EFSYS_OPT_DIAG */
- efx_rc_t (*envo_size)(efx_nic_t *, efx_nvram_type_t, size_t *);
- efx_rc_t (*envo_get_version)(efx_nic_t *, efx_nvram_type_t,
- uint32_t *, uint16_t *);
- efx_rc_t (*envo_rw_start)(efx_nic_t *, efx_nvram_type_t, size_t *);
- efx_rc_t (*envo_read_chunk)(efx_nic_t *, efx_nvram_type_t,
+ efx_rc_t (*envo_type_to_partn)(efx_nic_t *, efx_nvram_type_t,
+ uint32_t *);
+ efx_rc_t (*envo_partn_size)(efx_nic_t *, uint32_t, size_t *);
+ efx_rc_t (*envo_partn_rw_start)(efx_nic_t *, uint32_t, size_t *);
+ efx_rc_t (*envo_partn_read)(efx_nic_t *, uint32_t,
unsigned int, caddr_t, size_t);
- efx_rc_t (*envo_erase)(efx_nic_t *, efx_nvram_type_t);
- efx_rc_t (*envo_write_chunk)(efx_nic_t *, efx_nvram_type_t,
+ efx_rc_t (*envo_partn_erase)(efx_nic_t *, uint32_t,
+ unsigned int, size_t);
+ efx_rc_t (*envo_partn_write)(efx_nic_t *, uint32_t,
unsigned int, caddr_t, size_t);
- void (*envo_rw_finish)(efx_nic_t *, efx_nvram_type_t);
- efx_rc_t (*envo_set_version)(efx_nic_t *, efx_nvram_type_t,
+ void (*envo_partn_rw_finish)(efx_nic_t *, uint32_t);
+ efx_rc_t (*envo_partn_get_version)(efx_nic_t *, uint32_t,
+ uint32_t *, uint16_t *);
+ efx_rc_t (*envo_partn_set_version)(efx_nic_t *, uint32_t,
uint16_t *);
-
- efx_rc_t (*envo_type_to_partn)(efx_nic_t *, efx_nvram_type_t,
- uint32_t *);
} efx_nvram_ops_t;
#endif /* EFSYS_OPT_NVRAM */
@@ -553,7 +559,8 @@ efx_mcdi_nvram_read(
__in uint32_t partn,
__in uint32_t offset,
__out_bcount(size) caddr_t data,
- __in size_t size);
+ __in size_t size,
+ __in uint32_t mode);
__checkReturn efx_rc_t
efx_mcdi_nvram_erase(
@@ -587,6 +594,18 @@ efx_mcdi_nvram_test(
#endif /* EFSYS_OPT_VPD || EFSYS_OPT_NVRAM */
+#if EFSYS_OPT_LICENSING
+
+typedef struct efx_lic_ops_s {
+ efx_rc_t (*elo_update_licenses)(efx_nic_t *);
+ efx_rc_t (*elo_get_key_stats)(efx_nic_t *, efx_key_stats_t *);
+ efx_rc_t (*elo_app_state)(efx_nic_t *, uint64_t, boolean_t *);
+ efx_rc_t (*elo_get_id)(efx_nic_t *, size_t, uint32_t *,
+ size_t *, uint8_t *);
+} efx_lic_ops_t;
+
+#endif
+
typedef struct efx_drv_cfg_s {
uint32_t edc_min_vi_count;
uint32_t edc_max_vi_count;
@@ -636,6 +655,9 @@ struct efx_nic_s {
uint32_t en_rss_context;
#endif /* EFSYS_OPT_RX_SCALE */
uint32_t en_vport_id;
+#if EFSYS_OPT_LICENSING
+ efx_lic_ops_t *en_elop;
+#endif
union {
#if EFSYS_OPT_FALCON
struct {
diff --git a/sys/dev/sfxge/common/efx_lic.c b/sys/dev/sfxge/common/efx_lic.c
new file mode 100644
index 0000000..33c8aba
--- /dev/null
+++ b/sys/dev/sfxge/common/efx_lic.c
@@ -0,0 +1,792 @@
+/*-
+ * Copyright (c) 2009-2015 Solarflare Communications Inc.
+ * 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 COPYRIGHT HOLDERS AND CONTRIBUTORS "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 COPYRIGHT OWNER 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 views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the FreeBSD Project.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include "efx.h"
+#include "efx_impl.h"
+
+#if EFSYS_OPT_LICENSING
+
+#if EFSYS_OPT_SIENA
+
+static __checkReturn efx_rc_t
+efx_mcdi_fc_license_update_license(
+ __in efx_nic_t *enp);
+
+static __checkReturn efx_rc_t
+efx_mcdi_fc_license_get_key_stats(
+ __in efx_nic_t *enp,
+ __out efx_key_stats_t *eksp);
+
+static efx_lic_ops_t __efx_lic_v1_ops = {
+ efx_mcdi_fc_license_update_license, /* elo_update_licenses */
+ efx_mcdi_fc_license_get_key_stats, /* elo_get_key_stats */
+ NULL, /* elo_app_state */
+ NULL, /* elo_get_id */
+};
+
+#endif /* EFSYS_OPT_SIENA */
+
+#if EFSYS_OPT_HUNTINGTON
+
+static __checkReturn efx_rc_t
+efx_mcdi_licensing_update_licenses(
+ __in efx_nic_t *enp);
+
+static __checkReturn efx_rc_t
+efx_mcdi_licensing_get_key_stats(
+ __in efx_nic_t *enp,
+ __out efx_key_stats_t *eksp);
+
+static __checkReturn efx_rc_t
+efx_mcdi_licensed_app_state(
+ __in efx_nic_t *enp,
+ __in uint64_t app_id,
+ __out boolean_t *licensedp);
+
+static efx_lic_ops_t __efx_lic_v2_ops = {
+ efx_mcdi_licensing_update_licenses, /* elo_update_licenses */
+ efx_mcdi_licensing_get_key_stats, /* elo_get_key_stats */
+ efx_mcdi_licensed_app_state, /* elo_app_state */
+ NULL, /* elo_get_id */
+};
+
+#endif /* EFSYS_OPT_HUNTINGTON */
+
+#if EFSYS_OPT_MEDFORD
+
+static __checkReturn efx_rc_t
+efx_mcdi_licensing_v3_update_licenses(
+ __in efx_nic_t *enp);
+
+static __checkReturn efx_rc_t
+efx_mcdi_licensing_v3_report_license(
+ __in efx_nic_t *enp,
+ __out efx_key_stats_t *eksp);
+
+static __checkReturn efx_rc_t
+efx_mcdi_licensing_v3_app_state(
+ __in efx_nic_t *enp,
+ __in uint64_t app_id,
+ __out boolean_t *licensedp);
+
+static __checkReturn efx_rc_t
+efx_mcdi_licensing_v3_get_id(
+ __in efx_nic_t *enp,
+ __in size_t buffer_size,
+ __out uint32_t *typep,
+ __out size_t *lengthp,
+ __out_bcount_part_opt(buffer_size, *lengthp)
+ uint8_t *bufferp);
+
+static efx_lic_ops_t __efx_lic_v3_ops = {
+ efx_mcdi_licensing_v3_update_licenses, /* elo_update_licenses */
+ efx_mcdi_licensing_v3_report_license, /* elo_get_key_stats */
+ efx_mcdi_licensing_v3_app_state, /* elo_app_state */
+ efx_mcdi_licensing_v3_get_id, /* elo_get_id */
+};
+
+#endif /* EFSYS_OPT_MEDFORD */
+
+
+/* V1 Licensing - used in Siena Modena only */
+
+#if EFSYS_OPT_SIENA
+
+static __checkReturn efx_rc_t
+efx_mcdi_fc_license_update_license(
+ __in efx_nic_t *enp)
+{
+ efx_mcdi_req_t req;
+ uint8_t payload[MC_CMD_FC_IN_LICENSE_LEN];
+ efx_rc_t rc;
+
+ EFSYS_ASSERT(enp->en_family == EFX_FAMILY_SIENA);
+
+ (void) memset(payload, 0, sizeof (payload));
+ req.emr_cmd = MC_CMD_FC_OP_LICENSE;
+ req.emr_in_buf = payload;
+ req.emr_in_length = MC_CMD_FC_IN_LICENSE_LEN;
+ req.emr_out_buf = payload;
+ req.emr_out_length = 0;
+
+ MCDI_IN_SET_DWORD(req, FC_IN_LICENSE_OP,
+ MC_CMD_FC_IN_LICENSE_UPDATE_LICENSE);
+
+ efx_mcdi_execute(enp, &req);
+
+ if (req.emr_rc != 0) {
+ rc = req.emr_rc;
+ goto fail1;
+ }
+
+ if (req.emr_out_length_used != 0) {
+ rc = EIO;
+ goto fail2;
+ }
+
+ return (0);
+
+fail2:
+ EFSYS_PROBE(fail2);
+fail1:
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
+
+ return (rc);
+}
+
+static __checkReturn efx_rc_t
+efx_mcdi_fc_license_get_key_stats(
+ __in efx_nic_t *enp,
+ __out efx_key_stats_t *eksp)
+{
+ efx_mcdi_req_t req;
+ uint8_t payload[MAX(MC_CMD_FC_IN_LICENSE_LEN,
+ MC_CMD_FC_OUT_LICENSE_LEN)];
+ efx_rc_t rc;
+
+ EFSYS_ASSERT(enp->en_family == EFX_FAMILY_SIENA);
+
+ (void) memset(payload, 0, sizeof (payload));
+ req.emr_cmd = MC_CMD_FC_OP_LICENSE;
+ req.emr_in_buf = payload;
+ req.emr_in_length = MC_CMD_FC_IN_LICENSE_LEN;
+ req.emr_out_buf = payload;
+ req.emr_out_length = MC_CMD_FC_OUT_LICENSE_LEN;
+
+ MCDI_IN_SET_DWORD(req, FC_IN_LICENSE_OP,
+ MC_CMD_FC_IN_LICENSE_GET_KEY_STATS);
+
+ efx_mcdi_execute(enp, &req);
+
+ if (req.emr_rc != 0) {
+ rc = req.emr_rc;
+ goto fail1;
+ }
+
+ if (req.emr_out_length_used < MC_CMD_FC_OUT_LICENSE_LEN) {
+ rc = EMSGSIZE;
+ goto fail2;
+ }
+
+ eksp->eks_valid =
+ MCDI_OUT_DWORD(req, FC_OUT_LICENSE_VALID_KEYS);
+ eksp->eks_invalid =
+ MCDI_OUT_DWORD(req, FC_OUT_LICENSE_INVALID_KEYS);
+ eksp->eks_blacklisted =
+ MCDI_OUT_DWORD(req, FC_OUT_LICENSE_BLACKLISTED_KEYS);
+ eksp->eks_unverifiable = 0;
+ eksp->eks_wrong_node = 0;
+ eksp->eks_licensed_apps_lo = 0;
+ eksp->eks_licensed_apps_hi = 0;
+ eksp->eks_licensed_features_lo = 0;
+ eksp->eks_licensed_features_hi = 0;
+
+ return (0);
+
+fail2:
+ EFSYS_PROBE(fail2);
+fail1:
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
+
+ return (rc);
+}
+
+#endif /* EFSYS_OPT_SIENA */
+
+/* V2 Licensing - used by Huntington family only. See SF-113611-TC */
+
+#if EFSYS_OPT_HUNTINGTON
+
+static __checkReturn efx_rc_t
+efx_mcdi_licensed_app_state(
+ __in efx_nic_t *enp,
+ __in uint64_t app_id,
+ __out boolean_t *licensedp)
+{
+ efx_mcdi_req_t req;
+ uint8_t payload[MAX(MC_CMD_GET_LICENSED_APP_STATE_IN_LEN,
+ MC_CMD_GET_LICENSED_APP_STATE_OUT_LEN)];
+ uint32_t app_state;
+ efx_rc_t rc;
+
+ EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON);
+
+ /* V2 licensing supports 32bit app id only */
+ if ((app_id >> 32) != 0) {
+ rc = EINVAL;
+ goto fail1;
+ }
+
+ (void) memset(payload, 0, sizeof (payload));
+ req.emr_cmd = MC_CMD_GET_LICENSED_APP_STATE;
+ req.emr_in_buf = payload;
+ req.emr_in_length = MC_CMD_GET_LICENSED_APP_STATE_IN_LEN;
+ req.emr_out_buf = payload;
+ req.emr_out_length = MC_CMD_GET_LICENSED_APP_STATE_OUT_LEN;
+
+ MCDI_IN_SET_DWORD(req, GET_LICENSED_APP_STATE_IN_APP_ID,
+ app_id & 0xffffffff);
+
+ efx_mcdi_execute(enp, &req);
+
+ if (req.emr_rc != 0) {
+ rc = req.emr_rc;
+ goto fail2;
+ }
+
+ if (req.emr_out_length_used < MC_CMD_GET_LICENSED_APP_STATE_OUT_LEN) {
+ rc = EMSGSIZE;
+ goto fail3;
+ }
+
+ app_state = (MCDI_OUT_DWORD(req, GET_LICENSED_APP_STATE_OUT_STATE));
+ if (app_state != MC_CMD_GET_LICENSED_APP_STATE_OUT_NOT_LICENSED) {
+ *licensedp = B_TRUE;
+ } else {
+ *licensedp = B_FALSE;
+ }
+
+ return (0);
+
+fail3:
+ EFSYS_PROBE(fail3);
+fail2:
+ EFSYS_PROBE(fail2);
+fail1:
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
+
+ return (rc);
+}
+
+static __checkReturn efx_rc_t
+efx_mcdi_licensing_update_licenses(
+ __in efx_nic_t *enp)
+{
+ efx_mcdi_req_t req;
+ uint8_t payload[MC_CMD_LICENSING_IN_LEN];
+ efx_rc_t rc;
+
+ EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON);
+
+ (void) memset(payload, 0, sizeof (payload));
+ req.emr_cmd = MC_CMD_LICENSING;
+ req.emr_in_buf = payload;
+ req.emr_in_length = MC_CMD_LICENSING_IN_LEN;
+ req.emr_out_buf = payload;
+ req.emr_out_length = 0;
+
+ MCDI_IN_SET_DWORD(req, LICENSING_IN_OP,
+ MC_CMD_LICENSING_IN_OP_UPDATE_LICENSE);
+
+ efx_mcdi_execute(enp, &req);
+
+ if (req.emr_rc != 0) {
+ rc = req.emr_rc;
+ goto fail1;
+ }
+
+ if (req.emr_out_length_used != 0) {
+ rc = EIO;
+ goto fail2;
+ }
+
+ return (0);
+
+fail2:
+ EFSYS_PROBE(fail2);
+fail1:
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
+
+ return (rc);
+}
+
+static __checkReturn efx_rc_t
+efx_mcdi_licensing_get_key_stats(
+ __in efx_nic_t *enp,
+ __out efx_key_stats_t *eksp)
+{
+ efx_mcdi_req_t req;
+ uint8_t payload[MAX(MC_CMD_LICENSING_IN_LEN,
+ MC_CMD_LICENSING_OUT_LEN)];
+ efx_rc_t rc;
+
+ EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON);
+
+ (void) memset(payload, 0, sizeof (payload));
+ req.emr_cmd = MC_CMD_LICENSING;
+ req.emr_in_buf = payload;
+ req.emr_in_length = MC_CMD_LICENSING_IN_LEN;
+ req.emr_out_buf = payload;
+ req.emr_out_length = MC_CMD_LICENSING_OUT_LEN;
+
+ MCDI_IN_SET_DWORD(req, LICENSING_IN_OP,
+ MC_CMD_LICENSING_IN_OP_GET_KEY_STATS);
+
+ efx_mcdi_execute(enp, &req);
+
+ if (req.emr_rc != 0) {
+ rc = req.emr_rc;
+ goto fail1;
+ }
+
+ if (req.emr_out_length_used < MC_CMD_LICENSING_OUT_LEN) {
+ rc = EMSGSIZE;
+ goto fail2;
+ }
+
+ eksp->eks_valid =
+ MCDI_OUT_DWORD(req, LICENSING_OUT_VALID_APP_KEYS);
+ eksp->eks_invalid =
+ MCDI_OUT_DWORD(req, LICENSING_OUT_INVALID_APP_KEYS);
+ eksp->eks_blacklisted =
+ MCDI_OUT_DWORD(req, LICENSING_OUT_BLACKLISTED_APP_KEYS);
+ eksp->eks_unverifiable =
+ MCDI_OUT_DWORD(req, LICENSING_OUT_UNVERIFIABLE_APP_KEYS);
+ eksp->eks_wrong_node =
+ MCDI_OUT_DWORD(req, LICENSING_OUT_WRONG_NODE_APP_KEYS);
+ eksp->eks_licensed_apps_lo = 0;
+ eksp->eks_licensed_apps_hi = 0;
+ eksp->eks_licensed_features_lo = 0;
+ eksp->eks_licensed_features_hi = 0;
+
+ return (0);
+
+fail2:
+ EFSYS_PROBE(fail2);
+fail1:
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
+
+ return (rc);
+}
+
+#endif /* EFSYS_OPT_HUNTINGTON */
+
+/* V3 Licensing - used starting from Medford family. See SF-114884-SW */
+
+#if EFSYS_OPT_MEDFORD
+
+static __checkReturn efx_rc_t
+efx_mcdi_licensing_v3_update_licenses(
+ __in efx_nic_t *enp)
+{
+ efx_mcdi_req_t req;
+ uint8_t payload[MC_CMD_LICENSING_V3_IN_LEN];
+ efx_rc_t rc;
+
+ EFSYS_ASSERT(enp->en_family == EFX_FAMILY_MEDFORD);
+
+ (void) memset(payload, 0, sizeof (payload));
+ req.emr_cmd = MC_CMD_LICENSING_V3;
+ req.emr_in_buf = payload;
+ req.emr_in_length = MC_CMD_LICENSING_V3_IN_LEN;
+ req.emr_out_buf = NULL;
+ req.emr_out_length = 0;
+
+ MCDI_IN_SET_DWORD(req, LICENSING_V3_IN_OP,
+ MC_CMD_LICENSING_V3_IN_OP_UPDATE_LICENSE);
+
+ efx_mcdi_execute(enp, &req);
+
+ if (req.emr_rc != 0) {
+ rc = req.emr_rc;
+ goto fail1;
+ }
+
+ return (0);
+
+fail1:
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
+
+ return (rc);
+}
+
+static __checkReturn efx_rc_t
+efx_mcdi_licensing_v3_report_license(
+ __in efx_nic_t *enp,
+ __out efx_key_stats_t *eksp)
+{
+ efx_mcdi_req_t req;
+ uint8_t payload[MAX(MC_CMD_LICENSING_V3_IN_LEN,
+ MC_CMD_LICENSING_V3_OUT_LEN)];
+ efx_rc_t rc;
+
+ EFSYS_ASSERT(enp->en_family == EFX_FAMILY_MEDFORD);
+
+ (void) memset(payload, 0, sizeof (payload));
+ req.emr_cmd = MC_CMD_LICENSING_V3;
+ req.emr_in_buf = payload;
+ req.emr_in_length = MC_CMD_LICENSING_V3_IN_LEN;
+ req.emr_out_buf = payload;
+ req.emr_out_length = MC_CMD_LICENSING_V3_OUT_LEN;
+
+ MCDI_IN_SET_DWORD(req, LICENSING_V3_IN_OP,
+ MC_CMD_LICENSING_V3_IN_OP_REPORT_LICENSE);
+
+ efx_mcdi_execute(enp, &req);
+
+ if (req.emr_rc != 0) {
+ rc = req.emr_rc;
+ goto fail1;
+ }
+
+ if (req.emr_out_length_used < MC_CMD_LICENSING_V3_OUT_LEN) {
+ rc = EMSGSIZE;
+ goto fail2;
+ }
+
+ eksp->eks_valid =
+ MCDI_OUT_DWORD(req, LICENSING_V3_OUT_VALID_KEYS);
+ eksp->eks_invalid =
+ MCDI_OUT_DWORD(req, LICENSING_V3_OUT_INVALID_KEYS);
+ eksp->eks_blacklisted = 0;
+ eksp->eks_unverifiable =
+ MCDI_OUT_DWORD(req, LICENSING_V3_OUT_UNVERIFIABLE_KEYS);
+ eksp->eks_wrong_node =
+ MCDI_OUT_DWORD(req, LICENSING_V3_OUT_WRONG_NODE_KEYS);
+ eksp->eks_licensed_apps_lo =
+ MCDI_OUT_DWORD(req, LICENSING_V3_OUT_LICENSED_APPS_LO);
+ eksp->eks_licensed_apps_hi =
+ MCDI_OUT_DWORD(req, LICENSING_V3_OUT_LICENSED_APPS_HI);
+ eksp->eks_licensed_features_lo =
+ MCDI_OUT_DWORD(req, LICENSING_V3_OUT_LICENSED_FEATURES_LO);
+ eksp->eks_licensed_features_hi =
+ MCDI_OUT_DWORD(req, LICENSING_V3_OUT_LICENSED_FEATURES_HI);
+
+ return (0);
+
+fail2:
+ EFSYS_PROBE(fail2);
+fail1:
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
+
+ return (rc);
+}
+
+static __checkReturn efx_rc_t
+efx_mcdi_licensing_v3_app_state(
+ __in efx_nic_t *enp,
+ __in uint64_t app_id,
+ __out boolean_t *licensedp)
+{
+ efx_mcdi_req_t req;
+ uint8_t payload[MAX(MC_CMD_GET_LICENSED_V3_APP_STATE_IN_LEN,
+ MC_CMD_GET_LICENSED_V3_APP_STATE_OUT_LEN)];
+ uint32_t app_state;
+ efx_rc_t rc;
+
+ EFSYS_ASSERT(enp->en_family == EFX_FAMILY_MEDFORD);
+
+ (void) memset(payload, 0, sizeof (payload));
+ req.emr_cmd = MC_CMD_GET_LICENSED_V3_APP_STATE;
+ req.emr_in_buf = payload;
+ req.emr_in_length = MC_CMD_GET_LICENSED_V3_APP_STATE_IN_LEN;
+ req.emr_out_buf = payload;
+ req.emr_out_length = MC_CMD_GET_LICENSED_V3_APP_STATE_OUT_LEN;
+
+ MCDI_IN_SET_DWORD(req, GET_LICENSED_V3_APP_STATE_IN_APP_ID_LO,
+ app_id & 0xffffffff);
+ MCDI_IN_SET_DWORD(req, GET_LICENSED_V3_APP_STATE_IN_APP_ID_HI,
+ app_id >> 32);
+
+ efx_mcdi_execute(enp, &req);
+
+ if (req.emr_rc != 0) {
+ rc = req.emr_rc;
+ goto fail1;
+ }
+
+ if (req.emr_out_length_used < MC_CMD_GET_LICENSED_V3_APP_STATE_OUT_LEN) {
+ rc = EMSGSIZE;
+ goto fail2;
+ }
+
+ app_state = (MCDI_OUT_DWORD(req, GET_LICENSED_V3_APP_STATE_OUT_STATE));
+ if (app_state != MC_CMD_GET_LICENSED_V3_APP_STATE_OUT_NOT_LICENSED) {
+ *licensedp = B_TRUE;
+ } else {
+ *licensedp = B_FALSE;
+ }
+
+ return (0);
+
+fail2:
+ EFSYS_PROBE(fail2);
+fail1:
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
+
+ return (rc);
+}
+
+static __checkReturn efx_rc_t
+efx_mcdi_licensing_v3_get_id(
+ __in efx_nic_t *enp,
+ __in size_t buffer_size,
+ __out uint32_t *typep,
+ __out size_t *lengthp,
+ __out_bcount_part_opt(buffer_size, *lengthp)
+ uint8_t *bufferp)
+{
+ efx_mcdi_req_t req;
+ uint8_t payload[MAX(MC_CMD_LICENSING_GET_ID_V3_IN_LEN,
+ MC_CMD_LICENSING_GET_ID_V3_OUT_LENMIN)];
+ efx_rc_t rc;
+
+ req.emr_cmd = MC_CMD_LICENSING_GET_ID_V3;
+
+ if (bufferp == NULL) {
+ /* Request id type and length only */
+ req.emr_in_buf = bufferp;
+ req.emr_in_length = MC_CMD_LICENSING_GET_ID_V3_IN_LEN;
+ req.emr_out_buf = bufferp;
+ req.emr_out_length = MC_CMD_LICENSING_GET_ID_V3_OUT_LENMIN;
+ (void) memset(payload, 0, sizeof (payload));
+ } else {
+ /* Request full buffer */
+ req.emr_in_buf = bufferp;
+ req.emr_in_length = MC_CMD_LICENSING_GET_ID_V3_IN_LEN;
+ req.emr_out_buf = bufferp;
+ req.emr_out_length = MIN(buffer_size, MC_CMD_LICENSING_GET_ID_V3_OUT_LENMIN);
+ (void) memset(bufferp, 0, req.emr_out_length);
+ }
+
+ efx_mcdi_execute(enp, &req);
+
+ if (req.emr_rc != 0) {
+ rc = req.emr_rc;
+ goto fail1;
+ }
+
+ if (req.emr_out_length_used < MC_CMD_LICENSING_GET_ID_V3_OUT_LENMIN) {
+ rc = EMSGSIZE;
+ goto fail2;
+ }
+
+ *typep = MCDI_OUT_DWORD(req, LICENSING_GET_ID_V3_OUT_LICENSE_TYPE);
+ *lengthp = MCDI_OUT_DWORD(req, LICENSING_GET_ID_V3_OUT_LICENSE_ID_LENGTH);
+
+ if (bufferp == NULL) {
+ /* modify length requirements to indicate to caller the extra buffering
+ ** needed to read the complete output.
+ */
+ *lengthp += MC_CMD_LICENSING_GET_ID_V3_OUT_LENMIN;
+ } else {
+ /* Shift ID down to start of buffer */
+ memmove(bufferp,
+ bufferp+MC_CMD_LICENSING_GET_ID_V3_OUT_LICENSE_ID_OFST,
+ *lengthp);
+ memset(bufferp+(*lengthp), 0, MC_CMD_LICENSING_GET_ID_V3_OUT_LICENSE_ID_OFST);
+ }
+
+ return (0);
+
+fail2:
+ EFSYS_PROBE(fail2);
+fail1:
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
+
+ return (rc);
+}
+
+
+#endif /* EFSYS_OPT_MEDFORD */
+
+ __checkReturn efx_rc_t
+efx_lic_init(
+ __in efx_nic_t *enp)
+{
+ efx_lic_ops_t *elop;
+ efx_rc_t rc;
+
+ EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
+ EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PROBE);
+ EFSYS_ASSERT(!(enp->en_mod_flags & EFX_MOD_LIC));
+
+ switch (enp->en_family) {
+
+#if EFSYS_OPT_SIENA
+ case EFX_FAMILY_SIENA:
+ elop = (efx_lic_ops_t *)&__efx_lic_v1_ops;
+ break;
+#endif /* EFSYS_OPT_SIENA */
+
+#if EFSYS_OPT_HUNTINGTON
+ case EFX_FAMILY_HUNTINGTON:
+ elop = (efx_lic_ops_t *)&__efx_lic_v2_ops;
+ break;
+#endif /* EFSYS_OPT_HUNTINGTON */
+
+#if EFSYS_OPT_MEDFORD
+ case EFX_FAMILY_MEDFORD:
+ elop = (efx_lic_ops_t *)&__efx_lic_v3_ops;
+ break;
+#endif /* EFSYS_OPT_MEDFORD */
+
+ default:
+ EFSYS_ASSERT(0);
+ rc = ENOTSUP;
+ goto fail1;
+ }
+
+ enp->en_elop = elop;
+ enp->en_mod_flags |= EFX_MOD_LIC;
+
+ return (0);
+
+fail1:
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
+
+ return (rc);
+}
+
+ void
+efx_lic_fini(
+ __in efx_nic_t *enp)
+{
+ efx_lic_ops_t *elop = enp->en_elop;
+
+ EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
+ EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PROBE);
+ EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_LIC);
+
+ enp->en_elop = NULL;
+ enp->en_mod_flags &= ~EFX_MOD_LIC;
+}
+
+
+ __checkReturn efx_rc_t
+efx_lic_update_licenses(
+ __in efx_nic_t *enp)
+{
+ efx_lic_ops_t *elop = enp->en_elop;
+ efx_rc_t rc;
+
+ EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
+ EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_LIC);
+
+ if ((rc = elop->elo_update_licenses(enp)) != 0)
+ goto fail1;
+
+ return (0);
+
+fail1:
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
+
+ return (rc);
+}
+
+ __checkReturn efx_rc_t
+efx_lic_get_key_stats(
+ __in efx_nic_t *enp,
+ __out efx_key_stats_t *eksp)
+{
+ efx_lic_ops_t *elop = enp->en_elop;
+ efx_rc_t rc;
+
+ EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
+ EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_LIC);
+
+ if ((rc = elop->elo_get_key_stats(enp, eksp)) != 0)
+ goto fail1;
+
+ return (0);
+
+fail1:
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
+
+ return (rc);
+}
+
+ __checkReturn efx_rc_t
+efx_lic_app_state(
+ __in efx_nic_t *enp,
+ __in uint64_t app_id,
+ __out boolean_t *licensedp)
+{
+ efx_lic_ops_t *elop = enp->en_elop;
+ efx_rc_t rc;
+
+ EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
+ EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_LIC);
+
+ if (elop->elo_app_state == NULL) {
+ rc = ENOTSUP;
+ goto fail1;
+ }
+ if ((rc = elop->elo_app_state(enp, app_id, licensedp)) != 0)
+ goto fail2;
+
+ return (0);
+
+fail2:
+ EFSYS_PROBE(fail2);
+fail1:
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
+
+ return (rc);
+}
+
+ __checkReturn efx_rc_t
+efx_lic_get_id(
+ __in efx_nic_t *enp,
+ __in size_t buffer_size,
+ __out uint32_t *typep,
+ __out size_t *lengthp,
+ __out_opt uint8_t *bufferp
+ )
+{
+ efx_lic_ops_t *elop = enp->en_elop;
+ efx_rc_t rc;
+
+ EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
+ EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_LIC);
+
+ if (elop->elo_get_id == NULL) {
+ rc = ENOTSUP;
+ goto fail1;
+ }
+
+ if ((rc = elop->elo_get_id(enp, buffer_size, typep,
+ lengthp, bufferp)) != 0)
+ goto fail2;
+
+ return (0);
+
+fail2:
+ EFSYS_PROBE(fail2);
+fail1:
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
+
+ return (rc);
+}
+
+#endif /* EFSYS_OPT_LICENSING */
diff --git a/sys/dev/sfxge/common/efx_mac.c b/sys/dev/sfxge/common/efx_mac.c
index c8794a6..4868c4b 100644
--- a/sys/dev/sfxge/common/efx_mac.c
+++ b/sys/dev/sfxge/common/efx_mac.c
@@ -56,6 +56,7 @@ static efx_mac_ops_t __efx_falcon_gmac_ops = {
falcon_mac_poll, /* emo_poll */
falcon_mac_up, /* emo_up */
falcon_gmac_reconfigure, /* emo_addr_set */
+ falcon_gmac_reconfigure, /* emo_pdu_set */
falcon_gmac_reconfigure, /* emo_reconfigure */
falconsiena_mac_multicast_list_set, /* emo_multicast_list_set */
NULL, /* emo_filter_set_default_rxq */
@@ -77,6 +78,7 @@ static efx_mac_ops_t __efx_falcon_xmac_ops = {
falcon_mac_poll, /* emo_poll */
falcon_mac_up, /* emo_up */
falcon_xmac_reconfigure, /* emo_addr_set */
+ falcon_xmac_reconfigure, /* emo_pdu_set */
falcon_xmac_reconfigure, /* emo_reconfigure */
falconsiena_mac_multicast_list_set, /* emo_multicast_list_set */
NULL, /* emo_filter_set_default_rxq */
@@ -98,6 +100,7 @@ static efx_mac_ops_t __efx_siena_mac_ops = {
siena_mac_poll, /* emo_poll */
siena_mac_up, /* emo_up */
siena_mac_reconfigure, /* emo_addr_set */
+ siena_mac_reconfigure, /* emo_pdu_set */
siena_mac_reconfigure, /* emo_reconfigure */
falconsiena_mac_multicast_list_set, /* emo_multicast_list_set */
NULL, /* emo_filter_set_default_rxq */
@@ -113,27 +116,28 @@ static efx_mac_ops_t __efx_siena_mac_ops = {
};
#endif /* EFSYS_OPT_SIENA */
-#if EFSYS_OPT_HUNTINGTON
-static efx_mac_ops_t __efx_hunt_mac_ops = {
+#if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD
+static efx_mac_ops_t __efx_ef10_mac_ops = {
NULL, /* emo_reset */
- hunt_mac_poll, /* emo_poll */
- hunt_mac_up, /* emo_up */
- hunt_mac_addr_set, /* emo_addr_set */
- hunt_mac_reconfigure, /* emo_reconfigure */
- hunt_mac_multicast_list_set, /* emo_multicast_list_set */
- hunt_mac_filter_default_rxq_set, /* emo_filter_default_rxq_set */
- hunt_mac_filter_default_rxq_clear,
+ ef10_mac_poll, /* emo_poll */
+ ef10_mac_up, /* emo_up */
+ ef10_mac_addr_set, /* emo_addr_set */
+ ef10_mac_pdu_set, /* emo_pdu_set */
+ ef10_mac_reconfigure, /* emo_reconfigure */
+ ef10_mac_multicast_list_set, /* emo_multicast_list_set */
+ ef10_mac_filter_default_rxq_set, /* emo_filter_default_rxq_set */
+ ef10_mac_filter_default_rxq_clear,
/* emo_filter_default_rxq_clear */
#if EFSYS_OPT_LOOPBACK
- hunt_mac_loopback_set, /* emo_loopback_set */
+ ef10_mac_loopback_set, /* emo_loopback_set */
#endif /* EFSYS_OPT_LOOPBACK */
#if EFSYS_OPT_MAC_STATS
efx_mcdi_mac_stats_upload, /* emo_stats_upload */
efx_mcdi_mac_stats_periodic, /* emo_stats_periodic */
- hunt_mac_stats_update /* emo_stats_update */
+ ef10_mac_stats_update /* emo_stats_update */
#endif /* EFSYS_OPT_MAC_STATS */
};
-#endif /* EFSYS_OPT_HUNTINGTON */
+#endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD */
static efx_mac_ops_t *__efx_mac_ops[] = {
/* [EFX_MAC_INVALID] */
@@ -158,7 +162,13 @@ static efx_mac_ops_t *__efx_mac_ops[] = {
#endif
/* [EFX_MAC_HUNTINGTON] */
#if EFSYS_OPT_HUNTINGTON
- &__efx_hunt_mac_ops,
+ &__efx_ef10_mac_ops,
+#else
+ NULL,
+#endif
+ /* [EFX_MAC_MEDFORD] */
+#if EFSYS_OPT_MEDFORD
+ &__efx_ef10_mac_ops,
#else
NULL,
#endif
@@ -190,7 +200,7 @@ efx_mac_pdu_set(
old_pdu = epp->ep_mac_pdu;
epp->ep_mac_pdu = (uint32_t)pdu;
- if ((rc = emop->emo_reconfigure(enp)) != 0)
+ if ((rc = emop->emo_pdu_set(enp)) != 0)
goto fail3;
return (0);
@@ -781,6 +791,13 @@ efx_mac_select(
efx_mac_ops_t *emop;
int rc = EINVAL;
+#if EFSYS_OPT_SIENA
+ if (enp->en_family == EFX_FAMILY_SIENA) {
+ type = EFX_MAC_SIENA;
+ goto chosen;
+ }
+#endif
+
#if EFSYS_OPT_HUNTINGTON
if (enp->en_family == EFX_FAMILY_HUNTINGTON) {
type = EFX_MAC_HUNTINGTON;
@@ -788,9 +805,9 @@ efx_mac_select(
}
#endif
-#if EFSYS_OPT_SIENA
- if (enp->en_family == EFX_FAMILY_SIENA) {
- type = EFX_MAC_SIENA;
+#if EFSYS_OPT_MEDFORD
+ if (enp->en_family == EFX_FAMILY_MEDFORD) {
+ type = EFX_MAC_MEDFORD;
goto chosen;
}
#endif
diff --git a/sys/dev/sfxge/common/efx_mcdi.c b/sys/dev/sfxge/common/efx_mcdi.c
index 07224c7..9f7a9ff 100644
--- a/sys/dev/sfxge/common/efx_mcdi.c
+++ b/sys/dev/sfxge/common/efx_mcdi.c
@@ -36,13 +36,32 @@ __FBSDID("$FreeBSD$");
#if EFSYS_OPT_MCDI
+/*
+ * There are three versions of the MCDI interface:
+ * - MCDIv0: Siena BootROM. Transport uses MCDIv1 headers.
+ * - MCDIv1: Siena firmware and Huntington BootROM.
+ * - MCDIv2: EF10 firmware (Huntington/Medford) and Medford BootROM.
+ * Transport uses MCDIv2 headers.
+ *
+ * MCDIv2 Header NOT_EPOCH flag
+ * ----------------------------
+ * A new epoch begins at initial startup or after an MC reboot, and defines when
+ * the MC should reject stale MCDI requests.
+ *
+ * The first MCDI request sent by the host should contain NOT_EPOCH=0, and all
+ * subsequent requests (until the next MC reboot) should contain NOT_EPOCH=1.
+ *
+ * After rebooting the MC will fail all requests with NOT_EPOCH=1 by writing a
+ * response with ERROR=1 and DATALEN=0 until a request is seen with NOT_EPOCH=0.
+ */
+
+
#if EFSYS_OPT_SIENA
static efx_mcdi_ops_t __efx_mcdi_siena_ops = {
siena_mcdi_init, /* emco_init */
- siena_mcdi_request_copyin, /* emco_request_copyin */
- siena_mcdi_request_copyout, /* emco_request_copyout */
+ siena_mcdi_send_request, /* emco_send_request */
siena_mcdi_poll_reboot, /* emco_poll_reboot */
siena_mcdi_poll_response, /* emco_poll_response */
siena_mcdi_read_response, /* emco_read_response */
@@ -56,8 +75,7 @@ static efx_mcdi_ops_t __efx_mcdi_siena_ops = {
static efx_mcdi_ops_t __efx_mcdi_ef10_ops = {
ef10_mcdi_init, /* emco_init */
- ef10_mcdi_request_copyin, /* emco_request_copyin */
- ef10_mcdi_request_copyout, /* emco_request_copyout */
+ ef10_mcdi_send_request, /* emco_send_request */
ef10_mcdi_poll_reboot, /* emco_poll_reboot */
ef10_mcdi_poll_response, /* emco_poll_response */
ef10_mcdi_read_response, /* emco_read_response */
@@ -179,26 +197,16 @@ efx_mcdi_new_epoch(
}
static void
-efx_mcdi_request_copyin(
+efx_mcdi_send_request(
__in efx_nic_t *enp,
- __in efx_mcdi_req_t *emrp,
- __in unsigned int seq,
- __in boolean_t ev_cpl,
- __in boolean_t new_epoch)
-{
- efx_mcdi_ops_t *emcop = enp->en_mcdi.em_emcop;
-
- emcop->emco_request_copyin(enp, emrp, seq, ev_cpl, new_epoch);
-}
-
-static void
-efx_mcdi_request_copyout(
- __in efx_nic_t *enp,
- __in efx_mcdi_req_t *emrp)
+ __in void *hdrp,
+ __in size_t hdr_len,
+ __in void *sdup,
+ __in size_t sdu_len)
{
efx_mcdi_ops_t *emcop = enp->en_mcdi.em_emcop;
- emcop->emco_request_copyout(enp, emrp);
+ emcop->emco_send_request(enp, hdrp, hdr_len, sdup, sdu_len);
}
static efx_rc_t
@@ -241,8 +249,15 @@ efx_mcdi_request_start(
__in efx_mcdi_req_t *emrp,
__in boolean_t ev_cpl)
{
+#if EFSYS_OPT_MCDI_LOGGING
+ const efx_mcdi_transport_t *emtp = enp->en_mcdi.em_emtp;
+#endif
efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip);
+ efx_dword_t hdr[2];
+ size_t hdr_len;
+ unsigned int max_version;
unsigned int seq;
+ unsigned int xflags;
boolean_t new_epoch;
int state;
@@ -269,13 +284,64 @@ efx_mcdi_request_start(
emip->emi_poll_cnt = 0;
seq = emip->emi_seq++ & EFX_MASK32(MCDI_HEADER_SEQ);
new_epoch = emip->emi_new_epoch;
+ max_version = emip->emi_max_version;
EFSYS_UNLOCK(enp->en_eslp, state);
- efx_mcdi_request_copyin(enp, emrp, seq, ev_cpl, new_epoch);
+ xflags = 0;
+ if (ev_cpl)
+ xflags |= MCDI_HEADER_XFLAGS_EVREQ;
+
+ /*
+ * Huntington firmware supports MCDIv2, but the Huntington BootROM only
+ * supports MCDIv1. Use MCDIv1 headers for MCDIv1 commands where
+ * possible to support this.
+ */
+ if ((max_version >= 2) &&
+ ((emrp->emr_cmd > MC_CMD_CMD_SPACE_ESCAPE_7) ||
+ (emrp->emr_in_length > MCDI_CTL_SDU_LEN_MAX_V1))) {
+ /* Construct MCDI v2 header */
+ hdr_len = sizeof (hdr);
+ EFX_POPULATE_DWORD_8(hdr[0],
+ MCDI_HEADER_CODE, MC_CMD_V2_EXTN,
+ MCDI_HEADER_RESYNC, 1,
+ MCDI_HEADER_DATALEN, 0,
+ MCDI_HEADER_SEQ, seq,
+ MCDI_HEADER_NOT_EPOCH, new_epoch ? 0 : 1,
+ MCDI_HEADER_ERROR, 0,
+ MCDI_HEADER_RESPONSE, 0,
+ MCDI_HEADER_XFLAGS, xflags);
+
+ EFX_POPULATE_DWORD_2(hdr[1],
+ MC_CMD_V2_EXTN_IN_EXTENDED_CMD, emrp->emr_cmd,
+ MC_CMD_V2_EXTN_IN_ACTUAL_LEN, emrp->emr_in_length);
+ } else {
+ /* Construct MCDI v1 header */
+ hdr_len = sizeof (hdr[0]);
+ EFX_POPULATE_DWORD_8(hdr[0],
+ MCDI_HEADER_CODE, emrp->emr_cmd,
+ MCDI_HEADER_RESYNC, 1,
+ MCDI_HEADER_DATALEN, emrp->emr_in_length,
+ MCDI_HEADER_SEQ, seq,
+ MCDI_HEADER_NOT_EPOCH, new_epoch ? 0 : 1,
+ MCDI_HEADER_ERROR, 0,
+ MCDI_HEADER_RESPONSE, 0,
+ MCDI_HEADER_XFLAGS, xflags);
+ }
+
+#if EFSYS_OPT_MCDI_LOGGING
+ if (emtp->emt_logger != NULL) {
+ emtp->emt_logger(emtp->emt_context, EFX_LOG_MCDI_REQUEST,
+ &hdr, hdr_len,
+ emrp->emr_in_buf, emrp->emr_in_length);
+ }
+#endif /* EFSYS_OPT_MCDI_LOGGING */
+
+ efx_mcdi_send_request(enp, &hdr[0], hdr_len,
+ emrp->emr_in_buf, emrp->emr_in_length);
}
- void
+static void
efx_mcdi_read_response_header(
__in efx_nic_t *enp,
__inout efx_mcdi_req_t *emrp)
@@ -384,19 +450,56 @@ efx_mcdi_read_response_header(
return;
fail3:
- if (!emrp->emr_quiet)
- EFSYS_PROBE(fail3);
fail2:
- if (!emrp->emr_quiet)
- EFSYS_PROBE(fail2);
fail1:
- if (!emrp->emr_quiet)
- EFSYS_PROBE1(fail1, efx_rc_t, rc);
-
emrp->emr_rc = rc;
emrp->emr_out_length_used = 0;
}
+static void
+efx_mcdi_finish_response(
+ __in efx_nic_t *enp,
+ __in efx_mcdi_req_t *emrp)
+{
+#if EFSYS_OPT_MCDI_LOGGING
+ const efx_mcdi_transport_t *emtp = enp->en_mcdi.em_emtp;
+#endif /* EFSYS_OPT_MCDI_LOGGING */
+ efx_dword_t hdr[2];
+ unsigned int hdr_len;
+ size_t bytes;
+
+ if (emrp->emr_out_buf == NULL)
+ return;
+
+ /* Read the command header to detect MCDI response format */
+ hdr_len = sizeof (hdr[0]);
+ efx_mcdi_read_response(enp, &hdr[0], 0, hdr_len);
+ if (EFX_DWORD_FIELD(hdr[0], MCDI_HEADER_CODE) == MC_CMD_V2_EXTN) {
+ /*
+ * Read the actual payload length. The length given in the event
+ * is only correct for responses with the V1 format.
+ */
+ efx_mcdi_read_response(enp, &hdr[1], hdr_len, sizeof (hdr[1]));
+ hdr_len += sizeof (hdr[1]);
+
+ emrp->emr_out_length_used = EFX_DWORD_FIELD(hdr[1],
+ MC_CMD_V2_EXTN_IN_ACTUAL_LEN);
+ }
+
+ /* Copy payload out into caller supplied buffer */
+ bytes = MIN(emrp->emr_out_length_used, emrp->emr_out_length);
+ efx_mcdi_read_response(enp, emrp->emr_out_buf, hdr_len, bytes);
+
+#if EFSYS_OPT_MCDI_LOGGING
+ if (emtp->emt_logger != NULL) {
+ emtp->emt_logger(emtp->emt_context,
+ EFX_LOG_MCDI_RESPONSE,
+ &hdr, hdr_len,
+ emrp->emr_out_buf, bytes);
+ }
+#endif /* EFSYS_OPT_MCDI_LOGGING */
+}
+
__checkReturn boolean_t
efx_mcdi_request_poll(
@@ -444,7 +547,7 @@ efx_mcdi_request_poll(
if ((rc = emrp->emr_rc) != 0)
goto fail2;
- efx_mcdi_request_copyout(enp, emrp);
+ efx_mcdi_finish_response(enp, emrp);
return (B_TRUE);
fail2:
@@ -638,7 +741,6 @@ efx_mcdi_ev_cpl(
{
efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip);
const efx_mcdi_transport_t *emtp = enp->en_mcdi.em_emtp;
- efx_mcdi_ops_t *emcop = enp->en_mcdi.em_emcop;
efx_mcdi_req_t *emrp;
int state;
@@ -680,7 +782,7 @@ efx_mcdi_ev_cpl(
}
}
if (errcode == 0) {
- emcop->emco_request_copyout(enp, emrp);
+ efx_mcdi_finish_response(enp, emrp);
}
emtp->emt_ev_cpl(emtp->emt_context);
diff --git a/sys/dev/sfxge/common/efx_mcdi.h b/sys/dev/sfxge/common/efx_mcdi.h
index 36b3d8d..dd1d76e 100644
--- a/sys/dev/sfxge/common/efx_mcdi.h
+++ b/sys/dev/sfxge/common/efx_mcdi.h
@@ -88,11 +88,6 @@ efx_mcdi_execute_quiet(
__in efx_nic_t *enp,
__inout efx_mcdi_req_t *emrp);
- extern void
-efx_mcdi_read_response_header(
- __in efx_nic_t *enp,
- __inout efx_mcdi_req_t *emrp);
-
extern void
efx_mcdi_ev_cpl(
__in efx_nic_t *enp,
diff --git a/sys/dev/sfxge/common/efx_nic.c b/sys/dev/sfxge/common/efx_nic.c
index 07acc56..dd28ece 100644
--- a/sys/dev/sfxge/common/efx_nic.c
+++ b/sys/dev/sfxge/common/efx_nic.c
@@ -244,6 +244,7 @@ fail1:
static efx_nic_ops_t __efx_nic_falcon_ops = {
falcon_nic_probe, /* eno_probe */
+ NULL, /* eno_board_cfg */
NULL, /* eno_set_drv_limits */
falcon_nic_reset, /* eno_reset */
falcon_nic_init, /* eno_init */
@@ -263,6 +264,7 @@ static efx_nic_ops_t __efx_nic_falcon_ops = {
static efx_nic_ops_t __efx_nic_siena_ops = {
siena_nic_probe, /* eno_probe */
+ NULL, /* eno_board_cfg */
NULL, /* eno_set_drv_limits */
siena_nic_reset, /* eno_reset */
siena_nic_init, /* eno_init */
@@ -282,6 +284,7 @@ static efx_nic_ops_t __efx_nic_siena_ops = {
static efx_nic_ops_t __efx_nic_hunt_ops = {
ef10_nic_probe, /* eno_probe */
+ hunt_board_cfg, /* eno_board_cfg */
ef10_nic_set_drv_limits, /* eno_set_drv_limits */
ef10_nic_reset, /* eno_reset */
ef10_nic_init, /* eno_init */
@@ -297,6 +300,27 @@ static efx_nic_ops_t __efx_nic_hunt_ops = {
#endif /* EFSYS_OPT_HUNTINGTON */
+#if EFSYS_OPT_MEDFORD
+
+static efx_nic_ops_t __efx_nic_medford_ops = {
+ ef10_nic_probe, /* eno_probe */
+ medford_board_cfg, /* eno_board_cfg */
+ ef10_nic_set_drv_limits, /* eno_set_drv_limits */
+ ef10_nic_reset, /* eno_reset */
+ ef10_nic_init, /* eno_init */
+ ef10_nic_get_vi_pool, /* eno_get_vi_pool */
+ ef10_nic_get_bar_region, /* eno_get_bar_region */
+#if EFSYS_OPT_DIAG
+ ef10_sram_test, /* eno_sram_test */
+ ef10_nic_register_test, /* eno_register_test */
+#endif /* EFSYS_OPT_DIAG */
+ ef10_nic_fini, /* eno_fini */
+ ef10_nic_unprobe, /* eno_unprobe */
+};
+
+#endif /* EFSYS_OPT_MEDFORD */
+
+
__checkReturn efx_rc_t
efx_nic_create(
__in efx_family_t family,
@@ -357,10 +381,29 @@ efx_nic_create(
EFX_FEATURE_MAC_HEADER_FILTERS |
EFX_FEATURE_MCDI_DMA |
EFX_FEATURE_PIO_BUFFERS |
- EFX_FEATURE_FW_ASSISTED_TSO;
+ EFX_FEATURE_FW_ASSISTED_TSO |
+ EFX_FEATURE_FW_ASSISTED_TSO_V2;
break;
#endif /* EFSYS_OPT_HUNTINGTON */
+#if EFSYS_OPT_MEDFORD
+ case EFX_FAMILY_MEDFORD:
+ enp->en_enop = (efx_nic_ops_t *)&__efx_nic_medford_ops;
+ /*
+ * FW_ASSISTED_TSO ommitted as Medford only supports firmware
+ * assisted TSO version 2, not the v1 scheme used on Huntington.
+ */
+ enp->en_features =
+ EFX_FEATURE_IPV6 |
+ EFX_FEATURE_LINK_EVENTS |
+ EFX_FEATURE_PERIODIC_MAC_STATS |
+ EFX_FEATURE_MCDI |
+ EFX_FEATURE_MAC_HEADER_FILTERS |
+ EFX_FEATURE_MCDI_DMA |
+ EFX_FEATURE_PIO_BUFFERS;
+ break;
+#endif /* EFSYS_OPT_MEDFORD */
+
default:
rc = ENOTSUP;
goto fail2;
@@ -665,8 +708,9 @@ efx_nic_reset(
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
EFSYS_ASSERT(enp->en_mod_flags & EFX_MOD_PROBE);
/*
- * All modules except the MCDI, PROBE, NVRAM, VPD, MON (which we
- * do not reset here) must have been shut down or never initialized.
+ * All modules except the MCDI, PROBE, NVRAM, VPD, MON, LIC
+ * (which we do not reset here) must have been shut down or never
+ * initialized.
*
* A rule of thumb here is: If the controller or MC reboots, is *any*
* state lost. If it's lost and needs reapplying, then the module
@@ -674,7 +718,7 @@ efx_nic_reset(
*/
mod_flags = enp->en_mod_flags;
mod_flags &= ~(EFX_MOD_MCDI | EFX_MOD_PROBE | EFX_MOD_NVRAM |
- EFX_MOD_VPD | EFX_MOD_MON);
+ EFX_MOD_VPD | EFX_MOD_MON | EFX_MOD_LIC);
EFSYS_ASSERT3U(mod_flags, ==, 0);
if (mod_flags != 0) {
rc = EINVAL;
diff --git a/sys/dev/sfxge/common/efx_nvram.c b/sys/dev/sfxge/common/efx_nvram.c
index 7597636..272e6c7 100644
--- a/sys/dev/sfxge/common/efx_nvram.c
+++ b/sys/dev/sfxge/common/efx_nvram.c
@@ -42,15 +42,15 @@ static efx_nvram_ops_t __efx_nvram_falcon_ops = {
#if EFSYS_OPT_DIAG
falcon_nvram_test, /* envo_test */
#endif /* EFSYS_OPT_DIAG */
- falcon_nvram_size, /* envo_size */
- falcon_nvram_get_version, /* envo_get_version */
- falcon_nvram_rw_start, /* envo_rw_start */
- falcon_nvram_read_chunk, /* envo_read_chunk */
- falcon_nvram_erase, /* envo_erase */
- falcon_nvram_write_chunk, /* envo_write_chunk */
- falcon_nvram_rw_finish, /* envo_rw_finish */
- falcon_nvram_set_version, /* envo_set_version */
falcon_nvram_type_to_partn, /* envo_type_to_partn */
+ falcon_nvram_partn_size, /* envo_partn_size */
+ falcon_nvram_partn_rw_start, /* envo_partn_rw_start */
+ falcon_nvram_partn_read, /* envo_partn_read */
+ falcon_nvram_partn_erase, /* envo_partn_erase */
+ falcon_nvram_partn_write, /* envo_partn_write */
+ falcon_nvram_partn_rw_finish, /* envo_partn_rw_finish */
+ falcon_nvram_partn_get_version, /* envo_partn_get_version */
+ falcon_nvram_partn_set_version, /* envo_partn_set_version */
};
#endif /* EFSYS_OPT_FALCON */
@@ -61,15 +61,15 @@ static efx_nvram_ops_t __efx_nvram_siena_ops = {
#if EFSYS_OPT_DIAG
siena_nvram_test, /* envo_test */
#endif /* EFSYS_OPT_DIAG */
- siena_nvram_size, /* envo_size */
- siena_nvram_get_version, /* envo_get_version */
- siena_nvram_rw_start, /* envo_rw_start */
- siena_nvram_read_chunk, /* envo_read_chunk */
- siena_nvram_erase, /* envo_erase */
- siena_nvram_write_chunk, /* envo_write_chunk */
- siena_nvram_rw_finish, /* envo_rw_finish */
- siena_nvram_set_version, /* envo_set_version */
siena_nvram_type_to_partn, /* envo_type_to_partn */
+ siena_nvram_partn_size, /* envo_partn_size */
+ siena_nvram_partn_rw_start, /* envo_partn_rw_start */
+ siena_nvram_partn_read, /* envo_partn_read */
+ siena_nvram_partn_erase, /* envo_partn_erase */
+ siena_nvram_partn_write, /* envo_partn_write */
+ siena_nvram_partn_rw_finish, /* envo_partn_rw_finish */
+ siena_nvram_partn_get_version, /* envo_partn_get_version */
+ siena_nvram_partn_set_version, /* envo_partn_set_version */
};
#endif /* EFSYS_OPT_SIENA */
@@ -80,15 +80,15 @@ static efx_nvram_ops_t __efx_nvram_ef10_ops = {
#if EFSYS_OPT_DIAG
ef10_nvram_test, /* envo_test */
#endif /* EFSYS_OPT_DIAG */
- ef10_nvram_size, /* envo_size */
- ef10_nvram_get_version, /* envo_get_version */
- ef10_nvram_rw_start, /* envo_rw_start */
- ef10_nvram_read_chunk, /* envo_read_chunk */
- ef10_nvram_erase, /* envo_erase */
- ef10_nvram_write_chunk, /* envo_write_chunk */
- ef10_nvram_rw_finish, /* envo_rw_finish */
- ef10_nvram_set_version, /* envo_set_version */
ef10_nvram_type_to_partn, /* envo_type_to_partn */
+ ef10_nvram_partn_size, /* envo_partn_size */
+ ef10_nvram_partn_rw_start, /* envo_partn_rw_start */
+ ef10_nvram_partn_read, /* envo_partn_read */
+ ef10_nvram_partn_erase, /* envo_partn_erase */
+ ef10_nvram_partn_write, /* envo_partn_write */
+ ef10_nvram_partn_rw_finish, /* envo_partn_rw_finish */
+ ef10_nvram_partn_get_version, /* envo_partn_get_version */
+ ef10_nvram_partn_set_version, /* envo_partn_set_version */
};
#endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD */
@@ -178,6 +178,7 @@ efx_nvram_size(
__out size_t *sizep)
{
efx_nvram_ops_t *envop = enp->en_envop;
+ uint32_t partn;
efx_rc_t rc;
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
@@ -185,13 +186,19 @@ efx_nvram_size(
EFSYS_ASSERT3U(type, <, EFX_NVRAM_NTYPES);
- if ((rc = envop->envo_size(enp, type, sizep)) != 0)
+ if ((rc = envop->envo_type_to_partn(enp, type, &partn)) != 0)
goto fail1;
+ if ((rc = envop->envo_partn_size(enp, partn, sizep)) != 0)
+ goto fail2;
+
return (0);
+fail2:
+ EFSYS_PROBE(fail2);
fail1:
EFSYS_PROBE1(fail1, efx_rc_t, rc);
+ *sizep = 0;
return (rc);
}
@@ -204,6 +211,7 @@ efx_nvram_get_version(
__out_ecount(4) uint16_t version[4])
{
efx_nvram_ops_t *envop = enp->en_envop;
+ uint32_t partn;
efx_rc_t rc;
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
@@ -212,11 +220,17 @@ efx_nvram_get_version(
EFSYS_ASSERT3U(type, <, EFX_NVRAM_NTYPES);
- if ((rc = envop->envo_get_version(enp, type, subtypep, version)) != 0)
+ if ((rc = envop->envo_type_to_partn(enp, type, &partn)) != 0)
goto fail1;
+ if ((rc = envop->envo_partn_get_version(enp, partn,
+ subtypep, version)) != 0)
+ goto fail2;
+
return (0);
+fail2:
+ EFSYS_PROBE(fail2);
fail1:
EFSYS_PROBE1(fail1, efx_rc_t, rc);
@@ -230,6 +244,7 @@ efx_nvram_rw_start(
__out_opt size_t *chunk_sizep)
{
efx_nvram_ops_t *envop = enp->en_envop;
+ uint32_t partn;
efx_rc_t rc;
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
@@ -240,13 +255,18 @@ efx_nvram_rw_start(
EFSYS_ASSERT3U(enp->en_nvram_locked, ==, EFX_NVRAM_INVALID);
- if ((rc = envop->envo_rw_start(enp, type, chunk_sizep)) != 0)
+ if ((rc = envop->envo_type_to_partn(enp, type, &partn)) != 0)
goto fail1;
+ if ((rc = envop->envo_partn_rw_start(enp, partn, chunk_sizep)) != 0)
+ goto fail2;
+
enp->en_nvram_locked = type;
return (0);
+fail2:
+ EFSYS_PROBE(fail2);
fail1:
EFSYS_PROBE1(fail1, efx_rc_t, rc);
@@ -262,6 +282,7 @@ efx_nvram_read_chunk(
__in size_t size)
{
efx_nvram_ops_t *envop = enp->en_envop;
+ uint32_t partn;
efx_rc_t rc;
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
@@ -272,11 +293,16 @@ efx_nvram_read_chunk(
EFSYS_ASSERT3U(enp->en_nvram_locked, ==, type);
- if ((rc = envop->envo_read_chunk(enp, type, offset, data, size)) != 0)
+ if ((rc = envop->envo_type_to_partn(enp, type, &partn)) != 0)
goto fail1;
+ if ((rc = envop->envo_partn_read(enp, partn, offset, data, size)) != 0)
+ goto fail2;
+
return (0);
+fail2:
+ EFSYS_PROBE(fail2);
fail1:
EFSYS_PROBE1(fail1, efx_rc_t, rc);
@@ -289,6 +315,9 @@ efx_nvram_erase(
__in efx_nvram_type_t type)
{
efx_nvram_ops_t *envop = enp->en_envop;
+ unsigned int offset = 0;
+ size_t size = 0;
+ uint32_t partn;
efx_rc_t rc;
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
@@ -299,11 +328,21 @@ efx_nvram_erase(
EFSYS_ASSERT3U(enp->en_nvram_locked, ==, type);
- if ((rc = envop->envo_erase(enp, type)) != 0)
+ if ((rc = envop->envo_type_to_partn(enp, type, &partn)) != 0)
goto fail1;
+ if ((rc = envop->envo_partn_size(enp, partn, &size)) != 0)
+ goto fail2;
+
+ if ((rc = envop->envo_partn_erase(enp, partn, offset, size)) != 0)
+ goto fail3;
+
return (0);
+fail3:
+ EFSYS_PROBE(fail3);
+fail2:
+ EFSYS_PROBE(fail2);
fail1:
EFSYS_PROBE1(fail1, efx_rc_t, rc);
@@ -319,6 +358,7 @@ efx_nvram_write_chunk(
__in size_t size)
{
efx_nvram_ops_t *envop = enp->en_envop;
+ uint32_t partn;
efx_rc_t rc;
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
@@ -329,11 +369,16 @@ efx_nvram_write_chunk(
EFSYS_ASSERT3U(enp->en_nvram_locked, ==, type);
- if ((rc = envop->envo_write_chunk(enp, type, offset, data, size)) != 0)
+ if ((rc = envop->envo_type_to_partn(enp, type, &partn)) != 0)
goto fail1;
+ if ((rc = envop->envo_partn_write(enp, partn, offset, data, size)) != 0)
+ goto fail2;
+
return (0);
+fail2:
+ EFSYS_PROBE(fail2);
fail1:
EFSYS_PROBE1(fail1, efx_rc_t, rc);
@@ -346,6 +391,7 @@ efx_nvram_rw_finish(
__in efx_nvram_type_t type)
{
efx_nvram_ops_t *envop = enp->en_envop;
+ uint32_t partn;
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_NVRAM);
@@ -355,7 +401,8 @@ efx_nvram_rw_finish(
EFSYS_ASSERT3U(enp->en_nvram_locked, ==, type);
- envop->envo_rw_finish(enp, type);
+ if (envop->envo_type_to_partn(enp, type, &partn) == 0)
+ envop->envo_partn_rw_finish(enp, partn);
enp->en_nvram_locked = EFX_NVRAM_INVALID;
}
@@ -367,6 +414,7 @@ efx_nvram_set_version(
__in_ecount(4) uint16_t version[4])
{
efx_nvram_ops_t *envop = enp->en_envop;
+ uint32_t partn;
efx_rc_t rc;
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
@@ -382,11 +430,16 @@ efx_nvram_set_version(
*/
EFSYS_ASSERT3U(enp->en_nvram_locked, ==, EFX_NVRAM_INVALID);
- if ((rc = envop->envo_set_version(enp, type, version)) != 0)
+ if ((rc = envop->envo_type_to_partn(enp, type, &partn)) != 0)
goto fail1;
+ if ((rc = envop->envo_partn_set_version(enp, partn, version)) != 0)
+ goto fail2;
+
return (0);
+fail2:
+ EFSYS_PROBE(fail2);
fail1:
EFSYS_PROBE1(fail1, efx_rc_t, rc);
@@ -668,10 +721,11 @@ efx_mcdi_nvram_read(
__in uint32_t partn,
__in uint32_t offset,
__out_bcount(size) caddr_t data,
- __in size_t size)
+ __in size_t size,
+ __in uint32_t mode)
{
efx_mcdi_req_t req;
- uint8_t payload[MAX(MC_CMD_NVRAM_READ_IN_LEN,
+ uint8_t payload[MAX(MC_CMD_NVRAM_READ_IN_V2_LEN,
MC_CMD_NVRAM_READ_OUT_LENMAX)];
efx_rc_t rc;
@@ -683,13 +737,14 @@ efx_mcdi_nvram_read(
(void) memset(payload, 0, sizeof (payload));
req.emr_cmd = MC_CMD_NVRAM_READ;
req.emr_in_buf = payload;
- req.emr_in_length = MC_CMD_NVRAM_READ_IN_LEN;
+ req.emr_in_length = MC_CMD_NVRAM_READ_IN_V2_LEN;
req.emr_out_buf = payload;
req.emr_out_length = MC_CMD_NVRAM_READ_OUT_LENMAX;
- MCDI_IN_SET_DWORD(req, NVRAM_READ_IN_TYPE, partn);
- MCDI_IN_SET_DWORD(req, NVRAM_READ_IN_OFFSET, offset);
- MCDI_IN_SET_DWORD(req, NVRAM_READ_IN_LENGTH, size);
+ MCDI_IN_SET_DWORD(req, NVRAM_READ_IN_V2_TYPE, partn);
+ MCDI_IN_SET_DWORD(req, NVRAM_READ_IN_V2_OFFSET, offset);
+ MCDI_IN_SET_DWORD(req, NVRAM_READ_IN_V2_LENGTH, size);
+ MCDI_IN_SET_DWORD(req, NVRAM_READ_IN_V2_MODE, mode);
efx_mcdi_execute(enp, &req);
diff --git a/sys/dev/sfxge/common/efx_phy.c b/sys/dev/sfxge/common/efx_phy.c
index dd966be..51e1ccb 100644
--- a/sys/dev/sfxge/common/efx_phy.c
+++ b/sys/dev/sfxge/common/efx_phy.c
@@ -265,33 +265,34 @@ static efx_phy_ops_t __efx_phy_siena_ops = {
};
#endif /* EFSYS_OPT_SIENA */
-#if EFSYS_OPT_HUNTINGTON
-static efx_phy_ops_t __efx_phy_hunt_ops = {
- hunt_phy_power, /* epo_power */
+#if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD
+static efx_phy_ops_t __efx_phy_ef10_ops = {
+ ef10_phy_power, /* epo_power */
NULL, /* epo_reset */
- hunt_phy_reconfigure, /* epo_reconfigure */
- hunt_phy_verify, /* epo_verify */
+ ef10_phy_reconfigure, /* epo_reconfigure */
+ ef10_phy_verify, /* epo_verify */
NULL, /* epo_uplink_check */
NULL, /* epo_downlink_check */
- hunt_phy_oui_get, /* epo_oui_get */
+ ef10_phy_oui_get, /* epo_oui_get */
#if EFSYS_OPT_PHY_STATS
- hunt_phy_stats_update, /* epo_stats_update */
+ ef10_phy_stats_update, /* epo_stats_update */
#endif /* EFSYS_OPT_PHY_STATS */
#if EFSYS_OPT_PHY_PROPS
#if EFSYS_OPT_NAMES
- hunt_phy_prop_name, /* epo_prop_name */
+ ef10_phy_prop_name, /* epo_prop_name */
#endif
- hunt_phy_prop_get, /* epo_prop_get */
- hunt_phy_prop_set, /* epo_prop_set */
+ ef10_phy_prop_get, /* epo_prop_get */
+ ef10_phy_prop_set, /* epo_prop_set */
#endif /* EFSYS_OPT_PHY_PROPS */
#if EFSYS_OPT_BIST
+ /* FIXME: Are these BIST methods appropriate for Medford? */
hunt_bist_enable_offline, /* epo_bist_enable_offline */
hunt_bist_start, /* epo_bist_start */
hunt_bist_poll, /* epo_bist_poll */
hunt_bist_stop, /* epo_bist_stop */
#endif /* EFSYS_OPT_BIST */
};
-#endif /* EFSYS_OPT_HUNTINGTON */
+#endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD */
__checkReturn efx_rc_t
efx_phy_probe(
@@ -356,9 +357,14 @@ efx_phy_probe(
#endif /* EFSYS_OPT_SIENA */
#if EFSYS_OPT_HUNTINGTON
case EFX_FAMILY_HUNTINGTON:
- epop = (efx_phy_ops_t *)&__efx_phy_hunt_ops;
+ epop = (efx_phy_ops_t *)&__efx_phy_ef10_ops;
break;
#endif /* EFSYS_OPT_HUNTINGTON */
+#if EFSYS_OPT_MEDFORD
+ case EFX_FAMILY_MEDFORD:
+ epop = (efx_phy_ops_t *)&__efx_phy_ef10_ops;
+ break;
+#endif /* EFSYS_OPT_MEDFORD */
default:
rc = ENOTSUP;
goto fail1;
diff --git a/sys/dev/sfxge/common/efx_regs_ef10.h b/sys/dev/sfxge/common/efx_regs_ef10.h
index bd7619a..43745e5 100644
--- a/sys/dev/sfxge/common/efx_regs_ef10.h
+++ b/sys/dev/sfxge/common/efx_regs_ef10.h
@@ -50,7 +50,7 @@ extern "C" {
*/
#define ER_DZ_BIU_HW_REV_ID_REG_OFST 0x00000000
-/* hunta0=pcie_pf_bar2 */
+/* hunta0,medforda0=pcie_pf_bar2 */
#define ER_DZ_BIU_HW_REV_ID_REG_RESET 0xeb14face
@@ -64,7 +64,7 @@ extern "C" {
*/
#define ER_DZ_BIU_MC_SFT_STATUS_REG_OFST 0x00000010
-/* hunta0=pcie_pf_bar2 */
+/* hunta0,medforda0=pcie_pf_bar2 */
#define ER_DZ_BIU_MC_SFT_STATUS_REG_STEP 4
#define ER_DZ_BIU_MC_SFT_STATUS_REG_ROWS 8
#define ER_DZ_BIU_MC_SFT_STATUS_REG_RESET 0x1111face
@@ -80,7 +80,7 @@ extern "C" {
*/
#define ER_DZ_BIU_INT_ISR_REG_OFST 0x00000090
-/* hunta0=pcie_pf_bar2 */
+/* hunta0,medforda0=pcie_pf_bar2 */
#define ER_DZ_BIU_INT_ISR_REG_RESET 0x0
@@ -94,7 +94,7 @@ extern "C" {
*/
#define ER_DZ_MC_DB_LWRD_REG_OFST 0x00000200
-/* hunta0=pcie_pf_bar2 */
+/* hunta0,medforda0=pcie_pf_bar2 */
#define ER_DZ_MC_DB_LWRD_REG_RESET 0x0
@@ -108,7 +108,7 @@ extern "C" {
*/
#define ER_DZ_MC_DB_HWRD_REG_OFST 0x00000204
-/* hunta0=pcie_pf_bar2 */
+/* hunta0,medforda0=pcie_pf_bar2 */
#define ER_DZ_MC_DB_HWRD_REG_RESET 0x0
@@ -122,7 +122,7 @@ extern "C" {
*/
#define ER_DZ_EVQ_RPTR_REG_OFST 0x00000400
-/* hunta0=pcie_pf_bar2 */
+/* hunta0,medforda0=pcie_pf_bar2 */
#define ER_DZ_EVQ_RPTR_REG_STEP 8192
#define ER_DZ_EVQ_RPTR_REG_ROWS 2048
#define ER_DZ_EVQ_RPTR_REG_RESET 0x0
@@ -140,7 +140,7 @@ extern "C" {
*/
#define ER_DZ_EVQ_TMR_REG_OFST 0x00000420
-/* hunta0=pcie_pf_bar2 */
+/* hunta0,medforda0=pcie_pf_bar2 */
#define ER_DZ_EVQ_TMR_REG_STEP 8192
#define ER_DZ_EVQ_TMR_REG_ROWS 2048
#define ER_DZ_EVQ_TMR_REG_RESET 0x0
@@ -158,7 +158,7 @@ extern "C" {
*/
#define ER_DZ_RX_DESC_UPD_REG_OFST 0x00000830
-/* hunta0=pcie_pf_bar2 */
+/* hunta0,medforda0=pcie_pf_bar2 */
#define ER_DZ_RX_DESC_UPD_REG_STEP 8192
#define ER_DZ_RX_DESC_UPD_REG_ROWS 2048
#define ER_DZ_RX_DESC_UPD_REG_RESET 0x0
@@ -174,7 +174,7 @@ extern "C" {
*/
#define ER_DZ_TX_DESC_UPD_REG_OFST 0x00000a10
-/* hunta0=pcie_pf_bar2 */
+/* hunta0,medforda0=pcie_pf_bar2 */
#define ER_DZ_TX_DESC_UPD_REG_STEP 8192
#define ER_DZ_TX_DESC_UPD_REG_ROWS 2048
#define ER_DZ_TX_DESC_UPD_REG_RESET 0x0
@@ -248,8 +248,14 @@ extern "C" {
#define ESF_DZ_RX_OVERRIDE_HOLDOFF_WIDTH 1
#define ESF_DZ_RX_DROP_EVENT_LBN 58
#define ESF_DZ_RX_DROP_EVENT_WIDTH 1
-#define ESF_DZ_RX_EV_RSVD2_LBN 54
-#define ESF_DZ_RX_EV_RSVD2_WIDTH 4
+#define ESF_DD_RX_EV_RSVD2_LBN 54
+#define ESF_DD_RX_EV_RSVD2_WIDTH 4
+#define ESF_EZ_RX_TCP_UDP_INNER_CHKSUM_ERR_LBN 57
+#define ESF_EZ_RX_TCP_UDP_INNER_CHKSUM_ERR_WIDTH 1
+#define ESF_EZ_RX_IP_INNER_CHKSUM_ERR_LBN 56
+#define ESF_EZ_RX_IP_INNER_CHKSUM_ERR_WIDTH 1
+#define ESF_EZ_RX_EV_RSVD2_LBN 54
+#define ESF_EZ_RX_EV_RSVD2_WIDTH 2
#define ESF_DZ_RX_EV_SOFT2_LBN 52
#define ESF_DZ_RX_EV_SOFT2_WIDTH 2
#define ESF_DZ_RX_DSC_PTR_LBITS_LBN 48
@@ -293,10 +299,21 @@ extern "C" {
#define ESF_DZ_RX_MAC_CLASS_WIDTH 1
#define ESE_DZ_MAC_CLASS_MCAST 1
#define ESE_DZ_MAC_CLASS_UCAST 0
-#define ESF_DZ_RX_EV_SOFT1_LBN 32
-#define ESF_DZ_RX_EV_SOFT1_WIDTH 3
-#define ESF_DZ_RX_EV_RSVD1_LBN 30
-#define ESF_DZ_RX_EV_RSVD1_WIDTH 2
+#define ESF_DD_RX_EV_SOFT1_LBN 32
+#define ESF_DD_RX_EV_SOFT1_WIDTH 3
+#define ESF_EZ_RX_EV_SOFT1_LBN 34
+#define ESF_EZ_RX_EV_SOFT1_WIDTH 1
+#define ESF_EZ_RX_ENCAP_HDR_LBN 32
+#define ESF_EZ_RX_ENCAP_HDR_WIDTH 2
+#define ESE_EZ_ENCAP_HDR_GRE 2
+#define ESE_EZ_ENCAP_HDR_VXLAN 1
+#define ESE_EZ_ENCAP_HDR_NONE 0
+#define ESF_DD_RX_EV_RSVD1_LBN 30
+#define ESF_DD_RX_EV_RSVD1_WIDTH 2
+#define ESF_EZ_RX_EV_RSVD1_LBN 31
+#define ESF_EZ_RX_EV_RSVD1_WIDTH 1
+#define ESF_EZ_RX_ABORT_LBN 30
+#define ESF_EZ_RX_ABORT_WIDTH 1
#define ESF_DZ_RX_ECC_ERR_LBN 29
#define ESF_DZ_RX_ECC_ERR_WIDTH 1
#define ESF_DZ_RX_CRC1_ERR_LBN 28
@@ -369,12 +386,22 @@ extern "C" {
#define ESF_DZ_TX_OVERRIDE_HOLDOFF_WIDTH 1
#define ESF_DZ_TX_DROP_EVENT_LBN 58
#define ESF_DZ_TX_DROP_EVENT_WIDTH 1
-#define ESF_DZ_TX_EV_RSVD_LBN 48
-#define ESF_DZ_TX_EV_RSVD_WIDTH 10
+#define ESF_DD_TX_EV_RSVD_LBN 48
+#define ESF_DD_TX_EV_RSVD_WIDTH 10
+#define ESF_EZ_TCP_UDP_INNER_CHKSUM_ERR_LBN 57
+#define ESF_EZ_TCP_UDP_INNER_CHKSUM_ERR_WIDTH 1
+#define ESF_EZ_IP_INNER_CHKSUM_ERR_LBN 56
+#define ESF_EZ_IP_INNER_CHKSUM_ERR_WIDTH 1
+#define ESF_EZ_TX_EV_RSVD_LBN 48
+#define ESF_EZ_TX_EV_RSVD_WIDTH 8
#define ESF_DZ_TX_SOFT2_LBN 32
#define ESF_DZ_TX_SOFT2_WIDTH 16
-#define ESF_DZ_TX_SOFT1_LBN 24
-#define ESF_DZ_TX_SOFT1_WIDTH 8
+#define ESF_DD_TX_SOFT1_LBN 24
+#define ESF_DD_TX_SOFT1_WIDTH 8
+#define ESF_EZ_TX_CAN_MERGE_LBN 31
+#define ESF_EZ_TX_CAN_MERGE_WIDTH 1
+#define ESF_EZ_TX_SOFT1_LBN 24
+#define ESF_EZ_TX_SOFT1_WIDTH 7
#define ESF_DZ_TX_QLABEL_LBN 16
#define ESF_DZ_TX_QLABEL_WIDTH 5
#define ESF_DZ_TX_DESCR_INDX_LBN 0
diff --git a/sys/dev/sfxge/common/efx_rx.c b/sys/dev/sfxge/common/efx_rx.c
index a0b143f..8ebe205 100644
--- a/sys/dev/sfxge/common/efx_rx.c
+++ b/sys/dev/sfxge/common/efx_rx.c
@@ -78,14 +78,14 @@ falconsiena_rx_prefix_hash(
__in efx_rx_hash_alg_t func,
__in uint8_t *buffer);
+#endif /* EFSYS_OPT_RX_SCALE */
+
static __checkReturn efx_rc_t
falconsiena_rx_prefix_pktlen(
__in efx_nic_t *enp,
__in uint8_t *buffer,
__out uint16_t *lengthp);
-#endif /* EFSYS_OPT_RX_SCALE */
-
static void
falconsiena_rx_qpost(
__in efx_rxq_t *erp,
diff --git a/sys/dev/sfxge/common/efx_tx.c b/sys/dev/sfxge/common/efx_tx.c
index cff7742..168fde4 100644
--- a/sys/dev/sfxge/common/efx_tx.c
+++ b/sys/dev/sfxge/common/efx_tx.c
@@ -142,6 +142,7 @@ static efx_tx_ops_t __efx_tx_falcon_ops = {
falconsiena_tx_qdesc_post, /* etxo_qdesc_post */
falconsiena_tx_qdesc_dma_create, /* etxo_qdesc_dma_create */
NULL, /* etxo_qdesc_tso_create */
+ NULL, /* etxo_qdesc_tso2_create */
NULL, /* etxo_qdesc_vlantci_create */
#if EFSYS_OPT_QSTATS
falconsiena_tx_qstats_update, /* etxo_qstats_update */
@@ -167,6 +168,7 @@ static efx_tx_ops_t __efx_tx_siena_ops = {
falconsiena_tx_qdesc_post, /* etxo_qdesc_post */
falconsiena_tx_qdesc_dma_create, /* etxo_qdesc_dma_create */
NULL, /* etxo_qdesc_tso_create */
+ NULL, /* etxo_qdesc_tso2_create */
NULL, /* etxo_qdesc_vlantci_create */
#if EFSYS_OPT_QSTATS
falconsiena_tx_qstats_update, /* etxo_qstats_update */
@@ -192,6 +194,7 @@ static efx_tx_ops_t __efx_tx_hunt_ops = {
ef10_tx_qdesc_post, /* etxo_qdesc_post */
ef10_tx_qdesc_dma_create, /* etxo_qdesc_dma_create */
hunt_tx_qdesc_tso_create, /* etxo_qdesc_tso_create */
+ ef10_tx_qdesc_tso2_create, /* etxo_qdesc_tso2_create */
ef10_tx_qdesc_vlantci_create, /* etxo_qdesc_vlantci_create */
#if EFSYS_OPT_QSTATS
ef10_tx_qstats_update, /* etxo_qstats_update */
@@ -217,6 +220,7 @@ static efx_tx_ops_t __efx_tx_medford_ops = {
ef10_tx_qdesc_post, /* etxo_qdesc_post */
ef10_tx_qdesc_dma_create, /* etxo_qdesc_dma_create */
NULL, /* etxo_qdesc_tso_create */
+ ef10_tx_qdesc_tso2_create, /* etxo_qdesc_tso2_create */
ef10_tx_qdesc_vlantci_create, /* etxo_qdesc_vlantci_create */
#if EFSYS_OPT_QSTATS
ef10_tx_qstats_update, /* etxo_qstats_update */
@@ -641,6 +645,24 @@ efx_tx_qdesc_tso_create(
}
void
+efx_tx_qdesc_tso2_create(
+ __in efx_txq_t *etp,
+ __in uint16_t ipv4_id,
+ __in uint32_t tcp_seq,
+ __in uint16_t mss,
+ __out_ecount(count) efx_desc_t *edp,
+ __in int count)
+{
+ efx_nic_t *enp = etp->et_enp;
+ efx_tx_ops_t *etxop = enp->en_etxop;
+
+ EFSYS_ASSERT3U(etp->et_magic, ==, EFX_TXQ_MAGIC);
+ EFSYS_ASSERT(etxop->etxo_qdesc_tso2_create != NULL);
+
+ etxop->etxo_qdesc_tso2_create(etp, ipv4_id, tcp_seq, mss, edp, count);
+}
+
+ void
efx_tx_qdesc_vlantci_create(
__in efx_txq_t *etp,
__in uint16_t tci,
diff --git a/sys/dev/sfxge/common/efx_vpd.c b/sys/dev/sfxge/common/efx_vpd.c
index c1762e6..ebeddfe 100644
--- a/sys/dev/sfxge/common/efx_vpd.c
+++ b/sys/dev/sfxge/common/efx_vpd.c
@@ -669,7 +669,7 @@ efx_vpd_hunk_next(
__in size_t size,
__out efx_vpd_tag_t *tagp,
__out efx_vpd_keyword_t *keywordp,
- __out_bcount_opt(*paylenp) unsigned int *payloadp,
+ __out_opt unsigned int *payloadp,
__out_opt uint8_t *paylenp,
__inout unsigned int *contp)
{
@@ -689,12 +689,18 @@ efx_vpd_hunk_next(
if ((rc = efx_vpd_next_tag(data, size, &offset,
&tag, &taglen)) != 0)
goto fail1;
- if (tag == EFX_VPD_END)
+
+ if (tag == EFX_VPD_END) {
+ keyword = 0;
+ paylen = 0;
+ index = 0;
break;
+ }
if (tag == EFX_VPD_ID) {
- if (index == *contp) {
+ if (index++ == *contp) {
EFSYS_ASSERT3U(taglen, <, 0x100);
+ keyword = 0;
paylen = (uint8_t)MIN(taglen, 0xff);
goto done;
@@ -705,7 +711,7 @@ efx_vpd_hunk_next(
taglen, pos, &keyword, &keylen)) != 0)
goto fail2;
- if (index == *contp) {
+ if (index++ == *contp) {
offset += pos + 3;
paylen = keylen;
@@ -717,9 +723,6 @@ efx_vpd_hunk_next(
offset += taglen;
}
- *contp = 0;
- return (0);
-
done:
*tagp = tag;
*keywordp = keyword;
@@ -728,7 +731,7 @@ done:
if (paylenp != NULL)
*paylenp = paylen;
- ++(*contp);
+ *contp = index;
return (0);
fail2:
diff --git a/sys/dev/sfxge/common/hunt_ev.c b/sys/dev/sfxge/common/hunt_ev.c
index 2cea2e0..1a41b49 100644
--- a/sys/dev/sfxge/common/hunt_ev.c
+++ b/sys/dev/sfxge/common/hunt_ev.c
@@ -444,9 +444,9 @@ ef10_ev_qmoderate(
eep->ee_index, &dword, 0);
} else {
EFX_POPULATE_DWORD_2(dword,
- FRF_CZ_TC_TIMER_MODE, mode,
- FRF_CZ_TC_TIMER_VAL, timer_val);
- EFX_BAR_TBL_WRITED(enp, FR_BZ_TIMER_COMMAND_REGP0,
+ ERF_DZ_TC_TIMER_MODE, mode,
+ ERF_DZ_TC_TIMER_VAL, timer_val);
+ EFX_BAR_TBL_WRITED(enp, ER_DZ_EVQ_TMR_REG,
eep->ee_index, &dword, 0);
}
@@ -486,17 +486,14 @@ ef10_ev_rx(
{
efx_nic_t *enp = eep->ee_enp;
uint32_t size;
-#if 0
- boolean_t parse_err;
-#endif
uint32_t label;
- uint32_t mcast;
- uint32_t eth_base_class;
+ uint32_t mac_class;
uint32_t eth_tag_class;
uint32_t l3_class;
uint32_t l4_class;
uint32_t next_read_lbits;
uint16_t flags;
+ boolean_t cont;
boolean_t should_abort;
efx_evq_rxq_state_t *eersp;
unsigned int desc_count;
@@ -508,10 +505,15 @@ ef10_ev_rx(
if (enp->en_reset_flags & (EFX_RESET_RXQ_ERR | EFX_RESET_TXQ_ERR))
return (B_FALSE);
- /*
- * FIXME: likely to be incomplete, incorrect and inefficient.
- * Improvements in all three areas are required.
- */
+ /* Basic packet information */
+ size = EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_BYTES);
+ next_read_lbits = EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_DSC_PTR_LBITS);
+ label = EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_QLABEL);
+ eth_tag_class = EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_ETH_TAG_CLASS);
+ mac_class = EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_MAC_CLASS);
+ l3_class = EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_L3_CLASS);
+ l4_class = EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_L4_CLASS);
+ cont = EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_CONT);
if (EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_DROP_EVENT) != 0) {
/* Drop this event */
@@ -519,9 +521,7 @@ ef10_ev_rx(
}
flags = 0;
- size = EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_BYTES);
-
- if (EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_CONT) != 0) {
+ if (cont != 0) {
/*
* This may be part of a scattered frame, or it may be a
* truncated frame if scatter is disabled on this RXQ.
@@ -534,41 +534,9 @@ ef10_ev_rx(
flags |= EFX_PKT_CONT;
}
-#if 0
- /* TODO What to do if the packet is flagged with parsing error */
- parse_err = (EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_PARSE_INCOMPLETE) != 0);
-#endif
- label = EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_QLABEL);
-
- if (EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_ECRC_ERR) != 0) {
- /* Ethernet frame CRC bad */
- flags |= EFX_DISCARD;
- }
- if (EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_CRC0_ERR) != 0) {
- /* IP+TCP, bad CRC in iSCSI header */
- flags |= EFX_DISCARD;
- }
- if (EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_CRC1_ERR) != 0) {
- /* IP+TCP, bad CRC in iSCSI payload or FCoE or FCoIP */
- flags |= EFX_DISCARD;
- }
- if (EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_ECC_ERR) != 0) {
- /* ECC memory error */
- flags |= EFX_DISCARD;
- }
-
- mcast = EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_MAC_CLASS);
- if (mcast == ESE_DZ_MAC_CLASS_UCAST)
+ if (mac_class == ESE_DZ_MAC_CLASS_UCAST)
flags |= EFX_PKT_UNICAST;
- eth_base_class = EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_ETH_BASE_CLASS);
- eth_tag_class = EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_ETH_TAG_CLASS);
- l3_class = EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_L3_CLASS);
- l4_class = EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_L4_CLASS);
-
- /* bottom 4 bits of incremented index (not last desc consumed) */
- next_read_lbits = EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_DSC_PTR_LBITS);
-
/* Increment the count of descriptors read */
eersp = &eep->ee_rxq_state[label];
desc_count = (next_read_lbits - eersp->eers_rx_read_ptr) &
@@ -587,88 +555,84 @@ ef10_ev_rx(
/* Calculate the index of the the last descriptor consumed */
last_used_id = (eersp->eers_rx_read_ptr - 1) & eersp->eers_rx_mask;
- /* EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_OVERRIDE_HOLDOFF); */
-
- switch (eth_base_class) {
- case ESE_DZ_ETH_BASE_CLASS_LLC_SNAP:
- case ESE_DZ_ETH_BASE_CLASS_LLC:
- case ESE_DZ_ETH_BASE_CLASS_ETH2:
- default:
- break;
+ /* Check for errors that invalidate checksum and L3/L4 fields */
+ if (EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_ECC_ERR) != 0) {
+ /* RX frame truncated (error flag is misnamed) */
+ EFX_EV_QSTAT_INCR(eep, EV_RX_FRM_TRUNC);
+ flags |= EFX_DISCARD;
+ goto deliver;
+ }
+ if (EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_ECRC_ERR) != 0) {
+ /* Bad Ethernet frame CRC */
+ EFX_EV_QSTAT_INCR(eep, EV_RX_ETH_CRC_ERR);
+ flags |= EFX_DISCARD;
+ goto deliver;
+ }
+ if (EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_PARSE_INCOMPLETE)) {
+ /*
+ * Hardware parse failed, due to malformed headers
+ * or headers that are too long for the parser.
+ * Headers and checksums must be validated by the host.
+ */
+ // TODO: EFX_EV_QSTAT_INCR(eep, EV_RX_PARSE_INCOMPLETE);
+ goto deliver;
}
- switch (eth_tag_class) {
- case ESE_DZ_ETH_TAG_CLASS_RSVD7:
- case ESE_DZ_ETH_TAG_CLASS_RSVD6:
- case ESE_DZ_ETH_TAG_CLASS_RSVD5:
- case ESE_DZ_ETH_TAG_CLASS_RSVD4:
- break;
-
- case ESE_DZ_ETH_TAG_CLASS_RSVD3: /* Triple tagged */
- case ESE_DZ_ETH_TAG_CLASS_VLAN2: /* Double tagged */
- case ESE_DZ_ETH_TAG_CLASS_VLAN1: /* VLAN tagged */
+ if ((eth_tag_class == ESE_DZ_ETH_TAG_CLASS_VLAN1) ||
+ (eth_tag_class == ESE_DZ_ETH_TAG_CLASS_VLAN2)) {
flags |= EFX_PKT_VLAN_TAGGED;
- break;
-
- case ESE_DZ_ETH_TAG_CLASS_NONE:
- default:
- break;
}
switch (l3_class) {
- case ESE_DZ_L3_CLASS_RSVD7: /* Used by firmware for packet overrun */
-#if 0
- parse_err = B_TRUE;
-#endif
- flags |= EFX_DISCARD;
- break;
+ case ESE_DZ_L3_CLASS_IP4:
+ case ESE_DZ_L3_CLASS_IP4_FRAG:
+ flags |= EFX_PKT_IPV4;
+ if (EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_IPCKSUM_ERR)) {
+ EFX_EV_QSTAT_INCR(eep, EV_RX_IPV4_HDR_CHKSUM_ERR);
+ } else {
+ flags |= EFX_CKSUM_IPV4;
+ }
- case ESE_DZ_L3_CLASS_ARP:
- case ESE_DZ_L3_CLASS_FCOE:
+ if (l4_class == ESE_DZ_L4_CLASS_TCP) {
+ EFX_EV_QSTAT_INCR(eep, EV_RX_TCP_IPV4);
+ flags |= EFX_PKT_TCP;
+ } else if (l4_class == ESE_DZ_L4_CLASS_UDP) {
+ EFX_EV_QSTAT_INCR(eep, EV_RX_UDP_IPV4);
+ flags |= EFX_PKT_UDP;
+ } else {
+ EFX_EV_QSTAT_INCR(eep, EV_RX_OTHER_IPV4);
+ }
break;
- case ESE_DZ_L3_CLASS_IP6_FRAG:
case ESE_DZ_L3_CLASS_IP6:
+ case ESE_DZ_L3_CLASS_IP6_FRAG:
flags |= EFX_PKT_IPV6;
- break;
- case ESE_DZ_L3_CLASS_IP4_FRAG:
- case ESE_DZ_L3_CLASS_IP4:
- flags |= EFX_PKT_IPV4;
- if (EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_IPCKSUM_ERR) == 0)
- flags |= EFX_CKSUM_IPV4;
+ if (l4_class == ESE_DZ_L4_CLASS_TCP) {
+ EFX_EV_QSTAT_INCR(eep, EV_RX_TCP_IPV6);
+ flags |= EFX_PKT_TCP;
+ } else if (l4_class == ESE_DZ_L4_CLASS_UDP) {
+ EFX_EV_QSTAT_INCR(eep, EV_RX_UDP_IPV6);
+ flags |= EFX_PKT_UDP;
+ } else {
+ EFX_EV_QSTAT_INCR(eep, EV_RX_OTHER_IPV6);
+ }
break;
- case ESE_DZ_L3_CLASS_UNKNOWN:
default:
+ EFX_EV_QSTAT_INCR(eep, EV_RX_NON_IP);
break;
}
- switch (l4_class) {
- case ESE_DZ_L4_CLASS_RSVD7:
- case ESE_DZ_L4_CLASS_RSVD6:
- case ESE_DZ_L4_CLASS_RSVD5:
- case ESE_DZ_L4_CLASS_RSVD4:
- case ESE_DZ_L4_CLASS_RSVD3:
- break;
-
- case ESE_DZ_L4_CLASS_UDP:
- flags |= EFX_PKT_UDP;
- if (EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_TCPUDP_CKSUM_ERR) == 0)
- flags |= EFX_CKSUM_TCPUDP;
- break;
-
- case ESE_DZ_L4_CLASS_TCP:
- flags |= EFX_PKT_TCP;
- if (EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_TCPUDP_CKSUM_ERR) == 0)
+ if (flags & (EFX_PKT_TCP | EFX_PKT_UDP)) {
+ if (EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_TCPUDP_CKSUM_ERR)) {
+ EFX_EV_QSTAT_INCR(eep, EV_RX_TCP_UDP_CHKSUM_ERR);
+ } else {
flags |= EFX_CKSUM_TCPUDP;
- break;
-
- case ESE_DZ_L4_CLASS_UNKNOWN:
- default:
- break;
+ }
}
+deliver:
/* If we're not discarding the packet then it is ok */
if (~flags & EFX_DISCARD)
EFX_EV_QSTAT_INCR(eep, EV_RX_OK);
@@ -835,7 +799,7 @@ ef10_ev_mcdi(
case MCDI_EVENT_CODE_LINKCHANGE: {
efx_link_mode_t link_mode;
- hunt_phy_link_ev(enp, eqp, &link_mode);
+ ef10_phy_link_ev(enp, eqp, &link_mode);
should_abort = eecp->eec_link_change(arg, link_mode);
break;
}
diff --git a/sys/dev/sfxge/common/hunt_impl.h b/sys/dev/sfxge/common/hunt_impl.h
index f8c3b5e..49ecbea 100644
--- a/sys/dev/sfxge/common/hunt_impl.h
+++ b/sys/dev/sfxge/common/hunt_impl.h
@@ -54,6 +54,13 @@ extern "C" {
*/
#define EF10_RX_WPTR_ALIGN 8
+/*
+ * Max byte offset into the packet the TCP header must start for the hardware
+ * to be able to parse the packet correctly.
+ * FIXME: Move to ef10_impl.h when it is included in all driver builds.
+ */
+#define EF10_TCP_HEADER_OFFSET_LIMIT 208
+
/* Invalid RSS context handle */
#define EF10_RSS_CONTEXT_INVALID (0xffffffff)
@@ -165,6 +172,10 @@ ef10_nic_probe(
__in efx_nic_t *enp);
extern __checkReturn efx_rc_t
+hunt_board_cfg(
+ __in efx_nic_t *enp);
+
+extern __checkReturn efx_rc_t
ef10_nic_set_drv_limits(
__inout efx_nic_t *enp,
__in efx_drv_limits_t *edlp);
@@ -209,41 +220,45 @@ ef10_nic_unprobe(
/* MAC */
extern __checkReturn efx_rc_t
-hunt_mac_poll(
+ef10_mac_poll(
__in efx_nic_t *enp,
__out efx_link_mode_t *link_modep);
extern __checkReturn efx_rc_t
-hunt_mac_up(
+ef10_mac_up(
__in efx_nic_t *enp,
__out boolean_t *mac_upp);
extern __checkReturn efx_rc_t
-hunt_mac_addr_set(
+ef10_mac_addr_set(
__in efx_nic_t *enp);
extern __checkReturn efx_rc_t
-hunt_mac_reconfigure(
+ef10_mac_pdu_set(
__in efx_nic_t *enp);
extern __checkReturn efx_rc_t
-hunt_mac_multicast_list_set(
+ef10_mac_reconfigure(
+ __in efx_nic_t *enp);
+
+extern __checkReturn efx_rc_t
+ef10_mac_multicast_list_set(
__in efx_nic_t *enp);
extern __checkReturn efx_rc_t
-hunt_mac_filter_default_rxq_set(
+ef10_mac_filter_default_rxq_set(
__in efx_nic_t *enp,
__in efx_rxq_t *erp,
__in boolean_t using_rss);
extern void
-hunt_mac_filter_default_rxq_clear(
+ef10_mac_filter_default_rxq_clear(
__in efx_nic_t *enp);
#if EFSYS_OPT_LOOPBACK
extern __checkReturn efx_rc_t
-hunt_mac_loopback_set(
+ef10_mac_loopback_set(
__in efx_nic_t *enp,
__in efx_link_mode_t link_mode,
__in efx_loopback_type_t loopback_type);
@@ -253,7 +268,7 @@ hunt_mac_loopback_set(
#if EFSYS_OPT_MAC_STATS
extern __checkReturn efx_rc_t
-hunt_mac_stats_update(
+ef10_mac_stats_update(
__in efx_nic_t *enp,
__in efsys_mem_t *esmp,
__inout_ecount(EFX_MAC_NSTATS) efsys_stat_t *stat,
@@ -276,12 +291,12 @@ ef10_mcdi_fini(
__in efx_nic_t *enp);
extern void
-ef10_mcdi_request_copyin(
+ef10_mcdi_send_request(
__in efx_nic_t *enp,
- __in efx_mcdi_req_t *emrp,
- __in unsigned int seq,
- __in boolean_t ev_cpl,
- __in boolean_t new_epoch);
+ __in void *hdrp,
+ __in size_t hdr_len,
+ __in void *sdup,
+ __in size_t sdu_len);
extern __checkReturn boolean_t
ef10_mcdi_poll_response(
@@ -294,11 +309,6 @@ ef10_mcdi_read_response(
__in size_t offset,
__in size_t length);
-extern void
-ef10_mcdi_request_copyout(
- __in efx_nic_t *enp,
- __in efx_mcdi_req_t *emrp);
-
extern efx_rc_t
ef10_mcdi_poll_reboot(
__in efx_nic_t *enp);
@@ -359,39 +369,10 @@ ef10_nvram_partn_write_segment_tlv(
__in boolean_t all_segments);
extern __checkReturn efx_rc_t
-ef10_nvram_partn_size(
- __in efx_nic_t *enp,
- __in uint32_t partn,
- __out size_t *sizep);
-
-extern __checkReturn efx_rc_t
ef10_nvram_partn_lock(
__in efx_nic_t *enp,
__in uint32_t partn);
-extern __checkReturn efx_rc_t
-ef10_nvram_partn_read(
- __in efx_nic_t *enp,
- __in uint32_t partn,
- __in unsigned int offset,
- __out_bcount(size) caddr_t data,
- __in size_t size);
-
-extern __checkReturn efx_rc_t
-ef10_nvram_partn_erase(
- __in efx_nic_t *enp,
- __in uint32_t partn,
- __in unsigned int offset,
- __in size_t size);
-
-extern __checkReturn efx_rc_t
-ef10_nvram_partn_write(
- __in efx_nic_t *enp,
- __in uint32_t partn,
- __in unsigned int offset,
- __out_bcount(size) caddr_t data,
- __in size_t size);
-
extern void
ef10_nvram_partn_unlock(
__in efx_nic_t *enp,
@@ -410,117 +391,122 @@ ef10_nvram_test(
#endif /* EFSYS_OPT_DIAG */
extern __checkReturn efx_rc_t
-ef10_nvram_size(
+ef10_nvram_type_to_partn(
__in efx_nic_t *enp,
__in efx_nvram_type_t type,
+ __out uint32_t *partnp);
+
+extern __checkReturn efx_rc_t
+ef10_nvram_partn_size(
+ __in efx_nic_t *enp,
+ __in uint32_t partn,
__out size_t *sizep);
extern __checkReturn efx_rc_t
-ef10_nvram_get_version(
+ef10_nvram_partn_rw_start(
__in efx_nic_t *enp,
- __in efx_nvram_type_t type,
- __out uint32_t *subtypep,
- __out_ecount(4) uint16_t version[4]);
+ __in uint32_t partn,
+ __out size_t *chunk_sizep);
extern __checkReturn efx_rc_t
-ef10_nvram_rw_start(
+ef10_nvram_partn_read_mode(
__in efx_nic_t *enp,
- __in efx_nvram_type_t type,
- __out size_t *pref_chunkp);
+ __in uint32_t partn,
+ __in unsigned int offset,
+ __out_bcount(size) caddr_t data,
+ __in size_t size,
+ __in uint32_t mode);
extern __checkReturn efx_rc_t
-ef10_nvram_read_chunk(
+ef10_nvram_partn_read(
__in efx_nic_t *enp,
- __in efx_nvram_type_t type,
+ __in uint32_t partn,
__in unsigned int offset,
__out_bcount(size) caddr_t data,
__in size_t size);
-extern __checkReturn efx_rc_t
-ef10_nvram_erase(
+extern __checkReturn efx_rc_t
+ef10_nvram_partn_erase(
__in efx_nic_t *enp,
- __in efx_nvram_type_t type);
+ __in uint32_t partn,
+ __in unsigned int offset,
+ __in size_t size);
extern __checkReturn efx_rc_t
-ef10_nvram_write_chunk(
+ef10_nvram_partn_write(
__in efx_nic_t *enp,
- __in efx_nvram_type_t type,
+ __in uint32_t partn,
__in unsigned int offset,
- __in_bcount(size) caddr_t data,
+ __out_bcount(size) caddr_t data,
__in size_t size);
extern void
-ef10_nvram_rw_finish(
+ef10_nvram_partn_rw_finish(
__in efx_nic_t *enp,
- __in efx_nvram_type_t type);
+ __in uint32_t partn);
extern __checkReturn efx_rc_t
-ef10_nvram_partn_set_version(
+ef10_nvram_partn_get_version(
__in efx_nic_t *enp,
__in uint32_t partn,
- __in_ecount(4) uint16_t version[4]);
+ __out uint32_t *subtypep,
+ __out_ecount(4) uint16_t version[4]);
extern __checkReturn efx_rc_t
-ef10_nvram_set_version(
+ef10_nvram_partn_set_version(
__in efx_nic_t *enp,
- __in efx_nvram_type_t type,
+ __in uint32_t partn,
__in_ecount(4) uint16_t version[4]);
-extern __checkReturn efx_rc_t
-ef10_nvram_type_to_partn(
- __in efx_nic_t *enp,
- __in efx_nvram_type_t type,
- __out uint32_t *partnp);
-
#endif /* EFSYS_OPT_NVRAM */
/* PHY */
-typedef struct hunt_link_state_s {
- uint32_t hls_adv_cap_mask;
- uint32_t hls_lp_cap_mask;
- unsigned int hls_fcntl;
- efx_link_mode_t hls_link_mode;
+typedef struct ef10_link_state_s {
+ uint32_t els_adv_cap_mask;
+ uint32_t els_lp_cap_mask;
+ unsigned int els_fcntl;
+ efx_link_mode_t els_link_mode;
#if EFSYS_OPT_LOOPBACK
- efx_loopback_type_t hls_loopback;
+ efx_loopback_type_t els_loopback;
#endif
- boolean_t hls_mac_up;
-} hunt_link_state_t;
+ boolean_t els_mac_up;
+} ef10_link_state_t;
extern void
-hunt_phy_link_ev(
+ef10_phy_link_ev(
__in efx_nic_t *enp,
__in efx_qword_t *eqp,
__out efx_link_mode_t *link_modep);
extern __checkReturn efx_rc_t
-hunt_phy_get_link(
+ef10_phy_get_link(
__in efx_nic_t *enp,
- __out hunt_link_state_t *hlsp);
+ __out ef10_link_state_t *elsp);
extern __checkReturn efx_rc_t
-hunt_phy_power(
+ef10_phy_power(
__in efx_nic_t *enp,
__in boolean_t on);
extern __checkReturn efx_rc_t
-hunt_phy_reconfigure(
+ef10_phy_reconfigure(
__in efx_nic_t *enp);
extern __checkReturn efx_rc_t
-hunt_phy_verify(
+ef10_phy_verify(
__in efx_nic_t *enp);
extern __checkReturn efx_rc_t
-hunt_phy_oui_get(
+ef10_phy_oui_get(
__in efx_nic_t *enp,
__out uint32_t *ouip);
#if EFSYS_OPT_PHY_STATS
extern __checkReturn efx_rc_t
-hunt_phy_stats_update(
+ef10_phy_stats_update(
__in efx_nic_t *enp,
__in efsys_mem_t *esmp,
__inout_ecount(EFX_PHY_NSTATS) uint32_t *stat);
@@ -532,21 +518,21 @@ hunt_phy_stats_update(
#if EFSYS_OPT_NAMES
extern const char *
-hunt_phy_prop_name(
+ef10_phy_prop_name(
__in efx_nic_t *enp,
__in unsigned int id);
#endif /* EFSYS_OPT_NAMES */
extern __checkReturn efx_rc_t
-hunt_phy_prop_get(
+ef10_phy_prop_get(
__in efx_nic_t *enp,
__in unsigned int id,
__in uint32_t flags,
__out uint32_t *valp);
extern __checkReturn efx_rc_t
-hunt_phy_prop_set(
+ef10_phy_prop_set(
__in efx_nic_t *enp,
__in unsigned int id,
__in uint32_t val);
@@ -696,6 +682,15 @@ hunt_tx_qdesc_tso_create(
__out efx_desc_t *edp);
extern void
+ef10_tx_qdesc_tso2_create(
+ __in efx_txq_t *etp,
+ __in uint16_t ipv4_id,
+ __in uint32_t tcp_seq,
+ __in uint16_t tcp_mss,
+ __out_ecount(count) efx_desc_t *edp,
+ __in int count);
+
+extern void
ef10_tx_qdesc_vlantci_create(
__in efx_txq_t *etp,
__in uint16_t vlan_tci,
@@ -733,7 +728,7 @@ ef10_tx_qstats_update(
#define HUNT_MIN_PIO_ALLOC_SIZE (HUNT_PIOBUF_SIZE / 32)
-#define HUNT_LEGACY_PF_PRIVILEGE_MASK \
+#define EF10_LEGACY_PF_PRIVILEGE_MASK \
(MC_CMD_PRIVILEGE_MASK_IN_GRP_ADMIN | \
MC_CMD_PRIVILEGE_MASK_IN_GRP_LINK | \
MC_CMD_PRIVILEGE_MASK_IN_GRP_ONLOAD | \
@@ -746,7 +741,7 @@ ef10_tx_qstats_update(
MC_CMD_PRIVILEGE_MASK_IN_GRP_ALL_MULTICAST | \
MC_CMD_PRIVILEGE_MASK_IN_GRP_PROMISCUOUS)
-#define HUNT_LEGACY_VF_PRIVILEGE_MASK 0
+#define EF10_LEGACY_VF_PRIVILEGE_MASK 0
typedef uint32_t efx_piobuf_handle_t;
@@ -886,14 +881,14 @@ ef10_rx_prefix_hash(
__in efx_rx_hash_alg_t func,
__in uint8_t *buffer);
+#endif /* EFSYS_OPT_RX_SCALE */
+
extern __checkReturn efx_rc_t
ef10_rx_prefix_pktlen(
__in efx_nic_t *enp,
__in uint8_t *buffer,
__out uint16_t *lengthp);
-#endif /* EFSYS_OPT_RX_SCALE */
-
extern void
ef10_rx_qpost(
__in efx_rxq_t *erp,
diff --git a/sys/dev/sfxge/common/hunt_mac.c b/sys/dev/sfxge/common/hunt_mac.c
index 358c4d9..a36a11a 100644
--- a/sys/dev/sfxge/common/hunt_mac.c
+++ b/sys/dev/sfxge/common/hunt_mac.c
@@ -38,26 +38,21 @@ __FBSDID("$FreeBSD$");
#if EFSYS_OPT_HUNTINGTON
__checkReturn efx_rc_t
-hunt_mac_poll(
+ef10_mac_poll(
__in efx_nic_t *enp,
__out efx_link_mode_t *link_modep)
{
- /*
- * TBD: Consider a common Siena/Huntington function. The code is
- * essentially identical.
- */
-
efx_port_t *epp = &(enp->en_port);
- hunt_link_state_t hls;
+ ef10_link_state_t els;
efx_rc_t rc;
- if ((rc = hunt_phy_get_link(enp, &hls)) != 0)
+ if ((rc = ef10_phy_get_link(enp, &els)) != 0)
goto fail1;
- epp->ep_adv_cap_mask = hls.hls_adv_cap_mask;
- epp->ep_fcntl = hls.hls_fcntl;
+ epp->ep_adv_cap_mask = els.els_adv_cap_mask;
+ epp->ep_fcntl = els.els_fcntl;
- *link_modep = hls.hls_link_mode;
+ *link_modep = els.els_link_mode;
return (0);
@@ -70,26 +65,21 @@ fail1:
}
__checkReturn efx_rc_t
-hunt_mac_up(
+ef10_mac_up(
__in efx_nic_t *enp,
__out boolean_t *mac_upp)
{
- /*
- * TBD: Consider a common Siena/Huntington function. The code is
- * essentially identical.
- */
-
- hunt_link_state_t hls;
+ ef10_link_state_t els;
efx_rc_t rc;
/*
- * Because Huntington doesn't *require* polling, we can't rely on
- * hunt_mac_poll() being executed to populate epp->ep_mac_up.
+ * Because EF10 doesn't *require* polling, we can't rely on
+ * ef10_mac_poll() being executed to populate epp->ep_mac_up.
*/
- if ((rc = hunt_phy_get_link(enp, &hls)) != 0)
+ if ((rc = ef10_phy_get_link(enp, &els)) != 0)
goto fail1;
- *mac_upp = hls.hls_mac_up;
+ *mac_upp = els.els_mac_up;
return (0);
@@ -100,7 +90,7 @@ fail1:
}
/*
- * Huntington uses MC_CMD_VADAPTOR_SET_MAC to set the
+ * EF10 adapters use MC_CMD_VADAPTOR_SET_MAC to set the
* MAC address; the address field in MC_CMD_SET_MAC has no
* effect.
* MC_CMD_VADAPTOR_SET_MAC requires mac-spoofing privilege and
@@ -144,7 +134,7 @@ fail1:
}
__checkReturn efx_rc_t
-hunt_mac_addr_set(
+ef10_mac_addr_set(
__in efx_nic_t *enp)
{
efx_rc_t rc;
@@ -153,8 +143,11 @@ hunt_mac_addr_set(
if (rc != ENOTSUP)
goto fail1;
- /* Fallback for older firmware without Vadapter support */
- if ((rc = hunt_mac_reconfigure(enp)) != 0)
+ /*
+ * Fallback for older Huntington firmware without Vadapter
+ * support.
+ */
+ if ((rc = ef10_mac_reconfigure(enp)) != 0)
goto fail2;
}
@@ -169,8 +162,76 @@ fail1:
return (rc);
}
+static __checkReturn efx_rc_t
+efx_mcdi_mtu_set(
+ __in efx_nic_t *enp,
+ __in uint32_t mtu)
+{
+ efx_mcdi_req_t req;
+ uint8_t payload[MAX(MC_CMD_SET_MAC_EXT_IN_LEN,
+ MC_CMD_SET_MAC_OUT_LEN)];
+ efx_rc_t rc;
+
+ (void) memset(payload, 0, sizeof (payload));
+ req.emr_cmd = MC_CMD_SET_MAC;
+ req.emr_in_buf = payload;
+ req.emr_in_length = MC_CMD_SET_MAC_EXT_IN_LEN;
+ req.emr_out_buf = payload;
+ req.emr_out_length = MC_CMD_SET_MAC_OUT_LEN;
+
+ /* Only configure the MTU in this call to MC_CMD_SET_MAC */
+ MCDI_IN_SET_DWORD(req, SET_MAC_EXT_IN_MTU, mtu);
+ MCDI_IN_POPULATE_DWORD_1(req, SET_MAC_EXT_IN_CONTROL,
+ SET_MAC_EXT_IN_CFG_MTU, 1);
+
+ efx_mcdi_execute(enp, &req);
+
+ if (req.emr_rc != 0) {
+ rc = req.emr_rc;
+ goto fail1;
+ }
+
+ return (0);
+
+fail1:
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
+
+ return (rc);
+}
+
+ __checkReturn efx_rc_t
+ef10_mac_pdu_set(
+ __in efx_nic_t *enp)
+{
+ efx_port_t *epp = &(enp->en_port);
+ efx_nic_cfg_t *encp = &(enp->en_nic_cfg);
+ efx_rc_t rc;
+
+ if (encp->enc_enhanced_set_mac_supported) {
+ if ((rc = efx_mcdi_mtu_set(enp, epp->ep_mac_pdu)) != 0)
+ goto fail1;
+ } else {
+ /*
+ * Fallback for older Huntington firmware, which always
+ * configure all of the parameters to MC_CMD_SET_MAC. This isn't
+ * suitable for setting the MTU on unpriviliged functions.
+ */
+ if ((rc = ef10_mac_reconfigure(enp)) != 0)
+ goto fail2;
+ }
+
+ return (0);
+
+fail2:
+ EFSYS_PROBE(fail2);
+fail1:
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
+
+ return (rc);
+}
+
__checkReturn efx_rc_t
-hunt_mac_reconfigure(
+ef10_mac_reconfigure(
__in efx_nic_t *enp)
{
efx_port_t *epp = &(enp->en_port);
@@ -197,6 +258,8 @@ hunt_mac_reconfigure(
* from reaching the filters. As Huntington filters drop any
* traffic that does not match a filter it is ok to leave the
* MAC running in promiscuous mode. See bug41141.
+ *
+ * FIXME: Does REJECT_UNCST behave the same way on Medford?
*/
MCDI_IN_POPULATE_DWORD_2(req, SET_MAC_IN_REJECT,
SET_MAC_IN_REJECT_UNCST, 0,
@@ -247,16 +310,15 @@ fail1:
}
__checkReturn efx_rc_t
-hunt_mac_multicast_list_set(
+ef10_mac_multicast_list_set(
__in efx_nic_t *enp)
{
efx_port_t *epp = &(enp->en_port);
efx_mac_ops_t *emop = epp->ep_emop;
efx_rc_t rc;
- EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON);
-
- /* FIXME: Insert filters for multicast list */
+ EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON ||
+ enp->en_family == EFX_FAMILY_MEDFORD);
if ((rc = emop->emo_reconfigure(enp)) != 0)
goto fail1;
@@ -270,7 +332,7 @@ fail1:
}
__checkReturn efx_rc_t
-hunt_mac_filter_default_rxq_set(
+ef10_mac_filter_default_rxq_set(
__in efx_nic_t *enp,
__in efx_rxq_t *erp,
__in boolean_t using_rss)
@@ -304,7 +366,7 @@ fail1:
}
void
-hunt_mac_filter_default_rxq_clear(
+ef10_mac_filter_default_rxq_clear(
__in efx_nic_t *enp)
{
efx_port_t *epp = &(enp->en_port);
@@ -322,23 +384,18 @@ hunt_mac_filter_default_rxq_clear(
#if EFSYS_OPT_LOOPBACK
__checkReturn efx_rc_t
-hunt_mac_loopback_set(
+ef10_mac_loopback_set(
__in efx_nic_t *enp,
__in efx_link_mode_t link_mode,
__in efx_loopback_type_t loopback_type)
{
- /*
- * TBD: Consider a common Siena/Huntington function. The code is
- * essentially identical.
- */
-
efx_port_t *epp = &(enp->en_port);
efx_phy_ops_t *epop = epp->ep_epop;
efx_loopback_type_t old_loopback_type;
efx_link_mode_t old_loopback_link_mode;
efx_rc_t rc;
- /* The PHY object handles this on Huntington */
+ /* The PHY object handles this on EF10 */
old_loopback_type = epp->ep_loopback_type;
old_loopback_link_mode = epp->ep_loopback_link_mode;
epp->ep_loopback_type = loopback_type;
@@ -362,12 +419,12 @@ fail1:
#if EFSYS_OPT_MAC_STATS
-#define HUNT_MAC_STAT_READ(_esmp, _field, _eqp) \
+#define EF10_MAC_STAT_READ(_esmp, _field, _eqp) \
EFSYS_MEM_READQ((_esmp), (_field) * sizeof (efx_qword_t), _eqp)
__checkReturn efx_rc_t
-hunt_mac_stats_update(
+ef10_mac_stats_update(
__in efx_nic_t *enp,
__in efsys_mem_t *esmp,
__inout_ecount(EFX_MAC_NSTATS) efsys_stat_t *stat,
@@ -381,301 +438,301 @@ hunt_mac_stats_update(
/* Read END first so we don't race with the MC */
EFSYS_DMA_SYNC_FOR_KERNEL(esmp, 0, EFX_MAC_STATS_SIZE);
- HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_GENERATION_END,
+ EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_GENERATION_END,
&generation_end);
EFSYS_MEM_READ_BARRIER();
/* TX */
- HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_PKTS, &value);
+ EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_PKTS, &value);
EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_TX_PKTS]), &value);
- HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_CONTROL_PKTS, &value);
+ EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_CONTROL_PKTS, &value);
EFSYS_STAT_SUBR_QWORD(&(stat[EFX_MAC_TX_PKTS]), &value);
- HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_PAUSE_PKTS, &value);
+ EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_PAUSE_PKTS, &value);
EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_TX_PAUSE_PKTS]), &value);
- HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_UNICAST_PKTS, &value);
+ EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_UNICAST_PKTS, &value);
EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_TX_UNICST_PKTS]), &value);
- HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_MULTICAST_PKTS, &value);
+ EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_MULTICAST_PKTS, &value);
EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_TX_MULTICST_PKTS]), &value);
- HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_BROADCAST_PKTS, &value);
+ EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_BROADCAST_PKTS, &value);
EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_TX_BRDCST_PKTS]), &value);
- HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_BYTES, &value);
+ EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_BYTES, &value);
EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_TX_OCTETS]), &value);
- HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_LT64_PKTS, &value);
+ EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_LT64_PKTS, &value);
EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_TX_LE_64_PKTS]), &value);
- HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_64_PKTS, &value);
+ EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_64_PKTS, &value);
EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_TX_LE_64_PKTS]), &value);
- HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_65_TO_127_PKTS, &value);
+ EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_65_TO_127_PKTS, &value);
EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_TX_65_TO_127_PKTS]), &value);
- HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_128_TO_255_PKTS, &value);
+ EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_128_TO_255_PKTS, &value);
EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_TX_128_TO_255_PKTS]), &value);
- HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_256_TO_511_PKTS, &value);
+ EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_256_TO_511_PKTS, &value);
EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_TX_256_TO_511_PKTS]), &value);
- HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_512_TO_1023_PKTS, &value);
+ EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_512_TO_1023_PKTS, &value);
EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_TX_512_TO_1023_PKTS]), &value);
- HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_1024_TO_15XX_PKTS, &value);
+ EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_1024_TO_15XX_PKTS, &value);
EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_TX_1024_TO_15XX_PKTS]), &value);
- HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_15XX_TO_JUMBO_PKTS, &value);
+ EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_15XX_TO_JUMBO_PKTS, &value);
EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_TX_GE_15XX_PKTS]), &value);
- HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_GTJUMBO_PKTS, &value);
+ EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_GTJUMBO_PKTS, &value);
EFSYS_STAT_INCR_QWORD(&(stat[EFX_MAC_TX_GE_15XX_PKTS]), &value);
- HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_BAD_FCS_PKTS, &value);
+ EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_BAD_FCS_PKTS, &value);
EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_TX_ERRORS]), &value);
- HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_SINGLE_COLLISION_PKTS, &value);
+ EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_SINGLE_COLLISION_PKTS, &value);
EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_TX_SGL_COL_PKTS]), &value);
- HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_MULTIPLE_COLLISION_PKTS,
+ EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_MULTIPLE_COLLISION_PKTS,
&value);
EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_TX_MULT_COL_PKTS]), &value);
- HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_EXCESSIVE_COLLISION_PKTS,
+ EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_EXCESSIVE_COLLISION_PKTS,
&value);
EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_TX_EX_COL_PKTS]), &value);
- HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_LATE_COLLISION_PKTS, &value);
+ EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_LATE_COLLISION_PKTS, &value);
EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_TX_LATE_COL_PKTS]), &value);
- HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_DEFERRED_PKTS, &value);
+ EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_DEFERRED_PKTS, &value);
EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_TX_DEF_PKTS]), &value);
- HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_EXCESSIVE_DEFERRED_PKTS,
+ EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_EXCESSIVE_DEFERRED_PKTS,
&value);
EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_TX_EX_DEF_PKTS]), &value);
/* RX */
- HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_BYTES, &value);
+ EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_BYTES, &value);
EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RX_OCTETS]), &value);
- HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_PKTS, &value);
+ EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_PKTS, &value);
EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RX_PKTS]), &value);
- HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_UNICAST_PKTS, &value);
+ EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_UNICAST_PKTS, &value);
EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RX_UNICST_PKTS]), &value);
- HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_MULTICAST_PKTS, &value);
+ EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_MULTICAST_PKTS, &value);
EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RX_MULTICST_PKTS]), &value);
- HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_BROADCAST_PKTS, &value);
+ EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_BROADCAST_PKTS, &value);
EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RX_BRDCST_PKTS]), &value);
- HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_PAUSE_PKTS, &value);
+ EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_PAUSE_PKTS, &value);
EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RX_PAUSE_PKTS]), &value);
- HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_UNDERSIZE_PKTS, &value);
+ EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_UNDERSIZE_PKTS, &value);
EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RX_LE_64_PKTS]), &value);
- HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_64_PKTS, &value);
+ EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_64_PKTS, &value);
EFSYS_STAT_INCR_QWORD(&(stat[EFX_MAC_RX_LE_64_PKTS]), &value);
- HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_65_TO_127_PKTS, &value);
+ EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_65_TO_127_PKTS, &value);
EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RX_65_TO_127_PKTS]), &value);
- HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_128_TO_255_PKTS, &value);
+ EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_128_TO_255_PKTS, &value);
EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RX_128_TO_255_PKTS]), &value);
- HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_256_TO_511_PKTS, &value);
+ EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_256_TO_511_PKTS, &value);
EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RX_256_TO_511_PKTS]), &value);
- HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_512_TO_1023_PKTS, &value);
+ EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_512_TO_1023_PKTS, &value);
EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RX_512_TO_1023_PKTS]), &value);
- HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_1024_TO_15XX_PKTS, &value);
+ EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_1024_TO_15XX_PKTS, &value);
EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RX_1024_TO_15XX_PKTS]), &value);
- HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_15XX_TO_JUMBO_PKTS, &value);
+ EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_15XX_TO_JUMBO_PKTS, &value);
EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RX_GE_15XX_PKTS]), &value);
- HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_GTJUMBO_PKTS, &value);
+ EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_GTJUMBO_PKTS, &value);
EFSYS_STAT_INCR_QWORD(&(stat[EFX_MAC_RX_GE_15XX_PKTS]), &value);
- HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_BAD_FCS_PKTS, &value);
+ EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_BAD_FCS_PKTS, &value);
EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RX_FCS_ERRORS]), &value);
- HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_OVERFLOW_PKTS, &value);
+ EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_OVERFLOW_PKTS, &value);
EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RX_DROP_EVENTS]), &value);
- HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_FALSE_CARRIER_PKTS, &value);
+ EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_FALSE_CARRIER_PKTS, &value);
EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RX_FALSE_CARRIER_ERRORS]), &value);
- HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_SYMBOL_ERROR_PKTS, &value);
+ EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_SYMBOL_ERROR_PKTS, &value);
EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RX_SYMBOL_ERRORS]), &value);
- HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_ALIGN_ERROR_PKTS, &value);
+ EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_ALIGN_ERROR_PKTS, &value);
EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RX_ALIGN_ERRORS]), &value);
- HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_INTERNAL_ERROR_PKTS, &value);
+ EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_INTERNAL_ERROR_PKTS, &value);
EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RX_INTERNAL_ERRORS]), &value);
- HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_JABBER_PKTS, &value);
+ EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_JABBER_PKTS, &value);
EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RX_JABBER_PKTS]), &value);
- HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_LANES01_CHAR_ERR, &value);
+ EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_LANES01_CHAR_ERR, &value);
EFSYS_STAT_SET_DWORD(&(stat[EFX_MAC_RX_LANE0_CHAR_ERR]),
&(value.eq_dword[0]));
EFSYS_STAT_SET_DWORD(&(stat[EFX_MAC_RX_LANE1_CHAR_ERR]),
&(value.eq_dword[1]));
- HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_LANES23_CHAR_ERR, &value);
+ EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_LANES23_CHAR_ERR, &value);
EFSYS_STAT_SET_DWORD(&(stat[EFX_MAC_RX_LANE2_CHAR_ERR]),
&(value.eq_dword[0]));
EFSYS_STAT_SET_DWORD(&(stat[EFX_MAC_RX_LANE3_CHAR_ERR]),
&(value.eq_dword[1]));
- HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_LANES01_DISP_ERR, &value);
+ EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_LANES01_DISP_ERR, &value);
EFSYS_STAT_SET_DWORD(&(stat[EFX_MAC_RX_LANE0_DISP_ERR]),
&(value.eq_dword[0]));
EFSYS_STAT_SET_DWORD(&(stat[EFX_MAC_RX_LANE1_DISP_ERR]),
&(value.eq_dword[1]));
- HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_LANES23_DISP_ERR, &value);
+ EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_LANES23_DISP_ERR, &value);
EFSYS_STAT_SET_DWORD(&(stat[EFX_MAC_RX_LANE2_DISP_ERR]),
&(value.eq_dword[0]));
EFSYS_STAT_SET_DWORD(&(stat[EFX_MAC_RX_LANE3_DISP_ERR]),
&(value.eq_dword[1]));
- HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_MATCH_FAULT, &value);
+ EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_MATCH_FAULT, &value);
EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RX_MATCH_FAULT]), &value);
- HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_NODESC_DROPS, &value);
+ EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_NODESC_DROPS, &value);
EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RX_NODESC_DROP_CNT]), &value);
/* Packet memory (EF10 only) */
- HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_PM_TRUNC_BB_OVERFLOW, &value);
+ EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_PM_TRUNC_BB_OVERFLOW, &value);
EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_PM_TRUNC_BB_OVERFLOW]), &value);
- HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_PM_DISCARD_BB_OVERFLOW, &value);
+ EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_PM_DISCARD_BB_OVERFLOW, &value);
EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_PM_DISCARD_BB_OVERFLOW]), &value);
- HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_PM_TRUNC_VFIFO_FULL, &value);
+ EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_PM_TRUNC_VFIFO_FULL, &value);
EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_PM_TRUNC_VFIFO_FULL]), &value);
- HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_PM_DISCARD_VFIFO_FULL, &value);
+ EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_PM_DISCARD_VFIFO_FULL, &value);
EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_PM_DISCARD_VFIFO_FULL]), &value);
- HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_PM_TRUNC_QBB, &value);
+ EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_PM_TRUNC_QBB, &value);
EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_PM_TRUNC_QBB]), &value);
- HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_PM_DISCARD_QBB, &value);
+ EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_PM_DISCARD_QBB, &value);
EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_PM_DISCARD_QBB]), &value);
- HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_PM_DISCARD_MAPPING, &value);
+ EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_PM_DISCARD_MAPPING, &value);
EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_PM_DISCARD_MAPPING]), &value);
/* RX datapath */
- HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RXDP_Q_DISABLED_PKTS, &value);
+ EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_RXDP_Q_DISABLED_PKTS, &value);
EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RXDP_Q_DISABLED_PKTS]), &value);
- HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RXDP_DI_DROPPED_PKTS, &value);
+ EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_RXDP_DI_DROPPED_PKTS, &value);
EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RXDP_DI_DROPPED_PKTS]), &value);
- HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RXDP_STREAMING_PKTS, &value);
+ EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_RXDP_STREAMING_PKTS, &value);
EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RXDP_STREAMING_PKTS]), &value);
- HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RXDP_HLB_FETCH_CONDITIONS, &value);
+ EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_RXDP_HLB_FETCH_CONDITIONS, &value);
EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RXDP_HLB_FETCH]), &value);
- HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RXDP_HLB_WAIT_CONDITIONS, &value);
+ EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_RXDP_HLB_WAIT_CONDITIONS, &value);
EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RXDP_HLB_WAIT]), &value);
/* VADAPTER RX */
- HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_RX_UNICAST_PACKETS,
+ EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_RX_UNICAST_PACKETS,
&value);
EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_VADAPTER_RX_UNICAST_PACKETS]),
&value);
- HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_RX_UNICAST_BYTES,
+ EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_RX_UNICAST_BYTES,
&value);
EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_VADAPTER_RX_UNICAST_BYTES]),
&value);
- HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_RX_MULTICAST_PACKETS,
+ EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_RX_MULTICAST_PACKETS,
&value);
EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_VADAPTER_RX_MULTICAST_PACKETS]),
&value);
- HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_RX_MULTICAST_BYTES,
+ EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_RX_MULTICAST_BYTES,
&value);
EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_VADAPTER_RX_MULTICAST_BYTES]),
&value);
- HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_RX_BROADCAST_PACKETS,
+ EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_RX_BROADCAST_PACKETS,
&value);
EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_VADAPTER_RX_BROADCAST_PACKETS]),
&value);
- HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_RX_BROADCAST_BYTES,
+ EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_RX_BROADCAST_BYTES,
&value);
EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_VADAPTER_RX_BROADCAST_BYTES]),
&value);
- HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_RX_BAD_PACKETS,
+ EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_RX_BAD_PACKETS,
&value);
EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_VADAPTER_RX_BAD_PACKETS]),
&value);
- HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_RX_BAD_BYTES, &value);
+ EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_RX_BAD_BYTES, &value);
EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_VADAPTER_RX_BAD_BYTES]), &value);
- HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_RX_OVERFLOW, &value);
+ EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_RX_OVERFLOW, &value);
EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_VADAPTER_RX_OVERFLOW]), &value);
/* VADAPTER TX */
- HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_TX_UNICAST_PACKETS,
+ EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_TX_UNICAST_PACKETS,
&value);
EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_VADAPTER_TX_UNICAST_PACKETS]),
&value);
- HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_TX_UNICAST_BYTES,
+ EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_TX_UNICAST_BYTES,
&value);
EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_VADAPTER_TX_UNICAST_BYTES]),
&value);
- HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_TX_MULTICAST_PACKETS,
+ EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_TX_MULTICAST_PACKETS,
&value);
EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_VADAPTER_TX_MULTICAST_PACKETS]),
&value);
- HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_TX_MULTICAST_BYTES,
+ EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_TX_MULTICAST_BYTES,
&value);
EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_VADAPTER_TX_MULTICAST_BYTES]),
&value);
- HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_TX_BROADCAST_PACKETS,
+ EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_TX_BROADCAST_PACKETS,
&value);
EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_VADAPTER_TX_BROADCAST_PACKETS]),
&value);
- HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_TX_BROADCAST_BYTES,
+ EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_TX_BROADCAST_BYTES,
&value);
EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_VADAPTER_TX_BROADCAST_BYTES]),
&value);
- HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_TX_BAD_PACKETS, &value);
+ EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_TX_BAD_PACKETS, &value);
EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_VADAPTER_TX_BAD_PACKETS]), &value);
- HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_TX_BAD_BYTES, &value);
+ EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_TX_BAD_BYTES, &value);
EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_VADAPTER_TX_BAD_BYTES]), &value);
- HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_TX_OVERFLOW, &value);
+ EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_TX_OVERFLOW, &value);
EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_VADAPTER_TX_OVERFLOW]), &value);
EFSYS_DMA_SYNC_FOR_KERNEL(esmp, 0, EFX_MAC_STATS_SIZE);
EFSYS_MEM_READ_BARRIER();
- HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_GENERATION_START,
+ EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_GENERATION_START,
&generation_start);
/* Check that we didn't read the stats in the middle of a DMA */
diff --git a/sys/dev/sfxge/common/hunt_mcdi.c b/sys/dev/sfxge/common/hunt_mcdi.c
index 1cccb23..f39e977 100644
--- a/sys/dev/sfxge/common/hunt_mcdi.c
+++ b/sys/dev/sfxge/common/hunt_mcdi.c
@@ -43,37 +43,6 @@ __FBSDID("$FreeBSD$");
#error "WITH_MCDI_V2 required for EF10 MCDIv2 commands."
#endif
-typedef enum efx_mcdi_header_type_e {
- EFX_MCDI_HEADER_TYPE_V1, /* MCDIv0 (BootROM), MCDIv1 commands */
- EFX_MCDI_HEADER_TYPE_V2, /* MCDIv2 commands */
-} efx_mcdi_header_type_t;
-
-/*
- * Return the header format to use for sending an MCDI request.
- *
- * An MCDIv1 (Siena compatible) command should use MCDIv2 encapsulation if the
- * request input buffer or response output buffer are too large for the MCDIv1
- * format. An MCDIv2 command must always be sent using MCDIv2 encapsulation.
- */
-#define EFX_MCDI_HEADER_TYPE(_cmd, _length) \
- ((((_cmd) & ~EFX_MASK32(MCDI_HEADER_CODE)) || \
- ((_length) & ~EFX_MASK32(MCDI_HEADER_DATALEN))) ? \
- EFX_MCDI_HEADER_TYPE_V2 : EFX_MCDI_HEADER_TYPE_V1)
-
-
-/*
- * MCDI Header NOT_EPOCH flag
- * ==========================
- * A new epoch begins at initial startup or after an MC reboot, and defines when
- * the MC should reject stale MCDI requests.
- *
- * The first MCDI request sent by the host should contain NOT_EPOCH=0, and all
- * subsequent requests (until the next MC reboot) should contain NOT_EPOCH=1.
- *
- * After rebooting the MC will fail all requests with NOT_EPOCH=1 by writing a
- * response with ERROR=1 and DATALEN=0 until a request is seen with NOT_EPOCH=0.
- */
-
__checkReturn efx_rc_t
ef10_mcdi_init(
@@ -139,7 +108,7 @@ ef10_mcdi_fini(
emip->emi_new_epoch = B_FALSE;
}
-static void
+ void
ef10_mcdi_send_request(
__in efx_nic_t *enp,
__in void *hdrp,
@@ -181,118 +150,6 @@ ef10_mcdi_send_request(
EFX_BAR_WRITED(enp, ER_DZ_MC_DB_HWRD_REG, &dword, B_FALSE);
}
- void
-ef10_mcdi_request_copyin(
- __in efx_nic_t *enp,
- __in efx_mcdi_req_t *emrp,
- __in unsigned int seq,
- __in boolean_t ev_cpl,
- __in boolean_t new_epoch)
-{
-#if EFSYS_OPT_MCDI_LOGGING
- const efx_mcdi_transport_t *emtp = enp->en_mcdi.em_emtp;
-#endif /* EFSYS_OPT_MCDI_LOGGING */
- efx_mcdi_header_type_t hdr_type;
- efx_dword_t hdr[2];
- size_t hdr_len;
- unsigned int xflags;
-
- EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON ||
- enp->en_family == EFX_FAMILY_MEDFORD);
-
- xflags = 0;
- if (ev_cpl)
- xflags |= MCDI_HEADER_XFLAGS_EVREQ;
-
- hdr_type = EFX_MCDI_HEADER_TYPE(emrp->emr_cmd,
- MAX(emrp->emr_in_length, emrp->emr_out_length));
-
- if (hdr_type == EFX_MCDI_HEADER_TYPE_V2) {
- /* Construct MCDI v2 header */
- hdr_len = sizeof (hdr);
- EFX_POPULATE_DWORD_8(hdr[0],
- MCDI_HEADER_CODE, MC_CMD_V2_EXTN,
- MCDI_HEADER_RESYNC, 1,
- MCDI_HEADER_DATALEN, 0,
- MCDI_HEADER_SEQ, seq,
- MCDI_HEADER_NOT_EPOCH, new_epoch ? 0 : 1,
- MCDI_HEADER_ERROR, 0,
- MCDI_HEADER_RESPONSE, 0,
- MCDI_HEADER_XFLAGS, xflags);
-
- EFX_POPULATE_DWORD_2(hdr[1],
- MC_CMD_V2_EXTN_IN_EXTENDED_CMD, emrp->emr_cmd,
- MC_CMD_V2_EXTN_IN_ACTUAL_LEN, emrp->emr_in_length);
- } else {
- /* Construct MCDI v1 header */
- hdr_len = sizeof (hdr[0]);
- EFX_POPULATE_DWORD_8(hdr[0],
- MCDI_HEADER_CODE, emrp->emr_cmd,
- MCDI_HEADER_RESYNC, 1,
- MCDI_HEADER_DATALEN, emrp->emr_in_length,
- MCDI_HEADER_SEQ, seq,
- MCDI_HEADER_NOT_EPOCH, new_epoch ? 0 : 1,
- MCDI_HEADER_ERROR, 0,
- MCDI_HEADER_RESPONSE, 0,
- MCDI_HEADER_XFLAGS, xflags);
- }
-
-#if EFSYS_OPT_MCDI_LOGGING
- if (emtp->emt_logger != NULL) {
- emtp->emt_logger(emtp->emt_context, EFX_LOG_MCDI_REQUEST,
- &hdr, hdr_len,
- emrp->emr_in_buf, emrp->emr_in_length);
- }
-#endif /* EFSYS_OPT_MCDI_LOGGING */
-
- ef10_mcdi_send_request(enp, &hdr[0], hdr_len,
- emrp->emr_in_buf, emrp->emr_in_length);
-}
-
- void
-ef10_mcdi_request_copyout(
- __in efx_nic_t *enp,
- __in efx_mcdi_req_t *emrp)
-{
-#if EFSYS_OPT_MCDI_LOGGING
- const efx_mcdi_transport_t *emtp = enp->en_mcdi.em_emtp;
-#endif /* EFSYS_OPT_MCDI_LOGGING */
- efx_dword_t hdr[2];
- unsigned int hdr_len;
- size_t bytes;
-
- if (emrp->emr_out_buf == NULL)
- return;
-
- /* Read the command header to detect MCDI response format */
- hdr_len = sizeof (hdr[0]);
- ef10_mcdi_read_response(enp, &hdr[0], 0, hdr_len);
- if (EFX_DWORD_FIELD(hdr[0], MCDI_HEADER_CODE) == MC_CMD_V2_EXTN) {
- /*
- * Read the actual payload length. The length given in the event
- * is only correct for responses with the V1 format.
- */
- ef10_mcdi_read_response(enp, &hdr[1], hdr_len, sizeof (hdr[1]));
- hdr_len += sizeof (hdr[1]);
-
- emrp->emr_out_length_used = EFX_DWORD_FIELD(hdr[1],
- MC_CMD_V2_EXTN_IN_ACTUAL_LEN);
- }
-
- /* Copy payload out into caller supplied buffer */
- bytes = MIN(emrp->emr_out_length_used, emrp->emr_out_length);
- ef10_mcdi_read_response(enp, emrp->emr_out_buf, hdr_len, bytes);
-
-#if EFSYS_OPT_MCDI_LOGGING
- if (emtp->emt_logger != NULL) {
- emtp->emt_logger(emtp->emt_context,
- EFX_LOG_MCDI_RESPONSE,
- &hdr, hdr_len,
- emrp->emr_out_buf, bytes);
- }
-#endif /* EFSYS_OPT_MCDI_LOGGING */
-}
-
__checkReturn boolean_t
ef10_mcdi_poll_response(
__in efx_nic_t *enp)
diff --git a/sys/dev/sfxge/common/hunt_nic.c b/sys/dev/sfxge/common/hunt_nic.c
index d87f3cd..7f0c068 100644
--- a/sys/dev/sfxge/common/hunt_nic.c
+++ b/sys/dev/sfxge/common/hunt_nic.c
@@ -41,7 +41,7 @@ __FBSDID("$FreeBSD$");
#include "ef10_tlv_layout.h"
-static __checkReturn efx_rc_t
+ __checkReturn efx_rc_t
efx_mcdi_get_port_assignment(
__in efx_nic_t *enp,
__out uint32_t *portp)
@@ -85,7 +85,7 @@ fail1:
return (rc);
}
-static __checkReturn efx_rc_t
+ __checkReturn efx_rc_t
efx_mcdi_get_port_modes(
__in efx_nic_t *enp,
__out uint32_t *modesp)
@@ -112,7 +112,10 @@ efx_mcdi_get_port_modes(
goto fail1;
}
- /* Accept pre-Medford size (8 bytes - no CurrentMode field) */
+ /*
+ * Require only Modes and DefaultMode fields.
+ * (CurrentMode field was added for Medford)
+ */
if (req.emr_out_length_used <
MC_CMD_GET_PORT_MODES_OUT_CURRENT_MODE_OFST) {
rc = EMSGSIZE;
@@ -205,7 +208,7 @@ fail1:
return (rc);
}
-static __checkReturn efx_rc_t
+ __checkReturn efx_rc_t
efx_mcdi_get_mac_address_pf(
__in efx_nic_t *enp,
__out_ecount_opt(6) uint8_t mac_addrp[6])
@@ -263,7 +266,7 @@ fail1:
return (rc);
}
-static __checkReturn efx_rc_t
+ __checkReturn efx_rc_t
efx_mcdi_get_mac_address_vf(
__in efx_nic_t *enp,
__out_ecount_opt(6) uint8_t mac_addrp[6])
@@ -326,7 +329,7 @@ fail1:
return (rc);
}
-static __checkReturn efx_rc_t
+ __checkReturn efx_rc_t
efx_mcdi_get_clock(
__in efx_nic_t *enp,
__out uint32_t *sys_freqp)
@@ -376,7 +379,7 @@ fail1:
return (rc);
}
-static __checkReturn efx_rc_t
+ __checkReturn efx_rc_t
efx_mcdi_get_vector_cfg(
__in efx_nic_t *enp,
__out_opt uint32_t *vec_basep,
@@ -427,8 +430,8 @@ fail1:
static __checkReturn efx_rc_t
efx_mcdi_get_capabilities(
__in efx_nic_t *enp,
- __out efx_dword_t *flagsp,
- __out efx_dword_t *flags2p)
+ __out uint32_t *flagsp,
+ __out uint32_t *flags2p)
{
efx_mcdi_req_t req;
uint8_t payload[MAX(MC_CMD_GET_CAPABILITIES_IN_LEN,
@@ -454,13 +457,12 @@ efx_mcdi_get_capabilities(
goto fail2;
}
- *flagsp = *MCDI_OUT2(req, efx_dword_t, GET_CAPABILITIES_OUT_FLAGS1);
+ *flagsp = MCDI_OUT_DWORD(req, GET_CAPABILITIES_OUT_FLAGS1);
if (req.emr_out_length_used < MC_CMD_GET_CAPABILITIES_V2_OUT_LEN)
- EFX_ZERO_DWORD(*flags2p);
+ *flags2p = 0;
else
- *flags2p = *MCDI_OUT2(req, efx_dword_t,
- GET_CAPABILITIES_V2_OUT_FLAGS2);
+ *flags2p = MCDI_OUT_DWORD(req, GET_CAPABILITIES_V2_OUT_FLAGS2);
return (0);
@@ -889,76 +891,75 @@ ef10_nic_pio_unlink(
return (efx_mcdi_unlink_piobuf(enp, vi_index));
}
-static __checkReturn efx_rc_t
+ __checkReturn efx_rc_t
ef10_get_datapath_caps(
__in efx_nic_t *enp)
{
efx_nic_cfg_t *encp = &(enp->en_nic_cfg);
- efx_dword_t datapath_capabilities;
- efx_dword_t datapath_capabilities_v2;
+ uint32_t flags;
+ uint32_t flags2;
efx_rc_t rc;
- if ((rc = efx_mcdi_get_capabilities(enp, &datapath_capabilities,
- &datapath_capabilities_v2)) != 0)
+ if ((rc = efx_mcdi_get_capabilities(enp, &flags, &flags2)) != 0)
goto fail1;
+#define CAP_FLAG(flags1, field) \
+ ((flags1) & (1 << (MC_CMD_GET_CAPABILITIES_V2_OUT_ ## field ## _LBN)))
+
+#define CAP_FLAG2(flags2, field) \
+ ((flags2) & (1 << (MC_CMD_GET_CAPABILITIES_V2_OUT_ ## field ## _LBN)))
+
/*
* Huntington RXDP firmware inserts a 0 or 14 byte prefix.
* We only support the 14 byte prefix here.
*/
- if (MCDI_CMD_DWORD_FIELD(&datapath_capabilities,
- GET_CAPABILITIES_OUT_RX_PREFIX_LEN_14) != 1) {
+ if (CAP_FLAG(flags, RX_PREFIX_LEN_14) == 0) {
rc = ENOTSUP;
goto fail2;
}
encp->enc_rx_prefix_size = 14;
/* Check if the firmware supports TSO */
- if (MCDI_CMD_DWORD_FIELD(&datapath_capabilities,
- GET_CAPABILITIES_OUT_TX_TSO) == 1)
- encp->enc_fw_assisted_tso_enabled = B_TRUE;
- else
- encp->enc_fw_assisted_tso_enabled = B_FALSE;
+ encp->enc_fw_assisted_tso_enabled =
+ CAP_FLAG(flags, TX_TSO) ? B_TRUE : B_FALSE;
+
+ /* Check if the firmware supports FATSOv2 */
+ encp->enc_fw_assisted_tso_v2_enabled =
+ CAP_FLAG2(flags2, TX_TSO_V2) ? B_TRUE : B_FALSE;
/* Check if the firmware has vadapter/vport/vswitch support */
- if (MCDI_CMD_DWORD_FIELD(&datapath_capabilities,
- GET_CAPABILITIES_OUT_EVB) == 1)
- encp->enc_datapath_cap_evb = B_TRUE;
- else
- encp->enc_datapath_cap_evb = B_FALSE;
+ encp->enc_datapath_cap_evb =
+ CAP_FLAG(flags, EVB) ? B_TRUE : B_FALSE;
/* Check if the firmware supports VLAN insertion */
- if (MCDI_CMD_DWORD_FIELD(&datapath_capabilities,
- GET_CAPABILITIES_OUT_TX_VLAN_INSERTION) == 1)
- encp->enc_hw_tx_insert_vlan_enabled = B_TRUE;
- else
- encp->enc_hw_tx_insert_vlan_enabled = B_FALSE;
+ encp->enc_hw_tx_insert_vlan_enabled =
+ CAP_FLAG(flags, TX_VLAN_INSERTION) ? B_TRUE : B_FALSE;
/* Check if the firmware supports RX event batching */
- if (MCDI_CMD_DWORD_FIELD(&datapath_capabilities,
- GET_CAPABILITIES_OUT_RX_BATCHING) == 1) {
- encp->enc_rx_batching_enabled = B_TRUE;
+ encp->enc_rx_batching_enabled =
+ CAP_FLAG(flags, RX_BATCHING) ? B_TRUE : B_FALSE;
+
+ if (encp->enc_rx_batching_enabled)
encp->enc_rx_batch_max = 16;
- } else {
- encp->enc_rx_batching_enabled = B_FALSE;
- }
/* Check if the firmware supports disabling scatter on RXQs */
- if (MCDI_CMD_DWORD_FIELD(&datapath_capabilities,
- GET_CAPABILITIES_OUT_RX_DISABLE_SCATTER) == 1) {
- encp->enc_rx_disable_scatter_supported = B_TRUE;
- } else {
- encp->enc_rx_disable_scatter_supported = B_FALSE;
- }
+ encp->enc_rx_disable_scatter_supported =
+ CAP_FLAG(flags, RX_DISABLE_SCATTER) ? B_TRUE : B_FALSE;
/* Check if the firmware supports set mac with running filters */
- if (MCDI_CMD_DWORD_FIELD(&datapath_capabilities,
- GET_CAPABILITIES_OUT_VADAPTOR_PERMIT_SET_MAC_WHEN_FILTERS_INSTALLED)
- == 1) {
- encp->enc_allow_set_mac_with_installed_filters = B_TRUE;
- } else {
- encp->enc_allow_set_mac_with_installed_filters = B_FALSE;
- }
+ encp->enc_allow_set_mac_with_installed_filters =
+ CAP_FLAG(flags, VADAPTOR_PERMIT_SET_MAC_WHEN_FILTERS_INSTALLED) ?
+ B_TRUE : B_FALSE;
+
+ /*
+ * Check if firmware supports the extended MC_CMD_SET_MAC, which allows
+ * specifying which parameters to configure.
+ */
+ encp->enc_enhanced_set_mac_supported =
+ CAP_FLAG(flags, SET_MAC_ENHANCED) ? B_TRUE : B_FALSE;
+
+#undef CAP_FLAG
+#undef CAP_FLAG2
return (0);
@@ -970,6 +971,42 @@ fail1:
return (rc);
}
+
+ __checkReturn efx_rc_t
+ef10_get_privilege_mask(
+ __in efx_nic_t *enp,
+ __out uint32_t *maskp)
+{
+ efx_nic_cfg_t *encp = &(enp->en_nic_cfg);
+ uint32_t mask;
+ efx_rc_t rc;
+
+ if ((rc = efx_mcdi_privilege_mask(enp, encp->enc_pf, encp->enc_vf,
+ &mask)) != 0) {
+ if (rc != ENOTSUP)
+ goto fail1;
+
+ /* Fallback for old firmware without privilege mask support */
+ if (EFX_PCI_FUNCTION_IS_PF(encp)) {
+ /* Assume PF has admin privilege */
+ mask = EF10_LEGACY_PF_PRIVILEGE_MASK;
+ } else {
+ /* VF is always unprivileged by default */
+ mask = EF10_LEGACY_VF_PRIVILEGE_MASK;
+ }
+ }
+
+ *maskp = mask;
+
+ return (0);
+
+fail1:
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
+
+ return (rc);
+}
+
+
/*
* The external port mapping is a one-based numbering of the external
* connectors on the board. It does not distinguish off-board separated
@@ -992,6 +1029,13 @@ static struct {
(1 << TLV_PORT_MODE_10G_10G_10G_10G),
1
},
+ {
+ EFX_FAMILY_MEDFORD,
+ (1 << TLV_PORT_MODE_10G) |
+ (1 << TLV_PORT_MODE_10G_10G) |
+ (1 << TLV_PORT_MODE_10G_10G_10G_10G),
+ 1
+ },
/* Supported modes requiring 2 outputs per port */
{
EFX_FAMILY_HUNTINGTON,
@@ -1000,18 +1044,25 @@ static struct {
(1 << TLV_PORT_MODE_40G_10G_10G) |
(1 << TLV_PORT_MODE_10G_10G_40G),
2
- }
- /*
- * NOTE: Medford modes will require 4 outputs per port:
- * TLV_PORT_MODE_10G_10G_10G_10G_Q
- * TLV_PORT_MODE_10G_10G_10G_10G_Q2
- * The Q2 mode routes outputs to external port 2. Support for this
- * will require a new field specifying the number to add after
- * scaling by stride. This is fixed at 1 currently.
- */
+ },
+ {
+ EFX_FAMILY_MEDFORD,
+ (1 << TLV_PORT_MODE_40G) |
+ (1 << TLV_PORT_MODE_40G_40G) |
+ (1 << TLV_PORT_MODE_40G_10G_10G) |
+ (1 << TLV_PORT_MODE_10G_10G_40G),
+ 2
+ },
+ /* Supported modes requiring 4 outputs per port */
+ {
+ EFX_FAMILY_MEDFORD,
+ (1 << TLV_PORT_MODE_10G_10G_10G_10G_Q) |
+ (1 << TLV_PORT_MODE_10G_10G_10G_10G_Q2),
+ 4
+ },
};
-static __checkReturn efx_rc_t
+ __checkReturn efx_rc_t
ef10_external_port_mapping(
__in efx_nic_t *enp,
__in uint32_t port,
@@ -1064,7 +1115,7 @@ fail1:
return (rc);
}
-static __checkReturn efx_rc_t
+ __checkReturn efx_rc_t
hunt_board_cfg(
__in efx_nic_t *enp)
{
@@ -1072,7 +1123,7 @@ hunt_board_cfg(
efx_nic_cfg_t *encp = &(enp->en_nic_cfg);
uint8_t mac_addr[6];
uint32_t board_type = 0;
- hunt_link_state_t hls;
+ ef10_link_state_t els;
efx_port_t *epp = &(enp->en_port);
uint32_t port;
uint32_t pf;
@@ -1146,10 +1197,10 @@ hunt_board_cfg(
goto fail6;
/* Obtain the default PHY advertised capabilities */
- if ((rc = hunt_phy_get_link(enp, &hls)) != 0)
+ if ((rc = ef10_phy_get_link(enp, &els)) != 0)
goto fail7;
- epp->ep_default_adv_cap_mask = hls.hls_adv_cap_mask;
- epp->ep_adv_cap_mask = hls.hls_adv_cap_mask;
+ epp->ep_default_adv_cap_mask = els.els_adv_cap_mask;
+ epp->ep_adv_cap_mask = els.els_adv_cap_mask;
/*
* Enable firmware workarounds for hardware errata.
@@ -1288,20 +1339,8 @@ hunt_board_cfg(
* the privilege mask to check for sufficient privileges, as that
* can result in time-of-check/time-of-use bugs.
*/
- if ((rc = efx_mcdi_privilege_mask(enp, pf, vf, &mask)) != 0) {
- if (rc != ENOTSUP)
- goto fail13;
-
- /* Fallback for old firmware without privilege mask support */
- if (EFX_PCI_FUNCTION_IS_PF(encp)) {
- /* Assume PF has admin privilege */
- mask = HUNT_LEGACY_PF_PRIVILEGE_MASK;
- } else {
- /* VF is always unprivileged by default */
- mask = HUNT_LEGACY_VF_PRIVILEGE_MASK;
- }
- }
-
+ if ((rc = ef10_get_privilege_mask(enp, &mask)) != 0)
+ goto fail13;
encp->enc_privilege_mask = mask;
/* Get interrupt vector limits */
@@ -1320,7 +1359,7 @@ hunt_board_cfg(
* Maximum number of bytes into the frame the TCP header can start for
* firmware assisted TSO to work.
*/
- encp->enc_tx_tso_tcp_header_offset_limit = 208;
+ encp->enc_tx_tso_tcp_header_offset_limit = EF10_TCP_HEADER_OFFSET_LIMIT;
return (0);
@@ -1361,6 +1400,7 @@ fail1:
ef10_nic_probe(
__in efx_nic_t *enp)
{
+ efx_nic_ops_t *enop = enp->en_enop;
efx_nic_cfg_t *encp = &(enp->en_nic_cfg);
efx_drv_cfg_t *edcp = &(enp->en_drv_cfg);
efx_rc_t rc;
@@ -1380,7 +1420,7 @@ ef10_nic_probe(
if ((rc = efx_mcdi_drv_attach(enp, B_TRUE)) != 0)
goto fail3;
- if ((rc = hunt_board_cfg(enp)) != 0)
+ if ((rc = enop->eno_board_cfg(enp)) != 0)
if (rc != EACCES)
goto fail4;
diff --git a/sys/dev/sfxge/common/hunt_nvram.c b/sys/dev/sfxge/common/hunt_nvram.c
index 35c5ddd..dd471f4 100644
--- a/sys/dev/sfxge/common/hunt_nvram.c
+++ b/sys/dev/sfxge/common/hunt_nvram.c
@@ -598,8 +598,9 @@ ef10_nvram_read_tlv_segment(
}
/* Read initial chunk of the segment, starting at offset */
- if ((rc = ef10_nvram_partn_read(enp, partn, seg_offset, seg_data,
- EF10_NVRAM_CHUNK)) != 0) {
+ if ((rc = ef10_nvram_partn_read_mode(enp, partn, seg_offset, seg_data,
+ EF10_NVRAM_CHUNK,
+ MC_CMD_NVRAM_READ_IN_V2_TARGET_CURRENT)) != 0) {
goto fail2;
}
@@ -624,10 +625,11 @@ ef10_nvram_read_tlv_segment(
/* Read the remaining segment content */
if (total_length > EF10_NVRAM_CHUNK) {
- if ((rc = ef10_nvram_partn_read(enp, partn,
+ if ((rc = ef10_nvram_partn_read_mode(enp, partn,
seg_offset + EF10_NVRAM_CHUNK,
seg_data + EF10_NVRAM_CHUNK,
- total_length - EF10_NVRAM_CHUNK)) != 0)
+ total_length - EF10_NVRAM_CHUNK,
+ MC_CMD_NVRAM_READ_IN_V2_TARGET_CURRENT)) != 0)
goto fail6;
}
@@ -1321,12 +1323,13 @@ fail1:
}
__checkReturn efx_rc_t
-ef10_nvram_partn_read(
+ef10_nvram_partn_read_mode(
__in efx_nic_t *enp,
__in uint32_t partn,
__in unsigned int offset,
__out_bcount(size) caddr_t data,
- __in size_t size)
+ __in size_t size,
+ __in uint32_t mode)
{
size_t chunk;
efx_rc_t rc;
@@ -1335,7 +1338,7 @@ ef10_nvram_partn_read(
chunk = MIN(size, EF10_NVRAM_CHUNK);
if ((rc = efx_mcdi_nvram_read(enp, partn, offset,
- data, chunk)) != 0) {
+ data, chunk, mode)) != 0) {
goto fail1;
}
@@ -1353,6 +1356,22 @@ fail1:
}
__checkReturn efx_rc_t
+ef10_nvram_partn_read(
+ __in efx_nic_t *enp,
+ __in uint32_t partn,
+ __in unsigned int offset,
+ __out_bcount(size) caddr_t data,
+ __in size_t size)
+{
+ /*
+ * Read requests which come in through the EFX API expect to
+ * read the current, active partition.
+ */
+ return ef10_nvram_partn_read_mode(enp, partn, offset, data, size,
+ MC_CMD_NVRAM_READ_IN_V2_TARGET_CURRENT);
+}
+
+ __checkReturn efx_rc_t
ef10_nvram_partn_erase(
__in efx_nic_t *enp,
__in uint32_t partn,
@@ -1541,7 +1560,11 @@ static ef10_parttbl_entry_t hunt_parttbl[] = {
{NVRAM_PARTITION_TYPE_FPGA_BACKUP, 1, EFX_NVRAM_FPGA_BACKUP},
{NVRAM_PARTITION_TYPE_FPGA_BACKUP, 2, EFX_NVRAM_FPGA_BACKUP},
{NVRAM_PARTITION_TYPE_FPGA_BACKUP, 3, EFX_NVRAM_FPGA_BACKUP},
- {NVRAM_PARTITION_TYPE_FPGA_BACKUP, 4, EFX_NVRAM_FPGA_BACKUP}
+ {NVRAM_PARTITION_TYPE_FPGA_BACKUP, 4, EFX_NVRAM_FPGA_BACKUP},
+ {NVRAM_PARTITION_TYPE_LICENSE, 1, EFX_NVRAM_LICENSE},
+ {NVRAM_PARTITION_TYPE_LICENSE, 2, EFX_NVRAM_LICENSE},
+ {NVRAM_PARTITION_TYPE_LICENSE, 3, EFX_NVRAM_LICENSE},
+ {NVRAM_PARTITION_TYPE_LICENSE, 4, EFX_NVRAM_LICENSE}
};
static ef10_parttbl_entry_t medford_parttbl[] = {
@@ -1572,7 +1595,11 @@ static ef10_parttbl_entry_t medford_parttbl[] = {
{NVRAM_PARTITION_TYPE_FPGA_BACKUP, 1, EFX_NVRAM_FPGA_BACKUP},
{NVRAM_PARTITION_TYPE_FPGA_BACKUP, 2, EFX_NVRAM_FPGA_BACKUP},
{NVRAM_PARTITION_TYPE_FPGA_BACKUP, 3, EFX_NVRAM_FPGA_BACKUP},
- {NVRAM_PARTITION_TYPE_FPGA_BACKUP, 4, EFX_NVRAM_FPGA_BACKUP}
+ {NVRAM_PARTITION_TYPE_FPGA_BACKUP, 4, EFX_NVRAM_FPGA_BACKUP},
+ {NVRAM_PARTITION_TYPE_LICENSE, 1, EFX_NVRAM_LICENSE},
+ {NVRAM_PARTITION_TYPE_LICENSE, 2, EFX_NVRAM_LICENSE},
+ {NVRAM_PARTITION_TYPE_LICENSE, 3, EFX_NVRAM_LICENSE},
+ {NVRAM_PARTITION_TYPE_LICENSE, 4, EFX_NVRAM_LICENSE}
};
static __checkReturn efx_rc_t
@@ -1707,56 +1734,23 @@ fail1:
#endif /* EFSYS_OPT_DIAG */
__checkReturn efx_rc_t
-ef10_nvram_size(
- __in efx_nic_t *enp,
- __in efx_nvram_type_t type,
- __out size_t *sizep)
-{
- uint32_t partn;
- efx_rc_t rc;
-
- if ((rc = ef10_nvram_type_to_partn(enp, type, &partn)) != 0)
- goto fail1;
-
- if ((rc = ef10_nvram_partn_size(enp, partn, sizep)) != 0)
- goto fail2;
-
- return (0);
-
-fail2:
- EFSYS_PROBE(fail2);
-fail1:
- EFSYS_PROBE1(fail1, efx_rc_t, rc);
-
- *sizep = 0;
-
- return (rc);
-}
-
- __checkReturn efx_rc_t
-ef10_nvram_get_version(
+ef10_nvram_partn_get_version(
__in efx_nic_t *enp,
- __in efx_nvram_type_t type,
+ __in uint32_t partn,
__out uint32_t *subtypep,
__out_ecount(4) uint16_t version[4])
{
- uint32_t partn;
efx_rc_t rc;
- if ((rc = ef10_nvram_type_to_partn(enp, type, &partn)) != 0)
- goto fail1;
-
/* FIXME: get highest partn version from all ports */
/* FIXME: return partn description if available */
if ((rc = efx_mcdi_nvram_metadata(enp, partn, subtypep,
version, NULL, 0)) != 0)
- goto fail2;
+ goto fail1;
return (0);
-fail2:
- EFSYS_PROBE(fail2);
fail1:
EFSYS_PROBE1(fail1, efx_rc_t, rc);
@@ -1764,111 +1758,21 @@ fail1:
}
__checkReturn efx_rc_t
-ef10_nvram_rw_start(
+ef10_nvram_partn_rw_start(
__in efx_nic_t *enp,
- __in efx_nvram_type_t type,
+ __in uint32_t partn,
__out size_t *chunk_sizep)
{
- uint32_t partn;
efx_rc_t rc;
- if ((rc = ef10_nvram_type_to_partn(enp, type, &partn)) != 0)
- goto fail1;
-
if ((rc = ef10_nvram_partn_lock(enp, partn)) != 0)
- goto fail2;
+ goto fail1;
if (chunk_sizep != NULL)
*chunk_sizep = EF10_NVRAM_CHUNK;
return (0);
-fail2:
- EFSYS_PROBE(fail2);
-fail1:
- EFSYS_PROBE1(fail1, efx_rc_t, rc);
-
- return (rc);
-}
-
- __checkReturn efx_rc_t
-ef10_nvram_read_chunk(
- __in efx_nic_t *enp,
- __in efx_nvram_type_t type,
- __in unsigned int offset,
- __out_bcount(size) caddr_t data,
- __in size_t size)
-{
- uint32_t partn;
- efx_rc_t rc;
-
- if ((rc = ef10_nvram_type_to_partn(enp, type, &partn)) != 0)
- goto fail1;
-
- if ((rc = ef10_nvram_partn_read(enp, partn, offset, data, size)) != 0)
- goto fail2;
-
- return (0);
-
-fail2:
- EFSYS_PROBE(fail2);
-fail1:
- EFSYS_PROBE1(fail1, efx_rc_t, rc);
-
- return (rc);
-}
-
- __checkReturn efx_rc_t
-ef10_nvram_erase(
- __in efx_nic_t *enp,
- __in efx_nvram_type_t type)
-{
- uint32_t partn;
- size_t size;
- efx_rc_t rc;
-
- if ((rc = ef10_nvram_type_to_partn(enp, type, &partn)) != 0)
- goto fail1;
-
- if ((rc = ef10_nvram_partn_size(enp, partn, &size)) != 0)
- goto fail2;
-
- if ((rc = ef10_nvram_partn_erase(enp, partn, 0, size)) != 0)
- goto fail3;
-
- return (0);
-
-fail3:
- EFSYS_PROBE(fail3);
-fail2:
- EFSYS_PROBE(fail2);
-fail1:
- EFSYS_PROBE1(fail1, efx_rc_t, rc);
-
- return (rc);
-}
-
- __checkReturn efx_rc_t
-ef10_nvram_write_chunk(
- __in efx_nic_t *enp,
- __in efx_nvram_type_t type,
- __in unsigned int offset,
- __in_bcount(size) caddr_t data,
- __in size_t size)
-{
- uint32_t partn;
- efx_rc_t rc;
-
- if ((rc = ef10_nvram_type_to_partn(enp, type, &partn)) != 0)
- goto fail1;
-
- if ((rc = ef10_nvram_partn_write(enp, partn, offset, data, size)) != 0)
- goto fail2;
-
- return (0);
-
-fail2:
- EFSYS_PROBE(fail2);
fail1:
EFSYS_PROBE1(fail1, efx_rc_t, rc);
@@ -1876,40 +1780,11 @@ fail1:
}
void
-ef10_nvram_rw_finish(
- __in efx_nic_t *enp,
- __in efx_nvram_type_t type)
-{
- uint32_t partn;
- efx_rc_t rc;
-
- if ((rc = ef10_nvram_type_to_partn(enp, type, &partn)) == 0)
- ef10_nvram_partn_unlock(enp, partn);
-}
-
- __checkReturn efx_rc_t
-ef10_nvram_set_version(
+ef10_nvram_partn_rw_finish(
__in efx_nic_t *enp,
- __in efx_nvram_type_t type,
- __in_ecount(4) uint16_t version[4])
+ __in uint32_t partn)
{
- uint32_t partn;
- efx_rc_t rc;
-
- if ((rc = ef10_nvram_type_to_partn(enp, type, &partn)) != 0)
- goto fail1;
-
- if ((rc = ef10_nvram_partn_set_version(enp, partn, version)) != 0)
- goto fail2;
-
- return (0);
-
-fail2:
- EFSYS_PROBE(fail2);
-fail1:
- EFSYS_PROBE1(fail1, efx_rc_t, rc);
-
- return (rc);
+ ef10_nvram_partn_unlock(enp, partn);
}
#endif /* EFSYS_OPT_NVRAM */
diff --git a/sys/dev/sfxge/common/hunt_phy.c b/sys/dev/sfxge/common/hunt_phy.c
index c25e820..a6b7faa 100644
--- a/sys/dev/sfxge/common/hunt_phy.c
+++ b/sys/dev/sfxge/common/hunt_phy.c
@@ -37,15 +37,10 @@ __FBSDID("$FreeBSD$");
#if EFSYS_OPT_HUNTINGTON
static void
-hunt_phy_decode_cap(
+mcdi_phy_decode_cap(
__in uint32_t mcdi_cap,
__out uint32_t *maskp)
{
- /*
- * TBD: consider common Siena/Hunt function: Hunt is a superset of
- * Siena here (adds 40G)
- */
-
uint32_t mask;
mask = 0;
@@ -76,7 +71,7 @@ hunt_phy_decode_cap(
}
static void
-hunt_phy_decode_link_mode(
+mcdi_phy_decode_link_mode(
__in efx_nic_t *enp,
__in uint32_t link_flags,
__in unsigned int speed,
@@ -84,11 +79,6 @@ hunt_phy_decode_link_mode(
__out efx_link_mode_t *link_modep,
__out unsigned int *fcntlp)
{
- /*
- * TBD: consider common Siena/Hunt function: Hunt is a superset of
- * Siena here (adds 40G and generate-only flow control)
- */
-
boolean_t fd = !!(link_flags &
(1 << MC_CMD_GET_LINK_OUT_FULL_DUPLEX_LBN));
boolean_t up = !!(link_flags &
@@ -127,16 +117,11 @@ hunt_phy_decode_link_mode(
void
-hunt_phy_link_ev(
+ef10_phy_link_ev(
__in efx_nic_t *enp,
__in efx_qword_t *eqp,
__out efx_link_mode_t *link_modep)
{
- /*
- * TBD: consider common Siena/Hunt function: Hunt is a superset of
- * Siena here (adds 40G)
- */
-
efx_port_t *epp = &(enp->en_port);
unsigned int link_flags;
unsigned int speed;
@@ -167,10 +152,10 @@ hunt_phy_link_ev(
}
link_flags = MCDI_EV_FIELD(eqp, LINKCHANGE_LINK_FLAGS);
- hunt_phy_decode_link_mode(enp, link_flags, speed,
+ mcdi_phy_decode_link_mode(enp, link_flags, speed,
MCDI_EV_FIELD(eqp, LINKCHANGE_FCNTL),
&link_mode, &fcntl);
- hunt_phy_decode_cap(MCDI_EV_FIELD(eqp, LINKCHANGE_LP_CAP),
+ mcdi_phy_decode_cap(MCDI_EV_FIELD(eqp, LINKCHANGE_LP_CAP),
&lp_cap_mask);
/*
@@ -191,19 +176,17 @@ hunt_phy_link_ev(
}
__checkReturn efx_rc_t
-hunt_phy_power(
+ef10_phy_power(
__in efx_nic_t *enp,
__in boolean_t power)
{
- /* TBD: consider common Siena/Hunt function: essentially identical */
-
efx_rc_t rc;
if (!power)
return (0);
/* Check if the PHY is a zombie */
- if ((rc = hunt_phy_verify(enp)) != 0)
+ if ((rc = ef10_phy_verify(enp)) != 0)
goto fail1;
enp->en_reset_flags |= EFX_RESET_PHY;
@@ -217,16 +200,10 @@ fail1:
}
__checkReturn efx_rc_t
-hunt_phy_get_link(
+ef10_phy_get_link(
__in efx_nic_t *enp,
- __out hunt_link_state_t *hlsp)
+ __out ef10_link_state_t *elsp)
{
- /*
- * TBD: consider common Siena/Hunt function: Hunt is very similar
- * (at least for now; not clear that the loopbacks should necessarily
- * be quite the same...)
- */
-
efx_mcdi_req_t req;
uint8_t payload[MAX(MC_CMD_GET_LINK_IN_LEN,
MC_CMD_GET_LINK_OUT_LEN)];
@@ -251,15 +228,15 @@ hunt_phy_get_link(
goto fail2;
}
- hunt_phy_decode_cap(MCDI_OUT_DWORD(req, GET_LINK_OUT_CAP),
- &hlsp->hls_adv_cap_mask);
- hunt_phy_decode_cap(MCDI_OUT_DWORD(req, GET_LINK_OUT_LP_CAP),
- &hlsp->hls_lp_cap_mask);
+ mcdi_phy_decode_cap(MCDI_OUT_DWORD(req, GET_LINK_OUT_CAP),
+ &elsp->els_adv_cap_mask);
+ mcdi_phy_decode_cap(MCDI_OUT_DWORD(req, GET_LINK_OUT_LP_CAP),
+ &elsp->els_lp_cap_mask);
- hunt_phy_decode_link_mode(enp, MCDI_OUT_DWORD(req, GET_LINK_OUT_FLAGS),
+ mcdi_phy_decode_link_mode(enp, MCDI_OUT_DWORD(req, GET_LINK_OUT_FLAGS),
MCDI_OUT_DWORD(req, GET_LINK_OUT_LINK_SPEED),
MCDI_OUT_DWORD(req, GET_LINK_OUT_FCNTL),
- &hlsp->hls_link_mode, &hlsp->hls_fcntl);
+ &elsp->els_link_mode, &elsp->els_fcntl);
#if EFSYS_OPT_LOOPBACK
/* Assert the MC_CMD_LOOPBACK and EFX_LOOPBACK namespace agree */
@@ -282,10 +259,10 @@ hunt_phy_get_link(
EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_PCS == EFX_LOOPBACK_PCS);
EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_PMAPMD == EFX_LOOPBACK_PMA_PMD);
- hlsp->hls_loopback = MCDI_OUT_DWORD(req, GET_LINK_OUT_LOOPBACK_MODE);
+ elsp->els_loopback = MCDI_OUT_DWORD(req, GET_LINK_OUT_LOOPBACK_MODE);
#endif /* EFSYS_OPT_LOOPBACK */
- hlsp->hls_mac_up = MCDI_OUT_DWORD(req, GET_LINK_OUT_MAC_FAULT) == 0;
+ elsp->els_mac_up = MCDI_OUT_DWORD(req, GET_LINK_OUT_MAC_FAULT) == 0;
return (0);
@@ -298,15 +275,9 @@ fail1:
}
__checkReturn efx_rc_t
-hunt_phy_reconfigure(
+ef10_phy_reconfigure(
__in efx_nic_t *enp)
{
- /*
- * TBD: this is a little different for now (no LED support for Hunt
- * yet), but ultimately should consider common Siena/Hunt function:
- * Hunt should be a superset of Siena here (adds 40G)
- */
-
efx_nic_cfg_t *encp = &(enp->en_nic_cfg);
efx_port_t *epp = &(enp->en_port);
efx_mcdi_req_t req;
@@ -428,11 +399,9 @@ fail1:
}
__checkReturn efx_rc_t
-hunt_phy_verify(
+ef10_phy_verify(
__in efx_nic_t *enp)
{
- /* TBD: consider common Siena/Hunt function: essentially identical */
-
efx_mcdi_req_t req;
uint8_t payload[MAX(MC_CMD_GET_PHY_STATE_IN_LEN,
MC_CMD_GET_PHY_STATE_OUT_LEN)];
@@ -479,7 +448,7 @@ fail1:
}
__checkReturn efx_rc_t
-hunt_phy_oui_get(
+ef10_phy_oui_get(
__in efx_nic_t *enp,
__out uint32_t *ouip)
{
@@ -491,7 +460,7 @@ hunt_phy_oui_get(
#if EFSYS_OPT_PHY_STATS
__checkReturn efx_rc_t
-hunt_phy_stats_update(
+ef10_phy_stats_update(
__in efx_nic_t *enp,
__in efsys_mem_t *esmp,
__inout_ecount(EFX_PHY_NSTATS) uint32_t *stat)
@@ -509,8 +478,8 @@ hunt_phy_stats_update(
#if EFSYS_OPT_NAMES
-extern const char *
-hunt_phy_prop_name(
+ const char *
+ef10_phy_prop_name(
__in efx_nic_t *enp,
__in unsigned int id)
{
@@ -521,8 +490,8 @@ hunt_phy_prop_name(
#endif /* EFSYS_OPT_NAMES */
-extern __checkReturn efx_rc_t
-hunt_phy_prop_get(
+ __checkReturn efx_rc_t
+ef10_phy_prop_get(
__in efx_nic_t *enp,
__in unsigned int id,
__in uint32_t flags,
@@ -533,8 +502,8 @@ hunt_phy_prop_get(
return (ENOTSUP);
}
-extern __checkReturn efx_rc_t
-hunt_phy_prop_set(
+ __checkReturn efx_rc_t
+ef10_phy_prop_set(
__in efx_nic_t *enp,
__in unsigned int id,
__in uint32_t val)
diff --git a/sys/dev/sfxge/common/hunt_tx.c b/sys/dev/sfxge/common/hunt_tx.c
index 593db88..baa7444 100755
--- a/sys/dev/sfxge/common/hunt_tx.c
+++ b/sys/dev/sfxge/common/hunt_tx.c
@@ -87,12 +87,13 @@ efx_mcdi_init_txq(
MCDI_IN_SET_DWORD(req, INIT_TXQ_IN_LABEL, label);
MCDI_IN_SET_DWORD(req, INIT_TXQ_IN_INSTANCE, instance);
- MCDI_IN_POPULATE_DWORD_6(req, INIT_TXQ_IN_FLAGS,
+ MCDI_IN_POPULATE_DWORD_7(req, INIT_TXQ_IN_FLAGS,
INIT_TXQ_IN_FLAG_BUFF_MODE, 0,
INIT_TXQ_IN_FLAG_IP_CSUM_DIS,
(flags & EFX_TXQ_CKSUM_IPV4) ? 0 : 1,
INIT_TXQ_IN_FLAG_TCP_CSUM_DIS,
(flags & EFX_TXQ_CKSUM_TCPUDP) ? 0 : 1,
+ INIT_TXQ_EXT_IN_FLAG_TSOV2_EN, (flags & EFX_TXQ_FATSOV2) ? 1 : 0,
INIT_TXQ_IN_FLAG_TCP_UDP_ONLY, 0,
INIT_TXQ_IN_CRC_MODE, 0,
INIT_TXQ_IN_FLAG_TIMESTAMP, 0);
@@ -589,6 +590,38 @@ hunt_tx_qdesc_tso_create(
}
void
+ef10_tx_qdesc_tso2_create(
+ __in efx_txq_t *etp,
+ __in uint16_t ipv4_id,
+ __in uint32_t tcp_seq,
+ __in uint16_t tcp_mss,
+ __out_ecount(count) efx_desc_t *edp,
+ __in int count)
+{
+ EFSYS_PROBE4(tx_desc_tso2_create, unsigned int, etp->et_index,
+ uint16_t, ipv4_id, uint32_t, tcp_seq,
+ uint16_t, tcp_mss);
+
+ EFSYS_ASSERT(count >= EFX_TX_FATSOV2_OPT_NDESCS);
+
+ EFX_POPULATE_QWORD_5(edp[0].ed_eq,
+ ESF_DZ_TX_DESC_IS_OPT, 1,
+ ESF_DZ_TX_OPTION_TYPE,
+ ESE_DZ_TX_OPTION_DESC_TSO,
+ ESF_DZ_TX_TSO_OPTION_TYPE,
+ ESE_DZ_TX_TSO_OPTION_DESC_FATSO2A,
+ ESF_DZ_TX_TSO_IP_ID, ipv4_id,
+ ESF_DZ_TX_TSO_TCP_SEQNO, tcp_seq);
+ EFX_POPULATE_QWORD_4(edp[1].ed_eq,
+ ESF_DZ_TX_DESC_IS_OPT, 1,
+ ESF_DZ_TX_OPTION_TYPE,
+ ESE_DZ_TX_OPTION_DESC_TSO,
+ ESF_DZ_TX_TSO_OPTION_TYPE,
+ ESE_DZ_TX_TSO_OPTION_DESC_FATSO2B,
+ ESF_DZ_TX_TSO_TCP_MSS, tcp_mss);
+}
+
+ void
ef10_tx_qdesc_vlantci_create(
__in efx_txq_t *etp,
__in uint16_t tci,
diff --git a/sys/dev/sfxge/common/hunt_vpd.c b/sys/dev/sfxge/common/hunt_vpd.c
index 58e9a66..41b4b83 100644
--- a/sys/dev/sfxge/common/hunt_vpd.c
+++ b/sys/dev/sfxge/common/hunt_vpd.c
@@ -48,13 +48,20 @@ ef10_vpd_init(
caddr_t svpd;
size_t svpd_size;
uint32_t pci_pf;
+ uint32_t tag;
efx_rc_t rc;
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PROBE);
EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON ||
enp->en_family == EFX_FAMILY_MEDFORD);
- pci_pf = enp->en_nic_cfg.enc_pf;
+ if (enp->en_nic_cfg.enc_vpd_is_global) {
+ tag = TLV_TAG_GLOBAL_STATIC_VPD;
+ } else {
+ pci_pf = enp->en_nic_cfg.enc_pf;
+ tag = TLV_TAG_PF_STATIC_VPD(pci_pf);
+ }
+
/*
* The VPD interface exposes VPD resources from the combined static and
* dynamic VPD storage. As the static VPD configuration should *never*
@@ -64,8 +71,7 @@ ef10_vpd_init(
svpd_size = 0;
rc = ef10_nvram_partn_read_tlv(enp,
NVRAM_PARTITION_TYPE_STATIC_CONFIG,
- TLV_TAG_PF_STATIC_VPD(pci_pf),
- &svpd, &svpd_size);
+ tag, &svpd, &svpd_size);
if (rc != 0) {
if (rc == EACCES) {
/* Unpriviledged functions cannot access VPD */
@@ -132,17 +138,22 @@ ef10_vpd_read(
caddr_t dvpd;
size_t dvpd_size;
uint32_t pci_pf;
+ uint32_t tag;
efx_rc_t rc;
EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON ||
enp->en_family == EFX_FAMILY_MEDFORD);
- pci_pf = enp->en_nic_cfg.enc_pf;
+ if (enp->en_nic_cfg.enc_vpd_is_global) {
+ tag = TLV_TAG_GLOBAL_DYNAMIC_VPD;
+ } else {
+ pci_pf = enp->en_nic_cfg.enc_pf;
+ tag = TLV_TAG_PF_DYNAMIC_VPD(pci_pf);
+ }
if ((rc = ef10_nvram_partn_read_tlv(enp,
NVRAM_PARTITION_TYPE_DYNAMIC_CONFIG,
- TLV_TAG_PF_DYNAMIC_VPD(pci_pf),
- &dvpd, &dvpd_size)) != 0)
+ tag, &dvpd, &dvpd_size)) != 0)
goto fail1;
if (dvpd_size > size) {
@@ -210,6 +221,13 @@ ef10_vpd_verify(
if (dcont == 0)
break;
+ /*
+ * Skip the RV keyword. It should be present in both the static
+ * and dynamic cfg sectors.
+ */
+ if (dtag == EFX_VPD_RO && dkey == EFX_VPD_KEYWORD('R', 'V'))
+ continue;
+
scont = 0;
_NOTE(CONSTANTCONDITION)
while (1) {
@@ -389,12 +407,18 @@ ef10_vpd_write(
{
size_t vpd_length;
uint32_t pci_pf;
+ uint32_t tag;
efx_rc_t rc;
EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON ||
enp->en_family == EFX_FAMILY_MEDFORD);
- pci_pf = enp->en_nic_cfg.enc_pf;
+ if (enp->en_nic_cfg.enc_vpd_is_global) {
+ tag = TLV_TAG_GLOBAL_DYNAMIC_VPD;
+ } else {
+ pci_pf = enp->en_nic_cfg.enc_pf;
+ tag = TLV_TAG_PF_DYNAMIC_VPD(pci_pf);
+ }
/* Determine total length of new dynamic VPD */
if ((rc = efx_vpd_hunk_length(data, size, &vpd_length)) != 0)
@@ -403,8 +427,7 @@ ef10_vpd_write(
/* Store new dynamic VPD in all segments in DYNAMIC_CONFIG partition */
if ((rc = ef10_nvram_partn_write_segment_tlv(enp,
NVRAM_PARTITION_TYPE_DYNAMIC_CONFIG,
- TLV_TAG_PF_DYNAMIC_VPD(pci_pf),
- data, vpd_length, B_TRUE)) != 0) {
+ tag, data, vpd_length, B_TRUE)) != 0) {
goto fail2;
}
diff --git a/sys/dev/sfxge/common/medford_impl.h b/sys/dev/sfxge/common/medford_impl.h
index 11084dc..59ea35f 100644
--- a/sys/dev/sfxge/common/medford_impl.h
+++ b/sys/dev/sfxge/common/medford_impl.h
@@ -37,7 +37,29 @@
extern "C" {
#endif
+/* Alignment requirement for value written to RX WPTR:
+ * the WPTR must be aligned to an 8 descriptor boundary
+ *
+ * FIXME: Is this the same on Medford as Huntington?
+ */
+#define MEDFORD_RX_WPTR_ALIGN 8
+
+
+
+#ifndef ER_EZ_TX_PIOBUF_SIZE
+#define ER_EZ_TX_PIOBUF_SIZE 4096
+#endif
+
+
#define MEDFORD_PIOBUF_NBUFS (16)
+#define MEDFORD_PIOBUF_SIZE (ER_EZ_TX_PIOBUF_SIZE)
+
+#define MEDFORD_MIN_PIO_ALLOC_SIZE (MEDFORD_PIOBUF_SIZE / 32)
+
+
+extern __checkReturn efx_rc_t
+medford_board_cfg(
+ __in efx_nic_t *enp);
#ifdef __cplusplus
diff --git a/sys/dev/sfxge/common/medford_nic.c b/sys/dev/sfxge/common/medford_nic.c
index 68c8184..7c176b5 100644
--- a/sys/dev/sfxge/common/medford_nic.c
+++ b/sys/dev/sfxge/common/medford_nic.c
@@ -39,7 +39,273 @@ __FBSDID("$FreeBSD$");
#include "ef10_tlv_layout.h"
+static __checkReturn efx_rc_t
+efx_mcdi_get_rxdp_config(
+ __in efx_nic_t *enp,
+ __out uint32_t *end_paddingp)
+{
+ efx_mcdi_req_t req;
+ uint8_t payload[MAX(MC_CMD_GET_RXDP_CONFIG_IN_LEN,
+ MC_CMD_GET_RXDP_CONFIG_OUT_LEN)];
+ uint32_t end_padding;
+ efx_rc_t rc;
+ memset(payload, 0, sizeof (payload));
+ req.emr_cmd = MC_CMD_GET_RXDP_CONFIG;
+ req.emr_in_buf = payload;
+ req.emr_in_length = MC_CMD_GET_RXDP_CONFIG_IN_LEN;
+ req.emr_out_buf = payload;
+ req.emr_out_length = MC_CMD_GET_RXDP_CONFIG_OUT_LEN;
+ efx_mcdi_execute(enp, &req);
+ if (req.emr_rc != 0) {
+ rc = req.emr_rc;
+ goto fail1;
+ }
+
+ if (MCDI_OUT_DWORD_FIELD(req, GET_RXDP_CONFIG_OUT_DATA,
+ GET_RXDP_CONFIG_OUT_PAD_HOST_DMA) == 0) {
+ /* RX DMA end padding is disabled */
+ end_padding = 0;
+ } else {
+ switch(MCDI_OUT_DWORD_FIELD(req, GET_RXDP_CONFIG_OUT_DATA,
+ GET_RXDP_CONFIG_OUT_PAD_HOST_LEN)) {
+ case MC_CMD_SET_RXDP_CONFIG_IN_PAD_HOST_64:
+ end_padding = 64;
+ break;
+ case MC_CMD_SET_RXDP_CONFIG_IN_PAD_HOST_128:
+ end_padding = 128;
+ break;
+ case MC_CMD_SET_RXDP_CONFIG_IN_PAD_HOST_256:
+ end_padding = 256;
+ break;
+ default:
+ rc = ENOTSUP;
+ goto fail2;
+ }
+ }
+
+ *end_paddingp = end_padding;
+
+ return (0);
+
+fail2:
+ EFSYS_PROBE(fail2);
+fail1:
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
+
+ return (rc);
+}
+
+ __checkReturn efx_rc_t
+medford_board_cfg(
+ __in efx_nic_t *enp)
+{
+ efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip);
+ efx_nic_cfg_t *encp = &(enp->en_nic_cfg);
+ uint8_t mac_addr[6] = { 0 };
+ uint32_t board_type = 0;
+ ef10_link_state_t els;
+ efx_port_t *epp = &(enp->en_port);
+ uint32_t port;
+ uint32_t pf;
+ uint32_t vf;
+ uint32_t mask;
+ uint32_t flags;
+ uint32_t sysclk;
+ uint32_t base, nvec;
+ uint32_t end_padding;
+ efx_rc_t rc;
+
+ /*
+ * FIXME: Likely to be incomplete and incorrect.
+ * Parts of this should be shared with Huntington.
+ */
+
+ if ((rc = efx_mcdi_get_port_assignment(enp, &port)) != 0)
+ goto fail1;
+
+ /*
+ * NOTE: The MCDI protocol numbers ports from zero.
+ * The common code MCDI interface numbers ports from one.
+ */
+ emip->emi_port = port + 1;
+
+ if ((rc = ef10_external_port_mapping(enp, port,
+ &encp->enc_external_port)) != 0)
+ goto fail2;
+
+ /*
+ * Get PCIe function number from firmware (used for
+ * per-function privilege and dynamic config info).
+ * - PCIe PF: pf = PF number, vf = 0xffff.
+ * - PCIe VF: pf = parent PF, vf = VF number.
+ */
+ if ((rc = efx_mcdi_get_function_info(enp, &pf, &vf)) != 0)
+ goto fail3;
+
+ encp->enc_pf = pf;
+ encp->enc_vf = vf;
+
+ /* MAC address for this function */
+ if (EFX_PCI_FUNCTION_IS_PF(encp)) {
+ rc = efx_mcdi_get_mac_address_pf(enp, mac_addr);
+ if ((rc == 0) && (mac_addr[0] & 0x02)) {
+ /*
+ * If the static config does not include a global MAC
+ * address pool then the board may return a locally
+ * administered MAC address (this should only happen on
+ * incorrectly programmed boards).
+ */
+ rc = EINVAL;
+ }
+ } else {
+ rc = efx_mcdi_get_mac_address_vf(enp, mac_addr);
+ }
+ if (rc != 0)
+ goto fail4;
+
+ EFX_MAC_ADDR_COPY(encp->enc_mac_addr, mac_addr);
+
+ /* Board configuration */
+ rc = efx_mcdi_get_board_cfg(enp, &board_type, NULL, NULL);
+ if (rc != 0) {
+ /* Unprivileged functions may not be able to read board cfg */
+ if (rc == EACCES)
+ board_type = 0;
+ else
+ goto fail5;
+ }
+
+ encp->enc_board_type = board_type;
+ encp->enc_clk_mult = 1; /* not used for Medford */
+
+ /* Fill out fields in enp->en_port and enp->en_nic_cfg from MCDI */
+ if ((rc = efx_mcdi_get_phy_cfg(enp)) != 0)
+ goto fail6;
+
+ /* Obtain the default PHY advertised capabilities */
+ if ((rc = ef10_phy_get_link(enp, &els)) != 0)
+ goto fail7;
+ epp->ep_default_adv_cap_mask = els.els_adv_cap_mask;
+ epp->ep_adv_cap_mask = els.els_adv_cap_mask;
+
+ if (EFX_PCI_FUNCTION_IS_VF(encp)) {
+ /*
+ * Interrupt testing does not work for VFs. See bug50084.
+ * FIXME: Does this still apply to Medford?
+ */
+ encp->enc_bug41750_workaround = B_TRUE;
+ }
+
+ /* Chained multicast is always enabled on Medford */
+ encp->enc_bug26807_workaround = B_TRUE;
+
+ /* Get sysclk frequency (in MHz). */
+ if ((rc = efx_mcdi_get_clock(enp, &sysclk)) != 0)
+ goto fail8;
+
+ /*
+ * The timer quantum is 1536 sysclk cycles, documented for the
+ * EV_TMR_VAL field of EV_TIMER_TBL. Scale for MHz and ns units.
+ */
+ encp->enc_evq_timer_quantum_ns = 1536000UL / sysclk; /* 1536 cycles */
+ encp->enc_evq_timer_max_us = (encp->enc_evq_timer_quantum_ns <<
+ FRF_CZ_TC_TIMER_VAL_WIDTH) / 1000;
+
+ /* Check capabilities of running datapath firmware */
+ if ((rc = ef10_get_datapath_caps(enp)) != 0)
+ goto fail9;
+
+ /* Alignment for receive packet DMA buffers */
+ encp->enc_rx_buf_align_start = 1;
+
+ /* Get the RX DMA end padding alignment configuration */
+ if ((rc = efx_mcdi_get_rxdp_config(enp, &end_padding)) != 0)
+ goto fail10;
+ encp->enc_rx_buf_align_end = end_padding;
+
+ /* Alignment for WPTR updates */
+ encp->enc_rx_push_align = EF10_RX_WPTR_ALIGN;
+
+ /*
+ * Set resource limits for MC_CMD_ALLOC_VIS. Note that we cannot use
+ * MC_CMD_GET_RESOURCE_LIMITS here as that reports the available
+ * resources (allocated to this PCIe function), which is zero until
+ * after we have allocated VIs.
+ */
+ encp->enc_evq_limit = 1024;
+ encp->enc_rxq_limit = EFX_RXQ_LIMIT_TARGET;
+ encp->enc_txq_limit = EFX_TXQ_LIMIT_TARGET;
+
+ encp->enc_buftbl_limit = 0xFFFFFFFF;
+
+ encp->enc_piobuf_limit = MEDFORD_PIOBUF_NBUFS;
+ encp->enc_piobuf_size = MEDFORD_PIOBUF_SIZE;
+ encp->enc_piobuf_min_alloc_size = MEDFORD_MIN_PIO_ALLOC_SIZE;
+
+ /*
+ * Get the current privilege mask. Note that this may be modified
+ * dynamically, so this value is informational only. DO NOT use
+ * the privilege mask to check for sufficient privileges, as that
+ * can result in time-of-check/time-of-use bugs.
+ */
+ if ((rc = ef10_get_privilege_mask(enp, &mask)) != 0)
+ goto fail11;
+ encp->enc_privilege_mask = mask;
+
+ /* Get interrupt vector limits */
+ if ((rc = efx_mcdi_get_vector_cfg(enp, &base, &nvec, NULL)) != 0) {
+ if (EFX_PCI_FUNCTION_IS_PF(encp))
+ goto fail12;
+
+ /* Ignore error (cannot query vector limits from a VF). */
+ base = 0;
+ nvec = 1024;
+ }
+ encp->enc_intr_vec_base = base;
+ encp->enc_intr_limit = nvec;
+
+ /*
+ * Maximum number of bytes into the frame the TCP header can start for
+ * firmware assisted TSO to work.
+ */
+ encp->enc_tx_tso_tcp_header_offset_limit = EF10_TCP_HEADER_OFFSET_LIMIT;
+
+ /*
+ * Medford stores a single global copy of VPD, not per-PF as on
+ * Huntington.
+ */
+ encp->enc_vpd_is_global = B_TRUE;
+
+ return (0);
+
+fail12:
+ EFSYS_PROBE(fail12);
+fail11:
+ EFSYS_PROBE(fail11);
+fail10:
+ EFSYS_PROBE(fail10);
+fail9:
+ EFSYS_PROBE(fail9);
+fail8:
+ EFSYS_PROBE(fail8);
+fail7:
+ EFSYS_PROBE(fail7);
+fail6:
+ EFSYS_PROBE(fail6);
+fail5:
+ EFSYS_PROBE(fail5);
+fail4:
+ EFSYS_PROBE(fail4);
+fail3:
+ EFSYS_PROBE(fail3);
+fail2:
+ EFSYS_PROBE(fail2);
+fail1:
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
+
+ return (rc);
+}
#endif /* EFSYS_OPT_MEDFORD */
diff --git a/sys/dev/sfxge/common/siena_flash.h b/sys/dev/sfxge/common/siena_flash.h
index 48ddfac..143a14e 100644
--- a/sys/dev/sfxge/common/siena_flash.h
+++ b/sys/dev/sfxge/common/siena_flash.h
@@ -115,14 +115,14 @@ typedef struct siena_mc_boot_hdr_s { /* GENERATED BY scripts/genfwdef */
efx_word_t checksum; /* of whole header area + firmware image */
efx_word_t firmware_version_d;
efx_byte_t mcfw_subtype;
- efx_byte_t reserved_a[1]; /* (set to 0) */
+ efx_byte_t generation; /* Valid for medford, SBZ for earlier chips */
efx_dword_t firmware_text_offset; /* offset to firmware .text */
efx_dword_t firmware_text_size; /* length of firmware .text, in bytes */
efx_dword_t firmware_data_offset; /* offset to firmware .data */
efx_dword_t firmware_data_size; /* length of firmware .data, in bytes */
efx_byte_t spi_rate; /* SPI rate for reading image, 0 is BootROM default */
efx_byte_t spi_phase_adj; /* SPI SDO/SCL phase adjustment, 0 is default (no adj) */
- efx_word_t reserved_b[1]; /* (set to 0) */
+ efx_word_t xpm_sector; /* The sector that contains the key, or 0xffff if unsigned (medford) SBZ (earlier) */
efx_dword_t reserved_c[7]; /* (set to 0) */
} siena_mc_boot_hdr_t;
diff --git a/sys/dev/sfxge/common/siena_impl.h b/sys/dev/sfxge/common/siena_impl.h
index 639ac6b..4c80cd6 100644
--- a/sys/dev/sfxge/common/siena_impl.h
+++ b/sys/dev/sfxge/common/siena_impl.h
@@ -114,12 +114,12 @@ siena_mcdi_init(
__in const efx_mcdi_transport_t *mtp);
extern void
-siena_mcdi_request_copyin(
+siena_mcdi_send_request(
__in efx_nic_t *enp,
- __in efx_mcdi_req_t *emrp,
- __in unsigned int seq,
- __in boolean_t ev_cpl,
- __in boolean_t new_epoch);
+ __in void *hdrp,
+ __in size_t hdr_len,
+ __in void *sdup,
+ __in size_t sdu_len);
extern __checkReturn boolean_t
siena_mcdi_poll_response(
@@ -132,11 +132,6 @@ siena_mcdi_read_response(
__in size_t offset,
__in size_t length);
-extern void
-siena_mcdi_request_copyout(
- __in efx_nic_t *enp,
- __in efx_mcdi_req_t *emrp);
-
extern efx_rc_t
siena_mcdi_poll_reboot(
__in efx_nic_t *enp);
@@ -156,39 +151,10 @@ siena_mcdi_feature_supported(
#if EFSYS_OPT_NVRAM || EFSYS_OPT_VPD
extern __checkReturn efx_rc_t
-siena_nvram_partn_size(
- __in efx_nic_t *enp,
- __in uint32_t partn,
- __out size_t *sizep);
-
-extern __checkReturn efx_rc_t
siena_nvram_partn_lock(
__in efx_nic_t *enp,
__in uint32_t partn);
-extern __checkReturn efx_rc_t
-siena_nvram_partn_read(
- __in efx_nic_t *enp,
- __in uint32_t partn,
- __in unsigned int offset,
- __out_bcount(size) caddr_t data,
- __in size_t size);
-
-extern __checkReturn efx_rc_t
-siena_nvram_partn_erase(
- __in efx_nic_t *enp,
- __in uint32_t partn,
- __in unsigned int offset,
- __in size_t size);
-
-extern __checkReturn efx_rc_t
-siena_nvram_partn_write(
- __in efx_nic_t *enp,
- __in uint32_t partn,
- __in unsigned int offset,
- __out_bcount(size) caddr_t data,
- __in size_t size);
-
extern void
siena_nvram_partn_unlock(
__in efx_nic_t *enp,
@@ -215,67 +181,69 @@ siena_nvram_test(
#endif /* EFSYS_OPT_DIAG */
extern __checkReturn efx_rc_t
-siena_nvram_size(
- __in efx_nic_t *enp,
- __in efx_nvram_type_t type,
- __out size_t *sizep);
-
-extern __checkReturn efx_rc_t
siena_nvram_get_subtype(
__in efx_nic_t *enp,
__in uint32_t partn,
__out uint32_t *subtypep);
extern __checkReturn efx_rc_t
-siena_nvram_get_version(
+siena_nvram_type_to_partn(
__in efx_nic_t *enp,
__in efx_nvram_type_t type,
- __out uint32_t *subtypep,
- __out_ecount(4) uint16_t version[4]);
+ __out uint32_t *partnp);
extern __checkReturn efx_rc_t
-siena_nvram_rw_start(
+siena_nvram_partn_size(
__in efx_nic_t *enp,
- __in efx_nvram_type_t type,
- __out size_t *pref_chunkp);
+ __in uint32_t partn,
+ __out size_t *sizep);
extern __checkReturn efx_rc_t
-siena_nvram_read_chunk(
+siena_nvram_partn_rw_start(
__in efx_nic_t *enp,
- __in efx_nvram_type_t type,
+ __in uint32_t partn,
+ __out size_t *chunk_sizep);
+
+extern __checkReturn efx_rc_t
+siena_nvram_partn_read(
+ __in efx_nic_t *enp,
+ __in uint32_t partn,
__in unsigned int offset,
__out_bcount(size) caddr_t data,
__in size_t size);
-extern __checkReturn efx_rc_t
-siena_nvram_erase(
+extern __checkReturn efx_rc_t
+siena_nvram_partn_erase(
__in efx_nic_t *enp,
- __in efx_nvram_type_t type);
+ __in uint32_t partn,
+ __in unsigned int offset,
+ __in size_t size);
extern __checkReturn efx_rc_t
-siena_nvram_write_chunk(
+siena_nvram_partn_write(
__in efx_nic_t *enp,
- __in efx_nvram_type_t type,
+ __in uint32_t partn,
__in unsigned int offset,
- __in_bcount(size) caddr_t data,
+ __out_bcount(size) caddr_t data,
__in size_t size);
extern void
-siena_nvram_rw_finish(
+siena_nvram_partn_rw_finish(
__in efx_nic_t *enp,
- __in efx_nvram_type_t type);
+ __in uint32_t partn);
extern __checkReturn efx_rc_t
-siena_nvram_set_version(
+siena_nvram_partn_get_version(
__in efx_nic_t *enp,
- __in efx_nvram_type_t type,
- __in_ecount(4) uint16_t version[4]);
+ __in uint32_t partn,
+ __out uint32_t *subtypep,
+ __out_ecount(4) uint16_t version[4]);
extern __checkReturn efx_rc_t
-siena_nvram_type_to_partn(
+siena_nvram_partn_set_version(
__in efx_nic_t *enp,
- __in efx_nvram_type_t type,
- __out uint32_t *partnp);
+ __in uint32_t partn,
+ __in_ecount(4) uint16_t version[4]);
#endif /* EFSYS_OPT_NVRAM */
diff --git a/sys/dev/sfxge/common/siena_mcdi.c b/sys/dev/sfxge/common/siena_mcdi.c
index f3af2bf6f..4fb2b6c 100644
--- a/sys/dev/sfxge/common/siena_mcdi.c
+++ b/sys/dev/sfxge/common/siena_mcdi.c
@@ -52,7 +52,7 @@ __FBSDID("$FreeBSD$");
: MC_SMEM_P1_STATUS_OFST >> 2)
-static void
+ void
siena_mcdi_send_request(
__in efx_nic_t *enp,
__in void *hdrp,
@@ -89,79 +89,6 @@ siena_mcdi_send_request(
EFX_BAR_TBL_WRITED(enp, FR_CZ_MC_TREG_SMEM, dbr, &dword, B_FALSE);
}
- void
-siena_mcdi_request_copyin(
- __in efx_nic_t *enp,
- __in efx_mcdi_req_t *emrp,
- __in unsigned int seq,
- __in boolean_t ev_cpl,
- __in boolean_t new_epoch)
-{
-#if EFSYS_OPT_MCDI_LOGGING
- const efx_mcdi_transport_t *emtp = enp->en_mcdi.em_emtp;
-#endif
- efx_dword_t hdr;
- size_t hdr_len;
- unsigned int xflags;
-
- EFSYS_ASSERT(enp->en_family == EFX_FAMILY_SIENA);
- _NOTE(ARGUNUSED(new_epoch))
-
- xflags = 0;
- if (ev_cpl)
- xflags |= MCDI_HEADER_XFLAGS_EVREQ;
-
- /* Construct the header */
- hdr_len = sizeof (hdr);
- EFX_POPULATE_DWORD_6(hdr,
- MCDI_HEADER_CODE, emrp->emr_cmd,
- MCDI_HEADER_RESYNC, 1,
- MCDI_HEADER_DATALEN, emrp->emr_in_length,
- MCDI_HEADER_SEQ, seq,
- MCDI_HEADER_RESPONSE, 0,
- MCDI_HEADER_XFLAGS, xflags);
-
-#if EFSYS_OPT_MCDI_LOGGING
- if (emtp->emt_logger != NULL) {
- emtp->emt_logger(emtp->emt_context, EFX_LOG_MCDI_REQUEST,
- &hdr, sizeof (hdr),
- emrp->emr_in_buf, emrp->emr_in_length);
- }
-#endif /* EFSYS_OPT_MCDI_LOGGING */
-
- siena_mcdi_send_request(enp, &hdr, hdr_len,
- emrp->emr_in_buf, emrp->emr_in_length);
-}
-
- void
-siena_mcdi_request_copyout(
- __in efx_nic_t *enp,
- __in efx_mcdi_req_t *emrp)
-{
-#if EFSYS_OPT_MCDI_LOGGING
- const efx_mcdi_transport_t *emtp = enp->en_mcdi.em_emtp;
- efx_dword_t hdr;
-#endif
- size_t bytes = MIN(emrp->emr_out_length_used, emrp->emr_out_length);
-
- /* Copy payload out if caller supplied buffer */
- if (emrp->emr_out_buf != NULL) {
- siena_mcdi_read_response(enp, emrp->emr_out_buf,
- sizeof (efx_dword_t), bytes);
- }
-
-#if EFSYS_OPT_MCDI_LOGGING
- if (emtp->emt_logger != NULL) {
- siena_mcdi_read_response(enp, &hdr, 0, sizeof (hdr));
-
- emtp->emt_logger(emtp->emt_context,
- EFX_LOG_MCDI_RESPONSE,
- &hdr, sizeof (hdr),
- emrp->emr_out_buf, bytes);
- }
-#endif /* EFSYS_OPT_MCDI_LOGGING */
-}
-
efx_rc_t
siena_mcdi_poll_reboot(
__in efx_nic_t *enp)
diff --git a/sys/dev/sfxge/common/siena_nic.c b/sys/dev/sfxge/common/siena_nic.c
index 70e7b5d..59e1283 100644
--- a/sys/dev/sfxge/common/siena_nic.c
+++ b/sys/dev/sfxge/common/siena_nic.c
@@ -169,6 +169,7 @@ siena_board_cfg(
encp->enc_hw_tx_insert_vlan_enabled = B_FALSE;
encp->enc_fw_assisted_tso_enabled = B_FALSE;
+ encp->enc_fw_assisted_tso_v2_enabled = B_FALSE;
encp->enc_allow_set_mac_with_installed_filters = B_TRUE;
return (0);
diff --git a/sys/dev/sfxge/common/siena_nvram.c b/sys/dev/sfxge/common/siena_nvram.c
index 8f107b4..9708e0c 100644
--- a/sys/dev/sfxge/common/siena_nvram.c
+++ b/sys/dev/sfxge/common/siena_nvram.c
@@ -99,8 +99,8 @@ siena_nvram_partn_read(
while (size > 0) {
chunk = MIN(size, SIENA_NVRAM_CHUNK);
- if ((rc = efx_mcdi_nvram_read(enp, partn, offset,
- data, chunk)) != 0) {
+ if ((rc = efx_mcdi_nvram_read(enp, partn, offset, data, chunk,
+ MC_CMD_NVRAM_READ_IN_V2_DEFAULT)) != 0) {
goto fail1;
}
@@ -227,6 +227,8 @@ static siena_parttbl_entry_t siena_parttbl[] = {
{MC_CMD_NVRAM_TYPE_FC_FW, 2, EFX_NVRAM_FCFW},
{MC_CMD_NVRAM_TYPE_CPLD, 1, EFX_NVRAM_CPLD},
{MC_CMD_NVRAM_TYPE_CPLD, 2, EFX_NVRAM_CPLD},
+ {MC_CMD_NVRAM_TYPE_LICENSE, 1, EFX_NVRAM_LICENSE},
+ {MC_CMD_NVRAM_TYPE_LICENSE, 2, EFX_NVRAM_LICENSE}
};
__checkReturn efx_rc_t
@@ -291,32 +293,6 @@ fail1:
#endif /* EFSYS_OPT_DIAG */
- __checkReturn efx_rc_t
-siena_nvram_size(
- __in efx_nic_t *enp,
- __in efx_nvram_type_t type,
- __out size_t *sizep)
-{
- uint32_t partn;
- efx_rc_t rc;
-
- if ((rc = siena_nvram_type_to_partn(enp, type, &partn)) != 0)
- goto fail1;
-
- if ((rc = siena_nvram_partn_size(enp, partn, sizep)) != 0)
- goto fail2;
-
- return (0);
-
-fail2:
- EFSYS_PROBE(fail2);
-fail1:
- EFSYS_PROBE1(fail1, efx_rc_t, rc);
-
- *sizep = 0;
-
- return (rc);
-}
#define SIENA_DYNAMIC_CFG_SIZE(_nitems) \
(sizeof (siena_mc_dynamic_config_hdr_t) + ((_nitems) * \
@@ -506,29 +482,25 @@ fail1:
}
__checkReturn efx_rc_t
-siena_nvram_get_version(
+siena_nvram_partn_get_version(
__in efx_nic_t *enp,
- __in efx_nvram_type_t type,
+ __in uint32_t partn,
__out uint32_t *subtypep,
__out_ecount(4) uint16_t version[4])
{
siena_mc_dynamic_config_hdr_t *dcfg;
siena_parttbl_entry_t *entry;
uint32_t dcfg_partn;
- uint32_t partn;
unsigned int i;
efx_rc_t rc;
- if ((rc = siena_nvram_type_to_partn(enp, type, &partn)) != 0)
- goto fail1;
-
if ((1 << partn) & ~enp->en_u.siena.enu_partn_mask) {
rc = ENOTSUP;
- goto fail2;
+ goto fail1;
}
if ((rc = siena_nvram_get_subtype(enp, partn, subtypep)) != 0)
- goto fail3;
+ goto fail2;
/*
* Some partitions are accessible from both ports (for instance BOOTROM)
@@ -537,6 +509,7 @@ siena_nvram_get_version(
*/
version[0] = version[1] = version[2] = version[3] = 0;
for (i = 0; i < EFX_ARRAY_SIZE(siena_parttbl); i++) {
+ siena_mc_fw_version_t *verp;
unsigned int nitems;
uint16_t temp[4];
size_t length;
@@ -559,32 +532,27 @@ siena_nvram_get_version(
if ((rc = siena_nvram_get_dynamic_cfg(enp, dcfg_partn,
B_FALSE, &dcfg, &length)) != 0)
- goto fail4;
+ goto fail3;
nitems = EFX_DWORD_FIELD(dcfg->num_fw_version_items,
EFX_DWORD_0);
if (nitems < entry->partn)
goto done;
- temp[0] = EFX_WORD_FIELD(dcfg->fw_version[partn].version_w,
- EFX_WORD_0);
- temp[1] = EFX_WORD_FIELD(dcfg->fw_version[partn].version_x,
- EFX_WORD_0);
- temp[2] = EFX_WORD_FIELD(dcfg->fw_version[partn].version_y,
- EFX_WORD_0);
- temp[3] = EFX_WORD_FIELD(dcfg->fw_version[partn].version_z,
- EFX_WORD_0);
+ verp = &dcfg->fw_version[partn];
+ temp[0] = EFX_WORD_FIELD(verp->version_w, EFX_WORD_0);
+ temp[1] = EFX_WORD_FIELD(verp->version_x, EFX_WORD_0);
+ temp[2] = EFX_WORD_FIELD(verp->version_y, EFX_WORD_0);
+ temp[3] = EFX_WORD_FIELD(verp->version_z, EFX_WORD_0);
if (memcmp(version, temp, sizeof (temp)) < 0)
memcpy(version, temp, sizeof (temp));
- done:
+done:
EFSYS_KMEM_FREE(enp->en_esip, length, dcfg);
}
return (0);
-fail4:
- EFSYS_PROBE(fail4);
fail3:
EFSYS_PROBE(fail3);
fail2:
@@ -596,111 +564,21 @@ fail1:
}
__checkReturn efx_rc_t
-siena_nvram_rw_start(
+siena_nvram_partn_rw_start(
__in efx_nic_t *enp,
- __in efx_nvram_type_t type,
+ __in uint32_t partn,
__out size_t *chunk_sizep)
{
- uint32_t partn;
efx_rc_t rc;
- if ((rc = siena_nvram_type_to_partn(enp, type, &partn)) != 0)
- goto fail1;
-
if ((rc = siena_nvram_partn_lock(enp, partn)) != 0)
- goto fail2;
+ goto fail1;
if (chunk_sizep != NULL)
*chunk_sizep = SIENA_NVRAM_CHUNK;
return (0);
-fail2:
- EFSYS_PROBE(fail2);
-fail1:
- EFSYS_PROBE1(fail1, efx_rc_t, rc);
-
- return (rc);
-}
-
- __checkReturn efx_rc_t
-siena_nvram_read_chunk(
- __in efx_nic_t *enp,
- __in efx_nvram_type_t type,
- __in unsigned int offset,
- __out_bcount(size) caddr_t data,
- __in size_t size)
-{
- uint32_t partn;
- efx_rc_t rc;
-
- if ((rc = siena_nvram_type_to_partn(enp, type, &partn)) != 0)
- goto fail1;
-
- if ((rc = siena_nvram_partn_read(enp, partn, offset, data, size)) != 0)
- goto fail2;
-
- return (0);
-
-fail2:
- EFSYS_PROBE(fail2);
-fail1:
- EFSYS_PROBE1(fail1, efx_rc_t, rc);
-
- return (rc);
-}
-
- __checkReturn efx_rc_t
-siena_nvram_erase(
- __in efx_nic_t *enp,
- __in efx_nvram_type_t type)
-{
- size_t size;
- uint32_t partn;
- efx_rc_t rc;
-
- if ((rc = siena_nvram_type_to_partn(enp, type, &partn)) != 0)
- goto fail1;
-
- if ((rc = siena_nvram_partn_size(enp, partn, &size)) != 0)
- goto fail2;
-
- if ((rc = siena_nvram_partn_erase(enp, partn, 0, size)) != 0)
- goto fail3;
-
- return (0);
-
-fail3:
- EFSYS_PROBE(fail3);
-fail2:
- EFSYS_PROBE(fail2);
-fail1:
- EFSYS_PROBE1(fail1, efx_rc_t, rc);
-
- return (rc);
-}
-
- __checkReturn efx_rc_t
-siena_nvram_write_chunk(
- __in efx_nic_t *enp,
- __in efx_nvram_type_t type,
- __in unsigned int offset,
- __in_bcount(size) caddr_t data,
- __in size_t size)
-{
- uint32_t partn;
- efx_rc_t rc;
-
- if ((rc = siena_nvram_type_to_partn(enp, type, &partn)) != 0)
- goto fail1;
-
- if ((rc = siena_nvram_partn_write(enp, partn, offset, data, size)) != 0)
- goto fail2;
-
- return (0);
-
-fail2:
- EFSYS_PROBE(fail2);
fail1:
EFSYS_PROBE1(fail1, efx_rc_t, rc);
@@ -708,27 +586,23 @@ fail1:
}
void
-siena_nvram_rw_finish(
+siena_nvram_partn_rw_finish(
__in efx_nic_t *enp,
- __in efx_nvram_type_t type)
+ __in uint32_t partn)
{
- uint32_t partn;
- efx_rc_t rc;
-
- if ((rc = siena_nvram_type_to_partn(enp, type, &partn)) == 0)
- siena_nvram_partn_unlock(enp, partn);
+ siena_nvram_partn_unlock(enp, partn);
}
__checkReturn efx_rc_t
-siena_nvram_set_version(
+siena_nvram_partn_set_version(
__in efx_nic_t *enp,
- __in efx_nvram_type_t type,
+ __in uint32_t partn,
__in_ecount(4) uint16_t version[4])
{
efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip);
siena_mc_dynamic_config_hdr_t *dcfg = NULL;
siena_mc_fw_version_t *fwverp;
- uint32_t dcfg_partn, partn;
+ uint32_t dcfg_partn;
size_t dcfg_size;
unsigned int hdr_length;
unsigned int vpd_length;
@@ -741,15 +615,12 @@ siena_nvram_set_version(
size_t length;
efx_rc_t rc;
- if ((rc = siena_nvram_type_to_partn(enp, type, &partn)) != 0)
- goto fail1;
-
dcfg_partn = (emip->emi_port == 1)
? MC_CMD_NVRAM_TYPE_DYNAMIC_CFG_PORT0
: MC_CMD_NVRAM_TYPE_DYNAMIC_CFG_PORT1;
if ((rc = siena_nvram_partn_size(enp, dcfg_partn, &dcfg_size)) != 0)
- goto fail2;
+ goto fail1;
if ((rc = siena_nvram_partn_lock(enp, dcfg_partn)) != 0)
goto fail2;
diff --git a/sys/dev/sfxge/common/siena_vpd.c b/sys/dev/sfxge/common/siena_vpd.c
index 9a07f91..7a7ce67 100644
--- a/sys/dev/sfxge/common/siena_vpd.c
+++ b/sys/dev/sfxge/common/siena_vpd.c
@@ -326,6 +326,13 @@ siena_vpd_verify(
if (dcont == 0)
break;
+ /*
+ * Skip the RV keyword. It should be present in both the static
+ * and dynamic cfg sectors.
+ */
+ if (dtag == EFX_VPD_RO && dkey == EFX_VPD_KEYWORD('R', 'V'))
+ continue;
+
scont = 0;
_NOTE(CONSTANTCONDITION)
while (1) {
diff --git a/sys/dev/sfxge/sfxge.h b/sys/dev/sfxge/sfxge.h
index bea1eba..9cf8f07 100644
--- a/sys/dev/sfxge/sfxge.h
+++ b/sys/dev/sfxge/sfxge.h
@@ -283,7 +283,10 @@ struct sfxge_softc {
unsigned int rxq_count;
unsigned int txq_count;
- int tso_fw_assisted;
+ unsigned int tso_fw_assisted;
+#define SFXGE_FATSOV1 (1 << 0)
+#define SFXGE_FATSOV2 (1 << 1)
+
#if EFSYS_OPT_MCDI_LOGGING
int mcdi_logging;
#endif
diff --git a/sys/dev/sfxge/sfxge_tx.c b/sys/dev/sfxge/sfxge_tx.c
index 780ed26..6ae5a07 100644
--- a/sys/dev/sfxge/sfxge_tx.c
+++ b/sys/dev/sfxge/sfxge_tx.c
@@ -55,6 +55,7 @@ __FBSDID("$FreeBSD$");
#include <sys/socket.h>
#include <sys/sysctl.h>
#include <sys/syslog.h>
+#include <sys/limits.h>
#include <net/bpf.h>
#include <net/ethernet.h>
@@ -96,11 +97,11 @@ SYSCTL_INT(_hw_sfxge, OID_AUTO, tx_dpl_put_max, CTLFLAG_RDTUN,
"Maximum number of any packets in deferred packet put-list");
#define SFXGE_PARAM_TSO_FW_ASSISTED SFXGE_PARAM(tso_fw_assisted)
-static int sfxge_tso_fw_assisted = 1;
+static int sfxge_tso_fw_assisted = (SFXGE_FATSOV1 | SFXGE_FATSOV2);
TUNABLE_INT(SFXGE_PARAM_TSO_FW_ASSISTED, &sfxge_tso_fw_assisted);
SYSCTL_INT(_hw_sfxge, OID_AUTO, tso_fw_assisted, CTLFLAG_RDTUN,
&sfxge_tso_fw_assisted, 0,
- "Use FW-assisted TSO if supported by NIC firmware");
+ "Bitmask of FW-assisted TSO allowed to use if supported by NIC firmware");
static const struct {
@@ -850,6 +851,8 @@ struct sfxge_tso_state {
unsigned out_len; /* Remaining length in current segment */
unsigned seqnum; /* Current sequence number */
unsigned packet_space; /* Remaining space in current packet */
+ unsigned segs_space; /* Remaining number of DMA segments
+ for the packet (FATSOv2 only) */
/* Input position */
uint64_t dma_addr; /* DMA address of current position */
@@ -952,7 +955,7 @@ static void tso_start(struct sfxge_txq *txq, struct sfxge_tso_state *tso,
struct tcphdr th_copy;
#endif
- tso->fw_assisted = txq->sc->tso_fw_assisted;
+ tso->fw_assisted = txq->tso_fw_assisted;
tso->mbuf = mbuf;
/* Find network protocol and header */
@@ -1059,6 +1062,8 @@ static void tso_fill_packet_with_fragment(struct sfxge_txq *txq,
{
efx_desc_t *desc;
int n;
+ uint64_t dma_addr = tso->dma_addr;
+ boolean_t eop;
if (tso->in_len == 0 || tso->packet_space == 0)
return;
@@ -1066,20 +1071,38 @@ static void tso_fill_packet_with_fragment(struct sfxge_txq *txq,
KASSERT(tso->in_len > 0, ("TSO input length went negative"));
KASSERT(tso->packet_space > 0, ("TSO packet space went negative"));
- n = min(tso->in_len, tso->packet_space);
+ if (tso->fw_assisted & SFXGE_FATSOV2) {
+ n = tso->in_len;
+ tso->out_len -= n;
+ tso->seqnum += n;
+ tso->in_len = 0;
+ if (n < tso->packet_space) {
+ tso->packet_space -= n;
+ tso->segs_space--;
+ } else {
+ tso->packet_space = tso->seg_size -
+ (n - tso->packet_space) % tso->seg_size;
+ tso->segs_space =
+ EFX_TX_FATSOV2_DMA_SEGS_PER_PKT_MAX - 1 -
+ (tso->packet_space != tso->seg_size);
+ }
+ } else {
+ n = min(tso->in_len, tso->packet_space);
+ tso->packet_space -= n;
+ tso->out_len -= n;
+ tso->dma_addr += n;
+ tso->in_len -= n;
+ }
- tso->packet_space -= n;
- tso->out_len -= n;
- tso->in_len -= n;
+ /*
+ * It is OK to use binary OR below to avoid extra branching
+ * since all conditions may always be checked.
+ */
+ eop = (tso->out_len == 0) | (tso->packet_space == 0) |
+ (tso->segs_space == 0);
desc = &txq->pend_desc[txq->n_pend_desc++];
- efx_tx_qdesc_dma_create(txq->common,
- tso->dma_addr,
- n,
- tso->out_len == 0 || tso->packet_space == 0,
- desc);
-
- tso->dma_addr += n;
+ efx_tx_qdesc_dma_create(txq->common, dma_addr, n, eop, desc);
}
/* Callback from bus_dmamap_load() for long TSO headers. */
@@ -1112,28 +1135,47 @@ static int tso_start_new_packet(struct sfxge_txq *txq,
int rc;
if (tso->fw_assisted) {
- uint8_t tcp_flags = tso->tcp_flags;
-
- if (tso->out_len > tso->seg_size)
- tcp_flags &= ~(TH_FIN | TH_PUSH);
-
- /* TSO option descriptor */
- desc = &txq->pend_desc[txq->n_pend_desc++];
- efx_tx_qdesc_tso_create(txq->common,
- tso->packet_id,
- tso->seqnum,
- tcp_flags,
- desc++);
- KASSERT(txq->stmp[id].flags == 0, ("stmp flags are not 0"));
- id = (id + 1) & txq->ptr_mask;
+ if (tso->fw_assisted & SFXGE_FATSOV2) {
+ /* Add 2 FATSOv2 option descriptors */
+ desc = &txq->pend_desc[txq->n_pend_desc];
+ efx_tx_qdesc_tso2_create(txq->common,
+ tso->packet_id,
+ tso->seqnum,
+ tso->seg_size,
+ desc,
+ EFX_TX_FATSOV2_OPT_NDESCS);
+ desc += EFX_TX_FATSOV2_OPT_NDESCS;
+ txq->n_pend_desc += EFX_TX_FATSOV2_OPT_NDESCS;
+ KASSERT(txq->stmp[id].flags == 0, ("stmp flags are not 0"));
+ id = (id + EFX_TX_FATSOV2_OPT_NDESCS) & txq->ptr_mask;
+
+ tso->segs_space =
+ EFX_TX_FATSOV2_DMA_SEGS_PER_PKT_MAX - 1;
+ } else {
+ uint8_t tcp_flags = tso->tcp_flags;
+
+ if (tso->out_len > tso->seg_size)
+ tcp_flags &= ~(TH_FIN | TH_PUSH);
+
+ /* Add FATSOv1 option descriptor */
+ desc = &txq->pend_desc[txq->n_pend_desc++];
+ efx_tx_qdesc_tso_create(txq->common,
+ tso->packet_id,
+ tso->seqnum,
+ tcp_flags,
+ desc++);
+ KASSERT(txq->stmp[id].flags == 0, ("stmp flags are not 0"));
+ id = (id + 1) & txq->ptr_mask;
+
+ tso->seqnum += tso->seg_size;
+ tso->segs_space = UINT_MAX;
+ }
/* Header DMA descriptor */
*desc = tso->header_desc;
txq->n_pend_desc++;
KASSERT(txq->stmp[id].flags == 0, ("stmp flags are not 0"));
id = (id + 1) & txq->ptr_mask;
-
- tso->seqnum += tso->seg_size;
} else {
/* Allocate a DMA-mapped header buffer. */
if (__predict_true(tso->header_len <= TSOH_STD_SIZE)) {
@@ -1215,6 +1257,8 @@ static int tso_start_new_packet(struct sfxge_txq *txq,
0,
desc);
id = (id + 1) & txq->ptr_mask;
+
+ tso->segs_space = UINT_MAX;
}
tso->packet_space = tso->seg_size;
txq->tso_packets++;
@@ -1264,15 +1308,19 @@ sfxge_tx_queue_tso(struct sfxge_txq *txq, struct mbuf *mbuf,
}
/* End of packet? */
- if (tso.packet_space == 0) {
+ if ((tso.packet_space == 0) | (tso.segs_space == 0)) {
+ unsigned int n_fatso_opt_desc =
+ (tso.fw_assisted & SFXGE_FATSOV2) ?
+ EFX_TX_FATSOV2_OPT_NDESCS :
+ (tso.fw_assisted & SFXGE_FATSOV1) ? 1 : 0;
+
/* If the queue is now full due to tiny MSS,
* or we can't create another header, discard
* the remainder of the input mbuf but do not
* roll back the work we have done.
*/
- if (txq->n_pend_desc + tso.fw_assisted +
- 1 /* header */ + n_dma_seg >
- txq->max_pkt_desc) {
+ if (txq->n_pend_desc + n_fatso_opt_desc +
+ 1 /* header */ + n_dma_seg > txq->max_pkt_desc) {
txq->tso_pdrop_too_many++;
break;
}
@@ -1407,12 +1455,67 @@ sfxge_tx_qstop(struct sfxge_softc *sc, unsigned int index)
SFXGE_TXQ_UNLOCK(txq);
}
+/*
+ * Estimate maximum number of Tx descriptors required for TSO packet.
+ * With minimum MSS and maximum mbuf length we might need more (even
+ * than a ring-ful of descriptors), but this should not happen in
+ * practice except due to deliberate attack. In that case we will
+ * truncate the output at a packet boundary.
+ */
+static unsigned int
+sfxge_tx_max_pkt_desc(const struct sfxge_softc *sc, enum sfxge_txq_type type,
+ unsigned int tso_fw_assisted)
+{
+ /* One descriptor for every input fragment */
+ unsigned int max_descs = SFXGE_TX_MAPPING_MAX_SEG;
+ unsigned int sw_tso_max_descs;
+ unsigned int fa_tso_v1_max_descs = 0;
+ unsigned int fa_tso_v2_max_descs = 0;
+
+ /* VLAN tagging Tx option descriptor may be required */
+ if (efx_nic_cfg_get(sc->enp)->enc_hw_tx_insert_vlan_enabled)
+ max_descs++;
+
+ if (type == SFXGE_TXQ_IP_TCP_UDP_CKSUM) {
+ /*
+ * Plus header and payload descriptor for each output segment.
+ * Minus one since header fragment is already counted.
+ * Even if FATSO is used, we should be ready to fallback
+ * to do it in the driver.
+ */
+ sw_tso_max_descs = SFXGE_TSO_MAX_SEGS * 2 - 1;
+
+ /* FW assisted TSOv1 requires one more descriptor per segment
+ * in comparison to SW TSO */
+ if (tso_fw_assisted & SFXGE_FATSOV1)
+ fa_tso_v1_max_descs =
+ sw_tso_max_descs + SFXGE_TSO_MAX_SEGS;
+
+ /* FW assisted TSOv2 requires 3 (2 FATSO plus header) extra
+ * descriptors per superframe limited by number of DMA fetches
+ * per packet. The first packet header is already counted.
+ */
+ if (tso_fw_assisted & SFXGE_FATSOV2) {
+ fa_tso_v2_max_descs =
+ howmany(SFXGE_TX_MAPPING_MAX_SEG,
+ EFX_TX_FATSOV2_DMA_SEGS_PER_PKT_MAX - 1) *
+ (EFX_TX_FATSOV2_OPT_NDESCS + 1) - 1;
+ }
+
+ max_descs += MAX(sw_tso_max_descs,
+ MAX(fa_tso_v1_max_descs, fa_tso_v2_max_descs));
+ }
+
+ return (max_descs);
+}
+
static int
sfxge_tx_qstart(struct sfxge_softc *sc, unsigned int index)
{
struct sfxge_txq *txq;
efsys_mem_t *esmp;
uint16_t flags;
+ unsigned int tso_fw_assisted;
struct sfxge_evq *evq;
unsigned int desc_index;
int rc;
@@ -1434,6 +1537,7 @@ sfxge_tx_qstart(struct sfxge_softc *sc, unsigned int index)
return (rc);
/* Determine the kind of queue we are creating. */
+ tso_fw_assisted = 0;
switch (txq->type) {
case SFXGE_TXQ_NON_CKSUM:
flags = 0;
@@ -1443,6 +1547,9 @@ sfxge_tx_qstart(struct sfxge_softc *sc, unsigned int index)
break;
case SFXGE_TXQ_IP_TCP_UDP_CKSUM:
flags = EFX_TXQ_CKSUM_IPV4 | EFX_TXQ_CKSUM_TCPUDP;
+ tso_fw_assisted = sc->tso_fw_assisted;
+ if (tso_fw_assisted & SFXGE_FATSOV2)
+ flags |= EFX_TXQ_FATSOV2;
break;
default:
KASSERT(0, ("Impossible TX queue"));
@@ -1453,8 +1560,19 @@ sfxge_tx_qstart(struct sfxge_softc *sc, unsigned int index)
/* Create the common code transmit queue. */
if ((rc = efx_tx_qcreate(sc->enp, index, txq->type, esmp,
sc->txq_entries, txq->buf_base_id, flags, evq->common,
- &txq->common, &desc_index)) != 0)
- goto fail;
+ &txq->common, &desc_index)) != 0) {
+ /* Retry if no FATSOv2 resources, otherwise fail */
+ if ((rc != ENOSPC) || (~flags & EFX_TXQ_FATSOV2))
+ goto fail;
+
+ /* Looks like all FATSOv2 contexts are used */
+ flags &= ~EFX_TXQ_FATSOV2;
+ tso_fw_assisted &= ~SFXGE_FATSOV2;
+ if ((rc = efx_tx_qcreate(sc->enp, index, txq->type, esmp,
+ sc->txq_entries, txq->buf_base_id, flags, evq->common,
+ &txq->common, &desc_index)) != 0)
+ goto fail;
+ }
/* Initialise queue descriptor indexes */
txq->added = txq->pending = txq->completed = txq->reaped = desc_index;
@@ -1466,6 +1584,10 @@ sfxge_tx_qstart(struct sfxge_softc *sc, unsigned int index)
txq->init_state = SFXGE_TXQ_STARTED;
txq->flush_state = SFXGE_FLUSH_REQUIRED;
+ txq->tso_fw_assisted = tso_fw_assisted;
+
+ txq->max_pkt_desc = sfxge_tx_max_pkt_desc(sc, txq->type,
+ tso_fw_assisted);
SFXGE_TXQ_UNLOCK(txq);
@@ -1574,38 +1696,6 @@ sfxge_tx_qfini(struct sfxge_softc *sc, unsigned int index)
free(txq, M_SFXGE);
}
-/*
- * Estimate maximum number of Tx descriptors required for TSO packet.
- * With minimum MSS and maximum mbuf length we might need more (even
- * than a ring-ful of descriptors), but this should not happen in
- * practice except due to deliberate attack. In that case we will
- * truncate the output at a packet boundary.
- */
-static unsigned int
-sfxge_tx_max_pkt_desc(const struct sfxge_softc *sc, enum sfxge_txq_type type)
-{
- /* One descriptor for every input fragment */
- unsigned int max_descs = SFXGE_TX_MAPPING_MAX_SEG;
-
- /* VLAN tagging Tx option descriptor may be required */
- if (efx_nic_cfg_get(sc->enp)->enc_hw_tx_insert_vlan_enabled)
- max_descs++;
-
- if (type == SFXGE_TXQ_IP_TCP_UDP_CKSUM) {
- /*
- * Plus header and payload descriptor for each output segment.
- * Minus one since header fragment is already counted.
- */
- max_descs += SFXGE_TSO_MAX_SEGS * 2 - 1;
-
- /* FW assisted TSO requires one more descriptor per segment */
- if (sc->tso_fw_assisted)
- max_descs += SFXGE_TSO_MAX_SEGS;
- }
-
- return (max_descs);
-}
-
static int
sfxge_tx_qinit(struct sfxge_softc *sc, unsigned int txq_index,
enum sfxge_txq_type type, unsigned int evq_index)
@@ -1735,8 +1825,6 @@ sfxge_tx_qinit(struct sfxge_softc *sc, unsigned int txq_index,
txq->init_state = SFXGE_TXQ_INITIALIZED;
txq->hw_vlan_tci = 0;
- txq->max_pkt_desc = sfxge_tx_max_pkt_desc(sc, type);
-
return (0);
fail_txq_stat_init:
@@ -1852,10 +1940,12 @@ sfxge_tx_init(struct sfxge_softc *sc)
sc->txq_count = SFXGE_TXQ_NTYPES - 1 + sc->intr.n_alloc;
sc->tso_fw_assisted = sfxge_tso_fw_assisted;
- if (sc->tso_fw_assisted)
- sc->tso_fw_assisted =
- (encp->enc_features & EFX_FEATURE_FW_ASSISTED_TSO) &&
- (encp->enc_fw_assisted_tso_enabled);
+ if ((~encp->enc_features & EFX_FEATURE_FW_ASSISTED_TSO) ||
+ (!encp->enc_fw_assisted_tso_enabled))
+ sc->tso_fw_assisted &= ~SFXGE_FATSOV1;
+ if ((~encp->enc_features & EFX_FEATURE_FW_ASSISTED_TSO_V2) ||
+ (!encp->enc_fw_assisted_tso_v2_enabled))
+ sc->tso_fw_assisted &= ~SFXGE_FATSOV2;
sc->txqs_node = SYSCTL_ADD_NODE(
device_get_sysctl_ctx(sc->dev),
diff --git a/sys/dev/sfxge/sfxge_tx.h b/sys/dev/sfxge/sfxge_tx.h
index 816856a..ce5d3c4 100644
--- a/sys/dev/sfxge/sfxge_tx.h
+++ b/sys/dev/sfxge/sfxge_tx.h
@@ -170,6 +170,7 @@ struct sfxge_txq {
struct sfxge_softc *sc;
enum sfxge_txq_state init_state;
enum sfxge_flush_state flush_state;
+ unsigned int tso_fw_assisted;
enum sfxge_txq_type type;
unsigned int txq_index;
unsigned int evq_index;
diff --git a/sys/dev/sfxge/sfxge_version.h b/sys/dev/sfxge/sfxge_version.h
index 9d93e79..dbc23ba 100644
--- a/sys/dev/sfxge/sfxge_version.h
+++ b/sys/dev/sfxge/sfxge_version.h
@@ -36,6 +36,6 @@
#ifndef _SFXGE_VERSION_H
#define _SFXGE_VERSION_H
-#define SFXGE_VERSION_STRING "v4.5.3.1002"
+#define SFXGE_VERSION_STRING "v4.8.0.1019"
#endif /* _SFXGE_DRIVER_VERSION_H */
diff --git a/sys/dev/uart/uart_bus.h b/sys/dev/uart/uart_bus.h
index 4a2ab91..3422269 100644
--- a/sys/dev/uart/uart_bus.h
+++ b/sys/dev/uart/uart_bus.h
@@ -112,6 +112,7 @@ struct uart_softc {
/* Pulse capturing support (PPS). */
struct pps_state sc_pps;
int sc_pps_mode;
+ sbintime_t sc_pps_captime;
/* Upper layer data. */
void *sc_softih;
diff --git a/sys/dev/uart/uart_core.c b/sys/dev/uart/uart_core.c
index 3da37e0..b9cffe3 100644
--- a/sys/dev/uart/uart_core.c
+++ b/sys/dev/uart/uart_core.c
@@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$");
#include <dev/uart/uart.h>
#include <dev/uart/uart_bus.h>
#include <dev/uart/uart_cpu.h>
+#include <dev/uart/uart_ppstypes.h>
#include "uart_if.h"
@@ -65,47 +66,47 @@ static MALLOC_DEFINE(M_UART, "UART", "UART driver");
static int uart_poll_freq = UART_POLL_FREQ;
TUNABLE_INT("debug.uart_poll_freq", &uart_poll_freq);
-#define PPS_MODE_DISABLED 0
-#define PPS_MODE_CTS 1
-#define PPS_MODE_DCD 2
-
-static inline int
-uart_pps_signal(int pps_mode)
-{
-
- switch(pps_mode) {
- case PPS_MODE_CTS:
- return (SER_CTS);
- case PPS_MODE_DCD:
- return (SER_DCD);
- }
- return (0);
-}
static inline int
uart_pps_mode_valid(int pps_mode)
{
-
- switch(pps_mode) {
- case PPS_MODE_DISABLED:
- case PPS_MODE_CTS:
- case PPS_MODE_DCD:
- return (true);
+ int opt;
+
+ switch(pps_mode & UART_PPS_SIGNAL_MASK) {
+ case UART_PPS_DISABLED:
+ case UART_PPS_CTS:
+ case UART_PPS_DCD:
+ break;
+ default:
+ return (false);
}
- return (false);
+
+ opt = pps_mode & UART_PPS_OPTION_MASK;
+ if ((opt & ~(UART_PPS_INVERT_PULSE | UART_PPS_NARROW_PULSE)) != 0)
+ return (false);
+
+ return (true);
}
-static const char *
-uart_pps_mode_name(int pps_mode)
+static void
+uart_pps_print_mode(struct uart_softc *sc)
{
- switch(pps_mode) {
- case PPS_MODE_DISABLED:
- return ("disabled");
- case PPS_MODE_CTS:
- return ("CTS");
- case PPS_MODE_DCD:
- return ("DCD");
+
+ device_printf(sc->sc_dev, "PPS capture mode: ");
+ switch(sc->sc_pps_mode) {
+ case UART_PPS_DISABLED:
+ printf("disabled");
+ case UART_PPS_CTS:
+ printf("CTS");
+ case UART_PPS_DCD:
+ printf("DCD");
+ default:
+ printf("invalid");
}
- return ("invalid");
+ if (sc->sc_pps_mode & UART_PPS_INVERT_PULSE)
+ printf("-Inverted");
+ if (sc->sc_pps_mode & UART_PPS_NARROW_PULSE)
+ printf("-NarrowPulse");
+ printf("\n");
}
static int
@@ -126,6 +127,55 @@ uart_pps_mode_sysctl(SYSCTL_HANDLER_ARGS)
}
static void
+uart_pps_process(struct uart_softc *sc, int ser_sig)
+{
+ sbintime_t now;
+ int is_assert, pps_sig;
+
+ /* Which signal is configured as PPS? Early out if none. */
+ switch(sc->sc_pps_mode & UART_PPS_SIGNAL_MASK) {
+ case UART_PPS_CTS:
+ pps_sig = SER_CTS;
+ break;
+ case UART_PPS_DCD:
+ pps_sig = SER_DCD;
+ break;
+ default:
+ return;
+ }
+
+ /* Early out if there is no change in the signal configured as PPS. */
+ if ((ser_sig & SER_DELTA(pps_sig)) == 0)
+ return;
+
+ /*
+ * In narrow-pulse mode we need to synthesize both capture and clear
+ * events from a single "delta occurred" indication from the uart
+ * hardware because the pulse width is too narrow to reliably detect
+ * both edges. However, when the pulse width is close to our interrupt
+ * processing latency we might intermittantly catch both edges. To
+ * guard against generating spurious events when that happens, we use a
+ * separate timer to ensure at least half a second elapses before we
+ * generate another event.
+ */
+ pps_capture(&sc->sc_pps);
+ if (sc->sc_pps_mode & UART_PPS_NARROW_PULSE) {
+ now = getsbinuptime();
+ if (now > sc->sc_pps_captime + 500 * SBT_1MS) {
+ sc->sc_pps_captime = now;
+ pps_event(&sc->sc_pps, PPS_CAPTUREASSERT);
+ pps_event(&sc->sc_pps, PPS_CAPTURECLEAR);
+ }
+ } else {
+ is_assert = ser_sig & pps_sig;
+ if (sc->sc_pps_mode & UART_PPS_INVERT_PULSE)
+ is_assert = !is_assert;
+ pps_event(&sc->sc_pps, is_assert ? PPS_CAPTUREASSERT :
+ PPS_CAPTURECLEAR);
+ }
+}
+
+static void
uart_pps_init(struct uart_softc *sc)
{
struct sysctl_ctx_list *ctx;
@@ -142,23 +192,23 @@ uart_pps_init(struct uart_softc *sc)
* for one specific device.
*/
#ifdef UART_PPS_ON_CTS
- sc->sc_pps_mode = PPS_MODE_CTS;
+ sc->sc_pps_mode = UART_PPS_CTS;
#else
- sc->sc_pps_mode = PPS_MODE_DCD;
+ sc->sc_pps_mode = UART_PPS_DCD;
#endif
TUNABLE_INT_FETCH("hw.uart.pps_mode", &sc->sc_pps_mode);
SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, "pps_mode",
CTLTYPE_INT | CTLFLAG_RWTUN, sc, 0, uart_pps_mode_sysctl, "I",
- "pulse capturing mode - 0/1/2 - disabled/CTS/DCD");
+ "pulse mode: 0/1/2=disabled/CTS/DCD; "
+ "add 0x10 to invert, 0x20 for narrow pulse");
if (!uart_pps_mode_valid(sc->sc_pps_mode)) {
device_printf(sc->sc_dev,
- "Invalid pps_mode %d configured; disabling PPS capture\n",
+ "Invalid pps_mode 0x%02x configured; disabling PPS capture\n",
sc->sc_pps_mode);
- sc->sc_pps_mode = PPS_MODE_DISABLED;
+ sc->sc_pps_mode = UART_PPS_DISABLED;
} else if (bootverbose) {
- device_printf(sc->sc_dev, "PPS capture mode %d (%s)\n",
- sc->sc_pps_mode, uart_pps_mode_name(sc->sc_pps_mode));
+ uart_pps_print_mode(sc);
}
sc->sc_pps.ppscap = PPS_CAPTUREBOTH;
@@ -302,23 +352,16 @@ static __inline int
uart_intr_sigchg(void *arg)
{
struct uart_softc *sc = arg;
- int new, old, pps_sig, sig;
+ int new, old, sig;
sig = UART_GETSIG(sc);
/*
- * Time pulse counting support. Note that both CTS and DCD are
- * active-low signals. The status bit is high to indicate that
- * the signal on the line is low, which corresponds to a PPS
- * clear event.
+ * Time pulse counting support, invoked whenever the PPS parameters are
+ * currently set to capture either edge of the signal.
*/
if (sc->sc_pps.ppsparam.mode & PPS_CAPTUREBOTH) {
- pps_sig = uart_pps_signal(sc->sc_pps_mode);
- if (sig & SER_DELTA(pps_sig)) {
- pps_capture(&sc->sc_pps);
- pps_event(&sc->sc_pps, (sig & pps_sig) ?
- PPS_CAPTURECLEAR : PPS_CAPTUREASSERT);
- }
+ uart_pps_process(sc, sig);
}
/*
diff --git a/sys/dev/uart/uart_dev_ns8250.c b/sys/dev/uart/uart_dev_ns8250.c
index 99692e6..67149d6 100644
--- a/sys/dev/uart/uart_dev_ns8250.c
+++ b/sys/dev/uart/uart_dev_ns8250.c
@@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$");
#endif
#include <dev/uart/uart_bus.h>
#include <dev/uart/uart_dev_ns8250.h>
+#include <dev/uart/uart_ppstypes.h>
#include <dev/ic/ns16550.h>
@@ -390,11 +391,40 @@ static struct ofw_compat_data compat_data[] = {
UART_FDT_CLASS_AND_DEVICE(compat_data);
#endif
-#define SIGCHG(c, i, s, d) \
- if (c) { \
- i |= (i & s) ? s : s | d; \
- } else { \
- i = (i & s) ? (i & ~s) | d : i; \
+/* Use token-pasting to form SER_ and MSR_ named constants. */
+#define SER(sig) SER_##sig
+#define SERD(sig) SER_D##sig
+#define MSR(sig) MSR_##sig
+#define MSRD(sig) MSR_D##sig
+
+/*
+ * Detect signal changes using software delta detection. The previous state of
+ * the signals is in 'var' the new hardware state is in 'msr', and 'sig' is the
+ * short name (DCD, CTS, etc) of the signal bit being processed; 'var' gets the
+ * new state of both the signal and the delta bits.
+ */
+#define SIGCHGSW(var, msr, sig) \
+ if ((msr) & MSR(sig)) { \
+ if ((var & SER(sig)) == 0) \
+ var |= SERD(sig) | SER(sig); \
+ } else { \
+ if ((var & SER(sig)) != 0) \
+ var = SERD(sig) | (var & ~SER(sig)); \
+ }
+
+/*
+ * Detect signal changes using the hardware msr delta bits. This is currently
+ * used only when PPS timing information is being captured using the "narrow
+ * pulse" option. With a narrow PPS pulse the signal may not still be asserted
+ * by time the interrupt handler is invoked. The hardware will latch the fact
+ * that it changed in the delta bits.
+ */
+#define SIGCHGHW(var, msr, sig) \
+ if ((msr) & MSRD(sig)) { \
+ if (((msr) & MSR(sig)) != 0) \
+ var |= SERD(sig) | SER(sig); \
+ else \
+ var = SERD(sig) | (var & ~SER(sig)); \
}
int
@@ -521,21 +551,37 @@ ns8250_bus_flush(struct uart_softc *sc, int what)
int
ns8250_bus_getsig(struct uart_softc *sc)
{
- uint32_t new, old, sig;
+ uint32_t old, sig;
uint8_t msr;
+ /*
+ * The delta bits are reputed to be broken on some hardware, so use
+ * software delta detection by default. Use the hardware delta bits
+ * when capturing PPS pulses which are too narrow for software detection
+ * to see the edges. Hardware delta for RI doesn't work like the
+ * others, so always use software for it. Other threads may be changing
+ * other (non-MSR) bits in sc_hwsig, so loop until it can succesfully
+ * update without other changes happening. Note that the SIGCHGxx()
+ * macros carefully preserve the delta bits when we have to loop several
+ * times and a signal transitions between iterations.
+ */
do {
old = sc->sc_hwsig;
sig = old;
uart_lock(sc->sc_hwmtx);
msr = uart_getreg(&sc->sc_bas, REG_MSR);
uart_unlock(sc->sc_hwmtx);
- SIGCHG(msr & MSR_DSR, sig, SER_DSR, SER_DDSR);
- SIGCHG(msr & MSR_CTS, sig, SER_CTS, SER_DCTS);
- SIGCHG(msr & MSR_DCD, sig, SER_DCD, SER_DDCD);
- SIGCHG(msr & MSR_RI, sig, SER_RI, SER_DRI);
- new = sig & ~SER_MASK_DELTA;
- } while (!atomic_cmpset_32(&sc->sc_hwsig, old, new));
+ if (sc->sc_pps_mode & UART_PPS_NARROW_PULSE) {
+ SIGCHGHW(sig, msr, DSR);
+ SIGCHGHW(sig, msr, CTS);
+ SIGCHGHW(sig, msr, DCD);
+ } else {
+ SIGCHGSW(sig, msr, DSR);
+ SIGCHGSW(sig, msr, CTS);
+ SIGCHGSW(sig, msr, DCD);
+ }
+ SIGCHGSW(sig, msr, RI);
+ } while (!atomic_cmpset_32(&sc->sc_hwsig, old, sig & ~SER_MASK_DELTA));
return (sig);
}
@@ -889,12 +935,10 @@ ns8250_bus_setsig(struct uart_softc *sc, int sig)
old = sc->sc_hwsig;
new = old;
if (sig & SER_DDTR) {
- SIGCHG(sig & SER_DTR, new, SER_DTR,
- SER_DDTR);
+ new = (new & ~SER_DTR) | (sig & (SER_DTR | SER_DDTR));
}
if (sig & SER_DRTS) {
- SIGCHG(sig & SER_RTS, new, SER_RTS,
- SER_DRTS);
+ new = (new & ~SER_RTS) | (sig & (SER_RTS | SER_DRTS));
}
} while (!atomic_cmpset_32(&sc->sc_hwsig, old, new));
uart_lock(sc->sc_hwmtx);
diff --git a/sys/dev/uart/uart_ppstypes.h b/sys/dev/uart/uart_ppstypes.h
new file mode 100644
index 0000000..142d0f1
--- /dev/null
+++ b/sys/dev/uart/uart_ppstypes.h
@@ -0,0 +1,46 @@
+/*-
+ * Copyright (c) 2015 Ian Lepore
+ * 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.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef _DEV_UART_PPSTYPES_H_
+#define _DEV_UART_PPSTYPES_H_
+
+/*
+ * These constants are shared by several drivers including uart and usb_serial.
+ */
+
+#define UART_PPS_SIGNAL_MASK 0x0f
+#define UART_PPS_OPTION_MASK 0xf0
+
+#define UART_PPS_DISABLED 0x00
+#define UART_PPS_CTS 0x01
+#define UART_PPS_DCD 0x02
+
+#define UART_PPS_INVERT_PULSE 0x10
+#define UART_PPS_NARROW_PULSE 0x20
+
+#endif /* _DEV_UART_PPSTYPES_H_ */
diff --git a/sys/dev/usb/serial/usb_serial.c b/sys/dev/usb/serial/usb_serial.c
index 499d5c1..5bc23b8 100644
--- a/sys/dev/usb/serial/usb_serial.c
+++ b/sys/dev/usb/serial/usb_serial.c
@@ -81,6 +81,8 @@ __FBSDID("$FreeBSD$");
#include <sys/cons.h>
#include <sys/kdb.h>
+#include <dev/uart/uart_ppstypes.h>
+
#include <dev/usb/usb.h>
#include <dev/usb/usbdi.h>
#include <dev/usb/usbdi_util.h>
@@ -99,7 +101,8 @@ static SYSCTL_NODE(_hw_usb, OID_AUTO, ucom, CTLFLAG_RW, 0, "USB ucom");
static int ucom_pps_mode;
SYSCTL_INT(_hw_usb_ucom, OID_AUTO, pps_mode, CTLFLAG_RWTUN,
- &ucom_pps_mode, 0, "pulse capturing mode - 0/1/2 - disabled/CTS/DCD");
+ &ucom_pps_mode, 0,
+ "pulse capture mode: 0/1/2=disabled/CTS/DCD; add 0x10 to invert");
#ifdef USB_DEBUG
static int ucom_debug = 0;
@@ -1074,10 +1077,12 @@ ucom_cfg_status_change(struct usb_proc_msg *_task)
(struct ucom_cfg_task *)_task;
struct ucom_softc *sc = task->sc;
struct tty *tp;
+ int onoff;
uint8_t new_msr;
uint8_t new_lsr;
uint8_t msr_delta;
uint8_t lsr_delta;
+ uint8_t pps_signal;
tp = sc->sc_tty;
@@ -1107,35 +1112,33 @@ ucom_cfg_status_change(struct usb_proc_msg *_task)
sc->sc_lsr = new_lsr;
/*
- * Time pulse counting support. Note that both CTS and DCD are
- * active-low signals. The status bit is high to indicate that
- * the signal on the line is low, which corresponds to a PPS
- * clear event.
+ * Time pulse counting support.
*/
- switch(ucom_pps_mode) {
- case 1:
- if ((sc->sc_pps.ppsparam.mode & PPS_CAPTUREBOTH) &&
- (msr_delta & SER_CTS)) {
- pps_capture(&sc->sc_pps);
- pps_event(&sc->sc_pps, (sc->sc_msr & SER_CTS) ?
- PPS_CAPTURECLEAR : PPS_CAPTUREASSERT);
- }
+ switch(ucom_pps_mode & UART_PPS_SIGNAL_MASK) {
+ case UART_PPS_CTS:
+ pps_signal = SER_CTS;
break;
- case 2:
- if ((sc->sc_pps.ppsparam.mode & PPS_CAPTUREBOTH) &&
- (msr_delta & SER_DCD)) {
- pps_capture(&sc->sc_pps);
- pps_event(&sc->sc_pps, (sc->sc_msr & SER_DCD) ?
- PPS_CAPTURECLEAR : PPS_CAPTUREASSERT);
- }
+ case UART_PPS_DCD:
+ pps_signal = SER_DCD;
break;
default:
+ pps_signal = 0;
break;
}
+ if ((sc->sc_pps.ppsparam.mode & PPS_CAPTUREBOTH) &&
+ (msr_delta & pps_signal)) {
+ pps_capture(&sc->sc_pps);
+ onoff = (sc->sc_msr & pps_signal) ? 1 : 0;
+ if (ucom_pps_mode & UART_PPS_INVERT_PULSE)
+ onoff = !onoff;
+ pps_event(&sc->sc_pps, onoff ? PPS_CAPTUREASSERT :
+ PPS_CAPTURECLEAR);
+ }
+
if (msr_delta & SER_DCD) {
- int onoff = (sc->sc_msr & SER_DCD) ? 1 : 0;
+ onoff = (sc->sc_msr & SER_DCD) ? 1 : 0;
DPRINTF("DCD changed to %d\n", onoff);
diff --git a/sys/fs/devfs/devfs_vnops.c b/sys/fs/devfs/devfs_vnops.c
index ba56e56..a45e07d 100644
--- a/sys/fs/devfs/devfs_vnops.c
+++ b/sys/fs/devfs/devfs_vnops.c
@@ -146,7 +146,7 @@ devfs_get_cdevpriv(void **datap)
}
int
-devfs_set_cdevpriv(void *priv, cdevpriv_dtr_t priv_dtr)
+devfs_set_cdevpriv(void *priv, d_priv_dtor_t *priv_dtr)
{
struct file *fp;
struct cdev_priv *cdp;
@@ -239,18 +239,18 @@ devfs_populate_vp(struct vnode *vp)
if (DEVFS_DMP_DROP(dmp)) {
sx_xunlock(&dmp->dm_lock);
devfs_unmount_final(dmp);
- return (EBADF);
+ return (ERESTART);
}
if ((vp->v_iflag & VI_DOOMED) != 0) {
sx_xunlock(&dmp->dm_lock);
- return (EBADF);
+ return (ERESTART);
}
de = vp->v_data;
KASSERT(de != NULL,
("devfs_populate_vp: vp->v_data == NULL but vnode not doomed"));
if ((de->de_flags & DE_DOOMED) != 0) {
sx_xunlock(&dmp->dm_lock);
- return (EBADF);
+ return (ERESTART);
}
return (0);
diff --git a/sys/fs/smbfs/smbfs_smb.c b/sys/fs/smbfs/smbfs_smb.c
index ada84c2..c5b8a68 100644
--- a/sys/fs/smbfs/smbfs_smb.c
+++ b/sys/fs/smbfs/smbfs_smb.c
@@ -333,18 +333,18 @@ smbfs_smb_flush(struct smbnode *np, struct smb_cred *scred)
}
int
-smbfs_smb_setfsize(struct smbnode *np, int newsize, struct smb_cred *scred)
+smbfs_smb_setfsize(struct smbnode *np, int64_t newsize, struct smb_cred *scred)
{
struct smb_share *ssp = np->n_mount->sm_share;
struct smb_rq *rqp;
struct mbchain *mbp;
int error;
- if (!smbfs_smb_seteof(np, (int64_t) newsize, scred)) {
+ if (!smbfs_smb_seteof(np, newsize, scred)) {
np->n_flag |= NFLUSHWIRE;
return (0);
}
-
+ /* XXX: We should use SMB_COM_WRITE_ANDX to support large offsets */
error = smb_rq_alloc(SSTOCP(ssp), SMB_COM_WRITE, scred, &rqp);
if (error)
return (error);
@@ -352,7 +352,7 @@ smbfs_smb_setfsize(struct smbnode *np, int newsize, struct smb_cred *scred)
smb_rq_wstart(rqp);
mb_put_mem(mbp, (caddr_t)&np->n_fid, 2, MB_MSYSTEM);
mb_put_uint16le(mbp, 0);
- mb_put_uint32le(mbp, newsize);
+ mb_put_uint32le(mbp, (uint32_t)newsize);
mb_put_uint16le(mbp, 0);
smb_rq_wend(rqp);
smb_rq_bstart(rqp);
diff --git a/sys/fs/smbfs/smbfs_subr.h b/sys/fs/smbfs/smbfs_subr.h
index d22df08..4ee143c 100644
--- a/sys/fs/smbfs/smbfs_subr.h
+++ b/sys/fs/smbfs/smbfs_subr.h
@@ -128,7 +128,8 @@ int smbfs_smb_lock(struct smbnode *np, int op, caddr_t id,
off_t start, off_t end, struct smb_cred *scred);
int smbfs_smb_statfs(struct smb_share *ssp, struct statfs *sbp,
struct smb_cred *scred);
-int smbfs_smb_setfsize(struct smbnode *np, int newsize, struct smb_cred *scred);
+int smbfs_smb_setfsize(struct smbnode *np, int64_t newsize,
+ struct smb_cred *scred);
int smbfs_smb_query_info(struct smbnode *np, const char *name, int len,
struct smbfattr *fap, struct smb_cred *scred);
diff --git a/sys/fs/smbfs/smbfs_vnops.c b/sys/fs/smbfs/smbfs_vnops.c
index 8ea1198..c78ceb2 100644
--- a/sys/fs/smbfs/smbfs_vnops.c
+++ b/sys/fs/smbfs/smbfs_vnops.c
@@ -358,7 +358,8 @@ smbfs_setattr(ap)
doclose = 1;
}
if (error == 0)
- error = smbfs_smb_setfsize(np, vap->va_size, scred);
+ error = smbfs_smb_setfsize(np,
+ (int64_t)vap->va_size, scred);
if (doclose)
smbfs_smb_close(ssp, np->n_fid, NULL, scred);
if (error) {
diff --git a/sys/geom/geom_disk.c b/sys/geom/geom_disk.c
index 1a879f7..5d7965e 100644
--- a/sys/geom/geom_disk.c
+++ b/sys/geom/geom_disk.c
@@ -581,6 +581,23 @@ g_disk_dumpconf(struct sbuf *sb, const char *indent, struct g_geom *gp, struct g
indent, dp->d_fwheads);
sbuf_printf(sb, "%s<fwsectors>%u</fwsectors>\n",
indent, dp->d_fwsectors);
+
+ /*
+ * "rotationrate" is a little complicated, because the value
+ * returned by the drive might not be the RPM; 0 and 1 are
+ * special cases, and there's also a valid range.
+ */
+ sbuf_printf(sb, "%s<rotationrate>", indent);
+ if (dp->d_rotation_rate == 0) /* Old drives don't */
+ sbuf_printf(sb, "unknown"); /* report RPM. */
+ else if (dp->d_rotation_rate == 1) /* Since 0 is used */
+ sbuf_printf(sb, "0"); /* above, SSDs use 1. */
+ else if ((dp->d_rotation_rate >= 0x041) &&
+ (dp->d_rotation_rate <= 0xfffe))
+ sbuf_printf(sb, "%u", dp->d_rotation_rate);
+ else
+ sbuf_printf(sb, "invalid");
+ sbuf_printf(sb, "</rotationrate>\n");
if (dp->d_getattr != NULL) {
buf = g_malloc(DISK_IDENT_SIZE, M_WAITOK);
bp = g_alloc_bio();
diff --git a/sys/geom/multipath/g_multipath.c b/sys/geom/multipath/g_multipath.c
index 0953d18..6644532 100644
--- a/sys/geom/multipath/g_multipath.c
+++ b/sys/geom/multipath/g_multipath.c
@@ -107,8 +107,9 @@ struct g_class g_multipath_class = {
#define MP_NEW 0x00000004
#define MP_POSTED 0x00000008
#define MP_BAD (MP_FAIL | MP_LOST | MP_NEW)
-#define MP_IDLE 0x00000010
-#define MP_IDLE_MASK 0xfffffff0
+#define MP_WITHER 0x00000010
+#define MP_IDLE 0x00000020
+#define MP_IDLE_MASK 0xffffffe0
static int
g_multipath_good(struct g_geom *gp)
@@ -204,6 +205,7 @@ g_mpd(void *arg, int flags __unused)
g_access(cp, -cp->acr, -cp->acw, -cp->ace);
if (w > 0 && cp->provider != NULL &&
(cp->provider->geom->flags & G_GEOM_WITHER) == 0) {
+ cp->index |= MP_WITHER;
g_post_event(g_mpd, cp, M_WAITOK, NULL);
return;
}
@@ -467,23 +469,37 @@ g_multipath_access(struct g_provider *pp, int dr, int dw, int de)
gp = pp->geom;
+ /* Error used if we have no valid consumers. */
+ error = ENXIO;
+
LIST_FOREACH(cp, &gp->consumer, consumer) {
+ if (cp->index & MP_WITHER)
+ continue;
+
error = g_access(cp, dr, dw, de);
if (error) {
badcp = cp;
goto fail;
}
}
+
+ if (error != 0)
+ return (error);
+
sc = gp->softc;
sc->sc_opened += dr + dw + de;
if (sc->sc_stopping && sc->sc_opened == 0)
g_multipath_destroy(gp);
+
return (0);
fail:
LIST_FOREACH(cp, &gp->consumer, consumer) {
if (cp == badcp)
break;
+ if (cp->index & MP_WITHER)
+ continue;
+
(void) g_access(cp, -dr, -dw, -de);
}
return (error);
diff --git a/sys/i386/i386/elf_machdep.c b/sys/i386/i386/elf_machdep.c
index 81d6e35..29a8885 100644
--- a/sys/i386/i386/elf_machdep.c
+++ b/sys/i386/i386/elf_machdep.c
@@ -89,6 +89,7 @@ struct sysentvec elf32_freebsd_sysvec = {
.sv_shared_page_len = PAGE_SIZE,
.sv_schedtail = NULL,
.sv_thread_detach = NULL,
+ .sv_trap = NULL,
};
INIT_SYSENTVEC(elf32_sysvec, &elf32_freebsd_sysvec);
diff --git a/sys/i386/i386/machdep.c b/sys/i386/i386/machdep.c
index 36aeca5..f55900c 100644
--- a/sys/i386/i386/machdep.c
+++ b/sys/i386/i386/machdep.c
@@ -3190,10 +3190,11 @@ init386(first)
} else {
metadata_missing = 1;
}
- if (envmode == 1)
- kern_envp = static_env;
- else if (bootinfo.bi_envp)
- kern_envp = (caddr_t)bootinfo.bi_envp + KERNBASE;
+
+ if (bootinfo.bi_envp)
+ init_static_kenv((caddr_t)bootinfo.bi_envp + KERNBASE, 0);
+ else
+ init_static_kenv(NULL, 0);
/* Init basic tunables, hz etc */
init_param1();
diff --git a/sys/i386/ibcs2/ibcs2_sysvec.c b/sys/i386/ibcs2/ibcs2_sysvec.c
index 16507ee..372e5ea 100644
--- a/sys/i386/ibcs2/ibcs2_sysvec.c
+++ b/sys/i386/ibcs2/ibcs2_sysvec.c
@@ -90,6 +90,7 @@ struct sysentvec ibcs2_svr3_sysvec = {
.sv_syscallnames = NULL,
.sv_schedtail = NULL,
.sv_thread_detach = NULL,
+ .sv_trap = NULL,
};
static int
diff --git a/sys/i386/include/metadata.h b/sys/i386/include/metadata.h
index 73c9207..98d0272 100644
--- a/sys/i386/include/metadata.h
+++ b/sys/i386/include/metadata.h
@@ -1,36 +1,6 @@
/*-
- * Copyright (c) 2003 Peter Wemm <peter@FreeBSD.org>
- * 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 AND CONTRIBUTORS ``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 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.
- *
- * $FreeBSD$
+ * This file is in the public domain.
*/
+/* $FreeBSD$ */
-#ifndef _MACHINE_METADATA_H_
-#define _MACHINE_METADATA_H_
-
-#define MODINFOMD_SMAP 0x1001
-#define MODINFOMD_SMAP_XATTR 0x1002
-#define MODINFOMD_DTBP 0x1003
-
-#endif /* !_MACHINE_METADATA_H_ */
+#include <x86/metadata.h>
diff --git a/sys/i386/include/pcb.h b/sys/i386/include/pcb.h
index 4bfd603..558565b 100644
--- a/sys/i386/include/pcb.h
+++ b/sys/i386/include/pcb.h
@@ -44,13 +44,17 @@
#endif
#include <machine/npx.h>
+/*
+ * NB: The fields marked with (*) are used by kernel debuggers. Their
+ * ABI should be preserved.
+ */
struct pcb {
- int pcb_edi;
- int pcb_esi;
- int pcb_ebp;
- int pcb_esp;
- int pcb_ebx;
- int pcb_eip;
+ int pcb_edi; /* (*) */
+ int pcb_esi; /* (*) */
+ int pcb_ebp; /* (*) */
+ int pcb_esp; /* (*) */
+ int pcb_ebx; /* (*) */
+ int pcb_eip; /* (*) */
struct segment_descriptor pcb_fsd;
struct segment_descriptor pcb_gsd;
int pcb_ds;
diff --git a/sys/i386/linux/linux_sysvec.c b/sys/i386/linux/linux_sysvec.c
index 7c980ce..df5441b 100644
--- a/sys/i386/linux/linux_sysvec.c
+++ b/sys/i386/linux/linux_sysvec.c
@@ -988,6 +988,7 @@ struct sysentvec linux_sysvec = {
.sv_shared_page_len = PAGE_SIZE,
.sv_schedtail = linux_schedtail,
.sv_thread_detach = linux_thread_detach,
+ .sv_trap = NULL,
};
INIT_SYSENTVEC(aout_sysvec, &linux_sysvec);
@@ -1027,6 +1028,7 @@ struct sysentvec elf_linux_sysvec = {
.sv_shared_page_len = PAGE_SIZE,
.sv_schedtail = linux_schedtail,
.sv_thread_detach = linux_thread_detach,
+ .sv_trap = NULL,
};
static void
diff --git a/sys/kern/imgact_aout.c b/sys/kern/imgact_aout.c
index edd5f5f..553dc04 100644
--- a/sys/kern/imgact_aout.c
+++ b/sys/kern/imgact_aout.c
@@ -100,6 +100,7 @@ struct sysentvec aout_sysvec = {
.sv_syscallnames = syscallnames,
.sv_schedtail = NULL,
.sv_thread_detach = NULL,
+ .sv_trap = NULL,
};
#elif defined(__amd64__)
diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c
index 6cb5017..201680a 100644
--- a/sys/kern/init_main.c
+++ b/sys/kern/init_main.c
@@ -415,6 +415,7 @@ struct sysentvec null_sysvec = {
.sv_syscallnames = NULL,
.sv_schedtail = NULL,
.sv_thread_detach = NULL,
+ .sv_trap = NULL,
};
/*
diff --git a/sys/kern/kern_environment.c b/sys/kern/kern_environment.c
index ff453cb..05c4f62 100644
--- a/sys/kern/kern_environment.c
+++ b/sys/kern/kern_environment.c
@@ -210,12 +210,44 @@ done:
return (error);
}
+/*
+ * Populate the initial kernel environment.
+ *
+ * This is called very early in MD startup, either to provide a copy of the
+ * environment obtained from a boot loader, or to provide an empty buffer into
+ * which MD code can store an initial environment using kern_setenv() calls.
+ *
+ * If the global envmode is 1, the environment is initialized from the global
+ * static_env[], regardless of the arguments passed. This implements the env
+ * keyword described in config(5). In this case env_pos is set to env_len,
+ * causing kern_setenv() to return -1 (if len > 0) or panic (if len == 0) until
+ * the dynamic environment is available. The envmode and static_env variables
+ * are defined in env.c which is generated by config(8).
+ *
+ * If len is non-zero, the caller is providing an empty buffer. The caller will
+ * subsequently use kern_setenv() to add up to len bytes of initial environment
+ * before the dynamic environment is available.
+ *
+ * If len is zero, the caller is providing a pre-loaded buffer containing
+ * environment strings. Additional strings cannot be added until the dynamic
+ * environment is available. The memory pointed to must remain stable at least
+ * until sysinit runs init_dynamic_kenv(). If no initial environment is
+ * available from the boot loader, passing a NULL pointer allows the static_env
+ * to be installed if it is configured.
+ */
void
init_static_kenv(char *buf, size_t len)
{
- kern_envp = buf;
- env_len = len;
- env_pos = 0;
+
+ if (envmode == 1) {
+ kern_envp = static_env;
+ env_len = len;
+ env_pos = len;
+ } else {
+ kern_envp = buf;
+ env_len = len;
+ env_pos = 0;
+ }
}
/*
diff --git a/sys/kern/kern_linker.c b/sys/kern/kern_linker.c
index e379f5f..78eab87 100644
--- a/sys/kern/kern_linker.c
+++ b/sys/kern/kern_linker.c
@@ -71,6 +71,12 @@ SYSCTL_INT(_debug, OID_AUTO, kld_debug, CTLFLAG_RW | CTLFLAG_TUN,
TUNABLE_INT("debug.kld_debug", &kld_debug);
#endif
+/* These variables are used by kernel debuggers to enumerate loaded files. */
+const int kld_off_address = offsetof(struct linker_file, address);
+const int kld_off_filename = offsetof(struct linker_file, filename);
+const int kld_off_pathname = offsetof(struct linker_file, pathname);
+const int kld_off_next = offsetof(struct linker_file, link.tqe_next);
+
/*
* static char *linker_search_path(const char *name, struct mod_depend
* *verinfo);
diff --git a/sys/kern/kern_mib.c b/sys/kern/kern_mib.c
index 0307791..ccecbc9 100644
--- a/sys/kern/kern_mib.c
+++ b/sys/kern/kern_mib.c
@@ -574,6 +574,11 @@ SYSCTL_INT(_debug_sizeof, OID_AUTO, buf, CTLFLAG_RD,
SYSCTL_INT(_debug_sizeof, OID_AUTO, kinfo_proc, CTLFLAG_RD,
SYSCTL_NULL_INT_PTR, sizeof(struct kinfo_proc), "sizeof(struct kinfo_proc)");
+/* Used by kernel debuggers. */
+const int pcb_size = sizeof(struct pcb);
+SYSCTL_INT(_debug_sizeof, OID_AUTO, pcb, CTLFLAG_RD,
+ SYSCTL_NULL_INT_PTR, sizeof(struct pcb), "sizeof(struct pcb)");
+
/* XXX compatibility, remove for 6.0 */
#include <sys/imgact.h>
#include <sys/imgact_elf.h>
diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c
index c9b7ca3..6b60840 100644
--- a/sys/kern/kern_proc.c
+++ b/sys/kern/kern_proc.c
@@ -139,6 +139,21 @@ struct sx proctree_lock;
struct mtx ppeers_lock;
uma_zone_t proc_zone;
+/*
+ * The offset of various fields in struct proc and struct thread.
+ * These are used by kernel debuggers to enumerate kernel threads and
+ * processes.
+ */
+const int proc_off_p_pid = offsetof(struct proc, p_pid);
+const int proc_off_p_comm = offsetof(struct proc, p_comm);
+const int proc_off_p_list = offsetof(struct proc, p_list);
+const int proc_off_p_threads = offsetof(struct proc, p_threads);
+const int thread_off_td_tid = offsetof(struct thread, td_tid);
+const int thread_off_td_name = offsetof(struct thread, td_name);
+const int thread_off_td_oncpu = offsetof(struct thread, td_oncpu);
+const int thread_off_td_pcb = offsetof(struct thread, td_pcb);
+const int thread_off_td_plist = offsetof(struct thread, td_plist);
+
int kstack_pages = KSTACK_PAGES;
SYSCTL_INT(_kern, OID_AUTO, kstack_pages, CTLFLAG_RD, &kstack_pages, 0,
"Kernel stack size in pages");
diff --git a/sys/kern/kern_thread.c b/sys/kern/kern_thread.c
index 96f68609ca..c85813b 100644
--- a/sys/kern/kern_thread.c
+++ b/sys/kern/kern_thread.c
@@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$");
#include <sys/sched.h>
#include <sys/sleepqueue.h>
#include <sys/selinfo.h>
+#include <sys/syscallsubr.h>
#include <sys/sysent.h>
#include <sys/turnstile.h>
#include <sys/ktr.h>
@@ -885,7 +886,6 @@ thread_suspend_check(int return_instead)
*/
if ((p->p_flag & P_SINGLE_EXIT) && (p->p_singlethread != td)) {
PROC_UNLOCK(p);
- tidhash_remove(td);
/*
* Allow Linux emulation layer to do some work
@@ -893,13 +893,8 @@ thread_suspend_check(int return_instead)
*/
if (__predict_false(p->p_sysent->sv_thread_detach != NULL))
(p->p_sysent->sv_thread_detach)(td);
-
- PROC_LOCK(p);
- tdsigcleanup(td);
- umtx_thread_exit(td);
- PROC_SLOCK(p);
- thread_stopped(p);
- thread_exit();
+ kern_thr_exit(td);
+ panic("stopped thread did not exit");
}
PROC_SLOCK(p);
diff --git a/sys/kern/makesyscalls.sh b/sys/kern/makesyscalls.sh
index 8be4896..1d3af65 100644
--- a/sys/kern/makesyscalls.sh
+++ b/sys/kern/makesyscalls.sh
@@ -410,6 +410,10 @@ s/\$//g
printf("\t\tuarg[%d] = (intptr_t) p->%s; /* %s */\n", \
i - 1, \
argname[i], arg) > systrace
+ else if (arg == "union l_semun")
+ printf("\t\tuarg[%d] = p->%s.buf; /* %s */\n", \
+ i - 1, \
+ argname[i], arg) > systrace
else if (substr(arg, 1, 1) == "u" || arg == "size_t")
printf("\t\tuarg[%d] = p->%s; /* %s */\n", \
i - 1, \
diff --git a/sys/kern/subr_busdma_bufalloc.c b/sys/kern/subr_busdma_bufalloc.c
index b0b1ba8..c8980e1 100644
--- a/sys/kern/subr_busdma_bufalloc.c
+++ b/sys/kern/subr_busdma_bufalloc.c
@@ -94,8 +94,8 @@ busdma_bufalloc_create(const char *name, bus_size_t minimum_alignment,
for (i = 0, bz = ba->buf_zones, cursize = ba->min_size;
i < nitems(ba->buf_zones) && cursize <= MAX_ZONE_BUFSIZE;
++i, ++bz, cursize <<= 1) {
- snprintf(bz->name, sizeof(bz->name), "dma %.10s %lu",
- name, cursize);
+ snprintf(bz->name, sizeof(bz->name), "dma %.10s %ju",
+ name, (uintmax_t)cursize);
bz->size = cursize;
bz->umazone = uma_zcreate(bz->name, bz->size,
NULL, NULL, NULL, NULL, bz->size - 1, zcreate_flags);
diff --git a/sys/mips/include/elf.h b/sys/mips/include/elf.h
index c1e792b..a33c090 100644
--- a/sys/mips/include/elf.h
+++ b/sys/mips/include/elf.h
@@ -238,39 +238,10 @@ __ElfType(Auxinfo);
#define R_MIPS_COPY 126
#define R_MIPS_JUMP_SLOT 127
-/* mips dynamic tags */
-
-#define DT_MIPS_RLD_VERSION 0x70000001
-#define DT_MIPS_TIME_STAMP 0x70000002
-#define DT_MIPS_ICHECKSUM 0x70000003
-#define DT_MIPS_IVERSION 0x70000004
-#define DT_MIPS_FLAGS 0x70000005
-#define DT_MIPS_BASE_ADDRESS 0x70000006
-#define DT_MIPS_CONFLICT 0x70000008
-#define DT_MIPS_LIBLIST 0x70000009
-#define DT_MIPS_CONFLICTNO 0x7000000b
-#define DT_MIPS_LOCAL_GOTNO 0x7000000a /* number of local got ents */
-#define DT_MIPS_LIBLISTNO 0x70000010
-#define DT_MIPS_SYMTABNO 0x70000011 /* number of .dynsym entries */
-#define DT_MIPS_UNREFEXTNO 0x70000012
-#define DT_MIPS_GOTSYM 0x70000013 /* first dynamic sym in got */
-#define DT_MIPS_HIPAGENO 0x70000014
-#define DT_MIPS_RLD_MAP 0x70000016 /* address of loader map */
-#define DT_MIPS_PLTGOT 0x70000032
-#define DT_MIPS_RWPLT 0x70000034
-
/*
* ELF Flags
*/
-#define EF_MIPS_PIC 0x00000002 /* Contains PIC code */
-#define EF_MIPS_CPIC 0x00000004 /* STD PIC calling sequence */
-#define EF_MIPS_ABI2 0x00000020 /* N32 */
-
-#define EF_MIPS_ARCH_ASE 0x0f000000 /* Architectural extensions */
-#define EF_MIPS_ARCH_MDMX 0x08000000 /* MDMX multimedia extension */
-#define EF_MIPS_ARCH_M16 0x04000000 /* MIPS-16 ISA extensions */
-#define EF_MIPS_ARCH 0xf0000000 /* Architecture field */
#define EF_MIPS_ARCH_1 0x00000000 /* -mips1 code */
#define EF_MIPS_ARCH_2 0x10000000 /* -mips2 code */
#define EF_MIPS_ARCH_3 0x20000000 /* -mips3 code */
diff --git a/sys/mips/mips/elf_machdep.c b/sys/mips/mips/elf_machdep.c
index 626b5f8..db50a73 100644
--- a/sys/mips/mips/elf_machdep.c
+++ b/sys/mips/mips/elf_machdep.c
@@ -84,6 +84,7 @@ struct sysentvec elf64_freebsd_sysvec = {
.sv_syscallnames = syscallnames,
.sv_schedtail = NULL,
.sv_thread_detach = NULL,
+ .sv_trap = NULL,
};
static Elf64_Brandinfo freebsd_brand_info = {
@@ -141,6 +142,7 @@ struct sysentvec elf32_freebsd_sysvec = {
.sv_syscallnames = syscallnames,
.sv_schedtail = NULL,
.sv_thread_detach = NULL,
+ .sv_trap = NULL,
};
static Elf32_Brandinfo freebsd_brand_info = {
diff --git a/sys/mips/mips/freebsd32_machdep.c b/sys/mips/mips/freebsd32_machdep.c
index 5303420..87fda42 100644
--- a/sys/mips/mips/freebsd32_machdep.c
+++ b/sys/mips/mips/freebsd32_machdep.c
@@ -107,6 +107,7 @@ struct sysentvec elf32_freebsd_sysvec = {
.sv_syscallnames = freebsd32_syscallnames,
.sv_schedtail = NULL,
.sv_thread_detach = NULL,
+ .sv_trap = NULL,
};
INIT_SYSENTVEC(elf32_sysvec, &elf32_freebsd_sysvec);
diff --git a/sys/modules/dtrace/Makefile b/sys/modules/dtrace/Makefile
index 1b12371..9f3c993 100644
--- a/sys/modules/dtrace/Makefile
+++ b/sys/modules/dtrace/Makefile
@@ -16,7 +16,10 @@ SUBDIR= dtmalloc \
systrace
.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386"
-SUBDIR+= fasttrap fbt systrace_linux32
+SUBDIR+= fasttrap fbt systrace_linux
+.endif
+.if ${MACHINE_CPUARCH} == "amd64"
+SUBDIR+= systrace_linux32
.endif
.if ${MACHINE_CPUARCH} == "powerpc"
SUBDIR+= fbt fasttrap
diff --git a/sys/modules/dtrace/systrace_linux/Makefile b/sys/modules/dtrace/systrace_linux/Makefile
new file mode 100644
index 0000000..1cf5e31
--- /dev/null
+++ b/sys/modules/dtrace/systrace_linux/Makefile
@@ -0,0 +1,18 @@
+# $FreeBSD$
+
+SYSDIR?= ${.CURDIR}/../../..
+
+.PATH: ${SYSDIR}/cddl/dev/systrace
+
+KMOD= systrace_linux
+
+SRCS= systrace.c
+SRCS+= vnode_if.h
+
+CFLAGS+= -I${SYSDIR}/cddl/compat/opensolaris \
+ -I${SYSDIR}/cddl/contrib/opensolaris/uts/common \
+ -I${SYSDIR} -DLINUX_SYSTRACE
+
+.include <bsd.kmod.mk>
+
+CFLAGS+= -include ${SYSDIR}/cddl/compat/opensolaris/sys/debug_compat.h
diff --git a/sys/modules/dtrace/systrace_linux32/Makefile b/sys/modules/dtrace/systrace_linux32/Makefile
index a2bfc81..3183482 100644
--- a/sys/modules/dtrace/systrace_linux32/Makefile
+++ b/sys/modules/dtrace/systrace_linux32/Makefile
@@ -2,18 +2,14 @@
.PATH: ${.CURDIR}/../../../cddl/dev/systrace
-.if ${MACHINE} == "amd64"
KMOD= systrace_linux32
-.else
-KMOD= systrace_linux
-.endif
SRCS= systrace.c
SRCS+= vnode_if.h
CFLAGS+= -I${.CURDIR}/../../../cddl/compat/opensolaris \
-I${.CURDIR}/../../../cddl/contrib/opensolaris/uts/common \
- -I${.CURDIR}/../../.. -DLINUX_SYSTRACE
+ -I${.CURDIR}/../../.. -DLINUX32_SYSTRACE
.include <bsd.kmod.mk>
diff --git a/sys/modules/sfxge/Makefile b/sys/modules/sfxge/Makefile
index c444152..ba4108b 100644
--- a/sys/modules/sfxge/Makefile
+++ b/sys/modules/sfxge/Makefile
@@ -16,7 +16,7 @@ SRCS+= sfxge_port.c sfxge_rx.c sfxge_tx.c
SRCS+= sfxge.h sfxge_rx.h sfxge_tx.h sfxge_version.h
.PATH: ${.CURDIR}/../../dev/sfxge/common
-SRCS+= efx_bootcfg.c efx_crc32.c efx_ev.c efx_intr.c efx_mac.c
+SRCS+= efx_bootcfg.c efx_crc32.c efx_ev.c efx_intr.c efx_lic.c efx_mac.c
SRCS+= efx_mcdi.c efx_mon.c efx_nic.c
SRCS+= efx_nvram.c efx_phy.c efx_port.c efx_rx.c efx_sram.c efx_tx.c
SRCS+= efx_vpd.c efx_wol.c efx_filter.c efx_hash.c
diff --git a/sys/net/bpf.c b/sys/net/bpf.c
index 914dad6..15ab5aa 100644
--- a/sys/net/bpf.c
+++ b/sys/net/bpf.c
@@ -2500,7 +2500,7 @@ bpfattach2(struct ifnet *ifp, u_int dlt, u_int hdrlen, struct bpf_if **driverp)
bp->bif_hdrlen = hdrlen;
- if (bootverbose)
+ if (bootverbose && IS_DEFAULT_VNET(curvnet))
if_printf(ifp, "bpf attached\n");
}
diff --git a/sys/net/if.c b/sys/net/if.c
index efaece7..288d944 100644
--- a/sys/net/if.c
+++ b/sys/net/if.c
@@ -176,7 +176,7 @@ static int if_getgroup(struct ifgroupreq *, struct ifnet *);
static int if_getgroupmembers(struct ifgroupreq *);
static void if_delgroups(struct ifnet *);
static void if_attach_internal(struct ifnet *, int, struct if_clone *);
-static void if_detach_internal(struct ifnet *, int, struct if_clone **);
+static int if_detach_internal(struct ifnet *, int, struct if_clone **);
#ifdef INET6
/*
@@ -894,7 +894,7 @@ if_detach(struct ifnet *ifp)
CURVNET_RESTORE();
}
-static void
+static int
if_detach_internal(struct ifnet *ifp, int vmove, struct if_clone **ifcp)
{
struct ifaddr *ifa;
@@ -917,11 +917,19 @@ if_detach_internal(struct ifnet *ifp, int vmove, struct if_clone **ifcp)
#endif
IFNET_WUNLOCK();
if (!found) {
+ /*
+ * While we would want to panic here, we cannot
+ * guarantee that the interface is indeed still on
+ * the list given we don't hold locks all the way.
+ */
+ return (ENOENT);
+#if 0
if (vmove)
panic("%s: ifp=%p not on the ifnet tailq %p",
__func__, ifp, &V_ifnet);
else
return; /* XXX this should panic as well? */
+#endif
}
/* Check if this is a cloned interface or not. */
@@ -1019,6 +1027,8 @@ if_detach_internal(struct ifnet *ifp, int vmove, struct if_clone **ifcp)
(*dp->dom_ifdetach)(ifp,
ifp->if_afdata[dp->dom_family]);
}
+
+ return (0);
}
#ifdef VIMAGE
@@ -1034,12 +1044,16 @@ if_vmove(struct ifnet *ifp, struct vnet *new_vnet)
{
u_short idx;
struct if_clone *ifc;
+ int rc;
/*
* Detach from current vnet, but preserve LLADDR info, do not
* mark as dead etc. so that the ifnet can be reattached later.
+ * If we cannot find it, we lost the race to someone else.
*/
- if_detach_internal(ifp, 1, &ifc);
+ rc = if_detach_internal(ifp, 1, &ifc);
+ if (rc != 0)
+ return;
/*
* Unlink the ifnet from ifindex_table[] in current vnet, and shrink
diff --git a/sys/net/if_llatbl.c b/sys/net/if_llatbl.c
index 84ea6c6..11e415d 100644
--- a/sys/net/if_llatbl.c
+++ b/sys/net/if_llatbl.c
@@ -62,11 +62,10 @@ __FBSDID("$FreeBSD$");
MALLOC_DEFINE(M_LLTABLE, "lltable", "link level address tables");
-static VNET_DEFINE(SLIST_HEAD(, lltable), lltables);
+static VNET_DEFINE(SLIST_HEAD(, lltable), lltables) =
+ SLIST_HEAD_INITIALIZER(lltables);
#define V_lltables VNET(lltables)
-static void vnet_lltable_init(void);
-
struct rwlock lltable_rwlock;
RW_SYSINIT(lltable_rwlock, &lltable_rwlock, "lltable_rwlock");
@@ -367,15 +366,6 @@ lla_rt_output(struct rt_msghdr *rtm, struct rt_addrinfo *info)
return (error);
}
-static void
-vnet_lltable_init()
-{
-
- SLIST_INIT(&V_lltables);
-}
-VNET_SYSINIT(vnet_lltable_init, SI_SUB_PSEUDO, SI_ORDER_FIRST,
- vnet_lltable_init, NULL);
-
#ifdef DDB
struct llentry_sa {
struct llentry base;
diff --git a/sys/net/sff8436.h b/sys/net/sff8436.h
index 97abe10..3399cce 100644
--- a/sys/net/sff8436.h
+++ b/sys/net/sff8436.h
@@ -131,7 +131,7 @@ enum {
SFF_8436_CONNECTOR = 130, /* Connector type (Table 32) */
SFF_8436_TRANS_START = 131, /* Electric or Optical Compatibility
* (Table 33) */
- SFF_8436_CODE_E1040G = 131, /* 10/40G Ethernet Compliance Code */
+ SFF_8436_CODE_E1040100G = 131, /* 10/40/100G Ethernet Compliance Code */
SFF_8436_CODE_SONET = 132, /* SONET Compliance codes */
SFF_8436_CODE_SATA = 133, /* SAS/SATA compliance codes */
SFF_8436_CODE_E1G = 134, /* Gigabit Ethernet Compliant codes */
diff --git a/sys/netinet/sctp.h b/sys/netinet/sctp.h
index 8a033d8..784c1d4 100644
--- a/sys/netinet/sctp.h
+++ b/sys/netinet/sctp.h
@@ -388,33 +388,32 @@ struct sctp_error_cause {
} SCTP_PACKED;
struct sctp_error_invalid_stream {
- struct sctp_error_cause cause; /* code=SCTP_ERROR_INVALID_STREAM */
+ struct sctp_error_cause cause; /* code=SCTP_CAUSE_INVALID_STREAM */
uint16_t stream_id; /* stream id of the DATA in error */
uint16_t reserved;
} SCTP_PACKED;
struct sctp_error_missing_param {
- struct sctp_error_cause cause; /* code=SCTP_ERROR_MISSING_PARAM */
+ struct sctp_error_cause cause; /* code=SCTP_CAUSE_MISSING_PARAM */
uint32_t num_missing_params; /* number of missing parameters */
- /* uint16_t param_type's follow */
+ uint16_t type[];
} SCTP_PACKED;
struct sctp_error_stale_cookie {
- struct sctp_error_cause cause; /* code=SCTP_ERROR_STALE_COOKIE */
+ struct sctp_error_cause cause; /* code=SCTP_CAUSE_STALE_COOKIE */
uint32_t stale_time; /* time in usec of staleness */
} SCTP_PACKED;
struct sctp_error_out_of_resource {
- struct sctp_error_cause cause; /* code=SCTP_ERROR_OUT_OF_RESOURCES */
+ struct sctp_error_cause cause; /* code=SCTP_CAUSE_OUT_OF_RESOURCES */
} SCTP_PACKED;
struct sctp_error_unresolv_addr {
- struct sctp_error_cause cause; /* code=SCTP_ERROR_UNRESOLVABLE_ADDR */
-
+ struct sctp_error_cause cause; /* code=SCTP_CAUSE_UNRESOLVABLE_ADDR */
} SCTP_PACKED;
struct sctp_error_unrecognized_chunk {
- struct sctp_error_cause cause; /* code=SCTP_ERROR_UNRECOG_CHUNK */
+ struct sctp_error_cause cause; /* code=SCTP_CAUSE_UNRECOG_CHUNK */
struct sctp_chunkhdr ch;/* header from chunk in error */
} SCTP_PACKED;
@@ -423,6 +422,11 @@ struct sctp_error_no_user_data {
uint32_t tsn; /* TSN of the empty data chunk */
} SCTP_PACKED;
+struct sctp_error_auth_invalid_hmac {
+ struct sctp_error_cause cause; /* code=SCTP_CAUSE_UNSUPPORTED_HMACID */
+ uint16_t hmac_id;
+} SCTP_PACKED;
+
/*
* Main SCTP chunk types we place these here so natd and f/w's in user land
* can find them.
diff --git a/sys/netinet/sctp_asconf.c b/sys/netinet/sctp_asconf.c
index a64e7f9..540cc65 100644
--- a/sys/netinet/sctp_asconf.c
+++ b/sys/netinet/sctp_asconf.c
@@ -1680,8 +1680,14 @@ sctp_handle_asconf_ack(struct mbuf *m, int offset,
* abort the asoc, since someone probably just hijacked us...
*/
if (serial_num == (asoc->asconf_seq_out + 1)) {
+ struct mbuf *op_err;
+ char msg[SCTP_DIAG_INFO_LEN];
+
SCTPDBG(SCTP_DEBUG_ASCONF1, "handle_asconf_ack: got unexpected next serial number! Aborting asoc!\n");
- sctp_abort_an_association(stcb->sctp_ep, stcb, NULL, SCTP_SO_NOT_LOCKED);
+ snprintf(msg, sizeof(msg), "Never sent serial number %8.8x",
+ serial_num);
+ op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg);
+ sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED);
*abort_no_unlock = 1;
return;
}
diff --git a/sys/netinet/sctp_auth.c b/sys/netinet/sctp_auth.c
index 7c2e194..07dbf8b 100644
--- a/sys/netinet/sctp_auth.c
+++ b/sys/netinet/sctp_auth.c
@@ -558,7 +558,7 @@ sctp_auth_key_acquire(struct sctp_tcb *stcb, uint16_t key_id)
atomic_add_int(&skey->refcount, 1);
SCTPDBG(SCTP_DEBUG_AUTH2,
"%s: stcb %p key %u refcount acquire to %d\n",
- __FUNCTION__, (void *)stcb, key_id, skey->refcount);
+ __func__, (void *)stcb, key_id, skey->refcount);
}
}
@@ -578,7 +578,7 @@ sctp_auth_key_release(struct sctp_tcb *stcb, uint16_t key_id, int so_locked
if (skey) {
SCTPDBG(SCTP_DEBUG_AUTH2,
"%s: stcb %p key %u refcount release to %d\n",
- __FUNCTION__, (void *)stcb, key_id, skey->refcount);
+ __func__, (void *)stcb, key_id, skey->refcount);
/* see if a notification should be generated */
if ((skey->refcount <= 2) && (skey->deactivated)) {
@@ -587,7 +587,7 @@ sctp_auth_key_release(struct sctp_tcb *stcb, uint16_t key_id, int so_locked
key_id, 0, so_locked);
SCTPDBG(SCTP_DEBUG_AUTH2,
"%s: stcb %p key %u no longer used, %d\n",
- __FUNCTION__, (void *)stcb, key_id, skey->refcount);
+ __func__, (void *)stcb, key_id, skey->refcount);
}
sctp_free_sharedkey(skey);
}
@@ -1651,8 +1651,8 @@ sctp_handle_auth(struct sctp_tcb *stcb, struct sctp_auth_chunk *auth,
/* is the indicated HMAC supported? */
if (!sctp_auth_is_supported_hmac(stcb->asoc.local_hmacs, hmac_id)) {
- struct mbuf *m_err;
- struct sctp_auth_invalid_hmac *err;
+ struct mbuf *op_err;
+ struct sctp_error_auth_invalid_hmac *cause;
SCTP_STAT_INCR(sctps_recvivalhmacid);
SCTPDBG(SCTP_DEBUG_AUTH1,
@@ -1662,20 +1662,19 @@ sctp_handle_auth(struct sctp_tcb *stcb, struct sctp_auth_chunk *auth,
* report this in an Error Chunk: Unsupported HMAC
* Identifier
*/
- m_err = sctp_get_mbuf_for_msg(sizeof(*err), 0, M_NOWAIT,
- 1, MT_HEADER);
- if (m_err != NULL) {
+ op_err = sctp_get_mbuf_for_msg(sizeof(struct sctp_error_auth_invalid_hmac),
+ 0, M_NOWAIT, 1, MT_HEADER);
+ if (op_err != NULL) {
/* pre-reserve some space */
- SCTP_BUF_RESV_UF(m_err, sizeof(struct sctp_chunkhdr));
+ SCTP_BUF_RESV_UF(op_err, sizeof(struct sctp_chunkhdr));
/* fill in the error */
- err = mtod(m_err, struct sctp_auth_invalid_hmac *);
- bzero(err, sizeof(*err));
- err->ph.param_type = htons(SCTP_CAUSE_UNSUPPORTED_HMACID);
- err->ph.param_length = htons(sizeof(*err));
- err->hmac_id = ntohs(hmac_id);
- SCTP_BUF_LEN(m_err) = sizeof(*err);
+ cause = mtod(op_err, struct sctp_error_auth_invalid_hmac *);
+ cause->cause.code = htons(SCTP_CAUSE_UNSUPPORTED_HMACID);
+ cause->cause.length = htons(sizeof(struct sctp_error_auth_invalid_hmac));
+ cause->hmac_id = ntohs(hmac_id);
+ SCTP_BUF_LEN(op_err) = sizeof(struct sctp_error_auth_invalid_hmac);
/* queue it */
- sctp_queue_op_err(stcb, m_err);
+ sctp_queue_op_err(stcb, op_err);
}
return (-1);
}
diff --git a/sys/netinet/sctp_constants.h b/sys/netinet/sctp_constants.h
index d90bd25..a26bc5b 100644
--- a/sys/netinet/sctp_constants.h
+++ b/sys/netinet/sctp_constants.h
@@ -66,6 +66,8 @@ __FBSDID("$FreeBSD$");
*/
#define SCTP_LARGEST_INIT_ACCEPTED (65535 - 2048)
+/* Largest length of a chunk */
+#define SCTP_MAX_CHUNK_LENGTH 0xffff
/* Number of addresses where we just skip the counting */
#define SCTP_COUNT_LIMIT 40
@@ -458,7 +460,7 @@ __FBSDID("$FreeBSD$");
/*
- * SCTP states for internal state machine XXX (should match "user" values)
+ * SCTP states for internal state machine
*/
#define SCTP_STATE_EMPTY 0x0000
#define SCTP_STATE_INUSE 0x0001
@@ -612,10 +614,6 @@ __FBSDID("$FreeBSD$");
/* 30 seconds + RTO (in ms) */
#define SCTP_HB_DEFAULT_MSEC 30000
-/* Max time I will wait for Shutdown to complete */
-#define SCTP_DEF_MAX_SHUTDOWN_SEC 180
-
-
/*
* This is how long a secret lives, NOT how long a cookie lives how many
* ticks the current secret will live.
diff --git a/sys/netinet/sctp_header.h b/sys/netinet/sctp_header.h
index f322e04..dc05b3d 100644
--- a/sys/netinet/sctp_header.h
+++ b/sys/netinet/sctp_header.h
@@ -202,34 +202,6 @@ struct sctp_state_cookie { /* this is our definition... */
*/
} SCTP_PACKED;
-
-/* Used for NAT state error cause */
-struct sctp_missing_nat_state {
- uint16_t cause;
- uint16_t length;
- uint8_t data[];
-} SCTP_PACKED;
-
-
-struct sctp_inv_mandatory_param {
- uint16_t cause;
- uint16_t length;
- uint32_t num_param;
- uint16_t param;
- /*
- * We include this to 0 it since only a missing cookie will cause
- * this error.
- */
- uint16_t resv;
-} SCTP_PACKED;
-
-struct sctp_unresolv_addr {
- uint16_t cause;
- uint16_t length;
- uint16_t addr_type;
- uint16_t reserved; /* Only one invalid addr type */
-} SCTP_PACKED;
-
/* state cookie parameter */
struct sctp_state_cookie_param {
struct sctp_paramhdr ph;
@@ -370,28 +342,11 @@ struct sctp_shutdown_complete_chunk {
struct sctp_chunkhdr ch;
} SCTP_PACKED;
-/* Oper error holding a stale cookie */
-struct sctp_stale_cookie_msg {
- struct sctp_paramhdr ph;/* really an error cause */
- uint32_t time_usec;
-} SCTP_PACKED;
-
struct sctp_adaptation_layer_indication {
struct sctp_paramhdr ph;
uint32_t indication;
} SCTP_PACKED;
-struct sctp_cookie_while_shutting_down {
- struct sctphdr sh;
- struct sctp_chunkhdr ch;
- struct sctp_paramhdr ph;/* really an error cause */
-} SCTP_PACKED;
-
-struct sctp_shutdown_complete_msg {
- struct sctphdr sh;
- struct sctp_shutdown_complete_chunk shut_cmp;
-} SCTP_PACKED;
-
/*
* draft-ietf-tsvwg-addip-sctp
*/
@@ -554,12 +509,6 @@ struct sctp_auth_chunk {
uint8_t hmac[];
} SCTP_PACKED;
-struct sctp_auth_invalid_hmac {
- struct sctp_paramhdr ph;
- uint16_t hmac_id;
- uint16_t padding;
-} SCTP_PACKED;
-
/*
* we pre-reserve enough room for a ECNE or CWR AND a SACK with no missing
* pieces. If ENCE is missing we could have a couple of blocks. This way we
diff --git a/sys/netinet/sctp_indata.c b/sys/netinet/sctp_indata.c
index 50a6628..75c1ac5 100644
--- a/sys/netinet/sctp_indata.c
+++ b/sys/netinet/sctp_indata.c
@@ -223,9 +223,9 @@ sctp_build_ctl_nchunk(struct sctp_inpcb *inp, struct sctp_sndrcvinfo *sinfo)
}
seinfo = (struct sctp_extrcvinfo *)sinfo;
if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_RECVNXTINFO) &&
- (seinfo->sreinfo_next_flags & SCTP_NEXT_MSG_AVAIL)) {
+ (seinfo->serinfo_next_flags & SCTP_NEXT_MSG_AVAIL)) {
provide_nxt = 1;
- len += CMSG_SPACE(sizeof(struct sctp_rcvinfo));
+ len += CMSG_SPACE(sizeof(struct sctp_nxtinfo));
} else {
provide_nxt = 0;
}
@@ -276,20 +276,20 @@ sctp_build_ctl_nchunk(struct sctp_inpcb *inp, struct sctp_sndrcvinfo *sinfo)
cmh->cmsg_len = CMSG_LEN(sizeof(struct sctp_nxtinfo));
cmh->cmsg_type = SCTP_NXTINFO;
nxtinfo = (struct sctp_nxtinfo *)CMSG_DATA(cmh);
- nxtinfo->nxt_sid = seinfo->sreinfo_next_stream;
+ nxtinfo->nxt_sid = seinfo->serinfo_next_stream;
nxtinfo->nxt_flags = 0;
- if (seinfo->sreinfo_next_flags & SCTP_NEXT_MSG_IS_UNORDERED) {
+ if (seinfo->serinfo_next_flags & SCTP_NEXT_MSG_IS_UNORDERED) {
nxtinfo->nxt_flags |= SCTP_UNORDERED;
}
- if (seinfo->sreinfo_next_flags & SCTP_NEXT_MSG_IS_NOTIFICATION) {
+ if (seinfo->serinfo_next_flags & SCTP_NEXT_MSG_IS_NOTIFICATION) {
nxtinfo->nxt_flags |= SCTP_NOTIFICATION;
}
- if (seinfo->sreinfo_next_flags & SCTP_NEXT_MSG_ISCOMPLETE) {
+ if (seinfo->serinfo_next_flags & SCTP_NEXT_MSG_ISCOMPLETE) {
nxtinfo->nxt_flags |= SCTP_COMPLETE;
}
- nxtinfo->nxt_ppid = seinfo->sreinfo_next_ppid;
- nxtinfo->nxt_length = seinfo->sreinfo_next_length;
- nxtinfo->nxt_assoc_id = seinfo->sreinfo_next_aid;
+ nxtinfo->nxt_ppid = seinfo->serinfo_next_ppid;
+ nxtinfo->nxt_length = seinfo->serinfo_next_length;
+ nxtinfo->nxt_assoc_id = seinfo->serinfo_next_aid;
cmh = (struct cmsghdr *)((caddr_t)cmh + CMSG_SPACE(sizeof(struct sctp_nxtinfo)));
SCTP_BUF_LEN(ret) += CMSG_SPACE(sizeof(struct sctp_nxtinfo));
}
@@ -578,10 +578,10 @@ sctp_queue_data_to_stream(struct sctp_tcb *stcb, struct sctp_association *asoc,
sctp_log_strm_del(control, NULL, SCTP_STR_LOG_FROM_INTO_STRD);
}
SCTPDBG(SCTP_DEBUG_INDATA1,
- "queue to stream called for ssn:%u lastdel:%u nxt:%u\n",
- (uint32_t) control->sinfo_stream,
- (uint32_t) strm->last_sequence_delivered,
- (uint32_t) nxt_todel);
+ "queue to stream called for sid:%u ssn:%u tsn:%u lastdel:%u nxt:%u\n",
+ (uint32_t) control->sinfo_stream, (uint32_t) control->sinfo_ssn,
+ (uint32_t) control->sinfo_tsn,
+ (uint32_t) strm->last_sequence_delivered, (uint32_t) nxt_todel);
if (SCTP_SSN_GE(strm->last_sequence_delivered, control->sinfo_ssn)) {
/* The incoming sseq is behind where we last delivered? */
SCTPDBG(SCTP_DEBUG_INDATA1, "Duplicate S-SEQ:%d delivered:%d from peer, Abort association\n",
@@ -602,6 +602,20 @@ protocol_error:
return;
}
+#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING)
+ struct socket *so;
+
+ so = SCTP_INP_SO(stcb->sctp_ep);
+ atomic_add_int(&stcb->asoc.refcnt, 1);
+ SCTP_TCB_UNLOCK(stcb);
+ SCTP_SOCKET_LOCK(so, 1);
+ SCTP_TCB_LOCK(stcb);
+ atomic_subtract_int(&stcb->asoc.refcnt, 1);
+ if (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) {
+ SCTP_SOCKET_UNLOCK(so, 1);
+ return;
+ }
+#endif
if (nxt_todel == control->sinfo_ssn) {
/* can be delivered right away? */
if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_STR_LOGGING_ENABLE) {
@@ -617,7 +631,7 @@ protocol_error:
sctp_add_to_readq(stcb->sctp_ep, stcb,
control,
&stcb->sctp_socket->so_rcv, 1,
- SCTP_READ_LOCK_NOT_HELD, SCTP_SO_NOT_LOCKED);
+ SCTP_READ_LOCK_NOT_HELD, SCTP_SO_LOCKED);
TAILQ_FOREACH_SAFE(control, &strm->inqueue, next, at) {
/* all delivered */
nxt_todel = strm->last_sequence_delivered + 1;
@@ -641,7 +655,7 @@ protocol_error:
control,
&stcb->sctp_socket->so_rcv, 1,
SCTP_READ_LOCK_NOT_HELD,
- SCTP_SO_NOT_LOCKED);
+ SCTP_SO_LOCKED);
continue;
}
break;
@@ -653,6 +667,9 @@ protocol_error:
* to put it on the queue.
*/
if (SCTP_TSN_GE(asoc->cumulative_tsn, control->sinfo_tsn)) {
+#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING)
+ SCTP_SOCKET_UNLOCK(so, 1);
+#endif
goto protocol_error;
}
if (TAILQ_EMPTY(&strm->inqueue)) {
@@ -699,6 +716,9 @@ protocol_error:
control->whoFrom = NULL;
}
sctp_free_a_readq(stcb, control);
+#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING)
+ SCTP_SOCKET_UNLOCK(so, 1);
+#endif
return;
} else {
if (TAILQ_NEXT(at, next) == NULL) {
@@ -718,6 +738,9 @@ protocol_error:
}
}
}
+#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING)
+ SCTP_SOCKET_UNLOCK(so, 1);
+#endif
}
/*
@@ -1403,30 +1426,25 @@ sctp_process_a_data_chunk(struct sctp_tcb *stcb, struct sctp_association *asoc,
}
strmno = ntohs(ch->dp.stream_id);
if (strmno >= asoc->streamincnt) {
- struct sctp_paramhdr *phdr;
- struct mbuf *mb;
+ struct sctp_error_invalid_stream *cause;
- mb = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) * 2),
+ op_err = sctp_get_mbuf_for_msg(sizeof(struct sctp_error_invalid_stream),
0, M_NOWAIT, 1, MT_DATA);
- if (mb != NULL) {
+ if (op_err != NULL) {
/* add some space up front so prepend will work well */
- SCTP_BUF_RESV_UF(mb, sizeof(struct sctp_chunkhdr));
- phdr = mtod(mb, struct sctp_paramhdr *);
+ SCTP_BUF_RESV_UF(op_err, sizeof(struct sctp_chunkhdr));
+ cause = mtod(op_err, struct sctp_error_invalid_stream *);
/*
* Error causes are just param's and this one has
* two back to back phdr, one with the error type
* and size, the other with the streamid and a rsvd
*/
- SCTP_BUF_LEN(mb) = (sizeof(struct sctp_paramhdr) * 2);
- phdr->param_type = htons(SCTP_CAUSE_INVALID_STREAM);
- phdr->param_length =
- htons(sizeof(struct sctp_paramhdr) * 2);
- phdr++;
- /* We insert the stream in the type field */
- phdr->param_type = ch->dp.stream_id;
- /* And set the length to 0 for the rsvd field */
- phdr->param_length = 0;
- sctp_queue_op_err(stcb, mb);
+ SCTP_BUF_LEN(op_err) = sizeof(struct sctp_error_invalid_stream);
+ cause->cause.code = htons(SCTP_CAUSE_INVALID_STREAM);
+ cause->cause.length = htons(sizeof(struct sctp_error_invalid_stream));
+ cause->stream_id = ch->dp.stream_id;
+ cause->reserved = htons(0);
+ sctp_queue_op_err(stcb, op_err);
}
SCTP_STAT_INCR(sctps_badsid);
SCTP_TCB_LOCK_ASSERT(stcb);
@@ -1886,6 +1904,7 @@ finish_express_del:
sctp_reset_in_stream(stcb, liste->number_entries, liste->list_of_streams);
TAILQ_REMOVE(&asoc->resetHead, liste, next_resp);
+ sctp_send_deferred_reset_response(stcb, liste, SCTP_STREAM_RESET_RESULT_PERFORMED);
SCTP_FREE(liste, SCTP_M_STRESET);
/* sa_ignore FREED_MEMORY */
liste = TAILQ_FIRST(&asoc->resetHead);
@@ -2288,11 +2307,8 @@ doit_again:
int
sctp_process_data(struct mbuf **mm, int iphlen, int *offset, int length,
- struct sockaddr *src, struct sockaddr *dst,
- struct sctphdr *sh, struct sctp_inpcb *inp,
- struct sctp_tcb *stcb, struct sctp_nets *net, uint32_t * high_tsn,
- uint8_t mflowtype, uint32_t mflowid,
- uint32_t vrf_id, uint16_t port)
+ struct sctp_inpcb *inp, struct sctp_tcb *stcb,
+ struct sctp_nets *net, uint32_t * high_tsn)
{
struct sctp_data_chunk *ch, chunk_buf;
struct sctp_association *asoc;
@@ -2384,10 +2400,7 @@ sctp_process_data(struct mbuf **mm, int iphlen, int *offset, int length,
chk_length);
op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg);
stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_21;
- sctp_abort_association(inp, stcb, m, iphlen,
- src, dst, sh, op_err,
- mflowtype, mflowid,
- vrf_id, port);
+ sctp_abort_an_association(inp, stcb, op_err, SCTP_SO_NOT_LOCKED);
return (2);
}
if ((size_t)chk_length == sizeof(struct sctp_data_chunk)) {
@@ -2399,10 +2412,7 @@ sctp_process_data(struct mbuf **mm, int iphlen, int *offset, int length,
op_err = sctp_generate_no_user_data_cause(ch->dp.tsn);
stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_22;
- sctp_abort_association(inp, stcb, m, iphlen,
- src, dst, sh, op_err,
- mflowtype, mflowid,
- vrf_id, port);
+ sctp_abort_an_association(inp, stcb, op_err, SCTP_SO_NOT_LOCKED);
return (2);
}
#ifdef SCTP_AUDITING_ENABLED
@@ -2464,14 +2474,12 @@ sctp_process_data(struct mbuf **mm, int iphlen, int *offset, int length,
*/
if (SCTP_BASE_SYSCTL(sctp_strict_data_order)) {
struct mbuf *op_err;
+ char msg[SCTP_DIAG_INFO_LEN];
- op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, "");
- sctp_abort_association(inp, stcb,
- m, iphlen,
- src, dst,
- sh, op_err,
- mflowtype, mflowid,
- vrf_id, port);
+ snprintf(msg, sizeof(msg), "DATA chunk followed by chunk of type %2.2x",
+ ch->ch.chunk_type);
+ op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg);
+ sctp_abort_an_association(inp, stcb, op_err, SCTP_SO_NOT_LOCKED);
return (2);
}
break;
@@ -2479,34 +2487,21 @@ sctp_process_data(struct mbuf **mm, int iphlen, int *offset, int length,
/* unknown chunk type, use bit rules */
if (ch->ch.chunk_type & 0x40) {
/* Add a error report to the queue */
- struct mbuf *merr;
- struct sctp_paramhdr *phd;
-
- merr = sctp_get_mbuf_for_msg(sizeof(*phd), 0, M_NOWAIT, 1, MT_DATA);
- if (merr) {
- phd = mtod(merr, struct sctp_paramhdr *);
- /*
- * We cheat and use param
- * type since we did not
- * bother to define a error
- * cause struct. They are
- * the same basic format
- * with different names.
- */
- phd->param_type =
- htons(SCTP_CAUSE_UNRECOG_CHUNK);
- phd->param_length =
- htons(chk_length + sizeof(*phd));
- SCTP_BUF_LEN(merr) = sizeof(*phd);
- SCTP_BUF_NEXT(merr) = SCTP_M_COPYM(m, *offset, chk_length, M_NOWAIT);
- if (SCTP_BUF_NEXT(merr)) {
- if (sctp_pad_lastmbuf(SCTP_BUF_NEXT(merr), SCTP_SIZE32(chk_length) - chk_length, NULL) == NULL) {
- sctp_m_freem(merr);
- } else {
- sctp_queue_op_err(stcb, merr);
- }
+ struct mbuf *op_err;
+ struct sctp_gen_error_cause *cause;
+
+ op_err = sctp_get_mbuf_for_msg(sizeof(struct sctp_gen_error_cause),
+ 0, M_NOWAIT, 1, MT_DATA);
+ if (op_err != NULL) {
+ cause = mtod(op_err, struct sctp_gen_error_cause *);
+ cause->code = htons(SCTP_CAUSE_UNRECOG_CHUNK);
+ cause->length = htons(chk_length + sizeof(struct sctp_gen_error_cause));
+ SCTP_BUF_LEN(op_err) = sizeof(struct sctp_gen_error_cause);
+ SCTP_BUF_NEXT(op_err) = SCTP_M_COPYM(m, *offset, chk_length, M_NOWAIT);
+ if (SCTP_BUF_NEXT(op_err) != NULL) {
+ sctp_queue_op_err(stcb, op_err);
} else {
- sctp_m_freem(merr);
+ sctp_m_freem(op_err);
}
}
}
@@ -2768,6 +2763,11 @@ sctp_process_segment_range(struct sctp_tcb *stcb, struct sctp_tmit_chunk **p_tp1
panic("No chunks on the queues for sid %u.", tp1->rec.data.stream_number);
#endif
}
+ if ((stcb->asoc.strmout[tp1->rec.data.stream_number].chunks_on_queues == 0) &&
+ (stcb->asoc.strmout[tp1->rec.data.stream_number].state == SCTP_STREAM_RESET_PENDING) &&
+ TAILQ_EMPTY(&stcb->asoc.strmout[tp1->rec.data.stream_number].outqueue)) {
+ stcb->asoc.trigger_reset = 1;
+ }
tp1->sent = SCTP_DATAGRAM_NR_ACKED;
if (tp1->data) {
/*
@@ -3741,6 +3741,11 @@ sctp_express_handle_sack(struct sctp_tcb *stcb, uint32_t cumack,
#endif
}
}
+ if ((asoc->strmout[tp1->rec.data.stream_number].chunks_on_queues == 0) &&
+ (asoc->strmout[tp1->rec.data.stream_number].state == SCTP_STREAM_RESET_PENDING) &&
+ TAILQ_EMPTY(&asoc->strmout[tp1->rec.data.stream_number].outqueue)) {
+ asoc->trigger_reset = 1;
+ }
TAILQ_REMOVE(&asoc->sent_queue, tp1, sctp_next);
if (tp1->data) {
/* sa_ignore NO_NULL_CHK */
@@ -3989,6 +3994,7 @@ again:
op_err = sctp_generate_cause(SCTP_CAUSE_USER_INITIATED_ABT, "");
stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_26;
sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED);
+ return;
} else {
struct sctp_nets *netp;
@@ -4466,6 +4472,11 @@ sctp_handle_sack(struct mbuf *m, int offset_seg, int offset_dup,
#endif
}
}
+ if ((asoc->strmout[tp1->rec.data.stream_number].chunks_on_queues == 0) &&
+ (asoc->strmout[tp1->rec.data.stream_number].state == SCTP_STREAM_RESET_PENDING) &&
+ TAILQ_EMPTY(&asoc->strmout[tp1->rec.data.stream_number].outqueue)) {
+ asoc->trigger_reset = 1;
+ }
TAILQ_REMOVE(&asoc->sent_queue, tp1, sctp_next);
if (PR_SCTP_ENABLED(tp1->flags)) {
if (asoc->pr_sctp_cnt != 0)
diff --git a/sys/netinet/sctp_indata.h b/sys/netinet/sctp_indata.h
index 79a86e2..94cd49c 100644
--- a/sys/netinet/sctp_indata.h
+++ b/sys/netinet/sctp_indata.h
@@ -112,12 +112,8 @@ void
int
sctp_process_data(struct mbuf **, int, int *, int,
- struct sockaddr *src, struct sockaddr *dst,
- struct sctphdr *,
struct sctp_inpcb *, struct sctp_tcb *,
- struct sctp_nets *, uint32_t *,
- uint8_t, uint32_t,
- uint32_t, uint16_t);
+ struct sctp_nets *, uint32_t *);
void sctp_slide_mapping_arrays(struct sctp_tcb *stcb);
diff --git a/sys/netinet/sctp_input.c b/sys/netinet/sctp_input.c
index 0986293..3b50590 100644
--- a/sys/netinet/sctp_input.c
+++ b/sys/netinet/sctp_input.c
@@ -357,14 +357,17 @@ sctp_process_init(struct sctp_init_chunk *cp, struct sctp_tcb *stcb)
sctp_free_a_strmoq(stcb, sp, SCTP_SO_NOT_LOCKED);
/* sa_ignore FREED_MEMORY */
}
+ outs->state = SCTP_STREAM_CLOSED;
}
}
/* cut back the count */
asoc->pre_open_streams = newcnt;
}
SCTP_TCB_SEND_UNLOCK(stcb);
- asoc->strm_realoutsize = asoc->streamoutcnt = asoc->pre_open_streams;
-
+ asoc->streamoutcnt = asoc->pre_open_streams;
+ for (i = 0; i < asoc->streamoutcnt; i++) {
+ asoc->strmout[i].state = SCTP_STREAM_OPEN;
+ }
/* EY - nr_sack: initialize highest tsn in nr_mapping_array */
asoc->highest_tsn_inside_nr_map = asoc->highest_tsn_inside_map;
if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_MAP_LOGGING_ENABLE) {
@@ -518,7 +521,6 @@ sctp_process_init_ack(struct mbuf *m, int iphlen, int offset,
/* calculate the RTO */
net->RTO = sctp_calculate_rto(stcb, asoc, net, &asoc->time_entered, sctp_align_safe_nocopy,
SCTP_RTT_FROM_NON_DATA);
-
retval = sctp_send_cookie_echo(m, offset, stcb, net);
if (retval < 0) {
/*
@@ -527,25 +529,21 @@ sctp_process_init_ack(struct mbuf *m, int iphlen, int offset,
* abandon the peer, its broke.
*/
if (retval == -3) {
+ uint16_t len;
+
+ len = (uint16_t) (sizeof(struct sctp_error_missing_param) + sizeof(uint16_t));
/* We abort with an error of missing mandatory param */
- op_err = sctp_generate_cause(SCTP_CAUSE_MISSING_PARAM, "");
- if (op_err) {
- /*
- * Expand beyond to include the mandatory
- * param cookie
- */
- struct sctp_inv_mandatory_param *mp;
+ op_err = sctp_get_mbuf_for_msg(len, 0, M_NOWAIT, 1, MT_DATA);
+ if (op_err != NULL) {
+ struct sctp_error_missing_param *cause;
- SCTP_BUF_LEN(op_err) =
- sizeof(struct sctp_inv_mandatory_param);
- mp = mtod(op_err,
- struct sctp_inv_mandatory_param *);
+ SCTP_BUF_LEN(op_err) = len;
+ cause = mtod(op_err, struct sctp_error_missing_param *);
/* Subtract the reserved param */
- mp->length =
- htons(sizeof(struct sctp_inv_mandatory_param) - 2);
- mp->num_param = htonl(1);
- mp->param = htons(SCTP_STATE_COOKIE);
- mp->resv = 0;
+ cause->cause.code = htons(SCTP_CAUSE_MISSING_PARAM);
+ cause->cause.length = htons(len);
+ cause->num_missing_params = htonl(1);
+ cause->type[0] = htons(SCTP_STATE_COOKIE);
}
sctp_abort_association(stcb->sctp_ep, stcb, m, iphlen,
src, dst, sh, op_err,
@@ -778,10 +776,10 @@ sctp_handle_abort(struct sctp_abort_chunk *abort,
* Need to check the cause codes for our two magic nat
* aborts which don't kill the assoc necessarily.
*/
- struct sctp_missing_nat_state *natc;
+ struct sctp_gen_error_cause *cause;
- natc = (struct sctp_missing_nat_state *)(abort + 1);
- error = ntohs(natc->cause);
+ cause = (struct sctp_gen_error_cause *)(abort + 1);
+ error = ntohs(cause->code);
if (error == SCTP_CAUSE_NAT_COLLIDING_STATE) {
SCTPDBG(SCTP_DEBUG_INPUT2, "Received Colliding state abort flags:%x\n",
abort->ch.chunk_flags);
@@ -864,6 +862,7 @@ sctp_handle_shutdown(struct sctp_shutdown_chunk *cp,
{
struct sctp_association *asoc;
int some_on_streamwheel;
+ int old_state;
#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING)
struct socket *so;
@@ -882,11 +881,11 @@ sctp_handle_shutdown(struct sctp_shutdown_chunk *cp,
if (ntohs(cp->ch.chunk_length) != sizeof(struct sctp_shutdown_chunk)) {
/* Shutdown NOT the expected size */
return;
- } else {
- sctp_update_acked(stcb, cp, abort_flag);
- if (*abort_flag) {
- return;
- }
+ }
+ old_state = SCTP_GET_STATE(asoc);
+ sctp_update_acked(stcb, cp, abort_flag);
+ if (*abort_flag) {
+ return;
}
if (asoc->control_pdapi) {
/*
@@ -956,12 +955,16 @@ sctp_handle_shutdown(struct sctp_shutdown_chunk *cp,
(SCTP_GET_STATE(asoc) == SCTP_STATE_SHUTDOWN_RECEIVED)) {
SCTP_STAT_DECR_GAUGE32(sctps_currestab);
}
- SCTP_SET_STATE(asoc, SCTP_STATE_SHUTDOWN_ACK_SENT);
SCTP_CLEAR_SUBSTATE(asoc, SCTP_STATE_SHUTDOWN_PENDING);
- sctp_stop_timers_for_shutdown(stcb);
- sctp_send_shutdown_ack(stcb, net);
- sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWNACK, stcb->sctp_ep,
- stcb, net);
+ if (SCTP_GET_STATE(asoc) != SCTP_STATE_SHUTDOWN_ACK_SENT) {
+ SCTP_SET_STATE(asoc, SCTP_STATE_SHUTDOWN_ACK_SENT);
+ sctp_stop_timers_for_shutdown(stcb);
+ sctp_send_shutdown_ack(stcb, net);
+ sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWNACK,
+ stcb->sctp_ep, stcb, net);
+ } else if (old_state == SCTP_STATE_SHUTDOWN_ACK_SENT) {
+ sctp_send_shutdown_ack(stcb, net);
+ }
}
}
@@ -2100,6 +2103,7 @@ sctp_process_cookie_new(struct mbuf *m, int iphlen, int offset,
*/
stcb = sctp_aloc_assoc(inp, init_src, &error,
ntohl(initack_cp->init.initiate_tag), vrf_id,
+ ntohs(initack_cp->init.num_outbound_streams),
(struct thread *)NULL
);
if (stcb == NULL) {
@@ -2343,12 +2347,17 @@ sctp_process_cookie_new(struct mbuf *m, int iphlen, int offset,
sctp_timer_start(SCTP_TIMER_TYPE_AUTOCLOSE, inp, stcb, NULL);
}
(void)SCTP_GETTIME_TIMEVAL(&stcb->asoc.time_entered);
- if ((netp) && (*netp)) {
+ if ((netp != NULL) && (*netp != NULL)) {
/* calculate the RTT and set the encaps port */
(*netp)->RTO = sctp_calculate_rto(stcb, asoc, *netp,
&cookie->time_entered, sctp_align_unsafe_makecopy,
SCTP_RTT_FROM_NON_DATA);
+#if defined(INET) || defined(INET6)
+ if (((*netp)->port == 0) && (port != 0)) {
+ sctp_pathmtu_adjustment(stcb, (*netp)->mtu - sizeof(struct udphdr));
+ }
(*netp)->port = port;
+#endif
}
/* respond with a COOKIE-ACK */
sctp_send_cookie_ack(stcb);
@@ -2431,8 +2440,8 @@ sctp_handle_cookie_echo(struct mbuf *m, int iphlen, int offset,
cookie_offset = offset + sizeof(struct sctp_chunkhdr);
cookie_len = ntohs(cp->ch.chunk_length);
- if ((cookie->peerport != sh->src_port) &&
- (cookie->myport != sh->dest_port) &&
+ if ((cookie->peerport != sh->src_port) ||
+ (cookie->myport != sh->dest_port) ||
(cookie->my_vtag != sh->v_tag)) {
/*
* invalid ports or bad tag. Note that we always leave the
@@ -2550,27 +2559,27 @@ sctp_handle_cookie_echo(struct mbuf *m, int iphlen, int offset,
if (timevalcmp(&now, &time_expires, >)) {
/* cookie is stale! */
struct mbuf *op_err;
- struct sctp_stale_cookie_msg *scm;
+ struct sctp_error_stale_cookie *cause;
uint32_t tim;
- op_err = sctp_get_mbuf_for_msg(sizeof(struct sctp_stale_cookie_msg),
+ op_err = sctp_get_mbuf_for_msg(sizeof(struct sctp_error_stale_cookie),
0, M_NOWAIT, 1, MT_DATA);
if (op_err == NULL) {
/* FOOBAR */
return (NULL);
}
/* Set the len */
- SCTP_BUF_LEN(op_err) = sizeof(struct sctp_stale_cookie_msg);
- scm = mtod(op_err, struct sctp_stale_cookie_msg *);
- scm->ph.param_type = htons(SCTP_CAUSE_STALE_COOKIE);
- scm->ph.param_length = htons((sizeof(struct sctp_paramhdr) +
+ SCTP_BUF_LEN(op_err) = sizeof(struct sctp_error_stale_cookie);
+ cause = mtod(op_err, struct sctp_error_stale_cookie *);
+ cause->cause.code = htons(SCTP_CAUSE_STALE_COOKIE);
+ cause->cause.length = htons((sizeof(struct sctp_paramhdr) +
(sizeof(uint32_t))));
/* seconds to usec */
tim = (now.tv_sec - time_expires.tv_sec) * 1000000;
/* add in usec */
if (tim == 0)
tim = now.tv_usec - cookie->time_entered.tv_usec;
- scm->time_usec = htonl(tim);
+ cause->stale_time = htonl(tim);
sctp_send_operr_to(src, dst, sh, cookie->peers_vtag, op_err,
mflowtype, mflowid, l_inp->fibnum,
vrf_id, port);
@@ -3506,6 +3515,28 @@ sctp_reset_out_streams(struct sctp_tcb *stcb, uint32_t number_entries, uint16_t
sctp_ulp_notify(SCTP_NOTIFY_STR_RESET_SEND, stcb, number_entries, (void *)list, SCTP_SO_NOT_LOCKED);
}
+static void
+sctp_reset_clear_pending(struct sctp_tcb *stcb, uint32_t number_entries, uint16_t * list)
+{
+ uint32_t i;
+ uint16_t temp;
+
+ if (number_entries > 0) {
+ for (i = 0; i < number_entries; i++) {
+ temp = ntohs(list[i]);
+ if (temp >= stcb->asoc.streamoutcnt) {
+ /* no such stream */
+ continue;
+ }
+ stcb->asoc.strmout[temp].state = SCTP_STREAM_OPEN;
+ }
+ } else {
+ for (i = 0; i < stcb->asoc.streamoutcnt; i++) {
+ stcb->asoc.strmout[i].state = SCTP_STREAM_OPEN;
+ }
+ }
+}
+
struct sctp_stream_reset_request *
sctp_find_stream_reset(struct sctp_tcb *stcb, uint32_t seq, struct sctp_tmit_chunk **bchk)
@@ -3604,6 +3635,8 @@ sctp_handle_stream_reset_response(struct sctp_tcb *stcb,
type = ntohs(req_param->ph.param_type);
lparm_len = ntohs(req_param->ph.param_length);
if (type == SCTP_STR_RESET_OUT_REQUEST) {
+ int no_clear = 0;
+
req_out_param = (struct sctp_stream_reset_out_request *)req_param;
number_entries = (lparm_len - sizeof(struct sctp_stream_reset_out_request)) / sizeof(uint16_t);
asoc->stream_reset_out_is_outstanding = 0;
@@ -3614,9 +3647,21 @@ sctp_handle_stream_reset_response(struct sctp_tcb *stcb,
sctp_reset_out_streams(stcb, number_entries, req_out_param->list_of_streams);
} else if (action == SCTP_STREAM_RESET_RESULT_DENIED) {
sctp_ulp_notify(SCTP_NOTIFY_STR_RESET_DENIED_OUT, stcb, number_entries, req_out_param->list_of_streams, SCTP_SO_NOT_LOCKED);
+ } else if (action == SCTP_STREAM_RESET_RESULT_IN_PROGRESS) {
+ /*
+ * Set it up so we don't stop
+ * retransmitting
+ */
+ asoc->stream_reset_outstanding++;
+ stcb->asoc.str_reset_seq_out--;
+ asoc->stream_reset_out_is_outstanding = 1;
+ no_clear = 1;
} else {
sctp_ulp_notify(SCTP_NOTIFY_STR_RESET_FAILED_OUT, stcb, number_entries, req_out_param->list_of_streams, SCTP_SO_NOT_LOCKED);
}
+ if (no_clear == 0) {
+ sctp_reset_clear_pending(stcb, number_entries, req_out_param->list_of_streams);
+ }
} else if (type == SCTP_STR_RESET_IN_REQUEST) {
req_in_param = (struct sctp_stream_reset_in_request *)req_param;
number_entries = (lparm_len - sizeof(struct sctp_stream_reset_in_request)) / sizeof(uint16_t);
@@ -3643,7 +3688,12 @@ sctp_handle_stream_reset_response(struct sctp_tcb *stcb,
asoc->stream_reset_outstanding--;
if (action == SCTP_STREAM_RESET_RESULT_PERFORMED) {
/* Put the new streams into effect */
- stcb->asoc.streamoutcnt += num_stream;
+ int i;
+
+ for (i = asoc->streamoutcnt; i < (asoc->streamoutcnt + num_stream); i++) {
+ asoc->strmout[i].state = SCTP_STREAM_OPEN;
+ }
+ asoc->streamoutcnt += num_stream;
sctp_notify_stream_reset_add(stcb, stcb->asoc.streamincnt, stcb->asoc.streamoutcnt, 0);
} else if (action == SCTP_STREAM_RESET_RESULT_DENIED) {
sctp_notify_stream_reset_add(stcb, stcb->asoc.streamincnt, stcb->asoc.streamoutcnt,
@@ -3720,6 +3770,9 @@ sctp_handle_stream_reset_response(struct sctp_tcb *stcb,
}
}
}
+ if (asoc->stream_reset_outstanding == 0) {
+ sctp_send_stream_reset_out_if_possible(stcb, SCTP_SO_NOT_LOCKED);
+ }
return (0);
}
@@ -3750,22 +3803,33 @@ sctp_handle_str_reset_request_in(struct sctp_tcb *stcb,
} else if (stcb->asoc.stream_reset_out_is_outstanding == 0) {
len = ntohs(req->ph.param_length);
number_entries = ((len - sizeof(struct sctp_stream_reset_in_request)) / sizeof(uint16_t));
- for (i = 0; i < number_entries; i++) {
- temp = ntohs(req->list_of_streams[i]);
- req->list_of_streams[i] = temp;
+ if (number_entries) {
+ for (i = 0; i < number_entries; i++) {
+ temp = ntohs(req->list_of_streams[i]);
+ if (temp >= stcb->asoc.streamoutcnt) {
+ asoc->last_reset_action[0] = SCTP_STREAM_RESET_RESULT_DENIED;
+ goto bad_boy;
+ }
+ req->list_of_streams[i] = temp;
+ }
+ for (i = 0; i < number_entries; i++) {
+ if (stcb->asoc.strmout[req->list_of_streams[i]].state == SCTP_STREAM_OPEN) {
+ stcb->asoc.strmout[req->list_of_streams[i]].state = SCTP_STREAM_RESET_PENDING;
+ }
+ }
+ } else {
+ /* Its all */
+ for (i = 0; i < stcb->asoc.streamoutcnt; i++) {
+ if (stcb->asoc.strmout[i].state == SCTP_STREAM_OPEN)
+ stcb->asoc.strmout[i].state = SCTP_STREAM_RESET_PENDING;
+ }
}
asoc->last_reset_action[0] = SCTP_STREAM_RESET_RESULT_PERFORMED;
- sctp_add_stream_reset_out(chk, number_entries, req->list_of_streams,
- asoc->str_reset_seq_out,
- seq, (asoc->sending_seq - 1));
- asoc->stream_reset_out_is_outstanding = 1;
- asoc->str_reset = chk;
- sctp_timer_start(SCTP_TIMER_TYPE_STRRESET, stcb->sctp_ep, stcb, chk->whoTo);
- stcb->asoc.stream_reset_outstanding++;
} else {
/* Can't do it, since we have sent one out */
asoc->last_reset_action[0] = SCTP_STREAM_RESET_RESULT_ERR_IN_PROGRESS;
}
+bad_boy:
sctp_add_stream_reset_result(chk, seq, asoc->last_reset_action[0]);
asoc->str_reset_seq_in++;
} else if (asoc->str_reset_seq_in - 1 == seq) {
@@ -3775,6 +3839,7 @@ sctp_handle_str_reset_request_in(struct sctp_tcb *stcb,
} else {
sctp_add_stream_reset_result(chk, seq, SCTP_STREAM_RESET_RESULT_ERR_BAD_SEQNO);
}
+ sctp_send_stream_reset_out_if_possible(stcb, SCTP_SO_NOT_LOCKED);
}
static int
@@ -3893,11 +3958,12 @@ sctp_handle_str_reset_request_out(struct sctp_tcb *stcb,
sctp_add_stream_reset_result(chk, seq, asoc->last_reset_action[0]);
return;
}
+ liste->seq = seq;
liste->tsn = tsn;
liste->number_entries = number_entries;
memcpy(&liste->list_of_streams, req->list_of_streams, number_entries * sizeof(uint16_t));
TAILQ_INSERT_TAIL(&asoc->resetHead, liste, next_resp);
- asoc->last_reset_action[0] = SCTP_STREAM_RESET_RESULT_PERFORMED;
+ asoc->last_reset_action[0] = SCTP_STREAM_RESET_RESULT_IN_PROGRESS;
}
sctp_add_stream_reset_result(chk, seq, asoc->last_reset_action[0]);
asoc->str_reset_seq_in++;
@@ -4034,7 +4100,7 @@ sctp_handle_str_reset_add_out_strm(struct sctp_tcb *stcb, struct sctp_tmit_chunk
mychk += num_stream;
if (mychk < 0x10000) {
stcb->asoc.last_reset_action[0] = SCTP_STREAM_RESET_RESULT_PERFORMED;
- if (sctp_send_str_reset_req(stcb, 0, NULL, 0, 0, 0, 1, num_stream, 0, 1)) {
+ if (sctp_send_str_reset_req(stcb, 0, NULL, 0, 0, 1, num_stream, 0, 1)) {
stcb->asoc.last_reset_action[0] = SCTP_STREAM_RESET_RESULT_DENIED;
}
} else {
@@ -4565,7 +4631,7 @@ __attribute__((noinline))
}
}
if (stcb == NULL) {
- snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s\n", __FILE__, __LINE__, __FUNCTION__);
+ snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __func__);
op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code),
msg);
/* no association, so it's out of the blue... */
@@ -4609,7 +4675,7 @@ __attribute__((noinline))
if (locked_tcb) {
SCTP_TCB_UNLOCK(locked_tcb);
}
- snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s\n", __FILE__, __LINE__, __FUNCTION__);
+ snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __func__);
op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code),
msg);
sctp_handle_ootb(m, iphlen, *offset, src, dst,
@@ -4755,13 +4821,11 @@ process_control_chunks:
/* The INIT chunk must be the only chunk. */
if ((num_chunks > 1) ||
(length - *offset > (int)SCTP_SIZE32(chk_length))) {
- op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code),
- "INIT not the only chunk");
- sctp_abort_association(inp, stcb, m, iphlen,
- src, dst, sh, op_err,
- mflowtype, mflowid,
- vrf_id, port);
+ /* RFC 4960 requires that no ABORT is sent */
*offset = length;
+ if (locked_tcb) {
+ SCTP_TCB_UNLOCK(locked_tcb);
+ }
return (NULL);
}
/* Honor our resource limit. */
@@ -5519,39 +5583,27 @@ process_control_chunks:
unknown_chunk:
/* it's an unknown chunk! */
if ((ch->chunk_type & 0x40) && (stcb != NULL)) {
- struct mbuf *mm;
- struct sctp_paramhdr *phd;
+ struct sctp_gen_error_cause *cause;
int len;
- mm = sctp_get_mbuf_for_msg(sizeof(struct sctp_paramhdr),
+ op_err = sctp_get_mbuf_for_msg(sizeof(struct sctp_gen_error_cause),
0, M_NOWAIT, 1, MT_DATA);
- if (mm) {
+ if (op_err != NULL) {
len = min(SCTP_SIZE32(chk_length), (uint32_t) (length - *offset));
- phd = mtod(mm, struct sctp_paramhdr *);
- /*
- * We cheat and use param type since
- * we did not bother to define a
- * error cause struct. They are the
- * same basic format with different
- * names.
- */
- phd->param_type = htons(SCTP_CAUSE_UNRECOG_CHUNK);
- phd->param_length = htons(len + sizeof(*phd));
- SCTP_BUF_LEN(mm) = sizeof(*phd);
- SCTP_BUF_NEXT(mm) = SCTP_M_COPYM(m, *offset, len, M_NOWAIT);
- if (SCTP_BUF_NEXT(mm)) {
- if (sctp_pad_lastmbuf(SCTP_BUF_NEXT(mm), SCTP_SIZE32(len) - len, NULL) == NULL) {
- sctp_m_freem(mm);
- } else {
+ cause = mtod(op_err, struct sctp_gen_error_cause *);
+ cause->code = htons(SCTP_CAUSE_UNRECOG_CHUNK);
+ cause->length = htons(len + sizeof(struct sctp_gen_error_cause));
+ SCTP_BUF_LEN(op_err) = sizeof(struct sctp_gen_error_cause);
+ SCTP_BUF_NEXT(op_err) = SCTP_M_COPYM(m, *offset, len, M_NOWAIT);
+ if (SCTP_BUF_NEXT(op_err) != NULL) {
#ifdef SCTP_MBUF_LOGGING
- if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_MBUF_LOGGING_ENABLE) {
- sctp_log_mbc(SCTP_BUF_NEXT(mm), SCTP_MBUF_ICOPY);
- }
-#endif
- sctp_queue_op_err(stcb, mm);
+ if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_MBUF_LOGGING_ENABLE) {
+ sctp_log_mbc(SCTP_BUF_NEXT(op_err), SCTP_MBUF_ICOPY);
}
+#endif
+ sctp_queue_op_err(stcb, op_err);
} else {
- sctp_m_freem(mm);
+ sctp_m_freem(op_err);
}
}
}
@@ -5589,30 +5641,6 @@ next_chunk:
}
-#ifdef INVARIANTS
-#ifdef __GNUC__
-__attribute__((noinline))
-#endif
- void
- sctp_validate_no_locks(struct sctp_inpcb *inp)
-{
- struct sctp_tcb *lstcb;
-
- LIST_FOREACH(lstcb, &inp->sctp_asoc_list, sctp_tcblist) {
- if (mtx_owned(&lstcb->tcb_mtx)) {
- panic("Own lock on stcb at return from input");
- }
- }
- if (mtx_owned(&inp->inp_create_mtx)) {
- panic("Own create lock on inp");
- }
- if (mtx_owned(&inp->inp_mtx)) {
- panic("Own inp lock on inp");
- }
-}
-
-#endif
-
/*
* common input chunk processing (v4 and v6)
*/
@@ -5775,7 +5803,7 @@ sctp_common_input_processing(struct mbuf **mm, int iphlen, int offset, int lengt
*/
SCTP_TCB_UNLOCK(stcb);
stcb = NULL;
- snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s\n", __FILE__, __LINE__, __FUNCTION__);
+ snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __func__);
op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code),
msg);
sctp_handle_ootb(m, iphlen, offset, src, dst, sh, inp, op_err,
@@ -5799,7 +5827,7 @@ sctp_common_input_processing(struct mbuf **mm, int iphlen, int offset, int lengt
*/
inp = stcb->sctp_ep;
#if defined(INET) || defined(INET6)
- if ((net) && (port)) {
+ if ((net != NULL) && (port != 0)) {
if (net->port == 0) {
sctp_pathmtu_adjustment(stcb, net->mtu - sizeof(struct udphdr));
}
@@ -5827,7 +5855,7 @@ sctp_common_input_processing(struct mbuf **mm, int iphlen, int offset, int lengt
}
if (stcb == NULL) {
/* out of the blue DATA chunk */
- snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s\n", __FILE__, __LINE__, __FUNCTION__);
+ snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __func__);
op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code),
msg);
sctp_handle_ootb(m, iphlen, offset, src, dst, sh, inp, op_err,
@@ -5899,7 +5927,7 @@ sctp_common_input_processing(struct mbuf **mm, int iphlen, int offset, int lengt
/*
* We consider OOTB any data sent during asoc setup.
*/
- snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s\n", __FILE__, __LINE__, __FUNCTION__);
+ snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __func__);
op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code),
msg);
sctp_handle_ootb(m, iphlen, offset, src, dst, sh, inp, op_err,
@@ -5922,10 +5950,7 @@ sctp_common_input_processing(struct mbuf **mm, int iphlen, int offset, int lengt
}
/* plow through the data chunks while length > offset */
retval = sctp_process_data(mm, iphlen, &offset, length,
- src, dst, sh,
- inp, stcb, net, &high_tsn,
- mflowtype, mflowid,
- vrf_id, port);
+ inp, stcb, net, &high_tsn);
if (retval == 2) {
/*
* The association aborted, NO UNLOCK needed since
@@ -5977,7 +6002,7 @@ trigger_send:
if (!TAILQ_EMPTY(&stcb->asoc.control_send_queue)) {
cnt_ctrl_ready = stcb->asoc.ctrl_queue_cnt - stcb->asoc.ecn_echo_cnt_onq;
}
- if (cnt_ctrl_ready ||
+ if (cnt_ctrl_ready || stcb->asoc.trigger_reset ||
((un_sent) &&
(stcb->asoc.peers_rwnd > 0 ||
(stcb->asoc.peers_rwnd <= 0 && stcb->asoc.total_flight == 0)))) {
@@ -5999,11 +6024,6 @@ out:
SCTP_INP_DECR_REF(inp_decr);
SCTP_INP_WUNLOCK(inp_decr);
}
-#ifdef INVARIANTS
- if (inp != NULL) {
- sctp_validate_no_locks(inp);
- }
-#endif
return;
}
diff --git a/sys/netinet/sctp_os_bsd.h b/sys/netinet/sctp_os_bsd.h
index 7ae332a..88ad978 100644
--- a/sys/netinet/sctp_os_bsd.h
+++ b/sys/netinet/sctp_os_bsd.h
@@ -95,7 +95,6 @@ __FBSDID("$FreeBSD$");
#include <netinet/ip6.h>
#include <netinet6/ip6_var.h>
#include <netinet6/in6_pcb.h>
-#include <netinet/icmp6.h>
#include <netinet6/ip6protosw.h>
#include <netinet6/nd6.h>
#include <netinet6/scope6_var.h>
diff --git a/sys/netinet/sctp_output.c b/sys/netinet/sctp_output.c
index 0cdeb94..5328f49 100644
--- a/sys/netinet/sctp_output.c
+++ b/sys/netinet/sctp_output.c
@@ -2417,7 +2417,7 @@ sctp_is_addr_restricted(struct sctp_tcb *stcb, struct sctp_ifa *ifa)
LIST_FOREACH(laddr, &stcb->asoc.sctp_restricted_addrs, sctp_nxt_addr) {
if (laddr->ifa == NULL) {
SCTPDBG(SCTP_DEBUG_OUTPUT1, "%s: NULL ifa\n",
- __FUNCTION__);
+ __func__);
continue;
}
if (laddr->ifa == ifa) {
@@ -2439,7 +2439,7 @@ sctp_is_addr_in_ep(struct sctp_inpcb *inp, struct sctp_ifa *ifa)
LIST_FOREACH(laddr, &inp->sctp_addr_list, sctp_nxt_addr) {
if (laddr->ifa == NULL) {
SCTPDBG(SCTP_DEBUG_OUTPUT1, "%s: NULL ifa\n",
- __FUNCTION__);
+ __func__);
continue;
}
if ((laddr->ifa == ifa) && laddr->action == 0)
@@ -3652,6 +3652,7 @@ sctp_process_cmsgs_for_init(struct sctp_tcb *stcb, struct mbuf *control, int *er
#endif
stcb->asoc.strmout[i].stream_no = i;
stcb->asoc.strmout[i].last_msg_incomplete = 0;
+ stcb->asoc.strmout[i].state = SCTP_STREAM_OPENING;
stcb->asoc.ss_functions.sctp_ss_init_stream(&stcb->asoc.strmout[i], NULL);
}
}
@@ -5524,7 +5525,7 @@ do_a_abort:
if (op_err == NULL) {
char msg[SCTP_DIAG_INFO_LEN];
- snprintf(msg, sizeof(msg), "%s:%d at %s\n", __FILE__, __LINE__, __FUNCTION__);
+ snprintf(msg, sizeof(msg), "%s:%d at %s", __FILE__, __LINE__, __func__);
op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code),
msg);
}
@@ -5841,10 +5842,10 @@ do_a_abort:
his_limit = ntohs(init_chk->init.num_inbound_streams);
/* choose what I want */
if (asoc != NULL) {
- if (asoc->streamoutcnt > inp->sctp_ep.pre_open_stream_count) {
+ if (asoc->streamoutcnt > asoc->pre_open_streams) {
i_want = asoc->streamoutcnt;
} else {
- i_want = inp->sctp_ep.pre_open_stream_count;
+ i_want = asoc->pre_open_streams;
}
} else {
i_want = inp->sctp_ep.pre_open_stream_count;
@@ -6682,10 +6683,17 @@ sctp_sendall_iterator(struct sctp_inpcb *inp, struct sctp_tcb *stcb, void *ptr,
if (TAILQ_EMPTY(&asoc->send_queue) &&
TAILQ_EMPTY(&asoc->sent_queue) &&
(asoc->state & SCTP_STATE_PARTIAL_MSG_LEFT)) {
+ struct mbuf *op_err;
+ char msg[SCTP_DIAG_INFO_LEN];
+
abort_anyway:
+ snprintf(msg, sizeof(msg),
+ "%s:%d at %s", __FILE__, __LINE__, __func__);
+ op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code),
+ msg);
atomic_add_int(&stcb->asoc.refcnt, 1);
sctp_abort_an_association(stcb->sctp_ep, stcb,
- NULL, SCTP_SO_NOT_LOCKED);
+ op_err, SCTP_SO_NOT_LOCKED);
atomic_add_int(&stcb->asoc.refcnt, -1);
goto no_chunk_output;
}
@@ -7162,6 +7170,11 @@ one_more_time:
}
atomic_subtract_int(&asoc->stream_queue_cnt, 1);
TAILQ_REMOVE(&strq->outqueue, sp, next);
+ if ((strq->state == SCTP_STREAM_RESET_PENDING) &&
+ (strq->chunks_on_queues == 0) &&
+ TAILQ_EMPTY(&strq->outqueue)) {
+ stcb->asoc.trigger_reset = 1;
+ }
stcb->asoc.ss_functions.sctp_ss_remove_from_stream(stcb, asoc, strq, sp, send_lock_up);
if (sp->net) {
sctp_free_remote_addr(sp->net);
@@ -7206,7 +7219,7 @@ one_more_time:
}
/* Whack down the size */
atomic_subtract_int(&stcb->asoc.total_output_queue_size, sp->length);
- if ((stcb->sctp_socket != NULL) && \
+ if ((stcb->sctp_socket != NULL) &&
((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) ||
(stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL))) {
atomic_subtract_int(&stcb->sctp_socket->so_snd.sb_cc, sp->length);
@@ -7225,9 +7238,6 @@ one_more_time:
}
}
some_taken = sp->some_taken;
- if (stcb->asoc.state & SCTP_STATE_CLOSED_SOCKET) {
- sp->msg_is_complete = 1;
- }
re_look:
length = sp->length;
if (sp->msg_is_complete) {
@@ -7560,6 +7570,11 @@ dont_do_it:
send_lock_up = 1;
}
TAILQ_REMOVE(&strq->outqueue, sp, next);
+ if ((strq->state == SCTP_STREAM_RESET_PENDING) &&
+ (strq->chunks_on_queues == 0) &&
+ TAILQ_EMPTY(&strq->outqueue)) {
+ stcb->asoc.trigger_reset = 1;
+ }
stcb->asoc.ss_functions.sctp_ss_remove_from_stream(stcb, asoc, strq, sp, send_lock_up);
if (sp->net) {
sctp_free_remote_addr(sp->net);
@@ -7787,7 +7802,7 @@ sctp_med_chunk_output(struct sctp_inpcb *inp,
#endif
SCTP_TCB_LOCK_ASSERT(stcb);
hbflag = 0;
- if ((control_only) || (asoc->stream_reset_outstanding))
+ if (control_only)
no_data_chunks = 1;
else
no_data_chunks = 0;
@@ -8851,9 +8866,37 @@ sctp_queue_op_err(struct sctp_tcb *stcb, struct mbuf *op_err)
*/
struct sctp_chunkhdr *hdr;
struct sctp_tmit_chunk *chk;
- struct mbuf *mat;
+ struct mbuf *mat, *last_mbuf;
+ uint32_t chunk_length;
+ uint16_t padding_length;
SCTP_TCB_LOCK_ASSERT(stcb);
+ SCTP_BUF_PREPEND(op_err, sizeof(struct sctp_chunkhdr), M_NOWAIT);
+ if (op_err == NULL) {
+ return;
+ }
+ last_mbuf = NULL;
+ chunk_length = 0;
+ for (mat = op_err; mat != NULL; mat = SCTP_BUF_NEXT(mat)) {
+ chunk_length += SCTP_BUF_LEN(mat);
+ if (SCTP_BUF_NEXT(mat) == NULL) {
+ last_mbuf = mat;
+ }
+ }
+ if (chunk_length > SCTP_MAX_CHUNK_LENGTH) {
+ sctp_m_freem(op_err);
+ return;
+ }
+ padding_length = chunk_length % 4;
+ if (padding_length != 0) {
+ padding_length = 4 - padding_length;
+ }
+ if (padding_length != 0) {
+ if (sctp_add_pad_tombuf(last_mbuf, padding_length) == NULL) {
+ sctp_m_freem(op_err);
+ return;
+ }
+ }
sctp_alloc_a_chunk(stcb, chk);
if (chk == NULL) {
/* no memory */
@@ -8861,15 +8904,7 @@ sctp_queue_op_err(struct sctp_tcb *stcb, struct mbuf *op_err)
return;
}
chk->copy_by_ref = 0;
- SCTP_BUF_PREPEND(op_err, sizeof(struct sctp_chunkhdr), M_NOWAIT);
- if (op_err == NULL) {
- sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED);
- return;
- }
- chk->send_size = 0;
- for (mat = op_err; mat != NULL; mat = SCTP_BUF_NEXT(mat)) {
- chk->send_size += SCTP_BUF_LEN(mat);
- }
+ chk->send_size = (uint16_t) chunk_length;
chk->sent = SCTP_DATAGRAM_UNSENT;
chk->snd_count = 0;
chk->asoc = &stcb->asoc;
@@ -8879,9 +8914,7 @@ sctp_queue_op_err(struct sctp_tcb *stcb, struct mbuf *op_err)
hdr->chunk_type = SCTP_OPERATION_ERROR;
hdr->chunk_flags = 0;
hdr->chunk_length = htons(chk->send_size);
- TAILQ_INSERT_TAIL(&chk->asoc->control_send_queue,
- chk,
- sctp_next);
+ TAILQ_INSERT_TAIL(&chk->asoc->control_send_queue, chk, sctp_next);
chk->asoc->ctrl_queue_cnt++;
}
@@ -9462,12 +9495,16 @@ sctp_chunk_retransmission(struct sctp_inpcb *inp,
}
if ((SCTP_BASE_SYSCTL(sctp_max_retran_chunk)) &&
(chk->snd_count >= SCTP_BASE_SYSCTL(sctp_max_retran_chunk))) {
- /* Gak, we have exceeded max unlucky retran, abort! */
- SCTP_PRINTF("Gak, chk->snd_count:%d >= max:%d - send abort\n",
- chk->snd_count,
- SCTP_BASE_SYSCTL(sctp_max_retran_chunk));
+ struct mbuf *op_err;
+ char msg[SCTP_DIAG_INFO_LEN];
+
+ snprintf(msg, sizeof(msg), "TSN %8.8x retransmitted %d times, giving up",
+ chk->rec.data.TSN_seq, chk->snd_count);
+ op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code),
+ msg);
atomic_add_int(&stcb->asoc.refcnt, 1);
- sctp_abort_an_association(stcb->sctp_ep, stcb, NULL, so_locked);
+ sctp_abort_an_association(stcb->sctp_ep, stcb, op_err,
+ so_locked);
SCTP_TCB_LOCK(stcb);
atomic_subtract_int(&stcb->asoc.refcnt, 1);
return (SCTP_RETRAN_EXIT);
@@ -9872,6 +9909,7 @@ sctp_chunk_output(struct sctp_inpcb *inp,
unsigned int tot_frs = 0;
asoc = &stcb->asoc;
+do_it_again:
/* The Nagle algorithm is only applied when handling a send call. */
if (from_where == SCTP_OUTPUT_FROM_USR_SEND) {
if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_NODELAY)) {
@@ -9889,7 +9927,8 @@ sctp_chunk_output(struct sctp_inpcb *inp,
if ((un_sent <= 0) &&
(TAILQ_EMPTY(&asoc->control_send_queue)) &&
(TAILQ_EMPTY(&asoc->asconf_send_queue)) &&
- (asoc->sent_queue_retran_cnt == 0)) {
+ (asoc->sent_queue_retran_cnt == 0) &&
+ (asoc->trigger_reset == 0)) {
/* Nothing to do unless there is something to be sent left */
return;
}
@@ -10108,6 +10147,12 @@ sctp_chunk_output(struct sctp_inpcb *inp,
*/
if (stcb->asoc.ecn_echo_cnt_onq)
sctp_fix_ecn_echo(asoc);
+
+ if (stcb->asoc.trigger_reset) {
+ if (sctp_send_stream_reset_out_if_possible(stcb, so_locked) == 0) {
+ goto do_it_again;
+ }
+ }
return;
}
@@ -11224,6 +11269,11 @@ sctp_send_hb(struct sctp_tcb *stcb, struct sctp_nets *net, int so_locked
break;
#endif
default:
+ if (chk->data) {
+ sctp_m_freem(chk->data);
+ chk->data = NULL;
+ }
+ sctp_free_a_chunk(stcb, chk, so_locked);
return;
break;
}
@@ -11510,30 +11560,60 @@ sctp_send_cwr(struct sctp_tcb *stcb, struct sctp_nets *net, uint32_t high_tsn, u
asoc->ctrl_queue_cnt++;
}
-void
-sctp_add_stream_reset_out(struct sctp_tmit_chunk *chk,
- int number_entries, uint16_t * list,
+static int
+sctp_add_stream_reset_out(struct sctp_tcb *stcb, struct sctp_tmit_chunk *chk,
uint32_t seq, uint32_t resp_seq, uint32_t last_sent)
{
uint16_t len, old_len, i;
struct sctp_stream_reset_out_request *req_out;
struct sctp_chunkhdr *ch;
+ int at;
+ int number_entries = 0;
ch = mtod(chk->data, struct sctp_chunkhdr *);
old_len = len = SCTP_SIZE32(ntohs(ch->chunk_length));
-
/* get to new offset for the param. */
req_out = (struct sctp_stream_reset_out_request *)((caddr_t)ch + len);
/* now how long will this param be? */
+ for (i = 0; i < stcb->asoc.streamoutcnt; i++) {
+ if ((stcb->asoc.strmout[i].state == SCTP_STREAM_RESET_PENDING) &&
+ (stcb->asoc.strmout[i].chunks_on_queues == 0) &&
+ TAILQ_EMPTY(&stcb->asoc.strmout[i].outqueue)) {
+ number_entries++;
+ }
+ }
+ if (number_entries == 0) {
+ return (0);
+ }
+ if (number_entries == stcb->asoc.streamoutcnt) {
+ number_entries = 0;
+ }
+ if (number_entries > SCTP_MAX_STREAMS_AT_ONCE_RESET) {
+ number_entries = SCTP_MAX_STREAMS_AT_ONCE_RESET;
+ }
len = (sizeof(struct sctp_stream_reset_out_request) + (sizeof(uint16_t) * number_entries));
req_out->ph.param_type = htons(SCTP_STR_RESET_OUT_REQUEST);
req_out->ph.param_length = htons(len);
req_out->request_seq = htonl(seq);
req_out->response_seq = htonl(resp_seq);
req_out->send_reset_at_tsn = htonl(last_sent);
+ at = 0;
if (number_entries) {
- for (i = 0; i < number_entries; i++) {
- req_out->list_of_streams[i] = htons(list[i]);
+ for (i = 0; i < stcb->asoc.streamoutcnt; i++) {
+ if ((stcb->asoc.strmout[i].state == SCTP_STREAM_RESET_PENDING) &&
+ (stcb->asoc.strmout[i].chunks_on_queues == 0) &&
+ TAILQ_EMPTY(&stcb->asoc.strmout[i].outqueue)) {
+ req_out->list_of_streams[at] = htons(i);
+ at++;
+ stcb->asoc.strmout[i].state = SCTP_STREAM_RESET_IN_FLIGHT;
+ if (at >= number_entries) {
+ break;
+ }
+ }
+ }
+ } else {
+ for (i = 0; i < stcb->asoc.streamoutcnt; i++) {
+ stcb->asoc.strmout[i].state = SCTP_STREAM_RESET_IN_FLIGHT;
}
}
if (SCTP_SIZE32(len) > len) {
@@ -11550,7 +11630,7 @@ sctp_add_stream_reset_out(struct sctp_tmit_chunk *chk,
chk->book_size_scale = 0;
chk->send_size = SCTP_SIZE32(chk->book_size);
SCTP_BUF_LEN(chk->data) = chk->send_size;
- return;
+ return (1);
}
static void
@@ -11652,6 +11732,68 @@ sctp_add_stream_reset_result(struct sctp_tmit_chunk *chk,
}
void
+sctp_send_deferred_reset_response(struct sctp_tcb *stcb,
+ struct sctp_stream_reset_list *ent,
+ int response)
+{
+ struct sctp_association *asoc;
+ struct sctp_tmit_chunk *chk;
+ struct sctp_chunkhdr *ch;
+
+ asoc = &stcb->asoc;
+
+ /*
+ * Reset our last reset action to the new one IP -> response
+ * (PERFORMED probably). This assures that if we fail to send, a
+ * retran from the peer will get the new response.
+ */
+ asoc->last_reset_action[0] = response;
+ if (asoc->stream_reset_outstanding) {
+ return;
+ }
+ sctp_alloc_a_chunk(stcb, chk);
+ if (chk == NULL) {
+ SCTP_LTRACE_ERR_RET(NULL, stcb, NULL, SCTP_FROM_SCTP_OUTPUT, ENOMEM);
+ return;
+ }
+ chk->copy_by_ref = 0;
+ chk->rec.chunk_id.id = SCTP_STREAM_RESET;
+ chk->rec.chunk_id.can_take_data = 0;
+ chk->flags = 0;
+ chk->asoc = &stcb->asoc;
+ chk->book_size = sizeof(struct sctp_chunkhdr);
+ chk->send_size = SCTP_SIZE32(chk->book_size);
+ chk->book_size_scale = 0;
+ chk->data = sctp_get_mbuf_for_msg(MCLBYTES, 0, M_NOWAIT, 1, MT_DATA);
+ if (chk->data == NULL) {
+ sctp_free_a_chunk(stcb, chk, SCTP_SO_LOCKED);
+ SCTP_LTRACE_ERR_RET(NULL, stcb, NULL, SCTP_FROM_SCTP_OUTPUT, ENOMEM);
+ return;
+ }
+ SCTP_BUF_RESV_UF(chk->data, SCTP_MIN_OVERHEAD);
+ sctp_add_stream_reset_result(chk, ent->seq, response);
+ /* setup chunk parameters */
+ chk->sent = SCTP_DATAGRAM_UNSENT;
+ chk->snd_count = 0;
+ if (stcb->asoc.alternate) {
+ chk->whoTo = stcb->asoc.alternate;
+ } else {
+ chk->whoTo = stcb->asoc.primary_destination;
+ }
+ ch = mtod(chk->data, struct sctp_chunkhdr *);
+ ch->chunk_type = SCTP_STREAM_RESET;
+ ch->chunk_flags = 0;
+ ch->chunk_length = htons(chk->book_size);
+ atomic_add_int(&chk->whoTo->ref_count, 1);
+ SCTP_BUF_LEN(chk->data) = chk->send_size;
+ /* insert the chunk for sending */
+ TAILQ_INSERT_TAIL(&asoc->control_send_queue,
+ chk,
+ sctp_next);
+ asoc->ctrl_queue_cnt++;
+}
+
+void
sctp_add_stream_reset_result_tsn(struct sctp_tmit_chunk *chk,
uint32_t resp_seq, uint32_t result,
uint32_t send_una, uint32_t recv_next)
@@ -11749,19 +11891,90 @@ sctp_add_an_in_stream(struct sctp_tmit_chunk *chk,
}
int
+sctp_send_stream_reset_out_if_possible(struct sctp_tcb *stcb, int so_locked)
+{
+ struct sctp_association *asoc;
+ struct sctp_tmit_chunk *chk;
+ struct sctp_chunkhdr *ch;
+ uint32_t seq;
+
+ asoc = &stcb->asoc;
+ asoc->trigger_reset = 0;
+ if (asoc->stream_reset_outstanding) {
+ return (EALREADY);
+ }
+ sctp_alloc_a_chunk(stcb, chk);
+ if (chk == NULL) {
+ SCTP_LTRACE_ERR_RET(NULL, stcb, NULL, SCTP_FROM_SCTP_OUTPUT, ENOMEM);
+ return (ENOMEM);
+ }
+ chk->copy_by_ref = 0;
+ chk->rec.chunk_id.id = SCTP_STREAM_RESET;
+ chk->rec.chunk_id.can_take_data = 0;
+ chk->flags = 0;
+ chk->asoc = &stcb->asoc;
+ chk->book_size = sizeof(struct sctp_chunkhdr);
+ chk->send_size = SCTP_SIZE32(chk->book_size);
+ chk->book_size_scale = 0;
+ chk->data = sctp_get_mbuf_for_msg(MCLBYTES, 0, M_NOWAIT, 1, MT_DATA);
+ if (chk->data == NULL) {
+ sctp_free_a_chunk(stcb, chk, so_locked);
+ SCTP_LTRACE_ERR_RET(NULL, stcb, NULL, SCTP_FROM_SCTP_OUTPUT, ENOMEM);
+ return (ENOMEM);
+ }
+ SCTP_BUF_RESV_UF(chk->data, SCTP_MIN_OVERHEAD);
+
+ /* setup chunk parameters */
+ chk->sent = SCTP_DATAGRAM_UNSENT;
+ chk->snd_count = 0;
+ if (stcb->asoc.alternate) {
+ chk->whoTo = stcb->asoc.alternate;
+ } else {
+ chk->whoTo = stcb->asoc.primary_destination;
+ }
+ ch = mtod(chk->data, struct sctp_chunkhdr *);
+ ch->chunk_type = SCTP_STREAM_RESET;
+ ch->chunk_flags = 0;
+ ch->chunk_length = htons(chk->book_size);
+ atomic_add_int(&chk->whoTo->ref_count, 1);
+ SCTP_BUF_LEN(chk->data) = chk->send_size;
+ seq = stcb->asoc.str_reset_seq_out;
+ if (sctp_add_stream_reset_out(stcb, chk, seq, (stcb->asoc.str_reset_seq_in - 1), (stcb->asoc.sending_seq - 1))) {
+ seq++;
+ asoc->stream_reset_outstanding++;
+ } else {
+ m_freem(chk->data);
+ chk->data = NULL;
+ sctp_free_a_chunk(stcb, chk, so_locked);
+ return (ENOENT);
+ }
+ asoc->str_reset = chk;
+ /* insert the chunk for sending */
+ TAILQ_INSERT_TAIL(&asoc->control_send_queue,
+ chk,
+ sctp_next);
+ asoc->ctrl_queue_cnt++;
+
+ if (stcb->asoc.send_sack) {
+ sctp_send_sack(stcb, so_locked);
+ }
+ sctp_timer_start(SCTP_TIMER_TYPE_STRRESET, stcb->sctp_ep, stcb, chk->whoTo);
+ return (0);
+}
+
+int
sctp_send_str_reset_req(struct sctp_tcb *stcb,
uint16_t number_entries, uint16_t * list,
- uint8_t send_out_req,
uint8_t send_in_req,
uint8_t send_tsn_req,
uint8_t add_stream,
uint16_t adding_o,
uint16_t adding_i, uint8_t peer_asked)
{
-
struct sctp_association *asoc;
struct sctp_tmit_chunk *chk;
struct sctp_chunkhdr *ch;
+ int can_send_out_req = 0;
uint32_t seq;
asoc = &stcb->asoc;
@@ -11772,16 +11985,18 @@ sctp_send_str_reset_req(struct sctp_tcb *stcb,
SCTP_LTRACE_ERR_RET(NULL, stcb, NULL, SCTP_FROM_SCTP_OUTPUT, EBUSY);
return (EBUSY);
}
- if ((send_out_req == 0) && (send_in_req == 0) && (send_tsn_req == 0) &&
+ if ((send_in_req == 0) && (send_tsn_req == 0) &&
(add_stream == 0)) {
/* nothing to do */
SCTP_LTRACE_ERR_RET(NULL, stcb, NULL, SCTP_FROM_SCTP_OUTPUT, EINVAL);
return (EINVAL);
}
- if (send_tsn_req && (send_out_req || send_in_req)) {
+ if (send_tsn_req && send_in_req) {
/* error, can't do that */
SCTP_LTRACE_ERR_RET(NULL, stcb, NULL, SCTP_FROM_SCTP_OUTPUT, EINVAL);
return (EINVAL);
+ } else if (send_in_req) {
+ can_send_out_req = 1;
}
if (number_entries > (MCLBYTES -
SCTP_MIN_OVERHEAD -
@@ -11829,12 +12044,14 @@ sctp_send_str_reset_req(struct sctp_tcb *stcb,
SCTP_BUF_LEN(chk->data) = chk->send_size;
seq = stcb->asoc.str_reset_seq_out;
- if (send_out_req) {
- sctp_add_stream_reset_out(chk, number_entries, list,
- seq, (stcb->asoc.str_reset_seq_in - 1), (stcb->asoc.sending_seq - 1));
- asoc->stream_reset_out_is_outstanding = 1;
- seq++;
- asoc->stream_reset_outstanding++;
+ if (can_send_out_req) {
+ int ret;
+
+ ret = sctp_add_stream_reset_out(stcb, chk, seq, (stcb->asoc.str_reset_seq_in - 1), (stcb->asoc.sending_seq - 1));
+ if (ret) {
+ seq++;
+ asoc->stream_reset_outstanding++;
+ }
}
if ((add_stream & 1) &&
((stcb->asoc.strm_realoutsize - stcb->asoc.streamoutcnt) < adding_o)) {
@@ -11851,7 +12068,7 @@ sctp_send_str_reset_req(struct sctp_tcb *stcb,
oldstream = stcb->asoc.strmout;
/* get some more */
SCTP_MALLOC(stcb->asoc.strmout, struct sctp_stream_out *,
- ((stcb->asoc.streamoutcnt + adding_o) * sizeof(struct sctp_stream_out)),
+ (stcb->asoc.streamoutcnt + adding_o) * sizeof(struct sctp_stream_out),
SCTP_M_STRMO);
if (stcb->asoc.strmout == NULL) {
uint8_t x;
@@ -11874,6 +12091,7 @@ sctp_send_str_reset_req(struct sctp_tcb *stcb,
stcb->asoc.strmout[i].next_sequence_send = oldstream[i].next_sequence_send;
stcb->asoc.strmout[i].last_msg_incomplete = oldstream[i].last_msg_incomplete;
stcb->asoc.strmout[i].stream_no = i;
+ stcb->asoc.strmout[i].state = oldstream[i].state;
stcb->asoc.ss_functions.sctp_ss_init_stream(&stcb->asoc.strmout[i], &oldstream[i]);
/* now anything on those queues? */
TAILQ_FOREACH_SAFE(sp, &oldstream[i].outqueue, next, nsp) {
@@ -11906,6 +12124,7 @@ sctp_send_str_reset_req(struct sctp_tcb *stcb,
stcb->asoc.strmout[i].stream_no = i;
stcb->asoc.strmout[i].last_msg_incomplete = 0;
stcb->asoc.ss_functions.sctp_ss_init_stream(&stcb->asoc.strmout[i], NULL);
+ stcb->asoc.strmout[i].state = SCTP_STREAM_CLOSED;
}
stcb->asoc.strm_realoutsize = stcb->asoc.streamoutcnt + adding_o;
SCTP_FREE(oldstream, SCTP_M_STRMO);
@@ -11939,6 +12158,9 @@ skip_stuff:
chk,
sctp_next);
asoc->ctrl_queue_cnt++;
+ if (stcb->asoc.send_sack) {
+ sctp_send_sack(stcb, SCTP_SO_LOCKED);
+ }
sctp_timer_start(SCTP_TIMER_TYPE_STRRESET, stcb->sctp_ep, stcb, chk->whoTo);
return (0);
}
@@ -12393,6 +12615,7 @@ sctp_lower_sosend(struct socket *so,
}
#endif
stcb = sctp_aloc_assoc(inp, addr, &error, 0, vrf_id,
+ inp->sctp_ep.pre_open_stream_count,
p
);
if (stcb == NULL) {
@@ -12515,12 +12738,24 @@ sctp_lower_sosend(struct socket *so,
SCTP_ASOC_CREATE_UNLOCK(inp);
create_lock_applied = 0;
}
- if (asoc->stream_reset_outstanding) {
+ /* Is the stream no. valid? */
+ if (srcv->sinfo_stream >= asoc->streamoutcnt) {
+ /* Invalid stream number */
+ SCTP_LTRACE_ERR_RET(inp, stcb, net, SCTP_FROM_SCTP_OUTPUT, EINVAL);
+ error = EINVAL;
+ goto out_unlocked;
+ }
+ if ((asoc->strmout[srcv->sinfo_stream].state != SCTP_STREAM_OPEN) &&
+ (asoc->strmout[srcv->sinfo_stream].state != SCTP_STREAM_OPENING)) {
/*
* Can't queue any data while stream reset is underway.
*/
- SCTP_LTRACE_ERR_RET(inp, stcb, net, SCTP_FROM_SCTP_OUTPUT, EAGAIN);
- error = EAGAIN;
+ if (asoc->strmout[srcv->sinfo_stream].state > SCTP_STREAM_OPEN) {
+ error = EAGAIN;
+ } else {
+ error = EINVAL;
+ }
+ SCTP_LTRACE_ERR_RET(inp, stcb, net, SCTP_FROM_SCTP_OUTPUT, error);
goto out_unlocked;
}
if ((SCTP_GET_STATE(asoc) == SCTP_STATE_COOKIE_WAIT) ||
@@ -12659,13 +12894,6 @@ sctp_lower_sosend(struct socket *so,
SCTP_TCB_UNLOCK(stcb);
hold_tcblock = 0;
}
- /* Is the stream no. valid? */
- if (srcv->sinfo_stream >= asoc->streamoutcnt) {
- /* Invalid stream number */
- SCTP_LTRACE_ERR_RET(inp, stcb, net, SCTP_FROM_SCTP_OUTPUT, EINVAL);
- error = EINVAL;
- goto out_unlocked;
- }
if (asoc->strmout == NULL) {
/* huh? software error */
SCTP_LTRACE_ERR_RET(inp, stcb, net, SCTP_FROM_SCTP_OUTPUT, EFAULT);
@@ -12961,7 +13189,7 @@ skip_preblock:
/*-
* Ok, Nagle is set on and we have data outstanding.
* Don't send anything and let SACKs drive out the
- * data unless wen have a "full" segment to send.
+ * data unless we have a "full" segment to send.
*/
if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_NAGLE_LOGGING_ENABLE) {
sctp_log_nagle_event(stcb, SCTP_NAGLE_APPLIED);
@@ -13170,13 +13398,20 @@ dataless_eof:
if (TAILQ_EMPTY(&asoc->send_queue) &&
TAILQ_EMPTY(&asoc->sent_queue) &&
(asoc->state & SCTP_STATE_PARTIAL_MSG_LEFT)) {
+ struct mbuf *op_err;
+ char msg[SCTP_DIAG_INFO_LEN];
+
abort_anyway:
if (free_cnt_applied) {
atomic_add_int(&stcb->asoc.refcnt, -1);
free_cnt_applied = 0;
}
+ snprintf(msg, sizeof(msg),
+ "%s:%d at %s", __FILE__, __LINE__, __func__);
+ op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code),
+ msg);
sctp_abort_an_association(stcb->sctp_ep, stcb,
- NULL, SCTP_SO_LOCKED);
+ op_err, SCTP_SO_LOCKED);
/*
* now relock the stcb so everything
* is sane
@@ -13316,13 +13551,6 @@ out_unlocked:
}
}
#endif
-#ifdef INVARIANTS
- if (inp) {
- sctp_validate_no_locks(inp);
- } else {
- SCTP_PRINTF("Warning - inp is NULL so cant validate locks\n");
- }
-#endif
if (top) {
sctp_m_freem(top);
}
diff --git a/sys/netinet/sctp_output.h b/sys/netinet/sctp_output.h
index 8e45e5c..d7222c4 100644
--- a/sys/netinet/sctp_output.h
+++ b/sys/netinet/sctp_output.h
@@ -170,18 +170,21 @@ void sctp_send_cwr(struct sctp_tcb *, struct sctp_nets *, uint32_t, uint8_t);
void
-sctp_add_stream_reset_out(struct sctp_tmit_chunk *,
- int, uint16_t *, uint32_t, uint32_t, uint32_t);
+ sctp_add_stream_reset_result(struct sctp_tmit_chunk *, uint32_t, uint32_t);
void
- sctp_add_stream_reset_result(struct sctp_tmit_chunk *, uint32_t, uint32_t);
+sctp_send_deferred_reset_response(struct sctp_tcb *,
+ struct sctp_stream_reset_list *,
+ int);
void
sctp_add_stream_reset_result_tsn(struct sctp_tmit_chunk *,
uint32_t, uint32_t, uint32_t, uint32_t);
+int
+ sctp_send_stream_reset_out_if_possible(struct sctp_tcb *, int);
int
-sctp_send_str_reset_req(struct sctp_tcb *, uint16_t, uint16_t *, uint8_t,
+sctp_send_str_reset_req(struct sctp_tcb *, uint16_t, uint16_t *,
uint8_t, uint8_t, uint8_t, uint16_t, uint16_t, uint8_t);
void
diff --git a/sys/netinet/sctp_pcb.c b/sys/netinet/sctp_pcb.c
index 344cdfc..39872e4 100644
--- a/sys/netinet/sctp_pcb.c
+++ b/sys/netinet/sctp_pcb.c
@@ -1115,7 +1115,7 @@ sctp_tcb_special_locate(struct sctp_inpcb **inp_p, struct sockaddr *from,
LIST_FOREACH(laddr, &inp->sctp_addr_list, sctp_nxt_addr) {
if (laddr->ifa == NULL) {
- SCTPDBG(SCTP_DEBUG_PCB1, "%s: NULL ifa\n", __FUNCTION__);
+ SCTPDBG(SCTP_DEBUG_PCB1, "%s: NULL ifa\n", __func__);
continue;
}
if (laddr->ifa->localifa_flags & SCTP_BEING_DELETED) {
@@ -1773,7 +1773,7 @@ sctp_endpoint_probe(struct sockaddr *nam, struct sctppcbhead *head,
LIST_FOREACH(laddr, &inp->sctp_addr_list, sctp_nxt_addr) {
if (laddr->ifa == NULL) {
SCTPDBG(SCTP_DEBUG_PCB1, "%s: NULL ifa\n",
- __FUNCTION__);
+ __func__);
continue;
}
SCTPDBG(SCTP_DEBUG_PCB1, "Ok laddr->ifa:%p is possible, ",
@@ -2269,8 +2269,12 @@ sctp_findassociation_addr(struct mbuf *m, int offset,
}
}
find_tcp_pool = 0;
- if ((ch->chunk_type != SCTP_INITIATION) &&
- (ch->chunk_type != SCTP_INITIATION_ACK) &&
+ /*
+ * Don't consider INIT chunks since that breaks 1-to-1 sockets: When
+ * a server closes the listener, incoming INIT chunks are not
+ * responsed by an INIT-ACK chunk.
+ */
+ if ((ch->chunk_type != SCTP_INITIATION_ACK) &&
(ch->chunk_type != SCTP_COOKIE_ACK) &&
(ch->chunk_type != SCTP_COOKIE_ECHO)) {
/* Other chunk types go to the tcp pool. */
@@ -2343,7 +2347,7 @@ sctp_findassociation_ep_asconf(struct mbuf *m, int offset,
&parm_buf, sizeof(struct sctp_paramhdr));
if (phdr == NULL) {
SCTPDBG(SCTP_DEBUG_INPUT3, "%s: failed to get asconf lookup addr\n",
- __FUNCTION__);
+ __func__);
return NULL;
}
ptype = (int)((uint32_t) ntohs(phdr->param_type));
@@ -2363,7 +2367,7 @@ sctp_findassociation_ep_asconf(struct mbuf *m, int offset,
&p6_buf.ph, sizeof(*p6));
if (p6 == NULL) {
SCTPDBG(SCTP_DEBUG_INPUT3, "%s: failed to get asconf v6 lookup addr\n",
- __FUNCTION__);
+ __func__);
return (NULL);
}
sin6 = &remote_store.sin6;
@@ -2390,7 +2394,7 @@ sctp_findassociation_ep_asconf(struct mbuf *m, int offset,
&p4_buf.ph, sizeof(*p4));
if (p4 == NULL) {
SCTPDBG(SCTP_DEBUG_INPUT3, "%s: failed to get asconf v4 lookup addr\n",
- __FUNCTION__);
+ __func__);
return (NULL);
}
sin = &remote_store.sin;
@@ -2499,14 +2503,7 @@ sctp_inpcb_alloc(struct socket *so, uint32_t vrf_id)
return (ENOBUFS);
}
#ifdef IPSEC
- {
- struct inpcbpolicy *pcb_sp = NULL;
-
- error = ipsec_init_policy(so, &pcb_sp);
- /* Arrange to share the policy */
- inp->ip_inp.inp.inp_sp = pcb_sp;
- ((struct in6pcb *)(&inp->ip_inp.inp))->in6p_sp = pcb_sp;
- }
+ error = ipsec_init_policy(so, &inp->ip_inp.inp.inp_sp);
if (error != 0) {
crfree(inp->ip_inp.inp.inp_cred);
SCTP_ZONE_FREE(SCTP_BASE_INFO(ipi_zone_ep), inp);
@@ -2540,6 +2537,9 @@ sctp_inpcb_alloc(struct socket *so, uint32_t vrf_id)
SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_PCB, EOPNOTSUPP);
so->so_pcb = NULL;
crfree(inp->ip_inp.inp.inp_cred);
+#ifdef IPSEC
+ ipsec_delete_pcbpolicy(&inp->ip_inp.inp);
+#endif
SCTP_ZONE_FREE(SCTP_BASE_INFO(ipi_zone_ep), inp);
return (EOPNOTSUPP);
}
@@ -2560,6 +2560,9 @@ sctp_inpcb_alloc(struct socket *so, uint32_t vrf_id)
SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_PCB, ENOBUFS);
so->so_pcb = NULL;
crfree(inp->ip_inp.inp.inp_cred);
+#ifdef IPSEC
+ ipsec_delete_pcbpolicy(&inp->ip_inp.inp);
+#endif
SCTP_ZONE_FREE(SCTP_BASE_INFO(ipi_zone_ep), inp);
return (ENOBUFS);
}
@@ -3644,13 +3647,9 @@ sctp_inpcb_free(struct sctp_inpcb *inp, int immediate, int from)
* macro here since le_next will get freed as part of the
* sctp_free_assoc() call.
*/
- if (so) {
#ifdef IPSEC
- ipsec_delete_pcbpolicy(ip_pcb);
-#endif /* IPSEC */
-
- /* Unlocks not needed since the socket is gone now */
- }
+ ipsec_delete_pcbpolicy(ip_pcb);
+#endif
if (ip_pcb->inp_options) {
(void)sctp_m_free(ip_pcb->inp_options);
ip_pcb->inp_options = 0;
@@ -4169,6 +4168,7 @@ try_again:
struct sctp_tcb *
sctp_aloc_assoc(struct sctp_inpcb *inp, struct sockaddr *firstaddr,
int *error, uint32_t override_tag, uint32_t vrf_id,
+ uint16_t o_streams,
struct thread *p
)
{
@@ -4327,7 +4327,7 @@ sctp_aloc_assoc(struct sctp_inpcb *inp, struct sockaddr *firstaddr,
/* setup back pointer's */
stcb->sctp_ep = inp;
stcb->sctp_socket = inp->sctp_socket;
- if ((err = sctp_init_asoc(inp, stcb, override_tag, vrf_id))) {
+ if ((err = sctp_init_asoc(inp, stcb, override_tag, vrf_id, o_streams))) {
/* failed */
SCTP_TCB_LOCK_DESTROY(stcb);
SCTP_TCB_SEND_LOCK_DESTROY(stcb);
@@ -5304,7 +5304,7 @@ sctp_update_ep_vflag(struct sctp_inpcb *inp)
LIST_FOREACH(laddr, &inp->sctp_addr_list, sctp_nxt_addr) {
if (laddr->ifa == NULL) {
SCTPDBG(SCTP_DEBUG_PCB1, "%s: NULL ifa\n",
- __FUNCTION__);
+ __func__);
continue;
}
if (laddr->ifa->localifa_flags & SCTP_BEING_DELETED) {
@@ -6254,12 +6254,20 @@ sctp_load_addresses_from_init(struct sctp_tcb *stcb, struct mbuf *m,
*/
if (stcb_tmp) {
if (SCTP_GET_STATE(&stcb_tmp->asoc) & SCTP_STATE_COOKIE_WAIT) {
+ struct mbuf *op_err;
+ char msg[SCTP_DIAG_INFO_LEN];
+
/*
* in setup state we
* abort this guy
*/
+ snprintf(msg, sizeof(msg),
+ "%s:%d at %s", __FILE__, __LINE__, __func__);
+ op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code),
+ msg);
sctp_abort_an_association(stcb_tmp->sctp_ep,
- stcb_tmp, NULL, SCTP_SO_NOT_LOCKED);
+ stcb_tmp, op_err,
+ SCTP_SO_NOT_LOCKED);
goto add_it_now;
}
SCTP_TCB_UNLOCK(stcb_tmp);
@@ -6343,18 +6351,26 @@ sctp_load_addresses_from_init(struct sctp_tcb *stcb, struct mbuf *m,
* strange, address is in another
* assoc? straighten out locks.
*/
- if (stcb_tmp)
+ if (stcb_tmp) {
if (SCTP_GET_STATE(&stcb_tmp->asoc) & SCTP_STATE_COOKIE_WAIT) {
+ struct mbuf *op_err;
+ char msg[SCTP_DIAG_INFO_LEN];
+
/*
* in setup state we
* abort this guy
*/
+ snprintf(msg, sizeof(msg),
+ "%s:%d at %s", __FILE__, __LINE__, __func__);
+ op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code),
+ msg);
sctp_abort_an_association(stcb_tmp->sctp_ep,
- stcb_tmp, NULL, SCTP_SO_NOT_LOCKED);
+ stcb_tmp, op_err,
+ SCTP_SO_NOT_LOCKED);
goto add_it_now6;
}
- SCTP_TCB_UNLOCK(stcb_tmp);
-
+ SCTP_TCB_UNLOCK(stcb_tmp);
+ }
if (stcb->asoc.state == 0) {
/* the assoc was freed? */
return (-21);
diff --git a/sys/netinet/sctp_pcb.h b/sys/netinet/sctp_pcb.h
index f5ede2a..165ef3b 100644
--- a/sys/netinet/sctp_pcb.h
+++ b/sys/netinet/sctp_pcb.h
@@ -584,7 +584,7 @@ void sctp_inpcb_free(struct sctp_inpcb *, int, int);
struct sctp_tcb *
sctp_aloc_assoc(struct sctp_inpcb *, struct sockaddr *,
- int *, uint32_t, uint32_t, struct thread *);
+ int *, uint32_t, uint32_t, uint16_t, struct thread *);
int sctp_free_assoc(struct sctp_inpcb *, struct sctp_tcb *, int, int);
@@ -654,11 +654,5 @@ void
#endif
-#ifdef INVARIANTS
-void
- sctp_validate_no_locks(struct sctp_inpcb *inp);
-
-#endif
-
#endif /* _KERNEL */
#endif /* !__sctp_pcb_h__ */
diff --git a/sys/netinet/sctp_structs.h b/sys/netinet/sctp_structs.h
index 8f61cd7..eda99fe 100644
--- a/sys/netinet/sctp_structs.h
+++ b/sys/netinet/sctp_structs.h
@@ -76,6 +76,7 @@ TAILQ_HEAD(sctpnetlisthead, sctp_nets);
struct sctp_stream_reset_list {
TAILQ_ENTRY(sctp_stream_reset_list) next_resp;
+ uint32_t seq;
uint32_t tsn;
uint32_t number_entries;
uint16_t list_of_streams[];
@@ -580,11 +581,20 @@ union scheduling_parameters {
struct ss_fb fb;
};
+/* States for outgoing streams */
+#define SCTP_STREAM_CLOSED 0x00
+#define SCTP_STREAM_OPENING 0x01
+#define SCTP_STREAM_OPEN 0x02
+#define SCTP_STREAM_RESET_PENDING 0x03
+#define SCTP_STREAM_RESET_IN_FLIGHT 0x04
+
+#define SCTP_MAX_STREAMS_AT_ONCE_RESET 200
+
/* This struct is used to track the traffic on outbound streams */
struct sctp_stream_out {
struct sctp_streamhead outqueue;
union scheduling_parameters ss_params;
- uint32_t chunks_on_queues;
+ uint32_t chunks_on_queues; /* send queue and sent queue */
#if defined(SCTP_DETAILED_STR_STATS)
uint32_t abandoned_unsent[SCTP_PR_SCTP_MAX + 1];
uint32_t abandoned_sent[SCTP_PR_SCTP_MAX + 1];
@@ -596,6 +606,7 @@ struct sctp_stream_out {
uint16_t stream_no;
uint16_t next_sequence_send; /* next one I expect to send out */
uint8_t last_msg_incomplete;
+ uint8_t state;
};
/* used to keep track of the addresses yet to try to add/delete */
@@ -1148,7 +1159,7 @@ struct sctp_association {
uint8_t hb_random_idx;
uint8_t default_dscp;
uint8_t asconf_del_pending; /* asconf delete last addr pending */
-
+ uint8_t trigger_reset;
/*
* This value, plus all other ack'd but above cum-ack is added
* together to cross check against the bit that we have yet to
diff --git a/sys/netinet/sctp_sysctl.c b/sys/netinet/sctp_sysctl.c
index 997ee53..1b35af7 100644
--- a/sys/netinet/sctp_sysctl.c
+++ b/sys/netinet/sctp_sysctl.c
@@ -453,7 +453,7 @@ sctp_sysctl_handle_assoclist(SYSCTL_HANDLER_ARGS)
if (stcb->asoc.primary_destination != NULL)
xstcb.primary_addr = stcb->asoc.primary_destination->ro._l_addr;
xstcb.heartbeat_interval = stcb->asoc.heart_beat_delay;
- xstcb.state = SCTP_GET_STATE(&stcb->asoc); /* FIXME */
+ xstcb.state = (uint32_t) sctp_map_assoc_state(stcb->asoc.state);
/* 7.0 does not support these */
xstcb.assoc_id = sctp_get_associd(stcb);
xstcb.peers_rwnd = stcb->asoc.peers_rwnd;
@@ -511,6 +511,7 @@ sctp_sysctl_handle_assoclist(SYSCTL_HANDLER_ARGS)
xraddr.mtu = net->mtu;
xraddr.rtt = net->rtt / 1000;
xraddr.heartbeat_interval = net->heart_beat_delay;
+ xraddr.ssthresh = net->ssthresh;
xraddr.start_time.tv_sec = (uint32_t) net->start_time.tv_sec;
xraddr.start_time.tv_usec = (uint32_t) net->start_time.tv_usec;
SCTP_INP_RUNLOCK(inp);
diff --git a/sys/netinet/sctp_sysctl.h b/sys/netinet/sctp_sysctl.h
index 857bda1..8233343 100644
--- a/sys/netinet/sctp_sysctl.h
+++ b/sys/netinet/sctp_sysctl.h
@@ -291,10 +291,10 @@ struct sctp_sysctl {
#define SCTPCTL_PMTU_RAISE_TIME_DEFAULT SCTP_DEF_PMTU_RAISE_SEC
/* shutdown_guard_time: Default shutdown guard timer in seconds */
-#define SCTPCTL_SHUTDOWN_GUARD_TIME_DESC "Default shutdown guard timer in seconds"
+#define SCTPCTL_SHUTDOWN_GUARD_TIME_DESC "Shutdown guard timer in seconds (0 means 5 times RTO.Max)"
#define SCTPCTL_SHUTDOWN_GUARD_TIME_MIN 0
#define SCTPCTL_SHUTDOWN_GUARD_TIME_MAX 0xFFFFFFFF
-#define SCTPCTL_SHUTDOWN_GUARD_TIME_DEFAULT SCTP_DEF_MAX_SHUTDOWN_SEC
+#define SCTPCTL_SHUTDOWN_GUARD_TIME_DEFAULT 0
/* secret_lifetime: Default secret lifetime in seconds */
#define SCTPCTL_SECRET_LIFETIME_DESC "Default secret lifetime in seconds"
diff --git a/sys/netinet/sctp_timer.c b/sys/netinet/sctp_timer.c
index 257d188..0d684b3 100644
--- a/sys/netinet/sctp_timer.c
+++ b/sys/netinet/sctp_timer.c
@@ -153,7 +153,7 @@ sctp_threshold_management(struct sctp_inpcb *inp, struct sctp_tcb *stcb,
/* Abort notification sends a ULP notify */
struct mbuf *op_err;
- op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION,
+ op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code),
"Association error counter exceeded");
inp->last_abort_code = SCTP_FROM_SCTP_TIMER + SCTP_LOC_2;
sctp_abort_an_association(inp, stcb, op_err, SCTP_SO_NOT_LOCKED);
@@ -408,7 +408,11 @@ sctp_backoff_on_timeout(struct sctp_tcb *stcb,
int num_marked, int num_abandoned)
{
if (net->RTO == 0) {
- net->RTO = stcb->asoc.minrto;
+ if (net->RTO_measured) {
+ net->RTO = stcb->asoc.minrto;
+ } else {
+ net->RTO = stcb->asoc.initial_rto;
+ }
}
net->RTO <<= 1;
if (net->RTO > stcb->asoc.maxrto) {
@@ -438,6 +442,11 @@ sctp_recover_sent_list(struct sctp_tcb *stcb)
asoc->strmout[chk->rec.data.stream_number].chunks_on_queues--;
}
}
+ if ((asoc->strmout[chk->rec.data.stream_number].chunks_on_queues == 0) &&
+ (asoc->strmout[chk->rec.data.stream_number].state == SCTP_STREAM_RESET_PENDING) &&
+ TAILQ_EMPTY(&asoc->strmout[chk->rec.data.stream_number].outqueue)) {
+ asoc->trigger_reset = 1;
+ }
TAILQ_REMOVE(&asoc->sent_queue, chk, sctp_next);
if (PR_SCTP_ENABLED(chk->flags)) {
if (asoc->pr_sctp_cnt != 0)
@@ -1046,7 +1055,7 @@ sctp_cookie_timer(struct sctp_inpcb *inp,
/* FOOBAR! */
struct mbuf *op_err;
- op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION,
+ op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code),
"Cookie timer expired, but no cookie");
inp->last_abort_code = SCTP_FROM_SCTP_TIMER + SCTP_LOC_3;
sctp_abort_an_association(inp, stcb, op_err, SCTP_SO_NOT_LOCKED);
@@ -1492,6 +1501,8 @@ sctp_pathmtu_timer(struct sctp_inpcb *inp,
#endif
if (mtu > next_mtu) {
net->mtu = next_mtu;
+ } else {
+ net->mtu = mtu;
}
}
}
diff --git a/sys/netinet/sctp_uio.h b/sys/netinet/sctp_uio.h
index 9305413..ee31543 100644
--- a/sys/netinet/sctp_uio.h
+++ b/sys/netinet/sctp_uio.h
@@ -134,20 +134,27 @@ struct sctp_extrcvinfo {
uint16_t sinfo_flags;
uint32_t sinfo_ppid;
uint32_t sinfo_context;
- uint32_t sinfo_timetolive;
+ uint32_t sinfo_timetolive; /* should have been sinfo_pr_value */
uint32_t sinfo_tsn;
uint32_t sinfo_cumtsn;
sctp_assoc_t sinfo_assoc_id;
- uint16_t sreinfo_next_flags;
- uint16_t sreinfo_next_stream;
- uint32_t sreinfo_next_aid;
- uint32_t sreinfo_next_length;
- uint32_t sreinfo_next_ppid;
+ uint16_t serinfo_next_flags;
+ uint16_t serinfo_next_stream;
+ uint32_t serinfo_next_aid;
+ uint32_t serinfo_next_length;
+ uint32_t serinfo_next_ppid;
uint16_t sinfo_keynumber;
uint16_t sinfo_keynumber_valid;
uint8_t __reserve_pad[SCTP_ALIGN_RESV_PAD_SHORT];
};
+#define sinfo_pr_value sinfo_timetolive
+#define sreinfo_next_flags serinfo_next_flags
+#define sreinfo_next_stream serinfo_next_stream
+#define sreinfo_next_aid serinfo_next_aid
+#define sreinfo_next_length serinfo_next_length
+#define sreinfo_next_ppid serinfo_next_ppid
+
struct sctp_sndinfo {
uint16_t snd_sid;
uint16_t snd_flags;
@@ -1229,7 +1236,8 @@ struct xsctp_raddr {
struct sctp_timeval start_time; /* sctpAssocLocalRemEntry 8 */
uint32_t rtt;
uint32_t heartbeat_interval;
- uint32_t extra_padding[31]; /* future */
+ uint32_t ssthresh;
+ uint32_t extra_padding[30]; /* future */
};
#define SCTP_MAX_LOGGING_SIZE 30000
diff --git a/sys/netinet/sctp_usrreq.c b/sys/netinet/sctp_usrreq.c
index 907412c..2ea4eed 100644
--- a/sys/netinet/sctp_usrreq.c
+++ b/sys/netinet/sctp_usrreq.c
@@ -487,11 +487,6 @@ sctp_attach(struct socket *so, int proto SCTP_UNUSED, struct thread *p SCTP_UNUS
int error;
uint32_t vrf_id = SCTP_DEFAULT_VRFID;
-#ifdef IPSEC
- uint32_t flags;
-
-#endif
-
inp = (struct sctp_inpcb *)so->so_pcb;
if (inp != 0) {
SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
@@ -513,33 +508,6 @@ sctp_attach(struct socket *so, int proto SCTP_UNUSED, struct thread *p SCTP_UNUS
ip_inp = &inp->ip_inp.inp;
ip_inp->inp_vflag |= INP_IPV4;
ip_inp->inp_ip_ttl = MODULE_GLOBAL(ip_defttl);
-#ifdef IPSEC
- error = ipsec_init_policy(so, &ip_inp->inp_sp);
-#ifdef SCTP_LOG_CLOSING
- sctp_log_closing(inp, NULL, 17);
-#endif
- if (error != 0) {
-try_again:
- flags = inp->sctp_flags;
- if (((flags & SCTP_PCB_FLAGS_SOCKET_GONE) == 0) &&
- (atomic_cmpset_int(&inp->sctp_flags, flags, (flags | SCTP_PCB_FLAGS_SOCKET_GONE | SCTP_PCB_FLAGS_CLOSE_IP)))) {
-#ifdef SCTP_LOG_CLOSING
- sctp_log_closing(inp, NULL, 15);
-#endif
- SCTP_INP_WUNLOCK(inp);
- sctp_inpcb_free(inp, SCTP_FREE_SHOULD_USE_ABORT,
- SCTP_CALLED_AFTER_CMPSET_OFCLOSE);
- } else {
- flags = inp->sctp_flags;
- if ((flags & SCTP_PCB_FLAGS_SOCKET_GONE) == 0) {
- goto try_again;
- } else {
- SCTP_INP_WUNLOCK(inp);
- }
- }
- return (error);
- }
-#endif /* IPSEC */
SCTP_INP_WUNLOCK(inp);
return (0);
}
@@ -957,14 +925,15 @@ sctp_shutdown(struct socket *so)
SCTP_INP_RUNLOCK(inp);
SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EOPNOTSUPP);
return (EOPNOTSUPP);
- }
- /*
- * Ok if we reach here its the TCP model and it is either a SHUT_WR
- * or SHUT_RDWR. This means we put the shutdown flag against it.
- */
- {
+ } else {
+ /*
+ * Ok, if we reach here its the TCP model and it is either a
+ * SHUT_WR or SHUT_RDWR. This means we put the shutdown flag
+ * against it.
+ */
struct sctp_tcb *stcb;
struct sctp_association *asoc;
+ struct sctp_nets *netp;
if ((so->so_state &
(SS_ISCONNECTED | SS_ISCONNECTING | SS_ISDISCONNECTING)) == 0) {
@@ -976,7 +945,7 @@ sctp_shutdown(struct socket *so)
stcb = LIST_FIRST(&inp->sctp_asoc_list);
if (stcb == NULL) {
/*
- * Ok we hit the case that the shutdown call was
+ * Ok, we hit the case that the shutdown call was
* made after an abort or something. Nothing to do
* now.
*/
@@ -985,53 +954,48 @@ sctp_shutdown(struct socket *so)
}
SCTP_TCB_LOCK(stcb);
asoc = &stcb->asoc;
- if (TAILQ_EMPTY(&asoc->send_queue) &&
+ if (asoc->state & SCTP_STATE_ABOUT_TO_BE_FREED) {
+ SCTP_TCB_UNLOCK(stcb);
+ SCTP_INP_RUNLOCK(inp);
+ return (0);
+ }
+ if ((SCTP_GET_STATE(asoc) != SCTP_STATE_COOKIE_WAIT) &&
+ (SCTP_GET_STATE(asoc) != SCTP_STATE_COOKIE_ECHOED) &&
+ (SCTP_GET_STATE(asoc) != SCTP_STATE_OPEN)) {
+ /*
+ * If we are not in or before ESTABLISHED, there is
+ * no protocol action required.
+ */
+ SCTP_TCB_UNLOCK(stcb);
+ SCTP_INP_RUNLOCK(inp);
+ return (0);
+ }
+ if (stcb->asoc.alternate) {
+ netp = stcb->asoc.alternate;
+ } else {
+ netp = stcb->asoc.primary_destination;
+ }
+ if ((SCTP_GET_STATE(asoc) == SCTP_STATE_OPEN) &&
+ TAILQ_EMPTY(&asoc->send_queue) &&
TAILQ_EMPTY(&asoc->sent_queue) &&
(asoc->stream_queue_cnt == 0)) {
if (asoc->locked_on_sending) {
goto abort_anyway;
}
/* there is nothing queued to send, so I'm done... */
- if (SCTP_GET_STATE(asoc) != SCTP_STATE_SHUTDOWN_SENT) {
- /* only send SHUTDOWN the first time through */
- struct sctp_nets *netp;
-
- if ((SCTP_GET_STATE(asoc) == SCTP_STATE_OPEN) ||
- (SCTP_GET_STATE(asoc) == SCTP_STATE_SHUTDOWN_RECEIVED)) {
- SCTP_STAT_DECR_GAUGE32(sctps_currestab);
- }
- SCTP_SET_STATE(asoc, SCTP_STATE_SHUTDOWN_SENT);
- SCTP_CLEAR_SUBSTATE(asoc, SCTP_STATE_SHUTDOWN_PENDING);
- sctp_stop_timers_for_shutdown(stcb);
- if (stcb->asoc.alternate) {
- netp = stcb->asoc.alternate;
- } else {
- netp = stcb->asoc.primary_destination;
- }
- sctp_send_shutdown(stcb, netp);
- sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWN,
- stcb->sctp_ep, stcb, netp);
- sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWNGUARD,
- stcb->sctp_ep, stcb, netp);
- sctp_chunk_output(stcb->sctp_ep, stcb, SCTP_OUTPUT_FROM_T3, SCTP_SO_LOCKED);
- }
+ SCTP_STAT_DECR_GAUGE32(sctps_currestab);
+ SCTP_SET_STATE(asoc, SCTP_STATE_SHUTDOWN_SENT);
+ SCTP_CLEAR_SUBSTATE(asoc, SCTP_STATE_SHUTDOWN_PENDING);
+ sctp_stop_timers_for_shutdown(stcb);
+ sctp_send_shutdown(stcb, netp);
+ sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWN,
+ stcb->sctp_ep, stcb, netp);
} else {
/*
- * we still got (or just got) data to send, so set
- * SHUTDOWN_PENDING
+ * We still got (or just got) data to send, so set
+ * SHUTDOWN_PENDING.
*/
- struct sctp_nets *netp;
-
- if (stcb->asoc.alternate) {
- netp = stcb->asoc.alternate;
- } else {
- netp = stcb->asoc.primary_destination;
- }
-
- asoc->state |= SCTP_STATE_SHUTDOWN_PENDING;
- sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWNGUARD, stcb->sctp_ep, stcb,
- netp);
-
+ SCTP_ADD_SUBSTATE(asoc, SCTP_STATE_SHUTDOWN_PENDING);
if (asoc->locked_on_sending) {
/* Locked to send out the data */
struct sctp_stream_queue_pending *sp;
@@ -1042,7 +1006,7 @@ sctp_shutdown(struct socket *so)
asoc->locked_on_sending->stream_no);
} else {
if ((sp->length == 0) && (sp->msg_is_complete == 0)) {
- asoc->state |= SCTP_STATE_PARTIAL_MSG_LEFT;
+ SCTP_ADD_SUBSTATE(asoc, SCTP_STATE_PARTIAL_MSG_LEFT);
}
}
}
@@ -1056,16 +1020,20 @@ sctp_shutdown(struct socket *so)
stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_USRREQ + SCTP_LOC_6;
sctp_abort_an_association(stcb->sctp_ep, stcb,
op_err, SCTP_SO_LOCKED);
- goto skip_unlock;
- } else {
- sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_CLOSING, SCTP_SO_LOCKED);
+ SCTP_INP_RUNLOCK(inp);
+ return (0);
}
}
+ sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWNGUARD, stcb->sctp_ep, stcb, netp);
+ /*
+ * XXX: Why do this in the case where we have still data
+ * queued?
+ */
+ sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_CLOSING, SCTP_SO_LOCKED);
SCTP_TCB_UNLOCK(stcb);
+ SCTP_INP_RUNLOCK(inp);
+ return (0);
}
-skip_unlock:
- SCTP_INP_RUNLOCK(inp);
- return (0);
}
/*
@@ -1533,6 +1501,7 @@ sctp_do_connect_x(struct socket *so, struct sctp_inpcb *inp, void *optval,
/* We are GOOD to go */
stcb = sctp_aloc_assoc(inp, sa, &error, 0, vrf_id,
+ inp->sctp_ep.pre_open_stream_count,
(struct thread *)p
);
if (stcb == NULL) {
@@ -1914,8 +1883,15 @@ flags_out:
uint32_t *value, cnt;
SCTP_CHECK_AND_CAST(value, optval, uint32_t, *optsize);
- cnt = 0;
SCTP_INP_RLOCK(inp);
+ if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) ||
+ (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL)) {
+ /* Can't do this for a 1-1 socket */
+ error = EINVAL;
+ SCTP_INP_RUNLOCK(inp);
+ break;
+ }
+ cnt = 0;
LIST_FOREACH(stcb, &inp->sctp_asoc_list, sctp_tcblist) {
cnt++;
}
@@ -1930,9 +1906,16 @@ flags_out:
unsigned int at, limit;
SCTP_CHECK_AND_CAST(ids, optval, struct sctp_assoc_ids, *optsize);
+ SCTP_INP_RLOCK(inp);
+ if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) ||
+ (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL)) {
+ /* Can't do this for a 1-1 socket */
+ error = EINVAL;
+ SCTP_INP_RUNLOCK(inp);
+ break;
+ }
at = 0;
limit = (*optsize - sizeof(uint32_t)) / sizeof(sctp_assoc_t);
- SCTP_INP_RLOCK(inp);
LIST_FOREACH(stcb, &inp->sctp_asoc_list, sctp_tcblist) {
if (at < limit) {
ids->gaids_assoc_id[at++] = sctp_get_associd(stcb);
@@ -2668,12 +2651,7 @@ flags_out:
error = EINVAL;
break;
}
- /*
- * I think passing the state is fine since
- * sctp_constants.h will be available to the user
- * land.
- */
- sstat->sstat_state = stcb->asoc.state;
+ sstat->sstat_state = sctp_map_assoc_state(stcb->asoc.state);
sstat->sstat_assoc_id = sctp_get_associd(stcb);
sstat->sstat_rwnd = stcb->asoc.peers_rwnd;
sstat->sstat_unackdata = stcb->asoc.sent_queue_cnt;
@@ -4620,18 +4598,24 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize,
SCTP_TCB_UNLOCK(stcb);
break;
}
- if (stcb->asoc.stream_reset_outstanding) {
- SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EALREADY);
- error = EALREADY;
- SCTP_TCB_UNLOCK(stcb);
- break;
- }
if (strrst->srs_flags & SCTP_STREAM_RESET_INCOMING) {
send_in = 1;
+ if (stcb->asoc.stream_reset_outstanding) {
+ SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EALREADY);
+ error = EALREADY;
+ SCTP_TCB_UNLOCK(stcb);
+ break;
+ }
}
if (strrst->srs_flags & SCTP_STREAM_RESET_OUTGOING) {
send_out = 1;
}
+ if ((strrst->srs_number_streams > SCTP_MAX_STREAMS_AT_ONCE_RESET) && send_in) {
+ SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, ENOMEM);
+ error = ENOMEM;
+ SCTP_TCB_UNLOCK(stcb);
+ break;
+ }
if ((send_in == 0) && (send_out == 0)) {
SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
error = EINVAL;
@@ -4656,11 +4640,46 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize,
SCTP_TCB_UNLOCK(stcb);
break;
}
- error = sctp_send_str_reset_req(stcb, strrst->srs_number_streams,
- strrst->srs_stream_list,
- send_out, send_in, 0, 0, 0, 0, 0);
-
- sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_STRRST_REQ, SCTP_SO_LOCKED);
+ if (send_out) {
+ int cnt;
+ uint16_t strm;
+
+ if (strrst->srs_number_streams) {
+ for (i = 0, cnt = 0; i < strrst->srs_number_streams; i++) {
+ strm = strrst->srs_stream_list[i];
+ if (stcb->asoc.strmout[strm].state == SCTP_STREAM_OPEN) {
+ stcb->asoc.strmout[strm].state = SCTP_STREAM_RESET_PENDING;
+ cnt++;
+ }
+ }
+ } else {
+ /* Its all */
+ for (i = 0, cnt = 0; i < stcb->asoc.streamoutcnt; i++) {
+ if (stcb->asoc.strmout[i].state == SCTP_STREAM_OPEN) {
+ stcb->asoc.strmout[i].state = SCTP_STREAM_RESET_PENDING;
+ cnt++;
+ }
+ }
+ }
+ }
+ if (send_in) {
+ error = sctp_send_str_reset_req(stcb, strrst->srs_number_streams,
+ strrst->srs_stream_list,
+ send_in, 0, 0, 0, 0, 0);
+ } else {
+ error = sctp_send_stream_reset_out_if_possible(stcb, SCTP_SO_LOCKED);
+ }
+ if (error == 0) {
+ sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_STRRST_REQ, SCTP_SO_LOCKED);
+ } else {
+ /*
+ * For outgoing streams don't report any
+ * problems in sending the request to the
+ * application. XXX: Double check resetting
+ * incoming streams.
+ */
+ error = 0;
+ }
SCTP_TCB_UNLOCK(stcb);
break;
}
@@ -4730,7 +4749,7 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize,
goto skip_stuff;
}
}
- error = sctp_send_str_reset_req(stcb, 0, NULL, 0, 0, 0, addstream, add_o_strmcnt, add_i_strmcnt, 0);
+ error = sctp_send_str_reset_req(stcb, 0, NULL, 0, 0, addstream, add_o_strmcnt, add_i_strmcnt, 0);
sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_STRRST_REQ, SCTP_SO_LOCKED);
skip_stuff:
SCTP_TCB_UNLOCK(stcb);
@@ -4738,6 +4757,7 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize,
}
case SCTP_RESET_ASSOC:
{
+ int i;
uint32_t *value;
SCTP_CHECK_AND_CAST(value, optval, uint32_t, optsize);
@@ -4762,7 +4782,25 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize,
SCTP_TCB_UNLOCK(stcb);
break;
}
- error = sctp_send_str_reset_req(stcb, 0, NULL, 0, 0, 1, 0, 0, 0, 0);
+ /*
+ * Is there any data pending in the send or sent
+ * queues?
+ */
+ if (!TAILQ_EMPTY(&stcb->asoc.send_queue) ||
+ !TAILQ_EMPTY(&stcb->asoc.sent_queue)) {
+ busy_out:
+ error = EBUSY;
+ SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, error);
+ SCTP_TCB_UNLOCK(stcb);
+ break;
+ }
+ /* Do any streams have data queued? */
+ for (i = 0; i < stcb->asoc.streamoutcnt; i++) {
+ if (!TAILQ_EMPTY(&stcb->asoc.strmout[i].outqueue)) {
+ goto busy_out;
+ }
+ }
+ error = sctp_send_str_reset_req(stcb, 0, NULL, 0, 1, 0, 0, 0, 0);
sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_STRRST_REQ, SCTP_SO_LOCKED);
SCTP_TCB_UNLOCK(stcb);
break;
@@ -5769,7 +5807,7 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize,
LIST_FOREACH(laddr, &inp->sctp_addr_list, sctp_nxt_addr) {
if (laddr->ifa == NULL) {
SCTPDBG(SCTP_DEBUG_OUTPUT1, "%s: NULL ifa\n",
- __FUNCTION__);
+ __func__);
continue;
}
if (laddr->ifa == ifa) {
@@ -6906,7 +6944,7 @@ sctp_connect(struct socket *so, struct sockaddr *addr, struct thread *p)
}
vrf_id = inp->def_vrf_id;
/* We are GOOD to go */
- stcb = sctp_aloc_assoc(inp, addr, &error, 0, vrf_id, p);
+ stcb = sctp_aloc_assoc(inp, addr, &error, 0, vrf_id, inp->sctp_ep.pre_open_stream_count, p);
if (stcb == NULL) {
/* Gak! no memory */
goto out_now;
diff --git a/sys/netinet/sctputil.c b/sys/netinet/sctputil.c
index c25ec39..4cf134b 100644
--- a/sys/netinet/sctputil.c
+++ b/sys/netinet/sctputil.c
@@ -893,9 +893,52 @@ sctp_select_a_tag(struct sctp_inpcb *inp, uint16_t lport, uint16_t rport, int ch
return (x);
}
+int32_t
+sctp_map_assoc_state(int kernel_state)
+{
+ int32_t user_state;
+
+ if (kernel_state & SCTP_STATE_WAS_ABORTED) {
+ user_state = SCTP_CLOSED;
+ } else if (kernel_state & SCTP_STATE_SHUTDOWN_PENDING) {
+ user_state = SCTP_SHUTDOWN_PENDING;
+ } else {
+ switch (kernel_state & SCTP_STATE_MASK) {
+ case SCTP_STATE_EMPTY:
+ user_state = SCTP_CLOSED;
+ break;
+ case SCTP_STATE_INUSE:
+ user_state = SCTP_CLOSED;
+ break;
+ case SCTP_STATE_COOKIE_WAIT:
+ user_state = SCTP_COOKIE_WAIT;
+ break;
+ case SCTP_STATE_COOKIE_ECHOED:
+ user_state = SCTP_COOKIE_ECHOED;
+ break;
+ case SCTP_STATE_OPEN:
+ user_state = SCTP_ESTABLISHED;
+ break;
+ case SCTP_STATE_SHUTDOWN_SENT:
+ user_state = SCTP_SHUTDOWN_SENT;
+ break;
+ case SCTP_STATE_SHUTDOWN_RECEIVED:
+ user_state = SCTP_SHUTDOWN_RECEIVED;
+ break;
+ case SCTP_STATE_SHUTDOWN_ACK_SENT:
+ user_state = SCTP_SHUTDOWN_ACK_SENT;
+ break;
+ default:
+ user_state = SCTP_CLOSED;
+ break;
+ }
+ }
+ return (user_state);
+}
+
int
sctp_init_asoc(struct sctp_inpcb *inp, struct sctp_tcb *stcb,
- uint32_t override_tag, uint32_t vrf_id)
+ uint32_t override_tag, uint32_t vrf_id, uint16_t o_strms)
{
struct sctp_association *asoc;
@@ -1057,7 +1100,7 @@ sctp_init_asoc(struct sctp_inpcb *inp, struct sctp_tcb *stcb,
* that we request by default.
*/
asoc->strm_realoutsize = asoc->streamoutcnt = asoc->pre_open_streams =
- inp->sctp_ep.pre_open_stream_count;
+ o_strms;
SCTP_MALLOC(asoc->strmout, struct sctp_stream_out *,
asoc->streamoutcnt * sizeof(struct sctp_stream_out),
SCTP_M_STRMO);
@@ -1089,6 +1132,7 @@ sctp_init_asoc(struct sctp_inpcb *inp, struct sctp_tcb *stcb,
#endif
asoc->strmout[i].stream_no = i;
asoc->strmout[i].last_msg_incomplete = 0;
+ asoc->strmout[i].state = SCTP_STREAM_OPENING;
asoc->ss_functions.sctp_ss_init_stream(&asoc->strmout[i], NULL);
}
asoc->ss_functions.sctp_ss_init(stcb, asoc, 0);
@@ -1444,12 +1488,14 @@ sctp_timeout_handler(void *t)
struct sctp_tcb *stcb;
struct sctp_nets *net;
struct sctp_timer *tmr;
+ struct mbuf *op_err;
#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING)
struct socket *so;
#endif
int did_output;
+ int type;
tmr = (struct sctp_timer *)t;
inp = (struct sctp_inpcb *)tmr->ep;
@@ -1518,8 +1564,9 @@ sctp_timeout_handler(void *t)
return;
}
}
+ type = tmr->type;
tmr->stopped_from = 0xa005;
- SCTPDBG(SCTP_DEBUG_TIMER1, "Timer type %d goes off\n", tmr->type);
+ SCTPDBG(SCTP_DEBUG_TIMER1, "Timer type %d goes off\n", type);
if (!SCTP_OS_TIMER_ACTIVE(&tmr->timer)) {
if (inp) {
SCTP_INP_DECR_REF(inp);
@@ -1535,7 +1582,7 @@ sctp_timeout_handler(void *t)
if (stcb) {
SCTP_TCB_LOCK(stcb);
atomic_add_int(&stcb->asoc.refcnt, -1);
- if ((tmr->type != SCTP_TIMER_TYPE_ASOCKILL) &&
+ if ((type != SCTP_TIMER_TYPE_ASOCKILL) &&
((stcb->asoc.state == 0) ||
(stcb->asoc.state & SCTP_STATE_ABOUT_TO_BE_FREED))) {
SCTP_TCB_UNLOCK(stcb);
@@ -1547,7 +1594,7 @@ sctp_timeout_handler(void *t)
}
}
/* record in stopped what t-o occured */
- tmr->stopped_from = tmr->type;
+ tmr->stopped_from = type;
/* mark as being serviced now */
if (SCTP_OS_TIMER_PENDING(&tmr->timer)) {
@@ -1565,7 +1612,7 @@ sctp_timeout_handler(void *t)
SCTP_OS_TIMER_DEACTIVATE(&tmr->timer);
/* call the handler for the appropriate timer type */
- switch (tmr->type) {
+ switch (type) {
case SCTP_TIMER_TYPE_ZERO_COPY:
if (inp == NULL) {
break;
@@ -1755,7 +1802,9 @@ sctp_timeout_handler(void *t)
break;
}
SCTP_STAT_INCR(sctps_timoshutdownguard);
- sctp_abort_an_association(inp, stcb, NULL, SCTP_SO_NOT_LOCKED);
+ op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code),
+ "Shutdown guard timer expired");
+ sctp_abort_an_association(inp, stcb, op_err, SCTP_SO_NOT_LOCKED);
/* no need to unlock on tcb its gone */
goto out_decr;
@@ -1847,11 +1896,11 @@ sctp_timeout_handler(void *t)
goto out_no_decr;
default:
SCTPDBG(SCTP_DEBUG_TIMER1, "sctp_timeout_handler:unknown timer %d\n",
- tmr->type);
+ type);
break;
}
#ifdef SCTP_AUDITING_ENABLED
- sctp_audit_log(0xF1, (uint8_t) tmr->type);
+ sctp_audit_log(0xF1, (uint8_t) type);
if (inp)
sctp_auditing(5, inp, stcb, net);
#endif
@@ -1874,8 +1923,7 @@ out_decr:
SCTP_INP_DECR_REF(inp);
}
out_no_decr:
- SCTPDBG(SCTP_DEBUG_TIMER1, "Timer now complete (type %d)\n",
- tmr->type);
+ SCTPDBG(SCTP_DEBUG_TIMER1, "Timer now complete (type = %d)\n", type);
CURVNET_RESTORE();
}
@@ -2076,7 +2124,11 @@ sctp_timer_start(int t_type, struct sctp_inpcb *inp, struct sctp_tcb *stcb,
if (stcb == NULL) {
return;
}
- to_ticks = inp->sctp_ep.sctp_timeoutticks[SCTP_TIMER_MAXSHUTDOWN];
+ if (inp->sctp_ep.sctp_timeoutticks[SCTP_TIMER_MAXSHUTDOWN] == 0) {
+ to_ticks = 5 * MSEC_TO_TICKS(stcb->asoc.maxrto);
+ } else {
+ to_ticks = inp->sctp_ep.sctp_timeoutticks[SCTP_TIMER_MAXSHUTDOWN];
+ }
tmr = &stcb->asoc.shut_guard_timer;
break;
case SCTP_TIMER_TYPE_STRRESET:
@@ -2132,13 +2184,13 @@ sctp_timer_start(int t_type, struct sctp_inpcb *inp, struct sctp_tcb *stcb,
break;
default:
SCTPDBG(SCTP_DEBUG_TIMER1, "%s: Unknown timer type %d\n",
- __FUNCTION__, t_type);
+ __func__, t_type);
return;
break;
}
if ((to_ticks <= 0) || (tmr == NULL)) {
SCTPDBG(SCTP_DEBUG_TIMER1, "%s: %d:software error to_ticks:%d tmr:%p not set ??\n",
- __FUNCTION__, t_type, to_ticks, (void *)tmr);
+ __func__, t_type, to_ticks, (void *)tmr);
return;
}
if (SCTP_OS_TIMER_PENDING(&tmr->timer)) {
@@ -2294,7 +2346,7 @@ sctp_timer_stop(int t_type, struct sctp_inpcb *inp, struct sctp_tcb *stcb,
break;
default:
SCTPDBG(SCTP_DEBUG_TIMER1, "%s: Unknown timer type %d\n",
- __FUNCTION__, t_type);
+ __func__, t_type);
break;
}
if (tmr == NULL) {
@@ -2616,6 +2668,9 @@ sctp_notify_assoc_change(uint16_t state, struct sctp_tcb *stcb,
#endif
+ if (stcb == NULL) {
+ return;
+ }
if (sctp_stcb_is_feature_on(stcb->sctp_ep, stcb, SCTP_PCB_FLAGS_RECVASSOCEVNT)) {
notif_len = sizeof(struct sctp_assoc_change);
if (abort != NULL) {
@@ -3723,7 +3778,7 @@ sctp_ulp_notify(uint32_t notification, struct sctp_tcb *stcb,
break;
default:
SCTPDBG(SCTP_DEBUG_UTIL1, "%s: unknown notification %xh (%u)\n",
- __FUNCTION__, notification, notification);
+ __func__, notification, notification);
break;
} /* end switch */
}
@@ -5600,20 +5655,20 @@ found_one:
s_extra = (struct sctp_extrcvinfo *)sinfo;
if ((nxt) &&
(nxt->length)) {
- s_extra->sreinfo_next_flags = SCTP_NEXT_MSG_AVAIL;
+ s_extra->serinfo_next_flags = SCTP_NEXT_MSG_AVAIL;
if (nxt->sinfo_flags & SCTP_UNORDERED) {
- s_extra->sreinfo_next_flags |= SCTP_NEXT_MSG_IS_UNORDERED;
+ s_extra->serinfo_next_flags |= SCTP_NEXT_MSG_IS_UNORDERED;
}
if (nxt->spec_flags & M_NOTIFICATION) {
- s_extra->sreinfo_next_flags |= SCTP_NEXT_MSG_IS_NOTIFICATION;
+ s_extra->serinfo_next_flags |= SCTP_NEXT_MSG_IS_NOTIFICATION;
}
- s_extra->sreinfo_next_aid = nxt->sinfo_assoc_id;
- s_extra->sreinfo_next_length = nxt->length;
- s_extra->sreinfo_next_ppid = nxt->sinfo_ppid;
- s_extra->sreinfo_next_stream = nxt->sinfo_stream;
+ s_extra->serinfo_next_aid = nxt->sinfo_assoc_id;
+ s_extra->serinfo_next_length = nxt->length;
+ s_extra->serinfo_next_ppid = nxt->sinfo_ppid;
+ s_extra->serinfo_next_stream = nxt->sinfo_stream;
if (nxt->tail_mbuf != NULL) {
if (nxt->end_added) {
- s_extra->sreinfo_next_flags |= SCTP_NEXT_MSG_ISCOMPLETE;
+ s_extra->serinfo_next_flags |= SCTP_NEXT_MSG_ISCOMPLETE;
}
}
} else {
@@ -5624,11 +5679,11 @@ found_one:
* :-D
*/
nxt = NULL;
- s_extra->sreinfo_next_flags = SCTP_NO_NEXT_MSG;
- s_extra->sreinfo_next_aid = 0;
- s_extra->sreinfo_next_length = 0;
- s_extra->sreinfo_next_ppid = 0;
- s_extra->sreinfo_next_stream = 0;
+ s_extra->serinfo_next_flags = SCTP_NO_NEXT_MSG;
+ s_extra->serinfo_next_aid = 0;
+ s_extra->serinfo_next_length = 0;
+ s_extra->serinfo_next_ppid = 0;
+ s_extra->serinfo_next_stream = 0;
}
}
/*
@@ -6111,7 +6166,7 @@ out:
struct sctp_extrcvinfo *s_extra;
s_extra = (struct sctp_extrcvinfo *)sinfo;
- s_extra->sreinfo_next_flags = SCTP_NO_NEXT_MSG;
+ s_extra->serinfo_next_flags = SCTP_NO_NEXT_MSG;
}
if (hold_rlock == 1) {
SCTP_INP_READ_UNLOCK(inp);
@@ -6855,7 +6910,7 @@ sctp_log_trace(uint32_t subsys, const char *str SCTP_UNUSED, uint32_t a, uint32_
#endif
static void
-sctp_recv_udp_tunneled_packet(struct mbuf *m, int off, struct inpcb *ignored,
+sctp_recv_udp_tunneled_packet(struct mbuf *m, int off, struct inpcb *inp,
const struct sockaddr *sa SCTP_UNUSED, void *ctx SCTP_UNUSED)
{
struct ip *iph;
@@ -6903,6 +6958,18 @@ sctp_recv_udp_tunneled_packet(struct mbuf *m, int off, struct inpcb *ignored,
for (last = m; last->m_next; last = last->m_next);
last->m_next = sp;
m->m_pkthdr.len += sp->m_pkthdr.len;
+ /*
+ * The CSUM_DATA_VALID flags indicates that the HW checked the UDP
+ * checksum and it was valid. Since CSUM_DATA_VALID ==
+ * CSUM_SCTP_VALID this would imply that the HW also verified the
+ * SCTP checksum. Therefore, clear the bit.
+ */
+ SCTPDBG(SCTP_DEBUG_CRCOFFLOAD,
+ "sctp_recv_udp_tunneled_packet(): Packet of length %d received on %s with csum_flags 0x%b.\n",
+ m->m_pkthdr.len,
+ if_name(m->m_pkthdr.rcvif),
+ (int)m->m_pkthdr.csum_flags, CSUM_BITS);
+ m->m_pkthdr.csum_flags &= ~CSUM_DATA_VALID;
iph = mtod(m, struct ip *);
switch (iph->ip_v) {
#ifdef INET
diff --git a/sys/netinet/sctputil.h b/sys/netinet/sctputil.h
index 7df0a6c..354d40e 100644
--- a/sys/netinet/sctputil.h
+++ b/sys/netinet/sctputil.h
@@ -67,6 +67,9 @@ void
/*
* Function prototypes
*/
+int32_t
+sctp_map_assoc_state(int);
+
uint32_t
sctp_get_ifa_hash_val(struct sockaddr *addr);
@@ -80,7 +83,7 @@ uint32_t sctp_select_initial_TSN(struct sctp_pcb *);
uint32_t sctp_select_a_tag(struct sctp_inpcb *, uint16_t lport, uint16_t rport, int);
-int sctp_init_asoc(struct sctp_inpcb *, struct sctp_tcb *, uint32_t, uint32_t);
+int sctp_init_asoc(struct sctp_inpcb *, struct sctp_tcb *, uint32_t, uint32_t, uint16_t);
void sctp_fill_random_store(struct sctp_pcb *);
diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c
index 3ce21a9..c0add82 100644
--- a/sys/netinet/tcp_subr.c
+++ b/sys/netinet/tcp_subr.c
@@ -341,7 +341,7 @@ tcp_init(void)
*/
if (hashsize < 512)
hashsize = 512;
- if (bootverbose)
+ if (bootverbose && IS_DEFAULT_VNET(curvnet))
printf("%s: %s auto tuned to %d\n", __func__,
tcbhash_tuneable, hashsize);
}
diff --git a/sys/netinet6/in6.c b/sys/netinet6/in6.c
index 3baaa93..e3c3229 100644
--- a/sys/netinet6/in6.c
+++ b/sys/netinet6/in6.c
@@ -2003,7 +2003,7 @@ in6ifa_llaonifp(struct ifnet *ifp)
if (ND_IFINFO(ifp)->flags & ND6_IFF_IFDISABLED)
return (NULL);
- if_addr_rlock(ifp);
+ IF_ADDR_RLOCK(ifp);
TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
if (ifa->ifa_addr->sa_family != AF_INET6)
continue;
@@ -2013,7 +2013,7 @@ in6ifa_llaonifp(struct ifnet *ifp)
IN6_IS_ADDR_MC_NODELOCAL(&sin6->sin6_addr))
break;
}
- if_addr_runlock(ifp);
+ IF_ADDR_RUNLOCK(ifp);
return ((struct in6_ifaddr *)ifa);
}
diff --git a/sys/netinet6/sctp6_usrreq.c b/sys/netinet6/sctp6_usrreq.c
index 7670289..6749875 100644
--- a/sys/netinet6/sctp6_usrreq.c
+++ b/sys/netinet6/sctp6_usrreq.c
@@ -39,9 +39,7 @@ __FBSDID("$FreeBSD$");
#include <netinet/sctp_pcb.h>
#include <netinet/sctp_header.h>
#include <netinet/sctp_var.h>
-#ifdef INET6
#include <netinet6/sctp6_var.h>
-#endif
#include <netinet/sctp_sysctl.h>
#include <netinet/sctp_output.h>
#include <netinet/sctp_uio.h>
@@ -54,13 +52,12 @@ __FBSDID("$FreeBSD$");
#include <netinet/sctp_output.h>
#include <netinet/sctp_bsd_addr.h>
#include <netinet/sctp_crc32.h>
+#include <netinet/icmp6.h>
#include <netinet/udp.h>
#ifdef IPSEC
#include <netipsec/ipsec.h>
-#ifdef INET6
#include <netipsec/ipsec6.h>
-#endif /* INET6 */
#endif /* IPSEC */
extern struct protosw inetsw[];
@@ -956,7 +953,7 @@ sctp6_connect(struct socket *so, struct sockaddr *addr, struct thread *p)
return (EALREADY);
}
/* We are GOOD to go */
- stcb = sctp_aloc_assoc(inp, addr, &error, 0, vrf_id, p);
+ stcb = sctp_aloc_assoc(inp, addr, &error, 0, vrf_id, inp->sctp_ep.pre_open_stream_count, p);
SCTP_ASOC_CREATE_UNLOCK(inp);
if (stcb == NULL) {
/* Gak! no memory */
diff --git a/sys/ofed/include/linux/linux_compat.c b/sys/ofed/include/linux/linux_compat.c
index ef44c6d..92b6ac7 100644
--- a/sys/ofed/include/linux/linux_compat.c
+++ b/sys/ofed/include/linux/linux_compat.c
@@ -480,7 +480,7 @@ linux_dev_mmap_single(struct cdev *dev, vm_ooffset_t *offset,
vma.vm_end = size;
vma.vm_pgoff = *offset / PAGE_SIZE;
vma.vm_pfn = 0;
- vma.vm_page_prot = 0;
+ vma.vm_page_prot = VM_MEMATTR_DEFAULT;
if (filp->f_op->mmap) {
error = -filp->f_op->mmap(filp, &vma);
if (error == 0) {
diff --git a/sys/powerpc/powerpc/busdma_machdep.c b/sys/powerpc/powerpc/busdma_machdep.c
index 9ea51ce..1e57d92 100644
--- a/sys/powerpc/powerpc/busdma_machdep.c
+++ b/sys/powerpc/powerpc/busdma_machdep.c
@@ -514,14 +514,14 @@ bus_dmamem_alloc(bus_dma_tag_t dmat, void** vaddr, int flags,
/*
* XXX:
- * (dmat->alignment < dmat->maxsize) is just a quick hack; the exact
+ * (dmat->alignment <= dmat->maxsize) is just a quick hack; the exact
* alignment guarantees of malloc need to be nailed down, and the
* code below should be rewritten to take that into account.
*
* In the meantime, we'll warn the user if malloc gets it wrong.
*/
if ((dmat->maxsize <= PAGE_SIZE) &&
- (dmat->alignment < dmat->maxsize) &&
+ (dmat->alignment <= dmat->maxsize) &&
dmat->lowaddr >= ptoa((vm_paddr_t)Maxmem) &&
attr == VM_MEMATTR_DEFAULT) {
*vaddr = malloc(dmat->maxsize, M_DEVBUF, mflags);
diff --git a/sys/powerpc/powerpc/elf32_machdep.c b/sys/powerpc/powerpc/elf32_machdep.c
index e8d563a..6b3a9af 100644
--- a/sys/powerpc/powerpc/elf32_machdep.c
+++ b/sys/powerpc/powerpc/elf32_machdep.c
@@ -108,6 +108,7 @@ struct sysentvec elf32_freebsd_sysvec = {
.sv_shared_page_len = PAGE_SIZE,
.sv_schedtail = NULL,
.sv_thread_detach = NULL,
+ .sv_trap = NULL,
};
INIT_SYSENTVEC(elf32_sysvec, &elf32_freebsd_sysvec);
diff --git a/sys/powerpc/powerpc/elf64_machdep.c b/sys/powerpc/powerpc/elf64_machdep.c
index 4324266..d871e54 100644
--- a/sys/powerpc/powerpc/elf64_machdep.c
+++ b/sys/powerpc/powerpc/elf64_machdep.c
@@ -84,6 +84,7 @@ struct sysentvec elf64_freebsd_sysvec = {
.sv_shared_page_len = PAGE_SIZE,
.sv_schedtail = NULL,
.sv_thread_detach = NULL,
+ .sv_trap = NULL,
};
INIT_SYSENTVEC(elf64_sysvec, &elf64_freebsd_sysvec);
diff --git a/sys/security/audit/audit_worker.c b/sys/security/audit/audit_worker.c
index caad5ac..f526cd4 100644
--- a/sys/security/audit/audit_worker.c
+++ b/sys/security/audit/audit_worker.c
@@ -71,6 +71,8 @@ __FBSDID("$FreeBSD$");
#include <vm/uma.h>
+#include <machine/stdarg.h>
+
/*
* Worker thread that will schedule disk I/O, etc.
*/
@@ -98,6 +100,26 @@ static struct sx audit_worker_lock;
#define AUDIT_WORKER_LOCK() sx_xlock(&audit_worker_lock)
#define AUDIT_WORKER_UNLOCK() sx_xunlock(&audit_worker_lock)
+static void
+audit_worker_sync_vp(struct vnode *vp, struct mount *mp, const char *fmt, ...)
+{
+ struct mount *mp1;
+ int error;
+ va_list va;
+
+ va_start(va, fmt);
+ error = vn_start_write(vp, &mp1, 0);
+ if (error == 0) {
+ VOP_LOCK(vp, LK_EXCLUSIVE | LK_RETRY);
+ (void)VOP_FSYNC(vp, MNT_WAIT, curthread);
+ VOP_UNLOCK(vp, 0);
+ vn_finished_write(mp1);
+ }
+ vfs_unbusy(mp);
+ vpanic(fmt, va);
+ va_end(va);
+}
+
/*
* Write an audit record to a file, performed as the last stage after both
* preselection and BSM conversion. Both space management and write failures
@@ -114,6 +136,7 @@ audit_record_write(struct vnode *vp, struct ucred *cred, void *data,
static struct timeval last_fail;
static int cur_lowspace_trigger;
struct statfs *mnt_stat;
+ struct mount *mp;
int error;
static int cur_fail;
long temp;
@@ -123,15 +146,25 @@ audit_record_write(struct vnode *vp, struct ucred *cred, void *data,
if (vp == NULL)
return;
- mnt_stat = &vp->v_mount->mnt_stat;
+ mp = vp->v_mount;
+ if (mp == NULL) {
+ error = EINVAL;
+ goto fail;
+ }
+ error = vfs_busy(mp, 0);
+ if (error != 0) {
+ mp = NULL;
+ goto fail;
+ }
+ mnt_stat = &mp->mnt_stat;
/*
* First, gather statistics on the audit log file and file system so
* that we know how we're doing on space. Consider failure of these
* operations to indicate a future inability to write to the file.
*/
- error = VFS_STATFS(vp->v_mount, mnt_stat);
- if (error)
+ error = VFS_STATFS(mp, mnt_stat);
+ if (error != 0)
goto fail;
/*
@@ -246,13 +279,12 @@ audit_record_write(struct vnode *vp, struct ucred *cred, void *data,
*/
if (audit_in_failure) {
if (audit_q_len == 0 && audit_pre_q_len == 0) {
- VOP_LOCK(vp, LK_EXCLUSIVE | LK_RETRY);
- (void)VOP_FSYNC(vp, MNT_WAIT, curthread);
- VOP_UNLOCK(vp, 0);
- panic("Audit store overflow; record queue drained.");
+ audit_worker_sync_vp(vp, mp,
+ "Audit store overflow; record queue drained.");
}
}
+ vfs_unbusy(mp);
return;
fail_enospc:
@@ -262,10 +294,8 @@ fail_enospc:
* space, or ENOSPC returned by the vnode write call.
*/
if (audit_fail_stop) {
- VOP_LOCK(vp, LK_EXCLUSIVE | LK_RETRY);
- (void)VOP_FSYNC(vp, MNT_WAIT, curthread);
- VOP_UNLOCK(vp, 0);
- panic("Audit log space exhausted and fail-stop set.");
+ audit_worker_sync_vp(vp, mp,
+ "Audit log space exhausted and fail-stop set.");
}
(void)audit_send_trigger(AUDIT_TRIGGER_NO_SPACE);
audit_suspended = 1;
@@ -277,12 +307,12 @@ fail:
* lost, which may require an immediate system halt.
*/
if (audit_panic_on_write_fail) {
- VOP_LOCK(vp, LK_EXCLUSIVE | LK_RETRY);
- (void)VOP_FSYNC(vp, MNT_WAIT, curthread);
- VOP_UNLOCK(vp, 0);
- panic("audit_worker: write error %d\n", error);
+ audit_worker_sync_vp(vp, mp,
+ "audit_worker: write error %d\n", error);
} else if (ppsratecheck(&last_fail, &cur_fail, 1))
printf("audit_worker: write error %d\n", error);
+ if (mp != NULL)
+ vfs_unbusy(mp);
}
/*
diff --git a/sys/sparc64/sparc64/bus_machdep.c b/sys/sparc64/sparc64/bus_machdep.c
index 415f43d..fcac25a 100644
--- a/sys/sparc64/sparc64/bus_machdep.c
+++ b/sys/sparc64/sparc64/bus_machdep.c
@@ -521,14 +521,14 @@ nexus_dmamem_alloc(bus_dma_tag_t dmat, void **vaddr, int flags,
/*
* XXX:
- * (dmat->dt_alignment < dmat->dt_maxsize) is just a quick hack; the
+ * (dmat->dt_alignment <= dmat->dt_maxsize) is just a quick hack; the
* exact alignment guarantees of malloc need to be nailed down, and
* the code below should be rewritten to take that into account.
*
* In the meantime, we'll warn the user if malloc gets it wrong.
*/
if (dmat->dt_maxsize <= PAGE_SIZE &&
- dmat->dt_alignment < dmat->dt_maxsize)
+ dmat->dt_alignment <= dmat->dt_maxsize)
*vaddr = malloc(dmat->dt_maxsize, M_DEVBUF, mflags);
else {
/*
diff --git a/sys/sparc64/sparc64/elf_machdep.c b/sys/sparc64/sparc64/elf_machdep.c
index 0dab76d..6ddbd98 100644
--- a/sys/sparc64/sparc64/elf_machdep.c
+++ b/sys/sparc64/sparc64/elf_machdep.c
@@ -88,6 +88,7 @@ static struct sysentvec elf64_freebsd_sysvec = {
.sv_syscallnames = syscallnames,
.sv_schedtail = NULL,
.sv_thread_detach = NULL,
+ .sv_trap = NULL,
};
static Elf64_Brandinfo freebsd_brand_info = {
diff --git a/sys/sparc64/sparc64/machdep.c b/sys/sparc64/sparc64/machdep.c
index dd6f31c..e49e449 100644
--- a/sys/sparc64/sparc64/machdep.c
+++ b/sys/sparc64/sparc64/machdep.c
@@ -383,7 +383,8 @@ sparc64_init(caddr_t mdp, u_long o1, u_long o2, u_long o3, ofw_vec_t *vec)
kmdp = preload_search_by_type("elf kernel");
if (kmdp != NULL) {
boothowto = MD_FETCH(kmdp, MODINFOMD_HOWTO, int);
- kern_envp = MD_FETCH(kmdp, MODINFOMD_ENVP, char *);
+ init_static_kenv(MD_FETCH(kmdp, MODINFOMD_ENVP, char *),
+ 0);
end = MD_FETCH(kmdp, MODINFOMD_KERNEND, vm_offset_t);
kernel_tlb_slots = MD_FETCH(kmdp, MODINFOMD_DTLB_SLOTS,
int);
diff --git a/sys/sys/conf.h b/sys/sys/conf.h
index d72b58b..06c38c1 100644
--- a/sys/sys/conf.h
+++ b/sys/sys/conf.h
@@ -297,9 +297,9 @@ void setconf(void);
#define dev2unit(d) ((d)->si_drv0)
-typedef void (*cdevpriv_dtr_t)(void *data);
+typedef void d_priv_dtor_t(void *data);
int devfs_get_cdevpriv(void **datap);
-int devfs_set_cdevpriv(void *priv, cdevpriv_dtr_t dtr);
+int devfs_set_cdevpriv(void *priv, d_priv_dtor_t *dtr);
void devfs_clear_cdevpriv(void);
void devfs_fpdrop(struct file *fp); /* XXX This is not public KPI */
diff --git a/sys/sys/elf32.h b/sys/sys/elf32.h
index 62bf7be..03a546c 100644
--- a/sys/sys/elf32.h
+++ b/sys/sys/elf32.h
@@ -70,6 +70,18 @@ typedef struct {
} Elf32_Ehdr;
/*
+ * Shared object information, found in SHT_MIPS_LIBLIST.
+ */
+
+typedef struct {
+ Elf32_Word l_name; /* The name of a shared object. */
+ Elf32_Word l_time_stamp; /* 32-bit timestamp. */
+ Elf32_Word l_checksum; /* Checksum of visible symbols, sizes. */
+ Elf32_Word l_version; /* Interface version string index. */
+ Elf32_Word l_flags; /* Flags (LL_*). */
+} Elf32_Lib;
+
+/*
* Section header.
*/
diff --git a/sys/sys/elf64.h b/sys/sys/elf64.h
index 4ec7d34..f069619 100644
--- a/sys/sys/elf64.h
+++ b/sys/sys/elf64.h
@@ -79,6 +79,18 @@ typedef struct {
} Elf64_Ehdr;
/*
+ * Shared object information, found in SHT_MIPS_LIBLIST.
+ */
+
+typedef struct {
+ Elf64_Word l_name; /* The name of a shared object. */
+ Elf64_Word l_time_stamp; /* 64-bit timestamp. */
+ Elf64_Word l_checksum; /* Checksum of visible symbols, sizes. */
+ Elf64_Word l_version; /* Interface version string index. */
+ Elf64_Word l_flags; /* Flags (LL_*). */
+} Elf64_Lib;
+
+/*
* Section header.
*/
diff --git a/sys/sys/elf_common.h b/sys/sys/elf_common.h
index 1947d11..d6ca101 100644
--- a/sys/sys/elf_common.h
+++ b/sys/sys/elf_common.h
@@ -50,6 +50,61 @@ typedef struct {
} Elf_Note;
/*
+ * Option kinds.
+ */
+#define ODK_NULL 0 /* undefined */
+#define ODK_REGINFO 1 /* register usage info */
+#define ODK_EXCEPTIONS 2 /* exception processing info */
+#define ODK_PAD 3 /* section padding */
+#define ODK_HWPATCH 4 /* hardware patch applied */
+#define ODK_FILL 5 /* fill value used by the linker */
+#define ODK_TAGS 6 /* reserved space for tools */
+#define ODK_HWAND 7 /* hardware AND patch applied */
+#define ODK_HWOR 8 /* hardware OR patch applied */
+#define ODK_GP_GROUP 9 /* GP group for text/data sections */
+#define ODK_IDENT 10 /* ID information */
+#define ODK_PAGESIZE 11 /* page size information */
+
+/*
+ * ODK_EXCEPTIONS info field masks.
+ */
+#define OEX_FPU_MIN 0x0000001f /* min FPU exception required */
+#define OEX_FPU_MAX 0x00001f00 /* max FPU exception allowed */
+#define OEX_PAGE0 0x00010000 /* page zero must be mapped */
+#define OEX_SMM 0x00020000 /* run in sequential memory mode */
+#define OEX_PRECISEFP 0x00040000 /* run in precise FP exception mode */
+#define OEX_DISMISS 0x00080000 /* dismiss invalid address traps */
+
+/*
+ * ODK_PAD info field masks.
+ */
+#define OPAD_PREFIX 0x0001
+#define OPAD_POSTFIX 0x0002
+#define OPAD_SYMBOL 0x0004
+
+/*
+ * ODK_HWPATCH info field masks.
+ */
+#define OHW_R4KEOP 0x00000001 /* patch for R4000 branch at end-of-page bug */
+#define OHW_R8KPFETCH 0x00000002 /* R8000 prefetch bug may occur */
+#define OHW_R5KEOP 0x00000004 /* patch for R5000 branch at end-of-page bug */
+#define OHW_R5KCVTL 0x00000008 /* R5000 cvt.[ds].l bug: clean == 1 */
+#define OHW_R10KLDL 0x00000010UL /* need patch for R10000 misaligned load */
+
+/*
+ * ODK_HWAND/ODK_HWOR info field and hwp_flags[12] masks.
+ */
+#define OHWA0_R4KEOP_CHECKED 0x00000001 /* object checked for R4000 end-of-page bug */
+#define OHWA0_R4KEOP_CLEAN 0x00000002 /* object verified clean for R4000 end-of-page bug */
+#define OHWO0_FIXADE 0x00000001 /* object requires call to fixade */
+
+/*
+ * ODK_IDENT/ODK_GP_GROUP info field masks.
+ */
+#define OGP_GROUP 0x0000ffff /* GP group number */
+#define OGP_SELF 0x00010000 /* GP group is self-contained */
+
+/*
* The header for GNU-style hash sections.
*/
@@ -121,6 +176,7 @@ typedef struct {
#define ELFOSABI_SYSV ELFOSABI_NONE /* symbol used in old spec */
#define ELFOSABI_MONTEREY ELFOSABI_AIX /* Monterey */
+#define ELFOSABI_GNU ELFOSABI_LINUX
/* e_ident */
#define IS_ELF(ehdr) ((ehdr).e_ident[EI_MAG0] == ELFMAG0 && \
@@ -249,6 +305,60 @@ typedef struct {
#define EM_ALPHA_STD 41 /* Digital Alpha (standard value). */
#define EM_ALPHA 0x9026 /* Alpha (written in the absence of an ABI) */
+/**
+ * e_flags
+ */
+#define EF_ARM_RELEXEC 0x1
+#define EF_ARM_HASENTRY 0x2
+#define EF_ARM_SYMSARESORTED 0x4
+#define EF_ARM_DYNSYMSUSESEGIDX 0x8
+#define EF_ARM_MAPSYMSFIRST 0x10
+#define EF_ARM_LE8 0x00400000
+#define EF_ARM_BE8 0x00800000
+#define EF_ARM_EABIMASK 0xFF000000
+#define EF_ARM_EABI_UNKNOWN 0x00000000
+#define EF_ARM_EABI_VER1 0x01000000
+#define EF_ARM_EABI_VER2 0x02000000
+#define EF_ARM_EABI_VER3 0x03000000
+#define EF_ARM_EABI_VER4 0x04000000
+#define EF_ARM_EABI_VER5 0x05000000
+#define EF_ARM_INTERWORK 0x00000004
+#define EF_ARM_APCS_26 0x00000008
+#define EF_ARM_APCS_FLOAT 0x00000010
+#define EF_ARM_PIC 0x00000020
+#define EF_ARM_ALIGN8 0x00000040
+#define EF_ARM_NEW_ABI 0x00000080
+#define EF_ARM_OLD_ABI 0x00000100
+#define EF_ARM_SOFT_FLOAT 0x00000200
+#define EF_ARM_VFP_FLOAT 0x00000400
+#define EF_ARM_MAVERICK_FLOAT 0x00000800
+
+#define EF_MIPS_NOREORDER 0x00000001
+#define EF_MIPS_PIC 0x00000002 /* Contains PIC code */
+#define EF_MIPS_CPIC 0x00000004 /* STD PIC calling sequence */
+#define EF_MIPS_UCODE 0x00000010
+#define EF_MIPS_ABI2 0x00000020 /* N32 */
+#define EF_MIPS_OPTIONS_FIRST 0x00000080
+#define EF_MIPS_ARCH_ASE 0x0F000000 /* Architectural extensions */
+#define EF_MIPS_ARCH_ASE_MDMX 0x08000000 /* MDMX multimedia extension */
+#define EF_MIPS_ARCH_ASE_M16 0x04000000 /* MIPS-16 ISA extensions */
+#define EF_MIPS_ARCH 0xF0000000 /* Architecture field */
+
+#define EF_PPC_EMB 0x80000000
+#define EF_PPC_RELOCATABLE 0x00010000
+#define EF_PPC_RELOCATABLE_LIB 0x00008000
+
+#define EF_SPARC_EXT_MASK 0x00ffff00
+#define EF_SPARC_32PLUS 0x00000100
+#define EF_SPARC_SUN_US1 0x00000200
+#define EF_SPARC_HAL_R1 0x00000200
+#define EF_SPARC_SUN_US3 0x00000800
+
+#define EF_SPARCV9_MM 0x00000003
+#define EF_SPARCV9_TSO 0x00000000
+#define EF_SPARCV9_PSO 0x00000001
+#define EF_SPARCV9_RMO 0x00000002
+
/* Special section indexes. */
#define SHN_UNDEF 0 /* Undefined, missing, irrelevant. */
#define SHN_LORESERVE 0xff00 /* First of reserved range. */
@@ -286,6 +396,7 @@ typedef struct {
#define SHT_LOSUNW 0x6ffffff4
#define SHT_SUNW_dof 0x6ffffff4
#define SHT_SUNW_cap 0x6ffffff5
+#define SHT_GNU_ATTRIBUTES 0x6ffffff5
#define SHT_SUNW_SIGNATURE 0x6ffffff6
#define SHT_GNU_HASH 0x6ffffff6
#define SHT_GNU_LIBLIST 0x6ffffff7
@@ -305,6 +416,7 @@ typedef struct {
#define SHT_HIOS 0x6fffffff /* Last of OS specific semantics */
#define SHT_LOPROC 0x70000000 /* reserved range for processor */
#define SHT_AMD64_UNWIND 0x70000001 /* unwind information */
+
#define SHT_ARM_EXIDX 0x70000001 /* Exception index table. */
#define SHT_ARM_PREEMPTMAP 0x70000002 /* BPABI DLL dynamic linking
pre-emption map. */
@@ -312,9 +424,39 @@ typedef struct {
attributes. */
#define SHT_ARM_DEBUGOVERLAY 0x70000004 /* See DBGOVL for details. */
#define SHT_ARM_OVERLAYSECTION 0x70000005 /* See DBGOVL for details. */
+#define SHT_MIPS_LIBLIST 0x70000000
+#define SHT_MIPS_MSYM 0x70000001
+#define SHT_MIPS_CONFLICT 0x70000002
+#define SHT_MIPS_GPTAB 0x70000003
+#define SHT_MIPS_UCODE 0x70000004
+#define SHT_MIPS_DEBUG 0x70000005
#define SHT_MIPS_REGINFO 0x70000006
+#define SHT_MIPS_PACKAGE 0x70000007
+#define SHT_MIPS_PACKSYM 0x70000008
+#define SHT_MIPS_RELD 0x70000009
+#define SHT_MIPS_IFACE 0x7000000b
+#define SHT_MIPS_CONTENT 0x7000000c
#define SHT_MIPS_OPTIONS 0x7000000d
+#define SHT_MIPS_DELTASYM 0x7000001b
+#define SHT_MIPS_DELTAINST 0x7000001c
+#define SHT_MIPS_DELTACLASS 0x7000001d
#define SHT_MIPS_DWARF 0x7000001e /* MIPS gcc uses MIPS_DWARF */
+#define SHT_MIPS_DELTADECL 0x7000001f
+#define SHT_MIPS_SYMBOL_LIB 0x70000020
+#define SHT_MIPS_EVENTS 0x70000021
+#define SHT_MIPS_TRANSLATE 0x70000022
+#define SHT_MIPS_PIXIE 0x70000023
+#define SHT_MIPS_XLATE 0x70000024
+#define SHT_MIPS_XLATE_DEBUG 0x70000025
+#define SHT_MIPS_WHIRL 0x70000026
+#define SHT_MIPS_EH_REGION 0x70000027
+#define SHT_MIPS_XLATE_OLD 0x70000028
+#define SHT_MIPS_PDR_EXCEPTION 0x70000029
+#define SHT_MIPS_ABIFLAGS 0x7000002a
+
+#define SHT_SPARC_GOTDATA 0x70000000
+
+#define SHTORDERED
#define SHT_HIPROC 0x7fffffff /* specific section header types */
#define SHT_LOUSER 0x80000000 /* reserved range for application */
#define SHT_HIUSER 0xffffffff /* specific indexes */
@@ -440,11 +582,15 @@ typedef struct {
* Dyn.d_un.d_val field of the Elf*_Dyn structure.
*/
#define DT_VALRNGLO 0x6ffffd00
+#define DT_GNU_PRELINKED 0x6ffffdf5 /* prelinking timestamp */
+#define DT_GNU_CONFLICTSZ 0x6ffffdf6 /* size of conflict section */
+#define DT_GNU_LIBLISTSZ 0x6ffffdf7 /* size of library list */
#define DT_CHECKSUM 0x6ffffdf8 /* elf checksum */
#define DT_PLTPADSZ 0x6ffffdf9 /* pltpadding size */
#define DT_MOVEENT 0x6ffffdfa /* move table entry size */
#define DT_MOVESZ 0x6ffffdfb /* move table size */
#define DT_FEATURE 0x6ffffdfc /* feature holder */
+#define DT_FEATURE_1 DT_FEATURE
#define DT_POSFLAG_1 0x6ffffdfd /* flags for DT_* entries, effecting */
/* the following DT_* entry. */
/* See DF_P1_* definitions */
@@ -461,6 +607,8 @@ typedef struct {
*/
#define DT_ADDRRNGLO 0x6ffffe00
#define DT_GNU_HASH 0x6ffffef5 /* GNU-style hash table */
+#define DT_GNU_CONFLICT 0x6ffffef8 /* address of conflict section */
+#define DT_GNU_LIBLIST 0x6ffffef9 /* address of library list */
#define DT_CONFIG 0x6ffffefa /* configuration information */
#define DT_DEPAUDIT 0x6ffffefb /* dependency auditing */
#define DT_AUDIT 0x6ffffefc /* object auditing */
@@ -479,7 +627,67 @@ typedef struct {
#define DT_VERNEEDNUM 0x6fffffff /* Number of elems in verneed section */
#define DT_LOPROC 0x70000000 /* First processor-specific type. */
+
+#define DT_ARM_SYMTABSZ 0x70000001
+#define DT_ARM_PREEMPTMAP 0x70000002
+
+#define DT_SPARC_REGISTER 0x70000001
#define DT_DEPRECATED_SPARC_REGISTER 0x7000001
+
+#define DT_MIPS_RLD_VERSION 0x70000001
+#define DT_MIPS_TIME_STAMP 0x70000002
+#define DT_MIPS_ICHECKSUM 0x70000003
+#define DT_MIPS_IVERSION 0x70000004
+#define DT_MIPS_FLAGS 0x70000005
+#define DT_MIPS_BASE_ADDRESS 0x70000006
+#define DT_MIPS_CONFLICT 0x70000008
+#define DT_MIPS_LIBLIST 0x70000009
+#define DT_MIPS_LOCAL_GOTNO 0x7000000a
+#define DT_MIPS_CONFLICTNO 0x7000000b
+#define DT_MIPS_LIBLISTNO 0x70000010
+#define DT_MIPS_SYMTABNO 0x70000011
+#define DT_MIPS_UNREFEXTNO 0x70000012
+#define DT_MIPS_GOTSYM 0x70000013
+#define DT_MIPS_HIPAGENO 0x70000014
+#define DT_MIPS_RLD_MAP 0x70000016
+#define DT_MIPS_DELTA_CLASS 0x70000017
+#define DT_MIPS_DELTA_CLASS_NO 0x70000018
+#define DT_MIPS_DELTA_INSTANCE 0x70000019
+#define DT_MIPS_DELTA_INSTANCE_NO 0x7000001A
+#define DT_MIPS_DELTA_RELOC 0x7000001B
+#define DT_MIPS_DELTA_RELOC_NO 0x7000001C
+#define DT_MIPS_DELTA_SYM 0x7000001D
+#define DT_MIPS_DELTA_SYM_NO 0x7000001E
+#define DT_MIPS_DELTA_CLASSSYM 0x70000020
+#define DT_MIPS_DELTA_CLASSSYM_NO 0x70000021
+#define DT_MIPS_CXX_FLAGS 0x70000022
+#define DT_MIPS_PIXIE_INIT 0x70000023
+#define DT_MIPS_SYMBOL_LIB 0x70000024
+#define DT_MIPS_LOCALPAGE_GOTIDX 0x70000025
+#define DT_MIPS_LOCAL_GOTIDX 0x70000026
+#define DT_MIPS_HIDDEN_GOTIDX 0x70000027
+#define DT_MIPS_PROTECTED_GOTIDX 0x70000028
+#define DT_MIPS_OPTIONS 0x70000029
+#define DT_MIPS_INTERFACE 0x7000002A
+#define DT_MIPS_DYNSTR_ALIGN 0x7000002B
+#define DT_MIPS_INTERFACE_SIZE 0x7000002C
+#define DT_MIPS_RLD_TEXT_RESOLVE_ADDR 0x7000002D
+#define DT_MIPS_PERF_SUFFIX 0x7000002E
+#define DT_MIPS_COMPACT_SIZE 0x7000002F
+#define DT_MIPS_GP_VALUE 0x70000030
+#define DT_MIPS_AUX_DYNAMIC 0x70000031
+#define DT_MIPS_PLTGOT 0x70000032
+#define DT_MIPS_RLD_OBJ_UPDATE 0x70000033
+#define DT_MIPS_RWPLT 0x70000034
+
+#define DT_PPC_GOT 0x70000000
+#define DT_PPC_TLSOPT 0x70000001
+
+#define DT_PPC64_GLINK 0x70000000
+#define DT_PPC64_OPD 0x70000001
+#define DT_PPC64_OPDSZ 0x70000002
+#define DT_PPC64_TLSOPT 0x70000003
+
#define DT_AUXILIARY 0x7ffffffd /* shared library auxiliary name */
#define DT_USED 0x7ffffffe /* ignored - same as needed */
#define DT_FILTER 0x7fffffff /* shared library filter name */
@@ -510,6 +718,15 @@ typedef struct {
#define DF_1_INTERPOSE 0x00000400 /* Interpose all objects but main */
#define DF_1_NODEFLIB 0x00000800 /* Do not search default paths */
+/* Values for l_flags. */
+#define LL_NONE 0x0 /* no flags */
+#define LL_EXACT_MATCH 0x1 /* require an exact match */
+#define LL_IGNORE_INT_VER 0x2 /* ignore version incompatibilities */
+#define LL_REQUIRE_MINOR 0x4
+#define LL_EXPORTS 0x8
+#define LL_DELAY_LOAD 0x10
+#define LL_DELTA 0x20
+
/* Values for n_type. Used in core files. */
#define NT_PRSTATUS 1 /* Process status. */
#define NT_FPREGSET 2 /* Floating point registers. */
diff --git a/sys/sys/sysent.h b/sys/sys/sysent.h
index a93d552..8436ba3 100644
--- a/sys/sys/sysent.h
+++ b/sys/sys/sysent.h
@@ -131,6 +131,7 @@ struct sysentvec {
void *sv_shared_page_obj;
void (*sv_schedtail)(struct thread *);
void (*sv_thread_detach)(struct thread *);
+ int (*sv_trap)(struct thread *);
};
#define SV_ILP32 0x000100
diff --git a/sys/vm/vm_kern.c b/sys/vm/vm_kern.c
index 291d0dd..d605c23 100644
--- a/sys/vm/vm_kern.c
+++ b/sys/vm/vm_kern.c
@@ -94,6 +94,9 @@ vm_map_t pipe_map;
const void *zero_region;
CTASSERT((ZERO_REGION_SIZE & PAGE_MASK) == 0);
+/* NB: Used by kernel debuggers. */
+const u_long vm_maxuser_address = VM_MAXUSER_ADDRESS;
+
SYSCTL_ULONG(_vm, OID_AUTO, min_kernel_address, CTLFLAG_RD,
SYSCTL_NULL_ULONG_PTR, VM_MIN_KERNEL_ADDRESS, "Min kernel address");
diff --git a/sys/x86/include/metadata.h b/sys/x86/include/metadata.h
new file mode 100644
index 0000000..e13eba0
--- /dev/null
+++ b/sys/x86/include/metadata.h
@@ -0,0 +1,57 @@
+/*-
+ * Copyright (c) 2003 Peter Wemm <peter@FreeBSD.org>
+ * 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 AND CONTRIBUTORS ``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 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.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef _MACHINE_METADATA_H_
+#define _MACHINE_METADATA_H_
+
+#define MODINFOMD_SMAP 0x1001
+#define MODINFOMD_SMAP_XATTR 0x1002
+#define MODINFOMD_DTBP 0x1003
+#define MODINFOMD_EFI_MAP 0x1004
+#define MODINFOMD_EFI_FB 0x1005
+#define MODINFOMD_MODULEP 0x1006
+
+struct efi_map_header {
+ uint64_t memory_size;
+ uint64_t descriptor_size;
+ uint32_t descriptor_version;
+};
+
+struct efi_fb {
+ uint64_t fb_addr;
+ uint64_t fb_size;
+ uint32_t fb_height;
+ uint32_t fb_width;
+ uint32_t fb_stride;
+ uint32_t fb_mask_red;
+ uint32_t fb_mask_green;
+ uint32_t fb_mask_blue;
+ uint32_t fb_mask_reserved;
+};
+
+#endif /* !_MACHINE_METADATA_H_ */
diff --git a/sys/x86/x86/busdma_bounce.c b/sys/x86/x86/busdma_bounce.c
index 38c9f1e..bb63397 100644
--- a/sys/x86/x86/busdma_bounce.c
+++ b/sys/x86/x86/busdma_bounce.c
@@ -402,14 +402,14 @@ bounce_bus_dmamem_alloc(bus_dma_tag_t dmat, void** vaddr, int flags,
/*
* XXX:
- * (dmat->alignment < dmat->maxsize) is just a quick hack; the exact
+ * (dmat->alignment <= dmat->maxsize) is just a quick hack; the exact
* alignment guarantees of malloc need to be nailed down, and the
* code below should be rewritten to take that into account.
*
* In the meantime, we'll warn the user if malloc gets it wrong.
*/
if ((dmat->common.maxsize <= PAGE_SIZE) &&
- (dmat->common.alignment < dmat->common.maxsize) &&
+ (dmat->common.alignment <= dmat->common.maxsize) &&
dmat->common.lowaddr >= ptoa((vm_paddr_t)Maxmem) &&
attr == VM_MEMATTR_DEFAULT) {
*vaddr = malloc(dmat->common.maxsize, M_DEVBUF, mflags);
diff --git a/tools/build/options/WITH_OPENSSH_NONE_CIPHER b/tools/build/options/WITH_OPENSSH_NONE_CIPHER
deleted file mode 100644
index 8d44cc0..0000000
--- a/tools/build/options/WITH_OPENSSH_NONE_CIPHER
+++ /dev/null
@@ -1,9 +0,0 @@
-.\" $FreeBSD$
-Set to include the "None" cipher support in OpenSSH and its libraries.
-Additional adjustments may need to be done to system configuration
-files, such as
-.Xr sshd_config 5 ,
-to enable this cipher.
-Please see
-.Pa /usr/src/crypto/openssh/README.hpn
-for full details.
diff --git a/tools/regression/geom_mirror/conf.sh b/tools/regression/geom_mirror/conf.sh
index 5e7e15a..d8595f1 100644
--- a/tools/regression/geom_mirror/conf.sh
+++ b/tools/regression/geom_mirror/conf.sh
@@ -5,4 +5,11 @@ name="$(mktemp -u mirror.XXXXXX)"
class="mirror"
base=`basename $0`
+gmirror_test_cleanup()
+{
+ [ -c /dev/$class/$name ] && gmirror destroy $name
+ geom_test_cleanup
+}
+trap gmirror_test_cleanup ABRT EXIT INT TERM
+
. `dirname $0`/../geom_subr.sh
diff --git a/tools/regression/geom_mirror/test-1.t b/tools/regression/geom_mirror/test-1.t
index b07a8d1..af82a14 100644
--- a/tools/regression/geom_mirror/test-1.t
+++ b/tools/regression/geom_mirror/test-1.t
@@ -5,15 +5,11 @@
echo "1..1"
-us0=45
-us1=`expr $us0 + 1`
-us2=`expr $us0 + 2`
+us0=$(attach_md -t malloc -s 1M) || exit 1
+us1=$(attach_md -t malloc -s 2M) || exit 1
+us2=$(attach_md -t malloc -s 3M) || exit 1
-mdconfig -a -t malloc -s 1M -u $us0 || exit 1
-mdconfig -a -t malloc -s 2M -u $us1 || exit 1
-mdconfig -a -t malloc -s 3M -u $us2 || exit 1
-
-gmirror label $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1
+gmirror label $name /dev/$us0 /dev/$us1 /dev/$us2 || exit 1
devwait
# Size of created device should be 1MB - 512b.
@@ -25,10 +21,3 @@ if [ $size -eq 1048064 ]; then
else
echo "not ok 1"
fi
-
-gmirror remove $name md${us0}
-gmirror remove $name md${us1}
-gmirror remove $name md${us2}
-mdconfig -d -u $us0
-mdconfig -d -u $us1
-mdconfig -d -u $us2
diff --git a/tools/regression/geom_mirror/test-2.t b/tools/regression/geom_mirror/test-2.t
index 3fb0822..5605c44 100644
--- a/tools/regression/geom_mirror/test-2.t
+++ b/tools/regression/geom_mirror/test-2.t
@@ -6,22 +6,19 @@
echo "1..4"
balance="round-robin"
-us0=45
-us1=`expr $us0 + 1`
-us2=`expr $us0 + 2`
ddbs=2048
nblocks1=1024
nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)`
-src=`mktemp /tmp/$base.XXXXXX` || exit 1
-dst=`mktemp /tmp/$base.XXXXXX` || exit 1
+src=`mktemp $base.XXXXXX` || exit 1
+dst=`mktemp $base.XXXXXX` || exit 1
dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1
-mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us0 || exit 1
-mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1
-mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1
+us0=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1
+us1=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1
+us2=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1
-gmirror label -b $balance $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1
+gmirror label -b $balance $name /dev/${us0} /dev/${us1} /dev/${us2} || exit 1
devwait
dd if=${src} of=/dev/mirror/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1
@@ -32,28 +29,24 @@ if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then
else
echo "ok 1"
fi
-dd if=/dev/md${us0} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1
+dd if=/dev/${us0} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1
if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then
echo "not ok 2"
else
echo "ok 2"
fi
-dd if=/dev/md${us1} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1
+dd if=/dev/${us1} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1
if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then
echo "not ok 3"
else
echo "ok 3"
fi
-dd if=/dev/md${us2} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1
+dd if=/dev/${us2} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1
if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then
echo "not ok 4"
else
echo "ok 4"
fi
-gmirror remove $name md${us0} md${us1} md${us2}
-mdconfig -d -u $us0
-mdconfig -d -u $us1
-mdconfig -d -u $us2
rm -f ${src} ${dst}
diff --git a/tools/regression/geom_mirror/test-3.t b/tools/regression/geom_mirror/test-3.t
index 5bdd2ab..b7f8525 100644
--- a/tools/regression/geom_mirror/test-3.t
+++ b/tools/regression/geom_mirror/test-3.t
@@ -6,22 +6,19 @@
echo "1..5"
balance="round-robin"
-us0=45
-us1=`expr $us0 + 1`
-us2=`expr $us0 + 2`
ddbs=2048
nblocks1=1024
nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)`
-src=`mktemp /tmp/$base.XXXXXX` || exit 1
-dst=`mktemp /tmp/$base.XXXXXX` || exit 1
+src=`mktemp $base.XXXXXX` || exit 1
+dst=`mktemp $base.XXXXXX` || exit 1
dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1
-mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us0 || exit 1
-mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1
-mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1
+us0=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1
+us1=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1
+us2=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1
-gmirror label -b $balance $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1
+gmirror label -b $balance $name /dev/${us0} /dev/${us1} /dev/${us2} || exit 1
devwait
dd if=${src} of=/dev/mirror/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1
@@ -33,7 +30,7 @@ else
echo "ok 1"
fi
-gmirror remove $name md${us0}
+gmirror remove $name ${us0}
dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1
if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then
echo "not ok 2"
@@ -41,7 +38,7 @@ else
echo "ok 2"
fi
-gmirror remove $name md${us1}
+gmirror remove $name ${us1}
dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1
if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then
echo "not ok 3"
@@ -49,7 +46,7 @@ else
echo "ok 3"
fi
-gmirror remove $name md${us2}
+gmirror remove $name ${us2}
dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1
if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then
echo "not ok 4"
@@ -64,7 +61,4 @@ else
echo "ok 5"
fi
-mdconfig -d -u $us0
-mdconfig -d -u $us1
-mdconfig -d -u $us2
rm -f ${src} ${dst}
diff --git a/tools/regression/geom_mirror/test-4.t b/tools/regression/geom_mirror/test-4.t
index 0786bdb..6efcc02 100644
--- a/tools/regression/geom_mirror/test-4.t
+++ b/tools/regression/geom_mirror/test-4.t
@@ -6,22 +6,19 @@
echo "1..5"
balance="load"
-us0=45
-us1=`expr $us0 + 1`
-us2=`expr $us0 + 2`
ddbs=2048
nblocks1=1024
nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)`
-src=`mktemp /tmp/$base.XXXXXX` || exit 1
-dst=`mktemp /tmp/$base.XXXXXX` || exit 1
+src=`mktemp $base.XXXXXX` || exit 1
+dst=`mktemp $base.XXXXXX` || exit 1
dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1
-mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us0 || exit 1
-mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1
-mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1
+us0=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1
+us1=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1
+us2=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1
-gmirror label -b $balance $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1
+gmirror label -b $balance $name /dev/${us0} /dev/${us1} /dev/${us2} || exit 1
devwait
dd if=${src} of=/dev/mirror/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1
@@ -33,7 +30,7 @@ else
echo "ok 1"
fi
-gmirror remove $name md${us0}
+gmirror remove $name ${us0}
dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1
if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then
echo "not ok 2"
@@ -41,7 +38,7 @@ else
echo "ok 2"
fi
-gmirror remove $name md${us1}
+gmirror remove $name ${us1}
dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1
if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then
echo "not ok 3"
@@ -49,7 +46,7 @@ else
echo "ok 3"
fi
-gmirror remove $name md${us2}
+gmirror remove $name ${us2}
dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1
if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then
echo "not ok 4"
@@ -57,6 +54,8 @@ else
echo "ok 4"
fi
+gmirror destroy $name
+
# mirror/${name} should be removed.
if [ -c /dev/${name} ]; then
echo "not ok 5"
@@ -64,7 +63,4 @@ else
echo "ok 5"
fi
-mdconfig -d -u $us0
-mdconfig -d -u $us1
-mdconfig -d -u $us2
rm -f ${src} ${dst}
diff --git a/tools/regression/geom_mirror/test-5.t b/tools/regression/geom_mirror/test-5.t
index 5b0a5ed..3a176b5 100644
--- a/tools/regression/geom_mirror/test-5.t
+++ b/tools/regression/geom_mirror/test-5.t
@@ -6,22 +6,19 @@
echo "1..5"
balance="split"
-us0=45
-us1=`expr $us0 + 1`
-us2=`expr $us0 + 2`
ddbs=8192
nblocks1=1024
nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)`
-src=`mktemp /tmp/$base.XXXXXX` || exit 1
-dst=`mktemp /tmp/$base.XXXXXX` || exit 1
+src=`mktemp $base.XXXXXX` || exit 1
+dst=`mktemp $base.XXXXXX` || exit 1
dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1
-mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us0 || exit 1
-mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1
-mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1
+us0=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1
+us1=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1
+us2=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1
-gmirror label -b $balance -s `expr $ddbs / 2` $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1
+gmirror label -b $balance -s `expr $ddbs / 2` $name /dev/${us0} /dev/${us1} /dev/${us2} || exit 1
devwait
dd if=${src} of=/dev/mirror/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1
@@ -33,7 +30,7 @@ else
echo "ok 1"
fi
-gmirror remove $name md${us0}
+gmirror remove $name ${us0}
dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1
if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then
echo "not ok 2"
@@ -41,7 +38,7 @@ else
echo "ok 2"
fi
-gmirror remove $name md${us1}
+gmirror remove $name ${us1}
dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1
if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then
echo "not ok 3"
@@ -49,7 +46,7 @@ else
echo "ok 3"
fi
-gmirror remove $name md${us2}
+gmirror remove $name ${us2}
dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1
if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then
echo "not ok 4"
@@ -64,7 +61,4 @@ else
echo "ok 5"
fi
-mdconfig -d -u $us0
-mdconfig -d -u $us1
-mdconfig -d -u $us2
rm -f ${src} ${dst}
diff --git a/tools/regression/geom_mirror/test-6.t b/tools/regression/geom_mirror/test-6.t
index ec86d06..68036e9 100644
--- a/tools/regression/geom_mirror/test-6.t
+++ b/tools/regression/geom_mirror/test-6.t
@@ -6,26 +6,23 @@
echo "1..2"
balance="split"
-us0=45
-us1=`expr $us0 + 1`
-us2=`expr $us0 + 2`
ddbs=8192
nblocks1=1024
nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)`
-src=`mktemp /tmp/$base.XXXXXX` || exit 1
-dst=`mktemp /tmp/$base.XXXXXX` || exit 1
+src=`mktemp $base.XXXXXX` || exit 1
+dst=`mktemp $base.XXXXXX` || exit 1
dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1
-mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us0 || exit 1
-mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1
-mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1
+us0=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1
+us1=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1
+us2=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1
-gmirror label -b $balance -s `expr $ddbs / 2` $name /dev/md${us0} /dev/md${us1} || exit 1
+gmirror label -b $balance -s `expr $ddbs / 2` $name /dev/${us0} /dev/${us1} || exit 1
devwait
dd if=${src} of=/dev/mirror/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1
-dd if=/dev/zero of=/dev/md${us2} bs=$ddbs count=$nblocks2 >/dev/null 2>&1
+dd if=/dev/zero of=/dev/${us2} bs=$ddbs count=$nblocks2 >/dev/null 2>&1
dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1
if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then
@@ -35,18 +32,14 @@ else
fi
# Connect disk to the mirror.
-gmirror insert ${name} md${us2}
+gmirror insert ${name} ${us2}
# Wait for synchronization.
sleep 1
-dd if=/dev/md${us2} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1
+dd if=/dev/${us2} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1
if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then
echo "not ok 2"
else
echo "ok 2"
fi
-gmirror remove $name md${us0} md${us1} md${us2}
-mdconfig -d -u $us0
-mdconfig -d -u $us1
-mdconfig -d -u $us2
rm -f ${src} ${dst}
diff --git a/tools/regression/geom_mirror/test-7.t b/tools/regression/geom_mirror/test-7.t
index c911c03..f5bf71a 100644
--- a/tools/regression/geom_mirror/test-7.t
+++ b/tools/regression/geom_mirror/test-7.t
@@ -6,22 +6,19 @@
echo "1..5"
balance="prefer"
-us0=45
-us1=`expr $us0 + 1`
-us2=`expr $us0 + 2`
ddbs=2048
nblocks1=1024
nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)`
-src=`mktemp /tmp/$base.XXXXXX` || exit 1
-dst=`mktemp /tmp/$base.XXXXXX` || exit 1
+src=`mktemp $base.XXXXXX` || exit 1
+dst=`mktemp $base.XXXXXX` || exit 1
dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1
-mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us0 || exit 1
-mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1
-mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1
+us0=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1
+us1=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1
+us2=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1
-gmirror label -b $balance $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1
+gmirror label -b $balance $name /dev/${us0} /dev/${us1} /dev/${us2} || exit 1
devwait
dd if=${src} of=/dev/mirror/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1
@@ -33,7 +30,7 @@ else
echo "ok 1"
fi
-gmirror remove $name md${us0}
+gmirror remove $name ${us0}
dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1
if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then
echo "not ok 2"
@@ -41,7 +38,7 @@ else
echo "ok 2"
fi
-gmirror remove $name md${us1}
+gmirror remove $name ${us1}
dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1
if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then
echo "not ok 3"
@@ -49,7 +46,7 @@ else
echo "ok 3"
fi
-gmirror remove $name md${us2}
+gmirror remove $name ${us2}
dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1
if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then
echo "not ok 4"
@@ -64,7 +61,4 @@ else
echo "ok 5"
fi
-mdconfig -d -u $us0
-mdconfig -d -u $us1
-mdconfig -d -u $us2
rm -f ${src} ${dst}
diff --git a/tools/regression/geom_subr.sh b/tools/regression/geom_subr.sh
index 0ffb8c8..b437183 100644
--- a/tools/regression/geom_subr.sh
+++ b/tools/regression/geom_subr.sh
@@ -1,13 +1,6 @@
#!/bin/sh
# $FreeBSD$
-if [ $(id -u) -ne 0 ]; then
- echo 'Tests must be run as root'
- echo 'Bail out!'
- exit 1
-fi
-kldstat -q -m g_${class} || geom ${class} load || exit 1
-
devwait()
{
while :; do
@@ -18,13 +11,6 @@ devwait()
done
}
-# Need to keep track of the test md devices to avoid the scenario where a test
-# failing will cause the other tests to bomb out, or a test failing will leave
-# a large number of md(4) devices lingering around
-: ${TMPDIR=/tmp}
-export TMPDIR
-TEST_MDS_FILE=${TMPDIR}/test_mds
-
attach_md()
{
local test_md
@@ -38,11 +24,37 @@ geom_test_cleanup()
{
local test_md
- if [ -f $TEST_MDS_FILE ]; then
+ if [ -f "$TEST_MDS_FILE" ]; then
while read test_md; do
# The "#" tells the TAP parser this is a comment
echo "# Removing test memory disk: $test_md"
mdconfig -d -u $test_md
done < $TEST_MDS_FILE
fi
+ rm -f "$TEST_MDS_FILE"
}
+
+if [ $(id -u) -ne 0 ]; then
+ echo 'Tests must be run as root'
+ echo 'Bail out!'
+ exit 1
+fi
+# If the geom class isn't already loaded, try loading it.
+if ! kldstat -q -m g_${class}; then
+ if ! geom ${class} load; then
+ echo "Could not load module for geom class=${class}"
+ echo 'Bail out!'
+ exit 1
+ fi
+fi
+
+# Need to keep track of the test md devices to avoid the scenario where a test
+# failing will cause the other tests to bomb out, or a test failing will leave
+# a large number of md(4) devices lingering around
+: ${TMPDIR=/tmp}
+export TMPDIR
+if ! TEST_MDS_FILE=$(mktemp ${TMPDIR}/test_mds.XXXXXX); then
+ echo 'Failed to create temporary file for tracking the test md(4) devices'
+ echo 'Bail out!'
+ exit 1
+fi
diff --git a/tools/regression/lib/msun/Makefile b/tools/regression/lib/msun/Makefile
deleted file mode 100644
index 8b301cb..0000000
--- a/tools/regression/lib/msun/Makefile
+++ /dev/null
@@ -1,14 +0,0 @@
-# $FreeBSD$
-
-TESTS= test-ctrig \
- test-exponential test-fma \
- test-lround test-nearbyint test-next test-rem test-trig
-CFLAGS+= -O0 -lm -Wno-unknown-pragmas
-
-.PHONY: tests
-tests: ${TESTS}
- for p in ${TESTS}; do ${.OBJDIR}/$$p; done
-
-.PHONY: clean
-clean:
- -rm -f ${TESTS}
diff --git a/tools/regression/lib/msun/test-cexp.c b/tools/regression/lib/msun/test-cexp.c
deleted file mode 100644
index 69897d3..0000000
--- a/tools/regression/lib/msun/test-cexp.c
+++ /dev/null
@@ -1,322 +0,0 @@
-/*-
- * Copyright (c) 2008-2011 David Schultz <das@FreeBSD.org>
- * 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 AND CONTRIBUTORS ``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 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.
- */
-
-/*
- * Tests for corner cases in cexp*().
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <assert.h>
-#include <complex.h>
-#include <fenv.h>
-#include <float.h>
-#include <math.h>
-#include <stdio.h>
-
-#include "test-utils.h"
-
-#define N(i) (sizeof(i) / sizeof((i)[0]))
-
-#pragma STDC FENV_ACCESS ON
-#pragma STDC CX_LIMITED_RANGE OFF
-
-/*
- * Test that a function returns the correct value and sets the
- * exception flags correctly. The exceptmask specifies which
- * exceptions we should check. We need to be lenient for several
- * reasons, but mainly because on some architectures it's impossible
- * to raise FE_OVERFLOW without raising FE_INEXACT. In some cases,
- * whether cexp() raises an invalid exception is unspecified.
- *
- * These are macros instead of functions so that assert provides more
- * meaningful error messages.
- *
- * XXX The volatile here is to avoid gcc's bogus constant folding and work
- * around the lack of support for the FENV_ACCESS pragma.
- */
-#define test(func, z, result, exceptmask, excepts, checksign) do { \
- volatile long double complex _d = z; \
- assert(feclearexcept(FE_ALL_EXCEPT) == 0); \
- assert(cfpequal_cs((func)(_d), (result), (checksign))); \
- assert(((void)(func), fetestexcept(exceptmask) == (excepts))); \
-} while (0)
-
-/* Test within a given tolerance. */
-#define test_tol(func, z, result, tol) do { \
- volatile long double complex _d = z; \
- assert(cfpequal_tol((func)(_d), (result), (tol), \
- FPE_ABS_ZERO | CS_BOTH)); \
-} while (0)
-
-/* Test all the functions that compute cexp(x). */
-#define testall(x, result, exceptmask, excepts, checksign) do { \
- test(cexp, x, result, exceptmask, excepts, checksign); \
- test(cexpf, x, result, exceptmask, excepts, checksign); \
-} while (0)
-
-/*
- * Test all the functions that compute cexp(x), within a given tolerance.
- * The tolerance is specified in ulps.
- */
-#define testall_tol(x, result, tol) do { \
- test_tol(cexp, x, result, tol * DBL_ULP()); \
- test_tol(cexpf, x, result, tol * FLT_ULP()); \
-} while (0)
-
-/* Various finite non-zero numbers to test. */
-static const float finites[] =
-{ -42.0e20, -1.0, -1.0e-10, -0.0, 0.0, 1.0e-10, 1.0, 42.0e20 };
-
-
-/* Tests for 0 */
-void
-test_zero(void)
-{
-
- /* cexp(0) = 1, no exceptions raised */
- testall(0.0, 1.0, ALL_STD_EXCEPT, 0, 1);
- testall(-0.0, 1.0, ALL_STD_EXCEPT, 0, 1);
- testall(CMPLXL(0.0, -0.0), CMPLXL(1.0, -0.0), ALL_STD_EXCEPT, 0, 1);
- testall(CMPLXL(-0.0, -0.0), CMPLXL(1.0, -0.0), ALL_STD_EXCEPT, 0, 1);
-}
-
-/*
- * Tests for NaN. The signs of the results are indeterminate unless the
- * imaginary part is 0.
- */
-void
-test_nan()
-{
- int i;
-
- /* cexp(x + NaNi) = NaN + NaNi and optionally raises invalid */
- /* cexp(NaN + yi) = NaN + NaNi and optionally raises invalid (|y|>0) */
- for (i = 0; i < N(finites); i++) {
- printf("# Run %d..\n", i);
- testall(CMPLXL(finites[i], NAN), CMPLXL(NAN, NAN),
- ALL_STD_EXCEPT & ~FE_INVALID, 0, 0);
- if (finites[i] == 0.0)
- continue;
- /* XXX FE_INEXACT shouldn't be raised here */
- testall(CMPLXL(NAN, finites[i]), CMPLXL(NAN, NAN),
- ALL_STD_EXCEPT & ~(FE_INVALID | FE_INEXACT), 0, 0);
- }
-
- /* cexp(NaN +- 0i) = NaN +- 0i */
- testall(CMPLXL(NAN, 0.0), CMPLXL(NAN, 0.0), ALL_STD_EXCEPT, 0, 1);
- testall(CMPLXL(NAN, -0.0), CMPLXL(NAN, -0.0), ALL_STD_EXCEPT, 0, 1);
-
- /* cexp(inf + NaN i) = inf + nan i */
- testall(CMPLXL(INFINITY, NAN), CMPLXL(INFINITY, NAN),
- ALL_STD_EXCEPT, 0, 0);
- /* cexp(-inf + NaN i) = 0 */
- testall(CMPLXL(-INFINITY, NAN), CMPLXL(0.0, 0.0),
- ALL_STD_EXCEPT, 0, 0);
- /* cexp(NaN + NaN i) = NaN + NaN i */
- testall(CMPLXL(NAN, NAN), CMPLXL(NAN, NAN),
- ALL_STD_EXCEPT, 0, 0);
-}
-
-void
-test_inf(void)
-{
- int i;
-
- /* cexp(x + inf i) = NaN + NaNi and raises invalid */
- for (i = 0; i < N(finites); i++) {
- printf("# Run %d..\n", i);
- testall(CMPLXL(finites[i], INFINITY), CMPLXL(NAN, NAN),
- ALL_STD_EXCEPT, FE_INVALID, 1);
- }
- /* cexp(-inf + yi) = 0 * (cos(y) + sin(y)i) */
- /* XXX shouldn't raise an inexact exception */
- testall(CMPLXL(-INFINITY, M_PI_4), CMPLXL(0.0, 0.0),
- ALL_STD_EXCEPT & ~FE_INEXACT, 0, 1);
- testall(CMPLXL(-INFINITY, 3 * M_PI_4), CMPLXL(-0.0, 0.0),
- ALL_STD_EXCEPT & ~FE_INEXACT, 0, 1);
- testall(CMPLXL(-INFINITY, 5 * M_PI_4), CMPLXL(-0.0, -0.0),
- ALL_STD_EXCEPT & ~FE_INEXACT, 0, 1);
- testall(CMPLXL(-INFINITY, 7 * M_PI_4), CMPLXL(0.0, -0.0),
- ALL_STD_EXCEPT & ~FE_INEXACT, 0, 1);
- testall(CMPLXL(-INFINITY, 0.0), CMPLXL(0.0, 0.0),
- ALL_STD_EXCEPT, 0, 1);
- testall(CMPLXL(-INFINITY, -0.0), CMPLXL(0.0, -0.0),
- ALL_STD_EXCEPT, 0, 1);
- /* cexp(inf + yi) = inf * (cos(y) + sin(y)i) (except y=0) */
- /* XXX shouldn't raise an inexact exception */
- testall(CMPLXL(INFINITY, M_PI_4), CMPLXL(INFINITY, INFINITY),
- ALL_STD_EXCEPT & ~FE_INEXACT, 0, 1);
- testall(CMPLXL(INFINITY, 3 * M_PI_4), CMPLXL(-INFINITY, INFINITY),
- ALL_STD_EXCEPT & ~FE_INEXACT, 0, 1);
- testall(CMPLXL(INFINITY, 5 * M_PI_4), CMPLXL(-INFINITY, -INFINITY),
- ALL_STD_EXCEPT & ~FE_INEXACT, 0, 1);
- testall(CMPLXL(INFINITY, 7 * M_PI_4), CMPLXL(INFINITY, -INFINITY),
- ALL_STD_EXCEPT & ~FE_INEXACT, 0, 1);
- /* cexp(inf + 0i) = inf + 0i */
- testall(CMPLXL(INFINITY, 0.0), CMPLXL(INFINITY, 0.0),
- ALL_STD_EXCEPT, 0, 1);
- testall(CMPLXL(INFINITY, -0.0), CMPLXL(INFINITY, -0.0),
- ALL_STD_EXCEPT, 0, 1);
-}
-
-void
-test_reals(void)
-{
- int i;
-
- for (i = 0; i < N(finites); i++) {
- /* XXX could check exceptions more meticulously */
- printf("# Run %d..\n", i);
- test(cexp, CMPLXL(finites[i], 0.0),
- CMPLXL(exp(finites[i]), 0.0),
- FE_INVALID | FE_DIVBYZERO, 0, 1);
- test(cexp, CMPLXL(finites[i], -0.0),
- CMPLXL(exp(finites[i]), -0.0),
- FE_INVALID | FE_DIVBYZERO, 0, 1);
- test(cexpf, CMPLXL(finites[i], 0.0),
- CMPLXL(expf(finites[i]), 0.0),
- FE_INVALID | FE_DIVBYZERO, 0, 1);
- test(cexpf, CMPLXL(finites[i], -0.0),
- CMPLXL(expf(finites[i]), -0.0),
- FE_INVALID | FE_DIVBYZERO, 0, 1);
- }
-}
-
-void
-test_imaginaries(void)
-{
- int i;
-
- for (i = 0; i < N(finites); i++) {
- printf("# Run %d..\n", i);
- test(cexp, CMPLXL(0.0, finites[i]),
- CMPLXL(cos(finites[i]), sin(finites[i])),
- ALL_STD_EXCEPT & ~FE_INEXACT, 0, 1);
- test(cexp, CMPLXL(-0.0, finites[i]),
- CMPLXL(cos(finites[i]), sin(finites[i])),
- ALL_STD_EXCEPT & ~FE_INEXACT, 0, 1);
- test(cexpf, CMPLXL(0.0, finites[i]),
- CMPLXL(cosf(finites[i]), sinf(finites[i])),
- ALL_STD_EXCEPT & ~FE_INEXACT, 0, 1);
- test(cexpf, CMPLXL(-0.0, finites[i]),
- CMPLXL(cosf(finites[i]), sinf(finites[i])),
- ALL_STD_EXCEPT & ~FE_INEXACT, 0, 1);
- }
-}
-
-void
-test_small(void)
-{
- static const double tests[] = {
- /* csqrt(a + bI) = x + yI */
- /* a b x y */
- 1.0, M_PI_4, M_SQRT2 * 0.5 * M_E, M_SQRT2 * 0.5 * M_E,
- -1.0, M_PI_4, M_SQRT2 * 0.5 / M_E, M_SQRT2 * 0.5 / M_E,
- 2.0, M_PI_2, 0.0, M_E * M_E,
- M_LN2, M_PI, -2.0, 0.0,
- };
- double a, b;
- double x, y;
- int i;
-
- for (i = 0; i < N(tests); i += 4) {
- printf("# Run %d..\n", i);
- a = tests[i];
- b = tests[i + 1];
- x = tests[i + 2];
- y = tests[i + 3];
- test_tol(cexp, CMPLXL(a, b), CMPLXL(x, y), 3 * DBL_ULP());
-
- /* float doesn't have enough precision to pass these tests */
- if (x == 0 || y == 0)
- continue;
- test_tol(cexpf, CMPLXL(a, b), CMPLXL(x, y), 1 * FLT_ULP());
- }
-}
-
-/* Test inputs with a real part r that would overflow exp(r). */
-void
-test_large(void)
-{
-
- test_tol(cexp, CMPLXL(709.79, 0x1p-1074),
- CMPLXL(INFINITY, 8.94674309915433533273e-16), DBL_ULP());
- test_tol(cexp, CMPLXL(1000, 0x1p-1074),
- CMPLXL(INFINITY, 9.73344457300016401328e+110), DBL_ULP());
- test_tol(cexp, CMPLXL(1400, 0x1p-1074),
- CMPLXL(INFINITY, 5.08228858149196559681e+284), DBL_ULP());
- test_tol(cexp, CMPLXL(900, 0x1.23456789abcdep-1020),
- CMPLXL(INFINITY, 7.42156649354218408074e+83), DBL_ULP());
- test_tol(cexp, CMPLXL(1300, 0x1.23456789abcdep-1020),
- CMPLXL(INFINITY, 3.87514844965996756704e+257), DBL_ULP());
-
- test_tol(cexpf, CMPLXL(88.73, 0x1p-149),
- CMPLXL(INFINITY, 4.80265603e-07), 2 * FLT_ULP());
- test_tol(cexpf, CMPLXL(90, 0x1p-149),
- CMPLXL(INFINITY, 1.7101492622e-06f), 2 * FLT_ULP());
- test_tol(cexpf, CMPLXL(192, 0x1p-149),
- CMPLXL(INFINITY, 3.396809344e+38f), 2 * FLT_ULP());
- test_tol(cexpf, CMPLXL(120, 0x1.234568p-120),
- CMPLXL(INFINITY, 1.1163382522e+16f), 2 * FLT_ULP());
- test_tol(cexpf, CMPLXL(170, 0x1.234568p-120),
- CMPLXL(INFINITY, 5.7878851079e+37f), 2 * FLT_ULP());
-}
-
-int
-main(int argc, char *argv[])
-{
-
- printf("1..7\n");
-
- test_zero();
- printf("ok 1 - cexp zero\n");
-
- test_nan();
- printf("ok 2 - cexp nan\n");
-
- test_inf();
- printf("ok 3 - cexp inf\n");
-
-#if defined(__i386__)
- printf("not ok 4 - cexp reals # TODO: PR # 191676 fails assertion on i386\n");
-#else
- test_reals();
- printf("ok 4 - cexp reals\n");
-#endif
-
- test_imaginaries();
- printf("ok 5 - cexp imaginaries\n");
-
- test_small();
- printf("ok 6 - cexp small\n");
-
- test_large();
- printf("ok 7 - cexp large\n");
-
- return (0);
-}
diff --git a/tools/regression/lib/msun/test-conj.c b/tools/regression/lib/msun/test-conj.c
deleted file mode 100644
index c261f60..0000000
--- a/tools/regression/lib/msun/test-conj.c
+++ /dev/null
@@ -1,139 +0,0 @@
-/*-
- * Copyright (c) 2008 David Schultz <das@FreeBSD.org>
- * 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 AND CONTRIBUTORS ``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 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.
- */
-
-/*
- * Tests for conj{,f,l}()
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <assert.h>
-#include <complex.h>
-#include <fenv.h>
-#include <math.h>
-#include <stdio.h>
-
-#include "test-utils.h"
-
-#pragma STDC CX_LIMITED_RANGE off
-
-/* Make sure gcc doesn't use builtin versions of these or honor __pure2. */
-static float complex (*libconjf)(float complex) = conjf;
-static double complex (*libconj)(double complex) = conj;
-static long double complex (*libconjl)(long double complex) = conjl;
-static float (*libcrealf)(float complex) = crealf;
-static double (*libcreal)(double complex) = creal;
-static long double (*libcreall)(long double complex) = creall;
-static float (*libcimagf)(float complex) = cimagf;
-static double (*libcimag)(double complex) = cimag;
-static long double (*libcimagl)(long double complex) = cimagl;
-
-static const double tests[] = {
- /* a + bI */
- 0.0, 0.0,
- 0.0, 1.0,
- 1.0, 0.0,
- -1.0, 0.0,
- 1.0, -0.0,
- 0.0, -1.0,
- 2.0, 4.0,
- 0.0, INFINITY,
- 0.0, -INFINITY,
- INFINITY, 0.0,
- NAN, 1.0,
- 1.0, NAN,
- NAN, NAN,
- -INFINITY, INFINITY,
-};
-
-int
-main(int argc, char *argv[])
-{
- static const int ntests = sizeof(tests) / sizeof(tests[0]) / 2;
- complex float in;
- complex long double expected;
- int i;
-
- printf("1..%d\n", ntests * 3);
-
- for (i = 0; i < ntests; i++) {
- __real__ expected = __real__ in = tests[2 * i];
- __imag__ in = tests[2 * i + 1];
- __imag__ expected = -cimag(in);
-
- assert(fpequal(libcrealf(in), __real__ in));
- assert(fpequal(libcreal(in), __real__ in));
- assert(fpequal(libcreall(in), __real__ in));
- assert(fpequal(libcimagf(in), __imag__ in));
- assert(fpequal(libcimag(in), __imag__ in));
- assert(fpequal(libcimagl(in), __imag__ in));
-
- feclearexcept(FE_ALL_EXCEPT);
- if (!cfpequal(libconjf(in), expected)) {
- printf("not ok %d\t# conjf(%#.2g + %#.2gI): "
- "wrong value\n",
- 3 * i + 1, creal(in), cimag(in));
- } else if (fetestexcept(FE_ALL_EXCEPT)) {
- printf("not ok %d\t# conjf(%#.2g + %#.2gI): "
- "threw an exception\n",
- 3 * i + 1, creal(in), cimag(in));
- } else {
- printf("ok %d\t\t# conjf(%#.2g + %#.2gI)\n",
- 3 * i + 1, creal(in), cimag(in));
- }
-
- feclearexcept(FE_ALL_EXCEPT);
- if (!cfpequal(libconj(in), expected)) {
- printf("not ok %d\t# conj(%#.2g + %#.2gI): "
- "wrong value\n",
- 3 * i + 2, creal(in), cimag(in));
- } else if (fetestexcept(FE_ALL_EXCEPT)) {
- printf("not ok %d\t# conj(%#.2g + %#.2gI): "
- "threw an exception\n",
- 3 * i + 2, creal(in), cimag(in));
- } else {
- printf("ok %d\t\t# conj(%#.2g + %#.2gI)\n",
- 3 * i + 2, creal(in), cimag(in));
- }
-
- feclearexcept(FE_ALL_EXCEPT);
- if (!cfpequal(libconjl(in), expected)) {
- printf("not ok %d\t# conjl(%#.2g + %#.2gI): "
- "wrong value\n",
- 3 * i + 3, creal(in), cimag(in));
- } else if (fetestexcept(FE_ALL_EXCEPT)) {
- printf("not ok %d\t# conjl(%#.2g + %#.2gI): "
- "threw an exception\n",
- 3 * i + 3, creal(in), cimag(in));
- } else {
- printf("ok %d\t\t# conjl(%#.2g + %#.2gI)\n",
- 3 * i + 3, creal(in), cimag(in));
- }
- }
-
- return (0);
-}
diff --git a/tools/regression/lib/msun/test-csqrt.c b/tools/regression/lib/msun/test-csqrt.c
deleted file mode 100644
index 39176eb..0000000
--- a/tools/regression/lib/msun/test-csqrt.c
+++ /dev/null
@@ -1,295 +0,0 @@
-/*-
- * Copyright (c) 2007 David Schultz <das@FreeBSD.org>
- * 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 AND CONTRIBUTORS ``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 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.
- */
-
-/*
- * Tests for csqrt{,f}()
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <assert.h>
-#include <complex.h>
-#include <float.h>
-#include <math.h>
-#include <stdio.h>
-
-#include "test-utils.h"
-
-#define N(i) (sizeof(i) / sizeof((i)[0]))
-
-/*
- * This is a test hook that can point to csqrtl(), _csqrt(), or to _csqrtf().
- * The latter two convert to float or double, respectively, and test csqrtf()
- * and csqrt() with the same arguments.
- */
-long double complex (*t_csqrt)(long double complex);
-
-static long double complex
-_csqrtf(long double complex d)
-{
-
- return (csqrtf((float complex)d));
-}
-
-static long double complex
-_csqrt(long double complex d)
-{
-
- return (csqrt((double complex)d));
-}
-
-#pragma STDC CX_LIMITED_RANGE off
-
-/*
- * Compare d1 and d2 using special rules: NaN == NaN and +0 != -0.
- * Fail an assertion if they differ.
- */
-static void
-assert_equal(long double complex d1, long double complex d2)
-{
-
- assert(cfpequal(d1, d2));
-}
-
-/*
- * Test csqrt for some finite arguments where the answer is exact.
- * (We do not test if it produces correctly rounded answers when the
- * result is inexact, nor do we check whether it throws spurious
- * exceptions.)
- */
-static void
-test_finite()
-{
- static const double tests[] = {
- /* csqrt(a + bI) = x + yI */
- /* a b x y */
- 0, 8, 2, 2,
- 0, -8, 2, -2,
- 4, 0, 2, 0,
- -4, 0, 0, 2,
- 3, 4, 2, 1,
- 3, -4, 2, -1,
- -3, 4, 1, 2,
- -3, -4, 1, -2,
- 5, 12, 3, 2,
- 7, 24, 4, 3,
- 9, 40, 5, 4,
- 11, 60, 6, 5,
- 13, 84, 7, 6,
- 33, 56, 7, 4,
- 39, 80, 8, 5,
- 65, 72, 9, 4,
- 987, 9916, 74, 67,
- 5289, 6640, 83, 40,
- 460766389075.0, 16762287900.0, 678910, 12345
- };
- /*
- * We also test some multiples of the above arguments. This
- * array defines which multiples we use. Note that these have
- * to be small enough to not cause overflow for float precision
- * with all of the constants in the above table.
- */
- static const double mults[] = {
- 1,
- 2,
- 3,
- 13,
- 16,
- 0x1.p30,
- 0x1.p-30,
- };
-
- double a, b;
- double x, y;
- int i, j;
-
- for (i = 0; i < N(tests); i += 4) {
- for (j = 0; j < N(mults); j++) {
- a = tests[i] * mults[j] * mults[j];
- b = tests[i + 1] * mults[j] * mults[j];
- x = tests[i + 2] * mults[j];
- y = tests[i + 3] * mults[j];
- assert(t_csqrt(CMPLXL(a, b)) == CMPLXL(x, y));
- }
- }
-
-}
-
-/*
- * Test the handling of +/- 0.
- */
-static void
-test_zeros()
-{
-
- assert_equal(t_csqrt(CMPLXL(0.0, 0.0)), CMPLXL(0.0, 0.0));
- assert_equal(t_csqrt(CMPLXL(-0.0, 0.0)), CMPLXL(0.0, 0.0));
- assert_equal(t_csqrt(CMPLXL(0.0, -0.0)), CMPLXL(0.0, -0.0));
- assert_equal(t_csqrt(CMPLXL(-0.0, -0.0)), CMPLXL(0.0, -0.0));
-}
-
-/*
- * Test the handling of infinities when the other argument is not NaN.
- */
-static void
-test_infinities()
-{
- static const double vals[] = {
- 0.0,
- -0.0,
- 42.0,
- -42.0,
- INFINITY,
- -INFINITY,
- };
-
- int i;
-
- for (i = 0; i < N(vals); i++) {
- if (isfinite(vals[i])) {
- assert_equal(t_csqrt(CMPLXL(-INFINITY, vals[i])),
- CMPLXL(0.0, copysignl(INFINITY, vals[i])));
- assert_equal(t_csqrt(CMPLXL(INFINITY, vals[i])),
- CMPLXL(INFINITY, copysignl(0.0, vals[i])));
- }
- assert_equal(t_csqrt(CMPLXL(vals[i], INFINITY)),
- CMPLXL(INFINITY, INFINITY));
- assert_equal(t_csqrt(CMPLXL(vals[i], -INFINITY)),
- CMPLXL(INFINITY, -INFINITY));
- }
-}
-
-/*
- * Test the handling of NaNs.
- */
-static void
-test_nans()
-{
-
- assert(creall(t_csqrt(CMPLXL(INFINITY, NAN))) == INFINITY);
- assert(isnan(cimagl(t_csqrt(CMPLXL(INFINITY, NAN)))));
-
- assert(isnan(creall(t_csqrt(CMPLXL(-INFINITY, NAN)))));
- assert(isinf(cimagl(t_csqrt(CMPLXL(-INFINITY, NAN)))));
-
- assert_equal(t_csqrt(CMPLXL(NAN, INFINITY)),
- CMPLXL(INFINITY, INFINITY));
- assert_equal(t_csqrt(CMPLXL(NAN, -INFINITY)),
- CMPLXL(INFINITY, -INFINITY));
-
- assert_equal(t_csqrt(CMPLXL(0.0, NAN)), CMPLXL(NAN, NAN));
- assert_equal(t_csqrt(CMPLXL(-0.0, NAN)), CMPLXL(NAN, NAN));
- assert_equal(t_csqrt(CMPLXL(42.0, NAN)), CMPLXL(NAN, NAN));
- assert_equal(t_csqrt(CMPLXL(-42.0, NAN)), CMPLXL(NAN, NAN));
- assert_equal(t_csqrt(CMPLXL(NAN, 0.0)), CMPLXL(NAN, NAN));
- assert_equal(t_csqrt(CMPLXL(NAN, -0.0)), CMPLXL(NAN, NAN));
- assert_equal(t_csqrt(CMPLXL(NAN, 42.0)), CMPLXL(NAN, NAN));
- assert_equal(t_csqrt(CMPLXL(NAN, -42.0)), CMPLXL(NAN, NAN));
- assert_equal(t_csqrt(CMPLXL(NAN, NAN)), CMPLXL(NAN, NAN));
-}
-
-/*
- * Test whether csqrt(a + bi) works for inputs that are large enough to
- * cause overflow in hypot(a, b) + a. In this case we are using
- * csqrt(115 + 252*I) == 14 + 9*I
- * scaled up to near MAX_EXP.
- */
-static void
-test_overflow(int maxexp)
-{
- long double a, b;
- long double complex result;
-
- a = ldexpl(115 * 0x1p-8, maxexp);
- b = ldexpl(252 * 0x1p-8, maxexp);
- result = t_csqrt(CMPLXL(a, b));
- assert(creall(result) == ldexpl(14 * 0x1p-4, maxexp / 2));
- assert(cimagl(result) == ldexpl(9 * 0x1p-4, maxexp / 2));
-}
-
-int
-main(int argc, char *argv[])
-{
-
- printf("1..15\n");
-
- /* Test csqrt() */
- t_csqrt = _csqrt;
-
- test_finite();
- printf("ok 1 - csqrt\n");
-
- test_zeros();
- printf("ok 2 - csqrt\n");
-
- test_infinities();
- printf("ok 3 - csqrt\n");
-
- test_nans();
- printf("ok 4 - csqrt\n");
-
- test_overflow(DBL_MAX_EXP);
- printf("ok 5 - csqrt\n");
-
- /* Now test csqrtf() */
- t_csqrt = _csqrtf;
-
- test_finite();
- printf("ok 6 - csqrt\n");
-
- test_zeros();
- printf("ok 7 - csqrt\n");
-
- test_infinities();
- printf("ok 8 - csqrt\n");
-
- test_nans();
- printf("ok 9 - csqrt\n");
-
- test_overflow(FLT_MAX_EXP);
- printf("ok 10 - csqrt\n");
-
- /* Now test csqrtl() */
- t_csqrt = csqrtl;
-
- test_finite();
- printf("ok 11 - csqrt\n");
-
- test_zeros();
- printf("ok 12 - csqrt\n");
-
- test_infinities();
- printf("ok 13 - csqrt\n");
-
- test_nans();
- printf("ok 14 - csqrt\n");
-
- test_overflow(LDBL_MAX_EXP);
- printf("ok 15 - csqrt\n");
-
- return (0);
-}
diff --git a/tools/regression/lib/msun/test-exponential.t b/tools/regression/lib/msun/test-exponential.t
deleted file mode 100644
index 8bdfd03..0000000
--- a/tools/regression/lib/msun/test-exponential.t
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/sh
-# $FreeBSD$
-
-cd `dirname $0`
-
-executable=`basename $0 .t`
-
-make $executable 2>&1 > /dev/null
-
-exec ./$executable
diff --git a/tools/regression/lib/msun/test-fma.t b/tools/regression/lib/msun/test-fma.t
deleted file mode 100644
index 8bdfd03..0000000
--- a/tools/regression/lib/msun/test-fma.t
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/sh
-# $FreeBSD$
-
-cd `dirname $0`
-
-executable=`basename $0 .t`
-
-make $executable 2>&1 > /dev/null
-
-exec ./$executable
diff --git a/tools/regression/lib/msun/test-invtrig.t b/tools/regression/lib/msun/test-invtrig.t
deleted file mode 100644
index 8bdfd03..0000000
--- a/tools/regression/lib/msun/test-invtrig.t
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/sh
-# $FreeBSD$
-
-cd `dirname $0`
-
-executable=`basename $0 .t`
-
-make $executable 2>&1 > /dev/null
-
-exec ./$executable
diff --git a/tools/regression/lib/msun/test-lround.t b/tools/regression/lib/msun/test-lround.t
deleted file mode 100644
index 8bdfd03..0000000
--- a/tools/regression/lib/msun/test-lround.t
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/sh
-# $FreeBSD$
-
-cd `dirname $0`
-
-executable=`basename $0 .t`
-
-make $executable 2>&1 > /dev/null
-
-exec ./$executable
diff --git a/tools/regression/lib/msun/test-trig.c b/tools/regression/lib/msun/test-trig.c
deleted file mode 100644
index 80f1aef..0000000
--- a/tools/regression/lib/msun/test-trig.c
+++ /dev/null
@@ -1,280 +0,0 @@
-/*-
- * Copyright (c) 2008 David Schultz <das@FreeBSD.org>
- * 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 AND CONTRIBUTORS ``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 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.
- */
-
-/*
- * Tests for corner cases in trigonometric functions. Some accuracy tests
- * are included as well, but these are very basic sanity checks, not
- * intended to be comprehensive.
- *
- * The program for generating representable numbers near multiples of pi is
- * available at http://www.cs.berkeley.edu/~wkahan/testpi/ .
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <assert.h>
-#include <fenv.h>
-#include <float.h>
-#include <math.h>
-#include <stdio.h>
-
-#include "test-utils.h"
-
-#define LEN(a) (sizeof(a) / sizeof((a)[0]))
-
-#pragma STDC FENV_ACCESS ON
-
-/*
- * Test that a function returns the correct value and sets the
- * exception flags correctly. The exceptmask specifies which
- * exceptions we should check. We need to be lenient for several
- * reasons, but mainly because on some architectures it's impossible
- * to raise FE_OVERFLOW without raising FE_INEXACT.
- *
- * These are macros instead of functions so that assert provides more
- * meaningful error messages.
- *
- * XXX The volatile here is to avoid gcc's bogus constant folding and work
- * around the lack of support for the FENV_ACCESS pragma.
- */
-#define test(func, x, result, exceptmask, excepts) do { \
- volatile long double _d = x; \
- assert(feclearexcept(FE_ALL_EXCEPT) == 0); \
- assert(fpequal((func)(_d), (result))); \
- assert(((void)(func), fetestexcept(exceptmask) == (excepts))); \
-} while (0)
-
-#define testall(prefix, x, result, exceptmask, excepts) do { \
- test(prefix, x, (double)result, exceptmask, excepts); \
- test(prefix##f, x, (float)result, exceptmask, excepts); \
- test(prefix##l, x, result, exceptmask, excepts); \
-} while (0)
-
-#define testdf(prefix, x, result, exceptmask, excepts) do { \
- test(prefix, x, (double)result, exceptmask, excepts); \
- test(prefix##f, x, (float)result, exceptmask, excepts); \
-} while (0)
-
-/*
- * Test special cases in sin(), cos(), and tan().
- */
-static void
-run_special_tests(void)
-{
-
- /* Values at 0 should be exact. */
- testall(tan, 0.0, 0.0, ALL_STD_EXCEPT, 0);
- testall(tan, -0.0, -0.0, ALL_STD_EXCEPT, 0);
- testall(cos, 0.0, 1.0, ALL_STD_EXCEPT, 0);
- testall(cos, -0.0, 1.0, ALL_STD_EXCEPT, 0);
- testall(sin, 0.0, 0.0, ALL_STD_EXCEPT, 0);
- testall(sin, -0.0, -0.0, ALL_STD_EXCEPT, 0);
-
- /* func(+-Inf) == NaN */
- testall(tan, INFINITY, NAN, ALL_STD_EXCEPT, FE_INVALID);
- testall(sin, INFINITY, NAN, ALL_STD_EXCEPT, FE_INVALID);
- testall(cos, INFINITY, NAN, ALL_STD_EXCEPT, FE_INVALID);
- testall(tan, -INFINITY, NAN, ALL_STD_EXCEPT, FE_INVALID);
- testall(sin, -INFINITY, NAN, ALL_STD_EXCEPT, FE_INVALID);
- testall(cos, -INFINITY, NAN, ALL_STD_EXCEPT, FE_INVALID);
-
- /* func(NaN) == NaN */
- testall(tan, NAN, NAN, ALL_STD_EXCEPT, 0);
- testall(sin, NAN, NAN, ALL_STD_EXCEPT, 0);
- testall(cos, NAN, NAN, ALL_STD_EXCEPT, 0);
-}
-
-/*
- * Tests to ensure argument reduction for large arguments is accurate.
- */
-static void
-run_reduction_tests(void)
-{
- /* floats very close to odd multiples of pi */
- static const float f_pi_odd[] = {
- 85563208.0f,
- 43998769152.0f,
- 9.2763667655669323e+25f,
- 1.5458357838905804e+29f,
- };
- /* doubles very close to odd multiples of pi */
- static const double d_pi_odd[] = {
- 3.1415926535897931,
- 91.106186954104004,
- 642615.9188844458,
- 3397346.5699258847,
- 6134899525417045.0,
- 3.0213551960457761e+43,
- 1.2646209897993783e+295,
- 6.2083625380677099e+307,
- };
- /* long doubles very close to odd multiples of pi */
-#if LDBL_MANT_DIG == 64
- static const long double ld_pi_odd[] = {
- 1.1891886960373841596e+101L,
- 1.07999475322710967206e+2087L,
- 6.522151627890431836e+2147L,
- 8.9368974898260328229e+2484L,
- 9.2961044110572205863e+2555L,
- 4.90208421886578286e+3189L,
- 1.5275546401232615884e+3317L,
- 1.7227465626338900093e+3565L,
- 2.4160090594000745334e+3808L,
- 9.8477555741888350649e+4314L,
- 1.6061597222105160737e+4326L,
- };
-#elif LDBL_MANT_DIG == 113
- static const long double ld_pi_odd[] = {
- /* XXX */
- };
-#endif
-
- int i;
-
- for (i = 0; i < LEN(f_pi_odd); i++) {
- assert(fabs(sinf(f_pi_odd[i])) < FLT_EPSILON);
- assert(cosf(f_pi_odd[i]) == -1.0);
- assert(fabs(tan(f_pi_odd[i])) < FLT_EPSILON);
-
- assert(fabs(sinf(-f_pi_odd[i])) < FLT_EPSILON);
- assert(cosf(-f_pi_odd[i]) == -1.0);
- assert(fabs(tanf(-f_pi_odd[i])) < FLT_EPSILON);
-
- assert(fabs(sinf(f_pi_odd[i] * 2)) < FLT_EPSILON);
- assert(cosf(f_pi_odd[i] * 2) == 1.0);
- assert(fabs(tanf(f_pi_odd[i] * 2)) < FLT_EPSILON);
-
- assert(fabs(sinf(-f_pi_odd[i] * 2)) < FLT_EPSILON);
- assert(cosf(-f_pi_odd[i] * 2) == 1.0);
- assert(fabs(tanf(-f_pi_odd[i] * 2)) < FLT_EPSILON);
- }
-
- for (i = 0; i < LEN(d_pi_odd); i++) {
- assert(fabs(sin(d_pi_odd[i])) < 2 * DBL_EPSILON);
- assert(cos(d_pi_odd[i]) == -1.0);
- assert(fabs(tan(d_pi_odd[i])) < 2 * DBL_EPSILON);
-
- assert(fabs(sin(-d_pi_odd[i])) < 2 * DBL_EPSILON);
- assert(cos(-d_pi_odd[i]) == -1.0);
- assert(fabs(tan(-d_pi_odd[i])) < 2 * DBL_EPSILON);
-
- assert(fabs(sin(d_pi_odd[i] * 2)) < 2 * DBL_EPSILON);
- assert(cos(d_pi_odd[i] * 2) == 1.0);
- assert(fabs(tan(d_pi_odd[i] * 2)) < 2 * DBL_EPSILON);
-
- assert(fabs(sin(-d_pi_odd[i] * 2)) < 2 * DBL_EPSILON);
- assert(cos(-d_pi_odd[i] * 2) == 1.0);
- assert(fabs(tan(-d_pi_odd[i] * 2)) < 2 * DBL_EPSILON);
- }
-
-#if LDBL_MANT_DIG > 53
- for (i = 0; i < LEN(ld_pi_odd); i++) {
- assert(fabsl(sinl(ld_pi_odd[i])) < LDBL_EPSILON);
- assert(cosl(ld_pi_odd[i]) == -1.0);
- assert(fabsl(tanl(ld_pi_odd[i])) < LDBL_EPSILON);
-
- assert(fabsl(sinl(-ld_pi_odd[i])) < LDBL_EPSILON);
- assert(cosl(-ld_pi_odd[i]) == -1.0);
- assert(fabsl(tanl(-ld_pi_odd[i])) < LDBL_EPSILON);
-
- assert(fabsl(sinl(ld_pi_odd[i] * 2)) < LDBL_EPSILON);
- assert(cosl(ld_pi_odd[i] * 2) == 1.0);
- assert(fabsl(tanl(ld_pi_odd[i] * 2)) < LDBL_EPSILON);
-
- assert(fabsl(sinl(-ld_pi_odd[i] * 2)) < LDBL_EPSILON);
- assert(cosl(-ld_pi_odd[i] * 2) == 1.0);
- assert(fabsl(tanl(-ld_pi_odd[i] * 2)) < LDBL_EPSILON);
- }
-#endif
-}
-
-/*
- * Tests the accuracy of these functions over the primary range.
- */
-static void
-run_accuracy_tests(void)
-{
-
- /* For small args, sin(x) = tan(x) = x, and cos(x) = 1. */
- testall(sin, 0xd.50ee515fe4aea16p-114L, 0xd.50ee515fe4aea16p-114L,
- ALL_STD_EXCEPT, FE_INEXACT);
- testall(tan, 0xd.50ee515fe4aea16p-114L, 0xd.50ee515fe4aea16p-114L,
- ALL_STD_EXCEPT, FE_INEXACT);
- testall(cos, 0xd.50ee515fe4aea16p-114L, 1.0,
- ALL_STD_EXCEPT, FE_INEXACT);
-
- /*
- * These tests should pass for f32, d64, and ld80 as long as
- * the error is <= 0.75 ulp (round to nearest)
- */
-#if LDBL_MANT_DIG <= 64
-#define testacc testall
-#else
-#define testacc testdf
-#endif
- testacc(sin, 0.17255452780841205174L, 0.17169949801444412683L,
- ALL_STD_EXCEPT, FE_INEXACT);
- testacc(sin, -0.75431944555904520893L, -0.68479288156557286353L,
- ALL_STD_EXCEPT, FE_INEXACT);
- testacc(cos, 0.70556358769838947292L, 0.76124620693117771850L,
- ALL_STD_EXCEPT, FE_INEXACT);
- testacc(cos, -0.34061437849088045332L, 0.94254960031831729956L,
- ALL_STD_EXCEPT, FE_INEXACT);
- testacc(tan, -0.15862817413325692897L, -0.15997221861309522115L,
- ALL_STD_EXCEPT, FE_INEXACT);
- testacc(tan, 0.38374784931303813530L, 0.40376500259976759951L,
- ALL_STD_EXCEPT, FE_INEXACT);
-
- /*
- * XXX missing:
- * - tests for ld128
- * - tests for other rounding modes (probably won't pass for now)
- * - tests for large numbers that get reduced to hi+lo with lo!=0
- */
-}
-
-int
-main(int argc, char *argv[])
-{
-
- printf("1..3\n");
-
- run_special_tests();
- printf("ok 1 - trig\n");
-
-#ifndef __i386__
- run_reduction_tests();
-#endif
- printf("ok 2 - trig\n");
-
-#ifndef __i386__
- run_accuracy_tests();
-#endif
- printf("ok 3 - trig\n");
-
- return (0);
-}
diff --git a/tools/regression/sockets/accf_data_attach/accf_data_attach.c b/tools/regression/sockets/accf_data_attach/accf_data_attach.c
index 59ea68c..bfcda1a 100644
--- a/tools/regression/sockets/accf_data_attach/accf_data_attach.c
+++ b/tools/regression/sockets/accf_data_attach/accf_data_attach.c
@@ -27,6 +27,7 @@
*/
#include <sys/types.h>
+#include <sys/module.h>
#include <sys/socket.h>
#include <netinet/in.h>
@@ -65,6 +66,16 @@ main(void)
socklen_t len;
int lso, ret;
+ /* XXX: PLAIN_TEST_REQUIRE_MODULE "backport" for stable/9 */
+ const char *_mod_name = "accf_data";
+
+ if (modfind(_mod_name) == -1) {
+ printf("1..0 # SKIP - module %s could not be resolved: %s\n",
+ _mod_name, strerror(errno));
+ _exit(0);
+ }
+ /* XXX: PLAIN_TEST_REQUIRE_MODULE for stable/9 */
+
printf("1..11\n");
/*
@@ -119,7 +130,7 @@ main(void)
* yet a listen() socket.
*/
bzero(&afa, sizeof(afa));
- strcpy(afa.af_name, ACCF_NAME);
+ strncpy(afa.af_name, ACCF_NAME, sizeof(afa.af_name));
ret = setsockopt(lso, SOL_SOCKET, SO_ACCEPTFILTER, &afa, sizeof(afa));
if (ret == 0)
errx(-1, "not ok 5 - setsockopt() before listen() succeeded");
@@ -164,7 +175,7 @@ main(void)
* Step 8: After listen(). This call to setsockopt() should succeed.
*/
bzero(&afa, sizeof(afa));
- strcpy(afa.af_name, ACCF_NAME);
+ strncpy(afa.af_name, ACCF_NAME, sizeof(afa.af_name));
ret = setsockopt(lso, SOL_SOCKET, SO_ACCEPTFILTER, &afa, sizeof(afa));
if (ret != 0)
errx(-1, "not ok 9 - setsockopt() after listen() failed with %d "
diff --git a/tools/regression/sockets/reconnect/reconnect.c b/tools/regression/sockets/reconnect/reconnect.c
index 27f32cc..985d6d7 100644
--- a/tools/regression/sockets/reconnect/reconnect.c
+++ b/tools/regression/sockets/reconnect/reconnect.c
@@ -104,7 +104,7 @@ cleanup(void)
}
int
-main()
+main(void)
{
int s_sock1, s_sock2, c_sock;
@@ -127,6 +127,7 @@ main()
connect_uds_server(c_sock, uds_name1);
close(s_sock1);
connect_uds_server(c_sock, uds_name2);
+ close(s_sock2);
exit (0);
}
diff --git a/tools/regression/sockets/rtsocket/rtsocket.c b/tools/regression/sockets/rtsocket/rtsocket.c
index b5824b3..f189cdc 100644
--- a/tools/regression/sockets/rtsocket/rtsocket.c
+++ b/tools/regression/sockets/rtsocket/rtsocket.c
@@ -52,7 +52,7 @@ main(void)
sock);
}
- if (errno != EPROTONOSUPPORT)
+ if (errno != EPROTOTYPE)
err(-1, "socket(PF_ROUTE, SOCK_STREAM, 0)");
sock = socket(PF_ROUTE, SOCK_DGRAM, 0);
@@ -62,7 +62,7 @@ main(void)
sock);
}
- if (errno != EPROTONOSUPPORT)
+ if (errno != EPROTOTYPE)
err(-1, "socket(PF_ROUTE, SOCK_DGRAM, 0)");
sock = socket(PF_ROUTE, SOCK_RAW, 0);
@@ -77,7 +77,7 @@ main(void)
"socketpair(PF_ROUTE, SOCK_STREAM, 0, socks) success");
}
- if (errno != EPROTONOSUPPORT)
+ if (errno != EPROTOTYPE)
err(-1, "socketpair(PF_ROUTE, SOCK_STREAM, 0, socks)");
if (socketpair(PF_ROUTE, SOCK_DGRAM, 0, socks) == 0) {
@@ -87,7 +87,7 @@ main(void)
"socketpair(PF_ROUTE, SOCK_DGRAM, 0, socks) success");
}
- if (errno != EPROTONOSUPPORT)
+ if (errno != EPROTOTYPE)
err(-1, "socketpair(PF_ROUTE, SOCK_DGRAM, 0, socks)");
if (socketpair(PF_ROUTE, SOCK_RAW, 0, socks) == 0) {
diff --git a/tools/regression/sockets/sendfile/sendfile.c b/tools/regression/sockets/sendfile/sendfile.c
index 18ae9ad..3a59234 100644
--- a/tools/regression/sockets/sendfile/sendfile.c
+++ b/tools/regression/sockets/sendfile/sendfile.c
@@ -459,12 +459,9 @@ cleanup(void)
int
main(int argc, char *argv[])
{
- int pagesize;
path[0] = '\0';
- pagesize = getpagesize();
-
if (argc == 1) {
snprintf(path, sizeof(path), "sendfile.XXXXXXXXXXXX");
file_fd = mkstemp(path);
diff --git a/tools/regression/sockets/so_setfib/so_setfib.c b/tools/regression/sockets/so_setfib/so_setfib.c
index 50cb020..c56cf5b 100644
--- a/tools/regression/sockets/so_setfib/so_setfib.c
+++ b/tools/regression/sockets/so_setfib/so_setfib.c
@@ -171,7 +171,7 @@ main(int argc __unused, char *argv[] __unused)
size_t s;
if (geteuid() != 0) {
- printf("1..0 # SKIP: must be root");
+ printf("1..0 # SKIP: must be root\n");
return (0);
}
diff --git a/tools/regression/sockets/unix_gc/Makefile b/tools/regression/sockets/unix_gc/Makefile
index 0c66493..1846609 100644
--- a/tools/regression/sockets/unix_gc/Makefile
+++ b/tools/regression/sockets/unix_gc/Makefile
@@ -2,6 +2,6 @@
PROG= unix_gc
MAN=
-WARNS?= 3
+WARNS?= 6
.include <bsd.prog.mk>
diff --git a/tools/regression/sockets/unix_gc/unix_gc.c b/tools/regression/sockets/unix_gc/unix_gc.c
index 8cae2d9..e378f3a 100644
--- a/tools/regression/sockets/unix_gc/unix_gc.c
+++ b/tools/regression/sockets/unix_gc/unix_gc.c
@@ -752,7 +752,7 @@ recursion(void)
#define RMDIR "rm -Rf "
int
-main(int argc, char *argv[])
+main(void)
{
char cmd[sizeof(RMDIR) + PATH_MAX];
int serrno;
diff --git a/tools/regression/sockets/unix_socket/unix_socket.c b/tools/regression/sockets/unix_socket/unix_socket.c
index 085366f..ca7225b 100644
--- a/tools/regression/sockets/unix_socket/unix_socket.c
+++ b/tools/regression/sockets/unix_socket/unix_socket.c
@@ -59,7 +59,7 @@ main(void)
close(sock);
errx(-1, "socket(PF_LOCAL, SOCK_RAW, 0) returned %d", sock);
}
- if (errno != EPROTONOSUPPORT)
+ if (errno != EPROTOTYPE)
err(-1, "socket(PF_LOCAL, SOCK_RAW, 0)");
if (socketpair(PF_LOCAL, SOCK_STREAM, 0, socks) < 0)
diff --git a/tools/regression/sockets/zerosend/Makefile b/tools/regression/sockets/zerosend/Makefile
index 1562acc..18f7dd3 100644
--- a/tools/regression/sockets/zerosend/Makefile
+++ b/tools/regression/sockets/zerosend/Makefile
@@ -2,6 +2,6 @@
PROG= zerosend
MAN=
-WARNS?= 2
+WARNS?= 6
.include <bsd.prog.mk>
diff --git a/tools/regression/sockets/zerosend/zerosend.c b/tools/regression/sockets/zerosend/zerosend.c
index 1f3217a..5d29c0c 100644
--- a/tools/regression/sockets/zerosend/zerosend.c
+++ b/tools/regression/sockets/zerosend/zerosend.c
@@ -54,9 +54,9 @@ try_0send(const char *test, int fd)
ch = 0;
len = send(fd, &ch, 0, 0);
if (len < 0)
- err(-1, "%s: try_0send", test);
+ err(1, "%s: try_0send", test);
if (len != 0)
- errx(-1, "%s: try_0send: returned %zd", test, len);
+ errx(1, "%s: try_0send: returned %zd", test, len);
}
static void
@@ -68,9 +68,9 @@ try_0write(const char *test, int fd)
ch = 0;
len = write(fd, &ch, 0);
if (len < 0)
- err(-1, "%s: try_0write", test);
+ err(1, "%s: try_0write", test);
if (len != 0)
- errx(-1, "%s: try_0write: returned %zd", test, len);
+ errx(1, "%s: try_0write: returned %zd", test, len);
}
static void
@@ -87,24 +87,24 @@ setup_udp(const char *test, int *fdp)
sin.sin_port = htons(PORT1);
sock1 = socket(PF_INET, SOCK_DGRAM, 0);
if (sock1 < 0)
- err(-1, "%s: setup_udp: socket", test);
+ err(1, "%s: setup_udp: socket", test);
if (bind(sock1, (struct sockaddr *)&sin, sizeof(sin)) < 0)
- err(-1, "%s: setup_udp: bind(%s, %d)", test,
+ err(1, "%s: setup_udp: bind(%s, %d)", test,
inet_ntoa(sin.sin_addr), PORT1);
sin.sin_port = htons(PORT2);
if (connect(sock1, (struct sockaddr *)&sin, sizeof(sin)) < 0)
- err(-1, "%s: setup_udp: connect(%s, %d)", test,
+ err(1, "%s: setup_udp: connect(%s, %d)", test,
inet_ntoa(sin.sin_addr), PORT2);
sock2 = socket(PF_INET, SOCK_DGRAM, 0);
if (sock2 < 0)
- err(-1, "%s: setup_udp: socket", test);
+ err(1, "%s: setup_udp: socket", test);
if (bind(sock2, (struct sockaddr *)&sin, sizeof(sin)) < 0)
- err(-1, "%s: setup_udp: bind(%s, %d)", test,
+ err(1, "%s: setup_udp: bind(%s, %d)", test,
inet_ntoa(sin.sin_addr), PORT2);
sin.sin_port = htons(PORT1);
if (connect(sock2, (struct sockaddr *)&sin, sizeof(sin)) < 0)
- err(-1, "%s: setup_udp: connect(%s, %d)", test,
+ err(1, "%s: setup_udp: connect(%s, %d)", test,
inet_ntoa(sin.sin_addr), PORT1);
fdp[0] = sock1;
@@ -130,12 +130,12 @@ setup_tcp(const char *test, int *fdp)
sin.sin_port = htons(PORT1);
sock1 = socket(PF_INET, SOCK_STREAM, 0);
if (sock1 < 0)
- err(-1, "%s: setup_tcp: socket", test);
+ err(1, "%s: setup_tcp: socket", test);
if (bind(sock1, (struct sockaddr *)&sin, sizeof(sin)) < 0)
- err(-1, "%s: bind(%s, %d)", test, inet_ntoa(sin.sin_addr),
+ err(1, "%s: bind(%s, %d)", test, inet_ntoa(sin.sin_addr),
PORT1);
if (listen(sock1, -1) < 0)
- err(-1, "%s: listen", test);
+ err(1, "%s: listen", test);
/*
* Now connect to it, non-blocking so that we don't deadlock against
@@ -143,25 +143,25 @@ setup_tcp(const char *test, int *fdp)
*/
sock2 = socket(PF_INET, SOCK_STREAM, 0);
if (sock2 < 0)
- err(-1, "%s: setup_tcp: socket", test);
+ err(1, "%s: setup_tcp: socket", test);
if (fcntl(sock2, F_SETFL, O_NONBLOCK) < 0)
- err(-1, "%s: setup_tcp: fcntl(O_NONBLOCK)", test);
+ err(1, "%s: setup_tcp: fcntl(O_NONBLOCK)", test);
if (connect(sock2, (struct sockaddr *)&sin, sizeof(sin)) < 0 &&
errno != EINPROGRESS)
- err(-1, "%s: setup_tcp: connect(%s, %d)", test,
+ err(1, "%s: setup_tcp: connect(%s, %d)", test,
inet_ntoa(sin.sin_addr), PORT1);
/*
* Now pick up the connection after sleeping a moment to make sure
* there's been time for some packets to go back and forth.
*/
- if (sleep(1) < 0)
- err(-1, "%s: sleep(1)", test);
+ if (sleep(1) != 0)
+ err(1, "%s: sleep(1)", test);
sock3 = accept(sock1, NULL, NULL);
if (sock3 < 0)
- err(-1, "%s: accept", test);
- if (sleep(1) < 0)
- err(-1, "%s: sleep(1)", test);
+ err(1, "%s: accept", test);
+ if (sleep(1) != 0)
+ err(1, "%s: sleep(1)", test);
FD_ZERO(&writefds);
FD_SET(sock2, &writefds);
@@ -171,11 +171,11 @@ setup_tcp(const char *test, int *fdp)
tv.tv_usec = 0;
ret = select(sock2 + 1, NULL, &writefds, &exceptfds, &tv);
if (ret < 0)
- err(-1, "%s: setup_tcp: select", test);
+ err(1, "%s: setup_tcp: select", test);
if (FD_ISSET(sock2, &exceptfds))
- errx(-1, "%s: setup_tcp: select: exception", test);
+ errx(1, "%s: setup_tcp: select: exception", test);
if (!FD_ISSET(sock2, &writefds))
- errx(-1, "%s: setup_tcp: select: not writable", test);
+ errx(1, "%s: setup_tcp: select: not writable", test);
close(sock1);
fdp[0] = sock2;
@@ -187,7 +187,7 @@ setup_udsstream(const char *test, int *fdp)
{
if (socketpair(PF_LOCAL, SOCK_STREAM, 0, fdp) < 0)
- err(-1, "%s: setup_udsstream: socketpair", test);
+ err(1, "%s: setup_udsstream: socketpair", test);
}
static void
@@ -195,7 +195,7 @@ setup_udsdgram(const char *test, int *fdp)
{
if (socketpair(PF_LOCAL, SOCK_DGRAM, 0, fdp) < 0)
- err(-1, "%s: setup_udsdgram: socketpair", test);
+ err(1, "%s: setup_udsdgram: socketpair", test);
}
static void
@@ -203,7 +203,7 @@ setup_pipe(const char *test, int *fdp)
{
if (pipe(fdp) < 0)
- err(-1, "%s: setup_pipe: pipe", test);
+ err(1, "%s: setup_pipe: pipe", test);
}
static void
@@ -213,19 +213,19 @@ setup_fifo(const char *test, int *fdp)
int fd1, fd2;
if (mkstemp(path) == -1)
- err(-1, "%s: setup_fifo: mktemp", test);
+ err(1, "%s: setup_fifo: mktemp", test);
unlink(path);
if (mkfifo(path, 0600) < 0)
- err(-1, "%s: setup_fifo: mkfifo(%s)", test, path);
+ err(1, "%s: setup_fifo: mkfifo(%s)", test, path);
fd1 = open(path, O_RDONLY | O_NONBLOCK);
if (fd1 < 0)
- err(-1, "%s: setup_fifo: open(%s, O_RDONLY)", test, path);
+ err(1, "%s: setup_fifo: open(%s, O_RDONLY)", test, path);
fd2 = open(path, O_WRONLY | O_NONBLOCK);
if (fd2 < 0)
- err(-1, "%s: setup_fifo: open(%s, O_WRONLY)", test, path);
+ err(1, "%s: setup_fifo: open(%s, O_WRONLY)", test, path);
fdp[0] = fd2;
fdp[1] = fd1;
@@ -242,7 +242,7 @@ close_both(int *fdp)
}
int
-main(int argc, char *argv[])
+main(void)
{
int fd[2];
diff --git a/usr.bin/elfdump/elfdump.c b/usr.bin/elfdump/elfdump.c
index fe330f8..929125b 100644
--- a/usr.bin/elfdump/elfdump.c
+++ b/usr.bin/elfdump/elfdump.c
@@ -379,7 +379,9 @@ sh_types(uint64_t machine, uint64_t sht) {
break;
case EM_MIPS:
switch (sht) {
+ case SHT_MIPS_REGINFO: return "SHT_MIPS_REGINFO";
case SHT_MIPS_OPTIONS: return "SHT_MIPS_OPTIONS";
+ case SHT_MIPS_ABIFLAGS: return "SHT_MIPS_ABIFLAGS";
}
break;
}
diff --git a/usr.bin/fetch/fetch.1 b/usr.bin/fetch/fetch.1
index b9d4785..615a1ad 100644
--- a/usr.bin/fetch/fetch.1
+++ b/usr.bin/fetch/fetch.1
@@ -30,7 +30,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd January 28, 2014
+.Dd March 25, 2015
.Dt FETCH 1
.Os
.Sh NAME
@@ -39,7 +39,6 @@
.Sh SYNOPSIS
.Nm
.Op Fl 146AadFlMmnPpqRrsUv
-.Op Fl -allow-sslv2
.Op Fl B Ar bytes
.Op Fl -bind-address= Ns Ar host
.Op Fl -ca-cert= Ns Ar file
@@ -113,9 +112,6 @@ Some broken Web sites will return a redirect instead of a not-found
error when the requested object does not exist.
.It Fl a , -retry
Automatically retry the transfer upon soft failures.
-.It Fl -allow-sslv2
-[SSL]
-Allow SSL version 2 when negotiating the connection.
.It Fl B Ar bytes , Fl -buffer-size= Ns Ar bytes
Specify the read buffer size in bytes.
The default is 16,384 bytes.
@@ -350,7 +346,6 @@ for a description of additional environment variables, including
.Ev NETRC ,
.Ev NO_PROXY ,
.Ev no_proxy ,
-.Ev SSL_ALLOW_SSL2 ,
.Ev SSL_CA_CERT_FILE ,
.Ev SSL_CA_CERT_PATH ,
.Ev SSL_CLIENT_CERT_FILE ,
diff --git a/usr.bin/fetch/fetch.c b/usr.bin/fetch/fetch.c
index 3f64151..3fbf343 100644
--- a/usr.bin/fetch/fetch.c
+++ b/usr.bin/fetch/fetch.c
@@ -102,7 +102,6 @@ enum options
OPTION_HTTP_REFERER,
OPTION_HTTP_USER_AGENT,
OPTION_NO_PROXY,
- OPTION_SSL_ALLOW_SSL2,
OPTION_SSL_CA_CERT_FILE,
OPTION_SSL_CA_CERT_PATH,
OPTION_SSL_CLIENT_CERT_FILE,
@@ -154,7 +153,6 @@ static struct option longopts[] =
{ "referer", required_argument, NULL, OPTION_HTTP_REFERER },
{ "user-agent", required_argument, NULL, OPTION_HTTP_USER_AGENT },
{ "no-proxy", required_argument, NULL, OPTION_NO_PROXY },
- { "allow-sslv2", no_argument, NULL, OPTION_SSL_ALLOW_SSL2 },
{ "ca-cert", required_argument, NULL, OPTION_SSL_CA_CERT_FILE },
{ "ca-path", required_argument, NULL, OPTION_SSL_CA_CERT_PATH },
{ "cert", required_argument, NULL, OPTION_SSL_CLIENT_CERT_FILE },
@@ -845,17 +843,17 @@ static void
usage(void)
{
fprintf(stderr, "%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n",
-"usage: fetch [-146AadFlMmnPpqRrsUv] [--allow-sslv2] [-B bytes]",
-" [--bind-address=host] [--ca-cert=file] [--ca-path=dir] [--cert=file]",
-" [--crl=file] [-i file] [--key=file] [-N file] [--no-passive]",
-" [--no-proxy=list] [--no-sslv3] [--no-tlsv1] [--no-verify-hostname]",
-" [--no-verify-peer] [-o file] [--referer=URL] [-S bytes] [-T seconds]",
+"usage: fetch [-146AadFlMmnPpqRrsUv] [-B bytes] [--bind-address=host]",
+" [--ca-cert=file] [--ca-path=dir] [--cert=file] [--crl=file]",
+" [-i file] [--key=file] [-N file] [--no-passive] [--no-proxy=list]",
+" [--no-sslv3] [--no-tlsv1] [--no-verify-hostname] [--no-verify-peer]",
+" [-o file] [--referer=URL] [-S bytes] [-T seconds]",
" [--user-agent=agent-string] [-w seconds] URL ...",
-" fetch [-146AadFlMmnPpqRrsUv] [--allow-sslv2] [-B bytes]",
-" [--bind-address=host] [--ca-cert=file] [--ca-path=dir] [--cert=file]",
-" [--crl=file] [-i file] [--key=file] [-N file] [--no-passive]",
-" [--no-proxy=list] [--no-sslv3] [--no-tlsv1] [--no-verify-hostname]",
-" [--no-verify-peer] [-o file] [--referer=URL] [-S bytes] [-T seconds]",
+" fetch [-146AadFlMmnPpqRrsUv] [-B bytes] [--bind-address=host]",
+" [--ca-cert=file] [--ca-path=dir] [--cert=file] [--crl=file]",
+" [-i file] [--key=file] [-N file] [--no-passive] [--no-proxy=list]",
+" [--no-sslv3] [--no-tlsv1] [--no-verify-hostname] [--no-verify-peer]",
+" [-o file] [--referer=URL] [-S bytes] [-T seconds]",
" [--user-agent=agent-string] [-w seconds] -h host -f file [-c dir]");
}
@@ -1004,9 +1002,6 @@ main(int argc, char *argv[])
case OPTION_NO_PROXY:
setenv("NO_PROXY", optarg, 1);
break;
- case OPTION_SSL_ALLOW_SSL2:
- setenv("SSL_ALLOW_SSL2", "", 1);
- break;
case OPTION_SSL_CA_CERT_FILE:
setenv("SSL_CA_CERT_FILE", optarg, 1);
break;
diff --git a/usr.bin/iscsictl/iscsictl.8 b/usr.bin/iscsictl/iscsictl.8
index b9231ac..811f808 100644
--- a/usr.bin/iscsictl/iscsictl.8
+++ b/usr.bin/iscsictl/iscsictl.8
@@ -27,7 +27,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd September 12, 2014
+.Dd October 17, 2015
.Dt ISCSICTL 8
.Os
.Sh NAME
@@ -36,7 +36,9 @@
.Sh SYNOPSIS
.Nm
.Fl A
-.Fl p Ar portal Fl t Ar target Op Fl u Ar user Fl s Ar secret
+.Fl p Ar portal Fl t Ar target
+.Op Fl u Ar user Fl s Ar secret
+.Op Fl w Ar timeout
.Nm
.Fl A
.Fl d Ar discovery-host Op Fl u Ar user Fl s Ar secret
@@ -70,6 +72,7 @@
.Nm
.Fl L
.Op Fl v
+.Op Fl w Ar timeout
.Sh DESCRIPTION
The
.Nm
@@ -113,6 +116,10 @@ Target name.
CHAP login.
.It Fl v
Verbose mode.
+.It Fl w
+Instead of returning immediately, wait up to
+.Ar timeout
+seconds until all configured sessions are successfully established.
.El
.Pp
Certain parameters are necessary when adding a session.
@@ -132,9 +139,11 @@ via configuration file.
.Pp
Since connecting to the target is performed in background, non-zero
exit status does not mean that the session was successfully established.
-Use
+Use either
.Nm Fl L
-to check the connection status.
+to check the connection status, or the
+.Fl w
+flag to wait for session establishment.
.Pp
Note that in order for the iSCSI initiator to be able to connect to a target,
the
diff --git a/usr.bin/iscsictl/iscsictl.c b/usr.bin/iscsictl/iscsictl.c
index a27e32b..8e7faac 100644
--- a/usr.bin/iscsictl/iscsictl.c
+++ b/usr.bin/iscsictl/iscsictl.c
@@ -550,12 +550,70 @@ kernel_list(int iscsi_fd, const struct target *targ __unused,
return (0);
}
+static int
+kernel_wait(int iscsi_fd, int timeout)
+{
+ struct iscsi_session_state *states = NULL;
+ const struct iscsi_session_state *state;
+ const struct iscsi_session_conf *conf;
+ struct iscsi_session_list isl;
+ unsigned int i, nentries = 1;
+ bool all_connected;
+ int error;
+
+ for (;;) {
+ for (;;) {
+ states = realloc(states,
+ nentries * sizeof(struct iscsi_session_state));
+ if (states == NULL)
+ err(1, "realloc");
+
+ memset(&isl, 0, sizeof(isl));
+ isl.isl_nentries = nentries;
+ isl.isl_pstates = states;
+
+ error = ioctl(iscsi_fd, ISCSISLIST, &isl);
+ if (error != 0 && errno == EMSGSIZE) {
+ nentries *= 4;
+ continue;
+ }
+ break;
+ }
+ if (error != 0) {
+ warn("ISCSISLIST");
+ return (error);
+ }
+
+ all_connected = true;
+ for (i = 0; i < isl.isl_nentries; i++) {
+ state = &states[i];
+ conf = &state->iss_conf;
+
+ if (!state->iss_connected) {
+ all_connected = false;
+ break;
+ }
+ }
+
+ if (all_connected)
+ return (0);
+
+ sleep(1);
+
+ if (timeout > 0) {
+ timeout--;
+ if (timeout == 0)
+ return (1);
+ }
+ }
+}
+
static void
usage(void)
{
fprintf(stderr, "usage: iscsictl -A -p portal -t target "
- "[-u user -s secret]\n");
+ "[-u user -s secret] [-w timeout]\n");
fprintf(stderr, " iscsictl -A -d discovery-host "
"[-u user -s secret]\n");
fprintf(stderr, " iscsictl -A -a [-c path]\n");
@@ -567,7 +625,7 @@ usage(void)
fprintf(stderr, " iscsictl -R [-p portal] [-t target]\n");
fprintf(stderr, " iscsictl -R -a\n");
fprintf(stderr, " iscsictl -R -n nickname [-c path]\n");
- fprintf(stderr, " iscsictl -L [-v]\n");
+ fprintf(stderr, " iscsictl -L [-v] [-w timeout]\n");
exit(1);
}
@@ -589,6 +647,7 @@ main(int argc, char **argv)
const char *conf_path = DEFAULT_CONFIG_PATH;
char *nickname = NULL, *discovery_host = NULL, *portal = NULL,
*target = NULL, *user = NULL, *secret = NULL;
+ int timeout = -1;
long long session_id = -1;
char *end;
int ch, error, iscsi_fd, retval, saved_errno;
@@ -596,7 +655,7 @@ main(int argc, char **argv)
struct conf *conf;
struct target *targ;
- while ((ch = getopt(argc, argv, "AMRLac:d:i:n:p:t:u:s:v")) != -1) {
+ while ((ch = getopt(argc, argv, "AMRLac:d:i:n:p:t:u:s:vw:")) != -1) {
switch (ch) {
case 'A':
Aflag = 1;
@@ -647,6 +706,13 @@ main(int argc, char **argv)
case 'v':
vflag = 1;
break;
+ case 'w':
+ timeout = strtol(optarg, &end, 10);
+ if ((size_t)(end - optarg) != strlen(optarg))
+ errx(1, "trailing characters after timeout");
+ if (timeout < 0)
+ errx(1, "timeout cannot be negative");
+ break;
case '?':
default:
usage();
@@ -737,6 +803,8 @@ main(int argc, char **argv)
if (vflag != 0)
errx(1, "-v cannot be used with -M");
+ if (timeout != -1)
+ errx(1, "-w cannot be used with -M");
} else if (Rflag != 0) {
if (user != NULL)
@@ -766,6 +834,8 @@ main(int argc, char **argv)
errx(1, "-i cannot be used with -R");
if (vflag != 0)
errx(1, "-v cannot be used with -R");
+ if (timeout != -1)
+ errx(1, "-w cannot be used with -R");
} else {
assert(Lflag != 0);
@@ -851,6 +921,9 @@ main(int argc, char **argv)
failed += kernel_list(iscsi_fd, targ, vflag);
}
+ if (timeout != -1)
+ failed += kernel_wait(iscsi_fd, timeout);
+
error = close(iscsi_fd);
if (error != 0)
err(1, "close");
diff --git a/usr.bin/kdump/Makefile b/usr.bin/kdump/Makefile
index d450da5..378c416 100644
--- a/usr.bin/kdump/Makefile
+++ b/usr.bin/kdump/Makefile
@@ -3,10 +3,6 @@
.include <bsd.own.mk>
-.if (${MACHINE_ARCH} == "amd64")
-SFX= 32
-.endif
-
.PATH: ${.CURDIR}/../ktrace
PROG= kdump
@@ -24,6 +20,9 @@ CLEANFILES= ioctl.c kdump_subr.c kdump_subr.h
.if (${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386")
CLEANFILES+= linux_syscalls.c
.endif
+.if (${MACHINE_ARCH} == "amd64")
+CLEANFILES+= linux32_syscalls.c
+.endif
ioctl.c: mkioctls
env MACHINE=${MACHINE} CPP="${CPP}" \
@@ -37,7 +36,11 @@ kdump_subr.c: mksubr kdump_subr.h
sh ${.CURDIR}/mksubr ${DESTDIR}/usr/include >${.TARGET}
.if (${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386")
sh ${.CURDIR}/../../sys/kern/makesyscalls.sh \
- ${.CURDIR}/../../sys/${MACHINE_ARCH}/linux${SFX}/syscalls.master ${.CURDIR}/linux_syscalls.conf
+ ${.CURDIR}/../../sys/${MACHINE_ARCH}/linux/syscalls.master ${.CURDIR}/linux_syscalls.conf
+.endif
+.if (${MACHINE_ARCH} == "amd64")
+ sh ${.CURDIR}/../../sys/kern/makesyscalls.sh \
+ ${.CURDIR}/../../sys/${MACHINE_ARCH}/linux32/syscalls.master ${.CURDIR}/linux32_syscalls.conf
.endif
.include <bsd.prog.mk>
diff --git a/usr.bin/kdump/kdump.c b/usr.bin/kdump/kdump.c
index bd0e000..f028e51 100644
--- a/usr.bin/kdump/kdump.c
+++ b/usr.bin/kdump/kdump.c
@@ -139,13 +139,11 @@ static struct ktr_header ktr_header;
#if defined(__amd64__) || defined(__i386__)
-void linux_ktrsyscall(struct ktr_syscall *);
-void linux_ktrsysret(struct ktr_sysret *);
+void linux_ktrsyscall(struct ktr_syscall *, u_int);
+void linux_ktrsysret(struct ktr_sysret *, u_int);
extern const char *linux_syscallnames[];
#include <linux_syscalls.c>
-static int nlinux_syscalls = sizeof(linux_syscallnames) / \
- sizeof(linux_syscallnames[0]);
/*
* from linux.h
@@ -165,6 +163,12 @@ static int bsd_to_linux_errno[ELAST + 1] = {
};
#endif
+#if defined(__amd64__)
+extern const char *linux32_syscallnames[];
+
+#include <linux32_syscalls.c>
+#endif
+
struct proc_info
{
TAILQ_ENTRY(proc_info) info;
@@ -331,7 +335,8 @@ main(int argc, char *argv[])
case KTR_SYSCALL:
#if defined(__amd64__) || defined(__i386__)
if ((sv_flags & SV_ABI_MASK) == SV_ABI_LINUX)
- linux_ktrsyscall((struct ktr_syscall *)m);
+ linux_ktrsyscall((struct ktr_syscall *)m,
+ sv_flags);
else
#endif
ktrsyscall((struct ktr_syscall *)m, sv_flags);
@@ -339,7 +344,8 @@ main(int argc, char *argv[])
case KTR_SYSRET:
#if defined(__amd64__) || defined(__i386__)
if ((sv_flags & SV_ABI_MASK) == SV_ABI_LINUX)
- linux_ktrsysret((struct ktr_sysret *)m);
+ linux_ktrsysret((struct ktr_sysret *)m,
+ sv_flags);
else
#endif
ktrsysret((struct ktr_sysret *)m, sv_flags);
@@ -1891,16 +1897,28 @@ ktrfaultend(struct ktr_faultend *ktr)
}
#if defined(__amd64__) || defined(__i386__)
+
+#if defined(__amd64__)
+#define NLINUX_SYSCALLS(v) ((v) & SV_ILP32 ? \
+ nitems(linux32_syscallnames) : nitems(linux_syscallnames))
+#define LINUX_SYSCALLNAMES(v, i) ((v) & SV_ILP32 ? \
+ linux32_syscallnames[i] : linux_syscallnames[i])
+#else
+#define NLINUX_SYSCALLS(v) (nitems(linux_syscallnames))
+#define LINUX_SYSCALLNAMES(v, i) (linux_syscallnames[i])
+#endif
+
void
-linux_ktrsyscall(struct ktr_syscall *ktr)
+linux_ktrsyscall(struct ktr_syscall *ktr, u_int sv_flags)
{
int narg = ktr->ktr_narg;
+ unsigned code = ktr->ktr_code;
register_t *ip;
- if (ktr->ktr_code >= nlinux_syscalls || ktr->ktr_code < 0)
+ if (ktr->ktr_code < 0 || code >= NLINUX_SYSCALLS(sv_flags))
printf("[%d]", ktr->ktr_code);
else {
- printf("%s", linux_syscallnames[ktr->ktr_code]);
+ printf("%s", LINUX_SYSCALLNAMES(sv_flags, ktr->ktr_code));
if (syscallno)
printf("[%d]", ktr->ktr_code);
}
@@ -1915,16 +1933,16 @@ linux_ktrsyscall(struct ktr_syscall *ktr)
}
void
-linux_ktrsysret(struct ktr_sysret *ktr)
+linux_ktrsysret(struct ktr_sysret *ktr, u_int sv_flags)
{
register_t ret = ktr->ktr_retval;
+ unsigned code = ktr->ktr_code;
int error = ktr->ktr_error;
- int code = ktr->ktr_code;
- if (code >= nlinux_syscalls || code < 0)
- printf("[%d] ", code);
+ if (ktr->ktr_code < 0 || code >= NLINUX_SYSCALLS(sv_flags))
+ printf("[%d] ", ktr->ktr_code);
else {
- printf("%s", linux_syscallnames[code]);
+ printf("%s ", LINUX_SYSCALLNAMES(sv_flags, code));
if (syscallno)
printf("[%d]", code);
printf(" ");
diff --git a/usr.bin/kdump/linux32_syscalls.conf b/usr.bin/kdump/linux32_syscalls.conf
new file mode 100644
index 0000000..66a67fd
--- /dev/null
+++ b/usr.bin/kdump/linux32_syscalls.conf
@@ -0,0 +1,11 @@
+# $FreeBSD$
+sysnames="linux32_syscalls.c"
+sysproto="/dev/null"
+sysproto_h=_LINUX32_SYSPROTO_H_
+syshdr="/dev/null"
+syssw="/dev/null"
+sysmk="/dev/null"
+syscallprefix="LINUX32_SYS_"
+switchname="/dev/null"
+namesname="linux32_syscallnames"
+systrace="/dev/null"
diff --git a/usr.bin/less/defines.h b/usr.bin/less/defines.h
index 27b73ce..9b0f5c9 100644
--- a/usr.bin/less/defines.h
+++ b/usr.bin/less/defines.h
@@ -418,6 +418,11 @@
/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
#define TIME_WITH_SYS_TIME 1
+/* Enable large inode numbers on Mac OS X 10.5. */
+#ifndef _DARWIN_USE_64_BIT_INODE
+# define _DARWIN_USE_64_BIT_INODE 1
+#endif
+
/* Number of bits in a file offset, on hosts where this is settable. */
/* #undef _FILE_OFFSET_BITS */
diff --git a/usr.bin/netstat/sctp.c b/usr.bin/netstat/sctp.c
index 687d039..347aa57 100644
--- a/usr.bin/netstat/sctp.c
+++ b/usr.bin/netstat/sctp.c
@@ -572,25 +572,34 @@ sctp_statesprint(uint32_t state)
int idx;
switch (state) {
- case SCTP_STATE_COOKIE_WAIT:
+ case SCTP_CLOSED:
+ idx = NETSTAT_SCTP_STATES_CLOSED;
+ break;
+ case SCTP_BOUND:
+ idx = NETSTAT_SCTP_STATES_BOUND;
+ break;
+ case SCTP_LISTEN:
+ idx = NETSTAT_SCTP_STATES_LISTEN;
+ break;
+ case SCTP_COOKIE_WAIT:
idx = NETSTAT_SCTP_STATES_COOKIE_WAIT;
break;
- case SCTP_STATE_COOKIE_ECHOED:
+ case SCTP_COOKIE_ECHOED:
idx = NETSTAT_SCTP_STATES_COOKIE_ECHOED;
break;
- case SCTP_STATE_OPEN:
+ case SCTP_ESTABLISHED:
idx = NETSTAT_SCTP_STATES_ESTABLISHED;
break;
- case SCTP_STATE_SHUTDOWN_SENT:
+ case SCTP_SHUTDOWN_SENT:
idx = NETSTAT_SCTP_STATES_SHUTDOWN_SENT;
break;
- case SCTP_STATE_SHUTDOWN_RECEIVED:
+ case SCTP_SHUTDOWN_RECEIVED:
idx = NETSTAT_SCTP_STATES_SHUTDOWN_RECEIVED;
break;
- case SCTP_STATE_SHUTDOWN_ACK_SENT:
+ case SCTP_SHUTDOWN_ACK_SENT:
idx = NETSTAT_SCTP_STATES_SHUTDOWN_ACK_SENT;
break;
- case SCTP_STATE_SHUTDOWN_PENDING:
+ case SCTP_SHUTDOWN_PENDING:
idx = NETSTAT_SCTP_STATES_SHUTDOWN_PENDING;
break;
default:
diff --git a/usr.bin/sockstat/sockstat.1 b/usr.bin/sockstat/sockstat.1
index 040213d..4200594 100644
--- a/usr.bin/sockstat/sockstat.1
+++ b/usr.bin/sockstat/sockstat.1
@@ -27,7 +27,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd June 20, 2015
+.Dd August 27, 2015
.Dt SOCKSTAT 1
.Os
.Sh NAME
@@ -35,7 +35,7 @@
.Nd list open sockets
.Sh SYNOPSIS
.Nm
-.Op Fl 46cLlu
+.Op Fl 46cLlsu
.Op Fl j Ar jid
.Op Fl p Ar ports
.Op Fl P Ar protocols
@@ -83,6 +83,9 @@ The
argument is a comma-separated list of protocol names,
as they are defined in
.Xr protocols 5 .
+.It Fl s
+Display the protocol state, if applicable.
+This is currently only implemented for SCTP and TCP.
.It Fl u
Show
.Dv AF_LOCAL
diff --git a/usr.bin/sockstat/sockstat.c b/usr.bin/sockstat/sockstat.c
index 8a8afc0..98d86b5 100644
--- a/usr.bin/sockstat/sockstat.c
+++ b/usr.bin/sockstat/sockstat.c
@@ -45,6 +45,8 @@ __FBSDID("$FreeBSD$");
#include <netinet/in_pcb.h>
#include <netinet/sctp.h>
#include <netinet/tcp.h>
+#define TCPSTATES /* load state names */
+#include <netinet/tcp_fsm.h>
#include <netinet/tcp_seq.h>
#include <netinet/tcp_var.h>
#include <arpa/inet.h>
@@ -71,6 +73,7 @@ static int opt_c; /* Show connected sockets */
static int opt_j; /* Show specified jail */
static int opt_L; /* Don't show IPv4 or IPv6 loopback sockets */
static int opt_l; /* Show listening sockets */
+static int opt_s; /* Show protocol state if applicable */
static int opt_u; /* Show Unix domain sockets */
static int opt_v; /* Verbose mode */
@@ -101,6 +104,7 @@ struct sock {
int vflag;
int family;
int proto;
+ int state;
const char *protoname;
struct addr *laddr;
struct addr *faddr;
@@ -328,6 +332,10 @@ gather_sctp(void)
sock->socket = xinpcb->socket;
sock->proto = IPPROTO_SCTP;
sock->protoname = "sctp";
+ if (xinpcb->maxqlen == 0)
+ sock->state = SCTP_CLOSED;
+ else
+ sock->state = SCTP_LISTEN;
if (xinpcb->flags & SCTP_PCB_FLAGS_BOUND_V6) {
sock->family = AF_INET6;
sock->vflag = INP_IPV6;
@@ -417,6 +425,7 @@ gather_sctp(void)
sock->socket = xinpcb->socket;
sock->proto = IPPROTO_SCTP;
sock->protoname = "sctp";
+ sock->state = (int)xstcb->state;
if (xinpcb->flags & SCTP_PCB_FLAGS_BOUND_V6) {
sock->family = AF_INET6;
sock->vflag = INP_IPV6;
@@ -594,9 +603,10 @@ gather_inet(int proto)
xig = (struct xinpgen *)(void *)((char *)xig + xig->xig_len);
if (xig >= exig)
break;
+ xip = (struct xinpcb *)xig;
+ xtp = (struct xtcpcb *)xig;
switch (proto) {
case IPPROTO_TCP:
- xtp = (struct xtcpcb *)xig;
if (xtp->xt_len != sizeof(*xtp)) {
warnx("struct xtcpcb size mismatch");
goto out;
@@ -607,7 +617,6 @@ gather_inet(int proto)
break;
case IPPROTO_UDP:
case IPPROTO_DIVERT:
- xip = (struct xinpcb *)xig;
if (xip->xi_len != sizeof(*xip)) {
warnx("struct xinpcb size mismatch");
goto out;
@@ -670,6 +679,8 @@ gather_inet(int proto)
sock->laddr = laddr;
sock->faddr = faddr;
sock->vflag = inp->inp_vflag;
+ if (proto == IPPROTO_TCP)
+ sock->state = xtp->xt_tp.t_state;
sock->protoname = protoname;
hash = (int)((uintptr_t)sock->socket % HASHSIZE);
sock->next = sockhash[hash];
@@ -900,11 +911,51 @@ check_ports(struct sock *s)
return (0);
}
+static const char *
+sctp_state(int state)
+{
+ switch (state) {
+ case SCTP_CLOSED:
+ return "CLOSED";
+ break;
+ case SCTP_BOUND:
+ return "BOUND";
+ break;
+ case SCTP_LISTEN:
+ return "LISTEN";
+ break;
+ case SCTP_COOKIE_WAIT:
+ return "COOKIE_WAIT";
+ break;
+ case SCTP_COOKIE_ECHOED:
+ return "COOKIE_ECHOED";
+ break;
+ case SCTP_ESTABLISHED:
+ return "ESTABLISHED";
+ break;
+ case SCTP_SHUTDOWN_SENT:
+ return "SHUTDOWN_SENT";
+ break;
+ case SCTP_SHUTDOWN_RECEIVED:
+ return "SHUTDOWN_RECEIVED";
+ break;
+ case SCTP_SHUTDOWN_ACK_SENT:
+ return "SHUTDOWN_ACK_SENT";
+ break;
+ case SCTP_SHUTDOWN_PENDING:
+ return "SHUTDOWN_PENDING";
+ break;
+ default:
+ return "UNKNOWN";
+ break;
+ }
+}
+
static void
displaysock(struct sock *s, int pos)
{
void *p;
- int hash;
+ int hash, first;
struct addr *laddr, *faddr;
struct sock *s_tmp;
@@ -917,6 +968,7 @@ displaysock(struct sock *s, int pos)
pos += xprintf("6 ");
laddr = s->laddr;
faddr = s->faddr;
+ first = 1;
while (laddr != NULL || faddr != NULL) {
while (pos < 36)
pos += xprintf(" ");
@@ -968,6 +1020,23 @@ displaysock(struct sock *s, int pos)
default:
abort();
}
+ if (first && opt_s &&
+ (s->proto == IPPROTO_SCTP || s->proto == IPPROTO_TCP)) {
+ while (pos < 80)
+ pos += xprintf(" ");
+ switch (s->proto) {
+ case IPPROTO_SCTP:
+ pos += xprintf("%s", sctp_state(s->state));
+ break;
+ case IPPROTO_TCP:
+ if (s->state >= 0 && s->state < TCP_NSTATES)
+ pos +=
+ xprintf("%s", tcpstates[s->state]);
+ else
+ pos += xprintf("?");
+ break;
+ }
+ }
if (laddr != NULL)
laddr = laddr->next;
if (faddr != NULL)
@@ -976,6 +1045,7 @@ displaysock(struct sock *s, int pos)
xprintf("\n");
pos = 0;
}
+ first = 0;
}
xprintf("\n");
}
@@ -988,9 +1058,12 @@ display(void)
struct sock *s;
int hash, n, pos;
- printf("%-8s %-10s %-5s %-2s %-6s %-21s %-21s\n",
+ printf("%-8s %-10s %-5s %-2s %-6s %-21s %-21s",
"USER", "COMMAND", "PID", "FD", "PROTO",
"LOCAL ADDRESS", "FOREIGN ADDRESS");
+ if (opt_s)
+ printf(" %-12s", "STATE");
+ printf("\n");
setpassent(1);
for (xf = xfiles, n = 0; n < nxfiles; ++n, ++xf) {
if (xf->xf_data == NULL)
@@ -1061,7 +1134,7 @@ static void
usage(void)
{
fprintf(stderr,
- "Usage: sockstat [-46cLlu] [-j jid] [-p ports] [-P protocols]\n");
+ "usage: sockstat [-46cLlsu] [-j jid] [-p ports] [-P protocols]\n");
exit(1);
}
@@ -1072,7 +1145,7 @@ main(int argc, char *argv[])
int o, i;
opt_j = -1;
- while ((o = getopt(argc, argv, "46cj:Llp:P:uv")) != -1)
+ while ((o = getopt(argc, argv, "46cj:Llp:P:suv")) != -1)
switch (o) {
case '4':
opt_4 = 1;
@@ -1098,6 +1171,9 @@ main(int argc, char *argv[])
case 'P':
protos_defined = parse_protos(optarg);
break;
+ case 's':
+ opt_s = 1;
+ break;
case 'u':
opt_u = 1;
break;
diff --git a/usr.bin/systat/Makefile b/usr.bin/systat/Makefile
index 5773c36..817a0bc 100644
--- a/usr.bin/systat/Makefile
+++ b/usr.bin/systat/Makefile
@@ -6,7 +6,7 @@
PROG= systat
SRCS= cmds.c cmdtab.c devs.c fetch.c iostat.c keyboard.c main.c \
netcmds.c netstat.c pigs.c swap.c icmp.c \
- mode.c ip.c tcp.c \
+ mode.c ip.c sctp.c tcp.c \
vmstat.c convtbl.c ifcmds.c ifstat.c
.if ${MK_INET6_SUPPORT} != "no"
diff --git a/usr.bin/systat/cmdtab.c b/usr.bin/systat/cmdtab.c
index c9c9e7d..63a69f6 100644
--- a/usr.bin/systat/cmdtab.c
+++ b/usr.bin/systat/cmdtab.c
@@ -69,6 +69,9 @@ struct cmdtab cmdtab[] = {
initip6, openip6, closeip6, cmdmode,
resetip6, CF_LOADAV },
#endif
+ { "sctp", showsctp, fetchsctp, labelsctp,
+ initsctp, opensctp, closesctp, cmdmode,
+ resetsctp, CF_LOADAV },
{ "tcp", showtcp, fetchtcp, labeltcp,
inittcp, opentcp, closetcp, cmdmode,
resettcp, CF_LOADAV },
diff --git a/usr.bin/systat/extern.h b/usr.bin/systat/extern.h
index 17fffc1..461ef8d 100644
--- a/usr.bin/systat/extern.h
+++ b/usr.bin/systat/extern.h
@@ -163,3 +163,14 @@ void showtcp(void);
void status(void);
void suspend(int);
char *sysctl_dynread(const char *, size_t *);
+
+#define SYSTAT_CMD(name) \
+ void close ## name(WINDOW *); \
+ void fetch ## name(void); \
+ int init ## name(void); \
+ void label ## name(void); \
+ WINDOW *open ## name(void); \
+ void reset ## name(void); \
+ void show ## name(void)
+
+SYSTAT_CMD ( sctp );
diff --git a/usr.bin/systat/sctp.c b/usr.bin/systat/sctp.c
new file mode 100644
index 0000000..ea0edd8
--- /dev/null
+++ b/usr.bin/systat/sctp.c
@@ -0,0 +1,362 @@
+/*-
+ * Copyright (c) 2015
+ * The Regents of the University of California. All rights reserved.
+ * Michael Tuexen. 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.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS 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.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <sys/param.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <sys/sysctl.h>
+
+#include <netinet/sctp.h>
+
+#include <stdlib.h>
+#include <string.h>
+
+#include "systat.h"
+#include "extern.h"
+#include "mode.h"
+
+static struct sctpstat curstat, initstat, oldstat;
+
+/*-
+--0 1 2 3 4 5 6 7
+--0123456789012345678901234567890123456789012345678901234567890123456789012345
+00 SCTP Associations SCTP Packets
+01999999999999 associations initiated 999999999999 packets sent
+02999999999999 associations accepted 999999999999 packets received
+03999999999999 associations established 999999999999 - out of the blue
+04999999999999 associations restarted 999999999999 - bad vtag
+05999999999999 associations terminated 999999999999 - bad crc32c
+06999999999999 associations aborted
+07
+08 SCTP Timers SCTP Chunks
+09999999999999 init timeouts 999999999999 control chunks sent
+10999999999999 cookie timeouts 999999999999 data chunks sent
+11999999999999 data timeouts 999999999999 - ordered
+12999999999999 delayed sack timeouts 999999999999 - unordered
+13999999999999 shutdown timeouts 999999999999 control chunks received
+14999999999999 shutdown-ack timeouts 999999999999 data chunks received
+15999999999999 shutdown guard timeouts 999999999999 - ordered
+16999999999999 heartbeat timeouts 999999999999 - unordered
+17999999999999 path MTU timeouts
+18999999999999 autoclose timeouts SCTP user messages
+19999999999999 asconf timeouts 999999999999 fragmented
+20999999999999 stream reset timeouts 999999999999 reassembled
+--0123456789012345678901234567890123456789012345678901234567890123456789012345
+--0 1 2 3 4 5 6 7
+*/
+
+WINDOW *
+opensctp(void)
+{
+ return (subwin(stdscr, LINES-3-1, 0, MAINWIN_ROW, 0));
+}
+
+void
+closesctp(WINDOW *w)
+{
+ if (w != NULL) {
+ wclear(w);
+ wrefresh(w);
+ delwin(w);
+ }
+}
+
+void
+labelsctp(void)
+{
+ wmove(wnd, 0, 0); wclrtoeol(wnd);
+#define L(row, str) mvwprintw(wnd, row, 13, str)
+#define R(row, str) mvwprintw(wnd, row, 51, str);
+ L(0, "SCTP Associations"); R(0, "SCTP Packets");
+ L(1, "associations initiated"); R(1, "packets sent");
+ L(2, "associations accepted"); R(2, "packets received");
+ L(3, "associations established"); R(3, "- out of the blue");
+ L(4, "associations restarted"); R(4, "- bad vtag");
+ L(5, "associations terminated"); R(5, "- bad crc32c");
+ L(6, "associations aborted");
+
+ L(8, "SCTP Timers"); R(8, "SCTP Chunks");
+ L(9, "init timeouts"); R(9, "control chunks sent");
+ L(10, "cookie timeouts"); R(10, "data chunks sent");
+ L(11, "data timeouts"); R(11, "- ordered");
+ L(12, "delayed sack timeouts"); R(12, "- unordered");
+ L(13, "shutdown timeouts"); R(13, "control chunks received");
+ L(14, "shutdown-ack timeouts"); R(14, "data chunks received");
+ L(15, "shutdown guard timeouts"); R(15, "- ordered");
+ L(16, "heartbeat timeouts"); R(16, "- unordered");
+ L(17, "path MTU timeouts");
+ L(18, "autoclose timeouts"); R(18, "SCTP User Messages");
+ L(19, "asconf timeouts"); R(19, "fragmented");
+ L(20, "stream reset timeouts"); R(20, "reassembled");
+#undef L
+#undef R
+}
+
+static void
+domode(struct sctpstat *ret)
+{
+ const struct sctpstat *sub;
+ int divisor = 1;
+
+ switch(currentmode) {
+ case display_RATE:
+ sub = &oldstat;
+ divisor = (delay > 1000000) ? delay / 1000000 : 1;
+ break;
+ case display_DELTA:
+ sub = &oldstat;
+ break;
+ case display_SINCE:
+ sub = &initstat;
+ break;
+ default:
+ *ret = curstat;
+ return;
+ }
+#define DO(stat) ret->stat = (curstat.stat - sub->stat) / divisor
+ DO(sctps_currestab);
+ DO(sctps_activeestab);
+ DO(sctps_restartestab);
+ DO(sctps_collisionestab);
+ DO(sctps_passiveestab);
+ DO(sctps_aborted);
+ DO(sctps_shutdown);
+ DO(sctps_outoftheblue);
+ DO(sctps_checksumerrors);
+ DO(sctps_outcontrolchunks);
+ DO(sctps_outorderchunks);
+ DO(sctps_outunorderchunks);
+ DO(sctps_incontrolchunks);
+ DO(sctps_inorderchunks);
+ DO(sctps_inunorderchunks);
+ DO(sctps_fragusrmsgs);
+ DO(sctps_reasmusrmsgs);
+ DO(sctps_outpackets);
+ DO(sctps_inpackets);
+
+ DO(sctps_recvpackets);
+ DO(sctps_recvdatagrams);
+ DO(sctps_recvpktwithdata);
+ DO(sctps_recvsacks);
+ DO(sctps_recvdata);
+ DO(sctps_recvdupdata);
+ DO(sctps_recvheartbeat);
+ DO(sctps_recvheartbeatack);
+ DO(sctps_recvecne);
+ DO(sctps_recvauth);
+ DO(sctps_recvauthmissing);
+ DO(sctps_recvivalhmacid);
+ DO(sctps_recvivalkeyid);
+ DO(sctps_recvauthfailed);
+ DO(sctps_recvexpress);
+ DO(sctps_recvexpressm);
+ DO(sctps_recvnocrc);
+ DO(sctps_recvswcrc);
+ DO(sctps_recvhwcrc);
+
+ DO(sctps_sendpackets);
+ DO(sctps_sendsacks);
+ DO(sctps_senddata);
+ DO(sctps_sendretransdata);
+ DO(sctps_sendfastretrans);
+ DO(sctps_sendmultfastretrans);
+ DO(sctps_sendheartbeat);
+ DO(sctps_sendecne);
+ DO(sctps_sendauth);
+ DO(sctps_senderrors);
+ DO(sctps_sendnocrc);
+ DO(sctps_sendswcrc);
+ DO(sctps_sendhwcrc);
+
+ DO(sctps_pdrpfmbox);
+ DO(sctps_pdrpfehos);
+ DO(sctps_pdrpmbda);
+ DO(sctps_pdrpmbct);
+ DO(sctps_pdrpbwrpt);
+ DO(sctps_pdrpcrupt);
+ DO(sctps_pdrpnedat);
+ DO(sctps_pdrppdbrk);
+ DO(sctps_pdrptsnnf);
+ DO(sctps_pdrpdnfnd);
+ DO(sctps_pdrpdiwnp);
+ DO(sctps_pdrpdizrw);
+ DO(sctps_pdrpbadd);
+ DO(sctps_pdrpmark);
+
+ DO(sctps_timoiterator);
+ DO(sctps_timodata);
+ DO(sctps_timowindowprobe);
+ DO(sctps_timoinit);
+ DO(sctps_timosack);
+ DO(sctps_timoshutdown);
+ DO(sctps_timoheartbeat);
+ DO(sctps_timocookie);
+ DO(sctps_timosecret);
+ DO(sctps_timopathmtu);
+ DO(sctps_timoshutdownack);
+ DO(sctps_timoshutdownguard);
+ DO(sctps_timostrmrst);
+ DO(sctps_timoearlyfr);
+ DO(sctps_timoasconf);
+ DO(sctps_timodelprim);
+ DO(sctps_timoautoclose);
+ DO(sctps_timoassockill);
+ DO(sctps_timoinpkill);
+
+ DO(sctps_hdrops);
+ DO(sctps_badsum);
+ DO(sctps_noport);
+ DO(sctps_badvtag);
+ DO(sctps_badsid);
+ DO(sctps_nomem);
+ DO(sctps_fastretransinrtt);
+ DO(sctps_markedretrans);
+ DO(sctps_naglesent);
+ DO(sctps_naglequeued);
+ DO(sctps_maxburstqueued);
+ DO(sctps_ifnomemqueued);
+ DO(sctps_windowprobed);
+ DO(sctps_lowlevelerr);
+ DO(sctps_lowlevelerrusr);
+ DO(sctps_datadropchklmt);
+ DO(sctps_datadroprwnd);
+ DO(sctps_ecnereducedcwnd);
+ DO(sctps_vtagexpress);
+ DO(sctps_vtagbogus);
+ DO(sctps_primary_randry);
+ DO(sctps_cmt_randry);
+ DO(sctps_slowpath_sack);
+ DO(sctps_wu_sacks_sent);
+ DO(sctps_sends_with_flags);
+ DO(sctps_sends_with_unord);
+ DO(sctps_sends_with_eof);
+ DO(sctps_sends_with_abort);
+ DO(sctps_protocol_drain_calls);
+ DO(sctps_protocol_drains_done);
+ DO(sctps_read_peeks);
+ DO(sctps_cached_chk);
+ DO(sctps_cached_strmoq);
+ DO(sctps_left_abandon);
+ DO(sctps_send_burst_avoid);
+ DO(sctps_send_cwnd_avoid);
+ DO(sctps_fwdtsn_map_over);
+ DO(sctps_queue_upd_ecne);
+#undef DO
+}
+
+void
+showsctp(void)
+{
+ struct sctpstat stats;
+
+ memset(&stats, 0, sizeof stats);
+ domode(&stats);
+
+#define DO(stat, row, col) \
+ mvwprintw(wnd, row, col, "%12lu", stats.stat)
+#define L(row, stat) DO(stat, row, 0)
+#define R(row, stat) DO(stat, row, 38)
+ L(1, sctps_activeestab); R(1, sctps_outpackets);
+ L(2, sctps_passiveestab); R(2, sctps_inpackets);
+ L(3, sctps_currestab); R(3, sctps_outoftheblue);
+ L(4, sctps_restartestab); R(4, sctps_badvtag);
+ L(5, sctps_shutdown); R(5, sctps_checksumerrors);
+ L(6, sctps_aborted);
+
+
+ L(9, sctps_timoinit); R(9, sctps_outcontrolchunks);
+ L(10, sctps_timocookie); R(10, sctps_senddata);
+ L(11, sctps_timodata); R(11, sctps_outorderchunks);
+ L(12, sctps_timosack); R(12, sctps_outunorderchunks);
+ L(13, sctps_timoshutdown); R(13, sctps_incontrolchunks);
+ L(14, sctps_timoshutdownack); R(14, sctps_recvdata);
+ L(15, sctps_timoshutdownguard); R(15, sctps_inorderchunks);
+ L(16, sctps_timoheartbeat); R(16, sctps_inunorderchunks);
+ L(17, sctps_timopathmtu);
+ L(18, sctps_timoautoclose);
+ L(19, sctps_timoasconf); R(19, sctps_fragusrmsgs);
+ L(20, sctps_timostrmrst); R(20, sctps_reasmusrmsgs);
+#undef DO
+#undef L
+#undef R
+}
+
+int
+initsctp(void)
+{
+ size_t len;
+ const char *name = "net.inet.sctp.stats";
+
+ len = 0;
+ if (sysctlbyname(name, NULL, &len, NULL, 0) < 0) {
+ error("sysctl getting sctpstat size failed");
+ return 0;
+ }
+ if (len > sizeof curstat) {
+ error("sctpstat structure has grown--recompile systat!");
+ return 0;
+ }
+ if (sysctlbyname(name, &initstat, &len, NULL, 0) < 0) {
+ error("sysctl getting sctpstat failed");
+ return 0;
+ }
+ oldstat = initstat;
+ return 1;
+}
+
+void
+resetsctp(void)
+{
+ size_t len;
+ const char *name = "net.inet.sctp.stats";
+
+ len = sizeof initstat;
+ if (sysctlbyname(name, &initstat, &len, NULL, 0) < 0) {
+ error("sysctl getting sctpstat failed");
+ }
+ oldstat = initstat;
+}
+
+void
+fetchsctp(void)
+{
+ size_t len;
+ const char *name = "net.inet.sctp.stats";
+
+ oldstat = curstat;
+ len = sizeof curstat;
+ if (sysctlbyname(name, &curstat, &len, NULL, 0) < 0) {
+ error("sysctl getting sctpstat failed");
+ }
+ return;
+}
diff --git a/usr.bin/systat/systat.1 b/usr.bin/systat/systat.1
index 9c144e7..46c2cb9 100644
--- a/usr.bin/systat/systat.1
+++ b/usr.bin/systat/systat.1
@@ -28,7 +28,7 @@
.\" @(#)systat.1 8.2 (Berkeley) 12/30/93
.\" $FreeBSD$
.\"
-.Dd July 15, 2013
+.Dd October 24, 2015
.Dt SYSTAT 1
.Os
.Sh NAME
@@ -95,6 +95,7 @@ to be one of:
.Ic ip6 ,
.Ic netstat ,
.Ic pigs ,
+.Ic sctp ,
.Ic swap ,
.Ic tcp ,
or
@@ -223,6 +224,12 @@ except that it displays
statistics.
It does not display
.Tn UDP statistics.
+.It Ic sctp
+Like
+.Ic icmp ,
+but with
+.Tn SCTP
+statistics.
.It Ic tcp
Like
.Ic icmp ,
diff --git a/usr.sbin/Makefile b/usr.sbin/Makefile
index 8e97961..fccef4a 100644
--- a/usr.sbin/Makefile
+++ b/usr.sbin/Makefile
@@ -44,6 +44,7 @@ SUBDIR= adduser \
mixer \
mlxcontrol \
mountd \
+ mount_smbfs \
mptutil \
mtest \
${_mtree} \
diff --git a/usr.sbin/Makefile.amd64 b/usr.sbin/Makefile.amd64
index 3f40974..0fdccaf 100644
--- a/usr.sbin/Makefile.amd64
+++ b/usr.sbin/Makefile.amd64
@@ -25,7 +25,6 @@ SUBDIR+= hyperv
.endif
SUBDIR+= kgmon
SUBDIR+= lptcontrol
-SUBDIR+= mount_smbfs
SUBDIR+= mptable
.if ${MK_NDIS} != "no"
SUBDIR+= ndiscvt
diff --git a/usr.sbin/Makefile.arm b/usr.sbin/Makefile.arm
index b21bc52..84cff4a 100644
--- a/usr.sbin/Makefile.arm
+++ b/usr.sbin/Makefile.arm
@@ -1,4 +1,4 @@
# $FreeBSD$
-SUBDIR+= ofwdump
SUBDIR+= kgmon
+SUBDIR+= ofwdump
diff --git a/usr.sbin/Makefile.i386 b/usr.sbin/Makefile.i386
index de7bb46..1aae5a3 100644
--- a/usr.sbin/Makefile.i386
+++ b/usr.sbin/Makefile.i386
@@ -15,7 +15,6 @@ SUBDIR+= hyperv
SUBDIR+= kgmon
SUBDIR+= kgzip
SUBDIR+= lptcontrol
-SUBDIR+= mount_smbfs
SUBDIR+= mptable
.if ${MK_NDIS} != "no"
SUBDIR+= ndiscvt
diff --git a/usr.sbin/Makefile.ia64 b/usr.sbin/Makefile.ia64
index 0a897b4..d047b33 100644
--- a/usr.sbin/Makefile.ia64
+++ b/usr.sbin/Makefile.ia64
@@ -4,6 +4,5 @@
SUBDIR+= acpi
.endif
SUBDIR+= kgmon
-SUBDIR+= mount_smbfs
SUBDIR:= ${SUBDIR:Nuathload}
SUBDIR+= zzz
diff --git a/usr.sbin/Makefile.powerpc b/usr.sbin/Makefile.powerpc
index 8833a27..131eb57 100644
--- a/usr.sbin/Makefile.powerpc
+++ b/usr.sbin/Makefile.powerpc
@@ -1,5 +1,4 @@
# $FreeBSD$
-SUBDIR+= mount_smbfs
SUBDIR+= nvram
SUBDIR+= ofwdump
diff --git a/usr.sbin/Makefile.sparc64 b/usr.sbin/Makefile.sparc64
index 632b3a8..81f7a9b 100644
--- a/usr.sbin/Makefile.sparc64
+++ b/usr.sbin/Makefile.sparc64
@@ -1,5 +1,4 @@
# $FreeBSD$
SUBDIR+= eeprom
-SUBDIR+= mount_smbfs
SUBDIR+= ofwdump
diff --git a/usr.sbin/arp/arp.c b/usr.sbin/arp/arp.c
index 60f776f..eefde75 100644
--- a/usr.sbin/arp/arp.c
+++ b/usr.sbin/arp/arp.c
@@ -673,10 +673,13 @@ print_entry(struct sockaddr_dl *sdl,
*/
static void
nuke_entry(struct sockaddr_dl *sdl __unused,
- struct sockaddr_in *addr, struct rt_msghdr *rtm __unused)
+ struct sockaddr_in *addr, struct rt_msghdr *rtm)
{
char ip[20];
+ if (rtm->rtm_flags & RTF_PINNED)
+ return;
+
snprintf(ip, sizeof(ip), "%s", inet_ntoa(addr->sin_addr));
delete(ip);
}
diff --git a/usr.sbin/bhyve/pci_virtio_net.c b/usr.sbin/bhyve/pci_virtio_net.c
index 3781ea9..c13940b 100644
--- a/usr.sbin/bhyve/pci_virtio_net.c
+++ b/usr.sbin/bhyve/pci_virtio_net.c
@@ -36,6 +36,10 @@ __FBSDID("$FreeBSD$");
#include <sys/ioctl.h>
#include <machine/atomic.h>
#include <net/ethernet.h>
+#ifndef NETMAP_WITH_LIBS
+#define NETMAP_WITH_LIBS
+#endif
+#include <net/netmap_user.h>
#include <errno.h>
#include <fcntl.h>
@@ -133,6 +137,8 @@ struct pci_vtnet_softc {
struct mevent *vsc_mevp;
int vsc_tapfd;
+ struct nm_desc *vsc_nmd;
+
int vsc_rx_ready;
volatile int resetting; /* set and checked outside lock */
@@ -149,6 +155,10 @@ struct pci_vtnet_softc {
pthread_mutex_t tx_mtx;
pthread_cond_t tx_cond;
int tx_in_progress;
+
+ void (*pci_vtnet_rx)(struct pci_vtnet_softc *sc);
+ void (*pci_vtnet_tx)(struct pci_vtnet_softc *sc, struct iovec *iov,
+ int iovcnt, int len);
};
static void pci_vtnet_reset(void *);
@@ -371,14 +381,208 @@ pci_vtnet_tap_rx(struct pci_vtnet_softc *sc)
vq_endchains(vq, 1);
}
+static int
+pci_vtnet_netmap_writev(struct nm_desc *nmd, struct iovec *iov, int iovcnt)
+{
+ int r, i;
+ int len = 0;
+
+ for (r = nmd->cur_tx_ring; ; ) {
+ struct netmap_ring *ring = NETMAP_TXRING(nmd->nifp, r);
+ uint32_t cur, idx;
+ char *buf;
+
+ if (nm_ring_empty(ring)) {
+ r++;
+ if (r > nmd->last_tx_ring)
+ r = nmd->first_tx_ring;
+ if (r == nmd->cur_rx_ring)
+ break;
+ continue;
+ }
+ cur = ring->cur;
+ idx = ring->slot[cur].buf_idx;
+ buf = NETMAP_BUF(ring, idx);
+
+ for (i = 0; i < iovcnt; i++) {
+ memcpy(&buf[len], iov[i].iov_base, iov[i].iov_len);
+ len += iov[i].iov_len;
+ }
+ ring->slot[cur].len = len;
+ ring->head = ring->cur = nm_ring_next(ring, cur);
+ nmd->cur_tx_ring = r;
+ ioctl(nmd->fd, NIOCTXSYNC, NULL);
+ break;
+ }
+
+ return (len);
+}
+
+static inline int
+pci_vtnet_netmap_readv(struct nm_desc *nmd, struct iovec *iov, int iovcnt)
+{
+ int len = 0;
+ int i = 0;
+ int r;
+
+ for (r = nmd->cur_rx_ring; ; ) {
+ struct netmap_ring *ring = NETMAP_RXRING(nmd->nifp, r);
+ uint32_t cur, idx;
+ char *buf;
+ size_t left;
+
+ if (nm_ring_empty(ring)) {
+ r++;
+ if (r > nmd->last_rx_ring)
+ r = nmd->first_rx_ring;
+ if (r == nmd->cur_rx_ring)
+ break;
+ continue;
+ }
+ cur = ring->cur;
+ idx = ring->slot[cur].buf_idx;
+ buf = NETMAP_BUF(ring, idx);
+ left = ring->slot[cur].len;
+
+ for (i = 0; i < iovcnt && left > 0; i++) {
+ if (iov[i].iov_len > left)
+ iov[i].iov_len = left;
+ memcpy(iov[i].iov_base, &buf[len], iov[i].iov_len);
+ len += iov[i].iov_len;
+ left -= iov[i].iov_len;
+ }
+ ring->head = ring->cur = nm_ring_next(ring, cur);
+ nmd->cur_rx_ring = r;
+ ioctl(nmd->fd, NIOCRXSYNC, NULL);
+ break;
+ }
+ for (; i < iovcnt; i++)
+ iov[i].iov_len = 0;
+
+ return (len);
+}
+
+/*
+ * Called to send a buffer chain out to the vale port
+ */
+static void
+pci_vtnet_netmap_tx(struct pci_vtnet_softc *sc, struct iovec *iov, int iovcnt,
+ int len)
+{
+ static char pad[60]; /* all zero bytes */
+
+ if (sc->vsc_nmd == NULL)
+ return;
+
+ /*
+ * If the length is < 60, pad out to that and add the
+ * extra zero'd segment to the iov. It is guaranteed that
+ * there is always an extra iov available by the caller.
+ */
+ if (len < 60) {
+ iov[iovcnt].iov_base = pad;
+ iov[iovcnt].iov_len = 60 - len;
+ iovcnt++;
+ }
+ (void) pci_vtnet_netmap_writev(sc->vsc_nmd, iov, iovcnt);
+}
+
static void
-pci_vtnet_tap_callback(int fd, enum ev_type type, void *param)
+pci_vtnet_netmap_rx(struct pci_vtnet_softc *sc)
+{
+ struct iovec iov[VTNET_MAXSEGS], *riov;
+ struct vqueue_info *vq;
+ void *vrx;
+ int len, n;
+ uint16_t idx;
+
+ /*
+ * Should never be called without a valid netmap descriptor
+ */
+ assert(sc->vsc_nmd != NULL);
+
+ /*
+ * But, will be called when the rx ring hasn't yet
+ * been set up or the guest is resetting the device.
+ */
+ if (!sc->vsc_rx_ready || sc->resetting) {
+ /*
+ * Drop the packet and try later.
+ */
+ (void) nm_nextpkt(sc->vsc_nmd, (void *)dummybuf);
+ return;
+ }
+
+ /*
+ * Check for available rx buffers
+ */
+ vq = &sc->vsc_queues[VTNET_RXQ];
+ if (!vq_has_descs(vq)) {
+ /*
+ * Drop the packet and try later. Interrupt on
+ * empty, if that's negotiated.
+ */
+ (void) nm_nextpkt(sc->vsc_nmd, (void *)dummybuf);
+ vq_endchains(vq, 1);
+ return;
+ }
+
+ do {
+ /*
+ * Get descriptor chain.
+ */
+ n = vq_getchain(vq, &idx, iov, VTNET_MAXSEGS, NULL);
+ assert(n >= 1 && n <= VTNET_MAXSEGS);
+
+ /*
+ * Get a pointer to the rx header, and use the
+ * data immediately following it for the packet buffer.
+ */
+ vrx = iov[0].iov_base;
+ riov = rx_iov_trim(iov, &n, sc->rx_vhdrlen);
+
+ len = pci_vtnet_netmap_readv(sc->vsc_nmd, riov, n);
+
+ if (len == 0) {
+ /*
+ * No more packets, but still some avail ring
+ * entries. Interrupt if needed/appropriate.
+ */
+ vq_endchains(vq, 0);
+ return;
+ }
+
+ /*
+ * The only valid field in the rx packet header is the
+ * number of buffers if merged rx bufs were negotiated.
+ */
+ memset(vrx, 0, sc->rx_vhdrlen);
+
+ if (sc->rx_merge) {
+ struct virtio_net_rxhdr *vrxh;
+
+ vrxh = vrx;
+ vrxh->vrh_bufs = 1;
+ }
+
+ /*
+ * Release this chain and handle more chains.
+ */
+ vq_relchain(vq, idx, len + sc->rx_vhdrlen);
+ } while (vq_has_descs(vq));
+
+ /* Interrupt if needed, including for NOTIFY_ON_EMPTY. */
+ vq_endchains(vq, 1);
+}
+
+static void
+pci_vtnet_rx_callback(int fd, enum ev_type type, void *param)
{
struct pci_vtnet_softc *sc = param;
pthread_mutex_lock(&sc->rx_mtx);
sc->rx_in_progress = 1;
- pci_vtnet_tap_rx(sc);
+ sc->pci_vtnet_rx(sc);
sc->rx_in_progress = 0;
pthread_mutex_unlock(&sc->rx_mtx);
@@ -421,7 +625,7 @@ pci_vtnet_proctx(struct pci_vtnet_softc *sc, struct vqueue_info *vq)
}
DPRINTF(("virtio: packet send, %d bytes, %d segs\n\r", plen, n));
- pci_vtnet_tap_tx(sc, &iov[1], n - 1, plen);
+ sc->pci_vtnet_tx(sc, &iov[1], n - 1, plen);
/* chain is processed, release it and set tlen */
vq_relchain(vq, idx, tlen);
@@ -532,6 +736,67 @@ pci_vtnet_parsemac(char *mac_str, uint8_t *mac_addr)
return (0);
}
+static void
+pci_vtnet_tap_setup(struct pci_vtnet_softc *sc, char *devname)
+{
+ char tbuf[80];
+
+ strcpy(tbuf, "/dev/");
+ strlcat(tbuf, devname, sizeof(tbuf));
+
+ sc->pci_vtnet_rx = pci_vtnet_tap_rx;
+ sc->pci_vtnet_tx = pci_vtnet_tap_tx;
+
+ sc->vsc_tapfd = open(tbuf, O_RDWR);
+ if (sc->vsc_tapfd == -1) {
+ WPRINTF(("open of tap device %s failed\n", tbuf));
+ return;
+ }
+
+ /*
+ * Set non-blocking and register for read
+ * notifications with the event loop
+ */
+ int opt = 1;
+ if (ioctl(sc->vsc_tapfd, FIONBIO, &opt) < 0) {
+ WPRINTF(("tap device O_NONBLOCK failed\n"));
+ close(sc->vsc_tapfd);
+ sc->vsc_tapfd = -1;
+ }
+
+ sc->vsc_mevp = mevent_add(sc->vsc_tapfd,
+ EVF_READ,
+ pci_vtnet_rx_callback,
+ sc);
+ if (sc->vsc_mevp == NULL) {
+ WPRINTF(("Could not register event\n"));
+ close(sc->vsc_tapfd);
+ sc->vsc_tapfd = -1;
+ }
+}
+
+static void
+pci_vtnet_netmap_setup(struct pci_vtnet_softc *sc, char *ifname)
+{
+ sc->pci_vtnet_rx = pci_vtnet_netmap_rx;
+ sc->pci_vtnet_tx = pci_vtnet_netmap_tx;
+
+ sc->vsc_nmd = nm_open(ifname, NULL, 0, 0);
+ if (sc->vsc_nmd == NULL) {
+ WPRINTF(("open of netmap device %s failed\n", ifname));
+ return;
+ }
+
+ sc->vsc_mevp = mevent_add(sc->vsc_nmd->fd,
+ EVF_READ,
+ pci_vtnet_rx_callback,
+ sc);
+ if (sc->vsc_mevp == NULL) {
+ WPRINTF(("Could not register event\n"));
+ nm_close(sc->vsc_nmd);
+ sc->vsc_nmd = NULL;
+ }
+}
static int
pci_vtnet_init(struct vmctx *ctx, struct pci_devinst *pi, char *opts)
@@ -567,8 +832,8 @@ pci_vtnet_init(struct vmctx *ctx, struct pci_devinst *pi, char *opts)
*/
mac_provided = 0;
sc->vsc_tapfd = -1;
+ sc->vsc_nmd = NULL;
if (opts != NULL) {
- char tbuf[80];
int err;
devname = vtopts = strdup(opts);
@@ -583,36 +848,13 @@ pci_vtnet_init(struct vmctx *ctx, struct pci_devinst *pi, char *opts)
mac_provided = 1;
}
- strcpy(tbuf, "/dev/");
- strlcat(tbuf, devname, sizeof(tbuf));
+ if (strncmp(devname, "vale", 4) == 0)
+ pci_vtnet_netmap_setup(sc, devname);
+ if ((strncmp(devname, "tap", 3) == 0) ||
+ (strncmp(devname, "vmmnet", 5) == 0))
+ pci_vtnet_tap_setup(sc, devname);
free(devname);
-
- sc->vsc_tapfd = open(tbuf, O_RDWR);
- if (sc->vsc_tapfd == -1) {
- WPRINTF(("open of tap device %s failed\n", tbuf));
- } else {
- /*
- * Set non-blocking and register for read
- * notifications with the event loop
- */
- int opt = 1;
- if (ioctl(sc->vsc_tapfd, FIONBIO, &opt) < 0) {
- WPRINTF(("tap device O_NONBLOCK failed\n"));
- close(sc->vsc_tapfd);
- sc->vsc_tapfd = -1;
- }
-
- sc->vsc_mevp = mevent_add(sc->vsc_tapfd,
- EVF_READ,
- pci_vtnet_tap_callback,
- sc);
- if (sc->vsc_mevp == NULL) {
- WPRINTF(("Could not register event\n"));
- close(sc->vsc_tapfd);
- sc->vsc_tapfd = -1;
- }
- }
}
/*
diff --git a/usr.sbin/boot0cfg/boot0cfg.c b/usr.sbin/boot0cfg/boot0cfg.c
index 2602e50..c2cb91d 100644
--- a/usr.sbin/boot0cfg/boot0cfg.c
+++ b/usr.sbin/boot0cfg/boot0cfg.c
@@ -336,7 +336,8 @@ read_mbr(const char *disk, u_int8_t **mbr, int check_version)
close(fd);
return (mbr_size);
}
- *mbr = malloc(sizeof(buf));
+ if ((*mbr = malloc(sizeof(buf))) == NULL)
+ errx(1, "%s: unable to allocate MBR buffer", disk);
memcpy(*mbr, buf, sizeof(buf));
close(fd);
diff --git a/usr.sbin/bsdinstall/scripts/auto b/usr.sbin/bsdinstall/scripts/auto
index 57d7944..b7ce48b 100755
--- a/usr.sbin/bsdinstall/scripts/auto
+++ b/usr.sbin/bsdinstall/scripts/auto
@@ -53,7 +53,7 @@ error() {
}
hline_arrows_tab_enter="Press arrows, TAB or ENTER"
-msg_gpt_active_fix="Your hardware is known to have issues booting in BIOS mode from GPT partitions that are not set active. Would you like the installer to apply this workaround for you?"
+msg_gpt_active_fix="Your hardware is known to have issues booting in CSM/Legacy/BIOS mode from GPT partitions that are not set active. Would you like the installer to apply this workaround for you?"
msg_lenovo_fix="Your model of Lenovo is known to have a BIOS bug that prevents it booting from GPT partitions without UEFI. Would you like the installer to apply a workaround for you?"
msg_no="NO"
msg_yes="YES"
@@ -166,6 +166,14 @@ if f_interactive; then
f_dprintf "smbios.system.product=[%s]" "$sys_model"
sys_version=$( kenv -q smbios.system.version )
f_dprintf "smbios.system.version=[%s]" "$sys_version"
+ sys_mb_maker=$( kenv -q smbios.planar.maker )
+ f_dprintf "smbios.planar.maker=[%s]" "$sys_mb_maker"
+ sys_mb_product=$( kenv -q smbios.planar.product )
+ f_dprintf "smbios.planar.product=[%s]" "$sys_mb_product"
+
+ #
+ # Laptop Models
+ #
case "$sys_maker" in
"LENOVO")
case "$sys_version" in
@@ -182,7 +190,51 @@ if f_interactive; then
;;
"Dell Inc.")
case "$sys_model" in
- "Latitude E7440")
+ "Latitude E7440"|"Latitude E7240"|"Precision Tower 5810")
+ dialog_workaround "$msg_gpt_active_fix"
+ retval=$?
+ f_dprintf "gpt_active_fix_prompt=[%s]" "$retval"
+ if [ $retval -eq $DIALOG_OK ]; then
+ export ZFSBOOT_PARTITION_SCHEME="GPT + Active"
+ export WORKAROUND_GPTACTIVE=1
+ fi
+ ;;
+ esac
+ ;;
+ "Hewlett-Packard")
+ case "$sys_model" in
+ "HP ProBook 4330s")
+ dialog_workaround "$msg_gpt_active_fix"
+ retval=$?
+ f_dprintf "gpt_active_fix_prompt=[%s]" "$retval"
+ if [ $retval -eq $DIALOG_OK ]; then
+ export ZFSBOOT_PARTITION_SCHEME="GPT + Active"
+ export WORKAROUND_GPTACTIVE=1
+ fi
+ ;;
+ esac
+ ;;
+ esac
+ #
+ # Motherboard Models
+ #
+ case "$sys_mb_maker" in
+ "Intel Corporation")
+ case "$sys_mb_product" in
+ "DP965LT"|"D510MO")
+ dialog_workaround "$msg_gpt_active_fix"
+ retval=$?
+ f_dprintf "gpt_active_fix_prompt=[%s]" "$retval"
+ if [ $retval -eq $DIALOG_OK ]; then
+ export ZFSBOOT_PARTITION_SCHEME="GPT + Active"
+ export WORKAROUND_GPTACTIVE=1
+ fi
+ ;;
+ esac
+ ;;
+ "Acer")
+ case "$sys_mb_product" in
+ "Veriton M6630G")
dialog_workaround "$msg_gpt_active_fix"
retval=$?
f_dprintf "gpt_active_fix_prompt=[%s]" "$retval"
diff --git a/usr.sbin/bsdinstall/scripts/zfsboot b/usr.sbin/bsdinstall/scripts/zfsboot
index e230ac6..59c9b2e 100755
--- a/usr.sbin/bsdinstall/scripts/zfsboot
+++ b/usr.sbin/bsdinstall/scripts/zfsboot
@@ -825,6 +825,7 @@ zfs_create_diskpart()
if [ "$ZFSBOOT_FORCE_4K_SECTORS" ]; then
align_small="-a 4k"
align_big="-a 1m"
+ sysctl kern.geom.part.mbr.enforce_chs=0
fi
case "$ZFSBOOT_PARTITION_SCHEME" in
@@ -940,11 +941,12 @@ zfs_create_diskpart()
#
# Always prepare a boot pool on MBR
+ # Do not align this partition, there must not be a gap
#
ZFSBOOT_BOOT_POOL=1
f_eval_catch $funcname gpart \
"$GPART_ADD_ALIGN_INDEX_WITH_SIZE" \
- "$align_small" 1 freebsd-zfs ${bootsize}b ${disk}s1 ||
+ "" 1 freebsd-zfs ${bootsize}b ${disk}s1 ||
return $FAILURE
# Pedantically nuke any old labels
f_eval_catch -d $funcname zpool "$ZPOOL_LABELCLEAR_F" \
diff --git a/usr.sbin/jail/command.c b/usr.sbin/jail/command.c
index a170b30..805251f 100644
--- a/usr.sbin/jail/command.c
+++ b/usr.sbin/jail/command.c
@@ -878,6 +878,7 @@ get_user_info(struct cfjail *j, const char *username,
{
const struct passwd *pwd;
+ errno = 0;
*pwdp = pwd = username ? getpwnam(username) : getpwuid(getuid());
if (pwd == NULL) {
if (errno)
diff --git a/usr.sbin/jail/config.c b/usr.sbin/jail/config.c
index 87b8ef9..cb06bac 100644
--- a/usr.sbin/jail/config.c
+++ b/usr.sbin/jail/config.c
@@ -454,7 +454,7 @@ check_intparams(struct cfjail *j)
struct addrinfo hints;
struct addrinfo *ai0, *ai;
const char *hostname;
- int gicode, defif, prefix;
+ int gicode, defif;
#endif
#ifdef INET
struct in_addr addr4;
@@ -597,15 +597,7 @@ check_intparams(struct cfjail *j)
strcpy(s->s, cs + 1);
s->len -= cs + 1 - s->s;
}
- if ((cs = strchr(s->s, '/'))) {
- prefix = strtol(cs + 1, &ep, 10);
- if (*ep == '.'
- ? inet_pton(AF_INET, cs + 1, &addr4) != 1
- : *ep || prefix < 0 || prefix > 32) {
- jail_warnx(j,
- "ip4.addr: bad netmask \"%s\"", cs);
- error = -1;
- }
+ if ((cs = strchr(s->s, '/')) != NULL) {
*cs = '\0';
s->len = cs - s->s;
}
@@ -626,14 +618,7 @@ check_intparams(struct cfjail *j)
strcpy(s->s, cs + 1);
s->len -= cs + 1 - s->s;
}
- if ((cs = strchr(s->s, '/'))) {
- prefix = strtol(cs + 1, &ep, 10);
- if (*ep || prefix < 0 || prefix > 128) {
- jail_warnx(j,
- "ip6.addr: bad prefixlen \"%s\"",
- cs);
- error = -1;
- }
+ if ((cs = strchr(s->s, '/')) != NULL) {
*cs = '\0';
s->len = cs - s->s;
}
diff --git a/usr.sbin/mountd/exports.5 b/usr.sbin/mountd/exports.5
index 88e2219..018a865 100644
--- a/usr.sbin/mountd/exports.5
+++ b/usr.sbin/mountd/exports.5
@@ -131,6 +131,7 @@ The credential includes all the groups to which the user is a member
on the local machine (see
.Xr id 1 ) .
The user may be specified by name or number.
+The user string may be quoted, or use backslash escaping.
.Pp
.Sm off
.Fl maproot Li = Sy user:group1:group2:...
@@ -140,6 +141,7 @@ to be used for remote access by root.
The elements of the list may be either names or numbers.
Note that user: should be used to distinguish a credential containing
no groups from a complete credential for that user.
+The group names may be quoted, or use backslash escaping.
.Pp
.Sm off
.Fl mapall Li = Sy user
diff --git a/usr.sbin/mountd/mountd.c b/usr.sbin/mountd/mountd.c
index 7582195..89c7afb 100644
--- a/usr.sbin/mountd/mountd.c
+++ b/usr.sbin/mountd/mountd.c
@@ -174,6 +174,7 @@ int check_options(struct dirlist *);
int checkmask(struct sockaddr *sa);
int chk_host(struct dirlist *, struct sockaddr *, int *, int *, int *,
int **);
+static char *strsep_quote(char **stringp, const char *delim);
static int create_service(struct netconfig *nconf);
static void complete_service(struct netconfig *nconf, char *port_str);
static void clearout_service(void);
@@ -278,6 +279,73 @@ int debug = 0;
#endif
/*
+ * Similar to strsep(), but it allows for quoted strings
+ * and escaped characters.
+ *
+ * It returns the string (or NULL, if *stringp is NULL),
+ * which is a de-quoted version of the string if necessary.
+ *
+ * It modifies *stringp in place.
+ */
+static char *
+strsep_quote(char **stringp, const char *delim)
+{
+ char *srcptr, *dstptr, *retval;
+ char quot = 0;
+
+ if (stringp == NULL || *stringp == NULL)
+ return (NULL);
+
+ srcptr = dstptr = retval = *stringp;
+
+ while (*srcptr) {
+ /*
+ * We're looking for several edge cases here.
+ * First: if we're in quote state (quot != 0),
+ * then we ignore the delim characters, but otherwise
+ * process as normal, unless it is the quote character.
+ * Second: if the current character is a backslash,
+ * we take the next character as-is, without checking
+ * for delim, quote, or backslash. Exception: if the
+ * next character is a NUL, that's the end of the string.
+ * Third: if the character is a quote character, we toggle
+ * quote state.
+ * Otherwise: check the current character for NUL, or
+ * being in delim, and end the string if either is true.
+ */
+ if (*srcptr == '\\') {
+ srcptr++;
+ /*
+ * The edge case here is if the next character
+ * is NUL, we want to stop processing. But if
+ * it's not NUL, then we simply want to copy it.
+ */
+ if (*srcptr) {
+ *dstptr++ = *srcptr++;
+ }
+ continue;
+ }
+ if (quot == 0 && (*srcptr == '\'' || *srcptr == '"')) {
+ quot = *srcptr++;
+ continue;
+ }
+ if (quot && *srcptr == quot) {
+ /* End of the quoted part */
+ quot = 0;
+ srcptr++;
+ continue;
+ }
+ if (!quot && strchr(delim, *srcptr))
+ break;
+ *dstptr++ = *srcptr++;
+ }
+
+ *dstptr = 0; /* Terminate the string */
+ *stringp = (*srcptr == '\0') ? NULL : srcptr + 1;
+ return (retval);
+}
+
+/*
* Mountd server for NFS mount protocol as described in:
* NFS: Network File System Protocol Specification, RFC1094, Appendix A
* The optional arguments are the exports file name
@@ -2849,8 +2917,9 @@ parsecred(char *namelist, struct xucred *cr)
/*
* Get the user's password table entry.
*/
- names = strsep(&namelist, " \t\n");
+ names = strsep_quote(&namelist, " \t\n");
name = strsep(&names, ":");
+ /* Bug? name could be NULL here */
if (isdigit(*name) || *name == '-')
pw = getpwuid(atoi(name));
else
diff --git a/usr.sbin/ndp/ndp.c b/usr.sbin/ndp/ndp.c
index ada1822..c2fe869 100644
--- a/usr.sbin/ndp/ndp.c
+++ b/usr.sbin/ndp/ndp.c
@@ -655,6 +655,8 @@ again:;
if (rtm->rtm_flags & RTF_CLONED)
delete(host_buf);
#else
+ if (rtm->rtm_flags & RTF_PINNED)
+ continue;
delete(host_buf);
#endif
continue;
diff --git a/usr.sbin/ntp/config.h b/usr.sbin/ntp/config.h
index 73f83a3..ae3efba 100644
--- a/usr.sbin/ntp/config.h
+++ b/usr.sbin/ntp/config.h
@@ -182,7 +182,7 @@
/* #undef C_ALLOCA */
/* Enable debugging code? */
-#define DEBUG 1
+/* #undef DEBUG */
/* Enable processing time debugging? */
/* #undef DEBUG_TIMING */
@@ -1437,7 +1437,7 @@
#define PACKAGE_NAME "ntp"
/* Define to the full name and version of this package. */
-#define PACKAGE_STRING "ntp 4.2.8p5"
+#define PACKAGE_STRING "ntp 4.2.8p6"
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "ntp"
@@ -1446,7 +1446,7 @@
#define PACKAGE_URL "http://www.ntp.org./"
/* Define to the version of this package. */
-#define PACKAGE_VERSION "4.2.8p5"
+#define PACKAGE_VERSION "4.2.8p6"
/* data dir */
#define PERLLIBDIR "/usr/local/share/ntp/lib"
@@ -1627,7 +1627,7 @@ typedef unsigned int uintptr_t;
/* #undef USE_UDP_SIGPOLL */
/* Version number of package */
-#define VERSION "4.2.8p5"
+#define VERSION "4.2.8p6"
/* vsnprintf expands "%m" to strerror(errno) */
/* #undef VSNPRINTF_PERCENT_M */
@@ -1804,5 +1804,5 @@ typedef union mpinfou {
/*
* FreeBSD specific: Explicitly specify date/time for reproducible build.
*/
-#define MKREPRO_DATE "Jan 8 2016"
-#define MKREPRO_TIME "12:37:48"
+#define MKREPRO_DATE "Jan 21 2016"
+#define MKREPRO_TIME "01:03:28"
diff --git a/usr.sbin/ntp/doc/ntp-keygen.8 b/usr.sbin/ntp/doc/ntp-keygen.8
index a0c0954..e18940e 100644
--- a/usr.sbin/ntp/doc/ntp-keygen.8
+++ b/usr.sbin/ntp/doc/ntp-keygen.8
@@ -1,11 +1,11 @@
-.Dd January 7 2016
+.Dd January 20 2016
.Dt NTP_KEYGEN 8 User Commands
.Os
.\" EDIT THIS FILE WITH CAUTION (ntp-keygen-opts.mdoc)
.\"
.\" $FreeBSD$
.\"
-.\" It has been AutoGen-ed January 7, 2016 at 11:32:43 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed January 20, 2016 at 04:19:51 AM by AutoGen 5.18.5
.\" From the definitions ntp-keygen-opts.def
.\" and the template file agmdoc-cmd.tpl
.Sh NAME
@@ -1055,7 +1055,7 @@ it to autogen\-users@lists.sourceforge.net. Thank you.
.Sh "AUTHORS"
The University of Delaware and Network Time Foundation
.Sh "COPYRIGHT"
-Copyright (C) 1992\-2015 The University of Delaware and Network Time Foundation all rights reserved.
+Copyright (C) 1992\-2016 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 --git a/usr.sbin/ntp/doc/ntp.conf.5 b/usr.sbin/ntp/doc/ntp.conf.5
index 3f075a1..343f574 100644
--- a/usr.sbin/ntp/doc/ntp.conf.5
+++ b/usr.sbin/ntp/doc/ntp.conf.5
@@ -1,11 +1,11 @@
-.Dd January 7 2016
+.Dd January 20 2016
.Dt NTP_CONF 5 File Formats
.Os
.\" EDIT THIS FILE WITH CAUTION (ntp.mdoc)
.\"
.\" $FreeBSD$
.\"
-.\" It has been AutoGen-ed January 7, 2016 at 11:30:57 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed January 20, 2016 at 04:18:07 AM by AutoGen 5.18.5
.\" From the definitions ntp.conf.def
.\" and the template file agmdoc-cmd.tpl
.Sh NAME
@@ -2395,16 +2395,18 @@ a 6\-bit code. The default value is 46, signifying Expedited Forwarding.
.Oo
.Cm auth | Cm bclient |
.Cm calibrate | Cm kernel |
-.Cm mode7 | monitor |
-.Cm ntp | Cm stats
+.Cm mode7 | Cm monitor |
+.Cm ntp | Cm stats |
+.Cm unpeer_crypto_early | Cm unpeer_crypto_nak_early | Cm unpeer_digest_early
.Oc
.Xc
.It Xo Ic disable
.Oo
.Cm auth | Cm bclient |
.Cm calibrate | Cm kernel |
-.Cm mode7 | monitor |
-.Cm ntp | Cm stats
+.Cm mode7 | Cm monitor |
+.Cm ntp | Cm stats |
+.Cm unpeer_crypto_early | Cm unpeer_crypto_nak_early | Cm unpeer_digest_early
.Oc
.Xc
Provides a way to enable or disable various server options.
@@ -2478,6 +2480,67 @@ See the
section for further information.
The default for this flag is
.Ic disable .
+.It Cm unpeer_crypto_early
+By default, if
+.Xr ntpd 8
+receives an autokey packet that fails TEST9,
+a crypto failure,
+the association is immediately cleared.
+This is almost certainly a feature,
+but if, in spite of the current recommendation of not using autokey,
+you are
+.B still
+using autokey
+.B and
+you are seeing this sort of DoS attack
+disabling this flag will delay
+tearing down the association until the reachability counter
+becomes zero.
+You can check your
+.Cm peerstats
+file for evidence of any of these attacks.
+The
+default for this flag is
+.Ic enable .
+.It Cm unpeer_crypto_nak_early
+By default, if
+.Xr ntpd 8
+receives a crypto\-NAK packet that
+passes the duplicate packet and origin timestamp checks
+the association is immediately cleared.
+While this is generally a feature
+as it allows for quick recovery if a server key has changed,
+a properly forged and appropriately delivered crypto\-NAK packet
+can be used in a DoS attack.
+If you have active noticable problems with this type of DoS attack
+then you should consider
+disabling this option.
+You can check your
+.Cm peerstats
+file for evidence of any of these attacks.
+The
+default for this flag is
+.Ic enable .
+.It Cm unpeer_digest_early
+By default, if
+.Xr ntpd 8
+receives what should be an authenticated packet
+that passes other packet sanity checks but
+contains an invalid digest
+the association is immediately cleared.
+While this is generally a feature
+as it allows for quick recovery,
+if this type of packet is carefully forged and sent
+during an appropriate window it can be used for a DoS attack.
+If you have active noticable problems with this type of DoS attack
+then you should consider
+disabling this option.
+You can check your
+.Cm peerstats
+file for evidence of any of these attacks.
+The
+default for this flag is
+.Ic enable .
.El
.It Ic includefile Ar includefile
This command allows additional configuration commands
@@ -2836,7 +2899,7 @@ A snapshot of this documentation is available in HTML format in
.Sh "AUTHORS"
The University of Delaware and Network Time Foundation
.Sh "COPYRIGHT"
-Copyright (C) 1992\-2015 The University of Delaware and Network Time Foundation all rights reserved.
+Copyright (C) 1992\-2016 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 --git a/usr.sbin/ntp/doc/ntp.keys.5 b/usr.sbin/ntp/doc/ntp.keys.5
index 04dfbcd..6f711b9 100644
--- a/usr.sbin/ntp/doc/ntp.keys.5
+++ b/usr.sbin/ntp/doc/ntp.keys.5
@@ -1,11 +1,11 @@
-.Dd January 7 2016
+.Dd January 20 2016
.Dt NTP_KEYS 5 File Formats
.Os SunOS 5.10
.\" EDIT THIS FILE WITH CAUTION (ntp.mdoc)
.\"
.\" $FreeBSD$
.\"
-.\" It has been AutoGen-ed January 7, 2016 at 11:31:00 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed January 20, 2016 at 04:18:10 AM by AutoGen 5.18.5
.\" From the definitions ntp.keys.def
.\" and the template file agmdoc-file.tpl
.Sh NAME
@@ -46,7 +46,7 @@ The key file uses the same comment conventions
as the configuration file.
Key entries use a fixed format of the form
.Pp
-.D1 Ar keyno type key
+.D1 Ar keyno type key opt_IP_list
.Pp
where
.Ar keyno
@@ -55,7 +55,15 @@ is a positive integer (between 1 and 65534),
is the message digest algorithm,
and
.Ar key
-is the key itself.
+is the key itself, and
+.Ar opt_IP_list
+is an optional comma\-separated list of IPs
+that are allowed to serve time.
+If
+.Ar opt_IP_list
+is empty,
+any properly\-authenticated server message will be
+accepted.
.Pp
The
.Ar key
@@ -149,7 +157,7 @@ it to autogen\-users@lists.sourceforge.net. Thank you.
.Sh "AUTHORS"
The University of Delaware and Network Time Foundation
.Sh "COPYRIGHT"
-Copyright (C) 1992\-2015 The University of Delaware and Network Time Foundation all rights reserved.
+Copyright (C) 1992\-2016 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 --git a/usr.sbin/ntp/doc/ntpd.8 b/usr.sbin/ntp/doc/ntpd.8
index 70ab88e..3f6b673 100644
--- a/usr.sbin/ntp/doc/ntpd.8
+++ b/usr.sbin/ntp/doc/ntpd.8
@@ -1,11 +1,11 @@
-.Dd January 7 2016
+.Dd January 20 2016
.Dt NTPD 8 User Commands
.Os
.\" EDIT THIS FILE WITH CAUTION (ntpd-opts.mdoc)
.\"
.\" $FreeBSD$
.\"
-.\" It has been AutoGen-ed January 7, 2016 at 11:31:02 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed January 20, 2016 at 04:18:12 AM by AutoGen 5.18.5
.\" From the definitions ntpd-opts.def
.\" and the template file agmdoc-cmd.tpl
.Sh NAME
@@ -888,7 +888,7 @@ A snapshot of this documentation is available in HTML format in
.Sh "AUTHORS"
The University of Delaware and Network Time Foundation
.Sh "COPYRIGHT"
-Copyright (C) 1992\-2015 The University of Delaware and Network Time Foundation all rights reserved.
+Copyright (C) 1992\-2016 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 --git a/usr.sbin/ntp/doc/ntpdc.8 b/usr.sbin/ntp/doc/ntpdc.8
index 3561f2a..36511dc 100644
--- a/usr.sbin/ntp/doc/ntpdc.8
+++ b/usr.sbin/ntp/doc/ntpdc.8
@@ -1,11 +1,11 @@
-.Dd January 7 2016
+.Dd January 20 2016
.Dt NTPDC 8 User Commands
.Os
.\" EDIT THIS FILE WITH CAUTION (ntpdc-opts.mdoc)
.\"
.\" $FreeBSD$
.\"
-.\" It has been AutoGen-ed January 7, 2016 at 11:31:29 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed January 20, 2016 at 04:18:39 AM by AutoGen 5.18.5
.\" From the definitions ntpdc-opts.def
.\" and the template file agmdoc-cmd.tpl
.Sh NAME
@@ -789,7 +789,7 @@ it to autogen\-users@lists.sourceforge.net. Thank you.
.Sh AUTHORS
The formatting directives in this document came from FreeBSD.
.Sh "COPYRIGHT"
-Copyright (C) 1992\-2015 The University of Delaware and Network Time Foundation all rights reserved.
+Copyright (C) 1992\-2016 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 --git a/usr.sbin/ntp/doc/ntpq.8 b/usr.sbin/ntp/doc/ntpq.8
index e71a84b..a1e1c64 100644
--- a/usr.sbin/ntp/doc/ntpq.8
+++ b/usr.sbin/ntp/doc/ntpq.8
@@ -1,11 +1,11 @@
-.Dd January 7 2016
+.Dd January 20 2016
.Dt NTPQ 8 User Commands
.Os
.\" EDIT THIS FILE WITH CAUTION (ntpq-opts.mdoc)
.\"
.\" $FreeBSD$
.\"
-.\" It has been AutoGen-ed January 7, 2016 at 11:32:02 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed January 20, 2016 at 04:19:12 AM by AutoGen 5.18.5
.\" From the definitions ntpq-opts.def
.\" and the template file agmdoc-cmd.tpl
.Sh NAME
@@ -957,7 +957,7 @@ it to autogen\-users@lists.sourceforge.net. Thank you.
.Sh "AUTHORS"
The University of Delaware and Network Time Foundation
.Sh "COPYRIGHT"
-Copyright (C) 1992\-2015 The University of Delaware and Network Time Foundation all rights reserved.
+Copyright (C) 1992\-2016 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 --git a/usr.sbin/ntp/doc/sntp.8 b/usr.sbin/ntp/doc/sntp.8
index 0d2dd64..b800b9e 100644
--- a/usr.sbin/ntp/doc/sntp.8
+++ b/usr.sbin/ntp/doc/sntp.8
@@ -1,11 +1,11 @@
-.Dd January 7 2016
+.Dd January 20 2016
.Dt SNTP 8 User Commands
.Os
.\" EDIT THIS FILE WITH CAUTION (sntp-opts.mdoc)
.\"
.\" $FreeBSD$
.\"
-.\" It has been AutoGen-ed January 7, 2016 at 11:23:27 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed January 20, 2016 at 04:06:45 AM by AutoGen 5.18.5
.\" From the definitions sntp-opts.def
.\" and the template file agmdoc-cmd.tpl
.Sh NAME
@@ -305,7 +305,7 @@ it to autogen\-users@lists.sourceforge.net. Thank you.
.An "Harlan Stenn"
.An "Dave Hart"
.Sh "COPYRIGHT"
-Copyright (C) 1992\-2015 The University of Delaware and Network Time Foundation all rights reserved.
+Copyright (C) 1992\-2016 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 --git a/usr.sbin/ntp/libntp/Makefile b/usr.sbin/ntp/libntp/Makefile
index 1e48483..6a58cdb 100644
--- a/usr.sbin/ntp/libntp/Makefile
+++ b/usr.sbin/ntp/libntp/Makefile
@@ -16,6 +16,7 @@ NTP_SRCS= systime.c a_md5encrypt.c adjtime.c atoint.c \
clocktypes.c decodenetnum.c dofptoa.c dolfptoa.c \
emalloc.c findconfig.c getopt.c hextoint.c \
hextolfp.c humandate.c icom.c iosignal.c \
+ is_ip_address.c \
lib_strbuf.c machines.c mktime.c modetoa.c \
mstolfp.c msyslog.c netof.c ntp_calendar.c \
ntp_crypto_rnd.c ntp_intres.c ntp_libopts.c \
diff --git a/usr.sbin/ntp/scripts/mkver b/usr.sbin/ntp/scripts/mkver
index 6a99756..c200a1b 100755
--- a/usr.sbin/ntp/scripts/mkver
+++ b/usr.sbin/ntp/scripts/mkver
@@ -6,7 +6,7 @@ PROG=${1-UNKNOWN}
ConfStr="$PROG"
-ConfStr="$ConfStr 4.2.8p5"
+ConfStr="$ConfStr 4.2.8p6"
case "$CSET" in
'') ;;
diff --git a/usr.sbin/pciconf/pciconf.8 b/usr.sbin/pciconf/pciconf.8
index 8dbb2a6..705b594 100644
--- a/usr.sbin/pciconf/pciconf.8
+++ b/usr.sbin/pciconf/pciconf.8
@@ -25,7 +25,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd September 06, 2015
+.Dd November 23, 2015
.Dt PCICONF 8
.Os
.Sh NAME
@@ -33,7 +33,7 @@
.Nd diagnostic utility for the PCI bus
.Sh SYNOPSIS
.Nm
-.Fl l Oo Fl bcevV Oc Op Ar device
+.Fl l Oo Fl BbceVv Oc Op Ar device
.Nm
.Fl a Ar device
.Nm
@@ -112,6 +112,42 @@ device, which contains several (similar or independent) functions on
one chip.
.Pp
If the
+.Fl B
+option is supplied,
+.Nm
+will list additional information for
+.Tn PCI
+to
+.Tn PCI
+and
+.Tn PCI
+to
+.Tn CardBus
+bridges,
+specifically the resource ranges decoded by the bridge for use by devices
+behind the bridge.
+Each bridge lists a range of bus numbers handled by the bridge and its
+downstream devices.
+Memory and I/O port decoding windows are enumerated via a line in the
+following format:
+.Bd -literal
+ window[1c] = type I/O Port, range 16, addr 0x5000-0x8fff, enabled
+.Ed
+.Pp
+The first value after the
+.Dq Li window
+prefix in the square brackets is the offset of the decoding window in
+config space in hexadecimal.
+The type of a window is one of
+.Dq Memory ,
+.Dq Prefetchable Memory ,
+or
+.Dq I/O Port .
+The range indicates the binary log of the maximum address the window decodes.
+The address field indicates the start and end addresses of the decoded range.
+Finally, the last flag indicates if the window is enabled or disabled.
+.Pp
+If the
.Fl b
option is supplied,
.Nm
@@ -132,7 +168,7 @@ The type of a BAR is one of
.Dq Prefetchable Memory ,
or
.Dq I/O Port .
-The range indicates the maximum address the BAR decodes.
+The range indicates the binary log of the maximum address the BAR decodes.
The base and size indicate the start and length of the BAR's address window,
respectively.
Finally, the last flag indicates if the BAR is enabled or disabled.
diff --git a/usr.sbin/pciconf/pciconf.c b/usr.sbin/pciconf/pciconf.c
index ad709db..bb013b0 100644
--- a/usr.sbin/pciconf/pciconf.c
+++ b/usr.sbin/pciconf/pciconf.c
@@ -39,6 +39,7 @@ static const char rcsid[] =
#include <ctype.h>
#include <err.h>
#include <inttypes.h>
+#include <stdbool.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
@@ -69,9 +70,10 @@ struct pci_vendor_info
TAILQ_HEAD(,pci_vendor_info) pci_vendors;
static struct pcisel getsel(const char *str);
+static void list_bridge(int fd, struct pci_conf *p);
static void list_bars(int fd, struct pci_conf *p);
-static void list_devs(const char *name, int verbose, int bars, int caps,
- int errors, int vpd);
+static void list_devs(const char *name, int verbose, int bars, int bridge,
+ int caps, int errors, int vpd);
static void list_verbose(struct pci_conf *p);
static void list_vpd(int fd, struct pci_conf *p);
static const char *guess_class(struct pci_conf *p);
@@ -87,7 +89,7 @@ static void
usage(void)
{
fprintf(stderr, "%s\n%s\n%s\n%s\n",
- "usage: pciconf -l [-bcevV] [device]",
+ "usage: pciconf -l [-BbcevV] [device]",
" pciconf -a device",
" pciconf -r [-b | -h] device addr[:addr2]",
" pciconf -w [-b | -h] device addr value");
@@ -99,18 +101,22 @@ main(int argc, char **argv)
{
int c;
int listmode, readmode, writemode, attachedmode;
- int bars, caps, errors, verbose, vpd;
+ int bars, bridge, caps, errors, verbose, vpd;
int byte, isshort;
listmode = readmode = writemode = attachedmode = 0;
- bars = caps = errors = verbose = vpd = byte = isshort = 0;
+ bars = bridge = caps = errors = verbose = vpd = byte = isshort = 0;
- while ((c = getopt(argc, argv, "abcehlrwvV")) != -1) {
+ while ((c = getopt(argc, argv, "aBbcehlrwVv")) != -1) {
switch(c) {
case 'a':
attachedmode = 1;
break;
+ case 'B':
+ bridge = 1;
+ break;
+
case 'b':
bars = 1;
byte = 1;
@@ -161,7 +167,7 @@ main(int argc, char **argv)
if (listmode) {
list_devs(optind + 1 == argc ? argv[optind] : NULL, verbose,
- bars, caps, errors, vpd);
+ bars, bridge, caps, errors, vpd);
} else if (attachedmode) {
chkattached(argv[optind]);
} else if (readmode) {
@@ -178,8 +184,8 @@ main(int argc, char **argv)
}
static void
-list_devs(const char *name, int verbose, int bars, int caps, int errors,
- int vpd)
+list_devs(const char *name, int verbose, int bars, int bridge, int caps,
+ int errors, int vpd)
{
int fd;
struct pci_conf_io pc;
@@ -190,7 +196,8 @@ list_devs(const char *name, int verbose, int bars, int caps, int errors,
if (verbose)
load_vendors();
- fd = open(_PATH_DEVPCI, (caps || errors) ? O_RDWR : O_RDONLY, 0);
+ fd = open(_PATH_DEVPCI, (bridge || caps || errors) ? O_RDWR : O_RDONLY,
+ 0);
if (fd < 0)
err(1, "%s", _PATH_DEVPCI);
@@ -248,6 +255,8 @@ list_devs(const char *name, int verbose, int bars, int caps, int errors,
list_verbose(p);
if (bars)
list_bars(fd, p);
+ if (bridge)
+ list_bridge(fd, p);
if (caps)
list_caps(fd, p);
if (errors)
@@ -261,6 +270,189 @@ list_devs(const char *name, int verbose, int bars, int caps, int errors,
}
static void
+print_bus_range(int fd, struct pci_conf *p, int secreg, int subreg)
+{
+ uint8_t secbus, subbus;
+
+ secbus = read_config(fd, &p->pc_sel, secreg, 1);
+ subbus = read_config(fd, &p->pc_sel, subreg, 1);
+ printf(" bus range = %u-%u\n", secbus, subbus);
+}
+
+static void
+print_window(int reg, const char *type, int range, uint64_t base,
+ uint64_t limit)
+{
+
+ printf(" window[%02x] = type %s, range %2d, addr %#jx-%#jx, %s\n",
+ reg, type, range, (uintmax_t)base, (uintmax_t)limit,
+ base < limit ? "enabled" : "disabled");
+}
+
+static void
+print_special_decode(bool isa, bool vga, bool subtractive)
+{
+ bool comma;
+
+ if (isa || vga || subtractive) {
+ comma = false;
+ printf(" decode = ");
+ if (isa) {
+ printf("ISA");
+ comma = true;
+ }
+ if (vga) {
+ printf("%sVGA", comma ? ", " : "");
+ comma = true;
+ }
+ if (subtractive)
+ printf("%ssubtractive", comma ? ", " : "");
+ printf("\n");
+ }
+}
+
+static void
+print_bridge_windows(int fd, struct pci_conf *p)
+{
+ uint64_t base, limit;
+ uint32_t val;
+ uint16_t bctl;
+ bool subtractive;
+ int range;
+
+ /*
+ * XXX: This assumes that a window with a base and limit of 0
+ * is not implemented. In theory a window might be programmed
+ * at the smallest size with a base of 0, but those do not seem
+ * common in practice.
+ */
+ val = read_config(fd, &p->pc_sel, PCIR_IOBASEL_1, 1);
+ if (val != 0 || read_config(fd, &p->pc_sel, PCIR_IOLIMITL_1, 1) != 0) {
+ if ((val & PCIM_BRIO_MASK) == PCIM_BRIO_32) {
+ base = PCI_PPBIOBASE(
+ read_config(fd, &p->pc_sel, PCIR_IOBASEH_1, 2),
+ val);
+ limit = PCI_PPBIOLIMIT(
+ read_config(fd, &p->pc_sel, PCIR_IOLIMITH_1, 2),
+ read_config(fd, &p->pc_sel, PCIR_IOLIMITL_1, 1));
+ range = 32;
+ } else {
+ base = PCI_PPBIOBASE(0, val);
+ limit = PCI_PPBIOLIMIT(0,
+ read_config(fd, &p->pc_sel, PCIR_IOLIMITL_1, 1));
+ range = 16;
+ }
+ print_window(PCIR_IOBASEL_1, "I/O Port", range, base, limit);
+ }
+
+ base = PCI_PPBMEMBASE(0,
+ read_config(fd, &p->pc_sel, PCIR_MEMBASE_1, 2));
+ limit = PCI_PPBMEMLIMIT(0,
+ read_config(fd, &p->pc_sel, PCIR_MEMLIMIT_1, 2));
+ print_window(PCIR_MEMBASE_1, "Memory", 32, base, limit);
+
+ val = read_config(fd, &p->pc_sel, PCIR_PMBASEL_1, 2);
+ if (val != 0 || read_config(fd, &p->pc_sel, PCIR_PMLIMITL_1, 2) != 0) {
+ if ((val & PCIM_BRPM_MASK) == PCIM_BRPM_64) {
+ base = PCI_PPBMEMBASE(
+ read_config(fd, &p->pc_sel, PCIR_PMBASEH_1, 4),
+ val);
+ limit = PCI_PPBMEMLIMIT(
+ read_config(fd, &p->pc_sel, PCIR_PMLIMITH_1, 4),
+ read_config(fd, &p->pc_sel, PCIR_PMLIMITL_1, 2));
+ range = 64;
+ } else {
+ base = PCI_PPBMEMBASE(0, val);
+ limit = PCI_PPBMEMLIMIT(0,
+ read_config(fd, &p->pc_sel, PCIR_PMLIMITL_1, 2));
+ range = 32;
+ }
+ print_window(PCIR_PMBASEL_1, "Prefetchable Memory", range, base,
+ limit);
+ }
+
+ /*
+ * XXX: This list of bridges that are subtractive but do not set
+ * progif to indicate it is copied from pci_pci.c.
+ */
+ subtractive = p->pc_progif == PCIP_BRIDGE_PCI_SUBTRACTIVE;
+ switch (p->pc_device << 16 | p->pc_vendor) {
+ case 0xa002177d: /* Cavium ThunderX */
+ case 0x124b8086: /* Intel 82380FB Mobile */
+ case 0x060513d7: /* Toshiba ???? */
+ subtractive = true;
+ }
+ if (p->pc_vendor == 0x8086 && (p->pc_device & 0xff00) == 0x2400)
+ subtractive = true;
+
+ bctl = read_config(fd, &p->pc_sel, PCIR_BRIDGECTL_1, 2);
+ print_special_decode(bctl & PCIB_BCR_ISA_ENABLE,
+ bctl & PCIB_BCR_VGA_ENABLE, subtractive);
+}
+
+static void
+print_cardbus_mem_window(int fd, struct pci_conf *p, int basereg, int limitreg,
+ bool prefetch)
+{
+
+ print_window(basereg, prefetch ? "Prefetchable Memory" : "Memory", 32,
+ PCI_CBBMEMBASE(read_config(fd, &p->pc_sel, basereg, 4)),
+ PCI_CBBMEMLIMIT(read_config(fd, &p->pc_sel, limitreg, 4)));
+}
+
+static void
+print_cardbus_io_window(int fd, struct pci_conf *p, int basereg, int limitreg)
+{
+ uint32_t base, limit;
+ uint32_t val;
+ int range;
+
+ val = read_config(fd, &p->pc_sel, basereg, 2);
+ if ((val & PCIM_CBBIO_MASK) == PCIM_CBBIO_32) {
+ base = PCI_CBBIOBASE(read_config(fd, &p->pc_sel, basereg, 4));
+ limit = PCI_CBBIOBASE(read_config(fd, &p->pc_sel, limitreg, 4));
+ range = 32;
+ } else {
+ base = PCI_CBBIOBASE(val);
+ limit = PCI_CBBIOBASE(read_config(fd, &p->pc_sel, limitreg, 2));
+ range = 16;
+ }
+ print_window(basereg, "I/O Port", range, base, limit);
+}
+
+static void
+print_cardbus_windows(int fd, struct pci_conf *p)
+{
+ uint16_t bctl;
+
+ bctl = read_config(fd, &p->pc_sel, PCIR_BRIDGECTL_2, 2);
+ print_cardbus_mem_window(fd, p, PCIR_MEMBASE0_2, PCIR_MEMLIMIT0_2,
+ bctl & CBB_BCR_PREFETCH_0_ENABLE);
+ print_cardbus_mem_window(fd, p, PCIR_MEMBASE1_2, PCIR_MEMLIMIT1_2,
+ bctl & CBB_BCR_PREFETCH_1_ENABLE);
+ print_cardbus_io_window(fd, p, PCIR_IOBASE0_2, PCIR_IOLIMIT0_2);
+ print_cardbus_io_window(fd, p, PCIR_IOBASE1_2, PCIR_IOLIMIT1_2);
+ print_special_decode(bctl & CBB_BCR_ISA_ENABLE,
+ bctl & CBB_BCR_VGA_ENABLE, false);
+}
+
+static void
+list_bridge(int fd, struct pci_conf *p)
+{
+
+ switch (p->pc_hdr & PCIM_HDRTYPE) {
+ case PCIM_HDRTYPE_BRIDGE:
+ print_bus_range(fd, p, PCIR_SECBUS_1, PCIR_SUBBUS_1);
+ print_bridge_windows(fd, p);
+ break;
+ case PCIM_HDRTYPE_CARDBUS:
+ print_bus_range(fd, p, PCIR_SECBUS_2, PCIR_SUBBUS_2);
+ print_cardbus_windows(fd, p);
+ break;
+ }
+}
+
+static void
list_bars(int fd, struct pci_conf *p)
{
struct pci_bar_io bar;
diff --git a/usr.sbin/service/service.sh b/usr.sbin/service/service.sh
index 6ba2a8e..5c3807d 100755
--- a/usr.sbin/service/service.sh
+++ b/usr.sbin/service/service.sh
@@ -71,7 +71,9 @@ if [ -n "$RESTART" ]; then
if grep -q ^rcvar $file; then
eval `grep ^name= $file`
eval `grep ^rcvar $file`
- load_rc_config_var ${name} ${rcvar}
+ if [ -n "$rcvar" ]; then
+ load_rc_config_var ${name} ${rcvar}
+ fi
checkyesno $rcvar 2>/dev/null && run_rc_script ${file} stop
fi
done
@@ -101,7 +103,9 @@ if [ -n "$ENABLED" ]; then
if grep -q ^rcvar $file; then
eval `grep ^name= $file`
eval `grep ^rcvar $file`
- load_rc_config_var ${name} ${rcvar}
+ if [ -n "$rcvar" ]; then
+ load_rc_config_var ${name} ${rcvar}
+ fi
checkyesno $rcvar 2>/dev/null && echo $file
fi
done
OpenPOWER on IntegriCloud