]> CyberLeo.Net >> Repos - FreeBSD/stable/8.git/log
FreeBSD/stable/8.git
13 years agoMFC of 220549, tzdata2011f:
edwin [Mon, 11 Apr 2011 21:59:13 +0000 (21:59 +0000)]
MFC of 220549, tzdata2011f:

- During 2011 the Falkland Islands will remain on Summer time.

Obtained from:  ftp://elsie.nci.nih.gov/pub/

git-svn-id: svn://svn.freebsd.org/base/stable/8@220550 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

13 years agoMFC r197076,197191: apperture size printing changes
avg [Mon, 11 Apr 2011 17:49:26 +0000 (17:49 +0000)]
MFC r197076,197191: apperture size printing changes

Reduce diff to head.

On behalf of: n_hibma

git-svn-id: svn://svn.freebsd.org/base/stable/8@220544 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

13 years agoMFC r220328:
pluknet [Mon, 11 Apr 2011 09:06:11 +0000 (09:06 +0000)]
MFC r220328:

 Remove malloc type M_NETADDR unused since splitting into vfs_subr.c
 and vfs_export.c.

git-svn-id: svn://svn.freebsd.org/base/stable/8@220537 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

13 years agoMFC r220100:
kib [Mon, 11 Apr 2011 08:25:25 +0000 (08:25 +0000)]
MFC r220100:
Promote ksyms_map() and ksyms_unmap() to general facility
copyout_map() and copyout_unmap() interfaces.

MFC r220101:
Handle zero length in copyout_unmap().

MFC r220102:
Trim white spaces, adjust style.

MFC r220114:
Fix the check for vm_map_remove() error.

git-svn-id: svn://svn.freebsd.org/base/stable/8@220536 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

13 years agoMFC r220299:
trociny [Sun, 10 Apr 2011 19:31:00 +0000 (19:31 +0000)]
MFC r220299:

In g_eli_read_done() and g_eli_write_done(), for a bio with
bio_children > 1, g_destroy_bio() is never called and the bio
leaks. Fix this by calling g_destroy_bio() earlier, before the check.

Submitted by: Victor Balada Diaz <victor@bsdes.net> (initial version)

Approved by: pjd (mentor)

git-svn-id: svn://svn.freebsd.org/base/stable/8@220529 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

13 years agoMFC r220005, r220006, r220007, r220266, r220270, r220271, r220272,
trociny [Sun, 10 Apr 2011 15:48:16 +0000 (15:48 +0000)]
MFC r220005, r220006, r220007, r220266, r220270, r220271, r220272,
  r220273, r220274:

r220005 (pjd):

Use role2str() when setting process title.

r220006 (pjd):

Use timeout from configuration file not only when sending and receiving,
but also when establishing connection.

r220007 (pjd):

Add mapsize to the header just before sending the packet.
Before it could change later and we were sending invalid mapsize.
Some time ago I added optimization where when nodes are connected for the
first time and there were no writes to them yet, there is no initial full
synchronization. This bug prevented it from working.

r220266 (pjd):

Handle the problem described in r220264 by using GEOM GATE queue of unlimited
length. This should fix deadlocks reported by HAST users.

r220270 (pjd):

Allow to disable sends or receives on a socket using shutdown(2) by
interpreting NULL 'data' argument passed to proto_common_send() or
proto_common_recv() as a will to do so.

r220271 (pjd):

Declare directions for sockets between primary and secondary.
In HAST we use two sockets - one for only sending the data and one for only
receiving the data.

r220272 (pjd):

When we are operating on blocking socket and get EAGAIN on send(2) or recv(2)
this means that request timed out. Translate the meaningless EAGAIN to
ETIMEDOUT to give administrator a hint that he might need to increase timeout
in configuration file.

r220273 (pjd):

Handle ENOBUFS on send(2) by retrying for a while and logging the problem.

r220274 (pjd):

Increase default timeout from 5 seconds to 20 seconds. 5 seconds is definitely
to short under heavy load and I was experiencing those timeouts in my recent
tests.

Approved by: pjd (mentor)

git-svn-id: svn://svn.freebsd.org/base/stable/8@220525 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

13 years agoMFC r220264:
trociny [Sun, 10 Apr 2011 15:40:57 +0000 (15:40 +0000)]
MFC r220264:

r220264 (pjd):

GEOM has an internal mechanism to deal with ENOMEM errors returned via
g_io_deliver(). In such case it increases 'pace' counter on each ENOMEM and
reschedules the request. The 'pace' counter is decreased for each request going
down, but until 'pace' is greater than zero, GEOM will handle at most 10
requests per second. For GEOM GATE users that are proxy to local GEOM providers
(like ggatel(8) and HAST) we can end up with almost permanent slow down of GEOM
down queue. This is because once we reach GEOM GATE queue limit, we return
ENOMEM to the GEOM. This means that we have, eg. 1024 I/O requests in the GEOM
GATE queue. To make room in the queue and stop returning ENOMEM we need to
proceed the requests of course, but those requests are handled by userland
daemons that handle them by reading/writing also from/to local GEOM providers.
For example with HAST, a new requests comes to /dev/hast/data, which is GEOM
GATE provider. GEOM GATE passes the request to hastd(8) and hastd(8)
reads/writes from/to /dev/da0. Once we reach GEOM GATE queue limit, to free up
a slot in GEOM GATE queue, hastd(8) has to read/write from/to /dev/da0, but
this request will also be very slow, because GEOM now slows down all the
requests. We end up with full queue that we can unload at the speed of 10
requests per second. This simply looks like a deadlock.

Fix it by allowing userland daemons that work with both GEOM GATE and local
GEOM providers to specify unlimited queue size, so GEOM GATE will never return
ENOMEM to the GEOM.

Approved by: pjd (mentor)

git-svn-id: svn://svn.freebsd.org/base/stable/8@220524 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

13 years agoMFC: r220046, r220106
marius [Sun, 10 Apr 2011 09:35:42 +0000 (09:35 +0000)]
MFC: r220046, r220106

Wait until the DMA engine is stopped before unmapping buffers and
descriptors, which fixes DMA errors seen on sparc64.

git-svn-id: svn://svn.freebsd.org/base/stable/8@220513 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

13 years agoMFC r220410
np [Sun, 10 Apr 2011 01:21:02 +0000 (01:21 +0000)]
MFC r220410

Modify read/write ioctls to work with 64 bit registers too.

git-svn-id: svn://svn.freebsd.org/base/stable/8@220509 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

13 years agoMFC 220432:
gjb [Sun, 10 Apr 2011 00:29:00 +0000 (00:29 +0000)]
MFC 220432:
- u3g.4:
- remove self-reference in SEE ALSO section (originally was to s/XR/Xr)

- cxgbe.4:
- remove blank line
- add closing .El

git-svn-id: svn://svn.freebsd.org/base/stable/8@220508 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

13 years agoMFC 220382:
gjb [Sat, 9 Apr 2011 19:07:13 +0000 (19:07 +0000)]
MFC 220382:
Correct 'list scan' description in the examples.  The previous description
was incorrect - 'list scan' does not actually do a scan, but instead lists
the results of the background 'scan' cache.

git-svn-id: svn://svn.freebsd.org/base/stable/8@220504 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

