]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
11 years agoMake Tflag and Wflag filters work for more sysctl options.
Alfred Perlstein [Wed, 12 Dec 2012 02:55:40 +0000 (02:55 +0000)]
Make Tflag and Wflag filters work for more sysctl options.

To do this move the Tflag and Wflag checks earlier in show_var() so
we bail earlier for variables not matching our query.

11 years agoAdd -R, an option to restart all enabled "local" services.
Xin LI [Wed, 12 Dec 2012 01:50:58 +0000 (01:50 +0000)]
Add -R, an option to restart all enabled "local" services.

Discussed on: -rc@ (in September)
MFC after: 2 months

11 years agolibc: Make various internal file descriptors close-on-exec.
Jilles Tjoelker [Tue, 11 Dec 2012 22:52:56 +0000 (22:52 +0000)]
libc: Make various internal file descriptors close-on-exec.

These are obtained via fopen().

11 years agoCleanup a few duplicate llvm libs that snuck in with the recent update.
Dimitry Andric [Tue, 11 Dec 2012 20:08:57 +0000 (20:08 +0000)]
Cleanup a few duplicate llvm libs that snuck in with the recent update.

Noticed by: rdivacky

11 years agoSimilar to CTLFLAG_RDTUN, provide CTLFLAG_RWTUN that defines writable sysctl
Pawel Jakub Dawidek [Tue, 11 Dec 2012 19:54:35 +0000 (19:54 +0000)]
Similar to CTLFLAG_RDTUN, provide CTLFLAG_RWTUN that defines writable sysctl
that can also be modified by loader tunable.

11 years agoRemove 'dangerous' instructions from the example make.conf.
Eitan Adler [Tue, 11 Dec 2012 18:39:53 +0000 (18:39 +0000)]
Remove 'dangerous' instructions from the example make.conf.
Clarify when and why these might be used and that this isn't a supported
configuration.

PR: docs/144488
Submitted by: amdmi3
Approved by: cperciva (implicit)
MFC after: 2 weeks

11 years agoAdd pci id for the xeon hd4000 (IvyBridge server GT2)
Baptiste Daroussin [Tue, 11 Dec 2012 09:38:12 +0000 (09:38 +0000)]
Add pci id for the xeon hd4000 (IvyBridge server GT2)

Submitted by: François Tigeot <ftigeot@wolfpond.org>
Obtained from: dragonfly
MFC after: 3 days

