]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
14 years agoRemove tcp_input lock statistics; these are intended for debugging only
Robert Watson [Tue, 6 Oct 2009 20:35:41 +0000 (20:35 +0000)]
Remove tcp_input lock statistics; these are intended for debugging only
and are not intended to ship in 8.0 as they dirty additional cache
lines in a performance-critical per-packet path.

MFC after: 3 days

14 years agoFix tcsh losing history when tcsh terminates because the pty beneath it
Roman Divacky [Tue, 6 Oct 2009 20:19:16 +0000 (20:19 +0000)]
Fix tcsh losing history when tcsh terminates because the pty beneath it
is closed.

Diagnosed by Ted Anderson:

New signal queuing logic was introduced in 6.15 and allows the signal handlers
to be run explicitly by calling handle_pending_signals, instead of
immediately when the signal is delivered.  This function is called at
various places, typically when receiving a EINTR from a slow system call
such as read or write.  In the pty exit case, it was called from xwrite,
called from flush, while printing the "exit" message after receiving EOF
when reading from the pty (note that the read did not return EINTR but
zero bytes, indicating EOF).  The SIGHUP handler, phup(), called
rechist, which opened the history file and began writing the merged
history to it.  This process invoked flush recursively to actually write
the data.  In this case, however, the flush noticed it was being called
recursively and decided fail by calling stderror.

My conclusion was that the signal was being handled at a bad time.  But
whether to fix flush not to care about the recursive call, or to handle
the signal some other time and when to handle it, was unclear to me.
However, by adding an extra call to handle_pending_signals, just after
process() returns to main(), I was able to avoid the truncated history
after network outages and similar failures.  I verified this fix in
version 6.17.

Approved by: ed (mentor)
MFC after: 1 week

14 years agoIn rtld's map_object(), use pread(..., 0) rather than read() to read the
Robert Watson [Tue, 6 Oct 2009 17:14:39 +0000 (17:14 +0000)]
In rtld's map_object(), use pread(..., 0) rather than read() to read the
ELF header from the front of the file.  As all other I/O on the binary
is done using mmap(), this avoids the need for seek privileges on the
file descriptor during run-time linking.

MFC after: 1 month
Sponsored by: Google

14 years agoAdd basename_r(3) to complement basename(3). basename_r(3) which accepts
Robert Watson [Tue, 6 Oct 2009 14:05:57 +0000 (14:05 +0000)]
Add basename_r(3) to complement basename(3).  basename_r(3) which accepts
a caller-allocated buffer of at least MAXPATHLEN, rather than using a
global buffer.

MFC after: 1 month
Sponsored by: Google

14 years agoPer their definition, atomic instructions used in conjuction with
Attilio Rao [Tue, 6 Oct 2009 13:45:49 +0000 (13:45 +0000)]
Per their definition, atomic instructions used in conjuction with
memory barriers should also ensure that the compiler doesn't reorder paths
where they are used.  GCC, however, does that aggressively, even in
presence of volatile operands.  The most reliable way GCC offers for avoid
instructions reordering is clobbering "memory" even if that is
theoretically an heavy-weight operation, flushing the content of all
the registers and forcing reload of them (We could rely, however, on
gcc DTRT by just understanding the purpose as this is a well-known
pattern for many modern operating-systems).

Not all our memory barriers, right now, clobber memory for GCC-like
compilers. The most notable cases are IA32 and amd64 where the memory
barrier are treacted the same as normal atomic instructions.
Fix this by offering the possibility to implement atomic instructions
with memory barriers separately from the normal version and implement
the GCC-like specific one using memory clobbering.
Thanks to Chris Lattner (@apple) for his discussion on llvm specifics.

Reported by: jhb
Reviewed by: jhb
Tested by: rdivacky, Giovanni Trematerra
<giovanni dot trematerra at gmail dot com>

14 years agoExpand $FreeBSD$
Dag-Erling Smørgrav [Tue, 6 Oct 2009 10:19:20 +0000 (10:19 +0000)]
Expand $FreeBSD$

14 years agoo Fix typo: "an in particular" -> "and in particular".
Maxim Konovalov [Tue, 6 Oct 2009 04:57:18 +0000 (04:57 +0000)]
o Fix typo: "an in particular" -> "and in particular".

PR: docs/139370
Submitted by: Kenyon Ralph
MFC after: 1 week

14 years ago"Potluck Pogo" was a collection of Walt Kelly's "Pogo" cartoons
Doug Barton [Tue, 6 Oct 2009 02:13:32 +0000 (02:13 +0000)]
"Potluck Pogo" was a collection of Walt Kelly's "Pogo" cartoons
first published in 1955. "Putluck Pogo" seems to be a typo.

14 years agoIn tcp_input(), we acquire a global write lock at first only if a
Robert Watson [Mon, 5 Oct 2009 22:24:13 +0000 (22:24 +0000)]
In tcp_input(), we acquire a global write lock at first only if a
segment is likely to trigger a TCP state change (i.e., FIN/RST/SYN).
If we later have to upgrade the lock, we acquire an inpcb reference
and drop both global/inpcb locks before reacquiring in-order.  In
that gap, the connection may transition into TIMEWAIT, so we need
to loop back and reevaluate the inpcb after relocking.

