]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
6 years agolib, vtysh: fix inconsistent VRF commands in vtysh
Renato Westphal [Mon, 9 Jul 2018 00:16:47 +0000 (21:16 -0300)]
lib, vtysh: fix inconsistent VRF commands in vtysh

* Only zebra and pimd call vrf_cmd_init(), so these are the only daemons
  that should receive VRF commands from vtysh;
* "netns NAME" and "no netns NAME" are available only in zebra, write
  custom DEFSHs in vtysh to make it aware of that;
* Remove the "no vrf NAME" definition from vtysh.c and expose the
  original command to vtysh by converting the DEFUN_NOSH to a simple
  DEFUN. This command doesn't change the vty node so there's no need to
  special case it.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
6 years agozebra: fix "no pseudowire IFNAME" on vtysh
Renato Westphal [Sun, 8 Jul 2018 22:18:58 +0000 (19:18 -0300)]
zebra: fix "no pseudowire IFNAME" on vtysh

We must hide only "pseudowire IFNAME" from vtysh, the "no" form of the
command should be made available to the extract.pl script. Split the
command into two to fix this problem.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
6 years agoldpd: use DEFPY_NOSH whenever possible
Renato Westphal [Sun, 8 Jul 2018 23:31:43 +0000 (20:31 -0300)]
ldpd: use DEFPY_NOSH whenever possible

All ldpd commands were written using DEFPY except the ones that needed
to be ignored by vtysh, in which case we were using DEFUN_NOSH. Now that
DEFPY_NOSH is available, convert the remaining commands for consistency
and to simplify the code a little bit.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
6 years agolib: implement DEFPY_NOSH
Renato Westphal [Sun, 8 Jul 2018 22:02:36 +0000 (19:02 -0300)]
lib: implement DEFPY_NOSH

This is the DEFPY equivalent of DEFUN_NOSH.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
6 years agobabeld: avoid reading the configuration file twice
Renato Westphal [Mon, 2 Jul 2018 01:08:02 +0000 (22:08 -0300)]
babeld: avoid reading the configuration file twice

The frr_config_fork() function called by all FRR daemons during
initialization already takes care of reading the startup configuration
file.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
6 years agolib: add listnode_add_head()
Renato Westphal [Mon, 28 May 2018 13:15:09 +0000 (10:15 -0300)]
lib: add listnode_add_head()

Provide a new convenience function that adds an element to the beginning
of a list.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
6 years agoMerge pull request #2830 from pacovn/Coverity_1221459_revert
David Lamparter [Mon, 13 Aug 2018 19:05:34 +0000 (21:05 +0200)]
Merge pull request #2830 from pacovn/Coverity_1221459_revert

ospf6d: revert fix for Coverity 1221459

6 years agoMerge pull request #2820 from opensourcerouting/err-prep
Quentin Young [Mon, 13 Aug 2018 18:56:56 +0000 (14:56 -0400)]
Merge pull request #2820 from opensourcerouting/err-prep

remove alloc return value checks + minor babeld cleanup

6 years agoospf6d: revert fix for Coverity 1221459
F. Aragon [Mon, 13 Aug 2018 17:46:56 +0000 (19:46 +0200)]
ospf6d: revert fix for Coverity 1221459