11 years agoMerge 1.127 from OpenBSD, that closes a regression from 1.125 (merged
Gleb Smirnoff [Tue, 11 Dec 2012 08:37:08 +0000 (08:37 +0000)]
Merge 1.127 from OpenBSD, that closes a regression from 1.125 (merged
as r242694):
  do better detection of when we have a better version of the tcp sequence
  windows than our peer.

  this resolves the last of the pfsync traffic storm issues ive been able to
  produce, and therefore makes it possible to do usable active-active
  statuful firewalls with pf.

11 years agoCleanup more of the kassert_panic.
Alfred Perlstein [Tue, 11 Dec 2012 07:08:14 +0000 (07:08 +0000)]
Cleanup more of the kassert_panic.

fix compile warnings on !amd64 and NULL derefs that would happen
if kassert_panic() would return.

11 years agoFix WITNESS when INVARIANT_SUPPORT is defined.
Alfred Perlstein [Tue, 11 Dec 2012 05:59:16 +0000 (05:59 +0000)]
Fix WITNESS when INVARIANT_SUPPORT is defined.

This fixes tinderbox breakage from r244105.

Pointed out by: adrian

11 years agoThere's no need to use a TXQ pointer here; we specifically need the
Adrian Chadd [Tue, 11 Dec 2012 04:19:51 +0000 (04:19 +0000)]
There's no need to use a TXQ pointer here; we specifically need the
hardware queue ID when queuing to EDMA descriptors.

This is a small part of trying to reduce the size of ath_buf entries.

11 years agoAllow sysctl to filter boot and runtime tunables.
Alfred Perlstein [Tue, 11 Dec 2012 01:28:06 +0000 (01:28 +0000)]
Allow sysctl to filter boot and runtime tunables.

Add the following flags to sysctl:
 -W  - show only writable sysctls
 -T  - show only tuneable sysctls

This can be used to create a /var/run/sysctl.boot to
compare set tunables versus booted tunables.

Sponsored by: iXsystems

11 years agoSwitch the hardwired WITNESS panics to kassert_panic.
Alfred Perlstein [Tue, 11 Dec 2012 01:23:50 +0000 (01:23 +0000)]
Switch the hardwired WITNESS panics to kassert_panic.

This is an ongoing effort to provide runtime debug information
useful in the field that does not panic existing installations.

This gives us the flexibility needed when shipping images to a
potentially large audience with WITNESS enabled without worrying
about formerly non-fatal LORs hurting a release.

Sponsored by: iXsystems

11 years agoIn parse():
Xin LI [Tue, 11 Dec 2012 01:12:29 +0000 (01:12 +0000)]
In parse():

 - Only operate on copy, don't operate on source.
 - Eliminate home-rolled strsep().
 - Constify the parameter.

MFC after: 2 weeks

11 years agoback out half of 244098.
Alfred Perlstein [Tue, 11 Dec 2012 00:10:20 +0000 (00:10 +0000)]
back out half of 244098.

kern.bootfile needs to be rw for installkernel.

Pointed out by: kib, flo

11 years agoAdd CTLFLAG_STATS to sysctl flags
Alfred Perlstein [Mon, 10 Dec 2012 23:17:08 +0000 (23:17 +0000)]
Add CTLFLAG_STATS to sysctl flags

In preparation for sysctl(8) growing the ability to only print
out boot/run-time tunables we need a way to differentiate between
RW sysctl nodes that tune a particular thing, or simply export
a stat that we want to allow the sysadmin to reset to 0 (or some
other value).

To do so, we add the CTLFLAG_STATS which should be OR'd into the
CTLFLAGs when exporting a "writable/resettable" statistic node via
sysctl.

11 years agoAdd constant missed in r244099
Alfred Perlstein [Mon, 10 Dec 2012 23:12:51 +0000 (23:12 +0000)]
Add constant missed in r244099

KDB entered due to KASSERT.

11 years agoallow KASSERT to enter KDB.
Alfred Perlstein [Mon, 10 Dec 2012 23:11:26 +0000 (23:11 +0000)]
allow KASSERT to enter KDB.

11 years agomake sysctls kern.{bootfile,conftxt} read-only
Alfred Perlstein [Mon, 10 Dec 2012 23:09:55 +0000 (23:09 +0000)]
make sysctls kern.{bootfile,conftxt} read-only

MFC after: 1 month

11 years agoSync pf.os with OpenBSD:
Xin LI [Mon, 10 Dec 2012 20:52:52 +0000 (20:52 +0000)]
Sync pf.os with OpenBSD:

add a handful of linux signatures from p0fv2 and some other
signatures from observation.

MFC after: 2 weeks

11 years agoDo not yield while owning a mutex. The Giant reacquire in the
Konstantin Belousov [Mon, 10 Dec 2012 20:44:09 +0000 (20:44 +0000)]
Do not yield while owning a mutex.  The Giant reacquire in the
kern_yield() is problematic than.

The owned mutex is the mount interlock, and it is in fact not needed
to guarantee the stability of the mount list of active vnodes, so fix
the the issue by only taking the mount interlock for MNT_REF and
MNT_REL operations.

While there, augment the unconditional yield by some amount of
spinning [1].

Reported and tested by: pho
Reviewed by: attilio
Submitted by: attilio [1]
MFC after: 3 days

11 years agolibc: Make various internal file descriptors close-on-exec.
Jilles Tjoelker [Mon, 10 Dec 2012 17:56:51 +0000 (17:56 +0000)]
libc: Make various internal file descriptors close-on-exec.

These are obtained via fopen().

11 years agoImprove style(9) compliance of function declarations.
Brooks Davis [Mon, 10 Dec 2012 17:34:33 +0000 (17:34 +0000)]
Improve style(9) compliance of function declarations.

11 years agoChanges to resolve races in bpfread() and catchpacket() that, at worst,
Guy Helmer [Mon, 10 Dec 2012 16:14:44 +0000 (16:14 +0000)]
Changes to resolve races in bpfread() and catchpacket() that, at worst,
cause kernel panics.

Add a flag to the bpf descriptor to indicate whether the hold buffer
is in use. In bpfread(), set the "hold buffer in use" flag before
dropping the descriptor lock during the call to bpf_uiomove().
Everywhere else the hold buffer is used or changed, wait while
the hold buffer is in use by bpfread(). Add a KASSERT in bpfread()
after re-acquiring the descriptor lock to assist uncovering any
additional hold buffer races.

11 years agoAdd support for comma-separated values (whitespace-separated still supported).
Devin Teske [Mon, 10 Dec 2012 15:29:56 +0000 (15:29 +0000)]
Add support for comma-separated values (whitespace-separated still supported).

PR: conf/121064
Submitted by: koitsu
Reviewed by: jh

11 years agoNGM_NETFLOW_SHOW reports IPv6 flows as well.
Gleb Smirnoff [Mon, 10 Dec 2012 13:08:14 +0000 (13:08 +0000)]
NGM_NETFLOW_SHOW reports IPv6 flows as well.

Submitted by: Dmitry Luhtionov <dmitryluhtionov gmail.com>

11 years agoPrevent long type overflow of realmem calculation on ILP32 by forcing
Andre Oppermann [Mon, 10 Dec 2012 12:19:03 +0000 (12:19 +0000)]
Prevent long type overflow of realmem calculation on ILP32 by forcing
calculation to be in quad_t space.  Fix style issue with second parameter
to qmin().

Reported by: alc
Reviewed by: bde, alc

11 years agoAdjust the channel to correctly setup the HT flags when transitioning
Adrian Chadd [Mon, 10 Dec 2012 07:00:46 +0000 (07:00 +0000)]
Adjust the channel to correctly setup the HT flags when transitioning
an IBSS VAP to RUN.

An 11n IBSS was beaconing HTINFO/HTCAP IE's that didn't have any HT
information setup (like the HT TX/RX MCS bitmask.)

Tested:

* AR9280, IBSS - both a statically setup channel and a scanned channel

PR: kern/172955

11 years agoAdd amd64-specific ddb command "show pte". The command displays the
Konstantin Belousov [Mon, 10 Dec 2012 05:14:34 +0000 (05:14 +0000)]
Add amd64-specific ddb command "show pte".  The command displays the
hierarchy of the page table entries which map the specified address.

Reviewed by: alc (previous version)
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

11 years agoDo not ignore zero address, possibly returned by the vm_map_find()
Konstantin Belousov [Mon, 10 Dec 2012 05:14:04 +0000 (05:14 +0000)]
Do not ignore zero address, possibly returned by the vm_map_find()
call.  The function indicates a failure by the TRUE return value.  To
be extra safe, assert that the return value from the following
vm_map_insert() indicates success.

Fix style issues in the nearby lines, reformulate the comment.

Reviewed by: alc (previous version)
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

11 years agoGive users a hint when their locate database is too small.
Eitan Adler [Mon, 10 Dec 2012 02:26:01 +0000 (02:26 +0000)]
Give users a hint when their locate database is too small.

Reviewed by: wblock, gcooper
Reviewed by: "Lowell Gilbert" <lgfbsd@be-well.ilk.org>
Approved by: cperciva (implicit)
MFC after: 3 weeks

11 years agoUpdate the aggressive mode logic to also enable aggressive mode
Adrian Chadd [Mon, 10 Dec 2012 00:16:38 +0000 (00:16 +0000)]
Update the aggressive mode logic to also enable aggressive mode
parameters in IBSSes.

IBSS was just being plainly ignored here even though aggressive mode
was 'on'.

This still doesn't fix the "why are the WME parameters reset upon
interface down/up" issue.

PR: kern/165969

11 years agoUndo the previous adhoc commit - doing the WME IE handling here
Adrian Chadd [Sun, 9 Dec 2012 23:56:29 +0000 (23:56 +0000)]
Undo the previous adhoc commit - doing the WME IE handling here
is totally wrong.

If we parse the WME IE here, we'll be constantly updating the WME
configuration from each WME enabled IBSS node we see.

There's a separate issue where the WME configuration is blanked out
when the interface is brought up; the WME parameters aren't "sticky."

Also, ieee80211_init_neighbor() parses the ath IE, so doing it here
isn't required.

Sorry about the noise.

PR: kern/165969

11 years agoHandle ath-specific and WME IE's in adhoc mode.
Adrian Chadd [Sun, 9 Dec 2012 22:56:29 +0000 (22:56 +0000)]
Handle ath-specific and WME IE's in adhoc mode.

The Adhoc support wasn't parsing and handling the ath specific and WME
IEs, thus the atheros vendor support and WME TXOP parameters aren't being
copied from the peer.

It copies the WME parameters from whichever adhoc node it decides to
associate to, rather than just having them be statically configured
per adhoc node.  This may or may not be exactly "right", but it's certainly
going to be more convienent for people - they just have to ensure their
adhoc nodes are setup with correct WME parameters.

Since WME parameters aren't per-node but are configured on hardware TX
queues, if some nodes support WME and some don't - or perhaps, have
different WME parameters - things will get quite quirky.

So ensure that you configure your adhoc nodes with the same WME
parameters.

Secondly - the Atheros Vendor IE is parsed and operated on per-node, so
this should work out ok between nodes that do and don't do Atheros
extensions.  Once you see a becaon from that node and you setup the
association state, it _should_ parse things correctly.

TODO:

* I do need to ensure that both adhoc setup paths are correctly updating
  the IE stuff.  Ie, if the adhoc node is created by a data frame instead
  of a beacon frame, it'll come up with no WME/ath IE config.  The next
  beacon frame that it receives from that node will update the state.
  I just need to sit down and better understand how that's suppose to
  work in IBSS mode.

Tested:

* AR5416 <-> AR9280 - fast frames and the WME configuration both popped
  up. (This is with a local HAL patch that enables the fast frames
  capability on the AR5416 chipsets.)

PR: kern/165969

11 years agoAdd missed BETA* to list.
Glen Barber [Sun, 9 Dec 2012 22:55:51 +0000 (22:55 +0000)]
Add missed BETA* to list.

Approved by: simon (implicit)
MFC after: 3 days
X-MFC-With: r244058

11 years agoFix bandwidth reporting when doing a restarted download with "-r".
Andre Oppermann [Sun, 9 Dec 2012 22:54:03 +0000 (22:54 +0000)]
Fix bandwidth reporting when doing a restarted download with "-r".
The offset is already accounted for in xs->lastrcvd and doesn't
have to be subtracted again.

Reported by: Florian Smeets <flo@smeets.im>
Submitted by: Mateusz Guzik <mjguzik@gmail.com>
Tested by: Florian Smeets <flo@smeets.im>
MFC after: 1 week

11 years agoGet 'uname -r' earlier, so it can be used to determine what branch is
Glen Barber [Sun, 9 Dec 2012 22:53:53 +0000 (22:53 +0000)]
Get 'uname -r' earlier, so it can be used to determine what branch is
being run to set BSDINSTALL_DISTSITE accordingly.  This change allows
non-RELEASE branches to use the FTP snapshots directory for bootonly.iso
installations.

Approved by: simon

11 years agoAdd "nfsstat -m" support for the two new NFS mount options
Rick Macklem [Sun, 9 Dec 2012 22:23:50 +0000 (22:23 +0000)]
Add "nfsstat -m" support for the two new NFS mount options
added by r244042.

11 years agoDocument the new NFS mount options added by r244042.
Rick Macklem [Sun, 9 Dec 2012 21:26:47 +0000 (21:26 +0000)]
Document the new NFS mount options added by r244042.
This is a content change.

11 years agoRemove useless comment.
Konstantin Belousov [Sun, 9 Dec 2012 20:34:11 +0000 (20:34 +0000)]
Remove useless comment.

MFC after: 3 days

11 years agoFix typo.
Konstantin Belousov [Sun, 9 Dec 2012 20:26:51 +0000 (20:26 +0000)]
Fix typo.

MFC after: 3 days

11 years agoFix a couple of CTL locking issues and clean up some duplicated code.
Kenneth D. Merry [Sun, 9 Dec 2012 19:53:21 +0000 (19:53 +0000)]
Fix a couple of CTL locking issues and clean up some duplicated code.

ctl_frontend_cam_sim.c: Coalesce cfcs_online() and cfcs_offline()
into a single function since these were
identical except for one line.

Make sure we hold the SIM lock around path
creation, and calling xpt_rescan().

scsi_ctl.c: In ctlfe_onoffline(), make sure we hold the
SIM lock around path creation and free
calls, as well as xpt_action().

In ctlfe_lun_enable(), hold the SIM lock
around path and peripheral operations that
require it.

Sponsored by: Spectra Logic Corporation
MFC after: 1 week

11 years agoAtheros SuperG bug fixes, as part of hunting down kern/174283.
Adrian Chadd [Sun, 9 Dec 2012 19:20:28 +0000 (19:20 +0000)]
Atheros SuperG bug fixes, as part of hunting down kern/174283.

The stageqdepth (global, over all staging queues) was being kept
incorrectly.  It was being incremented whenever things were added,
but only decremented during a flush.  During active fast frames activity
it wasn't being decremented, resulting in it always having a non-zero
value during normal fast-frames operation.

It was only used when checking if the aging queue should be checked;
we may as well just defer to each of those staging queue counters (which
look correct, thankfully.)

Whilst I'm here, add locking assertions in the staging queue add/remove
functions.  The current crash shows that the staging queue has one frame,
but only has a tail pointer set (the head pointer being set to NULL.)
I'd like to grab a few more crashes where these locking assertions are
in place so I can narrow down the issue between "somehow locking is
messed up and things are racy" and "the stage queue head/tail pointer
manipulation logic is subtly wrong."

Tested:

* AR5416 STA, AR5413 AP; with FastFrames enabled in the AR5416 HAL.

PR: kern/174283

11 years agoUse ASCII characters for box/line characters in frames.4th
Devin Teske [Sun, 9 Dec 2012 15:25:34 +0000 (15:25 +0000)]
Use ASCII characters for box/line characters in frames.4th

Committed with changes to support the following from loader.conf(5):
+ console="vidconsole comconsole" (not just console="comconsole")
+ boot_serial="anything" (not just boot_serial="YES")
+ boot_multicons="anything" (unsupported in originally-submitted patch)

PR: conf/121064
Submitted by: koitsu
Reviewed by: gcooper, adrian (co-mentor)
Approved by: adrian (co-mentor)

11 years agoAdd new USB ID.
Hans Petter Selasky [Sun, 9 Dec 2012 09:58:44 +0000 (09:58 +0000)]
Add new USB ID.

MFC after: 1 week
Submitted by: Artyom Mirgorodskiy

11 years agoAdd a comment on why inlining critical_enter() may not be a good idea
Attilio Rao [Sun, 9 Dec 2012 04:54:22 +0000 (04:54 +0000)]
Add a comment on why inlining critical_enter() may not be a good idea
for the general case.

Reviewed by: bde
MFC after: 1 week

11 years agoDon't panic if the stageq here is empty; just fall through with NULL
Adrian Chadd [Sun, 9 Dec 2012 01:08:44 +0000 (01:08 +0000)]
Don't panic if the stageq here is empty; just fall through with NULL
pointers and leave the stage queue flush routine to just do nothing
(since both head and tail here will be NULL.)

This should quieten the "stageq empty" panic where the stageq itself
is empty, but it won't fix the second KASSERT() here "staging queue empty"
as that's likely a different underlying problem.

PR: kern/174283

11 years agoIn the past four years, we've added two new vm object types. Each time,
Alan Cox [Sun, 9 Dec 2012 00:32:38 +0000 (00:32 +0000)]
In the past four years, we've added two new vm object types.  Each time,
similar changes had to be made in various places throughout the machine-
independent virtual memory layer to support the new vm object type.
However, in most of these places, it's actually not the type of the vm
object that matters to us but instead certain attributes of its pages.
For example, OBJT_DEVICE, OBJT_MGTDEVICE, and OBJT_SG objects contain
fictitious pages.  In other words, in most of these places, we were
testing the vm object's type to determine if it contained fictitious (or
unmanaged) pages.

