Commit Graph

7739 Commits

Author SHA1 Message Date
Enji Cooper
51dd214c84 MFhead @ r277403 2015-01-19 22:18:00 +00:00
Alexander V. Chernikov
69c4b56a74 Eliminate incorrect IPv6 mask guessing:
RFC 2374 concept of 'IPv6 Aggregatable Global Unicast Address Format' was
deprecated by RFC 3587 12 years ago.

Before:

15:06 [1] edge# netstat -rn6 | grep 2a02:6b8::
2a02:6b8::/32                     2a02:978:2::1                 UGS         em0
15:06 [1] edge# route -6n get 2a02:6b8::
route: writing to routing socket: No such process

After:
15:07 [1] edge# /usr/obj/usr/src/sbin/route/route -n6 get 2a02:6b8::
   route to: 2a02:6b8::
destination: 2a02:6b8::
       mask: ffff:ffff::
    gateway: 2a02:978:2::1
        fib: 0
  interface: em0
      flags: <UP,GATEWAY,DONE,STATIC>
 recvpipe  sendpipe  ssthresh  rtt,msec    mtu        weight    expire
       0         0         0         0      1500         1         0

MFC after:	2 weeks
2015-01-16 11:17:30 +00:00
Edward Tomasz Napierala
01de1a0650 Add devd(8) notifications for creation and destruction of GEOM devices.
Differential Revision:	https://reviews.freebsd.org/D1211
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2015-01-14 11:15:57 +00:00
Kenneth D. Merry
a1736be349 Improve camcontrol(8) handling of drive defect data.
This includes a new summary mode (-s) for camcontrol defects that
quickly tells the user the most important thing: how many defects
are in the requested list.  The actual location of the defects is
less important.

Modern drives frequently have more than the 8191 defects that can
be reported by the READ DEFECT DATA (10) command.  If they don't
have that many grown defects, they certainly have more than 8191
defects in the primary (i.e. factory) defect list.

The READ DEFECT DATA (12) command allows for longer parameter
lists, as well as indexing into the list of defects, and so allows
reporting many more defects.

This has been tested with HGST drives and Seagate drives, but
does not fully work with Seagate drives.  Once I have a Seagate
spec I may be able to determine whether it is possible to make it
work with Seagate drives.

scsi_da.h:	Add a definition for the new long block defect
		format.

		Add bit and mask definitions for the new extended
		physical sector and bytes from index defect
		formats.

		Add a prototype for the new scsi_read_defects() CDB
		building function.

scsi_da.c:	Add a new scsi_read_defects() CDB building function.
		camcontrol(8) was previously composing CDBs manually.
		This is long overdue.

camcontrol.c:	Revamp the camcontrol defects subcommand.  We now
		go through multiple stages in trying to get defect
		data off the drive while avoiding various drive
		firmware quirks.

		We start off by requesting the defect header with
		the 10 byte command.  If we're in summary mode (-s)
		and the drive reports fewer defects than can be
		represented in the 10 byte header, we're done.
		Otherwise, we know that we need to issue the
		12 byte command if the drive reports the maximum
		number of defects.

		If we're in summary mode, we're done if we get a
		good response back when asking for the 12 byte header.

		If the user has asked for the full list, then we
		use the address descriptor index field in the 12
		byte CDB to step through the list in 64K chunks.
		64K is small enough to work with most any ancient
		or modern SCSI controller.

		Add support for printing the new long block defect
		format, as well as the extended physical sector and
		bytes from index formats.  I don't have any drives
		that support the new formats.

		Add a hexadecimal output format that can be turned
		on with -X.

		Add a quiet mode (-q) that can be turned on with
		the summary mode (-s) to just print out a number.

		Revamp the error detection and recovery code for
		the defects command to work with HGST drives.

		Call the new scsi_read_defects() CDB building
		function instead of rolling the CDB ourselves.

		Pay attention to the residual from the defect list
		request when printing it out, so we don't run off
		the end of the list.

		Use the new scsi_nv library routines to convert
		from strings to numbers and back.

camcontrol.8:	Document the new defect formats (longblock, extbfi,
		extphys) and command line options (-q, -s, -S and
		-X) for the defects subcommand.

		Explain a little more about what drives generally
		do and don't support.

