]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
6 years agodoc: Add some documentation for cli logging
Donald Sharp [Fri, 15 Jun 2018 17:43:13 +0000 (13:43 -0400)]
doc: Add some documentation for cli logging

Add some basic documentation for the new cli added to all daemons.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agolib: Add new cli to specify where to output logs on startup
Donald Sharp [Fri, 15 Jun 2018 17:38:46 +0000 (13:38 -0400)]
lib: Add new cli to specify where to output logs on startup

When we are starting a daemon, allow the user to specify:

--log <stdout|syslog|file:file_name>

This can be used on early startup to put the log files
where the end user wants them to show up.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agovtysh: Fix 'no log syslog ..' to be correct
Donald Sharp [Fri, 15 Jun 2018 16:34:31 +0000 (12:34 -0400)]
vtysh: Fix 'no log syslog ..' to be correct

The vtysh version of `no log syslog...` was out
of sync with what is actually correct.  Fix.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agoldpd: Schedule application of config till after read-in
Donald Sharp [Fri, 15 Jun 2018 02:33:59 +0000 (22:33 -0400)]
ldpd: Schedule application of config till after read-in

With commit e94b38d94b5 we are now scheduling the read
of vty config until after the startup of main thread
processing.  It now becomes necessary to move the
application of the config until after the read
in of the config from a file if we are using a
non-integrated config.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agolib: Create a thread for reading in the cli
Donald Sharp [Tue, 8 May 2018 12:35:06 +0000 (08:35 -0400)]
lib: Create a thread for reading in the cli

The read in of cli was happening prior to thread
event handling for non-integrated configs.  This
is interesting for 2 reasons:

1) Read-in of integrated configs was after thread
event loop startup, so we had a difference of behavior

2) Read-in can cause a series of events that cause
us to attempt to communicate with zebra.  The zebra
zapi connection only happens after the thread event
loop has been started.  This can cause data that
is being written down to zebra to be lost and
no real way to notice that this has happened and
to recover gracefully.

Modify the code to create a thread event for read
in of client config.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agolib: Add ability to retry if backup is specified
Donald Sharp [Tue, 8 May 2018 01:01:15 +0000 (21:01 -0400)]
lib: Add ability to retry if backup is specified

If we fail to read in the config file and we have
specified a backup of the backup, attempt to
read that information.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agolib: Add ability to know if we have read anything in
Donald Sharp [Tue, 8 May 2018 00:02:39 +0000 (20:02 -0400)]
lib: Add ability to know if we have read anything in

When reading the config file add an ability to know
if we have properly read in anything.  So that a daemon
can make fallback plans.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agoMerge pull request #2445 from ppmathis/feature/bgp-pg-overrides
Russ White [Tue, 19 Jun 2018 12:20:31 +0000 (08:20 -0400)]
Merge pull request #2445 from ppmathis/feature/bgp-pg-overrides

bgpd: Improve peer-group override implementation

6 years agoMerge pull request #2450 from ppmathis/bugfix/bgp-filtered-routes
Russ White [Tue, 19 Jun 2018 11:37:42 +0000 (07:37 -0400)]
Merge pull request #2450 from ppmathis/bugfix/bgp-filtered-routes

bgpd: Fix crash when showing filtered routes

6 years agoMerge pull request #2465 from qlyoung/fix-build-am-cppflags-warning
Russ White [Tue, 19 Jun 2018 11:31:43 +0000 (07:31 -0400)]
Merge pull request #2465 from qlyoung/fix-build-am-cppflags-warning

tests: fixup minor autotools nit

6 years agoMerge pull request #2468 from qlyoung/docuser
Russ White [Tue, 19 Jun 2018 11:31:10 +0000 (07:31 -0400)]
Merge pull request #2468 from qlyoung/docuser

doc: update workflow.rst

6 years agoMerge pull request #2470 from chiragshah6/mdev
Russ White [Tue, 19 Jun 2018 11:29:13 +0000 (07:29 -0400)]
Merge pull request #2470 from chiragshah6/mdev

zebra: Hide default vrf instance of l3vni cmd

6 years agoMerge pull request #2474 from donaldsharp/vty_thread_cancel_writes
Russ White [Tue, 19 Jun 2018 11:28:18 +0000 (07:28 -0400)]
Merge pull request #2474 from donaldsharp/vty_thread_cancel_writes

Add 'show thread poll'

6 years agoMerge pull request #2478 from pacovn/Coverity_1408766_Dereference_after_null_check
Russ White [Tue, 19 Jun 2018 11:21:42 +0000 (07:21 -0400)]
Merge pull request #2478 from pacovn/Coverity_1408766_Dereference_after_null_check

