]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
15 years agoFix a few panics in linuxulator + VIMAGE due to curvnet not being set.
zec [Fri, 28 Aug 2009 22:51:07 +0000 (22:51 +0000)]
Fix a few panics in linuxulator + VIMAGE due to curvnet not being set.

This change affects only options VIMAGE builds.

Reviewed by: julian
MFC after: 3 days

15 years agosh: Fix crash with empty functions (f() { }) introduced in r196483
jilles [Fri, 28 Aug 2009 22:41:25 +0000 (22:41 +0000)]
sh: Fix crash with empty functions (f() { }) introduced in r196483

Empty pairs of braces are represented by a NULL node pointer, just like
empty lines at the top level.

Support for empty pairs of braces may be removed later. They make the code
more complex, have inconsistent behaviour (may or may not change $?), are
not specified by POSIX and are not allowed by some other shells like bash,
dash and ksh93.

Reported by: kan

15 years agoIntroduce a separate sx lock for protecting lists of vnet sysinit
zec [Fri, 28 Aug 2009 22:30:55 +0000 (22:30 +0000)]
Introduce a separate sx lock for protecting lists of vnet sysinit
and sysuninit handlers.

Previously, sx_vnet, which is a lock designated for protecting
the vnet list, was (ab)used for protecting vnet sysinit / sysuninit
handler lists as well.  Holding exclusively the sx_vnet lock while
invoking sysinit and / or sysuninit handlers turned out to be
problematic, since some of the handlers may attempt to wake up
another thread and wait for it to walk over the vnet list, hence
acquire a shared lock on sx_vnet, which in turn leads to a deadlock.
Protecting vnet sysinit / sysuninit lists with a separate lock
mitigates this issue, which was first observed with
flowtable_flush() / flowtable_cleaner() in sys/net/flowtable.c.

Reviewed by: rwatson, jhb
MFC after: 3 days

15 years agoExtend the device pager to support different memory attributes on different
jhb [Fri, 28 Aug 2009 14:06:55 +0000 (14:06 +0000)]
Extend the device pager to support different memory attributes on different
pages in an object.
- Add a new variant of d_mmap() currently called d_mmap2() which accepts
  an additional in/out parameter that is the memory attribute to use for
  the requested page.
- A driver either uses d_mmap() or d_mmap2() for all requests but not both.
  The current implementation uses a flag in the cdevsw (D_MMAP2) to indicate
  that the driver provides a d_mmap2() handler instead of d_mmap().  This
  is done to make the change ABI compatible with existing drivers and
  MFC'able to 7 and 8.

Submitted by: alc
MFC after: 1 month

15 years agoHook up the pty(4) module to the build.
ed [Fri, 28 Aug 2009 10:23:40 +0000 (10:23 +0000)]
Hook up the pty(4) module to the build.

15 years agoFix a bug where vlan interfaces are not supported by SCTP.
tuexen [Fri, 28 Aug 2009 08:41:59 +0000 (08:41 +0000)]
Fix a bug where vlan interfaces are not supported by SCTP.

Approved by: rrs (mentor)
MFC after: 3 days

15 years agoIn ip_output(), the flow-table module must not try to cache L2/L3
qingli [Fri, 28 Aug 2009 07:01:09 +0000 (07:01 +0000)]
In ip_output(), the flow-table module must not try to cache L2/L3
information for interface of IFF_POINTOPOINT or IFF_LOOPBACK type.
Since the L2 information (rt_lle) is invalid for these interface
types, accidental caching attempt will trigger panic when the invalid
rt_lle reference is accessed.

When installing a new route, or when updating an existing route, the
user supplied gateway address may be an interface address (this is
particularly true for point-to-point interface related modules such
as ppp, if_tun, if_gif). Currently the routing command handler always
set the RTF_GATEWAY flag if the gateway address is given as part of the
command paramters. Therefore the gateway address must be verified against
interface addresses or else the route would be treated as an indirect
route, thus making that route unusable.

Reviewed by: kmacy, julia, rwatson
Verified by: marcus
MFC after: 3 days

15 years agoDo not try to free the rt_lle entry of the cached route in
qingli [Fri, 28 Aug 2009 05:37:31 +0000 (05:37 +0000)]
Do not try to free the rt_lle entry of the cached route in
ip_output() if the cached route was not initialized from the
flow-table. The rt_lle entry is invalid unless it has been
initialized through the flow-table.

Reviewed by: kmacy, rwatson
MFC after: immediately

15 years agoAdd some tests for a fixed bug in an uncommitted patch.
jilles [Thu, 27 Aug 2009 22:23:23 +0000 (22:23 +0000)]
Add some tests for a fixed bug in an uncommitted patch.
(Trying to get syntax errors for sh -c ':; do' and `:; do`.)

15 years agorevert r196600; didn't notice it'd been done already
sam [Thu, 27 Aug 2009 17:55:44 +0000 (17:55 +0000)]
revert r196600; didn't notice it'd been done already

Submitted by: jhay

15 years agochange default regdomain for thailand
sam [Thu, 27 Aug 2009 17:42:37 +0000 (17:42 +0000)]
change default regdomain for thailand

Obtained from: linux-wireless@kernel.org

15 years agoenable mesh by default
sam [Thu, 27 Aug 2009 17:33:44 +0000 (17:33 +0000)]
enable mesh by default

15 years agorecognie invalid register names
sam [Thu, 27 Aug 2009 17:32:58 +0000 (17:32 +0000)]
recognie invalid register names

15 years agoFix a LOR between allprison_lock and vnode locks by releasing
jamie [Thu, 27 Aug 2009 16:15:51 +0000 (16:15 +0000)]
Fix a LOR between allprison_lock and vnode locks by releasing
allprison_lock before releasing a prison's root vnode.

