]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/log
FreeBSD/stable/10.git
7 years agoMFC r310025:
bdrewery [Tue, 24 Jan 2017 16:47:06 +0000 (16:47 +0000)]
MFC r310025:

  Take write lock for rtld_bind before modifying obj_list in dl_iterate_phdr().

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

7 years agoMFC r312426: fix a thread preemption regression in schedulers introduced
avg [Mon, 23 Jan 2017 08:34:51 +0000 (08:34 +0000)]
MFC r312426: fix a thread preemption regression in schedulers introduced
in r270423

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

7 years agoMFC r312443:
pfg [Mon, 23 Jan 2017 01:21:39 +0000 (01:21 +0000)]
MFC r312443:
mppc - Finish pluging NETGRAPH_MPPC_COMPRESSION.

There were several places where reference to compression were left
unfinished. Furthermore, KASSERTs contained references to MPPC_INVALID
which is not defined in the tree and therefore were sure to break with
INVARIANTS: comment them out.

Reported by: Eugene Grosbein
PR: 216265

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

7 years agoMFC r312230: skel: Do not set -o emacs in .shrc.
jilles [Sun, 22 Jan 2017 21:34:26 +0000 (21:34 +0000)]
MFC r312230: skel: Do not set -o emacs in .shrc.

sh has defaulted to 'set -o emacs' since FreeBSD 9.0. Therefore, do not set
this again in .shrc, since that only serves to prevent invocations like
'sh -o vi' and 'sh +o emacs' to have the intended effect.

PR: 215958
Submitted by: Andras Farkas

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

7 years agoMFC r311651:
kib [Sat, 21 Jan 2017 12:30:07 +0000 (12:30 +0000)]
MFC r311651:
Export __cxa_thread_atexit_impl as an alias for __cxa_thread_atexit.

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

7 years agoMFC r311892: Do not wait for HA thread shutdown if scheduler is stopped.
mav [Sat, 21 Jan 2017 08:43:41 +0000 (08:43 +0000)]
MFC r311892: Do not wait for HA thread shutdown if scheduler is stopped.

This wait loop made system hang on panic instead of reboot.

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

7 years agoMFC r310649: Allow more efficient use of private area.
mav [Sat, 21 Jan 2017 08:41:00 +0000 (08:41 +0000)]
MFC r310649: Allow more efficient use of private area.

There are 16 bytes of space, so we may store two pointers in one.

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

7 years agoMFC r310646: Do not update "saved" mode page on every MODE SELECT.
mav [Sat, 21 Jan 2017 08:39:39 +0000 (08:39 +0000)]
MFC r310646: Do not update "saved" mode page on every MODE SELECT.

We do not have non-volatile memory to really save those values, so we
neither report nor support this capability.  Also saved mode pages are
not replicated between HA peers now.

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

7 years agoMFC r310644: Fix/synchronize field types in struct ctl_modepage_header.
mav [Sat, 21 Jan 2017 08:37:53 +0000 (08:37 +0000)]
MFC r310644: Fix/synchronize field types in struct ctl_modepage_header.

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

7 years agoMFC r310640, r310643:
mav [Sat, 21 Jan 2017 08:36:05 +0000 (08:36 +0000)]
MFC r310640, r310643:
Add support for revert to defaults (RTD) bit in MODE SELECT.

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

7 years agoMFC r310635: Decouple limits on number of LUNs per port and LUs per CTL.
mav [Sat, 21 Jan 2017 08:34:27 +0000 (08:34 +0000)]
MFC r310635: Decouple limits on number of LUNs per port and LUs per CTL.

Those two values are not directly related, so make them independent.
This does not change any limits immediately, but makes number of LUNs
per port controllable via tunable/sysctl kern.cam.ctl.lun_map_size.
After this change increasing CTL_MAX_LUNS should be pretty cheap,
and even making it tunable should be easy.

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

7 years agoMFC r310575: Fix improperly used nexus.targ_lun.
mav [Sat, 21 Jan 2017 08:32:56 +0000 (08:32 +0000)]
MFC r310575: Fix improperly used nexus.targ_lun.

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

7 years agoMFC r310555: Some random code cleaning.
mav [Sat, 21 Jan 2017 08:31:49 +0000 (08:31 +0000)]
MFC r310555: Some random code cleaning.

 - Reduce indentation.
 - Remove extra braces.
 - Add few missing savety checks.

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

7 years agoMFC r310539: Remove CTL_MAX_LUNS from places where it is not required.
mav [Sat, 21 Jan 2017 08:30:10 +0000 (08:30 +0000)]
MFC r310539: Remove CTL_MAX_LUNS from places where it is not required.

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

7 years agoMFC r311897: Add checks for received mode page length.
mav [Sat, 21 Jan 2017 08:19:42 +0000 (08:19 +0000)]
MFC r311897: Add checks for received mode page length.

If our buffer is too small, we may receive part of the page, and should
not try read/write past the end of the buffer.

Reported by:    Coverity
CID:            13683741368375

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

7 years agoMFC r311636: Make 'camcontrol modepage' support subpages.
mav [Sat, 21 Jan 2017 08:17:30 +0000 (08:17 +0000)]
MFC r311636: Make 'camcontrol modepage' support subpages.

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

