Peter Wemm [Thu, 20 Dec 2001 02:23:44 +0000 (02:23 +0000)]
Fix the 'nm' -> segfault bug (on the vendor branch). This has been fixed
the same way in the cygnus base source. The problem was that bfd was
writing to memory obtained from malloc(0). The next import will update
this if necessary. I'm not sure of the origins of this patch.
Matthew Dillon [Wed, 19 Dec 2001 23:58:09 +0000 (23:58 +0000)]
Pseudofs was leaking VFS cache entries badly due to its cache and use of
the wrong VOP descriptor. This misuse caused VFS-cached vnodes to be
re-cached, resulting in the leak. This commit is an interim fix until DES
has a chance to rework the code involved.
Add (unsigned char) cast to ctype macros
ftell->ftello, fseek->fseeko
File 'newsize' type int->off_t
Add visible (long) cast to fsize() when it called to small one message file and
result is assigned to long.
Warner Losh [Wed, 19 Dec 2001 19:37:31 +0000 (19:37 +0000)]
Make this driver a better citizen by moving dev creation and
other initialization into attach from probe. Also hide a few
printfs behind a bootverbose.
Bill Paul [Wed, 19 Dec 2001 18:23:45 +0000 (18:23 +0000)]
Fix the "conexant chips don't work in full duplexmode" problem. According
to Phil Kernick:
"The problem is that in full duplex mode, the Conexant chip always reports a
carrier lost error, even when the frame is successfully sent. So, if we
have a Conexant chip, then ignore carrier lost when in full duplex
mode."
Since the Xircom chips seem to have the same issue and since we already
have a workaround for this, just expand the workaround test to also
check for DC_IS_CONEXANT().
Bill Paul [Wed, 19 Dec 2001 18:13:44 +0000 (18:13 +0000)]
Fix compiler warning in dc_intr(): if the only code that does a "goto"
to a label is inside an #ifdef block, then the label should *also* be
inside an #ifdef block. Hide the "done:" label which is only used if
DEVICE_POLLING is enabled under #ifdef DEVICE_POLLING.
Orion Hodson [Wed, 19 Dec 2001 17:38:38 +0000 (17:38 +0000)]
Clear resume interrupts - these can occur during initialization and
must be cleared to prevent machine hanging (presently aflicts -current
and -stable).
Problem reported by Bruce Montague <brucem@cse.iitkgp.ernet.in>
Brian Somers [Wed, 19 Dec 2001 16:03:27 +0000 (16:03 +0000)]
Only call rt_getifa() if we've either been passed a gateway or
if we've been given an RTA_IFP or changed RTA_IFA sockaddr.
This fixes the following bug:
>/dev/tun100
>/dev/tun101
ifconfig tun100 1.2.3.4 5.6.7.8
ifconfig tun101 1.2.3.4 6.7.8.9
route change 6.7.8.9 -ifa 1.2.3.4 -iface -mtu 500
which erroneously changed tun101's host route to have an ifp of tun100
(rt_getifa() sets the ifp after calling ifa_ifwithnet(1.2.3.4))
Yaroslav Tykhiy [Wed, 19 Dec 2001 14:54:13 +0000 (14:54 +0000)]
Don't try to free a NULL route when doing IPFIREWALL_FORWARD.
An old route will be NULL at that point if a packet were initially
routed to an interface (using the IP_ROUTETOIF flag.)
Jonathan Lemon [Wed, 19 Dec 2001 06:12:14 +0000 (06:12 +0000)]
Extend the SYN DoS defense by adding syncookies to the syncache.
All TCP ISNs that are sent out are valid cookies, which allows entries
in the syncache to be dropped and still have the ACK accepted later.
As all entries pass through the syncache, there is no sudden switchover
from cache -> cookies when the cache is full; instead, syncache entries
simply have a reduced lifetime. More details may be found in the
"Resisting DoS attacks with a SYN cache" paper in the Usenix BSDCon 2002
conference proceedings.
Peter Wemm [Wed, 19 Dec 2001 01:31:12 +0000 (01:31 +0000)]
Use a different mechanism to get the vnlru process to wake up and notice
the shutdown request at reboot/halt time.
Disable the printf 'vnlru process getting nowhere, pausing...' and instead
export the count to the debug.vnlru_nowhere sysctl.
Luigi Rizzo [Wed, 19 Dec 2001 00:53:24 +0000 (00:53 +0000)]
Complete the device polling support by adding a thread in charge
of polling interfaces at the lowest possible priority
(this might result in softnetisr being scheduled, but there is
no risk of livelock because they have a higher priority than
this thread).
Joerg Wunsch [Tue, 18 Dec 2001 22:16:33 +0000 (22:16 +0000)]
Change the test for _MACHINE_ARCH == i386 into #ifdef __i386__ since it
otherwise breaks on the Alpha arch. I think this is wrong since i'd
actually like to probe for a PC architecture, not for a particular CPU
type. Anyway, now it's again the way it used to be.
Mike Heffner [Tue, 18 Dec 2001 20:52:09 +0000 (20:52 +0000)]
Sync with most of NetBSD's changes, including:
*) Sync with 4.4BSD-Lite2
*) Set usecs for utimes()
*) Add 'inc' command and 'autoinc' option that check for new mail
manually and automatically, respectively
*) Use POSIX signal handling and tty semantics
*) Handle long lines correctly when paging messages
*) Add ability to explicitly search 'To:' line
*) Various manpage cleanups
*) Support overriding '~/.mailrc' with $MAILRC
*) Support 'askbcc' and 'asksub' options
*) Fix various bugs
Matthew Dillon [Tue, 18 Dec 2001 20:48:54 +0000 (20:48 +0000)]
This is a forward port of Peter's vlrureclaim() fix, with some minor mods
by me to make it more efficient. The original code had serious balancing
problems and could also deadlock easily. This code relegates the vnode
reclamation to its own kproc and relaxes the vnode reclamation requirements
to better maintain kern.maxvnodes. This code still doesn't balance as well
as it could, but it does a much better job then the original code.
Approved by: re@freebsd.org
Obtained from: ps, peter, dillon
MFS Assuming: Assuming no problems crop up in Yahoo testing
MFC after: 7 days
Bruce A. Mah [Tue, 18 Dec 2001 16:26:57 +0000 (16:26 +0000)]
The smbutils import really only applies to the i386...fix this
(noticed by sheldonh). While I'm here, note its MFC, also add some
cross-references from the kernel part.
John Baldwin [Tue, 18 Dec 2001 09:06:10 +0000 (09:06 +0000)]
- Change all callers of addupc_task() to check PS_PROFIL explicitly and
remove the check from addupc_task(). It would need sched_lock while
testing the flag anyways.
- Always read sticks while holding sched_lock using a temporary variable
where needed.
- Always init prticks to 0 in ast() to quiet a warning.
John Baldwin [Tue, 18 Dec 2001 08:54:39 +0000 (08:54 +0000)]
Various assembly fixes mostly in the form of using the "+" modifier for
output operands to mark them as both input and output rather than listing
operands twice.
John Baldwin [Tue, 18 Dec 2001 07:55:17 +0000 (07:55 +0000)]
- Add a function to convert 6 byte SCSI commands for read, write, mode
sense, and mode select into their 10 byte equivalents. Eventually the
da(4) driver will become more intelligent about this, or at least allow
umass(4) to pass quirks in directly. However, this is a functional
workaround until a better fix is implemented.
- Use the 6 to 10 conversion function to allow the ATAPI and UFI command
sets to emulate 6 byte commands with 10 byte commands.
- Use the ATAPI command set rather than UFI for the ScanLogic SL11R-IDE
as it supports the SYNCH_CACHE command.
- Enable ATAPI command set support.
- Pass READ/WRITE_12 commands through for UFI support as the UFI spec
says they should be supported.
- Update a comment in the UFI translation function since we handle
MODE_SELECT.
Ian Dowse [Tue, 18 Dec 2001 01:22:09 +0000 (01:22 +0000)]
Avoid passing the variable `tl' to functions that just use it for
temporary storage. In the old NFS code it wasn't at all clear if
the value of `tl' was used across or after macro calls, but I'm
fairly confident that the convention was to keep its use local.
Each ex-macro function now uses a local version of this variable,
so all of the double-indirection goes away.
The only exception to the `local use' rule for `tl' is nfsm_clget(),
which is left unchanged by this commit.
John Baldwin [Tue, 18 Dec 2001 00:27:18 +0000 (00:27 +0000)]
Modify the critical section API as follows:
- The MD functions critical_enter/exit are renamed to start with a cpu_
prefix.
- MI wrapper functions critical_enter/exit maintain a per-thread nesting
count and a per-thread critical section saved state set when entering
a critical section while at nesting level 0 and restored when exiting
to nesting level 0. This moves the saved state out of spin mutexes so
that interlocking spin mutexes works properly.
- Most low-level MD code that used critical_enter/exit now use
cpu_critical_enter/exit. MI code such as device drivers and spin
mutexes use the MI wrappers. Note that since the MI wrappers store
the state in the current thread, they do not have any return values or
arguments.
- mtx_intr_enable() is replaced with a constant CRITICAL_FORK which is
assigned to curthread->td_savecrit during fork_exit().
John Baldwin [Mon, 17 Dec 2001 23:14:35 +0000 (23:14 +0000)]
Small cleanups to the SMP code:
- Axe inlvtlb_ok as it was completely redundant with smp_active.
- Remove references to non-existent variable and non-existent file
in i386/include/smp.h.
- Don't perform initializations local to each CPU while holding the
ap boot lock on i386 while an AP bootstraps itself.
- Reorganize the AP startup code some to unify the latter half of the
functions to bring an AP up. Eventually this might be broken out into
a MI function in subr_smp.c.
1) Localize (LC_CTYPE)
2) Catch "" to 0 conversion for OSes that not catch it in strto*()
(f.e. -stable). It is needed because POSIX agrees with both variants.
Michael Lucas [Mon, 17 Dec 2001 15:41:13 +0000 (15:41 +0000)]
Add Italian translations to the example for refusing docproj
translations. This will once again allow docproj trackers to use the
sample out-of-the-box to only download English.
Ian Dowse [Sun, 16 Dec 2001 18:54:09 +0000 (18:54 +0000)]
Make sure we ignore the value of `fs_active' when reloading the
superblock, and move the initialisation of it to beside where other
pointer fields are initialised.
Ian Dowse [Sun, 16 Dec 2001 18:51:11 +0000 (18:51 +0000)]
Move the new superblock field `fs_active' into the region of the
superblock that is already set up to handle pointer types. This
fixes an accidental change in the superblock size on 64-bit platforms
caused by revision 1.24.