]> git.puffer.fish Git - mirror/frr.git/log
mirror/frr.git
8 years agopimd: Add ability to set DR Priority for an interface
Donald Sharp [Fri, 19 Jun 2015 01:14:20 +0000 (18:14 -0700)]
pimd: Add ability to set DR Priority for an interface

From RFC 4601, Section 4.3.1:

The DR_Priority Option allows a network administrator to give
preference to a particular router in the DR election process by
giving it a numerically larger DR Priority.  The DR_Priority Option
SHOULD be included in every Hello message, even if no DR Priority is
explicitly configured on that interface.  This is necessary because
priority-based DR election is only enabled when all neighbors on an
interface advertise that they are capable of using the DR_Priority
Option.  The default priority is 1.

This modification allows the setting of the DR Priority on a per
interface basis.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: add support for configuring multicast static routes
Jafar Al-Gharaibeh [Thu, 11 Jun 2015 23:29:02 +0000 (18:29 -0500)]
pimd: add support for configuring multicast static routes

Hi,

This patch adds the ability to configure multicast static routes
directly into pimd. Two source files are introduced to implement the new
feature in addition to changes to existing files.

Here is how it can be used the CLI:

interface <incoming interface>
ip mroute <outgoing interface> <group addr>                          #
for asm
or ip mroute <outgoing interface> <group addr> <source>    # for ssm

Please let me know if you have any questions or concerns,

Regards,
Jafar

Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agoRemoval of 'show ip mroute'
Donald Sharp [Sat, 30 May 2015 22:57:54 +0000 (18:57 -0400)]
Removal of 'show ip mroute'

The 'show ip mroute' in zebra_vty.c collided with the
'show ip mroute' command in pim_cmd.c.  The 'show ip rpf'
command is functionally equivalent to the zebra_vty.c
'show ip mroute'.  Therefore remove the 'show ip mroute' command
in zebra_vty.c.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopim: 'show debugging' collision
Donald Sharp [Thu, 28 May 2015 00:40:46 +0000 (17:40 -0700)]
pim: 'show debugging' collision

The 'show debugging' cli as setup by pim collided with 'show debugging isis'.
Fix that and clean up cli help commands to actually display correctly.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agoFixup of redhat control files to properly start pimd
Donald Sharp [Thu, 28 May 2015 00:57:31 +0000 (17:57 -0700)]
Fixup of redhat control files to properly start pimd

8 years agopimd assert when no route to source from a new igmp join
Donald Sharp [Sat, 13 Jun 2015 00:47:26 +0000 (17:47 -0700)]
pimd assert when no route to source from a new igmp join

When pim_upstream_new is called the code looks up the nexthop.
If there is no route to the source, the code silently ignored
the error returned.  When the nexthop lookup fails don't create
the 'struct pim_stream *' to return.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopim_mroute.h has a different version of code than linux/mroute.h provides
Donald Sharp [Fri, 5 Jun 2015 19:15:44 +0000 (12:15 -0700)]
pim_mroute.h has a different version of code than linux/mroute.h provides

linux/mroutes.h and pim_mroute.h both have copies of the same structures.
This is causing failures in setsockopt(..., MRT_ADD_MFC,...) because
of data structure incompatibilities between the kernel and what
pim_mroute.h was providing.  Modify the code to check for mroute.h
and include it if necessary.  I did not modify the non linux/mroute.h
path because I do not have other systems to test on easily.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agoPIMD: Fix code to use srandom/random
Donald Sharp [Fri, 19 Jun 2015 23:26:18 +0000 (19:26 -0400)]
PIMD: Fix code to use srandom/random

pimd rolled it's own solution to random #'s, that was not
terribly random.  Rely on the underlying system to generate
random #'s for us

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years ago*: assorted warning fixes
David Lamparter [Tue, 21 Apr 2015 08:46:13 +0000 (10:46 +0200)]
*: assorted warning fixes

A few warnings slipped through the cracks...

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agopimd: fix out of tree build
David Lamparter [Tue, 21 Apr 2015 07:45:06 +0000 (09:45 +0200)]
pimd: fix out of tree build