MFC after: 3 days
Reported by: Kamigishi Rei <spambox at haruhiism.net>
Reviewed by: bz

14 years agoFix build on amd64, where sysctl arg1 is a pointer.
Robert Watson [Mon, 5 Oct 2009 22:23:12 +0000 (22:23 +0000)]
Fix build on amd64, where sysctl arg1 is a pointer.

Reported by: Mr Tinderbox
MFC after: 3 months

14 years agofts_open() requires that the list passed as argument to contain at least
Xin LI [Mon, 5 Oct 2009 21:11:04 +0000 (21:11 +0000)]
fts_open() requires that the list passed as argument to contain at least
one path.  When the list is empty (contain only a NULL pointer), return
EINVAL instead of pretending to succeed, which will cause a NULL pointer
deference in a later fts_read() call.

Noticed by: Christoph Mallon (via rdivacky@)
MFC after: 2 weeks

14 years agocxgb(4) updates, including:
Navdeep Parhar [Mon, 5 Oct 2009 20:21:41 +0000 (20:21 +0000)]
cxgb(4) updates, including:
- support for the new Gen-2, BT, and LP-CR cards.
- T3 firmware 7.7.0
- shared "common code" updates.

Approved by: gnn (mentor)
Obtained from: Chelsio
MFC after: 1 month

14 years agoFix a case when both ${name}_program and ${command} are defined.
Hiroki Sato [Mon, 5 Oct 2009 20:11:33 +0000 (20:11 +0000)]
Fix a case when both ${name}_program and ${command} are defined.

Spotted by: Michio "Karl" Jinbo

14 years agoFix NFSv4 ACLs on sparc64. Turns out that fuword(9) fetches 64 bits
Edward Tomasz Napierala [Mon, 5 Oct 2009 19:56:56 +0000 (19:56 +0000)]
Fix NFSv4 ACLs on sparc64.  Turns out that fuword(9) fetches 64 bits
instead of sizeof(int), and on sparc64 that resulted in fetching wrong
value for acl_maxcnt, which in turn caused __acl_get_link(2) to fail
with EINVAL.

PR: sparc64/139304
Submitted by: Dmitry Afanasiev <KOT at MATPOCKuH.Ru>

14 years agoBelatedly add my calendar entry.
Benedict Reuschling [Mon, 5 Oct 2009 19:29:49 +0000 (19:29 +0000)]
Belatedly add my calendar entry.

Discussed with:     remko
Approved by:        remko, jkois (mentor)

14 years agopam_ssh needs roaming_dummy to link correctly against libssh.
Dag-Erling Smørgrav [Mon, 5 Oct 2009 18:56:18 +0000 (18:56 +0000)]
pam_ssh needs roaming_dummy to link correctly against libssh.

14 years agoAdd more symbols that need to be masked:
Dag-Erling Smørgrav [Mon, 5 Oct 2009 18:55:13 +0000 (18:55 +0000)]
Add more symbols that need to be masked:

 - initialized and uninitialized data
 - symbols from roaming_dummy.c which end up in pam_ssh

Update the command line used to generate the #defines.

14 years ago- Revert r191568 partially. Forcing AHCI mode by changing device subclass
Jung-uk Kim [Mon, 5 Oct 2009 16:26:54 +0000 (16:26 +0000)]
- Revert r191568 partially.  Forcing AHCI mode by changing device subclass
and progif is evil.  It doesn't work reliably[1] and we should honor BIOS
configuration by the user.
- If the SATA controller is enbled but combined mode is disabled, mask off
the emulated IDE channel on the legacy IDE controller.

Pointed out by: mav[1]

14 years agoA few regression tests for SOCK_SEQPACKET UNIX domain sockets.
Robert Watson [Mon, 5 Oct 2009 15:27:01 +0000 (15:27 +0000)]
A few regression tests for SOCK_SEQPACKET UNIX domain sockets.

Sponsored by: Google

14 years agoMake fetch(9) and store(9) manual pages closer to reality.
Edward Tomasz Napierala [Mon, 5 Oct 2009 15:16:28 +0000 (15:16 +0000)]
Make fetch(9) and store(9) manual pages closer to reality.

14 years agoBump unix(4) man page date for SOCK_SEQPACKET.
Robert Watson [Mon, 5 Oct 2009 15:15:13 +0000 (15:15 +0000)]
Bump unix(4) man page date for SOCK_SEQPACKET.

Suggested by: bz
MFC after: 3 months

14 years agoSOCK_SEQPACKET is now supported on UNIX domain sockets.
Robert Watson [Mon, 5 Oct 2009 15:07:44 +0000 (15:07 +0000)]
SOCK_SEQPACKET is now supported on UNIX domain sockets.

Sponsored by: Google
MFC after: 3 months

