]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
15 years agoNamed normally cannot be started chrooted inside a jail. Thus treat
Bjoern A. Zeeb [Sat, 7 Feb 2009 16:37:02 +0000 (16:37 +0000)]
Named normally cannot be started chrooted inside a jail. Thus treat
the jail case specifically. In case we find a proper pre-seeded
devfs in the chroot path (mounted from the base system) permit
starting chrooted else give proper warn/error messages.

PR: conf/103489
Reviewed by: dougb
MFC after: 5 days

15 years agoFix build, sigh.
Andrew Thompson [Sat, 7 Feb 2009 15:51:32 +0000 (15:51 +0000)]
Fix build, sigh.

15 years agoMove the comment to it's correct place.
Wojciech A. Koszek [Sat, 7 Feb 2009 11:40:47 +0000 (11:40 +0000)]
Move the comment to it's correct place.

15 years agoRemove leftover of alpha support for config(8)--we have MAP_FAILED
Wojciech A. Koszek [Sat, 7 Feb 2009 11:12:30 +0000 (11:12 +0000)]
Remove leftover of alpha support for config(8)--we have MAP_FAILED
globally defined.

15 years agoDon't forget to create opt_agp.h on ia64, which also uses agp(4).
Wojciech A. Koszek [Sat, 7 Feb 2009 09:57:14 +0000 (09:57 +0000)]
Don't forget to create opt_agp.h on ia64, which also uses agp(4).

15 years agoDont hold the lock over the controller init, we are still attaching.
Andrew Thompson [Sat, 7 Feb 2009 06:27:16 +0000 (06:27 +0000)]
Dont hold the lock over the controller init, we are still attaching.

15 years agoC99 TC2 now wants FP_FAST_FMA* to be defined to 1, if the macros are
David Schultz [Sat, 7 Feb 2009 05:41:24 +0000 (05:41 +0000)]
C99 TC2 now wants FP_FAST_FMA* to be defined to 1, if the macros are
defined at all. See also: defect report #223.

15 years agocount stuck beacon events
Sam Leffler [Sat, 7 Feb 2009 05:34:41 +0000 (05:34 +0000)]
count stuck beacon events

15 years agofix building w/o CFI_ARMEDANDDANGEROUS
Sam Leffler [Sat, 7 Feb 2009 05:32:19 +0000 (05:32 +0000)]
fix building w/o CFI_ARMEDANDDANGEROUS

15 years agoexpand CFI_ARMEDANDDANGEROUS to include writing the user segment
Sam Leffler [Sat, 7 Feb 2009 05:03:25 +0000 (05:03 +0000)]
expand CFI_ARMEDANDDANGEROUS to include writing the user segment
of the PR; this register is actually write-once so deserves the
safety-belt as much as the PLR

15 years agosi_cmdname() is defined only when SI_DEBUG is enabled, thus
Wojciech A. Koszek [Sat, 7 Feb 2009 02:14:27 +0000 (02:14 +0000)]
si_cmdname() is defined only when SI_DEBUG is enabled, thus
using this function in simple printf() causes compile-time
problems. Use conditionally enabled DPRINT() macro instead.

15 years agofix 11n channel construction
Sam Leffler [Sat, 7 Feb 2009 01:54:57 +0000 (01:54 +0000)]
fix 11n channel construction

15 years agoadd macro for future regulatory mods
Sam Leffler [Sat, 7 Feb 2009 01:53:44 +0000 (01:53 +0000)]
add macro for future regulatory mods

15 years agoRearrange this code slightly to pass softcs around instead of device_t,
Nathan Whitehorn [Sat, 7 Feb 2009 01:15:13 +0000 (01:15 +0000)]
Rearrange this code slightly to pass softcs around instead of device_t,
solving a possible panic when snd_ai2s is loaded at boot time. Also change
the device setup to indicate to the pcm layer that the device is MPSAFE.

Submitted by: Marco Trillo
Suggestions by: Ariff Abdullah

15 years agoRegulatory fixups:
Sam Leffler [Sat, 7 Feb 2009 01:12:51 +0000 (01:12 +0000)]
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