To both simplify the code in these places and make the addition of future
vm object types easier, this change introduces two new vm object flags
that describe attributes of the vm object's pages, specifically, whether
they are fictitious or unmanaged.

Reviewed and tested by: kib

11 years agoMove the NFSv4.1 client patches over from projects/nfsv4.1-client
Rick Macklem [Sat, 8 Dec 2012 22:52:39 +0000 (22:52 +0000)]
Move the NFSv4.1 client patches over from projects/nfsv4.1-client
to head. I don't think the NFS client behaviour will change unless
the new "minorversion=1" mount option is used. It includes basic
NFSv4.1 support plus support for pNFS using the Files Layout only.
All problems detecting during an NFSv4.1 Bakeathon testing event
in June 2012 have been resolved in this code and it has been tested
against the NFSv4.1 server available to me.
Although not reviewed, I believe that kib@ has looked at it.

11 years agoA number of places in the source tree still reference cuad.* after
Eitan Adler [Sat, 8 Dec 2012 22:16:36 +0000 (22:16 +0000)]
A number of places in the source tree still reference cuad.* after
sio(4) was deprecated by uart(4).

s/cuad/cuau/g/

PR: docs/171533
Reviewed by: imp
Approved by: cperciva (implicit)
MFC after: 3 weeks

11 years agoRemove outdated reference to tcp inflight limiting. It was removed
Andre Oppermann [Sat, 8 Dec 2012 21:03:14 +0000 (21:03 +0000)]
Remove outdated reference to tcp inflight limiting.  It was removed
a long time ago.