The correction in commit 7edb6aa (PR #2502) was wrong, as it is was not
taking in consideration the unlock counter. Thanks to @eqvinox for noticing
it.

Signed-off-by: F. Aragon <paco@voltanet.io>
6 years agoMerge pull request #2827 from pacovn/Coverity_1472310_Unchecked_return_value
Quentin Young [Mon, 13 Aug 2018 17:22:17 +0000 (13:22 -0400)]
Merge pull request #2827 from pacovn/Coverity_1472310_Unchecked_return_value

bgpd: return value check (Coverity 1472310)

6 years agoMerge pull request #2828 from pacovn/Coverity_1472311_null_check
Rafael Zalamena [Mon, 13 Aug 2018 17:09:31 +0000 (14:09 -0300)]
Merge pull request #2828 from pacovn/Coverity_1472311_null_check

staticd: null check (Coverity 1472311)

6 years agoMerge pull request #2825 from dslicenc/frr-reload-vni
David Lamparter [Mon, 13 Aug 2018 17:04:52 +0000 (19:04 +0200)]
Merge pull request #2825 from dslicenc/frr-reload-vni

tools: correct frr-reload.py handling of bgp vni/exit-vni config

6 years agoMerge pull request #2824 from vishaldhingra/reg_case
David Lamparter [Mon, 13 Aug 2018 17:04:13 +0000 (19:04 +0200)]
Merge pull request #2824 from vishaldhingra/reg_case

peer_delete did not trigger ZEBRA_NEXTHOP_UNREGISTER to ZEBRA

6 years agostaticd: null check (Coverity 1472311)
F. Aragon [Mon, 13 Aug 2018 16:10:09 +0000 (18:10 +0200)]
staticd: null check (Coverity 1472311)

Signed-off-by: F. Aragon <paco@voltanet.io>
6 years agobgpd: return value check (Coverity 1472310)
F. Aragon [Mon, 13 Aug 2018 16:05:42 +0000 (18:05 +0200)]
bgpd: return value check (Coverity 1472310)

Signed-off-by: F. Aragon <paco@voltanet.io>
6 years agopeer_delete did not trigger ZEBRA_NEXTHOP_UNREGISTER to ZEBRA
vishaldhingra [Fri, 10 Aug 2018 13:00:17 +0000 (06:00 -0700)]
peer_delete did not trigger ZEBRA_NEXTHOP_UNREGISTER to ZEBRA

bgp_unlink_nexthop_check() PEER should be NULL and bgp_info list count should be 0

Signed-off-by: vishaldhingra <vdhingra@vmware.com>
6 years agobabeld: Use enum instead of #defines for kernel route type information
Donald Sharp [Mon, 18 Jun 2018 17:42:21 +0000 (13:42 -0400)]
babeld: Use enum instead of #defines for kernel route type information

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agotests: Cleanup assumption that ALLOC could fail.
Donald Sharp [Tue, 19 Jun 2018 20:17:09 +0000 (16:17 -0400)]
tests: Cleanup assumption that ALLOC could fail.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agolib: Remove memory check test
Donald Sharp [Mon, 18 Jun 2018 13:18:10 +0000 (09:18 -0400)]
lib: Remove memory check test

Found a missed memory check test that can just be removed.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agoripd: re-add check for rip_create fail
Quentin Young [Wed, 18 Jul 2018 16:52:50 +0000 (16:52 +0000)]
ripd: re-add check for rip_create fail

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years ago*: ALLOC calls cannot fail
Donald Sharp [Thu, 14 Jun 2018 12:58:05 +0000 (08:58 -0400)]
*: ALLOC calls cannot fail

There is no need to check for failure of a ALLOC call
as that any failure to do so will result in a assert
happening.  So we can safely remove all of this code.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agoMerge pull request #2809 from opensourcerouting/routemap-rpki-fix
Quentin Young [Fri, 10 Aug 2018 20:42:37 +0000 (16:42 -0400)]
Merge pull request #2809 from opensourcerouting/routemap-rpki-fix

bgpd: Fix bgp rpki to match route-map update from PR #2697

6 years agotools: correct frr-reload.py handling of bgp vni/exit-vni config
Don Slice [Thu, 9 Aug 2018 21:24:24 +0000 (21:24 +0000)]
tools: correct frr-reload.py handling of bgp vni/exit-vni config

Problem reported that when a peer-group was added in certain
configurations, it would be rejected because of the order of the
commands put in by nclu. Issued turned out to be how frr-reload.py
was handling the sub-sub-context of the vni under the address-family
and subsequently how it handled the following exit-vni.

Ticket: CM-21996
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
6 years agoMerge pull request #2806 from opensourcerouting/vty-term-fd
Quentin Young [Thu, 9 Aug 2018 16:43:02 +0000 (12:43 -0400)]
Merge pull request #2806 from opensourcerouting/vty-term-fd

lib: fix "-t" command line option

6 years agoMerge pull request #2812 from manuhalo/fix-staticd-coverity
David Lamparter [Thu, 9 Aug 2018 13:40:21 +0000 (15:40 +0200)]
Merge pull request #2812 from manuhalo/fix-staticd-coverity

staticd: Fix null pointer access (coverity 1472311)

6 years agostaticd: Fix null pointer access (coverity 1472311)
Emanuele Di Pascale [Thu, 9 Aug 2018 12:26:55 +0000 (14:26 +0200)]
staticd: Fix null pointer access (coverity 1472311)

Aded a check to ensure that if_is_vrf() is not called on a NULL if pointer.
Incidentally this was causing PR #2805 to fail.

Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
6 years agoMerge pull request #2807 from mjstapp/configure_help_fixes
Renato Westphal [Thu, 9 Aug 2018 01:01:50 +0000 (22:01 -0300)]
Merge pull request #2807 from mjstapp/configure_help_fixes

configure.ac : fix help text

6 years agobgpd: Fix bgp rpki to match route-map update from PR #2697
Martin Winter [Wed, 8 Aug 2018 22:08:22 +0000 (15:08 -0700)]
bgpd: Fix bgp rpki to match route-map update from PR #2697

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
6 years agoconfigure: fix help text
Mark Stapp [Wed, 8 Aug 2018 19:00:28 +0000 (15:00 -0400)]
configure: fix help text

Correct help text in a couple of places; add configure switch
for new staticd daemon.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
6 years agolib: fix "-t" command line option
David Lamparter [Wed, 8 Aug 2018 18:52:15 +0000 (20:52 +0200)]
lib: fix "-t" command line option

was_stdio was getting set for fd == -1 (config file read), thus
prematurely closing the stdio vty.

Signed-off-by: David Lamparter <equinox@diac24.net>
6 years agoMerge pull request #2790 from lyq140/branch1
David Lamparter [Wed, 8 Aug 2018 18:35:04 +0000 (20:35 +0200)]
Merge pull request #2790 from lyq140/branch1

don't send packets when auth_str is empty (via keychain.)

6 years agoMerge pull request #2794 from netravnen/feature/docs/set-origin
David Lamparter [Wed, 8 Aug 2018 18:28:36 +0000 (20:28 +0200)]
Merge pull request #2794 from netravnen/feature/docs/set-origin

doc: set origin

6 years agoMerge pull request #2799 from adharkar/frr-zebra_cli
David Lamparter [Wed, 8 Aug 2018 18:27:49 +0000 (20:27 +0200)]
Merge pull request #2799 from adharkar/frr-zebra_cli

Zebra: Changes to "show ip route" json commands

6 years agoMerge pull request #2122 from donaldsharp/zebra_nhs
Martin Winter [Wed, 8 Aug 2018 15:07:24 +0000 (08:07 -0700)]
Merge pull request #2122 from donaldsharp/zebra_nhs

Create Staticd

6 years agostaticd: fix tiny whitespace issue
David Lamparter [Wed, 8 Aug 2018 14:00:04 +0000 (16:00 +0200)]
staticd: fix tiny whitespace issue

Just add a linebreak.

Signed-off-by: David Lamparter <equinox@diac24.net>
6 years agoMerge pull request #2800 from adharkar/frr-bgp_cli
Russ White [Wed, 8 Aug 2018 10:37:51 +0000 (06:37 -0400)]
Merge pull request #2800 from adharkar/frr-bgp_cli

bgpd: Added local router-id to "show bgp neighbor"

6 years agoMerge pull request #2803 from opensourcerouting/pimd-nbr-uninit-warning
Russ White [Wed, 8 Aug 2018 10:35:15 +0000 (06:35 -0400)]
Merge pull request #2803 from opensourcerouting/pimd-nbr-uninit-warning

pimd: fix bogus uninitialized warning

6 years agoMerge pull request #2764 from opensourcerouting/isis-srcdest
Russ White [Wed, 8 Aug 2018 10:34:46 +0000 (06:34 -0400)]
Merge pull request #2764 from opensourcerouting/isis-srcdest

IS-IS dst-src routing support

6 years agopimd: fix bogus uninitialized warning
David Lamparter [Wed, 8 Aug 2018 10:32:21 +0000 (12:32 +0200)]
pimd: fix bogus uninitialized warning

pimd/pim_nht.c: In function ‘pim_ecmp_nexthop_search’:
pimd/pim_nht.c:523:17: error: ‘nbr’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
    nexthop->nbr = nbr;

(on gcc 5.4.0; this is the only warning with that version.)

Signed-off-by: David Lamparter <equinox@diac24.net>
6 years agobgpd: Added local router-id to "show bgp neighbor"
Ameya Dharkar [Tue, 7 Aug 2018 22:25:47 +0000 (15:25 -0700)]
bgpd: Added local router-id to "show bgp neighbor"

Signed-off-by: Ameya Dharkar adharkar@vmware.com
6 years ago1. Added json output to "show ip route <prefix>" command
Ameya Dharkar [Tue, 7 Aug 2018 22:15:34 +0000 (15:15 -0700)]
1. Added json output to "show ip route <prefix>" command
2. Added tag O/P to "show ip route json" command

Signed-off-by: Ameya Dharkar adharkar@vmware.com
6 years agodoc/user/routemap.rst
Christoffer [Mon, 6 Aug 2018 17:31:37 +0000 (19:31 +0200)]
doc/user/routemap.rst

6 years agoMerge pull request #2774 from qlyoung/fix-bgpd-questionable-clist-memory-mgmt
Russ White [Tue, 7 Aug 2018 20:12:41 +0000 (16:12 -0400)]
Merge pull request #2774 from qlyoung/fix-bgpd-questionable-clist-memory-mgmt

bgpd: fix odd memory mgmt in clist strings fn

6 years agoMerge pull request #2788 from ton31337/fix/print_ipv6_route_if_afi
Russ White [Tue, 7 Aug 2018 19:58:26 +0000 (15:58 -0400)]
Merge pull request #2788 from ton31337/fix/print_ipv6_route_if_afi

bgpd: Display `::` if AFI is IPv6, `0.0.0.0` otherwise

6 years agobgpd: fix odd memory mgmt in clist strings fn
Quentin Young [Thu, 2 Aug 2018 17:27:41 +0000 (17:27 +0000)]
bgpd: fix odd memory mgmt in clist strings fn

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agoMerge pull request #2772 from qlyoung/fix-bgp-updates-prefix-debugging
Rafael Zalamena [Tue, 7 Aug 2018 18:00:21 +0000 (15:00 -0300)]
Merge pull request #2772 from qlyoung/fix-bgp-updates-prefix-debugging

Fix bgp updates prefix debugging

6 years agobgpd: clean up evpn prefix debugging commands
Quentin Young [Tue, 31 Jul 2018 21:35:54 +0000 (21:35 +0000)]
bgpd: clean up evpn prefix debugging commands

* Fix memory leaks in debug commands
* Use CLI tokens to properly sanitize input
* Remove unnecessary error handling code from debug commands
* Remove unnecessary parameters from conf print functions

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agobgpd: fix UPDATE debugging for prefixes
Quentin Young [Tue, 31 Jul 2018 20:44:45 +0000 (20:44 +0000)]
bgpd: fix UPDATE debugging for prefixes

Recent patch to support EVPN prefix debugging broke debugging regular
prefixes.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agoMerge pull request #2795 from qlyoung/fix-control-build-deps
David Lamparter [Tue, 7 Aug 2018 15:55:48 +0000 (17:55 +0200)]
Merge pull request #2795 from qlyoung/fix-control-build-deps

Fix control build deps

6 years agobgpd: Display `::` if AFI is IPv6, `0.0.0.0` otherwise
Donatas Abraitis [Tue, 7 Aug 2018 12:37:57 +0000 (15:37 +0300)]
bgpd: Display `::` if AFI is IPv6, `0.0.0.0` otherwise

Signed-off-by: Donatas Abraitis donatas.abraitis@gmail.com
6 years agoMerge pull request #2726 from sworleys/Netlink-Filter-AFI
Renato Westphal [Mon, 6 Aug 2018 23:26:46 +0000 (20:26 -0300)]
Merge pull request #2726 from sworleys/Netlink-Filter-AFI

zebra: Ignore AF_ETHERNET and AF_MPLS in route change as well

6 years agodebian: remove trailing whitespace from control
Quentin Young [Mon, 6 Aug 2018 20:23:03 +0000 (20:23 +0000)]
debian: remove trailing whitespace from control

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agodebian: add install-info to build deps
Quentin Young [Mon, 6 Aug 2018 20:22:48 +0000 (20:22 +0000)]
debian: add install-info to build deps

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agoMerge pull request #2777 from qlyoung/fix-checkpatch-sh-greps
Lou Berger [Mon, 6 Aug 2018 19:59:35 +0000 (15:59 -0400)]
Merge pull request #2777 from qlyoung/fix-checkpatch-sh-greps

tools: improve checkpatch slicing

6 years agoMerge pull request #2793 from pacovn/Coverity_1472232_1472234_Unchecked_return_value
Quentin Young [Mon, 6 Aug 2018 19:42:49 +0000 (15:42 -0400)]
Merge pull request #2793 from pacovn/Coverity_1472232_1472234_Unchecked_return_value

bgpd pimd: return check (Coverity 1472232 1472234)

6 years agobgpd pimd: return check (Coverity 1472232 1472234)
F. Aragon [Mon, 6 Aug 2018 16:17:39 +0000 (18:17 +0200)]
bgpd pimd: return check (Coverity 1472232 1472234)

Signed-off-by: F. Aragon <paco@voltanet.io>
6 years agoripd: fix packet sending in authenticate mode
lyq140 [Mon, 6 Aug 2018 06:14:00 +0000 (14:14 +0800)]
ripd: fix packet sending in authenticate mode

fix a bug when sending packets.
in authenticate mode but without any string,
no packet should send.

Signed-off-by: lyq140 <34637052+lyq140@users.noreply.github.com>
6 years agoripd: fix packet sending
lyq140 [Mon, 6 Aug 2018 02:46:58 +0000 (10:46 +0800)]
ripd: fix packet sending

fix a bug when sending a rip packet.
in authenticate mode but without any string,
no packet should send.

Signed-off-by: lyq140 <34637052+lyq140@users.noreply.github.com>
6 years agoMerge pull request #2775 from donaldsharp/stream_speedup
Rafael Zalamena [Sat, 4 Aug 2018 17:17:25 +0000 (14:17 -0300)]
Merge pull request #2775 from donaldsharp/stream_speedup

lib: Increase stream allocation speed.

6 years agoMerge pull request #2758 from donaldsharp/pim_join
Russ White [Sat, 4 Aug 2018 15:46:45 +0000 (11:46 -0400)]
Merge pull request #2758 from donaldsharp/pim_join

lib and pim silliness

6 years agoMerge pull request #2773 from donaldsharp/pim_ordering
Russ White [Sat, 4 Aug 2018 15:43:38 +0000 (11:43 -0400)]
Merge pull request #2773 from donaldsharp/pim_ordering

Pim ordering

6 years agoMerge pull request #2778 from donaldsharp/pim_leaks_and_invalids
Russ White [Sat, 4 Aug 2018 15:30:15 +0000 (11:30 -0400)]
Merge pull request #2778 from donaldsharp/pim_leaks_and_invalids

Pim leaks and invalids

6 years agoMerge pull request #2684 from netravnen/feature/bgpd/well-known-communities
Russ White [Sat, 4 Aug 2018 13:57:32 +0000 (09:57 -0400)]
Merge pull request #2684 from netravnen/feature/bgpd/well-known-communities

Add missing bgp well-known communities

6 years agoMerge pull request #2731 from chiragshah6/mdev
Lou Berger [Fri, 3 Aug 2018 18:12:21 +0000 (14:12 -0400)]
Merge pull request #2731 from chiragshah6/mdev

bgpd: route detail output local pref display

6 years agotools: improve checkpatch slicing
Quentin Young [Thu, 2 Aug 2018 18:34:37 +0000 (18:34 +0000)]
tools: improve checkpatch slicing

checkpatch cuts from the diff between the outputs of pre-patch and
post-patch runs of `checkpatch.pl`, but fixed-length greps sometimes
don't cut correctly.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agoMerge pull request #2782 from pacovn/Coverity_1472236_Improper_use_of_negative_value
Quentin Young [Fri, 3 Aug 2018 17:19:13 +0000 (13:19 -0400)]
Merge pull request #2782 from pacovn/Coverity_1472236_Improper_use_of_negative_value

zebra: socket fd check (Coverity 1472236)

6 years agozebra: socket fd check (Coverity 1472236)
F. Aragon [Fri, 3 Aug 2018 13:37:02 +0000 (15:37 +0200)]
zebra: socket fd check (Coverity 1472236)

Signed-off-by: F. Aragon <paco@voltanet.io>
6 years agoMerge pull request #2783 from pacovn/Coverity_1472229_variable_scope
Quentin Young [Fri, 3 Aug 2018 16:07:19 +0000 (12:07 -0400)]
Merge pull request #2783 from pacovn/Coverity_1472229_variable_scope

bgpd: variable scope (Coverity 1472229)

6 years agoMerge pull request #2781 from pacovn/Coverity_1472237_null_check
Rafael Zalamena [Fri, 3 Aug 2018 16:01:11 +0000 (13:01 -0300)]
Merge pull request #2781 from pacovn/Coverity_1472237_null_check

bgpd: null check (Coverity 1472237)

6 years agoMerge pull request #2780 from pacovn/Coverity_1472238_dead_code
Rafael Zalamena [Fri, 3 Aug 2018 15:25:59 +0000 (12:25 -0300)]
Merge pull request #2780 from pacovn/Coverity_1472238_dead_code

bgpd: dead code (Coverity 1472230 1472231 1472238)

6 years agoMerge pull request #2784 from pacovn/Coverity_1472227_dead_code
Rafael Zalamena [Fri, 3 Aug 2018 15:18:58 +0000 (12:18 -0300)]
Merge pull request #2784 from pacovn/Coverity_1472227_dead_code

ospfd: dead code (Coverity 1472227)

6 years agobgpd: null check (Coverity 1472237)
F. Aragon [Fri, 3 Aug 2018 13:23:26 +0000 (15:23 +0200)]
bgpd: null check (Coverity 1472237)

Signed-off-by: F. Aragon <paco@voltanet.io>
6 years agobgpd: dead code (Coverity 1472230 1472231 1472238)
F. Aragon [Fri, 3 Aug 2018 13:14:58 +0000 (15:14 +0200)]
bgpd: dead code (Coverity 1472230 1472231 1472238)

Signed-off-by: F. Aragon <paco@voltanet.io>
6 years agoMerge pull request #2779 from pacovn/Coverity_1472226_1472228_1472239
Rafael Zalamena [Fri, 3 Aug 2018 14:15:32 +0000 (11:15 -0300)]
Merge pull request #2779 from pacovn/Coverity_1472226_1472228_1472239

bgpd: rsc leak (Coverity 1472226 1472228 1472239)

6 years agoospfd: dead code (Coverity 1472227)
F. Aragon [Fri, 3 Aug 2018 13:51:05 +0000 (15:51 +0200)]
ospfd: dead code (Coverity 1472227)

Signed-off-by: F. Aragon <paco@voltanet.io>
6 years agobgpd: variable scope (Coverity 1472229)
F. Aragon [Fri, 3 Aug 2018 13:47:03 +0000 (15:47 +0200)]
bgpd: variable scope (Coverity 1472229)

Signed-off-by: F. Aragon <paco@voltanet.io>
6 years agobgpd: rsc leak (Coverity 1472226 1472228 1472239)
F. Aragon [Fri, 3 Aug 2018 12:55:10 +0000 (14:55 +0200)]
bgpd: rsc leak (Coverity 1472226 1472228 1472239)

Signed-off-by: F. Aragon <paco@voltanet.io>
6 years agolib, bgpd, ospf6d, ospfd, pimd: Allow finish to cleanup a bit more
Donald Sharp [Fri, 3 Aug 2018 12:18:11 +0000 (08:18 -0400)]
lib, bgpd, ospf6d, ospfd, pimd: Allow finish to cleanup a bit more

When calling route_map_finish, every place that we do we must
first set the deletion event to NULL, or we will create an infinite
loop, if we are using the delayed route-map application code.
As such we might as well just make the route_map_finish code
do this work, as that there is really no viable alternative here
and route_map_finish should only be called on shutdown.

This fixes an infinite loop in zebra on shutdown when there
are route-maps.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agoisisd: fix refcounting in isis_route.c
Christian Franke [Wed, 1 Aug 2018 11:23:56 +0000 (13:23 +0200)]
isisd: fix refcounting in isis_route.c

This fixes multiple issues and inefficiencies regarding the usage of
route_tables in isis_route.c and removes some memory leaks.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
6 years agoisisd: make spf code dst-src aware
Christian Franke [Thu, 26 Jul 2018 20:53:08 +0000 (22:53 +0200)]
isisd: make spf code dst-src aware

Take the source-prefix sub-TLV into consideration when running SPF
and support creation/deletion of dst-src routes as result.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
6 years agoisisd: don't infer spftree from address family
Christian Franke [Thu, 26 Jul 2018 13:08:11 +0000 (15:08 +0200)]
isisd: don't infer spftree from address family

Instead of using the address family to determine which spftree structure
should be used, specify it explicitly. With the advent of ipv6 dst-src
routing, the tree cannot be uniquely determined from the family.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
6 years agoisisd: make use of advanced concepts like arrays and loops
Christian Franke [Thu, 26 Jul 2018 10:57:38 +0000 (12:57 +0200)]
isisd: make use of advanced concepts like arrays and loops

Have an array of spftrees instead of a separate spftree and an
spftree6 for which all the code gets duplicated.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
6 years agoisisd: fix isis_route_merge_verify logic
Christian Franke [Thu, 26 Jul 2018 08:02:15 +0000 (10:02 +0200)]
isisd: fix isis_route_merge_verify logic

This addresses two issues for L1L2 operation:

a) If an L1 route has ROUTE_ACTIVE unset and an L2 route for the same
destination has ROUTE_ACTIVE set, isisd would still put the L1 route
into the merged table. This causes the route for the destination to
get uninstalled from zebra until the next SPF run, which is incorrect.