pimd/Makefile.am was missing srcdir/lib from its include paths, breaking
out-of-tree build regarding route_types.h

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agopimd: cast ioctl values when printing them
David Lamparter [Wed, 4 Mar 2015 05:37:20 +0000 (06:37 +0100)]
pimd: cast ioctl values when printing them

ioctl values might be int or long, cast them to unsigned long for
consistent printing.  (They're long on FreeBSD, but were printed with
%d.)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agopimd: cast to sockaddr_in to sockaddr
David Lamparter [Tue, 3 Mar 2015 20:03:52 +0000 (21:03 +0100)]
pimd: cast to sockaddr_in to sockaddr

While glibc seems to have something in the system headers that prevents
this from triggering a warning, FreeBSD doesn't.  Fix the warning.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agopimd: Rework pim to handle changes between us and upstream
Donald Sharp [Wed, 25 May 2016 05:31:30 +0000 (01:31 -0400)]
pimd: Rework pim to handle changes between us and upstream

The code in pimd needs to be updated to handle the changes
we've made to api's that it depends on.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: mask unused zclient_broken()
David Lamparter [Tue, 3 Mar 2015 09:41:21 +0000 (10:41 +0100)]
pimd: mask unused zclient_broken()

this function is used by the currently not present zclient reconnect
code.  It'll be unmasked again when that code hits master.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agobuild: enable pimd in test script
David Lamparter [Wed, 4 Feb 2015 05:24:41 +0000 (06:24 +0100)]
build: enable pimd in test script

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agopimd: merge pimd as of 2015-01-19
David Lamparter [Wed, 4 Feb 2015 06:01:14 +0000 (07:01 +0100)]
pimd: merge pimd as of 2015-01-19

Welcome pimd to the Quagga daemon zoo!

