]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
11 years agoMFV r246388:
Martin Matuska [Sun, 10 Feb 2013 19:32:55 +0000 (19:32 +0000)]
MFV r246388:

Import vendor bugfixes

Illumos ZFS issues:
  3422 zpool create/syseventd race yield non-importable pool
  3425 first write to a new zvol can fail with EFBIG

References:
  https://www.illumos.org/issues/3422
  https://www.illumos.org/issues/3425

MFC after: 2 weeks

11 years agoAdd bootcamp support to the loader.
Andrey V. Elsukov [Sun, 10 Feb 2013 19:27:17 +0000 (19:27 +0000)]
Add bootcamp support to the loader.

Tested by: dchagin
MFC after: 1 week

11 years agoImprove code style. No functional change.
Michael Tuexen [Sun, 10 Feb 2013 19:21:17 +0000 (19:21 +0000)]
Improve code style. No functional change.

MFC after: 3 days

11 years agofind: Run when cwd cannot be opened, except with -execdir or -delete.
Jilles Tjoelker [Sun, 10 Feb 2013 18:56:37 +0000 (18:56 +0000)]
find: Run when cwd cannot be opened, except with -execdir or -delete.

fts(3) can run (albeit more slowly and imposing the {PATH_MAX} limit) when
the current directory cannot be opened. Therefore, do not make a failure to
open the current directory (for returning to it later in -exec) fatal.

If -execdir or -delete are used, the expectation is that fts(3) will use
chdir to avoid race conditions (except for -execdir with -L). Do not break
this expectation any more than it already is by still failing if the current
directory cannot be opened.

11 years agoDon't try to suppress the inclusion of the build date in named's version
Colin Percival [Sun, 10 Feb 2013 17:58:44 +0000 (17:58 +0000)]
Don't try to suppress the inclusion of the build date in named's version
string by undefining __DATE__, since (unlike gcc) clang doesn't allow us
to do that.  Instead, define NO_VERSION_DATE, which was helpfully added
to the named source code for exactly this purpose.

11 years agoBackport vendor changes in zfs(8) manual page (MFV r246389)
Martin Matuska [Sun, 10 Feb 2013 17:10:07 +0000 (17:10 +0000)]
Backport vendor changes in zfs(8) manual page (MFV r246389)

Illumos ZFS issues:
  3380 zfs man page: documentation for zfs allow is confusing

References:
  https://www.illumos.org/issues/3380

MFC after: 2 weeks

11 years agoFix minor memory leak.
Pawel Jakub Dawidek [Sun, 10 Feb 2013 15:56:47 +0000 (15:56 +0000)]
Fix minor memory leak.

11 years agoAssert that if we are not dealing with keyfile we are dealing with passfile.
Pawel Jakub Dawidek [Sun, 10 Feb 2013 15:56:20 +0000 (15:56 +0000)]
Assert that if we are not dealing with keyfile we are dealing with passfile.

11 years agoUse arc4random_buf(3) instead of reimplementing it.
Pawel Jakub Dawidek [Sun, 10 Feb 2013 15:55:42 +0000 (15:55 +0000)]
Use arc4random_buf(3) instead of reimplementing it.

11 years agoCorrect spelling of "daemon". No .Dd bump.
Gavin Atkinson [Sun, 10 Feb 2013 14:28:07 +0000 (14:28 +0000)]
Correct spelling of "daemon".  No .Dd bump.

Noticed by: Nathan Rich <Nathan.Rich dynastysystems com>
MFC after: 3 days

11 years agofind: In -execdir ... {} +, only pass one file per invocation.
Jilles Tjoelker [Sun, 10 Feb 2013 13:28:02 +0000 (13:28 +0000)]
find: In -execdir ... {} +, only pass one file per invocation.

This is inefficient but ensures that -execdir ... {} + does not mix files
from different directories in one invocation; the command could not access
some files. Files from the same directory should really be handled in one
invocation but this is somewhat more complicated.

11 years agosigqueue(2): Fix typo (EEPERM -> EPERM).
Jilles Tjoelker [Sun, 10 Feb 2013 13:20:23 +0000 (13:20 +0000)]
sigqueue(2): Fix typo (EEPERM -> EPERM).

MFC after: 3 days

11 years ago- Move scratch data from the USB bus structure to the USB device structure
Hans Petter Selasky [Sun, 10 Feb 2013 10:56:13 +0000 (10:56 +0000)]
- Move scratch data from the USB bus structure to the USB device structure
so that simultaneous access cannot happen. Protect scratch area using
the enumeration lock. Also reduce stack usage in usbd_transfer_setup()
by moving some big stack members to the scratch area. This saves around
200 bytes of stack.
- Fix a whitespace.

MFC after: 1 week

11 years agoFix correct use of USB header files.
Hans Petter Selasky [Sun, 10 Feb 2013 10:55:20 +0000 (10:55 +0000)]
Fix correct use of USB header files.

11 years ago- Streamline detach logic in wlan drivers, so that
Hans Petter Selasky [Sun, 10 Feb 2013 10:36:16 +0000 (10:36 +0000)]
- Streamline detach logic in wlan drivers, so that
  freed memory cannot be used during detach.
- Remove all panic() calls from the urtw driver because
  panic() is not appropriate here.
- Remove redundant checks for device detached in
  device detach callbacks.
- Use DEVMETHOD_END to mark end of device methods.

MFC after: 2 weeks

11 years agoFix several unsafe pointer dereferences in the buffered_write()
Konstantin Belousov [Sun, 10 Feb 2013 10:17:33 +0000 (10:17 +0000)]
Fix several unsafe pointer dereferences in the buffered_write()
function, implementing the sysctl vfs.ffs.set_bufoutput (not used in
the tree yet).

