]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
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

11 years agoAvoid the creation of a temporary object by using the prefix operator
Eitan Adler [Thu, 6 Dec 2012 01:25:17 +0000 (01:25 +0000)]
Avoid the creation of a temporary object by using the prefix operator
for non-primitive types.

Approved by: cperciva
MFC after: 2 weeks

11 years agoConstify where possible
Eitan Adler [Thu, 6 Dec 2012 01:25:14 +0000 (01:25 +0000)]
Constify where possible

Approved by: cperciva
MFC after: 2 weeks

11 years agoFixup r243901:
Attilio Rao [Wed, 5 Dec 2012 22:32:12 +0000 (22:32 +0000)]
Fixup r243901:
- As the comment report, CALLOUT_LOCAL_ALLOC cannot be checked
  directly from the callout flags but might be checked by a cached
  value.  Hence, do so before to actually remove the callout, when
  needed, in softclock_call_cc().
- In softclock_call_cc() also add a comment in the waiting and deferred
  migration case explaining that the dereference should be safe
  because of the migration dereference invariants.

Additively:
- In softclock_call_cc(), for the deferred migration case, move all the
  accesses to callout structure after the comment stating the callout
  must not be destroyed.
- For consistency with this last tweak, use cached c_flags for the
  KASSERT() in the deferred migration case.  It is not strictly necessary
  but this way all the callout accesses happen after the above mentioned
  comment, improving consistency.

Pointy hat to: me
Sponsored by: Isilon Systems / EMC Corporation
Reviewed by: kib
MFC after: 2 weeks
X-MFC: 243901

11 years agoDon't write-back the cachelines if we really just want to invalidate them.
Olivier Houchard [Wed, 5 Dec 2012 21:07:27 +0000 (21:07 +0000)]
Don't write-back the cachelines if we really just want to invalidate them.

Spotted out by: Ian Lepore <freebsd at damnhippie DOT dyndns dot org>

11 years agoFix an old bug in devd, where it uses std::sort() to sort the various
Dimitry Andric [Wed, 5 Dec 2012 20:50:40 +0000 (20:50 +0000)]
Fix an old bug in devd, where it uses std::sort() to sort the various
lists it reads from its configuration files on the priority field.

Because some items in the lists have the same priority, and std::sort()
is not stable, the exact order in which the items are enumerated does
not have to correspond to the order they appear in the configuration
files.

Apparently this was never noticed with libstdc++, but with libc++ it
could cause the "uhid" entry from /etc/devd/usb.conf to be used instead
of the "ums" entry (which is earlier in the file).  This caused the
problem described in the PR: the USB mouse module was never loaded, and
the other actions (such as starting moused) were not executed.

To fix the problem, make devd use std:stable_sort() instead.

Reported by: Jan Beich <jbeich@tormail.org>
PR: bin/172958
MFC after: 2 weeks

11 years agoremove redundant yyparse declarations
Baptiste Daroussin [Wed, 5 Dec 2012 20:28:44 +0000 (20:28 +0000)]
remove redundant yyparse declarations

PR: conf/174079
Submitted by: Garrett Cooper <yanegomi@gmail.com>

11 years agoDon't call bus_dmamap_load in CAM_DIR_NONE case, since there is nothing
Jim Harris [Wed, 5 Dec 2012 20:21:33 +0000 (20:21 +0000)]
Don't call bus_dmamap_load in CAM_DIR_NONE case, since there is nothing
to map, and technically this isn't allowed.

Functionally, it works OK (at least on x86) to call bus_dmamap_load with
a NULL data pointer and zero length, so this is primarily for correctness
and consistency with other drivers.

While here, remove check in isci_io_request_construct for nseg==0.
Previously, bus_dmamap_load would pass nseg==1, even for case where
buffer is NULL and length = 0, which allowed CAM_DIR_NONE CCBs
to get processed.  This check is not correct though, and needed to be
removed both for the changes elsewhere in this patch, as well as jeff's
preliminary bus_dmamap_load_ccb patch (which uncovered all of this in
the first place).

MFC after: 3 days

11 years ago- Move definition of V_deembed_scopeid to scope6_var.h.
Hiroki Sato [Wed, 5 Dec 2012 19:45:24 +0000 (19:45 +0000)]
- Move definition of V_deembed_scopeid to scope6_var.h.
- Deembed scope id in L3 address in in6_lltable_dump().
- Simplify scope id recovery in rtsock routines.
- Remove embedded scope id handling in ndp(8) and route(8) completely.