To fix this, look at the ROUTE_ACTIVE flag and allow L2 routes to win
against L1 routes, when the L1 has ROUTE_ACTIVE unset.

b) If an L1 route wins against an existing L2 route, the ZEBRA_SYNCED
flag would remain on the L2 route. This leads to the problem that when
the L1 route disappears again, the L2 doesn't get reinstalled, since
isisd assumes it's already in the RIB because ZEBRA_SYNCED is set.

Solve this by clearing ZEBRA_SYNCED on L2 routes, if they lose against
an L1 route.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
6 years agoisisd: fix redist_delete to also consider level-2
Christian Franke [Thu, 26 Jul 2018 08:01:47 +0000 (10:01 +0200)]
isisd: fix redist_delete to also consider level-2

There was an off-by-one error in redist_delete, so that routes redistributed
into level-2 could never be withdrawn.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
6 years agoisisd: move route_table into spftree
Christian Franke [Tue, 24 Jul 2018 15:40:24 +0000 (17:40 +0200)]
isisd: move route_table into spftree

As isisd's route_tables are directly related to spf trees, move
the route tables into the spftree instead of maintaining them
alongside of the spftrees.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
6 years agoisisd: learn and advertise IPv6 dst-src routes
Christian Franke [Sun, 22 Jul 2018 19:49:02 +0000 (15:49 -0400)]
isisd: learn and advertise IPv6 dst-src routes