bgpd: null check (Coverity 1408766)

6 years agoMerge pull request #2479 from dslicenc/zebra-vrf-statics
Russ White [Tue, 19 Jun 2018 11:19:39 +0000 (07:19 -0400)]
Merge pull request #2479 from dslicenc/zebra-vrf-statics

zebra: re-install static routes needed vrf when the vrf intf comes up

6 years agoMerge pull request #2481 from pacovn/security_vpn_null_check
Russ White [Tue, 19 Jun 2018 11:19:00 +0000 (07:19 -0400)]
Merge pull request #2481 from pacovn/security_vpn_null_check

bgpd: vpn null check

6 years agoMerge pull request #2483 from pacovn/clang_scan_bgpd_updgrp_deref
Russ White [Tue, 19 Jun 2018 11:18:13 +0000 (07:18 -0400)]
Merge pull request #2483 from pacovn/clang_scan_bgpd_updgrp_deref

bgpd: null check (Clang scan-build)

6 years agoMerge pull request #2491 from pacovn/cppcheck_no_effect
Russ White [Tue, 19 Jun 2018 11:15:07 +0000 (07:15 -0400)]
Merge pull request #2491 from pacovn/cppcheck_no_effect

eigrpd, isisd, lib, ospfd: no effect (cppcheck)

6 years agoMerge pull request #2492 from pacovn/cppcheck_security1
Russ White [Tue, 19 Jun 2018 11:14:19 +0000 (07:14 -0400)]
Merge pull request #2492 from pacovn/cppcheck_security1

eigrpd, lib, tests, vtysh: security (cppcheck)

6 years agoeigrpd, lib, tests, vtysh: security (cppcheck)
paco [Tue, 19 Jun 2018 08:40:56 +0000 (10:40 +0200)]
eigrpd, lib, tests, vtysh: security (cppcheck)

Signed-off-by: F. Aragon <paco@voltanet.io>
6 years agoeigrpd, isisd, lib, ospfd: no effect (cppcheck)
paco [Tue, 19 Jun 2018 08:17:03 +0000 (10:17 +0200)]
eigrpd, isisd, lib, ospfd: no effect (cppcheck)

Assignment of function parameter has no effect outside the function.

Signed-off-by: F. Aragon <paco@voltanet.io>
6 years agoMerge pull request #2476 from pacovn/Coverity_1433544_Explicit_null_dereferenced
Lou Berger [Mon, 18 Jun 2018 20:59:26 +0000 (16:59 -0400)]
Merge pull request #2476 from pacovn/Coverity_1433544_Explicit_null_dereferenced

bgpd: null check (Coverity 143354414335431433542)

6 years agoMerge pull request #2482 from pacovn/clang_scan_bgpd_bgp_rpki_deref
Donald Sharp [Mon, 18 Jun 2018 20:09:56 +0000 (16:09 -0400)]
Merge pull request #2482 from pacovn/clang_scan_bgpd_bgp_rpki_deref

bgpd: null check (Clang scan-build)

6 years agobgpd: null check (Clang scan-build)
paco [Mon, 18 Jun 2018 14:38:23 +0000 (16:38 +0200)]
bgpd: null check (Clang scan-build)

Signed-off-by: F. Aragon <paco@voltanet.io>
6 years agoMerge pull request #2484 from pacovn/cppcheck_unused_vars
Donald Sharp [Mon, 18 Jun 2018 19:27:11 +0000 (15:27 -0400)]
Merge pull request #2484 from pacovn/cppcheck_unused_vars

eigrpd, lib: unused vars (cppcheck)

6 years agoMerge pull request #2486 from pacovn/cppcheck_fmt_validation
Donald Sharp [Mon, 18 Jun 2018 19:23:49 +0000 (15:23 -0400)]
Merge pull request #2486 from pacovn/cppcheck_fmt_validation

babeld, lib, ospfd, tests: fmt fixes (cppcheck)

6 years agoMerge pull request #2489 from pacovn/cppcheck_reduntant_pointer_op
Donald Sharp [Mon, 18 Jun 2018 19:16:55 +0000 (15:16 -0400)]
Merge pull request #2489 from pacovn/cppcheck_reduntant_pointer_op

ldpd: redundant pointer operation (cppcheck)

6 years agoMerge pull request #2488 from pacovn/cppcheck_nhrpd_limit_check
Donald Sharp [Mon, 18 Jun 2018 19:16:34 +0000 (15:16 -0400)]
Merge pull request #2488 from pacovn/cppcheck_nhrpd_limit_check

nhrpd: array limit check (cppcheck)