7 years agoMFC r311623: Make do_buff_decode() not read past the end of the buffer.
mav [Sat, 21 Jan 2017 08:15:51 +0000 (08:15 +0000)]
MFC r311623: Make do_buff_decode() not read past the end of the buffer.

Abort format processing as soon as we have no enough data.

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

7 years agoMFC r310417
asomers [Fri, 20 Jan 2017 16:04:39 +0000 (16:04 +0000)]
MFC r310417

Add a dumpdev example to /boot/defaults/loader.conf

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

7 years agoMFC r311517: Add some more mode page fields.
mav [Fri, 20 Jan 2017 13:01:25 +0000 (13:01 +0000)]
MFC r311517: Add some more mode page fields.

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

7 years agoMFC r312368:
np [Fri, 20 Jan 2017 10:13:40 +0000 (10:13 +0000)]
MFC r312368:
cxgbe/tom: Fix a case where do_pass_accept_req wasn't properly restoring
the VNET.

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

7 years agoMFC r311504: MFV r311477: xz 5.2.3.
delphij [Fri, 20 Jan 2017 06:40:12 +0000 (06:40 +0000)]
MFC r311504: MFV r311477: xz 5.2.3.

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

7 years agoMFC r312331:
ngie [Fri, 20 Jan 2017 06:24:31 +0000 (06:24 +0000)]
MFC r312331:
r312331 (by glebius):

Fix regression from r310655, which broke operation of bsnmpd if it is bound
to a non-wildcard address.  As documented in ip(4), doing sendmsg(2) with
IP_SENDSRCADDR on a socket that is bound to non-wildcard address is
completely different to using this control message on a wildcard one.

A fix is to add a bool to mark whether we did setsockopt(IP_RECVDSTADDR)
on the socket, and use IP_SENDSRCADDR control message only if we did.

While here, garbage collect absolutely useless udp_recv() function that
establishes some structures on stack to never use them later.

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

7 years agoRevert MFC of 310847 and 310864
jpaetzel [Fri, 20 Jan 2017 00:15:11 +0000 (00:15 +0000)]
Revert MFC of 310847 and 310864

Requested by glebius who had questions about the original
head commit that I didn't see.

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

7 years agoMFC r311963: Remove writability requirement for single-mbuf, contiguous-
rpokala [Thu, 19 Jan 2017 23:44:05 +0000 (23:44 +0000)]
MFC r311963: Remove writability requirement for single-mbuf, contiguous-
range m_pulldown()

m_pulldown() only needs to determine if a mbuf is writable if it is going to
copy data into the data region of an existing mbuf. It does this to create a
contiguous data region in a single mbuf from multiple mbufs in the chain. If
the requested memory region is already contiguous and nothing needs to
change, the mbuf does not need to be writeable.

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

7 years agoMFC 310847 310864
jpaetzel [Thu, 19 Jan 2017 23:42:26 +0000 (23:42 +0000)]
MFC 310847 310864

Harden CARP against network loops.

If there is a loop in the network a CARP that is in MASTER state will see it's
own broadcasts, which will then cause it to assume BACKUP state.  When it
assumes BACKUP it will stop sending advertisements.  In that state it will no
longer see advertisements and will assume MASTER...

We can't catch all the cases where we are seeing our own CARP broadcast, but
we can catch the obvious case.

Unbreak ip_carp with WITHOUT_INET6 enabled by conditionalizing all IPv6
structs under the INET6 #ifdef. Similarly (even though it doesn't seem
to affect the build), conditionalize all IPv4 structs under the INET
#ifdef

This also unbreaks the LINT-NOINET6 tinderbox target on amd64; I have not
verified other MACHINE/TARGET pairs (e.g. armv6/arm).

Submitted by: torek
Obtained from: FreeNAS
Pointyhat fix: ngie

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

7 years agoMFC 311122
jpaetzel [Thu, 19 Jan 2017 17:58:08 +0000 (17:58 +0000)]
MFC 311122

Workaround NFS bug with readdirplus when there are greater than 1 billion files in a filesystem.

Reviewed by: kib

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

7 years agoMFC r311971: Report random flash storage as non-rotating to GEOM_DISK.
mav [Thu, 19 Jan 2017 11:17:09 +0000 (11:17 +0000)]
MFC r311971: Report random flash storage as non-rotating to GEOM_DISK.

While doing it, introduce respective constants in geom_disk.h.

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

7 years agoMFC r293040,293341,293435:
delphij [Thu, 19 Jan 2017 07:29:52 +0000 (07:29 +0000)]
MFC r293040,293341,293435:

Reduce libstand Makefile duplication.

PR: 216251

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

7 years agoMFC r311984:
kib [Thu, 19 Jan 2017 06:48:03 +0000 (06:48 +0000)]
MFC r311984:
For the main binary, postpone enforcing relro read-only protection
until copy relocations are done.

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

7 years agoMFC: r273180, r283754, r297329, r299414, r300707, r310309, r310340 (partial),
marius [Wed, 18 Jan 2017 23:26:10 +0000 (23:26 +0000)]
MFC: r273180, r283754, r297329, r299414, r300707, r310309, r310340 (partial),
     r310341, r311664, r311793-311794

o Use correct response bits for MMC_RSP_R4-R7 types

o Make sdhci(4) work after suspend/resume for chipsets that require
  the frequency quirk. This makes it work on eg ThinkPad T420.

