Commit Graph

5898 Commits

Author SHA1 Message Date
Poul-Henning Kamp
584f5546ee Some improvements to recoverdisk 2009-03-11 10:37:02 +00:00
Maxim Konovalov
01cd0a978f o Spell. Sort .Xrs. 2009-03-08 18:02:30 +00:00
Konstantin Belousov
2e1705590c Document several notifications, among them are DEVFS, update to ifneti,
coretemp and kern.

The asmc(4) and zfs(5) are still not documented.

Based on the patch by Roland Smith <rsmith xs4all nl>.
MFC after:	1 week
2009-03-08 14:28:40 +00:00
Craig Rodrigues
c783576970 Add a -o mountprog parameter to mount which explicitly allows
an alternative program to be used for mounting a file system.
Ideally, all file systems
should be converted to pass string arguments to nmount(), so that
/sbin/mount can handle them.  However, certain file systems such as FUSE have
not done this, and want to have their own userland mount programs.

For example, to mount an NTFS file system with the FUSE NTFS driver:

mount -t ntfs -o mountprog=/usr/local/bin/ntfs-3g /dev/acd0 /mnt

or via an fstab entry:

/dev/acd0  /mnt  ntfs    ro,noauto,mountprog=/usr/local/bin/ntfs-3g       0       0

PR:	120784
Requested by: Dominic Fandrey
2009-03-05 08:57:35 +00:00
Luigi Rizzo
1fd3fc6988 move a variable declaration to the beginning of the block
(unfortunately, it is far away; we need to pack this code in
a better way).
2009-03-05 08:08:09 +00:00
Luigi Rizzo
d7a32e24af remove some signed/unsigned and one const/!const warning 2009-03-05 08:01:58 +00:00
Luigi Rizzo
3e9771d290 mark a function static, as it is 2009-03-05 08:01:19 +00:00
Cy Schubert
062a58a160 Verify that the filesystem being referenced in fstab is indeed a UFS
filesystem. This avoids confusion with nullfs and unionfs filesystems
which reference the root of a UFS filesystem as a target.

PR:		116849
Approved by:	kib
2009-03-02 03:08:46 +00:00
Andriy Gapon
d461b46dd5 newfs_msdos: allow to work with media that doesn't have any CHS params
Either use parameters provided by user or make them up.
The code for faking CHS params is borrowed from disklabel code.
The logic for using user-provided and auto-guessed parameters is not
perfect, so to speak.

PR:		bin/121182
Approved by:	jhb (mentor)
2009-02-27 17:29:48 +00:00
Rui Paulo
9c1fd0b05f Replace clone_setcallback() with a new function clone_setdefcallback()
that selects a callback from an interface prefix name. This allows us to
report a meaningful error when the user types 'ifconfig wlan0 create',
for example, and also kills some redundant code.

Reviewed by:    sam (earlier version)
2009-02-27 00:31:34 +00:00
Alexander Motin
18d7e39ee7 Bring SATA revision reporting into conformance with SATA-IO guidelines. 2009-02-23 22:29:38 +00:00
Alexander Motin
91b791a38f Add SATA and USB modes for completeness. USB modes principally can't be set,
SATA mode setting is not implementes at this time.

Submitted by:	Christoph Mallon
2009-02-22 18:22:21 +00:00
Pawel Jakub Dawidek
663b354412 - Punctuation fixes.
- New sentence - new line.

Reported by:	Ben Kaduk <minimarmot@gmail.com>

- No more than 80 chars per line.
2009-02-22 15:03:29 +00:00
Roman Divacky
1cf0b25f91 Display an error message when the requested mode is not known. So the user can
distinguish between a typo in the mode name and that the device does not
support a certain mode (till now both causes show the same result, i.e. the old
mode is displayed).

Submitted by:	Christoph Mallon <christoph.mallon gmx.de>
Approved by:	kib (mentor)
2009-02-19 20:45:37 +00:00
Sam Leffler
7a8ca89318 Fixup handling of roaming and xmit parameters to support 1/2 and 1/4-width
channel modes:
o usurp 'h' mode flag for half-width channels
o add 'q' mode flag for quarter-width channels
o rewrite rate parameter parsing to handle fractional values
o merge mode loops to eliminate ordering assumptions
o replace 0x80 with IEEE80211_RATE_MCS
2009-02-19 05:28:03 +00:00
Pawel Jakub Dawidek
5d6fbb9900 Correct the year.
Reported by:	Florian Smeets <flo@kasimir.com>
2009-02-17 20:35:11 +00:00
Pawel Jakub Dawidek
9744488197 Document kern.geom.journal.* sysctls.
PR:		docs/130548
Submitted by:	Hywel Mallett <hywel@hmallett.co.uk>
MFC after:	1 week
2009-02-17 20:30:17 +00:00
Olivier Houchard
02dda28606 Don't add a bwrite() symbol, it breaks the build when building newfs
statically.
Instead, bring in a stripped down version of sbwrite(), and add the offset
to every bwrite() calls.
2009-02-12 15:28:15 +00:00
Marcel Moolenaar
0dd9f21c23 Prefer the start and end attributes over the offset and size
attributes. The start and end more accurately describe the
space taken by a partition. The offset and size are used to
describe the effective (usable) storage of that partition.
2009-02-08 20:19:19 +00:00
Paolo Pisati
37ce2656ec Add SCTP NAT support.
Submitted by: CAIA (http://caia.swin.edu.au)
2009-02-07 18:49:42 +00:00
Sam Leffler
47ee60ebbe Regulatory fixups:
o add missing channel flags for ECM, indoor, and outdoor constraints
o use HT capabilities to short-circuit HT20/HT40 channel construction
o rewrite 1/2 and 1/4 width channel handling yet again; previously
  we assumed there was a full-width version of the channel in the
  calibration table but that's not always true (e.g. for the Public
  Safety Band), now we first check the calibration table for the
  exact channel we want then fall back to the heuristics we used before
