Commit Graph

223369 Commits

Author SHA1 Message Date
Enji Cooper
981aa50fc2 Fix -Wunused and -Wshadow warnings
MFC after:	3 days
Sponsored by:	Dell EMC Isilon
2017-05-28 05:26:45 +00:00
Enji Cooper
91c53523fd getgr_test: fix -Wunused warnings
MFC after:	3 days
Sponsored by:	Dell EMC Isilon
2017-05-28 04:43:02 +00:00
Enji Cooper
87a9deed3c getpw_test: fix -Wunused warnings
- Mark unused parameters __unused.
- Put dump_passwd under DEBUG as it's only used in that case.

MFC after:	3 days
Sponsored by:	Dell EMC Isilon
2017-05-28 04:41:06 +00:00
Enji Cooper
58c03e4e08 gethostby_test: fix multiple warning types
- Fix -Wmissing-declaration warning by staticizing run_tests.
- Fix -Wsign-compare warnings by casting size_t types to int
  for comparisons.

Reindent some of the code in sdump_hostent(..) to accomodate the
overall changes.

MFC after:	3 days
Sponsored by:	Dell EMC Isilon
2017-05-28 04:34:57 +00:00
Enji Cooper
42f519347e getproto_test: fix -Wunused warnings
Mark unused parameters __unused in functions.

MFC after:	3 days
Sponsored by:	Dell EMC Isilon
2017-05-28 04:15:57 +00:00
Enji Cooper
eaff481c05 getrpc_test: fix -Wunused warnings
- Mark unused function parameters unused.
- Remove an unused function prototype.

MFC after:	3 days
Sponsored by:	Dell EMC Isilon
2017-05-28 04:15:05 +00:00
Enji Cooper
2b19d77418 getserv_test: mark unused parameters __unused to fix corresponding
warnings

MFC after:	3 days
Sponsored by:	Dell EMC Isilon
2017-05-28 04:12:52 +00:00
Enji Cooper
93ee3b7e9b getusershell_test: mark mdata parameter in compare_usershell __unused
MFC after:	3 days
Sponsored by:	Dell EMC Isilon
2017-05-28 04:12:02 +00:00
Enji Cooper
bd8f63f25c getaddrinfo_test: mark unused function parameters __unused to fix -Wunused
warnings

MFC after:	3 days
Sponsored by:	Dell EMC Isilon
2017-05-28 04:11:04 +00:00
Enji Cooper
c4519040b5 getproto_test: fix -Wmissing-prototypes and -Wsign-compare warnings
MFC after:	3 days
Sponsored by:	Dell EMC Isilon
2017-05-28 04:05:19 +00:00
Enji Cooper
8b0fc406e5 getrpc_test: fix -Wmissing-prototypes and -Wsign-compare warnings
MFC after:	3 days
Sponsored by:	Dell EMC Isilon
2017-05-28 04:04:32 +00:00
Enji Cooper
905de51259 getaddrinfo_test: fix -Wsign-compare warnings
MFC after:	3 days
Sponsored by:	Dell EMC Isilon
2017-05-28 04:03:45 +00:00
Enji Cooper
93936a0653 getserv_test: fix -Wsign-compare and -Wmissing-prototypes warnings
MFC after:	3 days
Sponsored by:	Dell EMC Isilon
2017-05-28 04:03:06 +00:00
Enji Cooper
bbccc5a736 getusershell_test: staticize run_tests(..) to fix warnings
MFC after:	3 days
Sponsored by:	Dell EMC Isilon
2017-05-28 03:58:36 +00:00
Enji Cooper
4a9a8952c0 Fix -Wsign-compare warnings
MFC after:	3 days
Sponsored by:	Dell EMC Isilon
2017-05-28 03:47:58 +00:00
Enji Cooper
bd874c6a7f Staticize functions and remove unused variables to aid with bumping WARNS
MFC after:	3 days
Sponsored by:	Dell EMC Isilon
2017-05-28 03:42:49 +00:00
Enji Cooper
ae8cdfddc3 Sort make variables to suit style.Makefile(5)
This is being done prior to functional changes.