13 years agoMFC r218688:
bz [Sat, 9 Apr 2011 15:27:36 +0000 (15:27 +0000)]
MFC r218688:

  Mfp4 CH=177256:

    Catch a set vnet upon return to user space. This usually
    means return paths with CURVNET_RESTORE() missing.

    If VNET_DEBUG is turned on we can even tell the function
    that did the CURVNET_SET() which is really helpful; else
    we print "N/A".

    Sponsored by: The FreeBSD Foundation
    Sponsored by: CK Software GmbH
    Reviewed by:  jhb

git-svn-id: svn://svn.freebsd.org/base/stable/8@220503 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

13 years agoMFC r218567:
bz [Sat, 9 Apr 2011 14:27:27 +0000 (14:27 +0000)]
MFC r218567:

  Mfp4 CH=177255:

    Resort the CURVNET_SET* macros in the non-VNET_DEBUG case to match
    the call order of the VNET_DEBUG case.

    Add the VNET_ASSERT() to the non-VNET_DEBUG case as well so that
    INVARIANTS will still catch problems.

    Sponsored by: The FreeBSD Foundation
    Sponsored by: CK Software GmbH
    Reviewed by:  jhb

git-svn-id: svn://svn.freebsd.org/base/stable/8@220501 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

13 years agoMFC r218559:
bz [Sat, 9 Apr 2011 13:45:13 +0000 (13:45 +0000)]
MFC r218559:

  Mfp4 CH=177255:

    Make VNET_ASSERT() available with either VNET_DEBUG or INVARIANTS.

    Change the syntax to match KASSERT() to allow more flexible panic
    messages rather than having a printf with hardcoded arguments
    before panic.

    Adjust the few assertions we have to the new format (and enhance
    the output).

    Sponsored by: The FreeBSD Foundation
    Sponsored by: CK Software GmbH
    Reviewed by:  jhb

git-svn-id: svn://svn.freebsd.org/base/stable/8@220495 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

13 years agoMFC r218555:
bz [Sat, 9 Apr 2011 13:19:44 +0000 (13:19 +0000)]
MFC r218555:

  Mfp4 CH=177255:

    Use __func__ rather than __FUNCTION__.

git-svn-id: svn://svn.freebsd.org/base/stable/8@220494 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

13 years agoMFC r217736:
bz [Sat, 9 Apr 2011 12:52:41 +0000 (12:52 +0000)]
MFC r217736:

  Add an svn:ignore property for _.{TARGETS,tinderbox}.* in the toplevel
  directory to ignore those file patters in svn status, add and import.

git-svn-id: svn://svn.freebsd.org/base/stable/8@220492 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

13 years agoMFC r217735:
bz [Sat, 9 Apr 2011 12:42:40 +0000 (12:42 +0000)]
MFC r217735:

  Make `make tinderbox` work with MAKEOBJDIRPREFIX set (or in possibly other
  combinations) by forcing FAILFILE into .CURDIR as we do for all other
  universe output files. [1]  Similarly make FAILFILE start with "_." as well.

  Reviewed by:  silence-on-src [1]

git-svn-id: svn://svn.freebsd.org/base/stable/8@220491 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

13 years agoMFC r219570:
bz [Sat, 9 Apr 2011 12:35:08 +0000 (12:35 +0000)]
MFC r219570:

  Push a possible "unbind" in some situation from in6_pcbsetport() to
  callers.  This also fixes a problem when the prison call could set
  the inp->in6p_laddr (laddr) and a following priv_check_cred() call
  would return an error and will allow us to merge the IPv4 and IPv6
  implementation.

git-svn-id: svn://svn.freebsd.org/base/stable/8@220489 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

13 years agoMFC r219562:
bz [Sat, 9 Apr 2011 12:11:19 +0000 (12:11 +0000)]
MFC r219562:

  Make sure the locally cached value of rt->rt_gateway stays stable,
  even after dropping the reference and unlocking. Previously we
  have dereferenced a NULL pointer (after r121765).
  Simply unlocking after the block does not work either because of
  lock ordering (see r121765) and in addition we would still hold
  a pointer to something that might be gone by the time we access it.
  Thus take a copy of the value rather than just caching the pointer.

  Submitted by: chenyl (netstar2008 126.com) (initial version)
PR: kern/151908

git-svn-id: svn://svn.freebsd.org/base/stable/8@220487 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

13 years agoMFC r219775:
bz [Sat, 9 Apr 2011 12:04:35 +0000 (12:04 +0000)]
MFC r219775:

  For now remove options FLOWTABLE from the remaining GENERIC kernel
  configurations and make it opt-in for those who want it.  LINT will
  still build it.

  While it may be a perfect win in some scenarios, it still troubles users
  (see PRs) in general cases.  In addition we are still allocating resources
  even if disabled by sysctl and still leak arp/nd6 entries in case of
  interface destruction.

  Discussed with: qingli (2010-11-24, just never executed)
  Discussed with: juli (OCTEON1)
PR: kern/148018, kern/155604, kern/144917, kern/146792

git-svn-id: svn://svn.freebsd.org/base/stable/8@220486 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

13 years agoMFC r220247:
bz [Sat, 9 Apr 2011 10:53:36 +0000 (10:53 +0000)]
MFC r220247:

  Do not allow directly recursive RFC3173 IPComp payload.

Security: CVE-2011-1547

git-svn-id: svn://svn.freebsd.org/base/stable/8@220483 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

13 years agoMFC r219597:
bz [Sat, 9 Apr 2011 10:45:22 +0000 (10:45 +0000)]
MFC r219597:

  Cross-reference ip(4) rather than sysctl(8) for the global, shared MIB
  values to control the various port ranges. ip(4) describes these in detail.

git-svn-id: svn://svn.freebsd.org/base/stable/8@220482 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

13 years agoMFC r219580:
bz [Sat, 9 Apr 2011 10:44:01 +0000 (10:44 +0000)]
MFC r219580:

  INET6 for some time needed in_pcb.c so make sure we compile it in case of
  no inet.

git-svn-id: svn://svn.freebsd.org/base/stable/8@220480 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

13 years agoMFC r219206:
bz [Sat, 9 Apr 2011 10:36:33 +0000 (10:36 +0000)]
MFC r219206:

  Hide the outer IP addresses of a tunnel interfaces (gif(4), gre(4))
  from processes inside jails if the addresses do not belong to the jail.

  Originally reported by: Pieter de Boer via remko
  Tested by: Piotr KUCHARSKI (nospam 42.pl) [gif]
PR: kern/151119

git-svn-id: svn://svn.freebsd.org/base/stable/8@220478 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

13 years agoMFC r219184:
bz [Sat, 9 Apr 2011 10:19:25 +0000 (10:19 +0000)]
MFC r219184:

  Prevent crashes from a race when (cloned) interfaces go away.

PR:             bin/152143
  Submitted by: Przemyslaw Frasunek (przemyslaw frasunek.com)
  Tested by:    Przemyslaw Frasunek (przemyslaw frasunek.com)

git-svn-id: svn://svn.freebsd.org/base/stable/8@220476 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

13 years agoMFC r220031: linux compat: improve and fix sendmsg/recvmsg compatibility
avg [Sat, 9 Apr 2011 08:52:22 +0000 (08:52 +0000)]
MFC r220031: linux compat: improve and fix sendmsg/recvmsg compatibility

PR: kern/149168

git-svn-id: svn://svn.freebsd.org/base/stable/8@220469 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

13 years agoMFC r220030: drop dummy definitions
avg [Sat, 9 Apr 2011 08:43:57 +0000 (08:43 +0000)]
MFC r220030: drop dummy definitions

