]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/log
FreeBSD/stable/10.git
7 years agoMFC r301683:
ngie [Sat, 11 Jun 2016 01:34:41 +0000 (01:34 +0000)]
MFC r301683:

Fix typo with description for $ipv6_cpe_wanif (upstram -> upstream)

PR: 210146

git-svn-id: svn://svn.freebsd.org/base/stable/10@301818 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r300301, r300319:
pfg [Fri, 10 Jun 2016 22:07:17 +0000 (22:07 +0000)]
MFC r300301, r300319:
GCC: Add support for named initializers for anonymous structs/unions.

This is a C11 feature that is starting to get used in places such as Mesa.
This implementation takes a different approach to upstream and is
therefore not covered by GPLv3.

Obtained from: OpenBSD (CVS rev. 1.2)

git-svn-id: svn://svn.freebsd.org/base/stable/10@301817 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r300333:
pfg [Fri, 10 Jun 2016 21:47:37 +0000 (21:47 +0000)]
MFC r300333:
gas: Implement the .inst assembler directive for arm.

We normally use the binutils from ports but on other systems this
is required for building gcc 4.9.

Obtained from: OpenBSD (CVS rev. 1.5)

git-svn-id: svn://svn.freebsd.org/base/stable/10@301816 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoRecord mergeinfo for all complete commits done in the ioat(4) merge
ngie [Fri, 10 Jun 2016 18:47:11 +0000 (18:47 +0000)]
Record mergeinfo for all complete commits done in the ioat(4) merge
in r300661

This will make it easier for someone to determine what's missing when
running `svn mergeinfo --show-revs eligible`

r299353 wasn't recorded intentionally because it was only a "partial"
merge

Sponsored by: EMC / Isilon Storage Division

git-svn-id: svn://svn.freebsd.org/base/stable/10@301813 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r301296,r301297,r301300:
ngie [Fri, 10 Jun 2016 18:40:03 +0000 (18:40 +0000)]
MFC r301296,r301297,r301300:

r301296 (by cem):

ioat(4): Make channel indices unsigned

r301297 (by cem):

ioat(4): Export the number of available channels

r301300 (by cem):

ioat(4): Always log capabilities on attach

Different, relatively recent Intel Xeon hardware support radically different
features.  E.g., BDX support CRC32 while BDX-DE does not.

git-svn-id: svn://svn.freebsd.org/base/stable/10@301812 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r295618,r300100,r300531:
ngie [Fri, 10 Jun 2016 18:34:31 +0000 (18:34 +0000)]
MFC r295618,r300100,r300531:

r295618 (by cem):

NTB: workaround for high traffic hardware hang

This patch comes from Dave Jiang's Linux tree, davejiang/ntb.  It hasn't
been accepted into Linus' tree, so I do not have an authoritative SHA1
to point at.  Original commit log:

=====================================================================
A hardware errata causes the NTB to hang when heavy bi-directional
traffic in addition to the usage of BAR0/1 (where the registers reside,
including the doorbell registers to trigger interrupts).

This workaround is only available on Haswell and Broadwell platform.
The workaround is to enable split BAR in the BIOS to allow the 64bit
BAR4 to be split into two 32bit BAR4 and BAR5. The BAR4 shall be pointed
to LAPIC region of the remote host. We will bypass the db mechanism and
directly trigger the MSIX interrupts. The offsets and vectors are
exchanged during transport scratch pad negotiation. The scratch pads are
now overloaded in order to allow the exchange of the information. This
gets around using the doorbell and prevents the lockup with additional
pcode changes in BIOS.

Signed-off-by: Dave Jiang <dave.jiang@intel.com>
=====================================================================

Notable changes in the FreeBSD version of this patch:
* The MSIX BAR is configurable, like hw.ntb.b2b_mw_idx (msix_mw_idx).
  The Linux version of the patch only uses BAR4.
* MSIX negotiation aborts if the link goes down.

Obtained from: Linux (Dual BSD/GPL driver)

r300100 (by cem):

ntb_hw(4): Add sysctls for administrative/test link config, state

dev.ntb_hw.0.admin_up=0/1: Like ifconfig UP/DOWN.
dev.ntb_hw.0.active=0/1:   Like ifconfig 'status'

r300531 (by cem):

ntb_hw(4): Only record the first three MSIX vectors

Don't overrun the msix_data array by reading the (unused) link state
interrupt information.

git-svn-id: svn://svn.freebsd.org/base/stable/10@301811 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r299513,r299515:
ngie [Fri, 10 Jun 2016 18:21:05 +0000 (18:21 +0000)]
MFC r299513,r299515:

r299513 (by cem):

rtadvd(8): Don't use-after-free

This whole block of code as committed fully formed in r224144.  I'm not really
sure what the intent was, but it seems plausible that !persist ifis could need
other member cleanup.  Don't free the object until after we've finished
cleaning its members.

CID: 1006079

r299515 (by cem):

rtadvd(8): Fix use-after-close in cm_handler_client

cm_send() closes 'fd' on error.  In that case, bail out early without trying to
recv from or close 'fd' again.

CID: 1006078

git-svn-id: svn://svn.freebsd.org/base/stable/10@301809 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r299511:
ngie [Fri, 10 Jun 2016 18:13:41 +0000 (18:13 +0000)]
MFC r299511:
r299511 (by cem):

print_positional_test: Fix misuse of wchar APIs

These APIs take unit length, not byte length parameters.

CIDs: 133854313385441338545

git-svn-id: svn://svn.freebsd.org/base/stable/10@301808 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r299510:
ngie [Fri, 10 Jun 2016 18:10:32 +0000 (18:10 +0000)]
MFC r299510:
r299510 (by cem):

libmp: Fix trivial buffer overrun

fgetln yields a non-NUL-terminated buffer and its length.  This routine
attempted to NUL-terminate it, but did not allocate space for the NUL.  So,
allocate space for the NUL.

CID: 1017457

git-svn-id: svn://svn.freebsd.org/base/stable/10@301806 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r299508:
ngie [Fri, 10 Jun 2016 18:07:35 +0000 (18:07 +0000)]
MFC r299508:
r299508 (by cem):

kern_descrip_test: Fix trivial buffer overrun with readlink(2)

CID: 12299651229972

git-svn-id: svn://svn.freebsd.org/base/stable/10@301805 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r299507:
ngie [Fri, 10 Jun 2016 18:02:51 +0000 (18:02 +0000)]
MFC r299507:
r299507 (by cem):