14 years agonetstat(1) support for UNIX SOCK_SEQPACKET sockets -- changes were required
Robert Watson [Mon, 5 Oct 2009 15:06:14 +0000 (15:06 +0000)]
netstat(1) support for UNIX SOCK_SEQPACKET sockets -- changes were required
only for the kvm case, as we supported SOCK_SEQPACKET via sysctl already.

Sponsored by: Google
MFC after: 3 months

14 years agoAdd myself.
Jaakko Heinonen [Mon, 5 Oct 2009 15:05:43 +0000 (15:05 +0000)]
Add myself.

Approved by: trasz (mentor)

14 years agoFirst cut at implementing SOCK_SEQPACKET support for UNIX (local) domain
Robert Watson [Mon, 5 Oct 2009 14:49:16 +0000 (14:49 +0000)]
First cut at implementing SOCK_SEQPACKET support for UNIX (local) domain
sockets.  This allows for reliable bi-directional datagram communication
over UNIX domain sockets, in contrast to SOCK_DGRAM (M:N, unreliable) or
SOCK_STERAM (bi-directional bytestream).  Largely, this reuses existing
UNIX domain socket code.  This allows applications requiring record-
oriented semantics to do so reliably via local IPC.

Some implementation notes (also present in XXX comments):

- Currently we lack an sbappend variant able to do datagrams and control
  data without doing addresses, so we mark SOCK_SEQPACKET as PR_ADDR.
  Adding a new variant will solve this problem.

- UNIX domain sockets on FreeBSD provide back-pressure/flow control
  notification for stream sockets by manipulating the send socket
  buffer's size during pru_send and pru_rcvd.  This trick works less well
  for SOCK_SEQPACKET as sosend_generic() uses sb_hiwat not just to
  manage blocking, but also to determine maximum datagram size.  Fixing
  this requires rethinking how back-pressure is done for SOCK_SEQPACKET;
  in the mean time, it's possible to get EMSGSIZE when buffers fill,
  instead of blocking.

Discussed with: benl
Reviewed by: bz, rpaulo
MFC after: 3 months
Sponsored by: Google

14 years agoWhen the timeout backoff hits the maximum value, leave it capped at the
John Baldwin [Mon, 5 Oct 2009 14:13:16 +0000 (14:13 +0000)]
When the timeout backoff hits the maximum value, leave it capped at the
maximum value rather than setting it to the result of a boolean expression
that is always true.

Submitted by: Joseph Kong
MFC after: 1 month

14 years ago- Drop unused pmap_use_l1 function and comment out currently unused
Stanislav Sedov [Mon, 5 Oct 2009 10:08:58 +0000 (10:08 +0000)]
- Drop unused pmap_use_l1 function and comment out currently unused
  pmap_dcache_wbinv_all/pmap_copy_page functions which we might want
  to take advatage of later.  This fixes the build with PMAP_DEBUG
  defined.

Discussed with: cognet

14 years agotabify
Dag-Erling Smørgrav [Mon, 5 Oct 2009 09:28:54 +0000 (09:28 +0000)]
tabify

MFC after: 3 weeks

14 years agoChange the pam_ssh examples: if you use it, you probably want want_agent.
Dag-Erling Smørgrav [Mon, 5 Oct 2009 09:26:22 +0000 (09:26 +0000)]
Change the pam_ssh examples: if you use it, you probably want want_agent.

MFC after: 3 weeks

14 years ago- Improve error message consistency and wording.
Ulf Lilleengen [Mon, 5 Oct 2009 08:44:31 +0000 (08:44 +0000)]
- Improve error message consistency and wording.

14 years agoBackout changes for c_fmt, x_fmt and X_fmt, they were coming from
Edwin Groothuis [Mon, 5 Oct 2009 07:21:21 +0000 (07:21 +0000)]
Backout changes for c_fmt, x_fmt and X_fmt, they were coming from
the wrong patches. Apologies.

14 years agoModified locale(1) to be able to show the altmon_X fields and the [cxX]_fmt's.
Edwin Groothuis [Mon, 5 Oct 2009 07:13:15 +0000 (07:13 +0000)]
Modified locale(1) to be able to show the altmon_X fields and the [cxX]_fmt's.
Also modify the "-k list" option to display only fields with a certain prefix.

MFC after:      1 week

14 years agoModified locale(1) to be able to show the altmon_X fields and the [cxX]_fmt's.
Edwin Groothuis [Mon, 5 Oct 2009 07:11:19 +0000 (07:11 +0000)]
Modified locale(1) to be able to show the altmon_X fields and the [cxX]_fmt's.
Also modify the "-k list" option to display only fields with a certain prefix.

MFC after: 1 week

14 years agoThe cylinder group tag cg_initediblk needs to match the number of inodes
Matt Jacob [Mon, 5 Oct 2009 01:31:16 +0000 (01:31 +0000)]
The cylinder group tag cg_initediblk needs to match the number of inodes
actually initialized. In the growfs case for UFS2, no inodes were actually
being initialized and the number of inodes noted as initialized was the
number of inodes per group. This created a filesystem that was deemed
corrupted because the inodes thus added were full of garbage.

MFC after: 1 month