11 years agoThe softclock_call_cc() is executing with the callout already removed
Konstantin Belousov [Wed, 5 Dec 2012 19:02:22 +0000 (19:02 +0000)]
The softclock_call_cc() is executing with the callout already removed
from the callwheel. Calculate the cc->cc_next before removing the
callout, otherwise the code followed the invalid tailq links.  After
this, make softclock_call_cc() return void, since it always return
cc->cc_next, which is immediately available to the softclock()
anyway. This also allows to eliminate a label under #ifdef SMP.

Remove the assignment of cc->cc_next from callout_cc_del(), since the
function is called with the callout already removed from callwheel.

If cancelling the migration, also clear the CALLOUT_DFRMIGRATION flag.

Postpone the free of the timeout(9) allocated callouts after the
migration checks are done.

Add some more strict asserts about the state of the callout in
callout_call_cc().

Reviewed by: attilio
Reported and tested by: pho (previous version)
MFC after: 2 weeks

11 years agoCheck for lockmgr recursion in case of disown and downgrade and panic
Attilio Rao [Wed, 5 Dec 2012 15:11:01 +0000 (15:11 +0000)]
Check for lockmgr recursion in case of disown and downgrade and panic
also in !debugging kernel rather than having "undefined" behaviour.

Tested by: avg
MFC after: 1 week

11 years agoUse Bernard Baruch's full name.
Eitan Adler [Wed, 5 Dec 2012 13:57:00 +0000 (13:57 +0000)]
Use Bernard Baruch's full name.

The words "old than" seem to be quoted as "older than" by some sources,
so use the more likely and grammatically correct text.

PR: docs/173868
Submitted by: Chris Petrik <c.petrik.sosa@gmail.com>
Approved by: cperciva
MFC after: 1 week

11 years agoSimplify string duplication: use strdup instead of malloc + strcpy
Eitan Adler [Wed, 5 Dec 2012 13:56:56 +0000 (13:56 +0000)]
Simplify string duplication: use strdup instead of malloc + strcpy

Submitted by: db
Approved by: cperciva
MFC after: 2 weeks

11 years agoAvoid overflowing the file buffer
Eitan Adler [Wed, 5 Dec 2012 13:56:52 +0000 (13:56 +0000)]
Avoid overflowing the file buffer

Submitted by: db
Approved by: cperciva
MFC after: 2 weeks

11 years agoUse strdup instead of malloc + strcpy
Eitan Adler [Wed, 5 Dec 2012 13:56:49 +0000 (13:56 +0000)]
Use strdup instead of malloc + strcpy

Submitted by: db
Approved by: cperciva
MFC after: 2 weeks

11 years agoAvoid overflow of file buffer
Eitan Adler [Wed, 5 Dec 2012 13:56:46 +0000 (13:56 +0000)]
Avoid overflow of file buffer

Submitted by: db
Approved by: cperciva
MFC after: 2 weeks

11 years agoRemove useless check for NULL prior to free.
Eitan Adler [Wed, 5 Dec 2012 13:56:43 +0000 (13:56 +0000)]
Remove useless check for NULL prior to free.

Approved by: cperciva
MFC after: 2 weeks

11 years agoRemove hack to emulate effective uid and just use the EUID's name in the
Eitan Adler [Wed, 5 Dec 2012 13:56:39 +0000 (13:56 +0000)]
Remove hack to emulate effective uid and just use the EUID's name in the
first place.  I was unaware of this option when originally committing
this change.

Submitted by: gcooper
Approved by: cperciva
MFC after: 3 days

11 years agoRemove pointless check for the existence of /usr/bin/less which exists
Eitan Adler [Wed, 5 Dec 2012 13:56:36 +0000 (13:56 +0000)]
Remove pointless check for the existence of /usr/bin/less which exists
in all configurations.

Reviewed by: mjg
Approved by: cperciva
MFC after: 2 weeks

11 years agoAdd ability to mergemaster to permit the user to type
Eitan Adler [Wed, 5 Dec 2012 13:56:32 +0000 (13:56 +0000)]
Add ability to mergemaster to permit the user to type
the absolute path to PAGER if mergemaster can not find
the one already set.

Reviewed by: mjg
Approved by: cperciva
MFC after: 2 weeks

11 years agoConnect organization.dot to the build
Eitan Adler [Wed, 5 Dec 2012 13:05:24 +0000 (13:05 +0000)]
Connect organization.dot to the build

Approved by: cperciva
MFC after: 3 days

11 years agoVendor import of Bind 9.8.4-P1
Erwin Lansing [Wed, 5 Dec 2012 13:00:54 +0000 (13:00 +0000)]
Vendor import of Bind 9.8.4-P1

