]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
6 years agobgpd: Fix bgpd crash in evpn vni route-map
Chirag Shah [Wed, 13 Jun 2018 05:13:05 +0000 (22:13 -0700)]
bgpd: Fix bgpd crash in evpn vni route-map

When evpn configured wiht route-map with vni which is not
configured. Upon receiving evpn routes (i.e Type-2, Type-3),
route-map match will be triggered. Since there is no l2vni
exists in db, some of the member fields in bgp_info (i.e.
dummy_info_extra) are passed uninitialized to evpn filter match cb.
This results in inaccessible memory causes crash.

Fix is to memset the bgp_info prior to passing to evpn filter cb.
In evpn vni filter cb, ensure to have NULL check for member filed
of the bgp_info.

memset bgp_info at few places where it is passed to route_match.

Ticket:CM-21335
Reviewed By:
Testing Done:

Configure route-map with not configured l2vni
Simulate to learn l2vpn type-2, 3 route

Restart frr.service with below config
address-family l2vpn evpn
  neighbor fear route-map EVPN_VNI out

route-map EVPN_VNI deny 10
 match evpn vni 140010

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
6 years agoMerge pull request #2424 from pacovn/Coverity_1399270_Dereference_after_null_check
Donald Sharp [Wed, 13 Jun 2018 16:13:57 +0000 (12:13 -0400)]
Merge pull request #2424 from pacovn/Coverity_1399270_Dereference_after_null_check

bgpd: null check (Coverity 1399270)

6 years agobgpd: null check (Coverity 1399270)
paco [Wed, 13 Jun 2018 11:08:58 +0000 (13:08 +0200)]
bgpd: null check (Coverity 1399270)

Signed-off-by: F. Aragon <paco@voltanet.io>
6 years agoMerge pull request #2421 from pacovn/Coverity_1399232_Logically_dead_code
Donald Sharp [Wed, 13 Jun 2018 14:45:48 +0000 (10:45 -0400)]
Merge pull request #2421 from pacovn/Coverity_1399232_Logically_dead_code

ospfd: dead code (Coverity 1399232)

6 years agoospfd: dead code (Coverity 1399232)
paco [Wed, 13 Jun 2018 10:34:23 +0000 (12:34 +0200)]
ospfd: dead code (Coverity 1399232)

Signed-off-by: F. Aragon <paco@voltanet.io>
6 years agoMerge pull request #2420 from pacovn/Coverity_1399246_Logically_dead_code
Donald Sharp [Wed, 13 Jun 2018 12:08:45 +0000 (08:08 -0400)]
Merge pull request #2420 from pacovn/Coverity_1399246_Logically_dead_code

bgpd: dead code (Coverity 1399246)

6 years agobgpd: dead code (Coverity 1399246)
paco [Wed, 13 Jun 2018 10:25:45 +0000 (12:25 +0200)]
bgpd: dead code (Coverity 1399246)

Signed-off-by: F. Aragon <paco@voltanet.io>
6 years agoMerge pull request #2414 from donaldsharp/bsd_failure
Rafael Zalamena [Tue, 12 Jun 2018 20:51:03 +0000 (17:51 -0300)]
Merge pull request #2414 from donaldsharp/bsd_failure

zebra: Fix compilation of bsd

6 years agoMerge pull request #2412 from opensourcerouting/lintian-warn-fix
Quentin Young [Tue, 12 Jun 2018 20:22:38 +0000 (16:22 -0400)]
Merge pull request #2412 from opensourcerouting/lintian-warn-fix

debianpkg: Add additional lintian override for Ubuntu 18.04

6 years agoMerge pull request #2407 from donaldsharp/bgp_spelunk
Rafael Zalamena [Tue, 12 Jun 2018 20:11:15 +0000 (17:11 -0300)]
Merge pull request #2407 from donaldsharp/bgp_spelunk

Bgp crash fix for topotests

6 years agoMerge pull request #2411 from qlyoung/fix-vtysh-config-write
Rafael Zalamena [Tue, 12 Jun 2018 19:59:35 +0000 (16:59 -0300)]
Merge pull request #2411 from qlyoung/fix-vtysh-config-write

vtysh: fix config write

6 years agozebra: Fix compilation of bsd
Donald Sharp [Tue, 12 Jun 2018 19:50:39 +0000 (15:50 -0400)]
zebra: Fix compilation of bsd

Actually return a value.