rtadvd(8): Fix a typo in full msg receive logic

Check against the size of the struct, not the pointer.  Previously, a message
with a cm_len between 9 and 23 (inclusive) could cause int msglen to underflow
and read(2) to be invoked with msglen size (implicitly cast to signed),
overrunning the caller-provided buffer.

All users of cm_recv() supply a stack buffer.

On the other hand, the rtadvd control socket appears to only be writable by the
owner, who is probably root.

While here, correct some types to be size_t or ssize_t.

CID: 1008477
Security: unix socket remotes may overflow stack in rtadvd

git-svn-id: svn://svn.freebsd.org/base/stable/10@301803 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r300836:
ngie [Fri, 10 Jun 2016 17:57:50 +0000 (17:57 +0000)]
MFC r300836:

Quell false positives in svc_vc_create and svc_vc_create_conn with cd and xprt

Both cd and xprt will be non-NULL after their respective malloc(9) wrappers are
called (mem_alloc and svc_xprt_alloc, which calls mem_alloc) as mem_alloc
always gets called with M_WAITOK|M_ZERO today. Thus, testing for them being
non-NULL is incorrect -- it misleads Coverity and it misleads the reader.

Remove some unnecessary NULL initializations as a follow up to help solidify
the fact that these pointers will be initialized properly in sys/rpc/.. with
the interfaces the way they are currently.

CID: 100733810073391007340

git-svn-id: svn://svn.freebsd.org/base/stable/10@301801 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r299503,r299504:
ngie [Fri, 10 Jun 2016 15:47:20 +0000 (15:47 +0000)]
MFC r299503,r299504:

r299503 (by cem):

snd_hda(4): Don't pass bogus sizeof()s to unused sysctl arg2 parameter

None of the sysctl handlers in hdaa use the arg2 parameter, so just pass zero
instead.  Additionally, the sizes being passed in were suspect (size of the
pointer rather than the value).

CIDs: 10076941009679

r299504 (by cem):

snd_hda(4): Don't pass bogus sizeof()s to unused sysctl arg2 parameter (again)

More of the same sort of issue as r299503, just missed some sysctls added in a
different place than the others.

CIDs: 100769210096771009678

git-svn-id: svn://svn.freebsd.org/base/stable/10@301799 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r299502:
ngie [Fri, 10 Jun 2016 15:42:17 +0000 (15:42 +0000)]
MFC r299502:
r299502 (by cem):

nss/gethostby_test: fix broken vector iteration of gethostbyaddr h_aliases

h_aliases is a NULL-terminated rather than fixed-length array.  nitems() is not
a valid way to determine its end; instead, check for NULL.

CID: 1346578

git-svn-id: svn://svn.freebsd.org/base/stable/10@301798 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r301295:
cy [Fri, 10 Jun 2016 15:03:18 +0000 (15:03 +0000)]
MFC r301295:

Enable daily_ntpd_leapfile_enable by default. Otherwise an expired
leapfile will be ignored and ntpd will behave as if it has no
leapfile.

While here, remove an extraneous blank line.

Suggested by: ache

git-svn-id: svn://svn.freebsd.org/base/stable/10@301795 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r299496:
ngie [Fri, 10 Jun 2016 14:51:11 +0000 (14:51 +0000)]
MFC r299496:
r299496 (by cem):

atf map: Fix double-free in low memory error path

If atf_list_append(, X, ) fails, X is freed.  Don't free it again.

CID: 979936

git-svn-id: svn://svn.freebsd.org/base/stable/10@301793 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r299495:
ngie [Fri, 10 Jun 2016 14:48:10 +0000 (14:48 +0000)]
MFC r299495:
r299495 (by cem):

libkrb5: Fix potential double-free

If krb5_make_principal fails, tmp_creds.server may remain a pointer to freed
memory and then be double-freed.  After freeing it the first time, initialize
it to NULL, which causes subsequent krb5_free_principal calls to do the right
thing.

CID: 1273430

git-svn-id: svn://svn.freebsd.org/base/stable/10@301792 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r299494:
ngie [Fri, 10 Jun 2016 14:45:20 +0000 (14:45 +0000)]
MFC r299494:
r299494 (by cem):

subr_vmem: Fix double-free in error case of vmem_create

If vmem_init() fails, 'vm' is already destroyed and freed.  Don't free it
again.

CID: 1042110

git-svn-id: svn://svn.freebsd.org/base/stable/10@301791 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r299491:
ngie [Fri, 10 Jun 2016 14:40:41 +0000 (14:40 +0000)]
MFC r299491:
r299491 (by cem):

route6d(8): Fix potential double-free

In the case that the subsequent sysctl(3) call failed, 'buf' could be free(3)ed
repeatedly.  It isn't clear to me that that case is possible, but be clear and
do the right thing in case it is.

CID: 272537

git-svn-id: svn://svn.freebsd.org/base/stable/10@301789 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r299490:
ngie [Fri, 10 Jun 2016 14:33:21 +0000 (14:33 +0000)]
MFC r299490:
r299490 (by cem):

camcontrol(8): Fix another trivial double-free

CID: 1331222

git-svn-id: svn://svn.freebsd.org/base/stable/10@301788 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r299489:
ngie [Fri, 10 Jun 2016 14:31:03 +0000 (14:31 +0000)]
MFC r299489:
r299489 (by cem):

camcontrol(8): Fix trival double-free

CID: 1331223

git-svn-id: svn://svn.freebsd.org/base/stable/10@301786 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r299461:
ngie [Fri, 10 Jun 2016 14:13:24 +0000 (14:13 +0000)]
MFC r299461:
r299461 (by cem):

ffs_bswap: Copy one UFS dinode member at a time

No functional change.

CIDs: 974635, 974636, 977396, 977397, 977398, 977399

git-svn-id: svn://svn.freebsd.org/base/stable/10@301784 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r299460:
ngie [Fri, 10 Jun 2016 14:08:41 +0000 (14:08 +0000)]
MFC r299460:
r299460 (by cem):

fsck_ffs: Don't overrun mount device buffer

Maybe this case is impossible.  Either way, when attempting to "/dev/"-prefix a
non-global device name, check that we do not overrun the f_mntfromname buffer.

In this case, truncating (with strlcpy or similar) would not be useful, since
the f_mntfromname result of getmntpt() is passed directly to open(2) later.

