]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
8 years agotests: fix MIN()-related sign warnings
David Lamparter [Tue, 11 Oct 2016 15:44:39 +0000 (17:44 +0200)]
tests: fix MIN()-related sign warnings

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agozebra: Fix route deletion on *BSD
Timo Teräs [Fri, 19 Feb 2016 02:19:54 +0000 (18:19 -0800)]
zebra: Fix route deletion on *BSD

Fix for not handling RTM_CHANGE correctly.  This patch change it to
delete/add instead.  Using RTM_CHANGE on kernels where it works is better,
but is left as an exercise for developer who has access and will to fix it
on *BSD.

[ed note: collaboration with Martin Winter]

8 years agozebra: kernel interface simplification
Timo Teräs [Fri, 15 Jan 2016 15:36:29 +0000 (17:36 +0200)]
zebra: kernel interface simplification

[DL: picked out from: "atomic FIB updates"]

This simplifies the OS-specific route update API into a single entry
point, kernel_route_rib(), which dispatches the various operations
internally.

Signed-off-by: Timo Teräs <timo.teras@iki.fi>
8 years agozebra: remove rt_ioctl kernel interface
David Lamparter [Sat, 28 Jun 2014 19:49:18 +0000 (21:49 +0200)]
zebra: remove rt_ioctl kernel interface

None of the BSDs uses ioctls to set routes anymore.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Acked-by: Greg Troxel <gdt@ir.bbn.com>
Acked-by: Feng Lu <lu.feng@6wind.com>
Acked-by: Paul Jakma <paul@jakma.org>
8 years agobgpd: Fix crash reported by NetDEF CI
Lou Berger [Fri, 5 Feb 2016 02:29:49 +0000 (21:29 -0500)]
bgpd: Fix crash reported by NetDEF CI

This patch is part of the previously submitted patch set on VPN and
Encap SAFIs.  It fixes an issue identified by NetDEF CI.

Ensure temp stack structures are initialized Add protection against
double frees / post free access to bgp_attr_flush

Signed-off-by: Lou Berger <lberger@labn.net>
8 years agobgp: add bgp_isvalid_nexthop helper and additional NHT zebra checks
Lou Berger [Tue, 11 Oct 2016 15:30:55 +0000 (11:30 -0400)]
bgp: add bgp_isvalid_nexthop helper and additional NHT zebra checks

8 years agobgp: ignore NHT when bgpd has never connected to zebra
Lou Berger [Fri, 7 Oct 2016 13:44:42 +0000 (09:44 -0400)]
bgp: ignore NHT when bgpd has never connected to zebra

8 years agorfapi: cleanup some warnings
Lou Berger [Thu, 6 Oct 2016 00:44:57 +0000 (20:44 -0400)]
rfapi: cleanup some warnings

8 years agozebra: Fix dist so that zebra includes right .h
Donald Sharp [Sun, 16 Oct 2016 03:44:17 +0000 (23:44 -0400)]
zebra: Fix dist so that zebra includes right .h

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agozebra: Fix compile failure in CI
Donald Sharp [Mon, 17 Oct 2016 22:00:19 +0000 (18:00 -0400)]
zebra: Fix compile failure in CI

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agozebra: Refactor netlink interactions
vivek [Mon, 17 Oct 2016 19:39:55 +0000 (12:39 -0700)]
zebra: Refactor netlink interactions

Separate core netlink functions and library functions from route-related
interactions and interface-related interactions.

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Don Slice <dslice@cumulusnetworks.com>
Ticket: CM-13199
Reviewed By: CCR-5254
Testing Done: bgp-min, ospf-min

8 years agozebra: Derive VRF Id for slave interfaces correctly
vivek [Fri, 14 Oct 2016 23:02:37 +0000 (16:02 -0700)]
zebra: Derive VRF Id for slave interfaces correctly

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

<DETAILED DESCRIPTION (REPLACE)>

8 years agozebra: Ensure correct use of VRF ID versus NS ID
vivek [Fri, 14 Oct 2016 22:31:58 +0000 (15:31 -0700)]
zebra: Ensure correct use of VRF ID versus NS ID

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Reviewed-by: Don Slice <dslice@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Ticket: CM-13194
Reviewed By: CCR-5248
Testing Done: None (trivial)

<DETAILED DESCRIPTION (REPLACE)>

8 years agozebra: Clear off pointer array into which netlink attributes are parsed
vivek [Fri, 14 Oct 2016 01:21:49 +0000 (18:21 -0700)]
zebra: Clear off pointer array into which netlink attributes are parsed

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Reviewed-by: Don Slice <dslice@cumulusnetworks.com>
Ticket: CM-13018
Reviewed By: CCR-5237
Testing Done: None

