]> git.puffer.fish Git - mirror/frr.git/log
mirror/frr.git
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>
9 years agostop/start of zebra creates empty Quagga.conf file when "no service
Daniel Walton [Wed, 13 Apr 2016 20:52:48 +0000 (20:52 +0000)]
stop/start of zebra creates empty Quagga.conf file when "no service
integrated-vtysh-config"

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

We do not need to pass O_CREAT to open() when creating the flock file

9 years agoMerge branch 'cmaster' of ssh://stash.cumulusnetworks.com:7999/quag/quagga into cmaster
vivek [Wed, 13 Apr 2016 18:08:57 +0000 (11:08 -0700)]
Merge branch 'cmaster' of ssh://stash.cumulusnetworks.com:7999/quag/quagga into cmaster

9 years agoBGP: Implement key show commands for all VRFs
vivek [Wed, 13 Apr 2016 00:33:03 +0000 (17:33 -0700)]
BGP: Implement key show commands for all VRFs

Key BGP 'show' commands have been expanded to support 'vrf all':

show ip bgp vrf all summary
show ip bgp vrf all neighbors
show ip bgp vrf all nexthop
show ip bgp vrf all update-group
show ip bgp vrf all
show bgp vrf all summary
show bgp vrf all update-group
show bgp vrf all

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Don Slice <dslice@cumulusnetworks.com>
Ticket: CM-10402
Reviewed By: CCR-4466
Testing Done: Manual

9 years agodebian: Add the creation of the quagga user to quaggavty group
Donald Sharp [Wed, 13 Apr 2016 00:44:28 +0000 (20:44 -0400)]
debian: Add the creation of the quagga user to quaggavty group

The creation of the quagga user was not the only place
to add the quagga user to the quaggavty group.  If
we are reinstalling quagga over a old version of
code then we need to check to see if the quagga
user is in the quaggavty and do the right thing.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Dave Olson <olson@cumulusnetworks.com>
9 years agolib, zebra: Refactor vrf creation a bit more
Donald Sharp [Fri, 8 Apr 2016 19:32:53 +0000 (19:32 +0000)]
lib, zebra: Refactor vrf creation a bit more

Create the idea of a VRF_UNKNOWN, this is for a vrf where we don't
yet have the vrf_id for it yet.

Refactor the vrf_create code out of existence.  We had two code
paths vrf_create and vrf_get.  We should use vrf_get to create
the new vrf since XXX_get() creates the data structures now.

Signed-off-by: Donald Sharp
Reviewed-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
9 years agolib: passing in vrf string length is not needed
Donald Sharp [Fri, 8 Apr 2016 18:34:54 +0000 (18:34 +0000)]
lib: passing in vrf string length is not needed

vrf_create does not need the string length of the vrf.
Remove it.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
9 years agolib: Fix priviledge modification for vty group specified
Donald Sharp [Fri, 8 Apr 2016 23:20:34 +0000 (19:20 -0400)]
lib: Fix priviledge modification for vty group specified

When attempting to switch runtime permissions over to
the correct group specified for the vty group, if the
user specified to run as does not have that vty group
then do warn about the issue and stop running

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reported-by: Thomas Martin <tmartincpp@gmail.com>
9 years agolib: add getgrouplist() for Solaris
David Lamparter [Tue, 15 Sep 2015 09:26:44 +0000 (02:26 -0700)]
lib: add getgrouplist() for Solaris

Of course Solaris doesn't have getgrouplist()...

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
9 years agoprivs: fix privilege dropping to use system defined groups
Timo Teräs [Fri, 22 May 2015 10:40:56 +0000 (13:40 +0300)]
privs: fix privilege dropping to use system defined groups

It may be requred for quagga process to belong to additional
groups. E.g. nhrp module will need to talk to strongSwan using
vici and may require additional permissions. Initialize groups
from the system group database.

Signed-off-by: Timo Teräs <timo.teras@iki.fi>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
9 years agolib/privs: Don't use CAP_NET_BROADCAST
Christian Franke [Wed, 13 May 2015 11:59:18 +0000 (13:59 +0200)]
lib/privs: Don't use CAP_NET_BROADCAST

From what I can tell, CAP_NET_BROADCAST has never been required for any
functionality in the Linux kernel, so we do not really need it.

