bms [Wed, 16 Jun 2004 07:00:50 +0000 (07:00 +0000)]
Make netstat(1) more closely follow documented behaviour. If a TCP
socket in LISTEN state happens to be bound to an interface, it will
show up in netstat(1) output even without the -a switch.
As the definition of "sockets used by server processes" is a
difficult one to qualify with regards to UDP, do not change the
output behaviour for UDP sockets.
bms [Wed, 16 Jun 2004 06:29:41 +0000 (06:29 +0000)]
When parsing an argument as an address in getaddr(), heed the -host option
in all cases. The failure mode in the PR is easily reproducible without
this patch.
bms [Wed, 16 Jun 2004 05:41:00 +0000 (05:41 +0000)]
Disconnect a temporarily-connected UDP socket in out-of-mbufs case. This
fixes the problem of UDP sockets getting wedged in a connected state (and
bound to their destination) under heavy load.
Temporary bind/connect should probably be deleted in future
as an optimization, as described in "A Faster UDP" [Partridge/Pink 1993].
Notes:
- INP_LOCK() is already held in udp_output(). The connection is in effect
happening at a layer lower than the socket layer, therefore in theory
socket locking should not be needed.
- Inlining the in_pcbdisconnect() operation buys us nothing (in the case
of the current state of the code), as laddr is not part of the
inpcb hash or the udbinfo hash. Therefore there should be no need
to rehash after restoring laddr in the error case (this was a
concern of the original author of the patch).
bms [Wed, 16 Jun 2004 05:08:57 +0000 (05:08 +0000)]
Turn on RFC 1724 compliant behaviour with regards to IP_ADD_MEMBERSHIP;
routed should be able to specify multicast memberships to be added by
interface index. This should fix the unnumbered / point-to-point case
for RIPv2.
alc [Wed, 16 Jun 2004 03:11:24 +0000 (03:11 +0000)]
Correct an error in the implementation of pmap_is_prefaultable(). When I
introduced this function in revision 1.441, I inverted one of the
comparisons.
julian [Wed, 16 Jun 2004 00:26:31 +0000 (00:26 +0000)]
Nice, is a property of a process as a whole..
I mistakenly moved it to the ksegroup when breaking up the process
structure. Put it back in the proc structure.
peter [Tue, 15 Jun 2004 23:57:02 +0000 (23:57 +0000)]
Change strategy based on a suggestion from Ian Dowse. Instead of trying
to keep track of different section base addresses at a symbol-by-symbol
level, just set the symbol values at load time.
davidxu [Tue, 15 Jun 2004 21:46:36 +0000 (21:46 +0000)]
Avoid to touch red zone, in libpthread, ucontext may be saved by kernel's
get_mcontext, and libpthread will use signalcontext to deliver signal in
userland, it looks same as kernel's send_sig does.
rwatson [Tue, 15 Jun 2004 13:43:11 +0000 (13:43 +0000)]
Fill in locking annotation for additional socket fields:
so_timeo Used as a sleep/wakeup address, no locking.
sb_* Almost all socket buffer fields locked with
sockbuf lock for the oskcet buffer.
so_cred Static after socket creation.
kientzle [Tue, 15 Jun 2004 07:12:04 +0000 (07:12 +0000)]
Be a little more careful about creating directories:
* Restore directories with 0700 permissions initially,
then use the fixup pass to correct the permissions
* Trim trailing "/" and "/." in mkdirpath()
rwatson [Tue, 15 Jun 2004 04:13:59 +0000 (04:13 +0000)]
Lock down rawcb_list, a global list of control blocks for raw sockets,
using rawcb_mtx. Hold this mutex while modifying or iterating over
the control list; this means that the mutex is held over calls into
socket delivery code, which no longer causes a lock order reversal as
the routing socket code uses a netisr to avoid recursing socket ->
routing -> socket.
Note: Locking of IPsec consumers of rawcb_list is not included in this
commit.
rwatson [Tue, 15 Jun 2004 03:51:44 +0000 (03:51 +0000)]
Grab the socket buffer send or receive mutex when performing a
read-modify-write on the sb_state field. This commit catches only
the "easy" ones where it doesn't interact with as yet unmerged
locking.
mlaier [Tue, 15 Jun 2004 01:45:19 +0000 (01:45 +0000)]
Transform tbr_dequeue into a function pointer in order to build drivers with
ALTQ enabled versions of IFQ_* macros by default, as requested by serveral
others. This is a follow-up to the quick fix I committed yesterday which
turned off the ALTQ checks for non-ALTQ kernels.
peter [Tue, 15 Jun 2004 01:35:57 +0000 (01:35 +0000)]
Fix symbol lookups between modules. This caused modules that depend on
other modules to explode. eg: snd_ich->snd_pcm and umass->usb.
The problem was that I was using the unified base address of the module
instead of finding the start address of the section in question.
bms [Tue, 15 Jun 2004 01:08:09 +0000 (01:08 +0000)]
Add a paragraph about the importance of byte order when using raw
sockets with the IP_HDRINCL option.
Add a list entry about the errors which IP_HDRINCL can return.
Bump .Dd.
PR: docs/30873
Submitted by: Douglas De Couto
Obtained from: BSD/OS (byte order), some old libnet stuff I did years ago.
green [Tue, 15 Jun 2004 01:02:00 +0000 (01:02 +0000)]
Make contigmalloc() more reliable:
1. Remove a race whereby contigmalloc() would deadlock against the
running processes in the system if they kept reinstantiating
the memory on the active and inactive page queues that it was
trying to flush out. The process doing the contigmalloc() would
sit in "swwrt" forever and the swap pager would be going at full
force, but never get anywhere. Instead of doing it until the
queues are empty, launder for as many iterations as there are
pages in the queue.
2. Do all laundering to swap synchronously; previously, the vnode
laundering was synchronous and the swap laundering not.
3. Increase the number of launder-or-allocate passes to three, from
two, while failing without bothering to do all the laundering on
the third pass if allocation was not possible. This effectively
gives exactly two chances to launder enough contiguous memory,
helpful with high memory churn where a lot of memory from one pass
to the next (and during a single laundering loop) becomes dirtied
again.
I can now reliably hot-plug hardware requiring a 256KB contigmalloc()
without having the kldload/cbb ithread sit around failing to make
progress, while running a busy X session. Previously, it took killing
X to get contigmalloc() to get further (that is, quiescing the system),
and even then contigmalloc() returned failure.
kientzle [Tue, 15 Jun 2004 00:28:34 +0000 (00:28 +0000)]
Rename -X to --one-file-system, as GNU tar uses -X for
something else. I would really like a short option for
this, but all of the obvious ones conflict with something else.
bms [Tue, 15 Jun 2004 00:23:26 +0000 (00:23 +0000)]
Ignore kernel routes with the RTF_WASCLONED flag set. This is a slight
modification of a patch which was already applied for BSD/OS in the
Rhyolite.com sources; this file is already off the vendor branch.
kientzle [Tue, 15 Jun 2004 00:07:23 +0000 (00:07 +0000)]
Clean up usage message(s):
* Usage goes to stderr, not stdout
* Use correct argument markup
* bsdtar --help no longer exits with an error return code
* ensure that the word "bsdtar" appears in the first
line output from "bsdtar --help" (even if the program is
invoked as "tar")
In particular, scripts can now test for the presence of bsdtar.
For example, in /bin/sh:
if (tar --help 2>&1 | grep bsdtar >/dev/null 2>&1) then \
echo bsdtar; else echo not bsdtar; fi
bms [Mon, 14 Jun 2004 22:43:05 +0000 (22:43 +0000)]
Do not depend on the global 'sockt' being initialized to 0;
instead, use the symbolic constant STDIN_FILENO, as this is
a daemon invoked from inetd.
Remove 'sockt' as it is not referenced.
bms [Mon, 14 Jun 2004 22:34:13 +0000 (22:34 +0000)]
Change the default behaviour of talk(1) to use "localhost" as the
"machine name" in ntalkd(8) request packets, when the destination
and source are local.
This should make talk(1) use much more pleasant for those security-
conscious individuals who have chosen to bind talkd to "localhost".
Previous to this change, talk(1) would require that the hostname of
the machine, as retrieved by gethostname(3), resolved to a valid and
reachable IPv4 address, using gethostbyname(3).
This makes talk(1) dependent on a valid host entry for "localhost"
in /etc/hosts (or the Domain Name System).
jhb [Mon, 14 Jun 2004 18:54:14 +0000 (18:54 +0000)]
Revert the removal of the initial_irq hack for now as this code is more
broken than I thought and doesn't do a good job of routing virgin
interrupts at all.
bms [Mon, 14 Jun 2004 18:39:28 +0000 (18:39 +0000)]
Add prototypes for the userland gmon support functions, which normally
live in src/lib/libc/gmon/gmon.c. glibc puts these prototypes in the same
header, so put them here for the sake of consistency.
jdp [Mon, 14 Jun 2004 18:19:05 +0000 (18:19 +0000)]
Change the return value of sema_timedwait() so it returns 0 on
success and a proper errno value on failure. This makes it
consistent with cv_timedwait(), and paves the way for the
introduction of functions such as sema_timedwait_sig() which can
fail in multiple ways.
Bump __FreeBSD_version and add a note to UPDATING.
rwatson [Mon, 14 Jun 2004 18:16:22 +0000 (18:16 +0000)]
The socket field so_state is used to hold a variety of socket related
flags relating to several aspects of socket functionality. This change
breaks out several bits relating to send and receive operation into a
new per-socket buffer field, sb_state, in order to facilitate locking.
This is required because, in order to provide more granular locking of
sockets, different state fields have different locking properties. The
following fields are moved to sb_state:
This facilitates locking by isolating fields to be located with other
identically locked fields, and permits greater granularity in socket
locking by avoiding storing fields with different locking semantics in
the same short (avoiding locking conflicts). In the future, we may
wish to coallesce sb_state and sb_flags; for the time being I leave
them separate and there is no additional memory overhead due to the
packing/alignment of shorts in the socket buffer structure.
le [Mon, 14 Jun 2004 17:12:32 +0000 (17:12 +0000)]
Don't free a VINUMDRIVE softc when it's orphaned or spoiled. All
allocated ressouces should be ultimately freed in gv_destroy_geom()
(when unloading the module and not earlier), but I need to look at this
more closely.
bde [Mon, 14 Jun 2004 15:37:49 +0000 (15:37 +0000)]
Fixed some style bugs:
- the comments on the rune/wide char types were lost
- struct cdev was bogusly forward declared
- some comments were excessively indented.