diff --git a/.arcconfig b/.arcconfig
index fa78c6db09ae..54153b9bd420 100644
--- a/.arcconfig
+++ b/.arcconfig
@@ -1,5 +1,6 @@
{
"project.name": "S",
+ "repository.callsign" : "S",
"phabricator.uri" : "https://reviews.freebsd.org/",
"history.immutable" : true
}
diff --git a/Makefile b/Makefile
index 261e3b475488..de98c034fb8d 100644
--- a/Makefile
+++ b/Makefile
@@ -102,7 +102,7 @@
# Note: we use this awkward construct to be compatible with FreeBSD's
# old make used in 10.0 and 9.2 and earlier.
-.if defined(MK_META_MODE) && ${MK_META_MODE} == "yes"
+.if defined(MK_META_MODE) && ${MK_META_MODE} == "yes" && !make(showconfig)
# targets/Makefile plays the role of top-level
.include "targets/Makefile"
.else
@@ -538,7 +538,9 @@ MK_META_MODE= no
MK_STAGING= no
# tell meta.autodep.mk to not even think about updating anything.
UPDATE_DEPENDFILE= NO
+.if !make(showconfig)
.export MK_META_MODE MK_STAGING UPDATE_DEPENDFILE
+.endif
.if make(universe)
# we do not want a failure of one branch abort all.
diff --git a/Makefile.inc1 b/Makefile.inc1
index 04f91f7ce76d..abb3b1d71cd9 100644
--- a/Makefile.inc1
+++ b/Makefile.inc1
@@ -297,7 +297,6 @@ KTMAKE= TOOLS_PREFIX=${WORLDTMP} MAKEOBJDIRPREFIX=${WORLDTMP} \
# world stage
WMAKEENV= ${CROSSENV} \
- _SHLIBDIRPREFIX=${WORLDTMP} \
_LDSCRIPTROOT= \
VERSION="${VERSION}" \
INSTALL="sh ${.CURDIR}/tools/install.sh" \
@@ -439,7 +438,6 @@ LIB32FLAGS+= --sysroot=${WORLDTMP}
# Yes, the flags are redundant.
LIB32WMAKEENV+= MAKEOBJDIRPREFIX=${LIB32_OBJTREE} \
- _SHLIBDIRPREFIX=${LIB32TMP} \
_LDSCRIPTROOT=${LIB32TMP} \
VERSION="${VERSION}" \
INSTALL="sh ${.CURDIR}/tools/install.sh" \
@@ -1768,9 +1766,9 @@ cddl/lib/libctf__L: lib/libz__L
.endif
# cddl/lib/libdtrace requires lib/libproc and lib/librtld_db; it's only built
# on select architectures though (see cddl/lib/Makefile)
-.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386" || \
- ${MACHINE_CPUARCH} == "mips" || ${MACHINE_CPUARCH} == "powerpc" || \
- ${MACHINE_CPUARCH} == "arm"
+.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_ARCH} == "amd64" || \
+ ${MACHINE_CPUARCH} == "arm" || ${MACHINE_ARCH} == "i386" || \
+ ${MACHINE_CPUARCH} == "mips" || ${MACHINE_CPUARCH} == "powerpc"
_prebuild_libs+= lib/libproc lib/librtld_db
.endif
@@ -2123,7 +2121,6 @@ XDTP?=/usr/${XDDIR}
CDBENV=MAKEOBJDIRPREFIX=${MAKEOBJDIRPREFIX}/${XDDIR} \
INSTALL="sh ${.CURDIR}/tools/install.sh"
CDENV= ${CDBENV} \
- _SHLIBDIRPREFIX=${XDDESTDIR} \
TOOLS_PREFIX=${XDTP}
CD2CFLAGS=-isystem ${XDDESTDIR}/usr/include -L${XDDESTDIR}/usr/lib \
--sysroot=${XDDESTDIR}/ -B${XDDESTDIR}/usr/libexec \
diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc
index 613ad201940a..f8f4c681cb80 100644
--- a/ObsoleteFiles.inc
+++ b/ObsoleteFiles.inc
@@ -99,6 +99,72 @@ OLD_FILES+=usr/lib/clang/3.6.1/lib/freebsd/libclang_rt.ubsan_cxx-x86_64.a
OLD_DIRS+=usr/lib/clang/3.6.1/lib/freebsd
OLD_DIRS+=usr/lib/clang/3.6.1/lib
OLD_DIRS+=usr/lib/clang/3.6.1
+# 20150604: Move nvlist man pages to section 9.
+OLD_FILES+=usr/share/man/man3/libnv.3.gz
+OLD_FILES+=usr/share/man/man3/nvlist.3.gz
+OLD_FILES+=usr/share/man/man3/nvlist_add_binary.3.gz
+OLD_FILES+=usr/share/man/man3/nvlist_add_bool.3.gz
+OLD_FILES+=usr/share/man/man3/nvlist_add_descriptor.3.gz
+OLD_FILES+=usr/share/man/man3/nvlist_add_null.3.gz
+OLD_FILES+=usr/share/man/man3/nvlist_add_number.3.gz
+OLD_FILES+=usr/share/man/man3/nvlist_add_nvlist.3.gz
+OLD_FILES+=usr/share/man/man3/nvlist_add_string.3.gz
+OLD_FILES+=usr/share/man/man3/nvlist_add_stringf.3.gz
+OLD_FILES+=usr/share/man/man3/nvlist_add_stringv.3.gz
+OLD_FILES+=usr/share/man/man3/nvlist_clone.3.gz
+OLD_FILES+=usr/share/man/man3/nvlist_create.3.gz
+OLD_FILES+=usr/share/man/man3/nvlist_destroy.3.gz
+OLD_FILES+=usr/share/man/man3/nvlist_dump.3.gz
+OLD_FILES+=usr/share/man/man3/nvlist_empty.3.gz
+OLD_FILES+=usr/share/man/man3/nvlist_error.3.gz
+OLD_FILES+=usr/share/man/man3/nvlist_exists.3.gz
+OLD_FILES+=usr/share/man/man3/nvlist_exists_binary.3.gz
+OLD_FILES+=usr/share/man/man3/nvlist_exists_bool.3.gz
+OLD_FILES+=usr/share/man/man3/nvlist_exists_descriptor.3.gz
+OLD_FILES+=usr/share/man/man3/nvlist_exists_null.3.gz
+OLD_FILES+=usr/share/man/man3/nvlist_exists_number.3.gz
+OLD_FILES+=usr/share/man/man3/nvlist_exists_nvlist.3.gz
+OLD_FILES+=usr/share/man/man3/nvlist_exists_string.3.gz
+OLD_FILES+=usr/share/man/man3/nvlist_exists_type.3.gz
+OLD_FILES+=usr/share/man/man3/nvlist_fdump.3.gz
+OLD_FILES+=usr/share/man/man3/nvlist_flags.3.gz
+OLD_FILES+=usr/share/man/man3/nvlist_free.3.gz
+OLD_FILES+=usr/share/man/man3/nvlist_free_binary.3.gz
+OLD_FILES+=usr/share/man/man3/nvlist_free_bool.3.gz
+OLD_FILES+=usr/share/man/man3/nvlist_free_descriptor.3.gz
+OLD_FILES+=usr/share/man/man3/nvlist_free_null.3.gz
+OLD_FILES+=usr/share/man/man3/nvlist_free_number.3.gz
+OLD_FILES+=usr/share/man/man3/nvlist_free_nvlist.3.gz
+OLD_FILES+=usr/share/man/man3/nvlist_free_string.3.gz
+OLD_FILES+=usr/share/man/man3/nvlist_free_type.3.gz
+OLD_FILES+=usr/share/man/man3/nvlist_get_binary.3.gz
+OLD_FILES+=usr/share/man/man3/nvlist_get_bool.3.gz
+OLD_FILES+=usr/share/man/man3/nvlist_get_descriptor.3.gz
+OLD_FILES+=usr/share/man/man3/nvlist_get_number.3.gz
+OLD_FILES+=usr/share/man/man3/nvlist_get_nvlist.3.gz
+OLD_FILES+=usr/share/man/man3/nvlist_get_parent.3.gz
+OLD_FILES+=usr/share/man/man3/nvlist_get_string.3.gz
+OLD_FILES+=usr/share/man/man3/nvlist_move_binary.3.gz
+OLD_FILES+=usr/share/man/man3/nvlist_move_descriptor.3.gz
+OLD_FILES+=usr/share/man/man3/nvlist_move_nvlist.3.gz
+OLD_FILES+=usr/share/man/man3/nvlist_move_string.3.gz
+OLD_FILES+=usr/share/man/man3/nvlist_next.3.gz
+OLD_FILES+=usr/share/man/man3/nvlist_pack.3.gz
+OLD_FILES+=usr/share/man/man3/nvlist_recv.3.gz
+OLD_FILES+=usr/share/man/man3/nvlist_send.3.gz
+OLD_FILES+=usr/share/man/man3/nvlist_set_error.3.gz
+OLD_FILES+=usr/share/man/man3/nvlist_size.3.gz
+OLD_FILES+=usr/share/man/man3/nvlist_take_binary.3.gz
+OLD_FILES+=usr/share/man/man3/nvlist_take_bool.3.gz
+OLD_FILES+=usr/share/man/man3/nvlist_take_descriptor.3.gz
+OLD_FILES+=usr/share/man/man3/nvlist_take_number.3.gz
+OLD_FILES+=usr/share/man/man3/nvlist_take_nvlist.3.gz
+OLD_FILES+=usr/share/man/man3/nvlist_take_string.3.gz
+OLD_FILES+=usr/share/man/man3/nvlist_unpack.3.gz
+OLD_FILES+=usr/share/man/man3/nvlist_xfer.3.gz
+# 20150702: Remove duplicated nvlist includes.
+OLD_FILES+=usr/include/dnv.h
+OLD_FILES+=usr/include/nv.h
# 20150528: PCI IOV device driver methods moved to a separate kobj interface.
OLD_FILES+=usr/share/man/man9/PCI_ADD_VF.9.gz
OLD_FILES+=usr/share/man/man9/PCI_INIT_IOV.9.gz
@@ -1081,6 +1147,7 @@ OLD_FILES+=usr/include/lwres/net.h
OLD_FILES+=usr/include/lwres/netdb.h
OLD_FILES+=usr/include/lwres/platform.h
OLD_FILES+=usr/include/lwres/result.h
+OLD_FILES+=usr/include/lwres/string.h
OLD_FILES+=usr/include/lwres/version.h
OLD_FILES+=usr/lib/liblwres.a
OLD_FILES+=usr/lib/liblwres.so
diff --git a/UPDATING b/UPDATING
index 0952828d42d6..4598fe95566d 100644
--- a/UPDATING
+++ b/UPDATING
@@ -36,23 +36,45 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11.x IS SLOW:
20141231 entry below for information about prerequisites and upgrading,
if you are not already using 3.5.0 or higher.
-20150616:
- /etc/make.conf now included earlier.
- sys.mk now includes /etc/make.conf and {local,src}.sys.mk earlier
- than previously.
- This makes it simple to interpose external toolchains etc.
- However it may cause problems for users who have things like::
+20150630:
+ The default kernel entropy-processing algorithm is now
+ Fortuna, replacing Yarrow.
- INSTALL+= something
+ Assuming you have 'device random' in your kernel config
+ file, the configurations allow a kernel option to override
+ this default. You may choose *ONE* of:
- in /etc/make.conf, since INSTALL is not yet defined.
- A safe fix for that is to have::
+ options RANDOM_YARROW # Legacy /dev/random algorithm.
+ options RANDOM_DUMMY # Blocking-only driver.
- INSTALL?= install
- INSTALL+= something
+ If you have neither, you get Fortuna. For most people,
+ read no further, Fortuna will give a /dev/random that works
+ like it always used to, and the difference will be irrelevant.
+
+ If you remove 'device random', you get *NO* kernel-processed
+ entopy at all. This may be acceptable to folks building
+ embedded systems, but has complications. Carry on reading,
+ and it is assumed you know what you need.
+
+ *PLEASE* read random(4) and random(9) if you are in the
+ habit of tweeking kernel configs, and/or if you are a member
+ of the embedded community, wanting specific and not-usual
+ behaviour from your security subsystems.
+
+ NOTE!! If you use RANDOM_DUMMY and/or have no 'device
+ random', you will NOT have a functioning /dev/random, and
+ many cryptographic features will not work, including SSH.
+ You may also find strange behaviour from the random(3) set
+ of library functions, in particular sranddev(3), srandomdev(3)
+ and arc4random(3). The reason for this is that the KERN_ARND
+ sysctl only returns entropy if it thinks it has some to
+ share, and with RANDOM_DUMMY or no 'device random' this
+ will never happen.
+
+20150623:
+ An additional fix for the issue described in the 20150614 sendmail
+ entry below has been been committed in revision 284717.
- which is equivalent to previous behavior.
-
20150616:
FreeBSD's old make (fmake) has been removed from the system. It is
available as the devel/fmake port or via pkg install fmake.
diff --git a/bin/mv/mv.c b/bin/mv/mv.c
index a95b07a288b0..c19f6a047f9e 100644
--- a/bin/mv/mv.c
+++ b/bin/mv/mv.c
@@ -122,7 +122,7 @@ main(int argc, char *argv[])
*/
if (stat(argv[argc - 1], &sb) || !S_ISDIR(sb.st_mode)) {
if (argc > 2)
- usage();
+ errx(1, "%s is not a directory", argv[argc - 1]);
exit(do_move(argv[0], argv[1]));
}
diff --git a/bin/sh/alias.c b/bin/sh/alias.c
index 21f3f44a34e5..a77ce99a9f07 100644
--- a/bin/sh/alias.c
+++ b/bin/sh/alias.c
@@ -248,7 +248,7 @@ hashalias(const char *p)
{
unsigned int hashval;
- hashval = *p << 4;
+ hashval = (unsigned char)*p << 4;
while (*p)
hashval+= *p++;
return &atab[hashval % ATABSIZE];
diff --git a/bin/sh/exec.c b/bin/sh/exec.c
index c9d4126488e6..7d18c3cfc62d 100644
--- a/bin/sh/exec.c
+++ b/bin/sh/exec.c
@@ -522,17 +522,16 @@ static struct tblentry **lastcmdentry;
static struct tblentry *
cmdlookup(const char *name, int add)
{
- int hashval;
+ unsigned int hashval;
const char *p;
struct tblentry *cmdp;
struct tblentry **pp;
size_t len;
p = name;
- hashval = *p << 4;
+ hashval = (unsigned char)*p << 4;
while (*p)
hashval += *p++;
- hashval &= 0x7FFF;
pp = &cmdtable[hashval % CMDTABLESIZE];
for (cmdp = *pp ; cmdp ; cmdp = cmdp->next) {
if (equal(cmdp->cmdname, name))
diff --git a/cddl/contrib/opensolaris/lib/libdtrace/aarch64/dt_isadep.c b/cddl/contrib/opensolaris/lib/libdtrace/aarch64/dt_isadep.c
new file mode 100644
index 000000000000..9f5af8570490
--- /dev/null
+++ b/cddl/contrib/opensolaris/lib/libdtrace/aarch64/dt_isadep.c
@@ -0,0 +1,139 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License, Version 1.0 only
+ * (the "License"). You may not use this file except in compliance
+ * with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+/*
+ * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ * Copyright 2014 Howard Su
+ * Copyright 2015 George V. Neville-Neil
+ * Copyright 2015 Ruslan Bukin
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#include
+#include
+#include
+#include
+#include
+
+#include
+#include
+
+#if !defined(sun)
+#include
+#endif
+
+/*ARGSUSED*/
+int
+dt_pid_create_entry_probe(struct ps_prochandle *P, dtrace_hdl_t *dtp,
+ fasttrap_probe_spec_t *ftp, const GElf_Sym *symp)
+{
+
+ ftp->ftps_type = DTFTP_ENTRY;
+ ftp->ftps_pc = (uintptr_t)symp->st_value;
+ ftp->ftps_size = (size_t)symp->st_size;
+ ftp->ftps_noffs = 1;
+ ftp->ftps_offs[0] = 0;
+
+ if (ioctl(dtp->dt_ftfd, FASTTRAPIOC_MAKEPROBE, ftp) != 0) {
+ dt_dprintf("fasttrap probe creation ioctl failed: %s\n",
+ strerror(errno));
+ return (dt_set_errno(dtp, errno));
+ }
+
+ return (1);
+}
+
+int
+dt_pid_create_return_probe(struct ps_prochandle *P, dtrace_hdl_t *dtp,
+ fasttrap_probe_spec_t *ftp, const GElf_Sym *symp, uint64_t *stret)
+{
+
+ dt_dprintf("%s: unimplemented\n", __func__);
+
+ return (DT_PROC_ERR);
+}
+
+/*ARGSUSED*/
+int
+dt_pid_create_offset_probe(struct ps_prochandle *P, dtrace_hdl_t *dtp,
+ fasttrap_probe_spec_t *ftp, const GElf_Sym *symp, ulong_t off)
+{
+
+ if (!ALIGNED_POINTER(off, 4))
+ return (DT_PROC_ALIGN);
+
+ ftp->ftps_type = DTFTP_OFFSETS;
+ ftp->ftps_pc = (uintptr_t)symp->st_value;
+ ftp->ftps_size = (size_t)symp->st_size;
+ ftp->ftps_noffs = 1;
+ ftp->ftps_offs[0] = off;
+
+ if (ioctl(dtp->dt_ftfd, FASTTRAPIOC_MAKEPROBE, ftp) != 0) {
+ dt_dprintf("fasttrap probe creation ioctl failed: %s\n",
+ strerror(errno));
+ return (dt_set_errno(dtp, errno));
+ }
+
+ return (1);
+}
+
+/*ARGSUSED*/
+int
+dt_pid_create_glob_offset_probes(struct ps_prochandle *P, dtrace_hdl_t *dtp,
+ fasttrap_probe_spec_t *ftp, const GElf_Sym *symp, const char *pattern)
+{
+ ulong_t i;
+
+ ftp->ftps_type = DTFTP_OFFSETS;
+ ftp->ftps_pc = (uintptr_t)symp->st_value;
+ ftp->ftps_size = (size_t)symp->st_size;
+ ftp->ftps_noffs = 0;
+
+ /*
+ * If we're matching against everything, just iterate through each
+ * instruction in the function, otherwise look for matching offset
+ * names by constructing the string and comparing it against the
+ * pattern.
+ */
+ if (strcmp("*", pattern) == 0) {
+ for (i = 0; i < symp->st_size; i += 4) {
+ ftp->ftps_offs[ftp->ftps_noffs++] = i;
+ }
+ } else {
+ char name[sizeof (i) * 2 + 1];
+
+ for (i = 0; i < symp->st_size; i += 4) {
+ (void) sprintf(name, "%lx", i);
+ if (gmatch(name, pattern))
+ ftp->ftps_offs[ftp->ftps_noffs++] = i;
+ }
+ }
+
+ if (ioctl(dtp->dt_ftfd, FASTTRAPIOC_MAKEPROBE, ftp) != 0) {
+ dt_dprintf("fasttrap probe creation ioctl failed: %s\n",
+ strerror(errno));
+ return (dt_set_errno(dtp, errno));
+ }
+
+ return (ftp->ftps_noffs);
+}
diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c
index f9b9625d6af6..f574cf763804 100644
--- a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c
+++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c
@@ -227,7 +227,10 @@ prepare_elf32(dtrace_hdl_t *dtp, const dof_hdr_t *dof, dof_elf32_t *dep)
s = &dofs[dofrh->dofr_tgtsec];
for (j = 0; j < nrel; j++) {
-#if defined(__arm__)
+#if defined(__aarch64__)
+/* XXX */
+printf("%s:%s(%d): DOODAD\n",__FUNCTION__,__FILE__,__LINE__);
+#elif defined(__arm__)
/* XXX */
printf("%s:%s(%d): DOODAD\n",__FUNCTION__,__FILE__,__LINE__);
#elif defined(__i386) || defined(__amd64)
@@ -426,7 +429,9 @@ prepare_elf64(dtrace_hdl_t *dtp, const dof_hdr_t *dof, dof_elf64_t *dep)
s = &dofs[dofrh->dofr_tgtsec];
for (j = 0; j < nrel; j++) {
-#if defined(__arm__)
+#if defined(__aarch64__)
+/* XXX */
+#elif defined(__arm__)
/* XXX */
#elif defined(__mips__)
/* XXX */
@@ -822,7 +827,16 @@ dt_symtab_lookup(Elf_Data *data_sym, int nsym, uintptr_t addr, uint_t shn,
return (ret);
}
-#if defined(__arm__)
+#if defined(__aarch64__)
+/* XXX */
+static int
+dt_modtext(dtrace_hdl_t *dtp, char *p, int isenabled, GElf_Rela *rela,
+ uint32_t *off)
+{
+printf("%s:%s(%d): DOODAD\n",__FUNCTION__,__FILE__,__LINE__);
+ return (0);
+}
+#elif defined(__arm__)
/* XXX */
static int
dt_modtext(dtrace_hdl_t *dtp, char *p, int isenabled, GElf_Rela *rela,
diff --git a/cddl/lib/Makefile b/cddl/lib/Makefile
index 48a77abb5107..f418993200ed 100644
--- a/cddl/lib/Makefile
+++ b/cddl/lib/Makefile
@@ -26,9 +26,9 @@ _libzpool= libzpool
.endif
.endif
-.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386" || \
- ${MACHINE_CPUARCH} == "mips" || ${MACHINE_CPUARCH} == "powerpc" || \
- ${MACHINE_CPUARCH} == "arm"
+.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_ARCH} == "amd64" || \
+ ${MACHINE_CPUARCH} == "arm" || ${MACHINE_ARCH} == "i386" || \
+ ${MACHINE_CPUARCH} == "mips" || ${MACHINE_CPUARCH} == "powerpc"
_drti= drti
_libdtrace= libdtrace
.endif
diff --git a/cddl/lib/libdtrace/Makefile b/cddl/lib/libdtrace/Makefile
index 128ccf5f9071..ee1d6dbb10ac 100644
--- a/cddl/lib/libdtrace/Makefile
+++ b/cddl/lib/libdtrace/Makefile
@@ -69,27 +69,31 @@ CFLAGS+= -I${.OBJDIR} -I${.CURDIR} \
#CFLAGS+= -DYYDEBUG
-.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
+.if ${MACHINE_CPUARCH} == "aarch64"
+CFLAGS+= -I${OPENSOLARIS_SYS_DISTDIR}/uts/aarch64
+.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libdtrace/aarch64
+.PATH: ${.CURDIR}/../../../sys/cddl/dev/dtrace/aarch64
+.elif ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386"
CFLAGS+= -I${.CURDIR}/../../../sys/cddl/dev/dtrace/x86
CFLAGS+= -I${OPENSOLARIS_SYS_DISTDIR}/uts/intel -DDIS_MEM
.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libdtrace/i386
.PATH: ${.CURDIR}/../../../sys/cddl/dev/dtrace/${MACHINE_ARCH}
.PATH: ${.CURDIR}/../../../sys/cddl/dev/dtrace/x86
-.elif ${MACHINE_CPUARCH} == "sparc64"
-CFLAGS+= -I${OPENSOLARIS_SYS_DISTDIR}/uts/sparc
-.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libdtrace/sparc
-.elif ${MACHINE_CPUARCH} == "mips"
-CFLAGS+= -I${OPENSOLARIS_SYS_DISTDIR}/uts/mips
-.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libdtrace/mips
-.PATH: ${.CURDIR}/../../../sys/cddl/dev/dtrace/mips
.elif ${MACHINE_CPUARCH} == "arm"
CFLAGS+= -I${OPENSOLARIS_SYS_DISTDIR}/uts/arm
.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libdtrace/arm
.PATH: ${.CURDIR}/../../../sys/cddl/dev/dtrace/arm
+.elif ${MACHINE_CPUARCH} == "mips"
+CFLAGS+= -I${OPENSOLARIS_SYS_DISTDIR}/uts/mips
+.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libdtrace/mips
+.PATH: ${.CURDIR}/../../../sys/cddl/dev/dtrace/mips
.elif ${MACHINE_CPUARCH} == "powerpc"
CFLAGS+= -I${OPENSOLARIS_SYS_DISTDIR}/uts/powerpc
.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libdtrace/powerpc
.PATH: ${.CURDIR}/../../../sys/cddl/dev/dtrace/powerpc
+.elif ${MACHINE_CPUARCH} == "sparc64"
+CFLAGS+= -I${OPENSOLARIS_SYS_DISTDIR}/uts/sparc
+.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libdtrace/sparc
.else
# temporary hack
CFLAGS+= -I${OPENSOLARIS_SYS_DISTDIR}/uts/intel
diff --git a/cddl/usr.sbin/Makefile b/cddl/usr.sbin/Makefile
index d309075a4306..31b55b6c4196 100644
--- a/cddl/usr.sbin/Makefile
+++ b/cddl/usr.sbin/Makefile
@@ -30,7 +30,7 @@ _plockstat= plockstat
.endif
.endif
-.if ${MACHINE_CPUARCH} == "arm"
+.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "arm"
_dtrace= dtrace
_dtruss= dtruss
_lockstat= lockstat
diff --git a/contrib/bmake/mk/meta2deps.sh b/contrib/bmake/mk/meta2deps.sh
index 2a79be17a331..0c934afd1c5f 100755
--- a/contrib/bmake/mk/meta2deps.sh
+++ b/contrib/bmake/mk/meta2deps.sh
@@ -52,7 +52,7 @@
# $SB/obj-i386/bsd/gnu/lib/csu
# $SB/obj-i386/bsd/gnu/lib/libgcc
# $SB/obj-i386/bsd/include
-# $SB/obj-i386/bsd/lib/csu/i386-elf
+# $SB/obj-i386/bsd/lib/csu/i386
# $SB/obj-i386/bsd/lib/libc
# $SB/src/bsd/include
# $SB/src/bsd/sys/i386/include
diff --git a/contrib/llvm/lib/Transforms/Scalar/SCCP.cpp b/contrib/llvm/lib/Transforms/Scalar/SCCP.cpp
index bc068f78c576..305175ff8f73 100644
--- a/contrib/llvm/lib/Transforms/Scalar/SCCP.cpp
+++ b/contrib/llvm/lib/Transforms/Scalar/SCCP.cpp
@@ -1055,7 +1055,7 @@ void SCCPSolver::visitLoadInst(LoadInst &I) {
// load null -> null
if (isa(Ptr) && I.getPointerAddressSpace() == 0)
- return markConstant(IV, &I, Constant::getNullValue(I.getType()));
+ return markConstant(IV, &I, UndefValue::get(I.getType()));
// Transform load (constant global) into the value loaded.
if (GlobalVariable *GV = dyn_cast(Ptr)) {
diff --git a/contrib/llvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp b/contrib/llvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp
index 919b45d3c7b1..add5432aa276 100644
--- a/contrib/llvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp
+++ b/contrib/llvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp
@@ -86,7 +86,7 @@ static void ConnectProlog(Loop *L, Value *BECount, unsigned Count,
if (L->contains(PN)) {
NewPN->addIncoming(PN->getIncomingValueForBlock(NewPH), OrigPH);
} else {
- NewPN->addIncoming(Constant::getNullValue(PN->getType()), OrigPH);
+ NewPN->addIncoming(UndefValue::get(PN->getType()), OrigPH);
}
Value *V = PN->getIncomingValueForBlock(Latch);
diff --git a/contrib/llvm/patches/patch-10-llvm-r241142-r241143-mmx-undef.diff b/contrib/llvm/patches/patch-10-llvm-r241142-r241143-mmx-undef.diff
new file mode 100644
index 000000000000..1750e7438954
--- /dev/null
+++ b/contrib/llvm/patches/patch-10-llvm-r241142-r241143-mmx-undef.diff
@@ -0,0 +1,88 @@
+Pull in r241142 from upstream llvm trunk (by David Majnemer):
+
+ [SCCP] Turn loads of null into undef instead of zero initialized values
+
+ Surprisingly, this is a correctness issue: the mmx type exists for
+ calling convention purposes, LLVM doesn't have a zero representation for
+ them.
+
+ This partially fixes PR23999.
+
+Pull in r241143 from upstream llvm trunk (by David Majnemer):
+
+ [LoopUnroll] Use undef for phis with no value live
+
+ We would create a phi node with a zero initialized operand instead of
+ undef in the case where no value was originally available. This was
+ problematic for x86_mmx which has no null value.
+
+These fix a "Cannot create a null constant of that type!" error when
+compiling the graphics/sdl2_gfx port with MMX enabled.
+
+Introduced here: http://svnweb.freebsd.org/changeset/base/285149
+
+Index: lib/Transforms/Scalar/SCCP.cpp
+===================================================================
+--- lib/Transforms/Scalar/SCCP.cpp
++++ lib/Transforms/Scalar/SCCP.cpp
+@@ -1054,7 +1054,7 @@
+
+ // load null -> null
+ if (isa(Ptr) && I.getPointerAddressSpace() == 0)
+- return markConstant(IV, &I, Constant::getNullValue(I.getType()));
++ return markConstant(IV, &I, UndefValue::get(I.getType()));
+
+ // Transform load (constant global) into the value loaded.
+ if (GlobalVariable *GV = dyn_cast(Ptr)) {
+Index: lib/Transforms/Utils/LoopUnrollRuntime.cpp
+===================================================================
+--- lib/Transforms/Utils/LoopUnrollRuntime.cpp
++++ lib/Transforms/Utils/LoopUnrollRuntime.cpp
+@@ -81,7 +81,7 @@
+ if (L->contains(PN)) {
+ NewPN->addIncoming(PN->getIncomingValueForBlock(NewPH), OrigPH);
+ } else {
+- NewPN->addIncoming(Constant::getNullValue(PN->getType()), OrigPH);
++ NewPN->addIncoming(UndefValue::get(PN->getType()), OrigPH);
+ }
+
+ Value *V = PN->getIncomingValueForBlock(Latch);
+Index: test/Transforms/LoopUnroll/X86/mmx.ll
+===================================================================
+--- test/Transforms/LoopUnroll/X86/mmx.ll
++++ test/Transforms/LoopUnroll/X86/mmx.ll
+@@ -0,0 +1,21 @@
++; RUN: opt < %s -S -loop-unroll | FileCheck %s
++target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
++target triple = "x86_64-unknown-linux-gnu"
++
++define x86_mmx @f() #0 {
++entry:
++ br label %for.body
++
++for.body: ; preds = %for.body, %entry
++ %phi = phi i32 [ 1, %entry ], [ %add, %for.body ]
++ %add = add i32 %phi, 1
++ %cmp = icmp eq i32 %phi, 0
++ br i1 %cmp, label %exit, label %for.body
++
++exit: ; preds = %for.body
++ %ret = phi x86_mmx [ undef, %for.body ]
++ ; CHECK: ret x86_mmx %ret
++ ret x86_mmx %ret
++}
++
++attributes #0 = { "target-cpu"="x86-64" }
+Index: test/Transforms/SCCP/crash.ll
+===================================================================
+--- test/Transforms/SCCP/crash.ll
++++ test/Transforms/SCCP/crash.ll
+@@ -27,3 +27,8 @@
+ %B = extractvalue [4 x i32] %A, 1
+ ret i32 %B
+ }
++
++define x86_mmx @test3() {
++ %load = load x86_mmx* null
++ ret x86_mmx %load
++}
diff --git a/contrib/pf/pflogd/pflogd.8 b/contrib/pf/pflogd/pflogd.8
index 38c954c9ccfa..d730a6b060e3 100644
--- a/contrib/pf/pflogd/pflogd.8
+++ b/contrib/pf/pflogd/pflogd.8
@@ -125,9 +125,11 @@ By default,
.Nm
will use
.Ar pflog0 .
+.It Fl p Ar pidfile
Writes a file containing the process ID of the program to
.Pa /var/run .
The file name has the form
+.Ao Ar pidfile Ac Ns .pid .
The default is
.Ar pflogd .
.It Fl s Ar snaplen
diff --git a/contrib/tcpdump/tcpdump.c b/contrib/tcpdump/tcpdump.c
index c8ca0bf5a4b3..aca877c5c3f9 100644
--- a/contrib/tcpdump/tcpdump.c
+++ b/contrib/tcpdump/tcpdump.c
@@ -82,7 +82,7 @@ extern int SIZE_BUF;
#include
#include
#include
-#include
+#include
#include
#include
#include
diff --git a/etc/defaults/rc.conf b/etc/defaults/rc.conf
index ef3b8616fabc..125d59e17aa9 100644
--- a/etc/defaults/rc.conf
+++ b/etc/defaults/rc.conf
@@ -630,15 +630,16 @@ kern_securelevel="-1" # range: -1..3 ; `-1' is the most insecure
# in the system booting with securelevel set to 1, as
# init(8) will raise the level when rc(8) completes.
update_motd="YES" # update version info in /etc/motd (or NO)
-entropy_file="/entropy" # Set to NO to disable caching entropy through reboots.
+entropy_boot_file="/boot/entropy" # Set to NO to disable very early
+ # (used at early boot time) entropy caching through reboots.
+entropy_file="/entropy" # Set to NO to disable late (used when going multi-user)
+ # entropy through reboots.
# /var/db/entropy-file is preferred if / is not avail.
entropy_dir="/var/db/entropy" # Set to NO to disable caching entropy via cron.
entropy_save_sz="4096" # Size of the entropy cache files.
entropy_save_num="8" # Number of entropy cache files to save.
-harvest_interrupt="YES" # Entropy device harvests interrupt randomness
-harvest_ethernet="YES" # Entropy device harvests ethernet randomness
-harvest_p_to_p="YES" # Entropy device harvests point-to-point randomness
-harvest_swi="YES" # Entropy device harvests internal SWI randomness
+harvest_mask="511" # Entropy device harvests all but the very invasive sources.
+ # (See 'sysctl kern.random.harvest' and random(4))
dmesg_enable="YES" # Save dmesg(8) to /var/run/dmesg.boot
watchdogd_enable="NO" # Start the software watchdog daemon
watchdogd_flags="" # Flags to watchdogd (if enabled)
diff --git a/etc/rc.d/iovctl b/etc/rc.d/iovctl
index f207b084dcc3..1958a266a9c9 100644
--- a/etc/rc.d/iovctl
+++ b/etc/rc.d/iovctl
@@ -27,7 +27,7 @@ run_iovctl()
iovctl_start()
{
- run_iovctl -E
+ run_iovctl -C
}
iovctl_stop()
diff --git a/etc/rc.d/random b/etc/rc.d/random
index 2420a39f97ca..13490a9fafef 100755
--- a/etc/rc.d/random
+++ b/etc/rc.d/random
@@ -41,6 +41,13 @@ feed_dev_random()
random_start()
{
+
+ if [ ${harvest_mask} -gt 0 ]; then
+ echo -n 'Setting up harvesting:'
+ ${SYSCTL} kern.random.harvest.mask=${harvest_mask} > /dev/null
+ ${SYSCTL_N} kern.random.harvest.mask_symbolic
+ fi
+
echo -n 'Feeding entropy:'
if [ ! -w /dev/random ] ; then
@@ -68,6 +75,14 @@ random_start()
;;
esac
+ case ${entropy_boot_file:=/boot/entropy} in
+ [Nn][Oo] | '')
+ ;;
+ *)
+ save_dev_random "${entropy_boot_file}"
+ ;;
+ esac
+
echo '.'
}
@@ -100,7 +115,33 @@ random_stop()
;;
*)
dd if=/dev/random of=${entropy_file_confirmed} \
- bs=4096 count=1 2> /dev/null
+ bs=4096 count=1 2> /dev/null ||
+ warn 'write failed (unwriteable file or full fs?)'
+ echo '.'
+ ;;
+ esac
+ umask ${oumask}
+ ;;
+ esac
+ case ${entropy_boot_file:=/boot/entropy} in
+ [Nn][Oo] | '')
+ ;;
+ *)
+ echo -n 'Writing early boot entropy file:'
+ rm -f ${entropy_boot_file} 2> /dev/null
+ oumask=`umask`
+ umask 077
+ if touch ${entropy_boot_file} 2> /dev/null; then
+ entropy_boot_file_confirmed="${entropy_boot_file}"
+ fi
+ case ${entropy_boot_file_confirmed} in
+ '')
+ warn 'write failed (read-only fs?)'
+ ;;
+ *)
+ dd if=/dev/random of=${entropy_boot_file_confirmed} \
+ bs=4096 count=1 2> /dev/null ||
+ warn 'write failed (unwriteable file or full fs?)'
echo '.'
;;
esac
diff --git a/etc/rc.firewall b/etc/rc.firewall
index 0c4d2203fcb0..c936da69cdcf 100644
--- a/etc/rc.firewall
+++ b/etc/rc.firewall
@@ -291,14 +291,14 @@ case ${firewall_type} in
fi
fi
- # define stuff we should never send out or receive in
+ # Define stuff we should never send out or receive in.
# Stop RFC1918 nets on the outside interface
${fwcmd} table ${BAD_ADDR_TBL} flush
${fwcmd} table ${BAD_ADDR_TBL} add 10.0.0.0/8
${fwcmd} table ${BAD_ADDR_TBL} add 172.16.0.0/12
${fwcmd} table ${BAD_ADDR_TBL} add 192.168.0.0/16
- # Stop draft-manning-dsua-03.txt (1 May 2000) nets (includes RESERVED-1,
+ # And stop draft-manning-dsua-03.txt (1 May 2000) nets (includes RESERVED-1,
# DHCP auto-configuration, NET-TEST, MULTICAST (class D), and class E)
# on the outside interface
${fwcmd} table ${BAD_ADDR_TBL} add 0.0.0.0/8
diff --git a/etc/services b/etc/services
index 1311799c76cd..3d06be637678 100644
--- a/etc/services
+++ b/etc/services
@@ -2365,6 +2365,8 @@ prosharerequest 5716/tcp #proshare conf request
prosharerequest 5716/udp #proshare conf request
prosharenotify 5717/tcp #proshare conf notify
prosharenotify 5717/udp #proshare conf notify
+couchdb 5984/tcp #CouchDB database server
+couchdb 5984/udp #CouchDB database server
cvsup 5999/tcp #CVSup file transfer/John Polstra/FreeBSD
x11 6000/tcp #6000-6063 are assigned to X Window System
x11 6000/udp
diff --git a/games/fortune/datfiles/fortunes b/games/fortune/datfiles/fortunes
index d7fecf4e2ccb..1aa54b557b15 100644
--- a/games/fortune/datfiles/fortunes
+++ b/games/fortune/datfiles/fortunes
@@ -6727,7 +6727,7 @@ K is for Kate who was struck with an axe, L is for Leo who swallowed some tacks.
M is for Maud who was swept out to sea, N is for Neville who died of ennui.
O is for Olive, run through with an awl, P is for Prue, trampled flat in a brawl
Q is for Quentin who sank in a mire, R is for Rhoda, consumed by a fire.
-S is for Susan who parished of fits, T is for Titus who flew into bits.
+S is for Susan who perished of fits, T is for Titus who flew into bits.
U is for Una who slipped down a drain, V is for Victor, squashed under a train.
W is for Winnie, embedded in ice, X is for Xerxes, devoured by mice.
Y is for Yorick whose head was bashed in, Z is for Zillah who drank too much gin.
diff --git a/gnu/usr.bin/gdb/kgdb/trgt.c b/gnu/usr.bin/gdb/kgdb/trgt.c
index b2f61890b2a7..c75edf000dba 100644
--- a/gnu/usr.bin/gdb/kgdb/trgt.c
+++ b/gnu/usr.bin/gdb/kgdb/trgt.c
@@ -76,7 +76,7 @@ kvm_t *kvm;
static char kvm_err[_POSIX2_LINE_MAX];
#define KERNOFF (kgdb_kernbase ())
-#define INKERNEL(x) ((x) >= KERNOFF)
+#define PINKERNEL(x) ((x) >= KERNOFF)
static CORE_ADDR
kgdb_kernbase (void)
@@ -296,7 +296,7 @@ kgdb_set_proc_cmd (char *arg, int from_tty)
addr = (CORE_ADDR) parse_and_eval_address (arg);
- if (!INKERNEL (addr)) {
+ if (!PINKERNEL (addr)) {
thr = kgdb_thr_lookup_pid((int)addr);
if (thr == NULL)
error ("invalid pid");
@@ -319,7 +319,7 @@ kgdb_set_tid_cmd (char *arg, int from_tty)
addr = (CORE_ADDR) parse_and_eval_address (arg);
- if (kvm != NULL && INKERNEL (addr)) {
+ if (kvm != NULL && PINKERNEL (addr)) {
thr = kgdb_thr_lookup_taddr(addr);
if (thr == NULL)
error("invalid thread address");
diff --git a/include/stdio.h b/include/stdio.h
index eaebff85e473..5a5b82bc665e 100644
--- a/include/stdio.h
+++ b/include/stdio.h
@@ -396,6 +396,7 @@ int (dprintf)(int, const char * __restrict, ...);
int asprintf(char **, const char *, ...) __printflike(2, 3);
char *ctermid_r(char *);
void fcloseall(void);
+int fdclose(FILE *, int *);
char *fgetln(FILE *, size_t *);
const char *fmtcheck(const char *, const char *) __format_arg(2);
int fpurge(FILE *);
diff --git a/lib/Makefile b/lib/Makefile
index b8b3a52ab5ca..d17cb5d25cd1 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -215,8 +215,9 @@ _libldns= libldns
# sense to build when clang is enabled at all. Furthermore, they can only be
# built for certain architectures.
.if ${MK_CLANG} != "no" && ${COMPILER_TYPE} == "clang" && \
- (${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" || \
- (${MACHINE_CPUARCH} == "arm" && ${MACHINE_ARCH} != "armeb"))
+ (${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" || \
+ (${MACHINE_CPUARCH} == "arm" && ${MACHINE_ARCH} != "armeb") || \
+ (${MACHINE_CPUARCH} == "i386"))
_libclang_rt= libclang_rt
.endif
@@ -273,7 +274,7 @@ _libsmb= libsmb
_libsmb= libsmb
.endif
-.if ${MACHINE_CPUARCH} == "arm"
+.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "arm"
_libsmb= libsmb
_libproc= libproc
_librtld_db= librtld_db
diff --git a/lib/csu/aarch64/crt1.c b/lib/csu/aarch64/crt1.c
index de4455e3f98c..be5931765a30 100644
--- a/lib/csu/aarch64/crt1.c
+++ b/lib/csu/aarch64/crt1.c
@@ -51,6 +51,8 @@ extern int eprol;
extern int etext;
#endif
+extern long * _end;
+
void __start(int, char **, char **, void (*)(void));
/* The entry function. */
@@ -79,8 +81,17 @@ __start(int argc, char *argv[], char *env[], void (*cleanup)(void))
if (&_DYNAMIC != NULL)
atexit(cleanup);
- else
+ else {
+ /*
+ * Hack to resolve _end so we read the correct symbol.
+ * Without this it will resolve to the copy in the library
+ * that firsts requests it. We should fix the toolchain,
+ * however this is is needed until this can take place.
+ */
+ *(volatile long *)&_end;
+
_init_tls();
+ }
#ifdef GCRT
atexit(_mcleanup);
diff --git a/lib/libc/aarch64/Symbol.map b/lib/libc/aarch64/Symbol.map
index a0b33da518db..3d8ad2525596 100644
--- a/lib/libc/aarch64/Symbol.map
+++ b/lib/libc/aarch64/Symbol.map
@@ -14,6 +14,9 @@ FBSD_1.0 {
_setjmp;
_longjmp;
fabs;
+ __flt_rounds;
+ fpgetmask;
+ fpsetmask;
setjmp;
longjmp;
sigsetjmp;
@@ -25,6 +28,7 @@ FBSD_1.0 {
FBSDprivate_1.0 {
_set_tp;
+ _end;
curbrk;
minbrk;
};
diff --git a/lib/libc/aarch64/gen/Makefile.inc b/lib/libc/aarch64/gen/Makefile.inc
index c4f7c80a84f7..bb70a36bf6e2 100644
--- a/lib/libc/aarch64/gen/Makefile.inc
+++ b/lib/libc/aarch64/gen/Makefile.inc
@@ -2,6 +2,8 @@
SRCS+= fabs.S \
flt_rounds.c \
+ fpgetmask.c \
+ fpsetmask.c \
ldexp.c \
_setjmp.S \
_set_tp.c \
diff --git a/lib/libc/aarch64/gen/_setjmp.S b/lib/libc/aarch64/gen/_setjmp.S
index 504423bbb9fb..ae00195d3ff7 100644
--- a/lib/libc/aarch64/gen/_setjmp.S
+++ b/lib/libc/aarch64/gen/_setjmp.S
@@ -59,8 +59,8 @@ ENTRY(_setjmp)
/* Return value */
mov x0, #0
ret
-.Lmagic:
.align 3
+.Lmagic:
.quad _JB_MAGIC__SETJMP
END(_setjmp)
diff --git a/lib/libc/aarch64/gen/fpgetmask.c b/lib/libc/aarch64/gen/fpgetmask.c
new file mode 100644
index 000000000000..afc05b479a44
--- /dev/null
+++ b/lib/libc/aarch64/gen/fpgetmask.c
@@ -0,0 +1,47 @@
+/*-
+ * Copyright (c) 2015 The FreeBSD Foundation
+ * All rights reserved.
+ *
+ * This software was developed by Andrew Turner under
+ * sponsorship from the FreeBSD Foundation.
+ *
+ * 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.
+ */
+
+#include
+__FBSDID("$FreeBSD$");
+
+#include
+#include
+
+#define FP_X_MASK (FP_X_INV | FP_X_DZ | FP_X_OFL | FP_X_UFL | FP_X_IMP)
+
+fp_except_t
+fpgetmask(void)
+{
+ uint64_t mask;
+
+ /* Read the current mask */
+ __asm __volatile("mrs %0, fpcr" : "=&r"(mask));
+
+ return (mask & FP_X_MASK);
+}
diff --git a/lib/libc/aarch64/gen/fpsetmask.c b/lib/libc/aarch64/gen/fpsetmask.c
new file mode 100644
index 000000000000..de9ac043b472
--- /dev/null
+++ b/lib/libc/aarch64/gen/fpsetmask.c
@@ -0,0 +1,52 @@
+/*-
+ * Copyright (c) 2015 The FreeBSD Foundation
+ * All rights reserved.
+ *
+ * This software was developed by Andrew Turner under
+ * sponsorship from the FreeBSD Foundation.
+ *
+ * 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.
+ */
+
+#include
+__FBSDID("$FreeBSD$");
+
+#include
+#include
+
+#define FP_X_MASK (FP_X_INV | FP_X_DZ | FP_X_OFL | FP_X_UFL | FP_X_IMP)
+
+fp_except_t
+fpsetmask(fp_except_t mask)
+{
+ uint64_t old, new;
+
+ mask &= FP_X_MASK;
+
+ /* Read the current mask */
+ __asm __volatile("mrs %0, fpcr" : "=&r"(old));
+ new = old & ~FP_X_MASK;
+ new |= mask;
+ __asm __volatile("msr fpcr, %0" :: "r"(new));
+
+ return ((fp_except_t)old);
+}
diff --git a/lib/libc/aarch64/gen/setjmp.S b/lib/libc/aarch64/gen/setjmp.S
index 790ed732a4fa..a30ed6a3082a 100644
--- a/lib/libc/aarch64/gen/setjmp.S
+++ b/lib/libc/aarch64/gen/setjmp.S
@@ -69,8 +69,8 @@ ENTRY(setjmp)
/* Return value */
mov x0, #0
ret
-.Lmagic:
.align 3
+.Lmagic:
.quad _JB_MAGIC_SETJMP
END(setjmp)
diff --git a/lib/libc/aarch64/gen/sigsetjmp.S b/lib/libc/aarch64/gen/sigsetjmp.S
index 8a13c9f005ee..be49f5343871 100644
--- a/lib/libc/aarch64/gen/sigsetjmp.S
+++ b/lib/libc/aarch64/gen/sigsetjmp.S
@@ -47,7 +47,7 @@ ENTRY(siglongjmp)
cmp x2, x3
b.eq _C_LABEL(_longjmp)
b _C_LABEL(longjmp)
-.Lmagic:
.align 3
+.Lmagic:
.quad _JB_MAGIC__SETJMP
END(siglongjmp)
diff --git a/lib/libc/aarch64/sys/brk.S b/lib/libc/aarch64/sys/brk.S
index 09167b60b00b..1e9a2156476f 100644
--- a/lib/libc/aarch64/sys/brk.S
+++ b/lib/libc/aarch64/sys/brk.S
@@ -32,6 +32,8 @@ __FBSDID("$FreeBSD$");
#include "SYS.h"
+ .globl _C_LABEL(_end)
+
.data
.align 3
.globl _C_LABEL(minbrk)
@@ -47,15 +49,8 @@ ENTRY(_brk)
WEAK_REFERENCE(_brk, brk)
/* Load the address of minbrk */
-#ifdef __PIC__
- adrp x2, :got:minbrk
- ldr x3, [x2, #:got_lo12:minbrk]
-#else
- ldr x3, .Lminbrk
-#endif
-
- /* Get the minimum allowable brk address */
- ldr x2, [x3]
+ adrp x3, minbrk
+ ldr x2, [x3, :lo12:minbrk]
/* Validate the address */
cmp x0, x2
@@ -70,24 +65,12 @@ ENTRY(_brk)
_SYSCALL(break)
b.cs cerror
-#ifdef __PIC__
- adrp x2, :got:curbrk
- ldr x3, [x2, #:got_lo12:curbrk]
-#else
- ldr x3, .Lcurbrk
-#endif
-
/* Store the new curbrk value */
- str x4, [x3]
+ adrp x2, curbrk
+ str x4, [x2, :lo12:curbrk]
/* Return success */
mov x0, #0
ret
-#ifndef __PIC__
-.Lcurbrk:
- .quad _C_LABEL(curbrk)
-.Lminbrk:
- .quad _C_LABEL(minbrk)
-#endif
END(_brk)
diff --git a/lib/libc/aarch64/sys/sbrk.S b/lib/libc/aarch64/sys/sbrk.S
index db9d7e1f7bc8..4880cc2a8c9d 100644
--- a/lib/libc/aarch64/sys/sbrk.S
+++ b/lib/libc/aarch64/sys/sbrk.S
@@ -32,6 +32,8 @@ __FBSDID("$FreeBSD$");
#include "SYS.h"
+ .globl _C_LABEL(_end)
+
.data
.align 3
.global _C_LABEL(curbrk)
@@ -47,15 +49,10 @@ ENTRY(_sbrk)
WEAK_REFERENCE(_sbrk, sbrk)
/* Load the address of curbrk */
-#ifdef __PIC__
- adrp x2, :got:curbrk
- ldr x3, [x2, #:got_lo12:curbrk]
-#else
- ldr x3, .Lcurbrk
-#endif
+ adrp x3, curbrk
/* Get the current brk address */
- ldr x2, [x3]
+ ldr x2, [x3, :lo12:curbrk]
/* Calculate the new value */
add x0, x2, x0
@@ -66,14 +63,10 @@ ENTRY(_sbrk)
b.cs cerror
/* Load the old value to return */
- ldr x0, [x3]
+ ldr x0, [x3, :lo12:curbrk]
/* Store the new curbrk value */
- str x4, [x3]
+ str x4, [x3, :lo12:curbrk]
ret
-#ifndef __PIC__
-.Lcurbrk:
- .quad _C_LABEL(curbrk)
-#endif
END(_sbrk)
diff --git a/lib/libc/stdio/Symbol.map b/lib/libc/stdio/Symbol.map
index d2a8c92b2411..a332ab26d3c0 100644
--- a/lib/libc/stdio/Symbol.map
+++ b/lib/libc/stdio/Symbol.map
@@ -162,6 +162,10 @@ FBSD_1.3 {
mkostemps;
};
+FBSD_1.4 {
+ fdclose;
+};
+
FBSDprivate_1.0 {
_flockfile;
_flockfile_debug_stub;
diff --git a/lib/libc/stdio/fclose.3 b/lib/libc/stdio/fclose.3
index 883aa108e7db..596ee3db0e6b 100644
--- a/lib/libc/stdio/fclose.3
+++ b/lib/libc/stdio/fclose.3
@@ -1,5 +1,6 @@
-.\" Copyright (c) 1990, 1991, 1993
-.\" The Regents of the University of California. All rights reserved.
+.\" Copyright (c) 1990, 1991, 1993 The Regents of the University of California.
+.\" Copyright (c) 2015 Mariusz Zaborski
+.\" All rights reserved.
.\"
.\" This code is derived from software contributed to Berkeley by
.\" Chris Torek and the American National Standards Committee X3,
@@ -32,11 +33,12 @@
.\" @(#)fclose.3 8.1 (Berkeley) 6/4/93
.\" $FreeBSD$
.\"
-.Dd April 22, 2006
+.Dd July 4, 2015
.Dt FCLOSE 3
.Os
.Sh NAME
.Nm fclose ,
+.Nm fdclose ,
.Nm fcloseall
.Nd close a stream
.Sh LIBRARY
@@ -45,6 +47,8 @@
.In stdio.h
.Ft int
.Fn fclose "FILE *stream"
+.Ft int
+.Fn fdclose "FILE *stream" "int *fdp"
.Ft void
.Fn fcloseall void
.Sh DESCRIPTION
@@ -59,36 +63,77 @@ first, using
.Xr fflush 3 .
.Pp
The
+.Fn fdclose
+function is equivalent to
+.Fn fclose
+except that it does not close the underlying file descriptor.
+If
+.Fa fdp
+is not
+.Dv NULL ,
+the file descriptor will be written to it.
+If the
+.Fa fdp
+argument will be different then NULL the file descriptor will be returned in it,
+If the stream does not have an associated file descriptor,
+.Fa fdp
+will be set to -1.
+This type of stream is created with functions such as
+.Xr fmemopen 3 ,
+.Xr funopen 3 ,
+or
+.Xr open_memstream 3 .
+.Pp
+The
.Fn fcloseall
function calls
.Fn fclose
on all open streams.
.Sh RETURN VALUES
-Upon successful completion 0 is returned.
+.Fn fcloseall
+does not return a value.
+.Pp
+Upon successful completion the
+.Fn fclose
+and
+.Fn fdclose
+functions return 0.
Otherwise,
.Dv EOF
is returned and the global variable
.Va errno
is set to indicate the error.
-In either case no further access to the stream is possible.
.Sh ERRORS
+.Fn fdclose
+fails if:
+.Bl -tag -width Er
+.It Bq Er EOPNOTSUPP
+The stream does not have an associated file descriptor.
+.El
+.Pp
The
.Fn fclose
-function
-may also fail and set
+and
+.Fn fdclose
+functions may also fail and set
.Va errno
-for any of the errors specified for the routines
-.Xr close 2
-or
+for any of the errors specified for
.Xr fflush 3 .
+.Pp
+The
+.Fn fclose
+function may also fail and set errno for any of the errors specified for
+.Xr close 2 .
.Sh NOTES
The
.Fn fclose
-function
-does not handle NULL arguments; they will result in a segmentation
-violation.
-This is intentional - it makes it easier to make sure programs written
-under
+and
+.Fn fdclose
+functions do not handle NULL arguments in the
+.Fa stream
+variable; this will result in a segmentation violation.
+This is intentional.
+It makes it easier to make sure programs written under
.Fx
are bug free.
This behaviour is an implementation detail, and programs should not
@@ -104,8 +149,13 @@ The
function
conforms to
.St -isoC .
-.Pp
+.Sh HISTORY
The
.Fn fcloseall
function first appeared in
.Fx 7.0 .
+.Pp
+The
+.Fn fdclose
+function first appeared in
+.Fx 11.0 .
diff --git a/lib/libc/stdio/fclose.c b/lib/libc/stdio/fclose.c
index 5ed8b2c548f6..24b9b90af985 100644
--- a/lib/libc/stdio/fclose.c
+++ b/lib/libc/stdio/fclose.c
@@ -1,6 +1,7 @@
/*-
- * Copyright (c) 1990, 1993
- * The Regents of the University of California. All rights reserved.
+ * Copyright (c) 1990, 1993 The Regents of the University of California.
+ * Copyright (c) 2013 Mariusz Zaborski
+ * All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* Chris Torek.
@@ -38,6 +39,7 @@ __FBSDID("$FreeBSD$");
#include "namespace.h"
#include
+#include
#include
#include
#include "un-namespace.h"
@@ -45,19 +47,17 @@ __FBSDID("$FreeBSD$");
#include "libc_private.h"
#include "local.h"
-int
-fclose(FILE *fp)
+static int
+cleanfile(FILE *fp, bool c)
{
int r;
- if (fp->_flags == 0) { /* not open! */
- errno = EBADF;
- return (EOF);
- }
- FLOCKFILE(fp);
r = fp->_flags & __SWR ? __sflush(fp) : 0;
- if (fp->_close != NULL && (*fp->_close)(fp->_cookie) < 0)
- r = EOF;
+ if (c) {
+ if (fp->_close != NULL && (*fp->_close)(fp->_cookie) < 0)
+ r = EOF;
+ }
+
if (fp->_flags & __SMBF)
free((char *)fp->_bf._base);
if (HASUB(fp))
@@ -80,6 +80,59 @@ fclose(FILE *fp)
STDIO_THREAD_LOCK();
fp->_flags = 0; /* Release this FILE for reuse. */
STDIO_THREAD_UNLOCK();
- FUNLOCKFILE(fp);
+
+ return (r);
+}
+
+int
+fdclose(FILE *fp, int *fdp)
+{
+ int r, err;
+
+ if (fdp != NULL)
+ *fdp = -1;
+
+ if (fp->_flags == 0) { /* not open! */
+ errno = EBADF;
+ return (EOF);
+ }
+
+ FLOCKFILE(fp);
+ r = 0;
+ if (fp->_close != __sclose) {
+ r = EOF;
+ errno = EOPNOTSUPP;
+ } else if (fp->_file < 0) {
+ r = EOF;
+ errno = EBADF;
+ }
+ if (r == EOF) {
+ err = errno;
+ (void)cleanfile(fp, true);
+ errno = err;
+ } else {
+ if (fdp != NULL)
+ *fdp = fp->_file;
+ r = cleanfile(fp, false);
+ }
+ FUNLOCKFILE(fp);
+
+ return (r);
+}
+
+int
+fclose(FILE *fp)
+{
+ int r;
+
+ if (fp->_flags == 0) { /* not open! */
+ errno = EBADF;
+ return (EOF);
+ }
+
+ FLOCKFILE(fp);
+ r = cleanfile(fp, true);
+ FUNLOCKFILE(fp);
+
return (r);
}
diff --git a/lib/libc/sys/ptrace.2 b/lib/libc/sys/ptrace.2
index 458ad8dbaf3d..71b432f4e70f 100644
--- a/lib/libc/sys/ptrace.2
+++ b/lib/libc/sys/ptrace.2
@@ -2,7 +2,7 @@
.\" $NetBSD: ptrace.2,v 1.2 1995/02/27 12:35:37 cgd Exp $
.\"
.\" This file is in the public domain.
-.Dd July 22, 2013
+.Dd July 3, 2015
.Dt PTRACE 2
.Os
.Sh NAME
@@ -503,8 +503,163 @@ The
.Fa data
argument is ignored.
.El
+.Sh x86 MACHINE-SPECIFIC REQUESTS
+.Bl -tag -width "Dv PT_GETXSTATE_INFO"
+.It Dv PT_GETXMMREGS
+Copy the XMM FPU state into the buffer pointed to by the
+argument
+.Fa addr .
+The buffer has the same layout as the 32-bit save buffer for the
+machine instruction
+.Dv FXSAVE .
.Pp
-Additionally, machine-specific requests can exist.
+This request is only valid for i386 programs, both on native 32-bit
+systems and on amd64 kernels.
+For 64-bit amd64 programs, the XMM state is reported as part of
+the FPU state returned by the
+.Dv PT_GETFPREGS
+request.
+.Pp
+The
+.Fa data
+argument is ignored.
+.It Dv PT_SETXMMREGS
+Load the XMM FPU state for the thread from the buffer pointed to
+by the argument
+.Fa addr .
+The buffer has the same layout as the 32-bit load buffer for the
+machine instruction
+.Dv FXRSTOR .
+.Pp
+As with
+.Dv PT_GETXMMREGS,
+this request is only valid for i386 programs.
+.Pp
+The
+.Fa data
+argument is ignored.
+.It Dv PT_GETXSTATE_INFO
+Report which XSAVE FPU extensions are supported by the CPU
+and allowed in userspace programs.
+The
+.Fa addr
+argument must point to a variable of type
+.Vt struct ptrace_xstate_info ,
+which contains the information on the request return.
+.Vt struct ptrace_xstate_info
+is defined as follows:
+.Bd -literal
+struct ptrace_xstate_info {
+ uint64_t xsave_mask;
+ uint32_t xsave_len;
+};
+.Ed
+The
+.Dv xsave_mask
+field is a bitmask of the currently enabled extensions.
+The meaning of the bits is defined in the Intel and AMD
+processor documentation.
+The
+.Dv xsave_len
+field reports the length of the XSAVE area for storing the hardware
+state for currently enabled extensions in the format defined by the x86
+.Dv XSAVE
+machine instruction.
+.Pp
+The
+.Fa data
+argument value must be equal to the size of the
+.Vt struct ptrace_xstate_info .
+.It Dv PT_GETXSTATE
+Return the content of the XSAVE area for the thread.
+The
+.Fa addr
+argument points to the buffer where the content is copied, and the
+.Fa data
+argument specifies the size of the buffer.
+The kernel copies out as much content as allowed by the buffer size.
+The buffer layout is specified by the layout of the save area for the
+.Dv XSAVE
+machine instruction.
+.It Dv PT_SETXSTATE
+Load the XSAVE state for the thread from the buffer specified by the
+.Fa addr
+pointer.
+The buffer size is passed in the
+.Fa data
+argument.
+The buffer must be at least as large as the
+.Vt struct savefpu
+(defined in
+.Pa x86/fpu.h )
+to allow the complete x87 FPU and XMM state load.
+It must not be larger than the XSAVE state length, as reported by the
+.Dv xsave_len
+field from the
+.Vt struct ptrace_xstate_info
+of the
+.Dv PT_GETXSTATE_INFO
+request.
+Layout of the buffer is identical to the layout of the load area for the
+.Dv XRSTOR
+machine instruction.
+.It Dv PT_GETFSBASE
+Return the value of the base used when doing segmented
+memory addressing using the %fs segment register.
+The
+.Fa addr
+argument points to an
+.Vt unsigned long
+variable where the base value is stored.
+.Pp
+The
+.Fa data
+argument is ignored.
+.It Dv PT_GETGSBASE
+Like the
+.Dv PT_GETFSBASE
+request, but returns the base for the %gs segment register.
+.It Dv PT_SETFSBASE
+Set the base for the %fs segment register to the value pointed to
+by the
+.Fa addr
+argument.
+.Fa addr
+must point to the
+.Vt unsigned long
+variable containing the new base.
+.Pp
+The
+.Fa data
+argument is ignored.
+.It Dv PT_SETGSBASE
+Like the
+.Dv PT_SETFSBASE
+request, but sets the base for the %gs segment register.
+.El
+.Sh PowerPC MACHINE-SPECIFIC REQUESTS
+.Bl -tag -width "Dv PT_SETVRREGS"
+.It Dv PT_GETVRREGS
+Return the thread's
+.Dv ALTIVEC
+machine state in the buffer pointed to by
+.Fa addr .
+.Pp
+The
+.Fa data
+argument is ignored.
+.It Dv PT_SETVRREGS
+Set the thread's
+.Dv ALTIVEC
+machine state from the buffer pointed to by
+.Fa addr .
+.Pp
+The
+.Fa data
+argument is ignored.
+.El
+.Pp
+Additionally, other machine-specific requests can exist.
.Sh RETURN VALUES
Some requests can cause
.Fn ptrace
@@ -564,6 +719,38 @@ provided to
was less than or equal to zero, or larger than the
.Vt ptrace_lwpinfo
structure known to the kernel.
+.It
+The size (in
+.Fa data )
+provided to the x86-specific
+.Dv PT_GETXSTATE_INFO
+request was not equal to the size of the
+.Vt struct ptrace_xstate_info .
+.It
+The size (in
+.Fa data )
+provided to the x86-specific
+.Dv PT_SETXSTATE
+request was less than the size of the x87 plus the XMM save area.
+.It
+The size (in
+.Fa data )
+provided to the x86-specific
+.Dv PT_SETXSTATE
+request was larger than returned in the
+.Dv xsave_len
+member of the
+.Vt struct ptrace_xstate_info
+from the
+.Dv PT_GETXSTATE_INFO
+request.
+.It
+The base value, provided to the amd64-specific requests
+.Dv PT_SETFSBASE
+or
+.Dv PT_SETGSBASE ,
+pointed outside of the valid user address space.
+This error will not occur in 32-bit programs.
.El
.It Bq Er EBUSY
.Bl -bullet -compact
diff --git a/lib/libcapsicum/libcapsicum.c b/lib/libcapsicum/libcapsicum.c
index 79c570f60e44..8c4d04da157e 100644
--- a/lib/libcapsicum/libcapsicum.c
+++ b/lib/libcapsicum/libcapsicum.c
@@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$");
#include
#include
#include
+#include
#include
#include
@@ -44,7 +45,6 @@ __FBSDID("$FreeBSD$");
#include "libcapsicum.h"
#include "libcapsicum_impl.h"
-#include "nv.h"
/*
* Structure describing communication channel between two separated processes.
diff --git a/lib/libcapsicum/libcapsicum_dns.c b/lib/libcapsicum/libcapsicum_dns.c
index a180b6b3b0ae..5f54283a460c 100644
--- a/lib/libcapsicum/libcapsicum_dns.c
+++ b/lib/libcapsicum/libcapsicum_dns.c
@@ -30,14 +30,14 @@
#include
__FBSDID("$FreeBSD$");
+#include
+
#include
#include
#include
#include
#include
-#include
-
#include "libcapsicum.h"
#include "libcapsicum_dns.h"
diff --git a/lib/libcapsicum/libcapsicum_grp.c b/lib/libcapsicum/libcapsicum_grp.c
index 267ac68c28f2..44d573e77b82 100644
--- a/lib/libcapsicum/libcapsicum_grp.c
+++ b/lib/libcapsicum/libcapsicum_grp.c
@@ -30,6 +30,8 @@
#include
__FBSDID("$FreeBSD$");
+#include
+#include
#include
#include
@@ -39,9 +41,6 @@ __FBSDID("$FreeBSD$");
#include
#include
-#include
-#include
-
#include "libcapsicum.h"
#include "libcapsicum_grp.h"
diff --git a/lib/libcapsicum/libcapsicum_pwd.c b/lib/libcapsicum/libcapsicum_pwd.c
index 32eeeb022462..5b44c3463def 100644
--- a/lib/libcapsicum/libcapsicum_pwd.c
+++ b/lib/libcapsicum/libcapsicum_pwd.c
@@ -31,6 +31,7 @@
__FBSDID("$FreeBSD$");
#include
+#include
#include
#include
@@ -39,8 +40,6 @@ __FBSDID("$FreeBSD$");
#include
#include
-#include
-
#include "libcapsicum.h"
#include "libcapsicum_pwd.h"
diff --git a/lib/libcapsicum/libcapsicum_random.c b/lib/libcapsicum/libcapsicum_random.c
index 2c3eb3635767..2a7b109cd47a 100644
--- a/lib/libcapsicum/libcapsicum_random.c
+++ b/lib/libcapsicum/libcapsicum_random.c
@@ -30,12 +30,12 @@
#include
__FBSDID("$FreeBSD$");
+#include
+
#include
#include
#include
-#include
-
#include "libcapsicum.h"
#include "libcapsicum_random.h"
diff --git a/lib/libcapsicum/libcapsicum_service.c b/lib/libcapsicum/libcapsicum_service.c
index edfde8cc0a43..6b6ceeac08de 100644
--- a/lib/libcapsicum/libcapsicum_service.c
+++ b/lib/libcapsicum/libcapsicum_service.c
@@ -30,12 +30,13 @@
#include
__FBSDID("$FreeBSD$");
+#include
+
#include
#include
#include
#include
-#include
#include "msgio.h"
#include "libcapsicum.h"
diff --git a/lib/libcapsicum/libcapsicum_sysctl.c b/lib/libcapsicum/libcapsicum_sysctl.c
index fc691136cd0b..3f1ccd9116c0 100644
--- a/lib/libcapsicum/libcapsicum_sysctl.c
+++ b/lib/libcapsicum/libcapsicum_sysctl.c
@@ -30,11 +30,11 @@
#include
__FBSDID("$FreeBSD$");
+#include
+
#include
#include
-#include
-
#include "libcapsicum.h"
#include "libcapsicum_sysctl.h"
diff --git a/lib/libcasper/libcasper.c b/lib/libcasper/libcasper.c
index cb95346ec161..e241888aa95e 100644
--- a/lib/libcasper/libcasper.c
+++ b/lib/libcasper/libcasper.c
@@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$");
#include
#include
#include
+#include
#include
#include
@@ -52,7 +53,6 @@ __FBSDID("$FreeBSD$");
#include
#include
#include
-#include
#include
/*
diff --git a/lib/libfetch/http.c b/lib/libfetch/http.c
index e0c297971a36..91ca6a399739 100644
--- a/lib/libfetch/http.c
+++ b/lib/libfetch/http.c
@@ -1330,7 +1330,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 +1339,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];
}
diff --git a/lib/libgpio/gpio.3 b/lib/libgpio/gpio.3
index 70f6b38c0622..6bdf4eacde0c 100644
--- a/lib/libgpio/gpio.3
+++ b/lib/libgpio/gpio.3
@@ -25,7 +25,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd March 8, 2015
+.Dd July 1, 2015
.Dt GPIO 3
.Os
.Sh NAME
@@ -35,6 +35,7 @@
.Sh LIBRARY
.Lb libgpio
.Sh SYNOPSIS
+.In sys/types.h
.In libgpio.h
.Ft "gpio_handle_t"
.Fn gpio_open "unsigned int unit"
@@ -161,13 +162,14 @@ are wrappers around
The following example shows how to configure pin 16 as output and then
drive it high:
.Bd -literal
+#include
#include
#include
gpio_handle_t handle;
handle = gpio_open(0);
-if (handle == GPIO_HANDLE_INVALID)
+if (handle == GPIO_INVALID_HANDLE)
err(1, "gpio_open failed");
gpio_pin_output(handle, 16);
gpio_pin_high(handle, 16);
diff --git a/lib/libipsec/pfkey_dump.c b/lib/libipsec/pfkey_dump.c
index 068ad0e060b0..872aa43ccb71 100644
--- a/lib/libipsec/pfkey_dump.c
+++ b/lib/libipsec/pfkey_dump.c
@@ -187,6 +187,9 @@ static struct val2str str_alg_enc[] = {
#ifdef SADB_X_EALG_AESCTR
{ SADB_X_EALG_AESCTR, "aes-ctr", },
#endif
+#ifdef SADB_X_EALG_AESGCM16
+ { SADB_X_EALG_AESGCM16, "aes-gcm-16", },
+#endif
#ifdef SADB_X_EALG_CAMELLIACBC
{ SADB_X_EALG_CAMELLIACBC, "camellia-cbc", },
#endif
diff --git a/lib/libnv/Makefile b/lib/libnv/Makefile
index 8b2fc7821d7a..38ec009815b7 100644
--- a/lib/libnv/Makefile
+++ b/lib/libnv/Makefile
@@ -7,81 +7,13 @@ SHLIBDIR?= /lib
LIB= nv
SHLIB_MAJOR= 0
-.PATH: ${.CURDIR}/../../sys/kern ${.CURDIR}/../../sys/sys
+.PATH: ${.CURDIR}/../../sys/contrib/libnv ${.CURDIR}/../../sys/sys
CFLAGS+=-I${.CURDIR}/../../sys -I${.CURDIR}
-SRCS= subr_dnvlist.c
+SRCS= dnvlist.c
SRCS+= msgio.c
-SRCS+= subr_nvlist.c
-SRCS+= subr_nvpair.c
-
-INCS= dnv.h
-INCS+= nv.h
-
-MAN+= nv.3
-
-MLINKS+=nv.3 libnv.3 \
- nv.3 nvlist.3
-MLINKS+=nv.3 nvlist_add_binary.3 \
- nv.3 nvlist_add_bool.3 \
- nv.3 nvlist_add_descriptor.3 \
- nv.3 nvlist_add_null.3 \
- nv.3 nvlist_add_number.3 \
- nv.3 nvlist_add_nvlist.3 \
- nv.3 nvlist_add_string.3 \
- nv.3 nvlist_add_stringf.3 \
- nv.3 nvlist_add_stringv.3 \
- nv.3 nvlist_clone.3 \
- nv.3 nvlist_create.3 \
- nv.3 nvlist_destroy.3 \
- nv.3 nvlist_dump.3 \
- nv.3 nvlist_empty.3 \
- nv.3 nvlist_error.3 \
- nv.3 nvlist_exists.3 \
- nv.3 nvlist_exists_binary.3 \
- nv.3 nvlist_exists_bool.3 \
- nv.3 nvlist_exists_descriptor.3 \
- nv.3 nvlist_exists_null.3 \
- nv.3 nvlist_exists_number.3 \
- nv.3 nvlist_exists_nvlist.3 \
- nv.3 nvlist_exists_string.3 \
- nv.3 nvlist_exists_type.3 \
- nv.3 nvlist_fdump.3 \
- nv.3 nvlist_flags.3 \
- nv.3 nvlist_free.3 \
- nv.3 nvlist_free_binary.3 \
- nv.3 nvlist_free_bool.3 \
- nv.3 nvlist_free_descriptor.3 \
- nv.3 nvlist_free_null.3 \
- nv.3 nvlist_free_number.3 \
- nv.3 nvlist_free_nvlist.3 \
- nv.3 nvlist_free_string.3 \
- nv.3 nvlist_free_type.3 \
- nv.3 nvlist_get_binary.3 \
- nv.3 nvlist_get_bool.3 \
- nv.3 nvlist_get_descriptor.3 \
- nv.3 nvlist_get_number.3 \
- nv.3 nvlist_get_nvlist.3 \
- nv.3 nvlist_get_parent.3 \
- nv.3 nvlist_get_string.3 \
- nv.3 nvlist_move_binary.3 \
- nv.3 nvlist_move_descriptor.3 \
- nv.3 nvlist_move_nvlist.3 \
- nv.3 nvlist_move_string.3 \
- nv.3 nvlist_next.3 \
- nv.3 nvlist_pack.3 \
- nv.3 nvlist_recv.3 \
- nv.3 nvlist_send.3 \
- nv.3 nvlist_set_error.3 \
- nv.3 nvlist_size.3 \
- nv.3 nvlist_take_binary.3 \
- nv.3 nvlist_take_bool.3 \
- nv.3 nvlist_take_descriptor.3 \
- nv.3 nvlist_take_number.3 \
- nv.3 nvlist_take_nvlist.3 \
- nv.3 nvlist_take_string.3 \
- nv.3 nvlist_unpack.3 \
- nv.3 nvlist_xfer.3
+SRCS+= nvlist.c
+SRCS+= nvpair.c
WARNS?= 6
diff --git a/lib/libnv/tests/dnv_tests.cc b/lib/libnv/tests/dnv_tests.cc
index 2f92d9d866d9..fe80d00f4851 100644
--- a/lib/libnv/tests/dnv_tests.cc
+++ b/lib/libnv/tests/dnv_tests.cc
@@ -27,9 +27,10 @@
#include
__FBSDID("$FreeBSD$");
+#include
+#include
+
#include
-#include
-#include
ATF_TEST_CASE_WITHOUT_HEAD(dnvlist_get_bool__present);
ATF_TEST_CASE_BODY(dnvlist_get_bool__present)
diff --git a/lib/libnv/tests/nv_tests.cc b/lib/libnv/tests/nv_tests.cc
index d77919078a50..1c65b6664ffd 100644
--- a/lib/libnv/tests/nv_tests.cc
+++ b/lib/libnv/tests/nv_tests.cc
@@ -27,8 +27,9 @@
#include
__FBSDID("$FreeBSD$");
+#include
+
#include
-#include
#include
#include
diff --git a/lib/libnv/tests/nvlist_add_test.c b/lib/libnv/tests/nvlist_add_test.c
index 06bcc639df94..04486f352363 100644
--- a/lib/libnv/tests/nvlist_add_test.c
+++ b/lib/libnv/tests/nvlist_add_test.c
@@ -29,12 +29,12 @@
* $FreeBSD$
*/
+#include
+
#include
#include
#include
-#include
-
static int ntest = 1;
#define CHECK(expr) do { \
diff --git a/lib/libnv/tests/nvlist_exists_test.c b/lib/libnv/tests/nvlist_exists_test.c
index cb595d7b7841..b4596fb6edba 100644
--- a/lib/libnv/tests/nvlist_exists_test.c
+++ b/lib/libnv/tests/nvlist_exists_test.c
@@ -29,11 +29,11 @@
* $FreeBSD$
*/
+#include
+
#include
#include
-#include
-
static int ntest = 1;
#define CHECK(expr) do { \
diff --git a/lib/libnv/tests/nvlist_free_test.c b/lib/libnv/tests/nvlist_free_test.c
index 4417a4464974..74ab785508b7 100644
--- a/lib/libnv/tests/nvlist_free_test.c
+++ b/lib/libnv/tests/nvlist_free_test.c
@@ -29,11 +29,11 @@
* $FreeBSD$
*/
+#include
+
#include
#include
-#include
-
static int ntest = 1;
#define CHECK(expr) do { \
diff --git a/lib/libnv/tests/nvlist_get_test.c b/lib/libnv/tests/nvlist_get_test.c
index b4468db88b11..f67da908831f 100644
--- a/lib/libnv/tests/nvlist_get_test.c
+++ b/lib/libnv/tests/nvlist_get_test.c
@@ -28,6 +28,7 @@
*
* $FreeBSD$
*/
+#include
#include
#include
@@ -35,8 +36,6 @@
#include
#include
-#include
-
static int ntest = 1;
#define CHECK(expr) do { \
diff --git a/lib/libnv/tests/nvlist_move_test.c b/lib/libnv/tests/nvlist_move_test.c
index 760399da2631..7499faac7388 100644
--- a/lib/libnv/tests/nvlist_move_test.c
+++ b/lib/libnv/tests/nvlist_move_test.c
@@ -29,14 +29,14 @@
* $FreeBSD$
*/
+#include
+
#include
#include
#include
#include
#include
-#include
-
static int ntest = 1;
#define CHECK(expr) do { \
diff --git a/lib/libnv/tests/nvlist_send_recv_test.c b/lib/libnv/tests/nvlist_send_recv_test.c
index 50222fbb8e39..f4bc1c4464bc 100644
--- a/lib/libnv/tests/nvlist_send_recv_test.c
+++ b/lib/libnv/tests/nvlist_send_recv_test.c
@@ -32,6 +32,7 @@
#include
#include
#include
+#include
#include
#include
@@ -40,8 +41,6 @@
#include
#include
-#include
-
static int ntest = 1;
#define CHECK(expr) do { \
diff --git a/lib/libproc/proc_bkpt.c b/lib/libproc/proc_bkpt.c
index 1e4a6cc92835..50d8a9d67908 100644
--- a/lib/libproc/proc_bkpt.c
+++ b/lib/libproc/proc_bkpt.c
@@ -42,18 +42,24 @@ __FBSDID("$FreeBSD$");
#include
#include "_libproc.h"
-#if defined(__i386__) || defined(__amd64__)
-#define BREAKPOINT_INSTR 0xcc /* int 0x3 */
+#if defined(__aarch64__)
+#define AARCH64_BRK 0xd4200000
+#define AARCH64_BRK_IMM16_SHIFT 5
+#define AARCH64_BRK_IMM16_VAL (0xd << AARCH64_BRK_IMM16_SHIFT)
+#define BREAKPOINT_INSTR (AARCH64_BRK | AARCH64_BRK_IMM16_VAL)
+#define BREAKPOINT_INSTR_SZ 4
+#elif defined(__amd64__) || defined(__i386__)
+#define BREAKPOINT_INSTR 0xcc /* int 0x3 */
#define BREAKPOINT_INSTR_SZ 1
+#elif defined(__arm__)
+#define BREAKPOINT_INSTR 0xe7ffffff /* bkpt */
+#define BREAKPOINT_INSTR_SZ 4
#elif defined(__mips__)
-#define BREAKPOINT_INSTR 0xd /* break */
+#define BREAKPOINT_INSTR 0xd /* break */
#define BREAKPOINT_INSTR_SZ 4
#elif defined(__powerpc__)
-#define BREAKPOINT_INSTR 0x7fe00008 /* trap */
-#define BREAKPOINT_INSTR_SZ 4
-#elif defined(__arm__)
-#define BREAKPOINT_INSTR 0xe7ffffff /* bkpt */
-#define BREAKPOINT_INSTR_SZ 4
+#define BREAKPOINT_INSTR 0x7fe00008 /* trap */
+#define BREAKPOINT_INSTR_SZ 4
#else
#error "Add support for your architecture"
#endif
diff --git a/lib/libproc/proc_regs.c b/lib/libproc/proc_regs.c
index 35d8d386731e..aae43ba17105 100644
--- a/lib/libproc/proc_regs.c
+++ b/lib/libproc/proc_regs.c
@@ -54,7 +54,9 @@ proc_regget(struct proc_handle *phdl, proc_reg_t reg, unsigned long *regvalue)
return (-1);
switch (reg) {
case REG_PC:
-#if defined(__amd64__)
+#if defined(__aarch64__)
+ *regvalue = regs.elr;
+#elif defined(__amd64__)
*regvalue = regs.r_rip;
#elif defined(__arm__)
*regvalue = regs.r_pc;
@@ -67,7 +69,9 @@ proc_regget(struct proc_handle *phdl, proc_reg_t reg, unsigned long *regvalue)
#endif
break;
case REG_SP:
-#if defined(__amd64__)
+#if defined(__aarch64__)
+ *regvalue = regs.sp;
+#elif defined(__amd64__)
*regvalue = regs.r_rsp;
#elif defined(__arm__)
*regvalue = regs.r_sp;
@@ -101,7 +105,9 @@ proc_regset(struct proc_handle *phdl, proc_reg_t reg, unsigned long regvalue)
return (-1);
switch (reg) {
case REG_PC:
-#if defined(__amd64__)
+#if defined(__aarch64__)
+ regs.elr = regvalue;
+#elif defined(__amd64__)
regs.r_rip = regvalue;
#elif defined(__arm__)
regs.r_pc = regvalue;
@@ -114,7 +120,9 @@ proc_regset(struct proc_handle *phdl, proc_reg_t reg, unsigned long regvalue)
#endif
break;
case REG_SP:
-#if defined(__amd64__)
+#if defined(__aarch64__)
+ regs.sp = regvalue;
+#elif defined(__amd64__)
regs.r_rsp = regvalue;
#elif defined(__arm__)
regs.r_sp = regvalue;
diff --git a/lib/libugidfw/Makefile b/lib/libugidfw/Makefile
index 2e0956575522..f11200d234cb 100644
--- a/lib/libugidfw/Makefile
+++ b/lib/libugidfw/Makefile
@@ -1,7 +1,7 @@
# $FreeBSD$
LIB= ugidfw
-SHLIB_MAJOR= 4
+SHLIB_MAJOR= 5
SRCS= ugidfw.c
INCS= ugidfw.h
diff --git a/lib/libugidfw/ugidfw.c b/lib/libugidfw/ugidfw.c
index 479ab4692248..a1e36d2be853 100644
--- a/lib/libugidfw/ugidfw.c
+++ b/lib/libugidfw/ugidfw.c
@@ -505,7 +505,7 @@ bsde_rule_to_string(struct mac_bsdextended_rule *rule, char *buf, size_t buflen)
return (-1);
}
-int
+static int
bsde_parse_uidrange(char *spec, uid_t *min, uid_t *max,
size_t buflen, char *errstr){
struct passwd *pwd;
@@ -554,7 +554,7 @@ bsde_parse_uidrange(char *spec, uid_t *min, uid_t *max,
return (0);
}
-int
+static int
bsde_parse_gidrange(char *spec, gid_t *min, gid_t *max,
size_t buflen, char *errstr){
struct group *grp;
@@ -603,7 +603,7 @@ bsde_parse_gidrange(char *spec, gid_t *min, gid_t *max,
return (0);
}
-int
+static int
bsde_parse_subject(int argc, char *argv[],
struct mac_bsdextended_subject *subject, size_t buflen, char *errstr)
{
@@ -612,7 +612,7 @@ bsde_parse_subject(int argc, char *argv[],
char *endp;
uid_t uid_min, uid_max;
gid_t gid_min, gid_max;
- int jid;
+ int jid = 0;
size_t len;
long value;
@@ -720,7 +720,7 @@ bsde_parse_subject(int argc, char *argv[],
return (0);
}
-int
+static int
bsde_parse_type(char *spec, int *type, size_t buflen, char *errstr)
{
size_t len;
@@ -764,7 +764,7 @@ bsde_parse_type(char *spec, int *type, size_t buflen, char *errstr)
return (0);
}
-int
+static int
bsde_parse_fsid(char *spec, struct fsid *fsid, size_t buflen, char *errstr)
{
size_t len;
@@ -781,15 +781,15 @@ bsde_parse_fsid(char *spec, struct fsid *fsid, size_t buflen, char *errstr)
return (0);
}
-int
+static int
bsde_parse_object(int argc, char *argv[],
struct mac_bsdextended_object *object, size_t buflen, char *errstr)
{
int not_seen, flags;
int current, neg, nextnot;
+ int type;
uid_t uid_min, uid_max;
gid_t gid_min, gid_max;
- int type;
struct fsid fsid;
size_t len;
@@ -797,6 +797,7 @@ bsde_parse_object(int argc, char *argv[],
flags = 0;
neg = 0;
nextnot = 0;
+ type = 0;
if (strcmp("not", argv[current]) == 0) {
not_seen = 1;
@@ -1101,7 +1102,7 @@ bsde_get_mib(const char *string, int *name, size_t *namelen)
return (0);
}
-int
+static int
bsde_check_version(size_t buflen, char *errstr)
{
size_t len;
diff --git a/lib/libusb/libusb10.c b/lib/libusb/libusb10.c
index e8f931427608..8d42e59ba720 100644
--- a/lib/libusb/libusb10.c
+++ b/lib/libusb/libusb10.c
@@ -1008,7 +1008,6 @@ libusb10_isoc_proxy(struct libusb20_transfer *pxfer)
uint16_t iso_packets;
uint16_t i;
uint8_t status;
- uint8_t flags;
status = libusb20_tr_get_status(pxfer);
sxfer = libusb20_tr_get_priv_sc1(pxfer);
@@ -1016,7 +1015,7 @@ libusb10_isoc_proxy(struct libusb20_transfer *pxfer)
iso_packets = libusb20_tr_get_max_frames(pxfer);
if (sxfer == NULL)
- return; /* cancelled - nothing to do */
+ return; /* cancelled - nothing to do */
uxfer = (struct libusb_transfer *)(
((uint8_t *)sxfer) + sizeof(*sxfer));
@@ -1025,16 +1024,13 @@ libusb10_isoc_proxy(struct libusb20_transfer *pxfer)
iso_packets = uxfer->num_iso_packets;
if (iso_packets == 0)
- return; /* nothing to do */
+ return; /* nothing to do */
/* make sure that the number of ISOCHRONOUS packets is valid */
uxfer->num_iso_packets = iso_packets;
- flags = uxfer->flags;
-
switch (status) {
case LIBUSB20_TRANSFER_COMPLETED:
-
/* update actual length */
uxfer->actual_length = actlen;
for (i = 0; i != iso_packets; i++) {
@@ -1043,9 +1039,7 @@ libusb10_isoc_proxy(struct libusb20_transfer *pxfer)
}
libusb10_complete_transfer(pxfer, sxfer, LIBUSB_TRANSFER_COMPLETED);
break;
-
case LIBUSB20_TRANSFER_START:
-
/* setup length(s) */
actlen = 0;
for (i = 0; i != iso_packets; i++) {
@@ -1064,7 +1058,6 @@ libusb10_isoc_proxy(struct libusb20_transfer *pxfer)
/* fork another USB transfer, if any */
libusb10_submit_transfer_sub(libusb20_tr_get_priv_sc0(pxfer), uxfer->endpoint);
break;
-
default:
libusb10_complete_transfer(pxfer, sxfer, libusb10_convert_error(status));
break;
diff --git a/lib/libusb/libusb20_desc.c b/lib/libusb/libusb20_desc.c
index 22077b61f160..c5cfc9df1056 100644
--- a/lib/libusb/libusb20_desc.c
+++ b/lib/libusb/libusb20_desc.c
@@ -517,9 +517,7 @@ libusb20_me_encode(void *ptr, uint16_t len, const void *pd)
* room for the
* complete structure:
*/
- uint16_t dummy;
-
- dummy = libusb20_me_encode(buf,
+ (void) libusb20_me_encode(buf,
0xFFFF - 3, ps->ptr);
} else {
bcopy(src_ptr, buf, src_len);
@@ -673,7 +671,6 @@ libusb20_me_decode(const void *ptr, uint16_t len, void *pd)
~(LIBUSB20_ME_STRUCT_ALIGN - 1)); /* align */
while (pd_count--) {
uint16_t temp;
- uint16_t dummy;
struct libusb20_me_struct *ps;
ps = LIBUSB20_ADD_BYTES(pd, pd_offset);
@@ -763,7 +760,7 @@ libusb20_me_decode(const void *ptr, uint16_t len, void *pd)
* Recursivly decode
* the next structure
*/
- dummy = libusb20_me_decode(buf,
+ (void) libusb20_me_decode(buf,
temp, ps->ptr);
} else {
/* update type */
diff --git a/lib/libutil/gr_util.c b/lib/libutil/gr_util.c
index b0b0b36f0818..93b3eb2f92fc 100644
--- a/lib/libutil/gr_util.c
+++ b/lib/libutil/gr_util.c
@@ -141,7 +141,7 @@ gr_tmp(int mfd)
errno = ENAMETOOLONG;
return (-1);
}
- if ((tfd = mkstemp(tempname)) == -1)
+ if ((tfd = mkostemp(tempname, O_SYNC)) == -1)
return (-1);
if (mfd != -1) {
while ((nr = read(mfd, buf, sizeof(buf))) > 0)
@@ -318,10 +318,28 @@ gr_copy(int ffd, int tfd, const struct group *gr, struct group *old_gr)
int
gr_mkdb(void)
{
+ int fd;
+
if (chmod(tempname, 0644) != 0)
return (-1);
- return (rename(tempname, group_file));
+ if (rename(tempname, group_file) != 0)
+ return (-1);
+
+ /*
+ * Make sure new group file is safe on disk. To improve performance we
+ * will call fsync() to the directory where file lies
+ */
+ if ((fd = open(group_dir, O_RDONLY|O_DIRECTORY)) == -1)
+ return (-1);
+
+ if (fsync(fd) != 0) {
+ close(fd);
+ return (-1);
+ }
+
+ close(fd);
+ return(0);
}
/*
diff --git a/lib/libutil/pw_util.3 b/lib/libutil/pw_util.3
index 706368fbffed..901135e02b94 100644
--- a/lib/libutil/pw_util.3
+++ b/lib/libutil/pw_util.3
@@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd June 06, 2015
+.Dd July 02, 2015
.Dt PW_UTIL 3
.Os
.Sh NAME
@@ -233,7 +233,8 @@ function returns 0 in case of success and -1 in case of failure.
The
.Fn pw_lock
function locks the master password file.
-It returns 0 in case of success and -1 in case of failure.
+It returns a file descriptor to the master password file on success
+and -1 on failure.
.Pp
The
.Fn pw_scan
diff --git a/lib/libutil/pw_util.c b/lib/libutil/pw_util.c
index befd1fb02d70..af749d5240de 100644
--- a/lib/libutil/pw_util.c
+++ b/lib/libutil/pw_util.c
@@ -226,7 +226,7 @@ pw_tmp(int mfd)
errno = ENAMETOOLONG;
return (-1);
}
- if ((tfd = mkstemp(tempname)) == -1)
+ if ((tfd = mkostemp(tempname, O_SYNC)) == -1)
return (-1);
if (mfd != -1) {
while ((nr = read(mfd, buf, sizeof(buf))) > 0)
diff --git a/lib/libvmmapi/Makefile.depend b/lib/libvmmapi/Makefile.depend
index a5c14b56b0a0..e2942710d8e3 100644
--- a/lib/libvmmapi/Makefile.depend
+++ b/lib/libvmmapi/Makefile.depend
@@ -1,8 +1,6 @@
# $FreeBSD$
# Autogenerated - do NOT edit!
-DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
-
DIRDEPS = \
gnu/lib/csu \
gnu/lib/libgcc \
diff --git a/lib/msun/arm/Makefile.inc b/lib/msun/arm/Makefile.inc
index 09f08d887915..e86997c99081 100644
--- a/lib/msun/arm/Makefile.inc
+++ b/lib/msun/arm/Makefile.inc
@@ -7,6 +7,6 @@ SYM_MAPS += ${.CURDIR}/arm/Symbol.map
ARCH_SRCS = fenv-softfp.c fenv-vfp.c
.endif
-CFLAGS.fenv-vfp.c= -mfloat-abi=softfp
+CFLAGS.fenv-vfp.c= -mfpu=vfp -mfloat-abi=softfp
CFLAGS+= ${CFLAGS.${.IMPSRC:T}}
diff --git a/libexec/casper/dns/dns.c b/libexec/casper/dns/dns.c
index f82801e42ddc..dbdb2a27d83b 100644
--- a/libexec/casper/dns/dns.c
+++ b/libexec/casper/dns/dns.c
@@ -30,6 +30,7 @@
#include
__FBSDID("$FreeBSD$");
+#include
#include
#include
@@ -41,7 +42,6 @@ __FBSDID("$FreeBSD$");
#include
#include
#include
-#include
#include
static bool
diff --git a/libexec/casper/grp/grp.c b/libexec/casper/grp/grp.c
index ab28e1a933d8..5b3e13d9415d 100644
--- a/libexec/casper/grp/grp.c
+++ b/libexec/casper/grp/grp.c
@@ -30,6 +30,8 @@
#include
__FBSDID("$FreeBSD$");
+#include
+
#include
#include
#include
@@ -38,7 +40,6 @@ __FBSDID("$FreeBSD$");
#include
#include
-#include
#include
static bool
diff --git a/libexec/casper/pwd/pwd.c b/libexec/casper/pwd/pwd.c
index be51ad0c2217..0a06c5f6bfd7 100644
--- a/libexec/casper/pwd/pwd.c
+++ b/libexec/casper/pwd/pwd.c
@@ -30,6 +30,8 @@
#include
__FBSDID("$FreeBSD$");
+#include
+
#include
#include
#include
@@ -37,7 +39,6 @@ __FBSDID("$FreeBSD$");
#include
#include
-#include
#include
static bool
diff --git a/libexec/casper/random/random.c b/libexec/casper/random/random.c
index 56f1afbf0354..db91685a0eaa 100644
--- a/libexec/casper/random/random.c
+++ b/libexec/casper/random/random.c
@@ -30,13 +30,14 @@
#include
__FBSDID("$FreeBSD$");
+#include
+
#include
#include
#include
#include
#include
-#include
#include
#define MAXSIZE (1024 * 1024)
diff --git a/libexec/casper/sysctl/sysctl.c b/libexec/casper/sysctl/sysctl.c
index 8bb43b6b8bd1..4cbc505630a7 100644
--- a/libexec/casper/sysctl/sysctl.c
+++ b/libexec/casper/sysctl/sysctl.c
@@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$");
#include
#include
+#include
#include
#include
@@ -40,7 +41,6 @@ __FBSDID("$FreeBSD$");
#include
#include
#include
-#include
#include
static int
diff --git a/libexec/rtld-elf/aarch64/rtld_start.S b/libexec/rtld-elf/aarch64/rtld_start.S
index a5e0df59fd74..2270efcb87d9 100644
--- a/libexec/rtld-elf/aarch64/rtld_start.S
+++ b/libexec/rtld-elf/aarch64/rtld_start.S
@@ -70,6 +70,12 @@ ENTRY(_rtld_bind_start)
stp x6, x7, [sp, #-16]!
stp x8, xzr, [sp, #-16]!
+ /* Save any floating-point arguments */
+ stp q0, q1, [sp, #-32]!
+ stp q2, q3, [sp, #-32]!
+ stp q4, q5, [sp, #-32]!
+ stp q6, q7, [sp, #-32]!
+
/* Calculate reloff */
ldr x2, [x17, #0] /* Get the address of the entry */
sub x1, x2, x16 /* Find its offset */
@@ -85,12 +91,16 @@ ENTRY(_rtld_bind_start)
bl _rtld_bind
/* Restore the registers saved by the plt code */
- ldp xzr, x30, [sp, #(5 * 16)]
+ ldp xzr, x30, [sp, #(5 * 16 + 4 * 32)]
/* Backup the address to branch to */
mov x16, x0
/* restore the arguments */
+ ldp q6, q7, [sp], #32
+ ldp q4, q5, [sp], #32
+ ldp q2, q3, [sp], #32
+ ldp q0, q1, [sp], #32
ldp x8, xzr, [sp], #16
ldp x6, x7, [sp], #16
ldp x4, x5, [sp], #16
diff --git a/release/Makefile.azure b/release/Makefile.azure
index 92ddaf2e7253..12fd3484291e 100644
--- a/release/Makefile.azure
+++ b/release/Makefile.azure
@@ -16,8 +16,8 @@ AZURE${VAR}!= grep -E ^AZURE${VAR} ${AZURE_UPLOAD_CONF} | awk -F' ' '{print $$2}
. endfor
.endif
-.if ${BRANCH} == "STABLE" || ${BRANCH} == "CURRENT"
-SNAPSHOT_DATE!= date +-%Y-%m-%d-%H:%M
+.if ${BRANCH} == "STABLE" || ${BRANCH} == "CURRENT" || ${BRANCH} == "PRERELEASE"
+SNAPSHOT_DATE!= date +-%Y-%m-%d
.endif
AZURE_TARGET:= ${OSRELEASE}${SNAPSHOT_DATE}.vhd
diff --git a/release/Makefile.ec2 b/release/Makefile.ec2
index f4e502575eb4..2695183d90f1 100644
--- a/release/Makefile.ec2
+++ b/release/Makefile.ec2
@@ -5,8 +5,8 @@
# Makefile for creating an EC2 AMI from a disk image.
#
-.if ${BRANCH} == "CURRENT" || ${BRANCH} == "STABLE"
-AMINAMESUFFIX!= date +-%Y-%m-%d-%H:%M
+.if ${BRANCH} == "CURRENT" || ${BRANCH} == "STABLE" || ${BRANCH} == "PRERELEASE"
+AMINAMESUFFIX!= date +-%Y-%m-%d
.endif
.if defined(EC2PUBLIC)
PUBLISH= --public
diff --git a/release/Makefile.gce b/release/Makefile.gce
new file mode 100644
index 000000000000..b6b6577cc7bd
--- /dev/null
+++ b/release/Makefile.gce
@@ -0,0 +1,69 @@
+#
+# $FreeBSD$
+#
+#
+# Makefile for uploading Google Compute Engine disk images.
+#
+
+GCE_IMG?= ${.OBJDIR}/gce.raw
+GCE_UPLOAD_TGTS= gce-check-depends \
+ gce-do-package \
+ gce-do-upload
+# I do not yet have a better way to deal with the "must be run interactively"
+# thing, so this is a fail-safe "do not do anything."
+.if !defined(GCE_LOGIN_SKIP) || empty(GCE_LOGIN_SKIP)
+GCE_UPLOAD_TGTS= gce-do-login
+.endif
+CLEANFILES+= ${GCE_UPLOAD_TGTS}
+
+GCE_BUCKET?=
+
+.if ${BRANCH} == "STABLE" || ${BRANCH} == "CURRENT" || ${BRANCH} == "PRERELEASE"
+SNAPSHOT_DATE!= date +-%Y-%m-%d
+.endif
+
+# Really? Uppercase characters are not allowed? Sigh...
+# And don't even get me started on the '.'.
+GCE_TARGET:= ${OSRELEASE:S,.raw,,:tl:S,.,-,g}${SNAPSHOT_DATE}
+
+gce-upload: ${GCE_UPLOAD_TGTS}
+
+gce-check-depends:
+.for VAR in _BUCKET
+. if !defined(GCE${VAR}) || empty(GCE${VAR})
+ @echo "Variable GCE${VAR} cannot be empty."
+ @false
+. endif
+.endfor
+.if !exists(/usr/local/bin/gcutil)
+. if !exists(${PORTSDIR}/net/google-cloud-sdk/Makefile)
+. if !exists(/usr/local/sbin/pkg-static)
+ env ASSUME_ALWAYS_YES=yes pkg bootstrap -yf
+. endif
+ env ASSUME_ALWAYS_YES=yes pkg install -y net/google-cloud-sdk
+. else
+ make -C ${PORTSDIR}/net/google-cloud-sdk BATCH=1 all install clean
+. endif
+.endif
+
+gce-do-package:
+ @# Yes, really... Sigh.
+ cd ${.OBJDIR} && mv gce.raw disk.raw
+ cd ${.OBJDIR} && tar --format=gnutar -zcf \
+ ${GCE_TARGET:S,${.OBJDIR}/,,}.tar.gz disk.raw
+ cd ${.OBJDIR} && mv disk.raw gce.raw
+ touch ${.OBJDIR}/${.TARGET}
+
+gce-do-login:
+ @echo "This requires human interaction, which is not yet supported."
+ @true
+
+gce-do-upload:
+ @# Fallthrough in case the bucket already exists.
+ /usr/local/bin/gsutil mb gs://${GCE_BUCKET} || true
+ /usr/local/bin/gsutil cp ${.OBJDIR}/${GCE_TARGET}.tar.gz \
+ gs://${GCE_BUCKET}/
+ /usr/local/bin/gcutil addimage ${GCE_TARGET} \
+ gs://${GCE_BUCKET}/${GCE_TARGET}.tar.gz
+ touch ${.OBJDIR}/${.TARGET}
+
diff --git a/release/Makefile.mirrors b/release/Makefile.mirrors
index ed10c5553bbd..d5e8949c3831 100644
--- a/release/Makefile.mirrors
+++ b/release/Makefile.mirrors
@@ -27,7 +27,7 @@ EMBEDDED= 1
.endif
# snapshot
-.if ${BRANCH} == "STABLE" || ${BRANCH} == "CURRENT"
+.if ${BRANCH} == "STABLE" || ${BRANCH} == "CURRENT" || ${BRANCH} == "PRERELEASE"
SNAPSHOT= 1
TLD?= ${FTPDIR}/snapshots
. if !defined(SVNREVISION) || empty(SVNREVISION)
@@ -63,7 +63,7 @@ BOARDNAME:= ${KERNCONF}
. else
OLDNAME:= ${KERNCONF}
. endif
-. if ${BRANCH} == "STABLE" || ${BRANCH} == "CURRENT"
+. if ${BRANCH} == "STABLE" || ${BRANCH} == "CURRENT" || ${BRANCH} == "PRERELEASE"
SNAPSHOT= 1
. endif
IMAGES:= img
diff --git a/release/Makefile.vagrant b/release/Makefile.vagrant
new file mode 100644
index 000000000000..307e21f72745
--- /dev/null
+++ b/release/Makefile.vagrant
@@ -0,0 +1,94 @@
+#
+# $FreeBSD$
+#
+#
+# Makefile for uploading Vagrant boxes to Hashicorp Atlas
+#
+
+VAGRANT_IMG?= ${.OBJDIR}/vagrant.vmdk
+VAGRANT_UPLOAD_TGTS= vagrant-check-depends \
+ atlas-do-upload
+CLEANFILES+= ${VAGRANT_UPLOAD_TGTS}
+
+.if defined(VAGRANT_UPLOAD_CONF) && !empty(VAGRANT_UPLOAD_CONF)
+. for VAR in _KEY _USERNAME
+VAGRANT${VAR}!= grep -E ^VAGRANT${VAR} ${VAGRANT_UPLOAD_CONF} | awk -F' ' '{print $$2}'
+ATLAS${VAR}:= ${VAGRANT${VAR}}
+. endfor
+.endif
+
+.if ${BRANCH} == "STABLE" || ${BRANCH} == "CURRENT" || ${BRANCH} == "PRERELEASE"
+SNAPSHOT_DATE!= date +-%Y-%m-%d
+.endif
+
+VAGRANT_VERSION?= ${REVISION}-${BRANCH}${SNAPSHOT_DATE}
+
+VAGRANT_TARGET:= ${OSRELEASE}${SNAPSHOT_DATE}.box
+VAGRANT_PROVIDERS?= vmware_desktop
+#VAGRANT_PROVIDERS+= virtualbox
+
+vagrant-upload: ${VAGRANT_UPLOAD_TGTS}
+
+vagrant-check-depends:
+.for VAR in _KEY _USERNAME _VERSION
+. if !defined(VAGRANT${VAR}) || empty(VAGRANT${VAR})
+ @echo "Variable VAGRANT${VAR} cannot be empty."
+ @false
+. endif
+.endfor
+.if !exists(/usr/local/bin/curl)
+. if !exists(${PORTSDIR}/ftp/curl/Makefile)
+. if !exists(/usr/local/sbin/pkg-static)
+ env ASSUME_ALWAYS_YES=yes pkg bootstrap -yf
+. endif
+ env ASSUME_ALWAYS_YES=yes pkg install -y curl
+. else
+ make -C ${PORTSDIR}/ftp/curl BATCH=1 all install clean
+. endif
+.endif
+
+vagrant-do-package: cw-vagrant
+
+vagrant-do-package-vmware: vagrant-create-vmware-vmx vagrant-do-package
+ @cd ${.OBJDIR} && echo '{"provider":"vmware_desktop"}' > metadata.json
+ cd ${.OBJDIR} && tar -czf ${VAGRANT_TARGET} metadata.json vagrant.vmx vagrant.vmdk
+ touch ${.OBJDIR}/${.TARGET}
+
+atlas-do-upload: vagrant-do-package-vmware
+.for PROVIDER in ${VAGRANT_PROVIDERS}
+ ${.CURDIR}/scripts/atlas-upload.sh -b FreeBSD-${REVISION}-${BRANCH} -f ${VAGRANT_TARGET} -p ${PROVIDER} -k ${VAGRANT_KEY} -u ${VAGRANT_USERNAME} -v ${VAGRANT_VERSION}
+.endfor
+ touch ${.OBJDIR}/${.TARGET}
+
+vagrant-create-vmware-vmx:
+ @cd ${.OBJDIR} && echo '.encoding = "UTF-8"' > vagrant.vmx
+ @cd ${.OBJDIR} && echo 'bios.bootorder = "hdd,CDROM"' >> vagrant.vmx
+ @cd ${.OBJDIR} && echo 'checkpoint.vmstate = ""' >> vagrant.vmx
+ @cd ${.OBJDIR} && echo 'cleanshutdown = "TRUE"' >> vagrant.vmx
+ @cd ${.OBJDIR} && echo 'config.version = "8"' >> vagrant.vmx
+ @cd ${.OBJDIR} && echo 'displayname = "${VAGRANT_TARGET}"' >> vagrant.vmx
+ @cd ${.OBJDIR} && echo 'ethernet0.addresstype = "generated"' >> vagrant.vmx
+ @cd ${.OBJDIR} && echo 'ethernet0.bsdname = "en0"' >> vagrant.vmx
+ @cd ${.OBJDIR} && echo 'ethernet0.connectiontype = "nat"' >> vagrant.vmx
+ @cd ${.OBJDIR} && echo 'ethernet0.displayname = "Ethernet"' >> vagrant.vmx
+ @cd ${.OBJDIR} && echo 'ethernet0.linkstatepropagation.enable = "FALSE"' >> vagrant.vmx
+ @cd ${.OBJDIR} && echo 'ethernet0.pcislotnumber = "33"' >> vagrant.vmx
+ @cd ${.OBJDIR} && echo 'ethernet0.present = "TRUE"' >> vagrant.vmx
+ @cd ${.OBJDIR} && echo 'ethernet0.virtualdev = "e1000"' >> vagrant.vmx
+ @cd ${.OBJDIR} && echo 'ethernet0.wakeonpcktrcv = "FALSE"' >> vagrant.vmx
+ @cd ${.OBJDIR} && echo 'floppy0.present = "FALSE"' >> vagrant.vmx
+ @cd ${.OBJDIR} && echo 'guestos = "freebsd-64"' >> vagrant.vmx
+ @cd ${.OBJDIR} && echo 'gui.fullscreenatpoweron = "FALSE"' >> vagrant.vmx
+ @cd ${.OBJDIR} && echo 'gui.viewmodeatpoweron = "windowed"' >> vagrant.vmx
+ @cd ${.OBJDIR} && echo 'memsize = "512"' >> vagrant.vmx
+ @cd ${.OBJDIR} && echo 'sound.startconnected = "FALSE"' >> vagrant.vmx
+ @cd ${.OBJDIR} && echo 'softpoweroff = "TRUE"' >> vagrant.vmx
+ @cd ${.OBJDIR} && echo 'scsi0.pcislotnumber = "16"' >> vagrant.vmx
+ @cd ${.OBJDIR} && echo 'scsi0.present = "TRUE"' >> vagrant.vmx
+ @cd ${.OBJDIR} && echo 'scsi0.virtualdev = "lsilogic"' >> vagrant.vmx
+ @cd ${.OBJDIR} && echo 'scsi0:0.filename = "vagrant.vmdk"' >> vagrant.vmx
+ @cd ${.OBJDIR} && echo 'scsi0:0.present = "TRUE"' >> vagrant.vmx
+ @cd ${.OBJDIR} && echo 'tools.synctime = "TRUE"' >> vagrant.vmx
+ @cd ${.OBJDIR} && echo 'usb.present = "FALSE"' >> vagrant.vmx
+ @cd ${.OBJDIR} && echo 'virtualhw.productcompatibility = "hosted"' >> vagrant.vmx
+ @cd ${.OBJDIR} && echo 'virtualhw.version = "9"' >> vagrant.vmx
diff --git a/release/Makefile.vm b/release/Makefile.vm
index ae7c3aa0295c..f6e7831445a7 100644
--- a/release/Makefile.vm
+++ b/release/Makefile.vm
@@ -18,7 +18,8 @@ RAW_DESC= Unformatted raw disk image
CLOUDWARE?= AZURE \
EC2 \
GCE \
- OPENSTACK
+ OPENSTACK \
+ VAGRANT
AZURE_FORMAT= vhdf
AZURE_DESC= Microsoft Azure platform image
AZURE_DISK= ${OSRELEASE}.${AZURE_FORMAT}
@@ -31,6 +32,9 @@ GCE_DISK= disk.${GCE_FORMAT}
OPENSTACK_FORMAT=qcow2
OPENSTACK_DESC= OpenStack platform image
OPENSTACK_DISK= ${OSRELEASE}.${OPENSTACK_FORMAT}
+VAGRANT_FORMAT= vmdk
+VAGRANT_DESC= Vagrant Image
+VAGRANT_DISK= ${OSRELEASE}.${VAGRANT_FORMAT}
.if defined(WITH_CLOUDWARE) && !empty(WITH_CLOUDWARE) && !empty(CLOUDWARE)
. for _CW in ${CLOUDWARE}
@@ -155,3 +159,5 @@ cloudware-install:
.include "${.CURDIR}/Makefile.ec2"
.include "${.CURDIR}/Makefile.azure"
+.include "${.CURDIR}/Makefile.gce"
+.include "${.CURDIR}/Makefile.vagrant"
diff --git a/release/doc/en_US.ISO8859-1/relnotes/article.xml b/release/doc/en_US.ISO8859-1/relnotes/article.xml
index b6ea140e804a..34ed1df48611 100644
--- a/release/doc/en_US.ISO8859-1/relnotes/article.xml
+++ b/release/doc/en_US.ISO8859-1/relnotes/article.xml
@@ -22,7 +22,7 @@
$FreeBSD$
-
+
2015
@@ -220,10 +220,6 @@
to filter by &man.jail.8; ID or name, in followup to the
&man.ps.1; change in r265229.
- The Blowfish &man.crypt.3; default
- format has been changed to
- $2b$.
-
The &man.pmcstat.8; utility has been
updated to include a new flag, -l, which
ends event collection after the specified number of
@@ -345,6 +341,37 @@
would cause final results to be sent to &man.stderr.4; when
receiving the SIGINFO signal has been
fixed.
+
+ The &man.lockstat.1; utility has been
+ updated with several improvements:
+
+
+
+ Spin locks are now reported as the amount of time
+ spinning, instead of loop iterations.
+
+
+
+ Reader locks are now recognized as adaptive that can
+ spin on &os;.
+
+
+
+ Lock aquisition events for successful reader try-lock
+ events are now reported.
+
+
+
+ Spin and block events are now reported before lock
+ acquisition events.
+
+
+
+ The &man.fstyp.8; utility has been
+ updated to be able to detect &man.zfs.8; and &man.geli.8;
+ filesystems.
@@ -417,9 +444,6 @@
The &man.xz.1; utility has been updated
to support multi-threaded compression.
- OpenSSL has
- been updated to version 1.0.1m.
-
The
elftoolchain utilities have been
updated to version 3179.
@@ -430,22 +454,28 @@
The &man.nvi.1; utility has been updated
to version 2.1.3.
- The &man.acpi.4; subsystem has been
- updated to version 20150410.
-
The &man.wpa.supplicant.8; and
&man.hostapd.8; utilities have been updated to version
2.4.
- bmake has
- been updated to version 20150418.
-
The &man.unbound.8; utility has been
updated to version 1.5.3.
The
&man.resolvconf.8; utility has been updated to version
3.7.0.
+
+ bmake has
+ been updated to version 20150606.
+
+ OpenSSL has
+ been updated to version 1.0.1o.
+
+ The &man.acpi.4; subsystem has been
+ updated to version 20150515.
+
+ The &man.file.1; utility has been
+ updated to version 5.23.
@@ -512,6 +542,10 @@
Runtime Libraries and API
+ The Blowfish &man.crypt.3; default
+ format has been changed to
+ $2b$.
+
The &man.readline.3; library is now
statically linked in software within the base system, and the
shared library is no longer installed, allowing the Ports
@@ -569,6 +603,22 @@
Support for file verification in
MAC has been added.
+
+ The
+ libgomp library is now only built when
+ building GCC from the base system. An
+ up-to-date version is available in the Ports Collection as
+ devel/libiomp5-devel.
+
+ The stdlib.h and
+ malloc.h headers have been updated to
+ make use of the gcc
+ alloc_align() attribute.
+
+ The Blowfish &man.crypt.3; library
+ has been updated to support $2y$ hashes.
@@ -675,6 +725,16 @@
arch="powerpc">The &man.pmap.9; implementation for 64-bit
&powerpc; processors has been overhaulded to improve
concurrency.
+
+ A new kernel configuration option,
+ EM_MULTIQUEUE, has been added which enables
+ multi-queue support in the &man.em.4; driver.
+
+
+ Multi-queue support in the &man.em.4; driver is not
+ officially supported by &intel;.
+
@@ -703,6 +763,26 @@
&man.rctl.8; with the GENERIC kernel.
A new kernel configuration option,
RACCT_DISABLED has also been added.
+
+ The
+ GENERIC kernel configuration now includes
+ RACCT and RCTL by
+ default.
+
+
+ To enable RACCT and
+ RCTL on a system using the
+ GENERIC kernel configuration, add
+ kern.racct.enable=1 to
+ &man.loader.conf.5;, and reboot the system.
+
+
+ A new &man.sysctl.8;,
+ net.inet.tcp.hostcache.purgenow, has
+ been added, which when set to 1 during
+ runtime will flush all
+ net.inet.tcp.hostcache entries.
@@ -744,6 +824,10 @@
The drm code has
been updated to match &linux; version 3.8.13.
+
+ Support for the Freescale
+ PCI Root Complex device has been
+ added.
@@ -838,6 +922,10 @@
&man.gre.4; driver has been significantly overhauled, and has
been split into two separate modules, &man.gre.4; and
&man.me.4;.
+
+ The &man.em.4; driver has been updated
+ with improved transmission queue hang detection.
@@ -883,6 +971,13 @@
updated to include AES-ICM and
AES-GCM modes, both of which have also been
added to the &man.aesni.4; driver.
+
+ The &man.ig4.4; driver has been added,
+ providing support for the fourth generation &intel;
+ I2C SMBus.
+
+ The &man.uart.4; driver has been updated to support
+ AMT devices on newer systems.
@@ -938,7 +1033,7 @@
has been added.
The
- HyperV™ drivers have been updated with several
+ Hyper-V™ drivers have been updated with several
enhancements:
@@ -960,6 +1055,10 @@
Support for &man.xen.4; para-virtualized
domU kernels has been removed.
+
+ The
+ &man.hv.netvsc.4; driver has been updated to support checksum
+ offloading and TSO.
@@ -980,6 +1079,17 @@
Initial
support for the ARM AArch64 architecture has been
added.
+
+ Kernel support for Thumb-2
+ userland has been added.
+
+ Support for the hardware power button
+ on the BeagleBone Black system has been added.
+
+ Initial
+ ACPI support has been added for
+ &os;/&arch.arm64;.
@@ -1000,6 +1110,19 @@
The
&man.ctld.8; utility has been updated to allow controlling
non-iSCSI &man.ctl.4; ports.
+
+ The
+ &man.autofs.5; subsystem has been updated to include a new
+ &man.auto.master.5; map, -media, which
+ allows automatically mounting removable media, such as
+ CD drives or USB flash
+ drives.
+
+ The
+ &man.autofs.5; subsystem has been updated to include a new
+ &man.auto.master.5; map, -noauto, which
+ handles &man.fstab.5; entries set to
+ noauto.
@@ -1059,6 +1182,10 @@
loading the kernel. To enable this behavior, add
geom_eli_passphrase_prompt="YES" to
&man.loader.conf.5;.
+
+ The
+ memory test run at boot time on &os;/&arch.amd64; platforms
+ has been disabled by default.
diff --git a/release/doc/share/xml/sponsor.ent b/release/doc/share/xml/sponsor.ent
index 19787a2b32a5..c9810614a9ea 100644
--- a/release/doc/share/xml/sponsor.ent
+++ b/release/doc/share/xml/sponsor.ent
@@ -15,6 +15,8 @@
+
+
diff --git a/release/scripts/atlas-upload.sh b/release/scripts/atlas-upload.sh
new file mode 100755
index 000000000000..63a5ba16b741
--- /dev/null
+++ b/release/scripts/atlas-upload.sh
@@ -0,0 +1,155 @@
+#!/bin/sh
+#-
+# 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.
+#
+# Upload a Vagrant image to Hashicorp's Atlas service
+#
+# $FreeBSD$
+#
+
+ATLAS_API_URL=''
+ATLAS_UPLOAD_URL='https://binstore.hashicorp.com'
+VERSION_DESCRIPTION="FreeBSD Snapshot Build"
+
+usage() {
+ echo "${0} usage:"
+ echo "-b box-name -f box-to-upload -k api-key -p provider -u user -v version"
+ return 1
+}
+
+main () {
+ while getopts "b:f:k:p:u:v:" arg; do
+ case "${arg}" in
+ b)
+ BOX="${OPTARG}"
+ ;;
+ f)
+ FILE="${OPTARG}"
+ ;;
+ k)
+ KEY="${OPTARG}"
+ ;;
+ p)
+ PROVIDER="${OPTARG}"
+ ;;
+ u)
+ USERNAME="${OPTARG}"
+ ;;
+ v)
+ VERSION="${OPTARG}"
+ ;;
+ *)
+ ;;
+ esac
+ done
+
+ if [ -z "${BOX}" -o \
+ -z "${FILE}" -o \
+ -z "${KEY}" -o \
+ -z "${PROVIDER}" -o \
+ -z "${USERNAME}" -o \
+ -z "${VERSION}" ];
+ then
+ usage || exit 0
+ fi
+
+ # Check to see if the box exists or create it
+ BOXRESULT=$(/usr/local/bin/curl -s "https://atlas.hashicorp.com/api/v1/box/${USERNAME}/${BOX}?access_token=${KEY}")
+ if [ $? != 0 ]; then
+ echo "Failed to connect to the API"
+ exit 2;
+ fi
+ echo $BOXRESULT | grep "\"name\":\"${BOX}\"" > /dev/null
+ if [ $? != 0 ]; then
+ echo "Creating box: ${BOX}"
+ /usr/local/bin/curl -s https://atlas.hashicorp.com/api/v1/boxes -X POST -d "box[name]=${BOX}" -d "access_token=${KEY}" > /dev/null
+ /usr/local/bin/curl -s https://atlas.hashicorp.com/api/v1/box/${USERNAME}/${BOX} -X PUT -d "box[is_private]=false" -d "access_token=${KEY}" > /dev/null
+ else
+ echo "Box already exists"
+ fi
+
+ # Check to see if the version exists or create it
+ VERSIONRESULT=$(/usr/local/bin/curl -s "https://atlas.hashicorp.com/api/v1/box/${USERNAME}/${BOX}/version/${VERSION}?access_token=${KEY}")
+ if [ $? != 0 ]; then
+ echo "Failed to connect to the API"
+ exit 2;
+ fi
+ echo $VERSIONRESULT | grep "\"version\":\"${VERSION}\"" > /dev/null
+ if [ $? != 0 ]; then
+ echo "Creating version: ${VERSION}"
+ /usr/local/bin/curl -s https://atlas.hashicorp.com/api/v1/box/${USERNAME}/${BOX}/versions -X POST -d "version[version]=${VERSION}" -d "access_token=${KEY}" > /dev/null
+ /usr/local/bin/curl -s https://atlas.hashicorp.com/api/v1/box/${USERNAME}/${BOX}/version/${VERSION} -X PUT -d "version[description]=${VERSION_DESCRIPTION}" -d "access_token=${KEY}" > /dev/null
+ VERSIONRESULT=$(/usr/local/bin/curl -s "https://atlas.hashicorp.com/api/v1/box/${USERNAME}/${BOX}/version/${VERSION}?access_token=${KEY}")
+ echo $VERSIONRESULT | grep "\"version\":\"${VERSION}\"" > /dev/null
+ if [ $? != 0 ]; then
+ echo "Failed to create version"
+ exit 2
+ fi
+ else
+ echo "Version already exists"
+ fi
+
+ # Check to see if the provider exists or create it
+ PROVIDERRESULT=$(/usr/local/bin/curl -s "https://atlas.hashicorp.com/api/v1/box/${USERNAME}/${BOX}/version/${VERSION}/provider/${PROVIDER}?access_token=${KEY}")
+ if [ $? != 0 ]; then
+ echo "Failed to connect to the API"
+ exit 2;
+ fi
+ echo $PROVIDERRESULT | grep "\"name\":\"${PROVIDER}\"" > /dev/null
+ if [ $? != 0 ]; then
+ echo "Creating provider: ${PROVIDER}"
+ /usr/local/bin/curl -s https://atlas.hashicorp.com/api/v1/box/${USERNAME}/${BOX}/version/${VERSION}/providers -X POST -d "provider[name]=${PROVIDER}" -d "access_token=${KEY}" > /dev/null
+ else
+ echo "Provider already exists"
+ fi
+
+ # Request an upload token
+ TOKENRESULT=$(/usr/local/bin/curl -s "https://atlas.hashicorp.com/api/v1/box/${USERNAME}/${BOX}/version/${VERSION}/provider/${PROVIDER}/upload?access_token=${KEY}")
+ if [ $? != 0 ]; then
+ echo "Failed to get the token from the API"
+ exit 2;
+ fi
+ echo ${TOKENRESULT} | grep "\"token\":" > /dev/null
+ if [ $? != 0 ]; then
+ echo "No token found from the API"
+ exit 2
+ else
+ TOKEN=$(echo $TOKENRESULT | sed -e 's/.*token":"//' -e 's/".*//')
+ echo "Uploading to Atlas"
+ UPLOADRESULT=$(/usr/local/bin/curl -s -X PUT --upload-file ${FILE} ${ATLAS_UPLOAD_URL}/${TOKEN})
+
+ # Validate the Upload
+ echo "Validating"
+ VALIDRESULT=$(/usr/local/bin/curl -s "https://atlas.hashicorp.com/api/v1/box/${USERNAME}/${BOX}/version/${VERSION}/provider/${PROVIDER}?access_token=${KEY}")
+ HOSTED_TOKEN=$(echo $VALIDRESULT | sed -e 's/.*hosted_token":"//' -e 's/".*//')
+ if [ ! -z ${HOSTED_TOKEN} -a ! -z ${TOKEN} -a ${HOSTED_TOKEN} != ${TOKEN} ]; then
+ echo "Upload failed, try again."
+ exit 2
+ fi
+
+ # Release the version
+ echo "Releasing ${VERSION} of ${BOX} in Atlas"
+ /usr/local/bin/curl -s https://atlas.hashicorp.com/api/v1/box/${USERNAME}/${BOX}/version/${VERSION}/release -X PUT -d "access_token=${KEY}" > /dev/null
+ fi
+}
+
+main "$@"
diff --git a/release/tools/ec2.conf b/release/tools/ec2.conf
index 4969ad560a58..9472ec59d89f 100644
--- a/release/tools/ec2.conf
+++ b/release/tools/ec2.conf
@@ -32,7 +32,7 @@ vm_extra_pre_umount() {
# catalogue and install or update pkg when the instance first
# launches, so these files would just be replaced anyway; removing
# them from the image allows it to boot faster.
- pkg -c ${DESTDIR} delete -f -y pkg
+ env ASSUME_ALWAYS_YES=yes pkg -c ${DESTDIR} delete -f -y pkg
rm ${DESTDIR}/var/db/pkg/repo-*.sqlite
# The size of the EC2 root disk can be configured at instance launch
diff --git a/release/tools/gce-package.sh b/release/tools/gce-package.sh
deleted file mode 100755
index 5d8ec3311303..000000000000
--- a/release/tools/gce-package.sh
+++ /dev/null
@@ -1,47 +0,0 @@
-#!/bin/sh
-#
-# $FreeBSD$
-#
-
-# Script to handle packaging cloud images for GCE.
-#
-# XXX:
-# This script only exists to help in automating image creation,
-# and reimplementing this is intended (in other words, this is
-# temporary).
-
-usage() {
- echo "Usage:"
- echo "$(basename ${0}) -D -I -S "
- exit 1
-}
-
-main() {
- while getopts "D:I:W:" opt; do
- case ${opt} in
- D)
- DESTDIR="${OPTARG}"
- ;;
- I)
- INFILE="${OPTARG}"
- ;;
- S)
- WORLDDIR="${OPTARG}"
- ;;
- *)
- usage
- ;;
- esac
- done
- shift $(( ${OPTIND} - 1 ))
-
- if [ -z "${DESTDIR}" -o -z "${INFILE}" -o -z "${WORLDDIR}" ]; then
- usage
- fi
-
- OUTFILE="$(make -C ${WORLDDIR}/release -V OSRELEASE).tar.gz"
-
- cd ${DESTDIR} && tar --format=gnutar -zcf ${OUTFILE} ${INFILE}
-}
-
-main "$@"
diff --git a/release/tools/vagrant.conf b/release/tools/vagrant.conf
new file mode 100644
index 000000000000..7e629caa4549
--- /dev/null
+++ b/release/tools/vagrant.conf
@@ -0,0 +1,81 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+# Packages to install into the image we're creating. This is a deliberately
+# minimalist set, providing only the packages necessary to bootstrap.
+export VM_EXTRA_PACKAGES="firstboot-freebsd-update firstboot-pkgs"
+
+# Set to a list of third-party software to enable in rc.conf(5).
+export VM_RC_LIST="firstboot_freebsd_update firstboot_pkgs"
+
+vm_extra_pre_umount() {
+ # The firstboot_pkgs rc.d script will download the repository
+ # catalogue and install or update pkg when the instance first
+ # launches, so these files would just be replaced anyway; removing
+ # them from the image allows it to boot faster.
+ env ASSUME_ALWAYS_YES=yes pkg -c ${DESTDIR} delete -f -y pkg
+ rm ${DESTDIR}/var/db/pkg/repo-*.sqlite
+
+ # The size of the EC2 root disk can be configured at instance launch
+ # time; expand our filesystem to fill the disk.
+ echo 'growfs_enable="YES"' >> ${DESTDIR}/etc/rc.conf
+
+ # Vagrant instances use DHCP to get their network configuration.
+ echo 'ifconfig_DEFAULT="SYNCDHCP"' >> ${DESTDIR}/etc/rc.conf
+
+ # Enable sshd by default
+ echo 'sshd_enable="YES"' >> ${DESTDIR}/etc/rc.conf
+ # Disable DNS lookups by default to make SSH connect quickly
+ echo 'UseDNS no' >> ${DESTDIR}/etc/ssh/sshd_config
+
+ # Disable sendmail
+ echo 'sendmail_enable="NO"' >> ${DESTDIR}/etc/rc.conf
+ echo 'sendmail_submit_enable="NO"' >> ${DESTDIR}/etc/rc.conf
+ echo 'sendmail_outbound_enable="NO"' >> ${DESTDIR}/etc/rc.conf
+ echo 'sendmail_msp_queue_enable="NO"' >> ${DESTDIR}/etc/rc.conf
+
+ # sudo is required
+ echo 'firstboot_pkgs_list="sudo rsync"' >> ${DESTDIR}/etc/rc.conf
+
+ # Create the vagrant user with a password of vagrant
+ /usr/sbin/pw -R ${DESTDIR} \
+ groupadd vagrant -g 1001
+ chroot ${DESTDIR} mkdir -p /home/vagrant
+ /usr/sbin/pw -R ${DESTDIR} \
+ useradd vagrant \
+ -m -M 0755 -w yes -n vagrant -u 1001 -g 1001 -G 0 \
+ -c 'Vagrant User' -d '/home/vagrant' -s '/bin/csh'
+
+ # Change root's password to vagrant
+ echo 'vagrant' | /usr/sbin/pw -R ${DESTDIR} \
+ usermod root -h 0
+
+ # Configure sudo to allow the vagrant user
+ echo 'vagrant ALL=(ALL) NOPASSWD: ALL' >> ${DESTDIR}/usr/local/etc/sudoers
+
+ # Configure the vagrant ssh key
+ mkdir ${DESTDIR}/home/vagrant/.ssh
+ chmod 700 ${DESTDIR}/home/vagrant/.ssh
+ echo "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzIw+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9HZyN1Q9qgCgzUFtdOKLv6IedplqoPkcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8HfdOV0IAdx4O7PtixWKn5y2hMNG0zQPyUecp4pzC6kivAIhyfHilFR61RGL+GPXQ2MWZWFYbAGjyiYJnAmCP3NOTd0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPKcF96hrucXzcWyLbIbEgE98OHlnVYCzRdK8jlqm8tehUc9c9WhQ== vagrant insecure public key" > ${DESTDIR}/home/vagrant/.ssh/authorized_keys
+ chown -R 1001 ${DESTDIR}/home/vagrant/.ssh
+ chmod 600 ${DESTDIR}/home/vagrant/.ssh/authorized_keys
+
+ # Reboot quickly, Don't wait at the panic screen
+ echo 'debug.trace_on_panic=1' >> ${DESTDIR}/etc/sysctl.conf
+ echo 'debug.debugger_on_panic=0' >> ${DESTDIR}/etc/sysctl.conf
+ echo 'kern.panic_reboot_wait_time=0' >> ${DESTDIR}/etc/sysctl.conf
+
+ # The console is not interactive, so we might as well boot quickly.
+ echo 'autoboot_delay="-1"' >> ${DESTDIR}/boot/loader.conf
+
+ # The first time the VM boots, the installed "first boot" scripts
+ # should be allowed to run:
+ # * growfs (expand the filesystem to fill the provided disk)
+ # * firstboot_freebsd_update (install critical updates)
+ # * firstboot_pkgs (install packages)
+ touch ${DESTDIR}/firstboot
+
+ return 0
+}
diff --git a/sbin/camcontrol/camcontrol.c b/sbin/camcontrol/camcontrol.c
index 45826e7966a4..fefb6952d9b8 100644
--- a/sbin/camcontrol/camcontrol.c
+++ b/sbin/camcontrol/camcontrol.c
@@ -8058,7 +8058,7 @@ usage(int printlong)
fprintf(printlong ? stdout : stderr,
"usage: camcontrol [device id][generic args][command args]\n"
-" camcontrol devlist [-v]\n"
+" camcontrol devlist [-b] [-v]\n"
#ifndef MINIMALISTIC
" camcontrol periphlist [dev_id][-n dev_name] [-u unit]\n"
" camcontrol tur [dev_id][generic args]\n"
diff --git a/sbin/casperd/casperd.c b/sbin/casperd/casperd.c
index f83881107de7..e9a4a94a8f36 100644
--- a/sbin/casperd/casperd.c
+++ b/sbin/casperd/casperd.c
@@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$");
#include
#include
#include
+#include
#include
#include
@@ -56,7 +57,6 @@ __FBSDID("$FreeBSD$");
#include
#include
#include
-#include
#include
#include "msgio.h"
@@ -253,7 +253,7 @@ casper_command(const char *cmd, const nvlist_t *limits, nvlist_t *nvlin,
return (error);
}
- if (zygote_clone(service_external_execute, 0, &chanfd, &procfd) == -1) {
+ if (zygote_clone(service_external_execute, &chanfd, &procfd) == -1) {
error = errno;
close(execfd);
return (error);
diff --git a/sbin/casperd/zygote.c b/sbin/casperd/zygote.c
index c460bd322b92..5bc9396a5afc 100644
--- a/sbin/casperd/zygote.c
+++ b/sbin/casperd/zygote.c
@@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$");
#include
#include
#include
+#include
#include
#include
@@ -46,7 +47,6 @@ __FBSDID("$FreeBSD$");
#include
#include
-#include
#include
#include "zygote.h"
@@ -77,7 +77,7 @@ stdnull(void)
}
int
-zygote_clone(zygote_func_t *func, int flags, int *chanfdp, int *procfdp)
+zygote_clone(zygote_func_t *func, int *chanfdp, int *procfdp)
{
nvlist_t *nvl;
int error;
@@ -90,7 +90,6 @@ zygote_clone(zygote_func_t *func, int flags, int *chanfdp, int *procfdp)
nvl = nvlist_create(0);
nvlist_add_number(nvl, "func", (uint64_t)(uintptr_t)func);
- nvlist_add_number(nvl, "flags", (uint64_t)flags);
nvl = nvlist_xfer(zygote_sock, nvl, 0);
if (nvl == NULL)
return (-1);
@@ -117,7 +116,7 @@ zygote_clone(zygote_func_t *func, int flags, int *chanfdp, int *procfdp)
static void
zygote_main(int sock)
{
- int error, fd, flags, procfd;
+ int error, fd, procfd;
int chanfd[2];
nvlist_t *nvlin, *nvlout;
zygote_func_t *func;
@@ -144,7 +143,6 @@ zygote_main(int sock)
}
func = (zygote_func_t *)(uintptr_t)nvlist_get_number(nvlin,
"func");
- flags = (int)nvlist_get_number(nvlin, "flags");
nvlist_destroy(nvlin);
/*
diff --git a/sbin/casperd/zygote.h b/sbin/casperd/zygote.h
index 75ef2efda486..4c9c7717fec1 100644
--- a/sbin/casperd/zygote.h
+++ b/sbin/casperd/zygote.h
@@ -35,6 +35,6 @@
typedef void zygote_func_t(int);
int zygote_init(void);
-int zygote_clone(zygote_func_t *func, int flags, int *chanfdp, int *procfdp);
+int zygote_clone(zygote_func_t *func, int *chanfdp, int *procfdp);
#endif /* !_ZYGOTE_H_ */
diff --git a/sbin/geom/class/eli/geli.8 b/sbin/geom/class/eli/geli.8
index c435859ea024..aac307f65d8e 100644
--- a/sbin/geom/class/eli/geli.8
+++ b/sbin/geom/class/eli/geli.8
@@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd June 18, 2014
+.Dd June 2, 2015
.Dt GELI 8
.Os
.Sh NAME
@@ -893,6 +893,13 @@ geli_da1s3a_keyfile0_type="da1s3a:geli_keyfile0"
geli_da1s3a_keyfile0_name="/boot/keys/da1s3a.key"
.Ed
.Pp
+If there is only one keyfile, the index might be omitted:
+.Bd -literal -offset indent
+geli_da1s3a_keyfile_load="YES"
+geli_da1s3a_keyfile_type="da1s3a:geli_keyfile"
+geli_da1s3a_keyfile_name="/boot/keys/da1s3a.key"
+.Ed
+.Pp
Not only configure encryption, but also data integrity verification using
.Nm HMAC/SHA256 .
.Bd -literal -offset indent
diff --git a/sbin/newfs_nandfs/newfs_nandfs.c b/sbin/newfs_nandfs/newfs_nandfs.c
index fda2b9ed01ef..3990dbbba8fd 100644
--- a/sbin/newfs_nandfs/newfs_nandfs.c
+++ b/sbin/newfs_nandfs/newfs_nandfs.c
@@ -897,7 +897,7 @@ check_parameters(void)
NANDFS_SEG_MIN_BLOCKS);
/* check reserved segment percentage */
- if ((rsv_segment_percent < 1) && (rsv_segment_percent > 99))
+ if ((rsv_segment_percent < 1) || (rsv_segment_percent > 99))
errx(1, "Bad reserved segment percentage. "
"Must in range 1..99.");
diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y
index aebf8a7d0931..d352c313fbe1 100644
--- a/sbin/pfctl/parse.y
+++ b/sbin/pfctl/parse.y
@@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$");
#include
#include
#include
+#include
#include
#include
@@ -300,6 +301,7 @@ struct pool_opts {
struct node_hfsc_opts hfsc_opts;
+struct node_fairq_opts fairq_opts;
struct node_state_opt *keep_state_defaults = NULL;
int disallow_table(struct node_host *, const char *);
@@ -422,6 +424,7 @@ typedef struct {
struct table_opts table_opts;
struct pool_opts pool_opts;
struct node_hfsc_opts hfsc_opts;
+ struct node_fairq_opts fairq_opts;
} v;
int lineno;
} YYSTYPE;
@@ -446,8 +449,8 @@ int parseport(char *, struct range *r, int);
%token REQUIREORDER SYNPROXY FINGERPRINTS NOSYNC DEBUG SKIP HOSTID
%token ANTISPOOF FOR INCLUDE
%token BITMASK RANDOM SOURCEHASH ROUNDROBIN STATICPORT PROBABILITY
-%token ALTQ CBQ PRIQ HFSC BANDWIDTH TBRSIZE LINKSHARE REALTIME UPPERLIMIT
-%token QUEUE PRIORITY QLIMIT RTABLE
+%token ALTQ CBQ PRIQ HFSC FAIRQ BANDWIDTH TBRSIZE LINKSHARE REALTIME UPPERLIMIT
+%token QUEUE PRIORITY QLIMIT HOGS BUCKETS RTABLE
%token LOAD RULESET_OPTIMIZATION
%token STICKYADDRESS MAXSRCSTATES MAXSRCNODES SOURCETRACK GLOBAL RULE
%token MAXSRCCONN MAXSRCCONNRATE OVERLOAD FLUSH SLOPPY
@@ -495,6 +498,7 @@ int parseport(char *, struct range *r, int);
%type cbqflags_list cbqflags_item
%type priqflags_list priqflags_item
%type hfscopts_list hfscopts_item hfsc_opts
+%type fairqopts_list fairqopts_item fairq_opts
%type bandwidth
%type filter_opts filter_opt filter_opts_l
%type antispoof_opts antispoof_opt antispoof_opts_l
@@ -1659,6 +1663,15 @@ scheduler : CBQ {
$$.qtype = ALTQT_HFSC;
$$.data.hfsc_opts = $3;
}
+ | FAIRQ {
+ $$.qtype = ALTQT_FAIRQ;
+ bzero(&$$.data.fairq_opts,
+ sizeof(struct node_fairq_opts));
+ }
+ | FAIRQ '(' fairq_opts ')' {
+ $$.qtype = ALTQT_FAIRQ;
+ $$.data.fairq_opts = $3;
+ }
;
cbqflags_list : cbqflags_item { $$ |= $1; }
@@ -1807,6 +1820,61 @@ hfscopts_item : LINKSHARE bandwidth {
}
;
+fairq_opts : {
+ bzero(&fairq_opts,
+ sizeof(struct node_fairq_opts));
+ }
+ fairqopts_list {
+ $$ = fairq_opts;
+ }
+ ;
+
+fairqopts_list : fairqopts_item
+ | fairqopts_list comma fairqopts_item
+ ;
+
+fairqopts_item : LINKSHARE bandwidth {
+ if (fairq_opts.linkshare.used) {
+ yyerror("linkshare already specified");
+ YYERROR;
+ }
+ fairq_opts.linkshare.m2 = $2;
+ fairq_opts.linkshare.used = 1;
+ }
+ | LINKSHARE '(' bandwidth number bandwidth ')' {
+ if (fairq_opts.linkshare.used) {
+ yyerror("linkshare already specified");
+ YYERROR;
+ }
+ fairq_opts.linkshare.m1 = $3;
+ fairq_opts.linkshare.d = $4;
+ fairq_opts.linkshare.m2 = $5;
+ fairq_opts.linkshare.used = 1;
+ }
+ | HOGS bandwidth {
+ fairq_opts.hogs_bw = $2;
+ }
+ | BUCKETS number {
+ fairq_opts.nbuckets = $2;
+ }
+ | STRING {
+ if (!strcmp($1, "default"))
+ fairq_opts.flags |= FARF_DEFAULTCLASS;
+ else if (!strcmp($1, "red"))
+ fairq_opts.flags |= FARF_RED;
+ else if (!strcmp($1, "ecn"))
+ fairq_opts.flags |= FARF_RED|FARF_ECN;
+ else if (!strcmp($1, "rio"))
+ fairq_opts.flags |= FARF_RIO;
+ else {
+ yyerror("unknown fairq flag \"%s\"", $1);
+ free($1);
+ YYERROR;
+ }
+ free($1);
+ }
+ ;
+
qassign : /* empty */ { $$ = NULL; }
| qassign_item { $$ = $1; }
| '{' optnl qassign_list '}' { $$ = $3; }
@@ -5226,6 +5294,7 @@ lookup(char *s)
{ "bitmask", BITMASK},
{ "block", BLOCK},
{ "block-policy", BLOCKPOLICY},
+ { "buckets", BUCKETS},
{ "cbq", CBQ},
{ "code", CODE},
{ "crop", FRAGCROP},
@@ -5235,6 +5304,7 @@ lookup(char *s)
{ "drop", DROP},
{ "drop-ovl", FRAGDROP},
{ "dup-to", DUPTO},
+ { "fairq", FAIRQ},
{ "fastroute", FASTROUTE},
{ "file", FILENAME},
{ "fingerprints", FINGERPRINTS},
@@ -5247,6 +5317,7 @@ lookup(char *s)
{ "global", GLOBAL},
{ "group", GROUP},
{ "hfsc", HFSC},
+ { "hogs", HOGS},
{ "hostid", HOSTID},
{ "icmp-type", ICMPTYPE},
{ "icmp6-type", ICMP6TYPE},
diff --git a/sbin/pfctl/pfctl_altq.c b/sbin/pfctl/pfctl_altq.c
index 64f474ce0501..2b523fc3eaf0 100644
--- a/sbin/pfctl/pfctl_altq.c
+++ b/sbin/pfctl/pfctl_altq.c
@@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$");
#include
#include
#include
+#include
#include "pfctl_parser.h"
#include "pfctl.h"
@@ -68,6 +69,11 @@ static int check_commit_hfsc(int, int, struct pf_altq *);
static int print_hfsc_opts(const struct pf_altq *,
const struct node_queue_opt *);
+static int eval_pfqueue_fairq(struct pfctl *, struct pf_altq *);
+static int print_fairq_opts(const struct pf_altq *,
+ const struct node_queue_opt *);
+static int check_commit_fairq(int, int, struct pf_altq *);
+
static void gsc_add_sc(struct gen_sc *, struct service_curve *);
static int is_gsc_under_sc(struct gen_sc *,
struct service_curve *);
@@ -88,6 +94,8 @@ int eval_queue_opts(struct pf_altq *, struct node_queue_opt *,
u_int32_t eval_bwspec(struct node_queue_bw *, u_int32_t);
void print_hfsc_sc(const char *, u_int, u_int, u_int,
const struct node_hfsc_sc *);
+void print_fairq_sc(const char *, u_int, u_int, u_int,
+ const struct node_fairq_sc *);
void
pfaltq_store(struct pf_altq *a)
@@ -173,6 +181,10 @@ print_altq(const struct pf_altq *a, unsigned int level,
if (!print_hfsc_opts(a, qopts))
printf("hfsc ");
break;
+ case ALTQT_FAIRQ:
+ if (!print_fairq_opts(a, qopts))
+ printf("fairq ");
+ break;
}
if (bw != NULL && bw->bw_percent > 0) {
@@ -203,7 +215,8 @@ print_queue(const struct pf_altq *a, unsigned int level,
printf("%s ", a->qname);
if (print_interface)
printf("on %s ", a->ifname);
- if (a->scheduler == ALTQT_CBQ || a->scheduler == ALTQT_HFSC) {
+ if (a->scheduler == ALTQT_CBQ || a->scheduler == ALTQT_HFSC ||
+ a->scheduler == ALTQT_FAIRQ) {
if (bw != NULL && bw->bw_percent > 0) {
if (bw->bw_percent < 100)
printf("bandwidth %u%% ", bw->bw_percent);
@@ -224,6 +237,9 @@ print_queue(const struct pf_altq *a, unsigned int level,
case ALTQT_HFSC:
print_hfsc_opts(a, qopts);
break;
+ case ALTQT_FAIRQ:
+ print_fairq_opts(a, qopts);
+ break;
}
}
@@ -294,6 +310,9 @@ check_commit_altq(int dev, int opts)
case ALTQT_HFSC:
error = check_commit_hfsc(dev, opts, altq);
break;
+ case ALTQT_FAIRQ:
+ error = check_commit_fairq(dev, opts, altq);
+ break;
default:
break;
}
@@ -342,7 +361,8 @@ eval_pfqueue(struct pfctl *pf, struct pf_altq *pa, struct node_queue_bw *bw,
if (pa->qlimit == 0)
pa->qlimit = DEFAULT_QLIMIT;
- if (pa->scheduler == ALTQT_CBQ || pa->scheduler == ALTQT_HFSC) {
+ if (pa->scheduler == ALTQT_CBQ || pa->scheduler == ALTQT_HFSC ||
+ pa->scheduler == ALTQT_FAIRQ) {
pa->bandwidth = eval_bwspec(bw,
parent == NULL ? 0 : parent->bandwidth);
@@ -388,6 +408,9 @@ eval_pfqueue(struct pfctl *pf, struct pf_altq *pa, struct node_queue_bw *bw,
case ALTQT_HFSC:
error = eval_pfqueue_hfsc(pf, pa);
break;
+ case ALTQT_FAIRQ:
+ error = eval_pfqueue_fairq(pf, pa);
+ break;
default:
break;
}
@@ -807,6 +830,85 @@ eval_pfqueue_hfsc(struct pfctl *pf, struct pf_altq *pa)
return (-1);
}
+/*
+ * FAIRQ support functions
+ */
+static int
+eval_pfqueue_fairq(struct pfctl *pf __unused, struct pf_altq *pa)
+{
+ struct pf_altq *altq, *parent;
+ struct fairq_opts *opts;
+ struct service_curve sc;
+
+ opts = &pa->pq_u.fairq_opts;
+
+ if (pa->parent[0] == 0) {
+ /* root queue */
+ opts->lssc_m1 = pa->ifbandwidth;
+ opts->lssc_m2 = pa->ifbandwidth;
+ opts->lssc_d = 0;
+ return (0);
+ }
+
+ LIST_INIT(&lssc);
+
+ /* if link_share is not specified, use bandwidth */
+ if (opts->lssc_m2 == 0)
+ opts->lssc_m2 = pa->bandwidth;
+
+ /*
+ * admission control:
+ * for the real-time service curve, the sum of the service curves
+ * should not exceed 80% of the interface bandwidth. 20% is reserved
+ * not to over-commit the actual interface bandwidth.
+ * for the link-sharing service curve, the sum of the child service
+ * curve should not exceed the parent service curve.
+ * for the upper-limit service curve, the assigned bandwidth should
+ * be smaller than the interface bandwidth, and the upper-limit should
+ * be larger than the real-time service curve when both are defined.
+ */
+ parent = qname_to_pfaltq(pa->parent, pa->ifname);
+ if (parent == NULL)
+ errx(1, "parent %s not found for %s", pa->parent, pa->qname);
+
+ TAILQ_FOREACH(altq, &altqs, entries) {
+ if (strncmp(altq->ifname, pa->ifname, IFNAMSIZ) != 0)
+ continue;
+ if (altq->qname[0] == 0) /* this is for interface */
+ continue;
+
+ if (strncmp(altq->parent, pa->parent, PF_QNAME_SIZE) != 0)
+ continue;
+
+ /* if the class has a link-sharing service curve, add it. */
+ if (opts->lssc_m2 != 0 && altq->pq_u.fairq_opts.lssc_m2 != 0) {
+ sc.m1 = altq->pq_u.fairq_opts.lssc_m1;
+ sc.d = altq->pq_u.fairq_opts.lssc_d;
+ sc.m2 = altq->pq_u.fairq_opts.lssc_m2;
+ gsc_add_sc(&lssc, &sc);
+ }
+ }
+
+ /* check the link-sharing service curve. */
+ if (opts->lssc_m2 != 0) {
+ sc.m1 = parent->pq_u.fairq_opts.lssc_m1;
+ sc.d = parent->pq_u.fairq_opts.lssc_d;
+ sc.m2 = parent->pq_u.fairq_opts.lssc_m2;
+ if (!is_gsc_under_sc(&lssc, &sc)) {
+ warnx("link-sharing sc exceeds parent's sc");
+ goto err_ret;
+ }
+ }
+
+ gsc_destroy(&lssc);
+
+ return (0);
+
+err_ret:
+ gsc_destroy(&lssc);
+ return (-1);
+}
+
static int
check_commit_hfsc(int dev, int opts, struct pf_altq *pa)
{
@@ -846,6 +948,43 @@ check_commit_hfsc(int dev, int opts, struct pf_altq *pa)
return (error);
}
+static int
+check_commit_fairq(int dev __unused, int opts __unused, struct pf_altq *pa)
+{
+ struct pf_altq *altq, *def = NULL;
+ int default_class;
+ int error = 0;
+
+ /* check if fairq has one default queue for this interface */
+ default_class = 0;
+ TAILQ_FOREACH(altq, &altqs, entries) {
+ if (strncmp(altq->ifname, pa->ifname, IFNAMSIZ) != 0)
+ continue;
+ if (altq->qname[0] == 0) /* this is for interface */
+ continue;
+ if (altq->pq_u.fairq_opts.flags & FARF_DEFAULTCLASS) {
+ default_class++;
+ def = altq;
+ }
+ }
+ if (default_class != 1) {
+ warnx("should have one default queue on %s", pa->ifname);
+ return (1);
+ }
+ /* make sure the default queue is a leaf */
+ TAILQ_FOREACH(altq, &altqs, entries) {
+ if (strncmp(altq->ifname, pa->ifname, IFNAMSIZ) != 0)
+ continue;
+ if (altq->qname[0] == 0) /* this is for interface */
+ continue;
+ if (strncmp(altq->parent, def->qname, PF_QNAME_SIZE) == 0) {
+ warnx("default queue is not a leaf");
+ error++;
+ }
+ }
+ return (error);
+}
+
static int
print_hfsc_opts(const struct pf_altq *a, const struct node_queue_opt *qopts)
{
@@ -892,6 +1031,43 @@ print_hfsc_opts(const struct pf_altq *a, const struct node_queue_opt *qopts)
return (0);
}
+static int
+print_fairq_opts(const struct pf_altq *a, const struct node_queue_opt *qopts)
+{
+ const struct fairq_opts *opts;
+ const struct node_fairq_sc *loc_lssc;
+
+ opts = &a->pq_u.fairq_opts;
+ if (qopts == NULL)
+ loc_lssc = NULL;
+ else
+ loc_lssc = &qopts->data.fairq_opts.linkshare;
+
+ if (opts->flags ||
+ (opts->lssc_m2 != 0 && (opts->lssc_m2 != a->bandwidth ||
+ opts->lssc_d != 0))) {
+ printf("fairq(");
+ if (opts->flags & FARF_RED)
+ printf(" red");
+ if (opts->flags & FARF_ECN)
+ printf(" ecn");
+ if (opts->flags & FARF_RIO)
+ printf(" rio");
+ if (opts->flags & FARF_CLEARDSCP)
+ printf(" cleardscp");
+ if (opts->flags & FARF_DEFAULTCLASS)
+ printf(" default");
+ if (opts->lssc_m2 != 0 && (opts->lssc_m2 != a->bandwidth ||
+ opts->lssc_d != 0))
+ print_fairq_sc("linkshare", opts->lssc_m1, opts->lssc_d,
+ opts->lssc_m2, loc_lssc);
+ printf(" ) ");
+
+ return (1);
+ } else
+ return (0);
+}
+
/*
* admission control using generalized service curve
*/
@@ -1211,6 +1387,23 @@ eval_queue_opts(struct pf_altq *pa, struct node_queue_opt *opts,
opts->data.hfsc_opts.upperlimit.d;
}
break;
+ case ALTQT_FAIRQ:
+ pa->pq_u.fairq_opts.flags = opts->data.fairq_opts.flags;
+ pa->pq_u.fairq_opts.nbuckets = opts->data.fairq_opts.nbuckets;
+ pa->pq_u.fairq_opts.hogs_m1 =
+ eval_bwspec(&opts->data.fairq_opts.hogs_bw, ref_bw);
+
+ if (opts->data.fairq_opts.linkshare.used) {
+ pa->pq_u.fairq_opts.lssc_m1 =
+ eval_bwspec(&opts->data.fairq_opts.linkshare.m1,
+ ref_bw);
+ pa->pq_u.fairq_opts.lssc_m2 =
+ eval_bwspec(&opts->data.fairq_opts.linkshare.m2,
+ ref_bw);
+ pa->pq_u.fairq_opts.lssc_d =
+ opts->data.fairq_opts.linkshare.d;
+ }
+ break;
default:
warnx("eval_queue_opts: unknown scheduler type %u",
opts->qtype);
@@ -1256,3 +1449,27 @@ print_hfsc_sc(const char *scname, u_int m1, u_int d, u_int m2,
if (d != 0)
printf(")");
}
+
+void
+print_fairq_sc(const char *scname, u_int m1, u_int d, u_int m2,
+ const struct node_fairq_sc *sc)
+{
+ printf(" %s", scname);
+
+ if (d != 0) {
+ printf("(");
+ if (sc != NULL && sc->m1.bw_percent > 0)
+ printf("%u%%", sc->m1.bw_percent);
+ else
+ printf("%s", rate2str((double)m1));
+ printf(" %u", d);
+ }
+
+ if (sc != NULL && sc->m2.bw_percent > 0)
+ printf(" %u%%", sc->m2.bw_percent);
+ else
+ printf(" %s", rate2str((double)m2));
+
+ if (d != 0)
+ printf(")");
+}
diff --git a/sbin/pfctl/pfctl_parser.h b/sbin/pfctl/pfctl_parser.h
index 5c909e9564e4..8a4e84e4ffe2 100644
--- a/sbin/pfctl/pfctl_parser.h
+++ b/sbin/pfctl/pfctl_parser.h
@@ -150,12 +150,27 @@ struct node_hfsc_opts {
int flags;
};
+struct node_fairq_sc {
+ struct node_queue_bw m1; /* slope of 1st segment; bps */
+ u_int d; /* x-projection of m1; msec */
+ struct node_queue_bw m2; /* slope of 2nd segment; bps */
+ u_int8_t used;
+};
+
+struct node_fairq_opts {
+ struct node_fairq_sc linkshare;
+ struct node_queue_bw hogs_bw;
+ u_int nbuckets;
+ int flags;
+};
+
struct node_queue_opt {
int qtype;
union {
struct cbq_opts cbq_opts;
struct priq_opts priq_opts;
struct node_hfsc_opts hfsc_opts;
+ struct node_fairq_opts fairq_opts;
} data;
};
diff --git a/sbin/pfctl/pfctl_qstats.c b/sbin/pfctl/pfctl_qstats.c
index 0921d47fbe91..2a40d956b934 100644
--- a/sbin/pfctl/pfctl_qstats.c
+++ b/sbin/pfctl/pfctl_qstats.c
@@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$");
#include
#include
#include
+#include
#include "pfctl.h"
#include "pfctl_parser.h"
@@ -46,6 +47,7 @@ union class_stats {
class_stats_t cbq_stats;
struct priq_classstats priq_stats;
struct hfsc_classstats hfsc_stats;
+ struct fairq_classstats fairq_stats;
};
#define AVGN_MAX 8
@@ -77,6 +79,7 @@ void pfctl_print_altq_node(int, const struct pf_altq_node *,
void print_cbqstats(struct queue_stats);
void print_priqstats(struct queue_stats);
void print_hfscstats(struct queue_stats);
+void print_fairqstats(struct queue_stats);
void pfctl_free_altq_node(struct pf_altq_node *);
void pfctl_print_altq_nodestat(int,
const struct pf_altq_node *);
@@ -317,6 +320,9 @@ pfctl_print_altq_nodestat(int dev, const struct pf_altq_node *a)
case ALTQT_HFSC:
print_hfscstats(a->qstats);
break;
+ case ALTQT_FAIRQ:
+ print_fairqstats(a->qstats);
+ break;
}
}
@@ -381,6 +387,26 @@ print_hfscstats(struct queue_stats cur)
rate2str((8 * cur.avg_bytes) / STAT_INTERVAL));
}
+void
+print_fairqstats(struct queue_stats cur)
+{
+ printf(" [ pkts: %10llu bytes: %10llu "
+ "dropped pkts: %6llu bytes: %6llu ]\n",
+ (unsigned long long)cur.data.fairq_stats.xmit_cnt.packets,
+ (unsigned long long)cur.data.fairq_stats.xmit_cnt.bytes,
+ (unsigned long long)cur.data.fairq_stats.drop_cnt.packets,
+ (unsigned long long)cur.data.fairq_stats.drop_cnt.bytes);
+ printf(" [ qlength: %3d/%3d ]\n",
+ cur.data.fairq_stats.qlength, cur.data.fairq_stats.qlimit);
+
+ if (cur.avgn < 2)
+ return;
+
+ printf(" [ measured: %7.1f packets/s, %s/s ]\n",
+ cur.avg_packets / STAT_INTERVAL,
+ rate2str((8 * cur.avg_bytes) / STAT_INTERVAL));
+}
+
void
pfctl_free_altq_node(struct pf_altq_node *node)
{
@@ -421,6 +447,10 @@ update_avg(struct pf_altq_node *a)
b = qs->data.hfsc_stats.xmit_cnt.bytes;
p = qs->data.hfsc_stats.xmit_cnt.packets;
break;
+ case ALTQT_FAIRQ:
+ b = qs->data.fairq_stats.xmit_cnt.bytes;
+ p = qs->data.fairq_stats.xmit_cnt.packets;
+ break;
default:
b = 0;
p = 0;
diff --git a/sbin/setkey/setkey.8 b/sbin/setkey/setkey.8
index 4306ec22f8b8..b9c616066599 100644
--- a/sbin/setkey/setkey.8
+++ b/sbin/setkey/setkey.8
@@ -29,7 +29,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd July 25, 2014
+.Dd July 3, 2015
.Dt SETKEY 8
.Os
.\"
@@ -627,11 +627,12 @@ des-deriv 64 ipsec-ciph-des-derived-01
3des-deriv 192 no document
rijndael-cbc 128/192/256 rfc3602
aes-ctr 160/224/288 draft-ietf-ipsec-ciph-aes-ctr-03
+aes-gcm-16 160/224/288 rfc4106
camellia-cbc 128/192/256 rfc4312
.Ed
.Pp
Note that the first 128/192/256 bits of a key for
-.Li aes-ctr
+.Li aes-ctr or aes-gcm-16
will be used as AES key, and remaining 32 bits will be used as nonce.
.Pp
The following are the list of compression algorithms that can be used
diff --git a/sbin/setkey/token.l b/sbin/setkey/token.l
index c89982fd9d45..1b667190fe39 100644
--- a/sbin/setkey/token.l
+++ b/sbin/setkey/token.l
@@ -159,7 +159,7 @@ tcp { yylval.num = 0; return(PR_TCP); }
{hyphen}E { BEGIN S_ENCALG; return(F_ENC); }
des-cbc { yylval.num = SADB_EALG_DESCBC; BEGIN INITIAL; return(ALG_ENC); }
3des-cbc { yylval.num = SADB_EALG_3DESCBC; BEGIN INITIAL; return(ALG_ENC); }
-null { yylval.num = SADB_EALG_NULL; BEGIN INITIAL; return(ALG_ENC_NOKEY); }
+null { yylval.num = SADB_EALG_NULL; BEGIN INITIAL; return(ALG_ENC); }
simple { yylval.num = SADB_EALG_NULL; BEGIN INITIAL; return(ALG_ENC_OLD); }
blowfish-cbc { yylval.num = SADB_X_EALG_BLOWFISHCBC; BEGIN INITIAL; return(ALG_ENC); }
cast128-cbc { yylval.num = SADB_X_EALG_CAST128CBC; BEGIN INITIAL; return(ALG_ENC); }
@@ -168,6 +168,7 @@ tcp { yylval.num = 0; return(PR_TCP); }
rijndael-cbc { yylval.num = SADB_X_EALG_RIJNDAELCBC; BEGIN INITIAL; return(ALG_ENC); }
aes-ctr { yylval.num = SADB_X_EALG_AESCTR; BEGIN INITIAL; return(ALG_ENC); }
camellia-cbc { yylval.num = SADB_X_EALG_CAMELLIACBC; BEGIN INITIAL; return(ALG_ENC); }
+aes-gcm-16 { yylval.num = SADB_X_EALG_AESGCM16; BEGIN INITIAL; return(ALG_ENC); }
/* compression algorithms */
{hyphen}C { return(F_COMP); }
diff --git a/share/dtrace/Makefile b/share/dtrace/Makefile
index e4f69d4cab7d..11fd1afb3faf 100644
--- a/share/dtrace/Makefile
+++ b/share/dtrace/Makefile
@@ -15,11 +15,13 @@ _toolkit= toolkit
SCRIPTS= disklatency \
disklatencycmd \
hotopen \
+ nfsattrstats \
nfsclienttime \
- udptrack \
+ siftr \
+ tcpconn \
tcpstate \
tcptrack \
- tcpconn
+ udptrack
SCRIPTSDIR= ${SHAREDIR}/dtrace
diff --git a/share/examples/csh/dot.cshrc b/share/examples/csh/dot.cshrc
index c85e4b1197d4..e9f0b38e1769 100644
--- a/share/examples/csh/dot.cshrc
+++ b/share/examples/csh/dot.cshrc
@@ -9,11 +9,11 @@
# has multiple ssh-agent(1) processes running, this will very likely
# set SSH_AUTH_SOCK to point to the wrong file/domain socket.
if (${?SSH_AUTH_SOCK} != "1") then
- setenv SSH_AUTH_SOCK `sockstat -u | awk '/^${USER}.+ ssh-agent/ { print $6 }'
+ setenv SSH_AUTH_SOCK `sockstat -u | awk '/^${USER}.+ ssh-agent/ { print $6 }'`
endif
# Change only root's prompt
-if (`id -g` == 0)
+if (`id -g` == 0) then
set prompt="root@%m# "
endif
@@ -70,7 +70,7 @@ complete grep 'c/-*A/x:<#_lines_after>/' \
'n/-*f/f/' \
'n/*/f/'
complete ifconfig 'p@1@`ifconfig -l`@' \
- 'n/*/(range phase link netmask mtu vlandev vlan metric mediaopt down delete broadcast arp debug)/'
+ 'n/*/(range phase link netmask mtu vlandev vlan metric mediaopt down delete broadcast arp debug)/' \
'c/%/j/' \
'n/*/`ps -ax | awk '"'"'{print $1}'"'"'`/'
complete kill 'c/-/S/' 'c/%/j/' 'n/*/`ps -ax | awk '"'"'{print $1}'"'"'`/'
diff --git a/share/examples/tests/tests/plain/cp_test.sh b/share/examples/tests/tests/plain/cp_test.sh
index ea6470518cda..c45d68490db6 100644
--- a/share/examples/tests/tests/plain/cp_test.sh
+++ b/share/examples/tests/tests/plain/cp_test.sh
@@ -1,3 +1,4 @@
+#! /bin/sh
# $FreeBSD$
#
# Copyright 2013 Google Inc.
diff --git a/share/man/man3/Makefile b/share/man/man3/Makefile
index 1213a7a56e40..373587085035 100644
--- a/share/man/man3/Makefile
+++ b/share/man/man3/Makefile
@@ -64,13 +64,15 @@ MLINKS+= fpgetround.3 fpgetmask.3 \
MLINKS+= makedev.3 major.3 \
makedev.3 minor.3
MLINKS+= ${PTHREAD_MLINKS}
-MLINKS+= queue.3 LIST_EMPTY.3 \
+MLINKS+= queue.3 LIST_CLASS_ENTRY.3 \
+ queue.3 LIST_CLASS_HEAD.3 \
+ queue.3 LIST_EMPTY.3 \
queue.3 LIST_ENTRY.3 \
queue.3 LIST_FIRST.3 \
queue.3 LIST_FOREACH.3 \
queue.3 LIST_FOREACH_FROM.3 \
- queue.3 LIST_FOREACH_SAFE.3 \
queue.3 LIST_FOREACH_FROM_SAFE.3 \
+ queue.3 LIST_FOREACH_SAFE.3 \
queue.3 LIST_HEAD.3 \
queue.3 LIST_HEAD_INITIALIZER.3 \
queue.3 LIST_INIT.3 \
@@ -81,13 +83,15 @@ MLINKS+= queue.3 LIST_EMPTY.3 \
queue.3 LIST_PREV.3 \
queue.3 LIST_REMOVE.3 \
queue.3 LIST_SWAP.3 \
+ queue.3 SLIST_CLASS_ENTRY.3 \
+ queue.3 SLIST_CLASS_HEAD.3 \
queue.3 SLIST_EMPTY.3 \
queue.3 SLIST_ENTRY.3 \
queue.3 SLIST_FIRST.3 \
queue.3 SLIST_FOREACH.3 \
queue.3 SLIST_FOREACH_FROM.3 \
- queue.3 SLIST_FOREACH_SAFE.3 \
queue.3 SLIST_FOREACH_FROM_SAFE.3 \
+ queue.3 SLIST_FOREACH_SAFE.3 \
queue.3 SLIST_HEAD.3 \
queue.3 SLIST_HEAD_INITIALIZER.3 \
queue.3 SLIST_INIT.3 \
@@ -98,14 +102,16 @@ MLINKS+= queue.3 LIST_EMPTY.3 \
queue.3 SLIST_REMOVE_AFTER.3 \
queue.3 SLIST_REMOVE_HEAD.3 \
queue.3 SLIST_SWAP.3 \
+ queue.3 STAILQ_CLASS_ENTRY.3 \
+ queue.3 STAILQ_CLASS_HEAD.3 \
queue.3 STAILQ_CONCAT.3 \
queue.3 STAILQ_EMPTY.3 \
queue.3 STAILQ_ENTRY.3 \
queue.3 STAILQ_FIRST.3 \
queue.3 STAILQ_FOREACH.3 \
queue.3 STAILQ_FOREACH_FROM.3 \
- queue.3 STAILQ_FOREACH_SAFE.3 \
queue.3 STAILQ_FOREACH_FROM_SAFE.3 \
+ queue.3 STAILQ_FOREACH_SAFE.3 \
queue.3 STAILQ_HEAD.3 \
queue.3 STAILQ_HEAD_INITIALIZER.3 \
queue.3 STAILQ_INIT.3 \
@@ -118,18 +124,20 @@ MLINKS+= queue.3 LIST_EMPTY.3 \
queue.3 STAILQ_REMOVE_AFTER.3 \
queue.3 STAILQ_REMOVE_HEAD.3 \
queue.3 STAILQ_SWAP.3 \
+ queue.3 TAILQ_CLASS_ENTRY.3 \
+ queue.3 TAILQ_CLASS_HEAD.3 \
queue.3 TAILQ_CONCAT.3 \
queue.3 TAILQ_EMPTY.3 \
queue.3 TAILQ_ENTRY.3 \
queue.3 TAILQ_FIRST.3 \
queue.3 TAILQ_FOREACH.3 \
queue.3 TAILQ_FOREACH_FROM.3 \
+ queue.3 TAILQ_FOREACH_FROM_SAFE.3 \
queue.3 TAILQ_FOREACH_REVERSE.3 \
queue.3 TAILQ_FOREACH_REVERSE_FROM.3 \
- queue.3 TAILQ_FOREACH_REVERSE_SAFE.3 \
queue.3 TAILQ_FOREACH_REVERSE_FROM_SAFE.3 \
+ queue.3 TAILQ_FOREACH_REVERSE_SAFE.3 \
queue.3 TAILQ_FOREACH_SAFE.3 \
- queue.3 TAILQ_FOREACH_FROM_SAFE.3 \
queue.3 TAILQ_HEAD.3 \
queue.3 TAILQ_HEAD_INITIALIZER.3 \
queue.3 TAILQ_INIT.3 \
diff --git a/share/man/man3/queue.3 b/share/man/man3/queue.3
index fbd1a064fe86..bde4687b0eb1 100644
--- a/share/man/man3/queue.3
+++ b/share/man/man3/queue.3
@@ -28,35 +28,39 @@
.\" @(#)queue.3 8.2 (Berkeley) 1/24/94
.\" $FreeBSD$
.\"
-.Dd April 16, 2015
+.Dd June 24, 2015
.Dt QUEUE 3
.Os
.Sh NAME
+.Nm SLIST_CLASS_ENTRY ,
+.Nm SLIST_CLASS_HEAD ,
.Nm SLIST_EMPTY ,
.Nm SLIST_ENTRY ,
.Nm SLIST_FIRST ,
.Nm SLIST_FOREACH ,
.Nm SLIST_FOREACH_FROM ,
-.Nm SLIST_FOREACH_SAFE ,
.Nm SLIST_FOREACH_FROM_SAFE ,
+.Nm SLIST_FOREACH_SAFE ,
.Nm SLIST_HEAD ,
.Nm SLIST_HEAD_INITIALIZER ,
.Nm SLIST_INIT ,
.Nm SLIST_INSERT_AFTER ,
.Nm SLIST_INSERT_HEAD ,
.Nm SLIST_NEXT ,
+.Nm SLIST_REMOVE ,
.Nm SLIST_REMOVE_AFTER ,
.Nm SLIST_REMOVE_HEAD ,
-.Nm SLIST_REMOVE ,
.Nm SLIST_SWAP ,
+.Nm STAILQ_CLASS_ENTRY ,
+.Nm STAILQ_CLASS_HEAD ,
.Nm STAILQ_CONCAT ,
.Nm STAILQ_EMPTY ,
.Nm STAILQ_ENTRY ,
.Nm STAILQ_FIRST ,
.Nm STAILQ_FOREACH ,
.Nm STAILQ_FOREACH_FROM ,
-.Nm STAILQ_FOREACH_SAFE ,
.Nm STAILQ_FOREACH_FROM_SAFE ,
+.Nm STAILQ_FOREACH_SAFE ,
.Nm STAILQ_HEAD ,
.Nm STAILQ_HEAD_INITIALIZER ,
.Nm STAILQ_INIT ,
@@ -65,17 +69,19 @@
.Nm STAILQ_INSERT_TAIL ,
.Nm STAILQ_LAST ,
.Nm STAILQ_NEXT ,
+.Nm STAILQ_REMOVE ,
.Nm STAILQ_REMOVE_AFTER ,
.Nm STAILQ_REMOVE_HEAD ,
-.Nm STAILQ_REMOVE ,
.Nm STAILQ_SWAP ,
+.Nm LIST_CLASS_ENTRY ,
+.Nm LIST_CLASS_HEAD ,
.Nm LIST_EMPTY ,
.Nm LIST_ENTRY ,
.Nm LIST_FIRST ,
.Nm LIST_FOREACH ,
.Nm LIST_FOREACH_FROM ,
-.Nm LIST_FOREACH_SAFE ,
.Nm LIST_FOREACH_FROM_SAFE ,
+.Nm LIST_FOREACH_SAFE ,
.Nm LIST_HEAD ,
.Nm LIST_HEAD_INITIALIZER ,
.Nm LIST_INIT ,
@@ -86,18 +92,20 @@
.Nm LIST_PREV ,
.Nm LIST_REMOVE ,
.Nm LIST_SWAP ,
+.Nm TAILQ_CLASS_ENTRY ,
+.Nm TAILQ_CLASS_HEAD ,
.Nm TAILQ_CONCAT ,
.Nm TAILQ_EMPTY ,
.Nm TAILQ_ENTRY ,
.Nm TAILQ_FIRST ,
.Nm TAILQ_FOREACH ,
.Nm TAILQ_FOREACH_FROM ,
-.Nm TAILQ_FOREACH_SAFE ,
.Nm TAILQ_FOREACH_FROM_SAFE ,
.Nm TAILQ_FOREACH_REVERSE ,
.Nm TAILQ_FOREACH_REVERSE_FROM ,
-.Nm TAILQ_FOREACH_REVERSE_SAFE ,
.Nm TAILQ_FOREACH_REVERSE_FROM_SAFE ,
+.Nm TAILQ_FOREACH_REVERSE_SAFE ,
+.Nm TAILQ_FOREACH_SAFE ,
.Nm TAILQ_HEAD ,
.Nm TAILQ_HEAD_INITIALIZER ,
.Nm TAILQ_INIT ,
@@ -115,32 +123,36 @@ lists and tail queues
.Sh SYNOPSIS
.In sys/queue.h
.\"
+.Fn SLIST_CLASS_ENTRY "CLASSTYPE"
+.Fn SLIST_CLASS_HEAD "HEADNAME" "CLASSTYPE"
.Fn SLIST_EMPTY "SLIST_HEAD *head"
.Fn SLIST_ENTRY "TYPE"
.Fn SLIST_FIRST "SLIST_HEAD *head"
.Fn SLIST_FOREACH "TYPE *var" "SLIST_HEAD *head" "SLIST_ENTRY NAME"
.Fn SLIST_FOREACH_FROM "TYPE *var" "SLIST_HEAD *head" "SLIST_ENTRY NAME"
-.Fn SLIST_FOREACH_SAFE "TYPE *var" "SLIST_HEAD *head" "SLIST_ENTRY NAME" "TYPE *temp_var"
.Fn SLIST_FOREACH_FROM_SAFE "TYPE *var" "SLIST_HEAD *head" "SLIST_ENTRY NAME" "TYPE *temp_var"
+.Fn SLIST_FOREACH_SAFE "TYPE *var" "SLIST_HEAD *head" "SLIST_ENTRY NAME" "TYPE *temp_var"
.Fn SLIST_HEAD "HEADNAME" "TYPE"
.Fn SLIST_HEAD_INITIALIZER "SLIST_HEAD head"
.Fn SLIST_INIT "SLIST_HEAD *head"
.Fn SLIST_INSERT_AFTER "TYPE *listelm" "TYPE *elm" "SLIST_ENTRY NAME"
.Fn SLIST_INSERT_HEAD "SLIST_HEAD *head" "TYPE *elm" "SLIST_ENTRY NAME"
.Fn SLIST_NEXT "TYPE *elm" "SLIST_ENTRY NAME"
+.Fn SLIST_REMOVE "SLIST_HEAD *head" "TYPE *elm" "TYPE" "SLIST_ENTRY NAME"
.Fn SLIST_REMOVE_AFTER "TYPE *elm" "SLIST_ENTRY NAME"
.Fn SLIST_REMOVE_HEAD "SLIST_HEAD *head" "SLIST_ENTRY NAME"
-.Fn SLIST_REMOVE "SLIST_HEAD *head" "TYPE *elm" "TYPE" "SLIST_ENTRY NAME"
.Fn SLIST_SWAP "SLIST_HEAD *head1" "SLIST_HEAD *head2" "SLIST_ENTRY NAME"
.\"
+.Fn STAILQ_CLASS_ENTRY "CLASSTYPE"
+.Fn STAILQ_CLASS_HEAD "HEADNAME" "CLASSTYPE"
.Fn STAILQ_CONCAT "STAILQ_HEAD *head1" "STAILQ_HEAD *head2"
.Fn STAILQ_EMPTY "STAILQ_HEAD *head"
.Fn STAILQ_ENTRY "TYPE"
.Fn STAILQ_FIRST "STAILQ_HEAD *head"
.Fn STAILQ_FOREACH "TYPE *var" "STAILQ_HEAD *head" "STAILQ_ENTRY NAME"
.Fn STAILQ_FOREACH_FROM "TYPE *var" "STAILQ_HEAD *head" "STAILQ_ENTRY NAME"
-.Fn STAILQ_FOREACH_SAFE "TYPE *var" "STAILQ_HEAD *head" "STAILQ_ENTRY NAME" "TYPE *temp_var"
.Fn STAILQ_FOREACH_FROM_SAFE "TYPE *var" "STAILQ_HEAD *head" "STAILQ_ENTRY NAME" "TYPE *temp_var"
+.Fn STAILQ_FOREACH_SAFE "TYPE *var" "STAILQ_HEAD *head" "STAILQ_ENTRY NAME" "TYPE *temp_var"
.Fn STAILQ_HEAD "HEADNAME" "TYPE"
.Fn STAILQ_HEAD_INITIALIZER "STAILQ_HEAD head"
.Fn STAILQ_INIT "STAILQ_HEAD *head"
@@ -149,18 +161,20 @@ lists and tail queues
.Fn STAILQ_INSERT_TAIL "STAILQ_HEAD *head" "TYPE *elm" "STAILQ_ENTRY NAME"
.Fn STAILQ_LAST "STAILQ_HEAD *head" "TYPE *elm" "STAILQ_ENTRY NAME"
.Fn STAILQ_NEXT "TYPE *elm" "STAILQ_ENTRY NAME"
+.Fn STAILQ_REMOVE "STAILQ_HEAD *head" "TYPE *elm" "TYPE" "STAILQ_ENTRY NAME"
.Fn STAILQ_REMOVE_AFTER "STAILQ_HEAD *head" "TYPE *elm" "STAILQ_ENTRY NAME"
.Fn STAILQ_REMOVE_HEAD "STAILQ_HEAD *head" "STAILQ_ENTRY NAME"
-.Fn STAILQ_REMOVE "STAILQ_HEAD *head" "TYPE *elm" "TYPE" "STAILQ_ENTRY NAME"
.Fn STAILQ_SWAP "STAILQ_HEAD *head1" "STAILQ_HEAD *head2" "STAILQ_ENTRY NAME"
.\"
+.Fn LIST_CLASS_ENTRY "CLASSTYPE"
+.Fn LIST_CLASS_HEAD "HEADNAME" "CLASSTYPE"
.Fn LIST_EMPTY "LIST_HEAD *head"
.Fn LIST_ENTRY "TYPE"
.Fn LIST_FIRST "LIST_HEAD *head"
.Fn LIST_FOREACH "TYPE *var" "LIST_HEAD *head" "LIST_ENTRY NAME"
.Fn LIST_FOREACH_FROM "TYPE *var" "LIST_HEAD *head" "LIST_ENTRY NAME"
-.Fn LIST_FOREACH_SAFE "TYPE *var" "LIST_HEAD *head" "LIST_ENTRY NAME" "TYPE *temp_var"
.Fn LIST_FOREACH_FROM_SAFE "TYPE *var" "LIST_HEAD *head" "LIST_ENTRY NAME" "TYPE *temp_var"
+.Fn LIST_FOREACH_SAFE "TYPE *var" "LIST_HEAD *head" "LIST_ENTRY NAME" "TYPE *temp_var"
.Fn LIST_HEAD "HEADNAME" "TYPE"
.Fn LIST_HEAD_INITIALIZER "LIST_HEAD head"
.Fn LIST_INIT "LIST_HEAD *head"
@@ -172,18 +186,20 @@ lists and tail queues
.Fn LIST_REMOVE "TYPE *elm" "LIST_ENTRY NAME"
.Fn LIST_SWAP "LIST_HEAD *head1" "LIST_HEAD *head2" "TYPE" "LIST_ENTRY NAME"
.\"
+.Fn TAILQ_CLASS_ENTRY "CLASSTYPE"
+.Fn TAILQ_CLASS_HEAD "HEADNAME" "CLASSTYPE"
.Fn TAILQ_CONCAT "TAILQ_HEAD *head1" "TAILQ_HEAD *head2" "TAILQ_ENTRY NAME"
.Fn TAILQ_EMPTY "TAILQ_HEAD *head"
.Fn TAILQ_ENTRY "TYPE"
.Fn TAILQ_FIRST "TAILQ_HEAD *head"
.Fn TAILQ_FOREACH "TYPE *var" "TAILQ_HEAD *head" "TAILQ_ENTRY NAME"
.Fn TAILQ_FOREACH_FROM "TYPE *var" "TAILQ_HEAD *head" "TAILQ_ENTRY NAME"
-.Fn TAILQ_FOREACH_SAFE "TYPE *var" "TAILQ_HEAD *head" "TAILQ_ENTRY NAME" "TYPE *temp_var"
.Fn TAILQ_FOREACH_FROM_SAFE "TYPE *var" "TAILQ_HEAD *head" "TAILQ_ENTRY NAME" "TYPE *temp_var"
.Fn TAILQ_FOREACH_REVERSE "TYPE *var" "TAILQ_HEAD *head" "HEADNAME" "TAILQ_ENTRY NAME"
.Fn TAILQ_FOREACH_REVERSE_FROM "TYPE *var" "TAILQ_HEAD *head" "HEADNAME" "TAILQ_ENTRY NAME"
-.Fn TAILQ_FOREACH_REVERSE_SAFE "TYPE *var" "TAILQ_HEAD *head" "HEADNAME" "TAILQ_ENTRY NAME" "TYPE *temp_var"
.Fn TAILQ_FOREACH_REVERSE_FROM_SAFE "TYPE *var" "TAILQ_HEAD *head" "HEADNAME" "TAILQ_ENTRY NAME" "TYPE *temp_var"
+.Fn TAILQ_FOREACH_REVERSE_SAFE "TYPE *var" "TAILQ_HEAD *head" "HEADNAME" "TAILQ_ENTRY NAME" "TYPE *temp_var"
+.Fn TAILQ_FOREACH_SAFE "TYPE *var" "TAILQ_HEAD *head" "TAILQ_ENTRY NAME" "TYPE *temp_var"
.Fn TAILQ_HEAD "HEADNAME" "TYPE"
.Fn TAILQ_HEAD_INITIALIZER "TAILQ_HEAD head"
.Fn TAILQ_INIT "TAILQ_HEAD *head"
@@ -198,8 +214,18 @@ lists and tail queues
.Fn TAILQ_SWAP "TAILQ_HEAD *head1" "TAILQ_HEAD *head2" "TYPE" "TAILQ_ENTRY NAME"
.\"
.Sh DESCRIPTION
-These macros define and operate on four types of data structures:
-singly-linked lists, singly-linked tail queues, lists, and tail queues.
+These macros define and operate on four types of data structures which
+can be used in both C and C++ source code:
+.Bl -enum -compact -offset indent
+.It
+Lists
+.It
+Singly-linked lists
+.It
+Singly-linked tail queues
+.It
+Tail queues
+.El
All four structures support the following functionality:
.Bl -enum -compact -offset indent
.It
@@ -301,24 +327,39 @@ than singly-linked lists.
.Pp
In the macro definitions,
.Fa TYPE
-is the name of a user defined structure,
-that must contain a field of type
+is the name of a user defined structure.
+The structure must contain a field called
+.Fa NAME
+which is of type
.Li SLIST_ENTRY ,
.Li STAILQ_ENTRY ,
.Li LIST_ENTRY ,
or
-.Li TAILQ_ENTRY ,
-named
-.Fa NAME .
+.Li TAILQ_ENTRY .
+In the macro definitions,
+.Fa CLASSTYPE
+is the name of a user defined class.
+The class must contain a field called
+.Fa NAME
+which is of type
+.Li SLIST_CLASS_ENTRY ,
+.Li STAILQ_CLASS_ENTRY ,
+.Li LIST_CLASS_ENTRY ,
+or
+.Li TAILQ_CLASS_ENTRY .
The argument
.Fa HEADNAME
is the name of a user defined structure that must be declared
using the macros
.Li SLIST_HEAD ,
+.Li SLIST_CLASS_HEAD ,
.Li STAILQ_HEAD ,
+.Li STAILQ_CLASS_HEAD ,
.Li LIST_HEAD ,
+.Li LIST_CLASS_HEAD ,
+.Li TAILQ_HEAD ,
or
-.Li TAILQ_HEAD .
+.Li TAILQ_CLASS_HEAD .
See the examples below for further explanation of how these
macros are used.
.Sh SINGLY-LINKED LISTS
diff --git a/share/man/man4/altq.4 b/share/man/man4/altq.4
index 718b593c0aba..e417d7d60fb3 100644
--- a/share/man/man4/altq.4
+++ b/share/man/man4/altq.4
@@ -25,7 +25,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd December 9, 2011
+.Dd June 24, 2015
.Dt ALTQ 4
.Os
.Sh NAME
@@ -40,6 +40,7 @@
.Cd options ALTQ_HFSC
.Cd options ALTQ_CDNR
.Cd options ALTQ_PRIQ
+.Cd options ALTQ_FAIRQ
.Sh DESCRIPTION
The
.Nm
@@ -93,6 +94,10 @@ any of the available disciplines or consumers.
Build the
.Dq "Priority Queuing"
discipline.
+.It Dv ALTQ_FAIRQ
+Build the
+.Dq "Fair Queuing"
+discipline.
.It Dv ALTQ_NOPCC
Required if the TSC is unusable.
.It Dv ALTQ_DEBUG
diff --git a/share/man/man4/ctl.4 b/share/man/man4/ctl.4
index 06f4849bb9af..005f90830d4b 100644
--- a/share/man/man4/ctl.4
+++ b/share/man/man4/ctl.4
@@ -23,12 +23,12 @@
.\" SUCH DAMAGE.
.\"
.\" $FreeBSD$
-.Dd June 20, 2015
+.Dd July 3, 2015
.Dt CTL 4
.Os
.Sh NAME
.Nm ctl
-.Nd CAM Target Layer
+.Nd CAM Target Layer / iSCSI target
.Sh SYNOPSIS
To compile this driver into the kernel,
place the following line in your
diff --git a/share/man/man4/em.4 b/share/man/man4/em.4
index aa0db1a44d0e..5b80ed6cbead 100644
--- a/share/man/man4/em.4
+++ b/share/man/man4/em.4
@@ -307,10 +307,5 @@ The
driver was written by
.An Intel Corporation Aq Mt freebsd@intel.com .
.Sh BUGS
-Hardware-assisted VLAN processing is disabled by default.
-You can enable it on an
-.Nm
-interface using
-.Xr ifconfig 8 .
.Pp
Activating EM_MULTIQUEUE support requires MSI-X features.
diff --git a/share/man/man4/malo.4 b/share/man/man4/malo.4
index 7f8a03631ff0..ea1ffb5c2fe9 100644
--- a/share/man/man4/malo.4
+++ b/share/man/man4/malo.4
@@ -31,7 +31,7 @@
.\"
.\" $FreeBSD$
.\"/
-.Dd September 20, 2014
+.Dd June 24, 2015
.Dt MALO 4
.Os
.Sh NAME
@@ -69,30 +69,12 @@ Only one virtual interface may be configured at any time.
For more information on configuring this device, see
.Xr ifconfig 8 .
.Pp
-This driver requires the
-.Nm malofw
-firmware kernel module be installed before it will work.
-The firmware files are not publicly available.
-A port of the firmware can be found at:
-.Bd -literal -offset indent
-http://weongyo.org/project/malo/malo-firmware-1.4.tar.gz
-.Ed
-.Pp
-The firmware kernel module can be installed by extracting
-the archive and running
-.Ql make install clean
-in the
-.Pa malo-firmware-1.4
-directory.
-.Pp
-To load the
-.Nm malofw
-firmware kernel module at boot time, place the following
-line in
-.Xr loader.conf 5 :
-.Bd -literal -offset indent
-malofw_load="YES"
-.Ed
+This driver requires firmware to be loaded before it will work.
+The
+.Pa ports/net/malo-firmware-kmod
+port needs to be installed before
+.Xr ifconfig 8
+will work.
.Sh HARDWARE
The following cards are among those supported by the
.Nm
diff --git a/share/man/man4/proto.4 b/share/man/man4/proto.4
index ead546b2320a..376060baa163 100644
--- a/share/man/man4/proto.4
+++ b/share/man/man4/proto.4
@@ -1,5 +1,5 @@
.\"
-.\" Copyright (c) 2014 Marcel Moolenaar
+.\" Copyright (c) 2014, 2015 Marcel Moolenaar
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
@@ -25,13 +25,13 @@
.\"
.\" $FreeBSD$
.\"
-.Dd April 29, 2014
+.Dd July 3, 2015
.Dt PROTO 4
.Os
.\"
.Sh NAME
.Nm proto
-.Nd Driver for prototyping and H/W diagnostics
+.Nd Generic prototyping and diagnostics driver
.\"
.Sh SYNOPSIS
To compile this driver into the kernel,
@@ -51,9 +51,9 @@ proto_load="YES"
.Sh DESCRIPTION
The
.Nm
-device driver attaches to PCI devices when no other device drivers are
-present and creates device special files for all resources associated
-with the device.
+device driver attaches to PCI or ISA devices when no other device drivers
+are present for those devices and it creates device special files for all
+resources associated with the device.
The driver itself has no knowledge of the device it attaches to.
Programs can open these device special files and perform register-level
reads and writes.
@@ -75,9 +75,9 @@ All device special files corresponding to a PCI device are located under
with
.Pa pci:::
representing the location of the PCI device in the PCI hierarchy.
-A location includes:
+A PCI location includes:
.Pp
-.Bl -tag -width XXXXXX -compact
+.Bl -tag -width XXXXXX -compact -offset indent
.It
The PCI domain number
.It
@@ -91,6 +91,10 @@ The PCI function number
Every PCI device has a device special file called
.Pa pcicfg .
This device special file gives access to the PCI configuration space.
+A device special file called
+.Pa busdma
+is also created.
+This device special file provides the interfaces needed for doing DMA.
For each valid base address register (BAR), a device special file is created
that contains the BAR offset and the resource type.
A resource type can be either
@@ -98,15 +102,49 @@ A resource type can be either
or
.Pa mem
representing I/O port or memory mapped I/O space (resp.)
+.Pp
+ISA devices do not have a location. Instead, they are identified by the
+first I/O port address or first memory mapped I/O address.
+Consequently, all device special files corresponding to an ISA device are
+located under
+.Pa /dev/proto/isa:
+with
+.Pa addr
+the address in hexadecimal notation.
+For each I/O port or memory mapped I/O address, a device special file is
+created that contains the resource identification used by the kernel and
+the resource type.
+The resource type can be either
+.Pa io
+or
+.Pa mem
+representing I/O port or memory mapped I/O space (resp.)
+When the device has a DMA channel assigned to it, a device special file
+with the name
+.Pa busdma
+is created as well.
+This device special file provides the interfaces needed for doing DMA.
+.Pp
+If the ISA device is not a Plug-and-Play device nor present in the ACPI
+device tree, it must have the appropriate hints so that the kernel can
+reserve the resources for it.
.\"
.Sh EXAMPLES
A single function PCI device in domain 0, on bus 1, in slot 2 and having a
single memory mapped I/O region will have the following device special files:
.Pp
-.Bl -tag -width XXXXXX -compact
+.Bl -tag -width XXXXXX -compact -offset indent
.It Pa /dev/proto/pci0:1:2:0/10.mem
.It Pa /dev/proto/pci0:1:2:0/pcicfg
.El
+.Pp
+A legacy floppy controller will have the following device files:
+.Pp
+.Bl -tag -width XXXXXX -compact -offset indent
+.It Pa /dev/proto/isa:0x3f0/00.io
+.It Pa /dev/proto/isa:0x3f0/01.io
+.It Pa /dev/proto/isa:0x3f0/busdma
+.El
.\"
.Sh AUTHORS
The
@@ -123,13 +161,12 @@ It is not advisable to use this driver on a production machine.
The
.Nm
driver does not yet support interrupts.
-Since interrupts cannot be handled by the driver itself, they must be converted
-into signals and delivered to the program that has registered for interrupts.
+Since interrupts cannot be handled by the driver itself, they must be
+converted into signals and delivered to the program that has registered
+for interrupts.
+A satisfactory mechanism for keeping the interrupt masked during the
+signal handling is still being worked out.
.Pp
-In order to test the transmission or reception of data, some means of doing
-direct memory access (DMA) by the device must be possible.
-This too must be under the control of the program.
-The details of how a program can set up and
-initiate DMA still need to be fleshed out.
-.Pp
-Support for non-PCI devices has not been implemented yet.
+DMA support for devices other than busmaster devices is not present yet.
+The details of how a program is to interact with the DMA controller still
+need to be fleshed out.
diff --git a/share/man/man4/random.4 b/share/man/man4/random.4
index a87a2ed7bbcb..b93f6baefeb6 100644
--- a/share/man/man4/random.4
+++ b/share/man/man4/random.4
@@ -1,4 +1,4 @@
-.\" Copyright (c) 2001-2013 Mark R V Murray. All rights reserved.
+.\" Copyright (c) 2001-2015 Mark R V Murray. All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
@@ -23,7 +23,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd October 12, 2013
+.Dd June 30, 2015
.Dt RANDOM 4
.Os
.Sh NAME
@@ -37,31 +37,32 @@ The
device
returns an endless supply of random bytes when read.
It also accepts and reads data
-as any ordinary (and willing) file,
-but discards data written to it.
-The device will probe for
-certain hardware entropy sources,
-and use these in preference to the fallback,
-which is a generator implemented in software.
+as any ordinary file.
.Pp
-The software generator will start in an
+The generator will start in an
.Em unseeded
state, and will block reads until
-it is (re)seeded.
+it is seeded for the first time.
This may cause trouble at system boot
when keys and the like
are generated from
-/dev/random
+.Xr random 4
so steps should be taken to ensure a
-reseed as soon as possible.
-The
-.Xr sysctl 8
-controlling the
-.Em seeded
-status (see below) may be used
-if security is not an issue
-or for convenience
-during setup or development.
+seeding as soon as possible.
+.Pp
+It is also possible
+to read random bytes
+by using the KERN_ARND sysctl.
+On the command line
+this could be done by
+.Pp
+.Dl "sysctl -x -B 16 kern.arandom"
+.Pp
+This sysctl will not return
+random bytes unless
+the
+.Xr random 4
+is seeded.
.Pp
This initial seeding
of random number generators
@@ -90,101 +91,57 @@ To see the current settings of the software
.Nm
device, use the command line:
.Pp
-.Dl sysctl kern.random
+.Dl "sysctl kern.random"
.Pp
which results in something like:
.Bd -literal -offset indent
-kern.random.adaptors: yarrow,dummy
-kern.random.active_adaptor: yarrow
-kern.random.yarrow.gengateinterval: 10
-kern.random.yarrow.bins: 10
-kern.random.yarrow.fastthresh: 96
-kern.random.yarrow.slowthresh: 128
-kern.random.yarrow.slowoverthresh: 2
-kern.random.sys.seeded: 1
-kern.random.sys.harvest.ethernet: 1
-kern.random.sys.harvest.point_to_point: 1
-kern.random.sys.harvest.interrupt: 1
-kern.random.sys.harvest.swi: 1
+kern.random.fortuna.minpoolsize: 64
+kern.random.harvest.mask_symbolic: [HIGH_PERFORMANCE], ... ,CACHED
+kern.random.harvest.mask_bin: 00111111111
+kern.random.harvest.mask: 511
+kern.random.random_sources: 'Intel Secure Key RNG'
.Ed
.Pp
Other than
-.Dl kern.random.adaptors
-all settings are read/write.
+.Dl kern.random.fortuna.minpoolsize
+and
+.Dl kern.random.harvest.mask
+all settings are read-only.
.Pp
The
-.Va kern.random.sys.seeded
-variable indicates whether or not the
-.Nm
-device is in an acceptably secure state
-as a result of reseeding.
-If set to 0,
-the device will block (on read)
-until the next reseed
-as a result of entropy harvesting.
-A reseed will set the value to 1 (non-blocking).
+.Pa kern.random.fortuna.minpoolsize
+sysctl is used
+to set the seed threshhold.
+A smaller number gives a faster seed,
+but a less secure one.
+In practice,
+values between 64 and 256
+are acceptable.
.Pp
The
-.Va kern.random.sys.harvest.ethernet
-variable is used to select LAN traffic as an entropy source.
-A 0 (zero) value means that LAN traffic
-is not considered as an entropy source.
-Set the variable to 1 (one)
-if you wish to use LAN traffic for entropy harvesting.
-.Pp
-The
-.Va kern.random.sys.harvest.point_to_point
-variable is used to select serial line traffic as an entropy source.
-(Serial line traffic includes PPP, SLIP and all tun0 traffic.)
-A 0 (zero) value means such traffic
-is not considered as an entropy source.
-Set the variable to 1 (one)
-if you wish to use it for entropy harvesting.
-.Pp
-The
-.Va kern.random.sys.harvest.interrupt
-variable is used to select hardware interrupts
+.Va kern.random.harvest.mask
+bitmask is used to select
+the possible entropy sources.
+A 0 (zero) value means
+the corresponding source
+is not considered
as an entropy source.
-A 0 (zero) value means hardware interrupts
-are not considered as an entropy source.
-Set the variable to 1 (one)
-if you wish to use them for entropy harvesting.
-All hardware interrupt harvesting is set up by the
-individual device drivers.
-.Pp
+Set the bit to 1 (one)
+if you wish to use
+that source.
The
-.Va kern.random.sys.harvest.swi
-variable is used to select software interrupts
-as an entropy source.
-A 0 (zero) value means software interrupts
-are not considered as an entropy source.
-Set the variable to 1 (one)
-if you wish to use them for entropy harvesting.
-.Pp
-The other variables are explained in the paper describing the
-.Em Yarrow
-algorithm at
-.Pa http://www.schneier.com/yarrow.html .
-.Pp
-These variables are all limited
-in terms of the values they may contain:
-.Bl -tag -width "kern.random.yarrow.gengateinterval" -compact -offset indent
-.It Va kern.random.yarrow.gengateinterval
-.Bq 4..64
-.It Va kern.random.yarrow.bins
-.Bq 2..16
-.It Va kern.random.yarrow.fastthresh
-.Bq 64..256
-.It Va kern.random.yarrow.slowthresh
-.Bq 64..256
-.It Va kern.random.yarrow.slowoverthresh
-.Bq 1..5
-.El
-.Pp
-Internal
-.Xr sysctl 3
-handlers force the above variables
-into the stated ranges.
+.Va kern.random.harvest.mask_bin
+and
+.Va kern.random.harvest.mask_symbolic
+sysctl
+can be used confirm
+that your choices are correct.
+Note that disabled items
+in the latter item
+are listed in square brackets.
+See
+.Xr random_harvest 9
+for more on the harvesting of entropy.
.Sh RANDOMNESS
The use of randomness in the field of computing
is a rather subtle issue because randomness means
@@ -308,23 +265,36 @@ so its use is discouraged.
.Xr RAND_add 3 ,
.Xr RAND_bytes 3 ,
.Xr random 3 ,
-.Xr sysctl 8
+.Xr sysctl 8 ,
+.Xr random 9
+.Rs
+.%A Ferguson
+.%A Schneier
+.%A Kohno
+.%B Cryptography Engineering
+.%I Wiley
+.%O ISBN 978-0-470-47424-2
+.Re
.Sh HISTORY
A
.Nm
device appeared in
.Fx 2.2 .
-The early version was taken from Theodore Ts'o's entropy driver for Linux.
The current software implementation,
introduced in
-.Fx 5.0 ,
-is a complete rewrite by
+.Fx 10.0 ,
+is by
.An Mark R V Murray ,
and is an implementation of the
-.Em Yarrow
-algorithm by Bruce Schneier,
+.Em Fortuna
+algorithm by Ferguson
.Em et al .
-Significant infrastructure work was done by Arthur Mesh.
-.Pp
-The author gratefully acknowledges
-significant assistance from VIA Technologies, Inc.
+It replaces the previous
+.Em Yarrow
+implementation,
+introduced in
+.Fx 5.0 .
+The older
+.Em Yarrow
+algorithm remains available
+as a compile-time fallback.
diff --git a/share/man/man5/rc.conf.5 b/share/man/man5/rc.conf.5
index c263111a1c19..ccbd9ef02aee 100644
--- a/share/man/man5/rc.conf.5
+++ b/share/man/man5/rc.conf.5
@@ -3995,27 +3995,11 @@ set from
.Va jail_ Ns Ao Ar jname Ac Ns Va _sysvipc_allow
.El
.\" -----------------------------------------------------
-.It Va harvest_interrupt
-.Pq Vt bool
-Set to
-.Dq Li YES
-to use hardware interrupts as an entropy source.
-Refer to
-.Xr random 4
-for more information.
-.It Va harvest_ethernet
-.Pq Vt bool
-Set to
-.Dq Li YES
-to use LAN traffic as an entropy source.
-Refer to
-.Xr random 4
-for more information.
-.It Va harvest_p_to_p
-.Pq Vt bool
-Set to
-.Dq Li YES
-to use serial line traffic as an entropy source.
+.It Va harvest_mask
+.Pq Vt int
+Set to a bit-mask
+representing the entropy sources
+you wish to harvest.
Refer to
.Xr random 4
for more information.
@@ -4025,17 +4009,54 @@ Set to
.Dq Li NO
to disable caching entropy via
.Xr cron 8 .
-Otherwise set to the directory used to store entropy files in.
+Otherwise set to the directory
+in which the entropy files are stored.
+To be useful,
+there must be
+a system cron job
+that regularly writes and rotates
+files here.
+All files found
+will be used at boot time.
+The default is
+.Pa /var/db/entropy .
.It Va entropy_file
.Pq Vt str
Set to
.Dq Li NO
to disable caching entropy through reboots.
-Otherwise set to the filename used to store cached entropy through
-reboots.
-This file should be located on the root file system to seed the
-.Xr random 4
-device as early as possible in the boot process.
+Otherwise set to the name
+of a file used to store cached entropy.
+This file should be located
+on a file system that is readable
+before all the volumes specified in
+.Xr fstab 5
+are mounted.
+By default,
+.Pa /entropy
+is used,
+but if
+.Pa /var/db/entropy-file
+is found it will also be used.
+This will be of some use to
+.Xr bsdinstall 8 .
+.It Va entropy_boot_file
+.Pq Vt str
+Set to
+.Dq Li NO
+to disable
+very early caching entropy
+through reboots.
+Otherwise set to the filename
+used to read
+very early reboot cached entropy.
+This file should be located where
+.Xr loader 8
+can read it.
+See also
+.Xr loader.conf 5 .
+The default location is
+.Pa /boot/entropy .
.It Va entropy_save_sz
.Pq Vt int
Size of the entropy cache files saved by
@@ -4478,6 +4499,7 @@ The default value is an empty string.
.Xr ipf 5 ,
.Xr ipnat 5 ,
.Xr jail.conf 5 ,
+.Xr loader.conf 5 ,
.Xr motd 5 ,
.Xr newsyslog.conf 5 ,
.Xr pf.conf 5 ,
@@ -4486,6 +4508,7 @@ The default value is an empty string.
.Xr amd 8 ,
.Xr apm 8 ,
.Xr atm 8 ,
+.Xr bsdinstall 8 ,
.Xr bthidd 8 ,
.Xr chkprintcap 8 ,
.Xr chown 8 ,
@@ -4503,6 +4526,7 @@ The default value is an empty string.
.Xr ipnat 8 ,
.Xr jail 8 ,
.Xr kldxref 8 ,
+.Xr loader 8 ,
.Xr lpd 8 ,
.Xr mdconfig 8 ,
.Xr mdmfs 8 ,
diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile
index d0e204f99586..21541908e218 100644
--- a/share/man/man9/Makefile
+++ b/share/man/man9/Makefile
@@ -188,6 +188,7 @@ MAN= accept_filter.9 \
mutex.9 \
namei.9 \
netisr.9 \
+ nv.9 \
osd.9 \
panic.9 \
pbuf.9 \
@@ -1127,6 +1128,68 @@ MLINKS+=netisr.9 netisr_clearqdrops.9 \
netisr.9 netisr_register.9 \
netisr.9 netisr_setqlimit.9 \
netisr.9 netisr_unregister.9
+MLINKS+=nv.9 libnv.9 \
+ nv.9 nvlist.9 \
+ nv.9 nvlist_add_binary.9 \
+ nv.9 nvlist_add_bool.9 \
+ nv.9 nvlist_add_descriptor.9 \
+ nv.9 nvlist_add_null.9 \
+ nv.9 nvlist_add_number.9 \
+ nv.9 nvlist_add_nvlist.9 \
+ nv.9 nvlist_add_string.9 \
+ nv.9 nvlist_add_stringf.9 \
+ nv.9 nvlist_add_stringv.9 \
+ nv.9 nvlist_clone.9 \
+ nv.9 nvlist_create.9 \
+ nv.9 nvlist_destroy.9 \
+ nv.9 nvlist_dump.9 \
+ nv.9 nvlist_empty.9 \
+ nv.9 nvlist_error.9 \
+ nv.9 nvlist_exists.9 \
+ nv.9 nvlist_exists_binary.9 \
+ nv.9 nvlist_exists_bool.9 \
+ nv.9 nvlist_exists_descriptor.9 \
+ nv.9 nvlist_exists_null.9 \
+ nv.9 nvlist_exists_number.9 \
+ nv.9 nvlist_exists_nvlist.9 \
+ nv.9 nvlist_exists_string.9 \
+ nv.9 nvlist_exists_type.9 \
+ nv.9 nvlist_fdump.9 \
+ nv.9 nvlist_flags.9 \
+ nv.9 nvlist_free.9 \
+ nv.9 nvlist_free_binary.9 \
+ nv.9 nvlist_free_bool.9 \
+ nv.9 nvlist_free_descriptor.9 \
+ nv.9 nvlist_free_null.9 \
+ nv.9 nvlist_free_number.9 \
+ nv.9 nvlist_free_nvlist.9 \
+ nv.9 nvlist_free_string.9 \
+ nv.9 nvlist_free_type.9 \
+ nv.9 nvlist_get_binary.9 \
+ nv.9 nvlist_get_bool.9 \
+ nv.9 nvlist_get_descriptor.9 \
+ nv.9 nvlist_get_number.9 \
+ nv.9 nvlist_get_nvlist.9 \
+ nv.9 nvlist_get_parent.9 \
+ nv.9 nvlist_get_string.9 \
+ nv.9 nvlist_move_binary.9 \
+ nv.9 nvlist_move_descriptor.9 \
+ nv.9 nvlist_move_nvlist.9 \
+ nv.9 nvlist_move_string.9 \
+ nv.9 nvlist_next.9 \
+ nv.9 nvlist_pack.9 \
+ nv.9 nvlist_recv.9 \
+ nv.9 nvlist_send.9 \
+ nv.9 nvlist_set_error.9 \
+ nv.9 nvlist_size.9 \
+ nv.9 nvlist_take_binary.9 \
+ nv.9 nvlist_take_bool.9 \
+ nv.9 nvlist_take_descriptor.9 \
+ nv.9 nvlist_take_number.9 \
+ nv.9 nvlist_take_nvlist.9 \
+ nv.9 nvlist_take_string.9 \
+ nv.9 nvlist_unpack.9 \
+ nv.9 nvlist_xfer.9
MLINKS+=osd.9 osd_call.9 \
osd.9 osd_del.9 \
osd.9 osd_deregister.9 \
diff --git a/share/man/man9/crypto.9 b/share/man/man9/crypto.9
index 7acfbeabbd31..d7bee0175d9b 100644
--- a/share/man/man9/crypto.9
+++ b/share/man/man9/crypto.9
@@ -17,7 +17,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd December 12, 2014
+.Dd July 2, 2015
.Dt CRYPTO 9
.Os
.Sh NAME
@@ -333,13 +333,13 @@ on the input buffer.
The various fields are:
.Bl -tag -width ".Va crd_inject"
.It Va crd_iv
-The field where IV should be provided when the
+When the flag
.Dv CRD_F_IV_EXPLICIT
-flag is given.
+is set, this field contains the IV.
.It Va crd_key
When the
.Dv CRD_F_KEY_EXPLICIT
-flag is given, the
+flag is set, the
.Va crd_key
points to a buffer with encryption or authentication key.
.It Va crd_alg
@@ -356,10 +356,12 @@ How many bytes, after
.Va crd_skip ,
should be processed.
.It Va crd_inject
-Offset from the beginning of the buffer to insert any results.
-For encryption algorithms, this is where the initialization vector
-(IV) will be inserted when encrypting or where it can be found when
-decrypting (subject to
+The
+.Va crd_inject
+field specifies an offset in bytes from the beginning of the buffer.
+For encryption algorithms, this may be where the IV will be inserted
+when encrypting or where the IV may be found for
+decryption (subject to
.Va crd_flags ) .
For MAC algorithms, this is where the result of the keyed hash will be
inserted.
@@ -370,15 +372,14 @@ The following flags are defined:
For encryption algorithms, this bit is set when encryption is required
(when not set, decryption is performed).
.It Dv CRD_F_IV_PRESENT
-For encryption, this bit is set when the IV already
-precedes the data, so the
-.Va crd_inject
-value will be ignored and no IV will be written in the buffer.
-Otherwise, the IV used to encrypt the packet will be written
-at the location pointed to by
+.\" This flag name has nothing to do w/ it's behavior, fix the name.
+For encryption, if this bit is not set the IV used to encrypt the packet
+will be written at the location pointed to by
.Va crd_inject .
The IV length is assumed to be equal to the blocksize of the
encryption algorithm.
+For encryption, if this bit is set, nothing is done.
+For decryption, this flag has no meaning.
Applications that do special
.Dq "IV cooking" ,
such as the half-IV mode in
@@ -388,13 +389,13 @@ This flag is typically used in conjunction with the
.Dv CRD_F_IV_EXPLICIT
flag.
.It Dv CRD_F_IV_EXPLICIT
-For encryption algorithms, this bit is set when the IV is explicitly
+This bit is set when the IV is explicitly
provided by the consumer in the
.Va crd_iv
field.
Otherwise, for encryption operations the IV is provided for by
the driver used to perform the operation, whereas for decryption
-operations it is pointed to by the
+operations the offset of the IV is provided by the
.Va crd_inject
field.
This flag is typically used when the IV is calculated
diff --git a/share/man/man9/hash.9 b/share/man/man9/hash.9
index 961be0b54e2c..3276fd1877e3 100644
--- a/share/man/man9/hash.9
+++ b/share/man/man9/hash.9
@@ -26,7 +26,7 @@
.\" $OpenBSD: hash.9,v 1.5 2003/04/17 05:08:39 jmc Exp $
.\" $FreeBSD$
.\"
-.Dd October 18, 2014
+.Dd June 30, 2015
.Dt HASH 9
.Os
.Sh NAME
@@ -72,6 +72,13 @@ These functions can be used to hash
.Dv NUL
terminated strings, as well as blocks of memory.
.Pp
+A
+.Fa len
+argument is the length of the buffer in bytes.
+A
+.Fa count
+argument is the length of the buffer in 32-bit words.
+.Pp
The
.Fn hash32_buf
function is used as a general buffer hashing function.
@@ -79,7 +86,7 @@ The argument
.Fa buf
is used to pass in the location, and
.Fa len
-is the length of the buffer.
+is the length of the buffer in bytes.
The argument
.Fa hash
is used to extend an existing hash, or is passed the initial value
diff --git a/lib/libnv/nv.3 b/share/man/man9/nv.9
similarity index 99%
rename from lib/libnv/nv.3
rename to share/man/man9/nv.9
index 58033be61fed..2184ae640566 100644
--- a/lib/libnv/nv.3
+++ b/share/man/man9/nv.9
@@ -28,8 +28,8 @@
.\"
.\" $FreeBSD$
.\"
-.Dd May 2, 2015
-.Dt NV 3
+.Dd July 4, 2015
+.Dt NV 9
.Os
.Sh NAME
.Nm nvlist_create ,
diff --git a/share/man/man9/random.9 b/share/man/man9/random.9
index a6bccda701b4..906b5e59679b 100644
--- a/share/man/man9/random.9
+++ b/share/man/man9/random.9
@@ -1,9 +1,9 @@
.\"
+.\" Copyright (c) 2015
+.\" Mark R V Murray
.\" Copyright (c) 2000
.\" The Regents of the University of California. All rights reserved.
.\"
-.\" All rights reserved.
-.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
@@ -26,7 +26,7 @@
.\"
.\" $FreeBSD$
.\" "
-.Dd September 25, 2000
+.Dd June 30, 2015
.Dt RANDOM 9
.Os
.Sh NAME
@@ -53,11 +53,12 @@
.Sh DESCRIPTION
The
.Fn random
-function will by default produce a sequence of numbers that can be duplicated
+function will by default produce
+a sequence of numbers
+that can be duplicated
by calling
.Fn srandom
-with
-.Ql 1
+with some constant
as the
.Fa seed .
The
@@ -67,19 +68,28 @@ function may be called with any arbitrary
value to get slightly more unpredictable numbers.
It is important to remember that the
.Fn random
-function is entirely predictable, and is therefore not of use where
-knowledge of the sequence of numbers may be of benefit to an attacker.
+function is entirely predictable,
+and is therefore not of use where
+knowledge of the sequence of numbers
+may be of benefit to an attacker.
.Pp
The
.Fn arc4rand
-function will return very good quality random numbers, slightly better
-suited for security-related purposes.
+function will return very good quality random numbers,
+better suited
+for security-related purposes.
The random numbers from
.Fn arc4rand
-are seeded from the entropy device if it is available.
-Automatic reseeds happen after a certain timeinterval and after a
-certain number of bytes have been delivered.
-A forced reseed can be forced by passing a non-zero value in the
+are seeded from the entropy device
+if it is available.
+Automatic reseeds happen
+after a certain timeinterval
+and after a certain number of bytes
+have been delivered.
+A forced reseed
+can be forced
+by passing a non-zero
+value in the
.Fa reseed
argument.
.Pp
@@ -90,19 +100,24 @@ if it has been loaded.
If the entropy device is not loaded, then
the
.Fa buffer
-is filled with output generated by
-.Fn random .
+is ignored
+and zero is returned.
The
.Fa buffer
is filled with no more than
.Fa count
bytes.
-It is advised that
+It is strongly advised that
.Fn read_random
-is not used; instead use
+is not used;
+instead use
.Fn arc4rand
+unless it is
+necessary to know
+that no entropy
+has been returned.
.Pp
-All the bits generated by
+All the bits returned by
.Fn random ,
.Fn arc4rand
and
@@ -120,32 +135,38 @@ to return a 32 bit pseudo-random integer.
.Sh RETURN VALUES
The
.Fn random
-function
-uses a non-linear additive feedback random number generator employing a
-default table of size 31 long integers to return successive pseudo-random
+function uses
+a non-linear additive feedback random number generator
+employing a default table
+of size 31
+containing long integers
+to return successive pseudo-random
numbers in the range from 0 to
.if t 2\u\s731\s10\d\(mi1.
.if n (2**31)\(mi1.
-The period of this random number generator is very large, approximately
+The period of this random number generator
+is very large,
+approximately
.if t 16\(mu(2\u\s731\s10\d\(mi1).
.if n 16*((2**31)\(mi1).
.Pp
The
.Fn arc4rand
-function uses the RC4 algorithm to generate successive pseudo-random
-bytes.
+function uses the RC4 algorithm
+to generate successive pseudo-random bytes.
The
.Fn arc4random
-function
-uses
+function uses
.Fn arc4rand
-to generate pseudo-random numbers in the range from 0 to
+to generate pseudo-random numbers
+in the range from 0 to
.if t 2\u\s732\s10\d\(mi1.
.if n (2**32)\(mi1.
.Pp
The
.Fn read_random
-function returns the number of bytes placed in
+function returns
+the number of bytes placed in
.Fa buffer .
.Sh AUTHORS
.An Dan Moschuk
diff --git a/share/man/man9/random_harvest.9 b/share/man/man9/random_harvest.9
index 7b72f3e996da..cb89a05c3f5e 100644
--- a/share/man/man9/random_harvest.9
+++ b/share/man/man9/random_harvest.9
@@ -1,5 +1,5 @@
.\"
-.\" Copyright (c) 2002 Mark R V Murray
+.\" Copyright (c) 2002-2015 Mark R V Murray
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
@@ -25,7 +25,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd February 6, 2002
+.Dd June 30, 2015
.Dt RANDOM_HARVEST 9
.Os
.Sh NAME
@@ -35,59 +35,93 @@
.In sys/types.h
.In sys/random.h
.Ft void
-.Fo random_harvest
+.Fo random_harvest_direct
+.Fa "void *entropy"
+.Fa "u_int size"
+.Fa "u_int bits"
+.Fa "enum esource source"
+.Fc
+.Ft void
+.Fo random_harvest_fast
+.Fa "void *entropy"
+.Fa "u_int size"
+.Fa "u_int bits"
+.Fa "enum esource source"
+.Fc
+.Ft void
+.Fo random_harvest_queue
.Fa "void *entropy"
.Fa "u_int size"
.Fa "u_int bits"
-.Fa "u_int frac"
.Fa "enum esource source"
.Fc
.Sh DESCRIPTION
The
-.Fn random_harvest
-function is used by device drivers
+.Fn random_harvest_*
+functions are used by device drivers
and other kernel processes to pass data
that is considered (at least partially) stochastic
to the entropy device.
.Pp
-The caller should pass a pointer (to no more than 16 bytes) of
-the
+The caller should pass
+a pointer pointing to the
.Dq random
data in
.Fa entropy .
The argument
.Fa size
contains the number of bytes pointed to.
-The caller should
+The
+.Fa source
+is chosen from one of
+the values enumerated in
+.Pa sys/dev/random.h .
+and is used to indicate the source of the entropy.
+.Pp
+The
+.Fo random_harvest_direct
+.Fc
+variant is used
+for early harvesting
+before any multitasking
+is enabled.
+.Pp
+The
+.Fn random_harvest_fast
+variant is used
+by sources that
+should not take
+a performance hit
+from harvesting,
+as they are high-rate
+sources.
+Some entropy is sacrificed,
+but the hig rate of supply
+will compensate for this.
+.Pp
+The
+.Fn random_harvest_queue
+variant is used
+for general harvesting
+and is the default
+choice for most entropy sources
+such as interrupts
+or console events.
+.Pp
+The
+.Fa bits
+argument is only used
+by the deprecated Yarrow algorithm.
+For compatibility,
+the caller should
.Em "very conservatively"
estimate the number of random bits
in the sample,
and pass this in
-.Fa bits
-or
-.Fa frac .
-If the estimated number of bits per sample is an integer, then
-.Fa bits
-is used, and
-.Fa frac
-is 0.
-Otherwise,
-for low-entropy samples,
-.Dq fractional
-entropy can be supplied in
-.Fa frac .
-(This is considered to be
-.Fa frac /
-1024 bits of entropy.)
-The
-.Fa source
-is chosen from
-.Dv RANDOM_WRITE , RANDOM_KEYBOARD , RANDOM_MOUSE , RANDOM_NET
-and
-.Dv RANDOM_INTERRUPT ,
-and is used to indicate the source of the entropy.
+.Fa bits .
.Pp
-Interrupt harvesting has been simplified
+Interrupt harvesting has been
+in part simplified simplified
for the kernel programmer.
If a device driver registers an interrupt handler
with
@@ -101,6 +135,7 @@ bit in the
.Fa flags
argument to have that interrupt source
be used for entropy harvesting.
+This should be done wherever practicable.
.Sh SEE ALSO
.Xr random 4 ,
.Xr BUS_SETUP_INTR 9
diff --git a/share/misc/bsd-family-tree b/share/misc/bsd-family-tree
index 0bf11134b456..4ff700d54fc6 100644
--- a/share/misc/bsd-family-tree
+++ b/share/misc/bsd-family-tree
@@ -330,7 +330,7 @@ FreeBSD 5.2 | | | |
| | | | DragonFly 4.0.5
| | | | |
| | | OpenBSD 5.7 |
- | | | | |
+ | | | | DragonFly 4.2.0
| | | | |
FreeBSD 11 -current | NetBSD -current OpenBSD -current DragonFly -current
| | | | |
@@ -672,6 +672,7 @@ DragonFly 4.0.3 2015-01-21 [DFB]
DragonFly 4.0.4 2015-03-09 [DFB]
DragonFly 4.0.5 2015-03-23 [DFB]
OpenBSD 5.7 2015-05-01 [OBD]
+DragonFly 4.2.0 2015-06-29 [DFB]
Bibliography
------------------------
diff --git a/share/misc/committers-src.dot b/share/misc/committers-src.dot
index 9af30b7ccc4f..2bf40d47b608 100644
--- a/share/misc/committers-src.dot
+++ b/share/misc/committers-src.dot
@@ -61,6 +61,7 @@ jkh [label="Jordan K. Hubbard\njkh@FreeBSD.org\n1993/06/12\n2008/06/13"]
jlemon [label="Jonathan Lemon\njlemon@FreeBSD.org\n1997/08/14\n2008/11/10"]
joe [label="Josef Karthauser\njoe@FreeBSD.org\n1999/10/22\n2008/08/10"]
jtc [label="J.T. Conklin\njtc@FreeBSD.org\n1993/06/12\n????/??/??"]
+kargl [label="Steven G. Kargl\nkargl@FreeBSD.org\n2011/01/17\n2015/06/28"]
kbyanc [label="Kelly Yancey\nkbyanc@FreeBSD.org\n2000/07/11\n2006/07/25"]
keichii [label="Michael Wu\nkeichii@FreeBSD.org\n2001/03/07\n2006/04/28"]
linimon [label="Mark Linimon\nlinimon@FreeBSD.org\n2006/09/30\n2008/05/04"]
@@ -205,7 +206,6 @@ julian [label="Julian Elischer\njulian@FreeBSD.org\n1993/04/19"]
jwd [label="John De Boskey\njwd@FreeBSD.org\n2000/05/19"]
kaiw [label="Kai Wang\nkaiw@FreeBSD.org\n2007/09/26"]
kan [label="Alexander Kabaev\nkan@FreeBSD.org\n2002/07/21"]
-kargl [label="Steven G. Kargl\nkargl@FreeBSD.org\n2011/01/17"]
ken [label="Ken Merry\nken@FreeBSD.org\n1998/09/08"]
kensmith [label="Ken Smith\nkensmith@FreeBSD.org\n2004/01/23"]
kevlo [label="Kevin Lo\nkevlo@FreeBSD.org\n2006/07/23"]
diff --git a/share/mk/bsd.cpu.mk b/share/mk/bsd.cpu.mk
index 4b619086963b..6ba87cc3486e 100644
--- a/share/mk/bsd.cpu.mk
+++ b/share/mk/bsd.cpu.mk
@@ -6,18 +6,20 @@
.if !defined(CPUTYPE) || empty(CPUTYPE)
_CPUCFLAGS =
-. if ${MACHINE_CPUARCH} == "i386"
-MACHINE_CPU = i486
+. if ${MACHINE_CPUARCH} == "aarch64"
+MACHINE_CPU = arm64
. elif ${MACHINE_CPUARCH} == "amd64"
MACHINE_CPU = amd64 sse2 sse mmx
+. elif ${MACHINE_CPUARCH} == "arm"
+MACHINE_CPU = arm
+. elif ${MACHINE_CPUARCH} == "i386"
+MACHINE_CPU = i486
+. elif ${MACHINE_CPUARCH} == "mips"
+MACHINE_CPU = mips
. elif ${MACHINE_CPUARCH} == "powerpc"
MACHINE_CPU = aim
. elif ${MACHINE_CPUARCH} == "sparc64"
MACHINE_CPU = ultrasparc
-. elif ${MACHINE_CPUARCH} == "arm"
-MACHINE_CPU = arm
-. elif ${MACHINE_CPUARCH} == "mips"
-MACHINE_CPU = mips
. endif
.else
diff --git a/share/mk/bsd.lib.mk b/share/mk/bsd.lib.mk
index f70cc95d2553..b8159ded23fc 100644
--- a/share/mk/bsd.lib.mk
+++ b/share/mk/bsd.lib.mk
@@ -362,7 +362,7 @@ _libinstall:
.if ${_SHLIBDIR} == ${_LIBDIR}
${INSTALL_SYMLINK} ${SHLIB_NAME} ${DESTDIR}${_LIBDIR}/${SHLIB_LINK}
.else
- ${INSTALL_SYMLINK} ${_SHLIBDIRPREFIX}${_SHLIBDIR}/${SHLIB_NAME} \
+ ${INSTALL_RSYMLINK} ${DESTDIR}${_SHLIBDIR}/${SHLIB_NAME} \
${DESTDIR}${_LIBDIR}/${SHLIB_LINK}
.if exists(${DESTDIR}${_LIBDIR}/${SHLIB_NAME})
-chflags noschg ${DESTDIR}${_LIBDIR}/${SHLIB_NAME}
diff --git a/share/mk/bsd.own.mk b/share/mk/bsd.own.mk
index 20c66c4162be..b46357563c4b 100644
--- a/share/mk/bsd.own.mk
+++ b/share/mk/bsd.own.mk
@@ -222,9 +222,11 @@ INCLUDEDIR?= /usr/include
#
HRDLINK?= -l h
SYMLINK?= -l s
+RSYMLINK?= -l rs
INSTALL_LINK?= ${INSTALL} ${HRDLINK}
INSTALL_SYMLINK?= ${INSTALL} ${SYMLINK}
+INSTALL_RSYMLINK?= ${INSTALL} ${RSYMLINK}
# Common variables
.if !defined(DEBUG_FLAGS)
diff --git a/share/mk/suite.test.mk b/share/mk/suite.test.mk
index 5e1504c15ab0..34b376410f47 100644
--- a/share/mk/suite.test.mk
+++ b/share/mk/suite.test.mk
@@ -34,12 +34,19 @@ KYUAFILE?= auto
# Kyua as this is later encoded in the Kyuafile test program definitions.
#TEST_INTERFACE.