8 years agovtysh: fix build failure in vtysh_writeconfig_integrated()
Daniel Walton [Thu, 13 Oct 2016 13:48:02 +0000 (13:48 +0000)]
vtysh: fix build failure in vtysh_writeconfig_integrated()

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agozebra: Fix signed / unsigned build error
Daniel Walton [Thu, 13 Oct 2016 13:43:12 +0000 (13:43 +0000)]
zebra: Fix signed / unsigned build error

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agolib/vtysh: fix duplicate installation of some vty commands
Renato Westphal [Wed, 12 Oct 2016 15:39:02 +0000 (12:39 -0300)]
lib/vtysh: fix duplicate installation of some vty commands

This is a followup to commits 735e62 and 0b1442, where we forgot to apply
the same VIEW/ENABLE consolidation logic to vtysh. Also, we can't call
install_default() for the ENABLE node because some of the vty commands
installed by this function were already installed in the VIEW node before.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
8 years agovtysh: infer integrated config usage from existence of Quagga.conf
Christian Franke [Mon, 26 Sep 2016 20:01:37 +0000 (22:01 +0200)]
vtysh: infer integrated config usage from existence of Quagga.conf

Only write to integrated config if integrated config is configured
explicitly or it is already in use.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
8 years agobgp: Fix bi->extra->tag if statement
Donald Sharp [Tue, 11 Oct 2016 12:47:32 +0000 (08:47 -0400)]
bgp: Fix bi->extra->tag if statement

bi->extra->tag is a 3 byte array, the statement
as written will always be true.  Modify code
to see if we actually have any data in the
tag and then print the label.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Lou Berger <lberger@labn.net>
8 years agobgpd: Fix peer->weight usage
Donald Sharp [Tue, 11 Oct 2016 12:24:03 +0000 (08:24 -0400)]
bgpd: Fix peer->weight usage

When setting the weight make sure to use the
correct afi safi to get what we need.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Lou Berger <lberger@labn.net>
8 years agozebra: Fix signed / unsigned comparisons
Donald Sharp [Tue, 11 Oct 2016 12:21:41 +0000 (08:21 -0400)]
zebra: Fix signed / unsigned comparisons

clang is complaining about signed/unsigned comparisons
for rta_addattr_l.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agorfapi: cleanup some warnings
Lou Berger [Thu, 6 Oct 2016 00:44:57 +0000 (20:44 -0400)]
rfapi: cleanup some warnings

8 years agobgpd/rfp: fix remaining index_sub uses
David Lamparter [Tue, 11 Oct 2016 11:37:26 +0000 (13:37 +0200)]
bgpd/rfp: fix remaining index_sub uses

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agobuild: remove accidentally-added configure outputs
David Lamparter [Tue, 11 Oct 2016 11:08:10 +0000 (13:08 +0200)]
build: remove accidentally-added configure outputs

these files do not belong in the git tree.  (They're temporaries during
a ./configure run and normally removed at the end;  let's add them to
.gitignore anyway.)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agoospfd: Fix arm compile issue
Donald Sharp [Mon, 10 Oct 2016 23:35:43 +0000 (19:35 -0400)]
ospfd: Fix arm compile issue

size_t printf formatter is %zd!

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agobgpd: 'neighbor x.x.x.x weight' should be per address-family
Daniel Walton [Mon, 10 Oct 2016 14:53:34 +0000 (07:53 -0700)]
bgpd: 'neighbor x.x.x.x weight' should be per address-family

Ticket: CM-13053
Reviewed By: dslice@cumulusnetworks.com

'neighbor x.x.x.x weight' was implemented as a per-peer knob instead of
a per-peer per-afi-safi option. This makes it configurable per-peer
per-afi-safi so that we can do things like soft clear that afi/safi when
weight is modified.

8 years agobgpd: Fix changes caused by index_sub change.
Donald Sharp [Sat, 8 Oct 2016 20:37:48 +0000 (16:37 -0400)]
bgpd: Fix changes caused by index_sub change.

The qobj changes changed how index_sub was handled.

This commit leaves some issues still.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years ago*: Consolidate all double VIEW_NODE and ENABLE_NODE's
Donald Sharp [Fri, 11 Mar 2016 19:27:13 +0000 (14:27 -0500)]
*: Consolidate all double VIEW_NODE and ENABLE_NODE's

If a command is put into the VIEW_NODE, it is going into the
ENABLE_NODE as well.  This is especially true for show commands.
As such if a command is in both consolidate it down to VIEW_NODE.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agolib: Consolidate VIEW_NODE to be ENABLE_NODE as well
Donald Sharp [Fri, 11 Mar 2016 19:27:12 +0000 (14:27 -0500)]
lib: Consolidate VIEW_NODE to be ENABLE_NODE as well

