aboutsummaryrefslogtreecommitdiffstats
path: root/sbin
diff options
context:
space:
mode:
authorSimon J. Gerraty <sjg@FreeBSD.org>2014-08-19 06:50:54 +0000
committerSimon J. Gerraty <sjg@FreeBSD.org>2014-08-19 06:50:54 +0000
commitee7b0571c2c18bdec848ed2044223cc88db29bd8 (patch)
treeb04f4bd7cd887f50e7d98af35f46b9834ff86c80 /sbin
parentffda191e301f128a62c152fde92b692548367fca (diff)
parent15fc2873832ea5b9b639e701bbbf2e73af8b6a88 (diff)
downloadsrc-ee7b0571c2c18bdec848ed2044223cc88db29bd8.tar.gz
src-ee7b0571c2c18bdec848ed2044223cc88db29bd8.zip
Merge head from 7/28
Notes
Notes: svn path=/projects/bmake/; revision=270164
Diffstat (limited to 'sbin')
-rw-r--r--sbin/Makefile.ia643
-rw-r--r--sbin/adjkerntz/adjkerntz.82
-rw-r--r--sbin/atm/atmconfig/Makefile.depend1
-rw-r--r--sbin/atm/atmconfig/atmconfig.82
-rw-r--r--sbin/bsdlabel/bsdlabel.82
-rw-r--r--sbin/bsdlabel/bsdlabel.c1
-rw-r--r--sbin/camcontrol/Makefile2
-rw-r--r--sbin/camcontrol/camcontrol.8349
-rw-r--r--sbin/camcontrol/camcontrol.c35
-rw-r--r--sbin/camcontrol/camcontrol.h10
-rw-r--r--sbin/camcontrol/persist.c966
-rw-r--r--sbin/casperd/casperd.82
-rw-r--r--sbin/dhclient/bpf.c2
-rw-r--r--sbin/dhclient/dhclient-script.84
-rw-r--r--sbin/dhclient/dhclient.86
-rw-r--r--sbin/dhclient/dhclient.c2
-rw-r--r--sbin/dhclient/dhclient.conf.54
-rw-r--r--sbin/dhclient/dhclient.leases.54
-rw-r--r--sbin/dhclient/dhcp-options.54
-rw-r--r--sbin/etherswitchcfg/etherswitchcfg.c2
-rw-r--r--sbin/fdisk/fdisk.c10
-rw-r--r--sbin/ffsinfo/ffsinfo.86
-rw-r--r--sbin/fsck/Makefile2
-rw-r--r--sbin/fsck/fsck.814
-rw-r--r--sbin/fsck_msdosfs/check.c2
-rw-r--r--sbin/fsck_msdosfs/dir.c9
-rw-r--r--sbin/fsck_msdosfs/ext.h8
-rw-r--r--sbin/fsck_msdosfs/fat.c52
-rw-r--r--sbin/fsdb/Makefile4
-rw-r--r--sbin/fsdb/Makefile.depend2
-rw-r--r--sbin/fsirand/fsirand.82
-rw-r--r--sbin/gbde/gbde.84
-rw-r--r--sbin/geom/class/cache/gcache.82
-rw-r--r--sbin/geom/class/concat/gconcat.82
-rw-r--r--sbin/geom/class/eli/geli.817
-rw-r--r--sbin/geom/class/journal/gjournal.82
-rw-r--r--sbin/geom/class/label/glabel.837
-rw-r--r--sbin/geom/class/mirror/gmirror.82
-rw-r--r--sbin/geom/class/mountver/gmountver.82
-rw-r--r--sbin/geom/class/multipath/gmultipath.86
-rw-r--r--sbin/geom/class/nop/gnop.82
-rw-r--r--sbin/geom/class/part/gpart.8239
-rw-r--r--sbin/geom/class/raid/graid.84
-rw-r--r--sbin/geom/class/raid3/graid3.82
-rw-r--r--sbin/geom/class/sched/gsched.84
-rw-r--r--sbin/geom/class/shsec/gshsec.82
-rw-r--r--sbin/geom/class/stripe/geom_stripe.c2
-rw-r--r--sbin/geom/class/stripe/gstripe.82
-rw-r--r--sbin/geom/class/virstor/gvirstor.84
-rw-r--r--sbin/geom/core/geom.82
-rw-r--r--sbin/ggate/ggatec/ggatec.82
-rw-r--r--sbin/ggate/ggated/ggated.82
-rw-r--r--sbin/ggate/ggatel/ggatel.82
-rw-r--r--sbin/growfs/growfs.88
-rw-r--r--sbin/gvinum/Makefile4
-rw-r--r--sbin/gvinum/Makefile.depend2
-rw-r--r--sbin/gvinum/gvinum.86
-rw-r--r--sbin/hastctl/hastctl.82
-rw-r--r--sbin/hastd/hast.conf.52
-rw-r--r--sbin/hastd/hastd.82
-rw-r--r--sbin/ifconfig/af_inet6.c22
-rw-r--r--sbin/ifconfig/ifconfig.856
-rw-r--r--sbin/ipf/ipf/Makefile2
-rw-r--r--sbin/ipf/ipfstat/Makefile2
-rw-r--r--sbin/ipf/ipftest/Makefile2
-rw-r--r--sbin/ipf/ipmon/Makefile2
-rw-r--r--sbin/ipf/ipnat/Makefile2
-rw-r--r--sbin/ipf/ippool/Makefile2
-rw-r--r--sbin/ipf/ipresend/Makefile2
-rw-r--r--sbin/ipfw/dummynet.c24
-rw-r--r--sbin/ipfw/ipfw.814
-rw-r--r--sbin/ipfw/ipfw2.c2
-rw-r--r--sbin/ipfw/ipfw2.h1
-rw-r--r--sbin/kldconfig/kldconfig.82
-rw-r--r--sbin/kldload/kldload.82
-rw-r--r--sbin/kldstat/kldstat.82
-rw-r--r--sbin/kldunload/kldunload.82
-rw-r--r--sbin/md5/md5.118
-rw-r--r--sbin/mdconfig/mdconfig.83
-rw-r--r--sbin/mount/mount.conf.84
-rw-r--r--sbin/mount_cd9660/mount_cd9660.82
-rw-r--r--sbin/mount_fusefs/mount_fusefs.81
-rw-r--r--sbin/mount_msdosfs/mount_msdosfs.84
-rw-r--r--sbin/mount_unionfs/mount_unionfs.86
-rw-r--r--sbin/natd/natd.817
-rw-r--r--sbin/newfs_msdos/newfs_msdos.82
-rw-r--r--sbin/newfs_nandfs/newfs_nandfs.82
-rw-r--r--sbin/nos-tun/nos-tun.86
-rw-r--r--sbin/nvmecontrol/nvmecontrol.84
-rw-r--r--sbin/pfctl/pfctl.81
-rw-r--r--sbin/ping6/ping6.c10
-rw-r--r--sbin/rcorder/Makefile2
-rw-r--r--sbin/rcorder/rcorder.84
-rw-r--r--sbin/reboot/boot_i386.81
-rw-r--r--sbin/reboot/nextboot.82
-rw-r--r--sbin/recoverdisk/recoverdisk.14
-rw-r--r--sbin/sconfig/sconfig.82
-rw-r--r--sbin/setkey/setkey.821
-rw-r--r--sbin/sysctl/sysctl.c4
99 files changed, 1903 insertions, 241 deletions
diff --git a/sbin/Makefile.ia64 b/sbin/Makefile.ia64
deleted file mode 100644
index c1e6a417ac88..000000000000
--- a/sbin/Makefile.ia64
+++ /dev/null
@@ -1,3 +0,0 @@
-# $FreeBSD$
-
-SUBDIR += mca
diff --git a/sbin/adjkerntz/adjkerntz.8 b/sbin/adjkerntz/adjkerntz.8
index 6f0f15e49b97..1bd1391b8ccb 100644
--- a/sbin/adjkerntz/adjkerntz.8
+++ b/sbin/adjkerntz/adjkerntz.8
@@ -190,4 +190,4 @@ The
utility appeared in
.Fx 1.0 .
.Sh AUTHORS
-.An Andrey A. Chernov Aq ache@astral.msk.su
+.An Andrey A. Chernov Aq Mt ache@astral.msk.su
diff --git a/sbin/atm/atmconfig/Makefile.depend b/sbin/atm/atmconfig/Makefile.depend
index d0b9730ddd5b..42e50670ff63 100644
--- a/sbin/atm/atmconfig/Makefile.depend
+++ b/sbin/atm/atmconfig/Makefile.depend
@@ -3,6 +3,7 @@
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
DIRDEPS = \
+ bin/cat.host \
gnu/lib/csu \
gnu/lib/libgcc \
include \
diff --git a/sbin/atm/atmconfig/atmconfig.8 b/sbin/atm/atmconfig/atmconfig.8
index 1ff76a100cd8..c8a740cea59b 100644
--- a/sbin/atm/atmconfig/atmconfig.8
+++ b/sbin/atm/atmconfig/atmconfig.8
@@ -316,4 +316,4 @@ List all NATM routes.
.Xr natmip 4 ,
.Xr atm 8
.Sh AUTHORS
-.An Hartmut Brandt Aq harti@FreeBSD.org
+.An Hartmut Brandt Aq Mt harti@FreeBSD.org
diff --git a/sbin/bsdlabel/bsdlabel.8 b/sbin/bsdlabel/bsdlabel.8
index d31187be1e73..e0f3752c295b 100644
--- a/sbin/bsdlabel/bsdlabel.8
+++ b/sbin/bsdlabel/bsdlabel.8
@@ -109,7 +109,7 @@ argument forces
.Nm
to use a layout suitable for a different architecture.
Current valid values are
-.Cm i386 , amd64 , ia64 ,
+.Cm i386 , amd64 ,
and
.Cm pc98 .
If this option is omitted,
diff --git a/sbin/bsdlabel/bsdlabel.c b/sbin/bsdlabel/bsdlabel.c
index ce5d375f3181..b99c27918594 100644
--- a/sbin/bsdlabel/bsdlabel.c
+++ b/sbin/bsdlabel/bsdlabel.c
@@ -165,7 +165,6 @@ main(int argc, char *argv[])
case 'm':
if (!strcmp(optarg, "i386") ||
!strcmp(optarg, "amd64") ||
- !strcmp(optarg, "ia64") ||
!strcmp(optarg, "pc98")) {
labelsoffset = 1;
labeloffset = 0;
diff --git a/sbin/camcontrol/Makefile b/sbin/camcontrol/Makefile
index 68633757c3df..4f11f195db5b 100644
--- a/sbin/camcontrol/Makefile
+++ b/sbin/camcontrol/Makefile
@@ -3,7 +3,7 @@
PROG= camcontrol
SRCS= camcontrol.c util.c
.if !defined(RELEASE_CRUNCH)
-SRCS+= fwdownload.c modeedit.c progress.c
+SRCS+= fwdownload.c modeedit.c persist.c progress.c
.else
CFLAGS+= -DMINIMALISTIC
.endif
diff --git a/sbin/camcontrol/camcontrol.8 b/sbin/camcontrol/camcontrol.8
index 856edc41c8d9..0c42564dfc4e 100644
--- a/sbin/camcontrol/camcontrol.8
+++ b/sbin/camcontrol/camcontrol.8
@@ -27,7 +27,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd September 6, 2013
+.Dd November 20, 2013
.Dt CAMCONTROL 8
.Os
.Sh NAME
@@ -269,6 +269,21 @@
.Op Fl U Ar pwd
.Op Fl y
.Nm
+.Ic persist
+.Op device id
+.Op generic args
+.Aq Fl i Ar action | Fl o Ar action
+.Op Fl a
+.Op Fl I Ar trans_id
+.Op Fl k Ar key
+.Op Fl K Ar sa_key
+.Op Fl p
+.Op Fl R Ar rel_tgt_port
+.Op Fl s Ar scope
+.Op Fl S
+.Op Fl T Ar res_type
+.Op Fl U
+.Nm
.Ic help
.Sh DESCRIPTION
The
@@ -1473,6 +1488,276 @@ to output a line for every firmware segment that is sent to the device by the
fwdownload command
-- the same as the ones shown in simulation mode.
.El
+.It Ic persist
+Persistent reservation support.
+Persistent reservations are a way to reserve a particular
+.Tn SCSI
+LUN for use by one or more
+.Tn SCSI
+initiators.
+If the
+.Fl i
+option is specified,
+.Nm
+will issue the
+.Tn SCSI
+PERSISTENT RESERVE IN
+command using the requested service action.
+If the
+.Fl o
+option is specified,
+.Nm
+will issue the
+.Tn SCSI
+PERSISTENT RESERVE OUT
+command using the requested service action.
+One of those two options is required.
+.Pp
+Persistent reservations are complex, and fully explaining them is outside
+the scope of this manual.
+Please visit
+http://www.t10.org
+and download the latest SPC spec for a full explanation of persistent
+reservations.
+.Bl -tag -width 8n
+.It Fl i Ar mode
+Specify the service action for the PERSISTENT RESERVE IN command.
+Supported service actions:
+.Bl -tag -width 19n
+.It read_keys
+Report the current persistent reservation generation (PRgeneration) and any
+registered keys.
+.It read_reservation
+Report the persistent reservation, if any.
+.It report_capabilities
+Report the persistent reservation capabilities of the LUN.
+.It read_full_status
+Report the full status of persistent reservations on the LUN.
+.El
+.It Fl o Ar mode
+Specify the service action for the PERSISTENT RESERVE OUT command.
+For service actions like register that are components of other service
+action names, the entire name must be specified.
+Otherwise, enough of the service action name must be specified to
+distinguish it from other possible service actions.
+Supported service actions:
+.Bl -tag -width 15n
+.It register
+Register a reservation key with the LUN or unregister a reservation key.
+To register a key, specify the requested key as the Service Action
+Reservation Key.
+To unregister a key, specify the previously registered key as the
+Reservation Key.
+To change a key, specify the old key as the Reservation Key and the new
+key as the Service Action Reservation Key.
+.It register_ignore
+This is similar to the register subcommand, except that the Reservation Key
+is ignored.
+The Service Action Reservation Key will overwrite any previous key
+registered for the initiator.
+.It reserve
+Create a reservation.
+A key must be registered with the LUN before the LUN can be reserved, and
+it must be specified as the Reservation Key.
+The type of reservation must also be specified.
+The scope defaults to LUN scope (LU_SCOPE), but may be changed.
+.It release
+Release a reservation.
+The Reservation Key must be specified.
+.It clear
+Release a reservation and remove all keys from the device.
+The Reservation Key must be specified.
+.It preempt
+Remove a reservation belonging to another initiator.
+The Reservation Key must be specified.
+The Service Action Reservation Key may be specified, depending on the
+operation being performed.
+.It preempt_abort
+Remove a reservation belonging to another initiator and abort all
+outstanding commands from that initiator.
+The Reservation Key must be specified.
+The Service Action Reservation Key may be specified, depending on the
+operation being performed.
+.It register_move
+Register another initiator with the LUN, and establish a reservation on the
+LUN for that initiator.
+The Reservation Key and Service Action Reservation Key must be specified.
+.It replace_lost
+Replace Lost Reservation information.
+.El
+.It Fl a
+Set the All Target Ports (ALL_TG_PT) bit.
+This requests that the key registration be applied to all target ports and
+not just the particular target port that receives the command.
+This only applies to the register and register_ignore actions.
+.It Fl I Ar tid
+Specify a Transport ID.
+This only applies to the Register and Register and Move service actions for
+Persistent Reserve Out.
+Multiple Transport IDs may be specified with multiple
+.Fl I
+arguments.
+With the Register service action, specifying one or more Transport IDs
+implicitly enables the
+.Fl S
+option which turns on the SPEC_I_PT bit.
+Transport IDs generally have the format protocol,id.
+.Bl -tag -width 5n
+.It SAS
+A SAS Transport ID consists of
+.Dq sas,
+followed by a 64-bit SAS address.
+For example:
+.Pp
+.Dl sas,0x1234567812345678
+.It FC
+A Fibre Channel Transport ID consists of
+.Dq fcp,
+followed by a 64-bit Fibre Channel World Wide Name.
+For example:
+.Pp
+.Dl fcp,0x1234567812345678
+.It SPI
+A Parallel SCSI address consists of
+.Dq spi,
+followed by a SCSI target ID and a relative target port identifier.
+For example:
+.Pp
+.Dl spi,4,1
+.It 1394
+An IEEE 1394 (Firewire) Transport ID consists of
+.Dq sbp,
+followed by a 64-bit EUI-64 IEEE 1394 node unique identifier.
+For example:
+.Pp
+.Dl sbp,0x1234567812345678
+.It RDMA
+A SCSI over RDMA Transport ID consists of
+.Dq srp,
+followed by a 128-bit RDMA initiator port identifier.
+The port identifier must be exactly 32 or 34 (if the leading 0x is
+included) hexadecimal digits.
+Only hexadecimal (base 16) numbers are supported.
+For example:
+.Pp
+.Dl srp,0x12345678123456781234567812345678
+.It iSCSI
+An iSCSI Transport ID consists an iSCSI name and optionally a separator and
+iSCSI session ID.
+For example, if only the iSCSI name is specified:
+.Pp
+.Dl iqn.2012-06.com.example:target0
+.Pp
+If the iSCSI separator and initiator session ID are specified:
+.Pp
+.Dl iqn.2012-06.com.example:target0,i,0x123
+.It PCIe
+A SCSI over PCIe Transport ID consists of
+.Dq sop,
+followed by a PCIe Routing ID.
+The Routing ID consists of a bus, device and function or in the alternate
+form, a bus and function.
+The bus must be in the range of 0 to 255 inclusive and the device must be
+in the range of 0 to 31 inclusive.
+The function must be in the range of 0 to 7 inclusive if the standard form
+is used, and in the range of 0 to 255 inclusive if the alternate form is
+used.
+For example, if a bus, device and function are specified for the standard
+Routing ID form:
+.Pp
+.Dl sop,4,5,1
+.Pp
+If the alternate Routing ID form is used:
+.Pp
+.Dl sop,4,1
+.El
+.It Fl k Ar key
+Specify the Reservation Key.
+This may be in decimal, octal or hexadecimal format.
+The value is zero by default if not otherwise specified.
+The value must be between 0 and 2^64 - 1, inclusive.
+.It Fl K Ar key
+Specify the Service Action Reservation Key.
+This may be in decimal, octal or hexadecimal format.
+The value is zero by default if not otherwise specified.
+The value must be between 0 and 2^64 - 1, inclusive.
+.It Fl p
+Enable the Activate Persist Through Power Loss bit.
+This is only used for the register and register_ignore actions.
+This requests that the reservation persist across power loss events.
+.It Fl s Ar scope
+Specify the scope of the reservation.
+The scope may be specified by name or by number.
+The scope is ignored for register, register_ignore and clear.
+If the desired scope isn't available by name, you may specify the number.
+.Bl -tag -width 7n
+.It lun
+LUN scope (0x00).
+This encompasses the entire LUN.
+.It extent
+Extent scope (0x01).
+.It element
+Element scope (0x02).
+.El
+.It Fl R Ar rtp
+Specify the Relative Target Port.
+This only applies to the Register and Move service action of the Persistent
+Reserve Out command.
+.It Fl S
+Enable the SPEC_I_PT bit.
+This only applies to the Register service action of Persistent Reserve Out.
+You must also specify at least one Transport ID with
+.Fl I
+if this option is set.
+If you specify a Transport ID, this option is automatically set.
+It is an error to specify this option for any service action other than
+Register.
+.It Fl T Ar type
+Specify the reservation type.
+The reservation type may be specified by name or by number.
+If the desired reservation type isn't available by name, you may specify
+the number.
+Supported reservation type names:
+.Bl -tag -width 11n
+.It read_shared
+Read Shared mode.
+.It wr_ex
+Write Exclusive mode.
+May also be specified as
+.Dq write_exclusive .
+.It rd_ex
+Read Exclusive mode.
+May also be specified as
+.Dq read_exclusive .
+.It ex_ac
+Exclusive access mode.
+May also be specified as
+.Dq exclusive_access .
+.It wr_ex_ro
+Write Exclusive Registrants Only mode.
+May also be specified as
+.Dq write_exclusive_reg_only .
+.It ex_ac_ro
+Exclusive Access Registrants Only mode.
+May also be specified as
+.Dq exclusive_access_reg_only .
+.It wr_ex_ar
+Write Exclusive All Registrants mode.
+May also be specified as
+.Dq write_exclusive_all_regs .
+.It ex_ac_ar
+Exclusive Access All Registrants mode.
+May also be specified as
+.Dq exclusive_access_all_regs .
+.El
+.It Fl U
+Specify that the target should unregister the initiator that sent
+the Register and Move request.
+By default, the target will not unregister the initiator that sends the
+Register and Move request.
+This option only applies to the Register and Move service action of the
+Persistent Reserve Out command.
+.El
.It Ic help
Print out verbose usage information.
.El
@@ -1639,6 +1924,66 @@ power-on or hardware reset!
.Pp
.Em DO NOT
use this on a device which has an active filesystem!
+.Pp
+.Bd -literal -offset indent
+camcontrol persist da0 -v -i read_keys
+.Ed
+.Pp
+This will read any persistent reservation keys registered with da0, and
+display any errors encountered when sending the PERSISTENT RESERVE IN
+.Tn SCSI
+command.
+.Bd -literal -offset indent
+camcontrol persist da0 -v -o register -a -K 0x12345678
+.Ed
+.Pp
+This will register the persistent reservation key 0x12345678 with da0,
+apply that registration to all ports on da0, and display any errors that
+occur when sending the PERSISTENT RESERVE OUT command.
+.Bd -literal -offset indent
+camcontrol persist da0 -v -o reserve -s lun -k 0x12345678 -T ex_ac
+.Ed
+.Pp
+This will reserve da0 for the exlusive use of the initiator issuing the
+command.
+The scope of the reservation is the entire LUN.
+Any errors sending the PERSISTENT RESERVE OUT command will be displayed.
+.Bd -literal -offset indent
+camcontrol persist da0 -v -i read_full
+.Ed
+.Pp
+This will display the full status of all reservations on da0 and print out
+status if there are any errors.
+.Bd -literal -offset indent
+camcontrol persist da0 -v -o release -k 0x12345678 -T ex_ac
+.Ed
+.Pp
+This will release a reservation on da0 of the type ex_ac
+(Exclusive Access).
+The Reservation Key for this registration is 0x12345678.
+Any errors that occur will be displayed.
+.Bd -literal -offset indent
+camcontrol persist da0 -v -o register -K 0x12345678 -S \e
+ -I sas,0x1234567812345678 -I sas,0x8765432187654321
+.Ed
+.Pp
+This will register the key 0x12345678 with da0, specifying that it applies
+to the SAS initiators with SAS addresses 0x1234567812345678 and
+0x8765432187654321.
+.Bd -literal -offset indent
+camcontrol persist da0 -v -o register_move -k 0x87654321 \e
+ -K 0x12345678 -U -p -R 2 -I fcp,0x1234567812345678
+.Ed
+.Pp
+This will move the registration from the current initiator, whose
+Registration Key is 0x87654321, to the Fibre Channel initiator with the
+Fiber Channel World Wide Node Name 0x1234567812345678.
+A new registration key, 0x12345678, will be registered for the initiator
+with the Fibre Channel World Wide Node Name 0x1234567812345678, and the
+current initiator will be unregistered from the target.
+The reservation will be moved to relative target port 2 on the target
+device.
+The registration will persist across power losses.
.Sh SEE ALSO
.Xr cam 3 ,
.Xr cam_cdbparse 3 ,
@@ -1666,7 +2011,7 @@ and first appeared in
in
.Fx 2.0.5 .
.Sh AUTHORS
-.An Kenneth Merry Aq ken@FreeBSD.org
+.An Kenneth Merry Aq Mt ken@FreeBSD.org
.Sh BUGS
The code that parses the generic command line arguments does not know that
some of the subcommands take multiple arguments.
diff --git a/sbin/camcontrol/camcontrol.c b/sbin/camcontrol/camcontrol.c
index 6783bd3204c4..12a0e5c56849 100644
--- a/sbin/camcontrol/camcontrol.c
+++ b/sbin/camcontrol/camcontrol.c
@@ -96,6 +96,7 @@ typedef enum {
CAM_CMD_SECURITY = 0x0000001d,
CAM_CMD_HPA = 0x0000001e,
CAM_CMD_SANITIZE = 0x0000001f,
+ CAM_CMD_PERSIST = 0x00000020
} cam_cmdmask;
typedef enum {
@@ -218,6 +219,7 @@ static struct camcontrol_opts option_table[] = {
{"fwdownload", CAM_CMD_DOWNLOAD_FW, CAM_ARG_NONE, "f:ys"},
{"security", CAM_CMD_SECURITY, CAM_ARG_NONE, "d:e:fh:k:l:qs:T:U:y"},
{"hpa", CAM_CMD_HPA, CAM_ARG_NONE, "Pflp:qs:U:y"},
+ {"persist", CAM_CMD_PERSIST, CAM_ARG_NONE, "ai:I:k:K:o:ps:ST:U"},
#endif /* MINIMALISTIC */
{"help", CAM_CMD_USAGE, CAM_ARG_NONE, NULL},
{"-?", CAM_CMD_USAGE, CAM_ARG_NONE, NULL},
@@ -225,12 +227,6 @@ static struct camcontrol_opts option_table[] = {
{NULL, 0, 0, NULL}
};
-typedef enum {
- CC_OR_NOT_FOUND,
- CC_OR_AMBIGUOUS,
- CC_OR_FOUND
-} camcontrol_optret;
-
struct cam_devitem {
struct device_match_result dev_match;
int num_periphs;
@@ -7826,6 +7822,9 @@ usage(int printlong)
" [-U <user|master>] [-y]\n"
" camcontrol hpa [dev_id][generic args] [-f] [-l] [-P] [-p pwd]\n"
" [-q] [-s max_sectors] [-U pwd] [-y]\n"
+" camcontrol persist [dev_id][generic args] <-i action|-o action>\n"
+" [-a][-I tid][-k key][-K sa_key][-p][-R rtp]\n"
+" [-s scope][-S][-T type][-U]\n"
#endif /* MINIMALISTIC */
" camcontrol help\n");
if (!printlong)
@@ -7862,8 +7861,9 @@ usage(int printlong)
"idle send the ATA IDLE command to the named device\n"
"standby send the ATA STANDBY command to the named device\n"
"sleep send the ATA SLEEP command to the named device\n"
-"fwdownload program firmware of the named device with the given image"
+"fwdownload program firmware of the named device with the given image\n"
"security report or send ATA security commands to the named device\n"
+"persist send the SCSI PERSISTENT RESERVE IN or OUT commands\n"
"help this message\n"
"Device Identifiers:\n"
"bus:target specify the bus and target, lun defaults to 0\n"
@@ -7998,6 +7998,22 @@ usage(int printlong)
" device\n"
"-U pwd unlock the HPA configuration of the device\n"
"-y don't ask any questions\n"
+"persist arguments:\n"
+"-i action specify read_keys, read_reservation, report_cap, or\n"
+" read_full_status\n"
+"-o action specify register, register_ignore, reserve, release,\n"
+" clear, preempt, preempt_abort, register_move, replace_lost\n"
+"-a set the All Target Ports (ALL_TG_PT) bit\n"
+"-I tid specify a Transport ID, e.g.: sas,0x1234567812345678\n"
+"-k key specify the Reservation Key\n"
+"-K sa_key specify the Service Action Reservation Key\n"
+"-p set the Activate Persist Through Power Loss bit\n"
+"-R rtp specify the Relative Target Port\n"
+"-s scope specify the scope: lun, extent, element or a number\n"
+"-S specify Transport ID for register, requires -I\n"
+"-T res_type specify the reservation type: read_shared, wr_ex, rd_ex,\n"
+" ex_ac, wr_ex_ro, ex_ac_ro, wr_ex_ar, ex_ac_ar\n"
+"-U unregister the current initiator for register_move\n"
);
#endif /* MINIMALISTIC */
}
@@ -8332,6 +8348,11 @@ main(int argc, char **argv)
error = scsisanitize(cam_dev, argc, argv,
combinedopt, retry_count, timeout);
break;
+ case CAM_CMD_PERSIST:
+ error = scsipersist(cam_dev, argc, argv, combinedopt,
+ retry_count, timeout, arglist & CAM_ARG_VERBOSE,
+ arglist & CAM_ARG_ERR_RECOVER);
+ break;
#endif /* MINIMALISTIC */
case CAM_CMD_USAGE:
usage(1);
diff --git a/sbin/camcontrol/camcontrol.h b/sbin/camcontrol/camcontrol.h
index 616236a8b762..7c249bfbcfa8 100644
--- a/sbin/camcontrol/camcontrol.h
+++ b/sbin/camcontrol/camcontrol.h
@@ -30,6 +30,13 @@
#ifndef _CAMCONTROL_H
#define _CAMCONTROL_H
+
+typedef enum {
+ CC_OR_NOT_FOUND,
+ CC_OR_AMBIGUOUS,
+ CC_OR_FOUND
+} camcontrol_optret;
+
/*
* get_hook: Structure for evaluating args in a callback.
*/
@@ -56,6 +63,9 @@ void mode_list(struct cam_device *device, int page_control, int dbd,
int retry_count, int timeout);
int scsidoinquiry(struct cam_device *device, int argc, char **argv,
char *combinedopt, int retry_count, int timeout);
+int scsipersist(struct cam_device *device, int argc, char **argv,
+ char *combinedopt, int retry_count, int timeout, int verbose,
+ int err_recover);
char *cget(void *hook, char *name);
int iget(void *hook, char *name);
void arg_put(void *hook, int letter, void *arg, int count, char *name);
diff --git a/sbin/camcontrol/persist.c b/sbin/camcontrol/persist.c
new file mode 100644
index 000000000000..bcc1073d2c05
--- /dev/null
+++ b/sbin/camcontrol/persist.c
@@ -0,0 +1,966 @@
+/*-
+ * Copyright (c) 2013 Spectra Logic Corporation
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions, and the following disclaimer,
+ * without modification.
+ * 2. Redistributions in binary form must reproduce at minimum a disclaimer
+ * substantially similar to the "NO WARRANTY" disclaimer below
+ * ("Disclaimer") and any redistribution must be conditioned upon
+ * including a substantially similar Disclaimer requirement for further
+ * binary redistribution.
+ *
+ * NO WARRANTY
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDERS OR CONTRIBUTORS BE LIABLE FOR 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 DAMAGES.
+ *
+ * Authors: Ken Merry (Spectra Logic Corporation)
+ */
+/*
+ * SCSI Persistent Reservation support for camcontrol(8).
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <sys/ioctl.h>
+#include <sys/stdint.h>
+#include <sys/types.h>
+#include <sys/endian.h>
+#include <sys/sbuf.h>
+#include <sys/queue.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <inttypes.h>
+#include <unistd.h>
+#include <string.h>
+#include <strings.h>
+#include <fcntl.h>
+#include <ctype.h>
+#include <limits.h>
+#include <err.h>
+
+#include <cam/cam.h>
+#include <cam/cam_debug.h>
+#include <cam/cam_ccb.h>
+#include <cam/scsi/scsi_all.h>
+#include <cam/scsi/scsi_pass.h>
+#include <cam/scsi/scsi_message.h>
+#include <camlib.h>
+#include "camcontrol.h"
+
+struct persist_transport_id {
+ struct scsi_transportid_header *hdr;
+ unsigned int alloc_len;
+ STAILQ_ENTRY(persist_transport_id) links;
+};
+
+/*
+ * Service Actions for PERSISTENT RESERVE IN.
+ */
+static struct scsi_nv persist_in_actions[] = {
+ { "read_keys", SPRI_RK },
+ { "read_reservation", SPRI_RR },
+ { "report_capabilities", SPRI_RC },
+ { "read_full_status", SPRI_RS }
+};
+
+/*
+ * Service Actions for PERSISTENT RESERVE OUT.
+ */
+static struct scsi_nv persist_out_actions[] = {
+ { "register", SPRO_REGISTER },
+ { "reserve", SPRO_RESERVE },
+ { "release" , SPRO_RELEASE },
+ { "clear", SPRO_CLEAR },
+ { "preempt", SPRO_PREEMPT },
+ { "preempt_abort", SPRO_PRE_ABO },
+ { "register_ignore", SPRO_REG_IGNO },
+ { "register_move", SPRO_REG_MOVE },
+ { "replace_lost", SPRO_REPL_LOST_RES }
+};
+
+/*
+ * Known reservation scopes. As of SPC-4, only LU_SCOPE is used in the
+ * spec. The others are obsolete.
+ */
+static struct scsi_nv persist_scope_table[] = {
+ { "lun", SPR_LU_SCOPE },
+ { "extent", SPR_EXTENT_SCOPE },
+ { "element", SPR_ELEMENT_SCOPE }
+};
+
+/*
+ * Reservation types. The longer name for a given reservation type is
+ * listed first, so that it makes more sense when we print out the
+ * reservation type. We step through the table linearly when looking for
+ * the text name for a particular numeric reservation type value.
+ */
+static struct scsi_nv persist_type_table[] = {
+ { "read_shared", SPR_TYPE_RD_SHARED },
+ { "write_exclusive", SPR_TYPE_WR_EX },
+ { "wr_ex", SPR_TYPE_WR_EX },
+ { "read_exclusive", SPR_TYPE_RD_EX },
+ { "rd_ex", SPR_TYPE_RD_EX },
+ { "exclusive_access", SPR_TYPE_EX_AC },
+ { "ex_ac", SPR_TYPE_EX_AC },
+ { "write_exclusive_reg_only", SPR_TYPE_WR_EX_RO },
+ { "wr_ex_ro", SPR_TYPE_WR_EX_RO },
+ { "exclusive_access_reg_only", SPR_TYPE_EX_AC_RO },
+ { "ex_ac_ro", SPR_TYPE_EX_AC_RO },
+ { "write_exclusive_all_regs", SPR_TYPE_WR_EX_AR },
+ { "wr_ex_ar", SPR_TYPE_WR_EX_AR },
+ { "exclusive_access_all_regs", SPR_TYPE_EX_AC_AR },
+ { "ex_ac_ar", SPR_TYPE_EX_AC_AR }
+};
+
+/*
+ * Print out the standard scope/type field.
+ */
+static void
+persist_print_scopetype(uint8_t scopetype)
+{
+ const char *tmpstr;
+ int num_entries;
+
+ num_entries = sizeof(persist_scope_table) /
+ sizeof(persist_scope_table[0]);
+ tmpstr = scsi_nv_to_str(persist_scope_table, num_entries,
+ scopetype & SPR_SCOPE_MASK);
+ fprintf(stdout, "Scope: %s (%#x)\n", (tmpstr != NULL) ? tmpstr :
+ "Unknown", (scopetype & SPR_SCOPE_MASK) >> SPR_SCOPE_SHIFT);
+
+ num_entries = sizeof(persist_type_table) /
+ sizeof(persist_type_table[0]);
+ tmpstr = scsi_nv_to_str(persist_type_table, num_entries,
+ scopetype & SPR_TYPE_MASK);
+ fprintf(stdout, "Type: %s (%#x)\n", (tmpstr != NULL) ? tmpstr :
+ "Unknown", scopetype & SPR_TYPE_MASK);
+}
+
+static void
+persist_print_transportid(uint8_t *buf, uint32_t len)
+{
+ struct sbuf *sb;
+
+ sb = sbuf_new_auto();
+ if (sb == NULL)
+ fprintf(stderr, "Unable to allocate sbuf\n");
+
+ scsi_transportid_sbuf(sb, (struct scsi_transportid_header *)buf, len);
+
+ sbuf_finish(sb);
+
+ fprintf(stdout, "%s\n", sbuf_data(sb));
+
+ sbuf_delete(sb);
+}
+
+/*
+ * Print out a persistent reservation. This is used with the READ
+ * RESERVATION (0x01) service action of the PERSISTENT RESERVE IN command.
+ */
+static void
+persist_print_res(struct scsi_per_res_in_header *hdr, uint32_t valid_len)
+{
+ uint32_t length;
+ struct scsi_per_res_in_rsrv *res;
+
+ length = scsi_4btoul(hdr->length);
+ length = MIN(length, valid_len);
+
+ res = (struct scsi_per_res_in_rsrv *)hdr;
+
+ if (length < sizeof(res->data) - sizeof(res->data.extent_length)) {
+ if (length == 0)
+ fprintf(stdout, "No reservations.\n");
+ else
+ warnx("unable to print reservation, only got %u "
+ "valid bytes", length);
+ return;
+ }
+ fprintf(stdout, "PRgeneration: %#x\n",
+ scsi_4btoul(res->header.generation));
+ fprintf(stdout, "Reservation Key: %#jx\n",
+ (uintmax_t)scsi_8btou64(res->data.reservation));
+ fprintf(stdout, "Scope address: %#x\n",
+ scsi_4btoul(res->data.scope_addr));
+
+ persist_print_scopetype(res->data.scopetype);
+
+ fprintf(stdout, "Extent length: %u\n",
+ scsi_2btoul(res->data.extent_length));
+}
+
+/*
+ * Print out persistent reservation keys. This is used with the READ KEYS
+ * service action of the PERSISTENT RESERVE IN command.
+ */
+static void
+persist_print_keys(struct scsi_per_res_in_header *hdr, uint32_t valid_len)
+{
+ uint32_t length, num_keys, i;
+ struct scsi_per_res_key *key;
+
+ length = scsi_4btoul(hdr->length);
+ length = MIN(length, valid_len);
+
+ num_keys = length / sizeof(*key);
+
+ fprintf(stdout, "PRgeneration: %#x\n", scsi_4btoul(hdr->generation));
+ fprintf(stdout, "%u key%s%s\n", num_keys, (num_keys == 1) ? "" : "s",
+ (num_keys == 0) ? "." : ":");
+
+ for (i = 0, key = (struct scsi_per_res_key *)&hdr[1]; i < num_keys;
+ i++, key++) {
+ fprintf(stdout, "%u: %#jx\n", i,
+ (uintmax_t)scsi_8btou64(key->key));
+ }
+}
+
+/*
+ * Print out persistent reservation capabilities. This is used with the
+ * REPORT CAPABILITIES service action of the PERSISTENT RESERVE IN command.
+ */
+static void
+persist_print_cap(struct scsi_per_res_cap *cap, uint32_t valid_len)
+{
+ uint32_t length;
+ int check_type_mask = 0;
+
+ length = scsi_2btoul(cap->length);
+ length = MIN(length, valid_len);
+
+ if (length < __offsetof(struct scsi_per_res_cap, type_mask)) {
+ fprintf(stdout, "Insufficient data (%u bytes) to report "
+ "full capabilities\n", length);
+ return;
+ }
+ if (length >= __offsetof(struct scsi_per_res_cap, reserved))
+ check_type_mask = 1;
+
+ fprintf(stdout, "Replace Lost Reservation Capable (RLR_C): %d\n",
+ (cap->flags1 & SPRI_RLR_C) ? 1 : 0);
+ fprintf(stdout, "Compatible Reservation Handling (CRH): %d\n",
+ (cap->flags1 & SPRI_CRH) ? 1 : 0);
+ fprintf(stdout, "Specify Initiator Ports Capable (SIP_C): %d\n",
+ (cap->flags1 & SPRI_SIP_C) ? 1 : 0);
+ fprintf(stdout, "All Target Ports Capable (ATP_C): %d\n",
+ (cap->flags1 & SPRI_ATP_C) ? 1 : 0);
+ fprintf(stdout, "Persist Through Power Loss Capable (PTPL_C): %d\n",
+ (cap->flags1 & SPRI_PTPL_C) ? 1 : 0);
+ fprintf(stdout, "ALLOW COMMANDS field: (%#x)\n",
+ (cap->flags2 & SPRI_ALLOW_CMD_MASK) >> SPRI_ALLOW_CMD_SHIFT);
+ /*
+ * These cases are cut-and-pasted from SPC4r36l. There is no
+ * succinct way to describe these otherwise, and even with the
+ * verbose description, the user will probably have to refer to
+ * the spec to fully understand what is going on.
+ */
+ switch (cap->flags2 & SPRI_ALLOW_CMD_MASK) {
+ case SPRI_ALLOW_1:
+ fprintf(stdout,
+" The device server allows the TEST UNIT READY command through Write\n"
+" Exclusive type reservations and Exclusive Access type reservations\n"
+" and does not provide information about whether the following commands\n"
+" are allowed through Write Exclusive type reservations:\n"
+" a) the MODE SENSE command, READ ATTRIBUTE command, READ BUFFER\n"
+" command, RECEIVE COPY RESULTS command, RECEIVE DIAGNOSTIC\n"
+" RESULTS command, REPORT SUPPORTED OPERATION CODES command,\n"
+" and REPORT SUPPORTED TASK MANAGEMENT FUNCTION command; and\n"
+" b) the READ DEFECT DATA command (see SBC-3).\n");
+ break;
+ case SPRI_ALLOW_2:
+ fprintf(stdout,
+" The device server allows the TEST UNIT READY command through Write\n"
+" Exclusive type reservations and Exclusive Access type reservations\n"
+" and does not allow the following commands through Write Exclusive type\n"
+" reservations:\n"
+" a) the MODE SENSE command, READ ATTRIBUTE command, READ BUFFER\n"
+" command, RECEIVE DIAGNOSTIC RESULTS command, REPORT SUPPORTED\n"
+" OPERATION CODES command, and REPORT SUPPORTED TASK MANAGEMENT\n"
+" FUNCTION command; and\n"
+" b) the READ DEFECT DATA command.\n"
+" The device server does not allow the RECEIVE COPY RESULTS command\n"
+" through Write Exclusive type reservations or Exclusive Access type\n"
+" reservations.\n");
+ break;
+ case SPRI_ALLOW_3:
+ fprintf(stdout,
+" The device server allows the TEST UNIT READY command through Write\n"
+" Exclusive type reservations and Exclusive Access type reservations\n"
+" and allows the following commands through Write Exclusive type\n"
+" reservations:\n"
+" a) the MODE SENSE command, READ ATTRIBUTE command, READ BUFFER\n"
+" command, RECEIVE DIAGNOSTIC RESULTS command, REPORT SUPPORTED\n"
+" OPERATION CODES command, and REPORT SUPPORTED TASK MANAGEMENT\n"
+" FUNCTION command; and\n"
+" b) the READ DEFECT DATA command.\n"
+" The device server does not allow the RECEIVE COPY RESULTS command\n"
+" through Write Exclusive type reservations or Exclusive Access type\n"
+" reservations.\n");
+ break;
+ case SPRI_ALLOW_4:
+ fprintf(stdout,
+" The device server allows the TEST UNIT READY command and the RECEIVE\n"
+" COPY RESULTS command through Write Exclusive type reservations and\n"
+" Exclusive Access type reservations and allows the following commands\n"
+" through Write Exclusive type reservations:\n"
+" a) the MODE SENSE command, READ ATTRIBUTE command, READ BUFFER\n"
+" command, RECEIVE DIAGNOSTIC RESULTS command, REPORT SUPPORTED\n"
+" OPERATION CODES command, and REPORT SUPPORTED TASK MANAGEMENT\n"
+" FUNCTION command; and\n"
+" b) the READ DEFECT DATA command.\n");
+ break;
+ case SPRI_ALLOW_NA:
+ fprintf(stdout,
+" No information is provided about whether certain commands are allowed\n"
+" through certain types of persistent reservations.\n");
+ break;
+ default:
+ fprintf(stdout,
+" Unknown ALLOW COMMANDS value %#x\n",
+ (cap->flags2 & SPRI_ALLOW_CMD_MASK) >>
+ SPRI_ALLOW_CMD_SHIFT);
+ break;
+ }
+ fprintf(stdout, "Persist Through Power Loss Activated (PTPL_A): %d\n",
+ (cap->flags2 & SPRI_PTPL_A) ? 1 : 0);
+ if ((check_type_mask != 0)
+ && (cap->flags2 & SPRI_TMV)) {
+ fprintf(stdout, "Supported Persistent Reservation Types:\n");
+ fprintf(stdout, " Write Exclusive - All Registrants "
+ "(WR_EX_AR): %d\n",
+ (cap->type_mask[0] & SPRI_TM_WR_EX_AR)? 1 : 0);
+ fprintf(stdout, " Exclusive Access - Registrants Only "
+ "(EX_AC_RO): %d\n",
+ (cap->type_mask[0] & SPRI_TM_EX_AC_RO) ? 1 : 0);
+ fprintf(stdout, " Write Exclusive - Registrants Only "
+ "(WR_EX_RO): %d\n",
+ (cap->type_mask[0] & SPRI_TM_WR_EX_RO)? 1 : 0);
+ fprintf(stdout, " Exclusive Access (EX_AC): %d\n",
+ (cap->type_mask[0] & SPRI_TM_EX_AC) ? 1 : 0);
+ fprintf(stdout, " Write Exclusive (WR_EX): %d\n",
+ (cap->type_mask[0] & SPRI_TM_WR_EX) ? 1 : 0);
+ fprintf(stdout, " Exclusive Access - All Registrants "
+ "(EX_AC_AR): %d\n",
+ (cap->type_mask[1] & SPRI_TM_EX_AC_AR) ? 1 : 0);
+ } else {
+ fprintf(stdout, "Persistent Reservation Type Mask is NOT "
+ "valid\n");
+ }
+
+
+}
+
+static void
+persist_print_full(struct scsi_per_res_in_header *hdr, uint32_t valid_len)
+{
+ uint32_t length, len_to_go = 0;
+ struct scsi_per_res_in_full_desc *desc;
+ uint8_t *cur_pos;
+ int i;
+
+ length = scsi_4btoul(hdr->length);
+ length = MIN(length, valid_len);
+
+ if (length < sizeof(*desc)) {
+ if (length == 0)
+ fprintf(stdout, "No reservations.\n");
+ else
+ warnx("unable to print reservation, only got %u "
+ "valid bytes", length);
+ return;
+ }
+
+ fprintf(stdout, "PRgeneration: %#x\n", scsi_4btoul(hdr->generation));
+ cur_pos = (uint8_t *)&hdr[1];
+ for (len_to_go = length, i = 0,
+ desc = (struct scsi_per_res_in_full_desc *)cur_pos;
+ len_to_go >= sizeof(*desc);
+ desc = (struct scsi_per_res_in_full_desc *)cur_pos, i++) {
+ uint32_t additional_length, cur_length;
+
+
+ fprintf(stdout, "Reservation Key: %#jx\n",
+ (uintmax_t)scsi_8btou64(desc->res_key.key));
+ fprintf(stdout, "All Target Ports (ALL_TG_PT): %d\n",
+ (desc->flags & SPRI_FULL_ALL_TG_PT) ? 1 : 0);
+ fprintf(stdout, "Reservation Holder (R_HOLDER): %d\n",
+ (desc->flags & SPRI_FULL_R_HOLDER) ? 1 : 0);
+
+ if (desc->flags & SPRI_FULL_R_HOLDER)
+ persist_print_scopetype(desc->scopetype);
+
+ if ((desc->flags & SPRI_FULL_ALL_TG_PT) == 0)
+ fprintf(stdout, "Relative Target Port ID: %#x\n",
+ scsi_2btoul(desc->rel_trgt_port_id));
+
+ additional_length = scsi_4btoul(desc->additional_length);
+
+ persist_print_transportid(desc->transport_id,
+ additional_length);
+
+ cur_length = sizeof(*desc) + additional_length;
+ len_to_go -= cur_length;
+ cur_pos += cur_length;
+ }
+}
+
+int
+scsipersist(struct cam_device *device, int argc, char **argv, char *combinedopt,
+ int retry_count, int timeout, int verbosemode, int err_recover)
+{
+ union ccb *ccb = NULL;
+ int c, in = 0, out = 0;
+ int action = -1, num_ids = 0;
+ int error = 0;
+ uint32_t res_len = 0;
+ unsigned long rel_tgt_port = 0;
+ uint8_t *res_buf = NULL;
+ int scope = SPR_LU_SCOPE, res_type = 0, key_set = 0, sa_key_set = 0;
+ struct persist_transport_id *id, *id2;
+ STAILQ_HEAD(, persist_transport_id) transport_id_list;
+ uint64_t key = 0, sa_key = 0;
+ struct scsi_nv *table = NULL;
+ size_t table_size = 0, id_len = 0;
+ uint32_t valid_len = 0;
+ int all_tg_pt = 0, aptpl = 0, spec_i_pt = 0, unreg = 0,rel_port_set = 0;
+
+ STAILQ_INIT(&transport_id_list);
+
+ ccb = cam_getccb(device);
+ if (ccb == NULL) {
+ warnx("%s: error allocating CCB", __func__);
+ error = 1;
+ goto bailout;
+ }
+
+ bzero(&(&ccb->ccb_h)[1],
+ sizeof(union ccb) - sizeof(struct ccb_hdr));
+
+ while ((c = getopt(argc, argv, combinedopt)) != -1) {
+ switch (c) {
+ case 'a':
+ all_tg_pt = 1;
+ break;
+ case 'I': {
+ int error_str_len = 128;
+ char error_str[error_str_len];
+ char *id_str;
+
+ id = malloc(sizeof(*id));
+ if (id == NULL) {
+ warnx("%s: error allocating %zu bytes",
+ __func__, sizeof(*id));
+ error = 1;
+ goto bailout;
+ }
+ bzero(id, sizeof(*id));
+
+ id_str = strdup(optarg);
+ if (id_str == NULL) {
+ warnx("%s: error duplicating string %s",
+ __func__, optarg);
+ free(id);
+ error = 1;
+ goto bailout;
+ }
+ error = scsi_parse_transportid(id_str, &id->hdr,
+ &id->alloc_len, error_str, error_str_len);
+ if (error != 0) {
+ warnx("%s", error_str);
+ error = 1;
+ free(id);
+ free(id_str);
+ goto bailout;
+ }
+ free(id_str);
+
+ STAILQ_INSERT_TAIL(&transport_id_list, id, links);
+ num_ids++;
+ id_len += id->alloc_len;
+ break;
+ }
+ case 'k':
+ case 'K': {
+ char *endptr;
+ uint64_t tmpval;
+
+ tmpval = strtoumax(optarg, &endptr, 0);
+ if (*endptr != '\0') {
+ warnx("%s: invalid key argument %s", __func__,
+ optarg);
+ error = 1;
+ goto bailout;
+ }
+ if (c == 'k') {
+ key = tmpval;
+ key_set = 1;
+ } else {
+ sa_key = tmpval;
+ sa_key_set = 1;
+ }
+ break;
+ }
+ case 'i':
+ case 'o': {
+ scsi_nv_status status;
+ int table_entry = 0;
+
+ if (c == 'i') {
+ in = 1;
+ table = persist_in_actions;
+ table_size = sizeof(persist_in_actions) /
+ sizeof(persist_in_actions[0]);
+ } else {
+ out = 1;
+ table = persist_out_actions;
+ table_size = sizeof(persist_out_actions) /
+ sizeof(persist_out_actions[0]);
+ }
+
+ if ((in + out) > 1) {
+ warnx("%s: only one in (-i) or out (-o) "
+ "action is allowed", __func__);
+ error = 1;
+ goto bailout;
+ }
+
+ status = scsi_get_nv(table, table_size, optarg,
+ &table_entry,SCSI_NV_FLAG_IG_CASE);
+ if (status == SCSI_NV_FOUND)
+ action = table[table_entry].value;
+ else {
+ warnx("%s: %s %s option %s", __func__,
+ (status == SCSI_NV_AMBIGUOUS) ?
+ "ambiguous" : "invalid", in ? "in" :
+ "out", optarg);
+ error = 1;
+ goto bailout;
+ }
+ break;
+ }
+ case 'p':
+ aptpl = 1;
+ break;
+ case 'R': {
+ char *endptr;
+
+ rel_tgt_port = strtoul(optarg, &endptr, 0);
+ if (*endptr != '\0') {
+ warnx("%s: invalid relative target port %s",
+ __func__, optarg);
+ error = 1;
+ goto bailout;
+ }
+ rel_port_set = 1;
+ break;
+ }
+ case 's': {
+ size_t scope_size;
+ struct scsi_nv *scope_table = NULL;
+ scsi_nv_status status;
+ int table_entry = 0;
+ char *endptr;
+
+ /*
+ * First check to see if the user gave us a numeric
+ * argument. If so, we'll try using it.
+ */
+ if (isdigit(optarg[0])) {
+ scope = strtol(optarg, &endptr, 0);
+ if (*endptr != '\0') {
+ warnx("%s: invalid scope %s",
+ __func__, optarg);
+ error = 1;
+ goto bailout;
+ }
+ scope = (scope << SPR_SCOPE_SHIFT) &
+ SPR_SCOPE_MASK;
+ break;
+ }
+
+ scope_size = sizeof(persist_scope_table) /
+ sizeof(persist_scope_table[0]);
+ scope_table = persist_scope_table;
+ status = scsi_get_nv(scope_table, scope_size, optarg,
+ &table_entry,SCSI_NV_FLAG_IG_CASE);
+ if (status == SCSI_NV_FOUND)
+ scope = scope_table[table_entry].value;
+ else {
+ warnx("%s: %s scope %s", __func__,
+ (status == SCSI_NV_AMBIGUOUS) ?
+ "ambiguous" : "invalid", optarg);
+ error = 1;
+ goto bailout;
+ }
+ break;
+ }
+ case 'S':
+ spec_i_pt = 1;
+ break;
+ case 'T': {
+ size_t res_type_size;
+ struct scsi_nv *rtype_table = NULL;
+ scsi_nv_status status;
+ char *endptr;
+ int table_entry = 0;
+
+ /*
+ * First check to see if the user gave us a numeric
+ * argument. If so, we'll try using it.
+ */
+ if (isdigit(optarg[0])) {
+ res_type = strtol(optarg, &endptr, 0);
+ if (*endptr != '\0') {
+ warnx("%s: invalid reservation type %s",
+ __func__, optarg);
+ error = 1;
+ goto bailout;
+ }
+ break;
+ }
+
+ res_type_size = sizeof(persist_type_table) /
+ sizeof(persist_type_table[0]);
+ rtype_table = persist_type_table;
+ status = scsi_get_nv(rtype_table, res_type_size,
+ optarg, &table_entry,
+ SCSI_NV_FLAG_IG_CASE);
+ if (status == SCSI_NV_FOUND)
+ res_type = rtype_table[table_entry].value;
+ else {
+ warnx("%s: %s reservation type %s", __func__,
+ (status == SCSI_NV_AMBIGUOUS) ?
+ "ambiguous" : "invalid", optarg);
+ error = 1;
+ goto bailout;
+ }
+ break;
+ }
+ case 'U':
+ unreg = 1;
+ break;
+ default:
+ break;
+ }
+ }
+
+ if ((in + out) != 1) {
+ warnx("%s: you must specify one of -i or -o", __func__);
+ error = 1;
+ goto bailout;
+ }
+
+ /*
+ * Note that we don't really try to figure out whether the user
+ * needs to specify one or both keys. There are a number of
+ * scenarios, and sometimes 0 is a valid and desired value.
+ */
+ if (in != 0) {
+ switch (action) {
+ case SPRI_RK:
+ case SPRI_RR:
+ case SPRI_RS:
+ /*
+ * Allocate the maximum length possible for these
+ * service actions. According to the spec, the
+ * target is supposed to return the available
+ * length in the header, regardless of the
+ * allocation length. In practice, though, with
+ * the READ FULL STATUS (SPRI_RS) service action,
+ * some Seagate drives (in particular a
+ * Constellation ES, <SEAGATE ST32000444SS 0006>)
+ * don't return the available length if you only
+ * allocate the length of the header. So just
+ * allocate the maximum here so we don't miss
+ * anything.
+ */
+ res_len = SPRI_MAX_LEN;
+ break;
+ case SPRI_RC:
+ res_len = sizeof(struct scsi_per_res_cap);
+ break;
+ default:
+ /* In theory we should catch this above */
+ warnx("%s: invalid action %d", __func__, action);
+ error = 1;
+ goto bailout;
+ break;
+ }
+ } else {
+
+ /*
+ * XXX KDM need to add length for transport IDs for the
+ * register and move service action and the register
+ * service action with the SPEC_I_PT bit set.
+ */
+ if (action == SPRO_REG_MOVE) {
+ if (num_ids != 1) {
+ warnx("%s: register and move requires a "
+ "single transport ID (-I)", __func__);
+ error = 1;
+ goto bailout;
+ }
+ if (rel_port_set == 0) {
+ warnx("%s: register and move requires a "
+ "relative target port (-R)", __func__);
+ error = 1;
+ goto bailout;
+ }
+ res_len = sizeof(struct scsi_per_res_reg_move) + id_len;
+ } else {
+ res_len = sizeof(struct scsi_per_res_out_parms);
+ if ((action == SPRO_REGISTER)
+ && (num_ids != 0)) {
+ /*
+ * If the user specifies any IDs with the
+ * register service action, turn on the
+ * spec_i_pt bit.
+ */
+ spec_i_pt = 1;
+ res_len += id_len;
+ res_len +=
+ sizeof(struct scsi_per_res_out_trans_ids);
+ }
+ }
+ }
+retry:
+ if (res_buf != NULL) {
+ free(res_buf);
+ res_buf = NULL;
+ }
+ res_buf = malloc(res_len);
+ if (res_buf == NULL) {
+ warn("%s: error allocating %d bytes", __func__, res_len);
+ error = 1;
+ goto bailout;
+ }
+ bzero(res_buf, res_len);
+
+ if (in != 0) {
+ scsi_persistent_reserve_in(&ccb->csio,
+ /*retries*/ retry_count,
+ /*cbfcnp*/ NULL,
+ /*tag_action*/ MSG_SIMPLE_Q_TAG,
+ /*service_action*/ action,
+ /*data_ptr*/ res_buf,
+ /*dxfer_len*/ res_len,
+ /*sense_len*/ SSD_FULL_SIZE,
+ /*timeout*/ timeout ? timeout :5000);
+
+ } else {
+ switch (action) {
+ case SPRO_REGISTER:
+ if (spec_i_pt != 0) {
+ struct scsi_per_res_out_trans_ids *id_hdr;
+ uint8_t *bufptr;
+
+ bufptr = res_buf +
+ sizeof(struct scsi_per_res_out_parms) +
+ sizeof(struct scsi_per_res_out_trans_ids);
+ STAILQ_FOREACH(id, &transport_id_list, links) {
+ bcopy(id->hdr, bufptr, id->alloc_len);
+ bufptr += id->alloc_len;
+ }
+ id_hdr = (struct scsi_per_res_out_trans_ids *)
+ (res_buf +
+ sizeof(struct scsi_per_res_out_parms));
+ scsi_ulto4b(id_len, id_hdr->additional_length);
+ }
+ case SPRO_REG_IGNO:
+ case SPRO_PREEMPT:
+ case SPRO_PRE_ABO:
+ case SPRO_RESERVE:
+ case SPRO_RELEASE:
+ case SPRO_CLEAR:
+ case SPRO_REPL_LOST_RES: {
+ struct scsi_per_res_out_parms *parms;
+
+ parms = (struct scsi_per_res_out_parms *)res_buf;
+
+ scsi_u64to8b(key, parms->res_key.key);
+ scsi_u64to8b(sa_key, parms->serv_act_res_key);
+ if (spec_i_pt != 0)
+ parms->flags |= SPR_SPEC_I_PT;
+ if (all_tg_pt != 0)
+ parms->flags |= SPR_ALL_TG_PT;
+ if (aptpl != 0)
+ parms->flags |= SPR_APTPL;
+ break;
+ }
+ case SPRO_REG_MOVE: {
+ struct scsi_per_res_reg_move *reg_move;
+ uint8_t *bufptr;
+
+ reg_move = (struct scsi_per_res_reg_move *)res_buf;
+
+ scsi_u64to8b(key, reg_move->res_key.key);
+ scsi_u64to8b(sa_key, reg_move->serv_act_res_key);
+ if (unreg != 0)
+ reg_move->flags |= SPR_REG_MOVE_UNREG;
+ if (aptpl != 0)
+ reg_move->flags |= SPR_REG_MOVE_APTPL;
+ scsi_ulto2b(rel_tgt_port, reg_move->rel_trgt_port_id);
+ id = STAILQ_FIRST(&transport_id_list);
+ /*
+ * This shouldn't happen, since we already checked
+ * the number of IDs above.
+ */
+ if (id == NULL) {
+ warnx("%s: No transport IDs found!", __func__);
+ error = 1;
+ goto bailout;
+ }
+ bufptr = (uint8_t *)&reg_move[1];
+ bcopy(id->hdr, bufptr, id->alloc_len);
+ scsi_ulto4b(id->alloc_len,
+ reg_move->transport_id_length);
+ break;
+ }
+ default:
+ break;
+ }
+ scsi_persistent_reserve_out(&ccb->csio,
+ /*retries*/ retry_count,
+ /*cbfcnp*/ NULL,
+ /*tag_action*/ MSG_SIMPLE_Q_TAG,
+ /*service_action*/ action,
+ /*scope*/ scope,
+ /*res_type*/ res_type,
+ /*data_ptr*/ res_buf,
+ /*dxfer_len*/ res_len,
+ /*sense_len*/ SSD_FULL_SIZE,
+ /*timeout*/ timeout ?timeout :5000);
+ }
+
+ /* Disable freezing the device queue */
+ ccb->ccb_h.flags |= CAM_DEV_QFRZDIS;
+
+ if (err_recover != 0)
+ ccb->ccb_h.flags |= CAM_PASS_ERR_RECOVER;
+
+ if (cam_send_ccb(device, ccb) < 0) {
+ warn("error sending PERSISTENT RESERVE %s", (in != 0) ?
+ "IN" : "OUT");
+
+ if (verbosemode != 0) {
+ cam_error_print(device, ccb, CAM_ESF_ALL,
+ CAM_EPF_ALL, stderr);
+ }
+
+ error = 1;
+ goto bailout;
+ }
+
+ if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) {
+ if (verbosemode != 0) {
+ cam_error_print(device, ccb, CAM_ESF_ALL,
+ CAM_EPF_ALL, stderr);
+ }
+ error = 1;
+ goto bailout;
+ }
+
+ if (in == 0)
+ goto bailout;
+
+ valid_len = res_len - ccb->csio.resid;
+
+ switch (action) {
+ case SPRI_RK:
+ case SPRI_RR:
+ case SPRI_RS: {
+ struct scsi_per_res_in_header *hdr;
+ uint32_t hdr_len;
+
+ if (valid_len < sizeof(*hdr)) {
+ warnx("%s: only got %d valid bytes, need %zd",
+ __func__, valid_len, sizeof(*hdr));
+ error = 1;
+ goto bailout;
+ }
+ hdr = (struct scsi_per_res_in_header *)res_buf;
+ hdr_len = scsi_4btoul(hdr->length);
+
+ if (hdr_len > (res_len - sizeof(*hdr))) {
+ res_len = hdr_len + sizeof(*hdr);
+ goto retry;
+ }
+
+ if (action == SPRI_RK) {
+ persist_print_keys(hdr, valid_len);
+ } else if (action == SPRI_RR) {
+ persist_print_res(hdr, valid_len);
+ } else {
+ persist_print_full(hdr, valid_len);
+ }
+ break;
+ }
+ case SPRI_RC: {
+ struct scsi_per_res_cap *cap;
+ uint32_t cap_len;
+
+ if (valid_len < sizeof(*cap)) {
+ warnx("%s: only got %u valid bytes, need %zd",
+ __func__, valid_len, sizeof(*cap));
+ error = 1;
+ goto bailout;
+ }
+ cap = (struct scsi_per_res_cap *)res_buf;
+ cap_len = scsi_2btoul(cap->length);
+ if (cap_len != sizeof(*cap)) {
+ /*
+ * We should be able to deal with this,
+ * it's just more trouble.
+ */
+ warnx("%s: reported size %u is different "
+ "than expected size %zd", __func__,
+ cap_len, sizeof(*cap));
+ }
+
+ /*
+ * If there is more data available, grab it all,
+ * even though we don't really know what to do with
+ * the extra data since it obviously wasn't in the
+ * spec when this code was written.
+ */
+ if (cap_len > res_len) {
+ res_len = cap_len;
+ goto retry;
+ }
+ persist_print_cap(cap, valid_len);
+ break;
+ }
+ default:
+ break;
+ }
+
+bailout:
+ free(res_buf);
+
+ if (ccb != NULL)
+ cam_freeccb(ccb);
+
+ STAILQ_FOREACH_SAFE(id, &transport_id_list, links, id2) {
+ STAILQ_REMOVE(&transport_id_list, id, persist_transport_id,
+ links);
+ free(id);
+ }
+ return (error);
+}
diff --git a/sbin/casperd/casperd.8 b/sbin/casperd/casperd.8
index ebe560dbb9e5..d60b9f3fe29f 100644
--- a/sbin/casperd/casperd.8
+++ b/sbin/casperd/casperd.8
@@ -122,5 +122,5 @@ daemon exits 0 on success, and >0 if an error occurs.
The
.Nm
was implemented by
-.An Pawel Jakub Dawidek Aq pawel@dawidek.net
+.An Pawel Jakub Dawidek Aq Mt pawel@dawidek.net
under sponsorship from the FreeBSD Foundation.
diff --git a/sbin/dhclient/bpf.c b/sbin/dhclient/bpf.c
index 7c2e53116cd0..78b9eb624e88 100644
--- a/sbin/dhclient/bpf.c
+++ b/sbin/dhclient/bpf.c
@@ -43,8 +43,6 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <sys/capsicum.h>
-
#include "dhcpd.h"
#include "privsep.h"
#include <sys/capsicum.h>
diff --git a/sbin/dhclient/dhclient-script.8 b/sbin/dhclient/dhclient-script.8
index fdb46a7774b7..2fae9f67cbe5 100644
--- a/sbin/dhclient/dhclient-script.8
+++ b/sbin/dhclient/dhclient-script.8
@@ -273,7 +273,7 @@ but current scripts do not do this.
The original version of
.Nm
was written for the Internet Software Consortium by
-.An Ted Lemon Aq mellon@fugue.com
+.An Ted Lemon Aq Mt mellon@fugue.com
in cooperation with Vixie Enterprises.
.Pp
The
@@ -281,7 +281,7 @@ The
implementation of
.Nm
was written by
-.An Kenneth R. Westerback Aq krw@openbsd.org .
+.An Kenneth R. Westerback Aq Mt krw@openbsd.org .
.Sh BUGS
If more than one interface is being used, there is no obvious way to
avoid clashes between server-supplied configuration parameters - for
diff --git a/sbin/dhclient/dhclient.8 b/sbin/dhclient/dhclient.8
index d2b8f437f7d4..c6940da89632 100644
--- a/sbin/dhclient/dhclient.8
+++ b/sbin/dhclient/dhclient.8
@@ -188,9 +188,9 @@ The
.Nm
utility
was written by
-.An Ted Lemon Aq mellon@fugue.com
+.An Ted Lemon Aq Mt mellon@fugue.com
and
-.An Elliot Poger Aq elliot@poger.com .
+.An Elliot Poger Aq Mt elliot@poger.com .
.Pp
The current implementation was reworked by
-.An Henning Brauer Aq henning@openbsd.org .
+.An Henning Brauer Aq Mt henning@openbsd.org .
diff --git a/sbin/dhclient/dhclient.c b/sbin/dhclient/dhclient.c
index c43bda9f480c..22b21f1da68c 100644
--- a/sbin/dhclient/dhclient.c
+++ b/sbin/dhclient/dhclient.c
@@ -56,8 +56,6 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <sys/capsicum.h>
-
#include "dhcpd.h"
#include "privsep.h"
diff --git a/sbin/dhclient/dhclient.conf.5 b/sbin/dhclient/dhclient.conf.5
index 167239ef63c3..3b6ae044343c 100644
--- a/sbin/dhclient/dhclient.conf.5
+++ b/sbin/dhclient/dhclient.conf.5
@@ -537,8 +537,8 @@ The
.Xr dhclient 8
utility
was written by
-.An Ted Lemon Aq mellon@vix.com
+.An Ted Lemon Aq Mt mellon@vix.com
under a contract with Vixie Labs.
.Pp
The current implementation was reworked by
-.An Henning Brauer Aq henning@openbsd.org .
+.An Henning Brauer Aq Mt henning@openbsd.org .
diff --git a/sbin/dhclient/dhclient.leases.5 b/sbin/dhclient/dhclient.leases.5
index b1f0f3d8bd53..f48b106287cf 100644
--- a/sbin/dhclient/dhclient.leases.5
+++ b/sbin/dhclient/dhclient.leases.5
@@ -88,8 +88,8 @@ The
.Xr dhclient 8
utility
was written by
-.An Ted Lemon Aq mellon@vix.com
+.An Ted Lemon Aq Mt mellon@vix.com
under a contract with Vixie Labs.
.Pp
The current implementation was reworked by
-.An Henning Brauer Aq henning@openbsd.org .
+.An Henning Brauer Aq Mt henning@openbsd.org .
diff --git a/sbin/dhclient/dhcp-options.5 b/sbin/dhclient/dhcp-options.5
index 1405839a9f25..4b65fa723083 100644
--- a/sbin/dhclient/dhcp-options.5
+++ b/sbin/dhclient/dhcp-options.5
@@ -603,8 +603,8 @@ The
.Xr dhcpd 8
utility
was written by
-.An Ted Lemon Aq mellon@vix.com
+.An Ted Lemon Aq Mt mellon@vix.com
under a contract with Vixie Labs.
.Pp
The current implementation was reworked by
-.An Henning Brauer Aq henning@openbsd.org .
+.An Henning Brauer Aq Mt henning@openbsd.org .
diff --git a/sbin/etherswitchcfg/etherswitchcfg.c b/sbin/etherswitchcfg/etherswitchcfg.c
index dd68e67c4ec9..f7f117ae3e2b 100644
--- a/sbin/etherswitchcfg/etherswitchcfg.c
+++ b/sbin/etherswitchcfg/etherswitchcfg.c
@@ -235,6 +235,8 @@ set_port_media(struct cfg *cfg, char *argv[])
p.es_ifmr.ifm_count = IFMEDIAREQ_NULISTENTRIES;
if (ioctl(cfg->fd, IOETHERSWITCHGETPORT, &p) != 0)
err(EX_OSERR, "ioctl(IOETHERSWITCHGETPORT)");
+ if (p.es_ifmr.ifm_count == 0)
+ return;
subtype = get_media_subtype(IFM_TYPE(ifm_ulist[0]), argv[1]);
p.es_ifr.ifr_media = (p.es_ifmr.ifm_current & IFM_IMASK) |
IFM_TYPE(ifm_ulist[0]) | subtype;
diff --git a/sbin/fdisk/fdisk.c b/sbin/fdisk/fdisk.c
index 34b96efd286c..819c1c72a852 100644
--- a/sbin/fdisk/fdisk.c
+++ b/sbin/fdisk/fdisk.c
@@ -507,7 +507,6 @@ print_part(const struct dos_partition *partp)
static void
init_boot(void)
{
-#ifndef __ia64__
const char *fname;
int fdesc, n;
struct stat sb;
@@ -529,15 +528,6 @@ init_boot(void)
err(1, "%s", fname);
if (n != mboot.bootinst_size)
errx(1, "%s: short read", fname);
-#else
- if (mboot.bootinst != NULL)
- free(mboot.bootinst);
- mboot.bootinst_size = secsize;
- if ((mboot.bootinst = malloc(mboot.bootinst_size)) == NULL)
- errx(1, "unable to allocate boot block buffer");
- memset(mboot.bootinst, 0, mboot.bootinst_size);
- le16enc(&mboot.bootinst[DOSMAGICOFFSET], DOSMAGIC);
-#endif
}
diff --git a/sbin/ffsinfo/ffsinfo.8 b/sbin/ffsinfo/ffsinfo.8
index 9753cf7c0cf8..d3c8e9f4ff05 100644
--- a/sbin/ffsinfo/ffsinfo.8
+++ b/sbin/ffsinfo/ffsinfo.8
@@ -134,9 +134,9 @@ The
utility first appeared in
.Fx 4.4 .
.Sh AUTHORS
-.An Christoph Herrmann Aq chm@FreeBSD.org
-.An Thomas-Henning von Kamptz Aq tomsoft@FreeBSD.org
-.An The GROWFS team Aq growfs@Tomsoft.COM
+.An Christoph Herrmann Aq Mt chm@FreeBSD.org
+.An Thomas-Henning von Kamptz Aq Mt tomsoft@FreeBSD.org
+.An The GROWFS team Aq Mt growfs@Tomsoft.COM
.Sh BUGS
Snapshots are handled like plain files.
They should get their own level to provide for independent control of the
diff --git a/sbin/fsck/Makefile b/sbin/fsck/Makefile
index 22de03c4da78..d0c45dbfd797 100644
--- a/sbin/fsck/Makefile
+++ b/sbin/fsck/Makefile
@@ -5,4 +5,6 @@ PROG= fsck
SRCS= fsck.c fsutil.c preen.c
MAN= fsck.8
+NO_PIE= yes
+
.include <bsd.prog.mk>
diff --git a/sbin/fsck/fsck.8 b/sbin/fsck/fsck.8
index 3fa113afe0c7..5d2a019ddbfc 100644
--- a/sbin/fsck/fsck.8
+++ b/sbin/fsck/fsck.8
@@ -29,7 +29,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd January 25, 2009
+.Dd May 23, 2014
.Dt FSCK 8
.Os
.Sh NAME
@@ -111,6 +111,18 @@ The disk drive containing each file system is inferred from the shortest prefix
of the device name that ends in a digit; the remaining characters are assumed
to be the partition and slice designators.
.Pp
+If the
+.Fl t
+or
+.Fl T
+flags are not specified,
+.Nm
+will attempt to determine the file system type and call the
+appropriated file system check utility.
+Failure to detect the file system type will cause
+.Nm
+to fail with a message that the partition has an unknown file system type.
+.Pp
The options are as follows:
.Bl -tag -width indent
.It Fl C
diff --git a/sbin/fsck_msdosfs/check.c b/sbin/fsck_msdosfs/check.c
index 1fb005ddd8d8..083389e09933 100644
--- a/sbin/fsck_msdosfs/check.c
+++ b/sbin/fsck_msdosfs/check.c
@@ -142,7 +142,7 @@ checkfilesys(const char *fname)
goto out;
/* now write the FATs */
- if (mod & FSFATMOD) {
+ if (mod & (FSFATMOD|FSFIXFAT)) {
if (ask(1, "Update FATs")) {
mod |= writefat(dosfs, &boot, fat, mod & FSFIXFAT);
if (mod & FSFATAL)
diff --git a/sbin/fsck_msdosfs/dir.c b/sbin/fsck_msdosfs/dir.c
index 008d0b3398f1..e8d6475736c2 100644
--- a/sbin/fsck_msdosfs/dir.c
+++ b/sbin/fsck_msdosfs/dir.c
@@ -206,7 +206,7 @@ static char longName[DOSLONGNAMELEN] = "";
static u_char *buffer = NULL;
static u_char *delbuf = NULL;
-struct dosDirEntry *rootDir;
+static struct dosDirEntry *rootDir;
static struct dosDirEntry *lostDir;
/*
@@ -419,13 +419,14 @@ checksize(struct bootblock *boot, struct fatEntry *fat, u_char *p,
fullpath(dir));
if (ask(1, "Drop superfluous clusters")) {
cl_t cl;
- u_int32_t sz = 0;
+ u_int32_t sz, len;
- for (cl = dir->head; (sz += boot->ClusterSize) <
- dir->size;)
+ for (cl = dir->head, len = sz = 0;
+ (sz += boot->ClusterSize) < dir->size; len++)
cl = fat[cl].next;
clearchain(boot, fat, fat[cl].next);
fat[cl].next = CLUST_EOF;
+ fat[dir->head].length = len;
return FSFATMOD;
} else
return FSERROR;
diff --git a/sbin/fsck_msdosfs/ext.h b/sbin/fsck_msdosfs/ext.h
index 681cde998e28..ef9c420c90d0 100644
--- a/sbin/fsck_msdosfs/ext.h
+++ b/sbin/fsck_msdosfs/ext.h
@@ -26,7 +26,7 @@
*/
#ifndef EXT_H
-#define EXT_H
+#define EXT_H
#include <sys/types.h>
@@ -43,8 +43,6 @@ extern int preen; /* we are preening */
extern int rdonly; /* device is opened read only (supersedes above) */
extern int skipclean; /* skip clean file systems if preening */
-extern struct dosDirEntry *rootDir;
-
/*
* function declarations
*/
@@ -71,8 +69,8 @@ int checkfilesys(const char *);
#define FSFATMOD 4 /* The FAT was modified */
#define FSERROR 8 /* Some unrecovered error remains */
#define FSFATAL 16 /* Some unrecoverable error occurred */
-#define FSDIRTY 32 /* File system is dirty */
-#define FSFIXFAT 64 /* Fix file system FAT */
+#define FSDIRTY 32 /* File system is dirty */
+#define FSFIXFAT 64 /* Fix file system FAT */
/*
* read a boot block in a machine independent fashion and translate
diff --git a/sbin/fsck_msdosfs/fat.c b/sbin/fsck_msdosfs/fat.c
index d2d144449ec5..b509c50246a6 100644
--- a/sbin/fsck_msdosfs/fat.c
+++ b/sbin/fsck_msdosfs/fat.c
@@ -242,7 +242,7 @@ readfat(int fs, struct bootblock *boot, u_int no, struct fatEntry **fp)
ret |= FSDIRTY;
else {
/* just some odd byte sequence in FAT */
-
+
switch (boot->ClustMask) {
case CLUST32_MASK:
pwarn("%s (%02x%02x%02x%02x%02x%02x%02x%02x)\n",
@@ -262,7 +262,7 @@ readfat(int fs, struct bootblock *boot, u_int no, struct fatEntry **fp)
break;
}
-
+
if (ask(1, "Correct"))
ret |= FSFIXFAT;
}
@@ -436,7 +436,15 @@ tryclear(struct bootblock *boot, struct fatEntry *fat, cl_t head, cl_t *truncp)
clearchain(boot, fat, head);
return FSFATMOD;
} else if (ask(0, "Truncate")) {
+ uint32_t len;
+ cl_t p;
+
+ for (p = head, len = 0;
+ p >= CLUST_FIRST && p < boot->NumClusters;
+ p = fat[p].next, len++)
+ continue;
*truncp = CLUST_EOF;
+ fat[head].length = len;
return FSFATMOD;
} else
return FSERROR;
@@ -465,7 +473,8 @@ checkfat(struct bootblock *boot, struct fatEntry *fat)
/* follow the chain and mark all clusters on the way */
for (len = 0, p = head;
- p >= CLUST_FIRST && p < boot->NumClusters;
+ p >= CLUST_FIRST && p < boot->NumClusters &&
+ fat[p].head != head;
p = fat[p].next) {
fat[p].head = head;
len++;
@@ -486,10 +495,10 @@ checkfat(struct bootblock *boot, struct fatEntry *fat)
continue;
/* follow the chain to its end (hopefully) */
- for (p = head;
+ for (len = fat[head].length, p = head;
(n = fat[p].next) >= CLUST_FIRST && n < boot->NumClusters;
p = n)
- if (fat[n].head != head)
+ if (fat[n].head != head || len-- < 2)
break;
if (n >= CLUST_EOFS)
continue;
@@ -497,14 +506,20 @@ checkfat(struct bootblock *boot, struct fatEntry *fat)
if (n == CLUST_FREE || n >= CLUST_RSRVD) {
pwarn("Cluster chain starting at %u ends with cluster marked %s\n",
head, rsrvdcltype(n));
+clear:
ret |= tryclear(boot, fat, head, &fat[p].next);
continue;
}
if (n < CLUST_FIRST || n >= boot->NumClusters) {
pwarn("Cluster chain starting at %u ends with cluster out of range (%u)\n",
- head, n);
- ret |= tryclear(boot, fat, head, &fat[p].next);
- continue;
+ head, n);
+ goto clear;
+ }
+ if (head == fat[n].head) {
+ pwarn("Cluster chain starting at %u loops at cluster %u\n",
+
+ head, p);
+ goto clear;
}
pwarn("Cluster chains starting at %u and %u are linked at cluster %u\n",
head, fat[n].head, n);
@@ -621,13 +636,15 @@ writefat(int fs, struct bootblock *boot, struct fatEntry *fat, int correct_fat)
default:
if (fat[cl].next == CLUST_FREE)
boot->NumFree++;
- if (cl + 1 < boot->NumClusters
- && fat[cl + 1].next == CLUST_FREE)
- boot->NumFree++;
*p++ = (u_char)fat[cl].next;
- *p++ = (u_char)((fat[cl].next >> 8) & 0xf)
- |(u_char)(fat[cl+1].next << 4);
- *p++ = (u_char)(fat[++cl].next >> 4);
+ *p = (u_char)((fat[cl].next >> 8) & 0xf);
+ cl++;
+ if (cl >= boot->NumClusters)
+ break;
+ if (fat[cl].next == CLUST_FREE)
+ boot->NumFree++;
+ *p++ |= (u_char)(fat[cl + 1].next << 4);
+ *p++ = (u_char)(fat[cl + 1].next >> 4);
break;
}
}
@@ -653,7 +670,7 @@ checklost(int dosfs, struct bootblock *boot, struct fatEntry *fat)
cl_t head;
int mod = FSOK;
int ret;
-
+
for (head = CLUST_FIRST; head < boot->NumClusters; head++) {
/* find next untravelled chain */
if (fat[head].head != head
@@ -677,8 +694,9 @@ checklost(int dosfs, struct bootblock *boot, struct fatEntry *fat)
if (boot->bpbFSInfo) {
ret = 0;
- if (boot->FSFree != boot->NumFree) {
- pwarn("Free space in FSInfo block (%d) not correct (%d)\n",
+ if (boot->FSFree != 0xffffffffU &&
+ boot->FSFree != boot->NumFree) {
+ pwarn("Free space in FSInfo block (%u) not correct (%u)\n",
boot->FSFree, boot->NumFree);
if (ask(1, "Fix")) {
boot->FSFree = boot->NumFree;
diff --git a/sbin/fsdb/Makefile b/sbin/fsdb/Makefile
index f921e89828ca..21ac09f9c66d 100644
--- a/sbin/fsdb/Makefile
+++ b/sbin/fsdb/Makefile
@@ -9,8 +9,8 @@ SRCS= fsdb.c fsdbutil.c \
pass5.c setup.c utilities.c ffs_subr.c ffs_tables.c globs.c
CFLAGS+= -I${.CURDIR}/../fsck_ffs
WARNS?= 2
-LDADD= -ledit -ltermcap
-DPADD= ${LIBEDIT} ${LIBTERMCAP}
+LDADD= -ledit -ltermcapw
+DPADD= ${LIBEDIT} ${LIBTERMCAPW}
.PATH: ${.CURDIR}/../fsck_ffs ${.CURDIR}/../../sys/ufs/ffs
.include <bsd.prog.mk>
diff --git a/sbin/fsdb/Makefile.depend b/sbin/fsdb/Makefile.depend
index 6bb45ddb04cd..6653b3c047eb 100644
--- a/sbin/fsdb/Makefile.depend
+++ b/sbin/fsdb/Makefile.depend
@@ -12,7 +12,7 @@ DIRDEPS = \
lib/libcompiler_rt \
lib/libedit \
lib/libufs \
- lib/ncurses/ncurses \
+ lib/ncurses/ncursesw \
.include <dirdeps.mk>
diff --git a/sbin/fsirand/fsirand.8 b/sbin/fsirand/fsirand.8
index 3156787a8bdc..f3fbd8d6c153 100644
--- a/sbin/fsirand/fsirand.8
+++ b/sbin/fsirand/fsirand.8
@@ -107,7 +107,7 @@ A
version first appeared in
.Fx 2.2.5 .
.Sh AUTHORS
-.An Todd C. Miller Aq Todd.Miller@courtesan.com
+.An Todd C. Miller Aq Mt Todd.Miller@courtesan.com
.Sh CAVEATS
Since
.Nm
diff --git a/sbin/gbde/gbde.8 b/sbin/gbde/gbde.8
index efd3156b4da9..47c2e2118d35 100644
--- a/sbin/gbde/gbde.8
+++ b/sbin/gbde/gbde.8
@@ -243,14 +243,14 @@ To destroy all copies of the masterkey:
This software was developed for the
.Fx
Project by
-.An "Poul-Henning Kamp"
+.An Poul-Henning Kamp
and NAI Labs, the Security Research Division of Network Associates, Inc.\&
under DARPA/SPAWAR contract N66001-01-C-8035
.Pq Dq CBOSS ,
as part of the
DARPA CHATS research program.
.Sh AUTHORS
-.An "Poul-Henning Kamp" Aq phk@FreeBSD.org
+.An Poul-Henning Kamp Aq Mt phk@FreeBSD.org
.Sh BUGS
The cryptographic algorithms and the overall design have not been
attacked mercilessly for over 10 years by a gang of cryptoanalysts.
diff --git a/sbin/geom/class/cache/gcache.8 b/sbin/geom/class/cache/gcache.8
index b9f03bd7f3ae..b0f1c7abf1f7 100644
--- a/sbin/geom/class/cache/gcache.8
+++ b/sbin/geom/class/cache/gcache.8
@@ -189,4 +189,4 @@ The
utility appeared in
.Fx 7.0 .
.Sh AUTHORS
-.An Ruslan Ermilov Aq ru@FreeBSD.org
+.An Ruslan Ermilov Aq Mt ru@FreeBSD.org
diff --git a/sbin/geom/class/concat/gconcat.8 b/sbin/geom/class/concat/gconcat.8
index b797a1c24dc2..d874b087b649 100644
--- a/sbin/geom/class/concat/gconcat.8
+++ b/sbin/geom/class/concat/gconcat.8
@@ -194,4 +194,4 @@ The
utility appeared in
.Fx 5.3 .
.Sh AUTHORS
-.An Pawel Jakub Dawidek Aq pjd@FreeBSD.org
+.An Pawel Jakub Dawidek Aq Mt pjd@FreeBSD.org
diff --git a/sbin/geom/class/eli/geli.8 b/sbin/geom/class/eli/geli.8
index 55cf844f6f74..c435859ea024 100644
--- a/sbin/geom/class/eli/geli.8
+++ b/sbin/geom/class/eli/geli.8
@@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd October 1, 2013
+.Dd June 18, 2014
.Dt GELI 8
.Os
.Sh NAME
@@ -331,7 +331,7 @@ key length.
.It Nm AES-XTS
.Em 128 ,
256
-.It Nm AES-CBC , Nm Camilla-CBC
+.It Nm AES-CBC , Nm Camellia-CBC
.Em 128 ,
192,
256
@@ -353,13 +353,14 @@ because encryption/decryption which requires an initialization vector
is done per sector; fewer sectors means less computational work.
.It Fl V Ar version
Metadata version to use.
-This option is helpful when creating provider that may be used by older
+This option is helpful when creating a provider that may be used by older
.Nm FreeBSD/GELI
versions.
Consult the
.Sx HISTORY
section to find which metadata version is supported by which FreeBSD version.
-Note that using older metadata version may limit numer of features available.
+Note that using an older version of metadata may limit the number of
+features available.
.El
.It Cm attach
Attach the given provider.
@@ -619,7 +620,7 @@ devices.
.El
.It Cm resume
Resume previously suspended device.
-The caller must ensure that executing this subcommand doesn't access the
+The caller must ensure that executing this subcommand does not access the
suspended device, leading to a deadlock.
For example suspending a device which contains the file system where the
.Nm
@@ -823,7 +824,7 @@ Enter passphrase:
.Pp
Create an encrypted provider, but use two User Keys:
one for your employee and one for you as the company's security officer
-(so it's not a tragedy if the employee
+(so it is not a tragedy if the employee
.Qq accidentally
forgets his passphrase):
.Bd -literal -offset indent
@@ -1052,6 +1053,8 @@ metadata version supported by the given FreeBSD version:
.It Li 8.2 Ta 5
.Pp
.It Li 9.0 Ta 6
+.Pp
+.It Li 10.0 Ta 7
.El
.Sh AUTHORS
-.An Pawel Jakub Dawidek Aq pjd@FreeBSD.org
+.An Pawel Jakub Dawidek Aq Mt pjd@FreeBSD.org
diff --git a/sbin/geom/class/journal/gjournal.8 b/sbin/geom/class/journal/gjournal.8
index edef9023eb56..6eb8cde821ae 100644
--- a/sbin/geom/class/journal/gjournal.8
+++ b/sbin/geom/class/journal/gjournal.8
@@ -343,4 +343,4 @@ The
utility appeared in
.Fx 7.0 .
.Sh AUTHORS
-.An Pawel Jakub Dawidek Aq pjd@FreeBSD.org
+.An Pawel Jakub Dawidek Aq Mt pjd@FreeBSD.org
diff --git a/sbin/geom/class/label/glabel.8 b/sbin/geom/class/label/glabel.8
index c1c7bc40d8d0..c950e26b35a7 100644
--- a/sbin/geom/class/label/glabel.8
+++ b/sbin/geom/class/label/glabel.8
@@ -130,8 +130,26 @@ GPT UUIDs (directory
.Pa /dev/gptid/ ) .
.El
.Pp
-Generic labels are created in the directory
-.Pa /dev/label/ .
+Generic disk ID strings are exported as labels in the format
+.Pa /dev/diskid/GEOM_CLASS-ident
+e.g.
+.Pa /dev/diskid/DISK-6QG3Z026 .
+.Pp
+Generic labels created and managed solely by
+.Xr glabel 8
+are created in the
+.Pa /dev/label/
+directory.
+.Pp
+Note that for all label types, nested GEOM classes will cause additional
+device nodes to be created, with context-specific data appended to their
+names. E.g. for every node like
+.Pa /dev/label/bigdisk
+there will be additional entries for any partitions which the device
+contains, like
+.Pa /dev/label/bigdiskp1
+and
+.Pa /dev/label/bigdiskp1a .
.Pp
The first argument to
.Nm
@@ -205,6 +223,19 @@ This can be set to a number between 0 and 2 inclusive.
If set to 0 minimal debug information is printed, and if set to 2 the
maximum amount of debug information is printed.
.El
+.Bl -tag -width indent
+.It Va kern.geom.label.*.enable : No 1
+Most
+.Nm LABEL
+providers implement a
+.Xr sysctl 8
+flag and a tunable variable named in the above format. This flag
+controls if the label provider will be active, tasting devices
+and creating label nodes in the
+.Xr devfs 5
+tree. It is sometimes desirable to disable certain label types if
+they conflict with other classes in complex GEOM topologies.
+.El
.Sh EXIT STATUS
Exit status is 0 on success, and 1 if the command fails.
.Sh EXAMPLES
@@ -241,4 +272,4 @@ The
utility appeared in
.Fx 5.3 .
.Sh AUTHORS
-.An Pawel Jakub Dawidek Aq pjd@FreeBSD.org
+.An Pawel Jakub Dawidek Aq Mt pjd@FreeBSD.org
diff --git a/sbin/geom/class/mirror/gmirror.8 b/sbin/geom/class/mirror/gmirror.8
index bca5bdba9749..fb501ca3de64 100644
--- a/sbin/geom/class/mirror/gmirror.8
+++ b/sbin/geom/class/mirror/gmirror.8
@@ -376,7 +376,7 @@ The
utility appeared in
.Fx 5.3 .
.Sh AUTHORS
-.An Pawel Jakub Dawidek Aq pjd@FreeBSD.org
+.An Pawel Jakub Dawidek Aq Mt pjd@FreeBSD.org
.Sh BUGS
There should be a way to change a component's priority inside a running mirror.
.Pp
diff --git a/sbin/geom/class/mountver/gmountver.8 b/sbin/geom/class/mountver/gmountver.8
index 02d77dbffd9f..c9a9c0ac8313 100644
--- a/sbin/geom/class/mountver/gmountver.8
+++ b/sbin/geom/class/mountver/gmountver.8
@@ -127,4 +127,4 @@ The
utility appeared in
.Fx 9.0 .
.Sh AUTHORS
-.An Edward Tomasz Napierala Aq trasz@FreeBSD.org
+.An Edward Tomasz Napierala Aq Mt trasz@FreeBSD.org
diff --git a/sbin/geom/class/multipath/gmultipath.8 b/sbin/geom/class/multipath/gmultipath.8
index 81b85ddbd642..07ac01ed6dc5 100644
--- a/sbin/geom/class/multipath/gmultipath.8
+++ b/sbin/geom/class/multipath/gmultipath.8
@@ -360,6 +360,6 @@ GEOM_MULTIPATH: da2 added to FRED
.Xr mount 8 ,
.Xr newfs 8 ,
.Xr sysctl 8
-.Sh AUTHOR
-.An Matthew Jacob Aq mjacob@FreeBSD.org
-.An Alexander Motin Aq mav@FreeBSD.org
+.Sh AUTHORS
+.An Matthew Jacob Aq Mt mjacob@FreeBSD.org
+.An Alexander Motin Aq Mt mav@FreeBSD.org
diff --git a/sbin/geom/class/nop/gnop.8 b/sbin/geom/class/nop/gnop.8
index 2bcbef30d4f7..4770090dd706 100644
--- a/sbin/geom/class/nop/gnop.8
+++ b/sbin/geom/class/nop/gnop.8
@@ -176,4 +176,4 @@ The
utility appeared in
.Fx 5.3 .
.Sh AUTHORS
-.An Pawel Jakub Dawidek Aq pjd@FreeBSD.org
+.An Pawel Jakub Dawidek Aq Mt pjd@FreeBSD.org
diff --git a/sbin/geom/class/part/gpart.8 b/sbin/geom/class/part/gpart.8
index 194a19fdf46a..0e3ed7f96b92 100644
--- a/sbin/geom/class/part/gpart.8
+++ b/sbin/geom/class/part/gpart.8
@@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd April 2, 2014
+.Dd July 1, 2014
.Dt GPART 8
.Os
.Sh NAME
@@ -491,6 +491,12 @@ called
Requires the
.Cm GEOM_PART_BSD
kernel option.
+.It Cm BSD64
+64-bit implementation of BSD disklabel used in DragonFlyBSD to subdivide MBR
+or GPT partitions.
+Requires the
+.Cm GEOM_PART_BSD64
+kernel option.
.It Cm LDM
The Logical Disk Manager is an implementation of volume manager for
Microsoft Windows NT.
@@ -544,8 +550,20 @@ The
.Nm
utility also allows the user to specify scheme-specific partition types
for partition types that do not have symbolic names.
-Symbolic names currently understood are:
-.Bl -tag -width ".Cm ms-ldm-metadata"
+Symbolic names currently understood and used by
+.Fx
+are:
+.Bl -tag -width ".Cm dragonfly-disklabel64"
+.It Cm apple-boot
+The system partition dedicated to storing boot loaders on some Apple
+systems.
+The scheme-specific types are
+.Qq Li "!171"
+for MBR,
+.Qq Li "!Apple_Bootstrap"
+for APM, and
+.Qq Li "!426f6f74-0000-11aa-aa11-00306543ecac"
+for GPT.
.It Cm bios-boot
The system partition dedicated to second stage of the boot loader program.
Usually it is used by the GRUB 2 loader for GPT partitioning schemes.
@@ -557,16 +575,6 @@ Interface (EFI).
In such cases, the GPT partitioning scheme is used and the
actual partition type for the system partition can also be specified as
.Qq Li "!c12a7328-f81f-11d2-ba4b-00a0c93ec93b" .
-.It Cm fat16
-A partition that contains a FAT16 filesystem.
-The scheme-specific type is
-.Qq Li "!6"
-for MBR.
-.It Cm fat32
-A partition that contains a FAT32 filesystem.
-The scheme-specific type is
-.Qq Li "!11"
-for MBR.
.It Cm freebsd
A
.Fx
@@ -625,6 +633,145 @@ The scheme-specific types are
for APM,
.Qq Li "!516e7cba-6ecf-11d6-8ff8-00022d09712b"
for GPT, and 0x0904 for VTOC8.
+.El
+.Pp
+Another symbolic names that can be used with
+.Cm gpart
+utility are:
+.Bl -tag -width ".Cm dragonfly-disklabel64"
+.It Cm apple-boot
+An Apple Mac OS X partition dedicated to bootloader.
+The scheme-specific types are
+.Qq Li "!Apple_Bootstrap"
+for APM and
+.Qq Li "!426f6f74-0000-11aa-aa11-00306543ecac"
+for GPT.
+.It Cm apple-hfs
+An Apple Mac OS X partition that contains a HFS or HFS+ filesystem.
+The scheme-specific types are
+.Qq Li "!Apple_HFS"
+for APM and
+.Qq Li "!48465300-0000-11aa-aa11-00306543ecac"
+for GPT.
+.It Cm apple-label
+An Apple Mac OS X partition dedicated to partition metadata that descibes
+disk device.
+The scheme-specific type is
+.Qq Li "!4c616265-6c00-11aa-aa11-00306543ecac"
+for GPT.
+.It Cm apple-raid
+An Apple Mac OS X partition used in a software RAID configuration.
+The scheme-specific type is
+.Qq Li "!52414944-0000-11aa-aa11-00306543ecac"
+for GPT.
+.It Cm apple-raid-offline
+An Apple Mac OS X partition used in a software RAID configuration.
+The scheme-specific type is
+.Qq Li "!52414944-5f4f-11aa-aa11-00306543ecac"
+for GPT.
+.It Cm apple-tv-recovery
+An Apple Mac OS X partition used by Apple TV.
+The scheme-specific type is
+.Qq Li "!5265636f-7665-11aa-aa11-00306543ecac"
+for GPT.
+.It Cm apple-ufs
+An Apple Mac OS X partition that contains a UFS filesystem.
+The scheme-specific types are
+.Qq Li "!Apple_UNIX_SVR2"
+for APM and
+.Qq Li "!55465300-0000-11aa-aa11-00306543ecac"
+for GPT.
+.It Cm dragonfly-label32
+A DragonFlyBSD partition subdivided into filesystems with a
+.Bx
+disklabel.
+The scheme-specific type is
+.Qq Li "!9d087404-1ca5-11dc-8817-01301bb8a9f5"
+for GPT.
+.It Cm dragonfly-label64
+A DragonFlyBSD partition subdivided into filesystems with a
+disklabel64.
+The scheme-specific type is
+.Qq Li "!3d48ce54-1d16-11dc-8696-01301bb8a9f5"
+for GPT.
+.It Cm dragonfly-legacy
+A legacy partition type used in DragonFlyBSD.
+The scheme-specific type is
+.Qq Li "!bd215ab2-1d16-11dc-8696-01301bb8a9f5"
+for GPT.
+.It Cm dragonfly-ccd
+A DragonFlyBSD partition used with Concatenated Disk driver.
+The scheme-specific type is
+.Qq Li "!dbd5211b-1ca5-11dc-8817-01301bb8a9f5"
+for GPT.
+.It Cm dragonfly-hammer
+A DragonFlyBSD partition that contains a Hammer filesystem.
+The scheme-specific type is
+.Qq Li "!61dc63ac-6e38-11dc-8513-01301bb8a9f5"
+for GPT.
+.It Cm dragonfly-hammer2
+A DragonFlyBSD partition that contains a Hammer2 filesystem.
+The scheme-specific type is
+.Qq Li "!5cbb9ad1-862d-11dc-a94d-01301bb8a9f5"
+for GPT.
+.It Cm dragonfly-swap
+A DragonFlyBSD partition dedicated to swap space.
+The scheme-specific type is
+.Qq Li "!9d58fdbd-1ca5-11dc-8817-01301bb8a9f5"
+for GPT.
+.It Cm dragonfly-ufs
+A DragonFlyBSD partition that contains an UFS1 filesystem.
+The scheme-specific type is
+.Qq Li "!9d94ce7c-1ca5-11dc-8817-01301bb8a9f5"
+for GPT.
+.It Cm dragonfly-vinum
+A DragonFlyBSD partition used with Logical Volume Manager.
+The scheme-specific type is
+.Qq Li "!9dd4478f-1ca5-11dc-8817-01301bb8a9f5"
+for GPT.
+.It Cm ebr
+A partition subdivided into filesystems with a EBR.
+The scheme-specific type is
+.Qq Li "!5"
+for MBR.
+.It Cm fat16
+A partition that contains a FAT16 filesystem.
+The scheme-specific type is
+.Qq Li "!6"
+for MBR.
+.It Cm fat32
+A partition that contains a FAT32 filesystem.
+The scheme-specific type is
+.Qq Li "!11"
+for MBR.
+.It Cm linux-data
+A Linux partition that contains some filesystem with data.
+The scheme-specific types are
+.Qq Li "!131"
+for MBR and
+.Qq Li "!0fc63daf-8483-4772-8e79-3d69d8477de4"
+for GPT.
+.It Cm linux-lvm
+A Linux partition dedicated to Logical Volume Manager.
+The scheme-specific types are
+.Qq Li "!142"
+for MBR and
+.Qq Li "!e6d6d379-f507-44c2-a23c-238f2a3df928"
+for GPT.
+.It Cm linux-raid
+A Linux partition used in a software RAID configuration.
+The scheme-specific types are
+.Qq Li "!253"
+for MBR and
+.Qq Li "!a19d880f-05fc-4d3b-a006-743f0f84911e"
+for GPT.
+.It Cm linux-swap
+A Linux partition dedicated to swap space.
+The scheme-specific types are
+.Qq Li "!130"
+for MBR and
+.Qq Li "!0657fd6d-a4ab-43c4-84e5-0933c84b4f4f"
+for GPT.
.It Cm mbr
A partition that is sub-partitioned by a Master Boot Record (MBR).
This type is known as
@@ -652,11 +799,73 @@ A partition that contains Logical Disk Manager (LDM) database.
The scheme-specific type is
.Qq Li "!5808c8aa-7e8f-42e0-85d2-e1e90434cfb3"
for GPT.
+.It Cm netbsd-ccd
+A NetBSD partition used with Concatenated Disk driver.
+The scheme-specific type is
+.Qq Li "!2db519c4-b10f-11dc-b99b-0019d1879648"
+for GPT.
+.It Cm netbsd-cgd
+An encrypted NetBSD partition.
+The scheme-specific type is
+.Qq Li "!2db519ec-b10f-11dc-b99b-0019d1879648"
+for GPT.
+.It Cm netbsd-ffs
+A NetBSD partition that contains an UFS filesystem.
+The scheme-specific type is
+.Qq Li "!49f48d5a-b10e-11dc-b99b-0019d1879648"
+for GPT.
+.It Cm netbsd-lfs
+A NetBSD partition that contains an LFS filesystem.
+The scheme-specific type is
+.Qq Li "!49f48d82-b10e-11dc-b99b-0019d1879648"
+for GPT.
+.It Cm netbsd-raid
+A NetBSD partition used in a software RAID configuration.
+The scheme-specific type is
+.Qq Li "!49f48daa-b10e-11dc-b99b-0019d1879648"
+for GPT.
+.It Cm netbsd-swap
+A NetBSD partition dedicated to swap space.
+The scheme-specific type is
+.Qq Li "!49f48d32-b10e-11dc-b99b-0019d1879648"
+for GPT.
.It Cm ntfs
A partition that contains a NTFS or exFAT filesystem.
The scheme-specific type is
.Qq Li "!7"
for MBR.
+.It Cm prep-boot
+The system partition dedicated to storing boot loaders on some PowerPC systems,
+notably those made by IBM.
+The scheme-specific types are
+.Qq Li "!65"
+for MBR and
+.Qq Li "!0x9e1a2d38-c612-4316-aa26-8b49521e5a8b"
+for GPT.
+.It Cm vmware-vmfs
+A partition that contains a VMware File System (VMFS).
+The scheme-specific types are
+.Qq Li "!251"
+for MBR and
+.Qq Li "!aa31e02a-400f-11db-9590-000c2911d1b8"
+for GPT.
+.It Cm vmware-vmkdiag
+A partition that contains a VMware diagostic filesystem.
+The scheme-specific types are
+.Qq Li "!252"
+for MBR and
+.Qq Li "!9d275380-40ad-11db-bf97-000c2911d1b8"
+for GPT.
+.It Cm vmware-reserved
+A VMware reserved partition.
+The scheme-specific type is
+.Qq Li "!9198effc-31c0-11db-8f-78-000c2911d1b8"
+for GPT.
+.It Cm vmware-vsanhdr
+A partition claimed by VMware VSAN.
+The scheme-specific type is
+.Qq Li "!381cfccc-7288-11e0-92ee-000c2911d0b2"
+for GPT.
.El
.Sh ATTRIBUTES
The scheme-specific attributes for EBR:
@@ -828,7 +1037,7 @@ Instead, the 800 KBytes bootstrap code image
should be written with the
.Cm gpart bootcode
command to a partition of type
-.Cm freebsd-boot ,
+.Cm apple-boot ,
which should also be 800 KB in size.
.Sh OPERATIONAL FLAGS
Actions other than the
@@ -1097,4 +1306,4 @@ The
utility appeared in
.Fx 7.0 .
.Sh AUTHORS
-.An Marcel Moolenaar Aq marcel@FreeBSD.org
+.An Marcel Moolenaar Aq Mt marcel@FreeBSD.org
diff --git a/sbin/geom/class/raid/graid.8 b/sbin/geom/class/raid/graid.8
index 47d7fa2c8690..496e44e4ed48 100644
--- a/sbin/geom/class/raid/graid.8
+++ b/sbin/geom/class/raid/graid.8
@@ -320,5 +320,5 @@ The
utility appeared in
.Fx 9.0 .
.Sh AUTHORS
-.An Alexander Motin Aq mav@FreeBSD.org
-.An M. Warner Losh Aq imp@FreeBSD.org
+.An Alexander Motin Aq Mt mav@FreeBSD.org
+.An M. Warner Losh Aq Mt imp@FreeBSD.org
diff --git a/sbin/geom/class/raid3/graid3.8 b/sbin/geom/class/raid3/graid3.8
index a82d3882e8a2..426c94d17521 100644
--- a/sbin/geom/class/raid3/graid3.8
+++ b/sbin/geom/class/raid3/graid3.8
@@ -248,7 +248,7 @@ The
utility appeared in
.Fx 5.3 .
.Sh AUTHORS
-.An Pawel Jakub Dawidek Aq pjd@FreeBSD.org
+.An Pawel Jakub Dawidek Aq Mt pjd@FreeBSD.org
.Sh BUGS
There should be a section with an implementation description.
.Pp
diff --git a/sbin/geom/class/sched/gsched.8 b/sbin/geom/class/sched/gsched.8
index ae04865a21b1..facb5c18440f 100644
--- a/sbin/geom/class/sched/gsched.8
+++ b/sbin/geom/class/sched/gsched.8
@@ -158,5 +158,5 @@ The
utility first appeared in
.Fx 8.1 .
.Sh AUTHORS
-.An Fabio Checconi Aq fabio@FreeBSD.org
-.An Luigi Rizzo Aq luigi@FreeBSD.org
+.An Fabio Checconi Aq Mt fabio@FreeBSD.org
+.An Luigi Rizzo Aq Mt luigi@FreeBSD.org
diff --git a/sbin/geom/class/shsec/gshsec.8 b/sbin/geom/class/shsec/gshsec.8
index f72c31c784ce..dcfd2b397909 100644
--- a/sbin/geom/class/shsec/gshsec.8
+++ b/sbin/geom/class/shsec/gshsec.8
@@ -127,4 +127,4 @@ The
utility appeared in
.Fx 5.4 .
.Sh AUTHORS
-.An Pawel Jakub Dawidek Aq pjd@FreeBSD.org
+.An Pawel Jakub Dawidek Aq Mt pjd@FreeBSD.org
diff --git a/sbin/geom/class/stripe/geom_stripe.c b/sbin/geom/class/stripe/geom_stripe.c
index 2e9e3db130be..1fb16e98c7e7 100644
--- a/sbin/geom/class/stripe/geom_stripe.c
+++ b/sbin/geom/class/stripe/geom_stripe.c
@@ -62,7 +62,7 @@ struct g_command class_commands[] = {
{ 's', "stripesize", GSTRIPE_STRIPESIZE, G_TYPE_NUMBER },
G_OPT_SENTINEL
},
- "[-hv] [-s stripesize] name prov prov ..."
+ "[-v] [-s stripesize] name prov prov ..."
},
{ "destroy", G_FLAG_VERBOSE, NULL,
{
diff --git a/sbin/geom/class/stripe/gstripe.8 b/sbin/geom/class/stripe/gstripe.8
index 33ef30bf85ce..f1f34fe10609 100644
--- a/sbin/geom/class/stripe/gstripe.8
+++ b/sbin/geom/class/stripe/gstripe.8
@@ -240,4 +240,4 @@ The
utility appeared in
.Fx 5.3 .
.Sh AUTHORS
-.An Pawel Jakub Dawidek Aq pjd@FreeBSD.org
+.An Pawel Jakub Dawidek Aq Mt pjd@FreeBSD.org
diff --git a/sbin/geom/class/virstor/gvirstor.8 b/sbin/geom/class/virstor/gvirstor.8
index 0273cb41aaba..bf04c1bb2c2c 100644
--- a/sbin/geom/class/virstor/gvirstor.8
+++ b/sbin/geom/class/virstor/gvirstor.8
@@ -293,7 +293,7 @@ and all their structures will be physically allocated at the start
of the first virstor component.
This could have a significant impact on file system performance
.Pq which can in some rare cases be even positive .
-.Sh AUTHOR
-.An Ivan Voras Aq ivoras@FreeBSD.org
+.Sh AUTHORS
+.An Ivan Voras Aq Mt ivoras@FreeBSD.org
.Pp
Sponsored by Google Summer of Code 2006.
diff --git a/sbin/geom/core/geom.8 b/sbin/geom/core/geom.8
index 6e79880ef629..ab960ff9e07b 100644
--- a/sbin/geom/core/geom.8
+++ b/sbin/geom/core/geom.8
@@ -203,4 +203,4 @@ The
utility appeared in
.Fx 5.3 .
.Sh AUTHORS
-.An Pawel Jakub Dawidek Aq pjd@FreeBSD.org
+.An Pawel Jakub Dawidek Aq Mt pjd@FreeBSD.org
diff --git a/sbin/ggate/ggatec/ggatec.8 b/sbin/ggate/ggatec/ggatec.8
index 09f0444fa6a5..72ae4c5a9c3e 100644
--- a/sbin/ggate/ggatec/ggatec.8
+++ b/sbin/ggate/ggatec/ggatec.8
@@ -178,4 +178,4 @@ client# mount_cd9660 /dev/ggate0 /cdrom
The
.Nm
utility as well as this manual page was written by
-.An Pawel Jakub Dawidek Aq pjd@FreeBSD.org .
+.An Pawel Jakub Dawidek Aq Mt pjd@FreeBSD.org .
diff --git a/sbin/ggate/ggated/ggated.8 b/sbin/ggate/ggated/ggated.8
index 3024a04230d7..3560fe0bc9b5 100644
--- a/sbin/ggate/ggated/ggated.8
+++ b/sbin/ggate/ggated/ggated.8
@@ -108,4 +108,4 @@ Export CD-ROM device and a file:
The
.Nm
utility as well as this manual page was written by
-.An Pawel Jakub Dawidek Aq pjd@FreeBSD.org .
+.An Pawel Jakub Dawidek Aq Mt pjd@FreeBSD.org .
diff --git a/sbin/ggate/ggatel/ggatel.8 b/sbin/ggate/ggatel/ggatel.8
index 236e550811e1..1463426f2384 100644
--- a/sbin/ggate/ggatel/ggatel.8
+++ b/sbin/ggate/ggatel/ggatel.8
@@ -152,4 +152,4 @@ ggatel destroy -u 5
The
.Nm
utility as well as this manual page was written by
-.An Pawel Jakub Dawidek Aq pjd@FreeBSD.org .
+.An Pawel Jakub Dawidek Aq Mt pjd@FreeBSD.org .
diff --git a/sbin/growfs/growfs.8 b/sbin/growfs/growfs.8
index 9d62a83b974b..0dab89f35943 100644
--- a/sbin/growfs/growfs.8
+++ b/sbin/growfs/growfs.8
@@ -118,10 +118,10 @@ utility first appeared in
The ability to resize mounted filesystems was added in
.Fx 10.0 .
.Sh AUTHORS
-.An Christoph Herrmann Aq chm@FreeBSD.org
-.An Thomas-Henning von Kamptz Aq tomsoft@FreeBSD.org
-.An The GROWFS team Aq growfs@Tomsoft.COM
-.An Edward Tomasz Napierala Aq trasz@FreeBSD.org
+.An Christoph Herrmann Aq Mt chm@FreeBSD.org
+.An Thomas-Henning von Kamptz Aq Mt tomsoft@FreeBSD.org
+.An The GROWFS team Aq Mt growfs@Tomsoft.COM
+.An Edward Tomasz Napierala Aq Mt trasz@FreeBSD.org
.Sh CAVEATS
When expanding a file system mounted read-write, any writes to that file system
will be temporarily suspended until the expansion is finished.
diff --git a/sbin/gvinum/Makefile b/sbin/gvinum/Makefile
index c9716e94670c..1b5f948ce893 100644
--- a/sbin/gvinum/Makefile
+++ b/sbin/gvinum/Makefile
@@ -7,8 +7,8 @@ MAN= gvinum.8
WARNS?= 2
CFLAGS+= -I${.CURDIR}/../../sys -I${DESTDIR}/${INCLUDEDIR}/edit
-DPADD= ${LIBEDIT} ${LIBTERMCAP} ${LIBDEVSTAT} ${LIBKVM} ${LIBGEOM}
-LDADD= -ledit -ltermcap -ldevstat -lkvm -lgeom
+DPADD= ${LIBEDIT} ${LIBTERMCAPW} ${LIBDEVSTAT} ${LIBKVM} ${LIBGEOM}
+LDADD= -ledit -ltermcapw -ldevstat -lkvm -lgeom
.PATH: ${.CURDIR}/../../sys/geom/vinum
diff --git a/sbin/gvinum/Makefile.depend b/sbin/gvinum/Makefile.depend
index e67cb4a72ca3..95ff20cc34ce 100644
--- a/sbin/gvinum/Makefile.depend
+++ b/sbin/gvinum/Makefile.depend
@@ -17,7 +17,7 @@ DIRDEPS = \
lib/libgeom \
lib/libkvm \
lib/libsbuf \
- lib/ncurses/ncurses \
+ lib/ncurses/ncursesw \
.include <dirdeps.mk>
diff --git a/sbin/gvinum/gvinum.8 b/sbin/gvinum/gvinum.8
index 703a81056f70..a8a448c8ff4d 100644
--- a/sbin/gvinum/gvinum.8
+++ b/sbin/gvinum/gvinum.8
@@ -395,9 +395,9 @@ and
through the 2007 Google Summer of Code program.
The documentation have been updated to reflect the new functionality.
.Sh AUTHORS
-.An Lukas Ertl Aq le@FreeBSD.org
-.An Chris Jones Aq soc-cjones@FreeBSD.org
-.An Ulf Lilleengen Aq lulf@FreeBSD.org
+.An Lukas Ertl Aq Mt le@FreeBSD.org
+.An Chris Jones Aq Mt soc-cjones@FreeBSD.org
+.An Ulf Lilleengen Aq Mt lulf@FreeBSD.org
.Sh BUGS
Currently,
.Nm
diff --git a/sbin/hastctl/hastctl.8 b/sbin/hastctl/hastctl.8
index bdca80d721a6..397d4cfec0a3 100644
--- a/sbin/hastctl/hastctl.8
+++ b/sbin/hastctl/hastctl.8
@@ -224,5 +224,5 @@ nodeB# application_start
The
.Nm
was developed by
-.An Pawel Jakub Dawidek Aq pjd@FreeBSD.org
+.An Pawel Jakub Dawidek Aq Mt pjd@FreeBSD.org
under sponsorship of the FreeBSD Foundation.
diff --git a/sbin/hastd/hast.conf.5 b/sbin/hastd/hast.conf.5
index 3d921e46c039..c7e2e33ec097 100644
--- a/sbin/hastd/hast.conf.5
+++ b/sbin/hastd/hast.conf.5
@@ -445,5 +445,5 @@ resource tank {
The
.Nm
was written by
-.An Pawel Jakub Dawidek Aq pjd@FreeBSD.org
+.An Pawel Jakub Dawidek Aq Mt pjd@FreeBSD.org
under sponsorship of the FreeBSD Foundation.
diff --git a/sbin/hastd/hastd.8 b/sbin/hastd/hastd.8
index 68c98cbc6fff..e30a11a46334 100644
--- a/sbin/hastd/hastd.8
+++ b/sbin/hastd/hastd.8
@@ -228,5 +228,5 @@ nodeA# mount -o noatime /dev/hast/shared /shared
The
.Nm
was developed by
-.An Pawel Jakub Dawidek Aq pjd@FreeBSD.org
+.An Pawel Jakub Dawidek Aq Mt pjd@FreeBSD.org
under sponsorship of the FreeBSD Foundation.
diff --git a/sbin/ifconfig/af_inet6.c b/sbin/ifconfig/af_inet6.c
index b4db0f174cd7..d2e65e4dc96f 100644
--- a/sbin/ifconfig/af_inet6.c
+++ b/sbin/ifconfig/af_inet6.c
@@ -42,6 +42,7 @@ static const char rcsid[] =
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
+#include <time.h>
#include <ifaddrs.h>
#include <arpa/inet.h>
@@ -98,20 +99,21 @@ static void
setip6lifetime(const char *cmd, const char *val, int s,
const struct afswtch *afp)
{
- time_t newval, t;
+ struct timespec now;
+ time_t newval;
char *ep;
- t = time(NULL);
+ clock_gettime(CLOCK_MONOTONIC_FAST, &now);
newval = (time_t)strtoul(val, &ep, 0);
if (val == ep)
errx(1, "invalid %s", cmd);
if (afp->af_af != AF_INET6)
errx(1, "%s not allowed for the AF", cmd);
if (strcmp(cmd, "vltime") == 0) {
- in6_addreq.ifra_lifetime.ia6t_expire = t + newval;
+ in6_addreq.ifra_lifetime.ia6t_expire = now.tv_sec + newval;
in6_addreq.ifra_lifetime.ia6t_vltime = newval;
} else if (strcmp(cmd, "pltime") == 0) {
- in6_addreq.ifra_lifetime.ia6t_preferred = t + newval;
+ in6_addreq.ifra_lifetime.ia6t_preferred = now.tv_sec + newval;
in6_addreq.ifra_lifetime.ia6t_pltime = newval;
}
}
@@ -172,9 +174,11 @@ in6_status(int s __unused, const struct ifaddrs *ifa)
int s6;
u_int32_t flags6;
struct in6_addrlifetime lifetime;
- time_t t = time(NULL);
+ struct timespec now;
int error;
+ clock_gettime(CLOCK_MONOTONIC_FAST, &now);
+
memset(&null_sin, 0, sizeof(null_sin));
sin = (struct sockaddr_in6 *)ifa->ifa_addr;
@@ -258,15 +262,15 @@ in6_status(int s __unused, const struct ifaddrs *ifa)
if (ip6lifetime && (lifetime.ia6t_preferred || lifetime.ia6t_expire)) {
printf("pltime ");
if (lifetime.ia6t_preferred) {
- printf("%s ", lifetime.ia6t_preferred < t
- ? "0" : sec2str(lifetime.ia6t_preferred - t));
+ printf("%s ", lifetime.ia6t_preferred < now.tv_sec
+ ? "0" : sec2str(lifetime.ia6t_preferred - now.tv_sec));
} else
printf("infty ");
printf("vltime ");
if (lifetime.ia6t_expire) {
- printf("%s ", lifetime.ia6t_expire < t
- ? "0" : sec2str(lifetime.ia6t_expire - t));
+ printf("%s ", lifetime.ia6t_expire < now.tv_sec
+ ? "0" : sec2str(lifetime.ia6t_expire - now.tv_sec));
} else
printf("infty ");
}
diff --git a/sbin/ifconfig/ifconfig.8 b/sbin/ifconfig/ifconfig.8
index 8116cb7feb54..5bf590d047d6 100644
--- a/sbin/ifconfig/ifconfig.8
+++ b/sbin/ifconfig/ifconfig.8
@@ -28,7 +28,7 @@
.\" From: @(#)ifconfig.8 8.3 (Berkeley) 1/5/94
.\" $FreeBSD$
.\"
-.Dd October 21, 2013
+.Dd June 5, 2014
.Dt IFCONFIG 8
.Os
.Sh NAME
@@ -141,13 +141,13 @@ The link-level
.Pq Dq link
address
is specified as a series of colon-separated hex digits.
-This can be used to
-e.g.,\& set a new MAC address on an ethernet interface, though the
-mechanism used is not ethernet-specific.
+This can be used to, for example,
+set a new MAC address on an Ethernet interface, though the
+mechanism used is not Ethernet specific.
If the interface is already
up when this option is used, it will be briefly brought down and
then brought back up again in order to ensure that the receive
-filter in the underlying ethernet hardware is properly reprogrammed.
+filter in the underlying Ethernet hardware is properly reprogrammed.
.It Ar address_family
Specify the
address family
@@ -169,6 +169,18 @@ and
.Dq lladdr
are synonyms for
.Dq link .
+When using the
+.Fl l
+flag, the
+.Dq ether
+address family has special meaning and is no longer synonymous with
+.Dq link
+or
+.Dq lladdr .
+Specifying
+.Fl l Dq ether
+will list only Ethernet interfaces, excluding all other interface types,
+including the loopback interface.
.It Ar dest_address
Specify the address of the correspondent on the other end
of a point to point link.
@@ -649,7 +661,8 @@ Clear a flag
.Cm defaultif .
.It Cm ifdisabled
Set a flag to disable all of IPv6 network communications on the
-specified interface. Note that if there are already configured IPv6
+specified interface.
+Note that if there are already configured IPv6
addresses on that interface, all of them are marked as
.Dq tentative
and DAD will be performed when this flag is cleared.
@@ -666,9 +679,11 @@ Set a flag to enable Neighbor Unreachability Detection.
Clear a flag
.Cm nud .
.It Cm no_prefer_iface
-Set a flag to not prefer address on the interface as candidates of the
-source address for outgoing packets, even when the interface is
-outgoing interface.
+Set a flag to not honor rule 5 of source address selection in RFC 3484.
+In practice this means the address on the outgoing interface will not be
+preferred, effectively yielding the decision to the address selection
+policy table, configurable with
+.Xr ip6addrctl 8 .
.It Cm -no_prefer_iface
Clear a flag
.Cm no_prefer_iface .
@@ -1075,7 +1090,8 @@ specifies the number of beacon intervals between DTIM
and must be in the range 1 to 15.
By default DTIM is 1 (i.e., DTIM occurs at each beacon).
.It Cm quiet
-Enable the use of quiet IE. Hostap will use this to silence other
+Enable the use of quiet IE.
+Hostap will use this to silence other
stations to reduce interference for radar detection when
operating on 5GHz frequency and doth support is enabled.
Use
@@ -1090,9 +1106,11 @@ scheduled quiet intervals defined by Quiet element.
Set the QUIET
.Ar count
to the number of TBTTs until the beacon interval during which the
-next quiet interval shall start. A value of 1 indicates the quiet
+next quiet interval shall start.
+A value of 1 indicates the quiet
interval will start during the beacon interval starting at the next
-TBTT. A value 0 is reserved.
+TBTT.
+A value 0 is reserved.
.It Cm quiet_offset Ar offset
Set the QUIET
.Ar offset
@@ -2317,7 +2335,6 @@ src/dst address for IPv4 or IPv6.
.It Cm l4
src/dst port for TCP/UDP/SCTP.
.El
-.Pp
.El
.Pp
The following parameters are specific to IP tunnel interfaces,
@@ -2342,7 +2359,8 @@ Another name for the
parameter.
.It Cm accept_rev_ethip_ver
Set a flag to accept both correct EtherIP packets and ones
-with reversed version field. Enabled by default.
+with reversed version field.
+Enabled by default.
This is for backward compatibility with
.Fx 6.1 ,
6.2, 6.3, 7.0, and 7.1.
@@ -2351,7 +2369,8 @@ Clear a flag
.Cm accept_rev_ethip_ver .
.It Cm send_rev_ethip_ver
Set a flag to send EtherIP packets with reversed version
-field intentionally. Disabled by default.
+field intentionally.
+Disabled by default.
This is for backward compatibility with
.Fx 6.1 ,
6.2, 6.3, 7.0, and 7.1.
@@ -2434,7 +2453,7 @@ pseudo-interface.
The
.Xr vlan 4
interface is assigned a
-copy of the parent interface's flags and the parent's ethernet address.
+copy of the parent interface's flags and the parent's Ethernet address.
The
.Cm vlandev
and
@@ -2554,6 +2573,11 @@ The
.Fl l
flag may be used to list all available interfaces on the system, with
no other additional information.
+If an
+.Ar address_family
+is specified, only interfaces of that type will be listed.
+.Fl l Dq ether
+will list only Ethernet adapters, excluding the loopback interface.
Use of this flag is mutually exclusive
with all other flags and commands, except for
.Fl d
diff --git a/sbin/ipf/ipf/Makefile b/sbin/ipf/ipf/Makefile
index c3938c63af61..73888b29ba6f 100644
--- a/sbin/ipf/ipf/Makefile
+++ b/sbin/ipf/ipf/Makefile
@@ -39,4 +39,6 @@ DPADD+= ${LIBPCAP}
LDADD+= -lpcap
.endif
+NO_PIE= yes
+
.include <bsd.prog.mk>
diff --git a/sbin/ipf/ipfstat/Makefile b/sbin/ipf/ipfstat/Makefile
index a33c5df38d8f..c2b422df42f4 100644
--- a/sbin/ipf/ipfstat/Makefile
+++ b/sbin/ipf/ipfstat/Makefile
@@ -8,4 +8,6 @@ MAN= ipfstat.8
DPADD+= ${LIBCURSES}
LDADD+= -lcurses
+NO_PIE= yes
+
.include <bsd.prog.mk>
diff --git a/sbin/ipf/ipftest/Makefile b/sbin/ipf/ipftest/Makefile
index 32b074cb93f4..57f3c4e7de83 100644
--- a/sbin/ipf/ipftest/Makefile
+++ b/sbin/ipf/ipftest/Makefile
@@ -32,6 +32,8 @@ CLEANFILES+= ipnat.tab.c ipnat.tab.h
CLEANFILES+= ippool_y.c ippool_l.c
CLEANFILES+= ippool.tab.c ippool.tab.h
+NO_PIE= yes
+
ipnat_y.c: ipnat_y.y
${YACC} -b ipnat -d ${.ALLSRC}
sed -e 's/yy/ipnat_yy/g' \
diff --git a/sbin/ipf/ipmon/Makefile b/sbin/ipf/ipmon/Makefile
index 3639f8733c1e..2ecfed1aa1b8 100644
--- a/sbin/ipf/ipmon/Makefile
+++ b/sbin/ipf/ipmon/Makefile
@@ -11,6 +11,8 @@ DPSRCS+= ${GENHDRS}
CLEANFILES+= ${GENHDRS} ipmon_y.c ipmon_l.c
+NO_PIE= yes
+
ipmon_y.c: ipmon_y.y
${YACC} -d ${.ALLSRC}
sed -e 's/yy/ipmon_yy/g' \
diff --git a/sbin/ipf/ipnat/Makefile b/sbin/ipf/ipnat/Makefile
index 1c017e182cb1..aafb0147ec57 100644
--- a/sbin/ipf/ipnat/Makefile
+++ b/sbin/ipf/ipnat/Makefile
@@ -11,6 +11,8 @@ DPSRCS+= ${GENHDRS}
CLEANFILES+= ${GENHDRS} ipnat_y.c ipnat_l.c
+NO_PIE= yes
+
ipnat_y.c: ipnat_y.y
${YACC} -d ${.ALLSRC}
sed -e 's/yy/ipnat_yy/g' \
diff --git a/sbin/ipf/ippool/Makefile b/sbin/ipf/ippool/Makefile
index 6e3f85da847d..bb7e9ceb24b9 100644
--- a/sbin/ipf/ippool/Makefile
+++ b/sbin/ipf/ippool/Makefile
@@ -10,6 +10,8 @@ DPSRCS+= ${GENHDRS}
CLEANFILES+= ${GENHDRS} ippool_y.c ippool_l.c
+NO_PIE= yes
+
ippool_y.c: ippool_y.y
${YACC} -d ${.ALLSRC}
sed -e 's/yy/ippool_yy/g' \
diff --git a/sbin/ipf/ipresend/Makefile b/sbin/ipf/ipresend/Makefile
index 5e0ac15cbb1f..492451cebfc2 100644
--- a/sbin/ipf/ipresend/Makefile
+++ b/sbin/ipf/ipresend/Makefile
@@ -4,6 +4,8 @@ PROG= ipresend
SRCS= ipresend.c ip.c resend.c sbpf.c sock.c 44arp.c
MAN= ipresend.1
+NO_PIE= yes
+
.PATH: ${.CURDIR}/../../../contrib/ipfilter/ipsend
.include <bsd.prog.mk>
diff --git a/sbin/ipfw/dummynet.c b/sbin/ipfw/dummynet.c
index 28dc2c77a020..cb6285323eed 100644
--- a/sbin/ipfw/dummynet.c
+++ b/sbin/ipfw/dummynet.c
@@ -56,6 +56,7 @@ static struct _s_x dummynet_params[] = {
{ "sched_mask", TOK_SCHED_MASK },
{ "flow_mask", TOK_FLOW_MASK },
{ "droptail", TOK_DROPTAIL },
+ { "ecn", TOK_ECN },
{ "red", TOK_RED },
{ "gred", TOK_GRED },
{ "bw", TOK_BW },
@@ -239,7 +240,7 @@ print_flowset_parms(struct dn_fs *fs, char *prefix)
else
plr[0] = '\0';
- if (fs->flags & DN_IS_RED) /* RED parameters */
+ if (fs->flags & DN_IS_RED) { /* RED parameters */
sprintf(red,
"\n\t %cRED w_q %f min_th %d max_th %d max_p %f",
(fs->flags & DN_IS_GENTLE_RED) ? 'G' : ' ',
@@ -247,7 +248,9 @@ print_flowset_parms(struct dn_fs *fs, char *prefix)
fs->min_th,
fs->max_th,
1.0 * fs->max_p / (double)(1 << SCALE_RED));
- else
+ if (fs->flags & DN_IS_ECN)
+ strncat(red, " (ecn)", 6);
+ } else
sprintf(red, "droptail");
if (prefix[0]) {
@@ -1046,13 +1049,17 @@ end_mask:
}
if ((end = strsep(&av[0], "/"))) {
double max_p = strtod(end, NULL);
- if (max_p > 1 || max_p <= 0)
- errx(EX_DATAERR, "0 < max_p <= 1");
+ if (max_p > 1 || max_p < 0)
+ errx(EX_DATAERR, "0 <= max_p <= 1");
fs->max_p = (int)(max_p * (1 << SCALE_RED));
}
ac--; av++;
break;
+ case TOK_ECN:
+ fs->flags |= DN_IS_ECN;
+ break;
+
case TOK_DROPTAIL:
NEED(fs, "droptail is only for flowsets");
fs->flags &= ~(DN_IS_RED|DN_IS_GENTLE_RED);
@@ -1175,13 +1182,20 @@ end_mask:
errx(EX_DATAERR, "2 <= queue size <= %ld", limit);
}
+ if ((fs->flags & DN_IS_ECN) && !(fs->flags & DN_IS_RED))
+ errx(EX_USAGE, "enable red/gred for ECN");
+
if (fs->flags & DN_IS_RED) {
size_t len;
int lookup_depth, avg_pkt_size;
- if (fs->min_th >= fs->max_th)
+ if (!(fs->flags & DN_IS_ECN) && (fs->min_th >= fs->max_th))
errx(EX_DATAERR, "min_th %d must be < than max_th %d",
fs->min_th, fs->max_th);
+ else if ((fs->flags & DN_IS_ECN) && (fs->min_th > fs->max_th))
+ errx(EX_DATAERR, "min_th %d must be =< than max_th %d",
+ fs->min_th, fs->max_th);
+
if (fs->max_th == 0)
errx(EX_DATAERR, "max_th must be > 0");
diff --git a/sbin/ipfw/ipfw.8 b/sbin/ipfw/ipfw.8
index bc8d8197ae3a..5b56b39c84e6 100644
--- a/sbin/ipfw/ipfw.8
+++ b/sbin/ipfw/ipfw.8
@@ -1,7 +1,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd October 25, 2012
+.Dd May 31, 2014
.Dt IPFW 8
.Os
.Sh NAME
@@ -1583,7 +1583,6 @@ followed by the number of significant bits.
For example, an address with 33 significant bits could be specified as:
.Pp
.Dl "MAC 10:20:30:40:50:60/33 any"
-.Pp
.It
An ampersand
.Pq &
@@ -2441,22 +2440,23 @@ and
control the maximum lengths that can be specified.
.Pp
.It Cm red | gred Ar w_q Ns / Ns Ar min_th Ns / Ns Ar max_th Ns / Ns Ar max_p
+[ecn]
Make use of the RED (Random Early Detection) queue management algorithm.
.Ar w_q
and
.Ar max_p
are floating
-point numbers between 0 and 1 (0 not included), while
+point numbers between 0 and 1 (inclusive), while
.Ar min_th
and
.Ar max_th
are integer numbers specifying thresholds for queue management
(thresholds are computed in bytes if the queue has been defined
in bytes, in slots otherwise).
-The
+The two parameters can also be of the same value if needed. The
.Nm dummynet
-also supports the gentle RED variant (gred).
-Three
+also supports the gentle RED variant (gred) and ECN (Explicit Congestion
+Notification) as optional. Three
.Xr sysctl 8
variables can be used to control the RED behaviour:
.Bl -tag -width indent
@@ -3385,7 +3385,7 @@ options have been added by various developer over the years.
.Pp
.An -nosplit
In-kernel NAT support written by
-.An Paolo Pisati Aq piso@FreeBSD.org
+.An Paolo Pisati Aq Mt piso@FreeBSD.org
as part of a Summer of Code 2005 project.
.Pp
SCTP
diff --git a/sbin/ipfw/ipfw2.c b/sbin/ipfw/ipfw2.c
index 98b25b320c0f..25d6afd5febe 100644
--- a/sbin/ipfw/ipfw2.c
+++ b/sbin/ipfw/ipfw2.c
@@ -4389,7 +4389,7 @@ table_list(uint16_t num, int need_header)
addr6 = &xent->k.addr6;
- if (IN6_IS_ADDR_V4COMPAT(addr6)) {
+ if ((xent->flags & IPFW_TCF_INET) != 0) {
/* IPv4 address */
inet_ntop(AF_INET, &addr6->s6_addr32[3], tbuf, sizeof(tbuf));
} else {
diff --git a/sbin/ipfw/ipfw2.h b/sbin/ipfw/ipfw2.h
index 6e895b8627bb..2301c40f2b76 100644
--- a/sbin/ipfw/ipfw2.h
+++ b/sbin/ipfw/ipfw2.h
@@ -165,6 +165,7 @@ enum tokens {
TOK_BURST,
TOK_RED,
TOK_GRED,
+ TOK_ECN,
TOK_DROPTAIL,
TOK_PROTO,
/* dummynet tokens */
diff --git a/sbin/kldconfig/kldconfig.8 b/sbin/kldconfig/kldconfig.8
index 18fbaf609ac4..3cc288f5a368 100644
--- a/sbin/kldconfig/kldconfig.8
+++ b/sbin/kldconfig/kldconfig.8
@@ -105,4 +105,4 @@ The
utility first appeared in
.Fx 4.4 .
.Sh AUTHORS
-.An Peter Pentchev Aq roam@FreeBSD.org
+.An Peter Pentchev Aq Mt roam@FreeBSD.org
diff --git a/sbin/kldload/kldload.8 b/sbin/kldload/kldload.8
index ee913ed638a1..b84b8630999e 100644
--- a/sbin/kldload/kldload.8
+++ b/sbin/kldload/kldload.8
@@ -126,4 +126,4 @@ replacing the
.Nm lkm
interface.
.Sh AUTHORS
-.An Doug Rabson Aq dfr@FreeBSD.org
+.An Doug Rabson Aq Mt dfr@FreeBSD.org
diff --git a/sbin/kldstat/kldstat.8 b/sbin/kldstat/kldstat.8
index bebabe8bff52..b892ef678293 100644
--- a/sbin/kldstat/kldstat.8
+++ b/sbin/kldstat/kldstat.8
@@ -74,4 +74,4 @@ replacing the
.Nm lkm
interface.
.Sh AUTHORS
-.An Doug Rabson Aq dfr@FreeBSD.org
+.An Doug Rabson Aq Mt dfr@FreeBSD.org
diff --git a/sbin/kldunload/kldunload.8 b/sbin/kldunload/kldunload.8
index 0a7937c5ebc4..5e371e6fc5a0 100644
--- a/sbin/kldunload/kldunload.8
+++ b/sbin/kldunload/kldunload.8
@@ -78,4 +78,4 @@ replacing the
.Nm lkm
interface.
.Sh AUTHORS
-.An Doug Rabson Aq dfr@FreeBSD.org
+.An Doug Rabson Aq Mt dfr@FreeBSD.org
diff --git a/sbin/md5/md5.1 b/sbin/md5/md5.1
index 04efa3750d06..e191cd16015c 100644
--- a/sbin/md5/md5.1
+++ b/sbin/md5/md5.1
@@ -1,5 +1,5 @@
.\" $FreeBSD$
-.Dd July 31, 2012
+.Dd May 17, 2014
.Dt MD5 1
.Os
.Sh NAME
@@ -63,12 +63,12 @@ concerned, and should not be relied upon to produce unique outputs.
This also means that
.Tn MD5
should not be used as part of a cryptographic signature scheme.
-At the current time (2009-01-06) there is no publicly known method to
+At the current time (2014-05-17) there is no publicly known method to
.Dq reverse
MD5, i.e., to find an input given a hash value.
.Pp
.Tn SHA-1
-currently (2009-01-06) has no known collisions, but an attack has been
+currently (2014-05-17) has no known collisions, but an attack has been
found which is faster than a brute-force search, placing the security of
.Tn SHA-1
in doubt.
@@ -83,15 +83,15 @@ The hexadecimal checksum of each file listed on the command line is printed
after the options are processed.
.Bl -tag -width indent
.It Fl c Ar string
-Compare files to this md5 string.
-(Note that this option is not yet useful if multiple files are specified.)
+Compare the digest of the file against this string.
+.Pq Note that this option is not yet useful if multiple files are specified.
.It Fl s Ar string
Print a checksum of the given
.Ar string .
.It Fl p
Echo stdin to stdout and append the checksum to stdout.
.It Fl q
-Quiet mode - only the checksum is printed out.
+Quiet mode \(em only the checksum is printed out.
Overrides the
.Fl r
option.
@@ -114,7 +114,9 @@ and
.Nm rmd160
utilities exit 0 on success,
1 if at least one of the input files could not be read,
-and 2 if at least one file does not have the same hash as the -c option.
+and 2 if at least one file does not have the same hash as the
+.Fl c
+option.
.Sh SEE ALSO
.Xr cksum 1 ,
.Xr md5 3 ,
@@ -152,4 +154,4 @@ This program is placed in the public domain for free general use by
RSA Data Security.
.Pp
Support for SHA-1 and RIPEMD-160 has been added by
-.An Oliver Eikemeier Aq eik@FreeBSD.org .
+.An Oliver Eikemeier Aq Mt eik@FreeBSD.org .
diff --git a/sbin/mdconfig/mdconfig.8 b/sbin/mdconfig/mdconfig.8
index 6b52bec7830a..04d3391c0b16 100644
--- a/sbin/mdconfig/mdconfig.8
+++ b/sbin/mdconfig/mdconfig.8
@@ -319,5 +319,4 @@ combo.
The
.Nm
utility was written by
-.An Poul-Henning Kamp
-.Aq phk@FreeBSD.org .
+.An Poul-Henning Kamp Aq Mt phk@FreeBSD.org .
diff --git a/sbin/mount/mount.conf.8 b/sbin/mount/mount.conf.8
index c3296c363eaf..45b8257ebae9 100644
--- a/sbin/mount/mount.conf.8
+++ b/sbin/mount/mount.conf.8
@@ -247,6 +247,6 @@ The root mount logic in the
kernel which parses
.Pa /.mount.conf
was written by
-.An Marcel Moolenaar Aq marcel@FreeBSD.org .
+.An Marcel Moolenaar Aq Mt marcel@FreeBSD.org .
This man page was written by
-.An Craig Rodrigues Aq rodrigc@FreeBSD.org .
+.An Craig Rodrigues Aq Mt rodrigc@FreeBSD.org .
diff --git a/sbin/mount_cd9660/mount_cd9660.8 b/sbin/mount_cd9660/mount_cd9660.8
index b4716862bfd3..974ab3b1349e 100644
--- a/sbin/mount_cd9660/mount_cd9660.8
+++ b/sbin/mount_cd9660/mount_cd9660.8
@@ -147,7 +147,7 @@ utility first appeared in
.Bx 4.4 .
.Pp
The Unicode conversion routine was added by
-.An Ryuichiro Imura Aq imura@ryu16.org
+.An Ryuichiro Imura Aq Mt imura@ryu16.org
in 2003.
.Sh BUGS
POSIX device node mapping is currently not supported.
diff --git a/sbin/mount_fusefs/mount_fusefs.8 b/sbin/mount_fusefs/mount_fusefs.8
index 7c8bb67a7771..3e11cf19bd8f 100644
--- a/sbin/mount_fusefs/mount_fusefs.8
+++ b/sbin/mount_fusefs/mount_fusefs.8
@@ -151,7 +151,6 @@ Do not refuse unmounting if there are secondary mounts
.It Cm push_symlinks_in
Prefix absolute symlinks with the mountpoint
.El
-.Pp
.El
.Pp
Besides the above mount options, there is a set of pseudo-mount options which
diff --git a/sbin/mount_msdosfs/mount_msdosfs.8 b/sbin/mount_msdosfs/mount_msdosfs.8
index e7bc764eaf02..ae69aeb52e46 100644
--- a/sbin/mount_msdosfs/mount_msdosfs.8
+++ b/sbin/mount_msdosfs/mount_msdosfs.8
@@ -213,8 +213,8 @@ of the more aptly-named
.Nm .
.Pp
The character code conversion routine was added by
-.An Ryuichiro Imura Aq imura@ryu16.org
-at 2003.
+.An Ryuichiro Imura Aq Mt imura@ryu16.org
+in 2003.
.Sh CAVEATS
The use of the
.Fl 9
diff --git a/sbin/mount_unionfs/mount_unionfs.8 b/sbin/mount_unionfs/mount_unionfs.8
index b613a94414b4..075eff184ee1 100644
--- a/sbin/mount_unionfs/mount_unionfs.8
+++ b/sbin/mount_unionfs/mount_unionfs.8
@@ -342,9 +342,9 @@ because this is identical to using
.An -nosplit
In
.Fx 7.0 ,
-.An Masanori OZAWA Aq ozawa@ongs.co.jp
+.An Masanori OZAWA Aq Mt ozawa@ongs.co.jp
reimplemented handling of locking, whiteout, and file mode bits, and
-.An Hiroki Sato Aq hrs@FreeBSD.org
+.An Hiroki Sato Aq Mt hrs@FreeBSD.org
wrote about the changes in this manual page.
.Sh BUGS
THIS FILE SYSTEM TYPE IS NOT YET FULLY SUPPORTED (READ: IT DOESN'T WORK)
@@ -357,7 +357,7 @@ BATTERIES NOT INCLUDED.
.Pp
This code also needs an owner in order to be less dangerous - serious
hackers can apply by sending mail to
-.Aq freebsd-fs@FreeBSD.org
+.Aq Mt freebsd-fs@FreeBSD.org
and announcing
their intent to take it over.
.Pp
diff --git a/sbin/natd/natd.8 b/sbin/natd/natd.8
index b4b37ed1fb5d..7ccfbf7578bb 100644
--- a/sbin/natd/natd.8
+++ b/sbin/natd/natd.8
@@ -585,7 +585,6 @@ in the
file or using the command
.Pp
.Dl "sysctl net.inet.ip.forwarding=1"
-.Pp
.It
If you use the
.Fl interface
@@ -813,19 +812,19 @@ are forwarded to the appropriate router on that interface.
This program is the result of the efforts of many people at different
times:
.Pp
-.An Archie Cobbs Aq archie@FreeBSD.org
+.An Archie Cobbs Aq Mt archie@FreeBSD.org
(divert sockets)
-.An Charles Mott Aq cm@linktel.net
+.An Charles Mott Aq Mt cm@linktel.net
(packet aliasing)
-.An Eivind Eklund Aq perhaps@yes.no
+.An Eivind Eklund Aq Mt perhaps@yes.no
(IRC support & misc additions)
-.An Ari Suutari Aq suutari@iki.fi
+.An Ari Suutari Aq Mt suutari@iki.fi
(natd)
-.An Dru Nelson Aq dnelson@redwoodsoft.com
+.An Dru Nelson Aq Mt dnelson@redwoodsoft.com
(early PPTP support)
-.An Brian Somers Aq brian@awfulhak.org
+.An Brian Somers Aq Mt brian@awfulhak.org
(glue)
-.An Ruslan Ermilov Aq ru@FreeBSD.org
+.An Ruslan Ermilov Aq Mt ru@FreeBSD.org
(natd, packet aliasing, glue)
-.An Poul-Henning Kamp Aq phk@FreeBSD.org
+.An Poul-Henning Kamp Aq Mt phk@FreeBSD.org
(multiple instances)
diff --git a/sbin/newfs_msdos/newfs_msdos.8 b/sbin/newfs_msdos/newfs_msdos.8
index 1627f2de2cd8..d61043a57bd9 100644
--- a/sbin/newfs_msdos/newfs_msdos.8
+++ b/sbin/newfs_msdos/newfs_msdos.8
@@ -238,4 +238,4 @@ The
utility first appeared in
.Fx 3.0 .
.Sh AUTHORS
-.An Robert Nordier Aq rnordier@FreeBSD.org .
+.An Robert Nordier Aq Mt rnordier@FreeBSD.org
diff --git a/sbin/newfs_nandfs/newfs_nandfs.8 b/sbin/newfs_nandfs/newfs_nandfs.8
index 6997430d7236..7a630bbbf89e 100644
--- a/sbin/newfs_nandfs/newfs_nandfs.8
+++ b/sbin/newfs_nandfs/newfs_nandfs.8
@@ -72,5 +72,5 @@ The
.Nm
utility first appeared in
.Fx 10.0 .
-.Sh AUTHOR
+.Sh AUTHORS
.An Grzegorz Bernacki
diff --git a/sbin/nos-tun/nos-tun.8 b/sbin/nos-tun/nos-tun.8
index 405d43007b62..8ea6d5c15fa5 100644
--- a/sbin/nos-tun/nos-tun.8
+++ b/sbin/nos-tun/nos-tun.8
@@ -82,11 +82,11 @@ tunnel source 192.168.56.45
.Ed
.Sh AUTHORS
.An -nosplit
-.An Nickolay N. Dudorov Aq nnd@itfs.nsk.su
+.An Nickolay N. Dudorov Aq Mt nnd@itfs.nsk.su
wrote the program,
-.An Poul-Henning Kamp Aq phk@FreeBSD.org
+.An Poul-Henning Kamp Aq Mt phk@FreeBSD.org
wrote the man-page.
-.An Isao SEKI Aq iseki@gongon.com
+.An Isao SEKI Aq Mt iseki@gongon.com
added a new flag, IP protocol number.
.Sh BUGS
We do not allow for setting our source address for multihomed machines.
diff --git a/sbin/nvmecontrol/nvmecontrol.8 b/sbin/nvmecontrol/nvmecontrol.8
index 010f10680a5f..3b4b5c23aef3 100644
--- a/sbin/nvmecontrol/nvmecontrol.8
+++ b/sbin/nvmecontrol/nvmecontrol.8
@@ -124,7 +124,7 @@ nvme0 controller and activate it on the next reset.
.An -nosplit
.Nm
was developed by Intel and originally written by
-.An Jim Harris Aq jimharris@FreeBSD.org .
+.An Jim Harris Aq Mt jimharris@FreeBSD.org .
.Pp
This man page was written by
-.An Jim Harris Aq jimharris@FreeBSD.org .
+.An Jim Harris Aq Mt jimharris@FreeBSD.org .
diff --git a/sbin/pfctl/pfctl.8 b/sbin/pfctl/pfctl.8
index 5c0e7b37f4de..5908cf1a8e56 100644
--- a/sbin/pfctl/pfctl.8
+++ b/sbin/pfctl/pfctl.8
@@ -317,7 +317,6 @@ To kill a state with ID 4823e84500000018 created from a backup
firewall with hostid 00000002 use:
.Pp
.Dl # pfctl -k id -k 4823e84500000018/2
-.Pp
.It Fl m
Merge in explicitly given options without resetting those
which are omitted.
diff --git a/sbin/ping6/ping6.c b/sbin/ping6/ping6.c
index 01e29a194e3b..b963de176892 100644
--- a/sbin/ping6/ping6.c
+++ b/sbin/ping6/ping6.c
@@ -1090,8 +1090,14 @@ main(int argc, char *argv[])
/* signal handling */
if (seenalrm) {
/* last packet sent, timeout reached? */
- if (npackets && ntransmitted >= npackets)
- break;
+ if (npackets && ntransmitted >= npackets) {
+ struct timeval zerotime = {0, 0};
+ itimer.it_value = zerotime;
+ itimer.it_interval = zerotime;
+ (void)setitimer(ITIMER_REAL, &itimer, NULL);
+ seenalrm = 0; /* clear flag */
+ continue;
+ }
retransmit();
seenalrm = 0;
continue;
diff --git a/sbin/rcorder/Makefile b/sbin/rcorder/Makefile
index b71aa4b83d37..dc48b4cae918 100644
--- a/sbin/rcorder/Makefile
+++ b/sbin/rcorder/Makefile
@@ -14,6 +14,8 @@ CFLAGS+= -DORDER -I.
SRCS+= util.h
CLEANFILES+= util.h
+NO_PIE= yes
+
util.h:
ln -sf ${.CURDIR}/../../lib/libutil/libutil.h ${.TARGET}
diff --git a/sbin/rcorder/rcorder.8 b/sbin/rcorder/rcorder.8
index b43383a5b6ff..995ef684bb8d 100644
--- a/sbin/rcorder/rcorder.8
+++ b/sbin/rcorder/rcorder.8
@@ -165,9 +165,9 @@ utility first appeared in
.Sh AUTHORS
.An -nosplit
Written by
-.An Perry E. Metzger Aq perry@piermont.com
+.An Perry E. Metzger Aq Mt perry@piermont.com
and
-.An Matthew R. Green Aq mrg@eterna.com.au .
+.An Matthew R. Green Aq Mt mrg@eterna.com.au .
.Sh BUGS
The
.Dq Li REQUIRE
diff --git a/sbin/reboot/boot_i386.8 b/sbin/reboot/boot_i386.8
index e21e53f28034..d860423f4719 100644
--- a/sbin/reboot/boot_i386.8
+++ b/sbin/reboot/boot_i386.8
@@ -113,7 +113,6 @@ boot device, as a hint about available boot files.
.Ic ?\&
may also be specified as the last segment of a path, in which case
the listing will be of the relevant subdirectory.)
-.Pp
.It Xo
.Sm off
.Ar bios_drive : interface ( unit , Oo Ar slice , Oc Ar part )
diff --git a/sbin/reboot/nextboot.8 b/sbin/reboot/nextboot.8
index eb383197ae8f..7d4135298ac0 100644
--- a/sbin/reboot/nextboot.8
+++ b/sbin/reboot/nextboot.8
@@ -118,7 +118,7 @@ appeared in
.Fx 5.0 .
.Sh AUTHORS
This manual page was written by
-.An Gordon Tetlow Aq gordon@FreeBSD.org .
+.An Gordon Tetlow Aq Mt gordon@FreeBSD.org .
.Sh BUGS
The
.Nm
diff --git a/sbin/recoverdisk/recoverdisk.1 b/sbin/recoverdisk/recoverdisk.1
index b3924c554714..fd42f65ad5fb 100644
--- a/sbin/recoverdisk/recoverdisk.1
+++ b/sbin/recoverdisk/recoverdisk.1
@@ -137,9 +137,9 @@ utility first appeared in
.Sh AUTHORS
.An -nosplit
The original implementation was done by
-.An Poul-Henning Kamp Aq phk@FreeBSD.org
+.An Poul-Henning Kamp Aq Mt phk@FreeBSD.org
with minor improvements from
-.An Ulrich Sp\(:orlein Aq uqs@FreeBSD.org .
+.An Ulrich Sp\(:orlein Aq Mt uqs@FreeBSD.org .
.Pp
This manual page was written by
.An Ulrich Sp\(:orlein .
diff --git a/sbin/sconfig/sconfig.8 b/sbin/sconfig/sconfig.8
index 3fe7abcff686..aa52b646b76e 100644
--- a/sbin/sconfig/sconfig.8
+++ b/sbin/sconfig/sconfig.8
@@ -595,7 +595,7 @@ versions of the
utility are not fully compatible.
.\"--------------------------------------------------------------
.Sh AUTHORS
-.An Cronyx Engineering Aq info@cronyx.ru
+.An Cronyx Engineering Aq Mt info@cronyx.ru
.Pp
.Pa http://www.cronyx.ru
.\"--------------------------------------------------------------
diff --git a/sbin/setkey/setkey.8 b/sbin/setkey/setkey.8
index 19a916447c36..4306ec22f8b8 100644
--- a/sbin/setkey/setkey.8
+++ b/sbin/setkey/setkey.8
@@ -29,7 +29,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd May 13, 2006
+.Dd July 25, 2014
.Dt SETKEY 8
.Os
.\"
@@ -514,7 +514,7 @@ the SA from the key exchange daemon.
A value of
.Li default
tells the kernel to use the system wide default protocol
-e.g.\& the one from the
+e.g.,\& the one from the
.Li esp_trans_deflev
sysctl variable, when the kernel processes the packet.
A value of
@@ -627,7 +627,7 @@ 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
-camllia-cbc 128/192/256 rfc4312
+camellia-cbc 128/192/256 rfc4312
.Ed
.Pp
Note that the first 128/192/256 bits of a key for
@@ -656,47 +656,46 @@ des-cbc encryption algorithm.
.Bd -literal -offset indent
add 3ffe:501:4819::1 3ffe:501:481d::1 esp 123457
-E des-cbc 0x3ffe05014819ffff ;
-
+.Pp
.Ed
.\"
Add an authentication SA between two FQDN specified hosts:
.Bd -literal -offset indent
add -6 myhost.example.com yourhost.example.com ah 123456
-A hmac-sha1 "AH SA configuration!" ;
-
+.Pp
.Ed
Use both ESP and AH between two numerically specified hosts:
.Bd -literal -offset indent
add 10.0.11.41 10.0.11.33 esp 0x10001
-E des-cbc 0x3ffe05014819ffff
-A hmac-md5 "authentication!!" ;
-
+.Pp
.Ed
Get the SA information associated with first example above:
.Bd -literal -offset indent
get 3ffe:501:4819::1 3ffe:501:481d::1 ah 123456 ;
-
+.Pp
.Ed
Flush all entries from the database:
.Bd -literal -offset indent
flush ;
-
+.Pp
.Ed
Dump the ESP entries from the database:
.Bd -literal -offset indent
dump esp ;
-
+.Pp
.Ed
Add a security policy between two networks that uses ESP in tunnel mode:
.Bd -literal -offset indent
spdadd 10.0.11.41/32[21] 10.0.11.33/32[any] any
-P out ipsec esp/tunnel/192.168.0.1-192.168.1.2/require ;
-
+.Pp
.Ed
Use TCP MD5 between two numerically specified hosts:
.Bd -literal -offset indent
add 10.1.10.34 10.1.10.36 tcp 0x1000 -A tcp-md5 "TCP-MD5 BGP secret" ;
-
.Ed
.\"
.Sh SEE ALSO
diff --git a/sbin/sysctl/sysctl.c b/sbin/sysctl/sysctl.c
index a86d659cb040..13596450d2e1 100644
--- a/sbin/sysctl/sysctl.c
+++ b/sbin/sysctl/sysctl.c
@@ -710,9 +710,10 @@ show_var(int *oid, int nlen)
warnx("malloc failed");
return (1);
}
+ ctltype = (kind & CTLTYPE);
len = j;
i = sysctl(oid, nlen, val, &len, 0, 0);
- if (i || !len) {
+ if (i != 0 || (len == 0 && ctltype != CTLTYPE_STRING)) {
free(oval);
return (1);
}
@@ -724,7 +725,6 @@ show_var(int *oid, int nlen)
}
val[len] = '\0';
p = val;
- ctltype = (kind & CTLTYPE);
sign = ctl_sign[ctltype];
intlen = ctl_size[ctltype];