- The current directory vnode dereference is unsafe since fd_cdir
  could be changed and unreferenced, lock the filedesc around and vref
  the fd_cdir.
- The VTOI() conversion of the fd_cdir is unsafe without first
  checking that the vnode is indeed from an FFS mount, otherwise
  the code dereferences a random memory.
- The cdir could be reclaimed from under us, lock it around the
  checks.
- The type of the fp vnode might be not a disk, or it might have
  changed while the thread was in flight, check the type.

Reviewed and tested by: mckusick
MFC after: 2 weeks

11 years agoRemove a racy checks on resident and cached pages for
Attilio Rao [Sun, 10 Feb 2013 01:04:10 +0000 (01:04 +0000)]
Remove a racy checks on resident and cached pages for
tmpfs_mapped{read, write}() functions:
- tmpfs_mapped{read, write}() are only called within VOP_{READ, WRITE}(),
  which check before-hand to work only on valid VREG vnodes.  Also the
  vnode is locked for the duration of the work, making vnode reclaiming
  impossible, during the operation. Hence, vobj can never be NULL.
- Currently check on resident pages and cached pages without vm object
  lock held is racy and can do even more harm than good, as a page could
  be transitioning between these 2 pools and then be skipped entirely.
  Skip the checks as lookups on empty splay trees are very cheap.

Discussed with: alc
Tested by: flo
MFC after: 2 weeks

11 years agoAdd nmtree to ITOOLS if it is installed on the host instead of keying off
Brooks Davis [Sat, 9 Feb 2013 23:17:28 +0000 (23:17 +0000)]
Add nmtree to ITOOLS if it is installed on the host instead of keying off
the BOOTSTRAPPING variable.  The previous test was wrong because
BOOTSTRAPPING is 0 in most cases.

Tested by: db

11 years agoFix breakage introduced in r246318.
Tim Kientzle [Sat, 9 Feb 2013 21:36:14 +0000 (21:36 +0000)]
Fix breakage introduced in r246318.

11 years agoAdd dtc to the build.
Tim Kientzle [Sat, 9 Feb 2013 18:14:26 +0000 (18:14 +0000)]
Add dtc to the build.

11 years agoCleanup the handling of address scopes. Announce in the INIT/INIT-ACK
Michael Tuexen [Sat, 9 Feb 2013 17:26:14 +0000 (17:26 +0000)]
Cleanup the handling of address scopes. Announce in the INIT/INIT-ACK
only the supported address types. While there, do some whitespace
cleanups.

MFC after: 1 week

11 years agoReference something which exists instead of the non-existent runsocks
Eitan Adler [Sat, 9 Feb 2013 17:13:54 +0000 (17:13 +0000)]
Reference something which exists instead of the non-existent runsocks
program.

PR: docs/173664
Submitted by: wkoszek
Approved by: bcr (mentor)

11 years agoFix logic inversion.
Eitan Adler [Sat, 9 Feb 2013 17:13:51 +0000 (17:13 +0000)]
Fix logic inversion.

PR: docs/174966
Submitted by: Christian Ullrich <chris+freebsd@chrullrich.net>
Approved by: bcr (mentor)

11 years agoFix some NLS catalogs broken after r245888.
Antoine Brodin [Sat, 9 Feb 2013 13:31:59 +0000 (13:31 +0000)]
Fix some NLS catalogs broken after r245888.

11 years agoAdd more obsolete files.
Antoine Brodin [Sat, 9 Feb 2013 13:28:49 +0000 (13:28 +0000)]
Add more obsolete files.

11 years agoFix a bug where HEARTBEATs were still sent in SHUTDOWN_SENT or
Michael Tuexen [Sat, 9 Feb 2013 08:27:08 +0000 (08:27 +0000)]
Fix a bug where HEARTBEATs were still sent in SHUTDOWN_SENT or
SHUTDOWN_ACK_SENT state. While there, make the corresponding
code consistent.

MFC after: 1 week

11 years agomdoc: Remove EOL whitespace.
Joel Dahl [Sat, 9 Feb 2013 07:01:05 +0000 (07:01 +0000)]
mdoc: Remove EOL whitespace.

11 years agoMFV r245512:
Xin LI [Sat, 9 Feb 2013 06:39:28 +0000 (06:39 +0000)]
MFV r245512:

 * Illumos zfs issue #3035 [1] LZ4 compression support in ZFS.

LZ4 is a new high-speed BSD-licensed compression algorithm created
by Yann Collet that delivers very high compression and decompression
performance compared to lzjb (>50% faster on compression, >80% faster
on decompression and around 3x faster on compression of incompressible
data), while giving better compression ratio [1].

This version of LZ4 corresponds to upstream's [2] revision 85.

Please note that for obvious reasons this is not backward read
compatible.  This means once a pool have LZ4 compressed data, these
data can no longer be read by older ZFS implementations.

Local changes:

 - On-stack hash table disabled and using kernel slab allocator
   instead, at this time.  This requires larger kernel thread stack
   for zio workers.  This may change in the future should we adjusted
   the zio workers' thread stack size.
 - likely and unlikely will be undefined if they are already defined,
   this is required for i386 XEN build.
 - Removed De Bruijn sequence based __builtin_ctz family of builtins
   in favor of the latter.  Both GCC and clang supports these builtins.
 - Changed the way the LZ4 code detects endianness.
 - Manual pages modifications to mention the feature based on Illumos
   counterpart.
 - Boot loader changes to make it support LZ4 decompression.

[1] https://www.illumos.org/issues/3035
[2] http://code.google.com/p/lz4/source/list