MFC after:	3 days
Sponsored by:	Dell EMC Isilon
2017-05-28 03:39:24 +00:00
Enji Cooper
3bdd6cf05d lib/libc/tests/nss: use calloc appropriately
The pattern used prior to this commit was `calloc(1, n * sizeof(type))`;
the pattern that should be used however is `calloc(n, sizeof(type))`.

MFC after:	3 days
Sponsored by:	Dell EMC Isilon
2017-05-28 02:55:04 +00:00
Enji Cooper
b8504cc0a6 pw: add some basic testcases for groupshow and usershow
- groupshow: test out -a/-g/-n .
- usershow: test out -a/-n/-u .

MFC after:	1 week
Sponsored by:	Dell EMC Isilon
2017-05-28 02:15:57 +00:00
Eric van Gyzen
c9d34d6652 Fix INSTALL_AS_USER with external nsswitch databases
The INSTALL_AS_USER option tells "install" to use the current
user name as the owner of the installed file.  The "install"
command executed by the build is statically linked, so it does not
load nsswitch modules, such as nss_ldap.so, so it fails when
the user is only defined in such a database.

Fix it to use the current UID instead of user name.  This works
for all users.  I expect it is also slightly more efficient.

Reviewed by:	sjg
MFC after:	3 days
Sponsored by:	Dell EMC
Differential Revision:	https://reviews.freebsd.org/D10862
2017-05-28 00:45:28 +00:00
Eric van Gyzen
4f2bab59e7 Fix INSTALL_AS_USER
Move INSTALL_AS_USER into bsd.init.mk to maximize the chance that
it has final authority over fooOWN and fooGRP.

Reviewed by:	sjg
MFC after:	3 days
Sponsored by:	Dell EMC
Differential Revision:	https://reviews.freebsd.org/D10810
2017-05-28 00:43:12 +00:00
Enji Cooper
3d98877013 Remove getpagesize(3) error checking added in r317312
getpagesize(3) no longer fails as of r317436.

MFC after:	3 days
Sponsored by:	Dell EMC Isilon
2017-05-28 00:28:11 +00:00
Enji Cooper
73dcfb8ddc Use calloc instead of malloc + memset
MFC after:	3 days
Sponsored by:	Dell EMC Isilon
2017-05-27 23:57:09 +00:00
Enji Cooper
9f825b1b1d Fix #if conditional added in r319008
I committed an earlier version of the file by accident

This is a no-op on ^/head and ^/stable/11.

MFC after:	now
Sponsored by:	Dell EMC Isilon
2017-05-27 23:23:22 +00:00
Enji Cooper
fbf8ca6df8 kvm_geterr_test: Compile out the portions that require kvm_open2(3) on
systems that lack the libcall, based on __FreeBSD_version.

kvm_open2(3) wasn't made available until r291406, which is in ^/stable/11,
but not ^/stable/10. This makes some of kvm_geterr_test available for testing
on ^/stable/10.

MFC after:	now
Sponsored by:	Dell EMC Isilon
2017-05-27 23:19:32 +00:00
Enji Cooper
80c5ef109c :rgrep : use atf-check to check the exit code/save the output of grep -r instead
of calling grep -r without it, and saving the output to a file

This ensures that any errors thrown via grep -r are caught, not lost, and uses
existing atf-sh idioms for saving files.

Tested with:	bsdgrep, gnu grep (base, ports)
Sponsored by:	Dell EMC Isilon
2017-05-27 22:40:20 +00:00
Alan Cox
07c348ea7b After r118390, the variable "dmmax" was neither the correct strip size
nor the correct maximum block size.  Moreover, after r318995, it serves
no purpose except to provide information to user space through a read-
sysctl.

This change eliminates the variable "dmmax" but retains the sysctl.  It
also corrects the value returned by the sysctl.