If you are in VIEW_NODE, the command should exist in ENABLE_NODE
as well.  This is being done to reduce chances of code being
added to one but not the other NODE.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agobgpd, lib: Remove RESTRICTED_NODE from code base
Donald Sharp [Fri, 11 Mar 2016 19:27:11 +0000 (14:27 -0500)]
bgpd, lib: Remove RESTRICTED_NODE from code base

The RESTRICTED_NODE command is not used, introduces code
complexity and provides no additional levels of security.

The only way to get into RESTRICTED_NODE is to add, under
vty configuration the command 'anonymous restricted', and
then telnet to a daemon, provide a password, then type
'enable' and fail to enter the password three times.
Then the user can enter a very limited set of commands to
monitor bgp and only bgp behavior.

This commit removes both the RESTRICTED_NODE usage as well
as the lib/* usage of the code

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agoripngd: add support for route tags
Christian Franke [Sat, 1 Oct 2016 20:35:32 +0000 (22:35 +0200)]
ripngd: add support for route tags

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
8 years agoripd: add support for route tags
Christian Franke [Sat, 1 Oct 2016 19:43:17 +0000 (21:43 +0200)]
ripd: add support for route tags

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
8 years agoospf6d: add support for route tags
Christian Franke [Sat, 1 Oct 2016 04:41:40 +0000 (06:41 +0200)]
ospf6d: add support for route tags

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
8 years ago*: Consistently support 32-bit route tags
Christian Franke [Sat, 1 Oct 2016 18:42:34 +0000 (20:42 +0200)]
*: Consistently support 32-bit route tags

This patch improves zebra,ripd,ripngd,ospfd and bgpd so that they can
make use of 32-bit route tags in the case of zebra,ospf,bgp or 16-bit
route-tags in the case of ripd,ripngd.

It is based on the following patch:

    commit d25764028829a3a30cdbabe85f32408a63cccadf
    Author: Paul Jakma <paul.jakma@hpe.com>
    Date:   Fri Jul 1 14:23:45 2016 +0100

    *: Widen width of Zserv routing tag field.

But also contains the changes which make this actually useful for all
the daemons.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
8 years agoospfd: Update route in zebra when tag changes
Christian Franke [Sat, 1 Oct 2016 02:06:03 +0000 (04:06 +0200)]
ospfd: Update route in zebra when tag changes

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
8 years agozebra: Fix some warnings found during compile.
Donald Sharp [Tue, 22 Dec 2015 20:24:25 +0000 (15:24 -0500)]
zebra: Fix some warnings found during compile.

This commit fixes some warnings found in Martin's Testbed
that compiles sun solaris and freebsd images.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agolib: Remove unknown protocol.
Donald Sharp [Fri, 7 Oct 2016 16:35:06 +0000 (12:35 -0400)]
lib: Remove unknown protocol.

What is MASC anyways?

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agolib: Fix ordering issue in protocol names
Donald Sharp [Fri, 7 Oct 2016 16:20:33 +0000 (12:20 -0400)]
lib: Fix ordering issue in protocol names

The protocol names and enum must be kept
in the same order.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agobgpd: remove the "exit" at the end of "router bgp"
Daniel Walton [Fri, 7 Oct 2016 14:13:26 +0000 (14:13 +0000)]
bgpd: remove the "exit" at the end of "router bgp"

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agozebra: use qobj and enable concurrent config edits
David Lamparter [Fri, 30 Sep 2016 13:38:03 +0000 (15:38 +0200)]
zebra: use qobj and enable concurrent config edits

This puts all the proper VTY_DECLVAR_CONTEXT calls in place, removing
all vty->index uses in the process.  With that, vty_config_lockless can
be enabled in zebra.

[v2: fix ordering screw-up in "interface XXX" command]

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agoldpd: replace global vars w/ qobj for vty context
Renato Westphal [Thu, 29 Sep 2016 17:16:50 +0000 (14:16 -0300)]
ldpd: replace global vars w/ qobj for vty context

ldpd was keeping track of the vty session's position in config editing
with 3 global static variables.  This worked because only one vty could
be in configuration-editing mode before.

Replace with vty->qobj_index infrastructure and enable
vty_config_lockless.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agoldpd: qobj: register everything
Renato Westphal [Wed, 22 Jun 2016 12:59:28 +0000 (09:59 -0300)]
ldpd: qobj: register everything

Place the appropriate QOBJ_* calls.  A bit more complicated for ldpd due
to the dup-merge config scheme.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agoldpd: add in-process API for creating/deleting
Renato Westphal [Wed, 22 Jun 2016 12:59:28 +0000 (09:59 -0300)]
ldpd: add in-process API for creating/deleting

These functions are currently unused but will be used by the Cap'n Proto
interface.  They're not a particular burden to maintain in-tree, so here
they go.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agoldpd: merge/dup/reload void **ref support
Renato Westphal [Wed, 22 Jun 2016 12:59:28 +0000 (09:59 -0300)]
ldpd: merge/dup/reload void **ref support

Extend configuration duplication-merge mechanism to allow keeping track
of a single specific object.  A "void **" pointer is passed in; the
"void *" pointer it points to is updated with the new address of the
object it points to.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agoldpd: reset interface configuration when it's disabled
Renato Westphal [Thu, 29 Sep 2016 17:52:32 +0000 (14:52 -0300)]
ldpd: reset interface configuration when it's disabled

This is necessary to prevent the same old configuration to come back
when the interface is reactivated later for a given address-family.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
8 years agolib, isisd: enable concurrent configuration editing
David Lamparter [Tue, 27 Sep 2016 14:53:25 +0000 (16:53 +0200)]
lib, isisd: enable concurrent configuration editing

Finally, this disables the config editing lock for isisd.  It also
enables deprecation warnings for the lib/ and isisd/ to catch accidental
uses of vty->index.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agoisisd: use qobj for vty->index context position
David Lamparter [Mon, 26 Sep 2016 16:36:13 +0000 (18:36 +0200)]
isisd: use qobj for vty->index context position

This converts all uses of vty->index over to qobj.  With this, isisd now
supports concurrent configuration editing as there are no more unsafe
references held anywhere while in config-edit mode.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agolib: replace vty->index_sub with qobj
David Lamparter [Tue, 27 Sep 2016 14:51:58 +0000 (16:51 +0200)]
lib: replace vty->index_sub with qobj

The keychain code is the only user of vty->index_sub;  this is also
replaced with a qobj safe-pointer.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agolib: use qobj for vty->index context position
David Lamparter [Mon, 26 Sep 2016 18:17:12 +0000 (20:17 +0200)]
lib: use qobj for vty->index context position

Prepares the library CLI functions for concurrent config access.  Note
the vty->index pointer is still kept functional for the daemons to use.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agolib: vty: add infrastructure for qobj ID "index"
David Lamparter [Mon, 26 Sep 2016 16:36:49 +0000 (18:36 +0200)]
lib: vty: add infrastructure for qobj ID "index"

As mentioned in previous commits, this prepares to replace the vty's
"void *index" context position with a safe qobj pointer.  This will
allow concurrent configuration editing by multiple users, as soon as no
more code (library included) in the daemon uses vty->index anymore.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agoisisd: qobj: register everything
David Lamparter [Tue, 5 Apr 2016 21:54:53 +0000 (18:54 -0300)]
isisd: qobj: register everything

Wire up all neccessary isisd first-class objects to be able to use qobj
safe-pointers on them.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agolib: qobj: register ifaces, routemaps & keychains
David Lamparter [Tue, 27 Sep 2016 12:51:08 +0000 (14:51 +0200)]
lib: qobj: register ifaces, routemaps & keychains

This places the appropriate calls so library objects can be used with
qobj "pointers", especially in the CLI.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agolib: add "qobj" object-ID infrastructure
David Lamparter [Mon, 26 Sep 2016 15:30:30 +0000 (17:30 +0200)]
lib: add "qobj" object-ID infrastructure

This adds 64-bit random identifiers as "safe pointers" which are also
type-tracked / can have type-specific extension methods.

This will be used by both the CLI (to keep safe references while in
config editing mode) as well as the Cap'n Proto code (to hand out
pointers to the user in a safe way and add per-type handlers)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agobgpd: 'Last write' does not update when we TX a keepalive
Daniel Walton [Thu, 6 Oct 2016 13:20:02 +0000 (13:20 +0000)]
bgpd: 'Last write' does not update when we TX a keepalive

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

8 years agobgpd: Fix crash in vnc_import_bgp_add_route
Donald Sharp [Sun, 2 Oct 2016 22:33:32 +0000 (18:33 -0400)]
bgpd: Fix crash in vnc_import_bgp_add_route

The ordering to check for NULL pointer was
reversed in this function.

I switched the order after examing a couple other
functions to see that they have the 'correct' order.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agosome rfapi compile fixes
Daniel Walton [Wed, 5 Oct 2016 20:54:55 +0000 (20:54 +0000)]
some rfapi compile fixes

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
8 years agozebra: Fix wrong afi used in zebra_static.c
Donald Sharp [Wed, 5 Oct 2016 14:58:43 +0000 (10:58 -0400)]
zebra: Fix wrong afi used in zebra_static.c

When calling a route uninstall in zebra_static.c use the
afi passed in and don't hardcode AFI_IP

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
8 years agodebian: Disable build of vnc currently
Donald Sharp [Mon, 3 Oct 2016 12:19:06 +0000 (08:19 -0400)]
debian: Disable build of vnc currently

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agovnc: look for librfp.a in builddir
Lou Berger [Thu, 29 Sep 2016 13:03:31 +0000 (09:03 -0400)]
vnc: look for librfp.a in builddir

8 years agovnc: default to enabled
Lou Berger [Wed, 28 Sep 2016 22:16:25 +0000 (18:16 -0400)]
vnc: default to enabled

8 years agovnc: use directories in includes (request from Martin W.)
Lou Berger [Wed, 28 Sep 2016 22:03:43 +0000 (18:03 -0400)]
vnc: use directories in includes (request from Martin W.)

8 years agobgpd: add L3/L2VPN Virtual Network Control feature
Lou Berger [Sat, 7 May 2016 18:18:56 +0000 (14:18 -0400)]
bgpd: add L3/L2VPN Virtual Network Control feature

This feature adds an L3 & L2 VPN application that makes use of the VPN
and Encap SAFIs.  This code is currently used to support IETF NVO3 style
operation.  In NVO3 terminology it provides the Network Virtualization
Authority (NVA) and the ability to import/export IP prefixes and MAC
addresses from Network Virtualization Edges (NVEs).  The code supports
per-NVE tables.

The NVE-NVA protocol used to communicate routing and Ethernet / Layer 2
(L2) forwarding information between NVAs and NVEs is referred to as the
Remote Forwarder Protocol (RFP). OpenFlow is an example RFP.  For
general background on NVO3 and RFP concepts see [1].  For information on
Openflow see [2].

RFPs are integrated with BGP via the RF API contained in the new "rfapi"
BGP sub-directory.  Currently, only a simple example RFP is included in
Quagga. Developers may use this example as a starting point to integrate
Quagga with an RFP of their choosing, e.g., OpenFlow.  The RFAPI code
also supports the ability import/export of routing information between
VNC and customer edge routers (CEs) operating within a virtual
network. Import/export may take place between BGP views or to the
default zebera VRF.

BGP, with IP VPNs and Tunnel Encapsulation, is used to distribute VPN
information between NVAs. BGP based IP VPN support is defined in
RFC4364, BGP/MPLS IP Virtual Private Networks (VPNs), and RFC4659,
BGP-MPLS IP Virtual Private Network (VPN) Extension for IPv6 VPN . Use
of both the Encapsulation Subsequent Address Family Identifier (SAFI)
and the Tunnel Encapsulation Attribute, RFC5512, The BGP Encapsulation
Subsequent Address Family Identifier (SAFI) and the BGP Tunnel
Encapsulation Attribute, are supported. MAC address distribution does
not follow any standard BGB encoding, although it was inspired by the
early IETF EVPN concepts.

The feature is conditionally compiled and disabled by default.
Use the --enable-bgp-vnc configure option to enable.

The majority of this code was authored by G. Paul Ziemba
<paulz@labn.net>.

[1] http://tools.ietf.org/html/draft-ietf-nvo3-nve-nva-cp-req
[2] https://www.opennetworking.org/sdn-resources/technical-library

Now includes changes needed to merge with cmaster-next.

8 years agolib: add skiplist
Lou Berger [Tue, 19 Apr 2016 20:00:37 +0000 (16:00 -0400)]
lib: add skiplist

8 years agobgpd: drop machineparse / random "show" improvements
Lou Berger [Tue, 12 Jan 2016 18:42:08 +0000 (13:42 -0500)]
bgpd: drop machineparse / random "show" improvements

Signed-off-by: Lou Berger <lberger@labn.net>
Fix up a few changed missed in previous merge

8 years agobgp debug: restore printing of memstats on exit, now prints if any debug flag set
Lou Berger [Sat, 24 Sep 2016 13:09:36 +0000 (09:09 -0400)]
bgp debug: restore printing of memstats on exit, now prints if any debug flag set

8 years agobgpd: remove old/duplicate, and now out of order prefixlen test
Lou Berger [Tue, 27 Sep 2016 11:54:56 +0000 (07:54 -0400)]
bgpd: remove old/duplicate, and now out of order prefixlen test

8 years agomemory: restore 'memstats:' keyword when logging memstats - useful in log
Lou Berger [Sat, 24 Sep 2016 13:18:23 +0000 (09:18 -0400)]
memory: restore 'memstats:' keyword when logging memstats - useful in log

8 years agolog.h: restore vzlog extern
Lou Berger [Fri, 23 Sep 2016 17:40:19 +0000 (13:40 -0400)]
log.h: restore vzlog extern

8 years agolib: add route_table_get_default_delegate
Lou Berger [Tue, 19 Apr 2016 20:06:35 +0000 (16:06 -0400)]
lib: add route_table_get_default_delegate

8 years agobgpd: eliminate RD related duplicate code in bgp_encap.c
Lou Berger [Thu, 16 Jun 2016 14:16:52 +0000 (10:16 -0400)]
bgpd: eliminate RD related duplicate code in bgp_encap.c
      decode_rd_... apis are declared global in bgp_mplsvpn.c

8 years agozebra: support FIB override routes
Timo Teräs [Fri, 15 Jan 2016 15:36:31 +0000 (17:36 +0200)]
zebra: support FIB override routes

FIB override routes are for routing protocols that establish
shortcut routes, or establish point-to-point routes that should
not be redistributed. Namely this is useful NHRP daemon to come.

Zebra is extended to select two entries from RIB the "best" entry
from routing protocols, and the FIB entry to install to kernel.
FIB override routes are never selected as best entry, and thus
are never adverticed to other routing daemons. The best FIB
override, or if it does not exist the otherwise best RIB is
selected as FIB entry to be installed.

Signed-off-by: Timo Teräs <timo.teras@iki.fi>
Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
[CF: Massage to fit cumulus tree]
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
8 years agolib: Only display memory items that have allocations
Donald Sharp [Fri, 30 Sep 2016 01:47:07 +0000 (21:47 -0400)]
lib: Only display memory items that have allocations

When displaying memory via a 'show run' only display
items that have actual memory allocated.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agoMerge remote-tracking branch 'origin/cmaster' into cmaster-next
Donald Sharp [Fri, 30 Sep 2016 00:24:49 +0000 (20:24 -0400)]
Merge remote-tracking branch 'origin/cmaster' into cmaster-next

8 years agoospfd: Fix OSPF daemon pid file param
ßingen [Mon, 26 Sep 2016 09:07:01 +0000 (11:07 +0200)]
ospfd: Fix OSPF daemon pid file param

When -i is specified on the cli, ospf was ignoring this
value.

8 years agolib: Fix compile for json
Donald Sharp [Thu, 29 Sep 2016 00:35:12 +0000 (20:35 -0400)]
lib: Fix compile for json

When compiling with the json library instead of the json-c
library allow it to switch back to the old way of printing.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agoldpd: always advertise labels upon receiving a redistributed route
Renato Westphal [Wed, 28 Sep 2016 15:25:18 +0000 (12:25 -0300)]
ldpd: always advertise labels upon receiving a redistributed route

Whenever a routing daemon advertises a new version of a route to zebra,
zebra removes the old version of this route (implicit withdraw) and then
create a new 'rib' structure for the new version of the route.

In this process, the previously received label(s) from ldpd are lost. This
is because upon receiving a ZEBRA_MPLS_LABELS_ADD message, zebra only
adds a label to a nexthop of an existing route. And routes are volatile,
they can be removed while being updated.

To workaround this issue, this patch makes ldpd always advertise the
appropriate labels whenever it receives a redistributed route, even
if it was already received before (an older version). This way, when
ldpd receives the updated version of a route, it will readvertise the
appropriate label(s) and zebra will reinstall them.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
8 years agoldpd: fix processing of redistributed routes
Renato Westphal [Wed, 28 Sep 2016 15:25:17 +0000 (12:25 -0300)]
ldpd: fix processing of redistributed routes

Commit 5048fe changed the way zebra behave when a route is updated. Now,
whenever a route is changed, zebra advertises its new version without
withdrawing the old one. This patch adapts ldpd to understand this new
behavior. After processing a ZEBRA_REDISTRIBUTE_IPV[46]_ADD message,
we need to check for nexthops that were removed and, for each of them
(if any), withdraw the associated labels from zebra.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
8 years agoldpd: make route flags a 32bit field
Renato Westphal [Wed, 28 Sep 2016 15:25:16 +0000 (12:25 -0300)]
ldpd: make route flags a 32bit field

This is a followup to commit 0fc452dc5, which updated all daemons
except ldpd.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
8 years agolib: fix vrf_bitmap leak in zclient_free()
David Lamparter [Wed, 16 Dec 2015 18:38:23 +0000 (19:38 +0100)]
lib: fix vrf_bitmap leak in zclient_free()

zclient_stop(), which is used as antagonist to zclient_init(), needs to
undo the vrf_bitmap allocation.  Otherwise zclient_init() will leak the
allocated memory, for example when zclient_reset() is used.

Reported-by: Lou Berger <lberger@labn.net>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agouse JSON_C_TO_STRING_PRETTY for json_object_to_json_string
Daniel Walton [Wed, 28 Sep 2016 04:52:36 +0000 (04:52 +0000)]
use JSON_C_TO_STRING_PRETTY for json_object_to_json_string

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
8 years agotools: quagga-reload should raise Exception instead of exiting
Daniel Walton [Tue, 27 Sep 2016 15:56:36 +0000 (15:56 +0000)]
tools: quagga-reload should raise Exception instead of exiting

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
NCLU imports quagga-reload.py and uses its Config class to parse
Quagga.conf.  The Config class will call 'vtysh -m -f Quagga.conf" and
if that exited with an error Config would call sys.exit(1) which in my
cases causes the NCLU daemon to exit which is bad.  The fix is to have
the Config class raise an exception instead of exiting, then NCLU can
catch the exception, log it and move on.

(cherry picked from commit 276887bb1c2961fa37b42ce7160346f1417577a8)

8 years agozebra: "ip import-table" display is hosed
Daniel Walton [Tue, 27 Sep 2016 15:57:56 +0000 (15:57 +0000)]
zebra: "ip import-table" display is hosed

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

Now that we have evpn we have the following AFIs

 /* Address family numbers from RFC1700. */
 typedef enum {
   AFI_IP  = 1,
   AFI_IP6 = 2,
   AFI_ETHER = 3,                /* RFC 1700 has "6" for 802.* */
   AFI_MAX = 4
 } afi_t;

