]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
10 years ago2 years, 10 months, 22 days after the projects/arm_eabi branch was created
andrew [Tue, 16 Jul 2013 19:15:19 +0000 (19:15 +0000)]
2 years, 10 months, 22 days after the projects/arm_eabi branch was created
make the ARM EABI the default ABI on arm, armeb, armv6 and armv6eb.

This is intended to be the default ABI from now on with the old ABI to be
retired. Because of this all users are strongly suggested to upgrade to the
ARM EABI.

As the two ABIs are incompatible it is unlikely upgrading in place will
work. Users should perform a full backup and either use an external machine
to upgrade, or install to an alternative location on their media. They
should also reinstall all ports or packages when these are available.

The only known issues are:
 - pkg incorrectly detects the ABI. This is fixed upstream, and will a
   patch will be made to the port.
 - GDB can have issues with executables built with clang.

__FreeBSD_version has been bumped.

10 years agoFree the non-fatal "timestamp missing" debug string manually as it is
andre [Tue, 16 Jul 2013 16:37:08 +0000 (16:37 +0000)]
Free the non-fatal "timestamp missing" debug string manually as it is
not covered by the catch-all free for the error cases.

Found by: Coverity

10 years agoDo not throw an error if the user requests to activate the image from
jimharris [Tue, 16 Jul 2013 15:45:37 +0000 (15:45 +0000)]
Do not throw an error if the user requests to activate the image from
an empty firmware slot, as long as the user has specified a firmware
image to download into the empty firmware slot.

Sponsored by: Intel
Reported by: Joe Golio <joseph.golio@emc.com>
MFC after: 3 days

10 years agoWorkaround some broken BIOSes that specify edge-sensitive but active-low
jhb [Tue, 16 Jul 2013 14:42:16 +0000 (14:42 +0000)]
Workaround some broken BIOSes that specify edge-sensitive but active-low
settings for ACPI-enumerated serial ports by forcing any IRQs that use
an ISA IRQ value with these settings to active-high instead of active-low.

This is known to occur with the BIOS on an Intel D2500CCE motherboard.

Tested by: Robert Ames <robertames@hotmail.com>, lev
Submitted by: Juergen Weiss weiss at uni-mainz.de (original patch)

10 years agoSweep unused nlist entries.
glebius [Tue, 16 Jul 2013 12:22:36 +0000 (12:22 +0000)]
Sweep unused nlist entries.

Sponsored by: Nginx, Inc.

10 years agoNeed to define NO_MAN here.
kevlo [Tue, 16 Jul 2013 09:40:59 +0000 (09:40 +0000)]
Need to define NO_MAN here.

10 years agoUse MAN= instead of NO_MAN=
kevlo [Tue, 16 Jul 2013 09:38:51 +0000 (09:38 +0000)]
Use MAN= instead of NO_MAN=

For some reason it still tries to install a priv.1 when using NO_MAN,
even though there isn't one yet.

10 years agoAdd missing header needed by sleep(3).
kevlo [Tue, 16 Jul 2013 09:22:50 +0000 (09:22 +0000)]
Add missing header needed by sleep(3).

10 years agolibc: name passed into __setenv is not necessarily NUL-terminated
avg [Tue, 16 Jul 2013 07:26:46 +0000 (07:26 +0000)]
libc: name passed into __setenv is not necessarily NUL-terminated

That's particularly true when __setenv is called from __merge_environ.

MFC after: 4 days

10 years agoAdd urtwnfw.
rpaulo [Tue, 16 Jul 2013 06:43:37 +0000 (06:43 +0000)]
Add urtwnfw.

10 years agoSilent warnings.
kevlo [Tue, 16 Jul 2013 03:12:31 +0000 (03:12 +0000)]
Silent warnings.

10 years agoAdd -n flag for compatibility with Linux version of mount(8).
rmh [Mon, 15 Jul 2013 21:57:21 +0000 (21:57 +0000)]
Add -n flag for compatibility with Linux version of mount(8).

Reviewed by: freebsd-fs, eadler, mckusick, jh, wblock

10 years agoMake some improvements to r253322 to really rescan target, not a bus.
mav [Mon, 15 Jul 2013 18:17:31 +0000 (18:17 +0000)]
Make some improvements to r253322 to really rescan target, not a bus.
Add there and in two more places checks for NULL on xpt_alloc_ccb_nowait().

10 years agoFix an argument reversal in calls to scsi_read_element_status().
ken [Mon, 15 Jul 2013 16:38:48 +0000 (16:38 +0000)]
Fix an argument reversal in calls to scsi_read_element_status().

Reported by: Ulrich Spoerlein <uqs@FreeBSD.org>
MFC after: 3 days

10 years agoInclude sys/systm.h after sys/param.h.
ae [Mon, 15 Jul 2013 15:40:57 +0000 (15:40 +0000)]
Include sys/systm.h after sys/param.h.

Suggested by: pluknet

10 years agoAdd IBM ServeRAID M5110 to the hardware list.
pluknet [Mon, 15 Jul 2013 14:28:59 +0000 (14:28 +0000)]
Add IBM ServeRAID M5110 to the hardware list.
This is a rebranded MegaRAID SAS 2208 [Thunderbolt] found e.g. on x3550 M4.

Reported by: Ilia Noskov <noskov@nic.ru>
MFC after: 3 days