15 years agoTidy NOTES a bit:
Wojciech A. Koszek [Sat, 7 Feb 2009 00:15:30 +0000 (00:15 +0000)]
Tidy NOTES a bit:
- ath(4) is the last listed device, so make it's comment last as well
- since we have hints for le(4), bring it back by inserting commented
  out line until I check, if it can be safely enabled.
- bring snc(4) explanation
- put pmtimer comment together with other drivers' comments in a block
- bring comments for canbus, canbepm, pmc

olpt comment has been left blank, since I don't know how does this
driver differ from other printer drivers.

15 years agoTidy NOTES a bit:
Wojciech A. Koszek [Sat, 7 Feb 2009 00:06:13 +0000 (00:06 +0000)]
Tidy NOTES a bit:
- leave pmtimer comment that is common to other architectures.
- bring pbio explanation to the block comment relating to other
  drivers in the same block.

15 years agoTidy NOTES a bit:
Wojciech A. Koszek [Sat, 7 Feb 2009 00:01:10 +0000 (00:01 +0000)]
Tidy NOTES a bit:
- remove misleading nve/nfe comments, which make it hard to
  distinguish those two at a first glance
- bring pbio documentation to the block comment together with
  other drivers

I also brought commented out line responsible for si(4), since it
seems to compile and already has respective comment in this file.

15 years agoAdd rudimentary support for symbolic links on UDF. Links are stored as a
John Baldwin [Fri, 6 Feb 2009 22:24:03 +0000 (22:24 +0000)]
Add rudimentary support for symbolic links on UDF.  Links are stored as a
sequence of pathname components.  We walk the list building a string in
the caller's passed in buffer.  Currently this only handles path names
in CS8 (character set 8) as that is what mkisofs generates for UDF images.

MFC after: 1 month

15 years agoComment about ural(4) isn't approprate here, since the driver is present in
Wojciech A. Koszek [Fri, 6 Feb 2009 22:22:08 +0000 (22:22 +0000)]
Comment about ural(4) isn't approprate here, since the driver is present in
global NOTES file.

cx(4) driver isn't present in this file, though it could be. However, cx(4)
seems to be more or less dead -- it hasn't been linked to the modules build,
and after TTY-ng transformations it doesn't compile.

Remove it until cx(4) is broken.

15 years agoural(4) is already present in global NOTES, thus there is no
Wojciech A. Koszek [Fri, 6 Feb 2009 21:56:55 +0000 (21:56 +0000)]
ural(4) is already present in global NOTES, thus there is no
need to explicitly list it here once again. This removes:

WARNING: duplicate option `DEV_URAL' encountered.
WARNING: duplicate device `ural' encountered.

Warnings when compiling LINT on amd64.

15 years agoFix AGP debugging code:
Wojciech A. Koszek [Fri, 6 Feb 2009 20:57:10 +0000 (20:57 +0000)]
Fix AGP debugging code:
- correct format strings
- fill opt_agp.h if AGP_DEBUG is defined
- bring AGP_DEBUG to LINT by mentioning it in NOTES

This should hopefully fix a warning that was...

Found by: Coverity Prevent(tm)
CID: 3676
Tested on: amd64, i386

15 years agoAdd support for fifos to UDF:
John Baldwin [Fri, 6 Feb 2009 20:09:14 +0000 (20:09 +0000)]
Add support for fifos to UDF:
- Add a separate set of vnode operations that inherits from the fifo ops
  and use it for fifo nodes.
- Add a VOP_SETATTR() method that allows setting the size (by silently
  ignoring the requests) of fifos.  This is to allow O_TRUNC opens of
  fifo devices (e.g. I/O redirection in shells using ">").
- Add a VOP_PRINT() handler while I'm here.

15 years agoTweak the output of VOP_PRINT/vn_printf() some.
John Baldwin [Fri, 6 Feb 2009 20:06:48 +0000 (20:06 +0000)]
Tweak the output of VOP_PRINT/vn_printf() some.
- Align the fifo output in fifo_print() with other vn_printf() output.
- Remove the leading space from lockmgr_printinfo() so its output lines up
  in vn_printf().
