Commit Graph

8673 Commits

Author SHA1 Message Date
Li-Wen Hsu
22e6ecf367 Follow r333233, add fat32lba description to gpart(8)
Reviewed by:	emaste
MFC after:	3 days
X-MFC with:	r333233
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D15767
2018-06-12 01:50:58 +00:00
Warner Losh
37d6a8f458 Revert size limits.
The size limits came from a flawed understanding of dump records.
The real issue was that dump was bogusly interpreting c_count
sometimes. r334978 fixes that.
2018-06-11 20:38:30 +00:00
Warner Losh
b9c7cba522 Fix a bug in the counting of blks.
We shouldn't count the bytes set in c_addr for TS_CLRI and TS_BITS
nodes. Those block overload c_count to communicate how many blocks
follow, not now many c_addr spaces are used. Dump would dump core
(now) because memory layout moved around and we'd access elements past
the end to make a count.

Reviewed by: kib@
2018-06-11 20:38:26 +00:00
Warner Losh
e26ce92b55 Don't initialize c_count. We don't need to. 2018-06-11 19:35:41 +00:00
Warner Losh
a86534e007 Minor style polishing.
Declare c_count and initialize it with other ints.

Reported by: mjg@
2018-06-11 19:32:49 +00:00
Warner Losh
94e18833a8 Document the newly enforced 524288 inode restriction. 2018-06-11 19:32:45 +00:00
Warner Losh
2d518c6518 Add asserts to prevent overflows of c_addr.
Add some asserts that prevents the overflows of c_addr. This can't
happen, absent bugs. However, certain large filesystems can cause
problems. These have been prevented by r334968, but a solution
is needed. These asserts will help assure that solution is correct.

PR: 228807
Reviewed by: db
2018-06-11 19:32:36 +00:00
Diane Bruce
803fec5fdf Large file systems with inodes > 512K have been silently overflowing
c_addr in spcl. So check before we start dumping otherwise we can
end up with a corrupted dump.

PR:		228807
Submitted by:	db
Reviewed by:	imp
Approved by:	imp
2018-06-11 19:12:50 +00:00
Kirk McKusick
db9cb3e823 Ensure proper initialization of superblock.
Submitted by: Diane Bruce
2018-06-07 20:49:01 +00:00
Justin Hibbits
8244d89ce3 Build nvmecontrol on powerpc64
The nvme driver is compiled for powerpc64 already, and the one fix required
to build nvmecontrol on powerpc64 was fixed in r334754.
2018-06-07 04:03:19 +00:00
Justin Hibbits
2bac48c266 Print Maximum Data Transfer Size as a long rather than int
PowerPC has PAGE_SIZE as a long, not an int.  This causes the compiler to throw
a format mismatch warning on this print.  To work around the difference, print
it as a long instead of an int, and force the argument to a long.

Reviewed By: imp
Differential Revision: https://reviews.freebsd.org/D15653
2018-06-07 04:02:09 +00:00
Kristof Provost
fa1d4439f9 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>
MFC after:	1 week
2018-06-06 19:36:37 +00:00
Conrad Meyer
f93497fe64 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.

PR:		206721
Submitted by:	novel@
Reported by:	<jimp AT pfsense.org>
MFC after:	37 minutes (if you care about 11, please MFC to 11.2)
Relnotes:	yes (potentially surprising behavior change w/ broken dhcpd mtu)
Differential Revision:	https://reviews.freebsd.org/D15484
2018-05-31 19:36:24 +00:00
Sean Bruno
21a8e0b1d5 dumpon(8)
- fix the WITHOUT_CRYPTO buildworld case.  Its rare, but some of us do
  build this way.

Sponsored by:	Limelight Networks
2018-05-29 21:52:13 +00:00
Mark Johnston
fe1ba25039 The extension for zstd-compressed files is ".zst".
Reported by:	manu
2018-05-29 16:04:53 +00:00
Eitan Adler
73d1ecdc98 kldstat: align "Size" to the right
This change also makes alignment and spacing an explicit number rather
than a bunch of spaces.

Reviewed by:	mmacy
Requested by:	Yuri Pankov <yuripv@yuripv.net>
2018-05-26 05:15:07 +00:00
Matt Macy
3741a56c31 devd: drop WARNS back down to 3 until 6 actually works with GCC 2018-05-24 01:12:06 +00:00
Eitan Adler
f405a1bea1 devd: Move variable declaration to header
Reminder by:	imp
2018-05-23 13:48:16 +00:00
Eitan Adler
d14732d366 kldstat: align size to the right
This makes it easier to compare numbers directly.

PR:		215747
Submitted by:	"Alexander von Gernler" <grunk@pestilenz.org>
2018-05-23 12:10:16 +00:00
Eitan Adler
aa677d07a1 md5: perform compare case-insenstive
md5 generates a md5 hash lowercase, but it might be provided in
uppercase. Allow this.