Obtained from: Illumos (13921:9d721847e469)
Tested on: FreeBSD/amd64
MFC after: 1 month

11 years agoFix LINT build for ARM.
Xin LI [Sat, 9 Feb 2013 06:31:22 +0000 (06:31 +0000)]
Fix LINT build for ARM.

11 years agoFix LINT build on amd64.
Xin LI [Sat, 9 Feb 2013 04:13:45 +0000 (04:13 +0000)]
Fix LINT build on amd64.

11 years agoThe encryption type field needs to be preserved for each descriptor
Adrian Chadd [Sat, 9 Feb 2013 02:42:01 +0000 (02:42 +0000)]
The encryption type field needs to be preserved for each descriptor
making up a frame, in both a sub-frame and for all frames in an
aggregate.

Tested:

* AR5416, STA mode

11 years agoDo not hold locks around hardware context reads.
Navdeep Parhar [Sat, 9 Feb 2013 00:35:28 +0000 (00:35 +0000)]
Do not hold locks around hardware context reads.

MFC after: 3 days

11 years agoCorrectly list the usbloader dependencies.
Hans Petter Selasky [Fri, 8 Feb 2013 23:13:46 +0000 (23:13 +0000)]
Correctly list the usbloader dependencies.

11 years agoMake sure we don't leak command buffers when a USB
Hans Petter Selasky [Fri, 8 Feb 2013 22:51:09 +0000 (22:51 +0000)]
Make sure we don't leak command buffers when a USB
command transfer fails.

MFC after: 1 week
Reported by: Ian FREISLICH

11 years agoIn r246282 the KTR_ENTRIES was specified with syntax error, fix it so 'make
Xin LI [Fri, 8 Feb 2013 22:41:48 +0000 (22:41 +0000)]
In r246282 the KTR_ENTRIES was specified with syntax error, fix it so 'make
universe' would work.

MFC after: 12 days
X-MFC-with: r246282

11 years agoFix regression issue after r244503:
Hans Petter Selasky [Fri, 8 Feb 2013 21:15:47 +0000 (21:15 +0000)]
Fix regression issue after r244503:
Correct init order to fix a NULL pointer access.

MFC after: 1 week
Reported by: Ian FREISLICH

11 years agoext2fs: Replace redundant EXT2_MIN_BLOCK with EXT2_MIN_BLOCK_SIZE.
Pedro F. Giffuni [Fri, 8 Feb 2013 21:09:44 +0000 (21:09 +0000)]
ext2fs: Replace redundant EXT2_MIN_BLOCK with EXT2_MIN_BLOCK_SIZE.

Submitted by: Christoph Mallon
MFC after: 2 weeks

11 years agoext2fs: make e2fs_maxcontig local and remove tautological check.
Pedro F. Giffuni [Fri, 8 Feb 2013 20:58:00 +0000 (20:58 +0000)]
ext2fs: make e2fs_maxcontig local and remove tautological check.

e2fs_maxcontig was modelled after UFS when bringing the
"Orlov allocator" to ext2. On UFS fs_maxcontig is kept in the
superblock and is used by userland tools (fsck and growfs),

In ext2 this information is volatile so it is not available
for userland tools, so in this case it doesn't have sense
to carry it in the in-memory superblock.

Also remove a pointless check for MAX(1, x) > 0.

Submitted by: Christoph Mallon
MFC after: 2 weeks

11 years agoRemove unused MAXSYMLINKLEN macro.
Pedro F. Giffuni [Fri, 8 Feb 2013 20:30:19 +0000 (20:30 +0000)]
Remove unused MAXSYMLINKLEN macro.

Reviewed by: mckusick
PR: kern/175794
MFC after: 1 week

11 years agoadd semicolon to end of CALLOUT_HANDLE_INITIALIZER example.
Alfred Perlstein [Fri, 8 Feb 2013 20:13:28 +0000 (20:13 +0000)]
add semicolon to end of CALLOUT_HANDLE_INITIALIZER example.

11 years agopatch: Follow original versioning convention.
Pedro F. Giffuni [Fri, 8 Feb 2013 19:39:15 +0000 (19:39 +0000)]
patch: Follow original versioning convention.

According to the README file [1] the 12u variant, unlike
the 12g variant, contains no copyleft code. It is therefore
convenient to keep using the original versioning scheme to
prevent confusions.

[1] http://www.openbsd.org/cgi-bin/cvsweb/src/usr.bin/patch/README

11 years agoFix NFSv4 permission description in setfacl(1) manual page: the 'D'
Edward Tomasz Napierala [Fri, 8 Feb 2013 18:43:47 +0000 (18:43 +0000)]
Fix NFSv4 permission description in setfacl(1) manual page: the 'D'
means delete_child, not delete.

MFC after: 1 week

11 years agoImprove description of the "-m" option to setfacl(1).
Edward Tomasz Napierala [Fri, 8 Feb 2013 18:12:16 +0000 (18:12 +0000)]
Improve description of the "-m" option to setfacl(1).

Submitted by: scottl
MFC after: 1 week

11 years agoIn the setfacl(1) manual page, make it clear that for NFSv4 ACLs,
Edward Tomasz Napierala [Fri, 8 Feb 2013 18:02:28 +0000 (18:02 +0000)]
In the setfacl(1) manual page, make it clear that for NFSv4 ACLs,
one should really use -a and -x instead of -m.

MFC after: 1 week

11 years agoAvoid use of register variables, which some compilers (e.g. clang)
Nathan Whitehorn [Fri, 8 Feb 2013 17:44:44 +0000 (17:44 +0000)]
Avoid use of register variables, which some compilers (e.g. clang)
don't like. It makes the code a little clearer as well.