The import-table code was treating the afi as a flag which was fine
before when the only choices were 1 and 2 but now that we have #3 that
doesn't work. The fix is to change zebra_import_table_used to a
[AFI_MAX][ZEBRA_KERNEL_TABLE_MAX] array to track if import-table is
enabled.

8 years agotools: quagga-reload should raise Exception instead of exiting
Daniel Walton [Tue, 27 Sep 2016 15:56:36 +0000 (15:56 +0000)]
tools: quagga-reload should raise Exception instead of exiting

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
NCLU imports quagga-reload.py and uses its Config class to parse
Quagga.conf.  The Config class will call 'vtysh -m -f Quagga.conf" and
if that exited with an error Config would call sys.exit(1) which in my
cases causes the NCLU daemon to exit which is bad.  The fix is to have
the Config class raise an exception instead of exiting, then NCLU can
catch the exception, log it and move on.

8 years agolib: Allow more space in thread.c output
Donald Sharp [Mon, 26 Sep 2016 18:06:23 +0000 (14:06 -0400)]
lib: Allow more space in thread.c output

When displaying thread time for long running/busy
protocols, the space allocated may not be sufficient.

Allow the runtime to take a bit more space.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agozebra: add missing files to EXTRA_DIST
Renato Westphal [Fri, 23 Sep 2016 12:58:30 +0000 (09:58 -0300)]
zebra: add missing files to EXTRA_DIST