14 years agoupdates device entries supported with the product name not magic numbers
Weongyo Jeong [Sun, 4 Oct 2009 23:30:08 +0000 (23:30 +0000)]
updates device entries supported with the product name not magic numbers
and sorts entries.  WUSB54GCV2 is added.

Obtained from: OpenBSD

14 years agoRegression tests for r197752 (handling of empty/NULL buffers).
David Schultz [Sun, 4 Oct 2009 19:44:41 +0000 (19:44 +0000)]
Regression tests for r197752 (handling of empty/NULL buffers).

14 years agoBetter glibc compatibility for getline/getdelim:
David Schultz [Sun, 4 Oct 2009 19:43:36 +0000 (19:43 +0000)]
Better glibc compatibility for getline/getdelim:

- Tolerate applications that pass a NULL pointer for the buffer and
  claim that the capacity of the buffer is nonzero.

- If an application passes in a non-NULL buffer pointer and claims the
  buffer has zero capacity, we should free (well, realloc) it
  anyway. It could have been obtained from malloc(0), so failing to
  free it would be a small memory leak.

MFC After: 2 weeks
Reported by: naddy
PR: ports/138320

14 years agoAlign and pad the page queue and free page queue locks so that the linker
Alan Cox [Sun, 4 Oct 2009 18:53:10 +0000 (18:53 +0000)]
Align and pad the page queue and free page queue locks so that the linker
can't possibly place them together within the same cache line.

MFC after: 3 weeks

14 years agoIn lists, if there is a Li command remove it. This fixes markup for
Simon L. B. Nielsen [Sun, 4 Oct 2009 16:30:33 +0000 (16:30 +0000)]
In lists, if there is a Li command remove it.  This fixes markup for
uath(4).

MFC after: 3 days
Reported by: Warren Block <wblock at wonkity.com>

14 years agoInstall x86 related man pages on x86 systems only.
Rui Paulo [Sun, 4 Oct 2009 10:54:20 +0000 (10:54 +0000)]
Install x86 related man pages on x86 systems only.

Reviewed by: jkoshy

14 years agoFix a bug that causes the fsx test case of mmap'ed page being out of sync
Xin LI [Sun, 4 Oct 2009 10:38:04 +0000 (10:38 +0000)]
Fix a bug that causes the fsx test case of mmap'ed page being out of sync
of read/write, inspired by ZFS's counterpart.

PR: kern/139312
Submitted by: gk@
MFC after: 1 week

14 years agoWhen releasing a lockmgr held in shared way we need to use a write memory
Attilio Rao [Sat, 3 Oct 2009 15:02:55 +0000 (15:02 +0000)]
When releasing a lockmgr held in shared way we need to use a write memory
barrier in order to avoid, on architectures which doesn't have strong
ordered writes, CPU instructions reordering.

Diagnosed by: fabio

14 years agoRemove remaining bits of performance counter support.
Rui Paulo [Sat, 3 Oct 2009 13:59:15 +0000 (13:59 +0000)]
Remove remaining bits of performance counter support.

Submitted by: Tom Judge <tom at tomjudge.com>

14 years agounifdef NFSCLIENT because the nlm depends on the nfsclient even if NFSCLIENT
Yoshihiro Takahashi [Sat, 3 Oct 2009 12:22:12 +0000 (12:22 +0000)]
unifdef NFSCLIENT because the nlm depends on the nfsclient even if NFSCLIENT
is not defined.

Now the nfslockd module works with the nfsclient module.

Reviewed by: kib
MFC after: 3 days

14 years agoMake sure that the primary native brandinfo always gets added
Bjoern A. Zeeb [Sat, 3 Oct 2009 11:57:21 +0000 (11:57 +0000)]
Make sure that the primary native brandinfo always gets added
first and the native ia32 compat as middle (before other things).
o(ld)brandinfo as well as third party like linux, kfreebsd, etc.
stays on SI_ORDER_ANY coming last.

The reason for this is only to make sure that even in case we would
overflow the MAX_BRANDS sized array, the native FreeBSD brandinfo
would still be there and the system would be operational.

Reviewed by: kib
MFC after: 1 month

14 years agoAdd OpenVPN IANA assigned port number.
Rui Paulo [Sat, 3 Oct 2009 11:02:36 +0000 (11:02 +0000)]
Add OpenVPN IANA assigned port number.

14 years agoPut #ifdef INET around parts of the FLOWTABLE code, to unbreak
Bjoern A. Zeeb [Sat, 3 Oct 2009 10:56:03 +0000 (10:56 +0000)]
Put #ifdef INET around parts of the FLOWTABLE code, to unbreak
nooptions INET kernel builds.

MFC after: 3 days
X-MFC: with r197687

14 years agoPrint a warning in case we cannot add more brandinfo because
Bjoern A. Zeeb [Sat, 3 Oct 2009 10:50:00 +0000 (10:50 +0000)]
Print a warning in case we cannot add more brandinfo because
we would overflow the MAX_BRANDS sized array.

Reviewed by: kib
MFC After: 1 month