However, it causes breakage in contexts where Quagga is started with a
limited set of capabilities, e.g. in Docker, because these may not
include CAP_NET_BROADCAST and in the case of Docker do not even support
adding CAP_NET_BROADCAST.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
9 years agolib/privs: display more info if cap_set_proc fails.
Christian Franke [Wed, 13 May 2015 11:59:17 +0000 (13:59 +0200)]
lib/privs: display more info if cap_set_proc fails.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
9 years agolib: Fix POSIX capabilities on SunOS platforms
Brian Bennett [Tue, 17 Feb 2015 23:24:15 +0000 (23:24 +0000)]
lib: Fix POSIX capabilities on SunOS platforms

When using POSIX capabilities on SunOS the capabilities are too
restricitve resulting in quagga processes not being able to read their
own config files. Credit goes to Oracle where this patch was originally
authored and included in OpenSolaris.

lib/privs.c: Include additional capabilities, better checking of
    missing capabilities.

Fixes: #820
Acked-by: Greg Troxel <gdt@ir.bbn.com>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
9 years agodebian: Modify preinst to add quagga user to quaggavty group
Donald Sharp [Fri, 8 Apr 2016 23:42:00 +0000 (19:42 -0400)]
debian: Modify preinst to add quagga user to quaggavty group

The quagga user was not being added to the quaggavty group.
Modify the user creation to add this step.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
9 years agoMerge branch 'cmaster' of ssh://stash.cumulusnetworks.com:7999/quag/quagga into cmaster
Donald Sharp [Fri, 8 Apr 2016 17:16:21 +0000 (13:16 -0400)]
Merge branch 'cmaster' of ssh://stash.cumulusnetworks.com:7999/quag/quagga into cmaster

9 years agoquagga: Remove iflist global variable
Donald Sharp [Fri, 8 Apr 2016 13:16:14 +0000 (09:16 -0400)]
quagga: Remove iflist global variable

The file if.c has a iflist that had the list of interfaces
in the default vrf.  Remove this variable and replace
with a vrf_iflist lookup on the default vrf where it
was used.

Additionally, modify ptm code to iterate over all vrf's
when enabling ptm.

Ticket: CM-10338
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Don Slice <dslice@cumulusnetworks.com>
Reviewed-by: Radhika Mahankali <radhika@cumulusnetworks.com>
9 years agolib, zebra: Rename ZEBRA_VRF_ACTIVE
Donald Sharp [Thu, 7 Apr 2016 15:19:58 +0000 (11:19 -0400)]
lib, zebra: Rename ZEBRA_VRF_ACTIVE

ZEBRA_VRF_ACTIVE is a poor name for when a vrf is
actually active.  Rename VRF_ACTIVE.

Ticket: CM-10338
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Don Slice <dslice@cumulusnetworks.com>
Reviewed-by: Radhika Mahankali <radhika@cumulusnetworks.com>
9 years agolib: Refactor XX_name_len away
Donald Sharp [Thu, 7 Apr 2016 15:15:31 +0000 (11:15 -0400)]
lib: Refactor XX_name_len away

We had two functions XXX_name and XXX_name_len
that both did the same thing.  Remove the
XXX_rename_len functions.

Ticket: CM-10338
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Don Slice <dslice@cumulusnetworks.com>
Reviewed-by: Radhika Mahankali <radhika@cumulusnetworks.com>
9 years agozebra: count iface up/down events and keep last time of their occurrence
Christian Franke [Thu, 7 Apr 2016 19:43:44 +0000 (16:43 -0300)]
zebra: count iface up/down events and keep last time of their occurrence

It is quite useful to be able to assert whether specific interfaces have
flapped or also to verify that specific interfaces have not flapped.

By having counters for those events and storing the last time of their
occurrence, this is made possible.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
Acked-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
9 years agolib: use constant to replace magic value for length of quagga_timestamp
Christian Franke [Thu, 7 Apr 2016 19:43:43 +0000 (16:43 -0300)]
lib: use constant to replace magic value for length of quagga_timestamp

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
Acked-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
9 years agodebian: Add ability to call reload from systemctl
Donald Sharp [Thu, 7 Apr 2016 14:48:28 +0000 (10:48 -0400)]
debian: Add ability to call reload from systemctl

