Donald Sharp [Sat, 20 May 2017 12:22:23 +0000 (08:22 -0400)]
bgpd: Fix crash when going down
When bgp is sent a SIGINT signal with vrf's configured
bgp proceeds to crash on the way down. This is because
the bm->bgp list was deleted( but the pointer was kept around)
and then later in the going down process vrf_terminate is called
which attempts to find any associated processes. Since memory
has been freed and subsuquently used for something else
we get a corrupt bgp pointer and bgp crashes.
Here is the trace:
(gdb) bt
at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
at sigevent.c:255
at thread.c:1315
(gdb)
Multiple protocols besides bgp and zebra running are needed to make
this happen as well. So a weird timing related issue?
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Renato Westphal [Fri, 19 May 2017 22:10:42 +0000 (19:10 -0300)]
zebra: build mpls sources the right way
zebra_mpls_null.c should contain only dummy replacements for
platform-specific functions that may not be available on some systems
(e.g. add/delete LSPs in the kernel).
Renato Westphal [Fri, 19 May 2017 13:51:00 +0000 (10:51 -0300)]
bgpd: fix sending of invalid nexthops on the wire
The bpacket_reformat_for_peer() function rewrites the nexthop of outgoing
route updates on a per-peer basis in order to handle route-maps ("set
ip next-hop") and locally-originated routes missing a nexthop.
In the latter case, RFC 4271 says the following: "When announcing a
locally-originated route to an internal peer, the BGP speaker SHOULD use
the interface address of the router through which the announced network
is reachable for the speaker as the NEXT_HOP".
We were doing this for regular IPv4/IPv6 routes, but not for
VPN/EVPN/ENCAP routes, which were being announced with invalid nexthops
(0.0.0.0 or ::).
Donald Sharp [Thu, 18 May 2017 15:03:21 +0000 (11:03 -0400)]
ospf6d: Make 'show zebra' 'show ipv6 ospf6 zebra'
The 'show zebra' command really shouldn't be owned
by ospf6. This command is a specialized command
to show some basic information about ospf6 and zebra
so limit it to ospf6.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Donald Sharp [Thu, 18 May 2017 00:33:43 +0000 (20:33 -0400)]
pimd: Thread changes allow pim to crash a boo
When we add a thread pointer to thread_add_XXX functions
when the specified function is called, thread.c is setting
the thread pointer to NULL. This was causing pim to
liberally pull it's zassert grenade pin's.
Additionally clean up code to not set the NULL pointer.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Timo Teräs [Wed, 17 May 2017 22:36:07 +0000 (18:36 -0400)]
nhrp: improve CIE prefix length handling
RFC2332 states that prefix length MUST be 0xff for unique bindings.
However, it seems at least some Cisco firmwares use host prefix
length instead (which on wire level makes sense). Relax the handling
of prefix length to treat all value longer than address length as
0xff. Additionally treat 0x00 the same way too, this is required
by the RFC. This also fixes the prefix length address family to be
checked against protocol address. Signed-off-by: Timo Teräs <timo.teras@iki.fi>
Quentin Young [Wed, 17 May 2017 18:37:24 +0000 (18:37 +0000)]
eigrpd: disambiguate bandwidth command
eigrpd defines a bandwidth command that takes kilobits instead of
megabits which is problematic when installed in the same node as the
megabits command since (1-100000) and (1-10000000) are ambiguous
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Donald Sharp [Wed, 16 Nov 2016 17:00:40 +0000 (12:00 -0500)]
bgpd: More Extended nexthop fixing
Basically if we are reading in a cli with a extended-nexthop
and we have not received from zebra the interface we are working
on I believe we have a race condition where we are not
propagating the PEER_FLAG_CAPABILITY_ENHE in this case.
Modify the code to propagate even if we haven't found the
interface yet.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Donald Sharp [Tue, 15 Nov 2016 14:39:35 +0000 (09:39 -0500)]
bgpd: Fix occassional turn off of extended-nexthop for an if
Sometimes, like once every 400 iterations, when you restart
Quagga, extended-nexthop has been turned off for interface
based config( for 5549 ).
Examining the code, there is only 1 real path to setting
the PEER_FLAG_CAPABILITITY_ENHE and that is through
peer_conf_interface_get. Modify this code path
to always set the PEER_FLAG_CAPABILITY_ENHE if it is
not already set.
In addition, fix a possible pointer dereference.
Ticket: CM-12929 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Don Slice [Tue, 14 Feb 2017 17:15:40 +0000 (09:15 -0800)]
zebra: stop deregistering static nexthops unless removing the static
Problem reported was that with some overlapping static route configurations,
when the link went down the less specific static was not re-installed after
the link came back up. Determined that with the overlapping statics, we
would recursively resolve the next-hop temporarily thru the more specific
static route, but since the next-hop wasn't actually reachable, we would go
through the code that clears the nht information for the static completely.
This caused the nht code to no longer process the static route.
After reviewing the process, there doesn't seem to be any reason that the
static should be deregistered in that section of code. Removed the
deregister and the problem is resolved and not addional failures seen in
manual testing. zebra_test.py completed successfully and ospf and bgp smokes
completed with no new failures.
Ticket: CM-14873 Signed-off-by: Don Slice <dslice@cumulusnetworks.com> Reviewed-by: CCR-5696
Don Slice [Wed, 23 Nov 2016 19:58:27 +0000 (11:58 -0800)]
zebra: Move interfaces to default before deleting
Encountered a crash in zebra due to getting a delete on an SVI with
VRR configured. Since we don't actually do a delete but flag the interface
as inactive, slag VRR interfaces would remain on the vrf_iflist with a lock
count of zero, causing the crash. Since all other interface types are moved
to the default table before deleting, doing the same thing for any interfaces
that were left in the vrf.
Testing includes manual testing, bgp-min, ospf-min, vrf-min, bgp-smoke, and ospf-smoke.
All passed (first time or on rerun) or match known failures.
Ticket: CM-13288 Signed-off-by: Don Slice Reviewed-by: Donald Sharp
Chirag Shah [Tue, 24 Jan 2017 01:39:54 +0000 (17:39 -0800)]
pimd: fix ip pim hello option does not take in effect
If frr.conf file has pim hello option setup prior to pim sm under an interface, upon frr start/restart hello option cli replayed prior to sm command
from vtysh. Added a code in pim hello option cli handler to create pim vif if it does not exist.
Testing Done:
configure pim hello options before pim sm in frr.conf file and restart frr
Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>