14 years agoThe 6bone was decommissioned on 6/6/06, so remove references to it.
Doug Barton [Sat, 3 Oct 2009 02:37:21 +0000 (02:37 +0000)]
The 6bone was decommissioned on 6/6/06, so remove references to it.

14 years agoTRENDnet TEW-424UB has multiple revisions so clarify zyd(4) man page and
Weongyo Jeong [Sat, 3 Oct 2009 02:28:28 +0000 (02:28 +0000)]
TRENDnet TEW-424UB has multiple revisions so clarify zyd(4) man page and
adds a device to urtw(4).  The revision informations are as follows:

    rev A       ZD1211
    V2          SiS163U
    V2.1R       SiS163U
    V3.xR       RTL8187B

and bump date.

Obtained from: OpenBSD
Reported by: Albert Shih <Albert.Shih at obspm.fr>

14 years agoFix RTS/CTS flow control, broken by the TTY overhaul. The new TTY
Marcel Moolenaar [Fri, 2 Oct 2009 22:30:44 +0000 (22:30 +0000)]
Fix RTS/CTS flow control, broken by the TTY overhaul. The new TTY
interface is fairly simple WRT dealing with flow control, but
needed 2 new RX buffer functions with "get-char-from-buf" separated
from "advance-buf-pointer" so that the pointer could be advanced
only when ttydisc_rint() succeeded.

MFC after: 1 week

14 years agoDon't comment on stream socket handling in sosend_dgram, since that's
Robert Watson [Fri, 2 Oct 2009 21:31:15 +0000 (21:31 +0000)]
Don't comment on stream socket handling in sosend_dgram, since that's
not handled.

MFC after: 3 weeks

14 years ago- Enable an afexists() check only when no AF argument is specified.
Hiroki Sato [Fri, 2 Oct 2009 20:19:53 +0000 (20:19 +0000)]
- Enable an afexists() check only when no AF argument is specified.
- Simplify helper functions.

Discussed with: ume

14 years agoReplace the name of the sysctl to security.bsd.map_at_zero and to be
Bjoern A. Zeeb [Fri, 2 Oct 2009 17:53:48 +0000 (17:53 +0000)]
Replace the name of the sysctl to security.bsd.map_at_zero and to be
consistent updated the name of the variable as well, after the change
in r197711.

14 years agoBack out the functional parts from r197537. After r197711, affecting all
Bjoern A. Zeeb [Fri, 2 Oct 2009 17:51:46 +0000 (17:51 +0000)]
Back out the functional parts from r197537.  After r197711, affecting all
user mappings, mmap no longer needs special treatment.

14 years agoAdd a mitigation feature that will prevent user mappings at
Bjoern A. Zeeb [Fri, 2 Oct 2009 17:48:51 +0000 (17:48 +0000)]
Add a mitigation feature that will prevent user mappings at
virtual address 0, limiting the ability to convert a kernel
NULL pointer dereference into a privilege escalation attack.

If the sysctl is set to 0 a newly started process will not be able
to map anything in the address range of the first page (0 to PAGE_SIZE).
This is the default. Already running processes are not affected by this.

You can either change the sysctl or the tunable from loader in case
you need to map at a virtual address of 0, for example when running
any of the extinct species of a set of a.out binaries, vm86 emulation, ..
In that case set security.bsd.map_at_zero="1".

Superseeds: r197537
In collaboration with: jhb, kib, alc

14 years agoFix build nfscl and/or nfsd.
Yoshihiro Takahashi [Fri, 2 Oct 2009 12:47:01 +0000 (12:47 +0000)]
Fix build nfscl and/or nfsd.

MFC after: 3 days

14 years agoReserve numbers for XScale.
Rui Paulo [Fri, 2 Oct 2009 11:14:12 +0000 (11:14 +0000)]
Reserve numbers for XScale.

Reviewed by: jkoshy

14 years agoRemove performance counter headers. This code came from NetBSD, but our
Rui Paulo [Fri, 2 Oct 2009 11:10:05 +0000 (11:10 +0000)]
Remove performance counter headers. This code came from NetBSD, but our
hardware perf. counter support is different, so we don't need these
files.

Reviewed by: freebsd-arm (no comments)

14 years agoEnable adding a link-local address even if ND6_IFF_IFDISABLED.
Hiroki Sato [Fri, 2 Oct 2009 07:00:20 +0000 (07:00 +0000)]
Enable adding a link-local address even if ND6_IFF_IFDISABLED.
Note that when the interface has ND6_IFF_IFDISABLED, a newly-added
address is always marked as IN6_IFF_TENTATIVE so that the interface
can perform DAD after the ND6_IFF_IFDISABLED is cleared.

14 years agoThe net.inet.tcp.log_in_vain accepts 0, 1 or 2, not Y/N.
Hiroki Sato [Fri, 2 Oct 2009 06:51:39 +0000 (06:51 +0000)]
The net.inet.tcp.log_in_vain accepts 0, 1 or 2, not Y/N.