o Add a convenience macro that masks all the bits related to clock divisors
  in all versions of the sdhci spec (the HI bits are just unused reserved
  bits in earlier versions).

o sdhci/mmc: Minor whitespace cleanups

o Add Braswell PCI IDs for Intel Cherryview

o mmc: Accept even lower voltage for Cherryview

  And HP x2 210, per DragonFlyBSD 240bd9cd58f8259c12c14a8006837e698.

o In mmcsd_task(), bio_resid was not being set to 0 on a successful read
  or write, resulting in random short-read and short-write returns for
  requests. Fixing this fixes nominal block I/O via mmcsd(4).

  Obtained from: DragonFlyBSD (fd4b97583be1a1e57234713c25f6e81bc0411cb0)

o Add support for Intel Apollo Lake and Bay Trail eMMC PCI controllers.

o Flesh out the support for Intel Braswell eMMC controllers further.

o In sdhci_init_slot(), use the right capability field for determining
  the announced bus width based on MMC_CAP_*_BIT_DATA.

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

7 years agoMFC: r296135
marius [Wed, 18 Jan 2017 23:23:46 +0000 (23:23 +0000)]
MFC: r296135

Replace several bus_alloc_resource() calls with bus_alloc_resource_any()

Most of these are BARs, and we allocate them in their entirety. The one
outlier in this is amdsbwd(4), which calls bus_set_resource() prior.

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

7 years agoMFC 310028: Use db_lookup_proc() in the DDB 'show procvm' command.
jhb [Wed, 18 Jan 2017 22:40:22 +0000 (22:40 +0000)]
MFC 310028: Use db_lookup_proc() in the DDB 'show procvm' command.

This allows processes to be identified by PID as well as a pointer address.

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

7 years agoMFC r311947, r311981:
pfg [Wed, 18 Jan 2017 15:23:40 +0000 (15:23 +0000)]
MFC r311947, r311981:

rpcgen(1): Avoid unused variable warning on generated code.

Avoid "unused variable 'i'" warnings in generated .c files by only
emitting the "int i;" for non-opaque arrays. Opaque arrays use
xdr_opaque() rather than iterating over the array.

Obtained from: OpenBSD (CVS rev 1.28)

rpcgen(1): Check getrlimit() return for generated code.

Obtained from: NetBSD (CVS rev 1.27, 1.28)

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

7 years agoMFC r310630: libkvm: support access to vmm guest memory, allow writes to
avg [Wed, 18 Jan 2017 14:14:00 +0000 (14:14 +0000)]
MFC r310630: libkvm: support access to vmm guest memory, allow writes to
fwmem and vmm

Sponsored by:  Panzura

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

7 years agoMFC r311275: Restructure libz.
delphij [Wed, 18 Jan 2017 08:20:36 +0000 (08:20 +0000)]
MFC r311275: Restructure libz.

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

7 years agoMFC r309527-309528:
yongari [Wed, 18 Jan 2017 02:57:22 +0000 (02:57 +0000)]
MFC r309527-309528:
r309527:
  Recognize RealTek ALC1150 7.1 channel HD audio codec.

r309528:
  Fix too low volume on MSI H170 GAMING M3 board by poking vendor
  specific COEF.

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

7 years agoMFC r302548:
yongari [Wed, 18 Jan 2017 02:41:13 +0000 (02:41 +0000)]
MFC r302548:
  Belatedly remove CSUM_IP_FRAGS and CSUM_FRAGMENT offloading
  capabilities.  It was removed in r243624 and r254804/r271006
  respectively.
  This file and mbuf(9) needs updates for other offloading
  capabilities(i.e. CSUM_SCTP and CSUM_TSO).

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

7 years agoMFC r295736,295738:
yongari [Wed, 18 Jan 2017 02:22:07 +0000 (02:22 +0000)]
MFC r295736,295738:
r295736:
  Remove duplicated check.

r295738:
  Fix a bug introduced in r295736
  TX descriptor address should be updated for valid chain.

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

7 years agoMFC r295735:
yongari [Wed, 18 Jan 2017 02:16:17 +0000 (02:16 +0000)]
MFC r295735:
  Fix variable assignment.

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

7 years agoMFC r304576:
yongari [Wed, 18 Jan 2017 01:58:33 +0000 (01:58 +0000)]
MFC r304576:
  Add Killer E2400 to the supported hardware list.

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

7 years agoMFC r304574-304575,304584:
yongari [Wed, 18 Jan 2017 01:53:07 +0000 (01:53 +0000)]
MFC r304574-304575,304584:
r304574:
  Correct DMA channel number selection on AR816x family of
  controllers. For Gigabit Ethernet version of AR816x, AR813x/AR815x
  except L1D controller, use vendor recommended ASPM parameters.
  While here, increase alc_dma_burst array size.  Broken H/W can
  return bogus value in theory.

r304575:
  Add Killer E2400 Gigabit Ethernet support.
  It seems Killer E2200/E2400 has a BIOS misconfiguration or silicon
  bug which triggers DMA write errors when driver uses advertised
  maximum payload size.  Force the maximum payload size to 128 bytes
  in DMA configuration.
  This change should fix occasional DMA write errors reported on
  Killer E2200.

