Sam Leffler [Fri, 29 Jul 2005 05:57:28 +0000 (05:57 +0000)]
Correct problems with handling interfaces that go away (e.g. when
a card is ejected). wpa_supplicant requires that internal events
for interfaces coming+going include a name but after an interface
is removed you cannot use if_indextoname to map the interface index
in the RTM_IFINFO (or RTM_IFANNOUNCE) msg to an interface name.
Instead record the interface index in the driver-private data area
and use that to filter msgs from the routing socket. This insures
that when we have a message to process we know the interface name.
The end result is that we can now dispatch an "interface removed"
event that is understood when notified than an interface went away
(where previously the event dispatched was ignored because the
interface name was unrecognized).
This change also insures we only process events for our interface.
The only downside is that we can no longer wait for an interface
to arrive as we need to map the interface name to an index at
startup. This is not important as wpa_supplicant should be launched
by devd and not include a separate mechanism for doing interface
discovery.
Fix nits in reporting battery information and add battery status reporting.
Rate units are mA/mW, not mAh/mWh. Get full battery status and time
remaining from ACPIIO_BATT_GET_BATTINFO instead of BST.
Zero the _BST, _BIF, and battinfo allocations. This is needed since we
later sum capacities for all batteries, even those that weren't actually
present. We only need to do this for _BST but do it for all of them.
simplied the fix to FreeBSD-SA-04:06.ipv6. The previous one worried
too much even though we actually validate the parameters. This code
also is more compatible with other *BSDs, which do copyin within
setsockopt().
Robert Watson [Thu, 28 Jul 2005 09:45:08 +0000 (09:45 +0000)]
Minor syntax tweaks:
- Remove some extra blank lines.
- Remove comments that don't contribute to understanding.
- Remove additional blank lines in output added to maximize compatibility
with older vmstat output, but that is actually somewhat gratuitous.
Submitted by: bde
MFC with: other vmstat libmemstat(3) changes
Warner Losh [Thu, 28 Jul 2005 03:51:54 +0000 (03:51 +0000)]
Add a couple of missing nic interfaces that have been added: iwi, ipw,
ral and ural. Add a comment about this regexp being lame, which
should shock no-one. Add a comment about why rescans are disabled on scsi
cards.
Brooks Davis [Thu, 28 Jul 2005 00:24:39 +0000 (00:24 +0000)]
Don't reject packets with server names containing characters that are
not allowed in domain names. RFC 2132 does not list valid or invalid
characters and the ISC client accepts anything here.
Fix the way how "InUse" column in 'vmstat -m' output works:
- increase number of allocations count only on successfull malloc(9),
so it doesn't confuse people;
- because we need to check if 'size > 0', hide 'mtsp->mts_memalloced += size;'
under the check as well, as for size=0 it is of course a no-op;
- avoid critical_enter()/critical_exit() in case of failure in
malloc_type_allocated() as there will be nothing to do.
Maksim Yevmenkin [Wed, 27 Jul 2005 21:03:35 +0000 (21:03 +0000)]
Reorganize an_detach() a bit. Make sure ether_ifdetach() and if_free()
are called outside of AN_LOCK()/AN_UNLOCK. This fixes the following
WITNESS warning (produced when an(4) PCMCIA card is detached).
taskqueue_drain with the following non-sleepable locks held:
exclusive sleep mutex an0 (network driver) r = 0 (0xc59af168) locked @ /usr/src/sys/dev/an/if_an.c:2836
John Baldwin [Wed, 27 Jul 2005 20:01:45 +0000 (20:01 +0000)]
Add extra constraints to tell the compiler that the memory be modified
in the arm __swp() and sparc64 casa() and casax() functions is actually
being used as an input and output and not just the value of the register
that points to the memory location. This was the underlying source of
the mbuf refcount problems on sparc64 a while back. For arm this should be
a nop because __swp() has a constraint to clobber all memory which can
probably be removed now.
Brooks Davis [Wed, 27 Jul 2005 19:25:46 +0000 (19:25 +0000)]
Fix a bug in the handling of cases where we got a short (or zero)
capture. Zero length captures caused an infinte loop and short captures
probably caused memory corruption and a crash.
Paul Saab [Wed, 27 Jul 2005 15:05:31 +0000 (15:05 +0000)]
In nfs_nget() if two threads race on the same filehandle, the loser should
cause the nfsnode to get freed. This fixes a potential vnode (and nfsnode)
leak in that path.
John Baldwin [Wed, 27 Jul 2005 13:51:01 +0000 (13:51 +0000)]
- Use callout_*() rather than timeout() to periodically poll the media.
- Add locking to protect the softc and mark this driver as MP safe. There
are still some edge cases with multiport cards that need more locking
work.
Use root_mount KPI for RAID3 to delay root file system mount.
Actually, one cannot setup root file system on RAID3 device, but when
other file system exist in /etc/fstab which are placed on RAID3 device,
boot process will be interrupted when these devices are missing.
MFC after: 3 days
X-MFC-note: MFC only to RELENG_6, as RELENG_5 doesn't have root_mount KPI.
Sam Leffler [Wed, 27 Jul 2005 02:53:09 +0000 (02:53 +0000)]
bandaid ni_fails handling so ap's with association failures are
reconsidered after a bit; a proper fix involves more changes to
the scanning infrastructure
Reviewed by: avatar, David Young
MFC after: 5 days
Introduce a bpfstat utility. This program can be used to retrieve
stats provided by bpf(4). This program will live in tools/ for now
until we figure out where it will live permanently. Based on some
discussions on developers@, it is likely that we will be adding
this functionality to netstat(1) at some point.
Add the first snapshot at rewriting the nanobsd build to be a shellscript.
The overall idea is to get a single build script which will not need
editing, but instead overrides and changes happen by config files passed
as arguments.
Robert Watson [Mon, 25 Jul 2005 22:35:10 +0000 (22:35 +0000)]
Teach vmstat -m and vmstat -z to use libmemstat(3). Certain
statistics from -z are now a bit different due to changes in the
way statistics are now measured. Reproduce with some amount of
accuracy the slightly obscure layouts adopted by the two kernel
sysctls. In the future, we might want to normalize them.
Maxime Henrion [Mon, 25 Jul 2005 22:21:11 +0000 (22:21 +0000)]
Remove an erroneous m_freem() call. If m_defrag() returns a non-NULL
pointer, it has already freed the original mbuf chain, so we shouldn't
do it again.
Brooks Davis [Mon, 25 Jul 2005 22:19:09 +0000 (22:19 +0000)]
Change host-name from type "X" to type "t". This allows the client to
accept NUL-terminated strings as required by RFC 2132.
This solution is not perfect as it removes the ability to send
NUL-terminated host-name options which may be required by some broken
servers. Given the current lack of an existance proof of such servers
and the fact that servers that send NUL-terminated domain names do
exist, this seems like an acceptable compromise. A discussion of these
issues can be found at:
By design I left a tiny race in updating the I/O statistics based on
the assumption that performance was more important that beancounter
quality statistics.
As it transpires the microoptimization is not measurable in the
real world and the inconsistent statistics confuse users, so revert
the decision.
Correct minor output bug. When the battery being queried is charging or
the overall discharge rate is 0, mark the battery remaining time as
"unknown", not 0.
Disable thread support in BIND. It appears to reduce performance rather
than increase it, and seems to be the cause of the memory leaks which some
users have reported.
scope cleanup. with this change
- most of the kernel code will not care about the actual encoding of
scope zone IDs and won't touch "s6_addr16[1]" directly.
- similarly, most of the kernel code will not care about link-local
scoped addresses as a special case.
- scope boundary check will be stricter. For example, the current
*BSD code allows a packet with src=::1 and dst=(some global IPv6
address) to be sent outside of the node, if the application do:
s = socket(AF_INET6);
bind(s, "::1");
sendto(s, some_global_IPv6_addr);
This is clearly wrong, since ::1 is only meaningful within a single
node, but the current implementation of the *BSD kernel cannot
reject this attempt.