MFC after: 1 week

11 years agolibc: Add a missing header to a test program.
Jilles Tjoelker [Sat, 8 Dec 2012 19:42:15 +0000 (19:42 +0000)]
libc: Add a missing header to a test program.

Usage of dup(), mkstemp() and unlink() needs <unistd.h>.

11 years agoAdd check for failure of mkstemp and setenv.
Eitan Adler [Sat, 8 Dec 2012 18:41:16 +0000 (18:41 +0000)]
Add check for failure of mkstemp and setenv.

Reviewed by: des
Approved by: cperciva (implicit)
Obtained from: DragonFlyBSD
MFC after: 1 week

11 years agotime: Use close-on-exec instead of fclose() in the child process.
Jilles Tjoelker [Sat, 8 Dec 2012 17:41:39 +0000 (17:41 +0000)]
time: Use close-on-exec instead of fclose() in the child process.

11 years agoGet it compiling without INET and INET6 support (mainly userland stack).
Michael Tuexen [Sat, 8 Dec 2012 15:11:09 +0000 (15:11 +0000)]
Get it compiling without INET and INET6 support (mainly userland stack).

MFC after: 2 weeks

11 years agoMore warnings for zones that depend on the kern.ipc.maxsockets limit.
Pawel Jakub Dawidek [Sat, 8 Dec 2012 12:51:06 +0000 (12:51 +0000)]
More warnings for zones that depend on the kern.ipc.maxsockets limit.

