]> git.puffer.fish Git - matthieu/frr.git/log
matthieu/frr.git
8 years agodistro/redhat/rpm: remove with_ipv6, package pimd binary, remove pam stack
Paul Jakma [Thu, 11 Feb 2016 13:54:23 +0000 (13:54 +0000)]
distro/redhat/rpm: remove with_ipv6, package pimd binary, remove pam stack

* 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

(cherry picked from commit 283d5d7f2fa12c3d33dc17962154665a9993b2c5)

8 years agodistro: fix redhat/quagga.spec.in
Paul Jakma [Fri, 4 Sep 2015 13:25:13 +0000 (14:25 +0100)]
distro: fix redhat/quagga.spec.in

* 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>
(cherry picked from commit e07068c838142a127da8821afd660f075f7c35f8)

8 years agobgpd: remove vrf->iflist deleted to avoid a crash
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.

8 years agozebra: Fix zebra to exit on recvmsg buffer overrun
Donald Sharp [Mon, 23 May 2016 21:22:24 +0000 (17:22 -0400)]
zebra: Fix zebra to exit on recvmsg buffer overrun

When zebra receives a recvmsg buffer from the kernel
silently exit so that watchquagga will notice and then
restart zebra.

Ticket: CM-11130
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
8 years agoBGP:Fix for BFD sessions not getting replayed after quagga restart
radhika [Sat, 21 May 2016 08:16:14 +0000 (01:16 -0700)]
BGP:Fix for BFD sessions not getting replayed after quagga restart

Signed-off-by: Radhika Mahankali <radhika@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Kanna Rajagopal <kanna@cumulusnetworks.com>
Ticket: CM-11055
Reviewed By: CCR-4773
Testing Done: Unit, PTM smoke, BGP neighbor smoke

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

Sample config which failed:
router bgp 100
bgp router-id 10.10.0.1
no bgp default ipv4-unicast
bgp bestpath as-path multipath-relax
neighbor dpeergrp_2 peer-group
neighbor dpeergrp_2 remote-as 100
neighbor dpeergrp_2 bfd
neighbor dpeergrp_2 advertisement-interval 1
neighbor dpeergrp_2 timers connect 1
neighbor dpeergrp_4 peer-group
neighbor dpeergrp_4 remote-as 400
neighbor dpeergrp_4 bfd
neighbor dpeergrp_4 advertisement-interval 1
neighbor dpeergrp_4 timers connect 1
neighbor swp2s0.1 interface peer-group dpeergrp_2
neighbor swp18s3.1 interface peer-group dpeergrp_4
!
address-family ipv4 unicast
redistribute connected route-map redist
neighbor dpeergrp_2 activate
neighbor dpeergrp_2 next-hop-self
neighbor dpeergrp_2 default-originate
neighbor dpeergrp_2 soft-reconfiguration inbound
neighbor dpeergrp_4 activate
neighbor dpeergrp_4 next-hop-self
neighbor dpeergrp_4 default-originate
neighbor dpeergrp_4 soft-reconfiguration inbound
maximum-paths 14
exit-address-family

Fix: Moved the BFD config copy from the peer group AF config copy function to the main peer group config copy function.

8 years agolib: Fix some poll semantics
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.

Ticket: CM-11027
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agoMerge branch 'cmaster' of ssh://stash.cumulusnetworks.com:7999/quag/quagga into cmaster
vivek [Fri, 20 May 2016 00:06:11 +0000 (17:06 -0700)]
Merge branch 'cmaster' of ssh://stash.cumulusnetworks.com:7999/quag/quagga into cmaster

8 years agoQuagga: Make sure order of route-maps in list and hash table matches
vivek [Wed, 18 May 2016 21:08:55 +0000 (14:08 -0700)]
Quagga: Make sure order of route-maps in list and hash table matches

Quick create/delete actions on a route-map can result in the same route-map
entity having multiple entries created for it — because BGP hasn't run the
update processing to complete prior delete action. The route-map is present
in both a hash table as well as a linked list and the order in each is
different. This can lead to problems when the BGP route-map update processing
runs and finds the same route-map entity present for deletion multiple times.
For example, while processing instance-2 of rmap-A, the code may end up
freeing the hash bucket corresponding to instance-1 of rmap-A.

The fix works by ensuring the list is ordered the same way as the hash
buckets.

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Shrijeet Mukherjee <shm@cumulusnetworks.com>
Ticket: CM-10023
Reviewed By: CCR-4747
Testing Done: manual, bgp-smoke

8 years agocumulus: Increase netlink socket buffer size
Donald Sharp [Thu, 19 May 2016 17:31:51 +0000 (13:31 -0400)]
cumulus: Increase netlink socket buffer size

Ticket: CM-10950
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
8 years agoquagga reload failure (Tested on VX)
Daniel Walton [Mon, 16 May 2016 14:36:17 +0000 (14:36 +0000)]
quagga reload failure (Tested on VX)

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Ticket: CM-10974

ctx_keys needs to be a tuple and not a list but there was one spot
where I created a tmp copy of the ctx_keys but failed to convert it to
tuple

8 years agoBGP: Unlink BGP instance from VRF only at the end of deletion
vivek [Sat, 14 May 2016 23:07:18 +0000 (16:07 -0700)]
BGP: Unlink BGP instance from VRF only at the end of deletion

Additional change missed out in earlier commit. Updates
d3f5a0d3f51a8a7f3f02c38bd4c1c6870b4b2a5b.

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Ticket: CM-10930
Reviewed By: CCR-4717
Testing Done: Manual, bgp-smoke

8 years agoMerge branch 'cmaster' of ssh://stash.cumulusnetworks.com:7999/quag/quagga into cmaster
vivek [Sat, 14 May 2016 22:58:23 +0000 (15:58 -0700)]
Merge branch 'cmaster' of ssh://stash.cumulusnetworks.com:7999/quag/quagga into cmaster

8 years agoBGP: Unlink BGP instance from VRF only at the end of deletion
vivek [Sat, 14 May 2016 21:48:18 +0000 (14:48 -0700)]
BGP: Unlink BGP instance from VRF only at the end of deletion

When a BGP instance including the default instance is deleted, it needs to be
unlinked from the corresponding VRF structure. However, instance deletion does
not happen in one shot but needs a lot of threads to run - peer event handling,
route processing etc. - before it can complete. Premature unlinking of the
instance from underlying VRF would result in BGP routes not being deleted from
the zebra RIB.

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Ticket: CM-10930
Reviewed By: CCR-4717
Testing Done: Manual, bgp-smoke

8 years agoOSPF ANVL failures in 3.0
Daniel Walton [Sat, 14 May 2016 02:29:11 +0000 (02:29 +0000)]
OSPF ANVL failures in 3.0

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Ticket: CM-10088

