Fix socket buffer timeouts precision using the new sbintime_t KPI instead
of relying on the tvtohz() workaround. The latter has been introduced
lately by jhb@ (r254699) in order to have a fix that can be backported
to STABLE.

Reported by:	Vitja Makarov <vitja.makarov at gmail dot com>
Reviewed by:	jhb (earlier version)


git-svn-id: svn+ssh://svn.freebsd.org/base/head@255138 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Conform to style(9).  No functional changes.

sys/x86/xen/hvm.c:
	Do not rely on implicit conversion to boolean in expressions
	(e.g. use "if (rc != 0)" instead of "if (rc)".

	Line continuations for functions are indented an additional
	4 spaces.

	Insert an empty line if the function has no local variables.

	Prefer separate initializtion statements to initialzing
	local variables in their declaration.

	Braces that are not necessary may be left out.

MFC after:	2 weeks


git-svn-id: svn+ssh://svn.freebsd.org/base/head@255139 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Merge 1.12 of pf_lb.c from OpenBSD, with some changes. Original commit:

  date: 2010/02/04 14:10:12;  author: sthen;  state: Exp;  lines: +24 -19;
  pf_get_sport() picks a random port from the port range specified in a
  nat rule. It should check to see if it's in-use (i.e. matches an existing
  PF state), if it is, it cycles sequentially through other ports until
  it finds a free one. However the check was being done with the state
  keys the wrong way round so it was never actually finding the state
  to be in-use.

  - switch the keys to correct this, avoiding random state collisions
  with nat. Fixes PR 6300 and problems reported by robert@ and viq.

  - check pf_get_sport() return code in pf_test(); if port allocation
  fails the packet should be dropped rather than sent out untranslated.

  Help/ok claudio@.

Some additional changes to 1.12:

- We also need to bzero() the key to zero padding, otherwise key
  won't match.
- Collapse two if blocks into one with ||, since both conditions
  lead to the same processing.
- Only naddr changes in the cycle, so move initialization of other
  fields above the cycle.
- s/u_intXX_t/uintXX_t/g

PR:		kern/181690
Submitted by:	Olivier Cochard-Labbé <olivier cochard.me>
Sponsored by:	Nginx, Inc.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@255143 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Make ELI destruction (including orphanization) less aggressive, making it
always wait for provider close.  Old algorithm was reported to cause NULL
dereference panic on attempt to close provider after softc destruction.
If not global workaroung in GEOM, that could even cause destruction with
requests still in flight.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@255144 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
libexecinfo compatibility with devel/libexecinfo port

1. Match shlib number
2. Add libelf dependency

Suggested by: bapt[1]


git-svn-id: svn+ssh://svn.freebsd.org/base/head@255146 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Revert accidental commit.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@255151 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
synaptics and trackpoint support are stable enough to be on by default.

Eventually both options should be removed.

Reviewed by:	dumbbell


git-svn-id: svn+ssh://svn.freebsd.org/base/head@255152 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
psm: Add support for middle and extended buttons on Synaptics touchpads

PR:		kern/170834
Submitted by:	Brandon Gooch <jamesbrandongooch@gmail.com>
Tested by:	Artyom Mirgorodskiy <artyom.mirgorodsky@gmail.com>
MFC after:	1 month


git-svn-id: svn+ssh://svn.freebsd.org/base/head@255153 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
sys/mouse.h: Move members introduced in r255153 to end of struct synapticshw

I didn't know this structure was public and didn't pay enough attention...


git-svn-id: svn+ssh://svn.freebsd.org/base/head@255154 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Ignore if the interface is not IPv6-capable.

Spotted by:	rpaulo


git-svn-id: svn+ssh://svn.freebsd.org/base/head@255156 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
sh: Fix race condition with signals and wait or set -T.

The change in r238888 was incomplete. It was still possible for a trapped
signal to arrive before the shell went to sleep (sigsuspend()) because a
check was missing or because the signal arrived before in_waitcmd was set.

On SMP, this bug sometimes caused the builtins/wait4.0 test to take 1 second
to execute; it then might or might not fail. On UP, the test almost always
failed.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@255157 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Better conformance to style(9) and organizational cleanup.
No functional changes.

sys/i386/xen/mp_machdep.c:
	Remove extra newlines.

	Group externs, forward delarations, local types, and pcpu data.

	Wrap at 80 columns.

	Use parens in return statements.

	Tab indent members of array initializers.

MFC after:	2 weeks


git-svn-id: svn+ssh://svn.freebsd.org/base/head@255158 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
All changes affect only SCTP-AUTH:
* Remove non working code related to SHA224.
* Remove support for non-standardised HMAC-IDs using SHA384 and SHA512.
* Prefer SHA256 over SHA1.
* Minor cleanup.

MFC after: 2 weeks


git-svn-id: svn+ssh://svn.freebsd.org/base/head@255160 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Whitespace cleanup.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@255161 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Use uint16_t instead of in_port_t for consistency with the SCTP code.

MFC after: 1 week


git-svn-id: svn+ssh://svn.freebsd.org/base/head@255162 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Create the default router last.  This allows using an static
interface route for default routes, which seems to be common
among many dedicated hosting providers.

Reviewed by:	hrs
MFC after:	2 weeks


git-svn-id: svn+ssh://svn.freebsd.org/base/head@255163 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Refactor PowerPC hwpmc(4) driver into generic and specific.  More refactoring
will likely be done as more drivers are added, since AIM-compatible processors
have similar PMC configuration logic.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@255164 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Enable PMC interrupt handling, and fix a DTrace trap handling bug.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@255165 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Fix unintended compiler constant folding

Pointed out by:	dim@


git-svn-id: svn+ssh://svn.freebsd.org/base/head@255166 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Complete any pending Tx frames before attempting the next transmit

Also complete pending frames in the watchdog function when the
EVENT_IDX feature was negotiated just in case the completion
interrupt was postponed.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@255167 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f