6 years agoMerge pull request #2487 from pacovn/cppcheck_redundant_memset
Donald Sharp [Mon, 18 Jun 2018 19:15:46 +0000 (15:15 -0400)]
Merge pull request #2487 from pacovn/cppcheck_redundant_memset

ospfd, pimd: redundant memset (cppcheck)

6 years agoMerge pull request #2490 from pacovn/cppcheck_unsigned_check
Donald Sharp [Mon, 18 Jun 2018 19:14:07 +0000 (15:14 -0400)]
Merge pull request #2490 from pacovn/cppcheck_unsigned_check

babeld, eigrpd, ospfd: unsigned negative check (cppcheck, grouped)

6 years agoMerge pull request #2417 from pacovn/Coverity_1399373_Structurally_dead_code
Donald Sharp [Mon, 18 Jun 2018 18:29:27 +0000 (14:29 -0400)]
Merge pull request #2417 from pacovn/Coverity_1399373_Structurally_dead_code

bgpd: dead code (Coverity 1399373)

6 years agobabeld, eigrpd, ospfd: unsigned negative check
paco [Mon, 18 Jun 2018 17:07:24 +0000 (19:07 +0200)]
babeld, eigrpd, ospfd: unsigned negative check

After Cppcheck 1.72 feedback

Signed-off-by: F. Aragon <paco@voltanet.io>
6 years agoldpd: redundant pointer operation (cppcheck)
paco [Mon, 18 Jun 2018 16:41:57 +0000 (18:41 +0200)]
ldpd: redundant pointer operation (cppcheck)

Signed-off-by: F. Aragon <paco@voltanet.io>
6 years agonhrpd: array limit check (cppcheck)
paco [Mon, 18 Jun 2018 16:13:41 +0000 (18:13 +0200)]
nhrpd: array limit check (cppcheck)

Signed-off-by: F. Aragon <paco@voltanet.io>
6 years agoospfd, pimd: redundant memset (cppcheck)
paco [Mon, 18 Jun 2018 16:01:59 +0000 (18:01 +0200)]
ospfd, pimd: redundant memset (cppcheck)

Signed-off-by: F. Aragon <paco@voltanet.io>
6 years agoMerge pull request #2457 from pacovn/Coverity_1465491_Untrusted_value_as_argument
Donald Sharp [Mon, 18 Jun 2018 15:55:53 +0000 (11:55 -0400)]
Merge pull request #2457 from pacovn/Coverity_1465491_Untrusted_value_as_argument

pimd: Untrusted val as argument (Coverity 1465491)

6 years agoMerge pull request #2464 from pacovn/Coverity_1399309_Out-of-bounds_access
Donald Sharp [Mon, 18 Jun 2018 15:55:16 +0000 (11:55 -0400)]
Merge pull request #2464 from pacovn/Coverity_1399309_Out-of-bounds_access

isisd: out-of-bounds access (Coverity 1399309)

6 years agobabeld, lib, ospfd, tests: fmt fixes (cppcheck)
paco [Mon, 18 Jun 2018 15:49:58 +0000 (17:49 +0200)]
babeld, lib, ospfd, tests: fmt fixes (cppcheck)

Signed-off-by: F. Aragon <paco@voltanet.io>
6 years agoeigrpd, lib, vtysh: unused vars (cppcheck)
paco [Mon, 18 Jun 2018 15:12:27 +0000 (17:12 +0200)]
eigrpd, lib, vtysh: unused vars (cppcheck)

Signed-off-by: F. Aragon <paco@voltanet.io>
6 years agobgpd: null check (Clang scan-build)
paco [Mon, 18 Jun 2018 14:27:02 +0000 (16:27 +0200)]
bgpd: null check (Clang scan-build)

Signed-off-by: F. Aragon <paco@voltanet.io>
6 years agobgpd: null chk (Coverity 1433544 1433543 1433542)
paco [Mon, 18 Jun 2018 10:23:28 +0000 (12:23 +0200)]
bgpd: null chk (Coverity 1433544 1433543 1433542)

Signed-off-by: F. Aragon <paco@voltanet.io>
6 years agobgpd: vpn null check
paco [Mon, 18 Jun 2018 13:52:57 +0000 (15:52 +0200)]
bgpd: vpn null check

Can be reproduced with following vtysh sequence (an intentionaly wrong
sequence):