When we pulled this patch from upstream there was one spot where we
incorrectly used min_ls_interval (5s) instead of min_ls_arrival (1s).
commit ac7424f9dec0d49d891e0b457afa8e31c2b854fe
Author: Michael Rossberg <michael.rossberg@tu-ilmenau.de>
Date:   Mon Jul 27 21:05:44 2015 +0200

    configuration options for faster OSPF convergence

    Allow configuration of faster OSPF convergence via the
    min_ls_interval and min_ls_arrival timer lengths.

    This patch was originated by Michael, and cross-ported
    to Cumulus's Quagga.

8 years agozebra: Fix show ip route for ibgp only routes
Donald Sharp [Fri, 13 May 2016 18:13:00 +0000 (14:13 -0400)]
zebra: Fix show ip route for ibgp only routes

When 'show ip route summ' is entered
and there are only ibgp routes they
are not being displayed.  This commit
fixes this issue.

Ticket: CM-10931
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
8 years agoOSPF refreshTimerMsecs in json output is off
Daniel Walton [Fri, 13 May 2016 18:19:56 +0000 (18:19 +0000)]
OSPF refreshTimerMsecs in json output is off

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Ticket: CM-10960

The timer is in seconds and was being divided by 1000 instead of
multiplying by 1000 when converting to ms.

8 years agoMerge branch 'cmaster' of ssh://stash.cumulusnetworks.com:7999/quag/quagga into cmaster
vivek [Fri, 13 May 2016 17:18:37 +0000 (10:18 -0700)]
Merge branch 'cmaster' of ssh://stash.cumulusnetworks.com:7999/quag/quagga into cmaster

8 years agozebra: Accept and process RAs with lifetime of zero
vivek [Fri, 13 May 2016 05:57:40 +0000 (22:57 -0700)]
zebra: Accept and process RAs with lifetime of zero

Fix code to not discard received RAs with a lifetime of 0. The router lifetime
is only applicable for default router processing which is not relevant here.
For the purposes of BGP unnumbered, the neighbor should be learnt without
consideration of the value of router lifetime in received RA.

Note: This patch brings in a portion of the earlier commit
690baa53592320dddee5c729f959150cc9a72699 - this included some additional
changes which have been reverted.

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
Ticket: CM-10943
Reviewed By: CCR-4611
Testing Done: bgp-smoke

8 years agolib: Fix crash in 'no vrf' command
Donald Sharp [Fri, 13 May 2016 12:24:50 +0000 (12:24 +0000)]
lib: Fix crash in 'no vrf' command

If a routing protocol does not have a vrf
configed and the vrf happens to be down
a 'no vrf X' line will cause the system
to crash.

This fixes the issue, I do believe though
that we need to revisit the issue and re-think
start/stop/config/unconfig of vrf's a bit more.

Ticket: CM-10952
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Signed-off-by: Dinesh Dutt <ddutt@cumulusnetworks.com>
8 years agoRevert "Zebra: Update/fix router_lifetime in IPv6 RAs"
vivek [Fri, 13 May 2016 01:31:19 +0000 (18:31 -0700)]
Revert "Zebra: Update/fix router_lifetime in IPv6 RAs"

This reverts commit 690baa53592320dddee5c729f959150cc9a72699.

Making the router lifetime in the IPv6 RAs as 0 by default would break BGP
unnumbered when this version of Quagga goes up against a 2.5.x Quagga. This
is because of a defect in the Quagga code that ignores any received RAs with
a lifetime of 0.

8 years agozebra: Add route-map support to ip import-table
Don Slice [Wed, 11 May 2016 15:47:02 +0000 (08:47 -0700)]
zebra: Add route-map support to ip import-table

Added the ability to supply a route-map to the ip import-table command,
which greatly improves filtering between the kernel prefixes in a
non-default table that are imported into the zebra rib.

Ticket:CM-8168
Signed-off-by: Donald Slice
Reviewed By: Donald Sharp

8 years agoBGP: Set advertisement interval when triggering IPv6 RAs
vivek [Thu, 12 May 2016 23:51:43 +0000 (16:51 -0700)]
BGP: Set advertisement interval when triggering IPv6 RAs

This change extends the earlier change which added the ability in BGP to
trigger IPv6 Router Advertisements when an unnumbered neighbor is configured.
In addition to triggering the RAs, the advertisement interval is also set to
10 seconds. This is needed to handle the scenario where the peer may start
later.

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Ticket: CM-10896
Reviewed By: CCR-4693
Testing Done: Manual, bgp-min, bgp-smoke

8 years agoFix unprotected debugs to warns and fix
Donald Sharp [Thu, 12 May 2016 01:31:30 +0000 (21:31 -0400)]
Fix unprotected debugs to warns and fix

In the case of a route replace failing we
saw two issues with the logging:

1) The route replace was a debug instead of a warn
  -> In this case change code to zlog_warn
2) The buf in the route replace was not being initialized
because buf initialization was protected by a debug check.
  -> In this case move the buf initialization to inside
the failure case.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
8 years agoFix non initialized usage of data in zebra_rnh.c
Donald Sharp [Thu, 12 May 2016 00:22:45 +0000 (20:22 -0400)]
Fix non initialized usage of data in zebra_rnh.c

In zebra_deregister_rnh_static_nexthops the nh_p
structure was not being properly initialized for
all the cases that we could be storing a nexthop
for.  This was causing code later to retrieve
the table from an nh_p->family which was garbage.

In the case of BLACKHOLE and Ifindex based routes
do nothing because they shouldn't be a nexthop
considered for NHT.

==2239== Conditional jump or move depends on uninitialised value(s)
==2239== at 0x4E5F6CE: family2afi (prefix.c:217)
==2239== by 0x155F7C: get_rnh_table (zebra_rnh.c:83)
==2239== by 0x156194: zebra_lookup_rnh (zebra_rnh.c:148)
==2239== by 0x15655E: zebra_deregister_rnh_static_nh (zebra_rnh.c:242)
==2239== by 0x156681: zebra_deregister_rnh_static_nexthops
(zebra_rnh.c:280)
==2239== by 0x12F3DF: rib_unlink (zebra_rib.c:2210)
==2239== by 0x12E9CE: rib_process (zebra_rib.c:1843)
==2239== by 0x12EA8A: process_subq (zebra_rib.c:1873)
==2239== by 0x12ECAF: meta_queue_process (zebra_rib.c:1936)
==2239== by 0x4E89625: work_queue_run (workqueue.c:298)
==2239== by 0x4E63230: thread_call (thread.c:1577)
==2239== by 0x125830: main (main.c:432)
==2239==
==2239== Conditional jump or move depends on uninitialised value(s)
==2239== at 0x4E5F6DB: family2afi (prefix.c:220)
==2239== by 0x155F7C: get_rnh_table (zebra_rnh.c:83)
==2239== by 0x156194: zebra_lookup_rnh (zebra_rnh.c:148)
==2239== by 0x15655E: zebra_deregister_rnh_static_nh (zebra_rnh.c:242)
==2239== by 0x156681: zebra_deregister_rnh_static_nexthops
(zebra_rnh.c:280)
==2239== by 0x12F3DF: rib_unlink (zebra_rib.c:2210)
==2239== by 0x12E9CE: rib_process (zebra_rib.c:1843)
==2239== by 0x12EA8A: process_subq (zebra_rib.c:1873)
==2239== by 0x12ECAF: meta_queue_process (zebra_rib.c:1936)
==2239== by 0x4E89625: work_queue_run (workqueue.c:298)
==2239== by 0x4E63230: thread_call (thread.c:1577)
==2239== by 0x125830: main (main.c:432)

