Commit Graph

8242 Commits

Author SHA1 Message Date
Pedro F. Giffuni
312717174d sbin: use our howmany() macro when available through <sys/param.h>. 2016-05-01 02:19:49 +00:00
Pedro F. Giffuni
e451cf5f4c restore: fix memory leak.
CID:		272297
MFC after:	5 days
2016-04-30 22:51:09 +00:00
Pedro F. Giffuni
cac8854eb6 restore: use our howmany() instead of reinventing the macro. 2016-04-30 20:05:23 +00:00
Pedro F. Giffuni
fbcfcbbc5b fdisk: drop unused macro and make use of roundup()/rounddown(). 2016-04-30 19:58:54 +00:00
Pedro F. Giffuni
b68ac8007d sbin: minor spelling fixes.
No functional change.
2016-04-30 19:04:59 +00:00
Glen Barber
49dae58b28 Fix including Kyuafile in packaged base system.
Fix a related typo while here.

Note, this change results in the Kyuafile inclusion in the runtime
package, which needs to be fixed, however addresses the PR as far
as I can tell in my tests.

PR:		209114
Submitted by:	ngie
Sponsored by:	The FreeBSD Foundation
2016-04-29 05:28:40 +00:00
Enji Cooper
dc8a83a5b6 Remove logically impossible test in scsidoinquiry(..)
It was already done 4 lines prior and the value of error didn't change

MFC after: 3 days
Reported by: Coverity
CID: 1011236
Sponsored by: EMC / Isilon Storage Division
2016-04-28 21:17:23 +00:00
Marcelo Araujo
7de7df1554 Use macro MIN() from sys/param.h.
MFC after:	2 weeks.
2016-04-27 02:02:44 +00:00
Pedro F. Giffuni
11ec5dd04b fsck_ffs: Revert partially the unsigned changes.
Any value of uint16_t will be internally promoted to int so
changing them to an unsigned value doesn't help.

Missing revert value in suj_read().

X-MFC with:	r298551
2016-04-27 01:36:25 +00:00
Pedro F. Giffuni
4235bafa7e fsck_ffs: Revert partially the unsigned changes.
Any value of uint16_t will be internally promoted to int so
changing them to an unsigned value doesn't help.

Make clear we want to use uint32_t for closedisk()

X-MFC with:	r298551
2016-04-27 01:32:11 +00:00
Alan Somers
96edd3f3ee Add GEOM::physpath documentation to devd.conf(5)
Suggested by:	trasz
Reviewed by:	trasz
MFC after:	4 weeks
Sponsored by:	Spectra Logic Corp
Differential Revision:	https://reviews.freebsd.org/D6063
2016-04-26 14:48:58 +00:00
Adrian Chadd
6605a047e7 [ifconfig] add STBC TX/RX configuration
This adds the ability to view and configure the STBC parameter for
both transmit and receive.

Whilst here, fix a typo for AMSDU.

TODO:

* manpage update
2016-04-26 01:30:29 +00:00
Pedro F. Giffuni
de497205b0 ifconfig: prevent some improbable signed integer overflows.
ic_nchans, from struct:ieee80211req_chaninfo, is an unsigned int.
Use an unsigned index to prevent overflowing the index.

Adopt unsigned integers in other cases where it is useful
to be aware of the unsigned quantities and there is no
risk of the values being negative.

MFC after:	1 week
2016-04-25 00:41:23 +00:00
Pedro F. Giffuni
0f8c0b0ae4 fsck_ffs: Adopt some type safety for the journalling checks.
fs_ncg is of type uint32, and we were indexing it with an int.
Fixed this using an unsigned type and adopt some other unsigned
indexes to remind us when we are dealing with unsigned numbers.

Reviewed by:	mckusick
MFC after:	5 days
2016-04-24 20:31:22 +00:00
Marcelo Araujo
091ea4a091 Use macro MAX() from sys/param.h.
MFC after:	2 weeks.
2016-04-22 03:32:14 +00:00
Marcelo Araujo
f4b72a8dd2 Use MIN()/MAX() macros from sys/param.h.
MFC after:	2 weeks.
2016-04-21 06:24:13 +00:00
Marcelo Araujo
67210fb3b8 Use MAX() from sys/param.h.
MFC after:	2 weeks.
2016-04-21 06:21:33 +00:00
Marcelo Araujo
6a25181bba Fix a missing blank space. 2016-04-21 06:14:30 +00:00
Marcelo Araujo
2d123458af Simplify the get_type() function.
Submitted by:	bde
Discussed with:	bde, jhb and pfg
MFC after:	2 weeks.
2016-04-21 06:11:24 +00:00
Sepherosa Ziehau
dd09ce3930 dhclient: Log a warning instead of bailing upon "illegal" options
In Azure, the DHCP servers add private option (id 0xf5), which contains
binary form of an IPv4 address. Once this option is converted to string
form, it could contain '$', e.g.

IPv4 address: 100.72.36.54
binary form: 0x64 0x48 0x24 0x36
string form: "dH$6"

dhclient bails upon "illegal" options like the above example, thus the
VM bring-up will fail.

Also as a side note, this "illegal" option detection was added in
OpenBSD ~11years ago:
http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/sbin/dhclient/dhclient.c?rev=1.50&content-type=text/x-cvsweb-markup

And it was removed along with the removal of script support in OpenBSD
~3years ago:
http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/sbin/dhclient/dhclient.c?rev=1.159&content-type=text/x-cvsweb-markup

Reported by:	Hongxiong Xian <v-hoxian microsoft com>
Reviewed by:	jhb, Dexuan Cui <decui microsoft com>
Tested by:	Hongxiong Xian <v-hoxian microsoft com>
Analyzed by:	Dong Liu <doliu microsoft com>
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D5853
2016-04-20 23:56:25 +00:00
Marcelo Araujo
974482aa61 Re-ident lines.
Requested by:	pfg
MFC after:	2 weeks.
2016-04-20 01:35:09 +00:00
Marcelo Araujo
fb4e4bd7f9 Use nitems() from sys/param.h.
MFC after:	2 weeks.
2016-04-20 01:05:54 +00:00
Marcelo Araujo
46df5db84e Use nitems() from sys/param.h.
MFC after:	2 weeks.
2016-04-20 00:55:35 +00:00
Enji Cooper
3ae587fde4 Don't leak fd on sectorsize malloc failure
Also, call endfsent after calling getfsent (i.e. when not explicitly called
with a swap device) for code cleanliness

CID: 1354785
Differential Revision: https://reviews.freebsd.org/D6014
X-MFC with: r298076
Reported by: Coverity
Reviewed by: cem
Sponsored by: EMC / Isilon Storage Division
2016-04-20 00:49:49 +00:00
Pedro F. Giffuni
05cfc40ab0 restore: use our roundup2/rounddown2() macros when param.h is available.
While here cleanup a little a malloc call.
2016-04-19 20:47:14 +00:00
Pedro F. Giffuni
4c8762f037 dump: use NULL instead of zero for pointers.
Clean out the casts from calloc(3) while here.
2016-04-19 19:13:33 +00:00
Pedro F. Giffuni
f3858ada3e fsck_msdosfs: use NULL instead of zero for pointers. 2016-04-19 19:08:37 +00:00
Edward Tomasz Napierala
e848a50ce6 Mention fsck_ffs -E in tunefs(8). It's non-obvious that one should
use it after enabling TRIM.

