Joachim Nilsson [Wed, 9 May 2012 11:38:36 +0000 (13:38 +0200)]
zebra: fix up compilation without rtadv/IPv6
let's ground the rtadv.h file if route advertisements are disabled. And
fix up the CLI for it, as well as move the "show ip mroute" to its
proper place.
* zebra/rtadv.h: #ifdef RTADV
* zebra/main.c: #ifdef RTADV
* zebra/zebra_vty.c: move "show ip mroute" out of #ifdef IPV6
From: Joachim Nilsson <troglobit@gmail.com>
[moved #ifdef RTADV to rtadv.h] Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
The SAFI_MULTICAST RIB needs to contain Connected routes so that the
nexthop lookup does not fail and so that multicast routing daemons do
not need to sidestep and look into SAFI_UNICAST to be aware of connected
subnets.
* zebra/connected.c: add & delete connected in SAFI_MULTICAST
Signed-off-by: G.Balaji <balajig81@gmail.com>
[merged add/delete patches] Signed-off-by: David Lamparter <equinox@diac24.net>
zebra: no need to clear memory of the netlink buffers
The memory is always written before sending. Clearing it before use
slows netlink_route_multipath() down considerably and it's pretty
noticeable in a full-internet table scenario loading.
* zebra/rt_netlink.c: subtract bulk buffer size from clear
Paul Jakma [Tue, 1 May 2012 15:24:35 +0000 (16:24 +0100)]
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
Paul Jakma [Tue, 1 May 2012 15:20:33 +0000 (16:20 +0100)]
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.
David Ward [Sun, 29 Apr 2012 20:47:08 +0000 (16:47 -0400)]
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>
David Ward [Sun, 29 Apr 2012 20:47:07 +0000 (16:47 -0400)]
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>
David Lamparter [Sat, 28 Apr 2012 20:37:20 +0000 (22:37 +0200)]
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>
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>
David Lamparter [Fri, 20 Apr 2012 15:26:48 +0000 (17:26 +0200)]
lib: bump ZSERV_VERSION to 2
continually changing the zserv protocol without bumping up the version
number has made it impossible to talk to zebra without knowing the exact
version. in reality, increasing the version number more often guards
against inadvertedly running incompatible versions of a daemon and zebra
as well as aids external development.
* lib/zclient.h: #define ZSERV_VERSION 2
Signed-off-by: David Lamparter <equinox@diac24.net>
JR Rivers [Sun, 1 Apr 2012 19:16:31 +0000 (12:16 -0700)]
zebra: use larger buffer (4096) for netlink messages
Increase the maximum number of nexthops per route by using a larger
buffer for netlink messages.
* zebra/rt_netlink.c: Use a buffer of 4096 bytes to parse/build
netlink messages. Add a hash define for this number
(NL_PKT_BUF_SIZE). Most places in the code were previously using a
buffer of 1024 bytes.
David Lamparter [Mon, 16 Apr 2012 11:54:37 +0000 (13:54 +0200)]
bgpd: merge osr/google-bgp-multipath
this patchset allows collapsing multiple received routes in BGP into one
multipath route that will, if readvertised, contain an aggregate of all
received attributes.
The previous commits modified both zebra and bgpd for additional
SAFI field, but not any other routing daemon, which led to zebra
daemon crashing with failed assertion.
# Resolve conflicts in the following:
lib/md5.h
zebra/rt_netlink.c
zebra/zebra_rib.c
zebra/zserv.c
Note that the content in the isisd directory is left unchanged in the
merge. As a result, changes made to isisd as part of the following
commits on the quagga mainline are dropped.
# 8ced4e82 is the merge base, e96b3121 is the current quagga master
$ git log --oneline --reverse 8ced4e82..e96b3121 -- isisd 5574999 isisd: fix crash on "no router isis" (BZ#536) 8998075 isisd: raise hello rate for DIS (BZ#539) 306ca83 isisd: include hash.h, not hash.c b82cdeb delete CVS keywords 2f65867 isisd: indent longopts array b511468 quagga: option "-z" ("--socket <path>") added 05e54ee build: delete .cvsignore files b4e45f6 fix zebra protocol after MP-BGP changes 7fd6cd8 isisd: fix circuit state machine 907fd95 isisd: send proper LSP after DIS election d034aa0 isisd: fix wrong next-hops from SPF c25eaff isisd: unexpected kernel routing table (BZ#544) e6b03b7 isisd: implement MD5 circuit authentication
Avneesh Sachdev [Sun, 19 Feb 2012 18:19:52 +0000 (10:19 -0800)]
bgpd: fix issue in capability negotiation (BZ#700)
Address problem where bgpd would reject a session if a peer sent some
capabilities in its Open message, but did not include a Multiprotocol
extensions capability. Note that the session would come up if there
were no capabilities at all in the Open message.
* Add the 'mp_capability' out parameter to
bgp_capability_parse(). Set it to '1' if a Multiprotocol
extensions capability is encountered.
* Switch on 'mp_capability' instead of 'capability' in the calling
functions to determine if the peer indicated the set of AFI/SAFIs
it supports.
The net result is that when a peer does not send an MP capability,
it is assumed to support the AFI/SAFIs configured for it locally.
Josh Bailey [Thu, 22 Mar 2012 00:13:39 +0000 (17:13 -0700)]
zebra: include hardware addr in if up/down messages
Change interface up/down notification messages to also include the
hardware address of the interface. The format of these messages is now
identical to the interface add message -- move the serialization code
to common functions.
* lib/zclient.c: Modify zebra_interface_if_set_value() to also parse
the hardware address. Invoke it from zebra_interface_add_read()
and and zebra_interface_state_read().
* zebra/zserv.c: Add zserv_encode_interface(). Invoke it from
zserv_interface_add(), zserv_interface_delete() and
zserv_interface_update().
Josh Bailey [Wed, 21 Mar 2012 17:37:03 +0000 (10:37 -0700)]
lib: Tweak to if_delete_retain()
* lib/if.c: Change if_delete_retain() to delete all connected
addresses, but to not free the list that holds them. Free the list
just before the interface structure itself is freed, in
if_delete().
Josh Bailey [Thu, 22 Mar 2012 01:47:51 +0000 (18:47 -0700)]
zebra: clean up client routes when client goes away
* zebra/zebra_rib.c: Add code to clean up routes added by a client
(as identfied by 'rib type').
* zebra/zserv.[ch]: Maintain the type of the routes added by a
client on the 'zserv' structure -- assume that a given client uses
a single route type for now.
Clean up routes from a client when the client goes away (in
zebra_client_close()).
Subbaiah Venkata [Wed, 28 Mar 2012 02:21:29 +0000 (19:21 -0700)]
zebra: tweak deletion of routes without nexthop addr
* zebra/zserv.c
- zread_ipv4_delete(): Pass a null 'gate' parameter to
rib_delete_ipv4() if the route being deleted does not specify a
next hop IP address. We were previously passing a pointer to a
cleared out IP address.
Josh Bailey [Thu, 22 Mar 2012 08:09:21 +0000 (01:09 -0700)]
zebra: read multipath routes and hw addr from netlink
* zebra/rt_netlink.c:
- Pick up the hardware address of an interface when we receive a
netlink link change message. Extract code for parsing the
link-layer hardware address into a new function so we can reuse
it.
- netlink_routing_table(): Update to handle multipath routes.
- netlink_route_change(): Update to handle multipath routes. Fix
problem where the metric was not being read out.
* zebra/zebra_rib.[ch]: Extern nexthop_ipv4_ifindex_add() -- it is
now called from the netlink code.
David Lamparter [Tue, 3 Apr 2012 22:14:36 +0000 (00:14 +0200)]
lib: pretty ip_masklen and masklen2ip
nonwithstanding any desire for optimisation, these versions are shorter
and more concise. reading the comments, they might even be easier to
understand.
I've tested them on i686 and x86_64, and checked that correct assembler
code is emitted for ARM, MIPS and PowerPC.
IPv6 is left as an exercise for another day, none of the ideas I had led
to a "yes, this is the one to go with" solution.
Signed-off-by: David Lamparter <equinox@diac24.net>
There are multiple reasons for this revert, including bug #720, but also
quite simply the unreadability of having 2000 lines of an autogenerated
table in the middle of a source file.
Signed-off-by: David Lamparter <equinox@diac24.net> Reported-by: Martin Winter <mwinter@opensourcerouting.org>
Paul Jakma [Tue, 27 Mar 2012 10:54:04 +0000 (11:54 +0100)]
bgpd: bgp_attr_flags_diagnose shouldn't assert
* bgpd/bgp_attr.c: (bgp_attr_flags_diagnose) debug code for error-handling
paths probably shouldn't assert, instead it should just log that there
was no problem.
Paul Jakma [Sun, 25 Mar 2012 20:31:47 +0000 (21:31 +0100)]
bgpd: attr_parse call to attr_malformed should deal with PROCEED error case
* bgpd/bgp_attr.c: (bgp_attr_parse) the invalid flag check call to
bgp_attr_malformed is pretty useless if it doesn't actually allow
for the PROCEED non-error case.
Paul Jakma [Thu, 15 Mar 2012 11:30:00 +0000 (11:30 +0000)]
bgpd: malformed attribute error that can still proceed should fixup getp
* bgp_attr.c: (bgp_attr_malformed) When a malformed attribute error can be
ignored, and BGP message processing may still proceed, the stream getp
should be adjusted to the end of the attribute - the caller may not have
consumed all the attribute. Problem noted by Martin Winter in bug 678.
Also, rename the 'startp' local to 'notify_datap', for clarity.
This is the functionality described in Appendix C of RFC 6126. Its
main purpose is to avoid keeping a full source table, which makes it
possible to implement a subset of Babel in just a few hundred lines of
code. However, in Quagga the code for maintaining the source table is
already there, and a parasitic implementation can be simulated using
filtering -- so it makes little sense to keep the functionality.
Denis Ovsienko [Sat, 11 Feb 2012 17:06:16 +0000 (21:06 +0400)]
babeld: justify "running-config" meaning in CLI
The primary focus of this commit is to make "show running-config"
command display more current configuration, including some of the bits
previously seen in the output of "show babel running-config". Besides
that, the following commands were renamed for consistency with the
syntax of other components:
"debug *" to "debug babel *" (and moved to top level)
"show babel running-config" to "show babel parameters"
* babel_interface.c
* show_babel_running_config(): rename to show_babel_parameters(),
update syntax pattern, don't call show_babeld_configuration()
* babel_if_init(): update respectively
* babel_enable_if_config_write(): new VTY helper for static
babel_enable_if
* babel_interface.h: add extern declaration
* babel_main.c: unset all debug options by default
* show_babel_main_configuration(): remove debug options decoder
* babel_zebra.c
* babel_debug(): rename to debug_babel(), update syntax pattern
* no_babel_debug(): rename to no_debug_babel(), update syntax pattern
* babelz_zebra_init(): update respectively
* debug_babel_config_write() new VTY helper for static debug_type
* babel_zebra.h: add extern declaration
* babeld.c
* babel_config_write(): add the code to output "debug babel *",
"router babel", "redistribute *" and "network *" statements
* show_babeld_configuration(): dismiss
* babeld.h: remove extern declaration
* babeld.texi: update for renamed commands
* babeld.conf.sample: idem, add debug statements block
Denis Ovsienko [Sat, 11 Feb 2012 11:25:01 +0000 (15:25 +0400)]
babeld: dismiss babel_redistribute_unset()
The function was effectively duplicating existing
zclient_redistribute(). This makes no_babel_redistribute_type()
consistent with babel_redistribute_type()
Babel makes use of blackhole routes to prevent routing loops between
overlapping prefixes shortly after a route is retracted (see RFC 6126
sections 2.8 and 3.5.5). This patch adds support for installing such
blackhole routes.
Factorise the common parts of the in/out filtering functions. This also
fixes a bug with filtered out routes, which in babeld are signalled by
a filter returing INFINITY, not -1.
babeld: Don't use an ifindex when installing IPv4 routes.
Stand-alone babeld installs routes using both a next-hop gateway
and an interface index. Unfortunately, this doesn't work for IPv4
under Quagga.
We now ignore the ifindex when installing IPv4 routes, which makes
Babel work for IPv4 in prefix-based networks. Of course this breaks
IPv4 mesh networks, unless you play some tricks with your interfaces'
netmasks.
Matthieu Boutier [Fri, 27 Jan 2012 23:29:51 +0000 (00:29 +0100)]
babeld: fix interface bug, simplify code.
Perhaps could it be able to free already free memory (so free(NULL)),
in function interface_reset(). On other hand, it initiated untracked
interfaces, raising (at least) inappropriate messages. Finally, I
remove the BABEL_IF_IS_ENABLE flag, witch was not really usefull.
Note the test if_up isn't weaker, because (...IS_UP => ...IS_ENABLE).