Receive IPv6 dst-src routes from zebra and advertise them in our LSPs
if so configured.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
6 years agoisisd: add debug message if adjacency is ignored because IP is unusable
Christian Franke [Sun, 22 Jul 2018 17:59:43 +0000 (13:59 -0400)]
isisd: add debug message if adjacency is ignored because IP is unusable

isisd verifies whether the neighboring IPv4 addresses overlap with its own
unless the interface is running in unnumbered mode. If no overlap is found
and IPv6 is also not enabled, IIHs will be ignored.

Add a debug message for this case, to avoid people wondering why adjacencies
are not coming up.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
6 years agopimd: On shutdown ensure wheel exists
Donald Sharp [Fri, 3 Aug 2018 03:31:53 +0000 (23:31 -0400)]
pimd: On shutdown ensure wheel exists

On shutdown and cleaning up pim_upstream ensure that the
upstream_sg_wheel still exists to remove item from.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agopimd: Cleanup msdp.mg on shutdown
Donald Sharp [Fri, 3 Aug 2018 03:07:08 +0000 (23:07 -0400)]
pimd: Cleanup msdp.mg on shutdown

When shutting down PIM, ensure that hte pim->msdp.mg is cleaned up.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agopimd: Cleanup bfd memory on shutdown
Donald Sharp [Fri, 3 Aug 2018 02:56:55 +0000 (22:56 -0400)]
pimd: Cleanup bfd memory on shutdown