PR:		205598
Reported by:	ohauer
MFC After:	2 weeks
2018-05-23 11:45:46 +00:00
Eitan Adler
6d6e62dcc3 dumpon: point to better kernel debug symbols.
The objdir is temporary, and the current example points to GENERIC.
Instead point to the installed location of the debug symbols that are
supposed to match the kernel you are using.

PR:		223993
Submitted by:	Trond.Endrestol@ximalas.info
2018-05-23 10:45:32 +00:00
Eitan Adler
695a3b29ff devd: Unbreak build
I'm not quite sure why this wasn't caught before. Most likely due to
some generated file not being properly cleaned.

Fix build by just hiding the warnings that `-i` was supposed to fix.

Tested with clang, gcc9, gcc7
2018-05-23 10:03:09 +00:00
Eitan Adler
e8d9a1edb3 devd: allow build to complete using g++ 2018-05-23 07:44:50 +00:00
Eitan Adler
0bc60783da devd: compile at WARNS=6
Verified with "make universe TARGETS='amd64 arm arm64 i386 sparc64'"
2018-05-23 07:39:05 +00:00
Eitan Adler
958160f3ec devd: correct two warnings
- catching a polymorphic type by value
- "output between 16 and 95 bytes into a destination of size 80"
2018-05-23 07:39:02 +00:00
Andrey V. Elsukov
7a07dfbc7c Make the name of option that toggles IFCAP_HWRXTSTMP capability to
match the name of this capability. It was added recently and is not merged
to stable branch, so I hope it is not too late to change the name.

Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D15475
2018-05-18 12:12:24 +00:00
Ed Maste
408c1ff8f4 Clarify that boot_mute / boot -m mutes kernel console only
Perhaps RB_MUTE could mute user startup (rc) output as well, but right
now it mutes only kernel console output, so make the documentation match
reality.

PR:		228193
Sponsored by:	The FreeBSD Foundation
2018-05-16 02:15:18 +00:00
Ed Maste
c44e7d2f2f gpart.8: list all options in table form for each command
Previously gpart's man page listed some command options in prose, and
some in table form, which made it more difficult to use as a reference.

Reviewed by:	bcr
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D15135
2018-05-11 12:58:36 +00:00
Ed Maste
6c967db174 gpart.8: sort suboptions per mdoc(7)
Alphabetical order, uppercase before lowercase for each letter and with
no regard to whether an option takes an argument.

Sponsored by:	The FreeBSD Foundation
2018-05-11 12:57:25 +00:00
Andrey V. Elsukov
51d5442fef Fix the printing of rule comments.
Change uint8_t type of opcode argument to int in the print_opcode()
function. Use negative value to print the rest of opcodes, because
zero value is O_NOP, and it can't be uses for this purpose.

Reported by:	lev
MFC after:	1 week
2018-05-10 12:25:01 +00:00
Mariusz Zaborski
31f7586d73 Introduce the 'n' flag for the geli attach command.
If the 'n' flag is provided the provided key number will be used to
decrypt device. This can be used combined with dryrun to verify if the key
is set correctly. This can be also used to determine which key slot we want to
change on already attached device.

Reviewed by:	allanjude
Differential Revision:	https://reviews.freebsd.org/D15309
2018-05-09 20:53:38 +00:00
Mariusz Zaborski
c2ac0fc5e0 Change option dry-run from 'n' to 'C' in geli attach command.
'n' is used in other commands to define the key index.
We should be consistent with that.
'C' option is used by patch(1) to perform dryrun so lets use that.

Reviewed by:	allanjude
Differential Revision:	https://reviews.freebsd.org/D15308
2018-05-09 20:51:16 +00:00
Warner Losh
0272270a8d nda protocol rate reporting
Report the NVMe spec, number of lanes (and max) as well as the PCIe
generation we're negotiated at (and max) for the camcontrol rate
command.

Reviewed by: scottl (the output, not the code)
Sponsored by: Netflix
2018-05-09 18:41:04 +00:00
Andrey V. Elsukov
c54e0abbc6 Update NAT64 documentation, now we support any IPv6 prefixes.
MFC after:	1 month
2018-05-09 12:25:23 +00:00
Andrey V. Elsukov
782360dec3 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.

Obtained from:	Yandex LLC
MFC after:	1 month
Sponsored by:	Yandex LLC
2018-05-09 11:59:24 +00:00
Mark Johnston
0ff40d3d29 Add netdump support to dumpon(8).
A new usage is added so that parameters for netdump may be specified.
Specifically, one configures an interface for netdump with:

# dumpon -c <client IP> -s <server IP> [-g <gateway IP>] <iface name>