Reviewed by:	kib, markj
MFC after:	3 days
2017-05-27 21:46:00 +00:00
Pedro F. Giffuni
8bc5011859 Align text correctly by using tabs instead of spaces.
The text was copy-pasted from the lines that carry the bogus spaces.
This is a non-functional change.
2017-05-27 20:01:50 +00:00
Baptiste Daroussin
04238e0a32 Update the comments concerning net_parse_rootpath to reflect what it is now
really doing

Reported by:	rgrimes
Reviewed by:	rgrimes
Differential Revision:	https://reviews.freebsd.org/D10959
2017-05-27 18:46:00 +00:00
Cy Schubert
243567356b Fix return value of ip_sync_nat. Previously, regardless of error it
always returned a return code of 0.

Obtained from:	NetBSD ip_sync.c r1.5
MFC after:	1 week
2017-05-27 18:01:14 +00:00
Konstantin Belousov
03311f117b Use whole mnt_stat.f_fsid bits for st_dev.
Since ino64 expanded dev_t to 64bit, make VOP_GETATTR(9) provide all
bits of mnt_stat.f_fsid as va_fsid for vnodes on filesystems which use
f_fsid.  In particular, NFSv3 and sometimes NFSv4, and ZFS use this
method or reporting st_dev by stat(2).

Provide a new helper vn_fsid() to avoid duplicating code to copy
f_fsid to va_fsid.

Note that the change is mostly cosmetic.  Its motivation is to avoid
sign-extension of f_fsid[0] into 64bit dev_t value which happens after
dev_t becomes 64bit..

Reviewed by:	avg(zfs), rmacklem (nfs) (both for previous version)
Sponsored by:	The FreeBSD Foundation
2017-05-27 17:00:30 +00:00
John Baldwin
708e72dc37 Add descriptions for AES-GCM IPSec authentication (AH) counters.
MFC after:	1 week
Sponsored by:	Chelsio Communications
2017-05-27 16:53:39 +00:00
Alan Cox
fe71561af2 In r118390, the swap pager's approach to striping swap allocation over
multiple devices was changed.  However, swapoff_one() was not fully and
correctly converted.  In particular, with r118390's introduction of a per-
device blist, the maximum swap block size, "dmmax", became irrelevant to
swapoff_one()'s operation.  Moreover, swapoff_one() was performing out-of-
range operations on the per-device blist that were silently ignored by
blist_fill().

This change corrects both of these problems with swapoff_one(), which will
allow us to potentially increase MAX_PAGEOUT_CLUSTER.  Previously,
swapoff_one() would panic inside of blist_fill() if you increased
MAX_PAGEOUT_CLUSTER.

Reviewed by:	kib, markj
MFC after:	3 days
2017-05-27 16:40:00 +00:00
Baptiste Daroussin
b5b274ce12 Catch with the change in the user class 2017-05-27 14:07:46 +00:00
Baptiste Daroussin
5a95bf085c Use the usual FreeBSD spelling for the DHCP user class
Reported by:	lidl
2017-05-27 14:06:57 +00:00
Baptiste Daroussin
4e2a7b5c99 Capitalize DHCP
Reported by:	danfe
2017-05-27 13:55:20 +00:00
Baptiste Daroussin
aff810f1b2 Document recent changes on pxeboot 2017-05-27 13:26:18 +00:00
Baptiste Daroussin
e9ce925773 Partially revert r314948
While it sounds like a good idea to extract the RFC1048 data from PXE, in the
end it is not and it is causing lots of issues.  Our pxeloader might need
options which are incompatible with other pxe servers (for example iPXE, but
not only).

Our pxe loaders are also now settings their own user class, so it is useful to
issue our own pxe request at startup

Reviewed by:	tsoome
Differential Revision:	https://reviews.freebsd.org/D10953
2017-05-27 12:46:46 +00:00
Baptiste Daroussin
4dfd16670e Always issue the pxe request
All the code are now only issueing one single dhcp request at startup of the
loader meaning we can always request a the PXE informations from the
dhcp server.