- lockmgr_printinfo() now ends with a newline, so remove an extra newline
  from vn_printf().

15 years agoAdd KASSERTs to make it easier to debug problems like the one fixed
Edward Tomasz Napierala [Fri, 6 Feb 2009 18:16:01 +0000 (18:16 +0000)]
Add KASSERTs to make it easier to debug problems like the one fixed
in r188141.

Reviewed by: kib,attilio
Approved by: rwatson (mentor)
Tested by: pho
Sponsored by: FreeBSD Foundation

15 years agoWhen a device containing mounted UFS filesystem disappears, the type
Edward Tomasz Napierala [Fri, 6 Feb 2009 17:14:07 +0000 (17:14 +0000)]
When a device containing mounted UFS filesystem disappears, the type
of devvp becomes VBAD, which UFS incorrectly interprets as snapshot
vnode, which in turns causes panic.  Fix it by replacing '!= VCHR'
with '== VREG'.

With this fix in place, you should no longer be able to panic the system
by removing a device with an UFS filesystem mounted from it - assuming
you don't use softupdates.

Reviewed by: kib
Tested by: pho
Approved by: rwatson (mentor)
Sponsored by: FreeBSD Foundation

15 years agoIn urtw_init() call urtw_stop(ifp, 0) rather than urtw_stop(ifp, 1)
Kevin Lo [Fri, 6 Feb 2009 15:27:40 +0000 (15:27 +0000)]
In urtw_init() call urtw_stop(ifp, 0) rather than urtw_stop(ifp, 1)
to stop the device.

15 years agoNote that the slave address passed to smb(4) commands must be left-justified
John Baldwin [Fri, 6 Feb 2009 15:09:31 +0000 (15:09 +0000)]
Note that the slave address passed to smb(4) commands must be left-justified
(LSB is 0).  The iic(4) manpage probably needs similar language to describe
the format it expects.

15 years agoRegen
Kevin Lo [Fri, 6 Feb 2009 15:04:06 +0000 (15:04 +0000)]
Regen

15 years agoAdd the Buffalo WLI-U2-SG54HG
Kevin Lo [Fri, 6 Feb 2009 15:03:17 +0000 (15:03 +0000)]
Add the Buffalo WLI-U2-SG54HG

15 years agoAdd a note to document that ichsmb(4) now uses left-justified SMBus slave
John Baldwin [Fri, 6 Feb 2009 15:03:14 +0000 (15:03 +0000)]
Add a note to document that ichsmb(4) now uses left-justified SMBus slave
addresses.

15 years agoExpand the scope of the sysctllock sx lock to protect the sysctl tree itself.
John Baldwin [Fri, 6 Feb 2009 14:51:32 +0000 (14:51 +0000)]
Expand the scope of the sysctllock sx lock to protect the sysctl tree itself.
Back in 1.1 of kern_sysctl.c the sysctl() routine wired the "old" userland
buffer for most sysctls (everything except kern.vnode.*).  I think to prevent
issues with wiring too much memory it used a 'memlock' to serialize all
sysctl(2) invocations, meaning that only one user buffer could be wired at
a time.  In 5.0 the 'memlock' was converted to an sx lock and renamed to
'sysctl lock'.  However, it still only served the purpose of serializing
sysctls to avoid wiring too much memory and didn't actually protect the
sysctl tree as its name suggested.  These changes expand the lock to actually
protect the tree.

Later on in 5.0, sysctl was changed to not wire buffers for requests by
default (sysctl_handle_opaque() will still wire buffers larger than a single
page, however).  As a result, user buffers are no longer wired as often.
However, many sysctl handlers still wire user buffers, so it is still
desirable to serialize userland sysctl requests.  Kernel sysctl requests
are allowed to run in parallel, however.

- Expose sysctl_lock()/sysctl_unlock() routines to exclusively lock the
  sysctl tree for a few places outside of kern_sysctl.c that manipulate
  the sysctl tree directly including the kernel linker and vfs_register().