Approved by: delphij (mentor)
Sponsored by: DK Hostmaster A/S

11 years agoVendor import of Bind 9.8.4
Erwin Lansing [Wed, 5 Dec 2012 12:53:50 +0000 (12:53 +0000)]
Vendor import of Bind 9.8.4

Approved by: delphij (mentor)
Sponsored by: DK Hostmaster A/S

11 years agoif PACKAGESITE url scheme is not 'file://', always try to revolv SRV records and
Baptiste Daroussin [Wed, 5 Dec 2012 11:35:50 +0000 (11:35 +0000)]
if PACKAGESITE url scheme is not 'file://', always try to revolv SRV records and
use them if any. It allows the bootstrap to use directly pkg.FreeBSD.org instead
of pkgbeta.FreeBSD.org

MFC after: 1 month

11 years ago Mechanically substitute flags from historic mbuf allocator with
Gleb Smirnoff [Wed, 5 Dec 2012 08:04:20 +0000 (08:04 +0000)]
  Mechanically substitute flags from historic mbuf allocator with
malloc(9) flags within sys.

Exceptions:

- sys/contrib not touched
- sys/mbuf.h edited manually

11 years agoRemove dead code that clang refuses to compile.
Rui Paulo [Wed, 5 Dec 2012 04:22:53 +0000 (04:22 +0000)]
Remove dead code that clang refuses to compile.

11 years agoFix a race between kern_setitimer() and realitexpire(), where the
Konstantin Belousov [Tue, 4 Dec 2012 20:49:39 +0000 (20:49 +0000)]
Fix a race between kern_setitimer() and realitexpire(), where the
callout is started before kern_setitimer() acquires process mutex, but
looses a race and kern_setitimer() gets the process mutex before the
callout.  Then, assuming that new specified struct itimerval has
it_interval zero, but it_value non-zero, the callout, after it starts
executing again, clears p->p_realtimer.it_value, but kern_setitimer()
already rescheduled the callout.

As the result of the race, both p_realtimer is zero, and the callout
is rescheduled. Then, in the exit1(), the exit code sees that it_value
is zero and does not even try to stop the callout. This allows the
struct proc to be reused and eventually the armed callout is
re-initialized.  The consequence is the corrupted callwheel tailq.

Use process mutex to interlock the callout start, which fixes the race.

Reported and tested by: pho
Reviewed by: jhb
MFC after: 2 weeks

11 years agoDo not allocate buffer of the 255 bytes length on the stack.
Konstantin Belousov [Tue, 4 Dec 2012 20:49:04 +0000 (20:49 +0000)]
Do not allocate buffer of the 255 bytes length on the stack.

Reported and tested by: sig6247@gmail.com
MFC after: 1 week

11 years agoFix fallout from r243019, which broke parsing of shortened network
Gleb Smirnoff [Tue, 4 Dec 2012 20:05:01 +0000 (20:05 +0000)]
Fix fallout from r243019, which broke parsing of shortened network
prefixes.

Reported and tested by: delphij

11 years ago- Fix LOR in sa6_recoverscope() in rt_msg2()[1].
Hiroki Sato [Tue, 4 Dec 2012 17:12:23 +0000 (17:12 +0000)]
- Fix LOR in sa6_recoverscope() in rt_msg2()[1].
- Check V_deembed_scopeid before checking if sa_family == AF_INET6.
- Fix scope id handing in route(8)[2] and ifconfig(8).

Reported by: rpaulo[1], Mateusz Guzik[1], peter[2]

11 years agolibc: Use the new 'e' fopen() mode option to simplify fstab.c.
Jilles Tjoelker [Tue, 4 Dec 2012 16:54:43 +0000 (16:54 +0000)]
libc: Use the new 'e' fopen() mode option to simplify fstab.c.

No functional change is intended.

11 years agoUse absolute path for /usr/libexec/ld-elf.so.1 symlink.
Pawel Jakub Dawidek [Tue, 4 Dec 2012 14:36:01 +0000 (14:36 +0000)]
Use absolute path for /usr/libexec/ld-elf.so.1 symlink.

Requested by: kan, kib

Use -h flags for chflags, so we won't remove 'schg' flag from system's
/libexec/ld-elf.so.1.

MFC after: 2 weeks

11 years agoFix typo.
Konstantin Belousov [Tue, 4 Dec 2012 14:07:17 +0000 (14:07 +0000)]
Fix typo.

Submitted by: bjk
MFC after: 3 days