This is a merge of commit 77ae369 ("pimd: Log ifindex found for an
interface when zebra lib reports a new connected address."), with
the intermediate "reconnect" changes removed (c9adf00...d274381).
d274381 is replaced with b162ab7, which includes some changes.  In
addition, 4 reconnect-related changes and 1 cosmetic one have been
bumped out.

The rebase command used to produce the branch that is merged here is:
  git rebase --onto b162ab7 c9adf00 77ae369

Note that 3 patches had their author rewritten from
    "Anonymous SR#108542 <>" (which is not a valid git author ID)
to: "Savannah SR#108542 <nbahr@atcorp.com>" (which is the e-mail address
                               listed in the associated Savannah ticket)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agodoc: explain rpf lookup default mode
David Lamparter [Mon, 2 Feb 2015 02:00:22 +0000 (03:00 +0100)]
doc: explain rpf lookup default mode

Reported-by: Alexis Rosen <quagga-users@alexis.users.panix.com>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agodoc: zebra multicast RIB commands
David Lamparter [Fri, 30 Jan 2015 00:44:25 +0000 (01:44 +0100)]
doc: zebra multicast RIB commands

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agozebra: mark multicast commands experimental
David Lamparter [Tue, 27 Jan 2015 19:24:15 +0000 (20:24 +0100)]
zebra: mark multicast commands experimental

depending on feedback from actually having these commands in a released
version, we may want to adjust them.  Thus, mark them as experimental so
users are aware of this.

Cc: Everton Marques <everton.marques@gmail.com>
Cc: Balaji G <balajig81@gmail.com>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agozebra: add "show ip rpf" to get result of RPF lookup
David Lamparter [Thu, 22 Jan 2015 18:12:35 +0000 (19:12 +0100)]
zebra: add "show ip rpf" to get result of RPF lookup

Checking what route exactly a RPF lookup for a given source uses is
essential for an administrator to debug multicast routing issues.  This
command provides exactly that, using the multicst RPF lookup function
and printing out its result to the CLI.

Cc: Everton Marques <everton.marques@gmail.com>
Cc: Balaji G <balajig81@gmail.com>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agozebra: make MRIB lookup behaviour switchable
David Lamparter [Tue, 6 Jan 2015 18:53:24 +0000 (19:53 +0100)]
zebra: make MRIB lookup behaviour switchable

depending on the usage scenario (and availability of multitopology IGP
protocols, which is currently zero in Quagga), different approaches of
Multicast RPF lookups are useful.

Reference behaviours from commercial vendors are urib-only/mrib-only
(Juniper, depending on inet.2 availability) and lowest-distance (Cisco).
As we are currently without MT IGP support, mrib-first seems the most
useful default for Quagga.

Cc: Everton Marques <everton.marques@gmail.com>
Cc: Balaji G <balajig81@gmail.com>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agozebra: return route_node from rib_match_ipv4_safi
David Lamparter [Thu, 22 Jan 2015 18:09:36 +0000 (19:09 +0100)]
zebra: return route_node from rib_match_ipv4_safi

The multicast code needs to know the route_node in addition to the rib
entry in order to perform distance or prefix-length comparisons.  Add it
as optional "out" pointer parameter.

Cc: Everton Marques <everton.marques@gmail.com>
Cc: Balaji G <balajig81@gmail.com>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agozebra: dummy kernel "install" multicast routes
David Lamparter [Mon, 12 Jan 2015 06:05:06 +0000 (07:05 +0100)]
zebra: dummy kernel "install" multicast routes

This is a followup to 9511633 ("zebra: MBGP routes should not be
installed in the kernel"), which was correct in disabling MRIB routes
being installed in the kernel, yet broke the MRIB since now routes were
never marked as active.

Hence, push down the check into the kernel install functions, so that
the routes are still marked active.  At the same time, the FPM calls get
a check each since otherwise we'd bump the FPM interface on MRIB
updates.

Fixes: 9511633 ("zebra: MBGP routes should not be installed in the kernel")
Cc: Everton Marques <everton.marques@gmail.com>
Cc: Balaji G <balajig81@gmail.com>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agozebra: fix optional distance on static mrib route
David Lamparter [Thu, 22 Jan 2015 18:03:53 +0000 (19:03 +0100)]
zebra: fix optional distance on static mrib route

Unfortunately, the quagga CLI parser doesn't support [<1-255>].  Fix by
working around with an alias.

Replaces the following commits:
- zebra: mrib: [no] ip mroute - require distance.
- zebra: mrib: [no] ip mroute - make distance optional.
(Rewritten as alias)

Cc: Everton Marques <everton.marques@gmail.com>
Cc: Balaji G <balajig81@gmail.com>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agozebra: mrib: static route support
Everton Marques [Mon, 14 Jul 2014 14:19:00 +0000 (11:19 -0300)]
zebra: mrib: static route support

With the MRIB being independent from the Unicast RIB, there's currently
now way to add static routes to the MRIB.  Address that by adding a
separate set of commands for MRIB static routes.

Combines these original patches:
- zebra: mrib: ip mroute command to add unicast route to MRIB for multicast RPF.
- zebra: mrib: no ip mroute: Fix removal of static multicast RPF route.
- zebra: mrib: remove unused static_add/delete_ipv4
- zebra: Cleanups to zebra_rib.
- pimd: Merge pim-only branch.

Cc: Everton Marques <everton.marques@gmail.com>
Cc: Balaji G <balajig81@gmail.com>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agozebra: add ZEBRA_IPV4_NEXTHOP_LOOKUP_MRIB
Everton Marques [Tue, 1 Jul 2014 18:15:52 +0000 (15:15 -0300)]
zebra: add ZEBRA_IPV4_NEXTHOP_LOOKUP_MRIB

This adds a new zapi call "ZEBRA_IPV4_NEXTHOP_LOOKUP_MRIB" performing a
Multicast RPF lookup for a given source.  Details of the lookup
behaviour are left to the zebra side of things.

Note: this is non-reactive, as in, only delivers a snapshot of the state
at a particular point in time.  There's no push notification of changes
happening to the RIB.

This combines the following 3 original patches:
- zebra: add zsend_ipv4_nexthop_lookup_mrib()
- zserv: Query mrib (SAFI_MULTICAST).
- zebra: Cleanups to zebra_rib.

Cc: Everton Marques <everton.marques@gmail.com>
Cc: Balaji G <balajig81@gmail.com>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agozebra: add rib_match_ipv4_safi()
Everton Marques [Mon, 22 Sep 2014 22:35:51 +0000 (19:35 -0300)]
zebra: add rib_match_ipv4_safi()

This is the same as rib_lookup_ipv4(), without the SAFI hardcoded.

Cc: Balaji G <balajig81@gmail.com>
Cc: Everton Marques <everton.marques@gmail.com>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agozebra: identify MRIB on debug messages
David Lamparter [Thu, 22 Jan 2015 18:02:13 +0000 (19:02 +0100)]
zebra: identify MRIB on debug messages

since the same code handles both URIB and MRIB, the debug messages can
get rather confusing if the RIB isn't identified.  Mark the MRIB in
debug messages so we can distinguish that.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agozebra: factor out rib debug logs
David Lamparter [Thu, 24 Apr 2014 18:22:53 +0000 (20:22 +0200)]
zebra: factor out rib debug logs

Introduces a logging function that takes a struct route_node * argument,
and prefixes log output with that node's prefix.  While this removes
some duplication, it will also later be useful for srcdest route nodes.

Behaviour before and after the patch should be exactly identical.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agozebra: Ensure IPv6 RA configuration is displayed correctly
vivek [Mon, 23 May 2016 16:46:14 +0000 (09:46 -0700)]
zebra: Ensure IPv6 RA configuration is displayed correctly

IPv6 RAs on an interface can be enabled either by the operator or internally
due to the configuration of a BGP unnumbered neighbor. Ensure that this is
displayed in the configuration correctly.

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Ticket: CM-11076
Reviewed By: CCR-4770
Testing Done: Manual; also verified by defect submitter.

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: 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 agolib: Compiler warning fix
Donald Sharp [Fri, 20 May 2016 12:48:21 +0000 (08:48 -0400)]
lib: Compiler warning fix

There exists a code path where fld would
be used uninitialized.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
8 years agovtysh: fix vtysh warnings from another compiler
Donald Sharp [Mon, 16 May 2016 01:07:50 +0000 (21:07 -0400)]
vtysh: fix vtysh warnings from another compiler

Remove some dead code and fix char `\0` being
used as NULL.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
8 years agoospfd: Fix compiler warnings
Donald Sharp [Sun, 15 May 2016 17:41:23 +0000 (13:41 -0400)]
ospfd: Fix compiler warnings

Two issues:

1) nbr->oi->ifp->name is an array it would
always evaluate to true.

2) There exist a code path where addr
would be used without initialization.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
8 years agoisisd: Remove dead case
Donald Sharp [Sun, 15 May 2016 17:40:33 +0000 (13:40 -0400)]
isisd: Remove dead case

