babeld: Include babel_main.h in noinst_HEADERS.

babeld wouldn't build in a dist tarball without this.

From: Denis Ovsienko <infrastation@yandex.ru>
Signed-off-by: Juliusz Chroboczek <jch@pps.jussieu.fr>
[fixed up git message]
Signed-off-by: David Lamparter <equinox@diac24.net>
babeld: merge kernel_zebra.c into kernel.c.

In upstream babel, we include different kernel_foo files depending on the
platform we compile for.  In Quagga, this is not needed, and it avoids
tricky autotools issues.  (All autotools issues are tricky.)

[David: without this commit, build breaks.]

From: Juliusz Chroboczek <jch@pps.jussieu.fr>
Signed-off-by: David Lamparter <equinox@diac24.net>
bgpd: fix up multipath merge breakage

the BGP multipath code was developed against a pre-f6f434b Quagga where
bgp_attr_unintern and ecommunity_free took single-star pointers.  They
now take double-star pointers.

  * bgpd/bgp_mpath.c: fix up bgp_attr_unintern & ecommunity_free calls.

Signed-off-by: David Lamparter <equinox@diac24.net>
tools: use standard interpreter path in all Perl scripts

Signed-off-by: David Ward <david.ward@ll.mit.edu>
[changed /usr/bin/perl to /usr/bin/env perl]
Signed-off-by: David Lamparter <equinox@diac24.net>
doc: only package man pages for daemons that are built

Signed-off-by: David Ward <david.ward@ll.mit.edu>
Signed-off-by: David Lamparter <equinox@diac24.net>
doc: add ospfclient(8) and watchquagga(8) man pages

Taken from Fedora packaging.

Signed-off-by: David Ward <david.ward@ll.mit.edu>
Signed-off-by: David Lamparter <equinox@diac24.net>
redhat: add logrotate configuration for babeld and isisd

Signed-off-by: David Ward <david.ward@ll.mit.edu>
Signed-off-by: David Lamparter <equinox@diac24.net>
redhat: update initscripts

Taken from Fedora packaging with additional fixes.

 * redhat/*.init: make all initscripts LSB-compliant;
     store the daemon configuration file location in $CONF_FILE,
     and perform existence testing before starting the daemon
 * redhat/babeld.init: add initscript for Babel routing engine
 * redhat/quagga.sysconfig: add command-line options for babeld;
     remove the daemon configuration file locations from $*_OPTS;
     clarify directions for configuring watchquagga
 * redhat/Makefile.am: add babeld.init to distribution

Signed-off-by: David Ward <david.ward@ll.mit.edu>
Signed-off-by: David Lamparter <equinox@diac24.net>
redhat: add systemd service files

 * redhat/*.service: add systemd service file for each routing daemon
 * redhat/quagga.sysconfig: add comment about watchquagga and systemd
 * redhat/Makefile.am: add systemd service files to distribution

Signed-off-by: David Ward <david.ward@ll.mit.edu>
Signed-off-by: David Lamparter <equinox@diac24.net>
tests: disable broken tests/bgp_mp_attr_test.c

it doesn't compile currently; it'll be fixed after the 0.99.21 release.

  * tests/bgp_mp_attr_test.c: wrap in #if 0 for now

Signed-off-by: David Lamparter <equinox@diac24.net>
release: 0.99.21
Revert "tests: disable broken tests/bgp_mp_attr_test.c"

This reverts commit d78e2b8b562f8496aaf2977f7371415b71e82433. Next 2
commits fix it.
tests: Fix some compile errors and warnings

* aspath_test.c: match changes in aspath_unintern. Fix printf size_t warning.
* bgp_capability_test.c: compile warnings.
* bgp_mp_attr_test.c: update for attr parser context struct
* ecommunity_test.c: ecommunity_free/ecommunity
* test-checksum.c: some unused vars and funcs without need of prototypes.
bgpd: Make socket init separate, so unit tests work again.

* Separate out BGP socket initialisation from bgp_get, and make it an
  explicit function. Allows unit tests to work again and probably also
  benefits dry-run.
* bgpd.c: (bgp_get) move socket init out...
  (bgp_socket_init) to here
* bgp_main.c: and call it after dry-run.
* bgpd.h: (bgp_socket_init) add prototype
bgpd: Fix regression in args consolidation, total should be inited from args

* bgp_attr.c: (bgp_attr_unknown) total should be initialised from the args.
bgpd, zebra: Fix format for some metric outputs

Metrics are unsigned values.

  * bgpd/bgp_{debug,route,vty}.c,
  * zebra/zebra_vty.c: replace %d with %u for metrics & distances

Signed-off-by: Jorge Boncompte [DTI2] <jorge@dti2.net>
[reworded commit message]
Signed-off-by: David Lamparter <equinox@diac24.net>
bgpd: fix for route-maps with "match peer local" statements

A route-map with a 'match peer local' statement it's shown like
'match peer (null)' on config output...

... and it's unparsable on daemon startup.

Signed-off-by: Jorge Boncompte [DTI2] <jorge@dti2.net>
Signed-off-by: David Lamparter <equinox@diac24.net>
bgpd: Fix memory leak with 'set ip next-hop peer-address'

A route-map with the mentioned statement causes a memory leak for every
prefix that matches.

Signed-off-by: Jorge Boncompte [DTI2] <jorge@dti2.net>
Signed-off-by: David Lamparter <equinox@diac24.net>
lib: remove last uses of sockunion_su2str()

Use of this function is prone to memory leaks.

This fixes a memory accounting bug for vty denied connections.

Signed-off-by: Jorge Boncompte [DTI2] <jorge@dti2.net>
Signed-off-by: David Lamparter <equinox@diac24.net>
bgpd: Fix memory leak of some "show ip bgp neighbor" commands

sockunion_str2su() use is prone to memory leaks. Remove it's use all over
the code.

At least these commands leaked a sockunion union:
    - show ip bgp vpnv4 ... routes
    - show ip bgp ... received prefix-filter

Signed-off-by: Jorge Boncompte [DTI2] <jorge@dti2.net>
Signed-off-by: David Lamparter <equinox@diac24.net>