Ticket: CM-10667
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Reviewed-by: Shrijeet Mukherjee <shm@cumulusnetworks.com>
8 years agolib: Fix connected lookup
Donald Sharp [Wed, 11 May 2016 23:11:06 +0000 (19:11 -0400)]
lib: Fix connected lookup

When looking up the connected route, the delete was
causing crashes in OSPF due to the oi having copies
of the freshly deleted connected interface.  Fix
code to first lookup the connected route and use that
instead of just deleting it.

Valgrind Findings:

==24112== Invalid read of size 1
==24112== at 0x4E8283F: ospf_intra_add_stub (ospf_route.c:614)
==24112== by 0x4E80B15: ospf_spf_process_stubs (ospf_spf.c:1064)
==24112== by 0x4E80F74: ospf_spf_calculate (ospf_spf.c:1269)
==24112== by 0x4E811C9: ospf_spf_calculate_timer (ospf_spf.c:1339)
==24112== by 0x5126230: thread_call (thread.c:1577)
==24112== by 0x401E00: main (ospf_main.c:377)
==24112== Address 0x7f56a09 is 9 bytes inside a block of size 40 free'd
==24112== at 0x4C29E90: free (in
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==24112== by 0x51290B3: zfree (memory.c:132)
==24112== by 0x51287F0: connected_free (if.c:987)
==24112== by 0x514406A: zebra_interface_address_read (zclient.c:1146)
==24112== by 0x4E5A81C: ospf_interface_address_add (ospf_zebra.c:262)
==24112== by 0x5144838: zclient_read (zclient.c:1397)
==24112== by 0x5126230: thread_call (thread.c:1577)
==24112== by 0x401E00: main (ospf_main.c:377)

Ticket: CM-10890
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
8 years agolib: refactor connected_lookup_prefix
Donald Sharp [Wed, 11 May 2016 22:52:30 +0000 (18:52 -0400)]
lib: refactor connected_lookup_prefix

The connected_lookup_address function should really
be a connected_lookup_prefix function.  Refactor
the code to use it.

Ticket: CM-10890
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
8 years ago"ip protocol" is missing ospf as an option
Daniel Walton [Wed, 11 May 2016 13:12:08 +0000 (13:12 +0000)]
"ip protocol" is missing ospf as an option

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Ticket: CM-10849

We were incorrectly listing protocols that supported ipv6 for "ip
protocol" instead of listing the protocols that supported ipv4.

With the fix

superm-redxp-05(config)# ip protocol ?
  any        Any of the above protocols
  bgp        Border Gateway Protocol (BGP)
  connected  Connected routes (directly attached subnet or host)
  isis       Intermediate System to Intermediate System (IS-IS)
  kernel     Kernel routes (not installed via the zebra RIB)
  ospf       Open Shortest Path First (OSPFv2)
  rip        Routing Information Protocol (RIP)
  static     Statically configured routes
  table      Non-main Kernel Routing Table
superm-redxp-05(config)#
superm-redxp-05(config)#
superm-redxp-05(config)# ipv6 protocol ?
  any        Any of the above protocols
  bgp        Border Gateway Protocol (BGP)
  connected  Connected routes (directly attached subnet or host)
  isis       Intermediate System to Intermediate System (IS-IS)
  kernel     Kernel routes (not installed via the zebra RIB)
  ospf6      Open Shortest Path First (IPv6) (OSPFv3)
  ripng      Routing Information Protocol next-generation (IPv6) (RIPng)
  static     Statically configured routes
  table      Non-main Kernel Routing Table
superm-redxp-05(config)#
superm-redxp-05(config)#

8 years agozebra: Fix interface based static routes
Donald Sharp [Tue, 10 May 2016 12:49:28 +0000 (08:49 -0400)]
zebra: Fix interface based static routes

This commit fixes interface based static routes.

static routes are now stored and if an interface
comes up it finds the route and installs it.

Ticket: CM-10869
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Don Slice <dslice@cumulusnetworks.com>
8 years agodebian: Fix changelog
Donald Sharp [Tue, 10 May 2016 19:06:14 +0000 (15:06 -0400)]
debian: Fix changelog

Fixup Changelog

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agoBGP: Fix nexthop setting for default originate
vivek [Tue, 10 May 2016 16:29:25 +0000 (09:29 -0700)]
BGP: Fix nexthop setting for default originate

The nexthop setting for IPv6 default origination was incorrect, resulting in
the same (incorrect) IPv6 link-local nexthop being advertised to multiple
peers. The issue was also present for IPv4 default origination when IPv4
routes are advertised with IPv6 nextops (RFC 5549).

For default origination, we should just reset the nexthop when forming the
update for the update-group and let the outbound update/nexthop setting code
set it correctly.

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Don Slice <dslice@cumulusnetworks.com>
Ticket: CM-10623
Reviewed By: CCR-4677
Testing Done: Manual, bgp-min

8 years agoQuagga: Check and cleanup prior address when processing address add on interface
vivek [Mon, 9 May 2016 22:53:06 +0000 (15:53 -0700)]
Quagga: Check and cleanup prior address when processing address add on interface

IPv4 addresses can be learnt from the kernel even when the interface is down.
Quagga notifis clients of addresses upon learning of them (initial read or
upon NEWADDR) as well as when the interface comes up. The problem is that
while zebra code itself has checks to ensure duplicate addresses aren't added
to an interface, that is not true for the clients.

This patch checks for duplicates when the client receives the address add.
Upon this, the patch does a delete and add as done in zebra - because there
is a possibility that some other parameter could have changed. The fix also
takes care of the extra memory allocation for 'connected' in clients.

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Reviewed-by: Dinesh Dutt <ddutt@cumulusnetworks.com>
Ticket: CM-10745
Reviewed By: CCR-4660
Testing Done: Manual, bgp-min

8 years agozebra - BFD client de-registration support
radhika [Mon, 9 May 2016 03:11:18 +0000 (20:11 -0700)]
zebra - BFD client de-registration support

CM-10680
Issue: When BGP daemon is stopped, all the BGP BFD sessions are not getting deleted from PTM.
Root cause: BGP daemon stop causes BFD de-register message to be sent for every peer on which BFD is enabled. But, all the de-register messages from bgpd to zebra are not processed before the socket close. This results in some stale BGP BFD sessions.
Fix: Support for client de-register message has been added in PTM/BFD.  Changes in Quagga to support BFD client de-registrations:
−   The BFD clients de-registration is sent directly from zebra daemon when zebra client (bgpd, ospfd and ospf6d) socket close is detected.
−   Introduced a BFD flag for the zebra clients to prevent BFD de-registration messages from being sent to zebra daemon when the client is shutting down. This reduces the BFD messaging.

CM-10540
Issue: Invalid ptm status “fail” instead of “n/a” being displayed for VRF interfaces.
Root cause: ptm status is not being initialized to “unknown” status when VRF interface is added or changed. The uninitialized value is ‘0’ which is the value for “fail”
Fix: Initialized the ptm status to the correct value.

Signed-off-by: Radhika Mahankali <radhika@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Kanna Rajagopal <kanna@cumulusnetworks.com>
Ticket: CM-10680, CM-10540
Reviewed By: CCR-4653
Testing Done: PTM smoke, BGP smoke and ptmd_test.py:TestMultipleAddrsIntfOspfBgp

8 years agoBGP: At exit, remove callbacks before invoking vrf_terminate()
vivek [Sat, 7 May 2016 05:07:58 +0000 (22:07 -0700)]
BGP: At exit, remove callbacks before invoking vrf_terminate()

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
Ticket: CM-10831
Reviewed By: CCR-4657
Testing Done: Manual

8 years agodebian: Update changelog
Donald Sharp [Wed, 4 May 2016 18:14:29 +0000 (14:14 -0400)]
debian: Update changelog

Fix the changelog to show what we are releasing

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agolib: Vrf disable hook was never being run
Donald Sharp [Thu, 5 May 2016 12:20:32 +0000 (08:20 -0400)]
lib: Vrf disable hook was never being run

The check for the fact a vrf was enabled
was immediately after we disabled it in vrf_disable()

Ticket: CM-10139
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Reviewed-by: Don Slice <dslice@cumulusnetworks.com>
8 years agozebra: fix show ip route vrf to use zvrf_list
Donald Sharp [Wed, 4 May 2016 13:44:43 +0000 (13:44 +0000)]
zebra: fix show ip route vrf to use zvrf_list

Iterate over the zvrf_list to allow 'show ip route vrf...'
to show vrfs that are inactive -vs- not even configured

Ticket: CM-10139
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Reviewed-by: Don Slice <dslice@cumulusnetworks.com>
8 years agolib: Swap show run ordering of interfaces and vrf's
Donald Sharp [Wed, 4 May 2016 13:05:37 +0000 (13:05 +0000)]
lib: Swap show run ordering of interfaces and vrf's

When doing a 'show run' display vrf information
first to allow later commands to just
work correctly for vrf cli read in.

Ticket: CM-10139
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Reviewed-by: Don Slice <dslice@cumulusnetworks.com>
8 years agozebra: Fix show vrf and show run to use the zvrf_list
Donald Sharp [Wed, 4 May 2016 01:04:00 +0000 (01:04 +0000)]
zebra: Fix show vrf and show run to use the zvrf_list

The show vrf and show run commands were iterating
over the vrf_list.  Use the zvrf_list instead
so that we can understand the differences
between something configed -vs- created

Ticket: CM-10139
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Reviewed-by: Don Slice <dslice@cumulusnetworks.com>
8 years agozebra: Save the zvrf in a zvrf_list
Donald Sharp [Wed, 4 May 2016 00:17:29 +0000 (20:17 -0400)]
zebra: Save the zvrf in a zvrf_list

The zebra vrf needs to be saved in a
zvrf_list so that we can tell when
things start/stop correctly

Ticket: CM-10139
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
Signed-off-by: Donald Sharp <sharpd@cumulustnetworks.com>
Reviewed-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
8 years agozebra: Add code to add/remove statics from the rib
Donald Sharp [Wed, 4 May 2016 00:04:43 +0000 (20:04 -0400)]
zebra: Add code to add/remove statics from the rib

On enable/disable of static routes add and remove them
from the rib as appropriate.

Ticket: CM-10139
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Reviewed-by: Don Slice <dslice@cumulusnetworks.com>
8 years agolib: Fix unprotected debug
Donald Sharp [Thu, 5 May 2016 00:13:54 +0000 (20:13 -0400)]
lib: Fix unprotected debug

"Vrf found: %p" was not protected by a debug
check and as such we were seeing allot of
extraneous output.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
8 years agoMerge branch 'cmaster' of ssh://stash.cumulusnetworks.com:7999/quag/quagga into cmaster
vivek [Tue, 3 May 2016 20:05:05 +0000 (13:05 -0700)]
Merge branch 'cmaster' of ssh://stash.cumulusnetworks.com:7999/quag/quagga into cmaster

8 years agolib: Rework vrf_get
Donald Sharp [Mon, 2 May 2016 19:30:55 +0000 (15:30 -0400)]
lib: Rework vrf_get

vrf_get has these possible lookup/creation ways of being called.

name = NULL, vrf_id = VRF_UNKNOWN
   Nothing to do here.

name = NULL, vrf_id != VRF_UNKNOWN
   Look up the vrf_id in the table.  Return that created vrf.
   If not found create a struct vrf to hold it properly.

name = <something>, vrf_id = VRF_UNKNOWN
   Look up the name in the vrf list, if found return that vrf.
   If not found create the vrf and zvrf

name = <something>, vrf_id != VRF_UNKNOWN
   Look up the name in the vrf list, if found check to see
   if the vrf->vrf_id is VRF_UNKNOWN, if so match up and return
   If not found, create the vrf and table entry and return

Ticket: CM-10139
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
8 years agoquagga-reload broken when comparing Quagga.conf in 2.5 format vs 3.0
Daniel Walton [Tue, 3 May 2016 19:45:38 +0000 (19:45 +0000)]
quagga-reload broken when comparing Quagga.conf in 2.5 format vs 3.0
format

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Ticket: CM-10693

8 years agoZebra: Update/fix router_lifetime in IPv6 RAs
vivek [Tue, 3 May 2016 19:10:22 +0000 (12:10 -0700)]
Zebra: Update/fix router_lifetime in IPv6 RAs

BGP Unnumbered relies on IPv6 Router Advertisements (RAs) to advertise our
link-local IPv6 address and learn of the peer's address in order to initiate
the BGP peering. When IPv6 RAs are enabled on an interface, Quagga currently
advertises a non-zero router lifetime which causes hosts receiving the RAs
to install the router as the default router. This may not be desirable in
many situations - the IPv6 RAs may be turned on just to get BGP unnumbered
peering up.

There is a sysctl available to control the host behavior (net.ipv6.conf.all.
accept_ra_defrtr). However, this requires setting on all hosts and this may
mean many hosts, especially if Quagga is run on the hosts.

An alternate solution arrived at was to modify Quagga to advertise a zero
router lifetime, unless a value is specifically set by the operator. This
patch implements this change. The change may not meet a strict interpretation
of the RFC, so it is under HAVE_CUMULUS. When hosts see an IPv6 RA with a
router lifetime of 0, they won't make that router a default router. The
patch also fixes an incorrect check in handling of received RAs which would
have caused us to drop RAs with a lifetime of 0.

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
Ticket: CM-9815
Reviewed By: CCR-4611
Testing Done: Manual, bgp-min etc. (defails in defect)

8 years agozebra: Allow vrfs to be defined and displayed before netlink vrf add
root [Tue, 3 May 2016 17:54:01 +0000 (17:54 +0000)]
zebra: Allow vrfs to be defined and displayed before netlink vrf add

Displays vrfs using the vrf_list rather than the route-nodes.  This allows "show vrf"
to display inactive (or not yet active) vrfs.  Also, IPv6 static routes are now
allowed to be defined and displayed prior to the netlink vrf add.

Ticket: CM-10139
Signed-off-by: Don Slice
Reviewed-by: Donald Sharp
8 years agobgpd: Fix call bgp_zebra_terminate_radv
Donald Sharp [Tue, 3 May 2016 03:52:00 +0000 (23:52 -0400)]
bgpd: Fix call bgp_zebra_terminate_radv

The call into bgp_zebra_terminate_radv was
setting the peer->ifp to NULL before
calling into bgp_zebra_terminate_radv.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
8 years agoquagga: Fix version string
Donald Sharp [Tue, 3 May 2016 02:30:43 +0000 (22:30 -0400)]
quagga: Fix version string

Modify cl3.0 -> cl3u1

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
9 years ago"bgp network import-check" needs hidden "exact" option
Daniel Walton [Mon, 2 May 2016 21:36:33 +0000 (21:36 +0000)]
"bgp network import-check" needs hidden "exact" option

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: vivek@cumulusnetworks.com
Ticket: CM-10694

To be backwards compatible we should silently accept the "exact" keyword
here

9 years agoBGP: Trigger IPv6 router advertisements upon config of unnumbered neighbor
vivek [Mon, 2 May 2016 20:53:38 +0000 (13:53 -0700)]
BGP: Trigger IPv6 router advertisements upon config of unnumbered neighbor

Instead of turning on IPv6 RA on every interface as soon as it has an IPv6
address, only enable it upon configuration of BGP neighbor. When the BGP
neighbor is deleted, signal that RAs can be turned off.

To support this, introduce new message interaction between BGP and Zebra.
Also, take appropriate actions in BGP upon interface add/del since the
unnumbered neighbor could exist prior to interface creation etc.

Only unnumbered IPv6 neighbors require RA, the /30 or /31 based neighbors
don't. However, to keep the interaction simple and not have to deal with
too many dynamic conditions (e.g., address deletes or neighbor change to/from
'v6only'), RAs on the interface are triggered upon any unnumbered neighbor
configuration.

BGP-triggered RAs will cause RAs to be initiated on the interface; however,
if BGP asks that RAs be stopped (upon delete of unnumbered neighbor), RAs
will continue to be exchanged if the operator has explicitly enabled.

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Ticket: CM-10640
Reviewed By: CCR-4589
Testing Done: Various manual and automated (refer to defect)

9 years agolib: VRF_GET_ID should respect VRF_UNKNOWN
Donald Sharp [Thu, 28 Apr 2016 14:02:35 +0000 (10:02 -0400)]
lib: VRF_GET_ID should respect VRF_UNKNOWN

The VRF_GET_ID macro should respect the VRF_UNKNOWN
as a notice that the vrf is not active.

Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
9 years agozebra: Stop passing around vrf_id for static_XXX functions
Donald Sharp [Wed, 27 Apr 2016 20:22:13 +0000 (16:22 -0400)]
zebra: Stop passing around vrf_id for static_XXX functions

The static zebra functions are passing around the vrf_id
At the crunchy edges gather the zvrf from passed in
vrf name and pass that around instead.

Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
9 years agozebra: Refactor zebra_vrf_static_table
Donald Sharp [Wed, 27 Apr 2016 18:30:45 +0000 (14:30 -0400)]
zebra: Refactor zebra_vrf_static_table

We were passing in the vrf_id pass in the zvrf
instead.

Signed-off-by: donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Don Slice <dslice@cumulusnetworks.com>
9 years agoMerge branch 'cmaster' of ssh://stash.cumulusnetworks.com:7999/quag/quagga into cmaster
Donald Sharp [Mon, 2 May 2016 12:24:33 +0000 (08:24 -0400)]
Merge branch 'cmaster' of ssh://stash.cumulusnetworks.com:7999/quag/quagga into cmaster

9 years agodebian: Debian fixups
Donald Sharp [Thu, 28 Apr 2016 00:03:35 +0000 (20:03 -0400)]
debian: Debian fixups

This commit does two things:

1)  Fixes package name to have ...+cl3u1
2)  Allows the build to determine if we are building
a debian package on a init.d or systemd style system
and to do the right thing.
3)  Fixed quagga service file naming

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Dave Olson <olson@cumulusnetworks.com>
Reviewed-by: Don Slice <dslice@cumulusnetworks.com>
Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
9 years agoMerge branch 'cmaster' of ssh://stash.cumulusnetworks.com:7999/quag/quagga into cmaster
Dinesh G Dutt [Fri, 29 Apr 2016 16:34:20 +0000 (09:34 -0700)]
Merge branch 'cmaster' of ssh://stash.cumulusnetworks.com:7999/quag/quagga into cmaster