PR: kern/149168

git-svn-id: svn://svn.freebsd.org/base/stable/8@220468 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

13 years agoRegen for r220466
avg [Sat, 9 Apr 2011 08:31:50 +0000 (08:31 +0000)]
Regen for r220466

PR: kern/149168

git-svn-id: svn://svn.freebsd.org/base/stable/8@220467 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

13 years agoMFC r220028: linux compat: add non-dummy capget and capset system calls
avg [Sat, 9 Apr 2011 08:29:07 +0000 (08:29 +0000)]
MFC r220028: linux compat: add non-dummy capget and capset system calls

PR: kern/149168

git-svn-id: svn://svn.freebsd.org/base/stable/8@220466 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

13 years agoMFC r220249,220252:
yongari [Fri, 8 Apr 2011 19:06:01 +0000 (19:06 +0000)]
MFC r220249,220252:
r220249:
  64bit DMA caused data corruption. Unfortunately there is no known
  workaround to use 64bit DMA.
  Disable 64bit DMA on Attansic L1 controller.

  Tested by: Yamagi Burmeister (lists <> yamagi dot org)

r220252:
  Partially revert r184106. RX buffer ring also needs bus_dmamap_sync().

  Tested by: Yamagi Burmeister (lists <> yamagi dot org)

git-svn-id: svn://svn.freebsd.org/base/stable/8@220457 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

13 years agoMFH r219446-219449:
uqs [Fri, 8 Apr 2011 18:31:01 +0000 (18:31 +0000)]
MFH r219446-219449:

- Remove bsdlabel.5
- Remove bsdlabel test-script that was full of broken assumptions
- Remove dead code depending on __alpha__
- Widen fields that display partition offset/length.

git-svn-id: svn://svn.freebsd.org/base/stable/8@220455 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

13 years agoMFC r220004: rtld: eliminate double call to close(2) that may occur in load_object
avg [Fri, 8 Apr 2011 06:50:26 +0000 (06:50 +0000)]
MFC r220004: rtld: eliminate double call to close(2) that may occur in load_object

git-svn-id: svn://svn.freebsd.org/base/stable/8@220440 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

13 years agoMFC r220304.
hselasky [Fri, 8 Apr 2011 06:37:22 +0000 (06:37 +0000)]
MFC r220304.
- Fix for missing event if a libUSB USB transfer is started and
  stopped rapidly in succession.

git-svn-id: svn://svn.freebsd.org/base/stable/8@220439 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

13 years agoMFC r219395.
hselasky [Fri, 8 Apr 2011 06:20:43 +0000 (06:20 +0000)]
MFC r219395.
- Bugfix: Root HUBs do not support re-enumeration.

Approved by: thompsa (mentor)

git-svn-id: svn://svn.freebsd.org/base/stable/8@220436 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

13 years agoMFC r220303
hselasky [Fri, 8 Apr 2011 06:13:19 +0000 (06:13 +0000)]
MFC r220303
- Correct EHCI interrupt disabling at detach.

Approved by: thompsa (mentor)

git-svn-id: svn://svn.freebsd.org/base/stable/8@220435 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

13 years agoMFC r219100
hselasky [Fri, 8 Apr 2011 05:48:51 +0000 (05:48 +0000)]
MFC r219100
- Add support for software pre-scaling of ISOCHRONOUS transfers.

Approved by: thompsa (mentor)

git-svn-id: svn://svn.freebsd.org/base/stable/8@220434 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

13 years agoMFC r198374:
emaste [Thu, 7 Apr 2011 14:17:55 +0000 (14:17 +0000)]
MFC r198374:
  Rename default to default_function, for compatibility with GNU awk.
  (For cross-compiling out-of-tree kernel modules, for example.)

git-svn-id: svn://svn.freebsd.org/base/stable/8@220425 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

13 years agoMFC r220211:
ae [Thu, 7 Apr 2011 11:13:50 +0000 (11:13 +0000)]
MFC r220211:
  Fill up src_port and dst_port variables for SCTP over IPv4.

  PR: kern/153415

git-svn-id: svn://svn.freebsd.org/base/stable/8@220415 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

13 years agoMFC of r220172
edwin [Thu, 7 Apr 2011 07:34:01 +0000 (07:34 +0000)]
MFC of r220172

Add a menu entry for UTC in the main menu.

PR:             bin/156019
Submitted by:   Daniel O'Conner

git-svn-id: svn://svn.freebsd.org/base/stable/8@220411 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

13 years agoMFC r220204:
ae [Thu, 7 Apr 2011 06:02:21 +0000 (06:02 +0000)]
MFC r220204:
  Fix malloc types.

git-svn-id: svn://svn.freebsd.org/base/stable/8@220409 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

13 years agoMFC r220203:
ae [Thu, 7 Apr 2011 06:01:09 +0000 (06:01 +0000)]
MFC r220203:
  Fix a memory leak. Memory that is allocated for schedulers hash table
  was not freed.

  PR: kern/156083

git-svn-id: svn://svn.freebsd.org/base/stable/8@220408 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

13 years agoMFC r220184:
ae [Thu, 7 Apr 2011 05:58:21 +0000 (05:58 +0000)]
MFC r220184:
  Remove unneeded checks, g_new_xxx functions can not return NULL.

git-svn-id: svn://svn.freebsd.org/base/stable/8@220407 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

13 years agoMFhead 220317:
glebius [Wed, 6 Apr 2011 18:03:49 +0000 (18:03 +0000)]
MFhead 220317:
  When removing ifnets, we should first remove the reference to ifnet
  from the interface index, then decrease refcount, not vice versa.

  Otherwise there is a race (reproducible) when if_free_internal()
  contests on IFNET_WLOCK(), and we got a zero-refed ifnet in the
  index for a long time. It may be picked by some other thread,
  that runs ifnet_byindex_ref(), who takes the ifnet from index,
  and bumps refcount. When reader drops the lock, if_free_internal()
  proceeds with free. Then reader tries to free it a second time.

git-svn-id: svn://svn.freebsd.org/base/stable/8@220397 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

13 years agoMFhead 219904:
glebius [Wed, 6 Apr 2011 18:00:26 +0000 (18:00 +0000)]
MFhead 219904:
  Fix SYNOPSIS.

git-svn-id: svn://svn.freebsd.org/base/stable/8@220396 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

13 years agoMFhead 219858:
glebius [Wed, 6 Apr 2011 17:58:59 +0000 (17:58 +0000)]
MFhead 219858:
  Give better URL to the list of available CVSup mirrors.

git-svn-id: svn://svn.freebsd.org/base/stable/8@220395 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

13 years agoMFhead 219827:
glebius [Wed, 6 Apr 2011 17:57:08 +0000 (17:57 +0000)]
MFhead 219827:

  Improve locking of creating and dropping links in the graph, acquiring
  the topology mutex in the following functions, that manipulate pointers
  to peer nodes:

  - ng_bypass()
  - ng_path2noderef() when switching to the next node in sequence.
    Rewrite the function a bit.
  - ng_address_hook()
  - ng_address_path()

  This patch improves stability of large mpd5 installations.

git-svn-id: svn://svn.freebsd.org/base/stable/8@220394 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

13 years agoMFhead 215790:
glebius [Wed, 6 Apr 2011 17:56:18 +0000 (17:56 +0000)]
MFhead 215790:

  Redo r166423. It is important not only skip freeing multicast
  entires when underlying interface is detached, but also purge
  pointers to them, to avoid double-free in future.

