Commit Graph

2371 Commits

Author SHA1 Message Date
lukem ed9bdbd8b9 - remove unused arg to getparts()
- clean up WARNS=2 problems
- implement getshort()
- use getshort() with MBR_MAGICOFF to test if the magic number is OK, rather
  than using hard-coded magic numbers
2001-02-18 03:36:07 +00:00
thorpej 617bd311bc Add a "deleteall" command that takes a src/dst/protocol. 2001-02-16 23:55:05 +00:00
minoura 2fafdf112c Descend to mount_* subdirs when cleandir, in addition to clean and distclean. 2001-02-14 14:21:08 +00:00
ad a42efe450c Fix typo. 2001-02-11 13:04:22 +00:00
itojun 22b473e0f6 during ip6/icmp6 inbound packet processing, do not call log() nor printf() in
normal operation (/var can get filled up by flodding bogus packets).
sysctl net.inet6.icmp6.nd6_debug will turn on diagnostic messages.
(#define ND6_DEBUG will turn it on by default)

improve stats in ND6 code.

lots of synchronziation with kame (including comments and cometic ones).
2001-02-07 08:59:47 +00:00
christos 180360ac44 remove redundant decl 2001-02-04 21:56:11 +00:00
christos df49c4a876 fix nested extern 2001-02-04 21:53:39 +00:00
christos aceee3f06d fix redundant decls 2001-02-04 21:52:02 +00:00
christos 93292f2f1a revert previous change; not needed. 2001-02-04 21:38:34 +00:00
christos abc5ad9724 fix nested extern 2001-02-04 21:38:01 +00:00
christos b9140b5b9f restore needs the rcmd operations. 2001-02-04 21:37:29 +00:00
christos 91a0880aad fix redundant decls 2001-02-04 21:33:19 +00:00
christos 566662ba06 remove redundant declarations 2001-02-04 21:25:54 +00:00
christos 422d686664 fix nested extern and duplicate declarations 2001-02-04 21:19:34 +00:00
christos 3aed6f1e40 avoid redundant declaration 2001-02-04 21:16:59 +00:00
christos a2c613b344 fix nested extern 2001-02-04 21:14:32 +00:00
christos 252e11ea2b fix nested extern. 2001-02-04 21:13:12 +00:00
christos f156d24d3f fix nested extern 2001-02-04 21:11:47 +00:00
christos 55692aa513 remove nested externs. 2001-02-04 21:09:07 +00:00
christos e2571306fb remove redundant prototypes. 2001-02-04 21:05:42 +00:00
christos a84f9073c7 fix nested extern 2001-02-04 20:09:40 +00:00
christos 158632e207 ifix nested extern. 2001-02-04 20:08:24 +00:00
christos 1e41af421a remove redundant declaration 2001-02-04 20:06:51 +00:00
christos f0cf3bcdfb fix nested externs 2001-02-04 20:05:20 +00:00
christos ccc59bf1d7 fix nested extern. While I am here assign copyright to TNF. 2001-02-04 20:04:02 +00:00
christos 8358095fd4 remove redundant declarations and nested externs. 2001-02-04 19:59:37 +00:00
christos ee002727d9 fix nested extern 2001-02-04 19:54:56 +00:00
itojun ad65d3d893 correct recvmsg() validation. 2001-02-04 00:35:20 +00:00
thorpej cab4d17202 Sprinkle some const. 2001-01-28 00:59:26 +00:00
oster 705631a231 Move parts of a RAID type mapping table from rf_layout.c to rf_configure.c.
This means we don't need to compile or link with rf_layout.c here.
2001-01-27 19:32:47 +00:00
itojun 08087050ed support -cloned command line flag.
i don't think anyone ever going to use it.
2001-01-27 04:53:13 +00:00
itojun 6a04f28b13 regen 2001-01-27 04:51:25 +00:00
itojun 16595a06cf add a keyword, cloned 2001-01-27 04:51:17 +00:00
itojun fee00b1a78 mark cloned routes with RTF_CLONED. present it with netstat -r by "c".
let static routes overwrite cloned routes, as cloned routes can come back again
if necessary.  behavior same as freebsd/bsdi, code partially from bsdi42.
(NRL rt->rt_parent was not added)
should fix PR 11916 and maybe some other PRs with ARP behavior.

recompilation of usr.sbin/route6d is suggested.
2001-01-27 04:49:31 +00:00
itojun ad678343e6 support RTF_BLACKHOLE.
XXX route show is total duplicate of netstat -r, we need to either remove
route show, or share the same source code, otherwise maintenance cost
bites (and is biting) us
2001-01-27 04:26:49 +00:00
itojun d9196c1881 remove use of uninitialized route (struct ortentry).
it seems that the bug was born during 4.3reno -> 4.4Lite1 transition.
2001-01-27 03:20:29 +00:00
hubertf 331005f88b Document that there's currently no registry for vendor sysctls.
After discussion with John Hawkinson and Frank van der Linden.
2001-01-26 21:13:23 +00:00
thorpej 9c45d4b02d In pass 5, check alternate superblocks for consistency with
the current in-core master superblock, and fix them up if
they're incorrect.  Move the code that writes the alternate
superblocks if (cvtlevel || doswap) into pass 5 for efficiency.

Reviewd by Charles Hannum, and used by me to fix up a curdled
file system.
2001-01-26 17:37:16 +00:00
itojun e42b253d93 more simpler signal handling. be more friendly with 4.3BSD-ish socket API
(linux/USAGI folks are using the code).  sync with kame.
2001-01-26 13:18:45 +00:00
enami cdf90f8e31 Remove incorrect advice for lint; the control may return from panic(). 2001-01-24 23:14:04 +00:00
garbled b17f8c01fa Fix the usage string so it displays the -b and s options to ifconfig -l 2001-01-24 18:06:51 +00:00
mycroft 1fa165bd82 Fix a rather glaring byte-swapping bug: di_size is 64 bits, not 16. 2001-01-23 02:35:51 +00:00
enami 2efd21a284 If possible, detect more case that file is missing on the tape.
XXX we still may lose if a file of highest inode number requested
XXX to extract was missing or one of multiple dump tape is lost.
2001-01-18 08:59:23 +00:00
fvdl 93beca224d Fix spelling. 2001-01-17 11:58:33 +00:00
fvdl 6129a28444 Document -o linux option. 2001-01-17 11:57:54 +00:00
itojun b3705ee26f unbroken slash notation (10.0.0.0/8) for IPv4. 2001-01-17 06:10:37 +00:00
itojun f3a31dc12d support "prefixlen n" for IPv4 too. 2001-01-17 06:07:32 +00:00
fvdl a7fede800b Add handling of -o linux. 2001-01-17 00:09:54 +00:00
cgd d594ce939b comment or delete text after CPP directives. 2001-01-16 02:50:27 +00:00
cgd 09995c7b56 generated source should include stdlib.h and string.h for prototypes. 2001-01-16 02:37:35 +00:00
itojun 7846de58b2 specify interface by using interface index (set/getsockopt with 0.0.0.0/8). 2001-01-15 13:19:12 +00:00
christos 8ce2d80d7a back out previous; it is better for now to handle the dependencies in
bsd.prog.mk
2001-01-14 09:41:41 +00:00
christos c26e2519ac add .NOTMAIN for good measure. 2001-01-14 09:24:30 +00:00
christos 726afedd26 don't use OBJS in the dependency line because it is not defined yet. 2001-01-14 09:22:01 +00:00
christos 9b6a2fbeb4 don't use OBJ in the dependency line cause it is not defined yet. 2001-01-14 09:21:24 +00:00
itojun b2f011d7b6 avoid signal handler race. help from deraadt 2001-01-12 19:13:41 +00:00
itojun 3a616a4855 correct use of howmany() for fd_set. commented by deraadt 2001-01-12 18:50:57 +00:00
martin 1bb8e47f65 Make option flag variables static. This avoids a conflict between
'int compress' in savecore.c and the function 'compress' in libz.
Gnu ld 2.10 (with BFD 2.10) used on sparc64 warns this conflict
(symbol "compress" changed size).
2001-01-11 20:27:12 +00:00
soren 65c1d02861 Remove extern __progname from enable_user(); no longer used. 2001-01-11 16:37:41 +00:00
lukem 0645f2f67b use explicit name rather than __progname in openlog 2001-01-11 01:34:28 +00:00
lukem 3efcec3cf5 remove unnecessary ":" in openlog ident 2001-01-11 01:33:35 +00:00
mycroft 521984e793 Whoops; call propagate() with the right child inode number. (Doesn't break
anything, but it would have made reconnect less efficient.)
2001-01-10 08:26:20 +00:00
mycroft f5a9d5eadc Abstract the code to attach a directory to its parent's child list into a
separate function, and call it from multiple places in linkup() to handle
reconnects and creation of /lost+found.
2001-01-10 08:22:20 +00:00
lukem d4b8ad46d7 don't use LOG_CONS
fix typo
2001-01-10 07:59:43 +00:00
lukem 790602fd72 deprecate LOG_ODELAY; it's the default 2001-01-10 03:47:41 +00:00
lukem f022cce90b use openlog correctly... 2001-01-10 03:41:35 +00:00
lukem 415d1abdd8 be consistent (both internally and with other programs):
log_err		fatal errors
	log_warning	non-fatal errors & warnings
	log_debug	debug messages (#ifdef DEBUG)
2001-01-10 03:33:16 +00:00
hubertf 44d7ee0289 * Document the vendor.* sysctl branch
* in sysctl.3, sort the list of CTL_ prefixes and sync with sysctl.h
2001-01-10 03:03:02 +00:00
lukem 37a54a1e9c deprecate LOG_ODELAY; it's the default 2001-01-10 03:01:41 +00:00
fvdl 4f289ff858 Number of toplevel names grew by one, account for it. 2001-01-09 21:31:02 +00:00
augustss e85ca50c79 Document what can happen with bad Rock Ridge info on the CD.
(Perhaps this can save someone the two hours I spent in the kernel
debugger tracking this down. :)
2001-01-09 20:51:26 +00:00
mycroft d722519e03 Make sure the rotor values are non-negative. 2001-01-09 11:20:00 +00:00
mycroft a48409305d A minor tweak. 2001-01-09 09:25:32 +00:00
enami 6c06fd4f9f Don't swap cg_clustersum(cg)[0]. It doesn't actually exists and it's
actually tail of free block bitmap.

XXX swap_cg() should be shared with newfs.
2001-01-09 09:08:35 +00:00
mycroft c4c9a7ecc0 Remove a bogus piece of code that was never used. 2001-01-09 06:05:10 +00:00
mycroft 66418680d4 The reconnect algorithm was historically O(n^4).
Some years ago I made it O(n^2).
Someone helpfully made it O(n^4) again.
Today I'm making it O(n).
If that's not good enough, I don't know what else to do.  B-)

Technical details:
* The graph traversal in propagate() is modified to be able to start from any
  point in the tree.  To handle certain exceptional cases, it is also modified
  to work in two passes, marking the tree with a special tag and then changing
  it to DFOUND.
* The reconnect case now modifies the child/sibling pointers and calls
  propagate() to propagate the connection state starting with the reconnected
  directory.

Pray that you never encounter a file system trashed enough for this to matter.
2001-01-09 05:51:14 +00:00
mycroft 3f2ff10f4c Try to cope with cs_ndir being wacky (too large or, particularly when using -b,
too damn small) by setting a minimum (1024) and maximum (maxino + 1).  This
prevents certain operations getting REALLY slow when -b is used, and also
avoids overallocating memory if the superblock is hosed.
2001-01-09 05:39:27 +00:00
itojun c5520fd00b uninitialized pointer. PR 11702 2001-01-08 14:06:12 +00:00
fvdl 275b941468 When -I is specified, we mean to initialize the label if it's not there
already. So, don't fail if there appears to be a corrupt label or
no 'fake' label; get the 'default' label (which is generated
from DIOCGDEFLABEL) instead.
2001-01-08 02:19:58 +00:00
joff 42ac80ad6d Fixed blockmap handling to properly use disk blocks rather than fragments.
Fixes an issue with fsck_lfs not detecting all duplicate blocks that may
exist in a corrupted filesystem.
2001-01-06 23:08:24 +00:00
cgd 169563b7c1 #warn is _not_ the GCC CPP directive that gives a warning, #warning is.
(this code has, apparently, always been wrong, but current GCC is kind
enough to warn about unknown CPP directives.)
2001-01-06 00:35:54 +00:00
lukem f7650338ca use %ll_ instead of the less standard %q_ 2001-01-05 02:02:57 +00:00
lukem ca48483336 minor knf 2001-01-05 01:41:34 +00:00
lukem 03c663afbc change verbose probe message to display "size xxx (yyy MB), offset zzz".
use %u instead of %d.
2001-01-04 00:57:14 +00:00
enami 0cd4f6f4aa Test read(2) failure by read(..., sizeof(n)) != sizeof(n) instead of
< sizeof(n) to avoid unwanted type promotion.
2001-01-03 06:57:57 +00:00
enami a48aa06c73 Kill whitespace at the end of line. 2001-01-03 06:55:30 +00:00
joda 7e74657e37 use gzip instead of compress 2001-01-02 21:39:37 +00:00
lukem 834e92eedc Bump the field width of `K to go' from 6 to 8; some systems have more
than 999999 KB of RAM... (this will suffice until it's common to have
~ 100 GB of RAM :)
2001-01-02 00:29:37 +00:00
itojun 1bc3ecd398 support IPv6. PR 11858 from ura@hiru.aoba.yokohama.jp 2000-12-31 06:03:52 +00:00
itojun f911e7eded indent and pedant. from deraadt. sync with kame 2000-12-31 05:04:15 +00:00
wiz 944d6ad333 Check return value of fgets. Approved by Greg Oster. 2000-12-31 01:58:03 +00:00
wiz 4b4b4ba4ae Fix typo in v1.38. 2000-12-30 15:32:19 +00:00
wiz f81de5856b sprinkle some const's 2000-12-30 15:03:23 +00:00
wiz 369f36b84f ANSIfy and de-__P() 2000-12-30 15:01:42 +00:00
wiz fb109fb5fa Handle NULL return value by fgets after shell prompt better. Also
improve '\n' slightly. Addresses bin/11847.
2000-12-30 14:46:21 +00:00
itojun 66927d4789 move racoon build framework from sbin/racoon to usr.sbin/racoon. 2000-12-29 02:33:38 +00:00
jdolecek f334b7ef55 make sure that elf_mod_sizes() uses data_hole size aligned to section alignment
this fixes a problem where elf_mod_sizes() would report size which would
be different (smaller) that the actual size of LKM code to be loaded in some
cases

Reviewed by: Johan Danielsson
2000-12-27 20:29:36 +00:00
lukem fbace08ced change behaviour of flags slightly:
-w	write in-core label if changed
-r	update on-disk as well as in-core label (with -w)
-f	force update (-w), even if there's been no change

-r behaviour suggested by matt green. what used to be `-f' is now `-wrf'
2000-12-27 04:22:11 +00:00
lukem a9dd32dbb7 more rewording
- mbrlabel updates the disklabel; it doesn't generate it
- it doesn't just affect the incore label, so remove the `incore' qualifier
2000-12-24 14:01:12 +00:00
lukem 747375caa2 i got sick of the brain damage that mbrlabel used to do, and had
gotten bitten by mbrlabel trashing my incore disklabel to a point where
the machine wasn't usable, so I reworked it:

* only update the incore (and on-disk) label if `-f' is given. by default,
  the proposed disklabel will be printed but no changes will occur
* add -q, to make the default operation a bit more quiet.
* leave existing `used' in-core partition slots alone, and only add entries
  to the incore label if:
	- there's not an existing partition of the same size and offset
	  (even of a different type)
	- there's a free partition slot (`unused', with size == 0)