9 years agoFix BGP JSON output
Dinesh G Dutt [Thu, 28 Apr 2016 02:03:31 +0000 (19:03 -0700)]
Fix BGP JSON output

Ticket: CM-10644
Reviewed By:
Testing Done:

The JSON outputs of a bunch of BGP commands were broken due to the
addition of VRF support. This fixes them all. Also replaces the use
of "-" in some of the JSON variable names with camel case names.

9 years agozebra: Implement recovery for route install failure
vivek [Fri, 29 Apr 2016 05:09:17 +0000 (22:09 -0700)]
zebra: Implement recovery for route install failure

Quagga does not have proper recovery for route install failure (in
the kernel). The lack of this may not be a significant issue if the
failure is only an exception. However, the introduction of route
replace presents a new failure scenario which was not there earlier.
Before replace, the update operation involved a delete followed by
add; the failure of add would not leave hanging route entries in the
kernel as they would've got deleted first. With route replace, if
the replace fails, recovery action to delete the route is needed, else
the route remains hanging in the kernel.

In particular, with VRFs and in the presence of ECMP/multipath, a
failure mode exists where Quagga thinks that routes have been cleaned
up and deleted from the kernel but the kernel continues to retain them.
This happens when multiple VRF interfaces are moved from one VRF to
another.