CID: 1006789

git-svn-id: svn://svn.freebsd.org/base/stable/10@301782 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r299387:
ngie [Fri, 10 Jun 2016 13:57:56 +0000 (13:57 +0000)]
MFC r299387:
r299387 (by cem):

netipsec: Fix minor style nit

Coverity points out that 'continue' is equivalent to 'break' in a do {}
while(false) loop.

CID: 1354983

git-svn-id: svn://svn.freebsd.org/base/stable/10@301780 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r301278
kib [Fri, 10 Jun 2016 04:04:55 +0000 (04:04 +0000)]
MFC r301278
Reduce number of iterations used for calibrating ICR read loop.

MFC r301279:
Record correct commit message for r301278.

git-svn-id: svn://svn.freebsd.org/base/stable/10@301776 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r300779, r300781, r300783, r300784, r300949, r301162, r301180
truckman [Fri, 10 Jun 2016 00:00:25 +0000 (00:00 +0000)]
MFC r300779, r300781, r300783, r300784, r300949, r301162, r301180

r300779 | truckman | 2016-05-26 14:40:13 -0700 (Thu, 26 May 2016) | 64 lines

Import Dummynet AQM version 0.2.1 (CoDel, FQ-CoDel, PIE and FQ-PIE).

Centre for Advanced Internet Architectures

Implementing AQM in FreeBSD

* Overview <http://caia.swin.edu.au/freebsd/aqm/index.html>

* Articles, Papers and Presentations
  <http://caia.swin.edu.au/freebsd/aqm/papers.html>

* Patches and Tools <http://caia.swin.edu.au/freebsd/aqm/downloads.html>

Overview

Recent years have seen a resurgence of interest in better managing
the depth of bottleneck queues in routers, switches and other places
that get congested. Solutions include transport protocol enhancements
at the end-hosts (such as delay-based or hybrid congestion control
schemes) and active queue management (AQM) schemes applied within
bottleneck queues.

The notion of AQM has been around since at least the late 1990s
(e.g. RFC 2309). In recent years the proliferation of oversized
buffers in all sorts of network devices (aka bufferbloat) has
stimulated keen community interest in four new AQM schemes -- CoDel,
FQ-CoDel, PIE and FQ-PIE.

The IETF AQM working group is looking to document these schemes,
and independent implementations are a corner-stone of the IETF's
process for confirming the clarity of publicly available protocol
descriptions. While significant development work on all three schemes
has occured in the Linux kernel, there is very little in FreeBSD.

Project Goals

This project began in late 2015, and aims to design and implement
functionally-correct versions of CoDel, FQ-CoDel, PIE and FQ_PIE
in FreeBSD (with code BSD-licensed as much as practical). We have
chosen to do this as extensions to FreeBSD's ipfw/dummynet firewall
and traffic shaper. Implementation of these AQM schemes in FreeBSD
will:
* Demonstrate whether the publicly available documentation is
  sufficient to enable independent, functionally equivalent implementations

* Provide a broader suite of AQM options for sections the networking
  community that rely on FreeBSD platforms

Program Members:

* Rasool Al Saadi (developer)

* Grenville Armitage (project lead)

Acknowledgements:

This project has been made possible in part by a gift from the
Comcast Innovation Fund.

Submitted by: Rasool Al-Saadi <ralsaadi@swin.edu.au>
X-No objection: core
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D6388

[Remove some code that was added to the mq_append() inline function in
HEAD by r258457, which was not merged to stable/10.  The AQM patch
moved mq_append() from ip_dn_io.c to the new file ip_dn_private.h, so
we need to remove that copy of the r258457 changes.]
------------------------------------------------------------------------
r300781 | truckman | 2016-05-26 14:44:52 -0700 (Thu, 26 May 2016) | 7 lines

Modify BOUND_VAR() macro to wrap all of its arguments in () and tweak
its expression to work on powerpc and sparc64 (gcc compatibility).

Correct a typo in a nearby comment.

MFC after: 2 weeks (with r300779)

------------------------------------------------------------------------
r300783 | truckman | 2016-05-26 15:03:28 -0700 (Thu, 26 May 2016) | 4 lines

Correct a typo in a comment.

MFC after: 2 weeks (with r300779)

------------------------------------------------------------------------
r300784 | truckman | 2016-05-26 15:07:09 -0700 (Thu, 26 May 2016) | 5 lines

Include the new AQM files when compiling a kernel with options DUMMYNET.

Reported by: Nikolay Denev <nike_d AT cytexbg DOT com>
MFC after: 2 weeks (with r300779)

------------------------------------------------------------------------
r300949 | truckman | 2016-05-29 00:23:56 -0700 (Sun, 29 May 2016) | 10 lines

Cast some expressions that multiply a long long constant by a
floating point constant to int64_t.  This avoids the runtime
conversion of the the other operand in a set of comparisons from
int64_t to floating point and doing the comparisions in floating
point.

Suggested by: lidl
Submitted by: Rasool Al-Saadi <ralsaadi@swin.edu.au>
MFC after: 2 weeks (with r300779)

------------------------------------------------------------------------
r301162 | truckman | 2016-06-01 13:04:24 -0700 (Wed, 01 Jun 2016) | 9 lines

Replace constant expressions that contain multiplications by
fractional floating point values with integer divides.  This will
eliminate any chance that the compiler will generate code to evaluate
the expression using floating point at runtime.

Suggested by: bde
Submitted by: Rasool Al-Saadi <ralsaadi@swin.edu.au>
MFC after: 8 days (with r300779 and r300949)

------------------------------------------------------------------------
r301180 | truckman | 2016-06-01 17:42:15 -0700 (Wed, 01 Jun 2016) | 2 lines

Belatedly bump .Dd date for Dummynet AQM import in r300779.

Relnotes: yes

git-svn-id: svn://svn.freebsd.org/base/stable/10@301772 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r301513:
pfg [Thu, 9 Jun 2016 16:29:19 +0000 (16:29 +0000)]
MFC r301513:
indent(1): Fix old typo.

It's typedef, not typdef.

Obtained from: NetBSD (CVS rev. 1.14)

git-svn-id: svn://svn.freebsd.org/base/stable/10@301743 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r301465:
bdrewery [Thu, 9 Jun 2016 15:43:00 +0000 (15:43 +0000)]
MFC r301465:

  Fix bmake version upgrade logic to use the new bmake.