Reviewed by:	brueffer@
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D5928
2016-04-19 15:08:35 +00:00
Marcelo Araujo
286d197142 Use nitems() from sys/param.h.
MFC after:	2 weeks.
2016-04-19 11:12:57 +00:00
Marcelo Araujo
21eacf9800 Use nitems() from sys/param.h.
MFC after:	2 weeks.
2016-04-19 09:43:51 +00:00
Marcelo Araujo
1068140988 Use nitems() from sys/param.h.
MFC after:	2 weeks.
2016-04-19 06:34:31 +00:00
Marcelo Araujo
c52ee6c23b Use nitems() from sys/param.h.
MFC after:	2 weeks.
2016-04-19 06:32:35 +00:00
Adrian Chadd
49d1897d12 Add VHT power envelope parsing to ifconfig. 2016-04-19 05:17:43 +00:00
Marcelo Araujo
564500def9 Use nitems() from sys/param.h.
MFC after:	2 weeks.
2016-04-19 04:57:57 +00:00
Marcelo Araujo
8ee0576c6b Use nitems() from sys/param.h.
MFC after:	2 weeks.
2016-04-19 04:52:51 +00:00
Marcelo Araujo
dc53e146ce Use nitems() from sys/param.h.
MFC after:	2 weeks.
2016-04-19 04:52:13 +00:00
Marcelo Araujo
2f21908de4 Remove redundant parenthesis.
Submitted by:	pfg
MFC after:	2 weeks.
2016-04-19 04:46:13 +00:00
Marcelo Araujo
cf83e90307 Use nitems() from sys/param.h.
MFC after:	2 weeks.
2016-04-19 04:42:34 +00:00
Marcelo Araujo
aa07ba2aad Use nitems() from sys/param.h.
MFC after:	2 weeks.
2016-04-19 04:37:17 +00:00
Marcelo Araujo
0bfc2a1246 Use nitems() instead of sizeof(name) / sizeof(*name).
MFC after:	2 weeks.
2016-04-19 04:28:25 +00:00
Marcelo Araujo
e63ce3de7f malloc will return NULL if it cannot allocate memory.
MFC after:	2 weeks.
2016-04-19 02:00:48 +00:00
Marcelo Araujo
deaa3563c8 getfsent(3) will return NULL on EOF or error.
MFC after:	2 weeks.
2016-04-19 01:59:26 +00:00
Marcelo Araujo
028d447b59 Use NULL instead of 0 for pointers.
malloc will return NULL if it cannot allocate memory.

MFC after:	2 weeks.
2016-04-19 01:57:56 +00:00
Marcelo Araujo
14adaa14cb Use NULL instead of 0 for pointers.
dbopen(3) will returns a NULL on error.

MFC after:	2 weeks.
2016-04-19 01:25:35 +00:00
Marcelo Araujo
0b410d9c57 Use NULL instead of 0.
malloc will return NULL in case it cannot allocate memory.

MFC after:	2 weeks.
2016-04-19 01:01:22 +00:00
Marcelo Araujo
8e58be03e7 Use NULL for pointers instead of 0.
MFC after:	2 weeks.
2016-04-19 00:59:15 +00:00
Marcelo Araujo
ff129d6f87 User NULL instead of 0 for pointers.
gethostbyname(3) will return NULL in case of an error.

MFC after:	2 weeks.
2016-04-18 14:12:42 +00:00
Marcelo Araujo
edf6b683e8 Use NULL instead of 0 for pointers.
strchr(3) will return NULL if the character does not appear in the
string.

MFC after:	2 weeks.
2016-04-18 14:08:35 +00:00
Marcelo Araujo
7fd35136d9 Use NULL instead of 0 for pointers.
malloc will return NULL if it cannot allocate memory.

MFC after:	2 weeks.
2016-04-18 07:47:26 +00:00
Marcelo Araujo
cd5f6a0cc1 strchr(3) will return NULL if it cannot find the character in the
string.
getfsent(3) will return NULL on EOF or error.

MFC after:	2 weeks.
2016-04-18 07:44:53 +00:00
Marcelo Araujo
fb6a35935a Use NULL instead of 0 for pointers.
strchr(3) will return NULL if the character does not appear in the
string.

MFC after:	2 weeks.
2016-04-18 07:40:36 +00:00
Glen Barber
0edd2576c0 MFH
Sponsored by:	The FreeBSD Foundation
2016-04-16 02:32:12 +00:00
Pedro F. Giffuni
80c7cc1c8f Cleanup unnecessary semicolons from utilities we all love. 2016-04-15 22:31:22 +00:00
Conrad Meyer
fca8407655 savecore(8): Explicitly cast to fix i386 warning 2016-04-15 20:19:32 +00:00
Conrad Meyer
5dc5dab6eb Add 4Kn kernel dump support
(And 4Kn minidump support, but only for amd64.)

Make sure all I/O to the dump device is of the native sector size.  To
that end, we keep a native sector sized buffer associated with dump
devices (di->blockbuf) and use it to pad smaller objects as needed (e.g.
kerneldumpheader).

Add dump_write_pad() as a convenience API to dump smaller objects with
zero padding.  (Rather than pull in NPM leftpad, we wrote our own.)

Savecore(1) has been updated to deal with these dumps.  The format for
512-byte sector dumps should remain backwards compatible.

Minidumps for other architectures are left as an exercise for the
reader.

PR:		194279
Submitted by:	ambrisko@
Reviewed by:	cem (earlier version), rpokala
Tested by:	rpokala (4Kn/512 except 512 fulldump), cem (512 fulldump)
Relnotes:	yes
Sponsored by:	EMC / Isilon Storage Division
Differential Revision:	https://reviews.freebsd.org/D5848
2016-04-15 17:45:12 +00:00
Andrey V. Elsukov
2acdf79f53 Add External Actions KPI to ipfw(9).
It allows implementing loadable kernel modules with new actions and
without needing to modify kernel headers and ipfw(8). The module
registers its action handler and keyword string, that will be used
as action name. Using generic syntax user can add rules with this
action. Also ipfw(8) can be easily modified to extend basic syntax
for external actions, that become a part base system.
Sample modules will coming soon.

Obtained from:	Yandex LLC
Sponsored by:	Yandex LLC
2016-04-14 22:51:23 +00:00
Scott Long
846c7c0841 Update the devd.conf man page to describe the new CAM/periph system/subsystem.
MFC after:	3 days
Sponsored by:	Netflix
2016-04-14 22:03:23 +00:00
Luiz Otavio O Souza
db1bbde602 Make pfctl(8) more flexible when parsing bandwidth values.
This is the current behaviour in OpenBSD and a similar patch exist in
pfSense too.

