lib: Fix accounting of memory

* lib/memory.c: (zrealloc) If is called with NULL pointer then it should
  increment allocations because it behaves the same as zmalloc.

  (zfree) is called with NULL pointer, it does nothing therefore allocation
  count should not change.
bgpd: fix bgp_node locking issues

* bgpd: Connected table locks were being locked but not unlocked, such that
  eventually a lock would exceed 2^31 and become negative, thus triggering
  an assert later on.
* bgp_main.c: (bgp_exit) delete connected elements along with ifp's.
* bgp_nexthop.c: (bgp_nexthop_lookup{,_ipv6}) add missing unlocks
  (bgp_multiaccess_check_v4) ditto
  (bgp_connected_{add,delete}) Use a distinct memtype for bgp_connected_ref.
  (bgp_scan_finish) reset the nexthop cache to clean it up when bgpd exits
* bgp_route.c: fix missing bgp_node unlocks
* lib/memtype.c: (memory_list_bgp) add MTYPE_BGP_CONN
* testing: has been tested for almost 2 months now.
bgpd: fix errors in aggregate address command

* bgpd: (bgp_aggregate_{set,unset,delete}) This fixes locking and other
  issues with aggregate set/unset command
bgpd: unlock node on aggregate error

* bgp_route.c: (bgp_aggregate_set) make sure to unlock BGP node if failure
tools/multiple-bgpd.sh: set some community attributes to help test them
bgpd: fix use of free memory by update_rsclient

* bgp_route.c: (bgp_static_update_rsclient) BGP sometimes crashes when
  removing route server client because of use after free.

  The code to update rsclient created a local static copy of bgp attributes
  but neglected to handle the extra information pointer.  The extra
  information was getting freed by bgp_attr_unintern() and reused later when
  the copy was passed to bgp_attr_intern().

  The fix is to use the attr_dup function to create a copy of the extra
  information, then clean it up.
bgpd: Remove extra lock on interior table node

If the radix tree creates an extra interior node in bgp_node_get(),
it locks the interior node even though this node is not returned to
the caller, so it may never be unlocked. The lock prevents this node
from being deleted.

* bgpd/bgp_table.c: (bgp_node_get) Remove lock on interior node which
  prevents proper node deletion
lib: Better hashing of string values using Bernstein hash

* hash.{h,c}: (string_hash_make) Hash optimised for strings, current
  implementation using Bernstein hash, which offers a good compromise
  between distribution and performance.
* distribute.c: (distribute_hash_make) use previous instead of additive
  string hash.
* if_rmap.c: (if_rmap_hash_make) ditto
bgpd: fix annoucements of redistributed routes after commit fcbd630.

* bgp_route.c (bgp_redistribute_add): check that the IPv6 nexthop is
  not link-local: mp_nexthop_global must be global. (A route redistributed
  from an IPv6 IGP is likely to have a link-local nexthop.)
bgpd: ignore link-local part of the IPv6 nexthop if the peer is not on a shared network.

Actually, the peer must not send us a link-local nexthop in this case, but
it may have a bug (seen in a real world).

* bgp_attr.c (bgp_mp_reach_parse): see above
ospf6d: implement cancel of custom iface configs

Implement cancellation of custom interface's configurations:

  no ipv6 ospf6 cost
  no ipv6 ospf6 dead-interval
  no ipv6 ospf6 hello-interval
  no ipv6 ospf6 instance-id
  no ipv6 ospf6 priority
  no ipv6 ospf6 retransmit-interval
  no ipv6 ospf6 transmit-delay
doc: update ospf6d.texi according to current cmds
bgpd: implement responsive route-map

This patch changes behaviour of route-maps which can be used
with redistribution command. When user change configuration
of such route-map, changes get applied to routes immediately.

To enable new behaviour you should use command
'bgp redistribute responsive' in global configuration mode.
ospfd: don't hardcode size in ospf_recv_packet()

stream_get_size (ibuf) == OSPF_MAX_PACKET_SIZE + 1 today, but it may
change in future
lib: remove unused sockunion2prefix()
honour return value of str2prefix_ipv4()

int str2prefix_ipv4() has the same semantics as int inet_aton(): it
returns 0 for an error or non-0 for a success.

First of all, make two ripd functions check "== 0" condition rather than
"< 0", because the latter is plain wrong. Then, some implementations
define inet_aton() to return positive value for success, but this should
not be relied upon. Thus, proper check conditions are "== 0" and "!= 0",
but not "<= 0".

Both changes don't fix any known bugs, because IPv4 pattern matcher kept
any invalid input from being fed into str2prefix_ipv4().

* lib/filter.c: (filter_set_zebra)
* lib/plist.c: (vty_prefix_list_install, vty_prefix_list_uninstall)
* lib/vty.h: (VTY_GET_IPV4_PREFIX)
* ripd/rip_interface.c: (rip_neighbor, no_rip_neighbor)
* ripd/ripd.c: (rip_route, no_rip_route)
* zebra/interface.c: (ip_address_install, ip_address_uninstall)
* zebra/zebra_vty.c: (show_ip_route_addr, show_ip_route_prefix)
ospfd: apply_mask_ipv4() is a no-op for /32
ripd: use LOOKUP() on rip_msg[]

* ripd.c
  * rip_msg[]: remove trailing NULL structure
  * rip_msg_max: add helper variable
  * rip_packet_dump(): update to use LOOKUP()
  * rip_read(): idem
ospfd: get ospf_ls_upd_list_lsa() checks in shape

Use right-sized variables for LSA "LS checksum" (16-bit), LSA "length"
(16-bit) and LS-Update packet "# LSAs" (32-bit) fields.

Once the "count > 0" check is sufficient for the job, remove the buffer
size and LSA type checks (ospf_lsaseq_examin() has already verified
these).
ospfd: clean ospf_dump.h and ospfd.h up

The following variables did not exist: ospf_lsa_type_str,
ospf_redistributed_proto_max, ospf_zlog.

The following declarations belong to ospf_dump.h: ospf_ism_state_msg,
ospf_nsm_state_msg, ospf_lsa_type_msg, ospf_link_state_id_type_msg,
ospf_network_type_msg, ospf_ism_state_msg_max, ospf_nsm_state_msg_max,
ospf_lsa_type_msg_max, ospf_link_state_id_type_msg_max,
ospf_network_type_msg_max.