['configure terminal\n router bgp 255 vrf l3vrf-6\n',
 'configure terminal\n router bgp 255 vrf l3vrf-6\nbgp router-id 10.255.255.1\n',
 'configure terminal\n router bgp 255 vrf l3vrf-6\n address-family ipv4\nlabel vpn export 45000\n',
 'configure terminal\n router bgp 255 vrf l3vrf-6\n address-family ipv4\nrd vpn export 255:5\n',
 'configure terminal\n router bgp 255 vrf l3vrf-6\n address-family ipv4\nredistribute isis\n', 'configure terminal\n router bgp 255 vrf l3vrf-6\n address-family ipv4\nredistribute ospf\n', 'configure terminal\n router bgp 255 vrf l3vrf-6\n address-family ipv4\nredistribute connected\n', 'configure terminal\n router bgp 255 vrf l3vrf-6\n address-family ipv4\nimport vpn\n', 'configure terminal\n router bgp 255 vrf l3vrf-6\n address-family ipv4\nexport vpn\n', 'configure terminal\n router bgp 255 vrf l3vrf-6\n address-family ipv4\nrt vpn import 255:1\n', 'configure terminal\n router bgp 255 vrf l3vrf-6\n address-family ipv4\nrt vpn export 255:1\n'
]

Signed-off-by: F. Aragon <paco@voltanet.io>
6 years agoMerge pull request #2466 from pacovn/clang_scan_bgpd_dereference1
Lou Berger [Mon, 18 Jun 2018 12:16:01 +0000 (08:16 -0400)]
Merge pull request #2466 from pacovn/clang_scan_bgpd_dereference1

bgpd: null check (Clang scan-build)

6 years agoMerge pull request #2456 from pacovn/Coverity_1399306_Out-of-bounds_access
Lou Berger [Mon, 18 Jun 2018 12:12:04 +0000 (08:12 -0400)]
Merge pull request #2456 from pacovn/Coverity_1399306_Out-of-bounds_access

bgpd: out-of-bounds access (Coverity 1399306)

6 years agozebra: re-install static routes needed vrf when the vrf intf comes up
Don Slice [Mon, 18 Jun 2018 11:38:45 +0000 (11:38 +0000)]
zebra: re-install static routes needed vrf when the vrf intf comes up

Problem reported that if the vrf device is taken down and then brought
back up, any static route referencing that vrf device was not
re-installed.  This fix runs back thru the static routes that
reference the vrf device coming up and re-install them.

Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
6 years agobgpd: null check (Coverity 1408766)
paco [Mon, 18 Jun 2018 10:51:33 +0000 (12:51 +0200)]
bgpd: null check (Coverity 1408766)

Signed-off-by: F. Aragon <paco@voltanet.io>
6 years agolib: A small optimization for the hash iterate and walk functions
Donald Sharp [Sat, 16 Jun 2018 23:27:41 +0000 (19:27 -0400)]
lib: A small optimization for the hash iterate and walk functions

When we are iterating through the hash, keep count of how many
we've called and if we have finished calling the hash->size
iterator times, then short-circuit and stop looping over
the entire array.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agolib, vtysh: Add 'show thread poll' command
Donald Sharp [Sat, 16 Jun 2018 22:12:54 +0000 (18:12 -0400)]
lib, vtysh: Add 'show thread poll' command

Add a 'show thread poll' command that displays the
poll information and fd's setup.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agoMerge pull request #2467 from pacovn/Coverity_1399274_Dereference_after_null_check
Lou Berger [Sat, 16 Jun 2018 12:26:26 +0000 (08:26 -0400)]
Merge pull request #2467 from pacovn/Coverity_1399274_Dereference_after_null_check

bgpd: null check (Coverity 1399274)

6 years agobgpd: fix default RD value in running-cfg
Chirag Shah [Sat, 16 Jun 2018 04:11:16 +0000 (21:11 -0700)]
bgpd: fix default RD value in running-cfg

When bgp vrf is configured with non-default
RD value, config flag is set.
Upon removing non-default RD value the flag was not reset,
thus displayed default RD value in running-config.

router bgp 5550 vrf vrf1
 rd 45.0.2.2:5

Unset the RD configuration flag under bgp_vrf instance.

Ticket:CM-20206

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
6 years agozebra: Hide default vrf instance of l3vni cmd
Chirag Shah [Fri, 15 Jun 2018 22:23:27 +0000 (15:23 -0700)]
zebra: Hide default vrf instance of l3vni cmd

Hide following l3vni config from DEFAULT_VRF instance
until it is fully supported.

TORS1(config)# vni 2222456 prefix-routes-only

Ticket:CM-20572

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
6 years agodoc: update workflow.rst
Quentin Young [Fri, 15 Jun 2018 18:34:25 +0000 (18:34 +0000)]
doc: update workflow.rst