10 years agoNuke mbstat. It wasn't used for mbuf statistics since FreeBSD 5.
glebius [Mon, 15 Jul 2013 12:18:36 +0000 (12:18 +0000)]
Nuke mbstat. It wasn't used for mbuf statistics since FreeBSD 5.

Now that r253351 moved sendfile() stats to a separate struct, the
last field used in mbstat is m_mcfail, which is updated, but never
read or obtained from userland.

10 years agoNuke "systat -mbuf". It was broken since FreeBSD 5, and since there
glebius [Mon, 15 Jul 2013 12:15:14 +0000 (12:15 +0000)]
Nuke "systat -mbuf". It was broken since FreeBSD 5, and since there
haven't been any complaints, no one used it.

10 years agoWhen stopping pfsync, remove the pfsync interface's syncpeer setting.
des [Mon, 15 Jul 2013 08:48:45 +0000 (08:48 +0000)]
When stopping pfsync, remove the pfsync interface's syncpeer setting.

MFC after: 3 days

10 years agoMove the Raspberry Pi low level options out of the kernel config and into
rpaulo [Mon, 15 Jul 2013 07:01:30 +0000 (07:01 +0000)]
Move the Raspberry Pi low level options out of the kernel config and into
std.rpi + std.bcm2835.

Reviewed by: imp

10 years agoMFi386: add ddb "show sysregs" command.
kib [Mon, 15 Jul 2013 06:30:57 +0000 (06:30 +0000)]
MFi386: add ddb "show sysregs" command.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

10 years agoIntroduce new structure sfstat for collecting sendfile's statistics
ae [Mon, 15 Jul 2013 06:16:57 +0000 (06:16 +0000)]
Introduce new structure sfstat for collecting sendfile's statistics
and remove corresponding fields from struct mbstat. Use PCPU counters
and SFSTAT_INC() macro for update these statistics.

Discussed with: glebius

10 years agoFix compiler warnings.
hrs [Mon, 15 Jul 2013 05:09:13 +0000 (05:09 +0000)]
Fix compiler warnings.

10 years agoDocument options for .eli devices.
hrs [Mon, 15 Jul 2013 03:50:14 +0000 (03:50 +0000)]
Document options for .eli devices.

Submitted by: ADAM David Alan Martin

10 years agoPR: kern/168520
rodrigc [Mon, 15 Jul 2013 01:41:34 +0000 (01:41 +0000)]
PR: kern/168520

Revert GRN 253255.  It is not needed now that GRN 253346 is committed.

10 years agoPR: 168520 170096
rodrigc [Mon, 15 Jul 2013 01:32:55 +0000 (01:32 +0000)]
PR: 168520 170096
Submitted by: adrian, zec

Fix multiple kernel panics when VIMAGE is enabled in the kernel.
These fixes are based on patches submitted by Adrian Chadd and Marko Zec.

(1)  Set curthread->td_vnet to vnet0 in device_probe_and_attach() just before calling
     device_attach().  This fixes multiple VIMAGE related kernel panics
     when trying to attach Bluetooth or USB Ethernet devices because
     curthread->td_vnet is NULL.

(2)  Set curthread->td_vnet in if_detach().  This fixes kernel panics when detaching networking
     interfaces, especially USB Ethernet devices.

(3)  Use VNET_DOMAIN_SET() in ng_btsocket.c

(4)  In ng_unref_node() set curthread->td_vnet.  This fixes kernel panics
     when detaching Netgraph nodes.

10 years agoUpdate fuse_kernel header.
pfg [Mon, 15 Jul 2013 00:05:27 +0000 (00:05 +0000)]
Update fuse_kernel header.

Bring in the changes from the FUSE kernel interface 7.10
(available under a BSD license).

After 7.10 the linux FUSE developers added support for a
controversial CUSE driver and some linux especific
features that are unlikely to find its way into FreeBSD.

We currently don't implement any of the new features so we
are *not* bumping the FUSE_KERNEL_MINOR_VERSION. The header
should, nevertheless, serve  as a template to add the new
features in a compatible manner.

While here adopt some minor cleanups from the upstream version
like removing FUSE_MAJOR and FUSE_MINOR which were never
used. Also add multiple inclusion header guards,

10 years agoFix a grammatical error.
rpaulo [Sun, 14 Jul 2013 20:22:16 +0000 (20:22 +0000)]
Fix a grammatical error.

10 years agoUpdate to comments describing block allocation policy.
mckusick [Sun, 14 Jul 2013 18:44:33 +0000 (18:44 +0000)]
Update to comments describing block allocation policy.

Submitted by: Bruce Evans

10 years agoRevert r252725 as it breaks WPA.
rpaulo [Sun, 14 Jul 2013 18:26:47 +0000 (18:26 +0000)]
Revert r252725 as it breaks WPA.

We need to fix wpa_supplicant because it checks whether the card has
ic_cryptocaps set. Since net80211 can do software encryption this check in
wpa_supplicant is wrong.

10 years agoAdd some missing definitions to build a working FreeBSD's libusb under Linux.
hselasky [Sun, 14 Jul 2013 10:22:00 +0000 (10:22 +0000)]
Add some missing definitions to build a working FreeBSD's libusb under Linux.

10 years agoAdd some missing LIBUSB IOCTL conversion codes.
hselasky [Sun, 14 Jul 2013 10:13:01 +0000 (10:13 +0000)]
Add some missing LIBUSB IOCTL conversion codes.