Fixes: #2413
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agobgpd: Ensure that bgp_delete bgp pointer is non-null
Donald Sharp [Tue, 12 Jun 2018 19:10:01 +0000 (15:10 -0400)]
bgpd: Ensure that bgp_delete bgp pointer is non-null

Crash w/ an assert if someone calls bgp_delete with a
NULL parameter as opposed to crashing when we dereference
the pointer a bit later.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agobgpd: bgp_default may be null
Donald Sharp [Wed, 23 May 2018 18:54:30 +0000 (14:54 -0400)]
bgpd: bgp_default may be null

The bgp_default variable when saved to the side might actually
be NULL.

Ticket: CM-21119
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agobgpd: Fix crash when shutdown
Donald Sharp [Tue, 22 May 2018 00:13:27 +0000 (20:13 -0400)]
bgpd: Fix crash when shutdown

The process of BGP shutdown hard free's memory irrelevant to
the fact that another process may be using that memory still
in route leaking scenario's.

As a temporary fix find the default instance and free it
last.

Ticket: CM-21068
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agobgpd: Move extra free code and fix a bug.
Donald Sharp [Tue, 12 Jun 2018 14:38:37 +0000 (10:38 -0400)]
bgpd: Move extra free code and fix a bug.

The bgp_info_extra_free code was the correct place to free
up data associated with the bgp_info pointer when we are
deleting the bgp_info node.

Additionally, if we have a parent pointer, we may not have a net
pointer.  So make sure we do.

Finally clean up the bgp_info_extra_free code so it is a bit
easier to read.  Use variables instead of multiple level
of casting.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agodebianpkg: Add additional lintian override for Ubuntu 18.04
Martin Winter [Tue, 12 Jun 2018 19:06:00 +0000 (12:06 -0700)]
debianpkg: Add additional lintian override for Ubuntu 18.04

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
6 years agovtysh: fix config write
Quentin Young [Tue, 12 Jun 2018 18:14:52 +0000 (18:14 +0000)]
vtysh: fix config write

Changing vtysh to use vty_out() for everything broke writing to config
files.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agoMerge pull request #2402 from qlyoung/germx-hand-sanitizer-kills-99-percent-of-germs
Jafar Al-Gharaibeh [Tue, 12 Jun 2018 16:11:55 +0000 (11:11 -0500)]
Merge pull request #2402 from qlyoung/germx-hand-sanitizer-kills-99-percent-of-germs

*: disable all sanitizers for clippy build

6 years agoMerge pull request #2379 from qlyoung/docuser
Jafar Al-Gharaibeh [Tue, 12 Jun 2018 16:04:26 +0000 (11:04 -0500)]
Merge pull request #2379 from qlyoung/docuser

Improve introductory user docs

6 years agoMerge pull request #2384 from qlyoung/docs-bgp-update
Jafar Al-Gharaibeh [Tue, 12 Jun 2018 15:57:36 +0000 (10:57 -0500)]
Merge pull request #2384 from qlyoung/docs-bgp-update

doc: massive cleanup of bgp.rst

6 years agoMerge pull request #2392 from chiragshah6/evpn_dev
Lou Berger [Tue, 12 Jun 2018 15:50:43 +0000 (11:50 -0400)]
Merge pull request #2392 from chiragshah6/evpn_dev

bgpd: accept vni rd_rt command for default vrf only

6 years agoMerge pull request #2399 from pacovn/Coverity_1469894_Dereference_null_return_value
Donald Sharp [Tue, 12 Jun 2018 15:50:18 +0000 (11:50 -0400)]
Merge pull request #2399 from pacovn/Coverity_1469894_Dereference_null_return_value

lib: null return value check (Coverity 1469894)

6 years agoMerge pull request #2404 from pacovn/Coverity_1455338_Dereference_null_return_value
Donald Sharp [Tue, 12 Jun 2018 14:47:48 +0000 (10:47 -0400)]
Merge pull request #2404 from pacovn/Coverity_1455338_Dereference_null_return_value

eigrpd: null return value check (Coverity 1455338)

6 years agoMerge pull request #2406 from pacovn/Coverity_1465495_Out-of-bounds_read
Rafael Zalamena [Tue, 12 Jun 2018 14:45:11 +0000 (11:45 -0300)]
Merge pull request #2406 from pacovn/Coverity_1465495_Out-of-bounds_read