o fix HT channel construction; wasn't adjusting band edges for HT40
  channel bandwidth requirements
2009-02-07 01:12:51 +00:00
Craig Rodrigues
8259724930 Set NFSMNT_ACDIRMAX flag in fallback_mount() function. 2009-02-06 07:47:53 +00:00
Craig Rodrigues
60341db4b2 Set NFSMNT_ACREGMIN, NFSMNT_ACREGMAX, and NFSMNT_ACDIRMIN flags
in fallback_mount() function.
Add a comment to indicate that the fallback_mount() function
should eventually go away.

Submitted by:	Jaakko Heinonen <jh saunalahti fi>
2009-02-06 07:42:21 +00:00
Sam Leffler
b8bd4a9751 add support for max antenna gain (not used at the moment) 2009-02-05 17:51:46 +00:00
Kirk McKusick
910b491e7e Update the actions previously attempted by the -D option to make them
robust. With these changes fsck is now able to detect and reliably
rebuild corrupted cylinder group maps. The -D option is no longer
necessary as it has been replaced by a prompt asking whether the
corrupted cylinder group should be rebuilt and doing so when requested.
These actions are only offered and taken when running fsck in manual
mode. Corrupted cylinder groups found during preen mode cause the fsck
to fail.

Add the -r option to free up excess unused inodes. Decreasing the
number of preallocated inodes reduces the running time of future
runs of fsck and frees up space that can allocated to files. The -r
option is ignored when running in preen mode.

Reviewed by: Xin LI <delphij@>
Sponsored by: Rsync.net
2009-02-04 01:02:56 +00:00
Xin LI
f9b2e762e8 Use %u instead of %zu when we intend to print integer constant. 2009-02-03 00:15:19 +00:00
Ulf Lilleengen
5d82438617 - Use a separate pointer to the allocated memory for freeing, as strsep may
modify the pointer argument passed to it. This triggered an assert in malloc
  when a geom command being run under the livefs environment.

PR:		bin/130632
Submitted by:	Dimitry Andric <dimitry -at- andric.com>
Pointy hat to:	me
MFC after:	2 days
2009-02-02 19:22:53 +00:00
Luigi Rizzo
a52e28c7dd Explain that we assume AF_INET and only use the addr and port field
from a struct sockaddr_in, so there is no need to initialize sin_len
2009-02-02 11:02:19 +00:00
Luigi Rizzo
d84d38734f remove duplicate #include 2009-02-02 10:58:05 +00:00
Luigi Rizzo
23c608c8f6 put the altq-related functions into a separate file.
Minor cleanup of the includes used by the various source files,
including annotations of why certain headers are used.
2009-02-01 16:00:49 +00:00
Bjoern A. Zeeb
c09a6b1ab6 Remove and unused variable.
Submitted by:	Christoph Mallon christoph.mallon@gmx.de
MFC after:	2 weeks
2009-01-31 13:48:15 +00:00
David E. O'Brien
111a52201c Add the '-C' "check clean" flag. If the FS is marked clean, skip file
system checking.  However, if the file system is not clean, perform a
full fsck.

Reviewed by:	delphij
Obtained from:	Juniper Networks
2009-01-30 18:33:05 +00:00
Sam Leffler
1dfdb874b6 include the channel list in list caps when -v is set; ieee channel
#'s are not available and we have to hack around the mapchan routine
but it lets us see the calibration table w/o forcing the debug regdomain
2009-01-28 19:24:29 +00:00
Sam Leffler
fa46e75db6 pritize the channel we display with list chans so that, among other
things, 1/2 and 1/4 width channels are hidden behind the full width
channel; this is needed because they are ordered such that they
appear after in the channel table
2009-01-28 19:23:12 +00:00
Sam Leffler
2da7e03a99 simplify display of 1/2 and 1/4 width channels 2009-01-28 19:20:12 +00:00
Sam Leffler
2f686fcee3 improve debug msgs for regdomain operations; print channel flags
symbolically so it's easier to identify channels and why they
are added (or not)
2009-01-28 19:18:58 +00:00
Sam Leffler
d6bf86af1e Fix 1/2 and 1/4 width channel handling:
o only include 1/2 and 1/4 width channels when they are specified in the
  regulatory database description; previously we treated them as if they
  were part of the band and blindly added them for 11a/g