This fixes RPM package generation on CentOS 7.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
8 years agolib: Make distribute.c accepts both v4 and v6.
Matthieu Boutier [Thu, 22 Sep 2016 21:11:07 +0000 (18:11 -0300)]
lib: Make distribute.c accepts both v4 and v6.

distribute.c doesn't allow to manage both v4 and v6 distribute lists.  This
patch fix this problem by having 4 DISTRIBUTE* values in the enumeration instead
of two. The code in all daemons using distribute.c is adapted.

8 years agoripngd: code simplification for redistribution.
Matthieu Boutier [Thu, 22 Sep 2016 21:11:06 +0000 (18:11 -0300)]
ripngd: code simplification for redistribution.

Use loops and variables instead of doing each cases by hand.
Use boolean instead of having 2 almost identical functions.

8 years agoripd: code simplification for redistribution.
Matthieu Boutier [Thu, 22 Sep 2016 21:11:05 +0000 (18:11 -0300)]
ripd: code simplification for redistribution.

Use loops and variables instead of doing each cases by hand.
Use boolean instead of having 2 almost identical functions.

8 years agolib: simplify distribute.c's code.
Matthieu Boutier [Thu, 22 Sep 2016 21:11:04 +0000 (18:11 -0300)]
lib: simplify distribute.c's code.