zebra: Out-of-bounds read (Coverity 1465495)

6 years agolib: null return value check (Coverity 1469894)
paco [Mon, 11 Jun 2018 18:14:59 +0000 (20:14 +0200)]
lib: null return value check (Coverity 1469894)

Signed-off-by: F. Aragon <paco@voltanet.io>
6 years agoMerge pull request #2405 from pacovn/Coverity_1399236_Logically_dead_code
Donald Sharp [Tue, 12 Jun 2018 13:59:37 +0000 (09:59 -0400)]
Merge pull request #2405 from pacovn/Coverity_1399236_Logically_dead_code

ospfd: logically dead code (Coverity 1399236)

6 years agoeigrpd: null return value check (Coverity 1455338)
paco [Tue, 12 Jun 2018 12:31:14 +0000 (14:31 +0200)]
eigrpd: null return value check (Coverity 1455338)

Signed-off-by: F. Aragon <paco@voltanet.io>
6 years agozebra: Out-of-bounds read (Coverity 1465495)
paco [Tue, 12 Jun 2018 13:27:44 +0000 (15:27 +0200)]
zebra: Out-of-bounds read (Coverity 1465495)

Signed-off-by: F. Aragon <paco@voltanet.io>
6 years agoospfd: logically dead code (Coverity 1399236)
paco [Tue, 12 Jun 2018 12:41:19 +0000 (14:41 +0200)]
ospfd: logically dead code (Coverity 1399236)

Signed-off-by: F. Aragon <paco@voltanet.io>
6 years agoMerge pull request #2397 from pacovn/Coverity_1469896_Dereference_after_null_check
Quentin Young [Mon, 11 Jun 2018 20:30:49 +0000 (16:30 -0400)]
Merge pull request #2397 from pacovn/Coverity_1469896_Dereference_after_null_check

vtysh: null dereference (Coverity 1469896)

6 years agoMerge pull request #2398 from pacovn/Coverity_1469895_Dereference_after_null_check
Quentin Young [Mon, 11 Jun 2018 20:27:42 +0000 (16:27 -0400)]
Merge pull request #2398 from pacovn/Coverity_1469895_Dereference_after_null_check

lib: null dereference (Coverity 1469895)

6 years agoMerge pull request #2396 from pacovn/Coverity_1469897_1469893_Out-of-bounds_access
Quentin Young [Mon, 11 Jun 2018 19:48:10 +0000 (15:48 -0400)]
Merge pull request #2396 from pacovn/Coverity_1469897_1469893_Out-of-bounds_access

bgpd: OoB access (Coverity 14698971469893)

6 years agolib: null dereference (Coverity 1469895)
paco [Mon, 11 Jun 2018 18:02:58 +0000 (20:02 +0200)]
lib: null dereference (Coverity 1469895)

Signed-off-by: F. Aragon <paco@voltanet.io>
6 years agovtysh: null dereference (Coverity 1469896)
paco [Mon, 11 Jun 2018 17:42:03 +0000 (19:42 +0200)]
vtysh: null dereference (Coverity 1469896)

Signed-off-by: F. Aragon <paco@voltanet.io>
6 years agobgpd: OoB access (Coverity 1469897, 1469893)
paco [Mon, 11 Jun 2018 17:07:13 +0000 (19:07 +0200)]
bgpd: OoB access (Coverity 14698971469893)

Signed-off-by: F. Aragon <paco@voltanet.io>
6 years agobgpd: accept vni rd_rt command for default vrf
Chirag Shah [Sat, 2 Jun 2018 00:52:14 +0000 (17:52 -0700)]
bgpd: accept vni rd_rt command for default vrf

L2VNI route-distinguisher and route-target configuartions
should only applied under DEFAULT VRF bgpd instance.

Add newline to each vni display.

router bgp 65006
  address-family l2vpn evpn
    vni 1000101
      route-target import 1:1000101

do not allow under
router bgp 65006 vrf RED

Ticket:CM-20204
Reviewed By:
Testing Done:

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
6 years agoMerge pull request #2390 from pacovn/Coverity_1221459_Use_after_free
Donald Sharp [Fri, 8 Jun 2018 18:57:02 +0000 (14:57 -0400)]
Merge pull request #2390 from pacovn/Coverity_1221459_Use_after_free

spf6d: fix use after free (Coverity 1221459)