It's impossible to ever get to the else statement.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
8 years agolib: Fix some more compiler warnings
Donald Sharp [Sun, 15 May 2016 17:33:15 +0000 (13:33 -0400)]
lib: Fix some more compiler warnings

Three different changes:
a) in nexthop.c we have an actual bug, we've rearranged
the enumerated types and the list of enums has changed, we
were displaying the wrong nexthop information.

b) Remove some dead code from sockunion.h

c) '\0' evaluates to 0 which is NULL.  vector_set takes
a pointer.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
8 years agobgpd: Fix more clang compiler warnings
Donald Sharp [Sun, 15 May 2016 17:31:30 +0000 (13:31 -0400)]
bgpd: Fix more clang compiler warnings

Remove some dead code and fix initialization of the
sockunion.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
8 years agobgpd: Fix warnings -> errors issues
Donald Sharp [Sat, 7 May 2016 23:14:33 +0000 (19:14 -0400)]
bgpd: Fix warnings -> errors issues

Switched to !another! new compiler and a few more
warnings creeped in.  Also noticed a json issue
that caused an error in output.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Don Slice <dslice@cumulusnetworks.com>
Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
8 years agobgpd: Fix possible api.tag uninitialized usage
Donald Sharp [Sat, 7 May 2016 19:43:50 +0000 (15:43 -0400)]
bgpd: Fix possible api.tag uninitialized usage

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Don Slice <dslice@cumulusnetworks.com>
Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
8 years agolib: Fix possible uninitialized pointer usage.
Donald Sharp [Sat, 7 May 2016 19:42:51 +0000 (15:42 -0400)]
lib: Fix possible uninitialized pointer usage.