The '${WANT_MAKE} != "bmake"' logic seems wrong but is not being modified.

git-svn-id: svn://svn.freebsd.org/base/stable/10@301738 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r300870,r300884:
ngie [Wed, 8 Jun 2016 20:47:25 +0000 (20:47 +0000)]
MFC r300870,r300884:

r300870:

Unbreak the zfs(4) build

vm/vm_pageout.h grew a dependency on the bool typedef in r300865

arc.c didn't include sys/types.h, which included the definition for the typedef

Other items (ofed, drm2) might need to be chased for this commit.

Pointyhat to: alc

r300884:

Fix up r300870

The sys/types.h fix I proposed was only tested with zfs(4), not with
libzpool, which is where the build failure actually existed

Remove vm/vm_pageout.h from arc.c and zfs_vnops.c because they're both
unneeded

In collaboration with: kib

git-svn-id: svn://svn.freebsd.org/base/stable/10@301695 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r300624:
ngie [Wed, 8 Jun 2016 18:46:10 +0000 (18:46 +0000)]
MFC r300624:

Fix up r300385

I accidentally glossed over the fact that tmp is manipulated via strchr, so
if we tried to free `tmp` after r300385, it would have crashed.

Create a separate pointer (tmp2) to track the original allocation of `tmp`,
and free `tmp2` if `p->nc_lookups` can't be malloced

CID: 1356026

git-svn-id: svn://svn.freebsd.org/base/stable/10@301687 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r300385:
ngie [Wed, 8 Jun 2016 18:41:49 +0000 (18:41 +0000)]
MFC r300385:

Don't leak `tmp` if `p->nc_lookups` can't be malloced

git-svn-id: svn://svn.freebsd.org/base/stable/10@301684 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r300386:
ngie [Wed, 8 Jun 2016 18:27:44 +0000 (18:27 +0000)]
MFC r300386:

Don't leak `handle` if svc_tp_create(..) succeeds and allocating a new
struct xlist object fails

CID: 978277

git-svn-id: svn://svn.freebsd.org/base/stable/10@301682 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r300625:
ngie [Wed, 8 Jun 2016 18:22:54 +0000 (18:22 +0000)]
MFC r300625:

Remove unnecessary memset(.., 0, ..)'s

The mem_alloc macro calls calloc (userspace) / malloc(.., M_WAITOK|M_ZERO)
under the covers, so zeroing out memory is already handled by the underlying
calls

git-svn-id: svn://svn.freebsd.org/base/stable/10@301680 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r300861,r300862:
ngie [Wed, 8 Jun 2016 18:21:25 +0000 (18:21 +0000)]
MFC r300861,r300862:

r300861:

- Sort make variables
- Use SRCTOP instead of ad hoc definition for it

r300862:

Install ioatcontrol to /usr/bin by default instead of /

git-svn-id: svn://svn.freebsd.org/base/stable/10@301678 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r300856,r300857,r300858,r300874:
ngie [Wed, 8 Jun 2016 18:19:34 +0000 (18:19 +0000)]
MFC r300856,r300857,r300858,r300874:

r300856:

Initialize `t` with memset(.., 0, ..)

This will help ensure that we're not using random garbage on the stack by
accident with respect to the variable

r300857:

Document the default behavior for -c (0)

Bump .Dd for the change

r300858:

Fix description for -V in the -r case

t.verify_test = true is always set when -V is specified, regardless of whether
or not the tool is being run in raw mode

r300874:

Update usage(..)

- Document missing options
- Sync options with ioatcontrol(8).
- Make it clear that the first 2 parameters are always required.

git-svn-id: svn://svn.freebsd.org/base/stable/10@301677 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r300714:
ngie [Wed, 8 Jun 2016 18:15:51 +0000 (18:15 +0000)]
MFC r300714:

The readme provides a high-level overview of how to upgrade top(1).

Reviewed By: ngie

git-svn-id: svn://svn.freebsd.org/base/stable/10@301675 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r299699:
ngie [Wed, 8 Jun 2016 18:14:06 +0000 (18:14 +0000)]
MFC r299699:

Remove NO_WERROR from libbsnmp/Makefile.inc

This has been compiling without warnings with clang/gcc for a while now

Tested with: clang 3.8.0, gcc 4.2.x, gcc 5.x

git-svn-id: svn://svn.freebsd.org/base/stable/10@301673 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r299815:
ngie [Wed, 8 Jun 2016 18:08:06 +0000 (18:08 +0000)]
MFC r299815:

Remove NO_WERROR.clang from this Makefile

This compiles with clang without warnings

git-svn-id: svn://svn.freebsd.org/base/stable/10@301671 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r299806:
ngie [Wed, 8 Jun 2016 18:05:52 +0000 (18:05 +0000)]
MFC r299806:

Bump WARNS to 6

git-svn-id: svn://svn.freebsd.org/base/stable/10@301669 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r299834:
ngie [Wed, 8 Jun 2016 17:59:21 +0000 (17:59 +0000)]
MFC r299834:

Fix .Dd

Today is the 14th, not the 10th of May

git-svn-id: svn://svn.freebsd.org/base/stable/10@301667 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r294507,r294567,r299466:
ngie [Wed, 8 Jun 2016 17:49:03 +0000 (17:49 +0000)]
MFC r294507,r294567,r299466:

r294507 (by harti):

Fill the ifAlias leaf of the ifXTable with the interface description
if there is one available and it fits into the maximum size (64 characters).

r294567 (by bz):

Change the variable to a #define in order to make gcc happy which
otherwise will complain about "variably modified 'alias' at file scope".
Unbreaks the build on gcc platforms.

r299466 (by cem):

bsnmpd: Fix size of trapsink::comm to match other community arrays

This fixes a number of possible strcpy() buffer overruns between the various
community strings in trap.c.

CIDs: 100682010068211006822

git-svn-id: svn://svn.freebsd.org/base/stable/10@301663 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r256678,r256680,r260986,r272878,r286402:
ngie [Wed, 8 Jun 2016 17:43:04 +0000 (17:43 +0000)]
MFC r256678,r256680,r260986,r272878,r286402:

r256678 (by syrinx):

Fix SNMP Error response PDUs and properly encode them when using v3 auth/encryption.

r256680 (by syrinx):

Fix the -Wconversion warnings produced when compiling the SNMP agent.

r260986 (by harti):

