summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* release: 1.0.20160315HEADquagga-1.0.20160315masterDonald Sharp2016-03-151-1/+1
|
* quagga: Remove double read of streamDonald Sharp2016-03-116-8/+22
| | | | | | | | | | The addition of a MIN(X,Y) with a stream_getc in the Y causes a double read of the stream due to the way that MIN is defined. This fix removes a crash in all protocols. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* release: 1.0.20160309quagga-1.0.20160309Donald Sharp2016-03-091-1/+1
|
* Revert "bgpd: Lower BGP's default keepalive/holdtime to 3s/9s"Paul Jakma2016-03-081-2/+2
| | | | | | | | | | This reverts commit f89b09be92bed03b1e5add55dc14ef92e94c52e1. Martin Winter has reported reliability issues in testing on some platforms. We need a more comprehensive way to deal with defaults and updating them, e.g. profiles of some kind. Defer this change till after next release.
* zebra: Fix route deletion on *BSDTimo Teräs2016-03-081-22/+21
| | | | | | | | | Fix for not handling RTM_CHANGE correctly. This patch change it to delete/add instead. Using RTM_CHANGE on kernels where it works is better, but is left as an exercise for developer who has access and will to fix it on *BSD. [ed note: collaboration with Martin Winter]
* configure: Fix warnings on CentOS and bump the minimum autoconf versionPaul Jakma2016-03-081-1/+2
| | | | | | | | | | | | | | | * configure.ac: Bump the minimum version to 2.60 as needed by AC_USE_SYSTEM_EXTENSIONS. AC 2.60 is nearly 10 years old, note. Add AC_PROG_RANLIB, for when --disable-shared is used. There are other warnings on, e.g., CentOS 6.7 with 2.63, but they don't go away if the suggestion to add AC_SYSTEM_EXTENSIONS is followed. This warning doesn't occur on Fedora with AC 2.69. Note: autoconf (and other auto*) should only be needed on developer machines building direct from git. Other systems should be using the 'make dist' tarballs, with a ready-made build system, that does not need auto* intalled.
* doc: older versions of texinfo seem to be sensitive to location of unmacroPaul Jakma2016-03-081-3/+0
| | | | | | * bgpd.texi: The unmacro of mprec seems to be disliked by older texinfos. Moving it to after the section fixes it. Even easier, just don't undef the macro.
* doc: Distribute a modern version of texinfo.tex with the docsPaul Jakma2016-03-083-2/+11200
| | | | | | | * doc/texinfo.tex: Ship a more recent texinfo.tex, from texinfo 6.1, so we don't have to worry about that. E.g., this should allow UTF-8 unicode chars to be used directly in the text. * doc/Makefile.am: Add previous to EXTRA_DIST
* distro/redhat: Update to support CentOS/RHEL/Fedora, upstart/init/systemdMartin Winter2016-03-083-145/+424
| | | | | | | | | | | | | * redhat/quagga.spec.in: Update to support CentOS, RHEL and Fedora, and support the various init systems across different versions of these distros, e.g. upstart/init/systemd. Clean up various warnings from rpmlint. Remove configure options that are gone. A few edits and commit message by: Paul Jakma <paul.jakma@hpe.com> / <paul@jakma.org>
* configure.ac: remove -dev in versionPaul Jakma2016-03-081-1/+1
| | | | | | | | | | * configure.ac: Remove the -dev suffix from the version, some package systems at least do not like non-numeric strings in package versions (e.g., rpm, which I often use in testing Quagga). TODO: Work out some sensible scheme for semi-autogenerating the version perhaps via git describe. The --with-pkg-git-version doesn't affect the tarball name.
* distro/redhat/rpm: remove with_ipv6, package pimd binary, remove pam stackPaul Jakma2016-03-083-50/+14
| | | | | | | | | * redhat/quagga.spec.in: remove with_ipv6, it should just be the norm now. The actual pimd binary wasn't being packaged, fix. Remove deprecated pam.stack support. * redhat/quagga.pam.stack: ancient, nuke. * Makefile.am: ditto
* Adding redhat init/service files to start pimdMartin Winter2016-03-083-1/+87
| | | | | | | Added missing pimd.init (for RedHat/CentOS <= 6) and pimd.service (for RedHat/CentOS >= 7) Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
* distro: fix redhat/quagga.spec.inPaul Jakma2016-03-081-9/+15
| | | | | | | | | | | | * quagga.spec.in: Add default for with_pimd macro. Remove ancient condtional on quagga_buildreqs. More recent rpmbuild complains about too many levels of recursion in quagga_buildreqs, so use %{expand:..}. Actually use quagga_buildreqs in BuildRequires! groff is needed for build. texi2html --number argument has disappeared, split into 2. Acked-by: Donald Sharp <sharpd at cumulusnetworks.com>
* lib: fix vrf_bitmap leak in zclient_free()David Lamparter2016-03-081-0/+10
| | | | | | | | | zclient_stop(), which is used as antagonist to zclient_init(), needs to undo the vrf_bitmap allocation. Otherwise zclient_init() will leak the allocated memory, for example when zclient_reset() is used. Reported-by: Lou Berger <lberger@labn.net> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* bgpd: Fix crash reported by NetDEF CILou Berger2016-03-082-4/+19
| | | | | | | | | | | | This patch is part of the previously submitted patch set on VPN and Encap SAFIs. It fixes an issue identified by NetDEF CI. Ensure temp stack structures are initialized Add protection against double frees / post free access to bgp_attr_flush Signed-off-by: Lou Berger <lberger@labn.net>
* lib: Check prefix length from zebra is sensiblePaul Jakma2016-03-087-24/+35
| | | | | | | | | | | | | * zclient.c: prefix length on router-id and interface address add messages not sanity checked. fix. * */*_zebra.c: Prefix length on zebra route read was not checked, and clients use it to write to storage. An evil zebra could overflow client structures by sending overly long prefixlen. Prompted by discussions with: Donald Sharp <sharpd@cumulusnetworks.com>
* lib: zclient can overflow (struct interface) hw_addr if zebra is evilPaul Jakma2016-03-081-1/+1
| | | | | | | | | | | | | | | * lib/zclient.c: (zebra_interface_if_set_value) The hw_addr_len field is used as trusted input to read off the hw_addr and write to the INTERFACE_HWADDR_MAX sized hw_addr field. The read from the stream is bounds-checked by the stream abstraction, however the write out to the heap can not be. Tighten the supplied length to stream_get used to do the write. Impact: a malicious zebra can overflow the heap of clients using the ZServ IPC. Note that zebra is already fairly trusted within Quagga. Reported-by: Kostya Kortchinsky <kostyak@google.com>
* bgpd: Remove the double-pass parsing of NLRIsPaul Jakma2016-03-086-172/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * bgpd parses NLRIs twice, a first pass "sanity check" and then a second pass that changes actual state. For most AFI/SAFIs this is done by bgp_nlri_sanity_check and bgp_nlri_parse, which are almost identical. As the required action on a syntactic error in an NLRI is to NOTIFY and shut down the session, it should be acceptable to just do a one pass parse. There is no need to atomically handle the NLRIs. * bgp_route.h: (bgp_nlri_sanity_check) Delete * bgp_route.c: (bgp_nlri_parse) Make the prefixlen size check more general and don't hard-code AFI/SAFI details, e.g. use prefix_blen library function. Add error logs consistent with bgp_nlri_sanity_check as much as possible. Add a "defense in depth" type check of the prefixlen against the sizeof the (struct prefix) storage - ala bgp_nlri_parse_vpn. Update standards text from draft RFC4271 to the actual RFC4271 text. Extend the semantic consistency test of IPv6. E.g. it should skip mcast NLRIs for unicast safi as v4 does. * bgp_mplsvpn.{c,h}: Delete bgp_nlri_sanity_check_vpn and make bgp_nlri_parse_vpn_body the bgp_nlri_parse_vpn function again. (bgp_nlri_parse_vpn) Remove the notifies. The sanity checks were responsible for this, but bgp_update_receive handles sending NOTIFY generically for bgp_nlri_parse. * bgp_attr.c: (bgp_mp_reach_parse,bgp_mp_unreach_parse) Delete sanity check. NLRI parsing done after attr parsing by bgp_update_receive. Arising out of discussions on the need for two-pass NLRI parse with: Lou Berger <lberger@labn.net> Donald Sharp <sharpd@cumulusnetworks.com>
* bgpd: Regularise bgp_update_receive, add missing notifies and checksPaul Jakma2016-03-086-244/+162
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * bgp_packet.c: (bgp_update_receive) Lots of repeated code, doing same thing for each AFI/SAFI. Except when it doesn't, e.g. the IPv4/VPN case was missing the EoR bgp_clear_stale_route call - the only action really needed for EoR. Make this function a lot more regular, using common, AFI/SAFI independent blocks so far as possible. Replace the 4 separate bgp_nlris with an array, indexed by an enum. The distinct blocks that handle calling bgp_nlri_parse for each different AFI/SAFI can now be replaced with a loop. Transmogrify the nlri SAFI from the SAFI_MPLS_LABELED_VPN code-point used on the wire, to the SAFI_MPLS_VPN safi_t enum we use internally as early as possible. The existing code was not necessarily sending a NOTIFY for NLRI parsing errors, if they arose via bgp_nlri_sanity_check. Send the correct NOTIFY - INVAL_NETWORK for the classic NLRIs and OPT_ATTR_ERR for the MP ones. EoR can now be handled in one block. The existing code seemed broken for EoR recognition in a number of ways: 1. A v4/unicast EoR should be an empty UPDATE. However, it seemed to be treating an UPDATE with attributes, inc. MP REACH/UNREACH, but no classic NLRIs, as a v4/uni EoR. 2. For other AFI/SAFIs, it was treating UPDATEs with no classic withraw and with a zero-length MP withdraw as EoRs. However, that would mean an UPDATE packet _with_ update NLRIs and a 0-len MP withdraw could be classed as an EoR. This seems to be loose coding leading to ambiguous protocol situations and likely incorrect behaviour, rather than simply being liberal. Be more strict about checking that an UPDATE really is an EoR and definitely is not trying to update any NLRIs. This same loose EoR parsing was noted by Chris Hall previously on list. (bgp_nlri_parse) Front end NLRI parse function, to fan-out to the correct parser for the AFI/SAFI. * bgp_route.c: (bgp_nlri_sanity_check) We try convert NLRI safi to internal code-point ASAP, adjust switch for that. Leave the wire code point in for defensive coding. (bgp_nlri_parse) rename to bgp_nlri_parse_ip. * tests/bgp_mp_attr_test.c: Can just use bgp_nlri_parse frontend.
* bgpd: Regularise BGP NLRI sanity checks a bitPaul Jakma2016-03-088-101/+390
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * bgp_route.h: (bgp_nlri_sanity_check) The bulk of the args are equivalent to a (struct bgp_nlri), consolidate. * bgp_route.c: (bgp_nlri_sanity_check) Make this a frontend for all afi/safis. Including SAFI_MPLS_LABELED_VPN. (bgp_nlri_sanity_check_ip) Regular IP NLRI sanity check based on the existing code, and adjusted for (struct bgp_nlri *) arg. * bgp_attr.c: (bgp_mp_reach_parse) Adjust for passing (struct bgp_nlri *) to bgp_nlri_sanity_check. Get rid of special-casing to not sanity check VPN. (bgp_mp_unreach_parse) Ditto. * bgp_mplsvpn.c: Use the same VPN parsing code for both the sanity check and the actual parse. (bgp_nlri_parse_vpn) renamed to bgp_nlri_parse_vpn_body and made internal. (bgp_nlri_parse_vpn_body) Added (bool) argument to control whether it is sanity checking or whether it should update routing state for each NLRI. Send a NOTIFY and reset the session, if there's a parsing error, as bgp_nlri_sanity_check_ip does, and as is required by the RFC. (bgp_nlri_parse_vpn) now a wrapper to call _body with update. (bgp_nlri_sanity_check_vpn) wrapper to call parser without updating. * bgp_mplsvpn.h: (bgp_nlri_sanity_check_vpn) export for bgp_nlri_sanity_check. * bgp_packet.c: (bgp_update_receive) Adjust for bgp_nlri_sanity_check argument changes. * test/bgp_mp_attr_test.c: Extend to also test the NLRI parsing functions, if the initial MP-attr parsing has succeeded. Fix the NLRI in the VPN cases. Add further VPN tests. * tests/bgpd.tests/testbgpmpattr.exp: Add the new test cases. This commit a joint effort of: Lou Berger <lberger@labn.net> Donald Sharp <sharpd@cumulusnetworks.com> Paul Jakma <paul.jakma@hpe.com> / <paul@jakma.org>
* bgpd: make bgp_nlri_parse_encap conform with other nlri_parse funcsPaul Jakma2016-02-263-14/+8
| | | | | | | | | * bgp_encap.{c,h} (bgp_nlri_parse_encap) afi is already in the NLRI argument. update or withdraw is signalled by attr being non-NULL or NULL. * bgp_packet.c: (update_receive) fixup to match, and also make the attr argument conform with NLRI_ATTR_ARG for correct error handling on optional, transitive, partial, attributes.
* bgpd: Fix Null pointer dereference in bgp_info_mpath_updateDonald Sharp2016-02-261-3/+3
| | | | | | | bgp_info_mpath_update is called with new_best == NULL, this causes the dereference of new_best in order to get at the mpath_cfg. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* bgpd: Modify maxpaths cli's to use MULTIPATH_NUM for rangeDonald Sharp2016-02-261-14/+4
| | | | | | | | | | Modify the various maxpath commands to use MULTIPATH_NUM as the upper limit of allowed max paths in BGP. There is no point in allowing a number of maximum paths greater than what Quagga is compiled for. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com> Tested-by: NetDEF CI System <cisystem@netdef.org>
* lib: Add CMD_RANGE_STR macro to command.hDonald Sharp2016-02-261-0/+11
| | | | | | | | | | Allow the auto-generation of a "<X-Y>" string for cli handline. Where X or Y can be a #define. CMD_RANGE_STR(LOW, HIGH) translates to: "<4-99>" Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* zebra, bgpd: Fixup MULTIPATH_NUM usage to not consider 0Donald Sharp2016-02-263-7/+6
| | | | | | | | The code has spots where MULTIPATH_NUM set to 0 is equal to 64. Now that MULTIPATH_NUM is set from the makefile to never be 0, remove the code that depends on this. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* build: Rework how MULTIPATH_NUM is delivered to buildDonald Sharp2016-02-263-6/+9
| | | | | | | | | | | | | | Changes made here: 1) MULTIPATH_NUM will never be 0. If user specifies --enable-multipath=0 then this translates to MULTIPATH_NUM being set to 64 inside of the build system. 2) Move MULTIPATH_NUM from a Makefile construct to a config.h construct. 3) Allowed MULTIPATH_NUM to be a number > 99 but < 1000 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* ospfd: Remove HAVE_OSPF_TEDonald Sharp2016-02-263-16/+0
| | | | | | | | Remove from ospf the HAVE_OSPF_TE define and just always have ospf traffic engineering. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com> Tested-by: NetDEF CI System <cisystem@netdef.org>
* ospfd: Remove HAVE_OPAQUE_LSADonald Sharp2016-02-2620-206/+3
| | | | | | | | HAVE_OPAQUE_LSA is used by default and you have to actively turn it off except that OPAQUE_LSA is an industry standard and used pretty much everywhere. There is no need to have special #defines for this anymore. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* doc, vtysh: Fixup of history handlingDonald Sharp2016-02-264-2/+45
| | | | | | | | | | | This fix does two things: 1) If the ${HOME}/.history_quagga file does not exist, create it for history storing. 2) Allow vtysh -c "..." commands to be stored in history file as well Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* *: use an ifindex_t type, defined in lib/if.h, for ifindex valuesPaul Jakma2016-02-2662-183/+194
|
* lib, zebra: unify link layer type and hardware address handlingTimo Teräs2016-02-2610-72/+238
| | | | | | | | | | | | | | | | This removes the BSD specific usage of struct sockaddr_dl hardware address. This unifies to use explict hw_addr member for the address, and zebra specific enumeration for the link layer type. Additionally the zapi is updated to never send platform specific structures over the wire, but the ll_type along with hw_addr_len and hw_addr are now sent for all platforms. Based on initial work by Paul Jakma. Signed-off-by: Timo Teräs <timo.teras@iki.fi> Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* zebra: remove metric from kernelTimo Teräs2016-02-262-29/+12
| | | | | | | | | | It simplifies things as we can do atomic replace of route prefix. And it seems there's some race condition somewhere that can result in an incorrect change request leaving prefixes in kernel when they were intended to be replaced/deleted. Signed-off-by: Timo Teräs <timo.teras@iki.fi> Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
* zebra: support FIB override routesTimo Teräs2016-02-266-31/+71
| | | | | | | | | | | | | | | | FIB override routes are for routing protocols that establish shortcut routes, or establish point-to-point routes that should not be redistributed. Namely this is useful NHRP daemon to come. Zebra is extended to select two entries from RIB the "best" entry from routing protocols, and the FIB entry to install to kernel. FIB override routes are never selected as best entry, and thus are never adverticed to other routing daemons. The best FIB override, or if it does not exist the otherwise best RIB is selected as FIB entry to be installed. Signed-off-by: Timo Teräs <timo.teras@iki.fi> Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
* zebra: use link scope for interface routesTimo Teräs2016-02-262-16/+11
| | | | | | | | | | In linux, 'scope' is a hint of distance of the IP. And this is evident from the fact that only lower scope can be used as recursive via lookup result. This changes all interface routes scope to link so kernel will allow regular routes to use it as via. Then we do not need to use the 'onlink' attribute. Signed-off-by: Timo Teräs <timo.teras@iki.fi>
* zebra: atomic FIB updatesTimo Teräs2016-02-266-307/+171
| | | | | | | | | | | This commit updates the kernel API so that route changes are atomically updated using change/replaces messages instead of first sending a withdraw followed with update. Same for zclient updates, changes are sent as single ADD instead of DELETE + ADD. Signed-off-by: Timo Teräs <timo.teras@iki.fi>
* lib, bgpd: Remove 'struct fifo' from lib/zebra.hDonald Sharp2016-02-264-40/+65
| | | | | | | The 'struct fifo' and it's accompanying #defines do not belong in lib/zebra.h. Move them into their own header. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* bgpd: remove HAVE_IPV6 conditionalsLou Berger2016-02-2617-461/+33
| | | | | Signed-off-by: Lou Berger <lberger@labn.net> Tested-by: NetDEF CI System <cisystem@netdef.org>
* doc: Add AFI/SAFI show commands to manualLou Berger2016-02-261-0/+25
| | | | Signed-off-by: Lou Berger <lberger@labn.net>
* bgpd: Add back old forms of 'show <afi> <safi>' for compatibilityLou Berger2016-02-262-216/+4342
| | | | Signed-off-by: Lou Berger <lberger@labn.net>
* bgpd: drop machineparse / random "show" improvementsLou Berger2016-02-262-15/+40
| | | | Signed-off-by: Lou Berger <lberger@labn.net>
* bgpd: encap show commandsLou Berger2016-02-262-2437/+2237
| | | | Signed-off-by: Lou Berger <lberger@labn.net>
* bgpd: VPNv6 show commandsLou Berger2016-02-262-300/+427
| | | | Signed-off-by: Lou Berger <lberger@labn.net>
* bgpd: cleanup vty bgp_node_afi/safi utilsLou Berger2016-02-261-14/+26
| | | | Signed-off-by: Lou Berger <lberger@labn.net>
* bgpd, lib, vtysh: hook up bgp ENCAP CLI nodeLou Berger2016-02-2610-4/+346
| | | | | Signed-off-by: Lou Berger <lberger@labn.net> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* bgp: Reorg cleanup to align process and bgp instance init/destroyLou Berger2016-02-262-8/+3
| | | | Signed-off-by: Lou Berger <lberger@labn.net>
* bgpd: encap: add encap SAFI (RFC5512)Lou Berger2016-02-2611-115/+1740
| | | | | | Adds RFC5512 and Encapsulation Attribute. Signed-off-by: Lou Berger <lberger@labn.net>
* bgpd: encap: add attribute handlingLou Berger2016-02-268-3/+1573
| | | | | Signed-off-by: Lou Berger <lberger@labn.net> Reviewed-by: David Lamparter <equinox@opensourcerouting.org>
* bgpd: encap: extend extcommunity handlingLou Berger2016-02-262-10/+33
| | | | | | | Add code to print ENCAP communities. Signed-off-by: Lou Berger <lberger@labn.net> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* bgpd: general MP/SAFI improvementsLou Berger2016-02-268-64/+98
| | | | | | | | This fixes some minor mixups particularly in MPLS-related SAFIs, as well as doing some stylistic changes & adding comments. Signed-off-by: Lou Berger <lberger@labn.net> Reviewed-by: David Lamparter <equinox@opensourcerouting.org>
* bgpd: tests - add null pointer protection to fix bgp test failuresLou Berger2016-02-262-1/+5
| | | | Signed-off-by: Lou Berger <lberger@labn.net>