Add the ability to call 'systemctl reload <daemon>'.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Don Slice <dslice@cumulusnetworks.com>
9 years agotools: Make quagga script be more helpful
Donald Sharp [Thu, 7 Apr 2016 14:36:11 +0000 (10:36 -0400)]
tools: Make quagga script be more helpful

When running the tools/quagga script without any options
it tells you nothing about what went wrong and what to
do to fix it.

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 [Thu, 7 Apr 2016 00:56:53 +0000 (20:56 -0400)]
Merge branch 'cmaster' of ssh://stash.cumulusnetworks.com:7999/quag/quagga into cmaster

9 years agovtysh: Add file locking to Quagga.conf
Donald Sharp [Wed, 6 Apr 2016 19:51:09 +0000 (15:51 -0400)]
vtysh: Add file locking to Quagga.conf

Problem:

Systemd runs in parallel all quagga daemons after zebra is started up.
Now each command has a ExecStartPost which executes vtysh -b -n.
Each of these vtysh -b -n would blask configuration to each daemon.

This leads to the situation where vtysh process #2 is blasting
in config that is at a different spot in the Quagga.conf file
that vtysh process #1 is at.

If #1 has put itself into a different submode that #2 is at,
we will get failures and the code will not be read in properly.

This problem is especially evident for when you have more than one
protocol running at one time.

Solution:

flock Quagga.conf.
If you don't get the flock, sleep for a while, try to get flock again
go to slepp...

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: Don Slice <dslice@cumulusnetworks.com>
Reviewed-by: DAve Olson <olson@cumulusnetworks.com>
9 years agolib, vtysh: Return actual problem further up
Donald Sharp [Wed, 6 Apr 2016 13:34:33 +0000 (09:34 -0400)]
lib, vtysh: Return actual problem further up

When we encounter a problem loading a config file
quantify to the end user what has gone wrong,
with a combination of err output as well as
return codes.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Don Slice <dslice@cumulusnetworks.com>
Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: Dave Olson <olson@cumulusnetworks.com>
9 years agoZebra: Fix VRF-id and table for BGP unnumbered (RFC 5549)
vivek [Wed, 6 Apr 2016 21:07:05 +0000 (14:07 -0700)]
Zebra: Fix VRF-id and table for BGP unnumbered (RFC 5549)

In the case of BGP unnumbered RFC 5549 (IPv4 routes with IPv6 nexthop), the
zebra code to handle routes was not initializing the correct VRF id and
locating the correct routing table, resulting in the routes not getting
installed. Fixed with this change.

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Ticket: CM-10247
Reviewed By: CCR-4429
Testing Done: Manual verification

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

9 years agobgpd: Resolve ability to add route-map out to peer-group member
Don Slice [Wed, 6 Apr 2016 12:08:42 +0000 (12:08 +0000)]
bgpd: Resolve ability to add route-map out to peer-group member

Modified the configuration code to properly allow a peer-group member
to have a route-map out applied when one does not exist on the peer-group
itself.  This capability already existed for route-map in.

Ticket: CM-10058
Signed-off-by: Don Slice
Reviewed-by: Donald Sharp
9 years agoisisd: ignore unknown interfaces when adjusting IS-IS mtu
Christian Franke [Sun, 3 Apr 2016 15:46:28 +0000 (12:46 -0300)]
isisd: ignore unknown interfaces when adjusting IS-IS mtu

For example during startup of isisd, the MTU of interfaces is not
known, since this information will only be available once the
interfaces have been learned from zebra.

It makes no sense to include the MTU 0 that is stored for interfaces
in this state in the consideration whether a new lsp-mtu for an
area is valid, so skip interfaces which are in this state.

Signed-off-by: Christian Franke <nobody@nowhere.ws>
9 years agoisisd: make sure that all interface addresses are advertised
Christian Franke [Sun, 3 Apr 2016 15:46:27 +0000 (12:46 -0300)]
isisd: make sure that all interface addresses are advertised

If the following configuration commands are run interactively in
succession, the ipv6 addresses of this interface won't be advertised
in the router's LSP immediately:

   # interface eth0
   # ip router isis test
   # ipv6 router isis test