6 years agoMerge pull request #2389 from pacovn/Coverity_1455482_Incorrect_sizeof_expression
Donald Sharp [Fri, 8 Jun 2018 18:36:42 +0000 (14:36 -0400)]
Merge pull request #2389 from pacovn/Coverity_1455482_Incorrect_sizeof_expression

lib: fix sizeof expression (Coverity 1455482)

6 years agoMerge pull request #2388 from pacovn/Coverity_1453454_Resource_leak
Donald Sharp [Fri, 8 Jun 2018 18:20:28 +0000 (14:20 -0400)]
Merge pull request #2388 from pacovn/Coverity_1453454_Resource_leak

zebra: resource leak fix (Coverity 1453454)

6 years agoMerge pull request #2387 from pacovn/Coverity_1465679_Resource_leak
Donald Sharp [Fri, 8 Jun 2018 18:14:57 +0000 (14:14 -0400)]
Merge pull request #2387 from pacovn/Coverity_1465679_Resource_leak

zebra: resource leak fix (Coverity 1465679)

6 years agoMerge pull request #2386 from gromit1811/pim-connected-nexthop-fix2
Donald Sharp [Fri, 8 Jun 2018 17:50:48 +0000 (13:50 -0400)]
Merge pull request #2386 from gromit1811/pim-connected-nexthop-fix2

pimd: Fix connected route nexthop fix from 66f5152f

6 years agospf6d: fix use after free (Coverity 1221459)
paco [Fri, 8 Jun 2018 17:46:48 +0000 (19:46 +0200)]
spf6d: fix use after free (Coverity 1221459)

Signed-off-by: F. Aragon <paco@voltanet.io>
6 years agolib: fix sizeof expression (Coverity 1455482)
paco [Fri, 8 Jun 2018 17:30:32 +0000 (19:30 +0200)]
lib: fix sizeof expression (Coverity 1455482)

Signed-off-by: F. Aragon <paco@voltanet.io>
6 years ago*: disable all sanitizers for clippy build
Quentin Young [Fri, 8 Jun 2018 16:39:31 +0000 (16:39 +0000)]
*: disable all sanitizers for clippy build

* Move configure flag propagations out of user flags
* Use AC_SUBST to transfer flag values to Automake
* Set default AM_CFLAGS and AM_CPPFLAGS in common.am and change child
  Makefiles to modify these base variables
* Add flag override to turn off all sanitizers when building clippy
* Remove LSAN suppressions blacklist as it's no longer needed

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agozebra: resource leak fix (Coverity 1453454)
paco [Fri, 8 Jun 2018 17:18:49 +0000 (19:18 +0200)]
zebra: resource leak fix (Coverity 1453454)

Signed-off-by: F. Aragon <paco@voltanet.io>
6 years agozebra: resource leak fix (Coverity 1465679)
paco [Fri, 8 Jun 2018 16:49:36 +0000 (18:49 +0200)]
zebra: resource leak fix (Coverity 1465679)

Signed-off-by: F. Aragon <paco@voltanet.io>
6 years agopimd: Fix connected route nexthop fix from 66f5152f
Martin Buck [Fri, 8 Jun 2018 16:26:39 +0000 (18:26 +0200)]
pimd: Fix connected route nexthop fix from 66f5152f

Fix a couple of problems in my 1st fix for PIM nexthops reachable via a
connected route:

Use NEXTHOP_TYPE_IPV4_IFINDEX instead of NEXTHOP_TYPE_IPV4 since we add an
IPv4 address to an already known ifindex.

Assign nexthop_tab[num_ifindex].protocol_distance and .route_metric before
incrementing num_ifindex.

Revert the default: to individual switch case statement conversion in
zclient_read_nexthop() as requested by donaldsharp in #2347

Signed-off-by: Martin Buck <mb-tmp-tvguho.pbz@gromit.dyndns.org>
6 years agoMerge pull request #2298 from qlyoung/pipe-actions-vtysh
Russ White [Fri, 8 Jun 2018 11:39:36 +0000 (07:39 -0400)]
Merge pull request #2298 from qlyoung/pipe-actions-vtysh

*: add support for `|` actions

6 years agoMerge pull request #2347 from gromit1811/pim-connected-nexthop-fix
Russ White [Fri, 8 Jun 2018 11:12:26 +0000 (07:12 -0400)]
Merge pull request #2347 from gromit1811/pim-connected-nexthop-fix

pimd: Fix nexthop determination when sending towards RP