PR: kern/138004
Reviewed by: kib
Approved by: bz (mentor)
MFC after: 3 days

15 years agoIn the loop through the list of interfaces in network6_interface_setup()
dougb [Thu, 27 Aug 2009 15:24:26 +0000 (15:24 +0000)]
In the loop through the list of interfaces in network6_interface_setup()
rtsol_interface gets reset to "yes" each time through the loop, but
rtsol_available does not. If a user has lo0 first in their list of
interfaces rtsol_available will get set to "no" the first time through
the loop and subsequent interfaces will not get rtsol'ed when they should.

Therefore change the conditional for the is_wired() test to _interface.

Noticed by: Dimitry Andric <dimitry@andric.com>

15 years agoUpdate some comments to match the removal of the docset compilation
blackend [Thu, 27 Aug 2009 13:18:59 +0000 (13:18 +0000)]
Update some comments to match the removal of the docset compilation
during the release build.

15 years agoMFV of r195794
edwin [Thu, 27 Aug 2009 12:36:15 +0000 (12:36 +0000)]
MFV of r195794

MFV of tzcode2009k

zic.c:
    Do not end a binary file with a POSIX-style time zone string
    for locations that end up in permanent DST (thanks to Andreas
    Schwab).

15 years agoMFV of r196350
edwin [Thu, 27 Aug 2009 12:24:21 +0000 (12:24 +0000)]
MFV of r196350

Import of tzdata2009l

- Egypt will go to Wintertime on 21 August 2009
- Heads up for a possible DST in Samoa

15 years agoMFV of r195792:
edwin [Thu, 27 Aug 2009 12:22:50 +0000 (12:22 +0000)]
MFV of r195792:

Import of tzdata2009k to head.

- Changes in Mauritius and Bangladesh
- No leapsecond at the end of December 2009

15 years agoThere's no need for checking result of M_WAITOK allocation.
pjd [Thu, 27 Aug 2009 08:40:51 +0000 (08:40 +0000)]
There's no need for checking result of M_WAITOK allocation.

15 years agoFix an obvious topology lock leak.
pjd [Thu, 27 Aug 2009 08:28:34 +0000 (08:28 +0000)]
Fix an obvious topology lock leak.

MFC after: 3 days

15 years agoWhen multiple interfaces exist in the system, with each interface having
qingli [Wed, 26 Aug 2009 21:32:50 +0000 (21:32 +0000)]
When multiple interfaces exist in the system, with each interface having
an IPv6 address assigned to it, and if an incoming packet received on
one interface has a packet destination address that belongs to another
interface, the routing table is consulted to determine how to reach this
packet destination. Since the packet destination is an interface address,
the route table will return a host route with the loopback interface as
rt_ifp. The input code must recognize this fact, instead of using the
loopback interface, the input code performs a search to find the right
interface that owns the given IPv6 address.

Reviewed by: bz, gnn, kmacy
MFC after: immediately

15 years ago- Add quirk for Sony DSC digital cameras. This umass devices fail
stas [Wed, 26 Aug 2009 21:14:28 +0000 (21:14 +0000)]
- Add quirk for Sony DSC digital cameras.  This umass devices fail
  to attach without these quirks applied.

PR: usb/137035
URL: http://lists.freebsd.org/pipermail/freebsd-current/2009-August/010852.html
Reported by: Henri Hennebert <hlh@restart.be>, Andrey V. Elsukov <bu7cher@yandex.ru>
MFC after: 1 week

15 years agoAdd a temporary workaround which just lets init die instead of
marius [Wed, 26 Aug 2009 21:10:47 +0000 (21:10 +0000)]
Add a temporary workaround which just lets init die instead of
causing a panic if it is killed due to a unsolved stack overflow
seen very late during shutdown on sparc64 when the gmirror worker
process exists, which is a regression introduced in 8.0.

Reviewed by: kib
MFC after: 3 days

15 years agoHonor the vfs.timestamp_precision sysctl settings for utimes(path, NULL)
kib [Wed, 26 Aug 2009 14:32:37 +0000 (14:32 +0000)]
Honor the vfs.timestamp_precision sysctl settings for utimes(path, NULL)
and similar calls.

Obtained from: Petr Salinger, Debian GNU/kFreeBSD, Debian bug #489894
MFC after: 3 days

15 years agoAdd IFNET_HOLD reserved pointer value for the ifindex ifnet array,
rwatson [Wed, 26 Aug 2009 11:13:10 +0000 (11:13 +0000)]
Add IFNET_HOLD reserved pointer value for the ifindex ifnet array,
which allows an index to be reserved for an ifnet without making
the ifnet available for management operations.  Use this in if_alloc()
while the ifnet lock is released between initial index allocation and
completion of ifnet initialization.

Add ifindex_free() to centralize the implementation of releasing an
ifindex value.  Use in if_free() and if_vmove(), as well as when
releasing a held index in if_alloc().

Reviewed by: bz
MFC after: 3 days

15 years agoDon't try to mmap the contents of empty files. This behaviour was harmless
cperciva [Wed, 26 Aug 2009 03:30:06 +0000 (03:30 +0000)]
Don't try to mmap the contents of empty files.  This behaviour was harmless
prior to r195693, since historical behaviour of mmap(2) was to silently
ignore length-zero mmap requests; but mmap now returns EINVAL, which caused
look(1) to emit an error message and fail.

Among other things, this makes `freebsd-update fetch` on a newly installed
8.0-BETA3 system print bogus warning messages.

MFC after: 3 days

15 years agoFix poll() on half-closed sockets, while retaining POLLHUP for fifos.
jilles [Tue, 25 Aug 2009 21:44:14 +0000 (21:44 +0000)]
Fix poll() on half-closed sockets, while retaining POLLHUP for fifos.