* use DIOCWDINFO instead of DIOCSDINFO, to update the incore as well as
  the on-disk label
* use showpartitions() from ../disklabel/printlabel.c

this should make mbrlabel a *lot* more useful.
2000-12-24 13:57:37 +00:00
lukem 45c96da8ec use MBR_IS_EXTENDED() instead of local test (which was missing a test case) 2000-12-24 13:32:41 +00:00
lukem 1c5cb88e30 move showinfo() and showpartition() into separate file, for use by
other programs.  slightly change argument signature so that globals
aren't depended upon.
2000-12-24 07:08:02 +00:00
lukem 35ccd2239b - convert to KNF ANSI style guide
- reorder arguments of runcmd(), getnum(), defnum() to be consistent
  with other functions (pass struct disklabel * first)
2000-12-24 05:59:11 +00:00
wiz c73aec3795 Add NTFS recognition per patch supplied by Dave Huang in bin/11804. 2000-12-24 01:54:20 +00:00
wiz 71288952b7 ANSIfy, de-__P() 2000-12-24 01:50:29 +00:00
enami 2f0c4425ee Don't swap clustersum[0]. It's not a cluster summery but block free bitmap. 2000-12-23 12:32:12 +00:00
itojun b7b4590361 call seteuid(getuid) too 2000-12-22 05:52:21 +00:00
itojun ef86e1e3da revoke root privilege earlierst possible. 2000-12-22 00:34:46 +00:00
itojun 8f5f80ebfe document net.inet6.icmp6.mtudisc_{lo,hi}wat. 2000-12-21 01:10:52 +00:00
cgd 2ed72303ae avoid use of ANSI C trigraph ??/ 2000-12-20 01:05:22 +00:00
cgd 30b3e4f5c7 __CONCAT does token pasting, not string concatnation. if something like:
__CONCAT("foo","bar");
actually works to concantate strings, it's because the preprocessor expands
it into "foo""bar" as separate strings, and then ANSI string concatenation
is performed on that.  It's more straightforward to just use ANSI string
concatenation directly, and newer GCCs complain (rightly) about misuse
of token pasting.
2000-12-20 00:31:41 +00:00
lukem 0f2402d559 * Recursively print out extended partition entries. An extended partition is
effectively an MBR with it's own partition table which contains another
  4 `slots', each of which can be another extended partition...
  This involved reworking some of the internal functions.
* Use off_t appropriately (so we can manipulate sectors past 4GB).
* Tweak to compile with WARNS=2
2000-12-19 16:01:28 +00:00
lukem b813a81a7c convert to ANSI KNF 2000-12-19 15:44:27 +00:00
lukem a67eb3719f list the options in a specific options list (as per the `traditional'
man page). i find this much easier to read than option descriptions
scattered amongst paragraphs of text.
2000-12-18 23:42:40 +00:00
simonb 6714e09fe2 Need an lfdir global variable now. 2000-12-14 00:32:22 +00:00
scw e89e2124d1 Global variables don't need to be initialised to zero. 2000-12-13 22:45:12 +00:00
scw 8c5df3aa33 `dev_bsize' needs to be declared extern. 2000-12-13 22:44:44 +00:00
scw 9482a2a194 Some more `extern's for initialised globals. 2000-12-13 22:38:15 +00:00
mycroft 078acb237c Fix an annoyingly incorrect message. 2000-12-13 03:04:51 +00:00
itojun e845d2144b make kerberos *.o conditional. 2000-12-12 22:41:51 +00:00
onoe 86d874c2bf Add powersave/powersavesleep into usage.
Fold usage output (still 14 lines...)
2000-12-12 20:27:42 +00:00
onoe f56e1f272f powersavesleep requires argument 2000-12-12 20:22:45 +00:00
thorpej f293b8799b Update for changes to KAME-current. racoon(8) now supports GSSAPI-Krb5
authentication for Phase 1 per dratf-ietf-ipsec-isakmp-gss-auth-06.txt.