14 years agoRevert the previous afexists() change. Knobs configured explicitly by
Hiroki Sato [Fri, 2 Oct 2009 06:19:34 +0000 (06:19 +0000)]
Revert the previous afexists() change.  Knobs configured explicitly by
the user should not be ignored if possible even if the kernel does not
support the prerequisite feature.

Discussed with: ume

14 years ago- Split routing_*() and option_*() to *_AF() and add afexists() check
Hiroki Sato [Fri, 2 Oct 2009 02:28:59 +0000 (02:28 +0000)]
- Split routing_*() and option_*() to *_AF() and add afexists() check
  for each address family.  Replace AF_static() with static_AF() for
  consistency.

- Display a message only if the user sets a non-default value, and set
  a sysctl explicitly even if it is the default value.

14 years ago- Fix logic inversion bug of net.inet.tcp.rfc1323[*].
Hiroki Sato [Fri, 2 Oct 2009 02:27:49 +0000 (02:27 +0000)]
- Fix logic inversion bug of net.inet.tcp.rfc1323[*].

- Split netoptions_start() to netoptions_AF() and add afexists() check
  for each address family.

- Display a message only if the user sets a non-default value, and set
  a sysctl explicitly even if it is the default value.

Spotted by: Pegasus Mc Cleaft[*]

14 years ago- Add AF_IPX and AF_NATM to afexists().
Hiroki Sato [Fri, 2 Oct 2009 02:24:25 +0000 (02:24 +0000)]
- Add AF_IPX and AF_NATM to afexists().

- Add afexists() check to address family specific rc.d scripts.  A
  script for an AF will be silently ignored if the kernel has no
  support for the AF.

14 years agoRemove a log message from production code. This log message can be
Qing Li [Fri, 2 Oct 2009 01:45:11 +0000 (01:45 +0000)]
Remove a log message from production code. This log message can be
triggered by a misconfigured host that is sending out gratuious ARPs.
This log message can also be triggered during a network renumbering
event when multiple prefixes co-exist on a single network segment.

MFC after: immediately

14 years agoPreviously, if an address alias is configured on an interface, and
Qing Li [Fri, 2 Oct 2009 01:34:55 +0000 (01:34 +0000)]
Previously, if an address alias is configured on an interface, and
this address alias has a prefix matching that of another address
configured on the same interface, then the ARP entry for the alias
is not deleted from the ARP table when that address alias is removed.
This patch fixes the aforementioned issue.

PR: kern/139113
MFC after: 3 days

14 years agomake read_eflags and write_eflags accomplish the same effect on PVM as native,
Kip Macy [Thu, 1 Oct 2009 22:05:38 +0000 (22:05 +0000)]
make read_eflags and write_eflags accomplish the same effect on PVM as native,
simplifying interrupt handling

14 years agoIn fill_kinfo_thread, copy the thread's name into struct kinfo_proc even
Ed Maste [Thu, 1 Oct 2009 21:44:30 +0000 (21:44 +0000)]
In fill_kinfo_thread, copy the thread's name into struct kinfo_proc even
if it is empty.  Otherwise the previous thread's name would remain in the
struct and then be reported for this thread.

Submitted by: Ryan Stone
MFC after: 1 week

14 years agosh: Disallow mismatched quotes in backticks (`...`).
Jilles Tjoelker [Thu, 1 Oct 2009 21:40:08 +0000 (21:40 +0000)]
sh: Disallow mismatched quotes in backticks (`...`).

Due to the amount of code removed by this, it seems that allowing unmatched
quotes was a deliberate imitation of System V sh and real ksh. Most other
shells do not allow unmatched quotes (e.g. bash, zsh, pdksh, NetBSD /bin/sh,
dash).

PR: bin/137657

14 years agoCompile ACPI debugger and disassembler for kernel modules unconditionally.
Jung-uk Kim [Thu, 1 Oct 2009 20:56:15 +0000 (20:56 +0000)]
Compile ACPI debugger and disassembler for kernel modules unconditionally.
These files will generate almost empty object files without ACPI_DEBUG/DDB
options.  As a result, size of acpi.ko will increase slightly.

14 years agoThe flow-table associates TCP/UDP flows and IP destinations with
Qing Li [Thu, 1 Oct 2009 20:32:29 +0000 (20:32 +0000)]
The flow-table associates TCP/UDP flows and IP destinations with
specific routes. When the routing table changes, for example,
when a new route with a more specific prefix is inserted into the
routing table, the flow-table is not updated to reflect that change.
As such existing connections cannot take advantage of the new path.
In some cases the path is broken. This patch will update the affected
flow-table entries when a more specific route is added. The route
entry is properly marked when a route is deleted from the table.
In this case, when the flow-table performs a search, the stale
entry is updated automatically. Therefore this patch is not
necessary for route deletion.

Submitted by: simon, phk
Reviewed by: bz, kmacy
MFC after: 3 days

14 years agoPut square backets ([]) around process names for system processes to patch
John Baldwin [Thu, 1 Oct 2009 19:12:14 +0000 (19:12 +0000)]
Put square backets ([]) around process names for system processes to patch
the behavior of ps(1).