Obtained from:	OpenBSD (partly - rev. 1.625)
MFC after:	2 weeks
Sponsored by:	Rubicon Communications (Netgate)
2016-04-14 18:37:40 +00:00
Andrey V. Elsukov
7b34dbe450 Fix output formatting of O_UNREACH6 opcode.
Obtained from:	Yandex LLC
2016-04-14 18:22:08 +00:00
Mark Johnston
ce2761f128 Include -a in the nextboot(8) usage string.
X-MFC-With: r297772
2016-04-14 18:03:55 +00:00
Glen Barber
9c831bbd69 MFH
Sponsored by:	The FreeBSD Foundation
2016-04-13 02:04:09 +00:00
Pedro F. Giffuni
7d5e656214 fsck_ffs for pointers replace 0 with NULL.
Found with devel/coccinelle.

Reviewed by:	mckusick
2016-04-12 22:55:47 +00:00
Glen Barber
a123f26e92 MFH
Sponsored by:	The FreeBSD Foundation
2016-04-12 17:00:13 +00:00
Alan Somers
2c6254c287 Fix an intermittent bug in sbin/devd/client_test.stream
In case where the two events were being received in separate reads, the
event buffer was being null-terminated at the wrong offset.

Also, factored out some common code between the tests, and fixed a comment.

Submitted by:	will
MFC after:	3 days
Sponsored by:	Spectra Logic Corp
2016-04-11 22:14:29 +00:00
Glen Barber
876d357fa7 MFH
Sponsored by:	The FreeBSD Foundation
2016-04-11 15:24:59 +00:00
Andrey V. Elsukov
b2d7040c1c Fix the problem, when gpart(8) can't write both bootcode and partcode
in one command due to wrong file size limit. Do not use bootcode size
to calculate partsize limit.
Also add report message about successful partcode writing.

Reported by:	Trond Endrestøl
MFC after:	2 weeks
2016-04-11 13:44:31 +00:00
Mark Johnston
8553156023 nextboot(8): add a -a option for appending to a configuration.
By default, a nextboot invocation will clobber any existing nextboot
configuration.

MFC after:	2 weeks
Relnotes:	yes
2016-04-10 01:25:12 +00:00
Allan Jude
d873662594 Create the GELIBOOT GEOM_ELI flag
This flag indicates that the user wishes to use the GELIBOOT feature to boot from a fully encrypted root file system.
Currently, GELIBOOT does not support key files, and in the future when it does, they will be loaded differently.
Due to the design of GELI, and the desire for secrecy, the GELI metadata does not know if key files are used or not, it just adds the key material (if any) to the HMAC before the optional passphrase, so there is no way to tell if a GELI partition requires key files or not.

Since the GELIBOOT code in boot2 and the loader does not support keys, they will now only attempt to attach if this flag is set. This will stop GELIBOOT from prompting for passwords to GELIs that it cannot decrypt, disrupting the boot process

PR:		208251
Reviewed by:	ed, oshogbo, wblock
Sponsored by:	ScaleEngine Inc.
Differential Revision:	https://reviews.freebsd.org/D5867
2016-04-08 01:25:25 +00:00
Pedro F. Giffuni
33bed970fa fsck_msdosfs(8): Optimimize memsets
Obtained from:	NetBSD (bin/50908)
MFC after:	2 weeks
2016-04-06 15:28:26 +00:00
Glen Barber
d60840138f MFH
Sponsored by:	The FreeBSD Foundation
2016-04-04 23:55:32 +00:00
Warner Losh
3b336ac34f Add a timestamp variable to the environment. This is when the event
was read from the kernel by devd.
2016-04-03 20:29:21 +00:00
Warner Losh
535595db8d Make $_ match the docs. 2016-04-03 20:29:14 +00:00
Pedro F. Giffuni
8f07cb00a5 restore(8): fix use of uninitialized value.
Prevent uninitialized use of scalar newvol when jumping to gethdr.

CID:	1006491
2016-03-31 02:01:11 +00:00
Edward Tomasz Napierala
225636dccb Fix bunch of .Xrs.
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2016-03-28 16:48:28 +00:00
Warner Losh
b3d322926d Sometimes, it's useful to export the entire line to an external
program without listening to the devd socket for all events. Define
two new pseudo variables $*, the entire event from devctl and $_,
the entire event without the type character, since it might be easier
to use in some circumstances.
2016-03-28 04:22:22 +00:00
Bryan Drewery
9c4c0cc214 Remove disconnected casperd, missed in r296047.
Reported by:	bz
2016-03-23 16:37:08 +00:00
Bryan Drewery
a774e11017 DIRDEPS_BUILD: Update dependencies.
Sponsored by:	EMC / Isilon Storage Division
2016-03-21 18:02:26 +00:00
Maxim Konovalov
028c7845c0 o Restore some good whitespace killed in the previous commit.
Spotted by:	bjk
2016-03-18 15:44:21 +00:00
Maxim Konovalov
61273736b3 o Kill EoL whitespaces. 2016-03-18 15:07:43 +00:00
Maxim Konovalov
f7fc5c9154 o No need to resolve a mask that we get with ICMP_MASKREPLY,
pass it directly to inet_ntoa(3).
2016-03-18 15:06:50 +00:00
Julian Elischer
637733b170 Add the ability to print out ht emodule specific information in likely formats.
Among other things this gives us the ability to find outthe syscall number of a dynamically loaded syscall that has a dynamicly allocated vector number.

MFC after:	1 week
Sponsored by:	Panzura inc.
2016-03-18 14:49:11 +00:00
Adrian Chadd
56fe6744fe Add parsing for AP channel report IE.
Eg:

TP-LINK_D579                     60:e3:27:e1:d5:79   10   54M  -72:-95   100 EP   SSID<TP-LINK_D579> RATES<B2,B4,B11,B22,18,36,72,108>
    DSPARMS<10> XRATES<12,24,48,96> COUNTRY<US  1-11,20> APCHANREP<class 32, chan:[1,2,3,4,5,6,7]> APCHANREP<class 33, chan:[5,6,7,8,9,10,11]>
    TIM<050400010000> ERP<0x4> HTCAP<cap 0x106e param 0x17 mcsset[0-15,32] extcap 0x0 txbf 0x0 antenna 0x0> HTINFO<ctl 10, 7,0,0,0 basicmcs[]>
    ???<4a0e14000a002c01c800140005001900> RSN<v1 mc:AES-CCMP uc:AES-CCMP km:8021X-PSK>
    WME<qosinfo 0x0 BE[aifsn 3 cwmin 4 cwmax 10 txop 0] BK[aifsn 7 cwmin 4 cwmax 10 txop 0] VO[aifsn 2 cwmin 3 cwmax 4 txop 94] VI[aifsn 2 cwmin 2 cwmax 3 txop 47]>
    BSSLOAD<sta count 0, chan load 11, aac 18> VEN<dd07000c4300000000>
2016-03-18 04:22:07 +00:00
Adrian Chadd
e3b60083ce Remove duplicate LE_READ_4() definition.
Tested:

* typed 'make', seemed to work.
2016-03-18 04:09:27 +00:00
Adrian Chadd
f6759842d9 Decode VHTCAP, VHTINFO and BSSLOAD.
BSSLOAD is based on work from Idwer Vollering.

Obtained from:	Idwer Vollering <vidwer@gmail.com> (bssload)
2016-03-18 03:55:57 +00:00
Adrian Chadd
1890c9065c Display the VHT IE names.
This doesn't decode the IEs just yet.

Tested:

* Archer c2 AP:

TP-LINK_D579_5G                  60:e3:27:e1:d5:78   44   54M   26:0     100 EP   SSID<TP-LINK_D579_5G> RATES<B12,18,B24,36,B48,72,96,108> DSPARMS<44> COUNTRY<US  36-48,20> TIM<050400010000> HTCAP<cap 0x6e param 0x16 mcsset[0-7,32] extcap 0x0 txbf 0x0 antenna 0x0> HTINFO<ctl 44, 5,0,0,0 basicmcs[]> VHTCAP<bf0c2000c031feff2401feff2401> VHTOPMODE<c005012a00feff> RSN<v1 mc:AES-CCMP uc:AES-CCMP km:8021X-PSK> WME<qosinfo 0x0 BE[aifsn 3 cwmin 4 cwmax 10 txop 0] BK[aifsn 7 cwmin 4 cwmax 10 txop 0] VO[aifsn 2 cwmin 3 cwmax 4 txop 94] VI[aifsn 2 cwmin 2 cwmax 3 txop 47]> BSSLOAD<0b05000001127a> VEN<dd07000c4300000000>
2016-03-16 06:27:57 +00:00
Hans Petter Selasky
95891718f5 Improve detection of extended QSFP diagnostics.
The standards in the QSFP diagnostics area are not clear when the
additional measurements are present or not. Use a valid temperature
reading as an indicator for the presence of voltage and TX/RX power
measurements.

MFC after:	1 week
Sponsored by:	Mellanox Technologies
Tested by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D5391
Reviewed by:	gallatin
2016-03-15 15:24:55 +00:00
Glen Barber
538354481e MFH
Sponsored by:	The FreeBSD Foundation
2016-03-14 18:54:29 +00:00
Adrian Chadd
523210fbaf [net80211] handle unlisted information elements.
This displays the IE names in ifconfig but it doesn't yet decode things.

Submitted by: Idwer Vollering <vidwer@gmail.com>
Differential Revision:	https://reviews.freebsd.org/D3782
2016-03-14 04:39:35 +00:00
Gleb Smirnoff
bb7dfe5e49 Allow minimum and maximum sweep size be the same.
Submitted by:	maxim
2016-03-11 21:06:17 +00:00
Dimitry Andric
b130d07f90 In nvmecontrol, fix gcc warnings about the local 'power' variables
shadowing a global declaration.
2016-03-11 17:25:18 +00:00
Maxim Konovalov
ed5e3d7a83 o Kill EoL whitespaces. No functional changes. 2016-03-11 16:03:47 +00:00
Maxim Konovalov
3c32812b1b o Xr icmp(4). 2016-03-11 15:29:00 +00:00
Maxim Konovalov
4323cae0bd o Document net.inet.icmp.maskfake and net.inet.icmp.tstamprepl sysctls. 2016-03-11 15:26:56 +00:00
Alexander Motin
c66784839b Allow standard commands for "unknown" classes in RESCUE mode.
For example, it allows quite useful `geom disk list` command.

MFC after:	1 week
2016-03-11 12:59:07 +00:00
Alex Kozlov
9bb18677ba - Implement -T option to allow to specify a fs type for a vnode-backed memory disk
- Rephrase -t option description (manpage)
- Split long sentences (manpage)

Differential Review:	https://reviews.freebsd.org/D4394

Reviewed by:	mav, wblock (manpage)
Approved by:	mav
2016-03-11 06:07:09 +00:00
Glen Barber
7d536dc855 MFH
Sponsored by:	The FreeBSD Foundation
2016-03-10 21:16:01 +00:00
Bryan Drewery
15c433351f DIRDEPS_BUILD: Connect MK_TESTS.
Sponsored by:	EMC / Isilon Storage Division
2016-03-09 22:46:01 +00:00
Andrey V. Elsukov
7aee4940a5 Set buffer to empty string to prevent duplicated output in some cases.
PR:		193888
2016-03-09 14:47:05 +00:00
Ed Maste
f9c821083a tunefs: clear the entire previous label when setting a new one
strlcpy(3) null terminates but does not zero-fill the buffer, so would
leave beind any portion of the previous volume label longer than the
new one.

Note that tunefs only allows -L args up to a length of MAXVOLLEN-1, so
the stored label will be null-terminated (whether or not required by
UFS).

Reviewed by:	imp
Sponsored by:	The FreeBSD Foundation
2016-03-07 19:14:26 +00:00
Glen Barber
7e2d468315 MFH
Sponsored by:	The FreeBSD Foundation
2016-03-07 15:44:54 +00:00
Alexander Motin
fd07a29ced Update meaning of -n argument.
Submitted by:	Dmitry Luhtionov <dmitryluhtionov@gmail.com>
MFC after:	1 week
2016-03-07 10:56:21 +00:00
Glen Barber
52259a98ad MFH
Sponsored by:	The FreeBSD Foundation
2016-03-02 16:14:46 +00:00
Edward Tomasz Napierala
4641226c6a carp(8) -> carp(4)
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2016-02-29 17:28:05 +00:00
Edward Tomasz Napierala
0ca11f9ded kenv(8) -> kenv(1)
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2016-02-29 17:22:34 +00:00
Bryan Drewery
3055a28d44 Update dependencies.
Sponsored by:	EMC / Isilon Storage Division
2016-02-26 22:14:15 +00:00
Mariusz Zaborski
c501d73c7e Convert casperd(8) daemon to the libcasper.
After calling the cap_init(3) function Casper will fork from it's original
process, using pdfork(2). Forking from a process has a lot of advantages:
1. We have the same cwd as the original process.
2. The same uid, gid and groups.
3. The same MAC labels.
4. The same descriptor table.
5. The same routing table.
6. The same umask.
7. The same cpuset(1).
From now services are also in form of libraries.
We also removed libcapsicum at all and converts existing program using Casper
to new architecture.

Discussed with:		pjd, jonathan, ed, drysdale@google.com, emaste
Partially reviewed by:	drysdale@google.com, bdrewery
Approved by:		pjd (mentor)
Differential Revision:	https://reviews.freebsd.org/D4277
2016-02-25 18:23:40 +00:00
Bryan Drewery
bd18fd57db DIRDEPS_BUILD: Regenerate without local dependencies.
These are no longer needed after the recent 'beforebuild: depend' changes
and hooking DIRDEPS_BUILD into a subset of FAST_DEPEND which supports
skipping 'make depend'.

Sponsored by:	EMC / Isilon Storage Division
2016-02-24 17:20:11 +00:00
Andrey V. Elsukov
23a6c7330c Fix bug in filling and handling ipfw's O_DSCP opcode.
Due to integer overflow CS4 token was handled as BE.

PR:		207459
MFC after:	1 week
2016-02-24 13:16:03 +00:00
Glen Barber
317cec3c43 MFH
Sponsored by:	The FreeBSD Foundation
2016-02-22 12:28:23 +00:00
Kristof Provost
6fe2e1762e ifconfig(8): can't use 'name' or 'description' when creating interface with auto numbering
If one does 'ifconfig tap create name blah', it will return error because the
'name' command doesn't properly populate the request sent to ioctl(...). The
'description' command has the same bug, and is also fixed with this patch.