Sponsored by:	Spectra Logic
MFC after:	1 week
2015-01-08 16:58:40 +00:00
Warner Losh
a91275f72f Remove old ioctl use and support, once and for all. 2015-01-06 05:28:37 +00:00
Enji Cooper
b219c275cc Integrate sbin/ifconfig/tests from NetBSD into atf/kyua
Sponsored by: EMC / Isilon Storage Division
2015-01-04 22:25:16 +00:00
Joel Dahl
f636caf195 mdoc: paragraph improvements. 2015-01-04 12:49:24 +00:00
Dag-Erling Smørgrav
e331584127 Belatedly commit the patch for SA-14:21 to head. It was not committed to
head at the time because it's a band-aid, rather than a complete fix, but
the complete fix never materialized.
2015-01-03 01:52:06 +00:00
Enji Cooper
a4ed727666 MFhead @ r276594 2015-01-02 23:27:16 +00:00
Joel Dahl
f7e00d4bbd mdoc: remove EOL whitespace. 2014-12-29 13:50:59 +00:00
Joel Dahl
c09eb46601 mdoc: improvements to SEE ALSO. 2014-12-27 08:22:58 +00:00
Enji Cooper
afbe8aa46f MFhead @ r275911 (also, sort out MK_* flags in BMAKE, etc on this branch) 2014-12-18 18:46:08 +00:00
Gleb Kurtsou
9b33705411 Adjust printf format specifiers for dev_t and ino_t in user space.
ino_t and dev_t are about to become uint64_t.

Reviewed by:	kib, mckusick
2014-12-17 07:10:48 +00:00
Bryan Venteicher
c6e32006e1 Prefix all the vxlan ifconfig commands so they are unique
And rehook ifvxlan back into the build.
2014-12-17 05:36:34 +00:00
Andrey V. Elsukov
8150c3ec36 Add ability to not specify a zone identifier twice, when both source and
destination addresses are specified.
For example:
	# ping6 -S fe80::1%ix0 ff02::1
or
	# ping6 -S fe80::1 fe80::2%ix0

Obtained from:	Yandex LLC
Sponsored by:	Yandex LLC
2014-12-16 14:59:20 +00:00
Gleb Kurtsou
c7d73a4d23 sbin/shutdown: Support time units as in 'shutdown -r +5sec'
Units supported: s, sec, m, min, h, hour.

Differential Revision:	https://reviews.freebsd.org/D1272
2014-12-16 08:29:02 +00:00
Enji Cooper
d455aba884 MFhead @ r275688 2014-12-10 20:44:51 +00:00
Edward Tomasz Napierala
be3a49ee62 Add fstyp(8). This utility, named after its SVR4 counterpart, detects
filesystems.  It differs from file(1) in that it gives machine-parseable
output, it outputs filesystem labels, doesn't get confused by other
formats metadata, and runs in Capsicum sandbox.

Differential Revision:	https://reviews.freebsd.org/D1255
Relnotes:	yes
Sponsored by:	The FreeBSD Foundation
2014-12-10 14:14:16 +00:00
Enji Cooper
2c3f939cab MFhead @ r275589 2014-12-08 03:36:43 +00:00
Edward Tomasz Napierala
de29f585af Move iscsi.conf.5 from sbin/iscontrol/ to usr.bin/iscsictl/, as the
former is obsolete.

MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2014-12-05 12:38:01 +00:00
Enji Cooper
da976f9d68 MFhead @ r275496 2014-12-05 07:48:25 +00:00
Enji Cooper
210607205f Make ccd(4), et al conditional based on MK_CCD 2014-12-02 19:53:55 +00:00
Xin LI
689c8e8b46 Fix inverted logic introduced in r272154.
Noticed by:	trasz
MFC after:	2 weeks
2014-12-01 20:51:01 +00:00
Dag-Erling Smørgrav
5d083d287b Disable the vxlan code until the people reponsible for it can come up with
new command names that don't conflict with existing commands.