This work was done by Frank van der Linden of Wasabi Systems, Inc.
under contract from Zembu Labs, Inc.
2000-12-12 17:18:58 +00:00
thorpej b22f104458 Add powersave, -powersave, and powersavesleep to manipulate 802.11
power management parameters.
2000-12-12 04:08:40 +00:00
wiz 9bf97e8322 Back out sysctl part for now, awaiting the result of further discussion,
on request of Andrew Doran.
2000-12-11 14:33:51 +00:00
wiz 4c06e7a434 Output proper warning if dumplo == -1 (as it can happen on macppc without
swap partition), instead of "kvm_dump_mkheader: Pread: Invalid argument".
2000-12-08 22:03:23 +00:00
wiz ba968ca2e4 de-__P(), and generally try to be more conforming to the new NetBSD style.
Use %m in syslog strings where appropriate.
Reduce warnings with WARNS=2.
2000-12-07 03:55:44 +00:00
wiz a934922366 Don't mention rc(8), we're using rc.d now. 2000-12-07 03:18:03 +00:00
wiz e7fe5f1380 Fix argument handling, which was pretty broken.
If sysctl supports it, try to get the kernel name with CPU_BOOTED_KERNEL.
Get current kernels version string in all cases.
Adapt some error messages to the correct kernel name.
Reviewed by Simon Burge.
2000-12-07 03:17:17 +00:00
perseant 8a3e9fdf9d Add "-A" option to autoconfigure the segment size based on measured
bandwidth and seek time of the disk, using the "4 * bandwidth * seek
time" formula from Neefe-Matthews' 1997 paper.  An RZ25 disk with this
option gets 200K segments.  Reference the paper in the manual page.
2000-12-05 19:51:14 +00:00
scw 222e7ea5ea Fix a bug introduced by 4.4-Lite:
Don't try to subtract the address of "acg.cg_firstfield" from
"acg.cg_nextfreeoff", as it's already relative to the start of "&acg".
This always worked because the result of the subtraction was
always negative, thus could never be > "sblock.fs_cgsize" ...
2000-12-04 09:59:48 +00:00
itojun bbaa97fa45 sync with latest kame.
- validate strdup() error on argument parsing.
- use strlcat on complex string manipulation.
2000-12-02 02:54:21 +00:00
simonb c878d09614 For mount_mfs, allow an 'm' suffix to the file system size option to
specify the size of the mfs in megabytes.