Fix a problem with OBJECT IDENTIFIER encoding: need to check the
second subid to be less than 40, not the first when the first
subid is 0 or 1.

r272878 (by syrinx):

Fix a bug in decoding string indexes in snmp_target(3), thus causing
bsnmpd(1) to not send v3 notifications properly; while here add two
missing return statements which could lead to abort() in case of a
rollback

r286402 (by araujo):

Fix variable 'old' is used uninitialized whenever '&&' condition is false.
Spotted by clang.

git-svn-id: svn://svn.freebsd.org/base/stable/10@301661 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r299701:
ngie [Wed, 8 Jun 2016 17:34:37 +0000 (17:34 +0000)]
MFC r299701:

Move _bsnmptools_debug extern from bsnmpmap.c to bsnmptools.h

It was used in bsnmpmap.c but was stored in bsnmptools.c; moving the extern
to the header allows us to cover all of our bases for the variable, and allows
_bsnmptools_debug to be used in the future elsewhere -- not just bsnmpmap.c.

git-svn-id: svn://svn.freebsd.org/base/stable/10@301657 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r299778:
ngie [Wed, 8 Jun 2016 17:32:41 +0000 (17:32 +0000)]
MFC r299778:

Use a consistent errno save/restore pattern before running strtoul

- Save errno
- Set errno to 0
- Call strtoul
- Test errno (optional, but many calls to strtoul did this afterwards)

Some of the code was setting errno = 0 after calling strtoul, not setting
errno = 0, or setting errno to saved_errno after the call, but before the
test. These all have unwanted behavioral side-effects, depending on the
initial value of errno and whether or not the input to strtoul was correct
or incorrect.

git-svn-id: svn://svn.freebsd.org/base/stable/10@301656 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r299766:
ngie [Wed, 8 Jun 2016 17:30:29 +0000 (17:30 +0000)]
MFC r299766:

Fix logically dead code pointed out by clang/Coverity

parse_context, parse_user_security: test for validity of results from
parse_ascii(..) with by casting to int32_t and comparing to -1; comparing
unsigned types to negative values will always be false.

CID: 10114321011433

git-svn-id: svn://svn.freebsd.org/base/stable/10@301655 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r299810:
ngie [Wed, 8 Jun 2016 17:27:38 +0000 (17:27 +0000)]
MFC r299810:

Correct function names that failed in error messages

It should be calloc/strdup, not malloc

git-svn-id: svn://svn.freebsd.org/base/stable/10@301653 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r300947:
ngie [Wed, 8 Jun 2016 17:13:28 +0000 (17:13 +0000)]
MFC r300947:

Staticize variables only used in rpcbind.c

This is some low hanging fruit necessary for making this WARNS?= 6 clean

git-svn-id: svn://svn.freebsd.org/base/stable/10@301648 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r300945:
ngie [Wed, 8 Jun 2016 17:11:42 +0000 (17:11 +0000)]
MFC r300945:

Remove unnecessary caller_uaddr != NULL test before calling free on it

git-svn-id: svn://svn.freebsd.org/base/stable/10@301646 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r300942:
ngie [Wed, 8 Jun 2016 17:09:47 +0000 (17:09 +0000)]
MFC r300942:

Remove a useless if (x != NULL) check before calling free on allocated_uaddr

git-svn-id: svn://svn.freebsd.org/base/stable/10@301644 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r300867,r300932,r300934,r300941,r300972,r300973:
ngie [Wed, 8 Jun 2016 15:41:39 +0000 (15:41 +0000)]
MFC r300867,r300932,r300934,r300941,r300972,r300973:

r300867:

Only expose `hint_uaddr` in the ND_DEBUG case

This fixes a -Wunused-but-set-variable warning with gcc

r300932:

Catch malloc(3) errors and socket(2) errors

- malloc failing will result in a delayed segfault
- socket failing will result in delayed failures with setsockopt

Exit in the event that either of these high-level conditions are met.

CID: 976288, 976321, 976858

r300934:

Plug leak with ifp by calling freeifaddrs after calling getifaddrs

Obtained from: NetBSD v1.18

r300941:

Don't leak res in network_init(..)

Call freeaddrinfo on it after it's been used

CID: 1225050

r300972 (by markj):

Fix rpcbind init after r300941.

- getaddrinfo() sets res = NULL on failure and freeaddrinfo() always
  dereferences its argument, so we should only free the address list after
  a successful call.
- Address a second potential leak caused by getaddrinfo(AF_INET6)
  overwriting the address list returned by getaddrinfo(AF_INET).

X-MFC-With: r300941

r300973:

Follow up to r300932

In the event MK_INET6 != no in userspace, but is disabled in the
kernel, or if there aren't any IPv6 addresses configured in userspace
(for lo0 and all physical interfaces), rpcbind would terminate
immediately instead of silently failing on

Skip over the IPv6 block to its respective cleanup with freeifaddrs if
creating the socket failed instead of terminating rpcbind immediately

git-svn-id: svn://svn.freebsd.org/base/stable/10@301636 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r300387,r300388,r300389:
ngie [Wed, 8 Jun 2016 14:18:47 +0000 (14:18 +0000)]
MFC r300387,r300388,r300389:

r300387:

getnetid(..): consistently fclose fd at the end of the function

This mutes a false positive with cppcheck, but also helps eliminate future
potential issues with this variable

r300388:

Call endnetconfig on nc_handle sooner to avoid leaking nc_handle if tmpnconf
was NULL

This would theoretically happen if the netconfig protocol family and protocol
semantics were never matched.

CID: 978179

r300389:

nis_rpcent: don't leak resultbuf from yp_first(..)/yp_next(..)

If the buffer couldn't be adequately resized to accomodate an additional "\n",
it would leak resultbuf by breaking from the loop early

CID: 1016702

git-svn-id: svn://svn.freebsd.org/base/stable/10@301629 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r300939:
ngie [Wed, 8 Jun 2016 14:07:43 +0000 (14:07 +0000)]
MFC r300939:

Use require.progs with bc instead of require.files with /usr/bin/bc

This will make things more flexible if the program path changes in the future,
and the test in and of itself doesn't call /usr/bin/bc -- it just calls bc

git-svn-id: svn://svn.freebsd.org/base/stable/10@301627 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r300938:
ngie [Wed, 8 Jun 2016 14:06:34 +0000 (14:06 +0000)]
MFC r300938:

Remove the sa(8) tests if MK_ACCT == no when "make delete-old" is run

sa(8) is conditionally installed based on MK_ACCT != no today

git-svn-id: svn://svn.freebsd.org/base/stable/10@301626 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r300937:
ngie [Wed, 8 Jun 2016 14:05:08 +0000 (14:05 +0000)]
MFC r300937:

Remove the etcupdate tests if MK_RCS == no when "make delete-old" is run

etcupdate is conditionally installed based on MK_RCS != no today

git-svn-id: svn://svn.freebsd.org/base/stable/10@301625 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r300936:
ngie [Wed, 8 Jun 2016 14:01:42 +0000 (14:01 +0000)]
MFC r300936:

Remove the calendar tests if MK_CALENDAR == no when "make delete-old"
is run

git-svn-id: svn://svn.freebsd.org/base/stable/10@301623 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r300620,r300621:
ngie [Wed, 8 Jun 2016 13:58:47 +0000 (13:58 +0000)]
MFC r300620,r300621:

r300620:

Use reallocf instead of malloc to fix leak with outbuf_pmap

The previous code overwrote outbuf_pmap's memory with malloc once per
loop iteration, which leaked its memory; use reallocf instead to ensure
that memory is properly free'd each loop iteration.

Add a outbuf_pmap = NULL in the failure case to avoid a double-free
at the bottom of the function.

CID: 1038776

r300621:

Remove redundant NULLing of outbuf_pmap

If reallocf ever failed, outbuf_pmap would already be NULL

git-svn-id: svn://svn.freebsd.org/base/stable/10@301622 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r300430:
ngie [Wed, 8 Jun 2016 13:49:59 +0000 (13:49 +0000)]
MFC r300430:

Wrap EXPAND(..) macro with a do-while(0) loop and put a single statement on each line

As a positive side-effect, this eliminates the double semicolons reported by Coverity:
the macro contained a trailing semicolon, in addition to the semicolon placed on
each line where EXPAND(..) was called.

CID: 1194269

git-svn-id: svn://svn.freebsd.org/base/stable/10@301619 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r300428:
ngie [Wed, 8 Jun 2016 13:44:01 +0000 (13:44 +0000)]
MFC r300428:

Fix humanized decoding of struct stat with respect to .st_mtim

st_mtim was being incorrectly described as "stime=", not "mtime=". This was
introduced with the original feature commit (r176471).

PR: 209699

git-svn-id: svn://svn.freebsd.org/base/stable/10@301617 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r299844,r300931:
ngie [Wed, 8 Jun 2016 13:40:07 +0000 (13:40 +0000)]
MFC r299844,r300931:

r299844:

Make hostid_save depend on hostid

r300931:

Make netif REQUIRE hostid

As noted in the PR, if etc/rc.d/zvol is removed, netif will be run before
hostid, and the MAC address generated for any bridge devices will be
non-deterministic. Make the MAC address generated be deterministic for
bridge devices by explicitly REQUIRE'ing hostid.

This fixes up the rest of the PR, inadvertently committed in r299844

PR: 195188

git-svn-id: svn://svn.freebsd.org/base/stable/10@301615 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r299843:
ngie [Wed, 8 Jun 2016 13:34:52 +0000 (13:34 +0000)]
MFC r299843:

Fix broken dependency with routed when MK_ROUTED != no

Remove routed as a requirement in NETWORKING, and put it in routed as a BEFORE
requirement instead

git-svn-id: svn://svn.freebsd.org/base/stable/10@301613 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r299839,r299840,r299841:
ngie [Wed, 8 Jun 2016 13:32:00 +0000 (13:32 +0000)]
MFC r299839,r299840,r299841:

r299839:

Make FILESYSTEMS, dumpon, and var not depend on zfs and zvol

Make zfs and zvol come before all of the items that depended on them
previously

r299840:

Conditionalize etc/rc.d/{zfs,zvol} install on MK_ZFS != no

r299841:

Remove etc/rc.d/{zfs,zvol} if MK_ZFS != no

git-svn-id: svn://svn.freebsd.org/base/stable/10@301612 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r299833:
ngie [Wed, 8 Jun 2016 13:24:42 +0000 (13:24 +0000)]
MFC r299833:

Fix fully canonicalized example for `myvariable.27...`

`6` doesn't occur in the OID; it was spurious

Bump .Dd for the change

git-svn-id: svn://svn.freebsd.org/base/stable/10@301610 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r299657:
ngie [Wed, 8 Jun 2016 13:21:17 +0000 (13:21 +0000)]
MFC r299657:

Include arpa/inet.h to get the htonl(3) definition

git-svn-id: svn://svn.freebsd.org/base/stable/10@301608 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r300691:
kib [Wed, 8 Jun 2016 04:49:20 +0000 (04:49 +0000)]
MFC r300691:
Fix issues found by Coverity in the rtld-elf.c:gethints().

git-svn-id: svn://svn.freebsd.org/base/stable/10@301581 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r301102:
cy [Wed, 8 Jun 2016 03:08:37 +0000 (03:08 +0000)]
MFC r301102:

Don't rely on $ntpd_enable to periodically fetch the latest leapfile.

Suggested by: cperciva

git-svn-id: svn://svn.freebsd.org/base/stable/10@301577 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r301139
truckman [Wed, 8 Jun 2016 01:17:22 +0000 (01:17 +0000)]
MFC r301139

The (i < PROMPTLEN - 1) test added by r300442 in the code for the default
case of \c in the prompt format string is a no-op.  We already passed
this test at the top of the loop, and i has not yet been incremented in
this path.  Change this test to (i < PROMPTLEN - 2).

Reported by: Coverity
CID: 1008328
Reviewed by: cem
Differential Revision: https://reviews.freebsd.org/D6552

git-svn-id: svn://svn.freebsd.org/base/stable/10@301571 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r300564
truckman [Tue, 7 Jun 2016 16:56:15 +0000 (16:56 +0000)]
MFC r300564

Fix CID 1006692 in /usr/sbin/pw pw_log() function and other fixes

The length of the name returned from the $LOGNAME and $USER can be
very long and it was being concatenated to a fixed length buffer
with no bounds checking.  Fix this problem by limiting the length
of the name copied.

Additionally, this name is actually used to create a format string
to be used in adding log file entries so embedded % characters in
the name could confuse *printf(), and embedded whitespace could
confuse a log file parser.  Handle the former by escaping each %
with an additional %, and handle the latter by simply stripping it
out.