- sysctl_register() and sysctl_unregister() require the caller to lock
  the sysctl lock using sysctl_lock() and sysctl_unlock().  The rest of
  the public sysctl API manage the locking internally.
- Add a locked variant of sysctl_remove_oid() for internal use so that
  external uses of the API do not need to be aware of locking requirements.
- The kernel linker no longer needs Giant when manipulating the sysctl
  tree.
- Add a missing break to the loop in vfs_register() so that we stop looking
  at the sysctl MIB once we have changed it.

MFC after: 1 month

15 years agoConsistently use <TAB> instead of spaces as option name and file
Wojciech A. Koszek [Fri, 6 Feb 2009 10:30:46 +0000 (10:30 +0000)]
Consistently use <TAB> instead of spaces as option name and file
separator.

15 years agofix spelling error
Warner Losh [Fri, 6 Feb 2009 09:34:17 +0000 (09:34 +0000)]
fix spelling error

Submitted by: trasz

15 years agoStore the entire funce for disk type functions (eg CF cards and the
Warner Losh [Fri, 6 Feb 2009 07:49:03 +0000 (07:49 +0000)]
Store the entire funce for disk type functions (eg CF cards and the
like).

15 years agoSet NFSMNT_ACDIRMAX flag in fallback_mount() function.
Craig Rodrigues [Fri, 6 Feb 2009 07:47:53 +0000 (07:47 +0000)]
Set NFSMNT_ACDIRMAX flag in fallback_mount() function.

15 years agoSet NFSMNT_ACREGMIN, NFSMNT_ACREGMAX, and NFSMNT_ACDIRMIN flags
Craig Rodrigues [Fri, 6 Feb 2009 07:42:21 +0000 (07:42 +0000)]
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>

15 years agoRemove unused variable.
Wojciech A. Koszek [Fri, 6 Feb 2009 00:55:19 +0000 (00:55 +0000)]
Remove unused variable.

Found with: Coverity Prevent(tm)
CID: 4138

15 years agoMake config -x <kernel> only return non-zero characters,
Wojciech A. Koszek [Fri, 6 Feb 2009 00:50:21 +0000 (00:50 +0000)]
Make config -x <kernel> only return non-zero characters,
so that:

config -x <kernel> | grep <something>

just works.

Reported by: Danny Braniss <danny@cs.huji.ac.il>

15 years agoadd PSB channels to the calibration list
Sam Leffler [Fri, 6 Feb 2009 00:48:56 +0000 (00:48 +0000)]
add PSB channels to the calibration list

15 years agoBring consistent debugging output for all values that are supposed
Wojciech A. Koszek [Thu, 5 Feb 2009 23:51:11 +0000 (23:51 +0000)]
Bring consistent debugging output for all values that are supposed
to be printed in a hexadecimal format. Otherwise, '270' doesn't say
much.

Reviewed by: imp

15 years agofor adhoc and ahdemo modes try to find the "bss node": use the bssid
Sam Leffler [Thu, 5 Feb 2009 23:15:39 +0000 (23:15 +0000)]
for adhoc and ahdemo modes try to find the "bss node": use the bssid
unless it's not setup or zero's; this may not work as the bssid of
the ibss isn't certain to the "right mac address" but for many cases
it is

15 years agoDrop the kernel linker lock while running SYSUNINIT routines and removing
John Baldwin [Thu, 5 Feb 2009 23:01:36 +0000 (23:01 +0000)]
Drop the kernel linker lock while running SYSUNINIT routines and removing
sysctls during a linker file unload.  We drop the lock when doing similar
operations during a linker file load.  To close races, clear the LINKED
flag before dropping the lock so that the linker file is no longer visible
to userland.

MFC after: 1 week

15 years agomake -o handling like athstats
Sam Leffler [Thu, 5 Feb 2009 22:17:10 +0000 (22:17 +0000)]
make -o handling like athstats

15 years agounbreak -o
Sam Leffler [Thu, 5 Feb 2009 22:16:09 +0000 (22:16 +0000)]
unbreak -o

15 years agohalt APs on reboot
Kip Macy [Thu, 5 Feb 2009 21:41:27 +0000 (21:41 +0000)]
halt APs on reboot

15 years agoreboot instance on reset
Kip Macy [Thu, 5 Feb 2009 21:35:40 +0000 (21:35 +0000)]
reboot instance on reset

15 years agofix non-witness compile
Kip Macy [Thu, 5 Feb 2009 21:18:39 +0000 (21:18 +0000)]
fix non-witness compile

15 years agoeliminate gainFCorrection; just have ar5212GetGainFCorrection return
Sam Leffler [Thu, 5 Feb 2009 21:13:31 +0000 (21:13 +0000)]
eliminate gainFCorrection; just have ar5212GetGainFCorrection return
the calculated value as it's only used in one place

15 years agoadd new stats and missing tx_raw stat
Sam Leffler [Thu, 5 Feb 2009 21:09:46 +0000 (21:09 +0000)]
add new stats and missing tx_raw stat

15 years agoMinor packet drop improvements:
Sam Leffler [Thu, 5 Feb 2009 21:02:40 +0000 (21:02 +0000)]
Minor packet drop improvements:
o change tdma packet drop msg when ack required to ATH_DEBUG_TDMA
  (ATH_DEBUG_XMIT is too noisy)
o add a debug msg for raw packet drop due to interface down/invalid
o add stats for these two cases
o explain how another drop case is handled

15 years agoimprove IQ cal debug msgs; in particular don't scare people by screaming
Sam Leffler [Thu, 5 Feb 2009 20:56:33 +0000 (20:56 +0000)]
improve IQ cal debug msgs; in particular don't scare people by screaming
"MISGATED IQ CAL!" when it's not

15 years agofill in ar5212ResetCalValid; reset the IQ valid flag on the channel
Sam Leffler [Thu, 5 Feb 2009 20:51:53 +0000 (20:51 +0000)]
fill in ar5212ResetCalValid; reset the IQ valid flag on the channel
so IQ calibration will be started on the next periodic cal

15 years agostyle
Sam Leffler [Thu, 5 Feb 2009 20:49:13 +0000 (20:49 +0000)]
style

15 years agoreplace r/w idiom with OS_REG_SET_BIT (to match other code)
Sam Leffler [Thu, 5 Feb 2009 20:48:30 +0000 (20:48 +0000)]
replace r/w idiom with OS_REG_SET_BIT (to match other code)

15 years agoDon't check for mapping above 4GB on 32-bit platforms.
Warner Losh [Thu, 5 Feb 2009 20:44:06 +0000 (20:44 +0000)]
Don't check for mapping above 4GB on 32-bit platforms.

15 years agoo fix identification of ahdemo mode
Sam Leffler [Thu, 5 Feb 2009 20:39:53 +0000 (20:39 +0000)]
o fix identification of ahdemo mode
o split out code to get the bssid for use in the future
o include more information in error diags when unable to collect sta info/stats

15 years agoo change _db_show_key to always dump the contents instead of checking
Sam Leffler [Thu, 5 Feb 2009 20:26:53 +0000 (20:26 +0000)]
o change _db_show_key to always dump the contents instead of checking
  IEEE80211_KEY_DEVKEY
o fix channel power printing (they are signed values)
o add show statab to dump a node table and automatically dump the sta
  table of a com structure with /s

15 years agodo_product_lookup should return a const struct pccard_product *.
Warner Losh [Thu, 5 Feb 2009 19:39:07 +0000 (19:39 +0000)]
do_product_lookup should return a const struct pccard_product *.

15 years agoFix parameter types for set_res_flags and read_ivars
Warner Losh [Thu, 5 Feb 2009 19:38:31 +0000 (19:38 +0000)]
Fix parameter types for set_res_flags and read_ivars

15 years agoshutdown returns an int
Warner Losh [Thu, 5 Feb 2009 19:37:49 +0000 (19:37 +0000)]
shutdown returns an int

15 years agoshutdown returns an int
Warner Losh [Thu, 5 Feb 2009 19:36:14 +0000 (19:36 +0000)]
shutdown returns an int

15 years agowritereg returns an int.
Warner Losh [Thu, 5 Feb 2009 19:33:35 +0000 (19:33 +0000)]
writereg returns an int.

15 years agowritereg returns an int.
Warner Losh [Thu, 5 Feb 2009 19:33:20 +0000 (19:33 +0000)]
writereg returns an int.

15 years agoMake iclear return int, since that matches all function definitions of it.
Warner Losh [Thu, 5 Feb 2009 19:32:34 +0000 (19:32 +0000)]
Make iclear return int, since that matches all function definitions of it.

15 years agoreset_epp and ecp_sync both return int.
Warner Losh [Thu, 5 Feb 2009 19:31:55 +0000 (19:31 +0000)]
reset_epp and ecp_sync both return int.

15 years agoShutdown returns an int.
Warner Losh [Thu, 5 Feb 2009 19:30:55 +0000 (19:30 +0000)]
Shutdown returns an int.

15 years agoidentify routine takes driver_t *, not device_t *.
Warner Losh [Thu, 5 Feb 2009 19:30:28 +0000 (19:30 +0000)]
identify routine takes driver_t *, not device_t *.

15 years agoo add IEEE80211_KEY_BITS for %b printing of wk_flags
Sam Leffler [Thu, 5 Feb 2009 19:20:34 +0000 (19:20 +0000)]
o add IEEE80211_KEY_BITS for %b printing of wk_flags
o replace hand-rolled code to print wk_flags
o add display of ni_ucastkey in show sta
o fix \n in _db_show_key

15 years agoAdd some additional debugging for the memory code.
Warner Losh [Thu, 5 Feb 2009 18:51:14 +0000 (18:51 +0000)]
Add some additional debugging for the memory code.

15 years agodevice_shutdown returns an int.
Warner Losh [Thu, 5 Feb 2009 18:43:13 +0000 (18:43 +0000)]
device_shutdown returns an int.

15 years agopcib_read_config and pcib_write_config take u_int params.
Warner Losh [Thu, 5 Feb 2009 18:40:42 +0000 (18:40 +0000)]
pcib_read_config and pcib_write_config take u_int params.

15 years agodevice_shutdown returns int.
Warner Losh [Thu, 5 Feb 2009 18:39:33 +0000 (18:39 +0000)]
device_shutdown returns int.

15 years agobus_add_child takes a const char *.
Warner Losh [Thu, 5 Feb 2009 18:38:39 +0000 (18:38 +0000)]
bus_add_child takes a const char *.

15 years agoadd cfi test tool
Sam Leffler [Thu, 5 Feb 2009 18:15:20 +0000 (18:15 +0000)]
add cfi test tool

Sponsored by: Carlson Wireless
Reviewed by: imp, Chris Andreson

15 years agoAdd support for frobbing Intel StrataFlash Protection Registers:
Sam Leffler [Thu, 5 Feb 2009 18:12:07 +0000 (18:12 +0000)]
Add support for frobbing Intel StrataFlash Protection Registers:
o add CFI_SUPPORT_STRATAFLASH compile option to enable support
o add new ioctls to get/set the factory and user/oem segments of the PR
  and to get/set Protection Lock Register that fuses the user segment
o add #defines for bits in the status register
o update cfi_wait_ready to take an offset so it can be used to wait for
  PR write completion and replace constants w/ symbolic names

Note: writing the user segment isn't correct; committing now to get review.

Sponsored by: Carlson Wireless
Reviewed by: imp, Chris Anderson

15 years agoadd support for max antenna gain (not used at the moment)
Sam Leffler [Thu, 5 Feb 2009 17:51:46 +0000 (17:51 +0000)]
add support for max antenna gain (not used at the moment)

15 years agoFix return type for detach routine (should be int)
Warner Losh [Thu, 5 Feb 2009 17:43:12 +0000 (17:43 +0000)]
Fix return type for detach routine (should be int)
Fix first parameter for identify routine (should be driver_t *)

15 years agoRemove the assertive KA_HELD and KA_UNHELD as long as they are dangerous,
Attilio Rao [Thu, 5 Feb 2009 15:09:04 +0000 (15:09 +0000)]
Remove the assertive KA_HELD and KA_UNHELD as long as they are dangerous,
and not really helpful.

15 years agoDon't bother null-checking the thread pointer before the prison checks
Jamie Gritton [Thu, 5 Feb 2009 15:04:23 +0000 (15:04 +0000)]
Don't bother null-checking the thread pointer before the prison checks
in udp6_connect (td is already dereferenced elsewhere without such a
check).  This makes the conversion from a sockaddr to a sockaddr_in6
always happen, so convert once at the beginning of the function rather
than twice in the middle.

Approved by: bz (mentor)

15 years agoAdd more KTR_VFS logging point in order to have a more effective tracing.
Attilio Rao [Thu, 5 Feb 2009 15:03:35 +0000 (15:03 +0000)]
Add more KTR_VFS logging point in order to have a more effective tracing.

Reviewed by: brueffer, kib
Tested by: Gianni Trematerra <giovanni D trematerra A gmail D com>

15 years agoCall prison_if from rtm_get_jailed, instead of splitting it out into
Jamie Gritton [Thu, 5 Feb 2009 14:58:16 +0000 (14:58 +0000)]
Call prison_if from rtm_get_jailed, instead of splitting it out into
prison_check_ip4 and prison_check_ip6.  As prison_if includes a jailed()
check, remove that check before calling rtm_get_jailed.

Approved by: bz (mentor)

15 years agoRemove redundant calls of prison_local_ip4 in in_pcbbind_setup, and of
Jamie Gritton [Thu, 5 Feb 2009 14:25:53 +0000 (14:25 +0000)]
Remove redundant calls of prison_local_ip4 in in_pcbbind_setup, and of
prison_local_ip6 in in6_pcbbind.

Approved by: bz (mentor)

15 years agoDon't leave the console TTY constantly open.
Ed Schouten [Thu, 5 Feb 2009 14:21:09 +0000 (14:21 +0000)]
Don't leave the console TTY constantly open.

When we leave the console TTY constantly open, we never reset the
termios attributes. This causes output processing, echoing, etc. not to
be reset to the proper values when going into single user mode after the
system has booted. It also causes nl-to-crnl-conversion not to take
place during shutdown, which causes a `staircase effect'.

This patch adds a new TTY flag, TF_OPENED_CONS, which is set when the
TTY is opened through /dev/console. Because the flags are only used by
the kernel and the pstat(8) utility, I've decided to renumber the TTY
flags. This shouldn't be an issue, because the TTY layer is not yet part
of a stable release.

Reported by: Mark Atkinson <atkin901 yahoo com>
Tested by: sepotvin

15 years agoDon't allow creating a socket with a protocol family that the current
Jamie Gritton [Thu, 5 Feb 2009 14:15:18 +0000 (14:15 +0000)]
Don't allow creating a socket with a protocol family that the current
jail doesn't support.  This involves a new function prison_check_af,
like prison_check_ip[46] but that checks only the family.

With this change, most of the errors generated by jailed sockets
shouldn't ever occur, at least until jails are changeable.

Approved by: bz (mentor)

15 years agoStandardize the various prison_foo_ip[46] functions and prison_if to
Jamie Gritton [Thu, 5 Feb 2009 14:06:09 +0000 (14:06 +0000)]
Standardize the various prison_foo_ip[46] functions and prison_if to
return zero on success and an error code otherwise.  The possible errors
are EADDRNOTAVAIL if an address being checked for doesn't match the
prison, and EAFNOSUPPORT if the prison doesn't have any addresses in
that address family.  For most callers of these functions, use the
returned error code instead of e.g. a hard-coded EADDRNOTAVAIL or
EINVAL.

Always include a jailed() check in these functions, where a non-jailed
cred always returns success (and makes no changes).  Remove the explicit
jailed() checks that preceded many of the function calls.

Approved by: bz (mentor)

15 years agoUse the correct creds when reconnecting so that we have enough privilege to
Doug Rabson [Thu, 5 Feb 2009 11:48:10 +0000 (11:48 +0000)]
Use the correct creds when reconnecting so that we have enough privilege to
bind reserved ports (if necessary).

Submitted by: Jaakko Heinonen <jh at saualaht dot fi>

15 years agoIn some situations, mnt_lockref could go negative due to vfs_unbusy() being
Edward Tomasz Napierala [Thu, 5 Feb 2009 08:46:18 +0000 (08:46 +0000)]
In some situations, mnt_lockref could go negative due to vfs_unbusy() being
called without calling vfs_busy() first.  This made umount(8) hang waiting
for mnt_lockref to become zero, which would never happen.

Reviewed by: kib
Approved by: rwatson (mentor)
Reported by: pho
Found with: stress2
Sponsored by: FreeBSD Foundation

15 years agopass in smp_processor_id to identify the cpu in use
Kip Macy [Thu, 5 Feb 2009 04:00:55 +0000 (04:00 +0000)]
pass in smp_processor_id to identify the cpu in use

15 years agoadjust the way that idle happens so as to avoid missing timer interrupts
Kip Macy [Thu, 5 Feb 2009 02:01:18 +0000 (02:01 +0000)]
adjust the way that idle happens so as to avoid missing timer interrupts

15 years agoAllow unprivileged users to run l2ping(8).
Maksim Yevmenkin [Wed, 4 Feb 2009 22:44:09 +0000 (22:44 +0000)]
Allow unprivileged users to run l2ping(8).

MFC after: 1 month

15 years agoFix bm_shutdown() KOBJ method to correspond to return int, as it should.
Nathan Whitehorn [Wed, 4 Feb 2009 22:16:27 +0000 (22:16 +0000)]
Fix bm_shutdown() KOBJ method to correspond to return int, as it should.

Found by: Andriy Gapon

15 years agoClenup code a bit and do not call fork(2) before dameon(3) where not needed.
Maksim Yevmenkin [Wed, 4 Feb 2009 22:04:06 +0000 (22:04 +0000)]
Clenup code a bit and do not call fork(2) before dameon(3) where not needed.

MFC after: 1 month

15 years agoCorrect signatures to match kobj function definitions.
Warner Losh [Wed, 4 Feb 2009 21:11:31 +0000 (21:11 +0000)]
Correct signatures to match kobj function definitions.

15 years agoShutdown routine returns int.
Warner Losh [Wed, 4 Feb 2009 20:39:45 +0000 (20:39 +0000)]
Shutdown routine returns int.

15 years agodetach doesn't return an unsinged int, but returns an int.
Warner Losh [Wed, 4 Feb 2009 20:35:22 +0000 (20:35 +0000)]
detach doesn't return an unsinged int, but returns an int.

15 years agoFix shutdown routine to return 0 and change signature from void return
Warner Losh [Wed, 4 Feb 2009 20:26:27 +0000 (20:26 +0000)]
Fix shutdown routine to return 0 and change signature from void return
to int.

15 years agoCorrect signature for the identify routine. The bad parameter wasn't
Warner Losh [Wed, 4 Feb 2009 20:23:42 +0000 (20:23 +0000)]
Correct signature for the identify routine.  The bad parameter wasn't
used at all, so this is just a tidiness excersize.

15 years agoRemove local variable 'ddp' from DDP's attach and detach routines; they
Robert Watson [Wed, 4 Feb 2009 20:04:32 +0000 (20:04 +0000)]
Remove local variable 'ddp' from DDP's attach and detach routines; they
were used only for assertions, and rather than ifdef'ing them
INVARIANTS and using local variables, just directly access so_pcb.

Submitted by: Christoph Mallon <christoph dot mallon at gmx dot de>
MFC after: 1 week

15 years agoRemove written-to but never read local variable 'offset' from
Robert Watson [Wed, 4 Feb 2009 20:00:17 +0000 (20:00 +0000)]
Remove written-to but never read local variable 'offset' from
soreceive_dgram().

Submitted by: Christoph Mallon <christoph dot mallon at gmx dot de>
MFC after: 1 week