]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
6 years agoMerge pull request #2104 from LabNConsulting/working/master/bvl-src-bgp
Russ White [Tue, 24 Apr 2018 12:12:03 +0000 (08:12 -0400)]
Merge pull request #2104 from LabNConsulting/working/master/bvl-src-bgp

bgpd: bugfix: vpn-vrf leak: set origin bgp to origin vrf for vrf-vpn-vrf

6 years agoMerge pull request #2099 from qlyoung/fix-cpu-thread-hist-race
Russ White [Tue, 24 Apr 2018 11:59:06 +0000 (07:59 -0400)]
Merge pull request #2099 from qlyoung/fix-cpu-thread-hist-race

lib: fix data race in thread history collection

6 years agoMerge pull request #2090 from qlyoung/graph-dfs
Russ White [Tue, 24 Apr 2018 11:53:09 +0000 (07:53 -0400)]
Merge pull request #2090 from qlyoung/graph-dfs

lib: add DFS + DOT dumping to graph datastructure

6 years agoMerge pull request #2094 from donaldsharp/pbr_fixes
Russ White [Tue, 24 Apr 2018 11:48:52 +0000 (07:48 -0400)]
Merge pull request #2094 from donaldsharp/pbr_fixes

Pbr fixes

6 years agoMerge pull request #2095 from donaldsharp/2060_fixup
Lou Berger [Tue, 24 Apr 2018 11:15:09 +0000 (07:15 -0400)]
Merge pull request #2095 from donaldsharp/2060_fixup

resolve possible null pointer dereference

6 years agolib: Fix SA warning
Donald Sharp [Fri, 20 Apr 2018 14:31:45 +0000 (10:31 -0400)]
lib: Fix SA warning

The addr value will never be null because of the way we do the
cli, but the SA system doesn't understand this.  Add an assert
to make it happy.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agopbrd: Fix a couple SA issues
Donald Sharp [Fri, 20 Apr 2018 14:18:47 +0000 (10:18 -0400)]
pbrd: Fix a couple SA issues

1) addr will never be non-null because of the way we build the cli
at this point in time, but the SA system does not understand this,
add a bread crumb for it.

2) Fix a possible memory leak of the pbr_ifp

3) Fix possible integer overflow when bit shifting.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agoisisd: resolve possible null pointer dereference
Ilya Shipitsin [Thu, 12 Apr 2018 18:23:21 +0000 (23:23 +0500)]
isisd: resolve possible null pointer dereference

issue found by cppcheck

[isisd/dict.c:1320] -> [isisd/dict.c:1065]:
(warning) Either the condition '!dn' is redundant or
there is possible null pointer dereference: newnode.

[isisd/dict.c:1320] -> [isisd/dict.c:1068]:
(warning) Either the condition '!dn' is redundant or
there is possible null pointer dereference: newnode.

Signed-off-by: Ilya Shipitsin <chipitsine@gmail.com>
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agoMerge pull request #2111 from mjstapp/zmq_sockopt
Quentin Young [Mon, 23 Apr 2018 18:33:41 +0000 (14:33 -0400)]
Merge pull request #2111 from mjstapp/zmq_sockopt

frrzmq: properly init args to zmq_getsockopt()

6 years agofrrzmq: properly init args to zmq_getsockopt()
Mark Stapp [Tue, 17 Apr 2018 19:19:34 +0000 (15:19 -0400)]
frrzmq: properly init args to zmq_getsockopt()

zmq read events get lost if zmq_getsockopt() silently fails in
frrzmq_check_events().

Signed-off-by: Mark Stapp <mjs@voltanet.io>
6 years agoMerge pull request #2103 from donaldsharp/bgp_zebra_youch
Lou Berger [Mon, 23 Apr 2018 15:02:15 +0000 (11:02 -0400)]
Merge pull request #2103 from donaldsharp/bgp_zebra_youch

bgpd: The deletion of a bgp route does not need to send some data

6 years agoMerge pull request #2098 from qlyoung/fix-underline-buf-overflow
Lou Berger [Mon, 23 Apr 2018 15:01:34 +0000 (11:01 -0400)]
Merge pull request #2098 from qlyoung/fix-underline-buf-overflow

lib: fix dynamic stack buffer overflow

6 years agoMerge pull request #2108 from donaldsharp/redistribute_debugs
Lou Berger [Mon, 23 Apr 2018 14:56:44 +0000 (10:56 -0400)]
Merge pull request #2108 from donaldsharp/redistribute_debugs

