]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
12 years agoAssert that the filedesc lock is being held when the fdunwrap() function
Pawel Jakub Dawidek [Thu, 14 Jun 2012 16:23:16 +0000 (16:23 +0000)]
Assert that the filedesc lock is being held when the fdunwrap() function
is called.

MFC after: 1 month

12 years agoAdd more quirks for USB MIDI adapters.
Hans Petter Selasky [Thu, 14 Jun 2012 16:20:19 +0000 (16:20 +0000)]
Add more quirks for USB MIDI adapters.

Obtained from: Clemens Ladisch
MFC after: 1 week

12 years agoSimplify the code by making more use of the fdtofp() function.
Pawel Jakub Dawidek [Thu, 14 Jun 2012 15:37:15 +0000 (15:37 +0000)]
Simplify the code by making more use of the fdtofp() function.

MFC after: 1 month

12 years ago- Assert that the filedesc lock is being held when fdisused() is called.
Pawel Jakub Dawidek [Thu, 14 Jun 2012 15:35:14 +0000 (15:35 +0000)]
- Assert that the filedesc lock is being held when fdisused() is called.
- Fix white spaces.

MFC after: 1 month

12 years agoStyle fixes and assertions improvements.
Pawel Jakub Dawidek [Thu, 14 Jun 2012 15:34:10 +0000 (15:34 +0000)]
Style fixes and assertions improvements.

MFC after: 1 month

12 years agoAssert that the filedesc lock is not held when closef() is called.
Pawel Jakub Dawidek [Thu, 14 Jun 2012 15:26:23 +0000 (15:26 +0000)]
Assert that the filedesc lock is not held when closef() is called.

MFC after: 1 month

12 years agoAdd FILEDESC_UNLOCK_ASSERT() macro which asserts that the filedesc is not
Pawel Jakub Dawidek [Thu, 14 Jun 2012 15:24:45 +0000 (15:24 +0000)]
Add FILEDESC_UNLOCK_ASSERT() macro which asserts that the filedesc is not
being held by the current thread (at least exclusively).

MFC after: 1 month

12 years agoExplicitly check if 'fd' is less than 0 instead of using cast-to-unsinged hack.
Pawel Jakub Dawidek [Thu, 14 Jun 2012 15:23:51 +0000 (15:23 +0000)]
Explicitly check if 'fd' is less than 0 instead of using cast-to-unsinged hack.

MFC after: 1 month

12 years agoStyle fixes.
Pawel Jakub Dawidek [Thu, 14 Jun 2012 15:21:57 +0000 (15:21 +0000)]
Style fixes.

Reported by: bde
MFC after: 1 month

12 years agoDefines for parsing linux ATAGs lists.
Warner Losh [Thu, 14 Jun 2012 14:38:55 +0000 (14:38 +0000)]
Defines for parsing linux ATAGs lists.

12 years agoRemove code duplication from fdclosexec(), which was the reason of the bug
Pawel Jakub Dawidek [Thu, 14 Jun 2012 12:43:37 +0000 (12:43 +0000)]
Remove code duplication from fdclosexec(), which was the reason of the bug
fixed in r237065.

MFC after: 1 month

12 years agoWhen we are closing capabilities during exec, we want to call mq_fdclose()
Pawel Jakub Dawidek [Thu, 14 Jun 2012 12:41:21 +0000 (12:41 +0000)]
When we are closing capabilities during exec, we want to call mq_fdclose()
on the underlying object and not on the capability itself.

Similar bug was fixed in r236853.

MFC after: 1 month

12 years agoStyle.
Pawel Jakub Dawidek [Thu, 14 Jun 2012 12:37:41 +0000 (12:37 +0000)]
Style.

MFC after: 1 month

12 years agoMake sure that fstab fd is not leaked on exec.
Konstantin Belousov [Thu, 14 Jun 2012 12:28:43 +0000 (12:28 +0000)]
Make sure that fstab fd is not leaked on exec.

PR:  kern/169023
Submitted by: Jukka Ukkonen <jau iki fi>
MFC after: 1 week

12 years agoEliminate the static buffer used to read the first page of the mapped
Konstantin Belousov [Thu, 14 Jun 2012 11:20:22 +0000 (11:20 +0000)]
Eliminate the static buffer used to read the first page of the mapped
object, and eliminate the pread(2) call as well [1]. Mmap the first
page of the object temporaly, and unmap it on error or last use.
Potentially, this leaves one-page gap between succeeding dlopen(3),
but there are other mmap(2) consumers as well.

Fix several cases were the whole mapping of the object leaked on error.

Use MAP_PREFAULT_READ for mmap(2) calls which map real object pages [2].

Insipired by the patch by: Ian Lepore <freebsd damnhippie dyndns org> [1]
Suggested by: alc [2]
MFC after: 2 weeks