6 years agoMerge pull request #2377 from ajones-rvbd/ajones-issue-2375
Russ White [Fri, 8 Jun 2018 11:07:25 +0000 (07:07 -0400)]
Merge pull request #2377 from ajones-rvbd/ajones-issue-2375

tests/isisd: bypass test_fuzz_isis_tlv when inet_ntop is broken

6 years agoMerge pull request #2380 from donaldsharp/pim_stuff
Russ White [Fri, 8 Jun 2018 11:06:19 +0000 (07:06 -0400)]
Merge pull request #2380 from donaldsharp/pim_stuff

pimd: Fix ecmp_enable and ecmp_rebalance_enable

6 years agoMerge pull request #2383 from donaldsharp/bgp_lunicast
Russ White [Fri, 8 Jun 2018 11:04:46 +0000 (07:04 -0400)]
Merge pull request #2383 from donaldsharp/bgp_lunicast

bgpd: Actually display labeled unicast routes received

6 years agoMerge pull request #2385 from donaldsharp/SA_SA_SA
Russ White [Fri, 8 Jun 2018 10:57:30 +0000 (06:57 -0400)]
Merge pull request #2385 from donaldsharp/SA_SA_SA

Some small clang 6.0 cleanups

6 years agoMerge pull request #2292 from donaldsharp/fixup_sb_stuff
Russ White [Fri, 8 Jun 2018 10:52:01 +0000 (06:52 -0400)]
Merge pull request #2292 from donaldsharp/fixup_sb_stuff

Fixup sb stuff

6 years agoMerge pull request #2123 from qlyoung/zserv-mt
Russ White [Fri, 8 Jun 2018 10:47:14 +0000 (06:47 -0400)]
Merge pull request #2123 from qlyoung/zserv-mt

Multithreaded Zserv

6 years agoMerge pull request #2349 from donaldsharp/aggregate_stuff
Russ White [Fri, 8 Jun 2018 10:42:24 +0000 (06:42 -0400)]
Merge pull request #2349 from donaldsharp/aggregate_stuff

Aggregate stuff

6 years agodoc: cleanup community list docs more
Quentin Young [Fri, 8 Jun 2018 09:39:27 +0000 (09:39 +0000)]
doc: cleanup community list docs more

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agodoc: move find command docs to better spot
Quentin Young [Fri, 8 Jun 2018 07:55:55 +0000 (07:55 +0000)]
doc: move find command docs to better spot

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agodoc: remove :caption: from toctree
Quentin Young [Thu, 7 Jun 2018 16:41:18 +0000 (16:41 +0000)]
doc: remove :caption: from toctree

Older versions of Sphinx don't support toctree captions, so we can't use
them yet unfortunately.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agodoc: update EXTRA_DIST
Quentin Young [Wed, 6 Jun 2018 23:20:58 +0000 (23:20 +0000)]
doc: update EXTRA_DIST

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agodoc: clean up introductory user docs
Quentin Young [Wed, 6 Jun 2018 21:53:09 +0000 (21:53 +0000)]
doc: clean up introductory user docs

* Update the list of protocol daemons from 5 to the current 13
* Rewrap and clean up formatting for lots of miscellaneous code blocks
* Improve English in various spots
* Update architecture description and diagram
* Remove duplicate information on reporting bugs

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agodoc: reorganize into multiple toctrees
Quentin Young [Wed, 6 Jun 2018 20:17:59 +0000 (20:17 +0000)]
doc: reorganize into multiple toctrees

Use multiple toctrees to reorganize the user docs into logical sections.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agobgpd, lib, ospf6d, vtysh: fix possible snprintf possible truncation
Donald Sharp [Thu, 7 Jun 2018 23:51:13 +0000 (19:51 -0400)]
bgpd, lib, ospf6d, vtysh: fix possible snprintf possible truncation

With a new version of clang 6.0, the compiler is detecting more
issues where we may be possibly be truncating the output string.
Fix by increasing the size of the output string to make the compiler
happy.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agovtysh, zebra: Fix function parameters
Donald Sharp [Thu, 7 Jun 2018 23:49:17 +0000 (19:49 -0400)]
vtysh, zebra: Fix function parameters

New version of clang are detecting function parameters that we should
not be casting as such.  Fix these issues.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agodoc: massive cleanup of bgp.rst
Quentin Young [Thu, 7 Jun 2018 22:35:52 +0000 (22:35 +0000)]
doc: massive cleanup of bgp.rst