Obtained from: WHEEL Systems

11 years agoAdd support for various Yamaha keyboards.
Hans Petter Selasky [Sat, 8 Dec 2012 09:58:11 +0000 (09:58 +0000)]
Add support for various Yamaha keyboards.

MFC after: 1 week
PR: usb/174254

11 years agoUse correct padding of the ABORT chunk in case of an user initiated
Michael Tuexen [Sat, 8 Dec 2012 09:50:38 +0000 (09:50 +0000)]
Use correct padding of the ABORT chunk in case of an user initiated
abort cause is used.

MFC after: 2 weeks

11 years agoFix a use-after-free bug in the Atheros fast-frames support.
Adrian Chadd [Sat, 8 Dec 2012 09:48:03 +0000 (09:48 +0000)]
Fix a use-after-free bug in the Atheros fast-frames support.

Tested:

* AR5212 AP, AR5413 STA, iperf TCP STA->AP, destroyed and/or shutdown
  the STA vap during active iperf TCP traffic.

PR: kern/174273
MFC after: 1 week

11 years agoWhite-space cleanups.
Pawel Jakub Dawidek [Sat, 8 Dec 2012 09:23:05 +0000 (09:23 +0000)]
White-space cleanups.

11 years agoThe socket_zone UMA zone is now private to uipc_socket.c.
Pawel Jakub Dawidek [Sat, 8 Dec 2012 08:35:49 +0000 (08:35 +0000)]
The socket_zone UMA zone is now private to uipc_socket.c.

11 years agoEnsure that the padding of the last parameter of an INIT chunk
Michael Tuexen [Sat, 8 Dec 2012 08:22:33 +0000 (08:22 +0000)]
Ensure that the padding of the last parameter of an INIT chunk
is not included in the chunk length as required by RFC 4960.
While there, cleanup sctp_send_initiate().

MFC after: 2 weeks

11 years agoSync with Library of Congress list.
Eitan Adler [Sat, 8 Dec 2012 05:51:27 +0000 (05:51 +0000)]
Sync with Library of Congress list.

Approved by: cperciva (implicit)
Obtained from: DragonflyBSD
MFC after: 3 days

11 years agoMake sure we hold the SIM lock when calling xpt_free_path().
Kenneth D. Merry [Sat, 8 Dec 2012 04:55:06 +0000 (04:55 +0000)]
Make sure we hold the SIM lock when calling xpt_free_path().

Sponsored by: Spectra Logic Corporation
MFC after: 1 week

11 years agoFix the CTL OOA queue dumping code so that it does not hold a mutex
Kenneth D. Merry [Sat, 8 Dec 2012 04:16:07 +0000 (04:16 +0000)]
Fix the CTL OOA queue dumping code so that it does not hold a mutex
while doing a copyout.  That can cause a panic, because copyout
can trigger VM faults, and we can't handle VM faults while holding
a mutex.

The solution here is to malloc a separate buffer to hold the OOA
queue entries, so that we don't risk a VM fault while filling up
the buffer and we don't have to drop the lock.  The other solution
would be to wire the user's memory while filling their buffer with
copyout, but that would have been a little more complex.

Also fix a debugging parenthesis issue in ctl_abort_task() pointed
out by Chuck Tuffli.

Sponsored by: Spectra Logic Corporation
MFC after: 1 week

11 years agoFix a device departure bug for the the pass(4), enc(4), sg(4) and ch(4)
Kenneth D. Merry [Sat, 8 Dec 2012 04:03:04 +0000 (04:03 +0000)]
Fix a device departure bug for the the pass(4), enc(4), sg(4) and ch(4)
drivers.