Pointy hat to:	bryanv
2014-12-01 12:59:16 +00:00
Enji Cooper
9779edfbd3 Remove the unnecessary glob 2014-11-30 09:04:24 +00:00
Enji Cooper
d370dc47a1 Fix CFLAGS+=-DDEBUG by using the right header for libutil (libutil.h, not
util.h)
2014-11-30 09:03:34 +00:00
Enji Cooper
317fdbc621 Build spppcontrol if MK_PPP != no 2014-11-30 08:34:46 +00:00
Enji Cooper
840e70929b MFHead @ r275232 2014-11-29 05:28:40 +00:00
Enji Cooper
66ca0717df Convert sbin/mdconfig/tests from prove format tests to ATF format tests
As a side effect...
1. The tests now checks for the root user before continuing with kyua, which is
   more visible than the test being skipped with the TAP protocol
2. The tests work with devices that aren't /dev/md0 by caching the device
   attached during the test to a file, and later use the cached information to
   detach the device in the cleanup routine
3. The tests no longer require perl to run

MFC after: 1 week
PR: 191191
Sponsored by: EMC / Isilon Storage Division
2014-11-27 06:04:00 +00:00
Enji Cooper
466046ec0d Conditionalize a number of components in the tree
- bootparamd
- bootpd
- finger/fingerd
- ftp/ftpd
- hastctl/hastd
- iscsid, et al
- rbootd
- talk/talkd
- tcpd, et al
- tftp/tftpd

Add src.conf entries for the various components and do a best effort
at adding components to tools/build/mk/OptionalObsoleteFiles.inc
2014-11-26 08:44:05 +00:00
Baptiste Daroussin
13eb765f2d Convert sbin/ to LIBADD
Reduce overlinking
2014-11-25 11:23:12 +00:00
Joel Dahl
d4d112e34a Misc mdoc fixes:
- Remove superfluous paragraph macros.
- Remove/fix empty or incorrect macros.
- Sort sections into conventional order.
- Terminate quoted strings properly.
- Remove EOL whitespace.
2014-11-23 21:00:00 +00:00
Edward Tomasz Napierala
a0252a0a82 Cross-reference autounmountd(8) from umount(8).
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2014-11-22 16:46:00 +00:00
Edward Tomasz Napierala
9df66c85e3 Cross-reference automount(8) from mount(8).
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2014-11-22 16:43:36 +00:00
Warner Losh
009ad003a2 Recommit r274750. 2014-11-21 01:43:55 +00:00
Warner Losh
adafc9d6e7 Back our r274750 until discussions on proper fix are over. 2014-11-20 21:18:19 +00:00
Andrey V. Elsukov
681a5b28a4 Use geom attribute "PART::type" to determine partition type and choose
relevant fsck_xxx utility.

MFC after:	1 week
2014-11-20 16:31:31 +00:00
Edward Tomasz Napierala
579a4f031e Uniformly refer to a file system as "file system".
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2014-11-20 06:14:40 +00:00
Edward Tomasz Napierala
85941ebd33 Add example on how to use gpart before growfs. While here, reorder examples
so that the simplest one comes first.

MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2014-11-20 06:12:11 +00:00
Edward Tomasz Napierala
7550bae5d8 Document growfs(8) feature apparently nobody knows about.
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2014-11-20 05:31:41 +00:00
Edward Tomasz Napierala
d888bdf640 Use proper ordering in EXAMPLES section in growfs(8).
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2014-11-20 05:25:52 +00:00
Mark Felder
46ad509bf8 Expose groups by default in ifconfig output. This was never hidden by
OpenBSD; unsure why we chose to do so. As groups are a requirement for
pf, exposing them by default will make our pf implementation less
confusing.

While here add a missing free() that OpenBSD fixed 7 years ago.

PR:		194925
Differential Revision:	https://reviews.freebsd.org/D1185
Approved by:	des
Obtained from:	OpenBSD
2014-11-19 13:57:39 +00:00
Mark Felder
e2d52f146f Fix geom's "usage" generation to not fabricate usage/help output for any
imaginary class we give it.

Differential Revision:	https://reviews.freebsd.org/D1150
Submitted by:	homerj
Approved by:	pjd
2014-11-17 15:19:57 +00:00
Alexander V. Chernikov
7f948f12f6 Finish r274175: do control plane MTU tracking.
Update route MTU in case of ifnet MTU change.
Add new RTF_FIXEDMTU to track explicitly specified MTU.

Old behavior:
ifconfig em0 mtu 1500->9000 -> all routes traversing em0 do not change MTU.
User has to manually update all routes.
ifconfig em0 mtu 9000->1500 -> all routes traversing em0 do not change MTU.
However, if ip[6]_output finds route with rt_mtu > interface mtu, rt_mtu
gets updated.

