Commit Graph

140641 Commits

Author SHA1 Message Date
cperciva
5b18df3c73 Initialize "nconv" to a reasonable value in all code paths. Prior to
this commit, sprintf("%s", "") could fail depending on what happened
to be on the stack.

Found by:	LLVM/Clang Static Checker
2008-08-04 06:55:42 +00:00
cperciva
f33a169622 Set "max" to a reasonable value if BLOCKSIZE has a bogus unit. Prior
to this commit, "env BLOCKSIZE=4X df" prints not only "4X: unknown
blocksize" as expected, but sometimes also "maximum blocksize is 1G"
and "minimum blocksize is 512" depending on what happened to be on
the stack.

Found by:	LLVM/Clang Static Checker
2008-08-04 06:53:13 +00:00
cperciva
16fd05844b Don't close file descriptor number <whatever random garbage was on the
stack>.

Found by:	LLVM/Clang Static Checker
MFC after:	1 week
2008-08-04 06:48:54 +00:00
cperciva
55239b4ba7 Setting a variable to the same value twice doesn't actually make it
more likely to have the right value.  Remove superfluous assignments.

Found by:	LLVM/Clang Static Checker
2008-08-04 06:39:52 +00:00
yongari
bfce43df58 Rearrange conditional compilation directives. This makes syntax
highlighting work in vim.
2008-08-04 04:00:10 +00:00
yongari
f38b468cd2 Remove return keyword at the end of functions that return void. 2008-08-04 03:51:20 +00:00
yongari
62712062b0 Remove register keyword. 2008-08-04 03:47:29 +00:00
yongari
43f358fb04 Use ANSI C declarations for all functions. 2008-08-04 03:45:07 +00:00
yongari
6d9b8fb4db Don't enable TSO by default. Users of RTL8169/8110 reported
watchdog timeout issues and the root cause seems to stem from
silicon bug of controller. Personally I couldn't reproduce it on
RTL8169 controller but it seems it's dependent on usage pattern.
For newer PCIe based controllers I have no TSO complaints but
turning off TSO would be more safe. Users who are sure that
their controller works with TSO can still reenable the TSO with
ifconfig(8).

Reported by:	Oliver Lehmann (lehmann at ans-netz dot de), Eugene Butusov (ebutusov at gmail dot com)
2008-08-04 02:34:40 +00:00
yongari
a36e7d5b67 The number of bits reserved for MSS in RealTek controllers is
11bits. This limits the maximum interface MTU size in TSO case
as upper stack should not generate TCP segments with MSS greater
than the limit. Armed with this information, disable TSO if
interface MTU is greater than the limit.
2008-08-04 02:05:09 +00:00
cperciva
45f0d08992 Mark functions as __dead2 in order to help the LLVM static checker
understand which code paths aren't possible.

This commit eliminates 117 false positive bug reports of the form
"allocate memory; error out if pointer is NULL; use pointer".
2008-08-04 01:25:48 +00:00
delphij
a5c1d60642 Make quota(1) to compile with WARNS=6:
- ANSI'fy showrawquotas().
 - Shut up GCC by initializing bgrace and igrace.  The situation
   that caused the GCC warning can never happen though.
2008-08-04 00:43:49 +00:00
scf
d2bab1788d Restructure and use different variables in the tests that involve
environ[0] to be more obvious that environ is not NULL before environ[0]
is tested.  Although I believe the previous code worked, this change
improves code maintainability.

Reviewed by:	ache
MFC after:	3 days
2008-08-03 22:47:23 +00:00
trhodes
79ec5bdbfe Add EAGAIN to the ERRORS list, as found in kern_jail.c.
PR:		125253
Submitted by:	Mateusz Guzik <mjguzik@gmail.com> (original version)
2008-08-03 21:56:58 +00:00
antoine
4dc3acdf62 Kill a dead variable
PR:		126223
Submitted by:	Mateusz Guzik
2008-08-03 21:07:19 +00:00
cognet
ba244939e6 ctime() expects a time_t, but qup->dqblk.dqb_btime is an int32_t, so for
big endian platforms where time_t is 64bits (ie armeb and sparc64), it will
be a problem.
Use a temporary time_t to work around this.

