summaryrefslogtreecommitdiff
path: root/sbin
Commit message (Collapse)AuthorAgeFilesLines
* After r270929 RAW IP code assumes that all IP fields are in networkAndrey V. Elsukov2015-01-231-2/+2
| | | | | | | | byte order. Fix ping(8) to pass an IP header with converted ip_off and ip_len fields, when IP_HDRINCL socket option used. Notes: svn path=/head/; revision=277562
* Eliminate incorrect IPv6 mask guessing:Alexander V. Chernikov2015-01-161-9/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=277241
* Add devd(8) notifications for creation and destruction of GEOM devices.Edward Tomasz Napierala2015-01-141-1/+28
| | | | | | | | | Differential Revision: https://reviews.freebsd.org/D1211 MFC after: 1 month Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=277170
* Improve camcontrol(8) handling of drive defect data.Kenneth D. Merry2015-01-082-184/+453
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=276835
* Remove old ioctl use and support, once and for all.Warner Losh2015-01-064-150/+20
| | | | Notes: svn path=/head/; revision=276737
* Integrate sbin/ifconfig/tests from NetBSD into atf/kyuaEnji Cooper2015-01-042-0/+17
| | | | | | | Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=276668
* mdoc: paragraph improvements.Joel Dahl2015-01-042-12/+3
| | | | Notes: svn path=/head/; revision=276659
* Belatedly commit the patch for SA-14:21 to head. It was not committed toDag-Erling Smørgrav2015-01-031-0/+4
| | | | | | | | head at the time because it's a band-aid, rather than a complete fix, but the complete fix never materialized. Notes: svn path=/head/; revision=276602
* mdoc: remove EOL whitespace.Joel Dahl2014-12-297-17/+17
| | | | Notes: svn path=/head/; revision=276360
* mdoc: improvements to SEE ALSO.Joel Dahl2014-12-277-10/+10
| | | | Notes: svn path=/head/; revision=276293
* Adjust printf format specifiers for dev_t and ino_t in user space.Gleb Kurtsou2014-12-171-19/+27
| | | | | | | | | ino_t and dev_t are about to become uint64_t. Reviewed by: kib, mckusick Notes: svn path=/head/; revision=275855
* Prefix all the vxlan ifconfig commands so they are uniqueBryan Venteicher2014-12-173-43/+43
| | | | | | | And rehook ifvxlan back into the build. Notes: svn path=/head/; revision=275851
* Add ability to not specify a zone identifier twice, when both source andAndrey V. Elsukov2014-12-161-4/+13
| | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=275830
* sbin/shutdown: Support time units as in 'shutdown -r +5sec'Gleb Kurtsou2014-12-162-3/+32
| | | | | | | | | Units supported: s, sec, m, min, h, hour. Differential Revision: https://reviews.freebsd.org/D1272 Notes: svn path=/head/; revision=275818
* Add fstyp(8). This utility, named after its SVR4 counterpart, detectsEdward Tomasz Napierala2014-12-101-1/+2
| | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=275680
* Move iscsi.conf.5 from sbin/iscontrol/ to usr.bin/iscsictl/, as theEdward Tomasz Napierala2014-12-052-189/+1
| | | | | | | | | | former is obsolete. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=275510
* Fix inverted logic introduced in r272154.Xin LI2014-12-011-2/+5
| | | | | | | | Noticed by: trasz MFC after: 2 weeks Notes: svn path=/head/; revision=275377
* Disable the vxlan code until the people reponsible for it can come up withDag-Erling Smørgrav2014-12-011-1/+1
| | | | | | | | | new command names that don't conflict with existing commands. Pointy hat to: bryanv Notes: svn path=/head/; revision=275361
* Convert sbin/mdconfig/tests from prove format tests to ATF format testsEnji Cooper2014-11-275-613/+284
| | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=275170
* Convert sbin/ to LIBADDBaptiste Daroussin2014-11-2564-144/+73
| | | | | | | Reduce overlinking Notes: svn path=/head/; revision=275030
* Misc mdoc fixes:Joel Dahl2014-11-231-2/+1
| | | | | | | | | | | - Remove superfluous paragraph macros. - Remove/fix empty or incorrect macros. - Sort sections into conventional order. - Terminate quoted strings properly. - Remove EOL whitespace. Notes: svn path=/head/; revision=274925
* Cross-reference autounmountd(8) from umount(8).Edward Tomasz Napierala2014-11-221-1/+2
| | | | | | | | MFC after: 1 month Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=274858
* Cross-reference automount(8) from mount(8).Edward Tomasz Napierala2014-11-221-1/+2
| | | | | | | | MFC after: 1 month Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=274857
* Recommit r274750.Warner Losh2014-11-211-29/+25
| | | | Notes: svn path=/head/; revision=274770
* Back our r274750 until discussions on proper fix are over.Warner Losh2014-11-201-25/+29
| | | | Notes: svn path=/head/; revision=274761
* Use geom attribute "PART::type" to determine partition type and chooseAndrey V. Elsukov2014-11-201-29/+25
| | | | | | | | | relevant fsck_xxx utility. MFC after: 1 week Notes: svn path=/head/; revision=274750
* Uniformly refer to a file system as "file system".Edward Tomasz Napierala2014-11-201-3/+3
| | | | | | | | MFC after: 1 month Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=274742
* Add example on how to use gpart before growfs. While here, reorder examplesEdward Tomasz Napierala2014-11-201-6/+6
| | | | | | | | | | so that the simplest one comes first. MFC after: 1 month Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=274741
* Document growfs(8) feature apparently nobody knows about.Edward Tomasz Napierala2014-11-201-0/+3
| | | | | | | | MFC after: 1 month Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=274738
* Use proper ordering in EXAMPLES section in growfs(8).Edward Tomasz Napierala2014-11-201-5/+4
| | | | | | | | MFC after: 1 month Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=274737
* Expose groups by default in ifconfig output. This was never hidden byMark Felder2014-11-191-3/+2
| | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=274710
* Fix geom's "usage" generation to not fabricate usage/help output for anyMark Felder2014-11-171-0/+5
| | | | | | | | | | | imaginary class we give it. Differential Revision: https://reviews.freebsd.org/D1150 Submitted by: homerj Approved by: pjd Notes: svn path=/head/; revision=274631
* Finish r274175: do control plane MTU tracking.Alexander V. Chernikov2014-11-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=274611
* Reference uefi(8) from i386 boot(8)Ed Maste2014-11-141-2/+8
| | | | | | | | | Suggested by trasz. Differential Revision: https://reviews.freebsd.org/D1162 Notes: svn path=/head/; revision=274527
* Kill custom in_matroute() radix mathing function removing one rte mutex lock.Alexander V. Chernikov2014-11-113-6/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=274363
* Attempt to report a better error if sanitize is not supportedBryan Venteicher2014-11-091-8/+24
| | | | | | | MFC after: 1 month Notes: svn path=/head/; revision=274322
* Report the 1-based key numbers rather than the 0-based ones to be consistent.Poul-Henning Kamp2014-11-092-5/+18
| | | | | | | | | | Fix documentation for destroy command. Not sure how the wrong explanation happened. Spotted by: mwlucas Notes: svn path=/head/; revision=274314
* Overhaul if_gre(4).Andrey V. Elsukov2014-11-071-18/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=274246
* fsirand does not actually use libutilBaptiste Daroussin2014-11-051-2/+0
| | | | Notes: svn path=/head/; revision=274148
* Put "break" after err() to please coverity.Alexander V. Chernikov2014-11-041-0/+1
| | | | | | | | Reported by: Coverity CID: 1250795 Notes: svn path=/head/; revision=274086
* Print human-readable error for "route not found" case.Alexander V. Chernikov2014-10-311-2/+11
| | | | | | | | | Submitted by: vsevolod (initial version) MFC after: 2 weeks Sponsored by: Yandex LLC Notes: svn path=/head/; revision=273906
* Build mount_nfs(8) with WARNS=6.Edward Tomasz Napierala2014-10-312-50/+59
| | | | | | | | | Reviewed by: rmacklem@ MFC after: 1 month Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=273896
* Make UEFI booting of 4Kn disks work:Doug Ambrisko2014-10-302-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - convert boot1.efi to corrrectly calculate the lba for what the media reports and convert the size based on what FreeBSD uses. The existing code would use the 512 byte lba and convert the size using 4K byte size. - make fsck_msdosfs read the boot block as 4K so the read doesn't fail on a 4Kn drive since FreeBSD will error out parition reads of a block. Make the bpbBytesPerSec check a multiple of 512 since it can be 512 or 4K depending on the disk. This allows fsck to pass checking the EFI partition on a 4Kn disk. To create the EFI file system I used: newfs_msdos -F 32 -S 4096 -c 1 -m 0xf8 <partition> This works for booting 512 and 4Kn disks. Caveat is that loader.efi cannot read the 4Kn EFI partition. This isn't critical right now since boot1.efi will read loader.efi from the ufs partition. It looks like loader.efi can be fixed via making some of the 512 bytes reads more flexible. loader.efi doesn't have trouble reading the ufs partition. This is probably a simple fix. I now have FreeBSD installed on a system with 4Kn drives and tested the same code works on 512. MFC after: 1 week Notes: svn path=/head/; revision=273865
* Remove two functions unused after r273848. Would be nice if clangEdward Tomasz Napierala2014-10-301-29/+0
| | | | | | | | | | or at least scan-build yelled about it. MFC after: 1 month Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=273861
* Note that the "timeout" nfs option is in tenths of a second.Edward Tomasz Napierala2014-10-301-1/+2
| | | | | | | | MFC after: 1 month Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=273851
* Add support for "timeo", "actimeo", "noac", and "proto" optionsEdward Tomasz Napierala2014-10-302-1/+46
| | | | | | | | | | | | to mount_nfs(8). They are implemented on Linux, OS X, and Solaris, and thus can be expected to appear in automounter maps. Reviewed by: rmacklem@ MFC after: 1 month Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=273849
* Get rid of obsolete code in mount_nfs(8).Edward Tomasz Napierala2014-10-301-217/+2
| | | | | | | | Reviewed by: rmacklem@ Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=273848
* Fix documentation issue.Alexander V. Chernikov2014-10-241-2/+2
| | | | | | | | PR: 194581 Submitted by: madpilot Notes: svn path=/head/; revision=273594
* Fix displaying non-contiguous netmasks.Alexander V. Chernikov2014-10-241-3/+4
| | | | | | | | Found by: ae Sponsored by: Yandex LLC Notes: svn path=/head/; revision=273586
* Show SFP+/QSFP memory map dump on higher verbose levels.Alexander V. Chernikov2014-10-231-2/+44
| | | | | | | | Sponsored by: Yandex LLC MFC after: 1 week Notes: svn path=/head/; revision=273541