202515 Commits

Author SHA1 Message Date
ngie
faa71f128b 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
2016-06-08 13:40:07 +00:00
ngie
4fed92adc4 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
2016-06-08 13:34:52 +00:00
ngie
a84f9fbf4f 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
2016-06-08 13:32:00 +00:00
ngie
511b4b072b MFC r299833:
Fix fully canonicalized example for `myvariable.27...`

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

Bump .Dd for the change
2016-06-08 13:24:42 +00:00
ngie
e3659f0f83 MFC r299657:
Include arpa/inet.h to get the htonl(3) definition
2016-06-08 13:21:17 +00:00
kib
8aac19713b MFC r300691:
Fix issues found by Coverity in the rtld-elf.c:gethints().
2016-06-08 04:49:20 +00:00
cy
cec071f6f8 MFC r301102:
Don't rely on $ntpd_enable to periodically fetch the latest leapfile.

Suggested by:	cperciva
2016-06-08 03:08:37 +00:00
truckman
13f6239c05 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
2016-06-08 01:17:22 +00:00
truckman
809b04224e 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
2016-06-07 16:56:15 +00:00
truckman
1d7291afd1 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
2016-06-07 16:53:05 +00:00
pfg
223f7999b2 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)
2016-06-06 13:31:28 +00:00
grembo
7ef21bdc1b MFC r297052:
Update fetch.1 and fetch.3 to reflect libfetch's actual use of CA bundles
2016-06-06 11:08:05 +00:00
kadesai
13d657a35d MFC r301203
r301203: Added support for Avago/Broadcom Cutlass(12 Gbps- 16 port count) controllers.

Sponsored by:   AVAGO Technologies/Broadcom Limited
2016-06-06 07:10:38 +00:00
ache
704e666406 MFC: r301115
Don't use fixup for C99 and up, the compiler result is already correct.

Suggested by: bde
2016-06-05 18:11:52 +00:00
ache
1040e2abb6 MFC: r301448
Reflect error indication according to POSIX and what those functions
currently do.
2016-06-05 16:21:53 +00:00
pfg
d69e829878 MFC r301206:
usb/uhso: Don't bail out on first USB error.

CID:		1305680
Submitted by:	hselasky
MFC after:	3 days
2016-06-05 15:03:55 +00:00
ache
29301f8121 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).
2016-06-05 14:31:36 +00:00
ache
199f286057 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.
2016-06-05 14:04:54 +00:00
ache
4ab0fcf85b 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.
2016-06-05 13:39:31 +00:00
dchagin
1d29d3ea45 MFC r300429:
Remove a now unused global declaration of some sysentvec struct.
2016-06-05 10:48:27 +00:00
kib
f7bbcd3e43 MFC r300959:
Do not leak the vm object lock when swap reservation failed, in
vm_object_coalesce().
2016-06-05 08:42:33 +00:00
dchagin
32dd9edc05 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
2016-06-05 07:43:20 +00:00
dchagin
f7acef050a MFC r300569:
Don't leak fp in case where fo_ioctl() returns an error.

Reported by:	C Turt <ecturt@gmail.com>
2016-06-05 07:40:12 +00:00
dchagin
e8e944c226 MFC r300416:
Add a missing errno translation for SO_ERROR optname.

PR:		135458
Reported by:	Stefan Schmidt
2016-06-05 07:38:56 +00:00
dchagin
74905f75d4 MFC r300415:
Add macro to convert errno and use it when appropriate.
2016-06-05 07:34:10 +00:00
dchagin
2caaff6b70 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.
2016-06-05 06:06:55 +00:00
dchagin
46f6e38f70 MFC r300412:
Add my copyright as I rewrote most of the futex code. Minor style(9) cleanup
while here.
2016-06-05 06:04:25 +00:00
dchagin
3d23c36165 MFC r300411:
Minor style(9) cleanup, no functional changes.
2016-06-05 06:02:37 +00:00
dchagin
a24d09886b 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.
2016-06-05 05:49:33 +00:00
bdrewery
fe5c6c0b6d MFC r300341:
FTS: Remove stale reference to nfs4 fs which was removed in r192578.
2016-06-04 17:40:23 +00:00
arybchik
ba2fd7424e 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.
2016-06-04 17:24:10 +00:00
arybchik
13b627958f 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.
2016-06-04 17:23:08 +00:00
arybchik
403b7a30dd 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.
2016-06-04 17:22:10 +00:00
arybchik
251b8b6025 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.
2016-06-04 17:20:50 +00:00
arybchik
0ae6c83e6e 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.
2016-06-04 17:19:25 +00:00
arybchik
cbf7e18c70 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.
2016-06-04 17:18:35 +00:00
arybchik
78cb60fee0 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.
2016-06-04 17:17:30 +00:00
arybchik
340d12ccfa 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.
2016-06-04 17:16:35 +00:00
arybchik
2a120a210a 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.
2016-06-04 17:15:38 +00:00
arybchik
47d515e964 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.
2016-06-04 17:14:28 +00:00
arybchik
28894f198e MFC r300609
sfxge(4): enable Medford support

Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
2016-06-04 17:12:28 +00:00
arybchik
b40ec06d05 MFC r300608
sfxge(4): bump driver version to the closest out-of-tree version

Sponsored by:   Solarflare Communications, Inc.
2016-06-04 17:11:04 +00:00
arybchik
4f24c165ae MFC r300607
sfxge(4): cleanup: update copyright to 2016

Sponsored by:   Solarflare Communications, Inc.
2016-06-04 17:08:34 +00:00
arybchik
b21c7afe1c MFC r300606
sfxge(4): provide option to disable not a local MAC address check

Option EFSYS_OPT_ALLOW_UNCONFIGURED_NIC disables check that the adapter
MAC address is not a local address (beginning 02).

Submitted by:   Laurence Evans <levans at solarflare.com>
Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
2016-06-04 17:05:20 +00:00
arybchik
40c12de63c MFC r300605
sfxge(4): be ready to receive events immediately after event queues are created

Submitted by:   Mark Spender <mspender at solarflare.com>
Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
2016-06-04 17:03:06 +00:00
arybchik
20c918cc21 MFC r300505
sfxge(4): cleanup: remove unused EFX preempt macros

The EFSYS_PREEMPT_DISABLE() and EFSYS_PREEMPT_ENABLE() macros
were used to ensure correct timing of I2C operations. The APIs
for I2C operations have been removed, so these macros have no
callers.

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
2016-06-04 17:00:50 +00:00
arybchik
b2684287e5 MFC r300135
sfxge(4): cleanup: remove trailing whitespaces

Sponsored by:   Solarflare Communications, Inc.
2016-06-04 16:58:34 +00:00
arybchik
6e80169d21 MFC r300011
sfxge(4): only raise an exception after MC assert or reboot in the common code

Fix efx_mcdi_request_poll so it only raises an exception if EIO is
reported from a detected MC assert or reboot. This prevents
an unnecessary exception being raised if an MCDI response error code
is trandlated to EIO.

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
2016-06-04 16:57:38 +00:00
arybchik
f9425301f6 MFC r300010
sfxge(4): restore clearing of MCDI new epoch flag in common code

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
2016-06-04 16:56:36 +00:00
arybchik
a96cc44e84 MFC r300009
sfxge(4): fix Medford timer quantum calculation in common code

The event/timer block used sysclk in Huntington, but has been
moved to the dpcpu clock domain for Medford. Fix the computed
timer quantum to use the right clock.

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
2016-06-04 16:54:28 +00:00