r304584:
  Add a missing change in r304575.

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

7 years agoMFC r299864,r303166:
ngie [Tue, 17 Jan 2017 23:55:10 +0000 (23:55 +0000)]
MFC r299864,r303166:

r299864 (by markj):

opt_kdtrace.h is not needed for SDT probes as of r258541.

r303166 (by imp):

Add opt_ddb.h.

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

7 years agoMFC r311650
lifanov [Tue, 17 Jan 2017 22:02:22 +0000 (22:02 +0000)]
MFC r311650

Restore priority value for OGIO_KEYMAP

PR: 206678
Submitted by: ecturt@gmail.com
Reviewed by: cem
Approved by: cem, matthew (mentor)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D5095

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

7 years agoMFC r311879:
kib [Tue, 17 Jan 2017 10:34:31 +0000 (10:34 +0000)]
MFC r311879:
Use ANSI C definitions, update comment.

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

7 years agoFix mismerge in r312117. This is a direct commit to stable/10.
np [Tue, 17 Jan 2017 07:43:37 +0000 (07:43 +0000)]
Fix mismerge in r312117.  This is a direct commit to stable/10.

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

7 years agoMFC r312113:
ngie [Tue, 17 Jan 2017 01:58:50 +0000 (01:58 +0000)]
MFC r312113:

Clean up trailing whitespace

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

7 years agoMFC r312122:
ngie [Tue, 17 Jan 2017 01:57:42 +0000 (01:57 +0000)]
MFC r312122:

Remove contrib/netbsd-tests/fs/nfs/nfsservice/rpcbind

This should have been pruned in r305358

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

7 years agoMFC r312111:
ngie [Tue, 17 Jan 2017 01:56:49 +0000 (01:56 +0000)]
MFC r312111:

Remove unused vars to fix -Wunused issues

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

7 years agoMFC r312118,r312121:
ngie [Tue, 17 Jan 2017 01:55:05 +0000 (01:55 +0000)]
MFC r312118,r312121:

r312118:

Fix -Wformat issue with zero-length format string passed to err(3)

Tested with: clang, gcc 4.2.1, gcc 4.9

r312121:

Follow up to r312118

State that execve failed instead of just printing out the program name
and strerror(errno) via err(3).

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

7 years agoMFC r311815:
kib [Mon, 16 Jan 2017 12:17:35 +0000 (12:17 +0000)]
MFC r311815:
Forcibly remove the cached items from pseudofs vncache on module unload.

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

7 years agoMFC r311781:
kib [Mon, 16 Jan 2017 12:13:49 +0000 (12:13 +0000)]
MFC r311781:
Use standard Versions.def for libprocstat.

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

7 years agoMFC r311780:
kib [Mon, 16 Jan 2017 12:05:00 +0000 (12:05 +0000)]
MFC r311780:
Use tab for indent.

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

7 years agoMFC r311769:
smh [Mon, 16 Jan 2017 09:12:40 +0000 (09:12 +0000)]
MFC r311769:

Fix rstat: symbol not in namelist from netstat

Sponsored by: Multiplay

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

7 years agoMFC r312009:
ngie [Mon, 16 Jan 2017 07:17:43 +0000 (07:17 +0000)]
MFC r312009:

Add license preamble for r286964; credit to asomers

While here, clean up trailing whitespace

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

7 years agoMFC r312009:
ngie [Mon, 16 Jan 2017 07:11:37 +0000 (07:11 +0000)]
MFC r312009:

Add license preamble for r286964; credit to asomers

While here, clean up trailing whitespace

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

7 years agoMFC r311140:
ngie [Mon, 16 Jan 2017 07:10:45 +0000 (07:10 +0000)]
MFC r311140:

Only bake krb5_config.h support in to ssh(3), etc if both MK_GSSAPI and
MK_KERBEROS_SUPPORT != no

This fixes the odd case where someone specified MK_GSSAPI=no and
MK_KERBEROS_SUPPORT=yes (which admittedly, probably doesn't make sense,
but the build system doesn't prevent this case today, and it didn't when
I filed the bug back in 2011 either).

PR: 159745

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

7 years agoMFC r310656,r311221:
ngie [Mon, 16 Jan 2017 07:07:45 +0000 (07:07 +0000)]
MFC r310656,r311221:

r310656:

style(9): sort alignment in udp_recv(..)

r311221:

Initialize msg.msg_flags to 0

This mutes a valid coverity warning about it being uninitialized
when passed in to sendmsg(2).

CID: 1368202

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

7 years agoMFC r310655:
ngie [Mon, 16 Jan 2017 07:04:08 +0000 (07:04 +0000)]
MFC r310655:

Fix bsnmpd sending/receiving with multi-homed configurations or INADDR_ANY used
as the listening address in snmpd_input(..)

Stash the IPv4 address of the receiver via the recv(..) callback and use it in
the send(..) callback for the transport by specifying IP_SENDSRCADDR for the
control message type.

Add sendmsg logic to the UDP transport's send(..) callback and use the
respective send(..) callback for the transport instead of calling sendto in
snmpd_input(..).

Obtained from:  Isilon OneFS (^/onefs/branches/BR_8_0_0_DEV@r507595)

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

7 years agoMFC r311740:
ngie [Mon, 16 Jan 2017 06:58:16 +0000 (06:58 +0000)]
MFC r311740:

Improve the smilint target in the hostres and mibII modules

- Mark the smilint target .PHONY so it's always executed when requested
- Leverage .PATH for BMIBS instead of spelling the path out longhand
  for them

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

7 years agoMFC r311742:
ngie [Mon, 16 Jan 2017 06:56:12 +0000 (06:56 +0000)]
MFC r311742:

Add a REVISION section to track changes for the BEGEMOT-IP-MIB MIB file

There haven't been any changes to the MIB definition, so the REVISION
remains static at the version it was imported at

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

7 years agoMFC r311758:
ngie [Mon, 16 Jan 2017 06:55:19 +0000 (06:55 +0000)]
MFC r311758:

Add a REVISION section to track changes for the BEGEMOT-ATM-FREEBSD-MIB MIB file

There haven't been any changes to the MIB definition, so the REVISION
remains static at the version it was imported at

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

7 years agoMFC r311741,r311761:
ngie [Mon, 16 Jan 2017 06:54:07 +0000 (06:54 +0000)]
MFC r311741,r311761:

r311741:

Add a REVISION section to track changes for the hostres module

There haven't been any changes to the MIB definition, so the REVISION remains
static at the version it was imported at

r311761:

Add a REVISION section to track changes for the BEGEMOT-NETGRAPH MIB file

This change also documents the modification harti made to a handful of
objects in r122758 (the max OCTET STRING width was increased from 15 to
31 octets)

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

7 years agoMFC r311759,r311760:
ngie [Mon, 16 Jan 2017 06:53:02 +0000 (06:53 +0000)]
MFC r311759,r311760:

r311759:

Add a REVISION section to track changes for the FOKUS-MIB MIB file

There haven't been any changes to the MIB definition, so the REVISION
remains static at the version it was imported at

r311760:

Add a REVISION section to track changes for the BEGEMOT-MIB MIB file

There haven't been any changes to the MIB definition, so the REVISION
remains static at the version it was imported at

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

7 years agoMFC r311101:
pfg [Mon, 16 Jan 2017 03:52:20 +0000 (03:52 +0000)]
MFC r311101:
libkvm - extend a bit the swap statistics field.

Change ksw_used and ksw_total to unsigned, which increases the maximum
total swap that can be displayed properly from ~8TB to ~16TB.

Obtained from: DragonflyBSD (ecc2e461)

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

7 years agoMFC r283263, r289359, r308187, r311660, r311693, r311727, r311797:
ian [Sun, 15 Jan 2017 22:30:59 +0000 (22:30 +0000)]
MFC r283263, r289359, r308187, r311660, r311693, r311727, r311797:

Raise the SDHCI timeout to 10 seconds and add a sysctl to allow changing
this value at runtime.

Add support for the BCM57765 card reader.

Toggle card insert/remove interrupt enable bits on events.

Add a new sdhci interface method, get_card_present().

Now that the PRESENT_STATE register is only used for the inhibit bits loop
in this function, sdhci_start_command(), eliminate the state variable and
restructure the loop to read the register just once at the top of the loop.

Add support for non-removable media, and a quirk to use polling to detect
card insert/remove events on controllers that don't implement the insert
and remove interrupts.

Add sdhci_handle_card_present_locked() that can be called from the interrupt
handler which already holds the mutex, and have sdhci_handle_card_present()
be just a tiny wrapper that does the locking for external callers.

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

7 years agoMFC r311848:
np [Sat, 14 Jan 2017 15:52:59 +0000 (15:52 +0000)]
MFC r311848:
cxgbe(4): Attach to the 2x25 debug card.  This is for internal use only.

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

7 years agoMFC r311831 and r311832.
np [Sat, 14 Jan 2017 15:43:31 +0000 (15:43 +0000)]
MFC r311831 and r311832.

r311831:
cxgbe(4): The wraparound logic in start_wrq_wr() should not get involved
in work requests that end at the end of the descriptor ring, even though
the pidx wraps around to 0.

r311832:
cxgbe(4): Enable automatic cidx flush for all control queues.

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

7 years agoMFC r311646:
kib [Sat, 14 Jan 2017 11:27:11 +0000 (11:27 +0000)]
MFC r311646:
Define _POSIX_PRIORITY_SCHEDULING as 0, to account for the kernel option.

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

7 years agoMFC r311983
arybchik [Sat, 14 Jan 2017 10:59:25 +0000 (10:59 +0000)]
MFC r311983

sfxge(4): add sysctl to change MAC stats update period

The sysctl controls the period per interface.

Sponsored by:   Solarflare Communications, Inc.

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

7 years agoMFC r311977
arybchik [Sat, 14 Jan 2017 10:58:08 +0000 (10:58 +0000)]
MFC r311977

sfxge(4): add tunable to configure MAC stats update period

Sponsored by:   Solarflare Communications, Inc.

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

7 years agoMFC r311962
arybchik [Sat, 14 Jan 2017 10:50:45 +0000 (10:50 +0000)]
MFC r311962

sfxge(4): stats refresh in SW should depend on HW update period

The period should be taken into account by the function which
refreshes driver stats.

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

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

7 years agoMFC r311961
arybchik [Sat, 14 Jan 2017 10:39:42 +0000 (10:39 +0000)]
MFC r311961