14 years agoReturn EOPNOTSUPP instead of EINVAL when doing chflags(2) over an old
Xin LI [Thu, 1 Oct 2009 18:58:26 +0000 (18:58 +0000)]
Return EOPNOTSUPP instead of EINVAL when doing chflags(2) over an old
format ZFS, as defined in the manual page.

Submitted by: pjd (response of my original patch but bugs are mine)
MFC after: 3 days

14 years agoEHCI Hardware BUG workaround
Andrew Thompson [Thu, 1 Oct 2009 18:37:16 +0000 (18:37 +0000)]
EHCI Hardware BUG workaround

The EHCI HW can use the qtd_next field instead of qtd_altnext when a short
packet is received. This contradicts what is stated in the EHCI datasheet.
Also the total-bytes field in the status field of the following TD gets
corrupted upon reception of a short packet!  We work this around in software by
not queueing more than one job/TD at a time of up to 16Kbytes! The bug has been
seen on multiple INTEL based EHCI chips.  Other vendors have not been tested
yet.

- Applications using /dev/usb/X.Y.Z, where Z is non-zero are affected, but not
  applications using LibUSB v0.1, v1.2 and v2.0.
- Mass Storage (umass) is affected.

Submitted by: Hans Petter Selasky
MFC after: 3 days

14 years agoCorrect the pthread stub prototype for pthread_mutexattr_settype to allow for
Joe Marcus Clarke [Thu, 1 Oct 2009 18:23:50 +0000 (18:23 +0000)]
Correct the pthread stub prototype for pthread_mutexattr_settype to allow for
the type argument.  This is known to fix some pthread_mutexattr_settype()
invocations, especially when it comes to pulseaudio.

Approved by: kib
deischen (threads)
MFC after: 3 days

14 years agoProvide default implementation for VOP_ACCESS(9), so that filesystems which
Edward Tomasz Napierala [Thu, 1 Oct 2009 17:22:03 +0000 (17:22 +0000)]
Provide default implementation for VOP_ACCESS(9), so that filesystems which
want to provide VOP_ACCESSX(9) don't have to implement both.  Note that
this commit makes implementation of either of these two mandatory.

Reviewed by: kib

14 years agoUpgrade to OpenSSH 5.3p1.
Dag-Erling Smørgrav [Thu, 1 Oct 2009 17:12:52 +0000 (17:12 +0000)]
Upgrade to OpenSSH 5.3p1.

14 years agoChanged an IPSEC_ASSERT to a simple test, as such invalid packets
VANHULLEBUS Yvan [Thu, 1 Oct 2009 15:33:53 +0000 (15:33 +0000)]
Changed an IPSEC_ASSERT to a simple test, as such invalid packets
may come from outside without being discarded before.

Submitted by: aurelien.ansel@netasq.com
Reviewed by: bz (secteam)
Obtained from: NETASQ
MFC after: 1m

14 years agoVendor import of OpenSSH 5.3p1
Dag-Erling Smørgrav [Thu, 1 Oct 2009 15:19:37 +0000 (15:19 +0000)]
Vendor import of OpenSSH 5.3p1

14 years agoAs a workaround, for Intel CPUs, do not use CLFLUSH in
Konstantin Belousov [Thu, 1 Oct 2009 12:52:48 +0000 (12:52 +0000)]
As a workaround, for Intel CPUs, do not use CLFLUSH in
pmap_invalidate_cache_range() when self-snoop is apparently not reported
in cpu features. We get a reserved trap when clflushing APIC registers
window.

XEN in full system virtualization mode removes self-snoop from CPU
features, making this a problem.

Tested by: csjp
Reviewed by: alc
MFC after: 3 days

14 years agoDo not dereference vp->v_mount without holding vnode lock and checking
Konstantin Belousov [Thu, 1 Oct 2009 12:50:26 +0000 (12:50 +0000)]
Do not dereference vp->v_mount without holding vnode lock and checking
that the vnode is not reclaimed.

Noted by: Igor Sysoev <is rambler-co ru>
MFC after: 1 week

14 years agoMove the annotation for vm_map_startup() immediately before the function.
Konstantin Belousov [Thu, 1 Oct 2009 12:48:35 +0000 (12:48 +0000)]
Move the annotation for vm_map_startup() immediately before the function.

MFC after: 3 days

14 years agoFix typo.
Konstantin Belousov [Thu, 1 Oct 2009 12:46:58 +0000 (12:46 +0000)]
Fix typo.

MFC after: 3 days

14 years agoFix a bad use of NULL instead of zero for int comparison. Sorry for the
Coleman Kane [Thu, 1 Oct 2009 11:52:06 +0000 (11:52 +0000)]
Fix a bad use of NULL instead of zero for int comparison. Sorry for the
breakage.

Submitted by: bz, des, onemda
MFC after: 3 days

14 years agoprint machine in kernel boot version string
Andriy Gapon [Thu, 1 Oct 2009 10:53:12 +0000 (10:53 +0000)]
print machine in kernel boot version string

Discussed with: gavin, kib, jhb
PR: kern/126926
MFC after: 2 weeks