Reviewed by:	bdrewery, cem (earlier versions), sbruno
MFC after:	1 month
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D15254
2018-05-06 00:42:30 +00:00
Alexander Motin
ba405bc811 Add NVMe Namespace Management support to nvmecontrol(8).
This allows create/delete/attach/detach namespaces on new NVMe controllers.
This is only a first user-level part of the bigger change set.  Kernel part
required to detect and handle the configuration changes without reboot is
completely independent and will be added separately.

Submitted by:	Matt Williams <mffbsdw@gmail.com> (original version)
Differential Revision:	https://reviews.freebsd.org/D11399
2018-05-05 20:08:03 +00:00
Xin LI
3e855e9c21 Don't bail out from the check if readboot() returns !FSFATAL.
This can happen when the fsinfo signature is invalid, and the
user have choose to fix it, in which case the code would return
FSBOOTMOD (not FSOK but not FSFATAL either).

All other (fatal) cases would return FSFATAL.

Obtained from:	Android Open Source Project
Obtained from:	d8775a29ea
MFC after:	2 weeks
2018-04-30 05:57:55 +00:00
Kristof Provost
c5e105655b pfctl: Don't break connections on skipped interfaces on reload
On reload we used to first flush everything, including the list of skipped
interfaces.  This can lead to termination of these connections if they send
packets before the new configuration is applied.

Note that this doesn't currently happen on 12 or 11, because of special EACCES
handling introduced in r315514. This special behaviour in tcp_output() may
change, hence the fix in pfctl.

PR:		214613
2018-04-28 13:16:58 +00:00
Brooks Davis
4204224162 Finish removing FDDI and tokenring media support.
This fixes media display for 802.11 wireless devices.

Software outside the base system that uses these media types and
defines should use #ifdef IFM_FDDI or IFM_TOKEN to include or remove
support.

Reported by:	zeising
Reviewed by:	emaste, kib, zeising
Tested by:	zeising
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D15170
2018-04-23 21:10:33 +00:00
Andrew Gallatin
47528c67ef Make lagg creation more fault tolerant
- Warn, don't exit, when SIOCSLAGGPORT returns an error.

When we exit with an error during lagg creation, a single
failed NIC (which no longer attaches) can prevent lagg
creation and other configuration, such as adding an IPv4
address, and thus leave a machine unreachable.

- Preserve non-EEXISTS errors for exit status from SIOCSLAGGPORT,
  in case scripts are looking for it. Hopefully this can be
  extended if other parts of ifconfig can allow a "soft" failure.

- Improve the warning message to mention what lagg and what
  member are problematic.

Reviewed by: jtl, glebius
Sponsored by: Netflix
Differential Revision:	https://reviews.freebsd.org/D15046
2018-04-17 12:54:58 +00:00
Brooks Davis
eec02418d8 Remove support for FDDI and token ring media types in userland utilities.
Reviewed by:	kib
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D15077
2018-04-16 18:07:51 +00:00
Andrey V. Elsukov
0f71e509e5 Fix indenting in ipv6.c file, use tabs instead of mixing tabs and spaces.
MFC after:	1 week
2018-04-12 20:05:26 +00:00
Andrey V. Elsukov
bd32e33552 Remove printing of "not" keyword from print_ip6() function.
After r331668 handling of F_NOT flag done in one place by
print_instruction() function. Also remove unused argument from
print_ip[6]() functions.

MFC after:	1 week
2018-04-12 19:44:04 +00:00
Andrey V. Elsukov
09a6be91bc Remove printing of "not" keyword from print_ip() function.
After r331668 handling of F_NOT flag done in one place by
print_instruction() function.

MFC after:	1 week
2018-04-12 19:34:35 +00:00
Brooks Davis
0437c8e3b1 Remove support for FDDI networks.
Defines in net/if_media.h remain in case code copied from ifconfig is in
use elsewere (supporting non-existant media type is harmless).

Reviewed by:	kib, jhb
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D15017
2018-04-11 17:28:24 +00:00
Oleg Bulyzhin
e5e8324fea Fix typo.
MFC after:	1 week
2018-04-11 11:17:57 +00:00
Mariusz Zaborski
8f1c45c20a Introduce dry run option for attaching the device.
This will allow us to verify if passphrase and key is valid without
decrypting whole device.

Reviewed by:	cem@, allanjude@
Differential Revision:	https://reviews.freebsd.org/D15000
2018-04-10 13:22:48 +00:00
Edward Tomasz Napierala
f0bbdd70ad Strip trailing whitespace.
MFC after:	2 weeks
2018-04-10 08:13:59 +00:00
Kirk McKusick
2a36aee276 When using the fsdb `blocks' command, replace the long and ugly list of
blocks with the much more concise and readable block list shown by the
prtblknos() function imported from tools/diag/prtblknos.
2018-04-08 07:06:12 +00:00