This reverts part of r196460, so that sockets only return POLLHUP if both
directions are closed/error. Fifos get POLLHUP by closing the unused
direction immediately after creating the sockets.

The tools/regression/poll/*poll.c tests now pass except for two other things:
- if POLLHUP is returned, POLLIN is always returned as well instead of only
  when there is data left in the buffer to be read
- fifo old/new reader distinction does not work the way POSIX specs it

Reviewed by: kib, bde

15 years ago- Use the headers from ACPI-CA to define various constants and structures
jhb [Tue, 25 Aug 2009 20:35:57 +0000 (20:35 +0000)]
- Use the headers from ACPI-CA to define various constants and structures
  for table layouts, etc. rather than homerolling our own structures and
  constants in acpidump.h.
- Verify the extended checksum on the RSDP.
- Handle new ACPI 3.0 fields in MADT including X2APIC entries and
  UIDs for local SAPICs.
- Add handling for new ACPI 3.0 flags in the FADT.

Reviewed by: jkim
MFC after: 1 month

15 years agoAdd some tests for poll(2)/shutdown(2) interaction.
jilles [Tue, 25 Aug 2009 20:33:37 +0000 (20:33 +0000)]
Add some tests for poll(2)/shutdown(2) interaction.

15 years agoBreak out allocation of new ifindex values from if_alloc() and if_vmove(),
rwatson [Tue, 25 Aug 2009 20:21:16 +0000 (20:21 +0000)]
Break out allocation of new ifindex values from if_alloc() and if_vmove(),
and centralize in a single function ifindex_alloc().  Assert the
IFNET_WLOCK, and add missing IFNET_WLOCK in if_alloc().  This does not
close all known races in this code.

Reviewed by: bz
MFC after: 3 days

15 years agoLocalize 'e'.
delphij [Tue, 25 Aug 2009 20:05:51 +0000 (20:05 +0000)]
Localize 'e'.

Submitted by: dougb

15 years agoFix argument ordering to memcpy as well as the size of the copy in the
mlaier [Tue, 25 Aug 2009 19:30:32 +0000 (19:30 +0000)]
Fix argument ordering to memcpy as well as the size of the copy in the
(theoretical) case that pfi_buffer_cnt should be greater than ~_max.

Submitted by: pjd
Reviewed by: {krw,sthen,markus}@openbsd.org
MFC after: 3 days

15 years agoAdd a new rc.d script, static_arp, which enables the administrator to
delphij [Tue, 25 Aug 2009 19:07:26 +0000 (19:07 +0000)]
Add a new rc.d script, static_arp, which enables the administrator to
statically bind IPv4 <-> MAC address at boot time.

In order to use this, the administrator needs to configure the following
rc.conf(5) variable:

 - static_arp_pairs: A list of names for static bind pairs, and,
 - a series of static_arp_(name): the arguments that is being passed to
   ``arp -S'' operation.

Example:
  static_arp_pairs="gw"
  static_arp_gw="192.168.1.1 00:01:02:03:04:05"

See the rc.conf(5) manual page for more details.

Reviewed by: -rc@
MFC after: 2 weeks

15 years agoIt is possible for all the kthreads to exit (hci modules unloaded) which in
thompsa [Tue, 25 Aug 2009 16:59:55 +0000 (16:59 +0000)]
It is possible for all the kthreads to exit (hci modules unloaded) which in
turn ends our usb process. This means the proc pointer becomes invalid and will
panic if a new kthread is added. Count the number of threads and clear the proc
pointer on the last one.

Suggested by: julian
MFC after: 3 days

15 years agoFix build broken in r196524.
glebius [Tue, 25 Aug 2009 14:08:33 +0000 (14:08 +0000)]
Fix build broken in r196524.

15 years agoIntroduce SheevaPlug support.
raj [Tue, 25 Aug 2009 10:09:25 +0000 (10:09 +0000)]
Introduce SheevaPlug support.

  - The device is based on Marvell 88F6281 system on chip.
  - More info about the platform at http://www.plugcomputer.org

  - To build the FreeBSD kernel:
    make buildkernel TARGET_ARCH=arm KERNCONF=SHEEVAPLUG

  - Installation notes at: http://wiki.freebsd.org/FreeBSDMarvell

Submitted by: Michal Hajduk
Obtained from: Semihalf

15 years agoUse locks specific to the lltable code, rather than borrow the ifnet
rwatson [Tue, 25 Aug 2009 09:52:38 +0000 (09:52 +0000)]
Use locks specific to the lltable code, rather than borrow the ifnet
list/index locks, to protect link layer address tables.  This avoids
lock order issues during interface teardown, but maintains the bug that
sysctl copy routines may be called while a non-sleepable lock is held.

Reviewed by: bz, kmacy
MFC after: 3 days

15 years agoIntroduce MII_ADDR_BASE option on ARM, which allows to override the default
raj [Tue, 25 Aug 2009 09:47:12 +0000 (09:47 +0000)]
Introduce MII_ADDR_BASE option on ARM, which allows to override the default
per platform requirements.

Notes:
- Only used by mge(4) at the moment.

- This is very simplified approach and should be replaced by some long-term
  solution for managing the board/platform configuration (among others the
  MAC-PHY binding info).

Submitted by: Michal Hajduk
Obtained from: Semihalf

15 years agoExclude common Kirkwood settings so they can be shared among various platforms
raj [Tue, 25 Aug 2009 09:39:11 +0000 (09:39 +0000)]
Exclude common Kirkwood settings so they can be shared among various platforms
based on this SOC. This is a preliminary step for SheevaPlug support.

Submitted by: Michal Hajduk
Obtained from: Semihalf

15 years agoProperly handle initial state of power mgmt.
raj [Tue, 25 Aug 2009 09:35:50 +0000 (09:35 +0000)]
Properly handle initial state of power mgmt.

Modules on Marvell SOC can be selectively PM-disabled, and we must not access
disabled devices' registers (attempt to initialize them) unconditionally, as
this leads to the system hang. This patch introduces graceful handling of the
PM state during devices init.

Submitted by: Michal Hajduk
Obtained from: Semihalf

15 years agoEliminate platform_pmap_init() to simplify Marvell bootstrap code.
raj [Tue, 25 Aug 2009 09:30:03 +0000 (09:30 +0000)]
Eliminate platform_pmap_init() to simplify Marvell bootstrap code.

15 years agoDocument that ppp handles pipe(2) descriptors specially in -direct mode.
brian [Tue, 25 Aug 2009 07:52:09 +0000 (07:52 +0000)]
Document that ppp handles pipe(2) descriptors specially in -direct mode.

MFC after: 3 days

15 years agoRather than havnig enabled/disabled, implement a max queue depth.
imp [Tue, 25 Aug 2009 06:25:59 +0000 (06:25 +0000)]
Rather than havnig enabled/disabled, implement a max queue depth.
While usually not an issue, this firewalls bugs in the code that may
run us out of memory.

Fix a memory exhaustion in the case where devctl was disabled, but the
link was bouncing.  The check to queue was in the wrong place.

Implement a new sysctl hw.bus.devctl_queue to control the depth.  Make
compatibility hacks for hw.bus.devctl_disable to ease transition.

Reviewed by: emaste@
Approved by: re@ (kib)
MFC after: asap

15 years ago- Add a SIGINFO handler for savecore.
lulf [Tue, 25 Aug 2009 06:21:45 +0000 (06:21 +0000)]
- Add a SIGINFO handler for savecore.

15 years agoANSIfy functions declarations, adjust prototypes. Rename local variable
charnier [Tue, 25 Aug 2009 04:09:09 +0000 (04:09 +0000)]
ANSIfy functions declarations, adjust prototypes. Rename local variable
to not conflict with err().

15 years agoAdd a missing .El.
delphij [Tue, 25 Aug 2009 01:04:15 +0000 (01:04 +0000)]
Add a missing .El.

Founded by: make manlint

15 years agoConsider flag == 0 as the same of flag == R_NEXT. This change will restore
delphij [Mon, 24 Aug 2009 23:44:07 +0000 (23:44 +0000)]
Consider flag == 0 as the same of flag == R_NEXT.  This change will restore
a historical behavior that has been changed by revision 190491, and has seen
to break exim.

15 years agoFix VESA modes and allow 8bit depth modes.
delphij [Mon, 24 Aug 2009 22:35:53 +0000 (22:35 +0000)]
Fix VESA modes and allow 8bit depth modes.

PR: i386/124902
Submitted by: paradox <ddkprog yahoo com>
MFC after: 2 months

15 years agoImprove the case test to detect the presence of lo0 in the list of
dougb [Mon, 24 Aug 2009 22:05:08 +0000 (22:05 +0000)]
Improve the case test to detect the presence of lo0 in the list of
network_interfaces.

Submitted by: Christoph Mallon <christoph.mallon@gmx.de>

15 years agoInvoke the recently added mm-mtree.sh release script to store a pre-built
jhb [Mon, 24 Aug 2009 21:56:41 +0000 (21:56 +0000)]
Invoke the recently added mm-mtree.sh release script to store a pre-built
mergemaster mtree database in the 'base' dist.

MFC after: 3 days

15 years agoFix a few issues with the lib32 dist so that it includes ldd32.
jhb [Mon, 24 Aug 2009 21:55:43 +0000 (21:55 +0000)]
Fix a few issues with the lib32 dist so that it includes ldd32.
- Use a better find invocation to purge empty directories from all the dist
  trees during a release build.  The previous version did not purge
  directories whose contents were all empty directories.
- Explicitly blacklist a few files from the lib32 dist instead of using a
  whitelist.  A better longterm solution is to fix the few offenders to not
  install data files during a lib32 install.

MFC after: 3 days

15 years agoTweak the way that the ACPI and ISA bus drivers match hint devices to
jhb [Mon, 24 Aug 2009 21:51:46 +0000 (21:51 +0000)]
Tweak the way that the ACPI and ISA bus drivers match hint devices to
BIOS-enumerated devices:
- Assume a device is a match if the memory and I/O ports match even if the
  IRQ or DRQ is wrong or missing.  Some BIOSes don't include an IRQ for
  the atrtc device for example.
- Add a hack to better match floppy controller devices.  Many BIOSes do not
  include the starting port of the floppy controller listed in the hints
  (0x3f0) in the resources for the device.  So far, however, all the BIOS
  variations encountered do include the 'port + 2' resource (0x3f2), so
  adjust the matching for "fdc" devices to look for 'port + 2'.

Reviewed by: imp
MFC after: 3 days

15 years agoWhen bridging LRO is causing a problem, the believe
jfv [Mon, 24 Aug 2009 21:04:51 +0000 (21:04 +0000)]
When bridging LRO is causing a problem, the believe
that it would work as long as all interfaces have TSO
seems to be false, until the matter gets sorted out
just disable LRO completely.

15 years agoA couple of changes: first, make header split on by default
jfv [Mon, 24 Aug 2009 20:41:51 +0000 (20:41 +0000)]
A couple of changes:  first, make header split on by default
and remove from its dependency on LRO, my tests have shown
that its always beneficial, even when doing bridging.
Second, fix up a few problems in the statistics code, the
adapter dependencies had gotten lost so some code that should
only run on 82599 was always running, this resulted in bogus
flow control numbers on 82598.

15 years agoDon't try to power down PHY when alc(4) failed to map the device.
yongari [Mon, 24 Aug 2009 20:37:15 +0000 (20:37 +0000)]
Don't try to power down PHY when alc(4) failed to map the device.
This fixes system crash when mapping alc(4) device failed in device
attach.

Reported by: Jim < stapleton.41 <> gmail DOT com >
MFC after: 3 days

15 years agoAdd RTL8168DP/RTL8111DP device id. While I'm here append "8111D" to
yongari [Mon, 24 Aug 2009 18:58:13 +0000 (18:58 +0000)]
Add RTL8168DP/RTL8111DP device id. While I'm here append "8111D" to
the description of RTL8168D as RL_HWREV_8168D can be either
RTL8168D or RTL8111D.

PR: kern/137672
MFC after: 3 days

15 years agoUpdate example for RELENG_8.
kensmith [Mon, 24 Aug 2009 18:43:22 +0000 (18:43 +0000)]
Update example for RELENG_8.

15 years agoWhen ``ppp -direct'' is invoked by a program that uses pipe(2) to
brian [Mon, 24 Aug 2009 17:19:45 +0000 (17:19 +0000)]
When ``ppp -direct'' is invoked by a program that uses pipe(2) to
create stdin and stdout, don't blindly try to use stdin as a bi-directional
channel.  Instead, detect the pipe and set up a special exec handler
that indirects write() calls through stdout.

This fixes the problem where ``set device "!ssh -e none host ppp
-direct label"'' no longer works with an openssh-5.2 server side as
that version of openssh ignores the USE_PIPES config setting and
*always* uses pipes (rather than socketpair) for stdin/stdout channels.

MFC after: 3 days

15 years agoWhen realloc()ing device memory for transfer to another ppp process,
brian [Mon, 24 Aug 2009 17:18:17 +0000 (17:18 +0000)]
When realloc()ing device memory for transfer to another ppp process,
don't continue to use the realloc()d pointer - it might have changed!

Remove some stray diagnostics while I'm here.

MFC after: 3 days

15 years agoFix handling of .note.ABI-tag section for GNU systems [1].
bz [Mon, 24 Aug 2009 16:19:47 +0000 (16:19 +0000)]
Fix handling of .note.ABI-tag section for GNU systems [1].
Handle GNU/Linux according to LSB Core Specification 4.0,
Chapter 11. Object Format, 11.8. ABI note tag.

Also check the first word of desc, not only name, according to
glibc abi-tags specification to distinguish between Linux and
kFreeBSD.

Add explicit handling for Debian GNU/kFreeBSD, which runs
on our kernels as well [2].

In {amd64,i386}/trap.c, when checking osrel of the current process,
also check the ABI to not change the signal behaviour for Linux
binary processes, now that we save an osrel version for all three
from the lists above in struct proc [2].

These changes make it possible to run FreeBSD, Debian GNU/kFreeBSD
and Linux binaries on the same machine again for at least i386 and
amd64, and no longer break kFreeBSD which was detected as GNU(/Linux).

PR: kern/135468
Submitted by: dchagin [1] (initial patch)
Suggested by: kib [2]
Tested by: Petr Salinger (Petr.Salinger seznam.cz) for kFreeBSD
Reviewed by: kib
MFC after: 3 days

15 years ago- Update config to doxygen 1.5.2 (I use this with 1.5.9).
netchild [Mon, 24 Aug 2009 13:10:55 +0000 (13:10 +0000)]
- Update config to doxygen 1.5.2 (I use this with 1.5.9).
- Add linprocfs and linsysfs to the linuxulator dox.
- Take the generated includes from the .m files from a subdirectory
  instead of putting everything into $(.OBJDIR). This imporves the
  human readbility of the source directory contents a lot, if you do not
  create a separate OBJDIR.
- Assume UTF-8 encoding for every input file.
- Strip the source and dest path from the output, we are not interested
  in the absolute location on the machine where the docs are created,
  relative the the root of the FreeBSD source is what interests us.
- Exclude .svn directories.
- Switch to alphabetic index.
- Use one line per INCLUDE_PATH member in the common dox-config.
- Bump the __FreeBSD__ version to 9. [MFC: to 8]
- Switch from hardcoded .m files to an run-time generated one. Takes
  a little bit more time to get started with actual work, but at least
  is more future-proof. If you generate dox for all subsystems, the
  time to find all .m files in the source is magnitutes lower than
  producing the docs.
- Make the *DEST_PATH overidable from the environment. This allows to
  produce the output directly in the docroot of a webserver.
- Fix the path when telling the user where he can find the API docs.

MFC after: 1 month (after 8.0)

15 years agoMake if_grow static -- it's not used outside of if.c, and with the
rwatson [Mon, 24 Aug 2009 12:52:05 +0000 (12:52 +0000)]
Make if_grow static -- it's not used outside of if.c, and with the
internals destined to change, it's better if it remains that way.

MFC after: 3 days

15 years agoThis fixes a bug where the value set by SCTP_PARTIAL_DELIVERY_POINT
tuexen [Mon, 24 Aug 2009 11:46:40 +0000 (11:46 +0000)]
This fixes a bug where the value set by SCTP_PARTIAL_DELIVERY_POINT
was not honored, if the socket buffer size was not 4 times that large.

Approved by: rrs (mentor)
MFC after: 3 days.

15 years agoOur implementation of granpt(3) could be valid in the future.
ed [Mon, 24 Aug 2009 11:16:44 +0000 (11:16 +0000)]
Our implementation of granpt(3) could be valid in the future.

When I wrote the pseudo-terminal driver for the MPSAFE TTY code, Robert
Watson and I agreed the best way to implement this, would be to let
posix_openpt() create a pseudo-terminal with proper permissions in place
and let grantpt() and unlockpt() be no-ops.

This isn't valid behaviour when looking at the spec. Because I thought
it was an elegant solution, I filed a bug report at the Austin Group
about this. In their last teleconference, they agreed on this subject.
This means that future revisions of POSIX may allow grantpt() and
unlockpt() to be no-ops if an open() on /dev/ptmx (if the implementation
has such a device) and posix_openpt() already do the right thing.

I'd rather put this in the manpage, because simply mentioning we don't
comply to any standard makes it look worse than it is. Right now we
don't, but at least we took care of it.

Approved by: re (kib)
MFC after: 3 days

15 years agoThis fixes two bugs in the NR-Sack code:
rrs [Mon, 24 Aug 2009 11:13:32 +0000 (11:13 +0000)]
This fixes two bugs in the NR-Sack code:
 1) When calculating the table offset for sliding the sack
    array, the two byte values must be "ored" together in order
    for us to do the correct sliding of the arrays.
 2) We were NOT properly doing CC and other changes to things only
    NR-Sacked. The solution here is to make a separate function that
    will actually do both CC/updates and free things if its NR sack'd.
    This actually shrinks out common code from three places (much better).

MFC after: 3 days

15 years agoAllow multiple console devices per driver without insane code duplication.
ed [Mon, 24 Aug 2009 10:53:30 +0000 (10:53 +0000)]
Allow multiple console devices per driver without insane code duplication.

Say, a driver wants to have multiple console devices to pick from, you
would normally write down something like this:

CONSOLE_DRIVER(dev1);
CONSOLE_DRIVER(dev2);

Unfortunately, this means that you have to declare 10 cn routines,
instead of 5. It also isn't possible to initialize cn_arg on beforehand.

I noticed this restriction when I was implementing some of the console
bits for my vt(4) driver in my newcons branch. I have a single set of cn
routines (termcn_*) which are shared by all vt(4) console devices.

In order to solve this, I'm adding a separate consdev_ops structure,
which contains all the function pointers. This structure is referenced
through consdev's cn_ops field.

While there, I'm removing CONS_DRIVER() and cn_checkc, which have been
deprecated for years. They weren't used throughout the source, until the
Xen console driver showed up. CONSOLE_DRIVER() has been changed to do
the right thing. It now declares both the consdev and consdev_ops
structure and ties them together. In other words: this change doesn't
change the KPI for drivers that used the regular way of declaring
console devices.

If drivers want to use multiple console devices, they can do this as
follows:

static const struct consdev_ops mydriver_cnops = {
.cn_probe = mydriver_cnprobe,
...
};
static struct mydriver_softc cons0_softc = {
...
};
CONSOLE_DEVICE(cons0, mydriver_cnops, &cons0_softc);
static struct mydriver_softc cons1_softc = {
...
};
CONSOLE_DEVICE(cons1, mydriver_cnops, &cons1_softc);

Obtained from: //depot/user/ed/newcons/...

15 years agoWhen "jail -c vnet" request fails, the current code actually creates and
zec [Mon, 24 Aug 2009 10:16:19 +0000 (10:16 +0000)]
When "jail -c vnet" request fails, the current code actually creates and
leaves behind an orphaned vnet.  This change ensures that such vnets get
released.

This change affects only options VIMAGE builds.

Submitted by: jamie
Discussed with: bz
Approved by: re (rwatson), julian (mentor)
MFC after: 3 days

15 years agoWhen moving ifnets from one vnet to another, and the ifnet
zec [Mon, 24 Aug 2009 10:14:09 +0000 (10:14 +0000)]
When moving ifnets from one vnet to another, and the ifnet
has ifaddresses of AF_LINK type which thus have an embedded
if_index "backpointer", we must update that if_index backpointer
to reflect the new if_index that our ifnet just got assigned.

This change affects only options VIMAGE builds.

Submitted by: bz
Reviewed by: bz
Approved by: re (rwatson), julian (mentor)

15 years agoFix NFS panics with options VIMAGE kernels by apropriately setting curvnet
zec [Mon, 24 Aug 2009 10:09:30 +0000 (10:09 +0000)]
Fix NFS panics with options VIMAGE kernels by apropriately setting curvnet
context inside the RPC code.

Temporarily set td's cred to mount's cred before calling socreate() via
__rpc_nconf2socket().

Submitted by: rmacklem (in part)
Reviewed by: rmacklem, rwatson
Discussed with: dfr, bz
Approved by: re (rwatson), julian (mentor)
MFC after: 3 days

15 years agoIntroduce a div_destroy() function which takes over per-vnet cleanup tasks
zec [Mon, 24 Aug 2009 10:06:02 +0000 (10:06 +0000)]
Introduce a div_destroy() function which takes over per-vnet cleanup tasks
from the existing modevent / MOD_UNLOAD handler, and register div_destroy()
in protosw as per-vnet .pr_destroy() handler for options VIMAGE builds.  In
nooptions VIMAGE builds, div_destroy() will be invoked from the modevent
handler, resulting in effectively identical operation as it was prior this
change.  div_destroy() also tears down hashtables used by ipdivert, which
were previously left behind on ipdivert kldunloads.

For options VIMAGE builds only, temporarily disable kldunloading of ipdivert,
because without introducing additional locking logic it is impossible to
atomically check whether all ipdivert instances in all vnets are idle, and
proceed with cleanup without opening a race window for a vnet to open an
ipdivert socket while ipdivert tear-down is in progress.

While here, staticize div_init(), because it is not used outside of
ip_divert.c.

In cooperation with: julian
Approved by: re (rwatson), julian (mentor)
MFC after: 3 days

15 years agoWhen registering a protocol to an existing protocol domain via
zec [Mon, 24 Aug 2009 10:03:41 +0000 (10:03 +0000)]
When registering a protocol to an existing protocol domain via
pf_proto_register(), iterate over all existing vnets to call protosw_init()
and thus the appropriate .pr_init() handler in the context of each vnet.
NB in the future we probably want to separate pr_init() handlers into
two, i.e. per-vnet and global, functions.

This change has no impact on nooptions VIMAGE builds.

Approved by: re (rwatson), julian (mentor)
MFC after: 3 days

15 years agoUnhardcode 0x100 inside kbdcontrol.
ed [Mon, 24 Aug 2009 09:17:01 +0000 (09:17 +0000)]
Unhardcode 0x100 inside kbdcontrol.

In preparation for Unicode support for the keyboard layer, we'd better
get rid of all the hardcoded 0x100/0xff constants in kbdcontrol.
Instead, add a flag called SPECIAL stored in the top bit of the integer.

Adding Unicode support is very simple now; just change u_char map[] to
u_int map[] in keyent_t, change the bounds checking in kbdcontrol to
0x1FFFFF and modify the ioctls to allow loading these new keymaps.

15 years agoCleanups to the Xen console driver:
ed [Mon, 24 Aug 2009 08:27:42 +0000 (08:27 +0000)]
Cleanups to the Xen console driver:

- Use CONSOLE_DRIVER() instead of the deprecated CONS_DRIVER() declaration.

- This means we cannot use cn_checkc anymore, which is supposed to do
  the same as cn_getc nowadays. Remove the cn_getc implementation (that
  was never being called) and rename cn_checkc to cn_getc.

- Don't run-time patch cn_putc, but add the logic to xc_cnputc().

This means I could do some cleanups to our console code...

Tested by: nobody on hackers@

15 years ago - Patch to allow USB controller to resume operation after
alfred [Mon, 24 Aug 2009 05:05:38 +0000 (05:05 +0000)]
     - Patch to allow USB controller to resume operation after
         being polled.

         - Remove the need for Giant from the USB HUB driver.

         - Leave device unconfigured instead of disabling the USB port
           when Huawei Autoinstall disk detection triggers. This should
           fix problems that the Huawei device is not detected after
           Autoinstall eject is issued.
         - Reported by: Nikolay Antsiferov

         - Fix memory use after free race for USB character devices.
         - Reported by: Lucius Windschuh

         - Factor out the enumeration lock into three functions to make the
         coming newbus lock conversion more easy.
          - usbd_enum_lock
          - usbd_enum_unlock
          - usbd_enum_is_locked

Submitted by: hps

15 years agoRemove redundant locking.
alfred [Mon, 24 Aug 2009 05:03:59 +0000 (05:03 +0000)]
Remove redundant locking.

Submitted by: hps

15 years agoAdd a reminder comment to optimize bus_dmamap_sync calls.
alfred [Mon, 24 Aug 2009 05:03:30 +0000 (05:03 +0000)]
Add a reminder comment to optimize bus_dmamap_sync calls.

Submitted by: hps

15 years agoAdd mass storage quirks.
alfred [Mon, 24 Aug 2009 05:02:36 +0000 (05:02 +0000)]
Add mass storage quirks.

PR:             usb/137138,usb/137226,usb/137789,usb/135372

Submitted by: hps

15 years ago - fix uvisor support, mostly correct buffer sizes used.
alfred [Mon, 24 Aug 2009 05:01:40 +0000 (05:01 +0000)]
     - fix uvisor support, mostly correct buffer sizes used.
         - correct device info flag for SONY Cli NR70V

Reported by: Marc Fonvieille
Submitted by: hps

15 years ago - Fix false positive uipaq probe
alfred [Mon, 24 Aug 2009 05:01:06 +0000 (05:01 +0000)]
     - Fix false positive uipaq probe

Reported by: Alexander Motin <mav@freebsd.org>

Submitted by: hps

15 years ago - fix CDC ethernet matching order so that the match flags get correct.
alfred [Mon, 24 Aug 2009 05:00:33 +0000 (05:00 +0000)]
     - fix CDC ethernet matching order so that the match flags get correct.

Reported by: Juergen Lock

Submitted by: hps

15 years agoWe used force all of the GPIO pins low first and then
alfred [Mon, 24 Aug 2009 05:00:07 +0000 (05:00 +0000)]
We used force all of the GPIO pins low first and then
enable the ones we want. This has been changed to better
match the ADMtek's reference design to avoid setting the
power-down configuration line of the PHY at the same time
it is reset.

Submitted by: John Hood via hps

15 years ago - FIFO's are always opened separately in read and write
alfred [Mon, 24 Aug 2009 04:59:09 +0000 (04:59 +0000)]
    - FIFO's are always opened separately in read and write
        direction even if the actual device is opened for read and
        write. Fix fflags check so that the UFM and URIO drivers work.
Reported by: Krassimir Slavchev

Submitted by: hps

15 years ago - patch for cordump slowdown. Avoid using DELAY(1000) when no
alfred [Mon, 24 Aug 2009 04:58:42 +0000 (04:58 +0000)]
    - patch for cordump slowdown. Avoid using DELAY(1000) when no
        keys are pressed.
        - Reported by: Various people

        - add sysctl to disable keyboard led control request
        - Reported by: Yoshihiro Ota

        - Save system CPU usage: Patch to stop keyboard timer when no
        keys are pressed.

Submitted by: hps
MFC after: 3 days

15 years ago - allow disabling "root_mount_hold()" by
alfred [Mon, 24 Aug 2009 04:58:11 +0000 (04:58 +0000)]
    - allow disabling "root_mount_hold()" by
        setting a sysctl/tunable at boot
        - remove some redundant initial explore code

Submitted by: hps

15 years agoRemove redundant Giant reference. Giant will be dropped
alfred [Mon, 24 Aug 2009 04:57:48 +0000 (04:57 +0000)]
Remove redundant Giant reference. Giant will be dropped
automatically when the mutex argument is NULL.

Reported by: Various people
Submitted by: hps

15 years agoOops. Needed to adjust a little bit more of the line for packages-8-stable
kensmith [Mon, 24 Aug 2009 03:04:13 +0000 (03:04 +0000)]
Oops.  Needed to adjust a little bit more of the line for packages-8-stable
now that we're prepping for 8.0's release.

Submitted by: pluknet at gmail dot com
Pointy hat: kensmith

15 years agoKDB needs <machine/db_machdep.h>, so move it under #ifdef KDB.
cognet [Sun, 23 Aug 2009 23:37:53 +0000 (23:37 +0000)]
KDB needs <machine/db_machdep.h>, so move it under #ifdef KDB.
While I'm there, remove dead code, we will never support acorn26.

15 years agosh: Fix crash when undefining or redefining a currently executing function.
jilles [Sun, 23 Aug 2009 21:09:46 +0000 (21:09 +0000)]
sh: Fix crash when undefining or redefining a currently executing function.

Add a reference count to function definitions.
Memory may leak if multiple SIGINTs arrive in interactive mode,
this will be fixed later by changing SIGINT handling.

PR: bin/137640

15 years agoRather than using IFNET_RLOCK() when iterating over (and modifying) the
rwatson [Sun, 23 Aug 2009 21:00:21 +0000 (21:00 +0000)]
Rather than using IFNET_RLOCK() when iterating over (and modifying) the
ifnet list during if_ef load, directly acquire the ifnet_sxlock
exclusively.  That way when if_alloc() recurses the lock, it's a write
recursion rather than a read->write recursion.

This code structure is arguably a bug, so add a comment indicating that
this is the case.  Post-8.0, we should fix this, but this commit
resolves panic-on-load for if_ef.

Discussed with: bz, julian
Reported by: phk
MFC after: 3 days

15 years agoRework global locks for interface list and index management, correcting
rwatson [Sun, 23 Aug 2009 20:40:19 +0000 (20:40 +0000)]
Rework global locks for interface list and index management, correcting
several critical bugs, including race conditions and lock order issues:

Replace the single rwlock, ifnet_lock, with two locks, an rwlock and an
sxlock.  Either can be held to stablize the lists and indexes, but both
are required to write.  This allows the list to be held stable in both
network interrupt contexts and sleepable user threads across sleeping
memory allocations or device driver interactions.  As before, writes to
the interface list must occur from sleepable contexts.

Reviewed by: bz, julian
MFC after: 3 days

15 years agoAllow pty(4) to be loaded as a kld.
ed [Sun, 23 Aug 2009 20:26:09 +0000 (20:26 +0000)]
Allow pty(4) to be loaded as a kld.

Unfortunately, the wrappers that are present in pts(4) don't have the
mechanics to allow pty(4) to be unloaded safely, so I'm forcing this kld
to return EBUSY. This also means we have to enable some extra code in
pts(4) unconditionally.

Proposed by: rwatson

15 years agoNo need to remove the same flag multiple times.
cognet [Sun, 23 Aug 2009 19:54:36 +0000 (19:54 +0000)]
No need to remove the same flag multiple times.

15 years agoPrior to the dire warning about values of network_interfaces other than
dougb [Sun, 23 Aug 2009 19:52:47 +0000 (19:52 +0000)]
Prior to the dire warning about values of network_interfaces other than
AUTO the biggest mistake users made was leaving lo0 off the list. Since
lo0 is effectively mandatory, check for it and add it to the list if
it's not there.

15 years agoObsoleteFiles.inc:
antoine [Sun, 23 Aug 2009 18:28:58 +0000 (18:28 +0000)]
ObsoleteFiles.inc:
  kthread_create(9) was resurrected as a mlink to kproc(9)

15 years agoRemove (c) line.
ivoras [Sun, 23 Aug 2009 18:15:13 +0000 (18:15 +0000)]
Remove (c) line.

Requested by: pjd
Approved by: gnn (mentor)
MFC after: 1 month

15 years ago- Add AS lookup functionality to traceroute6(8) as well.
ume [Sun, 23 Aug 2009 17:00:16 +0000 (17:00 +0000)]
- Add AS lookup functionality to traceroute6(8) as well.
- Support for IPv6 transport for AS lookup.
- Introduce $RA_SERVER to set whois server.
- Support for 4 byte ASN.
- ANSIfy function declaration in as.c.

Tested by: IHANet folks.

15 years agoMerge DTLS fixes from vendor-crypto/openssl/dist:
simon [Sun, 23 Aug 2009 16:29:47 +0000 (16:29 +0000)]
Merge DTLS fixes from vendor-crypto/openssl/dist:

- Fix memory consumption bug with "future epoch" DTLS records.
- Fix fragment handling memory leak.
- Do not access freed data structure.
- Fix DTLS fragment bug - out-of-sequence message handling which could
  result in NULL pointer dereference in
  dtls1_process_out_of_seq_message().

Note that this will not get FreeBSD Security Advisory as DTLS is
experimental in OpenSSL.

MFC after: 1 week
Security: CVE-2009-1377 CVE-2009-1378 CVE-2009-1379 CVE-2009-1387

15 years agoEnable _DIRENT_HAVE_D_TYPE so wpa_cli scans directories properly
sam [Sun, 23 Aug 2009 16:04:10 +0000 (16:04 +0000)]
Enable _DIRENT_HAVE_D_TYPE so wpa_cli scans directories properly
for it's unix domain socket.  Before this change wpa_cli would take
the first file in the directory that was not "." or "..".

Submitted by: Brandon Gooch <jamesbrandongooch@gmail.com>
MFC after: 3 days

15 years agoAdd GET_PARAM support for Z pipes.
rnoland [Sun, 23 Aug 2009 15:02:58 +0000 (15:02 +0000)]
Add GET_PARAM support for Z pipes.

This is needed for occulsion queries on rv530 chips.

MFC after: 2 weeks