If one does 'ifconfig tap create mtu 9000 name blah', it DOES work, but 'tap0'
(or other sequence number) is echoed, instead of the expected 'blah'. (assuming
the name change actually succeeded)

Submitted by:	Marie Helene Kvello-Aune <marieheleneka@gmail.com>
Differential Revision:	https://reviews.freebsd.org/D5341
2016-02-20 11:36:35 +00:00
Glen Barber
72c3aa02dc MFH
Sponsored by:	The FreeBSD Foundation
2016-02-18 00:37:58 +00:00
Bryan Drewery
9d8a81b4e4 DIRDEPS_BUILD: Update dependencies.
Sponsored by:	EMC / Isilon Storage Division
2016-02-16 02:14:30 +00:00
Glen Barber
3c76ad5c10 Include correct is*ct*l program in iscsi package, and package the
legacy version separately.

Submitted by:	trasz
Sponsored by:	The FreeBSD Foundation
2016-02-16 01:18:49 +00:00
Glen Barber
e01a93b63c Add devd and routed back to the runtime package instead
of their individual packages based on MK_foo evaluation.

There is no intent to split inet/inet6 or other similar
combinations for package creation, since they are created
during build time.

Noticed/prodded by:	lidl
Sponsored by:	The FreeBSD Foundation
2016-02-10 04:00:01 +00:00
Glen Barber
406d87b1c3 Explicitly add more files to the 'runtime' package.
Sponsored by:	The FreeBSD Foundation
2016-02-09 20:19:31 +00:00
Glen Barber
7de1daeb93 Create packages for atm, ccdconfig, devd, ipf, ipfw,
iscsi, natd, nandfs, pf, quotacheck, and routed.

Add ping6 and rtsol to the runtime package.

Sponsored by:	The FreeBSD Foundation
2016-02-09 19:30:31 +00:00
Glen Barber
bcefcb026a Create a package for HAST.
Sponsored by:	The FreeBSD Foundation
2016-02-08 21:15:07 +00:00
Glen Barber
0b8bc9c1d1 Create a 'casper' package.
Sponsored by:	The FreeBSD Foundation
2016-02-04 21:17:15 +00:00
Glen Barber
1f4bcc459a More 'tests' packaging fixes.
Sponsored by:	The FreeBSD Foundation
2016-02-03 19:08:45 +00:00
Glen Barber
221b349912 MFH
Sponsored by:	The FreeBSD Foundation
2016-02-02 22:27:48 +00:00
Glen Barber
43faedc133 First pass to fix the 'tests' packages.
Sponsored by:	The FreeBSD Foundation
2016-02-02 22:26:49 +00:00
Enji Cooper
24cd0f8516 Delete argsize to fix a -Wunused-but-set-variable warning with gcc 4.9
The variable isn't actually checked -- just the end result which gets
returned from the function

Differential Revision: https://reviews.freebsd.org/D5156
Reviewed by: araujo, delphij
MFC after: 1 month
Sponsored by: EMC / Isilon Storage Division
2016-02-01 08:06:17 +00:00
Enji Cooper
9650034d1a Remove r_tmp to fix a -Wunused-but-set-variable warning with gcc 4.9
MFC after: 1 month
Sponsored by: EMC / Isilon Storage Division
2016-02-01 07:15:31 +00:00
Warner Losh
038659e7dd Implement power command to list all power modes, find out the power
mode we're in and to set the power mode.
2016-01-30 22:48:06 +00:00
Ian Lepore
1cac26262e Make pfctl(8) work on strict-alignment platforms, by copying a pair of
embedded structures out of a packed, unaligned struct into local copies
on the stack which are aligned.

The original patch to do this was submitted by Guy Yur <guyyur@gmail.com>,
and this is conceptually the same change, but restructured with the
#ifndef __NO_STRICT_ALIGNMENT wrapper, similar to how the same issue is
handled in the kernel pf code.

PR:		185617
PR:		206658
2016-01-30 22:03:14 +00:00
Enji Cooper
a2d0c52540 Revert r295062 to unbreak buildworld
Some of the structures referenced in power.c (in particular
struct nvme_power_state) are missing from sbin/nvmecontrol/

Pointyhat to: imp
Reported by: Jenkins [*], O. Hartmann <ohartman@zedat.fu-berlin.de>, Outback Dingo <outbackdingo@gmail.com>
2016-01-30 17:10:14 +00:00
Warner Losh
d636ad2ee8 Implement power command to list all power modes, find out the power
mode we're in and to set the power mode.
2016-01-30 06:18:37 +00:00
Enji Cooper
fc7e71c52d Add pidfile support to ggated(8)
The tests will manipulate the system daemon today, which can cause undesired
service interruption when the tests are run.

This change allows the geom_gate tests to be run with an arbitrary ggated(8)
daemon / geom_gate(4) device pairing.

Other changes:
- Sort #includes
- Use a more common idiom for parsing options with getopt(3)

Differential Revision: https://reviews.freebsd.org/D4836
MFC after: 2 weeks
Reviewed by: bjk (manpages), pjd (maintainer timeout)
Sponsored by: EMC / Isilon Storage Division
2016-01-28 03:24:06 +00:00
Edward Tomasz Napierala
1b18fc10b3 Add "kldstat -h"; showing module sizes in hex is rather weird.
Reviewed by:	emaste@ (earlier version)
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D4969
2016-01-23 12:10:16 +00:00
Marcelo Araujo
d62edc5eb5 Add an IOCTL rr_limit to let users fine tuning the number of packets to be
sent using roundrobin protocol and set a better granularity and distribution
among the interfaces. Tuning the number of packages sent by interface can
increase throughput and reduce unordered packets as well as reduce SACK.

Example of usage:
# ifconfig bge0 up
# ifconfig bge1 up
# ifconfig lagg0 create
# ifconfig lagg0 laggproto roundrobin laggport bge0 laggport bge1 \
	192.168.1.1 netmask 255.255.255.0
# ifconfig lagg0 rr_limit 500

Reviewed by:	thompsa, glebius, adrian (old patch)
Approved by:	bapt (mentor)
Relnotes:	Yes
Differential Revision:	https://reviews.freebsd.org/D540
2016-01-23 04:18:44 +00:00
Warner Losh
4153c21113 Add ldconfig -soft to process the soft float abi libraries and put it
into startup scripts for armv6. It acts much like ldconfig -32 does.
2016-01-18 21:40:18 +00:00
Allan Jude
4332feca4b Make additional parts of sys/geom/eli more usable in userspace
The upcoming GELI support in the loader reuses parts of this code
Some ifdefs are added, and some code is moved outside of existing ifdefs

The HMAC parts of GELI are broken out into their own file, to separate
them from the kernel crypto/openssl dependant parts that are replaced
in the boot code.

Passed the GELI regression suite (tools/regression/geom/eli)
 Files=20 Tests=14996
 Result: PASS

Reviewed by:	pjd, delphij
MFC after:	1 week
Sponsored by:	ScaleEngine Inc.
Differential Revision:	https://reviews.freebsd.org/D4699
2016-01-07 05:47:34 +00:00
Steven Hartland
0f79b5d72b Fix use of uninitialised Nflag
Initialise Nflag to 0 preventing use of uninitialised value.