12 years agoAlways reconstruct partition entries in the PMBR when Boot Camp is
Andrey V. Elsukov [Thu, 14 Jun 2012 11:17:54 +0000 (11:17 +0000)]
Always reconstruct partition entries in the PMBR when Boot Camp is
disabled. This helps to easily recover from situations when PMBR is
damaged and contains no entries.

MFC after: 1 week

12 years agoPass flowid explicitly through the stack instead of taking it from
Michael Tuexen [Thu, 14 Jun 2012 06:54:48 +0000 (06:54 +0000)]
Pass flowid explicitly through the stack instead of taking it from
the mbuf chain at different places.
While there: Fix several bugs related to VRFs.

MFC after: 3 days

12 years agoShrink ath_buf a little more:
Adrian Chadd [Thu, 14 Jun 2012 04:24:13 +0000 (04:24 +0000)]
Shrink ath_buf a little more:

* Resize some types.  In particular, bfs_seqno can be uint16_t for now.
  Previous work would assign the unassigned seqno a value of -1, which
  I obviously can't do here.

* Remove bfs_pktdur.  It was in the original code but nothing so far uses
  it.

This gets ath_buf down (on my i386 system) to 292 bytes from 300 bytes.
I'd rather it be much, much smaller.

12 years agoMore Linux boot support. Create arm_dump_avail_init() to initialize
Warner Losh [Thu, 14 Jun 2012 04:18:56 +0000 (04:18 +0000)]
More Linux boot support.  Create arm_dump_avail_init() to initialize
this array either from Linux boot data, when enabled, or in the
typical way that most ports do it.  arm_pyhs_avail_init is coming
soon since it must be a separate function.

12 years agoAdd support for parsing Linux ATAGs such as you'd see from uboot or
Warner Losh [Thu, 14 Jun 2012 04:16:16 +0000 (04:16 +0000)]
Add support for parsing Linux ATAGs such as you'd see from uboot or
redboot.  Support is very preiminary and likely needs some work. Also,
do some minor code shuffling of the FreeBSD /boot/loader metadata
parsing code.  This code is preliminary and should be used with
caution.

12 years agoDisable BGSCAN for 802.11n for now. Until scanning during traffic is
Adrian Chadd [Thu, 14 Jun 2012 04:14:06 +0000 (04:14 +0000)]
Disable BGSCAN for 802.11n for now.  Until scanning during traffic is
fixed for 802.11n TX, this needs to be disabled or users wlil see randomly
hanging aggregation sessions.

Whilst I'm here, remove the warning about 802.11n being full of dragons.
It's nowhere near that scary now.

12 years agoCreate default_parse_boot_param which, if FreeBSD /boot/loader support
Warner Losh [Thu, 14 Jun 2012 04:09:20 +0000 (04:09 +0000)]
Create default_parse_boot_param which, if FreeBSD /boot/loader support
is enabled, sets values based on the metadata passed in.  Otherwise
fake_preload_metadata is called.  Change the default parse_boot_param
to default_parse_boot_param.  Enable this functionality only on the mv
platform, which is where most of the code is from.

Reviewed by: cognet, Ian Lapore

12 years agoDisable this warning debug for now, as I'm now aware of the particular
Adrian Chadd [Thu, 14 Jun 2012 04:01:25 +0000 (04:01 +0000)]
Disable this warning debug for now, as I'm now aware of the particular
situation where it's occuring.

Whilst I'm here, flesh out a more descriptive description.

12 years agoModify all the arm platform files to call parse_boot_param passing in
Warner Losh [Thu, 14 Jun 2012 04:00:30 +0000 (04:00 +0000)]
Modify all the arm platform files to call parse_boot_param passing in
the boot parameters from initarm first thing.  parse_boot_param parses
the boot arguments and converts them to the /boot/loader metadata the
rest of the kernel uses.  parse_boot_param is a weak alias to
fake_preload_metadata, which all the platforms use now, but may become
more extensive in the future.

Since it is a weak symbol, specific boards may define their own
parse_boot_param to interface to custom boot loaders.

Reviewed by: cognet@, Ian Lapore

12 years ago__flt_rounds is a public symbol (expands from the FLT_ROUNDS macro),
Tim Kientzle [Thu, 14 Jun 2012 03:27:01 +0000 (03:27 +0000)]
__flt_rounds is a public symbol (expands from the FLT_ROUNDS macro),
so include it in the public namespace on arm just as with
other architectures.

This corrects r236816.

Submitted by: Jan Sieka
MFC after: 1 week

12 years agoImplement a global (all non-mgmt traffic) TX ath_buf limitation when
Adrian Chadd [Thu, 14 Jun 2012 00:51:53 +0000 (00:51 +0000)]
Implement a global (all non-mgmt traffic) TX ath_buf limitation when
ath_start() is called.