The bug occurrs when a userland process has the driver instance
open and the underlying device goes away.  We get the devfs
callback that the device node has been destroyed, but not all of
the closes necessary to fully decrement the reference count on the
CAM peripheral.

The reason is that once devfs calls back and says the device has
been destroyed, it is moved off to deadfs, and devfs guarantees
that there will be no more open or close calls.  So the solution
is to keep track of how many outstanding open calls there are on
the device, and just release that many references when we get the
callback from devfs.

scsi_pass.c,
scsi_enc.c,
scsi_enc_internal.h: Add an open count to the softc in these
drivers.  Increment it on open and
decrement it on close.

When we get a devfs callback to say that
the device node has gone away, decrement
the peripheral reference count by the
number of still outstanding opens.

Make sure we don't access the peripheral
with cam_periph_unlock() after what might
be the final call to
cam_periph_release_locked().  The
peripheral might have been freed, and we
will be dereferencing freed memory.

scsi_ch.c,
scsi_sg.c: For the ch(4) and sg(4) drivers, add the
same changes described above, and in
addition, fix another bug that was
previously fixed in the pass(4) and enc(4)
drivers.

These drivers were calling destroy_dev()
from their cleanup routine, but that could
cause a deadlock because the cleanup
routine could be indirectly called from
the driver's close routine.  This would
cause a deadlock, because the device node
is being held open by the active close
call, and can't be destroyed.

Sponsored by: Spectra Logic Corporation
MFC after: 1 week

11 years agoAdd support for backchannels to the kernel RPC. Backchannels
Rick Macklem [Sat, 8 Dec 2012 00:29:16 +0000 (00:29 +0000)]
Add support for backchannels to the kernel RPC. Backchannels
are used by NFSv4.1 for callbacks. A backchannel is a connection
established by the client, but used for RPCs done by the server
on the client (callbacks). As a result, this patch mixes some
client side calls in the server side and vice versa. Some
definitions in the .c files were extracted out into a file called
krpc.h, so that they could be included in multiple .c files.
This code has been in projects/nfsv4.1-client for some time.
Although no one has given it a formal review, I believe kib@
has taken a look at it.

11 years agoFix a panic during CAM EDT traversal.
Kenneth D. Merry [Fri, 7 Dec 2012 23:48:54 +0000 (23:48 +0000)]
Fix a panic during CAM EDT traversal.

The problem was a race condition between the EDT traversal used by
things like 'camcontrol devlist', and CAM peripheral driver
removal.

The EDT traversal code holds the CAM topology lock, and wants
to show devices that have been invalidated.  It acquires a
reference to the peripheral to make sure the peripheral it is
examining doesn't go away.

However, because the peripheral removal code in camperiphfree()
drops the CAM topology lock to call the peripheral's destructor
routine, we can run into a situation where the EDT traversal
increments the peripheral reference count after free process is
already in progress.  At that point, the reference count is
ignored, because it was 0 when we started the process.

Fix this race by setting a flag, CAM_PERIPH_FREE, that I previously
added and checked in xptperiphtraverse() and xptpdperiphtravsere(),
but failed to use.  If the EDT traversal code sees that flag,
it will know that the peripheral free process has already started,
and that it should not access that peripheral.

Also, fix an inconsistency in the locking between
xptpdperiphtraverse() and xptperiphtraverse().  They now both
hold the CAM topology lock while calling the peripheral traversal
function.

cam_xpt.c: Change xptperiphtraverse() to hold the CAM topology
lock across calls to the traversal function.

Take out the comment in xptpdperiphtraverse() that
referenced the locking inconsistency.

cam_periph.c: Set the CAM_PERIPH_FREE flag when we are in the
process of freeing a peripheral driver.

Sponsored by: Spectra Logic Corporation
MFC after: 1 week

11 years agoConfigure UMA warnings for the following zones:
Pawel Jakub Dawidek [Fri, 7 Dec 2012 22:30:30 +0000 (22:30 +0000)]
Configure UMA warnings for the following zones:
- unp_zone: kern.ipc.maxsockets limit reached
- socket_zone: kern.ipc.maxsockets limit reached
- zone_mbuf: kern.ipc.nmbufs limit reached
- zone_clust: kern.ipc.nmbclusters limit reached
- zone_jumbop: kern.ipc.nmbjumbop limit reached
- zone_jumbo9: kern.ipc.nmbjumbo9 limit reached
- zone_jumbo16: kern.ipc.nmbjumbo16 limit reached

Note that those warnings are printed not often than every five minutes and can
be globally turned off by setting sysctl/tunable vm.zone_warnings to 0.

Discussed on: arch
Obtained from: WHEEL Systems
MFC after: 2 weeks

11 years agoImplemented uma_zone_set_warning(9) function that sets a warning, which
Pawel Jakub Dawidek [Fri, 7 Dec 2012 22:27:13 +0000 (22:27 +0000)]
Implemented uma_zone_set_warning(9) function that sets a warning, which
will be printed once the given zone becomes full and cannot allocate an
item. The warning will not be printed more often than every five minutes.

All UMA warnings can be globally turned off by setting sysctl/tunable
vm.zone_warnings to 0.

Discussed on: arch
Obtained from: WHEEL Systems
MFC after: 2 weeks

11 years agoMake use of the fact that uma_zone_set_max(9) already returns actual limit set.
Pawel Jakub Dawidek [Fri, 7 Dec 2012 22:23:53 +0000 (22:23 +0000)]
Make use of the fact that uma_zone_set_max(9) already returns actual limit set.