14 years agoMFi386: revision 197653
Yoshihiro Takahashi [Thu, 1 Oct 2009 10:46:22 +0000 (10:46 +0000)]
MFi386: revision 197653

  Improve 802.11s comment.

MFC after: 1 day

14 years agostyle(9) fixes (always compare pointers to NULL)
Coleman Kane [Thu, 1 Oct 2009 02:43:51 +0000 (02:43 +0000)]
style(9) fixes (always compare pointers to NULL)

Also, the previous commit to sys/dev/if_ndis/if_ndis.c also included the
removal of a call to ndis_setstate_80211 that is no longer needed.

Submitted by: sam
MFC after: 3 days

14 years agoImprove 802.11s comment.
Rui Paulo [Thu, 1 Oct 2009 02:08:42 +0000 (02:08 +0000)]
Improve 802.11s comment.

Spotted by: dougb
MFC after: 1 day

14 years agoFix typo in the comment.
Edward Tomasz Napierala [Wed, 30 Sep 2009 18:50:50 +0000 (18:50 +0000)]
Fix typo in the comment.

14 years agoDo not hold the ACPI A/C adapter lock when changing the power profile.
John Baldwin [Wed, 30 Sep 2009 17:07:49 +0000 (17:07 +0000)]
Do not hold the ACPI A/C adapter lock when changing the power profile.

MFC after: 2 weeks

14 years agoSplit the 'video' ACPI lock up into two locks to resolve a LOR with the
John Baldwin [Wed, 30 Sep 2009 17:05:26 +0000 (17:05 +0000)]
Split the 'video' ACPI lock up into two locks to resolve a LOR with the
sysctl lock.  The 'video' lock now protects the 'bus' of video output
devices attached to a graphics adapter.  It is used when iterating over
the list of outputs, etc.  The 'video_output' lock is used to lock the
output-specific data similar to a driver lock for the individual video
outputs.

MFC after: 2 weeks

14 years agocpufunc.h: unify/correct style of c extension names
Andriy Gapon [Wed, 30 Sep 2009 16:34:50 +0000 (16:34 +0000)]
cpufunc.h: unify/correct style of c extension names

i386 and amd64 archs only.
inline => __inline. [1]
__asm__ => __asm. [2]

Reviewed by: kib, jhb [1]
Suggested by: kib [2]
MFC after: 1 week

14 years agoDon't do an IPv6 operation when the kernel doesn't have
Hajimu UMEMOTO [Wed, 30 Sep 2009 14:58:10 +0000 (14:58 +0000)]
Don't do an IPv6 operation when the kernel doesn't have
an IPv6 support.

Reported by: Alexander Best <alexbestms__at__math.uni-muenster.de>
Confirmed by: Paul B. Mahol <onemda__at__gmail.com>,
Alexander Best <alexbestms__at__math.uni-muenster.de>

14 years agoTwo more mxge watchdog fixes:
Andrew Gallatin [Wed, 30 Sep 2009 14:42:06 +0000 (14:42 +0000)]
Two more mxge watchdog fixes:

1) Restore the PCI Express control register after a watchdog
   reset.  This is required because the device will come out
   of watchdog reset with the pectl reg at its default state,
   and important BIOS configuration (like max payload size)
   could be lost.

2) Call mxge_start_locked() for every tx queue before dropping
   the lock in the watchdog handler.   This is required, as
   the queue's buf ring may have filled during the reset.

14 years agoCorrect a bug that could lead to a kernel panic if a user attempted to
Coleman Kane [Wed, 30 Sep 2009 14:28:38 +0000 (14:28 +0000)]
Correct a bug that could lead to a kernel panic if a user attempted to
perform 802.11 operations directly on the ndis0 interface before the
first VAP (wlan0) had been created. This would lead to a NULL-pointer
dereference in the kernel.

Submitted by: Paul B. Mahol <onemda@gmail.com>
MFC after: 3 days

14 years agoWhen releasing a read/shared lock we need to use a write memory barrier
Attilio Rao [Wed, 30 Sep 2009 13:26:31 +0000 (13:26 +0000)]
When releasing a read/shared lock we need to use a write memory barrier
in order to avoid, on architectures which doesn't have strong ordered
writes, CPU instructions reordering.

Diagnosed by: fabio
Reviewed by: jhb
Tested by: Giovanni Trematerra
<giovanni dot trematerra at gmail dot com>

14 years agoprint_caddr_t: drop incorrect __unused attribute from parameter
Andriy Gapon [Wed, 30 Sep 2009 11:14:13 +0000 (11:14 +0000)]
print_caddr_t: drop incorrect __unused attribute from parameter

seems like a purely cosmetic change

Reviewed by: jhb, kib
MFC after: 1 week

14 years agoFix typo in previous commit.
Alexander Motin [Wed, 30 Sep 2009 11:05:12 +0000 (11:05 +0000)]
Fix typo in previous commit.
Add Realtek ALC887 codec ID.

14 years agoRegenerate system call files following r197636.
Robert Watson [Wed, 30 Sep 2009 08:48:59 +0000 (08:48 +0000)]
Regenerate system call files following r197636.