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
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
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
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
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
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
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)
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).
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.
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
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.