* Rewrap lines to 80 characters
* Update some portions to reflect current practices
* Clean up some formatting (indent, markup, etc)
* Reorganize sections on patch submission
* Remove link to nonexistent github wiki page

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agolib: ignore user CFLAGS when building Clippy
Quentin Young [Fri, 15 Jun 2018 18:35:53 +0000 (18:35 +0000)]
lib: ignore user CFLAGS when building Clippy

Unfortunately user CFLAGS causes #define conflicts with #defines in
Python development headers, which causes build failures under certain
platforms when using -Werror.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agobgpd: null check (Coverity 1399274)
paco [Fri, 15 Jun 2018 18:09:55 +0000 (20:09 +0200)]
bgpd: null check (Coverity 1399274)

Signed-off-by: F. Aragon <paco@voltanet.io>
6 years agobgpd: null check (Clang scan-build)
paco [Fri, 15 Jun 2018 18:02:23 +0000 (20:02 +0200)]
bgpd: null check (Clang scan-build)

Signed-off-by: F. Aragon <paco@voltanet.io>
6 years agotests: fixup minor autotools nit
Quentin Young [Fri, 15 Jun 2018 17:17:42 +0000 (17:17 +0000)]
tests: fixup minor autotools nit

Makes super strict builds fail due to a warning.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agoMerge pull request #2447 from ajones-rvbd/ajones-issue-2391
Quentin Young [Fri, 15 Jun 2018 16:40:19 +0000 (12:40 -0400)]
Merge pull request #2447 from ajones-rvbd/ajones-issue-2391

alpine: add unit tests to build

6 years agoisisd: out-of-bounds access (Coverity 1399309)
paco [Fri, 15 Jun 2018 16:36:20 +0000 (18:36 +0200)]
isisd: out-of-bounds access (Coverity 1399309)

Signed-off-by: F. Aragon <paco@voltanet.io>
6 years agoMerge pull request #2409 from LabNConsulting/working/master/vtysh-2400
Quentin Young [Fri, 15 Jun 2018 16:33:44 +0000 (12:33 -0400)]
Merge pull request #2409 from LabNConsulting/working/master/vtysh-2400

vtysh: -u fixes

6 years agoMerge pull request #2458 from pacovn/Coverity_1221437_Unchecked_return_value
Donald Sharp [Fri, 15 Jun 2018 14:53:58 +0000 (10:53 -0400)]
Merge pull request #2458 from pacovn/Coverity_1221437_Unchecked_return_value

ospf6d: unchecked return value (Coverity 1221437)

6 years agopimd: Untrusted val as argument (Coverity 1465491)
paco [Fri, 15 Jun 2018 10:57:47 +0000 (12:57 +0200)]
pimd: Untrusted val as argument (Coverity 1465491)

Signed-off-by: F. Aragon <paco@voltanet.io>
6 years agoospf6d: unchecked return value (Coverity 1221437)
paco [Fri, 15 Jun 2018 11:08:37 +0000 (13:08 +0200)]
ospf6d: unchecked return value (Coverity 1221437)

Signed-off-by: F. Aragon <paco@voltanet.io>
6 years agobgpd: out-of-bounds access (Coverity 1399306)
paco [Fri, 15 Jun 2018 10:39:10 +0000 (12:39 +0200)]
bgpd: out-of-bounds access (Coverity 1399306)

Signed-off-by: F. Aragon <paco@voltanet.io>
6 years agobgpd: dead code (Coverity 1399373)
paco [Wed, 13 Jun 2018 09:35:01 +0000 (11:35 +0200)]
bgpd: dead code (Coverity 1399373)

Signed-off-by: F. Aragon <paco@voltanet.io>
6 years agobgpd: Fix crash when showing filtered routes
Pascal Mathis [Thu, 14 Jun 2018 17:40:36 +0000 (19:40 +0200)]
bgpd: Fix crash when showing filtered routes

This commit fixes the issue mentioned in #2419, which is caused by a
double-free. The problem of the current implementation is that
*bgp_input_modifier* already frees the passed attributes under specific
circumstances, which can then lead to a double-free as *bgp_attr_undup*
does not check if the attributes are set to NULL.

As it is not transparent to the function caller if the attributes get
freed or not and the similar function *bgp_output_modifier* also does
not flush the passed attributes, the line has been removed altogether.

All callers of *bgp_input_modifier* already deal by themself with
freeing/flushing/unduping BGP attributes, so it is safe to remove.

Signed-off-by: Pascal Mathis <mail@pascalmathis.com>
6 years agoMerge pull request #2426 from pacovn/Coverity_23089_Buffer_not_null_terminated
Rafael Zalamena [Thu, 14 Jun 2018 21:02:34 +0000 (18:02 -0300)]
Merge pull request #2426 from pacovn/Coverity_23089_Buffer_not_null_terminated