git-svn-id: svn://svn.freebsd.org/base/stable/8@220393 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

13 years agoMFhead r196527,204406,216296-216297:
glebius [Wed, 6 Apr 2011 17:54:10 +0000 (17:54 +0000)]
MFhead r196527,204406,216296-216297:

  ------------------------------------------------------------------------
  r196527 | charnier | 2009-08-25 08:09:09 +0400 (вт, 25 авг 2009) | 3 lines

  ANSIfy functions declarations, adjust prototypes. Rename local variable
  to not conflict with err().

  ------------------------------------------------------------------------
  r204406 | uqs | 2010-02-27 13:18:33 +0300 (сб, 27 фев 2010) | 12 lines

  route(8): make WARNS=3 clean

  - add static and const where appropriate
  - check pointers against NULL
  - minor styling nits
  - it is actually WARNS=6 clean for non-strict alignment platforms

  ------------------------------------------------------------------------
  r216296 | glebius | 2010-12-08 18:10:27 +0300 (ср, 08 дек 2010) | 5 lines

  Add RTM_IEEE80211 to array of route message descriptions.

  ------------------------------------------------------------------------
  r216297 | glebius | 2010-12-08 18:12:37 +0300 (ср, 08 дек 2010) | 7 lines

  - Fix array bounds checking. [1]
  - Add message length checking.

git-svn-id: svn://svn.freebsd.org/base/stable/8@220391 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

13 years agoMFC 219850:
gjb [Wed, 6 Apr 2011 11:13:55 +0000 (11:13 +0000)]
MFC 219850:
s/buffer/buf as is used in the code.

git-svn-id: svn://svn.freebsd.org/base/stable/8@220380 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

13 years agoRegen
kib [Wed, 6 Apr 2011 11:12:51 +0000 (11:12 +0000)]
Regen

git-svn-id: svn://svn.freebsd.org/base/stable/8@220379 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

13 years agoMFC r220158:
kib [Wed, 6 Apr 2011 11:12:05 +0000 (11:12 +0000)]
MFC r220158:
Provide compat32 shims for kldstat(2).

git-svn-id: svn://svn.freebsd.org/base/stable/8@220378 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

13 years agoMFC r218877 from head: Document our complex(3) support in libm.
murray [Tue, 5 Apr 2011 04:23:08 +0000 (04:23 +0000)]
MFC r218877 from head:  Document our complex(3) support in libm.

git-svn-id: svn://svn.freebsd.org/base/stable/8@220353 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

13 years agoMFC r220124:
ae [Tue, 5 Apr 2011 04:18:42 +0000 (04:18 +0000)]
MFC r220124:
  Do not build ip_fw_nat.c for ipfw.ko. It can be build as separate module.

git-svn-id: svn://svn.freebsd.org/base/stable/8@220352 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

13 years agoMFC r219938:
yongari [Mon, 4 Apr 2011 20:44:26 +0000 (20:44 +0000)]
MFC r219938:
  Remove unused DMA map/tag in softc.

git-svn-id: svn://svn.freebsd.org/base/stable/8@220344 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

13 years agoMFC r220103:
yongari [Mon, 4 Apr 2011 20:40:39 +0000 (20:40 +0000)]
MFC r220103:
  Normally fxp(4) does not receive bad frames but promiscuous mode
  makes controller to receive bad frames and i82557 will also receive
  bad frames since fxp(4) have to receive VLAN oversized frames. If
  fxp(4) encounter DMA overrun error, the received frame size would
  be 0 so the actual frame size after checksum field extraction the
  length would be negative(-2). Due to signed/unsigned comparison
  used in driver, frame length check did not work for DMA overrun
  frames. Correct this by casting it to int.
  While I'm here explicitly check DMA overrun error and discard the
  frame regardless of result of received frame length check.

  Reported by: n_hibma
  Tested by: n_hibma

git-svn-id: svn://svn.freebsd.org/base/stable/8@220342 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

13 years agoMFC r219945, r219946, r220009
np [Mon, 4 Apr 2011 20:01:09 +0000 (20:01 +0000)]
MFC r219945, r219946, r220009

r219945:
T3C initialization should setup the parity fence too.

r219946:
t3_free_sge_resources should be given the number of qsets it needs to free.

r220009:
Update T3 firmware to 7.11.0

git-svn-id: svn://svn.freebsd.org/base/stable/8@220340 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

13 years agoMFC r220231, r220232
np [Mon, 4 Apr 2011 18:47:17 +0000 (18:47 +0000)]
MFC r220231, r220232

r220231:
Allow multiple modules within sys/modules/cxgbe.  The first one is if_cxgbe.

r220232:
Update header and related code for firmware 1.3.8

git-svn-id: svn://svn.freebsd.org/base/stable/8@220339 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

13 years agoMFC r220055: getlogin() may return NULL.
ume [Mon, 4 Apr 2011 14:54:52 +0000 (14:54 +0000)]
MFC r220055: getlogin() may return NULL.

git-svn-id: svn://svn.freebsd.org/base/stable/8@220326 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

13 years agoMFC r219828:
pluknet [Mon, 4 Apr 2011 09:56:10 +0000 (09:56 +0000)]
MFC r219828:

 Reference ifaddr object before unlocking as it can be freed
 from another context at the moment of later access.

PR: kern/155555
Submitted by: Andrew Boyer <aboyer att averesystems.com>

git-svn-id: svn://svn.freebsd.org/base/stable/8@220322 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

13 years agoMFC r220157:
pluknet [Mon, 4 Apr 2011 09:36:29 +0000 (09:36 +0000)]
MFC r220157:

Use FD_CLOEXEC explicitly.

git-svn-id: svn://svn.freebsd.org/base/stable/8@220320 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

13 years agoMFC r220253:
kib [Mon, 4 Apr 2011 08:04:32 +0000 (08:04 +0000)]
MFC r220253:
Fix mdoc errors.

git-svn-id: svn://svn.freebsd.org/base/stable/8@220318 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

13 years agoMFC r219848.
hselasky [Sun, 3 Apr 2011 22:21:40 +0000 (22:21 +0000)]
MFC r219848.
- Update format of sysctl node.

Approved by: thompsa (mentor)

git-svn-id: svn://svn.freebsd.org/base/stable/8@220310 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

13 years agoMFC r219845, r219930, r219949 and r219983.
hselasky [Sun, 3 Apr 2011 22:15:00 +0000 (22:15 +0000)]
MFC r219845, r219930, r219949 and r219983.
- Use software to compute EHCI data toggle instead of hardware.
- Fix EHCI initialisation order with regard to debug prints.

Approved by: thompsa (mentor)

git-svn-id: svn://svn.freebsd.org/base/stable/8@220309 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

13 years agoMFC r219048, r219004, r218475 and r204632.
hselasky [Sun, 3 Apr 2011 22:01:26 +0000 (22:01 +0000)]
MFC r219048, r219004, r218475 and r204632.
- The NetBSD Foundation has granted permission to remove clause 3 and 4 from
  their software.
- use device_printf() instead of printf() to give more accurate warnings.
- use memcpy() instead of bcopy().
- add missing #if's for non-FreeBSD compilation.
- Add missing xhci(4) manual page.
- Minor update in some USB manual pages.
- Correct USB 3.0 wire-speed to 5.0Gbps