When shutting down pim, ensure that we cleanup bfd memory

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agopimd: Fix crash on shutdown in oil
Donald Sharp [Fri, 3 Aug 2018 00:27:53 +0000 (20:27 -0400)]
pimd: Fix crash on shutdown in oil

When shutting down, do not free oil information after
interface information since we use the data there to
do so.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agopimd: Don't leak wheel memory
Donald Sharp [Fri, 3 Aug 2018 00:25:41 +0000 (20:25 -0400)]
pimd: Don't leak wheel memory

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agopimd: Properly cleanup ssm
Donald Sharp [Fri, 3 Aug 2018 00:06:15 +0000 (20:06 -0400)]
pimd: Properly cleanup ssm

Properly cleanup the ssm data structure on termination.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agopimd: Cleanup rp_info->plist
Donald Sharp [Fri, 3 Aug 2018 00:02:13 +0000 (20:02 -0400)]
pimd: Cleanup rp_info->plist

PIM is leaking the plist data structure in some shutdown
cases.  Additionally trust XFREE

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agopim: Clean up some data on shutdown in msdp
Donald Sharp [Thu, 2 Aug 2018 23:58:24 +0000 (19:58 -0400)]
pim: Clean up some data on shutdown in msdp

We were leaking some msdp hash backets and a msdp stream
data pointer on shutdown.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agopimd: No need to call zprivs_terminate 2 times
Donald Sharp [Thu, 2 Aug 2018 23:52:15 +0000 (19:52 -0400)]
pimd: No need to call zprivs_terminate 2 times