New behavior:
ifconfig em0 mtu 1500->9000 -> all interface routes in all fibs gets updated
with new MTU unless RTF_FIXEDMTU flag set on them.
ifconfig em0 mtu 9000->1500 -> all routes in all fibs gets updated with new
MTU unless RTF_FIXEDMTU flag set on them AND rt_mtu is less than ifp mtu.

route add ... -mtu XXX automatically sets RTF_FIXEDMTU flag.
route change .. -mtu 0 automatically removes RTF_FIXEDMTU flag.

PR:		194238
MFC after:	1 month
CR:		D1125
2014-11-17 01:05:29 +00:00
Ed Maste
9d1334e076 Reference uefi(8) from i386 boot(8)
Suggested by trasz.

Differential Revision: https://reviews.freebsd.org/D1162
2014-11-14 20:12:33 +00:00
Alexander V. Chernikov
670e8b3b8c Kill custom in_matroute() radix mathing function removing one rte mutex lock.
Initially in_matrote() in_clsroute() in their current state was introduced by
r4105 20 years ago. Instead of deleting inactive routes immediately, we kept them
in route table, setting RTPRF_OURS flag and some expire time. After that, either
GC came or RTPRF_OURS got removed on first-packet. It was a good solution
in that days (and probably another decade after that) to keep TCP metrics.
However, after moving metrics to TCP hostcache in r122922, most of in_rmx
functionality became unused. It might had been used for flushing icmp-originated
routes before rte mutexes/refcounting, but I'm not sure about that.

So it looks like this is nearly impossible to make GC do its work nowadays:

in_rtkill() ignores non-RTPRF_OURS routes.
route can only become RTPRF_OURS after dropping last reference via rtfree()
which calls in_clsroute(), which, it turn, ignores UP and non-RTF_DYNAMIC routes.

Dynamic routes can still be installed via received redirect, but they
have default lifetime (no specific rt_expire) and no one has another trie walker
to call RTFREE() on them.

So, the changelist:
* remove custom rnh_match / rnh_close matching function.
* remove all GC functions
* partially revert r256695 (proto3 is no more used inside kernel,
  it is not possible to use rt_expire from user point of view, proto3 support
  is not complete)
* Finish r241884 (similar to this commit) and remove remaining IPv6 parts

MFC after:	1 month
2014-11-11 02:52:40 +00:00
Bryan Venteicher
eccc99cb3e Attempt to report a better error if sanitize is not supported
MFC after:	1 month
2014-11-09 18:13:08 +00:00
Poul-Henning Kamp
89cbe4e288 Report the 1-based key numbers rather than the 0-based ones to be consistent.
Fix documentation for destroy command.  Not sure how the wrong explanation
happened.

Spotted by:	mwlucas
2014-11-09 15:53:29 +00:00
Andrey V. Elsukov
f325335caf Overhaul if_gre(4).
Split it into two modules: if_gre(4) for GRE encapsulation and
if_me(4) for minimal encapsulation within IP.

gre(4) changes:
* convert to if_transmit;
* rework locking: protect access to softc with rmlock,
  protect from concurrent ioctls with sx lock;
* correct interface accounting for outgoing datagramms (count only payload size);
* implement generic support for using IPv6 as delivery header;
* make implementation conform to the RFC 2784 and partially to RFC 2890;
* add support for GRE checksums - calculate for outgoing datagramms and check
  for inconming datagramms;
* add support for sending sequence number in GRE header;
* remove support of cached routes. This fixes problem, when gre(4) doesn't
  work at system startup. But this also removes support for having tunnels with
  the same addresses for inner and outer header.
* deprecate support for various GREXXX ioctls, that doesn't used in FreeBSD.
  Use our standard ioctls for tunnels.

me(4):
* implementation conform to RFC 2004;
* use if_transmit;
* use the same locking model as gre(4);

PR:		164475
Differential Revision:	D1023
No objections from:	net@
Relnotes:	yes
Sponsored by:	Yandex LLC
2014-11-07 19:13:19 +00:00
Baptiste Daroussin
b7f7b35fd3 fsirand does not actually use libutil 2014-11-05 22:46:11 +00:00