Merge 232538:
  Fix ng_ipfw(4) cookie number in example.

  Pointed out by:	"Jacco van Buuren" <jaccovanbuuren gmail.com>


git-svn-id: svn://svn.freebsd.org/base/stable/9@234273 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Merge 231586:
  Fix write(1) to support wide characters.

  Submitted by: amdmi3
  PR:           bin/164317


git-svn-id: svn://svn.freebsd.org/base/stable/9@234274 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Merge 233269:
  Add multibyte char support.

  PR:           165429
  Submitted by: amdmi3


git-svn-id: svn://svn.freebsd.org/base/stable/9@234275 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Merge 231760,231761,231764,231765,231766,231823,231830 from head:

  231760,231766:
	style(9): sort includes
  231761:
	In ng_bypass() add more protection against potential race
	with ng_rmnode() and its followers.
  231764:
	Remove testing stuff, reducing kernel memory footprint by 1 Kb.
  231765:
	Trim double empty lines.
  231823:
	In ng_getsockaddr() allocate memory prior to obtaining lock.
  231830:
	Specify correct loading order for core of netgraph(4).


git-svn-id: svn://svn.freebsd.org/base/stable/9@234276 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Merge 231831:
  Refactor the name hash and the ID hash, that are used to address nodes:

  - Make hash sizes growable, to satisfy users running large mpd
    installations, having thousands of nodes.
  - NG_NAMEHASH() proved to give a very bad distribution in real life
    name sets, while generic hash32_str(name, HASHINIT) proved to give
    an even one, so use the latter for name hash.
  - Do not store unnamed nodes in slot 0 of name hash, no reason for that.
  - Use the ID hash in cases when we need to run through all nodes: the
    NGM_LISTNODES command and in the vnet_netgraph_uninit().
  - Implement NGM_LISTNODES and NGM_LISTNAMES as separate code, the former
    iterates through the ID hash, and the latter through the name hash.
  - Keep count of all nodes and of named nodes, so that we don't need
    to count nodes in NGM_LISTNODES and NGM_LISTNAMES. The counters are
    also used to estimate whether we need to grow hashes.
  - Close a race between two threads running ng_name_node() assigning same
    name to different nodes.


git-svn-id: svn://svn.freebsd.org/base/stable/9@234277 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Merge 231076,231078:
  Make the 'tcpwin' option of ipfw(8) accept ranges and lists.

  Submitted by: sem


git-svn-id: svn://svn.freebsd.org/base/stable/9@234278 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Merge 233272:
  in6_pcblookup_local() still can return a pcb with NULL
  inp_socket. To avoid panic, do not dereference inp_socket,
  but obtain reuse port option from inp_flags2, like this
  is done after next call to in_pcblookup_local() a few lines
  down below.

  Submitted by: rwatson


git-svn-id: svn://svn.freebsd.org/base/stable/9@234279 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r233392, r233679:

r233392:

Fix typo.

r233679:

If hastd is invoked with "-P pidfile" option always create pidfile
regardless of whether -F (foreground) option is set or not.

Also, if -P option is specified, ignore pidfile setting from configuration
not only on start but on reload too. This fixes the issue when for hastd
run with -P option reload caused the pidfile change.

Reviewed by:	pjd


git-svn-id: svn://svn.freebsd.org/base/stable/9@234294 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Merge remote-tracking branch 'upstream/svn_stable_9' into svn_stable_9