sfxge(4): do not ignore requested MAC stats update period

Firmware version which takes PERIOD_MS parameter into account is
required.

Sponsored by:   Solarflare Communications, Inc.

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

7 years agoMFC r311877
arybchik [Sat, 14 Jan 2017 10:39:00 +0000 (10:39 +0000)]
MFC r311877

sfxge(4): avoid unnecessary mbuf data prefetch

Unnecessary prefetch just loads HW prefetcher and displaces other
cache entries (which could be really useful).

If we parse mbuf for TSO early and use firmware-assisted TSO, we do not
expect mbuf data access when we compose firmware-assisted TSO (v1 or v2)
option descriptors.  If packet header needs to be linearized or finally
FATSO cannot be used because of, for example, too big header, we do not
care about a bit more performance degradation because of prefetch
absence (it is better to optimize more common case).

Sponsored by:   Solarflare Communications, Inc.

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

7 years agoMFC r311569, r311657, and r311949.
np [Sat, 14 Jan 2017 04:34:30 +0000 (04:34 +0000)]
MFC r311569, r311657, and r311949.

r311569:
Fix comment in t4_tom.  No functional change.

r311657:
cxgbe/t4_tom: Fix tid accounting.  An offloaded IPv6 connection uses 2
tids, not 1, in the hardware.

r311949:
cxgbe/tom: Add VIMAGE support to the TOE driver.

Active Open:
- Save the socket's vnet at the time of the active open (t4_connect) and
  switch to it when processing the reply (do_act_open_rpl or
  do_act_establish).

Passive Open:
- Save the listening socket's vnet in the driver's listen_ctx and switch
  to it when processing incoming SYNs for the socket.
- Reject SYNs that arrive on an ifnet that's not in the same vnet as the
  listening socket.

CLIP (Compressed Local IPv6) table:
- Add only those IPv6 addresses to the CLIP that are in a vnet
  associated with one of the card's ifnets.

Misc:
- Set vnet from the toepcb when processing TCP state transitions.
- The kernel sets the vnet when calling the driver's output routine
  so t4_push_frames runs in proper vnet context already.  One exception
  is when incoming credits trigger tx within the driver's ithread.  Set
  the vnet explicitly in do_fw4_ack for that case.

Sponsored by: Chelsio Communications

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

7 years agoMFC r311748:
ngie [Sat, 14 Jan 2017 00:39:55 +0000 (00:39 +0000)]
MFC r311748:

Bump WARNS up from 0 to 6

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

7 years agoMFC r311750,r311754,r311757:
ngie [Sat, 14 Jan 2017 00:36:48 +0000 (00:36 +0000)]
MFC r311750,r311754,r311757:

r311750:

Check result from smiGetFirstNode and smiGetNodeByOID

This avoids a segfault with malformed or unanticipated files,
like IPV6-TC.txt (a file containing just TEXTUAL-CONVENTIONS).

Found with: gensnmpdef /usr/local/share/snmp/mibs/IPV6-TC.txt

r311754:

Use calloc instead of malloc + memset(.., 0, ..)

r311757:

Similar to r311750, check for the result from smiGetModule to avoid a segfault
when dereferencing a NULL pointer later on.

Choose to just check for the NULL pointer in the next for-loop for now to fix
the issue with a minimal amount of code churn

sys/queue.h use here would make more sense than using a static table

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

7 years agoMFC r311236,r311919:
ngie [Sat, 14 Jan 2017 00:33:03 +0000 (00:33 +0000)]
MFC r311236,r311919:

r311236:

unlink_fifo: don't leak the file descriptors opened with mkfifo and open

MFC fater: 3 days
CID: 978316, 978317

r311919:

Partially revert r311236

There's no sense in trying to close a file descriptor from the negative cases
with unlink_test; it's best to ignore these cases.

The mkfifo case does make sense to keep though.

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

7 years agoMFC r311924:
ngie [Sat, 14 Jan 2017 00:29:55 +0000 (00:29 +0000)]
MFC r311924:

Fix whitespace in comment

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

7 years agoMFC r311926:
ngie [Sat, 14 Jan 2017 00:28:21 +0000 (00:28 +0000)]
MFC r311926:

Consolidate __NetBSD__ #ifdef

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

7 years agoMFC r311227,r311917:
ngie [Sat, 14 Jan 2017 00:26:52 +0000 (00:26 +0000)]
MFC r311227,r311917:

r311227:

seekdir_basic: fix various Coverity issues

Address..
- .. resource leaks of file descriptors and memory
- .. unchecked return values from creat(2), mkdir(2), and telldir(3)
- .. potential NULL derefs after calling readdir(3)

CID: 975255, 975256, 976989, 978989, 978990

r311917:

Fix up r311227

Check for creat returning a value != -1, not a non-zero value

Pointyhat to: ngie
CID: 1368366

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

7 years agoMFC r310950:
ngie [Sat, 14 Jan 2017 00:24:46 +0000 (00:24 +0000)]
MFC r310950:

MIB-II: use strlcpy when copying interface names to .ifr_name

.ifra_name is assumed to be NUL terminated; using strlcpy(3)
ensures that it's indeed NUL terminated whereas strncpy does
not.

