Commit Graph

7296 Commits

Author SHA1 Message Date
Cy Schubert
520f089ad0 Use normal KNF cuddling of elses.
Reported by:	bde
MFC after:	2 weeks
X-MFC with:	r312777
2017-01-26 04:51:48 +00:00
Cy Schubert
971fa117c0 Currently the fragment info is placed at the top of the linked list
under a shared read lock. This patch attempts to upgrade the lock to
an exclusive write lock. If the exclusive write lock fails to be
obtained, the current fragment is not placed at the head of the list.

This portion of the patch was inspired by NetBSD ip_frag.c r1.4 (which
effectively removed the section of code that performed the reordering).

The patch to sys/contrib/ipfilter/netinet/ip_compat.h adds the
MUTEX_TRY_UPGRADE macro to support the patch to ip_frag.c.

The patch to contrib/ipfilter/lib/rwlock_emul.c supports this patch
by emulating the mutex in userspace when exercised by ipftest(1).

Inspired by:	NetBSD ip_frag.c r1.4
MFC after:	1 month
2017-01-26 01:24:05 +00:00
Cy Schubert
26594bd1ee Remove extraneous blank line.
MFC after:	2 weeks
X-MFC with:	r312777
2017-01-25 20:59:23 +00:00
Ed Maste
080b710889 strings: avoid unnecessary trip through handle_file for stdin
Sponsored by:	The FreeBSD Foundation
2017-01-25 20:59:06 +00:00
Cy Schubert
d780a32bc5 Issue an error message when an incorrect flush argument is
encountered.`

MFC after:	2 weeks
2017-01-25 20:41:16 +00:00
Dimitry Andric
1324fa835c Pull in r276136 from upstream llvm trunk (by Wei Mi):
Use ValueOffsetPair to enhance value reuse during SCEV expansion.

  In D12090, the ExprValueMap was added to reuse existing value during
  SCEV expansion. However, const folding and sext/zext distribution can
  make the reuse still difficult.

  A simplified case is: suppose we know S1 expands to V1 in
  ExprValueMap, and
    S1 = S2 + C_a
    S3 = S2 + C_b
  where C_a and C_b are different SCEVConstants. Then we'd like to
  expand S3 as V1 - C_a + C_b instead of expanding S2 literally. It is
  helpful when S2 is a complex SCEV expr and S2 has no entry in
  ExprValueMap, which is usually caused by the fact that S3 is
  generated from S1 after const folding.

  In order to do that, we represent ExprValueMap as a mapping from SCEV
  to ValueOffsetPair. We will save both S1->{V1, 0} and S2->{V1, C_a}
  into the ExprValueMap when we create SCEV for V1. When S3 is
  expanded, it will first expand S2 to V1 - C_a because of S2->{V1,
  C_a} in the map, then expand S3 to V1 - C_a + C_b.

  Differential Revision: https://reviews.llvm.org/D21313

This should fix assertion failures when building OpenCV >= 3.1.

PR:		215649
MFC after:	3 days
2017-01-25 17:59:22 +00:00
Baptiste Daroussin
7666f5006c Import mandoc cvs snapshot 20170121 (pre 1.14)
Note that mandoc does not use anymore sqlite3 but a home made database format
An important improvement has been made as well in makewhatis performance:
Tests on my laptop shows makewhatis on the entire system goes from 26s to 12s
2017-01-21 13:17:25 +00:00
Xin LI
ca6e7a016c MFV r312333: zlib 1.2.11.
MFC after:	1 month
2017-01-17 05:55:47 +00:00
Xin LI
850069632c Vendor import of zlib 1.2.11. 2017-01-17 05:47:05 +00:00
Gleb Smirnoff
1897a4f168 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.
2017-01-17 03:52:57 +00:00
Enji Cooper
792bbaba98 Remove contrib/netbsd-tests/fs/nfs/nfsservice/rpcbind
This should have been pruned in r305358

MFC after:	3 days
Sponsored by:	Dell EMC Isilon
2017-01-14 06:16:57 +00:00
Enji Cooper
36b9e15c66 Delete trailing whitespace and use __arraycount instead of nitems in contrib code
MFC after:	1 week
2017-01-14 03:54:23 +00:00
Enji Cooper
a5deb9babb Note that sys/types.h is required on FreeBSD for kqueue(2), unlike NetBSD
MFC after:	12 days
X-MFC with:	r305358
Sponsored by:	Dell EMC Isilon
2017-01-14 01:01:02 +00:00
Enji Cooper
cdebaff820 Upgrade NetBSD tests to 01.11.2017_23.20 snapshot
This contains some new testcases in /usr/tests/...:

- .../lib/libc
- .../lib/libthr
- .../lib/msun
- .../sys/kern

Tested on:	amd64, i386
MFC after:	1 month
2017-01-13 03:33:57 +00:00
Enji Cooper
9527fa4f66 Remove __HAVE_LONG_DOUBLE #define from t_strtod.c and place it in Makefile
This is to enable support in other testcases

Inspired by lib/msun/tests/Makefile .

MFC after:	1 week
2017-01-12 08:40:52 +00:00
Enji Cooper
35cfc322f1 Fix lib/libc/sys/access_test after r311925
sys/param.h needs to be #included in order for __FreeBSD_version to be checked

MFC after:	13 days
2017-01-12 08:31:42 +00:00
Ed Maste
c83bcfbd2e readelf: add S390 relocation types
From https://refspecs.linuxfoundation.org/ELF/zSeries/lzsabi0_zSeries.html

Reviewed by:	bz
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D9149
2017-01-11 22:54:04 +00:00
Ed Maste
0fbbe5bf87 readelf: add more PPC64 relocation types found in LLVM
MFC after:	2 weeks
MFC with:	r311941
Sponsored by:	The FreeBSD Foundation
2017-01-11 21:28:22 +00:00
Ed Maste
dd9d62b416 readelf: add PPC64 relocation types
Reported by:	Mark Millard
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D9146
2017-01-11 21:18:14 +00:00
Enji Cooper
bccef7f6d9 Consolidate __NetBSD__ #ifdef
MFC after:	3 days
2017-01-11 10:20:35 +00:00
Enji Cooper
ddba0402f4 Import testcase updates with code contributed back to NetBSD
This also (inadvertently) contains an update to
contrib/netbsd-tests/lib/libc/sys/t_wait.c (new testcases).

MFC after:		2 weeks
In collaboration with:	christos@NetBSD.org
2017-01-11 09:51:34 +00:00
Enji Cooper
d1a6b5fb2f Fix whitespace in comment
MFC after:	3 days
2017-01-11 09:34:42 +00:00
Enji Cooper
0e0dd02306 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.

MFC after:	3 days
2017-01-11 07:22:21 +00:00
Enji Cooper
19f27f3c34 Fix up r311227
Check for creat returning a value != -1, not a non-zero value

MFC after:	3 days
Pointyhat to:	ngie
Reported by:	Coverity
CID:		1368366
2017-01-11 07:17:03 +00:00
Martin Matuska
2dbf8c4a76 MFV r311899:
Sync libarchive with vendor.

Vendor bugfixes:
#691: Support for SCHILY.xattr extended attributes
#854: Spelling fixes

Multiple fixes in ACL code:
  - prefer acl_set_fd_np() to acl_set_fd()
  - if acl_set_fd_np() fails, do no fallback to acl_set_file()
  - do not warn if trying to write ACLs to a filesystem without ACL support
  - fix id handling in archive_acl_(from_to)_text*() for NFSv4 ACLs

MFC after:	1 week
X-MFC with:	r310866
2017-01-10 21:59:35 +00:00
Enji Cooper
7931520d40 Diff reduce with upstream by removing signal.h #include
MFC after:	3 days
2017-01-10 10:27:09 +00:00
Enji Cooper
b6a72c5dbe Merge ^/vendor/NetBSD/tests/dist@r311868
This is the vendor accepted version of ^/head@r311245

MFC after:	3 days
2017-01-10 10:16:59 +00:00
Enji Cooper
2bbc0fe246 Merge the grammar fix for lib/libc/gen/raise_test:raise_stress
MFC after:	3 days
2017-01-10 10:12:36 +00:00
Enji Cooper
818d3ff977 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

MFC after:	1 week
2017-01-09 06:27:30 +00:00
Enji Cooper
0c72a43f3f 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

MFC after:	1 week
2017-01-09 06:24:28 +00:00
Enji Cooper
b55d259a14 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

MFC after:	5 days
2017-01-09 06:13:27 +00:00
Enji Cooper
8406423362 Use calloc instead of malloc + memset(.., 0, ..)
MFC after:	5 days
2017-01-09 06:03:49 +00:00
Enji Cooper
c5f8d75113 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).

MFC after:	5 days
Found with:	gensnmpdef /usr/local/share/snmp/mibs/IPV6-TC.txt
2017-01-09 05:51:38 +00:00
Enji Cooper
fbd43e4c99 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

MFC after:	1 week
2017-01-09 03:21:21 +00:00
Enji Cooper
0ab7046959 Use nitems(mib) instead of hardcoding mib's length when calling sysctl(3)
MFC after:	3 days
2017-01-09 01:47:00 +00:00
Dimitry Andric
00742f6ced Fix the following clang 4.0.0 warning in ngatm's snmp_atm.c:
contrib/ngatm/snmp_atm/snmp_atm.c:173:6: error: logical not is only
    applied to the left hand side of this bitwise operator
    [-Werror,-Wlogical-not-parentheses]
            if (!ifmr.ifm_status & IFM_AVALID) {
                ^                ~

Obviously, the masking needs to be done before the logical not
operation.  Add parentheses to make it so.

MFC after:      3 days
2017-01-07 15:57:12 +00:00
Ed Maste
d4cd50b494 libunwind: add noexec stack annotation
Reported by:	vangyzen
Reviewed by:	kib
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D9075
2017-01-07 14:40:58 +00:00
Dimitry Andric
05ea86b0c0 In tcpdump's print-tcp.c, avoid increasing alignment when taking the
addresses of members of struct ip, which is packed.  Since the pointers
are only used for memcmp'ing, they can be pointing to void instead.

Note that upstream has removed the src and dst variables, in the mean
time.

MFC after:	3 days
2017-01-07 00:17:01 +00:00
Dimitry Andric
dba092b109 After r311459, some ports can break, because a few of the newly added
prototypes in <tcpd.h> use FILE.  Pull in a minimal forward declaration
of FILE from <stdio.h> to minimize impact.  Sorry for the breakage.

Reported by:	Shawn Webb <shawn.webb@hardenedbsd.org>
X-MFC-With:	r311459
2017-01-06 21:40:30 +00:00
Konstantin Belousov
1c32456953 Use type-independent formats for printing nlink_t and ino_t.
Extracted from:	ino64 work by gleb, mckusick
Discussed with:	mckusick
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2017-01-06 16:59:33 +00:00
Enji Cooper
08235f2408 Remove unnecessary __unused attribute attached to ctx in op_begemot_mibII(..)
MFC after:	3 days
2017-01-06 07:57:45 +00:00
Xin LI
1456f0f968 MFV r311477: xz 5.2.3.
MFC after:	2 weeks
2017-01-06 07:54:53 +00:00
Dimitry Andric
8da8161b26 Also remove unnecessary extern keywords from tcpd.h.
Noticed by:	kib
X-MFC-With:	r311459
2017-01-05 21:17:10 +00:00
Dimitry Andric
fd3e9b3896 Put proper prototypes in tcpd.h
Clang 4.0.0 complains about tcpd.h's not-really-prototypes, e.g.:

    /usr/include/tcpd.h:75:24: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes]
    extern int hosts_access();              /* access control */
                           ^

To fix this, turn these declarations into real prototypes.  While here,
garbage collect the incompatible rfc931() function from scaffold.c, as
it is never used.

Reviewed by:	emaste
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D9052
2017-01-05 20:44:45 +00:00
Enji Cooper
60c2226f89 op_usm_users: don't deref uusers if it's NULL when SETting the value
Add an XXX comment to note that the conditional seems suspect given
how it's handled elsewhere in the SNMP_OP_SET case.

MFC after:	2 weeks
Reported by:	Coverity
CID:		1008573
2017-01-05 09:46:36 +00:00
Enji Cooper
3daec7ae72 snmp_table_fetch_async: don't leak work if snmp_pdu_send(..) fails
MFC after:	1 week
Reported by:	Coverity
CID:		1017276
2017-01-05 08:49:06 +00:00
Enji Cooper
994c8618ec op_usm_users: fix indentation in SNMP_OP_SET block
MFC after:	3 days
2017-01-05 08:27:23 +00:00
Enji Cooper
446bd8a476 Use calloc instead of malloc + memset(.., 0, ..)
MFC after:	3 days
2017-01-05 08:17:17 +00:00
Enji Cooper
70157df618 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

MFC after:	1 week
Reported by:	Coverity
CID:		1006825
2017-01-05 08:14:20 +00:00
Enji Cooper
10a0306a2e 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).

MFC after:	1 week
Reported by:	Coverity
CID:		1006826 [*]
2017-01-05 07:55:17 +00:00