This patch addresses this scenario by implementing proper recovery for
route install failure.

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Reviewed-by: Dinesh Dutt <ddutt@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Ticket: CM-10361
Reviewed By: CCR-4566
Testing Done: bgp-min, ospf-min, bgp-smoke, ospf-smoke and manual

Note: There are some test failures and results aren't consistent across
runs; Daniel has resolved many of these through other fixes.

9 years agoMerge branch 'cmaster' of ssh://stash.cumulusnetworks.com:7999/quag/quagga into cmaster
Dinesh G Dutt [Wed, 27 Apr 2016 20:56:23 +0000 (13:56 -0700)]
Merge branch 'cmaster' of ssh://stash.cumulusnetworks.com:7999/quag/quagga into cmaster

9 years agoAdd support for fast rexmit of RA on link transitions.
Dinesh G Dutt [Wed, 27 Apr 2016 01:26:10 +0000 (18:26 -0700)]
Add support for fast rexmit of RA on link transitions.

Ticket: CM-7076
Reviewed By: CCR-4568
Testing Done:

To allow for faster convergence, modify transmission of IPv6 RA so
that on link transitions(link up, change VRF, link add etc.), we
transmit RA fast to ensure faster convergence with BGP Unnumbered.
But we don't enable Fast RA if RA interval is in msecs as we've
fixed the fast RA interval to be 1s. We retransmit RA 4 times, once
each second on link events and when RA is first enabled.

