In soreceive_generic() when checking if the type of mbuf has changed
check it for MT_CONTROL type too, otherwise the assertion
"m->m_type == MT_DATA" below may be triggered by the following scenario:

- the sender sends some data (MT_DATA) and then a file descriptor
  (MT_CONTROL);
- the receiver calls recv(2) with a MSG_WAITALL asking for data larger
  than the receive buffer (uio_resid > hiwat).

MFC after:	2 week


git-svn-id: svn+ssh://svn.freebsd.org/base/head@240003 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
In soreceive_generic() remove the optimization for the case when
MSG_WAITALL is set, and it is possible to do the entire receive
operation at once if we block (resid <= hiwat). Actually it might make
the recv(2) with MSG_WAITALL flag get stuck when there is enough space
in the receiver buffer to satisfy the request but not enough to open
the window closed previously due to the buffer being full.

The issue can be reproduced using the following scenario:

On the sender side do 2 send(2) requests:

1) data of size much smaller than SOBUF_SIZE (e.g. SOBUF_SIZE / 10);
2) data of size equal to SOBUF_SIZE.

On the receiver side do 2 recv(2) requests with MSG_WAITALL flag set:

1) recv() data of SOBUF_SIZE / 10 size;
2) recv() data of SOBUF_SIZE size;

We totally fill the receiver buffer with one SOBUF_SIZE/10 size request
and partial SOBUF_SIZE request. When the first request is processed we
get SOBUF_SIZE/10 free space. It is just enough to receive the rest of
bytes for the second request, and soreceive_generic() blocks in the
part that is a subject of this change waiting for the rest. But the
window was closed when the buffer was filled and to avoid silly window
syndrome it opens only when available space is larger than sb_hiwat/4
or maxseg. So it is stuck and pending data is only sent via TCP window
probes.

Discussed with:	kib (long ago)
MFC after:	2 weeks


git-svn-id: svn+ssh://svn.freebsd.org/base/head@240004 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
- Style(9) cleanup.

Approved by:	kib (mentor)


git-svn-id: svn+ssh://svn.freebsd.org/base/head@240005 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Fix a typo which results in RTT to be off by a factor of 10, if the RTT is
larger than 1 second.

MFC after:	3 days


git-svn-id: svn+ssh://svn.freebsd.org/base/head@240007 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Partially revert r239959, after actually fixing most of the clang
warnings in sys/gnu/fs/xfs.  The only warnings that still need to be
suppressed are those about array bound overruns of flexible array
members in xfs_dir2_{block,sf}.c, which are too expensive (in terms of
cascading code changes) to fix.

MFC after:	1 week
X-MFC-With:	r239959


git-svn-id: svn+ssh://svn.freebsd.org/base/head@240011 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
- Make kern.maxtsiz, kern.dfldsiz, kern.maxdsiz, kern.dflssiz, kern.maxssiz
  and kern.sgrowsiz sysctls writable.

Approved by:	kib (mentor)


git-svn-id: svn+ssh://svn.freebsd.org/base/head@240026 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Make sure we visit both symbol sections even if one of them doesn't
exist. This makes it possible to dtrace some C++ programs like devd.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@240040 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Fix RPC headers for C++

C++ mangling will cause trouble with variables like __rpc_xdr
in xdr.h so rename this to XDR.
While here add proper C++ guards to RPC headers.

PR:		137443
MFC after:	2 weeks


git-svn-id: svn+ssh://svn.freebsd.org/base/head@240060 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Revert	r240060: (Partial)

__BEGIN_DECLS and __END_DECLS in cdefs.h take care of the
__cplusplus mangling issues so most of the definitions
were redundant.

In the few places where they were not redundant we should
use BSD style instead of the guards used upstream.

Reported by:	Yuri Pankov


git-svn-id: svn+ssh://svn.freebsd.org/base/head@240062 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Add myself to copyright sections, per CDDL license.

Requested by:	mm


git-svn-id: svn+ssh://svn.freebsd.org/base/head@240063 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Correct an error in gxemul_disk_write().  It was issuing the command to
read from rather than write to the emulated disk.

Reviewed by:	jmallett


git-svn-id: svn+ssh://svn.freebsd.org/base/head@240065 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Add kern.hintmode sysctl variable to show current state of hints:
0 - loader hints in environment only;
1 - static hints only
2 - fallback mode (Dynamic KENV with fallback to kernel environment)
Add kern.hintmode write handler, accept only value 2. That will switch
static KENV to dynamic. So it will be possible to change device hints.

Approved by:	adrian (mentor)


git-svn-id: svn+ssh://svn.freebsd.org/base/head@240067 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
- Mark some sysctls with CTLFLAG_TUN flag instead of CTLFLAG_RDTUN.

Pointed out by:	avg
Approved by:	kib (mentor)
MFC after:	1 week


git-svn-id: svn+ssh://svn.freebsd.org/base/head@240068 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
- After r240026 sgrowsiz should be used in a safer maner.

Approved by:	kib (mentor)
MCF after:	1 week


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

Approved by:	bschmidt (while mentor offline)
Pointed by:     gcooper
Pointy hat to:  ray


git-svn-id: svn+ssh://svn.freebsd.org/base/head@240070 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Change bridge(4) to use if_transmit for forwarding packets to underlying
interfaces instead of queueing.

Tested by:	ray


git-svn-id: svn+ssh://svn.freebsd.org/base/head@240071 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Explicitly document all variables in the net.link.ether.inet MIB.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@240072 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Provide a sysctl switch that allows to install ARP entries
with multicast bit set. FreeBSD refuses to install such
entries since 9.0, and this broke installations running
Microsoft NLB, which are violating standards.

Tested by:	Tarasov Oleg <oleg_tarasov sg-tea.com>


git-svn-id: svn+ssh://svn.freebsd.org/base/head@240073 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Add more DWC OTG register definitions.

Submitted by:	Nick Hudson


git-svn-id: svn+ssh://svn.freebsd.org/base/head@240074 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Upgrade OpenSSH to 6.1p1.


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