Peter Wemm [Thu, 18 Nov 1999 05:15:09 +0000 (05:15 +0000)]
Tidy up a few loose ends in the fifo setup code.
Don't use NFDC as an arbitary limit, it is not required and goes against
using PnP fdc devices (eg: when PNPBIOS is turned on, the motherboard
devices (sio, fdc, etc etc) are detected via PnP, not config(8).)
Peter Wemm [Thu, 18 Nov 1999 04:31:31 +0000 (04:31 +0000)]
Use a common MAKEDEV between the Alpha and i386 - the only differences
of significance were due to the Alpha version going stale. We use common
device numbering for devices. Hopefully, this file's days are numbered.
John Polstra [Thu, 18 Nov 1999 03:01:06 +0000 (03:01 +0000)]
For the TCP transport, put the listening socket in non-blocking
mode. This addresses a well-known race condition that can cause
servers to hang in accept(). The relevant case is when somebody
connects to the server and then immediately kills the connection
by sending a TCP reset. On the server this causes select to report
a ready condition on the socket, after which the accept call blocks
because there is no longer any pending connection to accept.
In -current there is already a work-around for this in the kernel.
It was merged into -stable some time ago, but then David Greenman
reverted it because it seemed to be causing a socket leak in some
cases. (See uipc_socket.c revision 1.51.2.3.) Hence this userland
fix is needed in -stable, and I plan to merge it into that branch
soon because it fixes a potential DoS attack. It may also be needed
in -current if the suspected socket leak turns out to be real. In
any case, after thinking it over I believe the fix belongs in
userland. An application shouldn't assume that a ready return from
select guarantees that the subsequent I/O operation cannot block.
A lot can happen between the select and the accept.
A similar fix should most likely be applied to the Unix domain
socket transport too.
Warner Losh [Wed, 17 Nov 1999 23:54:39 +0000 (23:54 +0000)]
o Remove #if XXX from around the probe code.
o Rewrite probe code to work in the newbus world.
o Add preliminary pnp support. I have no clue what the pnp ids for
the older ISA machines/cards. I don't have any of these cards/machines
so I'll have to rely on the user community to give me help.
o Minor code reformatting.
Attach hasn't been touched, and there may be some config issues that
we need to deal with as well. These will follow in time.
Add network pass4 - after all local (/usr/local/etc/rc.d f.e.)
daemons started. Move log_in_vain option there. It is needed to avoid
lot of connections to port 80 logged on production WWW server prior
Apache started from /usr/local/etc/rc.d
Nick Hibma [Wed, 17 Nov 1999 22:33:51 +0000 (22:33 +0000)]
Synchronisation with NetBSD as of 1999/11/16:
Cleaning up the code:
- Declare many functions static
- Change variable names to make them more self explanatory
- Change usbd_request_handle -> usbd_xfer_handle
- Syntactical changes
- Remove some unused code
- Other KNF changes
Interrupt context handling
- Change delay to usbd_delay_ms were possible (takes polling mode into
account)
- Change detection mechanism for interrupt context
Add support for pre-allocation DMA-able memory by device driver
Add preliminary support for isochronous to the UHCI driver (not for OHCI
yet).
usb.c, uhci.c, ohci.c
- Initial attempt at detachable USB host controllers
- Handle the use_polling flag with a lttle more care and only set it if
we are cold booting.
usb.c, uhci.c ohci.c, usbdi.c usbdi_util.c usb_subr.c
- Make sure an aborted pipe is marked as not running.
- Start queued request in the right order.
- Insert some more DIAGNOSTIC sanity checks.
- Remove (almost) unused definitions USBD_XFER_OUT and USBD_XFER_IN.
usb.c, usb_subr.c
- Add an event mechanism so that a userland process can watch devices
come and go.
ohci.c
- Handle the case when a USB transfer is so long that it crosses two
page (4K) boundaries. OHCI cannot do that with a single TD so we make
a chain.
ulpt.c
- Use a bigger buffer when transferring data.
- Pre-allocate the DMA buffer. This makes the driver slightly more
efficient.
- Comment out the GET_DEVICE_ID code, because for some unknown reason it
causes printing to fail sometimes.
usb.h
- Add a macro to extract the isoc type.
- Add a macro to check whether the routine has been entered after splusb
and if not, complain.
usbdi.c
- Fix a glitch in dequeueing and aborting requests on interrupt pipes.
- Add a flag in the request to determine if the data copying is done by
the driver or the usbdi layer.
Merge with OpenBSD whois (with bugfixes missed there)
New features are:
Automatic lookup using *.whois-servers.net
Recursive lookup using Registrar's name
Fallback to InterNIC for non-domains
-m for RADB database
-Q to turn recursion/fallback off
Martin Cracauer [Wed, 17 Nov 1999 16:53:34 +0000 (16:53 +0000)]
The pipleline problem introduced in version 1.22 wasn't fully fixed in
1.23. This revision should work for long pipes both in
here-documents/backquote and in normal cases.
David Nugent [Wed, 17 Nov 1999 16:31:51 +0000 (16:31 +0000)]
Reduce max length of user names to 15 characters to reflect reality.
This also prevents the line-wrap and messed up display that occurs
when there happens to be one or more names with 15 chars.
Peter Wemm [Wed, 17 Nov 1999 15:28:45 +0000 (15:28 +0000)]
Use the same technique as ps(1) to avoid the need for setgid. (ie: use
/dev/null as the default kernel and /dev/mem filenames, but still allow
the usual overrides)
Peter Wemm [Wed, 17 Nov 1999 13:37:30 +0000 (13:37 +0000)]
I'm probably jumping the gun, but what the heck, this is -current.
Turn off setgid-kmem for /bin/ps, it's now quite functional without it.
ps no longer needs /dev/*mem or /proc. (It will still use some /proc
files if they are available for -e, but it's not required, so it'll
happily run in a jail or chroot).
The proc stats are now part of eproc (obtained via sysctl) and no longer
needs to beat up the u-page reading code and the problems with that.
This also has the side effect of disabling 'ps -e' for normal users
*EXCEPT* when looking at their own processes. ie: they can see
environments in processes with their uid, enforced by the ownership of
/proc/*/mem. Root can still see them all, as it can open all /proc/*/mem.
Peter Wemm [Wed, 17 Nov 1999 12:49:22 +0000 (12:49 +0000)]
Add e_stats (p->p_stats, from struct user->u_stats) to eproc so it's
fetchable via sysctl. This saves ps having to read the u-area for stats.
Be sure to recompile libkvm, ps, w, top and the usual suspects.
Matt Jacob [Wed, 17 Nov 1999 06:05:09 +0000 (06:05 +0000)]
Fix for 11815 (at mount time do a throwaway read of the front of the
tape to force the drive to do a media access so it knows what media
may be inserted).
Peter Wemm [Wed, 17 Nov 1999 03:32:05 +0000 (03:32 +0000)]
Put the listening socket into non-blocking mode before doing an
accept(2). This is a not really problem on -current as the accept race
is fixed, however it is a MFC candidate for -stable.
This could possibly be slightly more efficient and leave the listening
socket permanently in non-blocking mode, but I wasn't certain that I
could catch all the stream/wait (not nowait) mode implications.
Bruce Evans [Wed, 17 Nov 1999 03:25:54 +0000 (03:25 +0000)]
Fixed sorting on time. On i386's, time differences of more than 2147
seconds caused overflow. Use a type-safe but slightly slower comparison.
Comparisons for other fields are still fragile.
Fixed rounding of cputime (don't do extra work to get it slightly wrong
by first converting without rounding to milliseconds).
John Polstra [Wed, 17 Nov 1999 01:54:17 +0000 (01:54 +0000)]
Fix a bug in the hack that protects against FTP bounce attacks.
It used to loop back up to the accept() call and block there,
shutting out all other transports until a new connection came in.
Now it returns instead after dropping the connection. That will
take it back to the select() loop where all transports can be
serviced. I intend to MFC this within a day or two since it
fixes a DoS vulnerability.
Brian Somers [Tue, 16 Nov 1999 21:57:48 +0000 (21:57 +0000)]
Remove some extraneous ifdefs, and don't try to put the socket in
O_NONBLOCK. The select() is the best best as I don't want to muck
about with the send/receive thresholds.
This fixes some nasty procfs problems for SMP, makes ps(1) run much faster,
and makes ps(1) even less dependent on /proc which will aid chroot and
jails alike.
To disable this facility and revert to previous behaviour:
sysctl -w kern.ps_arg_cache_limit=0
For full details see the current@FreeBSD.org mail-archives.
Alot of the code in sys/kern directly accesses the *Q_HEAD and *Q_ENTRY
structures for list operations. This patch makes all list operations
in sys/kern use the queue(3) macros, rather than directly accessing the
*Q_{HEAD,ENTRY} structures.
Andrew Gallatin [Tue, 16 Nov 1999 14:01:12 +0000 (14:01 +0000)]
Mchines whose interrupts are not routed through the ISA pic were still
registering their interrupts with rman as though they were going through
the ISA pic. This prevents a conflict between isa & pci for irqs on such
machines.
Also hookup the chipset struct before calling platform.pci_intr_init().
This allows me to call inw/outw down in the platform code.
This is a partial commit of the patch from PR 14914:
Alot of the code in sys/kern directly accesses the *Q_HEAD and *Q_ENTRY
structures for list operations. This patch makes all list operations
in sys/kern use the queue(3) macros, rather than directly accessing the
*Q_{HEAD,ENTRY} structures.
This batch of changes compile to the same object files.
Marcel Moolenaar [Tue, 16 Nov 1999 10:26:38 +0000 (10:26 +0000)]
Add type int to those variables without a type. This is caused by the
frequent use of ``register var'' instead of ``register int var'' and
the removal of the register hint in the previous commit.
Josef Karthauser [Tue, 16 Nov 1999 01:03:12 +0000 (01:03 +0000)]
Curchill --> Churchill
The submitter also posted a change to 'fortunes.sp.ok', but it
looks like this file is no longer needed in our version so I've
left the typo in the file. (It also doesn't have a $FreeBSD$ tag,
and I couldn't easily find in the code whether it will allow comments
within it or not.)