ospfd: buffer termination (Coverity 23089)

6 years agoMerge pull request #2438 from pacovn/Coverity_1457300_Dereference_after_null_check
Rafael Zalamena [Thu, 14 Jun 2018 20:58:10 +0000 (17:58 -0300)]
Merge pull request #2438 from pacovn/Coverity_1457300_Dereference_after_null_check

ospfd: null check (Coverity 1457300)

6 years agoalpine: add unit tests to build
Arthur Jones [Fri, 8 Jun 2018 16:47:28 +0000 (09:47 -0700)]
alpine: add unit tests to build

Now that make check works on alpine, add it to the build

Testing done: alpine linux build -- check works

Issue: https://github.com/FRRouting/frr/issues/2391

Signed-off-by: Arthur Jones <arthur.jones@riverbed.com>
6 years agoMerge pull request #2422 from pacovn/Coverity_23201_Dereference_before_null_check
Donald Sharp [Thu, 14 Jun 2018 17:03:50 +0000 (13:03 -0400)]
Merge pull request #2422 from pacovn/Coverity_23201_Dereference_before_null_check

bgpd: null check (Coverity 23201)

6 years agobgpd: Finalize group-overrides for peer/AF attrs
Pascal Mathis [Thu, 14 Jun 2018 16:03:33 +0000 (18:03 +0200)]
bgpd: Finalize group-overrides for peer/AF attrs

This commit finalizes the previous commits which introduced a generic
approach for making all BGP peer and address-family attributes
overrideable by keeping track of the configuration origin in separate
internal structures.

First of all, the test suite was greatly extended to also check the
internal data structures of peer/AF attributes, so that inheritance for
internal values like 'peer->weight' is also being checked in all cases.

This revealed some smaller issues in the implementation, which were also
fixed in this commit. The test suite now fully passes and covers all the
usual situations that should normally occur.

Signed-off-by: Pascal Mathis <mail@pascalmathis.com>
6 years agobgpd: Implement group-overrides for peer attrs
Pascal Mathis [Wed, 13 Jun 2018 17:34:17 +0000 (19:34 +0200)]
bgpd: Implement group-overrides for peer attrs

This commit introduces BGP peer-group overrides for the last set of
peer-level attrs which did not offer that feature yet. The following
attributes have been implemented: description, local-as, password and
update-source.

Each attribute, with the exception of description because it does not
offer any inheritance between peer-groups and peers, is now also setting
a peer-flag instead of just modifying the internal data structures. This
made it possible to also re-use the same implementation for attribute
overrides as already done for peer flags, AF flags and AF attrs.

The `no neighbor <neigh> description` command has been slightly changed
to support negation for no parameters, one parameter or * parameters
(LINE...). This was needed for the test suite to pass and is a small
change without any bigger impact on the CLI.

Signed-off-by: Pascal Mathis <mail@pascalmathis.com>
6 years agobgpd: Implement group-overrides for peer timers
Pascal Mathis [Wed, 13 Jun 2018 00:34:43 +0000 (02:34 +0200)]
bgpd: Implement group-overrides for peer timers

This commit implements BGP peer-group overrides for the timer flags,
which control the value of the hold, keepalive, advertisement-interval
and connect connect timers. It was kept separated on purpose as the
whole timer implementation is quite complex and merging this commit
together with with the other flag implementations did not seem right.

Basically three new peer flags were introduced, namely
*PEER_FLAG_ROUTEADV*, *PEER_FLAG_TIMER* and *PEER_FLAG_TIMER_CONNECT*.
The overrides work exactly the same way as they did before, but
introducing these flags made a few conditionals simpler as they no
longer had to compare internal data structures against eachother.

Last but not least, the test suite has been adjusted accordingly to test
the newly implemented flag overrides.

Signed-off-by: Pascal Mathis <mail@pascalmathis.com>
6 years agobgpd: Improve test suite for peer-group overrides
Pascal Mathis [Tue, 12 Jun 2018 22:39:19 +0000 (00:39 +0200)]
bgpd: Improve test suite for peer-group overrides

This commit introduces the current test suite for BGP peer-group
overrides by adding support for custom check handlers (which can check
internal data structures more thoroughly) and by fixing several small
mistakes and issues that slipped through. Also some parts of the code
have been cleaned up to avoid duplicate and/or hard-to-read code.

Additionally a first experimental check for a BGP peer attribute with
values (advertisement-interval <value>) has been added to the test
suite. As this test suite is currently not passing, it has not been
added to the python test caller.