11 years agoMore style cleanups.
Pawel Jakub Dawidek [Fri, 7 Dec 2012 22:22:04 +0000 (22:22 +0000)]
More style cleanups.

11 years agoStyle cleanups.
Pawel Jakub Dawidek [Fri, 7 Dec 2012 22:19:41 +0000 (22:19 +0000)]
Style cleanups.

11 years ago- Make socket_zone static - it is used only in this file.
Pawel Jakub Dawidek [Fri, 7 Dec 2012 22:15:51 +0000 (22:15 +0000)]
- Make socket_zone static - it is used only in this file.
- Update maxsockets on uma_zone_set_max().

Obtained from: WHEEL Systems

11 years agoStyle cleanups.
Pawel Jakub Dawidek [Fri, 7 Dec 2012 22:13:33 +0000 (22:13 +0000)]
Style cleanups.

11 years agoThere is no need anymore to include vm/uma.h after r241726.
Pawel Jakub Dawidek [Fri, 7 Dec 2012 22:05:42 +0000 (22:05 +0000)]
There is no need anymore to include vm/uma.h after r241726.

Obtained from: WHEEL Systems

11 years agoRe-disable GSSAPI, which does not build on several archs.
Erwin Lansing [Fri, 7 Dec 2012 16:05:04 +0000 (16:05 +0000)]
Re-disable GSSAPI, which does not build on several archs.

Approved by: delphij (mentor)

11 years agoUpdate to 9.8.4-P1.
Erwin Lansing [Fri, 7 Dec 2012 12:39:58 +0000 (12:39 +0000)]
Update to 9.8.4-P1.

Security Fixes

   Prevents named from aborting with a require assertion failure
   on servers with DNS64 enabled.  These crashes might occur as a
   result of  specific queries that are received.

New Features