9 years agodebian: Attempt to fix parrelization
Donald Sharp [Wed, 27 Apr 2016 16:27:37 +0000 (12:27 -0400)]
debian: Attempt to fix parrelization

This commit fixes some quagga build issues such
that you can now use -j in your sbuild line.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Signed-off-by: Jon Toppins <toppins@cumulusnetworks.com>
9 years agoquagga: Fixup startup to allow consistency between sysV and systemd
Donald Sharp [Mon, 25 Apr 2016 15:34:35 +0000 (11:34 -0400)]
quagga: Fixup startup to allow consistency between sysV and systemd

We want the ability to start up quagga in a varied set of
environments.  This needs to be done in SysV and systemd
startups.  As such refactor the code to allow us to
allow end users to easily switch between the two

sysV:
edit the /etc/quagga/daemons file
service quagga [start|stop|reload|restart]

Systemd:
edit the /etc/quagga/daemons file
systemctl [start|stop|reload|restart] quagga

Ticket: CM-10634
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
9 years agoMerge branch 'cmaster' of ssh://stash.cumulusnetworks.com:7999/quag/quagga into cmaster
Donald Sharp [Wed, 27 Apr 2016 19:55:43 +0000 (15:55 -0400)]
Merge branch 'cmaster' of ssh://stash.cumulusnetworks.com:7999/quag/quagga into cmaster

9 years agozebra: Fix PTM to not pass a default vrf name
Donald Sharp [Tue, 26 Apr 2016 00:01:04 +0000 (20:01 -0400)]
zebra: Fix PTM to not pass a default vrf name

The default vrf name choosen in quagga has no meaning.
Don't pass it to the ptm process as it gets dizzy.

Ticket: CM-10581
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Kanna Rajagopal <kanna@cumulusnetworks.com>
9 years ago"show ip route summary" has negative values for ebgp counters
Daniel Walton [Tue, 26 Apr 2016 22:50:34 +0000 (22:50 +0000)]
"show ip route summary" has negative values for ebgp counters

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: Dinesh Dutt <ddutt@cumulusnetworks.com>
Ticket: CM-10612

9 years agono neighbor peergrp shutdown no longer works
Daniel Walton [Tue, 26 Apr 2016 02:20:25 +0000 (02:20 +0000)]
no neighbor peergrp shutdown no longer works

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Ticket: CM-10565

9 years agoBGP peers remain in active while rdnbrd is running.
Daniel Walton [Mon, 25 Apr 2016 20:19:08 +0000 (20:19 +0000)]
BGP peers remain in active while rdnbrd is running.

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Ticket: CM-7789, CM-8806

If the route-map for an "ip import-table" denied a route it only flagged
the nexthop as inactive, it did not actually delete the route. This
breaks all directly connected EBGP peers that peer via IPv4 because NHT
finds this /32 with an inactive nexthop.

9 years agoUpdate last reset reason on interface down or neighbor addr loss.
Dinesh G Dutt [Fri, 22 Apr 2016 22:15:25 +0000 (15:15 -0700)]
Update last reset reason on interface down or neighbor addr loss.

Ticket:
Reviewed By:
Testing Done:

For interface-based peering, we don't update the reset reason to be
interface down. Similarly, we don't update the reason to be loss of
neighbor address (maybe due to RA loss). This patch addresses these
limitations.

9 years agoMerge branch 'cmaster' of ssh://stash.cumulusnetworks.com:7999/quag/quagga into cmaster
Donald Sharp [Fri, 22 Apr 2016 16:34:04 +0000 (12:34 -0400)]
Merge branch 'cmaster' of ssh://stash.cumulusnetworks.com:7999/quag/quagga into cmaster

9 years agolib: bfd debug fixup
Donald Sharp [Fri, 22 Apr 2016 11:41:08 +0000 (07:41 -0400)]
lib: bfd debug fixup

BFD debugs were being output without any
debug protection.  Modify the code
to not output unless debugging is
turned on.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Radhika Mahankali <radhika@cumulusnetworks.com>
Reviewed-by: Don Slice <dslice@cumulusnetworks.com>
Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
9 years agobgpd: debug protect a log message
Donald Sharp [Fri, 22 Apr 2016 01:34:48 +0000 (21:34 -0400)]
bgpd: debug protect a log message

With the addition of RA being turned on by default.
Spewing this error message when unable to connect
doesn't make much sense anymore.

Ticket: CM-10494
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Don Slice <dslice@cumulusnetworks.com>
Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: Radhika Mahankali <radhika@cumulusnetworks.com>
9 years agoMerge branch 'cmaster' of ssh://stash.cumulusnetworks.com:7999/quag/quagga into cmaster
Don Slice [Fri, 22 Apr 2016 12:40:09 +0000 (05:40 -0700)]
Merge branch 'cmaster' of ssh://stash.cumulusnetworks.com:7999/quag/quagga into cmaster

9 years agozebra: Change interface handling so non-vrf aware protocols correctly handle them
Don Slice [Fri, 22 Apr 2016 00:12:26 +0000 (17:12 -0700)]
zebra: Change interface handling so non-vrf aware protocols correctly handle them

Changed interaction between zebra and routing protocols so that they correctly
fill in the vrf_iflist even for vrfs they're not responsible for.  In that way,
when they get callbacks from zebra they can correctly understand whether they need
to create them or not.

Ticket: CM-10427
Signed-off-by: Don Slice
Reviewed-by:

9 years agoMerge branch 'cmaster' of ssh://stash.cumulusnetworks.com:7999/quag/quagga into cmaster
Dinesh G Dutt [Fri, 22 Apr 2016 01:41:47 +0000 (18:41 -0700)]
Merge branch 'cmaster' of ssh://stash.cumulusnetworks.com:7999/quag/quagga into cmaster

9 years agoAddition on hidden command "bfd multihop/singlehop" and "ptm-enable" per interface...
radhika [Thu, 21 Apr 2016 22:39:38 +0000 (15:39 -0700)]
Addition on hidden command "bfd multihop/singlehop" and "ptm-enable" per interface command

