eadler [Fri, 22 Jun 2018 04:54:51 +0000 (04:54 +0000)]
MFC r334472:
service(1): Improve manual page
* Sort options..
* Fix some typos.
* Use one Bd macro for code blocks instead of a bunch of Dl
* macros.
* Improve formatting.
* Clarify 'jail' argument
emaste [Fri, 22 Jun 2018 00:30:24 +0000 (00:30 +0000)]
MFC r335213: ldd: reference readelf instead of objdump in warning message
We have an obsolete GNU objdump 2.17.50 in the base system, which will
be removed in the future. Suggest readelf(1) for examining ELF files
instead; for most use cases it is the preferred tool anyhow.
emaste [Fri, 22 Jun 2018 00:29:29 +0000 (00:29 +0000)]
MFC r335209: elf.5: add readelf cross-reference
objdump is sometimes used in cases where readelf is more appropriate,
but the obsolete GNU objdump we have in the base system will be removed
in the future.
.Xr readelf from elf.5 to improve the odds the more appropriate tool
will be found.
ed [Thu, 21 Jun 2018 16:12:30 +0000 (16:12 +0000)]
MFC r335314:
Fix bad logic in iovlist_truncate().
To conform to RFC 5426, this function is intended to truncate messages
if they exceed the message size limits. Unfortunately, the amount of
space was computed the wrong way around, causing messages to be
truncated entirely.
dteske [Thu, 21 Jun 2018 14:55:26 +0000 (14:55 +0000)]
MFC r335308: bsdconfig: Fix a bug when editing users
The usermgmt API was stomping on a global ($user_gid to be specific)
so things would appear to work fine until you tried to make a second
pass into the API with the now-tainted variable contents.
Fixed by localizing menu-specific contents as to not leak outside API.
PR: bin/208774
Reported by: Martin Waschbuesch <martin@waschbuesch.de>
Sponsored by: Smule, Inc.
ae [Thu, 21 Jun 2018 10:51:25 +0000 (10:51 +0000)]
MFC r335133:
In m_megapullup() use m_getjcl() to allocate 9k or 16k mbuf when requested.
It is better to try allocate a big mbuf, than just silently drop a big
packet. A better solution could be reworking of libalias modules to be
able use m_copydata()/m_copyback() instead of requiring the single
contiguous buffer.
dim [Thu, 21 Jun 2018 09:45:03 +0000 (09:45 +0000)]
MFC r335297:
Fix build of ndis with base gcc on i386
Casting from rman_res_t to a pointer results in "cast to pointer from
integer of different size" warnings with base gcc on i386, so use an
intermediate cast to uintptr_t to suppress it. In this case, the I/O
port range is effectively limited to the range of 0..65535.
dim [Thu, 21 Jun 2018 09:41:44 +0000 (09:41 +0000)]
MFC r335296:
Fix build of aibs with base gcc on i386
Add a few intermediate casts to intptr_t to suppress "cast to pointer
from integer of different size" warnings from gcc. In this case, the
'arg2' part of SYSCTL_HANDLER_ARGS is used to pass in a pointer, via an
intermediate intmax_t, so no information is lost.
hselasky [Wed, 20 Jun 2018 06:48:41 +0000 (06:48 +0000)]
MFC r334714:
Rename two structure field members while keeping backwards compatibility in
the LinuxKPI. Add a comment saying in which Linux version this change was made.
hselasky [Wed, 20 Jun 2018 06:39:32 +0000 (06:39 +0000)]
MFC r334660:
Add "access" function pointer to the "vm_operations_struct" structure
in the LinuxKPI. While at it document when to use the "virtual_address" or
the "address" field in the "vm_fault" structure.
r330878: Fix typo and lint/igor warnings
r330879: Fix lint/igor warnings
r330939: Use full month in dpv(3), figpar(3), and bsdconfig(8) manuals
r330948: Bump copyright following recent changes
dteske [Wed, 20 Jun 2018 05:45:41 +0000 (05:45 +0000)]
dpv(3): MFC r330943, r335264
r330943:
Fix bad error messages from dpv(3)
Before = dpv: <__func__>: posix_spawnp(3): No such file or directory
After = dpv: <path/cmd>: No such file or directory
Most notably, show the 2nd argument being passed to posix_spawnp(3)
so we know what path/cmd failed.
Also, we don't need to have "posix_spawnp(3)" in the error message
nor the function because that can [a] change and [b] traversed using
a debugger if necessary.
r335264:
Fix comparison between pointer and char literal
PR: misc/204252
Reported by: David Binderman <dcb314@hotmail.com>
Sponsored by: Smule, Inc.
dteske [Wed, 20 Jun 2018 05:10:30 +0000 (05:10 +0000)]
MFC r335277:
sysrc(8): Exit with failure on API error
Fix exit status when f_sysrc_set() fails. Errors in the underlying API
provided by bsdconfig(8) -- /usr/share/bsdconfig/sysrc.subr -- were not
being communicated back to the command-line. This was affecting ansible
modules using sysrc as they were not able to accurately test for error.
PR: bin/211448
Reported by: Christian Schwarz <me@cschwarz.com>
Sponsored by: Smule, Inc.
dim [Sun, 17 Jun 2018 17:38:24 +0000 (17:38 +0000)]
MFC r335034:
Fix build of liquidio with base gcc on i386
Some casts from pointers to uint64_t and back in lio_main.c cause base
gcc on i386 to warn "cast from pointer to integer of different size",
and vice versa. Add additional casts to uintptr_t to suppress these.
dim [Sun, 17 Jun 2018 17:32:32 +0000 (17:32 +0000)]
MFC r334945:
Fix build of ocs_fs with base gcc on i386
Add a few intermediate casts to uintptr_t to suppress "cast to pointer
from integer of different size" warnings from gcc. Also remove a few
incorrect casts.
dim [Sun, 17 Jun 2018 17:28:27 +0000 (17:28 +0000)]
MFC r334948:
Fix build of bxe with base gcc on i386
Casting from rman_res_t to a pointer results in "cast to pointer from
integer of different size" warnings with base gcc on i386, so print
these without casting. The kva field of struct bxe_bar is of type
vm_offset_t, which can be 32 or 64 bit, so cast it to uintmax_t before
printing.
dim [Sun, 17 Jun 2018 17:24:57 +0000 (17:24 +0000)]
MFC r334946:
Fix build of i915kms with base gcc
Base gcc fails to compile sys/dev/drm2/i915/intel_display.c for i386,
with the following -Werror warnings:
cc1: warnings being treated as errors
/usr/src/sys/dev/drm2/i915/intel_display.c:8884: warning:
initialization from incompatible pointer type
This is due to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=36432, which
incorrectly interprets the [] as a flexible array member.
Because base gcc does not have a -W flag to suppress this particular
warning, it requires a rather ugly cast. To not influence any other
compiler, put it in a #if/#endif block.
kp [Sat, 16 Jun 2018 09:32:05 +0000 (09:32 +0000)]
MFC r334876:
pf: Fix deadlock with route-to
If a locally generated packet is routed (with route-to/reply-to/dup-to) out of
a different interface it's passed through the firewall again. This meant we
lost the inp pointer and if we required the pointer (e.g. for user ID matching)
we'd deadlock trying to acquire an inp lock we've already got.
Pass the inp pointer along with pf_route()/pf_route6().
mav [Thu, 14 Jun 2018 18:18:55 +0000 (18:18 +0000)]
MFC r325794, r325838 (by imp):
Provide link speed data in XPT_GET_TRAN_SETTINGS. Provide full version
information for that and XPT_PATH_INQ. Provide macros to encode/decode
major/minor versions. Read the link speed and lane count to compute
the base_transfer_speed for XPT_PATH_INQ.
mav [Thu, 14 Jun 2018 17:09:33 +0000 (17:09 +0000)]
MFC r333180: Fix LOR between controller and queue locks.
Admin pass-through requests took controller lock before the queue lock,
but in case of request submission to a failed controller controller lock
was taken after the queue lock. Fix that by reducing the lock scopes and
switching to mtx_pool locks to track pass-through request completion.
This change allows clean device detach on attach failures and driver unload,
while previous code tried to talk to already shut down controller, or even
accessed resources failed to allocate.
mav [Thu, 14 Jun 2018 16:51:39 +0000 (16:51 +0000)]
MFC r331046 (by imp): Try polling the qpairs on timeout.
On some systems, we're getting timeouts when we use multiple queues on
drives that work perfectly well on other systems. On a hunch, Jim
Harris suggested I poll the completion queue when we get a timeout.
This patch polls the completion queue if no fatal status was
indicated. If it had pending I/O, we complete that request and
return. Otherwise, if aborts are enabled and no fatal status, we abort
the command and return. Otherwise we reset the card.
This may clear up the problem, or we may see it result in lots of
timeouts and a performance problem. Either way, we'll know the next
step. We may also need to pay attention to the fatal status bit
of the controller.
mav [Thu, 14 Jun 2018 16:19:05 +0000 (16:19 +0000)]
MFC r330954, r330955 (by imp):
When tearing down a queue pair, also delete the queue entries.
The NVME standard has required in section 7.2.6, since at least 1.1,
that a clean shutdown is signalled by deleting the subission and the
completion queues before setting the shutdown bit in CC. The 1.0
standard, apparently, did not and many of the early Intel cards didn't
care. Some newer cards care, at least one whose beta firmware can
scramble the card on an unclean shutdown. Linux has done this for some
time. To make it possible to move forward with an evaluation of this
pre-release card with wonky firmware, delete the queues on the card
when we delete the qpair structures.
mav [Thu, 14 Jun 2018 14:58:51 +0000 (14:58 +0000)]
MFC r328089 (by imp):
Move setting of CAM_SIM_QUEUED to before we actually submit it to the
hardware. Setting it after is racy, and we can lose the race on a
heavily loaded system.
dim [Wed, 13 Jun 2018 20:33:52 +0000 (20:33 +0000)]
Fix build of si with base gcc on i386
Casting from rman_res_t to a pointer results in "cast to pointer from
integer of different size" warnings with base gcc on i386, so use
intermediate casts to uintptr_t to suppress these.
Direct commit to stable/11, since si(4) has been removed from head.
This commit brings syslogd(8) in sync with the copy in HEAD. The key
improvement of this change is that it adds support for RFC 5424 log
ingestion and exposition (enabled by passing in -O rfc5424). This allows
for saner logging in environments with multiple time zones.
The list of changes to merge back were obtained by running:
Of the commits listed, r314436, r325188 and r326025 were excluded, as
they affect a significant number of unrelated files (SPDX and 4-clause
license renumbering). Due to the large number of directly committed
changes on this branch, I had no choice but to perform the merge as
follows:
svn merge --accept=theirs-full -c <list of revisions> ^/head .
This would, however, cause some unrelated changes, such as undoing the
r333356 (MFC of r332877) and still adding the SPDX tag to syslogd.c.
These have been reverted manually.
Requested by: Dave Cottlehuber
Thanks to: dim@ for sharing his insight on hackers@
kp [Wed, 13 Jun 2018 13:15:04 +0000 (13:15 +0000)]
MFC r334726:
pf: Return non-zero from 'status' if pf is not enabled
In the pf rc.d script the output of `/etc/rc.d/pf status` or `/etc/rc.d/pf
onestatus` always provided an exit status of zero. This made it fiddly to
programmatically determine if pf was running or not.
Return a non-zero status if the pf module is not loaded, extend pfctl to have
an option to return an error status if pf is not enabled.
PR: 228632
Submitted by: James Park-Watt <jimmypw AT gmail.com>
ae [Wed, 13 Jun 2018 07:17:10 +0000 (07:17 +0000)]
MFC r334875:
Explicitly change the link state when we assingn an address.
Since we are setting IFF_UP flag on SIOCSIFADDR, it is possible, that
after this link state information still not initialized properly.
This leads to problems with routing, since now interface has
IFCAP_LINKSTATE capability and a route is considered as working only
when interface's link state is in LINK_STATE_UP (see RT_LINK_IS_UP()
macro).
ian [Sun, 10 Jun 2018 22:26:15 +0000 (22:26 +0000)]
MFC r334656, r334665, r334695
r334656:
Add vsnprintf() to libsa. Alpha-sort the printf prototypes in stand.h.
r334665:
Make the v*printf() functions in libsa return int instead of void.
This makes them compatible with the C standard signatures, avoiding
spurious mismatch errors in the places where the oddball requirements
of standalone code end up putting two declarations of the same function
in play.
r334695:
Remove comments and assertions that are no longer valid after r330809.
r330809 replaced duplication of devdesc struct fields with an embedded copy
of the devdesc struct, to avoid fragility. That means all the scattered
comments indicating that structs must match are no longer valid. Likewise
asserts that attempted to mitigate some of the old fragility.
MFC r333403:
Bring in some last changes in NAT64 implementation:
o Modify ipfw(8) to be able set any prefix6 not just Well-Known,
and also show configured prefix6;
o relocate some definitions and macros into proper place;
o convert nat64_debug and nat64_allow_private variables to be
VNET-compatible;
o add struct nat64_config that keeps generic configuration needed
to NAT64 code;
o add nat64_check_prefix6() function to check validness of specified
by user IPv6 prefix according to RFC6052;
o use nat64_check_private_ip4() and nat64_embed_ip4() functions
instead of nat64_get_ip4() and nat64_set_ip4() macros. This allows
to use any configured IPv6 prefixes that are allowed by RFC6052;
o introduce NAT64_WKPFX flag, that is set when IPv6 prefix is
Well-Known IPv6 prefix. It is used to reduce overhead to check this;
o modify nat64lsn_cfg and nat64stl_cfg structures to use nat64_config
structure. And respectivelly modify the rest of code;
o remove now unused ro argument from nat64_output() function;
o remove __FreeBSD_version ifdef, NAT64 was not merged to older versions;
o add commented -DIPFIREWALL_NAT64_DIRECT_OUTPUT flag to module's Makefile
as example.
MFC r333406:
Update NAT64 documentation, now we support any IPv6 prefixes.
tuexen [Thu, 7 Jun 2018 17:43:31 +0000 (17:43 +0000)]
MFC r334725:
Improve compliance with RFC 4895 and RFC 6458.
Silently dicard SCTP chunks which have been requested to be
authenticated but are received unauthenticated no matter if support
for SCTP authentication has been negotiated. This improves compliance
with RFC 4895.
When the application uses the SCTP_AUTH_CHUNK socket option to
request a chunk to be received in an authenticated way, enable
the SCTP authentication extension for the end-point. This improves
compliance with RFC 6458.
Discussed with: Peter Lei
Approved by: re (gjb, early MFC)
marius [Thu, 7 Jun 2018 15:03:47 +0000 (15:03 +0000)]
MFC: r334443 (by cem@)
dhclient(8): allow to supersede interface-mtu option
In some cases broken DHCP servers might send invalid MTU value, so allow to
use 'supersede' in dhclient.conf to override this. When superseded value is
0, MTU value is not updated at all.