*  Elliptic Curve Digital Signature Algorithm keys and signatures in
   DNSSEC are now supported per RFC 6605. [RT #21918]

Feature Changes

*  Improves OpenSSL error logging [RT #29932]

*  nslookup now returns a nonzero exit code when it is unable to get
   an answer.  [RT #29492]

Other critical bug fixes are included.

Approved by: delphij (mentor)
MFC after: 3 days
Security: CVE-2012-5688
Sponsored by: DK Hostmaster A/S

11 years agoAllow KASSERT to log instead of panic.
Alfred Perlstein [Fri, 7 Dec 2012 08:25:08 +0000 (08:25 +0000)]
Allow KASSERT to log instead of panic.

This is to allow debug images to be used without taking down the
system when non-fatal asserts are hit.

The following sysctls are added:

debug.kassert.warn_only: 1 = log, 0 = panic

debug.kassert.do_ktr: set to a ktr mask for logging via KTR

debug.kassert.do_log: 1 = log, 0 = quiet

debug.kassert.warnings: stats, number of kasserts hit

debug.kassert.log_panic_at:
  number of kasserts before we actually panic, 0 = never

debug.kassert.log_pps_limit: pps limit for log messages

debug.kassert.log_mute_at: stop warning after N kasserts, 0 = never stop

debug.kassert.kassert: set this sysctl to trigger a kassert

Discussed with: scottl, gnn, marcel
Sponsored by: iXsystems

11 years agoTypo in a comment.
Rui Paulo [Fri, 7 Dec 2012 07:08:39 +0000 (07:08 +0000)]
Typo in a comment.

11 years agoMake this work for 64 bit binaries.
Rui Paulo [Fri, 7 Dec 2012 07:02:39 +0000 (07:02 +0000)]
Make this work for 64 bit binaries.

11 years agoAdd XC900 SKU mapping.
Adrian Chadd [Fri, 7 Dec 2012 06:38:30 +0000 (06:38 +0000)]
Add XC900 SKU mapping.

11 years agoAdd a new 900MHz GSM regulatory SKU for the Xagyl Communications XC900M.
Adrian Chadd [Fri, 7 Dec 2012 06:34:46 +0000 (06:34 +0000)]
Add a new 900MHz GSM regulatory SKU for the Xagyl Communications XC900M.

The XC900M acts as a Ubiquiti XR9 (and I _think_ SR9) by default;
it uses the same 900MHz<->2.4GHz downconverter mapping.

However it has an alternative frequency mapping which squeezes in a couple
more half/quarter rate channels.  Since the default HAL doesn't support
fractional tuning (sub-1MHz) in 2.4GHz mode on the AR5413/AR5414, they
implement it using a jumper.

Datasheet: http://www.xagyl.com/download/XC900M_Datasheet.pdf

Thankyou to Xagyl Communications for the XC900M NICs and Edgar Martinez
for organising the donation.

Tested:

* XC900M <-> XC900M
* Ubiquiti XR9 <-> XC900M

TODO:

* Test against SR9 and GZ901 if possible (the IEEE channel<->frequency
  mapping may not match up, thanks to the slightly different channels
  involved)

11 years agoUse uint instead of int for flags exported via sysctl.
Alfred Perlstein [Fri, 7 Dec 2012 05:55:48 +0000 (05:55 +0000)]
Use uint instead of int for flags exported via sysctl.

11 years agoDocument pffinddomain().
Kevin Lo [Fri, 7 Dec 2012 02:29:32 +0000 (02:29 +0000)]
Document pffinddomain().

Reviewed by: glebius

11 years agoDocument that socket(2) may fail with EAFNOSUPPORT if the family cannot
Kevin Lo [Fri, 7 Dec 2012 02:26:08 +0000 (02:26 +0000)]
Document that socket(2) may fail with EAFNOSUPPORT if the family cannot
be found.

Reviewed by: glebius
Obtained from: NetBSD

11 years ago- according to POSIX, make socket(2) return EAFNOSUPPORT rather than
Kevin Lo [Fri, 7 Dec 2012 02:22:48 +0000 (02:22 +0000)]
- according to POSIX, make socket(2) return EAFNOSUPPORT rather than
  EPROTONOSUPPORT if the address family is not supported.
- introduce pffinddomain() to find a domain by family and use it as
  appropriate.

Reviewed by: glebius

11 years agoFix build: reflect the increased field number.
Xin LI [Fri, 7 Dec 2012 01:36:53 +0000 (01:36 +0000)]
Fix build: reflect the increased field number.

11 years agoAdd amd64 implementations for 8-byte bus_space routines.
Jim Harris [Thu, 6 Dec 2012 22:33:31 +0000 (22:33 +0000)]
Add amd64 implementations for 8-byte bus_space routines.

Submitted by: Carl Delsey <carl.r.delsey@intel.com>
Discussed with: jhb, rwatson
Reviewed by: jimharris
MFC after: 1 week

11 years ago- Rewrite radius servers traversal algorithm.
Sergey Matveychuk [Thu, 6 Dec 2012 19:00:37 +0000 (19:00 +0000)]
- Rewrite radius servers traversal algorithm.
- Add functions for working with IPv6 attributes.

Approved by: ae

11 years agoAdd PCI device ID for 8-channel IDT NVMe controller, and clarify that the
Jim Harris [Thu, 6 Dec 2012 15:36:24 +0000 (15:36 +0000)]
Add PCI device ID for 8-channel IDT NVMe controller, and clarify that the
previously defined IDT PCI device ID was for a 32-channel controller.

Submitted by: Joe Golio <joseph.golio@isilon.com>

11 years ago Rule memory garbage collecting in new pf scans only states that are on
Gleb Smirnoff [Thu, 6 Dec 2012 08:38:14 +0000 (08:38 +0000)]
  Rule memory garbage collecting in new pf scans only states that are on
id hash. If a state has been disconnected from id hash, its rule pointers
can no longer be dereferenced, and referenced memory can't be modified.
Thus, move rule statistics from pf_free_rule() to pf_unlink_rule() and
update them prior to releasing id hash slot lock.

Reported by: Ian FREISLICH <ianf cloudseed.co.za>

11 years agoClose possible races between state deletion and sent being sent out
Gleb Smirnoff [Thu, 6 Dec 2012 08:32:28 +0000 (08:32 +0000)]
Close possible races between state deletion and sent being sent out
from pfsync:
- Call into pfsync_delete_state() holding the state lock.
- Set the state timeout to PFTM_UNLINKED after state has been moved
  to the PFSYNC_S_DEL queue in pfsync.

Reported by: Ian FREISLICH <ianf cloudseed.co.za>

11 years ago Remove extra PFSYNC_LOCK() in pfsync_bulk_update() which lead to lock
Gleb Smirnoff [Thu, 6 Dec 2012 08:22:08 +0000 (08:22 +0000)]
  Remove extra PFSYNC_LOCK() in pfsync_bulk_update() which lead to lock
recursion.

Reported by: Ian FREISLICH <ianf cloudseed.co.za>

11 years ago Revert erroneous r242693. A state may have PFTM_UNLINKED being on the
Gleb Smirnoff [Thu, 6 Dec 2012 08:15:06 +0000 (08:15 +0000)]
  Revert erroneous r242693. A state may have PFTM_UNLINKED being on the
PFSYNC_S_DEL queue of pfsync.

11 years agoEliminate superfluous code.
David Xu [Thu, 6 Dec 2012 06:29:08 +0000 (06:29 +0000)]
Eliminate superfluous code.

11 years agoAdd the Programmer Dvorak Keyboard Layout
Eitan Adler [Thu, 6 Dec 2012 01:44:19 +0000 (01:44 +0000)]
Add the Programmer Dvorak Keyboard Layout

PR: conf/173950
Submitted by: clutton <mbsd@isgroup.com.ua>
Approved by: cperciva

11 years agoChange the default to 'cru' for speed reasons.
Eitan Adler [Thu, 6 Dec 2012 01:31:34 +0000 (01:31 +0000)]
Change the default to 'cru' for speed reasons.

Submitted by: Erik Cederstrand <erik@cederstrand.dk>
Reviewed by: imp, toolchain@
Approved by: cperciva
MFC after: 2 weeks

11 years agoClean up hardcoded ar(1) flags in the tree to use the global ARFLAGS in
Eitan Adler [Thu, 6 Dec 2012 01:31:25 +0000 (01:31 +0000)]
Clean up hardcoded ar(1) flags in the tree to use the global ARFLAGS in
share/mk/sys.mk instead.

This is part of a medium term project to permit deterministic builds of
FreeBSD.

Submitted by: Erik Cederstrand <erik@cederstrand.dk>
Reviewed by: imp, toolchain@
Approved by: cperciva
MFC after: 2 weeks

11 years agoPrefer the use of initalizer lists to ctor assignment.
Eitan Adler [Thu, 6 Dec 2012 01:25:21 +0000 (01:25 +0000)]
Prefer the use of initalizer lists to ctor assignment.

Approved by: cperciva
MFC after: 2 weeks