Clean up the code by moving the variable declarations to the top
of the function, formatting them to conform with style, and moving
intialization elsewhere.

Reduce code indentation by returning early in a couple of places.

Reported by: Coverity
CID: 1006692
Reviewed by: markj (previous version)
Differential Revision: https://reviews.freebsd.org/D6490

git-svn-id: svn://svn.freebsd.org/base/stable/10@301557 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r299921
truckman [Tue, 7 Jun 2016 16:53:05 +0000 (16:53 +0000)]
MFC r299921

Add an assertion to catch a potential underflow in an array index
calculation, though this should not happen in the current code.

Reported by: Coverity
CID: 1008486

git-svn-id: svn://svn.freebsd.org/base/stable/10@301556 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r301235:
pfg [Mon, 6 Jun 2016 13:31:28 +0000 (13:31 +0000)]
MFC r301235:
dhclient(1): correct obvious mismatch in get_char().

Correct switch between current and previous line buffers when
encountering a carriage return in the input.

CID: 1305719
Obtained from: OpenBSD (CVS rev. 1.30)

git-svn-id: svn://svn.freebsd.org/base/stable/10@301506 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoFix missing svn:mergeinfo from r301101.
gjb [Mon, 6 Jun 2016 11:10:37 +0000 (11:10 +0000)]
Fix missing svn:mergeinfo from r301101.

Sponsored by: The FreeBSD Foundation

git-svn-id: svn://svn.freebsd.org/base/stable/10@301501 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r297052:
grembo [Mon, 6 Jun 2016 11:08:05 +0000 (11:08 +0000)]
MFC r297052:

Update fetch.1 and fetch.3 to reflect libfetch's actual use of CA bundles

git-svn-id: svn://svn.freebsd.org/base/stable/10@301500 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r301203
kadesai [Mon, 6 Jun 2016 07:10:38 +0000 (07:10 +0000)]
MFC r301203

r301203: Added support for Avago/Broadcom Cutlass(12 Gbps- 16 port count) controllers.

Sponsored by:   AVAGO Technologies/Broadcom Limited

git-svn-id: svn://svn.freebsd.org/base/stable/10@301486 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC: r301115
ache [Sun, 5 Jun 2016 18:11:52 +0000 (18:11 +0000)]
MFC: r301115

Don't use fixup for C99 and up, the compiler result is already correct.

Suggested by: bde

git-svn-id: svn://svn.freebsd.org/base/stable/10@301459 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC: r301448
ache [Sun, 5 Jun 2016 16:21:53 +0000 (16:21 +0000)]
MFC: r301448

Reflect error indication according to POSIX and what those functions
currently do.

git-svn-id: svn://svn.freebsd.org/base/stable/10@301454 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r301206:
pfg [Sun, 5 Jun 2016 15:03:55 +0000 (15:03 +0000)]
MFC r301206:
usb/uhso: Don't bail out on first USB error.

CID: 1305680
Submitted by: hselasky
MFC after: 3 days

git-svn-id: svn://svn.freebsd.org/base/stable/10@301446 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC: r300956
ache [Sun, 5 Jun 2016 14:31:36 +0000 (14:31 +0000)]
MFC: r300956

1) Unifdef USE_WEAK_SEEDING since it is too obsolete to support and makes
reading hard.

2) Instead of doing range transformation in each and every function here,
do it single time directly in do_rand(). One "mod" operation overhead is not
a big deal, but the code looks nicer and possible future functions additions
or PRNG change do not miss range transformations neither have unneeded ones.

3) Use POSIX argument types for visible functions (cosmetic).

git-svn-id: svn://svn.freebsd.org/base/stable/10@301445 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoPrepare for merge of r300956. One year old r288030 which fix prototypes
ache [Sun, 5 Jun 2016 14:04:54 +0000 (14:04 +0000)]
Prepare for merge of r300956. One year old r288030 which fix prototypes
can't be merged without conflicts and require merging of other versions
too and I don't want to go deep in that unmerged commits chain.

git-svn-id: svn://svn.freebsd.org/base/stable/10@301444 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC: r300953
ache [Sun, 5 Jun 2016 13:39:31 +0000 (13:39 +0000)]
MFC: r300953

1) Unifdef USE_WEAK_SEEDING it is too obsolete to support and makes reading
harder.

2) ACM paper require seed to be in [1, 2^31-2] range, so use the same range
shifting as already done for rand(3). Also protect srandomdev() + TYPE_0 case
(non default) from negative seeds.

3) Don't check for valid "type" range in setstate(), it is always valid as
calculated. Instead add a check that rear pointer not exceeed end pointer.

MFC: r300965

Micro optimize: C standard guarantees that right shift for unsigned value
fills left bits with zero, and we have exact 32bit unsigned value
(uint32_t), so there is no reason to add "& 0x7fffffff" here.

git-svn-id: svn://svn.freebsd.org/base/stable/10@301443 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r300429:
dchagin [Sun, 5 Jun 2016 10:48:27 +0000 (10:48 +0000)]
MFC r300429:

Remove a now unused global declaration of some sysentvec struct.

git-svn-id: svn://svn.freebsd.org/base/stable/10@301441 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r300959:
kib [Sun, 5 Jun 2016 08:42:33 +0000 (08:42 +0000)]
MFC r300959:
Do not leak the vm object lock when swap reservation failed, in
vm_object_coalesce().

git-svn-id: svn://svn.freebsd.org/base/stable/10@301436 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r300431:
dchagin [Sun, 5 Jun 2016 07:43:20 +0000 (07:43 +0000)]
MFC r300431:

Convert proto family in both directions. The linux and native values for
local and inet are identical, but for inet6 values differ.

PR: 155040
Reported by: Simon Walton

git-svn-id: svn://svn.freebsd.org/base/stable/10@301431 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r300569:
dchagin [Sun, 5 Jun 2016 07:40:12 +0000 (07:40 +0000)]
MFC r300569:

Don't leak fp in case where fo_ioctl() returns an error.

Reported by: C Turt <ecturt@gmail.com>

git-svn-id: svn://svn.freebsd.org/base/stable/10@301430 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r300416:
dchagin [Sun, 5 Jun 2016 07:38:56 +0000 (07:38 +0000)]
MFC r300416:

Add a missing errno translation for SO_ERROR optname.