zebra: Add some information to redistribute debugs

6 years agoMerge pull request #2105 from qlyoung/fix-includes
Lou Berger [Mon, 23 Apr 2018 14:55:00 +0000 (10:55 -0400)]
Merge pull request #2105 from qlyoung/fix-includes

lib: table.h needs to include prefix.h

6 years agozebra: Add some information to redistribute debugs
Donald Sharp [Mon, 23 Apr 2018 12:26:33 +0000 (08:26 -0400)]
zebra: Add some information to redistribute debugs

When we are debugging add a bit of extra information
so we can know what we are redistributing to our peers

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agolib: fix data race in thread history collection
Quentin Young [Fri, 20 Apr 2018 21:27:16 +0000 (17:27 -0400)]
lib: fix data race in thread history collection

Thread statistics are collected and stored in a hashtable shared across
threads, but while the hashtable itself is protected by a mutex, the
records themselves were not being updated safely. Change all thread
history collection to use atomic operations.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agolib: table.h needs to include prefix.h
Quentin Young [Sun, 22 Apr 2018 21:06:00 +0000 (17:06 -0400)]
lib: table.h needs to include prefix.h

For the last six years this source file has been using a type defined in
a header it did not include.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agobgpd: bugfix: vpn-vrf leak: set origin bgp to origin vrf for vrf-vpn-vrf
G. Paul Ziemba [Sun, 22 Apr 2018 03:04:29 +0000 (20:04 -0700)]
bgpd: bugfix: vpn-vrf leak: set origin bgp to origin vrf for vrf-vpn-vrf

bgp route extra->bgp_orig for routes leaked vpn->vrf should be set
to original extra->bgp_orig if it is set, not vpn's bgp instance.