This doc needed (and still needs) a lot of love.

* Reorganize doc into logical sections
* Clean up lots of grammatical mistakes and misspellings
* Clean up lots of bad formatting
* Remove non-existent configuration options and commands
* Mark deprecated configuration options as deprecated
* Fix all cross-references to follow a standard format
* Fix capitalization on section and subsection titles
* Fix section and subsection level underlines

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agobgpd: Actually display labeled unicast routes received
Donald Sharp [Thu, 7 Jun 2018 21:10:38 +0000 (17:10 -0400)]
bgpd: Actually display labeled unicast routes received

The labeled unicast and unicast tables have been combined
into the unicast table.  Additionally we have a restriction
where if you configure labeled unicast you cannot configure
unicast.  This created a bug with 'show bgp ipv4 labeled-unicast summ'
command where we were displaying NoNeg, because v4 has been intentionally
turned off.

Modify the code so that when we are looking up if we have negotiated
a capapbility we use the correct one, while still using the appropriate
table for prefix count.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agoMerge pull request #2382 from opensourcerouting/remove_preprocessor_check
Donald Sharp [Thu, 7 Jun 2018 19:49:12 +0000 (15:49 -0400)]
Merge pull request #2382 from opensourcerouting/remove_preprocessor_check

zebra: remove unnecessary preprocessor check

6 years agozebra: remove unnecessary preprocessor check
Renato Westphal [Thu, 7 Jun 2018 18:45:33 +0000 (15:45 -0300)]
zebra: remove unnecessary preprocessor check

The IFLA_INFO_SLAVE_KIND constant is always defined now that we imported
our own copies of the Linux kernel headers. Remove the preprocessor
checks since they aren't necessary anymore.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
6 years agopimd: Fix ecmp_enable and ecmp_rebalance_enable
Donald Sharp [Thu, 7 Jun 2018 14:23:32 +0000 (10:23 -0400)]
pimd: Fix ecmp_enable and ecmp_rebalance_enable

These commands were being accepted in all vrf's and
affecting all vrf's behavior globally, since they were
global variables.

Modify the code to make these two commands work
on a per-vrf basis.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agoMerge pull request #2335 from donaldsharp/bgp_memory_hooliganism
Lou Berger [Thu, 7 Jun 2018 10:05:38 +0000 (06:05 -0400)]
Merge pull request #2335 from donaldsharp/bgp_memory_hooliganism

Bgp memory leaks and crashes?

6 years agoMerge pull request #2345 from pguibert6WIND/issue_2328
Quentin Young [Wed, 6 Jun 2018 23:21:49 +0000 (19:21 -0400)]
Merge pull request #2345 from pguibert6WIND/issue_2328

lib: make netns command visible under vtysh

6 years agodoc: add docs on | actions, find command
Quentin Young [Wed, 6 Jun 2018 19:51:34 +0000 (19:51 +0000)]
doc: add docs on | actions, find command

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agolib: fix output mangling with | include
Quentin Young [Wed, 6 Jun 2018 19:09:44 +0000 (19:09 +0000)]
lib: fix output mangling with | include

Sometimes output would be mangled when filtering with include as a
result of the following bugs:

* Filters were applied per each call to vty_out() instead of buffering
  until a line break and then applying
* Long output would sometimes be cut due to using the wrong buffer
  pointer

Also remove the trailing \n as it should no longer be necessary to
ensure the vty prompt ends up on a new line.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agobgpd: Collapse bgp_aggregate_add into bgp_aggregate_route
Donald Sharp [Wed, 6 Jun 2018 17:33:19 +0000 (13:33 -0400)]
bgpd: Collapse bgp_aggregate_add into bgp_aggregate_route

These two functions are functionally the same, except
bgp_aggregate_route is meant to handle the addition and
deletion of routes, while aggregate_add is meant for all of them.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agobgpd: Allow bgp to know when to actually add/delete agg route
Donald Sharp [Wed, 6 Jun 2018 17:13:00 +0000 (13:13 -0400)]
bgpd: Allow bgp to know when to actually add/delete agg route

The aggregated route was being sent in updates to peers every
time a route changed that we were aggregating.  Modify
the code such that we only send aggregated route updates
if we actually have something different to tell the peer.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agobgpd: Move bgp_aggregate_delete to a better location
Donald Sharp [Wed, 6 Jun 2018 16:46:14 +0000 (12:46 -0400)]
bgpd: Move bgp_aggregate_delete to a better location