Use loops and variables instead of doing each cases by hand.
Use static functions instead of rewriting code.

8 years agoMake route flags a 32bit field
Christian Franke [Fri, 16 Sep 2016 19:55:37 +0000 (21:55 +0200)]
Make route flags a 32bit field

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
8 years agolib: Check prefix length from zebra is sensible
Paul Jakma [Tue, 9 Feb 2016 15:23:03 +0000 (15:23 +0000)]
lib: Check prefix length from zebra is sensible

* zclient.c: prefix length on router-id and interface address add
  messages not sanity checked.  fix.

* */*_zebra.c: Prefix length on zebra route read was not checked, and
  clients use it to write to storage.  An evil zebra could overflow
  client structures by sending overly long prefixlen.

Prompted by discussions with:

Donald Sharp <sharpd@cumulusnetworks.com>

8 years agolib: force local MIN/MAX macros
David Lamparter [Wed, 21 Sep 2016 16:20:49 +0000 (18:20 +0200)]
lib: force local MIN/MAX macros

Linux/glibc sys/param.h has definitions of MIN/MAX that result in
multiple evaluations of its parameters.  Force local definitions.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agofpm/protobuf: fix compile errors & warnings
David Lamparter [Wed, 21 Sep 2016 10:45:46 +0000 (12:45 +0200)]
fpm/protobuf: fix compile errors & warnings

BABEL was removed, ifname nexthops were removed, additional includes
were needed, and lastly the protobuf enum-handling triggers a warning.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agozebra: add developer test functions for FPM code
Avneesh Sachdev [Fri, 11 Mar 2016 20:21:26 +0000 (12:21 -0800)]
zebra: add developer test functions for FPM code

Add test functions for the zebra code that interfaces with the
Forwarding Plane Manager. These functions can be invoked in a
development build via the recently-added 'invoke' command.

For example:

  # invoke zebra function zfpm_dt_benchmark_protobuf_encode 100000

Changes:

  * zebra/zebra_fpm_dt.c

    Add the following functions. Each function encodes or decodes a
    route in a particular FPM format a specified number of times.

    - zfpm_dt_benchmark_netlink_encode()
    - zfpm_dt_benchmark_protobuf_encode()
    - zfpm_dt_benchmark_protobuf_decode()

  * zebra/Makefile.am

    Compile zebra_fpm_dt when building a development build.

Signed-off-by: Avneesh Sachdev <avneesh@sproute.com>
8 years agobuild: support for "development build"
Avneesh Sachdev [Fri, 11 Mar 2016 20:21:24 +0000 (12:21 -0800)]
build: support for "development build"

* configure.ac

    Add the --enable-dev-build flag. It controls the DEV_BUILD
    define for autoconf and automake, which can be used to
    conditionally build in code that is only intended for development..

Signed-off-by: Avneesh Sachdev <avneesh@sproute.com>
8 years agodoc: add blurb on use of protobuf with FPM
Avneesh Sachdev [Mon, 4 Apr 2016 17:54:59 +0000 (10:54 -0700)]
doc: add blurb on use of protobuf with FPM

Add text about using protobuf as an alternative format for the FPM
interface.

Signed-off-by: Avneesh Sachdev <avneesh@sproute.com>
8 years agozebra: optionally use protobuf with FPM
Avneesh Sachdev [Mon, 4 Apr 2016 17:54:58 +0000 (10:54 -0700)]
zebra: optionally use protobuf with FPM

Change zebra so that it can optionally use protobuf serialization when
communicating with a Forwarding Plane Manager component.

  * zebra/main.c

    Add the --fpm-format/-F command line option. This allows the user
    to control the format (protbuf|netlink) that is used to
    communicate with the FPM.

  * zebra/zebra_fpm.c

    - zebra_init_msg_format(),

      This new function is invoked on process startup to determine the
      FPM format that should be used.

    - zfpm_init()

      Change to accept any 'FPM message format' specified by the user
      (via the new command line flag).

    - zebra_encode_route()

      Tweak to use the selected FPM format.

  * zebra_fpm_protobuf.c

    New code to build protobuf messages to be sent to the FPM.

  * zebra/Makefile.am

    - Include common.am

    - Build new file zebra_fpm_protobuf.c when protobuf is available.

    - Link with the fpm_pb library.

Signed-off-by: Avneesh Sachdev <avneesh@sproute.com>
8 years agoUse only the ISC license for .proto files.
Avneesh Sachdev [Thu, 14 Jul 2016 16:59:30 +0000 (09:59 -0700)]
Use only the ISC license for .proto files.

Simplify licensing for protobuf files based on discussion on the
quagga-dev mailing list.

Previously, users could choose between the GPL and the ISC license.

Signed-off-by: Avneesh Sachdev <avneesh@sproute.com>
Signed-off-by: Avneesh Sachdev <avneesh@sproute.com>
8 years agofpm: Add protobuf support for FPM.
Avneesh Sachdev [Mon, 4 Apr 2016 17:54:57 +0000 (10:54 -0700)]
fpm: Add protobuf support for FPM.

Code that allows a client to convey routes to a Forwarding Plane
Manager component using protobuf instead of netlink..

  * fpm/fpm.proto

    Protobuf definitions pertaining to the Forwarding Plane Manager.
    In particular, this file defines the AddRoute and DeleteRoute
    messages.

  * fpm/fpm.h

    Tweak FPM message header definition to also allow messages to be
    encoded in protobuf format.

  * fpm/{fpm_pb.h,.gitignore,.Makefile.am}

    Add the fpm_pb library, which contains code for interfacing with
    the FPM using protobuf.

  * configure.ac

    Generate fpm/Makefile.

  * Makefile.am

    Add fpm subdirectory to build.

  * common.am

    Add flags to be used by clients of the fpm_pb library.

Signed-off-by: Avneesh Sachdev <avneesh@sproute.com>
8 years agobuild: turn off automake portability warnings
Avneesh Sachdev [Mon, 4 Apr 2016 17:54:56 +0000 (10:54 -0700)]
build: turn off automake portability warnings

Modify configure.ac to disable portability warnings for automake --
our automake code (in particular common.am) uses some constructs
specific to gmake.

Signed-off-by: Avneesh Sachdev <avneesh@sproute.com>