Tested and verified as follows with a combination of ifconfig,
snmpget, and snmpset:

  % ifconfig create lo1 127.0.0.2/8
  % SNMPARGS="-v 3 -n '' -u bsnmp -A bsnmptest -l authPriv -a sha -x des -X bsnmptest localhost"
  % snmpget $SNMPARGS IF-MIB::ifAdminStatus.4
  IF-MIB::ifAdminStatus.4 = INTEGER: up(1)
  % snmpset $SNMPARGS IF-MIB::ifAdminStatus.4 i 2
  IF-MIB::ifAdminStatus.4 = INTEGER: down(2)
  % snmpget $SNMPARGS IF-MIB::ifAdminStatus.4
  IF-MIB::ifAdminStatus.4 = INTEGER: down(2)
  % snmpset $SNMPARGS IF-MIB::ifAdminStatus.4 i 1
  IF-MIB::ifAdminStatus.4 = INTEGER: up(1)
  % snmpget $SNMPARGS IF-MIB::ifAdminStatus.4
  IF-MIB::ifAdminStatus.4 = INTEGER: up(1)

CID: 1009652-10096561349850

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

7 years agoMFC 304492,310721,310734: Update cxgbe info in NOTES.
jhb [Fri, 13 Jan 2017 21:42:36 +0000 (21:42 +0000)]
MFC 304492,310721,310734: Update cxgbe info in NOTES.

304492:
Move cxgb and cxgbe down to the non-mii PCI NIC section.

310721:
Mention T6 and 100GbE in description of cxgbe.

310734:
Note that the Chelsio T6 also supports 25Gbps.

To avoid overflowing 80 columns, condense the cxgbe description a bit.

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

7 years agoMFC r311525:
kib [Fri, 13 Jan 2017 12:47:44 +0000 (12:47 +0000)]
MFC r311525:
Lock tmpfs node tn_status updates done under the shared vnode lock.

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

7 years agoMFC r311524:
kib [Fri, 13 Jan 2017 12:45:54 +0000 (12:45 +0000)]
MFC r311524:
Use vnode lock assertion expression, assert exclusive ownership.

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

7 years agoMFC r311523:
kib [Fri, 13 Jan 2017 12:44:52 +0000 (12:44 +0000)]
MFC r311523:
Remove dead code.

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

7 years agoMFC r310718:
amdmi3 [Fri, 13 Jan 2017 10:28:24 +0000 (10:28 +0000)]
MFC r310718:

bzip2 does not exit after showing license as requested with --version
or --license as most apps would do, instead it waits for data to
compress on stdin. Because of that, if `bzip2 --version' is called,
bogus `bzip2: I won't write compressed data to a terminal' error
message will be displayed, and checking for bzip2 version in scripts
as in

    bzip2 --version 2>&1 | grep -o "Version [^,]*"

will hand as bzip2 would wait for data to compress on stdin. Fix
this by exiting right after showing version/license text.

I've tried to push this upstream for more than a year, but author
is unresponsive, so upstream may be considered dead.

Ubuntu applies similar fix, for the note.

PR: 199443
Approved by: dim, bapt
Differential Revision: D8924

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

7 years agoMFC r310586,r310587,r310588,r311381:
ngie [Fri, 13 Jan 2017 09:19:04 +0000 (09:19 +0000)]
MFC r310586,r310587,r310588,r311381:

r310586:

Refactor transport sources a bit to facilitate changes coming down pipeline

Add recv callback to transport layer to better facilitate code reuse and
readability and for symmetry with send callback. Move recv_dgram and
recv_stream to udp_recv and lsock_recv, respectively, and make the
beforementioned functions recv callbacks for the udp and lsock transports,
respectively.

Consolidate the check_priv* functions in their relevant trans*.c source to
limit scope/use.

Note: this code is roughly based content from the submitter, although this
was modified to be more of a direct move from snmpd/main.c to the trans_*.c
sources, and to reduce unnecessary static function declarations.

r310587:

Fix definition for recv_dgram(..); it should be "ssize_t", not "int"

I'm not sure why this wasn't flagged as an issue by the compiler, yet

r310588:

Fix return type for `ret` (recv callback) and sort variables by alignment

Again, for reasons I don't yet understand, this is not being flagged by the
compiler. Unlike the issue addressed in r310587, this problem existed prior
to r310586

r311381:

lsock_init_port: address issues with initializing sockaddr_un object

- Use strlcpy to ensure p->name doesn't overflow sa.sun_path [*].
- Use SUN_LEN(..) instead of spelling out calculation longhand (inspired
  by comment by jmallett).

Tested with: dgram and stream support with both bsnmpwalk and snmpwalk

CID: 1006825

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

7 years agoMFC r311739:
ngie [Fri, 13 Jan 2017 09:07:25 +0000 (09:07 +0000)]
MFC r311739:

Use SRCTOP instead of spelling out the full path with .CURDIR

This helps condense the output for CFLAGS and .PATH

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

7 years agoMFC r311378:
ngie [Fri, 13 Jan 2017 09:04:29 +0000 (09:04 +0000)]
MFC r311378:

lm_load: fix string copying issues

- Ensure `section` doesn't overrun section by using strlcpy instead of
  strcpy [*].
- Use strdup instead of malloc + strcpy (this wasn't flagged by Coverity,
  but is an opportunistic change).

CID: 1006826 [*]

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