This is because the ipv6 router command won't trigger a state change
for the interface and therefore, it won't trigger a regeneration of
the LSPs.

The same thing happens if IPv4 is enabled after IPv6, or for the cases
where IPv4 is disabled and IPv6 stays enabled or vice-versa.

Fix this by explicitly calling lsp_regenerate_schedule for the cases
where it won't be called implicitly.

Signed-off-by: Christian Franke <nobody@nowhere.ws>
9 years agoisisd: fix a crash due to an lsp-mtu issue
Christian Franke [Sun, 3 Apr 2016 15:46:26 +0000 (12:46 -0300)]
isisd: fix a crash due to an lsp-mtu issue

isisd crashed on startup if it was enabled for an interface with
a too small MTU.

To fix this, we treat this case as an invalid configuration and
disable isis on that interface if that case happens, since it is
a configuration error.

Signed-off-by: Christian Franke <nobody@nowhere.ws>
9 years agoisisd: work around route table asserts for deleting node with info
Christian Franke [Sun, 3 Apr 2016 15:46:25 +0000 (12:46 -0300)]
isisd: work around route table asserts for deleting node with info

The route table code in lib/table.c triggers an assertion when a route
node with rn->info != NULL reaches refcount 0, probably to avoid
memleaks. In this particular case, this is not an issue, since the
info will be freed by the destructor.

However, since removing this assertion probably requires more
discussion, just make sure that rn->info gets freed and unset before
its refcount is decremented to zero.

Signed-off-by: Christian Franke <nobody@nowhere.ws>
9 years agolib: Initialize variable
vivek [Tue, 5 Apr 2016 17:40:33 +0000 (10:40 -0700)]
lib: Initialize variable

Initialize a variable to prevent warnings.

Updates: 8087b296b4750eda2d34e4f48731f81415bdccd2

Ticket: CM-10258
Reviewed By:  Trivial
Testing Done: None

9 years agolib: Ensure VRF is created with correct id
vivek [Mon, 4 Apr 2016 17:58:06 +0000 (10:58 -0700)]
lib: Ensure VRF is created with correct id

In function vrf_get(), an early call to vrf_get_by_name() may end up
creating the Zebra VRF structure prior to the VRF id being set,
resulting in various other misbehavior. Fix this with appropriate
changes.

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Ticket: CM-10258
Reviewed By: CCR-4418
Testing Done: Manual

9 years agobgpd: Another hash_get crash fix
Donald Sharp [Mon, 4 Apr 2016 16:44:46 +0000 (12:44 -0400)]
bgpd: Another hash_get crash fix

Basically when modifying the peer->su, we must *always*
release the hash and then re-install it, else
we will cause crashes when we go to look up data
that is not going to be there.

Ticket: CM-10212
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Don Slice <dslice@cumulusnetworks.com>
Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
9 years agolib: plist should not CMD_WARNING when command has already been entered
Donald Sharp [Mon, 4 Apr 2016 16:40:33 +0000 (12:40 -0400)]
lib: plist should not CMD_WARNING when command has already been entered

When you startup zebra and apply a prefix list command, and then at a
later point in time start up additional daemons and then attempt to
apply the integrated-config, the prefix-list command will stop
processing after zebra.

This is because when zebra attempted to process the command, it would
notice that it already had that cli handled and print a vty warning and
then it would return CMD_WARNING. This caused the loop over all the
commands to stop and as such the command would not be sent to all the
individual daemons.

This behavior is exactly the same as it is in the 2.5.X( hell it's
upstream behavior to! ). Modify the plist command to return CMD_SUCCESS
in this case.

Ticket: CM-10248
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
Don Slice [Fri, 1 Apr 2016 23:16:20 +0000 (16:16 -0700)]
Merge branch 'cmaster' of ssh://stash.cumulusnetworks.com:7999/quag/quagga into cmaster

9 years agozebra: close all tables when quagga is stopped
Don Slice [Fri, 1 Apr 2016 15:31:40 +0000 (08:31 -0700)]
zebra: close all tables when quagga is stopped

When signalled to stop quagga, iterate through any "other_tables" that may have
been imported and close them all before stopping.

Ticket: CM-9386
Signed-off-by: Don Slice
Reviewed-by: Donald Sharp