This (defaults to 10 frames) gives for a little headway in the TX ath_buf
allocation, so buffer cloning is still possible.

This requires a lot omre experimenting and tuning.

It also doesn't stop a node/TID from consuming all of the available
ath_buf's, especially when the node is going through high packet loss
or only talking at a low TX rate.  It also doesn't stop a paused TID
from taking all of the ath_bufs.  I'll look at fixing that up in subsequent
commits.

PR: kern/168170

12 years ago- Remove unused code for CR3 and CR4.
Jung-uk Kim [Wed, 13 Jun 2012 22:53:56 +0000 (22:53 +0000)]
- Remove unused code for CR3 and CR4.
- Fix few style(9) nits while I am here.

12 years agoWhen checking if file descriptor number is valid, explicitely check for 'fd'
Pawel Jakub Dawidek [Wed, 13 Jun 2012 22:12:10 +0000 (22:12 +0000)]
When checking if file descriptor number is valid, explicitely check for 'fd'
being less than 0 instead of using cast-to-unsigned hack.

Today's commit was brought to you by the letters 'B', 'D' and 'E' :)

12 years agofind(1): Move description of -d option to -depth primary.
Jilles Tjoelker [Wed, 13 Jun 2012 21:53:40 +0000 (21:53 +0000)]
find(1): Move description of -d option to -depth primary.

The nullary -depth primary is standard and the -d option provides little
advantage.

PR: docs/168885
MFC after: 1 week

12 years agoNow that dupfdopen() doesn't depend on finstall() being called earlier,
Pawel Jakub Dawidek [Wed, 13 Jun 2012 21:38:07 +0000 (21:38 +0000)]
Now that dupfdopen() doesn't depend on finstall() being called earlier,
indx will never be -1 on error, as none of dupfdopen(), finstall() and
kern_capwrap() modifies it on error, but what is more important none of
those functions install and leave file at indx descriptor on error.

Leave an assert to prove my words.

MFC after: 1 month

12 years agoAllocate descriptor number in dupfdopen() itself instead of depending on
Pawel Jakub Dawidek [Wed, 13 Jun 2012 21:32:35 +0000 (21:32 +0000)]
Allocate descriptor number in dupfdopen() itself instead of depending on
the caller using finstall().
This saves us the filedesc lock/unlock cycle, fhold()/fdrop() cycle and closes
a race between finstall() and dupfdopen().

MFC after: 1 month

12 years ago- Remove nfp variable that is not really needed.
Pawel Jakub Dawidek [Wed, 13 Jun 2012 21:22:35 +0000 (21:22 +0000)]
- Remove nfp variable that is not really needed.
- Update comment.
- Style nits.

MFC after: 1 month

12 years agoRemove duplicated code.
Pawel Jakub Dawidek [Wed, 13 Jun 2012 21:15:01 +0000 (21:15 +0000)]
Remove duplicated code.

MFC after: 1 month