Previous code lost that information, meaning no option 55 anymore (meaning not
working with the kea dhcp server) and no request for rootpath etc, no user class

Remove the flags from the bootp function which is not needed anymore

Reviewed by:	tsoome
Differential Revision:	https://reviews.freebsd.org/D10952
2017-05-27 12:35:01 +00:00
Baptiste Daroussin
5fe86cd909 Always build tftpfs support along with nfs for pxeboot
This change was already done for loader.efi
2017-05-27 12:20:13 +00:00
Baptiste Daroussin
404f5b6b29 Support URI scheme for root-path in netbooting
Rather that previous attempts to add tftpfs support at the same time as NFS
support. This time decide on a proper URI parser rather than hacks.

root-path can now be define the following way:
For tftpfs:

tftp://ip/path
tftp:/path (this one will consider the tftp server is the same as the one where
the pxeboot file was fetched from)

For nfs:
nfs:/path
nfs://ip/path

The historical
ip:/path
/path

are kept on NFS

Reviewed by:	tsoom, rgrimes
Differential Revision:	https://reviews.freebsd.org/D10947
2017-05-27 12:06:52 +00:00
Baptiste Daroussin
b2390b67da add a comment on vendor index 19 and 20 to avoid confusion
Suggested by:	tsoome
2017-05-27 11:41:54 +00:00
Baptiste Daroussin
6180f83d95 Pass a "FREEBSD" user-class in PXE dhcp request
rfc3004 allows to pass multiple user classes on dhcp requests
this is used by dhcp servers to differentiate the caller if needed.

As an example with isc dhcp server it will be possible to make options
only for the FreeBSD loaders:

if exists user-class and option user-class = "FREEBSD" {
   option root-path "tftp://192.168.42.1/FreeBSD;
}

Reviewed by:	tsoome
Differential Revision:	https://reviews.freebsd.org/D10951
2017-05-27 10:50:35 +00:00
Xin LI
335917f071 Tighten /entropy permissions.
PR:		219527
Reported by:	Lu Tung-Pin <lutungpin at openmailbox.org>
Submitted by:	jilles
MFC after:	3 days
2017-05-27 06:24:06 +00:00
Ed Maste
ef7161e774 uart: add AMT SOL PCI ID
I adjusted the description to be similar to existing AMT entries.

PR:		219384
Submitted by:	"Tooker"
MFC after:	1 week
2017-05-27 02:07:22 +00:00
Navdeep Parhar
7de5a71e79 libcxgb4: Use memcpy instead of copying WRs 8B at a time in the userspace
RDMA library for cxgbe(4).

MFC after:	3 days
Sponsored by:	Chelsio Communications
2017-05-27 02:05:21 +00:00
Alexander Motin
41cf0d54a2 Call VLAN_CAPABILITIES() when LAGG capabilities change.
This makes VLAN on top of LAGG to expose proper capabilities if they are
changed after creation.

MFC after:	1 week
2017-05-26 22:22:48 +00:00
Conrad Meyer
95b978955c procstat(1): Add TCP socket send/recv buffer size
Add TCP socket send and receive buffer size to procstat -f output.

Reviewed by:	kib, markj
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D10689
2017-05-26 22:17:44 +00:00
Brooks Davis
fbf87d4016 Add missing usage and getopt(3) options
- Add the missing option 'n' to the getopt(3) string
- Add the missing options 'libxo' and 'N' to the usage message
- Add the missing options 'M' and 'N' to the man-page

Submitted by:	Keegan Drake H.P. <kdrakehp@zoho.com>
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D10915
2017-05-26 21:10:01 +00:00
John Baldwin
d68990a14c Fail large requests with EFBIG.
The adapter firmware in general does not accept PDUs larger than 64k - 1
bytes in size.  Sending crypto requests larger than this size result in
hangs or incorrect output, so reject them with EFBIG.  For requests
chaining an AES cipher with an HMAC, the firmware appears to require
slightly smaller requests (around 512 bytes).

Sponsored by:	Chelsio Communications
2017-05-26 20:20:40 +00:00