Submitted by:	Matthew Luckie <mjl AT luckie DOT org dot nz>
MFC after:	3 days
2008-08-03 20:36:40 +00:00
ache
3fa9cc2a95 Restored from previous backing out (because that is OpenBSD way, so
assumed to be reviewd by them):
Stir directly from the kernel PRNG, without taking less random pid & time
bytes too (when it is possible).

The difference with OpenBSD code is that they have KERN_ARND sysctl for
that task, while we need to read /dev/random
2008-08-03 20:15:22 +00:00
danger
b6a62e0a11 - back out my last commit as it seems to be wrong.
Spotted by: das
2008-08-03 19:01:07 +00:00
das
d95c118b83 Fix some style bogosity from fdlibm. 2008-08-03 17:49:05 +00:00
das
e570127faf Minor improvements:
- Improve the order of some tests.
- Fix style.

Submitted by:	bde
2008-08-03 17:39:54 +00:00
rwatson
8883e5c019 Remove broken code to replace st_mode value with ACCESSPERMS when
lstat(2) is called on symlinks -- this code appears never to have
worked.  The PR this addresses suggests that the intended
original behavior is the right one, but as bde points out in the
PR comments, we do actually support storing a mode on symlinks,
so returning it seems reasonable.

This is consistent with Mac OS X, which despite documentation to
the contrary does return the mode set on a symlink, but not some
other platforms.  The Single Unix Spec requires only that the
returned bits be "meaningful", which seems at best unhelpful as
advice goes.

PR:		25018
MFC after:	3 days
2008-08-03 15:44:56 +00:00
cognet
28def2c5ae Add "add pc, whatever" as a branch instruction, we use it in memcpy().
MFC after:	3 days
2008-08-03 15:35:32 +00:00
rwatson
6fbc5fa75e DDB scripting, textdumps, output capture, etc, all will appear in
FreeBSD 7.1 before 8.0 ships.

Spotted by:	Ulrich Spoerlein <uspoerlein at gmail dot com>
MFC after:	3 days
2008-08-03 14:27:06 +00:00
trhodes
f37865f7f0 Fill in a few sysctl descriptions.
Reviewed by:	alc, Matt Dillon <dillon@apollo.backplane.com>
Approved by:	alc
2008-08-03 14:26:15 +00:00
rwatson
8517be7c44 DDB scripting, textdumps, output capture, etc, all will appear in
FreeBSD 7.1 before 8.0 ships.

Spotted by:	Ulrich Spoerlein <uspoerlein at gmail dot com>
MFC after:	3 days
2008-08-03 14:14:43 +00:00
trhodes
584243ca1e Document a few sysctls.
Approved by:	imp
2008-08-03 14:11:06 +00:00
kib
52aa4f35d0 Calling linker_load_dependencies() while holding the module'
vnode lock may cause a LOR between kld_sx lock and vnode lock.
linker_load_dependencies() drops kld_sx, and another thread may attempt
to load the same kld.

Reported and tested by:	pjd
MFC after:	1 week
2008-08-03 13:33:45 +00:00
ed
7237d2d9a2 Disconnect drivers that haven't been ported to MPSAFE TTY yet.
As clearly mentioned on the mailing lists, there is a list of drivers
that have not been ported to the MPSAFE TTY layer yet. Remove them from
the kernel configuration files. This means people can now still use
these drivers if they explicitly put them in their kernel configuration
file, which is good.