Approved by: thompsa (mentor)

git-svn-id: svn://svn.freebsd.org/base/stable/8@220308 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

13 years agoMFC r217374
hselasky [Sun, 3 Apr 2011 21:12:16 +0000 (21:12 +0000)]
MFC r217374
Add support for 64-byte contexts to XHCI driver.

Approved by: thompsa (mentor)

git-svn-id: svn://svn.freebsd.org/base/stable/8@220307 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

13 years agoMFC r213434
hselasky [Sun, 3 Apr 2011 21:01:36 +0000 (21:01 +0000)]
MFC r213434
Add missing #if's

Approved by: thompsa (mentor)

git-svn-id: svn://svn.freebsd.org/base/stable/8@220306 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

13 years agoMFC r213433
hselasky [Sun, 3 Apr 2011 20:54:32 +0000 (20:54 +0000)]
MFC r213433
Tighten USB string filtering.

Approved by: thompsa (mentor)

git-svn-id: svn://svn.freebsd.org/base/stable/8@220305 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

13 years agoMFC r220062, r220173:
trociny [Sun, 3 Apr 2011 18:56:16 +0000 (18:56 +0000)]
MFC r220062, r220173:

r220062:

In g_gate_create() there is a window between when g_gate_softc is
registered in g_gate_units array and when its sc_provider field is
filled. If during this period g_gate_units is accessed by another
thread that is checking for provider name collision the crash is
possible.

Fix this by adding sc_name field to struct g_gate_softc. In
g_gate_create() when g_gate_softc is created but sc_provider is still
not sc_name points to provider name stored in the local array.

Reported by:    Freddie Cash <fjwcash@gmail.com>

r220173:

Increase debug level on g_gate device destruction and add message on
device creation.

Suggested by:   danger

Approved by: pjd (mentor)

git-svn-id: svn://svn.freebsd.org/base/stable/8@220300 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

13 years agoMFC r216224:
jh [Sun, 3 Apr 2011 08:44:57 +0000 (08:44 +0000)]
MFC r216224:

Don't write the terminating NUL past end of buffer.

PR: bin/152345

git-svn-id: svn://svn.freebsd.org/base/stable/8@220291 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

13 years agoMFC of 220286, tzdata2011e:
edwin [Sun, 3 Apr 2011 03:43:47 +0000 (03:43 +0000)]
MFC of 220286, tzdata2011e:

Change for Africa/Casablanca:
- The 3rd april 2011 at 00:00:00, [it] will be 3rd april 1:00:00
- The 31th july 2011 at 00:59:59,  [it] will be 31th July 00:00:00

Update for SouthAmerica/Chili:
- Chile's clocks will go back an hour this year on the 7th of May instead
  of this Saturday. They will go forward again the 3rd Saturday in
  August, not in October as they have since 1968. This is a pilot plan
  which will be reevaluated in 2012.

git-svn-id: svn://svn.freebsd.org/base/stable/8@220287 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

13 years agoMFC r220043:
kib [Sat, 2 Apr 2011 11:10:36 +0000 (11:10 +0000)]
MFC r220043:
Print the raw value of si_code, that is esp. useful for undecoded values.

Sponsored by: The FreeBSD Foundation

git-svn-id: svn://svn.freebsd.org/base/stable/8@220278 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

13 years agoMFC r219364:
dchagin [Sat, 2 Apr 2011 08:45:13 +0000 (08:45 +0000)]
MFC r219364:

Remove dead (since r190620) code.

git-svn-id: svn://svn.freebsd.org/base/stable/8@220269 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

13 years agoMFC r219043:
dchagin [Sat, 2 Apr 2011 08:29:02 +0000 (08:29 +0000)]
MFC r219043:

Teach kdump to understand sv_flags records in the trace files.

MFC r219044:

Update manual page to reflect latest changes of ABI description support.

MFC r219138:

Teach kdump to understand linux syscalls names too.

Fix bug introduced in r219043: the kernel always dump native
signal numbers, so no need to check the ABI in ktrpsig().

git-svn-id: svn://svn.freebsd.org/base/stable/8@220267 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

13 years agoMFC r219041:
dchagin [Sat, 2 Apr 2011 06:13:31 +0000 (06:13 +0000)]
MFC r219041:

ktrace_resize_pool() locking slightly reworked:
1) do not take a lock around the single atomic operation.
2) do not lose the invariant of lock by dropping/acquiring
   ktrace_mtx around free() or malloc().

MFC r219042:

Introduce preliminary support of the show description of the ABI of
traced process by adding two new events which records value of process
sv_flags to the trace file at process creation/execing/exiting time.

MFC r219311:

Partially rework r219042.
The reason for this is a bug at ktrops() where process dereferenced
without having a lock. This might cause a panic if ktrace was runned
with -p flag and the specified process exited between the dropping
a lock and writing sv_flags.

Since it is impossible to acquire sx lock while holding mtx switch
to use asynchronous enqueuerequest() instead of writerequest().

Rename ktr_getrequest_ne() to more understandable name.

MFC r219312:

Fix indentation in comment, double ';' in variable declaration.

git-svn-id: svn://svn.freebsd.org/base/stable/8@220262 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

13 years agoMFC r219084:
delphij [Fri, 1 Apr 2011 18:23:44 +0000 (18:23 +0000)]
MFC r219084:

Accept == as an alias of = which is a popular GNU extension.

This is intentionally undocumented for now since it's not part
of any standard.

git-svn-id: svn://svn.freebsd.org/base/stable/8@220250 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

13 years agoMFC r220014:
kib [Fri, 1 Apr 2011 14:04:36 +0000 (14:04 +0000)]
MFC r220014:
Report EBUSY instead of EROFS for attempt of deleting or renaming the
root directory of msdosfs mount.

git-svn-id: svn://svn.freebsd.org/base/stable/8@220246 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

13 years agoMFC r219989:
kib [Fri, 1 Apr 2011 13:23:53 +0000 (13:23 +0000)]
MFC r219989:
Implement compat32 MEMRANGE_GET and MEMRANGE_SET.

git-svn-id: svn://svn.freebsd.org/base/stable/8@220244 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

13 years agoMFC r219988:
kib [Fri, 1 Apr 2011 13:20:39 +0000 (13:20 +0000)]
MFC r219988:
Fully emulate MDIOCLIST for compat32.

git-svn-id: svn://svn.freebsd.org/base/stable/8@220243 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

13 years agoMFC r220000:
kib [Fri, 1 Apr 2011 12:52:55 +0000 (12:52 +0000)]
MFC r220000:
Document O_CLOEXEC.

git-svn-id: svn://svn.freebsd.org/base/stable/8@220242 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

13 years agoMFC r219999:
kib [Fri, 1 Apr 2011 12:50:29 +0000 (12:50 +0000)]
MFC r219999:
Add O_CLOEXEC flag to open(2) and fhopen(2).

git-svn-id: svn://svn.freebsd.org/base/stable/8@220241 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

13 years agoMFC r219963:
pluknet [Thu, 31 Mar 2011 08:55:00 +0000 (08:55 +0000)]
MFC r219963:

 Add missing resource limits:
 - RLIMIT_NPTS
 - RLIMIT_SWAP

git-svn-id: svn://svn.freebsd.org/base/stable/8@220189 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