Reported by:	uqs
MFC after:	1 week
X-MFC-With:	r292266
Sponsored by:	Multiplay
Differential Revision:	https://reviews.freebsd.org/D4449
2015-12-30 14:57:42 +00:00
Ulrich Spörlein
e96092e82b Fix type mismatches for malloc(3) and Co.
Found by:	clang static analyzer
Reviewed by:	ed
Differential Revision:	https://reviews.freebsd.org/D4722
2015-12-29 11:24:35 +00:00
Alexander V. Chernikov
a18742e938 Add SFF-8024 Extended Specification Compliance
Submitted by:		markb_mellanox.com
MFC after:		2 weeks
Differential Revision:	https://reviews.freebsd.org/D4666
2015-12-28 09:26:07 +00:00
Allan Jude
7a3f5d11fb Replace sys/crypto/sha2/sha2.c with lib/libmd/sha512c.c
cperciva's libmd implementation is 5-30% faster

The same was done for SHA256 previously in r263218

cperciva's implementation was lacking SHA-384 which I implemented, validated against OpenSSL and the NIST documentation

Extend sbin/md5 to create sha384(1)

Chase dependancies on sys/crypto/sha2/sha2.{c,h} and replace them with sha512{c.c,.h}

Reviewed by:	cperciva, des, delphij
Approved by:	secteam, bapt (mentor)
MFC after:	2 weeks
Sponsored by:	ScaleEngine Inc.
Differential Revision:	https://reviews.freebsd.org/D3929
2015-12-27 17:33:59 +00:00
Baptiste Daroussin
1921045de0 Reduce overlinking
ifconfig does not need libbsdxml and libsbuf only lib80211 needs it
2015-12-24 11:30:29 +00:00
Alan Somers
b5bbeb2117 Fix "mount -a" for NFS and ZFS filesystems with shared mountpoints
sbin/mount.c
	Check whether an fstab entry has the same fstype as a mounted
	filesystem before declaring it to be mounted. This will allow NFS
	filesystems that share a mountpoint with a local filesystem to be
	automatically mounted at boot.

	This is not such an unusual situation. For example, if somebody uses
	the standard installer with a ZFS root, he'll get a /usr/home
	filesystem, even though he may choose to mount /usr/home over NFS.

Reviewed by:	trasz
MFC after:	4 weeks
Sponsored by:	Spectra Logic Corp
Differential Revision:	https://reviews.freebsd.org/D4556
2015-12-21 22:19:22 +00:00
Steven Hartland
6237ce0841 Add flag to disable inital reboot(8) userland sync
Add -N flag to reboot(8) which bypasses the userland sync(2) during
reboot(8) while still allow the kernel sync during the reboot(2) syscall
to occur.

An example use of this is when rebooting with disconnected iSCSI sessions
which would otherwise cause the reboot to hang on BIOs that will never
complete.

Reviewed by:	bjk
MFC after:	2 weeks
Sponsored by:	Multiplay
Differential Revision:	https://reviews.freebsd.org/D4449
2015-12-15 14:17:07 +00:00
Andrey V. Elsukov
ad32bf978a Remove a note about damaged PMBR. Now GPT will be detected automatically
with such corruption.

MFC after:	1 month
2015-12-10 10:37:12 +00:00
Enji Cooper
94c1ff89ad Don't leak rsector/sector in mp_label(..)
Use calloc instead of malloc + memset(.., 0, ..) when allocating sector

Differential Revision: https://reviews.freebsd.org/D4450
MFC after: 1 week
Reported by: cppcheck
Reviewed by: mav
Sponsored by: EMC / Isilon Storage Division
2015-12-10 07:04:36 +00:00
Marcelo Araujo
8020192d7b Add -t option to display field types.
PR:		bin/203918
Submitted by:	ota <ota@j.email.ne.jp>
Reviewed by:	cem
Approved by:	bapt (mentor)
Differential Revision:	https://reviews.freebsd.org/D4451
2015-12-10 02:11:42 +00:00
Alan Somers
d9ca81dabe Increase devd's client socket buffer size to 256KB. This is not as large as
it looks, because we'll hit the sockbuf's mbuf limit long before hitting its
data limit. A 256KB data limit allows creating a ZFS pool on about 450
drives without overflowing the client socket buffers.

MFC after:	4 weeks
Sponsored by:	Spectra Logic Corp
Differential Revision:	https://reviews.freebsd.org/D4476
2015-12-09 18:55:25 +00:00
Enji Cooper
33c2e470b4 Call va_end on ap when vsnprintf fails in run_cmd(..) to clean up
the variable state

MFC after: 1 week
Reported by: cppcheck
Sponsored by: EMC / Isilon Storage Division
2015-12-09 01:24:34 +00:00
Enji Cooper
170b1dd53e Fix leak in mkfs_msdos(..) by initializing img to NULL and free'ing at the end
of the function

Differential Revision: https://reviews.freebsd.org/D4405
MFC after: 1 week
PR: 204943
Reviewed by: emaste, jilles
Reported by: David Binderman <dcb314@hotmail.com>
Sponsored by: EMC / Isilon Storage Division
2015-12-06 21:07:33 +00:00
Bryan Drewery
eacae6dc66 Fix LDADD/DPADD that should be LIBADD.
Sponsored by:	EMC / Isilon Storage Division
2015-12-04 03:17:47 +00:00
Bryan Drewery
7aab86d59d For INTERNALLIB always add in the corresponding _DP_ and use LIBADD in
the real build file.

This lessens the need to define DPADD_<lib> and LDADD_<lib> to just very
special cases.

Sponsored by:	EMC / Isilon Storage Division
2015-12-04 03:17:17 +00:00
Bryan Drewery
9728842cf3 META MODE: Connect MK_NAND directories.
Sponsored by:	EMC / Isilon Storage Division
2015-12-02 05:31:01 +00:00
Bryan Drewery
b748535cc4 Don't add LIBADD=ipf to libipf itself.
This had no real impact since libipf is a static INTERNALLIB.  It does conflict
with an assertion I am adding for LIBADD though.

Sponsored by:	EMC / Isilon Storage Division
2015-12-01 22:39:19 +00:00
Craig Rodrigues
06691045ba Add more text to explain --libxo flag. 2015-12-01 19:18:53 +00:00
Bryan Drewery
b1f92fa229 META MODE: Update dependencies with 'the-lot' and add missing directories.
This is not properly respecting WITHOUT or ARCH dependencies in target/.
Doing so requires a massive effort to rework targets/ to do so.  A
better approach will be to either include the SUBDIR Makefiles directly
and map to DIRDEPS or just dynamically lookup the SUBDIR.  These lose
the benefit of having a userland/lib, userland/libexec, etc, though and
results in a massive package.  The current implementation of targets/ is
very unmaintainable.

Currently rescue/rescue and sys/modules are still not connected.

Sponsored by:	EMC / Isilon Storage Division
2015-12-01 05:23:19 +00:00
Bryan Drewery
cf990407e1 Update dependencies after r291406 added libelf to libkvm.
Unfortunately filemon/meta mode tracks all indirect dependencies here
since ld(1) is reading libelf when linking in libkvm.  Churn would be
reduced if this was able to be limited to direct dependencies.

