bgpd: "neigbor <interface> ttl-security hops" should reject a hops value greater than 1
"neighbor <interface> disable-connected-check" should not be allowed by the parser
Made changes to not allow hops greater than 1 and disable-connected check for neighbor <interface>
Donald Sharp [Wed, 29 Jun 2016 18:30:28 +0000 (14:30 -0400)]
pimd: Pass the appropriate data structure around
Several static functions were passing a list around
when the reality is we are going to need to
look at the group information in order to make an
informated decision.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Donald Sharp [Wed, 29 Jun 2016 12:31:19 +0000 (08:31 -0400)]
pimd: Prevent igmp packet loopback.
pim is joining the 224.0.0.13 and 224.0.0.22 groups
This is causing the creation of (*, 224.0.0.13) and
(*, 224.0.0.22) multicast routes which are immediately
sent to the pim network.
If we are the originator of the igmp report than
there is no need to accept the packet for
processing.
Ticket: CM-11397 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Donald Sharp [Wed, 29 Jun 2016 01:50:49 +0000 (21:50 -0400)]
pimd: Bind pim sockets to interface they are associated with
When pim is receiving packets, each interface's fd is receiving
packets for all interfaces. Modify the code to bind the
pim interface sockets to the interface they were created for.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Don Slice [Mon, 27 Jun 2016 11:34:32 +0000 (04:34 -0700)]
zebra/ospf/ospf6: Fix several memory leaks on if up/down
Resolved several memory leaks caused by ifdown/ifup the vrf device or
a swp port. For bgp/zebra/ospf/ospf6, bouncing the vrf device would cause
a linked list, Interface, and route-table to get leaked. For ospf6,
bouncing the swp device also caused leaks of Connected and Prefix entries.
Ticket: CM-10841 Signed-off-by: Don Slice Reviewed-By: Donald Sharp
Testing Done: Manual testing, bgp and ospf mins passed, smokes had fewer failures than base
Don Slice [Mon, 27 Jun 2016 15:31:57 +0000 (08:31 -0700)]
zebra: resolved problem with show ip route vrf
Repaired damage done by commit upstream, which changed the way show_ip_route
is called to allow for multicast rpf table display. Matched the technique of
the other callers to the new function.
Ticket: CM-11345 Signed-off-by: Don Slice
Reviewed By: Donald Sharp
Testing Done: Manual testing and vrf-min
Donald Sharp [Fri, 24 Jun 2016 00:42:19 +0000 (20:42 -0400)]
pimd: Fix register receive pointer arithmetic
When receiving the register packet from another pim
neighbor at the RP, we were adding an incorrect
amount of bytes to find the start of the ip_hdr
of the encapsulated data. This commit fixes
this issue.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Quentin Young [Tue, 21 Jun 2016 19:57:22 +0000 (19:57 +0000)]
zebra: Suppress 'ip forwarding' in configuration output
Since IP forwarding is enabled by default on Quagga startup, it
makes more sense to only explicitly report the state of this
setting when it is disabled. Inverted the relevant printouts.
Ticket: CM-11462
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Add command and associated functionality to enable dumping
raw netlink messages.
Ticket: CM-6568
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com> Reviewed-by: Don Slice <dslice@cumulusnetworks.com> Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Daniel Walton [Tue, 21 Jun 2016 14:52:43 +0000 (14:52 +0000)]
quagga-reload.py thinks the BGP ASN changed when it did not
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com> Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Ticket: CM-11463
(cherry picked from commit ab5f8310801f1870a7c5c22e1595e4452c558ddb)
Daniel Walton [Tue, 21 Jun 2016 14:24:29 +0000 (14:24 +0000)]
Fix build warnings in start-stop-daemon.c
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com> Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Ticket: CM-11484
(cherry picked from commit 39dcf9acd87b18ab00f9f71ec15fdd89fff4b3c8)
Quentin Young [Mon, 20 Jun 2016 13:31:55 +0000 (13:31 +0000)]
zebra: Change bitwise operations to purpose-built macros
Some bitfields for zebra_debug_* flags were being modified
with bitwise operators instead of the purpose-built macros
in lib/zebra.h. Changed such instances to use the macros.
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Donald Sharp [Mon, 20 Jun 2016 12:21:00 +0000 (08:21 -0400)]
quagga: Allow compile time determination of v6 RR semantics
The patches to allow kernel v6 Route Replacement semantics
to work correctly are on a very recent kernel. If you are
compiling on a linux kernel where it's broken, just
compile with --disable-rr-semantics.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Donald Sharp [Sat, 18 Jun 2016 01:25:21 +0000 (21:25 -0400)]
pimd: Prevent loopback from forming neighbor
This code prevents pim from forming a neighbor relationship
with itself by preventing pim from sending a hello
out the loopback interface if we have pim configured
on an interface.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Donald Sharp [Sat, 18 Jun 2016 00:43:21 +0000 (20:43 -0400)]
pimd: Separate pim vif index spot from ifindex
Allow pim to separate out the pim vif index from the ifindex.
This change will allow pim to work with up to 255(MAXVIFS)
interfaces, while also allowing the interface ifindex to
be whatever number it needs to be.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Donald Sharp [Fri, 17 Jun 2016 19:37:49 +0000 (15:37 -0400)]
pim: Fix NOCACHE to use incoming interface
When the kernel sends a NOCACHE message to
pim we were looking up the interface to
use for the incoming multicast packet
based upon the source. No need to do
that trust that the kernel has properly
identified it and use that.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Daniel Walton [Fri, 17 Jun 2016 13:44:35 +0000 (13:44 +0000)]
bgp_recalculate_all_bestpaths() should check if rn->info is NULL
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com> Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Ticket: CM-11444
The bgp table may contain nodes without an 'info' (these nodes are used
for balancing the tree, they are created by route_common() in lib/table.c).
When we call bgp_recalculate_all_bestpaths() we should avoid calling
bgp_process() for these nodes. bgp_recalculate_all_bestpaths() is only
called when knobs are configured that could have an impact on which
routes are selected as best.
Donald Sharp [Fri, 17 Jun 2016 13:19:38 +0000 (09:19 -0400)]
pimd: Use the ifindex to create vif device
It is possible to create multiple interfaces
with the same ip address. Looking up the
dev to use based upon the ip address will
eventually fail when you keep getting
the same dev device.
Future-Work: I'll need to add a translation
to vif index to actual device to use because
ifindex's are not guaranteed to be under 256.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
lib/table.c's route_common() can create a rn for a prefix that BGP has
never RXed. For example here we RX 10.1.8.0/24 from neighbor 10.0.0.2,
notice how the 10.1.0.0/20 entry is created. We would later assert on
this prefix because its info was NULL.
2016/06/16 23:37:21.418426 BGP: 10.0.0.2 rcvd UPDATE w/ attr: nexthop 10.0.0.2, origin i, localpref 100, metric 0, community 99:7, path
2016/06/16 23:37:21.418442 BGP: 10.0.0.2 rcvd UPDATE wlen 0 wpfx 0 attrlen 36 alen 4 apfx 1
2016/06/16 23:37:21.418458 BGP: bgp_node_create called
2016/06/16 23:37:21.418475 BGP: route_node_get called for 10.1.8.0/24, route_node_new 10.1.0.0/20, match (nil)
2016/06/16 23:37:21.418519 BGP: bgp_node_create called
2016/06/16 23:37:21.418536 BGP: route_node_get called for 10.1.8.0/24, route_node_new(2) 10.1.8.0/24, match 0x2013cd0
2016/06/16 23:37:21.418554 BGP: 10.0.0.2 rcvd 10.1.8.0/24
If rn->info is NULL then avoiding the group_announce_route() call in
bgp_proces_main() also feels risky as this code path generates WITHDRAWs
for prefixes that no longer have a bestpath which would be the case if
there are no paths.
Donald Sharp [Mon, 13 Jun 2016 23:08:43 +0000 (19:08 -0400)]
tools: Use the now included start-stop-daemon
Redhat does not have a way to run the start-stop-daemon.
This code is widely available on the internet and
very small. Use the compiled start-stop-daemon(ssd)
if it is included with the system.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Donald Sharp [Mon, 13 Jun 2016 23:00:24 +0000 (19:00 -0400)]
redhat: Changes to allow Cumulus start/stop methodology
Change the redhat .spec and control files to allow
redhat systemd interaction to be the same as
the debian style. This will allow users
to use Quagga consistently across platforms.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Sam Tannous [Mon, 13 Jun 2016 22:39:57 +0000 (15:39 -0700)]
Quagga: bgpd needs extra neighbor and route json attributes for SNMP BGP4 MIB
Ticket: CM-11344
Reviewed By: dwalton, dsharp
Testing Done: built and tested amd64 debs
This patch adds the peerID JSON attribute for routes for show ip bgp json.
It also corrects the bgpTimerLastWrite in show ip bgp neigh json as well
as adds bgpInUpdateElapsedTimeMsecs, lastErrorCodeSubcode, and connectRetryTimer.
These are needed for the bgp4 mib implementation (rfc 4273) from the json
output of vtysh commands.
Don Slice [Mon, 13 Jun 2016 13:06:45 +0000 (09:06 -0400)]
ospfd/ospf6d/zebra: Change interface bandwidth range and auto-cost range to 100G
Prior to this change, interface bandwidth could not be defined above 10G. With
the use of higher speed interfaces, the ability to effectively define the path
links was highly impacted. Additionally, the default auto-cost reference-bandwidth
for ospf and ospfv3 was set to 100M, which relects a much earlier time. Changed both
the range of interface bandwidth definitions and reference bandwidths to be up to
100G. Set the default interface bandwidth (if not defined) to 10G to make the ratio
continue to cause a cost of 10 as before. Manual testing as well as ospf-min and
ospf-smoke passed successfully.
Ticket: CM-10756 Signed-of-by: Don Slice Reviewed-by: Donald Sharp
vivek [Sat, 11 Jun 2016 18:36:42 +0000 (11:36 -0700)]
bgpd: Fixes and updates for VPNv6
VPNv6 changes picked from upstream needed fixes and updates due to some
fundamental changes implemented by Cumulus (BGP update-groups, RFC 5549
and nexthop setting etc.) which aren't present upstream.
Issue: bgpd is not replaying the BFD registrations to PTM after quagga restart.
Root Cause: This problem happens when BFD configuration is part of the peer group template. Currently, the BFD configuration is being copied to the peer from template as part of the AF (address family) configuration. But, when the saved config is used after the quagga restart the peer group template is applied to the peer before the AF configuration is configured for the template. Due to this the BFD configuration never gets copied from the template to the peer and the BGP peers have no BFD configuration after the restart
Donald Sharp [Thu, 19 May 2016 13:56:35 +0000 (09:56 -0400)]
lib: Fix some poll semantics
Two Fixes:
1) When a fd has both read and write as a .events.
(POLLHUP | POLLIN | POLLOUT) and a
thread_cancel_read_write call is executed
from a protocol, the code was blindly removing
the fd from consideration at all.
2) POLLNVAL was being evaluated before POLLIN|POLLOUT
were being evaluated. While I didn't see a case
of POLLNVAL being included with other .revent flags
I decided to move the POLLNVAL and POLLHUP handling
to the same section of code.
Additionally the function thread_cancel_read_write
was poorly named and let me to poorly implement
the poll version of it. I've renamed the function
thread_cancel_read_or_write in an attempt to
make this problem moot in the future.
Don Slice [Fri, 10 Jun 2016 13:58:03 +0000 (06:58 -0700)]
bgpd: remove vrf->iflist deleted to avoid a crash
Ticket: CM-11327 Signed-off-by: Don Slice Reviewed-by: Donald Sharp
Testing Done: Manual testing, bgp-min, vrf-min, bgp-smoke, vrf-smoke all successful
When bgp was configured in a vrf and then deleted, the vrf->iflist
was being deleted from the vrf. Since the vrf itself was not deleted,
it was assumed in later calls that the vrf->iflist was still there
and when it was referenced, the crash occurred.
Sam Tannous [Thu, 9 Jun 2016 16:26:06 +0000 (12:26 -0400)]
vtysh json output not JSON for show ip bgp neigh json
Ticket: CM-11350
Reviewed By: dsharp
Testing Done: built amd64 images and tested output of both json and non-json
Upstream patch was applied in wrong section of code so JSON
output contained plain text. The upstream patch was
commit baa376fc1 (cherry picked from ef757700d0f)
This patch moves the text output to the correct if clause
and also adds a new JSON line for the same data.
Signed-off-by: Sam Tannous <stannous@cumulusnetworks.com> Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
David Lamparter [Tue, 15 Sep 2015 08:53:09 +0000 (01:53 -0700)]
*: make sure zebra.h is always included first
zebra.h pulls in config.h, which results in fiddling with things like
__FILE_OFFSET_BITS. It must always be included first, in order to set
flags that influence the compiler via <features.h>.
Donald Sharp [Thu, 17 Sep 2015 14:54:25 +0000 (10:54 -0400)]
lib/zclient: Consolidate error reporting for zclient_read_header
All functions that call zclient_read_header immediately turn around
and check to ensure that the version and marker fields are correct
Move this code into zclient_read_header
Michael Rossberg [Mon, 27 Jul 2015 05:56:25 +0000 (07:56 +0200)]
ospfd: Fast OSPF convergence
When considering small networks that have extreme requirements on
availability and thus convergence delay, the timers given in the OSPF RFC
seem a little “conservative”, i.e., the delay between accepted LSAs and the
rate at which LSAs are sent. Cisco introduced two commands 'timers throttle
lsa all’ and 'timers lsa arrival’, which allow operators to tune these
parameters.
I have been writing a patch to also support 'timers lsa arrival’ fully and
‘timers throttle lsa all’ (without the throttling part) also in quagga.
Feng Lu [Fri, 22 May 2015 09:39:55 +0000 (11:39 +0200)]
ospf6d, bgpd: avoid calling if_nametoindex
As the comments in if.h, it is better to call ifname2ifindex()
instead of if_nametoindex().
And ifname2ifindex() can work for VRF by appending a parameter
while if_nametoindex() can not.
Signed-off-by: Feng Lu <lu.feng@6wind.com> Reviewed-by: Alain Ritoux <alain.ritoux@6wind.com> Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com> Acked-by: Vincent JARDIN <vincent.jardin@6wind.com> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
(cherry picked from commit 395828eea809e8b2b8c5824d3639cefedd7aa9f0)
Timo Teräs [Sat, 23 May 2015 08:08:41 +0000 (11:08 +0300)]
zebra: use prefix2str for logging where possible
This makes code more robust, consice and readable.
Signed-off-by: Timo Teräs <timo.teras@iki.fi> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
(cherry picked from commit be6335d682c5ee1b6930345193eda875705fbab2)
Timo Teräs [Sat, 23 May 2015 08:08:40 +0000 (11:08 +0300)]
zebra/vty: use prefix2str and unify show ip/ipv6 route code
Use prefix2str where possible. As now ip/ipv6 are practically
identical, they are merged removing unneeded code duplication.
Signed-off-by: Timo Teräs <timo.teras@iki.fi> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
(cherry picked from commit 53a5c39c705f917567d5b1764f1fe12ad5c5e577)
Timo Teräs [Sat, 23 May 2015 08:08:39 +0000 (11:08 +0300)]
lib: make prefix2str simpler to use, and use it in zclient
Returning the buffer allows using it in the logging functions
in easier way. This also makes the API consistent with sockunion.
Add also PREFIX_STRLEN to be the generic buffer length required
for any prefix string representation.
Signed-off-by: Timo Teräs <timo.teras@iki.fi> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
(cherry picked from commit 41eb9a4305fbcb206c900a18af7df7115d857d60)
vivek [Thu, 9 Jun 2016 01:14:17 +0000 (18:14 -0700)]
bgpd: Do not process workqueue upon instance delete
During instance cleanup, an earlier patch walked the workqueue in order
to process queued routes of the instance. However, since the workqueue
is not per instance, the code walks and immediately processes all routes
across all instances.
This may not be ideal in the presence of VRFs, when multiple instances
will be a fact. Revert that part of the change from earlier patch. This
needs to be revisited later for a better solution.
Feng Lu [Fri, 22 May 2015 09:39:54 +0000 (11:39 +0200)]
ripngd: allow to enable/disable the ECMP feature
Introduce a new command "[no] allow-ecmp" to enable/disable the
ECMP feature in RIPng. By default, ECMP is not allowed.
Once ECMP is disabled, only one route entry can exist in the list.
* ripng_zebra.c: adjust a debugging information, which shows the number
of nexthops according to whether ECMP is enabled.
* ripngd.c: ripng_ecmp_add() will reject the new route if ECMP is not
allowed and some entry already exists.
A new configurable command "allow-ecmp" is added to control
whether ECMP is allowed.
When ECMP is disabled, ripng_ecmp_disable() is called to
remove the multiple nexthops.
* ripngd.h: Add a new member "ecmp" to "struct ripng", indicating whether
ECMP is allowed or not.
Signed-off-by: Feng Lu <lu.feng@6wind.com> Reviewed-by: Alain Ritoux <alain.ritoux@6wind.com> Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com> Acked-by: Vincent Jardin <vincent.jardin@6wind.com> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
(cherry picked from commit 72855b16b72e9ad2c7eb0c0bfd8f5985f779608f)
Feng Lu [Fri, 22 May 2015 09:39:53 +0000 (11:39 +0200)]
ripngd: add ECMP support
* Each node in the routing table is changed into a list, holding
the multiple equal-cost paths.
* If one of the multiple entries gets less-preferred (greater
metric or greater distance), it will be directly deleted instead
of starting a garbage-collection timer for it.
The garbage-collection timer is started only when the last entry
in the list gets INFINITY.
* Some new functions are used to maintain the ECMP list. And hence
ripng_route_process(), ripng_redistribute_add() and ripng_timeout()
are significantly simplified.
* ripng_zebra_ipv6_add() and ripng_zebra_ipv6_delete() now can share
the common code. The common part is moved to ripng_zebra_ipv6_send().
Signed-off-by: Feng Lu <lu.feng@6wind.com> Reviewed-by: Alain Ritoux <alain.ritoux@6wind.com> Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com> Acked-by: Vincent Jardin <vincent.jardin@6wind.com> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>