13 years agoMFC of 198254, 198255, 198350, 198267, 209190, 208831, 208830, 210243
edwin [Thu, 31 Mar 2011 06:29:15 +0000 (06:29 +0000)]
MFC of 198254, 198255, 198350, 198267, 209190, 208831, 208830, 210243

198254:
When tzsetup is run as non-root and the "CMOS clock question on
UTC" is answered as No, it would abort without properly ending the
dialog session.

198255:
Make the usage of the default zoneinfo file to install clearer.

198350:
- Add support for chrooted installs.
- Add examples to the man-page.

198267:
Instead of having to know which timezone was picked last time, you
now can run "tzsetup -r" which will reinstall the last choice. This
data is recorded in /var/db/zoneinfo.

209190:
Use literal format strings.  Found by clang.

208831:
Add comment that this value is unused.
It is obvious that it isn't used, but both clang and Coverity talk about it.

208830:
When there is a problem with writing, also bail out.

Found with the clang checker.

210243:
Fix support for chrooted installs.

git-svn-id: svn://svn.freebsd.org/base/stable/8@220183 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

13 years agoMFC r219351, r219354, r219369, r219370, r219371, r219372, r219373,
trociny [Tue, 29 Mar 2011 20:58:25 +0000 (20:58 +0000)]
MFC r219351, r219354, r219369, r219370, r219371, r219372, r219373,
  r219385, r219482, r219620, r219669, r219721, r219813, r219814,
  r219815, r219816, r219817, r219818, r219821, r219830, r219831,
  r219832, r219833, r219837, r219844, r219864, r219873, r219879,
  r219882, r219884, r219887, r219900:

r219351 (pjd):

Allow to checksum on-the-wire data using either CRC32 or SHA256.

r219354 (pjd):

Allow to compress on-the-wire data using two algorithms:
- HOLE - it simply turns all-zero blocks into few bytes header;
        it is extremely fast, so it is turned on by default;
        it is mostly intended to speed up initial synchronization
        where we expect many zeros;
- LZF - very fast algorithm by Marc Alexander Lehmann, which shows
        very decent compression ratio and has BSD license.

r219369 (pjd):

Provides three states for pjdlog_initialized, so we can also tell that
this is fist initialization ever.

r219370 (pjd), r219385 (pjd):

- Turn on printf extentions.
- Load support for %T for pritning time.
- Add support for %N for printing number in human readable form.
- Add support for %S for printing sockaddr structure (currently only AF_INET
  family is supported, as this is all we need in HAST).
- Disable gcc compile-time format checking as this will no longer work.

r219371 (pjd):

Use %S to print IP address and port number.

r219372 (pjd):

- Log size of data to synchronize in human readable form (using %N).
- Log synchronization time (using %T).
- Log synchronization speed in human readable form (using %N).

r219373 (pjd):

Print some of the numbers in human readable form (using %N).

r219482:

Make workers inherit debug level from the main process.

r219620 (pjd):

In command line options allow size to be specified using k/M/G/T
suffixes.

r219669 (pjd):

Remove #include needed for debugging.

r219721:

For secondary, set 2 * HAST_KEEPALIVE seconds timeout for incoming
connection so the worker will exit if it does not receive packets from
the primary during this interval.

Reported by:    Christian Vogt <Christian.Vogt@haw-hamburg.de>
Tested by:      Christian Vogt <Christian.Vogt@haw-hamburg.de>

r219813 (pjd):

If there is any traffic on one of out descriptors, we were not checking for
long running hooks. Fix it by not using select(2) timeout to decide if we want
to check hooks or not.

r219814 (pjd):

When creating connection on behalf of primary worker, set pjdlog prefix
to resource name and role, so that any logs related to that can be identified
properly.

r219815 (pjd):

Add snprlcat() and vsnprlcat() - the functions I'm always missing.
They work as a combination of snprintf(3) and strlcat(3) - the caller
can append a string build based on the given format.

r219816 (pjd):

Use snprlcat() instead of two strlcat(3)s.

r219817 (pjd):

Log when we start hooks checking and when we execute a hook.

r219818 (pjd), r219821 (pjd):

In hast.conf we define the other node's address in 'remote' variable.
This way we know how to connect to secondary node when we are primary.
The same variable is used by the secondary node - it only accepts
connections from the address stored in 'remote' variable.
In cluster configurations it is common that each node has its individual
IP address and there is one addtional shared IP address which is assigned
to primary node. It seems it is possible that if the shared IP address is
from the same network as the individual IP address it might be choosen by
the kernel as a source address for connection with the secondary node.
Such connection will be rejected by secondary, as it doesn't come from
primary node individual IP.

Add 'source' variable that allows to specify source IP address we want to
bind to before connecting to the secondary node.

r219821 (pjd):

Forgot to commit this as a part of r219818.

r219830 (pjd):

Detect situation where resource internal identifier differs.
This means that both nodes have separately managed resources that don't
have the same data.

r219831 (pjd):

Be pedantic and free nvout before exiting.

r219832 (pjd):

Increase debug level of "Checking hooks." message.

r219833 (pjd):

Remove stale comment. Yes, it is valid to set role back to init.

r219837 (pjd):

Before handling any events on descriptors check signals so we can update
our info about worker processes if any of them was terminated in the meantime.

This fixes the problem with 'hastctl status' running from a hook called on
split-brain:
1. Secondary calls a hooks and terminates.
2. Hook asks for resource status via 'hastctl status'.
3. The main hastd handles the status request by sending it to the secondary
   worker who is already dead, but because signals weren't checked yet he
   doesn't know that and we get EPIPE.

r219843 (pjd):

Fix typo.

r219844 (pjd):

Initialize localcnt on first write. This fixes assertion when we create
resource, set role to primary, do no writes, then sent it to secondary
and accept connection from primary.

r219864 (pjd):

White space cleanups.

r219873 (pjd), r219873 (pjd):

The proto API is a general purpose API, so don't use 'hast' in structures or
function names. It can now be used outside of HAST.

r219879:

For requests that are sent only to remote component use the
error from remote.

r219882:

After synchronization is complete we should make primary counters be
equal to secondary counters:

  primary_localcnt = secondary_remotecnt
  primary_remotecnt = secondary_localcnt

Previously it was done wrong and split-brain was observed after
primary had synchronized up-to-date data from secondary.

r219887 (pjd):

Add pjd copyright.

r219900 (pjd):

Don't create socketpair for connection forwarding between parent and secondary.
Secondary doesn't need to connect anywhere.

Approved by: pjd (mentor)

git-svn-id: svn://svn.freebsd.org/base/stable/8@220151 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

13 years agoMFC r219368:
trociny [Tue, 29 Mar 2011 17:59:30 +0000 (17:59 +0000)]
MFC r219368:

r219368 (pjd):

To be able to use printf extensions we need to turn off gcc format checking.
Following the convention of NO_WERROR and NO_WCAST_ALIGN add NO_WFORMAT,
which, when defined in Makefile, turns off compile-time format checking
(by adding -Wno-format), but still allows to use high WARNS level.

Approved by: kib (co-mentor), pjd (mentor)

git-svn-id: svn://svn.freebsd.org/base/stable/8@220141 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

13 years agoMFC r219343:
trociny [Tue, 29 Mar 2011 17:57:40 +0000 (17:57 +0000)]
MFC r219343:

r219343 (pjd):

Include stdio.h, so we can include printf.h in any order, as it needs FILE.

Approved by: kib (co-mentor), pjd (mentor)