Sponsored by:	EMC / Isilon Storage Division
2015-12-01 05:18:48 +00:00
Adrian Chadd
d01cb677ba Convert ifconfig to use lib80211.
* remove regdomain.[ch] - it's now part of lib80211.
* convert ifieee80211.c to use the ioctl routines in lib80211 and
  implement the "error? exit" wrapper behaviour the callers expect.
2015-11-30 06:34:16 +00:00
Ed Maste
64953dd1dd Use netbsd usage() implementation in newfs_msdos
In r289629 newfs_msdos option descriptions are available in
mkfs_msdos.h.

Obtained from:	NetBSD
2015-11-27 14:40:21 +00:00
Ed Maste
937744df07 mkfs_msdos: sync with NetBSD
Add a sanity test and clean up whitespace.

Obtained from:	NetBSD
2015-11-27 14:20:32 +00:00
Adrian Chadd
db4eb9fec2 [ifconfig] handle IBSS mediatype correctly.
Right now net80211 is configured as type IBSS but then treats it
as mediatype ADHOC.  This doesn't change that; it just correctly handles
being given a mediatype of IBSS.
2015-11-26 01:58:50 +00:00
Bryan Drewery
277fbb92d5 Remove redundant DPSRCS which were already in SRCS.
DPSRCS already contains all of SRCS.

MFC after:	1 week
Sponsored by:	EMC / Isilon Storage Division
2015-11-25 20:38:07 +00:00
Ed Maste
99f4158c82 newfs_msdos: rework error handling for eventual use in makefs
Return -1 on errors from mkfs_msdos() instead of err()/errx(), to
allow different consumers to handle errors as appropriate.

Obtained from:	NetBSD
Sponsored by:	The FreeBSD Foundation
2015-11-23 18:58:00 +00:00
Ed Maste
b3e7589994 Update $NetBSD$ ID
NetBSD mkfs_msdos.h rev 1.3 removed the no-endorsement clause from the
license block, which had already been done in the source I imported in
r289629.
2015-11-23 18:56:10 +00:00
Steven Hartland
45a9027de4 Fix dumpon compatibility with dumpdev kenv
The dumpdev kenv supports devices without the /dev/ prefix, fix dumpon to
also support this which is required after r288153.

MFC after:	1 week
Sponsored by:	Multiplay
2015-11-23 14:06:21 +00:00
Bryan Drewery
6f42d16f43 Convert to SUBDIR.yes format.
Reviewed by:	imp
Sponsored by:	EMC / Isilon Storage Division
Differential Revision:	https://reviews.freebsd.org/D4182
2015-11-18 17:52:38 +00:00
John-Mark Gurney
9ed7fa550e If you backup a large file that is mostly holes, previously we'd issue
a seek for every block...  For large (Exabyte sized files) this would
issue lots of unneeded seeks, so combine them...

Thanks for the work Jan, sorry took so long to commit...  And an item
completed off the IdeasPage!

Submitted by:	Jan Sucan
2015-11-16 01:29:58 +00:00
Edward Tomasz Napierala
b9124fc313 Fix resource leaks in error cases.
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2015-11-11 23:00:57 +00:00
Edward Tomasz Napierala
3f5ac575ea Userspace part of reroot support. This makes it possible to change
the root filesystem without full reboot, using "reboot -r". This can
be used to to eg. boot from a temporary md_image preloaded by loader(8),
setup an iSCSI session, and continue booting from rootfs mounted over
iSCSI.

Reviewed by:	kib@, bapt@
MFC after:	1 month
Relnotes:	yes
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D3693
2015-11-08 17:33:48 +00:00
Conrad Meyer
fc6f845ec5 savecore(8): Be quiet unless the user asks for verbose
Make savecore(8) more suitable for init-time scripts; be quiet by default.

Sponsored by:	EMC / Isilon Storage Division
Differential Revision:	https://reviews.freebsd.org/D3229
2015-11-07 23:27:03 +00:00
Conrad Meyer
2a71f1ed95 Follow-up to r290475: Add sysctl(8) support for added types
Sponsored by:	EMC / Isilon Storage Division
2015-11-07 01:56:32 +00:00
Alan Somers
49f1692b78 Always check the return value of lseek.
This is a follow-up to r289845, which only fixed one occurence of CID
1009429.

Coverity CID:	1009429
Reviewed by:	markj
MFC after:	2 weeks
X-MFC-With:	r289845
Sponsored by:	Spectra Logic
Differential Revision:	https://reviews.freebsd.org/D4096
2015-11-06 19:18:20 +00:00
Steven Hartland
c1be893c44 Add sysctl to control LACP strict compliance default
Add net.link.lagg.lacp.default_strict_mode which defines
the default value for LACP strict compliance for created
lagg devices.

Also:
* Add lacp_strict option to ifconfig(8).
* Fix lagg(4) creation examples.
* Minor style(9) fix.

MFC after:	1 week
2015-11-06 15:33:27 +00:00
Andriy Voskoboinyk
db615b2bb1 ifconfig: fix padding for '<ifname> scan' command output
(S:N and beacon interval fields).

Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D4085
2015-11-06 11:17:23 +00:00
Andrey V. Elsukov
5dc5a0e0aa Implement ipfw internal olist command to list named objects.
Reviewed by:	melifaro
Obtained from:	Yandex LLC
Sponsored by:	Yandex LLC
2015-11-03 10:21:53 +00:00
Kristof Provost
3e768368d0 pfctl: Fix uninitialised veriable
In pfctl_set_debug() we used 'level' without ever initialising it.
We correctly parsed the option, but them failed to actually assign the parsed
value to 'level' before performing to ioctl() to configure the debug level.

PR:		202996
Submitted by:	Andrej Kolontai
2015-11-01 17:20:17 +00:00
Bryan Drewery
7d8f797b72 Use more appropriate ${SHAREDIR} rather than /usr/share.
MFC after:	2 weeks
Sponsored by:	EMC / Isilon Storage Division
2015-10-27 23:35:02 +00:00
Enji Cooper
ea36ade1d1 Limit RESOLUTION_MAX to INT_MAX, not UINT_MAX (all spelled out) so the
mode value isn't always clipped to -1 when (resolution * size) == 32, which
would have been the case with values => {4i,32b,32t}.

This seems to have been broken in r64382.

MFC after: 1 week
X-MFC with: r289915
PR: 200619
Reported by: Michael Baptist
Submitted by: Lars Skodje
Sponsored by: EMC / Isilon Storage Division
2015-10-25 04:37:00 +00:00
Alan Somers
6123d3f697 Fix various Coverity issues in sbin/savecore/savecore.c:
CID1009429: Fix unchecked return value from lseek while clearing dump
CID1007781: Fix file descriptor leak in DoFile
CID1007261: Don't send potentially unterminated string to syslog(3)

Coverity CID:	1009429
Coverity CID:	1007781
Coverity CID:	1007261
MFC after:	2 weeks
Sponsored by:	Spectra Logic
Differential Revision:	https://reviews.freebsd.org/D3991
2015-10-23 19:28:24 +00:00
Conrad Meyer
ec9f6de7d2 sysctl(8): Fix style nits
Suggested by:	bde
Sponsored by:	EMC / Isilon Storage Division
2015-10-23 15:40:44 +00:00
Conrad Meyer
c3220d0b6d Sysctl: Add common support for U8, U16 types
Sponsored by:	EMC / Isilon Storage Division
2015-10-22 23:03:06 +00:00
Eitan Adler
463a577b27 Fix a ton of speelling errors
arc lint is helpful