frr_fini and pim_free both call zprivs_terminate.  There is
no need for pim_free to call this function.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agolib: Increase stream allocation speed.
Donald Sharp [Thu, 2 Aug 2018 17:42:15 +0000 (13:42 -0400)]
lib: Increase stream allocation speed.

Modify stream_new in this way:

1) ALLOC allocations do not fail, they cause a crash so remove
if tests for it.

2) Modify usage of XCALLOC to XMALLOC and then hand set all the
relevant data in the stream pointer.

With this modification stream allocation of 10000000 streams at
10k bytes each reduced from on average 1.43 seconds to 0.65 seconds.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agovtysh: Respect order dependancy of some pim commands
Donald Sharp [Thu, 2 Aug 2018 14:36:59 +0000 (10:36 -0400)]
vtysh: Respect order dependancy of some pim commands

If `ip igmp query-max-respone-time ` is specified allow it
to show up before `ip igmp query-interval ` since there
are order dependancies that may show up.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com.
6 years agopimd: Modify order of command output for vty output
Donald Sharp [Thu, 2 Aug 2018 14:35:14 +0000 (10:35 -0400)]
pimd: Modify order of command output for vty output

If `ip igmp query-max-response-time` is set move it to
display first as that this command has order dependencies
on `ip igmp query-interval`.

Ticket: CM-21598
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agolib: Fix vrf check output to only have 1 line
Donald Sharp [Tue, 31 Jul 2018 19:28:04 +0000 (15:28 -0400)]
lib: Fix vrf check output to only have 1 line

When we issue this command, we are getting:

robot# show ip route vrf green json
{}
% VRF green not found
robot# show ip route vrf green
% VRF green not found
% VRF green not found
robot#

Fix the command so it only displays one line of output
for json or non-json output.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>