10 years agoRe-implement $probe_only aspect of f_media_get_TYPE() (where TYPE is cdrom,
dteske [Sun, 14 Jul 2013 03:08:52 +0000 (03:08 +0000)]
Re-implement $probe_only aspect of f_media_get_TYPE() (where TYPE is cdrom,
nfs, ftp, http, httpproxy, etc.) and f_device_get() (abstract method for
calling aforementioned f_media_get_TYPE()).

Previously, if $probe_only was present and non-NULL, the TYPE functions
would check for $file and exit with an appropriate error status (success if
the file exists and readable, failure otherwise).

While this has been retained, a pair of globals has been introduced:
$PROBE_EXIST and $PROBE_SIZE (see `/usr/share/bsdconfig/media/common.subr')

The $PROBE_EXIST global can be used where you need the functionality of
simply testing for existence (previously the _only_ functionality).

Meanwhile, the new $PROBE_SIZE global can be used to cause the TYPE function
to print the size of the file (in bytes) on standard-out (or -1) if not
found or an error occurs. NOTE: If an error occurs, it is logged with the
dprintf function, which is visible with `-d' flag or debug=1.

In many cases, where you need to get the size of a file _and_ check for its
existence, you can use the return status of a $PROBE_SIZE call.

10 years agoAllow regular off-the-shelf keyboards to be overclocked like so-called
hselasky [Sat, 13 Jul 2013 22:39:56 +0000 (22:39 +0000)]
Allow regular off-the-shelf keyboards to be overclocked like so-called
"Gamers Keyboards" by adding a tunable, "hw.usb.ukbd.pollrate", which
can fix the polling rate of the attached USB keyboards in the range
1..1000Hz. A similar feature already exists in the USB mouse
driver. Use with care! Might leave you without keyboard input. This
feature is only available when the USB_DEBUG option is set in the
kernel configuration file.

Correct "unit" type to "int" while at it.

10 years agoAdd creation timestamp (birthtime) support for fuse.
pfg [Sat, 13 Jul 2013 22:06:41 +0000 (22:06 +0000)]
Add creation timestamp (birthtime) support for fuse.

I was keeping this #ifdef'd for reference with the MacFUSE change[1]
but on second thought, this is a FreeBSD-only header so the SVN
history should be enough.

Add missing padding while here.

Reference [1]:
http://code.google.com/p/macfuse/source/detail?spec=svn1686&r=1360

10 years agoWhen fiddling with options of which registers to copy out for
mjacob [Sat, 13 Jul 2013 21:24:25 +0000 (21:24 +0000)]
When fiddling with options of which registers to copy out for
a mailbox command and which registers to copy back in when
the command completes, the bits being set need to not only
specify what bits you want to add from the default from the
table but also what bits you want *subtract* (mask) from the
default from the table.

A failing ISP2200 command pointed this out.

Much appreciation to: marius, who persisted and narrowed down what
the failure delta was, and shamed me into actually fixing it.
MFC after: 1 week

10 years agoCreate a proper stack frame for i386 version of bcopy(), despite the
kib [Sat, 13 Jul 2013 19:42:52 +0000 (19:42 +0000)]
Create a proper stack frame for i386 version of bcopy(), despite the
function is leaf.  The frame allows ddb to not loose the direct caller
of bcopy() in backtrace.

Other functions from support.s would benefit from the same change as
well, but for now bcopy() is the most frequent offender.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

10 years agoAssert that runningbufspace does not underflow.
kib [Sat, 13 Jul 2013 19:36:18 +0000 (19:36 +0000)]
Assert that runningbufspace does not underflow.

Sponsored by: The FreeBSD Foundation

10 years agoThere is no need to count waiters for the runningbufspace.
kib [Sat, 13 Jul 2013 19:34:34 +0000 (19:34 +0000)]
There is no need to count waiters for the runningbufspace.

Sponsored by: The FreeBSD Foundation

10 years agoAllow to call clock_gettime() on the clock id for zombie process.
kib [Sat, 13 Jul 2013 19:32:50 +0000 (19:32 +0000)]
Allow to call clock_gettime() on the clock id for zombie process.

Reported by: Petr Salinger <Petr.Salinger@seznam.cz>
PR: threads/180496
Sponsored by: The FreeBSD Foundation

10 years agoWhen printing opcode description, map T_NODEVICE to Direct Access Device to
mav [Sat, 13 Jul 2013 15:34:37 +0000 (15:34 +0000)]
When printing opcode description, map T_NODEVICE to Direct Access Device to
handle REPORT LUNS, etc.

10 years agoImprove handling of 0x3F/0x0E "Reported LUNs data has changed" and 0x25/0x00
mav [Sat, 13 Jul 2013 13:35:09 +0000 (13:35 +0000)]
Improve handling of 0x3F/0x0E "Reported LUNs data has changed" and 0x25/0x00
"Logical unit not supported" errors.  First initiates specific target rescan,
second -- destroys specific LUN.  That allows to automatically detect changes
in list of device LUNs.  This mechanism doesn't work when target is completely
idle, but probably that is all what can be done without active polling.

Reviewed by: ken
Sponsored by: iXsystems, Inc.

10 years agoCleaner support for type qualifiers.
theraven [Sat, 13 Jul 2013 13:04:38 +0000 (13:04 +0000)]
Cleaner support for type qualifiers.

Submitted by: Pasi Parviainen

10 years agoEnsure that the _Generic() macro in math.h works with qualified types.
theraven [Sat, 13 Jul 2013 10:10:45 +0000 (10:10 +0000)]
Ensure that the _Generic() macro in math.h works with qualified types.

tgmath.h contains the same bugs and so should be fixed in the same way.

10 years agoFix mdoc syntax.
hrs [Sat, 13 Jul 2013 08:17:55 +0000 (08:17 +0000)]
Fix mdoc syntax.

Pointed out by: joeld

10 years agoFix the urtwnfw definitions. We can now use urtwnfw in kernel config files.
rpaulo [Sat, 13 Jul 2013 07:17:18 +0000 (07:17 +0000)]
Fix the urtwnfw definitions. We can now use urtwnfw in kernel config files.

10 years agoClean up the modules list for PowerPC. powerpc64 has MACHINE_CPUARCH of
jhibbits [Sat, 13 Jul 2013 07:16:45 +0000 (07:16 +0000)]
Clean up the modules list for PowerPC.  powerpc64 has MACHINE_CPUARCH of
powerpc.  While here, sort the list.

10 years agoBring over some link aggregation / LACP protocol improvements and debugging
adrian [Sat, 13 Jul 2013 04:25:03 +0000 (04:25 +0000)]
Bring over some link aggregation / LACP protocol improvements and debugging
additions.

* Add some new tracing events to aid in debugging.
* Add in a debugging mode to drop transmit and received frames, specifically
  to test whether seeing or hearing heartbeats correctly cause LACP to
  drop the port.
* Add in (and make default) a strict LACP mode, which requires the
  heartbeat on a port to be heard before it's used.  Sometimes vendor ports
  will hang but the link layer stays up, resulting in hung traffic.
* Add logging the number of link status flaps, again to aid in debugging
  badly behaving switch ports.
* Calculate the lagg interface port speed as the multiple of the
  configured ports, rather than the largest.

Obtained from: Netflix
MFC after: 2 weeks

10 years agoIndent the "scp=... rlv=..." to make it easier to read the backtrace.
rpaulo [Sat, 13 Jul 2013 00:39:07 +0000 (00:39 +0000)]
Indent the "scp=... rlv=..." to make it easier to read the backtrace.

10 years agoConst-ify the new da_delete_functions.
scottl [Fri, 12 Jul 2013 23:20:11 +0000 (23:20 +0000)]
Const-ify the new da_delete_functions.
Remove a redundant sanity check

Submitted by: Steven Hartland
Obtained from: Netflix
MFC after: 3 days

10 years agoRegenerate src.conf(5) after changing WITHOUT_PKGTOOLS to WITH_PKGTOOLS
bapt [Fri, 12 Jul 2013 23:12:37 +0000 (23:12 +0000)]
Regenerate src.conf(5) after changing WITHOUT_PKGTOOLS to WITH_PKGTOOLS

10 years agoDisable building of pkg_install by default
bapt [Fri, 12 Jul 2013 23:11:17 +0000 (23:11 +0000)]
Disable building of pkg_install by default
If people still want to have pkg_install they can specify WITH_PKGTOOLS when building world

10 years agoEnsure the locale is LC_ALL=C when regenerating src.conf.5
bapt [Fri, 12 Jul 2013 23:08:44 +0000 (23:08 +0000)]
Ensure the locale is LC_ALL=C when regenerating src.conf.5

MFC after: 3 days

10 years agoChange the E1000 driver option header handling to match the
jfv [Fri, 12 Jul 2013 22:36:26 +0000 (22:36 +0000)]
Change the E1000 driver option header handling to match the
ixgbe driver. As it was, when building them as a module INET
and INET6 are not defined. In these drivers it does not cause
a panic, however it does result in different behavior in the
ioctl routine when you are using a module vs static, and I
think the behavior should be the same.

MFC after: 3 days

10 years agoDocument that a literal jail name of 0 (zero) is not allowed.
gjb [Fri, 12 Jul 2013 22:02:11 +0000 (22:02 +0000)]
Document that a literal jail name of 0 (zero) is not allowed.

PR: 174436
Submitted by: Robert Schulze
Reviewed by: mjg
MFC after: 3 days

10 years agoMerge from hpt27xx, r249468 (mav):
delphij [Fri, 12 Jul 2013 21:36:29 +0000 (21:36 +0000)]
Merge from hpt27xx, r249468 (mav):

MFprojects/camlock r248982:
Stop abusing xpt_periph in random plases that really have no periph related
to CCB, for example, bus scanning.  NULL value is fine in such cases and it
is correctly logged in debug messages as "noperiph".  If at some point we
need some real XPT periphs (alike to pmpX now), quite likely they will be
per-bus, and not a single global instance as xpt_periph now.

10 years agoOpps, need to change the VF code as well.
jfv [Fri, 12 Jul 2013 21:21:15 +0000 (21:21 +0000)]
Opps, need to change the VF code as well.

MFC after: ASAP

10 years agoRemove the conditional define around the option headers,
jfv [Fri, 12 Jul 2013 21:14:42 +0000 (21:14 +0000)]
Remove the conditional define around the option headers,
when building the driver as a module the result of the present
system results in INET and INET6 being undefined, and will cause
the panic in ixgbe_tso_setup(). The Makefile in the module directory
now renders the conditional in the source unnecessary and wrong.

MFC after: ASAP - the panic as a module must not get into 9.2

10 years agoA complete duplication of binding should be allowed if on both new and
trociny [Fri, 12 Jul 2013 19:08:33 +0000 (19:08 +0000)]
A complete duplication of binding should be allowed if on both new and
duplicated sockets a multicast address is bound and either
SO_REUSEPORT or SO_REUSEADDR is set.

But actually it works for the following combinations:

  * SO_REUSEPORT is set for the fist socket and SO_REUSEPORT for the new;
  * SO_REUSEADDR is set for the fist socket and SO_REUSEADDR for the new;
  * SO_REUSEPORT is set for the fist socket and SO_REUSEADDR for the new;

and fails for this:

  * SO_REUSEADDR is set for the fist socket and SO_REUSEPORT for the new.

Fix the last case.

PR: 179901
MFC after: 1 month

10 years agoOnly copy as much bytes as there in superblock, instead of the full
kib [Fri, 12 Jul 2013 18:52:33 +0000 (18:52 +0000)]
Only copy as much bytes as there in superblock, instead of the full
block copy, when copying the superblock into the snapshot.  UFS1 does
not align superblock on the block boundary, and bcopy runs off the end
of the buffer.

Reported by: Andre Albsmeier <Andre.Albsmeier@siemens.com>
Reviewed by: mckusick
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

10 years ago%d should be used for printing int32_t instead of %zd.
jimharris [Fri, 12 Jul 2013 18:13:41 +0000 (18:13 +0000)]
%d should be used for printing int32_t instead of %zd.

clang does not complain about this - only gcc.

MFC after: 3 days

10 years agoTypo corrected.
schweikh [Fri, 12 Jul 2013 17:37:05 +0000 (17:37 +0000)]
Typo corrected.

10 years agoAdd creation timestamp (birthtime) support for fuse.
pfg [Fri, 12 Jul 2013 17:22:59 +0000 (17:22 +0000)]
Add creation timestamp (birthtime) support for fuse.

This is based on similar support in MacFUSE.

10 years agoAdd -F fibnum option to specify an FIB number for -r flag.
hrs [Fri, 12 Jul 2013 17:11:30 +0000 (17:11 +0000)]
Add -F fibnum option to specify an FIB number for -r flag.

10 years agoFix a problem with READ ELEMENT STATUS that occurs on some
ken [Fri, 12 Jul 2013 17:09:50 +0000 (17:09 +0000)]
Fix a problem with READ ELEMENT STATUS that occurs on some
changers that don't support the DVCID and CURDATA bits that were
introduced in the SMC spec.

These changers will return an Illegal Request type error if the
bits are set.  This causes "chio status" to fail.

The fix is two-fold.  First, for changers that claim to be SCSI-2
or older, don't set the DVCID and CURDATA bits for READ ELEMENT
STATUS.  For newer changers (SCSI-3 and newer), we default to
setting the new bits, but back off and try the READ ELEMENT STATUS
without the bits if we get an Illegal Request type error.

This has been tested on a Qualstar TLS-8211, which is a SCSI-2
changer that does not support the new bits, and a Spectra T-380,
which is a SCSI-3 changer that does support the new bits.  In the
absence of a SCSI-3 changer that does not support the bits, I
tested that with some error injection code.  (The SMC spec says
that support for CURDATA is mandatory, and DVCID is optional.)

scsi_ch.c: Add a new quirk, CH_Q_NO_DVCID that gets set for
SCSI-2 and older libraries, or newer libraries that
report errors when the DVCID/CURDATA bits are set.

In chgetelemstatus(), use the new quirk to
determine whether or not to set DVCID and CURDATA.
If we get an error with the bits set, back off and
try without the bits.  Set the quirk flag if the
read element status succeeds without the bits set.

Increase the READ ELEMENT STATUS timeout to 60
seconds after testing with a Spectra T-380.  The
previous value was 10 seconds, and too short for
the T-380.  This may be decreased later after
some additional testing and investigation.

Tested by: Andre Albsmeier <Andre.Albsmeier@siemens.com>
Sponsored by: Spectra Logic
MFC after: 3 days

10 years agoFix check: bitwise and has only one &.
nwhitehorn [Fri, 12 Jul 2013 15:56:30 +0000 (15:56 +0000)]
Fix check: bitwise and has only one &.

MFC after: 1 week

10 years agosh: Do not read from stdin if an error occurs during -i -c cmd.
jilles [Fri, 12 Jul 2013 15:29:41 +0000 (15:29 +0000)]
sh: Do not read from stdin if an error occurs during -i -c cmd.

Although using -i with -c does not seem very useful, it seems inappropriate
to read commands from the terminal in this case.

Side effect: if the -s -c extension is used and the -s option is turned off
using 'set +s' during the interactive part, the shell now exits after an
error or interrupt. Note that POSIX only specifies -s as option to sh, not
to set.

See also Austin Group issue #718.

10 years ago- mdoc: remove superfluous paragraph macros.
pluknet [Fri, 12 Jul 2013 15:08:37 +0000 (15:08 +0000)]
- mdoc: remove superfluous paragraph macros.
- fix typo in xref manual section number.

10 years agoRemove non existent in FreeBSD reference.
glebius [Fri, 12 Jul 2013 14:46:40 +0000 (14:46 +0000)]
Remove non existent in FreeBSD reference.

10 years agoAdd manual page for vmem(9). Obtained from NetBSD, modified to match
glebius [Fri, 12 Jul 2013 14:25:58 +0000 (14:25 +0000)]
Add manual page for vmem(9). Obtained from NetBSD, modified to match
our implementation.

Obtained from: NetBSD

10 years agoPrefix the alias macros for members of struct __mcontext with an underscore
marius [Fri, 12 Jul 2013 14:24:52 +0000 (14:24 +0000)]
Prefix the alias macros for members of struct __mcontext with an underscore
in order to avoid a clash in the net80211 code.

10 years agoAdd a leaf node CTL_NET.PF_ROUTE.0.AF.NET_RT_DUMP.0.FIB. This returns
hrs [Fri, 12 Jul 2013 12:36:12 +0000 (12:36 +0000)]
Add a leaf node CTL_NET.PF_ROUTE.0.AF.NET_RT_DUMP.0.FIB.  This returns
routing table with the specified FIB number, not td->td_proc->p_fibnum.

10 years ago- Drop GIF_ACCEPT_REVETHIP flag by default.
hrs [Fri, 12 Jul 2013 12:18:07 +0000 (12:18 +0000)]
- Drop GIF_ACCEPT_REVETHIP flag by default.
- Add IFF_MONITOR support.

10 years agoFix the build with C++ where __builtin_types_compatible_p is not allowed.
theraven [Fri, 12 Jul 2013 11:03:51 +0000 (11:03 +0000)]
Fix the build with C++ where __builtin_types_compatible_p is not allowed.

10 years agoRemove authpf-noip along with authpf.
des [Fri, 12 Jul 2013 10:07:21 +0000 (10:07 +0000)]
Remove authpf-noip along with authpf.

Reminded by: delphij@

10 years agoFix 'SEE ALSO' list.
oleg [Fri, 12 Jul 2013 09:20:55 +0000 (09:20 +0000)]
Fix 'SEE ALSO' list.

10 years agoPR: kern/168520
rodrigc [Fri, 12 Jul 2013 08:03:10 +0000 (08:03 +0000)]
PR: kern/168520
Submitted by: "YAMAMOTO, Shigeru" <shigeru@iij.ad.jp>
Reviewed by: adrian

In PC-BSD 9.1, VIMAGE is enabled in the kernel config.
For laptops with Bluetooth capability, such as the HP Elitebook 8460p,
the kernel will panic upon bootup, because curthread->td_vnet
is not initialized.

Properly initialize curthread->td_vnet when initializing the Bluetooth stack.

This allows laptops such as the HP Elitebook 8460p laptop
to properly boot with VIMAGE kernels.

10 years agoUnbreak VIMAGE by correctly naming the vnet pointer in struct tcp_syncache.
andre [Fri, 12 Jul 2013 07:43:56 +0000 (07:43 +0000)]
Unbreak VIMAGE by correctly naming the vnet pointer in struct tcp_syncache.

Reported by: trociny, rodrigc

10 years agoFix a wrong memcpy of struct sockaddr.
hrs [Fri, 12 Jul 2013 06:54:29 +0000 (06:54 +0000)]
Fix a wrong memcpy of struct sockaddr.

Spotted by: dt71@gmx.com

10 years agoClarify how "hide" and "unhide" commands work on directories.
jh [Fri, 12 Jul 2013 06:03:25 +0000 (06:03 +0000)]
Clarify how "hide" and "unhide" commands work on directories.

10 years agoRevert r253247. This change should be improved based on a lesson learnt
hrs [Fri, 12 Jul 2013 04:22:46 +0000 (04:22 +0000)]
Revert r253247.  This change should be improved based on a lesson learnt
from r233646 first.

Pointed out by: jmallett

10 years agoUse strtoumax() instead of strtoul() for id/ref attr in XML elements.
hrs [Fri, 12 Jul 2013 02:36:00 +0000 (02:36 +0000)]
Use strtoumax() instead of strtoul() for id/ref attr in XML elements.
This improves compatibility when running an ILP32 binary on LP64 kernel.

Spotted by: gjb

10 years agoRefactor the various delete methods out of dastart(). Cleans up a bunch
scottl [Fri, 12 Jul 2013 00:50:25 +0000 (00:50 +0000)]
Refactor the various delete methods out of dastart().  Cleans up a bunch
of style and adds more modularity and clarity.

Obtained from: Netflix
MFC after: 3 days

10 years agoFix bug in deleting files: If two ports had the same tarball and one of
cperciva [Thu, 11 Jul 2013 22:19:18 +0000 (22:19 +0000)]
Fix bug in deleting files: If two ports had the same tarball and one of
them changed (or was removed from the tree) then portsnap would delete
that file.  This happened earlier today when one of two empty port
directories was removed.  Uniquifying the lists of needed files fixes
this.

9.2-RELEASE candidate.

MFC after: 3 days

10 years agoWhen swap pager allocates metadata in the pagedaemon context, allow it
kib [Thu, 11 Jul 2013 20:33:57 +0000 (20:33 +0000)]
When swap pager allocates metadata in the pagedaemon context, allow it
to drain the reserve.  This was broken in r243040, causing deadlock.
Note that VM_WAIT call in case of uma_zalloc() failure from pagedaemon
would only wait for the v_pageout_free_min anyway.

Reported and tested by: pho
Reviewed by: alc
Sponsored by: The FreeBSD Foundation

10 years agoFix some typoes in math.h cleanup.
theraven [Thu, 11 Jul 2013 19:34:16 +0000 (19:34 +0000)]
Fix some typoes in math.h cleanup.

10 years agoAttach to the 4x10G T540-CR card.
np [Thu, 11 Jul 2013 19:09:31 +0000 (19:09 +0000)]
Attach to the 4x10G T540-CR card.

10 years agoCleanups to math.h that prevent namespace conflicts with C++.
theraven [Thu, 11 Jul 2013 17:41:04 +0000 (17:41 +0000)]
Cleanups to math.h that prevent namespace conflicts with C++.

Reviewed by: bde
MFC after: 3 days

10 years agoFix const propagation issues to make GCC happy.
andre [Thu, 11 Jul 2013 16:27:11 +0000 (16:27 +0000)]
Fix const propagation issues to make GCC happy.

Submitted by: Michael Butler <imb@protected-networks.net>

10 years agoImprove SYN cookies by encoding the MSS, WSCALE (window scaling) and SACK
andre [Thu, 11 Jul 2013 15:29:25 +0000 (15:29 +0000)]
Improve SYN cookies by encoding the MSS, WSCALE (window scaling) and SACK
information into the ISN (initial sequence number) without the additional
use of timestamp bits and switching to the very fast and cryptographically
strong SipHash-2-4 MAC hash algorithm to protect the SYN cookie against
forgeries.

The purpose of SYN cookies is to encode all necessary session state in
the 32 bits of our initial sequence number to avoid storing any information
locally in memory.  This is especially important when under heavy spoofed
SYN attacks where we would either run out of memory or the syncache would
fill with bogus connection attempts swamping out legitimate connections.

The original SYN cookies method only stored an indexed MSS values in the
cookie.  This isn't sufficient anymore and breaks down in the presence of
WSCALE information which is only exchanged during SYN and SYN-ACK.  If we
can't keep track of it then we may severely underestimate the available
send or receive window. This is compounded with large windows whose size
information on the TCP segment header is even lower numerically.  A number
of years back SYN cookies were extended to store the additional state in
the TCP timestamp fields, if available on a connection.  While timestamps
are common among the BSD, Linux and other *nix systems Windows never enabled
them by default and thus are not present for the vast majority of clients
seen on the Internet.

The common parameters used on TCP sessions have changed quite a bit since
SYN cookies very invented some 17 years ago.  Today we have a lot more
bandwidth available making the use window scaling almost mandatory.  Also
SACK has become standard making recovering from packet loss much more
efficient.

This change moves all necessary information into the ISS removing the need
for timestamps.  Both the MSS (16 bits) and send WSCALE (4 bits) are stored
in 3 bit indexed form together with a single bit for SACK.  While this is
significantly less than the original range, it is sufficient to encode all
common values with minimal rounding.

The MSS depends on the MTU of the path and with the dominance of ethernet
the main value seen is around 1460 bytes.  Encapsulations for DSL lines
and some other overheads reduce it by a few more bytes for many connections
seen.  Rounding down to the next lower value in some cases isn't a problem
as we send only slightly more packets for the same amount of data.

The send WSCALE index is bit more tricky as rounding down under-estimates
the available send space available towards the remote host, however a small
number values dominate and are carefully selected again.

The receive WSCALE isn't encoded at all but recalculated based on the local
receive socket buffer size when a valid SYN cookie returns.  A listen socket
buffer size is unlikely to change while active.

The index values for MSS and WSCALE are selected for minimal rounding errors
based on large traffic surveys.  These values have to be periodically
validated against newer traffic surveys adjusting the arrays tcp_sc_msstab[]
and tcp_sc_wstab[] if necessary.

In addition the hash MAC to protect the SYN cookies is changed from MD5
to SipHash-2-4, a much faster and cryptographically secure algorithm.

Reviewed by: dwmalone
Tested by: Fabian Keil <fk@fabiankeil.de>

10 years agoFix a poorly worded comment in nvme(4).
jimharris [Thu, 11 Jul 2013 15:02:38 +0000 (15:02 +0000)]
Fix a poorly worded comment in nvme(4).

MFC after: 3 days

10 years agoSipHash is a cryptographically strong pseudo-random function (a.k.a. keyed
andre [Thu, 11 Jul 2013 14:18:38 +0000 (14:18 +0000)]
SipHash is a cryptographically strong pseudo-random function (a.k.a. keyed
hash function) optimized for speed on short messages returning a 64bit hash/
digest value.

SipHash is simpler and much faster than other secure MACs and competitive
in speed with popular non-cryptographic hash functions.  It uses a 128-bit
key without the hidden cost of a key expansion step.  SipHash iterates a
simple round function consisting of four additions, four xors, and six
rotations, interleaved with xors of message blocks for a pre-defined number
of compression and finalization rounds.  The absence of  secret load/store
addresses or secret branch conditions avoid timing attacks.  No state is
shared between messages.  Hashing is deterministic and doesn't use nonces.
It is not susceptible to length extension attacks.

Target applications include network traffic authentication, message
authentication (MAC) and hash-tables protection against hash-flooding
denial-of-service attacks.

The number of update/finalization rounds is defined during initialization:

 SipHash24_Init() for the fast and reasonable strong version.
 SipHash48_Init() for the strong version (half as fast).

SipHash usage is similar to other hash functions:

 struct SIPHASH_CTX ctx;
 char *k = "16bytes long key"
 char *s = "string";
 uint64_t h = 0;
 SipHash24_Init(&ctx);
 SipHash_SetKey(&ctx, k);
 SipHash_Update(&ctx, s, strlen(s));
 SipHash_Final(&h, &ctx);  /* or */
 h = SipHash_End(&ctx);    /* or */
 h = SipHash24(&ctx, k, s, strlen(s));

It was designed by Jean-Philippe Aumasson and Daniel J. Bernstein and
is described in the paper "SipHash: a fast short-input PRF", 2012.09.18:
 https://131002.net/siphash/siphash.pdf
 Permanent ID: b9a943a805fbfc6fde808af9fc0ecdfa

Implemented by: andre (based on the paper)
Reviewed by: cperciva

10 years agoMake use of the fact that uma_zone_set_max(9) already returns the
andre [Thu, 11 Jul 2013 12:53:13 +0000 (12:53 +0000)]
Make use of the fact that uma_zone_set_max(9) already returns the
rounded limit making a call to uma_zone_get_max(9) unnecessary.

MFC after: 1 day

10 years agoFix style issues, a typo in "kern.ipc.nmbufs" and correctly plave and
andre [Thu, 11 Jul 2013 12:46:35 +0000 (12:46 +0000)]
Fix style issues, a typo in "kern.ipc.nmbufs" and correctly plave and
expose the value of the tunable maxmbufmem as "kern.ipc.maxmbufmem"
through sysctl.

Reported by: smh
MFC after: 1 day

10 years agoThe vm_fault() should not be allowed to proceed on the map entry which
kib [Thu, 11 Jul 2013 05:58:28 +0000 (05:58 +0000)]
The vm_fault() should not be allowed to proceed on the map entry which
is being wired now.  The entry wired count is changed to non-zero in
advance, before the map lock is dropped.  This makes the vm_fault() to
perceive the entry as wired, and breaks the fragment which moves the
wire count from the shadowed page, to the upper page, making the code
unwiring non-wired page.

On the other hand, the vm_fault() calls from vm_fault_wire() should be
allowed to proceed, so only drain MAP_ENTRY_IN_TRANSITION from
vm_fault() when wiring_thread is not current.

Reported and tested by: pho
Reviewed by: alc
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

10 years agoThe mlockall() or VM_MAP_WIRE_HOLESOK does not interact properly with
kib [Thu, 11 Jul 2013 05:55:08 +0000 (05:55 +0000)]
The mlockall() or VM_MAP_WIRE_HOLESOK does not interact properly with
parallel creation of the map entries, e.g. by mmap() or stack growing.
It also breaks when other entry is wired in parallel.

The vm_map_wire() iterates over the map entries in the region, and
assumes that map entries it finds are marked as in transition before,
also that any entry marked as in transition, are marked by the current
invocation of vm_map_wire().  This is not true for new entries in the
holes.

Add the thread owner of the MAP_ENTRY_IN_TRANSITION flag to struct
vm_map_entry.  In vm_map_wire() and vm_map_unwire(), only process the
entries which transition owner is the current thread.

Reported and tested by: pho
Reviewed by: alc
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

10 years agoNever remove user-wired pages from an object when doing
kib [Thu, 11 Jul 2013 05:47:26 +0000 (05:47 +0000)]
Never remove user-wired pages from an object when doing
msync(MS_INVALIDATE).  The vm_fault_copy_entry() requires that object
range which corresponds to the user-wired vm_map_entry, is always
fully populated.

Add OBJPR_NOTWIRED flag for vm_object_page_remove() to request the
preserving behaviour, use it when calling vm_object_page_remove() from
vm_object_sync().

Reported and tested by: pho
Reviewed by: alc
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

10 years agoIn the vm_page_set_invalid() function, do not assert that the page is
kib [Thu, 11 Jul 2013 05:38:39 +0000 (05:38 +0000)]
In the vm_page_set_invalid() function, do not assert that the page is
not busy, since its only caller brelse() can legitimately call it on
busy page.  This happens for VOP_PUTPAGES() on filesystems that use
buffers and which VOP_WRITE() method marked the buffer containing page
as non-cacheable.

Reported and tested by: pho
Reviewed by: alc
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

10 years agoDo not invalidate page of the B_NOCACHE buffer or buffer after an I/O
kib [Thu, 11 Jul 2013 05:36:26 +0000 (05:36 +0000)]
Do not invalidate page of the B_NOCACHE buffer or buffer after an I/O
error if any user wired mappings exist.  Doing the invalidation
destroys the user wiring.

The change is the temporal measure to close the bug, the more proper
fix is to delegate the invalidation of the page to upper layers
always.

Reported and tested by: pho
Reviewed by: alc
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

10 years agoExplicitely panic instead of possibly doing undefined things when
kib [Thu, 11 Jul 2013 05:15:30 +0000 (05:15 +0000)]
Explicitely panic instead of possibly doing undefined things when
ptelist KVA is exhausted.  Currently this cannot happen, the added
panic serves as assert.

Discussed with: alc
Sponsored by: The FreeBSD Foundation