12 years agoAdd missing {.
Pawel Jakub Dawidek [Wed, 13 Jun 2012 21:13:18 +0000 (21:13 +0000)]
Add missing {.

MFC after: 1 month

12 years agoStyle.
Pawel Jakub Dawidek [Wed, 13 Jun 2012 21:11:58 +0000 (21:11 +0000)]
Style.

MFC after: 1 month

12 years agoThere is no need to set td->td_retval[0] to -1 on error.
Pawel Jakub Dawidek [Wed, 13 Jun 2012 21:10:00 +0000 (21:10 +0000)]
There is no need to set td->td_retval[0] to -1 on error.

Confirmed by: jhb
MFC after: 1 month

12 years ago- Fix resumectx() prototypes to reflect reality.
Jung-uk Kim [Wed, 13 Jun 2012 21:03:01 +0000 (21:03 +0000)]
- Fix resumectx() prototypes to reflect reality.
- For i386, simply jump to resumectx() with PCB in %ecx.
- Fix a style(9) nit while I am here.

12 years agoAdd a convenience macro for the fastcall attribute.
Jung-uk Kim [Wed, 13 Jun 2012 20:41:45 +0000 (20:41 +0000)]
Add a convenience macro for the fastcall attribute.

MFC after: 2 weeks

12 years agoRevert r236962 - Experimental amdfam10/barcelona support.
Pedro F. Giffuni [Wed, 13 Jun 2012 20:21:08 +0000 (20:21 +0000)]
Revert r236962 - Experimental amdfam10/barcelona support.

The patches are unexpectedly causing gcc to fail while
building ports/graphics/ImageMagick even when the cpu
flags are not used.

Reported by: Andreas Tobler

12 years agoSync example file with mdoc changes made in rev 235450.
Joel Dahl [Wed, 13 Jun 2012 19:08:00 +0000 (19:08 +0000)]
Sync example file with mdoc changes made in rev 235450.

12 years agoThere is only one caller of the dupfdopen() function, so we can simplify
Pawel Jakub Dawidek [Wed, 13 Jun 2012 19:00:29 +0000 (19:00 +0000)]
There is only one caller of the dupfdopen() function, so we can simplify
it a bit:
- We can assert that only ENODEV and ENXIO errors are passed instead of
  handling other errors.
- The caller always call finstall() for indx descriptor, so we can assume
  it is set. Actually the filedesc lock is dropped between finstall() and
  dupfdopen(), so there is a window there for another thread to close the
  indx descriptor, but it will be closed in next commit.

Reviewed by: mjg
MFC after: 1 month

12 years agomdoc: avoid nested displays. Fixes mandoc warnings.
Joel Dahl [Wed, 13 Jun 2012 18:57:27 +0000 (18:57 +0000)]
mdoc: avoid nested displays. Fixes mandoc warnings.

12 years agoRemove 'low' argument from fd_last_used().
Mateusz Guzik [Wed, 13 Jun 2012 17:18:16 +0000 (17:18 +0000)]
Remove 'low' argument from fd_last_used().

This function is static and the only caller always passes 0 as low.

While here update note about return values in comment.

Reviewed by: pjd
Approved by: trasz (mentor)
MFC after: 1 month

12 years agoRe-apply reverted parts of r236935 by pjd with some changes.
Mateusz Guzik [Wed, 13 Jun 2012 17:12:53 +0000 (17:12 +0000)]
Re-apply reverted parts of r236935 by pjd with some changes.

If fdalloc() decides to grow fdtable it does it once and at most doubles
the size. This still may be not enough for sufficiently large fd. Use fd
in calculations of new size in order to fix this.

When growing the table, fd is already equal to first free descriptor >= minfd,
also fdgrowtable() no longer drops the filedesc lock. As a result of this there
is no need to retry allocation nor lookup.

Fix description of fd_first_free to note all return values.

In co-operation with: pjd
Approved by: trasz (mentor)
MFC after: 1 month

12 years agoAlso remove /usr/share/examples/etc/auth.conf, which I didn't even
Dag-Erling Smørgrav [Wed, 13 Jun 2012 16:40:47 +0000 (16:40 +0000)]
Also remove /usr/share/examples/etc/auth.conf, which I didn't even
realize existed.

Noticed by: Andrey Zonov <andrey@zonov.org>
MFC after: 3 weeks

12 years agoRemove leakage of other patches into last commit.
Warner Losh [Wed, 13 Jun 2012 16:12:30 +0000 (16:12 +0000)]
Remove leakage of other patches into last commit.

12 years agoFix a couple of bugs that prevented windows in PCI-PCI bridges from
John Baldwin [Wed, 13 Jun 2012 15:04:50 +0000 (15:04 +0000)]
Fix a couple of bugs that prevented windows in PCI-PCI bridges from
growing "downward" (moving the start address down).  First, an off by
one error caused the end address to be moved down an extra alignment
chunk unnecessarily.  Second, when aligning the new candidate starting
address, the wrong bits were masked off.

Tested by: Andrey Zonov  andrey zonov org
MFC after: 3 days

12 years agoRemove leading /
Dag-Erling Smørgrav [Wed, 13 Jun 2012 11:59:47 +0000 (11:59 +0000)]
Remove leading /

MFC after: 3 weeks

12 years agoRemove auth.conf and related files.
Dag-Erling Smørgrav [Wed, 13 Jun 2012 11:59:03 +0000 (11:59 +0000)]
Remove auth.conf and related files.

Submitted by: trhodes@
MFC after: 3 weeks

12 years agoFix ZFS boot with pre-features pools (version <= 28) broken in r236884
Martin Matuska [Wed, 13 Jun 2012 08:00:32 +0000 (08:00 +0000)]
Fix ZFS boot with pre-features pools (version <= 28) broken in r236884

Reported by: mav
MFC after: 1 month

12 years agoImplement a separate, smaller pool of ath_buf entries for use by management
Adrian Chadd [Wed, 13 Jun 2012 06:57:55 +0000 (06:57 +0000)]
Implement a separate, smaller pool of ath_buf entries for use by management
traffic.

* Create sc_mgmt_txbuf and sc_mgmt_txdesc, initialise/free them appropriately.
* Create an enum to represent buffer types in the API.
* Extend ath_getbuf() and _ath_getbuf_locked() to take the above enum.
* Right now anything sent via ic_raw_xmit() allocates via ATH_BUFTYPE_MGMT.
  This may not be very useful.
* Add ATH_BUF_MGMT flag (ath_buf.bf_flags) which indicates the current buffer
  is a mgmt buffer and should go back onto the mgmt free list.
* Extend 'txagg' to include debugging output for both normal and mgmt txbufs.
* When checking/clearing ATH_BUF_BUSY, do it on both TX pools.

Tested:

* STA mode, with heavy UDP injection via iperf.  This filled the TX queue
  however BARs were still going out successfully.

TODO:

* Initialise the mgmt buffers with ATH_BUF_MGMT and then ensure the right
  type is being allocated and freed on the appropriate list.  That'd save
  a write operation (to bf->bf_flags) on each buffer alloc/free.

* Test on AP mode, ensure that BAR TX and probe responses go out nicely
  when the main TX queue is filled (eg with paused traffic to a TID,
  awaiting a BAR to complete.)

PR: kern/168170

12 years agoInclude a warning when using the example code as it may not
Eitan Adler [Wed, 13 Jun 2012 06:46:00 +0000 (06:46 +0000)]
Include a warning when using the example code as it may not
work in unusual situations.
Also slightly optimize the command.

Submitted by: Jeremy Chadwick jdc@koitsu.org
Approved by: cperciva (implicit)
MFC after: 1 week

12 years agoAdd ARM callchain support for hwpmc.
Fabien Thomas [Wed, 13 Jun 2012 06:38:25 +0000 (06:38 +0000)]
Add ARM callchain support for hwpmc.

Sponsored by: NETASQ
MFC after: 3 days

12 years agoRemove a duplicate definition.
Adrian Chadd [Wed, 13 Jun 2012 05:47:24 +0000 (05:47 +0000)]
Remove a duplicate definition.

12 years agoOops, return the newly allocated buffer to the queue, not the completed
Adrian Chadd [Wed, 13 Jun 2012 05:41:00 +0000 (05:41 +0000)]
Oops, return the newly allocated buffer to the queue, not the completed
buffer.

PR: kern/168170

12 years agoReplace the direct sc_txbuf manipulation with a pair of functions.
Adrian Chadd [Wed, 13 Jun 2012 05:39:16 +0000 (05:39 +0000)]
Replace the direct sc_txbuf manipulation with a pair of functions.

This is preparation work for having a separate ath_buf queue for
management traffic.

PR: kern/168170

12 years agotrim trailing whitespace
Warner Losh [Wed, 13 Jun 2012 05:02:51 +0000 (05:02 +0000)]
trim trailing whitespace

12 years agoFinal whitespace trim.
Warner Losh [Wed, 13 Jun 2012 04:59:55 +0000 (04:59 +0000)]
Final whitespace trim.

12 years agoTrim trailing whitespace...
Warner Losh [Wed, 13 Jun 2012 04:59:00 +0000 (04:59 +0000)]
Trim trailing whitespace...

12 years agoStrip trailing whitespace before other changes.
Warner Losh [Wed, 13 Jun 2012 04:52:19 +0000 (04:52 +0000)]
Strip trailing whitespace before other changes.

12 years agoStrip trailing whitespace.
Warner Losh [Wed, 13 Jun 2012 04:40:29 +0000 (04:40 +0000)]
Strip trailing whitespace.

12 years agotrim trailing spaces that have accumulated over the years (these files
Warner Losh [Wed, 13 Jun 2012 04:38:09 +0000 (04:38 +0000)]
trim trailing spaces that have accumulated over the years (these files
served as the basis for too many other platforms).

12 years agoAdd a test for the :tl & :tu modifiers.
David E. O'Brien [Tue, 12 Jun 2012 23:16:00 +0000 (23:16 +0000)]
Add a test for the :tl & :tu modifiers.

12 years agoFor incompleted block allocations or frees, the inode block count usage
Konstantin Belousov [Tue, 12 Jun 2012 21:37:27 +0000 (21:37 +0000)]
For incompleted block allocations or frees, the inode block count usage
must be recalculated. The blk_check pass of suj checker explicitely marks
inodes which owned such blocks as needing block count adjustment. But
ino_adjblks() is only called by cg_trunc pass, which is performed before
blk_check. As result, the block use count for such inodes is left wrong.
This causes full fsck run after journaled run to still find inconsistencies
like 'INCORRECT BLOCK COUNT I=14557 (328 should be 0)' in phase 1.

Fix this issue by running additional adj_blk pass after blk_check, which
updates the field.

Reviewed by: jeff, mckusick
MFC after: 1 week

12 years agoAdd pfg@ as one of my mentees.
John Baldwin [Tue, 12 Jun 2012 20:55:57 +0000 (20:55 +0000)]
Add pfg@ as one of my mentees.

12 years agoMake sure libkiconv.so.4 is installed into /lib, not into /usr/lib,
Dimitry Andric [Tue, 12 Jun 2012 20:24:57 +0000 (20:24 +0000)]
Make sure libkiconv.so.4 is installed into /lib, not into /usr/lib,
which was inadvertently caused by r236185: if SHLIBDIR is set using the
?= operator, it must be done *before* bsd.own.mk is included, otherwise
the default value is still used.

Note, bsd.lib.mk will take care of removing the copy in /usr/lib upon
installation, so no addition to ObsoleteFiles.inc is needed.

X-MFC-With: r236185

12 years agoReplace a reference to the non-existent SI_ORDER_LAST in a comment with
John Baldwin [Tue, 12 Jun 2012 18:19:46 +0000 (18:19 +0000)]
Replace a reference to the non-existent SI_ORDER_LAST in a comment with
SI_ORDER_ANY.

Submitted by: Brandon Gooch  brandongooch yahoo com

12 years agoStop using auth_getval() now that it always returns NULL. Instead,
Dag-Erling Smørgrav [Tue, 12 Jun 2012 17:14:19 +0000 (17:14 +0000)]
Stop using auth_getval() now that it always returns NULL.  Instead,
hardcode the default to what it would be if we didn't hardcode it,
i.e. DES if supported and MD5 otherwise.

MFC after: 3 weeks

12 years agoauth.conf is dead.
Dag-Erling Smørgrav [Tue, 12 Jun 2012 17:04:56 +0000 (17:04 +0000)]
auth.conf is dead.

12 years agoFinally nuke auth.conf, nine years after it was deprecated. The only
Dag-Erling Smørgrav [Tue, 12 Jun 2012 17:02:53 +0000 (17:02 +0000)]
Finally nuke auth.conf, nine years after it was deprecated.  The only
thing it was still used for was to set the "global default" password
hash.  Since the stock auth.conf contained nothing but comments, the
global default was actually the first algorithm in crypt(3)'s list,
which happens to be DES; I take the fact that nobody noticed as proof
that it was not used outside of crypt(3).

The only other use in our tree was in the Kerberos support code in
in tinyware's passwd(1).  I removed that code in an earlier commit;
it would not have compiled anyway, as it only supported Kerberos IV.

The auth_getval() function is now a stub that always returns NULL,
which has the same effect as a functional auth_getval() with an
empty auth.conf.

MFC after: 3 weeks

12 years agoSpace mismatch - typo in r236962.
Pedro F. Giffuni [Tue, 12 Jun 2012 16:07:03 +0000 (16:07 +0000)]
Space mismatch - typo in  r236962.

Found by: Dima Panov
Approved by: jhb (mentor)
MFC after: 2 weeks

12 years agoRemove dead code.
Dag-Erling Smørgrav [Tue, 12 Jun 2012 15:32:14 +0000 (15:32 +0000)]
Remove dead code.

12 years agoAdd experimental support for amdfam10/barcelona from the GCC 4.3 branch.
Pedro F. Giffuni [Tue, 12 Jun 2012 15:04:18 +0000 (15:04 +0000)]
Add experimental support for amdfam10/barcelona from the GCC 4.3 branch.

Initial support for the AMD barcelona chipsets has been available in the
gcc43 branch under GPLv2 but was not included when the Core 2 support
was brought to the system gcc.

AMD and some linux distributions (OpenSUSE) did a backport of the amdfam10
support and made them available. Unfortunately this is still experimental
and while it can improve performance, enabling the CPUTYPE may break some
C++ ports (like clang).

Special care was taken to make sure that the patches predate the GPLv3
switch upstream.

Tested by: Vladimir Kushnir
Reviewed by: mm
Approved by: jhb (mentor)
MFC after: 2 weeks

12 years agoAdd a cmsg of type IP_TOS for UDP/IPv4 sockets to specify the TOS byte.
Michael Tuexen [Tue, 12 Jun 2012 14:56:08 +0000 (14:56 +0000)]
Add a cmsg of type IP_TOS for UDP/IPv4 sockets to specify the TOS byte.

MFC after: 3 days

12 years agoDocument the -v flag for zpool list.
Martin Matuska [Tue, 12 Jun 2012 14:40:19 +0000 (14:40 +0000)]
Document the -v flag for zpool list.

PR: 168970
Suggested by: Marcelo Araujo <araujo@FreeBSD.org>
MFC after: 3 days

12 years agoAdd a IP_RECVTOS socket option to receive for received UDP/IPv4
Michael Tuexen [Tue, 12 Jun 2012 14:02:38 +0000 (14:02 +0000)]
Add a IP_RECVTOS socket option to receive for received UDP/IPv4
packets a cmsg of type IP_RECVTOS which contains the TOS byte.
Much like IP_RECVTTL does for TTL. This allows to implement a
protocol on top of UDP and implementing ECN.

MFC after: 3 days

12 years agoDeliver IPV6_TCLASS, IPV6_HOPLIMIT and IPV6_PKTINFO cmsgs (if
Michael Tuexen [Tue, 12 Jun 2012 13:57:56 +0000 (13:57 +0000)]
Deliver IPV6_TCLASS, IPV6_HOPLIMIT and IPV6_PKTINFO cmsgs (if
requested) on IPV6 sockets, which have been marked to be not IPV6_V6ONLY,
for each received IPV4 packet.

MFC after: 3 days

12 years agoFix comment to better reflect how we are
Randall Stewart [Tue, 12 Jun 2012 13:31:32 +0000 (13:31 +0000)]
Fix comment to better reflect how we are
cheating and using the csum_data. Also fix
style issues with the comments.

12 years agoUnify the sending of ABORT, SHUTDOWN-COMPLETE and ERROR chunks.
Michael Tuexen [Tue, 12 Jun 2012 13:15:27 +0000 (13:15 +0000)]
Unify the sending of ABORT, SHUTDOWN-COMPLETE and ERROR chunks.
While there: Fix also some minor bugs and prepare for SCTP/DTLS.

MFC after: 3 days

12 years agoNote to self. Have morning coffee *before* committing things.
Randall Stewart [Tue, 12 Jun 2012 12:44:17 +0000 (12:44 +0000)]
Note to self. Have morning coffee *before* committing things.
There is no mac_addr in the mbuf for BSD.. cheat like
we are supposed to and use the csum field since our friend
the gif tunnel itself will never use offload.

12 years agoOpps forgot to commit the flag.
Randall Stewart [Tue, 12 Jun 2012 12:40:15 +0000 (12:40 +0000)]
Opps forgot to commit the flag.

12 years agoFix a problem where zero-length RDATA fields can cause named(8) to crash.
Bjoern A. Zeeb [Tue, 12 Jun 2012 12:10:10 +0000 (12:10 +0000)]
Fix a problem where zero-length RDATA fields can cause named(8) to crash.
[12:03]

Correct a privilege escalation when returning from kernel if
running FreeBSD/amd64 on non-AMD processors. [12:04]

Fix reference count errors in IPv6 code. [EN-12:02]

Security: CVE-2012-1667
Security: FreeBSD-SA-12:03.bind
Security: CVE-2012-0217
Security: FreeBSD-SA-12:04.sysret
Security: FreeBSD-EN-12:02.ipv6refcount
Approved by: so (simon, bz)

12 years ago - Limit r214102 workaround to only x86. On arm it causes more problems
Alexander Motin [Tue, 12 Jun 2012 11:08:51 +0000 (11:08 +0000)]
 - Limit r214102 workaround to only x86. On arm it causes more problems
then solves because of cache coherency issues. This fixes periodic error
messages on console and command timeouts.
 - Patch SATA PHY configuration for 65nm SoCs to improve SNR same as
Linux does.

MFC after: 2 weeks

12 years agoAllow a gif tunnel to be used with ALTq.
Randall Stewart [Tue, 12 Jun 2012 10:44:09 +0000 (10:44 +0000)]
Allow a gif tunnel to be used with ALTq.

Reviewed by: gnn

12 years agoRevert part of the r236935 for now, until I figure out why it doesn't
Pawel Jakub Dawidek [Tue, 12 Jun 2012 10:25:11 +0000 (10:25 +0000)]
Revert part of the r236935 for now, until I figure out why it doesn't
work properly.

Reported by: davidxu

12 years agoSmall cleanup.
Michael Tuexen [Tue, 12 Jun 2012 09:18:28 +0000 (09:18 +0000)]
Small cleanup.

MFC after: 3 days

12 years agoLibUSB v1.0 API compiliance and bugfixes.
Hans Petter Selasky [Tue, 12 Jun 2012 07:28:25 +0000 (07:28 +0000)]
LibUSB v1.0 API compiliance and bugfixes.

- Use CLOCK_MONOTONIC instead of CLOCK_REALTIME, because CLOCK_MONOTONIC
does not wrap into negative in near future. This fixes any potential
problems using "pthread_cond_timedwait()".

- Fix a bug where the "libusb_wait_for_event()" function computes an
absolute timeout instead of a relative timeout. USB transfers do
not depend on this timeout value.

- Add dependency towards LibPthread to Makefile, because LibUSB v1.0
needs this library to function correctly.

MFC after: 1 week

12 years agoShare IPI init and startup code of mp_machdep.c with acpi_wakeup.c
Mitsuru IWASAKI [Tue, 12 Jun 2012 00:14:54 +0000 (00:14 +0000)]
Share IPI init and startup code of mp_machdep.c with acpi_wakeup.c
as ipi_startup().

12 years agoIn softdep_setup_inomapdep() we may have to allocate both inodedep
Kirk McKusick [Mon, 11 Jun 2012 23:07:21 +0000 (23:07 +0000)]
In softdep_setup_inomapdep() we may have to allocate both inodedep
and bmsafemap dependency structures in inodedep_lookup() and
bmsafemap_lookup() respectively. The setup of these structures must
be done while holding the soft-dependency mutex. If the inodedep is
allocated first, it may be freed in the I/O completion callback when
the mutex is released to allocate the bmsafemap. If the bmsafemap is
allocated first, it may be freed in the I/O completion callback when
the mutex is released to allocate the inodedep.

To resolve this problem, bmsafemap_lookup has had a parameter added
that allows a pre-malloc'ed bmsafemap to be passed in so that it does
not need to release the mutex to create a new bmsafemap. The
softdep_setup_inomapdep() routine pre-malloc's a bmsafemap dependency
before acquiring the mutex and starting to build the inodedep with a
call to inodedep_lookup(). The subsequent call to bmsafemap_lookup()
is passed this pre-allocated bmsafemap entry so that it need not
release the mutex if it needs to create a new one.

Reported by: Peter Holm
Tested by:   Peter Holm
MFC after:   1 week

12 years agoSwitch from 4-clause to 2-clause BSD license. (OpenBSD r1.22)
Xin LI [Mon, 11 Jun 2012 22:25:20 +0000 (22:25 +0000)]
Switch from 4-clause to 2-clause BSD license. (OpenBSD r1.22)
No functional change.

Obtained from: NetBSD via OpenBSD

12 years agofdgrowtable() no longer drops the filedesc lock so it is enough to
Pawel Jakub Dawidek [Mon, 11 Jun 2012 22:05:26 +0000 (22:05 +0000)]
fdgrowtable() no longer drops the filedesc lock so it is enough to
retry finding free file descriptor only once after fdgrowtable().

Spotted by: pluknet
MFC after: 1 month

12 years agoAvoid unnecessary atomic operations for clearing PGA_WRITEABLE in
Alan Cox [Mon, 11 Jun 2012 21:41:16 +0000 (21:41 +0000)]
Avoid unnecessary atomic operations for clearing PGA_WRITEABLE in
pmap_remove_pages().  This reduces pmap_remove_pages()'s running time by
4 to 11% in my tests.

MFC after: 1 week

12 years agoRevert: r236909
Hans Petter Selasky [Mon, 11 Jun 2012 20:27:52 +0000 (20:27 +0000)]
Revert: r236909

Pointyhat: me

12 years agoUse consistent way of checking if descriptor number is valid.
Pawel Jakub Dawidek [Mon, 11 Jun 2012 20:19:24 +0000 (20:19 +0000)]
Use consistent way of checking if descriptor number is valid.

MFC after: 1 month

12 years agoUse consistent way of checking if descriptor number is valid.
Pawel Jakub Dawidek [Mon, 11 Jun 2012 20:17:20 +0000 (20:17 +0000)]
Use consistent way of checking if descriptor number is valid.

MFC after: 1 month

12 years agoFix a panic I introduced in r234487, the bridge softc pointer is set to null
Andrew Thompson [Mon, 11 Jun 2012 20:12:13 +0000 (20:12 +0000)]
Fix a panic I introduced in r234487, the bridge softc pointer is set to null
early in the detach so rearrange things not to explode.

Reported by: David Roffiaen, Gustau Perez Querol
Tested by: David Roffiaen
MFC after: 3 days

12 years agoBe consistent with white spaces.
Pawel Jakub Dawidek [Mon, 11 Jun 2012 20:01:50 +0000 (20:01 +0000)]
Be consistent with white spaces.

MFC after: 1 month

12 years agoRemove code duplicated in kern_close() and do_dup() and use closefp() function
Pawel Jakub Dawidek [Mon, 11 Jun 2012 20:00:44 +0000 (20:00 +0000)]
Remove code duplicated in kern_close() and do_dup() and use closefp() function
introduced a minute ago.

This code duplication was responsible for the bug fixed in r236853.

Discussed with: kib
Tested by: pho
MFC after: 1 month

12 years agoIntroduce closefp() function that we will be able to use to eliminate
Pawel Jakub Dawidek [Mon, 11 Jun 2012 19:57:31 +0000 (19:57 +0000)]
Introduce closefp() function that we will be able to use to eliminate
code duplication in kern_close() and do_dup().

This is committed separately from the actual removal of the duplicated
code, as the combined diff was very hard to read.

Discussed with: kib
Tested by: pho
MFC after: 1 month

12 years agoMerge two ifs into one to make the code almost identical to the code in
Pawel Jakub Dawidek [Mon, 11 Jun 2012 19:53:41 +0000 (19:53 +0000)]
Merge two ifs into one to make the code almost identical to the code in
kern_close().

Discussed with: kib
Tested by: pho
MFC after: 1 month