CM-10435
Issue: IBGP BFD sessions are created as multi-hop even though peer is single-hop away. This is causing an interop issue with ICOS.
Root Cause: By design all IBGP peers are registered with BFD as multi-hop.
Fix:
• Changed the default behavior of always treating IBGP BFD sessions as mult-hop. shared_network variable is used to determine whether the IBGP peer is single hop or multi-hop away. The logic for determining whether EBGP peer is single hop or multi-hop has not been changed.
• Since the default behavior has been changed, it will cause interop issues between 2.5 and 3.0 IBGP BFD sessions. A new hidden command “bfd multihop/singlehop” has been introduced to overcome the interop issues.

dell-s6000-10(config-router)# neighbor 30.0.2.6 bfd
<2-255> Detect Multiplier
<cr>
dell-s6000-10(config-router)# neighbor 30.0.2.6 bfd multihop
dell-s6000-10(config-router)# no neighbor 30.0.2.6 bfd multihop
dell-s6000-10(config-router)#
dell-s6000-10(config-router)# neighbor 30.0.2.6 bfd multihop
dell-s6000-10(config-router)# do show running-config
!
router bgp 100
neighbor igroup peer-group
neighbor igroup bfd 5 500 500
neighbor igroup bfd multihop
neighbor 30.0.2.2 remote-as 100
neighbor 30.0.2.2 peer-group igroup
neighbor 3101:abc:bcad::2 remote-as 100
neighbor 3101:abc:bcad::2 peer-group igroup
neighbor 30.0.2.6 remote-as 200
neighbor 30.0.2.6 bfd multihop
neighbor 3102:abc:bcad::6 remote-as 200
neighbor 3102:abc:bcad::6 bfd
neighbor 3102:abc:bcad::6 ebgp-multihop 255
!

CM-10260
Issue: “Unable to connect to socket” message keeps getting logged when ptmd process doesn’t exist.
Root Cause: BFD clients (bgpd, ospfd and ospf6d) during initialization try to register with BFD/PTM by default. This results in continuous logging If PTM does not exist since there is no max on number of retries.
Fix:
• Stop the retries to connect to PTM after max reconnect timer of 5 mins is reached.
• Added zebra debug event wrapper to message logging to prevent it from showing by default.

CM-4541
Issue: Addition of a new command "ptm-enable" or "no ptm-enable" per interface to enable/disable PTM link status checks for an interface.
Fix: Currently there is only one ptm-enable global command that enables/disables PTM status updates for all interfaces. This new command will give the handle to individually stop interface from reacting on the PTM status updates.
• by default interface uses the ptm-enable global configuration
• "no ptm-enable" on an interface will disable PTM status updates from taking affect for that interface. This can bring the interface up if it was brought down due to PTM status update.
• "ptm-enable" on an interface will cause the interface to fallback to the global ptm-enable configuration value and will bring the interface up or down based on the last stored PTM status update if global ptm is enabled.

Ticket: CM-10435, CM-10260 and CM-4541
Signed-off-by: Radhika Mahankali
Reviewed-by: Donald Sharp, Kanna Rajagopal
9 years agoquagga-reload broken for 'neighbor swpX interface peer-group FOO'
Daniel Walton [Thu, 21 Apr 2016 20:21:29 +0000 (20:21 +0000)]
quagga-reload broken for 'neighbor swpX interface peer-group FOO'

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: Don Slice <dslice@cumulusnetworks.com>
Ticket: CM-10328

9 years agoGet route counts right for show ip route summary
Dinesh G Dutt [Thu, 21 Apr 2016 05:27:29 +0000 (22:27 -0700)]
Get route counts right for show ip route summary

Ticket: CM-9974
Reviewed By: CCR-4531
Testing Done: Testing with both single & multiple NHs

Zebra is counting each NH as a separate route which leads to all wrong
stats. Count routes, not NHs.

9 years agozebra: Only create vrf route-node if in the kernel
Don Slice [Thu, 21 Apr 2016 16:15:07 +0000 (16:15 +0000)]
zebra: Only create vrf route-node if in the kernel

Changed vrf_get to only create a route-node if the kernel has enabled the vrf,
supplying a table-id.  If the quagga configuration contains vrfs that have not
yet been enabled by the kernel, the vrf is created with a vrf_id of VRF_UNKNOWN.
These vrfs are added to the vrf_list so they contain a zvrf and configuration,
but the route-node is not created until the kernel has signalled that the vrf
has been defined and enabled.

Ticket: CM-10481
Signed-off-by: Don Slice
Reviewed-by: Donald Sharp
9 years agobgp: Anti-Yammer Patch
Donald Sharp [Thu, 21 Apr 2016 02:08:49 +0000 (22:08 -0400)]
bgp: Anti-Yammer Patch

When you shutdown interfaces with ifdown -a -X eth0
bgp would still attempt to talk to it's configured
neighbors but since the interface is down it would
just complain and complain.  Now that we have
somewhat aggressive timers the error message
really starts to show up.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
9 years agozebra: Fix zebra_rnh_register crash
Donald Sharp [Wed, 20 Apr 2016 20:12:29 +0000 (16:12 -0400)]
zebra: Fix zebra_rnh_register crash

Zebra is crashing inside of zserv_rnh_register when it attempts to
lookup a vrf that was just deleted:

Imagine this series of events:

Pre (A): ifdown -a -X eth0
(A) zebra notification from kernel that vrf is goneroo
(B) zebra notifies all daemons
(C) bgpd is churning because we have been removing interfaces and we
have an new path and it hasn't handled the vrf goneroo event yet from
zebra so it sends to zebra a new rnh with an old vrf_id.
(D) zebra attempts to lookup the zvrf and crashes because of pointer
dereference.

zebra handles all callbacks in one function. Convert that function to
check to see if we have a valid zvrf. If so make the callback

Ticket: CM-10482
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Don Slice <dslice@cumulusnetworks.com>
Reviewed-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
9 years agoBGP: Certain peer-group parameters (e.g., enhe, local-as) are not taking
Daniel Walton [Tue, 19 Apr 2016 02:26:57 +0000 (02:26 +0000)]
BGP: Certain peer-group parameters (e.g., enhe, local-as) are not taking
effect

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Don Slice <dslice@cumulusnetworks.com>
Reviewed-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Ticket: CM-10290

9 years agoFixes Quagga Bugzilla #842 - ospfd uses non-zero metric when describing loopback...
kitty [Fri, 19 Feb 2016 05:33:40 +0000 (21:33 -0800)]
Fixes Quagga Bugzilla #842 - ospfd uses non-zero metric when describing loopback addresses

Change-Id: Iff33d70089d1393bf3e9c757d9e9faf134699121
Signed-off-by: kitty <khiruthigai.balasubramanian@hpe.com>
Tested-by: NetDEF CI System <cisystem@netdef.org>
Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
9 years agoMerge branch 'cmaster' of ssh://stash.cumulusnetworks.com:7999/quag/quagga into cmaster
Donald Sharp [Fri, 15 Apr 2016 19:22:11 +0000 (15:22 -0400)]
Merge branch 'cmaster' of ssh://stash.cumulusnetworks.com:7999/quag/quagga into cmaster

9 years agodebian: Remove /usr/bin/quagga from distribution
Donald Sharp [Fri, 15 Apr 2016 14:04:30 +0000 (10:04 -0400)]
debian: Remove /usr/bin/quagga from distribution