7 years agoMFC r311390:
ngie [Fri, 13 Jan 2017 09:01:09 +0000 (09:01 +0000)]
MFC r311390:

snmp_table_fetch_async: don't leak `work` if snmp_pdu_send(..) fails

CID: 1017276

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

7 years agoMFC r310892,r310894,r310989:
ngie [Fri, 13 Jan 2017 08:59:22 +0000 (08:59 +0000)]
MFC r310892,r310894,r310989:

r310892:

Don't call snmp_pdu_free(..) until finished with the pdu and when ready to
allocate a new one via snmp_pdu_create(..)

This fixes bsnmpwalk, so it no longer crashes after r310729

r310894:

snmp_pdu_free the right object at the right time in snmptool_walk

r310892 was on the right track, but unfortunately it was resolving
the problem incorrectly and accidentally leaking memory in the
process.

- Call snmp_pdu_free on req before calling snmp_pdu_create on it
  at the bottom of the outer while loop
- Call snmp_pdu_free on resp after calling snmpwalk_nextpdu_create
  in the inner loop

r310989:

Call snmp_pdu_free on req/resp with a consistent, correct pattern

- snmp_pdu_free should be called before snmp_pdu_create is called
  again
- snmp_pdu_free should be called on the resp to snmp_dialog when
  successful

Tested with the following bsnmp commands:

  % export SNMPUSER=bsnmp SNMPPASSWD=bsnmptest
  % SNMP_ARGS="-A proto=sha -C context='' -K -P proto=des -v 3 -r 0"
  % bsnmpset $SNMP_ARGS sysLocation="MyAgent"
  % bsnmpget $SNMP_ARGS sysLocation
  % bsnmpwalk $SNMP_ARGS

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

7 years agoMFC r310729:
ngie [Fri, 13 Jan 2017 08:55:37 +0000 (08:55 +0000)]
MFC r310729:

Prevent improper memory accesses after calling snmp_pdu_free and snmp_value_free

snmp_pdu_free: set pdu->nbindings to 0 to limit the damage that
could happen if a pdu was reused after calling the function, and
as both stack and heap allocation types are used in contrib/bsnmp
and usr.sbin/bsnmpd.

snmp_value_free: NULL out value->v.octetstring.octets after calling
free on it to prevent a double-free from occurring.

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

7 years agoMFC r311733:
ngie [Fri, 13 Jan 2017 08:54:06 +0000 (08:54 +0000)]
MFC r311733:

Use nitems(mib) instead of hardcoding mib's length when calling sysctl(3)

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

7 years agoMFC r311290,r311293,r311294:
ngie [Fri, 13 Jan 2017 08:51:46 +0000 (08:51 +0000)]
MFC r311290,r311293,r311294:

r311290:

Use strlcpy instead of strcpy when copying the bridge name to ifr.ifr_name
to avoid buffer overflows

CID: 100673510067371006738

r311293:

bridge_do_pfctl: allocate mib_name dynamically using asprintf

This is being done to reduce wasted space, simplify complexity in
the code, and to quell a Coverity warning about buffer overruns.
warning about buffer overruns.

CID: 1006736

r311294:

style cleanup

- bridge_pf_dump: use nitems instead of spelling it out longhand
- bridge_do_pfctl: sort variables by alignment for type

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

7 years agoMFC r311282:
ngie [Fri, 13 Jan 2017 08:49:22 +0000 (08:49 +0000)]
MFC r311282:

snmp_mibII(3) requires net/if.h and net/if_mib.h

Document that requirement

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

7 years agoMFC r311268:
ngie [Fri, 13 Jan 2017 08:48:17 +0000 (08:48 +0000)]
MFC r311268:

Clarify lifetime of child(..) function

Ensure child exits when complete as it's always run in a forked
process.

Add a missing break statement in :pselect_sigmask when calling
child(..) for clarity and to avoid weird domino effects if the
child process somehow does something it's not supposed to do
with the logfiles, file descriptors, etc

CID: 122336912233701300301

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

7 years agoMFC r311265,r311274:
ngie [Fri, 13 Jan 2017 08:46:49 +0000 (08:46 +0000)]
MFC r311265,r311274:

r311265:

fpu: ensure calls to pthread_create succeed and test sched_yield to make
sure it returns 0

sched_yield tests for values returning 0 of type int and sched_yield is
of type long, so the test is a mismatch

CID: 1254953125495412549651254966

r311274:

run: ensure pthread_condattr_{init,setclock} is successful

CID: 12686311268633

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

7 years agoMFC r311715:
ngie [Fri, 13 Jan 2017 08:42:11 +0000 (08:42 +0000)]
MFC r311715:

Use nitems({mib,name}) instead of hardcoding their value

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

7 years agoMFC r311709:
ngie [Fri, 13 Jan 2017 08:40:58 +0000 (08:40 +0000)]
MFC r311709:

Style(9) fixes

- Sort sys/ #includes
- Use nitems instead of hardcoding the length of `mib`

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

7 years agoMFC r311714:
ngie [Fri, 13 Jan 2017 08:39:40 +0000 (08:39 +0000)]
MFC r311714:

lib/libutil/kinfo_*: style cleanup

- Use nitems(mib) instead of hardcoding mib's length
- Sort sys/ #includes

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