Signed-off-by: Pascal Mathis <mail@pascalmathis.com>
6 years agobgpd: Cleanup peer/AF-flag override implementation
Pascal Mathis [Tue, 12 Jun 2018 16:50:51 +0000 (18:50 +0200)]
bgpd: Cleanup peer/AF-flag override implementation

This commit cleans up some ugly leftovers from previous flag-override
implementation and refactors the AF-flag override implementation to
match the same behavior the newly added peer-flag override
implementation has.

Signed-off-by: Pascal Mathis <mail@pascalmathis.com>
6 years agobgpd: Fix AF-attribute overrides when binding peer
Pascal Mathis [Tue, 12 Jun 2018 15:09:49 +0000 (17:09 +0200)]
bgpd: Fix AF-attribute overrides when binding peer

The current implementation of the overrides for peer address-family
attributes suffered a bug, which caused all peer-specific attributes to
be lost when the peer was added to a peer-group which already had that
specific address-family active.

This commit extends the *peer_group2peer_config_copy_af* function to
respect overridden flags properly. Additionally, the arguments of the
macros *PEER_ATTR_INHERIT* and *PEER_STR_ATTR_INHERIT* have been
reordered to be more consistent and easy to read.

This commit also adds further test cases to the BGP peer attributes test
suite, so that this kind of error is being caught in future commits. The
missing AF-attribute *distribute-list* has also been added to the test
suite.

Signed-off-by: Pascal Mathis <mail@pascalmathis.com>
6 years agobgpd: Implement group-overrides for peer flags
Pascal Mathis [Mon, 11 Jun 2018 17:49:20 +0000 (19:49 +0200)]
bgpd: Implement group-overrides for peer flags

The current implementation of peer flags (e.g. shutdown, passive, ...)
only has partial support for overriding flags of a peer-group when the
peer is a member. Often settings might get lost if the user toys around
with the peer-group configuration, which can lead to disaster.

This commit introduces the same override implementation which was
previously integrated to support proper peer flag/attribute override on
the address-family level. The code is very similar and the global
attributes now use their separate state-arrays *flags_invert* and
*flags_override*.

The test suite for BGP peer attributes was extended to also check peer
global attributes, so that the newly introduced changes are covered. An
additional feature was added which allows to test an attribute with an
*interface-peer*, which can be configured by running `neighbor IF-TEST
interface`. This was introduced so that the dynamic runtime inversion of
the `extended-nexthop` flag, which is only enabled by default for
interface peers, can also be tested.

Last but not least, two small changes have been made to the current bgpd
implementation:

- The command `strict-capability-match` can now also be set on a
peer-group, it seems like this command slipped through while
implementing peer-groups in the very past.

- The macro `COND_FLAG` was introduced inside lib/zebra.h, which now
allows to either set or unset a flag based on a condition. The syntax
for using this macro is: `COND_FLAG(flag_variable, flag, condition)`

Signed-off-by: Pascal Mathis <mail@pascalmathis.com>
6 years agoMerge pull request #2435 from pacovn/Coverity_1464993_Buffer_not_null_terminated
Renato Westphal [Thu, 14 Jun 2018 16:44:10 +0000 (13:44 -0300)]
Merge pull request #2435 from pacovn/Coverity_1464993_Buffer_not_null_terminated

ospfd: buffer termination (Coverity 1464993)

6 years agoospfd: buffer termination (Coverity 23089)
paco [Wed, 13 Jun 2018 12:43:18 +0000 (14:43 +0200)]
ospfd: buffer termination (Coverity 23089)

Details:
- INET_ADDRSTRLEN is 16, for xxx.xxx.xxx\0, so 15 is now passed
 to the strncpy call instead of 16, ensuring ASCII-z output

Signed-off-by: F. Aragon <paco@voltanet.io>
6 years agobgpd: null check (Coverity 23201)
paco [Wed, 13 Jun 2018 10:45:44 +0000 (12:45 +0200)]
bgpd: null check (Coverity 23201)

Signed-off-by: F. Aragon <paco@voltanet.io>
6 years agoospfd: buffer termination (Coverity 1464993)
paco [Wed, 13 Jun 2018 15:24:51 +0000 (17:24 +0200)]
ospfd: buffer termination (Coverity 1464993)

Signed-off-by: F. Aragon <paco@voltanet.io>
6 years agoMerge pull request #2430 from pacovn/clang_scan_ospf_dereference
Rafael Zalamena [Thu, 14 Jun 2018 14:14:52 +0000 (11:14 -0300)]
Merge pull request #2430 from pacovn/clang_scan_ospf_dereference

ospfd: dereference check (Clang scan-build)

