MFC:
Have the man page catch up with the namespace pollution cleanup that
occurred between 2001-2003. Thanks to bde for the history lesson[1]
concerning sys/types.h and the many system calls that at one time
(pre-2001) were required by POSIX to include it.
Delay the global registration of the struct ifnet in if_alloc() until after
we're certain the allocation will entierly succeed. This fixes a leak in a
fairly unlikely case.
Reported by: vijay singh <vijjus at rocketmail dot com>
- Fix bugs where the value of arithmetic expansion$((...)) was trucated
to type int.
- Change the type used for arithmetic expansion to intmax_t (ie. 64 bit on all
currently supported FreeBSD architectures). SUSv3 requires at least type
long but allows for larger types. Other shells (eg. bash, zsh, NetBSD's sh)
do that too.
PR: 122659
Submitted by: Jaakko Heinonen (minor modifications by me)
- style(9) cleanup.
- dummynet_io() declaration has changed.
- Alter packet flow inside dummynet and introduce 'fast' mode of dummynet
operation: allow certain packets to bypass dummynet scheduler. Benefits are:
-- lower latency: if packet flow does not exceed pipe bandwidth, packets
will not be (up to tick) delayed (due to dummynet's scheduler granularity).
-- lower overhead: if packet avoids dummynet scheduler it shouldn't reenter
ip stack later. Such packets can be fastforwarded.
-- recursion (which can lead to kernel stack exhaution) eliminated. This fix
long existed panic, which can be triggered this way:
kldload dummynet
sysctl net.inet.ip.fw.one_pass=0
ipfw pipe 1 config bw 0
for i in `jot 30`; do ipfw add 1 pipe 1 icmp from any to any; done
ping -c 1 localhost
- New sysctl nodes:
net.inet.ip.dummynet.io_fast - enables 'fast' dummynet io
net.inet.ip.dummynet.io_pkt - packets passed to dummynet
net.inet.ip.dummynet.io_pkt_fast - packets avoided dummynet scheduler
net.inet.ip.dummynet.io_pkt_drop - packets dropped by dummynet
- Workaround p->numbytes overflow, which can result in infinite loop inside
dummynet module (prerequisite is using queues with "fat" pipe).
- Spelling fix for interupt -> interrupt
- Fix function prototype for device_shutdown method.
- Take advantage of bus_dmamap_load_mbuf_sg(9).
- Sync with other NIC drivers and prepend a TX mbuf if the first attempt
to load it fails with an error other than EFBIG and stop trying instead
of freeing it and keeping on trying to enqueue more mbufs. Also ensure
the driver queue isn't empty before trying to enqueue mbufs in order to
reduce locking operations.
- In xl_ifmedia_upd() add a missing XL_UNLOCK(). [1]
- Const'ify the xl_devs array.
- Remove an outdated comment.
antoine [Sun, 20 Apr 2008 16:32:20 +0000 (16:32 +0000)]
MFC to RELENG_6:
Merge changes from NetBSD on humanize_number.c, 1.8 -> 1.13
Significant changes:
- rev. 1.11: Use PRId64 instead of a cast to long long and %lld to print
an int64_t.
- rev. 1.12: Fix a bug that humanize_number() produces "1000" where it
should be "1.0G" or "1.0M". The bug reported by Greg Troxel.
MFC some small optimizations:
rev. 1.151: Remove impossible (hk_peer == NULL) check.
rev. 1.152: Remove ng_setisr() call from ng_dequeue().
rev. 1.153: There is no need to erase hook->hk_node before freeing hook.
rev. 1.154: Use new atomic_fetchadd() primitive instead of looping atomic_cmpset().
rev. 1.158: ng_address_hook() microoptimization.
MFC if_rl.c, rev 1.174 to RELENG_6.
It seems that RealTek 8129/8139 chip reports invalid length of
received frame under certain conditions. wpaul said the length
0xfff0 is special meaning that indicates hardware is in the
process of copying a packet into host memory. But it seems
there are other cases that hardware is busy or stuck in bad
situation even if the received frame length is not 0xfff0.
To work-around this condition, add a check that verifys that
recevied frame length is in valid range. If received length is out
of range reinitialize hardware to recover from stuck condition.
MFC revs 1.17-1.20, the functional components of which are:
1.17:
Allow the characters .-+/ to appear in ppp profile names by folding them
to _ when evaluating ppp_<profile>_nat and ppp_<profile>_mode. Document
the per-profile variables.
1.18:
Add support for hardwiring ppp sessions to particular devices with new
per-profile variables of the form ppp_<profile>_unit. No ppp_unit
variable is supported since tying the same unit to more than one profile
won't work.
Add rfcomm_pppd_server rc script to allow start rfcomm_pppd(8) in server
mode at boot time. Multiple profiles can be started at the same time.
The whole idea is very similar to the ppp rc script.
MFC:
Make ALTQ cope with disappearing interfaces (particularly common with mpd
and netgraph in gernal). This also allows to add queues for an interface
that is not yet existing (you have to provide the bandwidth for the
interface, however).
- Do as the comment in pmap_bootstrap() suggests and flush all non-locked
TLB entries possibly left over by the firmware and also do so while
bootstrapping APs.
- Use __FBSDID.
marius [Fri, 11 Apr 2008 23:41:43 +0000 (23:41 +0000)]
MFC: if_dc.c 1.195, 1.194; if_dcreg.h 1.55
- Fix function prototype for device_shutdown method.
- Const'ify the dc_devs array.
- Correct the maxsize parameter when creating the mbufs busdma tag to
reflect the actual requirement of dc(4).
- Move the KASSERT in dc_newbuf() to the right spot.
- Also convert the TX side to take advantage of bus_dmamap_load_mbuf_sg(9).
- Move the comment regarding dc_start_locked() to the right spot.
Document the removal data for usbdevs.h and usbdevs_data.h,
sort the entry into it's correct place (behind 200407XX before
200406XX because we have an explicit date here).
Add a new function is_default_interface() which determines if this
interface is one with the default route (or there isn't one). Use it to
decide if we should adjust the default route and /etc/resolv.conf.
Fix the delete of the default route. The if statement was totally bogus
and the delete only worked due to a typo. [1]
Reported by: Jordan Coleman <jordan at JordanColeman dot com> [1]
MFC revision 1.22
date: 2008/03/07 00:01:19; author: delphij; state: Exp; lines: +61 -68
Merge revisions 1.10 and 1.11 from DragonFly:
- Use real getopt() handling instead of the hand-rolled and
IOCCC-worthy "Micro getopt()" macros, plus clean up to the
option handling code:
* Sort the options in the switch statement;
* Plug piddling memory leaks when processing repeated options
by freeing strings before allocating them for a second time;
* Die with a fatal error if the requested report file cannot
be opened for appending;
* Don't call init() before usage() (to prevent the usage
message being mangled by changes to the terminal settings;)
- Clean up the usage message, both in usage() and in the main
program comment, both stylistically (sort and combine options)
and for accuracy (following the manual page, make note of the -s
and -S flags, and use the term 'send' instead of 'say' to reduce
confusion (SAY is the name of a command for output to the user,
not the connection.))
MFC r1.97:
Sync with rev 1.63 of NetBSD's ums.c:
If a mouse has both a wheel and a Z direction we report both.
XXX Due to tradition the wheel is reported as the Z direction (and the Z
direction as W).
Now Apple's Mighty Mouse is fully supported, except the X11 mouse driver
doesn't know what to do with the new coordinate.
MFC aac.c 1.137:
Calling RequestSupplementAdapterInfo before RequestAdapterInfo appears
to trip a bug causing the latter to return a zeroed struct
aac_adapter_info. This causes two issues. One is cosmetic only --
a verbose boot prints information about the controller, and shows all
zero:
The second problem is that the firmware version information is stored
away for aac_rev_check, for userland tools (like aaccli) to query via
the FSACTL_MINIPORT_REV_CHECK and FSACTL_LNX_MINIPORT_REV_CHECK ioctls.
When aaccli encounters this issue it prints
Command Error: <The current AFAAPI.DLL is too old to work with the
current controller software.>
Move the RequestSupplementAdapterInfo call after RequestAdapterInfo,
which seems to fix both problems.
MFC ng_pptpgre.c rev. 1.41-1.42
Rewrite node to support multiple hooks, alike to ng_l2tp, to use one pair
of pptpgre and ksocket nodes for all calls between two peers. This patch
modifies node's API by adding new "session_%04x" hook names support, while
keeping backward compatibility.
MFC revisions 1.13, 1.14: Don't try to compute the SHA256 hashes of
files which don't exist; and fix the handling of symlinks to
dynamically linked libraries.
Merge rev 1.20:
Fix a buffer overflow in the processing of various SCSI commands. This
likely fixes a great number of weird problems that have been reported
with this driver.
MFC: Initialize list of kld's correctly when there are no kld's and catch
errors in kgdb_parse() so it returns 0 for invalid expressions. This
fixes the kld loading for 6.x and 7.x.
emaste [Mon, 31 Mar 2008 20:11:46 +0000 (20:11 +0000)]
MFC aac_cam.c 1.30:
Merge from Adaptec a 64 bit fix and a workaround for luns != 0
returning CAM_SEL_TIMEOUT on SAS controllers, which prevented
passthrough devices from being created.
emaste [Mon, 31 Mar 2008 19:50:53 +0000 (19:50 +0000)]
MFC aac.c 1.130:
Restore creation of passthrough devices with newer controller firmware by
putting the correct size in the fib header. Presumably the older firmware
silently ignored a bad size field.
(This change tested with a 3805 controller. Passthrough devices were
created when running firmware build 12814, but not 15323 or later. With
this change they're created for both old and new firmware versions.)
emaste [Mon, 31 Mar 2008 17:04:10 +0000 (17:04 +0000)]
MFC aac.c 1.131:
Diff reduction to Adaptec driver build 15317 (refactoring and code shuffling):
- Resource allocation in aac_alloc (moved from from aac_init)
- Interrupt setup in aac_setup_intr (from aac_attach)
- Container probing in aac_get_container_info (from aac_startup and
aac_handle_aif)
- Firmware status check moved to aac_check_firmware from aac_init
remko [Sat, 29 Mar 2008 13:44:36 +0000 (13:44 +0000)]
MFC rev 1.84 route.c
In route.c in newroute() there's a call to exit(0) if the command was
'get'. Since rtmsg() always gets called and returns 0 on success and -1
on failure, it's possible to exit with a suitable exit code by calling
exit(ret != 0) instead, as is done at the end of newroute().
kib [Thu, 27 Mar 2008 13:53:52 +0000 (13:53 +0000)]
MFC
rev. 1.682 of sys/amd64/amd64/machdep.c
rev. 1.16 of sys/amd64/ia32/ia32_signal.c
rev. 1.33 of sys/amd64/linux32/linux32_sysvec.c
rev. 1.666 of sys/i386/i386/machdep.c
rev. 1.152 of sys/i386/linux/linux_sysvec.c
rev. 1.39 of sys/i386/svr4/svr4_machdep.c
rev. 1.402 of sys/pc98/pc98/machdep.c
Modify the signal handler frame setup code to clear the DF {e,r}flags
bit on the amd64/i386 for the signal handlers.
jkim [Mon, 24 Mar 2008 17:49:34 +0000 (17:49 +0000)]
MFC: 1.24-1.26
- Check device masks and bypass printing headers if capable device does
not exist. /etc/rc.d/mixer tried to restore non-existent recording
source because /var/var/db/mixer*-state contains '=rec' for example.
- Remove hardcoded mixer2 and mixer3 and do the right thing.
- Replace getopt(3) with hand-rolled option parser. It was not able
to handle 'mixer -rec mic' although it is a valid command.
- Make '-s' and '-S' mutualy exclusive as mixer(8) says.
- Do not re-read recording source unless it has been modified.
- Clean up code and fix style(9) nits.