MFC after: 1 week

11 years agoThe 'end' word was missed in the comment.
Konstantin Belousov [Fri, 8 Feb 2013 15:52:20 +0000 (15:52 +0000)]
The 'end' word was missed in the comment.

MFC after:     3 days

11 years agoPrint a warning if not setuid root.
Dag-Erling Smørgrav [Fri, 8 Feb 2013 14:14:00 +0000 (14:14 +0000)]
Print a warning if not setuid root.
Document the need for the setuid bit and how to set it.
Explain why it isn't set by default, and suggest simply adding users
to groups instead.

PR: docs/167741
MFC after: 3 weeks

11 years agoCross-reference newgrp(1), and document the use of pw(8) to set the group
Dag-Erling Smørgrav [Fri, 8 Feb 2013 14:11:12 +0000 (14:11 +0000)]
Cross-reference newgrp(1), and document the use of pw(8) to set the group
password.

PR: docs/167741
MFC after: 3 weeks

11 years agoRemove NO_OBJ from Makefiles that generate manuals because this causes the
Devin Teske [Fri, 8 Feb 2013 11:14:01 +0000 (11:14 +0000)]
Remove NO_OBJ from Makefiles that generate manuals because this causes the
GZIP compressed manuals to appear in ./src instead of the appropriate obj dir.

PR: conf/175844
Submitted by: Dominique Goncalves <dominique.goncalves@gmail.com>

11 years agoFix warning: comparison of unsigned expression < 0 is always false.
Sergey Kandaurov [Fri, 8 Feb 2013 09:54:53 +0000 (09:54 +0000)]
Fix warning: comparison of unsigned expression < 0 is always false.

Reported by: clang

11 years agoFix ieee80211_mesh.c compilation.
Adrian Chadd [Fri, 8 Feb 2013 09:11:55 +0000 (09:11 +0000)]
Fix ieee80211_mesh.c compilation.

* Add the superg.h header to allow ieee80211_check_ff() to work
* Since the assert stuff creates assertions based on line numbers and there
  was a conflict, just nudge things down a bit.

