emax [Fri, 14 Mar 2008 16:11:20 +0000 (16:11 +0000)]
MFC:
Add an option to register DUN (Dial-Up Networking) service on the same
RFCOMM channel if needed. There is really no good reason to not to support
this. AT-command exchange can be faked with chat script in ppp.conf.
bz [Thu, 13 Mar 2008 10:09:12 +0000 (10:09 +0000)]
MFC rev. 1.146 tcp_output.c
Padding after EOL option must be zeros according to RFC793 but
the NOPs used are 0x01.
While we could simply pad with EOLs (which are 0x00), rather use an
explicit 0x00 constant there to not confuse poeple with 'EOL padding'.
Put in a comment saying just that.
Early MFC requested by: silby
because of more people reporting problems on net@
wollman [Thu, 13 Mar 2008 02:33:20 +0000 (02:33 +0000)]
MFC rev. 1.26:
stdio is currently limited to file descriptors not greater than
{SHRT_MAX}, so {STREAM_MAX} should be no greater than that. (This
does not exactly meet the letter of POSIX but comes reasonably close
to it in spirit.)
brooks [Wed, 12 Mar 2008 17:35:38 +0000 (17:35 +0000)]
MFC rev 1.31:
When the state of the interface changes rapidly enough there is a race
where dhclient is in the process of exiting due to the link going down
when the link coming up causes devd to try and start a new one. This
results is the link being up, but no dhclient running.
Work around this race by checking a second time after a one second delay
before refusing to start a dhclient instance due to one already being
running.
mav [Tue, 11 Mar 2008 19:14:10 +0000 (19:14 +0000)]
MFC rev. 1.23-1.24
To avoid control data losses, do not acknowledge recieving of control packet
if netgraph reported error while delivering to destination.
Reset 'next send' counter to the last requested by peer on ack timeout,
to resend all subsequest packets after lost one again without additional hints.
mav [Tue, 11 Mar 2008 19:04:42 +0000 (19:04 +0000)]
MFC rev. 1.61
Send only one incoming notification at a time to reduce queue
trashing and improve performance.
Remove waitflag argument from ng_ksocket_incoming2(), it means nothing
as function call was queued by netgraph.
Remove node validity check, as node validity guarantied by netgraph.
Update comments.
rwatson [Tue, 11 Mar 2008 10:14:47 +0000 (10:14 +0000)]
Merge cnode.h:1.25, coda_fbsd.c:1.48, coda_io.h:1.10,
coda_kernel.h:1.7, coda_namecache.c:1.25, coda_namecache.h:1.14,
coda_opstats.h:1.8, coda_pioctl.h:1.10, coda_psdev.c:1.43,
coda_psdev.h:1.8, coda_subr.c:1.35, coda_subr.h:1.11,
coda_venus.c:1.30, coda_venus.h:1.11, coda_vfsops.c:1.79,
coda_vfsops.h:1.14, coda_vnops.c:1.92, coda_vnops.h:1.23 from HEAD
to RELENG_7:
Since we're now actively maintaining the Coda module in the FreeBSD source
tree, restyle everything but coda.h (which is more explicitly shared
across systems) into a closer approximation to style(9).
Remove a few more unused function prototypes.
Add or clarify some comments.
Minor differences required in the MFC due to diverging VFS locking in
HEAD vs RELENG_7.
nyan [Mon, 10 Mar 2008 12:41:47 +0000 (12:41 +0000)]
MFC: revision 1.400
Add "show sysregs" command to ddb. On i386, this gives gdt, idt, ldt,
cr0-4, etc. Support should be added for other platforms that have a
different set of registers for system use.
rwatson [Mon, 10 Mar 2008 10:23:03 +0000 (10:23 +0000)]
Merge db_input.c:1.39 from HEAD to RELENG_7:
Reserve two bytes at the end of the DDB input line in db_readline() to
hold the newline and nul terminator. Otherwise, there are cases where
garbage may end up in the command history due to a lack of a nul
terminator, or input may end up without room for a newline.
PR: 119079
Submitted by: Michael Plass <mfp49_freebsd@plass-family.net>
rwatson [Mon, 10 Mar 2008 10:22:23 +0000 (10:22 +0000)]
Merge cnode.h:1.24, coda_fbsd.c:1.47, coda_namecache.c:1.24,
coda_psdev.c:1.42, coda_psdev.h:1.7, coda_venus.c:1.29,
coda_vfsops.c:1.78, coda_vfsops.h:1.13, coda_vnops.c:1.91,
coda_vnops.h:1.22 from HEAD to RELENG_7:
Various further non-functional cleanups to coda:
- Rename print_vattr to coda_print_vattr and make static, rename
print_cred to coda_print_cred.
- Remove unused coda_vop_nop.
- Add XXX comment because coda_readdir forwards to the cache vnode's
readdir rather than venus_readdir, and annotate venus_readdir as
unused.
- Rename vc_nb_* to vc_*.
- Use d_open_t, d_close_t, d_read_t, d_write_t, d_ioctl_t and d_poll_t
for prototyping vc_* as that is the intent, don't use our own
definitions.
- Rename coda_nb_statfs to coda_statfs, rename NB_SFS_SIZ to
CODA_SFS_SIZ.
- Replace one more OBE reference to NetBSD with a reference to FreeBSD.
- Tidy up a little vertical whitespace here and there.
- Annotate coda_nc_zapvnode as unused.
- Remove unused vcodattach.
- Annotate VM_INTR as unused.
- Annotate that coda_fhtovp is unused and doesn't match the FreeBSD
prototype, so isn't hooked up to vfs_fhtovp. If we want NFS export of
Coda to work someday, this needs to be fixed.
- Remove unused getNewVnode.
- Remove unused coda_vget, coda_init, coda_quotactl prototypes.
rwatson [Mon, 10 Mar 2008 10:18:06 +0000 (10:18 +0000)]
Merge cnode.h:1.23, coda_vfsops.c:1.76 from HEAD to RELENG_7:
Remove unused devtomp(), which exploited UFS-specific knowledge to find
the mountpoint for a specific device. This was implemented incorrectly,
a bad idea in a fundamental sense, and also never used, so presumably
a long-idle debugging function.
rwatson [Mon, 10 Mar 2008 10:16:09 +0000 (10:16 +0000)]
Merge coda_vnops.c:1.90, coda_vnops.h:1.21 from HEAD to RELENG_7:
Since Coda is effectively a stacked file system, use VOP_EOPNOTSUPP
for vop_bmap; delete the existing stub that returned either EINVAL
or EOPNOTSUPP, and had unreachable calls to VOP_BMAP on the cache
vnode.
mav [Sun, 9 Mar 2008 20:10:54 +0000 (20:10 +0000)]
MFC: rev. 1.148-1.149
Implement 128 items node name hash for faster name search.
Increase node ID hash size from 32 to 128 items.
Increase default queue items allocation limit from 512 to 4096 items
to avoid terrible unpredicted effects for netgraph operation of their
exhaustion while allocating control messages.
Add separate configurable 512 items limit for data items allocation
for DoS/overload protection.
rwatson [Sun, 9 Mar 2008 15:12:11 +0000 (15:12 +0000)]
Merge coda_psdev.c:1.41, coda_subr.c:1.45, coda_venus.c:1.28,
coda_vfsops.c:1.74, coda_vnops.c:1.87, coda_vnops.h:1.20 from HEAD
to RELENG_7:
The Coda module was originally ported to NetBSD from Mach by rvb, and
then later to FreeBSD. Update various NetBSD-related comments: in some
cases delete them because they don't appply, in others update to say
FreeBSD as they still apply but in FreeBSD (and might for that matter
no longer apply on NetBSD), and flag one case where I'm not sure
whether it applies.
rwatson [Sun, 9 Mar 2008 15:09:22 +0000 (15:09 +0000)]
Merge coda_vnops.c:1.86 from HEAD to RELENG_7:
Before invoking vnode operations on cache vnodes, acquire the vnode
locks of those vnodes. Probably, Coda should do the same lock sharing/
pass-through that is done for nullfs, but in the mean time this ensures
that locks are adequately held to prevent corruption of data structures
in the cache file system.
Assuming most operations came from the top layer of Coda and weren't
performed directly on the cache vnodes, in practice this corruption was
relatively unlikely as the Coda vnode locks were ensuring exclusive
access for most consumers.
This causes WITNESS to squeal like a pig immediately when Coda is used,
rather than waiting until file close; I noticed these problems because
of the lack of said squealing.
NB: Because WITNESS in RELENG_7 doesn't yet support lockmgr, said
squealing doesn't yet happen in RELENG_7, but will do if/when lockmgr
grows support for WITNESS there.
rwatson [Sun, 9 Mar 2008 15:06:12 +0000 (15:06 +0000)]
Merge coda_vfsops.c:1.73 from HEAD to RELENG_7:
Remove undefined coda excluded by #if 1 #else, which previously protected
vget() calls using inode numbers to query the root of /coda, which is not
needed since we now cache the root vnode with the mountpoint.
rwatson [Sun, 9 Mar 2008 14:49:39 +0000 (14:49 +0000)]
Merge db_input.c:1.38 from HEAD to RELENG_7:
When redrawing an input line, count backspaces to get to the beginning of
the input field from the current cursor location, rather than the end of
the input line, as the cursor may not be at the end of the line.
Otherwise, we may overshoot, overwriting a bit of the previous line and
failing to fully overwrite the current line.
PR: 119079
Submitted by: Michael Plass <mfp49_freebsd@plass-family.net>
Though we are currently not interested in the EDD3 flag,
Enhanced Disk Drive Specification Ver 3.0 defines that the version
of extension in AH would be 30h.
Correct the check for that to be >=30h instead of >3h.
rev. 1.373
Some "cleanup" of tcp_mss():
- Move the assigment of the socket down before we first need it.
No need to do it at the beginning and then drop out the function
by one of the returns before using it 100 lines further down.
- Use t_maxopd which was assigned the "tcp_mssdflt" for the corrrect
AF already instead of another #ifdef ? : #endif block doing the same.
- Remove an unneeded (duplicate) assignment of mss to t_maxseg just before
we possibly change mss and re-do the assignment without using t_maxseg
in between.
rafan [Sat, 8 Mar 2008 05:42:09 +0000 (05:42 +0000)]
MFC termcap changes for the END/ENTER keys
Log:
- Remove kH and *6 from xterm. They are defined to the same key as @7 (kp_end).
As ncurses has the limitation that it returns the first matched key symbol,
you can not use END in ncurses based program, like mutt, with xterm.
- Add @8 (kp_enter) definition for xterm so you can use ENTER in xterm with
ncurses based program.
I also found that NetBSD's xterm does the same thing.
PR: 100150
Reported by: Arseny Nasokin <tarc at tarc.po.cs.msu.su>
Discussed with: Thomas Dickey, Ulrich Spoerlein <uspoerlein at gmail.com>
Reviewed by: freebsd-arch@
jasone [Fri, 7 Mar 2008 22:39:39 +0000 (22:39 +0000)]
MFC: Merge malloc(3) improvements and fixes. The highlights are:
* Avoid re-zeroing memory in calloc() when possible.
* Use pthread mutexes where possible instead of libc "spinlocks", and
actually spin some during contention before blocking.
* Implement dynamic load balancing of thread-->arena mapping.
* Avoid floating point math in order to avoid increased context switch
overhead for applications that otherwise would not use floating point
math.
* Restructure how sbrk() and mmap() are used to acquire memory mappings.
This provides a way to force malloc to only use sbrk(), which can be
useful in the context of resource limits.
* Reduce the number of mmap() calls typically necessary when allocating
a chunk.
* Track dirty unused pages so that they can be purged if they exceed a
threshold.
* Try to realloc() large objects in place.
* Manage page runs with trees instead of chunk maps, which allows
logarithmic-time run allocation.
jhb [Fri, 7 Mar 2008 20:19:33 +0000 (20:19 +0000)]
MFC: VIA Padlock changes:
- Read the brand string from VIA/IDT CPUs.
- Add a VIA Padlock feature line in dmesg.
- Support the newer Via C7 core (0x6d0).
mav [Fri, 7 Mar 2008 17:58:49 +0000 (17:58 +0000)]
MFC rev. 1.92-1.93
Make session ID generator to use session ID hash.
Make session ID generator thread-safe.
Use more compact LIST instead of TAILQ for session hash.
Add all listening hooks into LIST to simplify searches.
Use ng_findhook() instead of own equal implementation.
scf [Thu, 6 Mar 2008 15:14:36 +0000 (15:14 +0000)]
MFC:
Replace the use of warnx() with direct output to stderr using _write().
This reduces the size of a statically-linked binary by approximately 100KB
in a trivial "return (0)" test application. readelf -S was used to verify
that the .text section was reduced and that using strlen() saved a few
more bytes over using sizeof(). Since the section of code is only called
when environ is corrupt (program bug), I went with fewer bytes over fewer
cycles.
I made minor edits to the submitted patch to make the output resemble
warnx().
mtm [Thu, 6 Mar 2008 14:13:11 +0000 (14:13 +0000)]
MFC: rev. 1.32
Add the -M command-line option, which will set home directory
permissions. Works both in interactive or batch mode. This is
a heavily modified version of the patch submitted in the PR.
delphij [Thu, 6 Mar 2008 01:05:30 +0000 (01:05 +0000)]
MFC revision 1.5
date: 2008/02/16 00:16:49; author: delphij; state: Exp; lines: +2 -1
Allow underscore in domain names while resolving. While having underscore
is a violation of RFC 1034 [STD 13], it is accepted by certain name servers
as well as other popular operating systems' resolver library.
rwatson [Sat, 1 Mar 2008 15:40:53 +0000 (15:40 +0000)]
Merge uipc_sockbuf.c:1.176, uipc_socket.c:1.305, socketvar.h:1.162 from
HEAD to RELENG_7:
Further clean up sorflush:
- Expose sbrelease_internal(), a variant of sbrelease() with no
expectations about the validity of locks in the socket buffer.
- Use sbrelease_internel() in sorflush(), and as a result avoid
initializing and destroying a socket buffer lock for the temporary
stack copy of the actual buffer, asb.
- Add a comment indicating why we do what we do, and remove an XXX
since things have gotten less ugly in sorflush() lately.
This makes socket close cleaner, and possibly also marginally faster.
rwatson [Sat, 1 Mar 2008 11:55:11 +0000 (11:55 +0000)]
Merge mac_mls.c:1.99 from HEAD to RELENG_7:
Properly return the error from mls_subject_privileged() in the ifnet
relabel check for MLS rather than returning 0 directly.
This problem didn't result in a vulnerability currently as the central
implementation of ifnet relabeling also checks for UNIX privilege, and
we currently don't guarantee containment for the root user in mac_mls,
but we should be using the MLS definition of privilege as well as the
UNIX definition in anticipation of supporting root containment at some
point.
Submitted by: Zhouyi Zhou <zhouzhouyi at gmail dot com>
Sponsored by: Google SoC 2007
rwatson [Sat, 1 Mar 2008 11:50:00 +0000 (11:50 +0000)]
Merge tcp_usrreq.c:1.166 from HEAD to RELENG_7:
In tcp_ctloutput(), don't hold the inpcb lock over sooptcopyin(), rather,
drop the lock and then re-acquire it, revalidating TCP connection state
assumptions when we do so. This avoids a potential lock order reversal
(and potential deadlock, although none have been reported) due to the
inpcb lock being held over a page fault.
PR: 102752
Reviewed by: bz
Reported by: Václav Haisman <v dot haisman at sh dot cvut dot cz>
rwatson [Sat, 1 Mar 2008 11:44:30 +0000 (11:44 +0000)]
Merge netisr.h:1.34 from HEAD to RELENG_7:
Update netisr comment for the SMPng world order: netisr is no longer
implemented using the ISR facility, and cannot be triggered by calling
splnet()/splx().