Signed-off-by: Donald Sharp <sharp@cumulusnetworks.com>
Reviewed-by: Don Slice <dslice@cumulusnetworks.com>
Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
8 years agobgpd: Clean up some static analysis warnings
Donald Sharp [Sat, 7 May 2016 00:19:05 +0000 (20:19 -0400)]
bgpd: Clean up some static analysis warnings

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Don Slice <dslice@cumulusnetworks.com>
Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
8 years agozebra: Clean up some small static analysis warnings
Donald Sharp [Sat, 7 May 2016 00:18:07 +0000 (20:18 -0400)]
zebra: Clean up some small static analysis warnings

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Don Slice <dslice@cumulusnetworks.com>
Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
8 years agolib: Clean up some small static analysis warnings
Donald Sharp [Sat, 7 May 2016 00:17:31 +0000 (20:17 -0400)]
lib: Clean up some small static analysis warnings

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Don Slice <dslice@cumulusnetworks.com>
Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
8 years agoospf6d: Fix printf % code usage
Donald Sharp [Fri, 6 May 2016 23:32:00 +0000 (19:32 -0400)]
ospf6d: Fix printf % code usage

Use correct % code in printf statement.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Don Slice <dslice@cumulusnetworks.com>
Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
8 years agobgpd: Fix function return
Donald Sharp [Fri, 6 May 2016 23:30:33 +0000 (19:30 -0400)]
bgpd: Fix function return

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Don Slice <dslice@cumulusnetworks.com>
Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
8 years agoisisd: Use correct boolean operator type.
Donald Sharp [Fri, 6 May 2016 23:29:36 +0000 (19:29 -0400)]
isisd: Use correct boolean operator type.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Don Slice <dslice@cumulusnetworks.com>
Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
8 years agoquagga: Remove WEAK_ALIAS pragma usage
Donald Sharp [Fri, 6 May 2016 23:27:16 +0000 (19:27 -0400)]
quagga: Remove WEAK_ALIAS pragma usage

The code was using pragma's to override function calls
while there was code for platforms that don't support pragma's
Just remove the pragma usage from the program in it's entirety

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Don Slice <dslice@cumulusnetworks.com>
Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
8 years agobgpd: peer_uptime overflows after 1 year
Paul Jakma [Tue, 26 May 2015 14:19:38 +0000 (15:19 +0100)]
bgpd: peer_uptime overflows after 1 year

* bgpd.c: (peer_uptime) Wraps after 1 year, and doesn't indicate years.
  Fix. Assume a year is 365 days, for an easy life.

Fixes: Bug #836
Reported-by: Rolf Hanßen
Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
8 years agobgpd: Refactor peer_uptime
Donald Sharp [Fri, 6 May 2016 14:12:20 +0000 (10:12 -0400)]
bgpd: Refactor peer_uptime

peer_uptime was doing the same work unnecessarily.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
8 years agoOSPF LSA may not be refreshed within 1800s, ANVL OSPF test 12.4 fails
Daniel Walton [Wed, 18 May 2016 13:36:38 +0000 (13:36 +0000)]
OSPF LSA may not be refreshed within 1800s, ANVL OSPF test 12.4 fails

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

The previous formula for calculating delay was:

    delay = OSPF_LS_REFRESH_TIME - LS_AGE (lsa) - OSPF_LS_REFRESH_JITTER
              + (random () % (2*OSPF_LS_REFRESH_JITTER));

If LS_AGE() is 0 we get:

  delay = 1800 - 0 - 60 + (random() % 2*60)

So delay will be 1740 + 0..120, so we could easily pick a delay that is
greater than OSPF_LS_REFRESH_TIME (1800).  For the normal case where
we hit this else the LS_AGE will be > 0 so that reduces the chances of
delay being greater than 1800.

8 years agoBGP: "show ip bgp neighbor json" keys are stepping all over each other
Daniel Walton [Wed, 18 May 2016 13:31:59 +0000 (13:31 +0000)]
BGP: "show ip bgp neighbor json" keys are stepping all over each other

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

bgp_show_neighbor() was allocating a json_neigh struct and using that
for every single peer...so the resulting json was a munge of state from
all peers

We need to allocate a new json_neigh for each neighbor.

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>
9 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

9 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>
9 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

9 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)

9 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
9 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>
9 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.