11 years agoFix a corner case that I noticed with the AR5416 (and it's currently
Adrian Chadd [Fri, 8 Feb 2013 09:07:03 +0000 (09:07 +0000)]
Fix a corner case that I noticed with the AR5416 (and it's currently
crappy 802.11n performance, sigh.)

With the AR5416, aggregates need to be limited to 8KiB if RTS/CTS is
enabled.  However, larger aggregates were going out with RTSCTS enabled.
The following was going on:

* The first buffer in the list would have RTS/CTS enabled in
  bf->bf_state.txflags;
* The aggregate would be formed;
* The "copy over the txflags from the first buffer" logic that I added
  blanked the RTS/CTS TX flags fields, and then copied the bf_first
  RTS/CTS flags over;
* .. but that'd cause bf_first to be blanked out! And thus the flag
  was cleared;
* So the rest of the aggregate formation would run with those flags
  cleared, and thus > 8KiB aggregates were formed.

The driver is now (again) correctly limiting aggregate formation for
the AR5416 but there are still other pending issues to resolve.

Tested:

* AR5416, STA mode

11 years agozfs_vget, zfs_fhtovp: properly handle the z_shares_dir object
Andriy Gapon [Fri, 8 Feb 2013 07:49:54 +0000 (07:49 +0000)]
zfs_vget, zfs_fhtovp: properly handle the z_shares_dir object

A special gfs vnode corresponds to that object.
A regular zfs vnode must not be returned.

This should be upstreamed.

Reported by: pluknet
Submitted by: rmacklem
Tested by: pluknet
MFC after: 10 days

11 years agozfs: update comments about zfid_long_t to match the FreeBSD definitions
Andriy Gapon [Fri, 8 Feb 2013 07:44:15 +0000 (07:44 +0000)]
zfs: update comments about zfid_long_t to match the FreeBSD definitions

MFC after: 1 week

11 years agoktr: correctly handle possible wrap-around in the boot buffer
Andriy Gapon [Fri, 8 Feb 2013 07:29:07 +0000 (07:29 +0000)]
ktr: correctly handle possible wrap-around in the boot buffer

Older entries should be 'before' newer entries in the new buffer too
and there should be no zero-filled gap between them.

Pointed out by: jhb
MFC after: 3 days
X-MFC with: r246282

11 years agosh: Simplify mksyntax and make it fit for cross-compiling.
Jilles Tjoelker [Thu, 7 Feb 2013 22:42:33 +0000 (22:42 +0000)]
sh: Simplify mksyntax and make it fit for cross-compiling.

Now it outputs fixed files, which use constants provided by the C standard
library to determine appropriate values for the target machine.

Before, mksyntax inspected the host machine which resulted in subtle
breakage if e.g. char is signed on the host and unsigned on the target such
as when cross-compiling on x86 for ARM.

Tested using -funsigned-char on amd64. Compiling build-tools without it and
sh itself with it causes various tests to fail without this change but not
with this change. With consistent -funsigned-char, tests pass with or
without this change.

The mksyntax program could be removed and syntax.c and syntax.h committed to
the repository.

Submitted by: Christoph Mallon
MFC after: 2 weeks

11 years agoMesh: recevied GANN frames where not parsed correctly.
Monthadar Al Jaberi [Thu, 7 Feb 2013 21:32:09 +0000 (21:32 +0000)]
Mesh: recevied GANN frames where not parsed correctly.

* Added mesh_parse_meshgate_action that parse all values to host endian;
* Add more detailed debug output;

Approved by: adrian (mentor)

11 years agoMesh HWMP forwarding information: updating FI for transmitter.
Monthadar Al Jaberi [Thu, 7 Feb 2013 21:31:37 +0000 (21:31 +0000)]
Mesh HWMP forwarding information: updating FI for transmitter.

* Added hwmp_update_transmitter function that checks if the metric
  to the transmitter have improved. If old FI is invalid or metric
  is larger the FI to the transmitter is updated occurdingly.
  This is a recommendation from the 802.11 2012 standard, table 13-9;

Approved by: adrian (mentor)

11 years agoMesh HWMP PERR bug fixes.
Monthadar Al Jaberi [Thu, 7 Feb 2013 21:30:58 +0000 (21:30 +0000)]
Mesh HWMP PERR bug fixes.

* When calling ieee80211_mesh_rt_flush_peer, the rt->rt_dest argument
  should not be passed because it can get freed before invalidating
  the other routes that depends on it to compare with next_hop.
  Use PERR_DADDR(i) instead;

Approved by: adrian (mentor)

11 years agoMesh bug: debug infomartion showing swapped SA and DA address.
Monthadar Al Jaberi [Thu, 7 Feb 2013 21:30:29 +0000 (21:30 +0000)]
Mesh bug: debug infomartion showing swapped SA and DA address.

* Fix bug for "forward frame from SA(%6D), DA(%6D)" where addresses where
  swapped between SA and DA;

Approved by: adrian (mentor)

11 years agoUpdate ddb to print mesh routing table.
Monthadar Al Jaberi [Thu, 7 Feb 2013 21:29:48 +0000 (21:29 +0000)]
Update ddb to print mesh routing table.

* Modified _db_show_vap and _db_show_com to print mesh routing table
  if the 'm' modifier is specified;

Approved by: adrian (mentor)

11 years agoMesh HWMP PREQ: fixed conditions for discarding elements.
Monthadar Al Jaberi [Thu, 7 Feb 2013 21:29:14 +0000 (21:29 +0000)]
Mesh HWMP PREQ: fixed conditions for discarding elements.

Approved by: adrian (mentor)

11 years agoMesh HWMP: don't send an intermediate PREP for proxy entries.
Monthadar Al Jaberi [Thu, 7 Feb 2013 21:28:25 +0000 (21:28 +0000)]
Mesh HWMP: don't send an intermediate PREP for proxy entries.

* The standard is unclear about what should happen in case a mesh STA (not
  marked as a mesh gate) recevies a PREQ for a destination that is marked
  as proxy. Solution for now is not to do intermediate reply at all, and
  let the PREQ reach the mesh gate;

Approved by: adrian (mentor)

11 years agoMesh HWMP PREQ update: proxy reply only if mesh STA is a meshgate.
Monthadar Al Jaberi [Thu, 7 Feb 2013 21:27:40 +0000 (21:27 +0000)]
Mesh HWMP PREQ update: proxy reply only if mesh STA is a meshgate.

* Original PREP frame is transmitted only by the target mesh STA or the
  mesh STA that is the proxy target;
* Fixed so that metric value is not over written incorrectly in
  hwmp_recv_preq for when replying back with a PREP;

Approved by: adrian (mentor)

11 years agoHWMP: ic->raw_xmit didn't always point to correct ni.
Monthadar Al Jaberi [Thu, 7 Feb 2013 21:26:40 +0000 (21:26 +0000)]
HWMP: ic->raw_xmit didn't always point to correct ni.

This is a code re-write. ic->raw_xmit need a pointer to ieee80211_node
for the destination node (da). I have reorganized the code so that
a pointer to the da node is searched for in the end & in one place.

* Make mesh_find_txnode public to be used by HWMP, renamed to
  ieee80211_mesh_finx_txnode;
* changed the argument from ieee80211_node to ieee80211vap for all
  hwmp_send_* functions;
* removed the 'sa' argument from hwmp_send_* functions as all HWMP frames
  have the source address equal to vap->iv_myaddr;
* Modified hwmp_send_action so that if da is MULTCAST ni=vap->iv_bss
  otherwise we called ieee80211_mesh_find_txnode. Also no need to hold
  a reference in this functions if da is not MULTICAST as by finding the
  node it became referenced in ieee80211_find_txnode;

Approved by: adrian (mentor)

11 years agoMesh gate code to transmit to all mesh gates.
Monthadar Al Jaberi [Thu, 7 Feb 2013 21:26:06 +0000 (21:26 +0000)]
Mesh gate code to transmit to all mesh gates.

* Modified mesh_find_txnode to be able to handle proxy marked entries by
  recursively calling itself to find the txnode towards the active mesh gate;
* Mesh Gate: Added a new function that transmits data frames
  similar to ieee80211_start;
* Modified ieee80211_mesh_forward_to_gates so that:
     + Frames are duplicated and sent to each valid Mesh Gate;
     + Route is marked invalid before return of function, this is
       because we dont know yet which Mesh Gate is we will use;

Approved by: adrian (mentor)

11 years agoSend frames to mesh gate if 11s discovery fails.
Monthadar Al Jaberi [Thu, 7 Feb 2013 21:25:32 +0000 (21:25 +0000)]
Send frames to mesh gate if 11s discovery fails.

* Send frames that have no path to a known valid Mesh Gate;
* Added the function ieee80211_mesh_forward_to_gates that sends the frame
  to the first found Mesh Gate in the forwarding information;
* If we try to discover again while we are discovering queue frame,
  the discovery callout will send the frames either to mesh gates
  or discards them silently;
* Queue frame also if we try to discover to frequently;

Approved by: adrian (mentor)

11 years agoMark root mesh as gate when mesh gate flag set.
Monthadar Al Jaberi [Thu, 7 Feb 2013 21:24:52 +0000 (21:24 +0000)]
Mark root mesh as gate when mesh gate flag set.

* Add function ieee80211_mesh_mark_gate in ieee80211_mesh.h;
* When received a proactive PREQ or RANN with corresponding mesh gate
  flag set, create a new entry in the known mesh gate list;

Approved by: adrian (mentor)

11 years agoPropagate GANN frames, and store know gate info.
Monthadar Al Jaberi [Thu, 7 Feb 2013 21:24:20 +0000 (21:24 +0000)]
Propagate GANN frames, and store know gate info.

* Modified mesh_recv_action_meshgate to do following:
    + if mesh STA already knows the mesh gate of the recevied GANN frame
    + if mesh gate is know, check seq number according to 802.11 standard
    + if mesh gate is not know, add it to the list of known mesh gates
    + if forwarding is enabled and ttl >= 1 then propagate the GANN frame;
* Declare a new malloc type M_80211_MESH_GT_RT;
* Declare a struct to store GANN information, ieee80211_mesh_gate_route. And
  add it as a TAILQ list to ieee80211_mesh_state;

Approved by: adrian (mentor)

11 years agosh: Fix a comment.
Jilles Tjoelker [Thu, 7 Feb 2013 21:24:10 +0000 (21:24 +0000)]
sh: Fix a comment.

11 years agoMesh update: add base Mesh Gate functionality.
Monthadar Al Jaberi [Thu, 7 Feb 2013 21:23:43 +0000 (21:23 +0000)]
Mesh update: add base Mesh Gate functionality.

A Mesh Gate should transmit a Mesh Action frame containing
ieee80211_meshgann_ie as its only information element periodically
every ieee80211_mesh_gateint ms. Unless the mesh gate is also configure
as a ROOT, then these frames should not be send.
This is according to 802.11 2012 standard;

* Introduce new SYSCTL net.wlan.mesh.gateint, with 10s default;
* Add two new functions mesh_gatemode_setup and mesh_gatemode_cb. This
  is similar to how HWMP setups up a callout;
* Add two new action handlers mesh_recv_action_meshgate and
  mesh_send_action_meshgate;
* Added ieee80211_add_meshgate to ieee80211_mesh.h;
* Modified mesh_send_action to look similar to hwmp_send_action. This is
  because we need to send out broadcast management frames.
* Introduced a new flag for mesh state IEEE80211_MESHFLAGS_ROOT. This flag
  is now set by HWMP code when a mesh STA is configured as a ROOT. This
  is then checked by mesh_gatemode_cb before scheduling a new callout;
* Added to new field to ieee80211_mesh_state:
    + struct callout                  ms_gatetimer
    + ieee80211_mesh_seq              ms_gateseq;

Approved by: adrian (mentor)

11 years agoMark a mesh path to a mesh gate with a 'G'.
Monthadar Al Jaberi [Thu, 7 Feb 2013 21:23:03 +0000 (21:23 +0000)]
Mark a mesh path to a mesh gate with a 'G'.

Approved by: adrian (mentor)

11 years agoStart accepting IEEE80211_ACTION_MESH_GANN frames;
Monthadar Al Jaberi [Thu, 7 Feb 2013 21:22:14 +0000 (21:22 +0000)]
Start accepting IEEE80211_ACTION_MESH_GANN frames;

* Add IEEE80211_ACTION_MESH_GANN Action frame verification in
  ieee80211_parse_action;

Approved by: adrian (mentor)

11 years agoMesh: management mesh action frames are to be discarded
Monthadar Al Jaberi [Thu, 7 Feb 2013 21:21:40 +0000 (21:21 +0000)]
Mesh: management mesh action frames are to be discarded
 when not peered.

* Modified ieee80211_recv_action to check if neighbour is peered for
  IEEE80211_ACTION_CAT_MESH frames, if not frame is discarded. This is
  according to IEEE802.11 2012 standard;
* Removed duplicate checks in each hwmp_recv_* handlers because HWMP
  is a subtype of mesh action;

Approved by: adrian (mentor)

11 years agoUpdate in ieee80211_action.c for mesh code handlers.
Monthadar Al Jaberi [Thu, 7 Feb 2013 21:21:05 +0000 (21:21 +0000)]
Update in ieee80211_action.c for mesh code handlers.

* Removed meshlm_send_action and hwmp_send_action. Introduced one common
  for all Mesh Action frames meshaction_send_action. According to 802.11
  standard Link Metric and HWMP are all under Mesh Action category;
* Did similar changes to recv_action part;
* The size of meshaction_*_action is set to 12. This is to make room for
  the rest of Mesh Action category subtypes;

Approved by: adrian (mentor)

11 years agoUpdate net80211 mesh struct ieee80211_meshgann_ie.
Monthadar Al Jaberi [Thu, 7 Feb 2013 21:20:28 +0000 (21:20 +0000)]
Update net80211 mesh struct ieee80211_meshgann_ie.

* Change all field prefix from pann_ to gann_;
* Added IEEE80211_MESHGANN_BASE_SZ macro to be used in the length field
  of a GANN frame according to 802.11 standard;
* Changed gann_seq field type to uint32_t;
* Added a Gate Announcement interval field according to
  IEEE802.11 2012 standard;
* Added IEEE80211_MESHRT_FLAGS_GATE as flag bit to ieee80211_mesh_route;
* Added IEEE80211_MESHRT_FLAGS_GATE as flag bit to ieee80211req_mesh_route;

Approved by: adrian (mentor)

11 years agoHWMP: Accept a PERR even if path is valid.
Monthadar Al Jaberi [Thu, 7 Feb 2013 21:19:44 +0000 (21:19 +0000)]
HWMP: Accept a PERR even if path is valid.

* An HWMP PERR should be accepted even if path is valid. Because
  we check if we recevied it from a neighbour that we use as a next hop;

Approved by: adrian (mentor)

11 years agoAdd mesh debug for interarction between DS & MBSS.
Monthadar Al Jaberi [Thu, 7 Feb 2013 21:18:22 +0000 (21:18 +0000)]
Add mesh debug for interarction between DS & MBSS.

* Add mesh debug information when frames enter or leave the MBSS;
* Set IEEE80211_MSG_OUTPUT bit to enable output;

Approved by: adrian (mentor)

11 years agoFix mesh path flag.
Monthadar Al Jaberi [Thu, 7 Feb 2013 21:17:35 +0000 (21:17 +0000)]
Fix mesh path flag.

* A bug occurs while in discovery mode which leaves a path marked with
  both Discover and Valid flag. This happens when receiving/sending
  PREQ and PREP in a particular order. Solution is to assign the Valid bit
  instead of oring it;

Approved by: adrian (mentor)

11 years agoStop a mesh STA from flooding with peer frames.
Monthadar Al Jaberi [Thu, 7 Feb 2013 21:12:55 +0000 (21:12 +0000)]
Stop a mesh STA from flooding with peer frames.

This problem happens when using ACL policy to filter mesh STA
but two nodes have different policy. Then one of them will try to
peer all the time. This can also help if for any reason one of the
peering mesh STA have problems sending/receiving peer frames.

* Modified struct ieee80211_node to include two new fields:
    + struct callout ni_mlhtimer /* link mesh backoff timer */
    + uint8_t ni_mlhcnt /* link mesh holding counter */
* Added two new sysctl (check sysctl -d for more info):
    + net.wlan.mesh.backofftimeout=5000
    + net.wlan.mesh.maxholding=2;
* When receiving a beacon and we are in IEEE80211_NODE_MESH_IDLE
  check if ni_mlhcnt >= ieee80211_mesh_maxholding, if so do not do anything;
* In mesh_peer_timeout_cb when transitioning from IEEE80211_NODE_MESH_HOLDING
  to IEEE80211_NODE_MESH_IDLE increment ni_mlhcnt, and eventually start
  ieee80211_mesh_backofftimeout;

Approved by: adrian (mentor)

11 years agoCatch TRACE parameters up with r238888. This change is only needed when
Xin LI [Thu, 7 Feb 2013 19:00:54 +0000 (19:00 +0000)]
Catch TRACE parameters up with r238888.  This change is only needed when
debugging is enabled.

11 years agoImport new libc++ to head. Various small fixes and cleanups.
David Chisnall [Thu, 7 Feb 2013 15:45:28 +0000 (15:45 +0000)]
Import new libc++ to head.  Various small fixes and cleanups.

MFC after: 2 weeks

11 years agoDocument P_PPTRACE.
Konstantin Belousov [Thu, 7 Feb 2013 15:37:51 +0000 (15:37 +0000)]
Document P_PPTRACE.

MFC after: 2 weeks

11 years agoDocument the detail of interaction between vfork and PT_TRACEME.
Konstantin Belousov [Thu, 7 Feb 2013 15:36:24 +0000 (15:36 +0000)]
Document the detail of interaction between vfork and PT_TRACEME.

MFC after: 2 weeks

11 years agoWhen vforked child is traced, the debugging events are not generated
Konstantin Belousov [Thu, 7 Feb 2013 15:34:22 +0000 (15:34 +0000)]
When vforked child is traced, the debugging events are not generated
until child performs exec().  The behaviour is reasonable when a
debugger is the real parent, because the parent is stopped until
exec(), and sending a debugging event to the debugger would deadlock
both parent and child.

On the other hand, when debugger is not the parent of the vforked
child, not sending debugging signals makes it impossible to debug
across vfork.

Fix the issue by declining generating debug signals only when vfork()
was done and child called ptrace(PT_TRACEME).  Set a new process flag
P_PPTRACE from the attach code for PT_TRACEME, if P_PPWAIT flag is
set, which indicates that the process was created with vfork() and
still did not execed. Check P_PPTRACE from issignal(), instead of
refusing the trace outright for the P_PPWAIT case.  The scope of
P_PPTRACE is exactly contained in the scope of P_PPWAIT.

Found and tested by:  zont
Reviewed by: pluknet
MFC after: 2 weeks

11 years agoThis fixes a out-of-order problem with several
Randall Stewart [Thu, 7 Feb 2013 15:20:54 +0000 (15:20 +0000)]
This fixes a out-of-order problem with several
of the newer drivers. The basic problem was
that the driver was pulling the mbuf off the
drbr ring and then when sending with xmit(), encounting
a full transmit ring. Thus the lower layer
xmit() function would return an error, and the
drivers would then append the data back on to the ring.
For TCP this is a horrible scenario sure to bring
on a fast-retransmit.

The fix is to use drbr_peek() to pull the data pointer
but not remove it from the ring. If it fails then
we either call the new drbr_putback or drbr_advance
method. Advance moves it forward (we do this sometimes
when the xmit() function frees the mbuf). When
we succeed we always call advance. The
putback will always copy the mbuf back to the top
of the ring. Note that the putback *cannot* be used
with a drbr_dequeue() only with drbr_peek(). We most
of the time, in putback, would not need to copy it
back since most likey the mbuf is still the same, but
sometimes xmit() functions will change the mbuf via
a pullup or other call. So the optimial case for
the single consumer is to always copy it back. If
we ever do a multiple_consumer (for lagg?) we
will  need a test and atomic in the put back possibly
a seperate putback_mc() in the ring buf.

Reviewed by: jhb@freebsd.org, jlv@freebsd.org

11 years agoDocument the ERESTART translation to EINTR for devfs nodes.
Konstantin Belousov [Thu, 7 Feb 2013 15:11:43 +0000 (15:11 +0000)]
Document the ERESTART translation to EINTR for devfs nodes.

Based on the submission by: jilles
MFC after: 2 weeks

11 years agoStop translating the ERESTART error from the open(2) into EINTR.
Konstantin Belousov [Thu, 7 Feb 2013 14:53:33 +0000 (14:53 +0000)]
Stop translating the ERESTART error from the open(2) into EINTR.
Posix requires that open(2) is restartable for SA_RESTART.

For non-posix objects, in particular, devfs nodes, still disable
automatic restart of the opens. The open call to a driver could have
significant side effects for the hardware.

Noted and reviewed by: jilles
Discussed with: bde
MFC after: 2 weeks

11 years agoAdd myself as a src committer and my mentor relationship.
Achim Leubner [Thu, 7 Feb 2013 14:49:55 +0000 (14:49 +0000)]
Add myself as a src committer and my mentor relationship.

Approved by: emaste (co-mentor)

11 years agoImport new libc++ to vendor branch.
David Chisnall [Thu, 7 Feb 2013 13:09:19 +0000 (13:09 +0000)]
Import new libc++ to vendor branch.

11 years agoFix a copy-and-paste error in libcxxrt.
David Chisnall [Thu, 7 Feb 2013 11:08:03 +0000 (11:08 +0000)]
Fix a copy-and-paste error in libcxxrt.

11 years agoAdd support for mute buttons on USB audio devices and
Hans Petter Selasky [Thu, 7 Feb 2013 08:20:03 +0000 (08:20 +0000)]
Add support for mute buttons on USB audio devices and
use the hwvol interface to adjust the mixer settings.

MFC after: 1 week

11 years agoCreate a new TX lock specifically for queuing frames.
Adrian Chadd [Thu, 7 Feb 2013 07:50:16 +0000 (07:50 +0000)]
Create a new TX lock specifically for queuing frames.

This now separates out the act of queuing frames from the act of running
TX and TX completion.

11 years agoIf an interrupt event's assign_cpu method fails, then restore the original
Neel Natu [Thu, 7 Feb 2013 06:48:47 +0000 (06:48 +0000)]
If an interrupt event's assign_cpu method fails, then restore the original
cpuset mask for the associated interrupt thread.

The text used above is verbatim from r195249 and the code should now be
in line with the intent of that commit.

11 years agoMethodize the process of adding the software TX queue to the taskqueue.
Adrian Chadd [Thu, 7 Feb 2013 02:15:25 +0000 (02:15 +0000)]
Methodize the process of adding the software TX queue to the taskqueue.

Move it (for now) to the TX taskqueue.

11 years agoAudit sockaddr argument for bind(2), connect(2), accept(2), sendto(2) and
Pawel Jakub Dawidek [Thu, 7 Feb 2013 00:36:00 +0000 (00:36 +0000)]
Audit sockaddr argument for bind(2), connect(2), accept(2), sendto(2) and
recvfrom(2) syscalls.

Sponsored by: The FreeBSD Foundation

11 years agoMinor style tweaks.
Pawel Jakub Dawidek [Thu, 7 Feb 2013 00:27:11 +0000 (00:27 +0000)]
Minor style tweaks.

11 years agoAdd AUDIT_ARG_SOCKADDR() macro so we can start using the audit_arg_sockaddr()
Pawel Jakub Dawidek [Thu, 7 Feb 2013 00:24:23 +0000 (00:24 +0000)]
Add AUDIT_ARG_SOCKADDR() macro so we can start using the audit_arg_sockaddr()
function, which is currently unused.

Sponsored by: The FreeBSD Foundation

11 years agoAdd support for buttons on USB audio devices,
Hans Petter Selasky [Wed, 6 Feb 2013 17:43:05 +0000 (17:43 +0000)]
Add support for buttons on USB audio devices,
like Volume Up and Volume Down.

Reviewed by: mav @
MFC after: 1 week

11 years agoRework the handling of stop signals in the NFS client. The changes in
John Baldwin [Wed, 6 Feb 2013 17:06:51 +0000 (17:06 +0000)]
Rework the handling of stop signals in the NFS client.  The changes in
195702, 195703, and 195821 prevented a thread from suspending while holding
locks inside of NFS by forcing the thread to fail sleeps with EINTR or
ERESTART but defer the thread suspension to the user boundary.  However,
this had the effect that stopping a process during an NFS request could
abort the request and trigger EINTR errors that were visible to userland
processes (previously the thread would have suspended and completed the
request once it was resumed).

This change instead effectively masks stop signals while in the NFS client.
It uses the existing TDF_SBDRY flag to effect this since SIGSTOP cannot
be masked directly.  Also, instead of setting PBDRY on individual sleeps,
the NFS client now sets the TDF_SBDRY flag around each NFS request and
stop signals are masked for all sleeps during that region (the previous
change missed sleeps in lockmgr locks).  The end result is that stop
signals sent to threads performing an NFS request are completely
ignored until after the NFS request has finished processing and the
thread prepares to return to userland.  This restores the behavior of
stop signals being transparent to userland processes while still
preventing threads from suspending while holding NFS locks.

Reviewed by: kib
MFC after: 1 month