rse [Sat, 5 Aug 2006 12:50:38 +0000 (12:50 +0000)]
Do not pass-through the tailing newline character from the ctime(3)
output to setproctitle(3) in order to get rid of the ugly two-character
escape sequence "\n" in the ps(1) output of a dump(8) process:
<< [...] finished in 0:00 at Sat Aug 5 14:44:39 2006\n (dump)
>> [...] finished in 0:00 at Sat Aug 5 14:44:39 2006 (dump)
Add OpenSolaris compatibility definitions for stat64 and fstat64 which
are only visible if _SOLARIS_C_SOURCE is defined.
Note thar FreeBSD stat() and fstat() are 64-bit functions now and Solaris
still persists with both 32- and 64-bit versions. When I query this, I am
referred to: <http://www.unix.org/version2/whatsnew/lfs20mar.html>.
But when you look at the main page of unix.org you will see that the
Single Unix Specification <http://www.unix.org/version3/> is the most
recent standard they are pushing. And there are no stat64() fstat64()
functions defined there. I guess this just goes to prove that there are so
many standards, you can take your pick.
Add a type definition for the cyclic timer callback function.
The cyclic timer is a high-resolution timer allows timeouts at nanosecond
intervals where hardware support is available. Typically on i386 there
is no HPET (high performance event timer) like the one Intel started
specifying some time in 2004, so the best that tye cyclic timer subsystem
can do is run at Hz.
The cyclic timer code itself is ported from OpenSolaris and is covered
by the CDDL, so it is only loaded as a module. This function type definition
is used in machine-dependent code to provide a hook for the module to
register it's callback function.
Add some OpenSolaris compatibility definitions which are only visible
if _SOLARIS_C_SOURCE is defined.
Add two function prototypes which are required to feed high-resolution
times to DTrace. DTrace requires it's own functions with the dtrace_
prefix so that it knows not to try and trace them. This is a rule that
code executed from the DTrace probe context must obey.
The two functions are only be compiled if the KDTRACE option is defined
to compile in kernel support for loading the DTrace modules.
Add some compatibility definitions for OpenSolaris source.
These are only defined if _SOLARIS_C_SOURCE is defined, so they don't
polute the FreeBSD compile environment.
They are used all over the OpenSolaris source, so defining them here
removes the need to continually resolve differences in FreeBSD system
haeder files from Solaris header files.
marcel [Fri, 4 Aug 2006 21:28:42 +0000 (21:28 +0000)]
Fix (static) buffer overflow bug. The dest buffer is of size MAXPATHLEN,
so dest[MAXPATHLEN] falls outside the buffer. This bug corrupted
arenas[0] defined in libc's malloc.c on PowerPC when kldxref is shared,
which triggered a delayed SIGSERV.
brooks [Fri, 4 Aug 2006 21:27:40 +0000 (21:27 +0000)]
With exception of the if_name() macro, all definitions in net_osdep.h
were unused or already in if_var.h so add if_name() to if_var.h and
remove net_osdep.h along with all references to it.
Longer term we may want to kill off if_name() entierly since all modern
BSDs have if_xname variables rendering it unnecessicary.
mjacob [Fri, 4 Aug 2006 20:20:00 +0000 (20:20 +0000)]
Fix na_fcentry_t to not have a lun field. Fix indentation in handly
the notify structs. Fix messages in isp_got_msg_fc to print out the
loop id of the sender- not the wwpn which will be synthesized later,
if possible, in the outer layers. Put in debug printouts to pair
a notify ack to a notify so one can see the start/close of an
immediate notify event. Put in spsace for TASK MANAGEMENT response
flags (which we don't do yet).
ume [Fri, 4 Aug 2006 12:26:07 +0000 (12:26 +0000)]
Check if the filedes of kevent is expected one. Though our
old resolver opened just one socket, BIND9's resolver may
open more than one sockets. And, BIND9's resolver doesn't
close the socket on timeout. So, we need this check.
pdeuskar [Thu, 3 Aug 2006 19:05:04 +0000 (19:05 +0000)]
Revert back changes to made in rev 1.109 of if_em.c which were unnecessary.
This makes it easier for us to get the changes into -current and to -stable quickly.
jhb [Thu, 3 Aug 2006 15:31:52 +0000 (15:31 +0000)]
- Fix ncp_poll() to not panic if the socket doesn't have any pending data.
We have to adjust curthread's state enough so that it appears to be
in a poll(2) or select(2) call so that selrecord() will work and then
teardown that state after calling sopoll().
- Fix some minor nits in nearby ncp_sock_rselect() and in the identical
nbssn_rselect() function in the netsmb code:
- Don't call nb_poll()/ncp_poll() now that ncp_poll() already fakes up
poll(2) state since the rselect() functions already do that. Just
invoke sopoll() directly.
- To make things slightly more intuitive, store the results of sopoll()
in a new 'revents' variable rather than 'error' since that's what
sopoll() actually returns.
- If the requested timeout time has been exceeded by the time we get
ready to block, then return EWOULDBLOCK rather than 0 to signal a
timeout as this is what the calling code expects.
Tested by: Eric Christeson <eric.j.christeson AT gmail> (1)
MFC after: 1 week
yar [Thu, 3 Aug 2006 09:59:08 +0000 (09:59 +0000)]
Should vlan_input() ever be called with ifp pointing to a non-Ethernet
interface, do not just assign -1 to tag because it breaks the logic of
the code to follow. The better way is to handle this case as an unsupported
protocol and return unless INVARIANTS is in effect and we can panic.
Panic is good there because the scenario can happen only because of a
coding error elsewhere.
We also should show the interface name in the panic message for easier
debugging of the problem, should it ever emerge.
yar [Thu, 3 Aug 2006 09:50:15 +0000 (09:50 +0000)]
Back out rev. 1.107 because it introduced as many problems
as it tried to solve:
- it smuggled hidden 802.1q details into otherwise protocol-neutral code;
- it put an important code consistency check under DEBUG, which was never
defined by anyone but a developer hacking this file for the moment;
- lastly, the former bcopy() call had been correct as long as the "dead"
code was there.
(A new version of the fix for tag of -1 to come in the next commit.)
glebius [Thu, 3 Aug 2006 09:20:11 +0000 (09:20 +0000)]
Merge in new driver from Intel, version 6.0.5. It adds support for
80003 NICs and NICs found on ICH8 mobos, and improves support for
already known chips.
Details:
- if_em.c. Merged manually, viewing diff between new vendor
driver and previous one. This was an easy task, because
most changes between 5.1.5 and 6.0.5 are bugfixes taken
from FreeBSD.
- if_em_hw.h. Dropped in from vendor, and then restored
revisions 1.16, 1.17, 1.18.
- if_em_hw.c. Dropped in from vendor, and then restored
revision 1.15.
- if_em_osdep.h. Added new required macros from vendor file
and add a hack against define namespace mangling in
if_em_hw.h. Intel made another hack, but I prefer mine.
Generate another file called systrace_args.c. This will be compiled
into systrace and is used to map the syscall arguments into the 64-bit
parameter array.
Add fields to struct sysent to support the DTrace syscall provider called
systrace.
Another file called systrace_args.c is generated. This will be compiled
into systrace and is used to map the syscall arguments into the 64-bit
parameter array.
delphij [Thu, 3 Aug 2006 03:34:36 +0000 (03:34 +0000)]
In DCE 1.1, the time_low value is defined as an unsigned 32-bit
integer. Presently, our implementation employs an approach that
converts the value to int64_t, then back to int, unfortunately,
this approach can be problematic when the the difference between
the two time_low is larger than 0x7fffffff, as the value is then
truncated to int.
To quote the test case from the original PR, the following is
true with the current implementation:
This commit adds a new intermediate variable which uses int64_t
to store the result of subtraction between the two time_low values,
which would not introduce different semantic of the MSB found in
time_low value.
PR: 83107
Submitted by: Steve Sears <sjs at acm dot org>
MFC After: 1 month
rwatson [Wed, 2 Aug 2006 18:37:44 +0000 (18:37 +0000)]
Move destroying kqueue state from above pru_detach to below it in
sofree(), as a number of protocols expect to be able to call
soisdisconnected() during detach. That may not be a good assumption,
but until I'm sure if it's a good assumption or not, allow it.
jhb [Wed, 2 Aug 2006 17:41:58 +0000 (17:41 +0000)]
- Use m_getcl(), m_get(), and m_gethdr() rather than the older macros for
alloc'ing mbufs so that there is less error handling required.
- Go ahead and account for the data space in the first mbuf before entering
the loop to alloc more mbuf's. This simplifies the loop logic and avoids
confusing Coverity.
CID: 817
Reviewed by: sam
Tested by: pjd
Found by: Coverity Prevent (tm)
rwatson [Wed, 2 Aug 2006 16:22:34 +0000 (16:22 +0000)]
Remove call to soisdisconnected() in at_pcbdetach(): by the time the
socket is being detached, there are no consumers left worth notifying
about the disconnect.
rwatson [Wed, 2 Aug 2006 16:18:05 +0000 (16:18 +0000)]
Move soisdisconnected() in tcp_discardcb() to one of its calling contexts,
tcp_twstart(), but not to the other, tcp_detach(), as the socket is
already being torn down and therefore there are no listeners. This avoids
a panic if kqueue state is registered on the socket at close(), and
eliminates to XXX comments. There is one case remaining in which
tcp_discardcb() reaches up to the socket layer as part of the TCP host
cache, which would be good to avoid.
Reported by: Goran Gajic <ggajic at afrodita dot rcub dot bg dot ac dot yu>
jhb [Wed, 2 Aug 2006 15:27:48 +0000 (15:27 +0000)]
Fix some bugs in the previous revision (1.419). Don't perform extra
vfs_rel() on the mountpoint if the MAC checks fail in kern_statfs() and
kern_fstatfs(). Similarly, don't perform an extra vfs_rel() if we get
a doomed vnode in kern_fstatfs(), and handle the case of mp being NULL
(for some doomed vnodes) by conditionalizing the vfs_rel() in
kern_fstatfs() on mp != NULL.
CID: 1517
Found by: Coverity Prevent (tm) (kern_fstatfs())
Pointy hat to: jhb
rwatson [Wed, 2 Aug 2006 14:30:58 +0000 (14:30 +0000)]
Remove now unneeded ENOTCONN clause from SOCK_DGRAM side of uipc_send():
we have to check it regardless of the target address, so don't check it
twice.
bms [Wed, 2 Aug 2006 13:05:38 +0000 (13:05 +0000)]
Block a variety of signals which may afffect reboot(8), before killing
init(8), to avoid losing a race to them and dying before being able
to call reboot(2).
yongari [Wed, 2 Aug 2006 05:28:52 +0000 (05:28 +0000)]
Replace hard-coded magic constants to system defined constants
(BUS_PROBE_DEFAULT, BUS_PROBE_GENERIC etc). These pseudo PHY
drivers were forgotten from the conversion due to the repo copy
to dc driver location.
thompsa [Wed, 2 Aug 2006 02:47:27 +0000 (02:47 +0000)]
Add a callback so we can notify the parent bridge that a port state change has
occured, we need to do this from a taskqueue to avoid a LOR with the if_bridge
mutex.
rwatson [Wed, 2 Aug 2006 00:45:27 +0000 (00:45 +0000)]
Move updated of 'numopensockets' from bottom of sodealloc() to the top,
eliminating a second set of identical mutex operations at the bottom.
This allows brief exceeding of the max sockets limit, but only by
sockets in the last stages of being torn down.
sobomax [Tue, 1 Aug 2006 22:19:01 +0000 (22:19 +0000)]
Add device to access and modify Open Firmware NVRAM settings in
PowerPC-based Apple's machines and small utility to do it from
userland modelled after the similar utility in Darwin/OSX.