Inspired by the Solaris tmpfs "-o size=sz" option.
2000-12-01 12:48:09 +00:00
simonb b234617a20 Put extern variable declarations in "extern.h". 2000-12-01 12:03:27 +00:00
simonb 06cbcf7494 ANSIfy. 2000-12-01 11:52:54 +00:00
perseant ea919b5343 Change "cpg" to "cpg/sgs" in the printed partition table header, in an
attempt to avoid confusion.  (PR #9230)
2000-11-27 23:13:12 +00:00
ad 1b9fadaf46 typo 2000-11-26 15:13:19 +00:00
perseant 262e70b7e7 Initialize inodes' generation number to 1, consistent with their version
number.
2000-11-23 23:09:57 +00:00
perseant 7c5a881d60 Check/fix accounting of lfs_dmeta. Patch from Jesse Off
<joff@gci-net.com> (PR #11534).
2000-11-21 06:24:26 +00:00
lukem ddbba91107 fix incorrect comment; -d does work! 2000-11-17 12:35:09 +00:00
mrg f44b54e376 support new `swapctl -z' that shows the dump device. 2000-11-17 11:43:41 +00:00
jdolecek bec09f2dd9 also visit mount_* for 'make clean' and 'make distclean'
Pointed out by Minoura Makoto in private e-mail.
2000-11-16 08:07:55 +00:00
abs fc52578672 xref (disklabel.8, fdisk.8, mbrlabel.8) as appropriate 2000-11-14 11:06:19 +00:00
perseant 9683b76b99 Try to prevent running more than one active cleaner on a filesystem at a time.
Let lfs_cleanerd record its pid in /var/run like other daemons.  Make
mount_lfs not start another cleaner when updating the mount, unless it is
being upgraded from read-only to read-write; when downgrading to read-only,
kill the cleaner using the recorded pids.
2000-11-13 22:12:49 +00:00
jdolecek 57e4e7265b add mount_* to SUBDIR for 'make obj', so that the obj directories get
created and used. Some ramdisks compile individual mount_* commands
directly and hence need the obj dirs setup in order to allow shared
source tree.
Noted in private mail by Andrew Brown <atatat@atatdot.net>.
2000-11-13 05:29:31 +00:00
perseant a3bb9e16b4 Report, and detect and correct inconsistencies in, the number of clean
segments.  Patches from Jesse Off <joff@gci-net.com> (PR #11470).
2000-11-13 00:30:48 +00:00
perseant 5975446609 Add "-f" flag to match fsck(8) manual page. This flag currently has no
effect.  Fixes PR #11129.
2000-11-11 22:26:10 +00:00
itojun a21e536042 improve spec conformance of node information query (07).
sync with kame.
2000-11-11 00:46:36 +00:00
enami d86faab485 Cosmetic change; actually split a line which looks like as if two lines. 2000-11-10 03:12:45 +00:00
eeh 59da39b946 Document new hw.cnmagic sysctl(8) variable. 2000-11-08 22:48:32 +00:00