6 years agoMerge pull request #2434 from pacovn/Coverity_1457145_Out-of-bounds_access
Rafael Zalamena [Thu, 14 Jun 2018 14:09:05 +0000 (11:09 -0300)]
Merge pull request #2434 from pacovn/Coverity_1457145_Out-of-bounds_access

lib: out-of-bounds access (Coverity 1457145)

6 years agoMerge pull request #2436 from pacovn/Coverity_1143220_Argument_cannot_be_negative
Donald Sharp [Thu, 14 Jun 2018 14:02:25 +0000 (10:02 -0400)]
Merge pull request #2436 from pacovn/Coverity_1143220_Argument_cannot_be_negative

tools: return check (Coverity 1143220)

6 years agoMerge pull request #2437 from pacovn/Coverity_1436343_Dereference_after_null_check
Rafael Zalamena [Thu, 14 Jun 2018 14:00:57 +0000 (11:00 -0300)]
Merge pull request #2437 from pacovn/Coverity_1436343_Dereference_after_null_check

lib: null check (Coverity 1436343)

6 years agoMerge pull request #2428 from donaldsharp/zserv_debug
Renato Westphal [Thu, 14 Jun 2018 13:43:40 +0000 (10:43 -0300)]
Merge pull request #2428 from donaldsharp/zserv_debug

zebra: Cleanup code to test for failure once

6 years agoMerge pull request #2410 from pacovn/Coverity_1448806_Out-of-bounds_access
Rafael Zalamena [Thu, 14 Jun 2018 13:29:35 +0000 (10:29 -0300)]
Merge pull request #2410 from pacovn/Coverity_1448806_Out-of-bounds_access

lib: Out-of-bounds access (Coverity 14488061448810)

6 years agoMerge pull request #2439 from chiragshah6/evpn_dev
Lou Berger [Thu, 14 Jun 2018 13:21:14 +0000 (09:21 -0400)]
Merge pull request #2439 from chiragshah6/evpn_dev

bgpd: Fix bgpd crash in evpn vni route-map apply

6 years agoMerge pull request #2441 from MasterofJOKers/workflow_pr_info_url
Donald Sharp [Thu, 14 Jun 2018 10:27:15 +0000 (06:27 -0400)]
Merge pull request #2441 from MasterofJOKers/workflow_pr_info_url

doc: Correct wiki URL in workflow-documentation

6 years agodoc: Correct wiki URL in workflow-documentation
MasterofJOKers [Thu, 14 Jun 2018 07:31:14 +0000 (09:31 +0200)]
doc: Correct wiki URL in workflow-documentation

The organization on github is called "FRRouting".

Signed-off-by: MasterofJOKers <joker@someserver.de>
6 years agolib: null check (Coverity 1436343)
paco [Wed, 13 Jun 2018 16:38:46 +0000 (18:38 +0200)]
lib: null check (Coverity 1436343)

Signed-off-by: F. Aragon <paco@voltanet.io>
6 years agoMerge pull request #2431 from pacovn/Coverity_1399290_Out-of-bounds_access
Renato Westphal [Wed, 13 Jun 2018 17:49:52 +0000 (14:49 -0300)]
Merge pull request #2431 from pacovn/Coverity_1399290_Out-of-bounds_access

tools: out-of-bounds access (Coverity 1399290)

6 years agoMerge pull request #2416 from pacovn/Coverity_1399389_Structurally_dead_code
Donald Sharp [Wed, 13 Jun 2018 17:38:03 +0000 (13:38 -0400)]
Merge pull request #2416 from pacovn/Coverity_1399389_Structurally_dead_code

bgpd: dead code (Coverity 1399389)

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 agoospfd: null check (Coverity 1457300)
paco [Wed, 13 Jun 2018 17:04:43 +0000 (19:04 +0200)]
ospfd: null check (Coverity 1457300)

Signed-off-by: F. Aragon <paco@voltanet.io>
6 years agobgpd: dead code removal (Coverity 1399389)
paco [Wed, 13 Jun 2018 09:09:17 +0000 (11:09 +0200)]
bgpd: dead code removal (Coverity 1399389)

Signed-off-by: F. Aragon <paco@voltanet.io>
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 agotools: return check (Coverity 1143220)
paco [Wed, 13 Jun 2018 16:07:36 +0000 (18:07 +0200)]
tools: return check (Coverity 1143220)

Signed-off-by: F. Aragon <paco@voltanet.io>
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 agolib: out-of-bounds access (Coverity 1457145)
paco [Wed, 13 Jun 2018 15:08:38 +0000 (17:08 +0200)]
lib: out-of-bounds access (Coverity 1457145)

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)