Reviewed By: allanjude, wblock, #manpages, chris@bsdjunk.com
Differential Revision: https://reviews.freebsd.org/D3337
2015-10-21 05:37:09 +00:00
Ed Maste
160309f2c2 newfs_msdos: use NetBSD's mkfs_msdos.h verbatim for makefs compatibility
Sponsored by:	The FreeBSD Foundation
2015-10-20 13:32:09 +00:00
Enji Cooper
550d2b80ec Make libxo depend on libutil because it uses humanize_number after r287111
Remove overlinking in lib/libxo/tests, sbin/savecore, and
usr.bin/{iscsictl,wc,xo}

PR: 203673
Sponsored by: EMC / Isilon Storage Division
2015-10-18 07:30:50 +00:00
Enji Cooper
3f18b7fa12 Replace /dev/acd0 with /dev/cd1
atapicd(4) has been removed since r249083, and if a system has more than one
optical drive, it will likely be /dev/cd1

Update mount.conf(8) to reflect the change in behavior

MFC after: never
Sponsored by: EMC / Isilon Storage Division
2015-10-17 08:51:10 +00:00
Ed Maste
59faa1e9fb newfs_msdos: prefer snprintf to sprintf
Obtained from:	NetBSD
Sponsored by:	The FreeBSD Foundation
2015-10-16 15:19:36 +00:00
Ed Maste
041b03daab newfs_msdos: move mkfs_msdos to separate file for later use in makefs
Sponsored by:	The FreeBSD Foundation
2015-10-15 19:00:33 +00:00
Ed Maste
4d45a6738a newfs_msdos: rework option parsing to match NetBSD
NetBSD split newfs_msdos in two so that they can reuse the file system
creation part in makefs. This change is a step on the path of bringing
that support to FreeBSD.

Reviewed by:	kib, pfg
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D3905
2015-10-15 16:19:00 +00:00
Enji Cooper
0b0d825ad8 Replace references to /dev/acd0 with /dev/cd0
atapicd(4) was replaced by cd(4) with the atacam work done by
mav@ and then removed in r249083

X-MFC to: stable/10
MFC after: 2 weeks
2015-10-13 17:14:27 +00:00
Adrian Chadd
4052b8bc34 casperd: bump default socket queue length to SOMAXCONN; make length configurable.
The current default listen queue for casperd is too small (8) and
hard-coded.

This patch increases the default to SOMAXCONN, and introduces a command
line flag that can used to further increase or decrease the queue length.

PR:		bin/202147
Submitted by:	<lidl@pix.net>
2015-10-13 02:34:41 +00:00
Enji Cooper
b2d48be1bc Refactor the test/ Makefiles after recent changes to bsd.test.mk (r289158) and
netbsd-tests.test.mk (r289151)

- Eliminate explicit OBJTOP/SRCTOP setting
- Convert all ad hoc NetBSD test integration over to netbsd-tests.test.mk
- Remove unnecessary TESTSDIR setting
- Use SRCTOP where possible for clarity

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Divison
2015-10-12 08:16:03 +00:00
Alexander Motin
4a3760bae6 Remove compatibility shims for legacy ATA device names.
We got new ATA stack in FreeBSD 8.x, switched to it at 9.x, completely
removed old stack at 10.x, so at 11.x it is time to remove compat shims.
2015-10-11 13:01:51 +00:00
Edward Tomasz Napierala
d5b0fb47eb Add 'p' postfix to mdconfig(8).
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2015-10-10 09:37:31 +00:00
Edward Tomasz Napierala
45d7de1d37 Make geom_nop(4) collect statistics on all types of BIOs, not just
reads and writes.

PR:		kern/198405
Submitted by:	Matthew D. Fuller <fullermd at over-yonder dot net>
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D3679
2015-10-10 09:03:31 +00:00
Baptiste Daroussin
e1619d123e Only print the errno string in case sysctl(3) does not file with ENOENT
This reduces the noise in error reporing from sysctl(8):

Before:
$ sysctl bla=something
sysctl: unknown oid 'bla': No such file or directory

After:
$ sysctl bla=something
sysctl: unknown oid 'bla'

MFC after:	1 week
Sponsored by:	Gandi.net
2015-10-07 09:28:54 +00:00
Baptiste Daroussin
ca587fdaac Trim spaces at the end of the buffer before trying to convert it to an oid
This allows to write entries in sysctl.conf with spaces before the '=' like
kern.ipc.shmmax = 9663676416

MFC after:	1 week
Sponsored by:	Gandi.net
2015-10-07 08:56:01 +00:00
Xin LI
56160b2e67 Now that we own the code, use arc4random(3) unconditionally
and remove the corresponding HAVE_ARC4RANDOM conditions.

MFC after:	2 weeks
2015-10-06 23:42:58 +00:00
Andrey V. Elsukov
56afe65ca9 Fix possible segmentation fault.
PR:		203494
MFC after:	1 week
2015-10-03 03:12:57 +00:00
Bryan Drewery
10b83bb0e9 META_MODE: For some reason meta mode cannot generate the intermediate tab.c
files.  Split up all of the targets to be more clear on how they are generated
to fix the problem.

MFC after:	2 weeks
Sponsored by:	EMC / Isilon Storage Division
2015-10-02 07:00:43 +00:00
Colin Percival
2eb0015ab7 Disable suspend when we're shutting down. This solves the "tell FreeBSD
to shut down; close laptop lid" scenario which otherwise tended to end
with a laptop overheating or the battery dying.

The implementation uses a new sysctl, kern.suspend_blocked; init(8) sets
this while rc.suspend runs, and the ACPI sleep code ignores requests while
the sysctl is set.

Discussed on:	freebsd-acpi (35 emails)
MFC after:	1 week
2015-10-01 10:52:26 +00:00
Enji Cooper
abd7105060 Replace N #defines with nitems to simplify ifconfig code slightly
MFC after: 1 week
2015-09-27 07:51:18 +00:00
Bryan Drewery
6a8077f3d5 Add SUBDIR_PARALLEL.
MFC after:	2 weeks
Sponsored by:	EMC / Isilon Storage Division
2015-09-26 01:28:50 +00:00
Bryan Drewery
a98533d3e8 Remove disconnected directories.
These were added disconnected in 2005 in r145524.

Sponsored by:	EMC / Isilon Storage Division
2015-09-26 01:24:35 +00:00
Bryan Drewery
ec766071e3 META_MODE: Remove DEP_MACHINE from Makefile.depend files.
This has not been needed since r246865 in projects/bmake.

Sponsored by:	EMC / Isilon Storage Division
2015-09-25 19:44:01 +00:00
Bryan Drewery
54c7d75a06 META_MODE: Remove DEP_RELDIR from Makefile.depend files.
This has not been needed since r284171 in projects/bmake.

Sponsored by:	EMC / Isilon Storage Division
2015-09-25 19:26:08 +00:00