We've decided to remove /usr/bin/quagga from
the quagga packaging.  It was only going
to confuse the end user.

Ticket: CM-10456
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Don Slice <dslice@cumulusnetworks.com>
9 years agovtysh: Allow file read in to continue in more cases
Donald Sharp [Fri, 15 Apr 2016 13:15:21 +0000 (09:15 -0400)]
vtysh: Allow file read in to continue in more cases

When a duplicate command is read in from a file,
there are cases where daemons return CMD_WARNING
this causes the command to not be send to subsuquent
daemons( if any ).

Allow the read in of commands to continue in this
situation.

Ticket: CM-10393
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Don Slice <dslice@cumulusnetworks.com>
9 years agoquagga: Check for existence of IFLA_INFO_SLAVE_KIND
Donald Sharp [Fri, 15 Apr 2016 17:09:58 +0000 (13:09 -0400)]
quagga: Check for existence of IFLA_INFO_SLAVE_KIND

IFLA_INFO_SLAVE_KIND is a new type of netlink message
If the kernel makes it available compile in support
else we'll just silently do the right thing.

Additionally reduce the test cases for netlink by 1
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: David Ahern <dsa@cumulusnetworks.com>
Reviewed-by: Don Slice <dslice@cumulusnetworks.com>
Reviewed-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
9 years agolib: Fix json.c compile on older platforms
Donald Sharp [Fri, 15 Apr 2016 19:01:46 +0000 (15:01 -0400)]
lib: Fix json.c compile on older platforms

The header file inclusions for json.c was wrong.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
9 years agovtysh -f needs to flock the file
Daniel Walton [Fri, 15 Apr 2016 13:13:27 +0000 (13:13 +0000)]
vtysh -f needs to flock the file

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Ticket: CM-10428

9 years agolib, bgpd: Refactor vrf handling through zclient
Donald Sharp [Fri, 15 Apr 2016 01:46:44 +0000 (21:46 -0400)]
lib, bgpd: Refactor vrf handling through zclient

Protocols receive zclient vrf creation events from zebra.
This data was being handed to the protocol to decode and
then to hand back to zclient to create the vrf to then
handle appropriately.  This is a bad idea.

Modify the code such that when zclient.c receives a vrf
event from zebra that it decodes the data and just creates
the vrf.  Individual protocols just need to handle the
appropriate vrf events.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: Don Slice <dslice@cumulusnetworks.com>
9 years agoMerge branch 'cmaster' of ssh://stash.cumulusnetworks.com:7999/quag/quagga into cmaster
Donald Sharp [Fri, 15 Apr 2016 00:59:05 +0000 (20:59 -0400)]
Merge branch 'cmaster' of ssh://stash.cumulusnetworks.com:7999/quag/quagga into cmaster

9 years agozebra: Refactor zebra_vrf
Donald Sharp [Thu, 14 Apr 2016 13:20:47 +0000 (09:20 -0400)]
zebra: Refactor zebra_vrf

Move zebra_vrf_XXX functionality into it's own
file so that we can isolate a bit the api edges

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Don Slice <dslice@cumulusnetworks.com>
Reviewed-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
9 years agolib, zebra: Rework zebra_ns to be a bit more modular
Donald Sharp [Thu, 14 Apr 2016 02:40:18 +0000 (22:40 -0400)]
lib, zebra: Rework zebra_ns to be a bit more modular

The struct zebra_ns was littered throughout the code
base in a half-hazard fashion.  Gather up the references
and isolate the code a bit better.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Don Slice <dslice@cumulusnetworks.com>
Reviewed-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
9 years agozebra: Refactor struct zebra_t
Donald Sharp [Wed, 13 Apr 2016 16:21:47 +0000 (12:21 -0400)]
zebra: Refactor struct zebra_t

We were including 'extern struct zebra_t zebrad;' all
over the place.  This made no sense.  Refactor
into zserv.h where the definition was and remove resulting
unnecessary code.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Don Slice <dslice@cumulusnetworks.com>
Reviewed-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
9 years agolib, zebra: Rework vrf_add_update
Donald Sharp [Wed, 13 Apr 2016 14:06:36 +0000 (10:06 -0400)]
lib, zebra: Rework vrf_add_update

The vrf_add_update function does not need to exist.
Move it's constituent parts into the appropriate
vrf_create/vrf_enable functionality as well as
move the zebra_vrf_add_update() function call
into zebra_vrf_enable()

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Don Slice <dslice@cumulusnetworks.com>
Reviewed-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
9 years agolib, zebra: Rearrange vrf_delete_update
Donald Sharp [Wed, 13 Apr 2016 12:20:33 +0000 (08:20 -0400)]
lib, zebra: Rearrange vrf_delete_update

vrf_delete_update really belongs in vrf.c broken up
into it's appropriate places.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Don Slice <dslice@cumulusnetworks.com>
Reviewed-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
9 years agoBGP: cannot "no neighbor ISL timers 3 10" for peer-group
Daniel Walton [Thu, 14 Apr 2016 20:34:43 +0000 (20:34 +0000)]
BGP: cannot "no neighbor ISL timers 3 10" for peer-group

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Ticket: CM-10438

9 years agoquagga: "set community x:y" needs bounds checking
Daniel Walton [Thu, 14 Apr 2016 18:16:43 +0000 (18:16 +0000)]
quagga: "set community x:y" needs bounds checking

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Ticket: CM-10002

superm-redxp-05# conf t
superm-redxp-05(config)# route-map FOO permit 10
superm-redxp-05(config-route-map)# set community ?
  AA:NN  Community number in AA:NN format (where AA and NN are <0-65535>) or local-AS|no-advertise|no-export|internet or additive
  none   No community attribute
superm-redxp-05(config-route-map)# set community 2:2
superm-redxp-05(config-route-map)# set community 2:70000
% Malformed communities attribute
superm-redxp-05(config-route-map)# set community 70000:2
% Malformed communities attribute
superm-redxp-05(config-route-map)#

9 years agoBGP: Register with correct VRF id for redistribution
vivek [Thu, 14 Apr 2016 01:41:58 +0000 (18:41 -0700)]
BGP: Register with correct VRF id for redistribution

When doing a redistribution re-registration upon route-map
updates, the correct VRF id was not being used. Fixed.

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Ticket: CM-10311
Reviewed By: Trivial
Testing Done: Manual - verified failed scenario

9 years agoBGP: Use VRF_UNKNOWN for initialization
vivek [Wed, 13 Apr 2016 22:43:15 +0000 (15:43 -0700)]
BGP: Use VRF_UNKNOWN for initialization

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Ticket: CM-10423
Reviewed By: CCR-4474
Testing Done: Manual (basic checks)

9 years ago'systemctl restart zebra' was blocking if the BGP ASN changed due to
Daniel Walton [Wed, 13 Apr 2016 20:54:30 +0000 (20:54 +0000)]
'systemctl restart zebra' was blocking if the BGP ASN changed due to
restarting bgpd

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>