o check the channel list returned in the devcaps to identify whether a
  device supports 1/2 or 1/4 width channels on a band; this might be
  better brought out as a capability bit to avoid filling the channel
  list w/ 1/2 and 1/4 width channels but then cards that only support
  these channels in a range of frequencies could not be described (though
  right now we don't check frequency range only band)
2009-01-28 19:15:52 +00:00
Warner Losh
688ff09fed Restore necessary NUL termination of locname.
Submitted by:	ian dowse
MFC after:	2 days
2009-01-28 16:23:21 +00:00
Robert Watson
6458691cc4 Print disk offets as %jd rather than %lld; I fixed one before committing
but missed the other, which breaks 64-bit builds.

Reported by:	bf <bf2006a at yahoo dot com>
MFC after:	1 week
2009-01-28 12:08:19 +00:00
Luigi Rizzo
16e3606f57 Avoid the use of duplicated typedefs -- see the comment for details. 2009-01-28 11:43:12 +00:00
Tom Rhodes
4b797ca8d7 Bump doc date for recent change. 2009-01-28 11:31:09 +00:00
Robert Watson
fd15d586ee Add a new flag to dumpfs(8), -f, which causes dumpfs to list all free
fragments in the file system by fragment (block) number.  This new
mode does the necessary arithmetic to generate absolute fragment
numbers rather than than the cg-relative numbers printed in the default
mode.

If -f is passed once, contiguous fragment ranges are collapsed into
an X-Y format as free block lists are currently printed in regular
dumpfs output, but if specified twice, all block numbers are printed
individually, allowing both compact and more script-friendly
representation.

This proves quite handy when attempting to recover deleted data, as it
allows exclusion of non-deleted data from blocks searched.
MFC after:	1 week
Discussed with:	jeff, Richard Clayton <richard dot clayton at cl.cam.ac.uk>
Sponsored by:	Google, Inc.
2009-01-28 09:33:00 +00:00
Craig Rodrigues
e4f9e894d4 Fix parsing of acregmin, acregmax, acdirmin and acdirmax NFS mount options
when passed as strings via nmount().

Submitted by: Jaakko Heinonen <jh saunalahti fi>
2009-01-28 07:46:35 +00:00
Sam Leffler
8658b18b82 Remove assumptions about the max # channels in ioctl's:
o change ioctl's that pass channel lists in/out to handle variable-size
  arrays instead of a fixed (compile-time) value; we do this in a way
  that maintains binary compatibility
o change ifconfig so all channel list data structures are now allocated
  to hold MAXCHAN entries (1536); this, for example, allows the kernel
  to return > IEEE80211_CHAN_MAX entries for calls like IEEE80211_IOC_DEVCAPS
2009-01-27 23:42:14 +00:00
Sam Leffler
63ad8170dd remove %b msg bit defines now public 2009-01-27 23:01:14 +00:00
Luigi Rizzo
50a99912c1 fix printing of uint64_t values, so we can use WARNS=2 2009-01-27 20:26:45 +00:00
Luigi Rizzo
b361cf5805 fix wrong variable usage... 2009-01-27 12:24:53 +00:00
Luigi Rizzo
ead75a59f1 Put nat and ipv6 support in their own files.
Usual moving of code with no changes from ipfw2.c to the
newly created files, and addition of prototypes to ipfw2.h

I have added forward declarations for ipfw_insn_* in ipfw2.h
to avoid a global dependency on ip_fw.h
2009-01-27 12:01:30 +00:00
Luigi Rizzo
4e9c8ae7b5 Put dummynet-related code in a separate file.
To this purpose, add prototypes for global functions in ipfw2.h
and move there also the list of tokens used in various places in the code.
2009-01-27 11:06:59 +00:00
Luigi Rizzo
d36bf6e792 never mind, for the time being let's stick with WARNS=0 until
we sort out all proper printf formats.
2009-01-27 11:03:47 +00:00
Luigi Rizzo
3c0c871777 Start splitting the monster file in smaller blocks.
In this episode:
- introduce a common header with a minimal set of common definitions;
- bring the main() function and options parser in main.c
- rename the main functions with an ipfw_ prefix

No code changes except for the introduction of a global variable,
resvd_set_number, which stores the RESVD_SET value from ip_fw.h
and is used to remove the dependency of main.c from ip_fw.h
(and the subtree of dependencies) for just a single constant.
2009-01-27 10:18:55 +00:00
Luigi Rizzo
0e22daad2d put the usage() function inline, it was only 1 line and used once;
slightly reformat the help() text;
slightly correct the text for the 'extraneous filename' error message;
2009-01-27 09:27:13 +00:00
Luigi Rizzo
db7c522411 put all options in a single struct, and document them.
This will allow us to easily restore the original values when processing
commands from a file (where each individual line can have its own options).
2009-01-27 09:06:25 +00:00
Luigi Rizzo
2edea98d7f I believe this is safe to build with WARNS=2 now 2009-01-27 09:04:29 +00:00
Luigi Rizzo
be39e0b2b1 remove a couple of rarely used #define;
change PRINT_UINT from a macro to a function (renaming is
postponed to reduce clutter)
2009-01-27 07:40:16 +00:00
Xin LI
ffed8dfb38 Follow up with previous commit: mention -D, not -C when cg check
failed.

Submitted by:	obrien
2009-01-27 00:29:19 +00:00
Luigi Rizzo
5f356082eb wrap all malloc/calloc/realloc calls so they exit on failure
without having to check in each place.

Remove an wrong strdup from previous commit.
2009-01-26 14:26:35 +00:00
Luigi Rizzo
c562063980 Some implementations of getopt() expect that argv[0] is always the
program name, and ignore that entry.  ipfw2.c code instead skips
this entry and starts with options at offset 0, relying on a more
tolerant implementation of the library.

This change fixes the issue by always passing a program name
in the first entry to getopt. The motivation for this change
is to remove a potential compatibility issue should we use
a different getopt() implementation in the future.

No functional changes.

Submitted by:	Marta Carbone (parts)
MFC after:	4 weeks
2009-01-26 14:03:39 +00:00
Luigi Rizzo
e5dbf7366f remove some useless #include,
document why timeconv.h is needed

MFC after:	3 days
2009-01-22 23:25:28 +00:00
Xin LI
7f94ca7233 Rename option 'C' to 'D' (damaged) in order to avoid a conflict with upcoming
Juniper 'C' (clean) flag.

Requested by:	obrien
MFC after:	1 week
2009-01-20 22:49:49 +00:00
Luigi Rizzo
daa9733afd Fix a number of (innocuous) warnings, and remove a useless test.
There are still several signed/unsigned warnings left, which
require a bit more study for a proper fix.

This file has grown beyond reasonable limits.

We really need to split it into separate components (ipv4, ipv6,
dummynet, nat, table, userland-kernel communication ...) so we can
make mainteinance easier.

MFC after:	1 weeks
2009-01-20 18:16:31 +00:00
Maxim Sobolev
e8bbeae7b0 Tone down warning about the quality of the NTFS VFS module. It appears that
not all developers share luigi opinion about quality of sysutils/fusefs-ntfs
compared to our kernel NTFS module.
2009-01-20 02:08:21 +00:00
Maxim Sobolev
940369b908 In the CAVEATS section mention the fact that the NTFS kernel support isn't
very well maintained and point user to sysutils/fusefs-ntfs, which
at the time of this writing seems to be a better alternative.

Suggested by:	luigi

MFC after:	2 weeks
2009-01-19 15:59:05 +00:00
Alexander Motin
b814ca8a4f Fix regression introduced in rev. 173124:
0.0.0.0/1 is not the same as 0.0.0.0/0.

MFC after:	1 month
2009-01-18 11:38:35 +00:00
Poul-Henning Kamp
972b3f3056 Bail on ENXIO, you won't get any further any way.
Submitted by:	tobez
2009-01-17 11:57:32 +00:00
Sam Leffler
5814deb84d Fix 1/2 and 1/4 width channel handling for non-GSM operation:
o correct typo that caused random channel selection
o explicitly add 1/2 and 1/4 width channels because channel lookups match
  flags that include IEEE80211_CHANNEL_HALF and IEEE80211_CHANNEL_QUARTER
2009-01-16 20:38:42 +00:00
Sam Leffler
fab0828067 use correct interface name when setting flags; fixes ifconfig ... create ... up
Noticed by:	Chris Anderson
2009-01-14 22:55:49 +00:00
Luigi Rizzo
31fade0527 Reword some entries for NTFS and DOS.
Add entries for DELL and ASUS recovery partitions.

MFC after:	3 days
2009-01-14 22:05:51 +00:00
Luigi Rizzo
22fccf5ce9 Another change from Christoph:
replace the table of partition with a simpler and faster array of strings.
The change in the array is done mechanically, using vi commands.
Most entries in the table are probably 15+ years old and largely outdated,
so the next step is to remove stale entries with more current values.

Submitted by:	Christoph Mallon, with small changes from me
MFC after:	3 days
2009-01-14 21:31:09 +00:00
Luigi Rizzo
40905b6e22 more changes from Christoph:
pass a pointer instead of an index to print_part()
so it does not depend on a static variable.

Submitted by:	Christoph Mallon
MFC after:	3 days
2009-01-14 21:08:19 +00:00
Luigi Rizzo
fbcb16efdf remove unused argument to print_s0()
Submitted by:	Christoph Mallon
MFC after:	3 days
2009-01-14 20:53:46 +00:00
Luigi Rizzo
c4898ccb7c Some small fixes submitted by Christoph Mallon, specifically:
+ Remove a dead field of a struct. It serves no purpose anymore.
+ Remove a \n at the end of the format string of err(); the err()
  function already adds a \n ;
+ remove many unnecessary casts which obfuscate the code.

This file has a huge number of indentation bugs, but I'd rather fix
them when/if we happen to modify the relevant parts of the code.

Submitted by:	Christoph Mallon
MFC after:	3 days
2009-01-13 23:36:38 +00:00
David E. O'Brien
0e969ed7e0 r187093 failed to keep the lifetime of the pointer suitable for reentrancy.
Fix that.  Also move the current buffer size into the 'cpa' structure.
2009-01-13 06:08:37 +00:00
David E. O'Brien
0035611858 Use a dynamically grown buffer for building the argv for the sub-mounts.
Also fix RCSid spamage.

Inspired by patch from:	Christoph Mallon <christoph.mallon@gmx.de>
2009-01-12 08:22:36 +00:00
Xin LI
07580acce5 Fix typo.
Submitted by:	Ben Kaduk <minimarmot gmail com>
MFC after:	3 days
2009-01-12 03:33:48 +00:00
Daniel Gerzo
7f220ecf72 - improve readability
Reviewed by:	trhodes, keramida
MFC after:	3 days
2009-01-11 22:36:45 +00:00
David E. O'Brien
a86de99566 Explicitly check each mount argv building assignment for buffer over flowing.
Reviewed by:	imp (earlier version of patch)
2009-01-10 20:54:47 +00:00
Edward Tomasz Napierala
a9ebb31183 Add the possibility to specify "-o force" with "mdconfig -du".
Reviewed by:	scottl
Approved by:	rwatson (mentor)
Sponsored by:	FreeBSD Foundation
2009-01-10 17:17:18 +00:00
Sam Leffler
10ad9a77f3 TDMA support for long distance point-to-point links using ath devices:
o add net80211 support for a tdma vap that is built on top of the
  existing adhoc-demo support
o add tdma scheduling of frame transmission to the ath driver; it's
  conceivable other devices might be capable of this too in which case
  they can make use of the 802.11 protocol additions etc.
o add minor bits to user tools that need to know: ifconfig to setup and
  configure, new statistics in athstats, and new debug mask bits

While the architecture can support >2 slots in a TDMA BSS the current
design is intended (and tested) for only 2 slots.

Sponsored by:	Intel
2009-01-08 17:12:47 +00:00
Daniel Gerzo
0c868e9061 - rename the RETURN VALUES section to EXIT STATUS
- not bumping a date as this is not a real content change

Approved by:	ru
MFC after:	3 days
2009-01-07 00:51:41 +00:00
Simon L. B. Nielsen
0211d3b61c Minor markup fix for the r186836 update. 2009-01-06 21:16:42 +00:00
Colin Percival
4c55b9e02e Strengthen some of the language concerning attacks on MD5, in light of the
recent demonstration of a forged SSL certificate.  Add text pointing out
that SHA-1 is at least theoretically broken.  Add a recommendation that
new applications use SHA-256.

MFC after:	1 month
2009-01-06 19:25:24 +00:00
Tom Rhodes
c6b34b2563 Add missing qualifier which was missed in the previous commit.
Noticed by:	brooks
2009-01-05 12:10:22 +00:00
Daniel Gerzo
c419baec28 - grammar and language fixes
- hard sentence breaks
- trim EXIT STATUS section and move it to DIAGNOSTICS as well as use .Er
  macro
- sort SEE ALSO

MFC after:	7 days
2009-01-04 15:41:01 +00:00
Ivan Voras
2b67c28a09 Several significant updates:
* Better wording of sections dealing with physical storage
* A new section on assumptions gvirstor has on its consumer devices
  (components) and its interaction  with file systems
* Improved markup (by hrs@)

Reviewed by:	hrs
Approved by:	gnn (mentor)
2009-01-04 11:31:03 +00:00
Ulf Lilleengen
db2bf4b016 - Back out r186038. Rather than changing the intent of the caller, the problem
should be handled internally in gvinum.

Suggested by:	pjd
2008-12-27 14:24:24 +00:00
David E. O'Brien
c9c6feb62c style(9) 2008-12-26 22:55:38 +00:00
David E. O'Brien
76c4621653 Make the sub-'argc' static to make it harder to overwrite thru a buffer
overflow.
2008-12-26 22:54:53 +00:00
Tom Rhodes
138f7e4b30 Apply various fixes:
Silence mdoc(7) warnings;
Xref correct manual pages;
Point user to the ddb.8 manual page.

PR:		129398
Submitted by:	gavin
2008-12-24 11:12:21 +00:00
David E. O'Brien
defc9d504b Garbage collect 'fflags'. 2008-12-24 03:07:19 +00:00
Tom Rhodes
1aa26f525e Note that when shutdown is run without options, it will place
the system into single user mode at the time specified.

PR:		129765
2008-12-23 15:00:03 +00:00
Tom Rhodes
9ffd02d312 Document the "-o large" option.
PR:		129792
2008-12-23 13:35:26 +00:00
Andrew Thompson
97a7a5698b Only show the pathname in verbose output as intended in the last commit (r172862). 2008-12-22 19:52:21 +00:00
Paolo Pisati
a21e097b2e Update the ipfw man page to reflect last change (-q option with nat option).
MFC after:	3 days
2008-12-18 21:46:18 +00:00
Paolo Pisati
3fc7bd58bc Honor the quiet (-q) option while adding a nat rule.
Submitted by:	Andrey V. Elsukov<bu7cher@yandex.ru>
MFC after:	3 days
2008-12-18 21:37:31 +00:00
David E. O'Brien
fce5f960ba Be a little bit more pestimistic in argument handling - check if we've
overflown our internal buffer (though after the fact), and s/strncpy/strlcpy/

Reviewed by:	rodrigc
Obtained from:	Juniper Networks
2008-12-18 18:44:46 +00:00
Qing Li
6e6b3f7cbc This main goals of this project are:
1. separating L2 tables (ARP, NDP) from the L3 routing tables
2. removing as much locking dependencies among these layers as
   possible to allow for some parallelism in the search operations
3. simplify the logic in the routing code,

The most notable end result is the obsolescent of the route
cloning (RTF_CLONING) concept, which translated into code reduction
in both IPv4 ARP and IPv6 NDP related modules, and size reduction in
struct rtentry{}. The change in design obsoletes the semantics of
RTF_CLONING, RTF_WASCLONE and RTF_LLINFO routing flags. The userland
applications such as "arp" and "ndp" have been modified to reflect
those changes. The output from "netstat -r" shows only the routing
entries.

Quite a few developers have contributed to this project in the
past: Glebius Smirnoff, Luigi Rizzo, Alessandro Cerri, and
Andre Oppermann. And most recently:

- Kip Macy revised the locking code completely, thus completing
  the last piece of the puzzle, Kip has also been conducting
  active functional testing
- Sam Leffler has helped me improving/refactoring the code, and
  provided valuable reviews
- Julian Elischer setup the perforce tree for me and has helped
  me maintaining that branch before the svn conversion
2008-12-15 06:10:57 +00:00
Sam Leffler
67207b6994 back out unintended change 2008-12-15 01:44:23 +00:00
Sam Leffler
ddd244ecff move channel parsing to a getchannel routine so it can be reused to check
the channel argument supplied to chanswitch
2008-12-15 01:15:15 +00:00
Sam Leffler
746b34ace7 fix handling of sku codes like country codes 2008-12-15 01:10:52 +00:00
Sam Leffler
76f0b9bff1 fix handling of unknown country codes; atoi doesn't return -1
for an invalid string as I thought; so use strtol instead
2008-12-15 01:10:08 +00:00
Sam Leffler
b6130d380f 0 is a potential ISO CC; use new NO_COUNTRY #define to identify
when the CC is not set.  Note NO_COUNTRY is set to 0xffff for now
(must be 16 bits as ieee80211_regdomain struct defines sku's and
cc's as uint16_t which may need fixing).
2008-12-15 01:09:01 +00:00
Sam Leffler
27c1a6f490 o distinguish between adhoc and ahdemo modes
o do not require 1/2 and 1/4 rate channels be present in the
  calibration list when doing a gsm regulatory change; the
  existing 900MHz cards are not self-identifying so there is
  no way (using the calibration channel list) to check
2008-12-15 01:06:49 +00:00
Sam Leffler
cf0d500765 Improve regdomain.xml parser:
o store XML_Parser in the state block so we can report line numbers for errors
o complain about netband w/o mode
o complain about unknown modes
o complain about band w/o enclosing netband
o complain about duplicate freqband
o complain about unknown channel flags
o complain about band w/o freqband's
o complain about band w/o maxpower
o complain about country w/o ISO cc
o complain about country w/o regdomain reference
2008-12-15 01:00:18 +00:00
Ruslan Ermilov
a794372087 Fix the fallouts from r146267:
- Add the forgotten "mode" argument to the "mode" command.
- Move the description of "info" to where it belongs.
2008-12-14 12:56:56 +00:00
Poul-Henning Kamp
0f3311c56f Send all debug to stderr. 2008-12-14 11:48:51 +00:00
Poul-Henning Kamp
877ed37a0d Clarify that configuration files must be named '*.conf' 2008-12-14 11:47:39 +00:00
Ulf Lilleengen
a468c003ef - When writing metadata to a geom provider, open the it as read-write since it
might do subsequent reads from other providers. This stopped geli (and
  probably other classes using g_metadata_store as well) from being put on top
  of gvinum raid5 volumes.

Note:
The reason it fails in the gvinum raid5 case is that gvinum will read back the
old parity stripe before calculating the new parity stripe to be written out
again.  The write will then fail because the underlying disk to be read is
opened write only.

MFC after:	1 week
2008-12-13 14:14:56 +00:00
Luigi Rizzo
59cf6deb68 Move the check for the ending char in the partition name where
it was before -- the check is only made when getdisklabel()
returns valid info.
On passing, use MAXPARTITIONS to identify the max partition number,
instead of the hardwired 'h'

MFC after:	4 weeks
2008-12-12 15:56:38 +00:00
Max Laier
d3adc65594 Fix build - cast off_t to (intmax_t) for printing. 2008-12-03 23:00:57 +00:00
Luigi Rizzo
64c8fef580 Enable operation of newfs on plain files, which is useful when you
want to prepare disk images for emulators (though 'makefs' in port
can do something similar).

This relies on:
+ minor changes to pass the consistency checks even when working on a file;

+ an additional option, '-p partition' , to specify the disk partition to
  initialize;

+ some changes on the I/O routines to deal with partition offsets.

The latter was a bit tricky to implement, see the details in newfs.h:
in newfs, I/O is done through libufs which assumes that the file
descriptor refers to the whole partition. Introducing support for
the offset in libufs would require a non-backward compatible change
in the library, to be dealt with a version bump or with symbol
versioning.

I felt both approaches to be overkill for this specific application,
especially because there might be other changes to libufs that might
become necessary in the near future.

So I used the following trick:
- read access is always done by calling bread() directly, so we just add
  the offset in the (few) places that call bread();
- write access is done through bwrite() and sbwrite(), which in turn
  calls bwrite(). To avoid rewriting sbwrite(), we supply our own version
  of bwrite() here, which takes precedence over the version in libufs.

MFC after:	4 weeks
2008-12-03 18:36:59 +00:00
Luigi Rizzo
b87d1601b6 Some useful operational extensions to newfs_msdos, especially
when preparing images for emulators or flash devices:

+ option '-C size' to create the underlying image file with given size.
  Saves doing a 'dd' before, and especially it creates a sparse file

+ option '-@ offset' to build the FAT image at the specified offset
  in the image file or device;

+ make the cluster size adaptive on the filesystem size.
  Previously the default was 4k which is really unconvenient with
  large media; now it goes from 512 bytes to 32k depending on
  filesystem size (i still need to check whether it makes sense
  to go further up, to 64k or above);

+ fix default geometry when not specified on the command line,
  use 63 sectors/255 heads by default.
  Also trim the size so it exactly a multiple of a track, to avoid
  complaints in some filesystem code.

+ document all the above, plus some manual page clarifications.

MFC after:	4 weeks
2008-12-03 18:22:36 +00:00
Marcel Moolenaar
08b6360ca3 Print error messages as-is, when they don't conform to
<errno> [<parameter> 'value']
These are error messages from (lib)geom itself.
2008-11-30 23:46:31 +00:00
Marcel Moolenaar
e419ba879f Call gctl_free() after we processed the error string.
It's being freed as part of the request.
2008-11-30 23:38:44 +00:00
Marcel Moolenaar
39bd58723a Parse the error string returned by the kernel. The format is:
<errno> [<parameter> <value>]
So, rather than printing the error:
	gpart: 22 scheme 'gpt'
gpart(8) now prints:
	gpart: scheme 'gpt': invalid argument
2008-11-29 21:20:07 +00:00
Warner Losh
44e6d7240a Noticed the following error message:
mount_msdosfs: /dev/cf0s1: : Operation not supported by device

and thought I'd fix it to be:

mount_msdosfs: /dev/cf0s1: Operation not supported by device

Not sure why errmsg isn't getting filled in, or why this error is even
happening at all... (fsck_msdosfs is clean, and I can mount this same
CF elsewhere).
2008-11-29 02:28:05 +00:00
Luigi Rizzo
045651ec1e Create a fake geometry (16 heads, 64 sectors) when dealing with
a plain file and a geometry is not explicitly supplied through
command line or disktab entry.

This way you can a FAT image on a file as simply as this:

	newfs_msdos ./some/file

(right now you need a much longer command

	newfs_msdos -h 32 -u 64 -S 512 -s $total_blocks -o 0 ./some/file

Will be merged after 7.1 and 6.4 are released.
See also the related PR which suggests a similar change.

PR:		bin/121182
MFC after:	4 weeks
2008-11-26 21:05:03 +00:00
Scott Long
3f3137fee5 Big update to the iSCSI initiator code. Highlights include IPv6 support,
many bugs fixes, many more performance improvements.

Submitted by:	Danny Braniss

M    sbin/iscontrol/iscsi.conf.5
M    sbin/iscontrol/iscontrol.8
M    sbin/iscontrol/iscontrol.h
M    sbin/iscontrol/config.c
M    sbin/iscontrol/fsm.c
M    sbin/iscontrol/login.c
M    sbin/iscontrol/pdu.c
M    sbin/iscontrol/misc.c
M    sbin/iscontrol/auth_subr.c
M    sbin/iscontrol/iscontrol.c
M    sys/dev/iscsi/initiator/isc_cam.c
M    sys/dev/iscsi/initiator/iscsi.h
M    sys/dev/iscsi/initiator/isc_soc.c
M    sys/dev/iscsi/initiator/iscsi_subr.c
M    sys/dev/iscsi/initiator/iscsivar.h
M    sys/dev/iscsi/initiator/isc_subr.c
M    sys/dev/iscsi/initiator/iscsi.c
M    sys/dev/iscsi/initiator/isc_sm.c
2008-11-25 07:17:11 +00:00
Xin LI
b652d3a3dc Grammar improvements.
Submitted by:	kensmith
2008-11-18 20:38:07 +00:00
Marcel Moolenaar
7f792cd758 Use humanize_number(), rather than a home-grown algorithm for
formatting a number in a human-friendly way.

Note that with this commit a megabyte changed from 1000000 to
1048576 and a 80G disk is now printed as being 75G in size.
This is deliberate. It's consistent with the core of geom(8).
However, the original choice for a megabyte being 1000000 was
on purpose and matches what disk vendors put on the box. The
consistency is considered more important.

Submitted by:	delphij
2008-11-18 04:04:01 +00:00
Marcel Moolenaar
567bc443e8 Sort includes
Submitted by:	delphij
2008-11-18 03:43:02 +00:00
Marcel Moolenaar
0a4acb2e3d Pad the bootcode we write to the partition to a multiple of the
sector size.

Submitted by:	Alexey Shuvaev <shuvaev@physik.uni-wuerzburg.de>
Prompted by: 	delphij
MFC after:	3 days
2008-11-18 00:03:30 +00:00
Maxim Konovalov
69573e862d o One more s/gpt/gpart/. 2008-11-05 09:28:30 +00:00
Maxim Konovalov
7922d6f987 o Replace Xr to gpt(8) which is gone by gpart(8). 2008-11-05 09:27:13 +00:00
Doug Rabson
a9148abd9d Implement support for RPCSEC_GSS authentication to both the NFS client
and server. This replaces the RPC implementation of the NFS client and
server with the newer RPC implementation originally developed
(actually ported from the userland sunrpc code) to support the NFS
Lock Manager.  I have tested this code extensively and I believe it is
stable and that performance is at least equal to the legacy RPC
implementation.

The NFS code currently contains support for both the new RPC
implementation and the older legacy implementation inherited from the
original NFS codebase. The default is to use the new implementation -
add the NFS_LEGACYRPC option to fall back to the old code. When I
merge this support back to RELENG_7, I will probably change this so
that users have to 'opt in' to get the new code.

To use RPCSEC_GSS on either client or server, you must build a kernel
which includes the KGSSAPI option and the crypto device. On the
userland side, you must build at least a new libc, mountd, mount_nfs
and gssd. You must install new versions of /etc/rc.d/gssd and
/etc/rc.d/nfsd and add 'gssd_enable=YES' to /etc/rc.conf.

As long as gssd is running, you should be able to mount an NFS
filesystem from a server that requires RPCSEC_GSS authentication. The
mount itself can happen without any kerberos credentials but all
access to the filesystem will be denied unless the accessing user has
a valid ticket file in the standard place (/tmp/krb5cc_<uid>). There
is currently no support for situations where the ticket file is in a
different place, such as when the user logged in via SSH and has
delegated credentials from that login. This restriction is also
present in Solaris and Linux. In theory, we could improve this in
future, possibly using Brooks Davis' implementation of variant
symlinks.

Supporting RPCSEC_GSS on a server is nearly as simple. You must create
service creds for the server in the form 'nfs/<fqdn>@<REALM>' and
install them in /etc/krb5.keytab. The standard heimdal utility ktutil
makes this fairly easy. After the service creds have been created, you
can add a '-sec=krb5' option to /etc/exports and restart both mountd
and nfsd.

The only other difference an administrator should notice is that nfsd
doesn't fork to create service threads any more. In normal operation,
there will be two nfsd processes, one in userland waiting for TCP
connections and one in the kernel handling requests. The latter
process will create as many kthreads as required - these should be
visible via 'top -H'. The code has some support for varying the number
of service threads according to load but initially at least, nfsd uses
a fixed number of threads according to the value supplied to its '-n'
option.

Sponsored by:	Isilon Systems
MFC after:	1 month
2008-11-03 10:38:00 +00:00
Marcel Moolenaar
1eecfda454 Add support for multiple attributes. This is required for the
PC98 scheme.
2008-10-20 05:12:50 +00:00
Giorgos Keramidas
4f1fb109f9 Tiny wording nits.
MFC after:	1 week
2008-10-19 09:45:29 +00:00
Brooks Davis
38e755fd40 Support the remaining options listed in dhcp-options(5) and RFC 2132.
PR:		bin/127076
Submitted by:	jkim
MFC after:	1 week
2008-10-17 13:28:53 +00:00
Maxim Konovalov
20e58023f4 o Remove a debug code and restore an accidentally deleted code
in a previous commit.
2008-10-14 17:59:39 +00:00
Maxim Konovalov
92531c02e6 o Do nothing in show_nat() for a test mode (-n). This prevents
show_nat() from endless loop and makes work ipfw -n nat <...>.

PR:		bin/128064
Submitted by:	sem
MFC after:	1 month
2008-10-14 17:53:26 +00:00
Konstantin Belousov
e6e1a3a875 Background fsck applies twice some summary totals changes. The next
background fsck on the same file system might then print negative
numbers for reclaimed directories/files/fragments.

Address the issue in a limited degree, by using old summary data for
cg when bgfsck is performed.

Submitted by:	tegge
MFC after:	1 week
2008-10-13 14:01:05 +00:00
Konstantin Belousov
717902b613 check_maps() in /usr/src/sbin/fsck_ffs/pass5.c seems to be limited to file
systems less than 1 TB, due to using 32-bits integers for file system block
numbers. This also causes incorrect error reporting for foreground fsck.

Convert it to use ufs2_daddr_t for block numbers.

PR:	kern/127951
Submitted by:	tegge
MFC after:	1 week
2008-10-13 13:56:23 +00:00
Xin LI
30223a3203 Add some examples to demostrate gpart(8).
--此行及以下内容将会被忽略--
2008-10-09 06:23:04 +00:00
Maxim Konovalov
116c00fb0b o Typo fixes.
PR:		docs/127866
Submitted by:	Marius Korsmo
2008-10-05 05:12:48 +00:00
Sam Leffler
24994b364c add duplicate cmd entries for vlan and vlandev that are marked !clone
so they can be used when not doing a create operation

Reviewed by:	ed
2008-10-02 20:03:41 +00:00
Ulf Lilleengen
9d8ce07800 - A call to close(2) might overwrite errno and thus give a wrong error message
on g_providername failure.

Suggested by:	pjd
Approved by:	pjd (mentor)
2008-09-30 11:46:14 +00:00
Ulf Lilleengen
bd5add5884 - Improve error message given on g_providername call failure.
- While there, make error messages consistent with the rest.

Approved by:	kib (mentor)
2008-09-30 07:18:49 +00:00
Sam Leffler
39669258d7 Distinguish between cmd/parameters used for clone operations and
all others.  Use this to disambiguate cmd line arguments that can
be either clone params or regular parameters so, in particular,
"bssid" again works as a regular parameter.

While here leverage the above to improve the logic for flushing
clone operations on the first !clone cmd line parameter.

Reviewed by:	jhay
2008-09-29 16:27:32 +00:00
Maxim Konovalov
19d35886ef o Add missed dot. 2008-09-29 05:31:27 +00:00
Roman Kurakin
e7ef3e9494 Fix the build.
Noted by: ganbold@
2008-09-27 15:58:54 +00:00
Roman Kurakin
e927c2b2e6 * add all keyword for table list & flush actions.
* add tables_max sysctl.
* add default_rule sysctl.

PR:		127058 (partially)
2008-09-27 15:09:00 +00:00
Roman Kurakin
c15c249000 Add keyword all in addtion to the table number for the 'list' and the
'flush' actions on tables.  Part of PR: 127058.

PR:		127058 (based on)
MFC after:	1 month
2008-09-27 14:30:34 +00:00
Xin LI
45cfb1dc53 Static-ify procedures in init(8). 2008-09-27 00:09:10 +00:00
Ruslan Ermilov
0a4b670e07 Add missing library dependencies.
PR:		bin/127573
Submitted by:	Eygene Ryabinkin
2008-09-23 13:12:51 +00:00
Giorgos Keramidas
7bf717b721 Unbreak the build. 2008-09-22 04:12:27 +00:00
Sam Leffler
51947cb625 MIMO power save and RIFS; while here also update per-node state/flags for ampdu 2008-09-22 00:30:26 +00:00
Sam Leffler
8db67fd293 "ampdudensity -" is too subtle; use "NA" for any and accept it as a parameter 2008-09-22 00:24:47 +00:00
Sam Leffler
40808af3aa check for undefined identifiers 2008-09-21 22:16:03 +00:00
Sam Leffler
690f477d75 add new build knobs and jigger some existing controls to improve
control over the result of buildworld and installworld; this especially
helps packaging systems such as nanobsd

Reviewed by:	various (posted to arch)
MFC after:	1 month
2008-09-21 22:02:26 +00:00
Roman Kurakin
eba1dd2124 Add the check of the table number. 2008-09-21 21:46:56 +00:00