PR: 135458
Reported by: Stefan Schmidt

git-svn-id: svn://svn.freebsd.org/base/stable/10@301429 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r300415:
dchagin [Sun, 5 Jun 2016 07:34:10 +0000 (07:34 +0000)]
MFC r300415:

Add macro to convert errno and use it when appropriate.

git-svn-id: svn://svn.freebsd.org/base/stable/10@301428 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r300413:
dchagin [Sun, 5 Jun 2016 06:06:55 +0000 (06:06 +0000)]
MFC r300413:

Due to lack the priority propagation feature replace sx by mutex. WIth this
commit NPTL tests are ends in 1 minute faster.

MFC r300414:

For future use move futex timeout code to the separate function and
switch to the high resolution sbintime_t.

git-svn-id: svn://svn.freebsd.org/base/stable/10@301426 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r300412:
dchagin [Sun, 5 Jun 2016 06:04:25 +0000 (06:04 +0000)]
MFC r300412:

Add my copyright as I rewrote most of the futex code. Minor style(9) cleanup
while here.

git-svn-id: svn://svn.freebsd.org/base/stable/10@301425 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r300411:
dchagin [Sun, 5 Jun 2016 06:02:37 +0000 (06:02 +0000)]
MFC r300411:

Minor style(9) cleanup, no functional changes.

git-svn-id: svn://svn.freebsd.org/base/stable/10@301424 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r300359, r300360:
dchagin [Sun, 5 Jun 2016 05:49:33 +0000 (05:49 +0000)]
MFC r300359, r300360:

Correct an argument param of linux_sched_* system calls as a struct l_sched_param
does not defined due to it's nature.

git-svn-id: svn://svn.freebsd.org/base/stable/10@301422 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r300341:
bdrewery [Sat, 4 Jun 2016 17:40:23 +0000 (17:40 +0000)]
MFC r300341:

  FTS: Remove stale reference to nfs4 fs which was removed in r192578.

git-svn-id: svn://svn.freebsd.org/base/stable/10@301405 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r300849
arybchik [Sat, 4 Jun 2016 17:24:10 +0000 (17:24 +0000)]
MFC r300849

sfxge(4): fix typo in monitor types strings in common code

Submitted by:   Garrett D'Amore <garrett at damore.org>
Sponsored by:   Solarflare Communications, Inc.

git-svn-id: svn://svn.freebsd.org/base/stable/10@301401 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r300848
arybchik [Sat, 4 Jun 2016 17:23:08 +0000 (17:23 +0000)]
MFC r300848

sfxge(4): avoid necessity to add one more constant condition note

Use for forever loop instead of while.

Found by lint on illumos.

Submitted by:   Garrett D'Amore <garrett at damore.org>
Sponsored by:   Solarflare Communications, Inc.

git-svn-id: svn://svn.freebsd.org/base/stable/10@301400 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r300847
arybchik [Sat, 4 Jun 2016 17:22:10 +0000 (17:22 +0000)]
MFC r300847

sfxge(4): cope with always true unsigned comparison with 0 to make lint happier

Found by lint on illumos.

Submitted by:   Garrett D'Amore <garrett at damore.org>
Sponsored by:   Solarflare Communications, Inc.

git-svn-id: svn://svn.freebsd.org/base/stable/10@301399 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r300846
arybchik [Sat, 4 Jun 2016 17:20:50 +0000 (17:20 +0000)]
MFC r300846

sfxge(4): unsigned 1 should be shifted to produce bitmask

Found by lint on illumos.

Submitted by:   Garrett D'Amore <garrett at damore.org>
Sponsored by:   Solarflare Communications, Inc.

git-svn-id: svn://svn.freebsd.org/base/stable/10@301398 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r300845
arybchik [Sat, 4 Jun 2016 17:19:25 +0000 (17:19 +0000)]
MFC r300845

sfxge(4): cope with lint for EFX_SET_OWORD_BIT() with const bit arg

Found by lint on illumos.

Submitted by:   Garrett D'Amore <garrett at damore.org>
Sponsored by:   Solarflare Communications, Inc.

git-svn-id: svn://svn.freebsd.org/base/stable/10@301397 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r300844
arybchik [Sat, 4 Jun 2016 17:18:35 +0000 (17:18 +0000)]
MFC r300844

sfxge(4): remove set but not used variable

Found by lint on illumos.

Submitted by:   Garrett D'Amore <garrett at damore.org>
Sponsored by:   Solarflare Communications, Inc.

git-svn-id: svn://svn.freebsd.org/base/stable/10@301396 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r300842
arybchik [Sat, 4 Jun 2016 17:17:30 +0000 (17:17 +0000)]
MFC r300842

sfxge(4): remove unreachable break after goto

Found by lint on illumos.

Submitted by:   Garrett D'Amore <garrett at damore.org>
Sponsored by:   Solarflare Communications, Inc.

git-svn-id: svn://svn.freebsd.org/base/stable/10@301395 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r300841
arybchik [Sat, 4 Jun 2016 17:16:35 +0000 (17:16 +0000)]
MFC r300841

sfxge(4): add constant condition note to make lint happier

Found by lint on illumos.

Submitted by:   Garrett D'Amore <garrett at damore.org>
Sponsored by:   Solarflare Communications, Inc.

git-svn-id: svn://svn.freebsd.org/base/stable/10@301393 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r300840
arybchik [Sat, 4 Jun 2016 17:15:38 +0000 (17:15 +0000)]
MFC r300840

sfxge(4): note unused variables to make lint happier

Found by lint on illumos.

Submitted by:   Garrett D'Amore <garrett at damore.org>
Sponsored by:   Solarflare Communications, Inc.

git-svn-id: svn://svn.freebsd.org/base/stable/10@301392 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r300739
arybchik [Sat, 4 Jun 2016 17:14:28 +0000 (17:14 +0000)]
MFC r300739

sfxge(4): correct parenthesis location in if coundition

Found by lint on illumos.

Submitted by:   Garrett D'Amore <garrett at damore.org>
Sponsored by:   Solarflare Communications, Inc.

git-svn-id: svn://svn.freebsd.org/base/stable/10@301391 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r300609
arybchik [Sat, 4 Jun 2016 17:12:28 +0000 (17:12 +0000)]
MFC r300609

sfxge(4): enable Medford support

Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.

git-svn-id: svn://svn.freebsd.org/base/stable/10@301390 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f