People should keep in mind that after August 10, these drivers will not
work anymore. Even though owners of the hardware are capable of getting
these drivers working again, I will see if I can at least get them to a
compilable state (if time permits).
2008-08-03 10:32:17 +00:00
edwin
50751ffe31 calendar.holiday: Buinea-bissau should be Guinea-Bissau
PR:		conf/126199
Submitted by:	comet--berkeley (aka Pablo Picasso) <comet@transbay.net>
Approved by:	bde@
2008-08-03 09:21:47 +00:00
imp
2e4a975bb4 Kernel config for the Linksys NSLU2. This is just a basic configuration,
with no support for the LED, buttons, realtime clock or flash support.
2008-08-03 07:10:25 +00:00
thompsa
dd68eea321 Move the grekey to its own file, ifconfig.c does not have interface specific
code.

Submitted by:	sam
2008-08-03 03:36:12 +00:00
cognet
9468ed046d Handle ldr pc, [reg] in branch_taken().
Obtained from:	NetBSD
MFC after:	3 days
2008-08-03 01:53:14 +00:00
cognet
17ddb2b745 Add blx as a branch instruction.
MFC after:	3 days
2008-08-03 01:51:30 +00:00
imp
8d3ee4e826 Bumpd date
Minor word smithing on the need for newer firmware.
2008-08-02 23:41:10 +00:00
imp
e08e926471 Add entry for Prism-3 based Siemens SpeedStream card. It has
identical packaging and model numbers, but has had the Prism-II chips
replaced by Prism-3.  The wi driver was just updated with the new
entry.
2008-08-02 23:29:35 +00:00
imp
3c3360a8ef Minor style nit. 2008-08-02 22:53:43 +00:00
rwatson
e6f6fc88e2 Minor style tweaks. 2008-08-02 22:30:51 +00:00
rwatson
7b3a18a595 Rename mac_partition_enabled to partition_enabled to synchronize with
other policies that similarly now avoid the additional mac_ prefix on
variables.

MFC after:	soon
2008-08-02 20:53:59 +00:00
imp
4e9469a6c7 Add an altnerative Siemens SpeedStream ID. This one is for a Prism 3
card.  I got a pair of these at a garage sale for US$1.00 today...
2008-08-02 20:50:13 +00:00
imp
726eab705b Report what kind of chip only under bootverbose since that's now
exported via a sysctl.
2008-08-02 20:49:01 +00:00
imp
d2adb03381 Minor tweaks to names and comments now that I understand what's going
on better.
2008-08-02 20:45:28 +00:00
imp
5587b55c63 Add an alternative ID for the Siemens SpeedStream SS1021: 0x3021. 2008-08-02 20:36:25 +00:00
phk
62173de879 Add a quote too good to miss from:
http://www.schneier.com/blog/archives/2008/08/schneier_misquo.html

(and reorder one I appearantly didn't get in the right place last time.)
2008-08-02 20:11:56 +00:00
das
f97e361aa3 Test that the result is correctly rounded when |y/x| is huge. 2008-08-02 19:21:33 +00:00
das
9df7b1ac5c A few minor corrections, including some from bde:
- When y/x is huge, it's faster and more accurate to return pi/2
  instead of pi - pi/2.
- There's no need for 3 lines of bit fiddling to compute -z.
- Fix a comment.
2008-08-02 19:17:00 +00:00
sam
ddf87cb1a8 change list wme to only print the channel parameters; to
get channel+bss use -v
2008-08-02 18:10:14 +00:00
sam
1a57b0b9b6 don't silently exit if the regdomain.xml file is missing 2008-08-02 18:06:27 +00:00
sam
64e56d4fb3 add missing lock for htinfo update
Submitted by:	Chris Zimmermann
2008-08-02 18:04:09 +00:00
sam
23d2075246 correct decap of of AppleTalk and IPX frames; don't strip the SNAP
header as they have one natively

Submitted by:	Chris Zimmermann
2008-08-02 18:02:57 +00:00
sam
e93a37806c use new sysctl to generate a fake radar event 2008-08-02 18:01:58 +00:00