The function bgp_aggregate_delete function was forward
declared and not static.  Move it so we can clean that
up.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agobgpd: Seperate out install/removal of aggregate from delete function
Donald Sharp [Wed, 6 Jun 2018 16:31:17 +0000 (12:31 -0400)]
bgpd: Seperate out install/removal of aggregate from delete function

This is a transitional commit, to get us where we want to go.
Seperate out the install/removal of the aggregate route from
the bgp_aggregate_delete and bgp_aggregate_route functions.

In the future we'll write a bit of code to determine if the
aggregate add has actually changed any information we care
about.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agolib: initialize vty->of
Quentin Young [Fri, 1 Jun 2018 20:13:18 +0000 (20:13 +0000)]
lib: initialize vty->of

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agolib: add vector_compact(), use after str splits
Quentin Young [Tue, 29 May 2018 21:38:18 +0000 (21:38 +0000)]
lib: add vector_compact(), use after str splits

* Add function to move all data to the start of a vector by shifting
  over contiguous empty slots
* Use this function to remove empty slots leftover after
  frrstr_filter_vec

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agolib: fix static analysis issues, use regfree()
Quentin Young [Tue, 29 May 2018 17:13:51 +0000 (17:13 +0000)]
lib: fix static analysis issues, use regfree()

* Fix potential NULL dereference
* Fix use of uninitialized value
* Fix leaking memory by not freeing regex_t
* Fix extra \n when using empty regex filter
* Clean up still-reachable hook memory
* Handle nonexistent pager

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agolib: add vector_remove() to vector.[ch]
Quentin Young [Fri, 25 May 2018 22:49:53 +0000 (22:49 +0000)]
lib: add vector_remove() to vector.[ch]

An optimized version of this has already been implemented within graph.c
that assumes some specialized constraints for that code. It's generally
useful so this change implements a general purpose version of it.

This fixes cmd_make_strvec() that was broken by some code shuffling in
previous commits.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years ago*: style for | support
Quentin Young [Fri, 25 May 2018 20:31:07 +0000 (20:31 +0000)]
*: style for | support

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agovtysh: add | support
Quentin Young [Mon, 14 May 2018 22:13:03 +0000 (18:13 -0400)]
vtysh: add | support

* Rewrite pager implementation
* Replace fprintf() with vty_out()
* Modify vty_out() for better vtysh support
* Remove static global outputfile var
* Remove fp argument from many vtysh functions
* Add some docs for stuff along the way

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agolib: add cli preprocessor for `|` actions
Quentin Young [Sun, 13 May 2018 00:14:22 +0000 (20:14 -0400)]
lib: add cli preprocessor for `|` actions

This patch adds a CLI preprocessor function that activates when `|` is
found in the command. This is the start of adding support for some text
processing utilities intended for inline use. The first one implemented
here is `| include`, which provides grep-like filtering of command
output.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agolib: add hook for preprocessing commands
Quentin Young [Sun, 13 May 2018 00:09:08 +0000 (20:09 -0400)]
lib: add hook for preprocessing commands

This patch adds a hook point intended to allow subscribers to modify the
raw text of a CLI command before it is passed to the rest of the CLI
pipeline. To give access to the raw text of the command, a new function
for executing CLI has been defined whose only difference from
`cmd_execute_command` is that it accepts the command to execute as a
string rather than as a string vector.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agolib: add string utilities
Quentin Young [Fri, 11 May 2018 19:32:06 +0000 (15:32 -0400)]
lib: add string utilities

I see lots of the same code being copy-pasted and slightly tweaked for
string processing all over the codebase. Time to start aggregating these
pieces into something consistent and correct.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agotests/isisd: bypass test_fuzz_isis_tlv when inet_ntop is broken
Arthur Jones [Wed, 6 Jun 2018 14:47:17 +0000 (07:47 -0700)]
tests/isisd: bypass test_fuzz_isis_tlv when inet_ntop is broken

On Alpine Linux edge, musl does not seem to be RFC 5952 4.2.2
compliant (how to print a single :0: in the IPv6 address).  Let's
skip that test, as we get false negatives when running against
that version of musl.

Credit for the idea for the fix and how to fix it is due to
chris@opensourcerouting.org.

Testing done:

make check on alpine linux passes now

Issue: https://github.com/FRRouting/frr/issues/2375
Signed-off-by: Arthur Jones <arthur.jones@riverbed.com>
6 years agoMerge pull request #2376 from mjstapp/doc_link
Quentin Young [Tue, 5 Jun 2018 21:30:07 +0000 (17:30 -0400)]
Merge pull request #2376 from mjstapp/doc_link

doc: fix broken link to 'code formatting' section

6 years agodoc: fix broken link to 'code formatting' section
Mark Stapp [Tue, 5 Jun 2018 19:32:07 +0000 (15:32 -0400)]
doc: fix broken link to 'code formatting' section

Mismatch in rst source was producing a dead link in the html output

Signed-off-by: Mark Stapp <mjs@voltanet.io>
6 years agobgpd: Dissallow useless aggregation commands from the cli
Donald Sharp [Tue, 5 Jun 2018 17:22:11 +0000 (13:22 -0400)]
bgpd: Dissallow useless aggregation commands from the cli

We were allowing useless aggregation commands (/32 and /128).
These were being silently accepted and nvgenned and then
just ignored.

When a user enters a value that should be rejected tell
them and reject.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agobgpd: first variable is set but never used.
Donald Sharp [Tue, 5 Jun 2018 16:56:46 +0000 (12:56 -0400)]
bgpd: first variable is set but never used.

For the bgp_aggregate_route function it is
set but never used.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agobgpd: rework bgp_aggregate_route
Donald Sharp [Fri, 1 Jun 2018 18:33:28 +0000 (14:33 -0400)]
bgpd: rework bgp_aggregate_route

Make bgp_aggregate_route easier to read.  It was indented so many
levels that it was extremely hard to figure out what it was doing.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agobgpd: Remove AGGREGATE_NEXTHOP_CHECK as it's been unused
Donald Sharp [Fri, 1 Jun 2018 18:23:44 +0000 (14:23 -0400)]
bgpd: Remove AGGREGATE_NEXTHOP_CHECK as it's been unused

The #define AGGREGATE_NEXTHOP_CHECK has not been used
for a very very long time.  Since this is effectively
dead code, let's remove it.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agobgpd: Trust the bgp_table_top_nolock for aggregates
Donald Sharp [Fri, 1 Jun 2018 18:19:12 +0000 (14:19 -0400)]
bgpd: Trust the bgp_table_top_nolock for aggregates

The safi passed in to short-circuit the aggregate lookup
adds code complexity and little speed improvements for
the case where we actually may have aggregates configured!
Since bgp_table_top_nolock() actually tells us if there
are any aggregates installed and safely returns if there
is nothing to do, trust it.  As that we know for those
safi's were we don't want to have, we dissallow the
creation via the cli anyways.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agobgpd: Cleanup bgp_aggregate_set/unset to not worry about safi so much
Donald Sharp [Fri, 1 Jun 2018 18:13:58 +0000 (14:13 -0400)]
bgpd: Cleanup bgp_aggregate_set/unset to not worry about safi so much

The bgp_aggregate_set/unset functions are only called from the cli
invocations which control what AFI/SAFI we are looking at.  Tests
for safi are unimportant.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agoMerge pull request #2367 from qlyoung/docuser
Lou Berger [Tue, 5 Jun 2018 16:09:41 +0000 (12:09 -0400)]
Merge pull request #2367 from qlyoung/docuser

doc: document 'show cli graph'

6 years agoMerge pull request #2351 from donaldsharp/bgp_deprecation
Lou Berger [Tue, 5 Jun 2018 16:05:39 +0000 (12:05 -0400)]
Merge pull request #2351 from donaldsharp/bgp_deprecation

Bgp deprecation

6 years agoMerge pull request #2344 from pguibert6WIND/bgp_vrf_usecase
Lou Berger [Tue, 5 Jun 2018 16:02:45 +0000 (12:02 -0400)]
Merge pull request #2344 from pguibert6WIND/bgp_vrf_usecase

doc: add BGP VRF use case

6 years agoMerge pull request #2304 from ppmathis/enhancement/bgp-pg-overrides
Quentin Young [Tue, 5 Jun 2018 15:51:57 +0000 (11:51 -0400)]
Merge pull request #2304 from ppmathis/enhancement/bgp-pg-overrides

bgpd: Add proper support for overriding peer-group AF-flags/filters