summaryrefslogtreecommitdiffstats
path: root/sbin
Commit message (Collapse)AuthorAgeFilesLines
* Implement the -l and -r options for gpart show.marcel2008-06-131-6/+32
| | | | | | The -l option changes the output to show the partition label, if applicable and when present. The -r option changes the output to show the raw (i.e. scheme-specific) partition types.
* Remove gpt(8). It's replaced by gpart(8).marcel2008-06-0915-3544/+0
|
* Use the -n flag to route(8) when calling "route get". Otherwise we hangbrooks2008-06-091-1/+1
| | | | | | for a long time if we get a lease, but DNS isn't working. MFC after: 1 week
* Disconnect gpt(8) from the build. gpt(8) is replaced by gpart(8).marcel2008-06-091-1/+0
|
* Document the misleading nature of the REQUIRE line. The patch inmtm2008-06-091-1/+20
| | | | | | | the PR has been heavily edited for style(9) and clarity. Mistakes are mine. PR: bin/124251
* - Display '-C' option in usage().stas2008-06-081-1/+1
| | | | Approved by: kib
* Document the new -p and -i options for writing bootstrap code intomarcel2008-06-071-8/+24
| | | | | a partition. Make it clear that the -b option embeds boot code in the meta-data.
* Enhance the bootcode command to also allow bootcode to be writtenmarcel2008-06-061-25/+143
| | | | | to a partition. This avoids that users need to use dd(1) to install boot code (as is needed for VTOC8 and booting GPT on PCs).
* Add two support functions:marcel2008-06-062-0/+47
| | | | | | | | | | | | | o gctl_delete_param() -- intended for parameters that are consumed by geom(8) itself and which should not be passed to the kernel. o gctl_has_param() -- intended to check if optional parameters are present. Both are needed by gpart(8) to process the optional parameter for writing bootcode to a partition (as part of the bootcode verb). However, the kernel is itself not involved in this matter and the parameter needs to be removed from the request destined for the kernel.
* Don't abend if we get ENOMEM from sysctl(3). The data returnedbrian2008-06-061-1/+1
| | | | | | is sufficient MFC after: 2 weeks
* Update the manpage to reflect reality:marcel2008-06-061-3/+32
| | | | | | o The BSD, PC98 and VTOC8 schemes are supported. o The bootcode command was added to allow installing bootstrap code into the scheme's metadata.
* Allow building a static geom(8) for release related crunchedmarcel2008-06-051-1/+1
| | | | | binaries. In particular, this allows geom to be added to the boot_crunch binary on ia64.
* Replace checks for RESCUE in sources with checks for STATIC_GEOM_CLASSESmarcel2008-06-044-8/+8
| | | | | | and define STATIC_GEOM_CLASSES when building the rescue binary. This way geom can more easily be part of other crunched binaries, as it requires only a Makefile change.
* Fix markup.ru2008-06-031-4/+6
|
* Add note about a reason to use mount(8) instead of mount_somefs.kib2008-06-031-0/+11
| | | | | | Reported and proof-readed by: pho Discussed with: rodrigc MFC after: 3 days
* Change the exit status for 0 and 2 to be the same as with ping(1)bz2008-05-272-4/+9
| | | | | | | | | | and be usable in scripts, etc. This also changes the semantics in case when we lose one of n packets. In that case, before we exited by SIG, now we exit with return(0). Submitted by: Gert Doering (gert space.net) MFC after: 10 days
* Remove netatm from HEAD as it is not MPSAFE and relies on the now removedrwatson2008-05-2519-14522/+0
| | | | | | | | | | | | | | | | | | | NET_NEEDS_GIANT. netatm has been disconnected from the build for ten months in HEAD/RELENG_7. Specifics: - netatm include files - netatm command line management tools - libatm - ATM parts in rescue and sysinstall - sample configuration files and documents - kernel support as a module or in NOTES - netgraph wrapper nodes for netatm - ctags data for netatm. - netatm-specific device drivers. MFC after: 3 weeks Reviewed by: bz Discussed with: bms, bz, harti
* Expand dump to allow MAX_INT dump levels.mckusick2008-05-243-14/+21
| | | | | PR: bin/100732 Submitted by: Matthew Vincenz <msvincen@midway.uchicago.edu>
* When using dump to generate level 0 dumps which are then rsync'edmckusick2008-05-234-4/+51
| | | | | | | | | | | | to a remote machine, the fact that the dump date is stored with each header (inode) record makes rsync significantly less efficient than necessary. This also applies to inode access times when they are not important data to retain. When implementing an offsite backup solution of this type, these dates in particular are not important, especially if it prevents effective offsite backups. PR: bin/91049 Submitted by: Forrest W Christian <fwc@mt.net>
* Fix nits pointed out in PR bin/39905 that have not already beenmckusick2008-05-231-3/+3
| | | | | | corrected since it was filed. With this change the PR will be closed. PR: bin/39905
* This fixes the "getfile: lost data" panic when restoring dumpsmckusick2008-05-221-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | on a 7.0 or later system that were created on a pre-5.0 system. We must ensure that restore zeros out the previously undefined birthtime and external attribute size fields when reading dump tapes made by the UFS1 dump program. The problem is that UFS2 dump carefully zeros out the unused birthtime and external attribute size fields in the dump header when dumping UFS1 filesystems, but the UFS1 dump didn't know about those fields (they were spares) so just left whatever random junk was in them. So, when restoring one of these pre-UFS2 dumps, the new restore would eventually trip across a header that had a non-zero external attribute size and try to extract it. That consumed several tape blocks which left it totally out of sync and very unhappy (i.e., the panic). The fix is in the gethead() function which modernizes old headers by copying old fields to their new location (and with this fix) zeroing out previously undefined fields. PR: bin/120881 Review by: David Malone & Scott Lambert MFC after: 1 week
* Follow on to fix 1.51 for "Header with wrong dumpdate" message.mckusick2008-05-221-16/+10
| | | | | | | | | | | Must ensure that dump tapes from UFS1 filesystems properly copy old fields of dump headers to new locations. Move check of dumpdate to follow the code which ensures that the appropriate fields have been copied. PR: bin/118087 Help from: David Malone, Scott Lambert, Javier Martín Rueda MFC after: 2 weeks
* - Change the meaning of -h flag from giving the output in megabytes topjd2008-05-203-21/+67
| | | | | | | giving the output in a human-readable form. This behaviour is consistent with most of system tools. - Add -m and -g options to give output in megabytes and gigabytes respectively.
* Fix for a bug I introduced when I cleaned up atacontrol: Don't terminatephk2008-05-151-3/+5
| | | | | | if we are listing devices, a controller might legitimately not be there. Submitted by: "Andrey V. Elsukov" <bu7cher@yandex.ru>
* Change two variables to size_t to improve portability.julian2008-05-101-1/+2
| | | | Submitted by: Xin Li
* Add code to allow the system to handle multiple routing tables.julian2008-05-092-2/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This particular implementation is designed to be fully backwards compatible and to be MFC-able to 7.x (and 6.x) Currently the only protocol that can make use of the multiple tables is IPv4 Similar functionality exists in OpenBSD and Linux. From my notes: ----- One thing where FreeBSD has been falling behind, and which by chance I have some time to work on is "policy based routing", which allows different packet streams to be routed by more than just the destination address. Constraints: ------------ I want to make some form of this available in the 6.x tree (and by extension 7.x) , but FreeBSD in general needs it so I might as well do it in -current and back port the portions I need. One of the ways that this can be done is to have the ability to instantiate multiple kernel routing tables (which I will now refer to as "Forwarding Information Bases" or "FIBs" for political correctness reasons). Which FIB a particular packet uses to make the next hop decision can be decided by a number of mechanisms. The policies these mechanisms implement are the "Policies" referred to in "Policy based routing". One of the constraints I have if I try to back port this work to 6.x is that it must be implemented as a EXTENSION to the existing ABIs in 6.x so that third party applications do not need to be recompiled in timespan of the branch. This first version will not have some of the bells and whistles that will come with later versions. It will, for example, be limited to 16 tables in the first commit. Implementation method, Compatible version. (part 1) ------------------------------- For this reason I have implemented a "sufficient subset" of a multiple routing table solution in Perforce, and back-ported it to 6.x. (also in Perforce though not always caught up with what I have done in -current/P4). The subset allows a number of FIBs to be defined at compile time (8 is sufficient for my purposes in 6.x) and implements the changes needed to allow IPV4 to use them. I have not done the changes for ipv6 simply because I do not need it, and I do not have enough knowledge of ipv6 (e.g. neighbor discovery) needed to do it. Other protocol families are left untouched and should there be users with proprietary protocol families, they should continue to work and be oblivious to the existence of the extra FIBs. To understand how this is done, one must know that the current FIB code starts everything off with a single dimensional array of pointers to FIB head structures (One per protocol family), each of which in turn points to the trie of routes available to that family. The basic change in the ABI compatible version of the change is to extent that array to be a 2 dimensional array, so that instead of protocol family X looking at rt_tables[X] for the table it needs, it looks at rt_tables[Y][X] when for all protocol families except ipv4 Y is always 0. Code that is unaware of the change always just sees the first row of the table, which of course looks just like the one dimensional array that existed before. The entry points rtrequest(), rtalloc(), rtalloc1(), rtalloc_ign() are all maintained, but refer only to the first row of the array, so that existing callers in proprietary protocols can continue to do the "right thing". Some new entry points are added, for the exclusive use of ipv4 code called in_rtrequest(), in_rtalloc(), in_rtalloc1() and in_rtalloc_ign(), which have an extra argument which refers the code to the correct row. In addition, there are some new entry points (currently called rtalloc_fib() and friends) that check the Address family being looked up and call either rtalloc() (and friends) if the protocol is not IPv4 forcing the action to row 0 or to the appropriate row if it IS IPv4 (and that info is available). These are for calling from code that is not specific to any particular protocol. The way these are implemented would change in the non ABI preserving code to be added later. One feature of the first version of the code is that for ipv4, the interface routes show up automatically on all the FIBs, so that no matter what FIB you select you always have the basic direct attached hosts available to you. (rtinit() does this automatically). You CAN delete an interface route from one FIB should you want to but by default it's there. ARP information is also available in each FIB. It's assumed that the same machine would have the same MAC address, regardless of which FIB you are using to get to it. This brings us as to how the correct FIB is selected for an outgoing IPV4 packet. Firstly, all packets have a FIB associated with them. if nothing has been done to change it, it will be FIB 0. The FIB is changed in the following ways. Packets fall into one of a number of classes. 1/ locally generated packets, coming from a socket/PCB. Such packets select a FIB from a number associated with the socket/PCB. This in turn is inherited from the process, but can be changed by a socket option. The process in turn inherits it on fork. I have written a utility call setfib that acts a bit like nice.. setfib -3 ping target.example.com # will use fib 3 for ping. It is an obvious extension to make it a property of a jail but I have not done so. It can be achieved by combining the setfib and jail commands. 2/ packets received on an interface for forwarding. By default these packets would use table 0, (or possibly a number settable in a sysctl(not yet)). but prior to routing the firewall can inspect them (see below). (possibly in the future you may be able to associate a FIB with packets received on an interface.. An ifconfig arg, but not yet.) 3/ packets inspected by a packet classifier, which can arbitrarily associate a fib with it on a packet by packet basis. A fib assigned to a packet by a packet classifier (such as ipfw) would over-ride a fib associated by a more default source. (such as cases 1 or 2). 4/ a tcp listen socket associated with a fib will generate accept sockets that are associated with that same fib. 5/ Packets generated in response to some other packet (e.g. reset or icmp packets). These should use the FIB associated with the packet being reponded to. 6/ Packets generated during encapsulation. gif, tun and other tunnel interfaces will encapsulate using the FIB that was in effect withthe proces that set up the tunnel. thus setfib 1 ifconfig gif0 [tunnel instructions] will set the fib for the tunnel to use to be fib 1. Routing messages would be associated with their process, and thus select one FIB or another. messages from the kernel would be associated with the fib they refer to and would only be received by a routing socket associated with that fib. (not yet implemented) In addition Netstat has been edited to be able to cope with the fact that the array is now 2 dimensional. (It looks in system memory using libkvm (!)). Old versions of netstat see only the first FIB. In addition two sysctls are added to give: a) the number of FIBs compiled in (active) b) the default FIB of the calling process. Early testing experience: ------------------------- Basically our (IronPort's) appliance does this functionality already using ipfw fwd but that method has some drawbacks. For example, It can't fully simulate a routing table because it can't influence the socket's choice of local address when a connect() is done. Testing during the generating of these changes has been remarkably smooth so far. Multiple tables have co-existed with no notable side effects, and packets have been routes accordingly. ipfw has grown 2 new keywords: setfib N ip from anay to any count ip from any to any fib N In pf there seems to be a requirement to be able to give symbolic names to the fibs but I do not have that capacity. I am not sure if it is required. SCTP has interestingly enough built in support for this, called VRFs in Cisco parlance. it will be interesting to see how that handles it when it suddenly actually does something. Where to next: -------------------- After committing the ABI compatible version and MFCing it, I'd like to proceed in a forward direction in -current. this will result in some roto-tilling in the routing code. Firstly: the current code's idea of having a separate tree per protocol family, all of the same format, and pointed to by the 1 dimensional array is a bit silly. Especially when one considers that there is code that makes assumptions about every protocol having the same internal structures there. Some protocols don't WANT that sort of structure. (for example the whole idea of a netmask is foreign to appletalk). This needs to be made opaque to the external code. My suggested first change is to add routing method pointers to the 'domain' structure, along with information pointing the data. instead of having an array of pointers to uniform structures, there would be an array pointing to the 'domain' structures for each protocol address domain (protocol family), and the methods this reached would be called. The methods would have an argument that gives FIB number, but the protocol would be free to ignore it. When the ABI can be changed it raises the possibilty of the addition of a fib entry into the "struct route". Currently, the structure contains the sockaddr of the desination, and the resulting fib entry. To make this work fully, one could add a fib number so that given an address and a fib, one can find the third element, the fib entry. Interaction with the ARP layer/ LL layer would need to be revisited as well. Qing Li has been working on this already. This work was sponsored by Ironport Systems/Cisco Reviewed by: several including rwatson, bz and mlair (parts each) Obtained from: Ironport systems/Cisco
* Update the lib/expat tree for the new v2.0.1 expat import. The bsdxml.hcokane2008-05-081-1/+1
| | | | | | | | | header is now in two parts: bsdxml.h and bsdxml_external.h, representing the expat.h and expat_external.h headers. Updated the info on the man page as well. Also, fixed a type-error in a printf in sbin/ifconfig/regdomain.c that would cause a compiler warning. Approved by: sam, phk
* Add "ddb capture print" and "ddb capture status" commands do ddb(8),rwatson2008-04-255-5/+297
| | | | | | | | | | | | | | alowing the DDB output capture buffer to be easily extracted from user space. Both of these commands include -M/-N arguments, allowing them to be used with kernel crash dumps (or /dev/mem). This makes it easier to use DDB scripting and output capture with minidumps or full dumps rather than with text dumps, allowing DDB output (scripted or otherwise) to be easily extracted from a crash dump. MFC after: 1 week Discussed with: brooks, jhb
* Multi-bss (aka vap) support for 802.11 devices.sam2008-04-206-330/+2491
| | | | | | | | | | | Note this includes changes to all drivers and moves some device firmware loading to use firmware(9) and a separate module (e.g. ral). Also there no longer are separate wlan_scan* modules; this functionality is now bundled into the wlan module. Supported by: Hobnob and Marvell Reviewed by: many Obtained from: Atheros (some bits)
* When sending packets directly to the DHCP server, use a socket and sendbrooks2008-04-151-0/+15
| | | | | | | | directly rather than bogusly sending it out as a link layer broadcast (which fails to be received on some networks). PR: bin/96018 MFC after: 2 weeks
* restore(8) does not check for write failure while building two tempmckusick2008-04-141-24/+68
| | | | | | | | | | | files containing directory and ownership data. If /tmp fills, the console is blasted with zillions of "file system full" errors, and restore continues on, even though directory and/or ownership data has been lost. This is particularly likely to happen when running from the live CD, which has little /tmp space. PR: bin/93603, also probably bin/107213 Fix from: Ken Lalonde
* Add the bootcode verb for installing boot code. Boot codemarcel2008-04-131-3/+47
| | | | | is supported for the MBR, GPT and PC98 schemes, where GPT installs boot code into the PMBR.
* I keep taking timemachines to get back in time. Update theremko2008-04-131-1/+1
| | | | | | year to 2008. Noticed by: ceri
* Add missing device in tunefs entry.remko2008-04-131-2/+2
| | | | | | PR: docs/122702 Submitted by: Yoshihiro Ota <ota@j.email.ne.jp> MFC After: 3 days
* Avoid printing spurious ``Header with wrong dumpdate.'' message.mckusick2008-04-111-1/+1
|
* Correctly set file group when restore is run by a user other than root.mckusick2008-04-112-2/+9
|
* Add a new flag, '-C' which enables a special mode that is intended fordelphij2008-04-105-7/+61
| | | | | | | | | | catastrophic recovery. Currently, this mode only validates whether a cylindergroup has good signature data, and prompts the user to decide whether to clear it as a whole. This mode is useful when there is data damage on a disk and you are working on copy of the original disk, as fsck_ffs(8) tends to abnormally exit in such case, as a last resort to recover data from the disk.
* Fix printing of sockaddr prefixes in verbose mode.ru2008-04-101-1/+1
| | | | | | PR: bin/122403 Submitted by: az MFC after: 3 days
* Add 'zfs' as an alias for the FreeBSD ZFS UUID.jhb2008-04-071-0/+7
| | | | | | MFC after: 3 days PR: bin/119976 Submitted by: Cian Hughes Ci of nhugh.es
* - Normalize usage(), add "ddb pathname" syntax.ru2008-04-042-25/+28
| | | | - Revise the manpage.
* Add comment about specifying "ro" mount option whenrodrigc2008-04-041-0/+4
| | | | | | doing an update mount on a read-only file system. Requested by: yar
* Use safer string handling.imp2008-04-032-11/+8
| | | | Reviewed by: security-team
* Fix handling of create operation together with setting other parameters:sam2008-03-314-9/+42
| | | | | | | | | | | o mark cmds/parameters to indicate they are potential arguments to a clone operation (e.g. vlantag) o when handling a create/clone operation do the callback on seeing the first non-clone cmd line argument so the new device is created and can be used; and re-setup operating state to reflect the newly created device Reviewed by: Eugene Grosbein MFC after: 2 weeks
* Add a new function is_default_interface() which determines if thisbrooks2008-03-301-20/+48
| | | | | | | | | | | interface is one with the default route (or there isn't one). Use it to decide if we should adjust the default route and /etc/resolv.conf. Fix the delete of the default route. The if statement was totally bogus and the delete only worked due to a typo. [1] Reported by: Jordan Coleman <jordan at JordanColeman dot com> [1] MFC after: 1 week
* Remove options MK_LIBKSE and DEFAULT_THREAD_LIB now that we no longerru2008-03-291-1/+1
| | | | build libkse. This should fix WITHOUT_LIBTHR builds as a side effect.
* Remove comment about "-r" flag from readlabel. "-r" is a no-op.rodrigc2008-03-231-1/+0
| | | | | | The is comment is left over from the old disklabel command. Reviewed by: phk
* Defer state change on disassociate to avoid unnecessarily dropping thesam2008-03-221-15/+31
| | | | | | | | | | lease: track the current bssid and if it changes (as reported in an assoc/reassoc) event only then kick the state machine. This gives us immediate response when roaming but otherwise causes us to fallback on the normal state machine. Reviewed by: brooks, jhb MFC after: 3 weeks
* correct syslog mask so LOG_DEBUG msgs are not lostsam2008-03-221-1/+1
| | | | MFC after: 2 weeks
* In route.c in newroute() there's a call to exit(0) if the command wasremko2008-03-221-1/+1
| | | | | | | | | | 'get'. Since rtmsg() always gets called and returns 0 on success and -1 on failure, it's possible to exit with a suitable exit code by calling exit(ret != 0) instead, as is done at the end of newroute(). PR: bin/112303 Submitted by: bruce@cran.org.uk MFC after: 1 week
* No need to be gratuitously style(9) non-compliant here, even thoughimp2008-03-211-1/+1
| | | | C++ lets me get away with it.
OpenPOWER on IntegriCloud