git-svn-id: svn://svn.freebsd.org/base/stable/8@220140 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

13 years agoMFC r200035, r219344:
trociny [Tue, 29 Mar 2011 17:55:15 +0000 (17:55 +0000)]
MFC r200035, r219344:

Bring in missing headers and primitive type declarations into <libutil.h> to
make it work when included by itself.

r200035 (ed):

Make <libutil.h> work when included by itself.

There are several reasons why it didn't work:

- It was missing <sys/cdefs.h> for __BEGIN_DECLS.
- It uses various primitive types that were not declared.

r219344 (pjd):

expand_number() needs uint64_t, declare it here if not already declared.

Approved by: kib (co-mentor), pjd (mentor)

git-svn-id: svn://svn.freebsd.org/base/stable/8@220139 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

13 years agoMFC r219342, r219346:
trociny [Tue, 29 Mar 2011 17:52:45 +0000 (17:52 +0000)]
MFC r219342, r219346:

r219342 (pjd):

Fix various issues in how %#T is handled:
- If precision is 0, don't print period followed by no digits.
- If precision is 0 stop printing units as soon as possible
  (eg. if we have three years and five days and precision is 0
   print only 3y5d).
- If precision is not 0, print all units (eg. 3y0d0h0m0s.00).

r219346 (pjd):

Because we call __printf_out() with a on-stack buffer, also call
__printf_flush() so we are sure it won't be referenced after we return.

Approved by: kib (co-mentor), pjd (mentor)

git-svn-id: svn://svn.freebsd.org/base/stable/8@220138 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