The initial leak is OK because it goes through a loopback path
in the vrf->vpn leaking code, but it is possible later re-leaks (e.g.,
if the destination vrf's leak configuration is changed) could
set the wrong extra->bgp_orig and break the route's nexthop.

Signed-off-by: G. Paul Ziemba <paulz@labn.net>
6 years agobgpd: The deletion of a bgp route does not need to send some data
Donald Sharp [Sat, 21 Apr 2018 23:59:25 +0000 (19:59 -0400)]
bgpd: The deletion of a bgp route does not need to send some data

When sending a bgp route down to zebra for deletion, the
ZEBRA_FLAG_ALLOW_RECURSION and ZEBRA_FLAG_IBGP flags
are not needed in zebra.  So remove the setting
of the api.flags.  If we remove this data from being
passed down we no longer need the peer data structure.

Remove the lookup of the peer data structure and the setting
of the flags as that peer was NULL in some evpn symmetric
routing cases for shutdown of bgp.

Ticket: CM-20720
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agoMerge pull request #2080 from qlyoung/docuser
Lou Berger [Sat, 21 Apr 2018 11:52:31 +0000 (07:52 -0400)]
Merge pull request #2080 from qlyoung/docuser

doc: spelling fixes

6 years agodoc: spelling fixes
Quentin Young [Tue, 17 Apr 2018 18:57:32 +0000 (14:57 -0400)]
doc: spelling fixes

* Run sphinxcontrib-spelling over docs
* Correct spelling errors
* Compile a dictionary for future spellchecking efforts

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agolib: fix dynamic stack buffer overflow
Quentin Young [Fri, 20 Apr 2018 20:40:46 +0000 (16:40 -0400)]
lib: fix dynamic stack buffer overflow

oops

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agoMerge pull request #2092 from dslicenc/import-table-change
Russ White [Fri, 20 Apr 2018 12:10:39 +0000 (08:10 -0400)]
Merge pull request #2092 from dslicenc/import-table-change

zebra: resolve issue when changing import-table route-map config

6 years agoMerge pull request #2086 from donaldsharp/zebra_capabilities
Russ White [Fri, 20 Apr 2018 12:06:54 +0000 (08:06 -0400)]
Merge pull request #2086 from donaldsharp/zebra_capabilities

zebra: Add pass up through zapi what zebra is capable of handling

6 years agoMerge pull request #2083 from LabNConsulting/working/master/bvl-routemap-defined
Russ White [Fri, 20 Apr 2018 12:05:22 +0000 (08:05 -0400)]
Merge pull request #2083 from LabNConsulting/working/master/bvl-routemap-defined

bgpd: vpn-vrf routemaps: no leak if named route-map not defined

6 years agoMerge pull request #2079 from qlyoung/exit-vrf-memes
Russ White [Fri, 20 Apr 2018 12:01:32 +0000 (08:01 -0400)]
Merge pull request #2079 from qlyoung/exit-vrf-memes

Always explicitly exit vrf contexts

6 years agoMerge pull request #2077 from donaldsharp/static_warn
Russ White [Fri, 20 Apr 2018 11:59:37 +0000 (07:59 -0400)]
Merge pull request #2077 from donaldsharp/static_warn

zebra: Leave some warning breadcrumbs

6 years agoMerge pull request #2072 from donaldsharp/blackhole_this
Russ White [Fri, 20 Apr 2018 11:58:03 +0000 (07:58 -0400)]
Merge pull request #2072 from donaldsharp/blackhole_this

zebra: Allow blackhole route deletion for prefixes

6 years agoMerge pull request #2057 from donaldsharp/fix_1916
Russ White [Fri, 20 Apr 2018 11:56:48 +0000 (07:56 -0400)]
Merge pull request #2057 from donaldsharp/fix_1916

Fix 1916

6 years agoMerge pull request #2051 from donaldsharp/PBRD_EXTRA
Russ White [Fri, 20 Apr 2018 11:54:30 +0000 (07:54 -0400)]
Merge pull request #2051 from donaldsharp/PBRD_EXTRA

Pbrd extra

6 years agoMerge pull request #2088 from ajones-rvbd/ajones-issue-2087
Donald Sharp [Fri, 20 Apr 2018 11:22:09 +0000 (07:22 -0400)]
Merge pull request #2088 from ajones-rvbd/ajones-issue-2087

alpine build docs: Document docker images and alpine packages

6 years agozebra: resolve issue when changing import-table route-map config
Don Slice [Thu, 19 Apr 2018 21:04:05 +0000 (21:04 +0000)]
zebra: resolve issue when changing import-table route-map config

When changing from "ip import-table 10 route-map rdn" to "ip
import-table 10" without a route-map, routes would be deleted
and not reinstalled.  This fix resolves that problem.

Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
6 years agolib: add DFS + DOT dumping to graph datastructure
Quentin Young [Thu, 19 Apr 2018 15:35:16 +0000 (11:35 -0400)]
lib: add DFS + DOT dumping to graph datastructure

* Add general-purpose DFS traversal code
* Add ability to dump any graph to DOT language
* Add tests for graph datastructure

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agoMerge pull request #2084 from donaldsharp/move_mpls
Jafar Al-Gharaibeh [Wed, 18 Apr 2018 20:53:17 +0000 (15:53 -0500)]
Merge pull request #2084 from donaldsharp/move_mpls

Move mpls

6 years agoalpine build docs: Document docker images and alpine packages
Arthur Jones [Wed, 18 Apr 2018 17:18:00 +0000 (10:18 -0700)]
alpine build docs: Document docker images and alpine packages

https://hub.docker.com/r/ajones17/frr/ contains pre-built docker
images and alpine packages for the master branch of frr.  Document
this continuous delivery system on the alpine build page.

Issue: https://github.com/FRRouting/frr/issues/2087
Signed-of-by: Arthur Jones <arthur.jones@riverbed.com>
6 years agoMerge pull request #2082 from qlyoung/sa-fixes
Rafael Zalamena [Wed, 18 Apr 2018 17:22:08 +0000 (14:22 -0300)]
Merge pull request #2082 from qlyoung/sa-fixes

Even more static analysis fixes

6 years agopbrd: fix multiple unsafe string copies
Quentin Young [Tue, 17 Apr 2018 22:20:53 +0000 (18:20 -0400)]
pbrd: fix multiple unsafe string copies

Coverity #1467828
Coverity #1467827
Coverity #1467826
Coverity #1467825
Coverity #1467824
Coverity #1467823
Coverity #1467822

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agopbrd: remove potential null dereference
Quentin Young [Tue, 17 Apr 2018 21:59:47 +0000 (17:59 -0400)]
pbrd: remove potential null dereference

Coverity #1467832

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agopbrd: remove pbr-policy resource leak
Quentin Young [Tue, 17 Apr 2018 21:51:48 +0000 (17:51 -0400)]
pbrd: remove pbr-policy resource leak

Removing a non-existent pbr-policy caused a pbr_interface to leak.

Coverity #1467829

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agopbrd: remove unsafe string copy
Quentin Young [Tue, 17 Apr 2018 20:55:59 +0000 (16:55 -0400)]
pbrd: remove unsafe string copy

A user could overflow the pbr_ifp->mapname buffer by entering a pbr-map
name longer than 100 characters.

Coverity #1467821
Coverity #1467821

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agobgpd: avoid indexing with negative integer
Quentin Young [Tue, 17 Apr 2018 20:40:09 +0000 (16:40 -0400)]
bgpd: avoid indexing with negative integer

Coverity #1399286

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agopimd: avoid writing to negative fd
Quentin Young [Tue, 17 Apr 2018 20:36:56 +0000 (16:36 -0400)]
pimd: avoid writing to negative fd

Coverty #1465483

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agolib: avoid writing to negative fd
Quentin Young [Tue, 17 Apr 2018 20:34:25 +0000 (16:34 -0400)]
lib: avoid writing to negative fd

Coverity #1399341

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agozebra: Add pass up through zapi what zebra is capable of handling
Donald Sharp [Wed, 18 Apr 2018 15:10:27 +0000 (11:10 -0400)]
zebra: Add pass up through zapi what zebra is capable of handling

Zebra is starting to have some run-time capabilites that would be
useful to pass up to the higher level protocols so that they
can act in an appropriate manner when needed.

Send the ecmp value zebra is being run with and whether or not
we believe mpls is enabled in the kernel or not.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agoMerge pull request #2078 from dslicenc/fix-import-table-fix
Rafael Zalamena [Wed, 18 Apr 2018 13:21:38 +0000 (10:21 -0300)]
Merge pull request #2078 from dslicenc/fix-import-table-fix

zebra: fix flaw in fix for import-table crash

6 years agolib, zebra: Move label conversion strings to lib
Donald Sharp [Wed, 18 Apr 2018 11:06:11 +0000 (07:06 -0400)]
lib, zebra: Move label conversion strings to lib

The mpls_label2str and mpls_str2label functions should not
be zebra exclusive functions.  Move them to lib/mpls.c

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agolib, zebra: Move help string to appropriate header
Donald Sharp [Wed, 18 Apr 2018 11:00:12 +0000 (07:00 -0400)]
lib, zebra: Move help string to appropriate header

The MPLS_LABEL_HELPSTR belongs in lib/mpls.h in case
any other protocol wants to use it.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agobgpd: vpn-vrf routemaps: no leak if named route-map not defined
G. Paul Ziemba [Wed, 18 Apr 2018 05:30:38 +0000 (22:30 -0700)]
bgpd: vpn-vrf routemaps: no leak if named route-map not defined

given a configuration such as this:

    router bgp 7777 vrf A
address-family ipv4 unicast
    route-map vpn import FOO
    import vpn

or this:

    router bgp 7777 vrf A
address-family ipv4 unicast
    rd vpn export 1:3
    rt vpn export 1:100
    route-map vpn export FOO
    export vpn

Previous code allowed leaking if the named FOO route-map was not defined.

Since the configuration is logically incomplete, if a route-map is named
for "vpn export" or "vpn import" but is not defined, leaking should not
occur until the route-map is defined.

This changeset implements the correct behavior.

Signed-off-by: G. Paul Ziemba <paulz@labn.net>
6 years agoMerge pull request #2035 from vincentbernat/fix/no-etag-esi-ignore
Donald Sharp [Tue, 17 Apr 2018 22:59:48 +0000 (18:59 -0400)]
Merge pull request #2035 from vincentbernat/fix/no-etag-esi-ignore

bgpd: add basic support for ETI and ESI for BGP EVPN

6 years agolib: Handle if up/down and vrf enable/disable events
Donald Sharp [Tue, 10 Apr 2018 19:57:09 +0000 (15:57 -0400)]
lib: Handle if up/down and vrf enable/disable events

Properly notice when we get if up/down and vrf enable/disable
events and attempt to properly install nexthops as they
come in.

Ticket: CM20489
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agopbrd: Use proper decode function for interface
Donald Sharp [Tue, 10 Apr 2018 19:54:35 +0000 (15:54 -0400)]
pbrd: Use proper decode function for interface

Use a proper decode function for a interface state change.

Ticket: CM-20489
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agolib: Store nexthop information independently
Donald Sharp [Tue, 10 Apr 2018 13:23:34 +0000 (09:23 -0400)]
lib: Store nexthop information independently

Store Nexthop's as the incoming raw data.  This will allow
us to separate the act of inputting the cli from the
act of instantiating the cli.

Ticket: CM-20489
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agopbrd: Fix unused function
Donald Sharp [Tue, 10 Apr 2018 12:03:25 +0000 (08:03 -0400)]
pbrd: Fix unused function

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agopbrd: Allow pbr-policy add/removal to install/remove rules
Donald Sharp [Mon, 9 Apr 2018 19:41:37 +0000 (15:41 -0400)]
pbrd: Allow pbr-policy add/removal to install/remove rules

The pbrm->installed variable was being used only in a couple
of places and it has no real bearing on whether or not
we should install a rule or not.  Remove this value.

Ticket: CM-20429
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agopbrd: don't collapse pbr debugs
Quentin Young [Tue, 3 Apr 2018 20:48:53 +0000 (16:48 -0400)]
pbrd: don't collapse pbr debugs

While compact, collapsing the various debugs into simply `debug pbr` if
all debugs are on is potentially confusing to users.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agopbrd: move debug vty into pbr_vty.c
Quentin Young [Tue, 3 Apr 2018 20:46:11 +0000 (16:46 -0400)]
pbrd: move debug vty into pbr_vty.c

Dev docs say that CLI goes in _vty.c files

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agopbrd, zebra: Properly notice rule deletion
Donald Sharp [Mon, 9 Apr 2018 13:41:08 +0000 (09:41 -0400)]
pbrd, zebra: Properly notice rule deletion

When a rule is deleted properly notice it in pbr.

Ticket: CM-20394
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agopbrd, zebra: Fix multiple pbr-policy install
Donald Sharp [Fri, 6 Apr 2018 20:38:20 +0000 (16:38 -0400)]
pbrd, zebra: Fix multiple pbr-policy install

Somewhere along the way the ability to install multiple
pbr-policys for the same pbr-map was lost.

Add this back.  There is a limitation in that we are limited
to 64 interfaces per pbr-policy.

Ticket: CM-20429
Signed-off-by: Donald Sharp sharpd@cumulusnetworks.com>
6 years agopbrd: Fix installation and deletion in some cases
Donald Sharp [Fri, 6 Apr 2018 15:41:10 +0000 (11:41 -0400)]
pbrd: Fix installation and deletion in some cases

When a nexthop group is modified do not assume that it
is not installed.  The creation of the pnhgc is enough
to set the installed to false.  If we are reinstalling
it is not needed to set it as not installed.

When a pbrms is being installed/removed check to see if it
is already installed/deleted and do the right thing from
there.

Ticket: CM-20371
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agopbrd: Prevent attempt at re-install for several scenarios
Donald Sharp [Fri, 30 Mar 2018 17:38:45 +0000 (13:38 -0400)]
pbrd: Prevent attempt at re-install for several scenarios

There exists several places we attempt to re-install the
same rule.  Figure out when we need to not make an attempt
at doing anything and do it.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agozebra: Tell rib_process to actually rethink pbr routes.
Donald Sharp [Fri, 30 Mar 2018 14:33:25 +0000 (10:33 -0400)]
zebra: Tell rib_process to actually rethink pbr routes.

When I implemented this code change I was only testing against
static routes and with one nexthop.  I missed the fact that
we needed to tell rib_process to actually rethink the nexthops.

Ticket: CM-20274
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agolib: Clean up delete of a nexthop from a nexthop group
Donald Sharp [Wed, 28 Mar 2018 23:31:40 +0000 (19:31 -0400)]
lib: Clean up delete of a nexthop from a nexthop group

The delete was not properly deleting the nexthop from
the nexthop group and it was not properly setting the
nexthop's pointers to NULL.

Ticket: CM-20261
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agolib, pbrd: Do not allow v6 LL nexthops to be specified without an interface.
Donald Sharp [Wed, 28 Mar 2018 22:23:27 +0000 (18:23 -0400)]
lib, pbrd: Do not allow v6 LL nexthops to be specified without an interface.

Prevent the creation of a v6 LL nexthop that does not include an interface
for proper resolution.

Ticket: CM-20276
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agoMerge pull request #2064 from donaldsharp/redistribute_limitation
Lou Berger [Tue, 17 Apr 2018 19:55:35 +0000 (15:55 -0400)]
Merge pull request #2064 from donaldsharp/redistribute_limitation

redristribute and access list

6 years agoMerge pull request #2071 from qlyoung/sa-fixes
Rafael Zalamena [Tue, 17 Apr 2018 19:22:36 +0000 (16:22 -0300)]
Merge pull request #2071 from qlyoung/sa-fixes

More static analyzer fixes

6 years agovtysh: remove exit-vrf for vtysh -m
Quentin Young [Thu, 12 Apr 2018 20:44:03 +0000 (16:44 -0400)]
vtysh: remove exit-vrf for vtysh -m

How It's Made:

- vtysh -m is for frr-reload.py to know when a context ends. This is
  done by executing commands against the CLI graph, checking for walkup,
  and putting the appropriate context exit if walkup is necessary. Thus
  the default case for walking up from a vrf context is fine, and
  doesn't need a specific exit-vrf command. Remove that.

- exit-vrf needs to be explicitly printed at the end of vrf config
  printing. We already do this.

- vtysh's special snowflake config prettiness logic needs to know that
  exit-vrf goes with the vrf block and needs to be explicitly told not
  place this in alphabetical order in that block. We also already do
  this.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agovtysh, zebra: print exit-vrf at end of vrf context
Quentin Young [Wed, 11 Apr 2018 15:23:23 +0000 (11:23 -0400)]
vtysh, zebra: print exit-vrf at end of vrf context

Need to explicitly exit this context otherwise we risk ambiguities
between global and vrf context commands

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agoospfd: use __func__ in ospf_te.c
Quentin Young [Tue, 17 Apr 2018 18:08:57 +0000 (14:08 -0400)]
ospfd: use __func__ in ospf_te.c

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agozebra: Leave some warning breadcrumbs
Donald Sharp [Tue, 17 Apr 2018 17:39:06 +0000 (13:39 -0400)]
zebra: Leave some warning breadcrumbs

When a user specifies static routes, there are a couple of states
where we will store the route and display it as part of the 'show run'
but it will not be installed until such time that the dependant state
is created.  Add some breadcrumbs to the user so that they can figure
out WTF just happened.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agobgpd: clean up clist management logic
Quentin Young [Mon, 16 Apr 2018 21:22:41 +0000 (17:22 -0400)]
bgpd: clean up clist management logic

* Remove unused parameter
* Restore behavior described by function comment
* Eliminate NPD caught by static analysis

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agoospf6d: handle realloc() failure in lsa test
Quentin Young [Mon, 16 Apr 2018 19:36:12 +0000 (15:36 -0400)]
ospf6d: handle realloc() failure in lsa test

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agobgpd: fix stylistic issue
Quentin Young [Mon, 16 Apr 2018 18:50:30 +0000 (14:50 -0400)]
bgpd: fix stylistic issue

Again, use of a macro as a conditional without wrapping in parens...

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agoeigrpd: remove unnecessary assignment
Quentin Young [Mon, 16 Apr 2018 18:49:16 +0000 (14:49 -0400)]
eigrpd: remove unnecessary assignment

Plot thickens, EIGRP SNMP code was copied from ospfd

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agolib: initialize imsg_hdr
Quentin Young [Mon, 16 Apr 2018 18:48:24 +0000 (14:48 -0400)]
lib: initialize imsg_hdr

Not fully initialized.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agoospfd: remove unnecessary assignment
Quentin Young [Mon, 16 Apr 2018 18:47:57 +0000 (14:47 -0400)]
ospfd: remove unnecessary assignment

Not sure what's going on here but it doesn't need to be

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agoospfd: fix stylistic issue
Quentin Young [Mon, 16 Apr 2018 18:37:30 +0000 (14:37 -0400)]
ospfd: fix stylistic issue

Macro that expands to be wrapped in parentheses was being used as a raw
condition for an if statement, leading to some very weird and confusing
formatting...

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agozebra: fix error-prone array iterator
Quentin Young [Mon, 16 Apr 2018 18:28:16 +0000 (14:28 -0400)]
zebra: fix error-prone array iterator

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agozebra: fix flaw in fix for import-table crash
Don Slice [Tue, 17 Apr 2018 17:48:30 +0000 (10:48 -0700)]
zebra: fix flaw in fix for import-table crash

Realized (with coverity's help) the fix had a mistake by pasting in
the wrong route entry to unset the selected flag.  This fix takes
care of that mistake.

Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
6 years agoMerge pull request #2058 from chipitsine/master
Quentin Young [Tue, 17 Apr 2018 15:45:41 +0000 (11:45 -0400)]
Merge pull request #2058 from chipitsine/master

more exclusions for clippy tool when running -fsanitize=address

6 years agoMerge pull request #2069 from donaldsharp/v6_tunnel_crash
Lou Berger [Tue, 17 Apr 2018 10:25:30 +0000 (06:25 -0400)]
Merge pull request #2069 from donaldsharp/v6_tunnel_crash

zebra: Fix crash with certain types of tunnels

6 years agoMerge pull request #2070 from dslicenc/import-table-crash-cm20450
Lou Berger [Tue, 17 Apr 2018 10:22:04 +0000 (06:22 -0400)]
Merge pull request #2070 from dslicenc/import-table-crash-cm20450

zebra: resolve assert when adding ip import-table entry

6 years agotools: more lsan suppressions for clippy
Ilya Shipitsin [Tue, 17 Apr 2018 07:30:33 +0000 (12:30 +0500)]
tools: more lsan suppressions for clippy

Signed-off-by: Ilya Shipitsin <chipitsine@gmail.com>
6 years agoMerge pull request #1905 from pguibert6WIND/ipset_iptable_zebra
Donald Sharp [Tue, 17 Apr 2018 00:00:50 +0000 (20:00 -0400)]
Merge pull request #1905 from pguibert6WIND/ipset_iptable_zebra

Ipset iptable for zebra

6 years agozebra: Allow blackhole route deletion for prefixes
Donald Sharp [Mon, 16 Apr 2018 22:42:40 +0000 (18:42 -0400)]
zebra: Allow blackhole route deletion for prefixes

With the recent change to just pass the prefix in
for the RTM_DELROUTE, for blackhole routes we
had stopped modifying the req.rtm_type to
be the appropriate type for blackhole routes.

Since we are just deleting on the route, and
zebra is never going to really install the same
route multiple times then we do not need
to specify the req.r.rtm_type for the deletion
command.

Ticket: CM-20616
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agozebra: Check for NULL in connected_add_ipv6
Donald Sharp [Mon, 16 Apr 2018 15:17:52 +0000 (11:17 -0400)]
zebra: Check for NULL in connected_add_ipv6

When I implemented the same functionality in add_ipv6 that
add_ipv4 has I just assumed that broad would not be NULL with
the ZEBRA_IFA_PEER flag set.

Modify the code to act similiar to the flow of control
in add_ipv4.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agoMerge pull request #2067 from LabNConsulting/working/master/bgp-vpn-leak-new-label...
Donald Sharp [Mon, 16 Apr 2018 14:45:32 +0000 (10:45 -0400)]
Merge pull request #2067 from LabNConsulting/working/master/bgp-vpn-leak-new-label-new-route

bgpd: bugfix vpn-vrf leak: consider route changed if labels change

6 years agozebra: resolve assert when adding ip import-table entry
Don Slice [Sun, 15 Apr 2018 19:25:24 +0000 (12:25 -0700)]
zebra: resolve assert when adding ip import-table entry

Problem was due to in certain route replace circumstances,
we would mark the old route_entry as removed to delete it but
would leave the selected flag set.  When the rn was pulled off the
work queue for process, we would find both the new re and old re
(being deleted) with the selected flag set and would assert.
In this change, when we decide to delete the old re, we also  mark
it as no longer selected.

Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
6 years agozebra: rename pbr_unique structure to pbr_rule_unique
Philippe Guibert [Sat, 24 Mar 2018 13:58:04 +0000 (14:58 +0100)]
zebra: rename pbr_unique structure to pbr_rule_unique

This renaming of structure permits better identify which structure is
looked up, since policy routing will not only rely on iprule, but also
on some other structures.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agozebra: adapt zebra_pbr_rule based with pbr_rule
Philippe Guibert [Wed, 21 Mar 2018 10:59:02 +0000 (11:59 +0100)]
zebra: adapt zebra_pbr_rule based with pbr_rule

In order to avoid duplicates functions, the zebra_pbr_rule structure
used by zebra to decode the zapi message, and send netlink messages, is
slightly modified. the structure is derived from pbr_rule, but it also
includes sock identifier that is used to send back information to the
daemon that did the request. Also, the ifp pointer is stored in that
structure.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agolib: enhance pbr_rule structure for zapi encode and for common usage
Philippe Guibert [Wed, 21 Mar 2018 10:55:38 +0000 (11:55 +0100)]
lib: enhance pbr_rule structure for zapi encode and for common usage

The pbr_rule structure is derived from zebra_pbr_rule, and is
defined, so that a zclient will be able to encode the zebra_pbr_rule to
send ADD_RULE or DEL_RULE command. Also, the same structure can be used
by other daemons to derive a structure ( this will be the case for
zebra_pbr_rule).
Adding to this, an encoding function is defined, and will be used by
remote daemon to encode that message.
Those definitions are moved in new file pbr.h file.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agozebra: add a helper structure to look zebra_pbr_ipset per ipsetname
Philippe Guibert [Sat, 24 Mar 2018 13:55:06 +0000 (14:55 +0100)]
zebra: add a helper structure to look zebra_pbr_ipset per ipsetname

Add an intermediate helper structure that is used to walk the list of
ipset entries, and look for associated name.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agozebra: add IPTABLE_ADD and IPTABLE_DEL commands in zapi
Philippe Guibert [Mon, 12 Mar 2018 08:23:48 +0000 (09:23 +0100)]
zebra: add IPTABLE_ADD and IPTABLE_DEL commands in zapi

Those messages permit a remote daemon to configure an iptable entry. A
structure is defined that maps to an iptable entry. More specifically,
this structure proposes to associate fwmark, and a table ID.
Adding to the configuration, the initialisation of iptables hash list is
done into zebra netnamespace. Also a hook for notifying the sender that
the iptables has been correctly set is done.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agozebra: pbr rule structure is being added fwmark tag
Philippe Guibert [Thu, 8 Mar 2018 14:20:49 +0000 (15:20 +0100)]
zebra: pbr rule structure is being added fwmark tag

PBR rule is being added a 32 bit value that can be used to record a rule
in the kernel, by using a fwmark information.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agozebra: handling notifications upon ipset creation/destruction done
Philippe Guibert [Wed, 7 Mar 2018 14:46:00 +0000 (15:46 +0100)]
zebra: handling notifications upon ipset creation/destruction done

Once ipset entries are injected in the kernel, the relevant daemon is
informed with a zebra message sent back.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agolib: add ZEBRA IPSET defines
Philippe Guibert [Wed, 7 Mar 2018 12:21:14 +0000 (13:21 +0100)]
lib: add ZEBRA IPSET defines

ZEBRA IPSET defines are added for creating/deleting ipset contexts.
Ans also create ipset hash sets.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agozebra: handle entry pointfs for ipset creation/destruction
Philippe Guibert [Wed, 7 Mar 2018 11:54:16 +0000 (12:54 +0100)]
zebra: handle entry pointfs for ipset creation/destruction

IPset and IPset entries structures are introduced. Those entries reflect
the ipset structures and ipset hash sets that will be created on the
kernel.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agoMerge pull request #2053 from LabNConsulting/working/master/bvl-bug-degenerate-no...
Donald Sharp [Mon, 16 Apr 2018 12:00:23 +0000 (08:00 -0400)]
Merge pull request #2053 from LabNConsulting/working/master/bvl-bug-degenerate-no-label

bgpd: bugfix vpn->vrf leak: unicast-originated routes are local non-LSP

6 years agoMerge pull request #2055 from opensourcerouting/fix-pathspace
Donald Sharp [Mon, 16 Apr 2018 11:59:24 +0000 (07:59 -0400)]
Merge pull request #2055 from opensourcerouting/fix-pathspace

Fix pathspace option -N

6 years agoMerge pull request #1950 from pguibert6WIND/issue_1949
Donald Sharp [Mon, 16 Apr 2018 11:51:31 +0000 (07:51 -0400)]
Merge pull request #1950 from pguibert6WIND/issue_1949

 VRF NETNS / add an indirection table for mapping NSID/VRFID

6 years agoMerge pull request #2054 from qlyoung/sa-fixes
Renato Westphal [Sun, 15 Apr 2018 22:10:50 +0000 (19:10 -0300)]
Merge pull request #2054 from qlyoung/sa-fixes

Static analyzer fixes