13 years agoMFC r220041:
ru [Tue, 29 Mar 2011 11:54:22 +0000 (11:54 +0000)]
MFC r220041:
  Fixed sockets display somewhat (-L, -T, -x, -Lx, with and without -A).
  (I didn't try to fix negative TCP timers with -x.)

Also, fixed a mismerge of -T option in r216964 -- it erroneously added
headers for TCP timers to -x.

git-svn-id: svn://svn.freebsd.org/base/stable/8@220125 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

13 years agoMFC r219803: index(3): Mention that index/rindex are deprecated and not
jilles [Mon, 28 Mar 2011 22:50:02 +0000 (22:50 +0000)]
MFC r219803: index(3): Mention that index/rindex are deprecated and not
specified by POSIX.1-2008.

git-svn-id: svn://svn.freebsd.org/base/stable/8@220115 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

13 years agoMFC r220020:
dougb [Mon, 28 Mar 2011 19:39:53 +0000 (19:39 +0000)]
MFC r220020:

Add a daily period script to back up /var/db/pkg

MFC r220049:

Hook the 220.backup-pkgdb script I added to the build unconditionally
Hook up 610.ipf6denied based on MK_IPFILTER as 510.ipfdenied is now

git-svn-id: svn://svn.freebsd.org/base/stable/8@220112 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

13 years agoMFC r220015:
dougb [Mon, 28 Mar 2011 19:32:16 +0000 (19:32 +0000)]
MFC r220015:

An EXAMPLE for <include>

git-svn-id: svn://svn.freebsd.org/base/stable/8@220111 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

13 years agoMFC r219587, r220017, r220048
dougb [Mon, 28 Mar 2011 19:22:55 +0000 (19:22 +0000)]
MFC r219587, r220017, r220048

Adjust svn:executable properties

git-svn-id: svn://svn.freebsd.org/base/stable/8@220107 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

13 years agoMFC r217729, r217730, r217731, r217732, r217737, r217784, r217958,
trociny [Mon, 28 Mar 2011 17:41:10 +0000 (17:41 +0000)]
MFC r217729, r217730, r217731, r217732, r217737, r217784, r217958,
  r217961, r217962, r217964, r217965, r217966, r217967, r217969,
  r218040, r218041, r218042, r218043, r218044, r218045, r218048,
  r218049, r218119, r218132, r218138, r218139, r218147, r218148,
  r218158, r218185, r218191, r218192, r218193, r218194, r218201,
  r218214, r218215, r218217, r218218, r218370, r218373, r218374,
  r218375, r218376, r218464, r218465, r218474, r219082:

r217729 (pjd):

- On primary worker reload, update hr_exec field.
- Update comment.

r217730 (pjd):

Use int16 for error.

r217731 (pjd):

Use more consistent function name with the others (pjdlogv_prefix_set()
instead of pjdlog_prefix_setv()).

r217732 (pjd):

Add nv_assert() which allows to assert that the given name exists.

r217737 (pjd):

Add missing logs.

r217784 (pjd):

Don't open configuration file from worker process. Handle SIGHUP in the
master process only and pass changes to the worker processes over control
socket. This removes access to global namespace in preparation for capsicum
sandboxing.

r217958 (pjd):

Remove __dead2 from pjdlog_verify() prototype, it does return sometimes.

r217961 (pjd):

- Remove obvious NOTREACHED comment after abort() call.
- Remove redundant newline at the end of the file.

r217962 (pjd):

Add LOG_NDELAY flag to openlog(3) - we want descriptor to be immediately open
so there are no surprises once we start chrooting or using capsicum.

r217964 (pjd):

Use pjd copyright for 2011 work.

r217965 (pjd):

Add functions to initialize/finalize pjdlog. This allows to open/close log
file at will.

r217966 (pjd):

Extend pjdlog_verify() to support the following additional macros:
PJDLOG_RVERIFY() - always check expression and on false log the given message
        and exit.
PJDLOG_RASSERT() - check expression when NDEBUG is not defined and on false log
        given message and exit.
PJDLOG_ABORT() - log the given message and exit.

r217967 (pjd):

Close the control socket before exiting, so it will be unlinked.

r217969 (pjd):

Remember created control connection so on fork(2) we can close it in child.

r218040 (pjd):

Initialize all global variables on pjdlog_init().

r218041 (pjd):

Add function to close all unneeded descriptors after fork(2).

r218042 (pjd):

Add comments to places where we treat errors as ciritical, but it is possible
to handle them more gracefully.

r218043 (pjd):

Close all unneeded descriptors after fork(2).

r218044 (pjd):

Add function to assert that the only descriptors we have open are the ones
we expect to be open. Also assert that they point at expected type.

Because openlog(3) API is unable to tell us descriptor number it is using, we
have to close syslog socket, remember assert message in local buffer and if we
fail on assertion, reopen syslog socket and log the message.

r218045 (pjd):

Use newly added descriptors_assert() function to ensure only expected
descriptors are open.

r218046 (pjd), r218047 (pjd), r218119 (maxim):

Add 'hast' user and 'hast' group that will be used by hastd (and maybe hastctl)
to drop privileges.

r218048 (pjd):

Implement function that drops privileges by:
- chrooting to /var/empty (user hast home directory),
- setting groups to 'hast' (user hast primary group),
- setting real group id, effective group id and saved group id to 'hast',
- setting real user id, effective user id and saved user id to 'hast'.
At the end verify that those operations where successfull.

r218049 (pjd):

Drop privileges in worker processes.

Accepting connections and handshaking in secondary is still done before
dropping privileges. It should be implemented by only accepting connections in
privileged main process and passing connection descriptors to the worker, but
is not implemented yet.

r218132 (pjd):

Rename pjdlog_verify() to pjdlog_abort() as it better describes what the
the function does and mark it with __dead2.

r218138 (pjd):

- Use pjdlog for assertions and aborts as this will log assert/abort message
  to syslog if we run in background.
- Asserts in proto.c that method we want to call is implemented and remove
  dummy methods from protocols implementation that are only there to abort
  the program with nice message.

r218139 (pjd):

Implement two new functions for sending descriptor and receving descriptor
over UNIX domain sockets and socket pairs.
This is in preparation for capsicum.

r218147 (pjd), r218148 (pjd):

Fix build on ia64.

r218158 (pjd):

Do not set socket send and receive buffer. It will be auto-tuned.

Confirmed by:   rwatson

r218185 (pjd):

Be prepared that hp_client or hp_server might be NULL now.

r218191 (pjd):

Move protocol allocation and deallocation to separate functions.

r218192 (pjd), r218201 (bz):

Allow to specify connection timeout by the caller.

r218193 (pjd):

Add proto_connect_wait() to wait for connection to finish.
If timeout argument to proto_connect() is -1, then the caller needs to use
this new function to wait for connection.

This change is in preparation for capsicum, where sandboxed worker wants
to ask main process to connect in worker's behalf and pass descriptor
to the worker. Because we don't want the main process to wait for the
connection, it will start async connection and pass descriptor to the
worker who will be responsible for waiting for the connection to finish.

r218194 (pjd):

- Rename proto_descriptor_{send,recv}() functions to
  proto_connection_{send,recv} and change them to return proto_conn
  structure. We don't operate directly on descriptors, but on
  proto_conns.
- Add wrap method to wrap descriptor with proto_conn.
- Remove methods to send and receive descriptors and implement this
  functionality as additional argument to send and receive methods.

r218214 (pjd):

Let the caller log info about successful privilege drop.
We don't want to log this in hastctl.

r218215 (pjd):

Drop privileges after connecting to hastd, but before sending or receiving
anything.

r218217 (pjd):

Add missing locking after moving keepalive_send() to remote send thread
in r214692.

r218218 (pjd):

Setup another socketpair between parent and child, so that primary sandboxed
worker can ask the main privileged process to connect in worker's behalf
and then we can migrate descriptor using this socketpair to worker.
This is not really needed now, but will be needed once we start to use
capsicum for sandboxing.

r218370 (pjd):

Close more descriptors that can be open if the worker process for the given
resource is already running.

Submitted by:   Mikolaj Golub <to.my.trociny@gmail.com>

r218373 (pjd):

Open syslog when logging sysconf(3) failure.

Reported by:    Mikolaj Golub <to.my.trociny@gmail.com>

r218374 (pjd):

Treat fstat(2) failure (different than EBADF) as fatal error.

Reported by:    Mikolaj Golub <to.my.trociny@gmail.com>

r218375 (pjd):

Add (void) cast before snprintf(3)s for which we are not interested in return
values.

r218376 (pjd):

Now that we break the loop on fstat(2) failure we no longer need to satisfy
gcc's imperfections.

r218464 (pjd):

Unlink UNIX domain socket file only if:
1. The descriptor is the one we are listening on (not the one when we connect
   as a client and not the one which is created on accept(2)).
2. Descriptor was created by us (PID matches with the PID stored on bind(2)).

Reported by:    Mikolaj Golub <to.my.trociny@gmail.com>

r218465 (pjd):

Explicitly include <sys/types.h> as suggested by getpid(2) and don't rely on
<sys/un.h> including what's needed.

r218474 (pjd):

When we decide to unlink socket file, sun_path must be set. If it is set,
but there is problem unlinking the file, log a warning.

r219082 (pjd):

Recognize 'reload' command, as hastd can be reloaded with the SIGHUP signal.

Approved by: pjd (mentor)

git-svn-id: svn://svn.freebsd.org/base/stable/8@220104 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

13 years agoMFC r219987:
kib [Mon, 28 Mar 2011 08:23:45 +0000 (08:23 +0000)]
MFC r219987:
Remove unneccessary panics.

git-svn-id: svn://svn.freebsd.org/base/stable/8@220093 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

13 years agoMFC r219986:
kib [Mon, 28 Mar 2011 08:22:13 +0000 (08:22 +0000)]
MFC r219986:
Fix file leakage in the freebsd32_ioctl routines.

git-svn-id: svn://svn.freebsd.org/base/stable/8@220092 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

13 years agoMFC r219982:
kevlo [Mon, 28 Mar 2011 01:24:20 +0000 (01:24 +0000)]
MFC r219982:
Fix panic while associating access point.
While here, add the SMC SMCWUSB-G

git-svn-id: svn://svn.freebsd.org/base/stable/8@220087 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

13 years agoMFC r201449:
yongari [Mon, 28 Mar 2011 00:18:02 +0000 (00:18 +0000)]
MFC r201449:
  Fix CardBus spelling.

git-svn-id: svn://svn.freebsd.org/base/stable/8@220085 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

13 years agoMFC r219701:
yongari [Mon, 28 Mar 2011 00:13:41 +0000 (00:13 +0000)]
MFC r219701:
  Remove too expensive bus_dmamap_sync(9) call in dc_rx_resync().
  With this change, driver may not notice updated descriptor status
  change when bounce buffers are active. However, rxeof() in next run
  will handle the synchronization.

  Change dc_rxeof() a bit to return the number of processed frames in
  RX descriptor ring. Previously it returned the number of frames
  that were successfully passed to upper stack which in turn means it
  ignored frames that were discarded due to errors. The number of
  processed frames in RX descriptor ring is used to detect whether
  driver is out of sync with controller's current descriptor pointer.
  Returning number of processed frames reduces unnecessary (probably
  wrong) re-synchronization.

  Reviewed by: marius

git-svn-id: svn://svn.freebsd.org/base/stable/8@220083 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

13 years agoMFC r219407:
yongari [Sun, 27 Mar 2011 23:13:02 +0000 (23:13 +0000)]
MFC r219407:
  Rearrange dc_tx_underrun() a bit to correctly set TX FIFO threshold
  value. Controllers that always require "store and forward" mode(
  Davicom and PNIC 82C168) have no way to recover from TX underrun
  except completely reinitializing hardware. Previously only Davicom
  was reinitialized and the TX FIFO threshold was changed not to use
  "store and forward" mode after reinitialization since the default
  FIFO threshold value was 0. This effectively disabled Davicom
  controller's "store and forward" mode once it encountered TX
  underruns. In theory, this can cause watchodg timeouts.

  Intel 21143 controller requires TX MAC should be idle before
  changing TX FIFO threshold. So driver tried to disable TX MAC and
  checked whether it saw the idle state of TX MAC. Driver should
  perform full hardware reinitialization on failing to enter to idle
  state and it should not touch TX MAC again once it performed full
  reinitialization.

  While I'm here remove resetting TX FIFO threshold to 0 when
  interface is put into down state. If driver ever encountered TX
  underrun, it's likely to trigger TX underrun again whenever
  interface is brought to up again. Keeping old/learned TX FIFO
  threshold value shall reduce the chance of seeing TX underrns in
  next run.

git-svn-id: svn://svn.freebsd.org/base/stable/8@220078 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

13 years agoMFC r218834-218835:
yongari [Sun, 27 Mar 2011 23:08:01 +0000 (23:08 +0000)]
MFC r218834-218835:
r218834:
  Consistently use a tab character instead of space after #define.
  No functional changes.

r218835:
  s/u_intXX_t/uintXX_t/g

git-svn-id: svn://svn.freebsd.org/base/stable/8@220076 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f