]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
4 years agoMerge pull request #5022 from chiragshah6/mdev
Russ White [Tue, 15 Oct 2019 15:34:22 +0000 (11:34 -0400)]
Merge pull request #5022 from chiragshah6/mdev

bgpd: evpn fix advertise-svi-ip display in show commands

4 years agoMerge pull request #5152 from donaldsharp/evpn_es_not_locking
Russ White [Tue, 15 Oct 2019 15:09:12 +0000 (11:09 -0400)]
Merge pull request #5152 from donaldsharp/evpn_es_not_locking

Some bgp evpn fixes

4 years agoMerge pull request #5119 from lkrishnamoor/community-list
Donatas Abraitis [Tue, 15 Oct 2019 10:35:27 +0000 (13:35 +0300)]
Merge pull request #5119 from lkrishnamoor/community-list

bgpd: Implement "sh bgp l2vpn evpn community|large-community X"

4 years agobgpd: Implement "sh bgp l2vpn evpn community|large-community X"
Lakshman Krishnamoorthy [Mon, 7 Oct 2019 21:58:39 +0000 (14:58 -0700)]
bgpd: Implement "sh bgp l2vpn evpn community|large-community X"

Full output here: https://github.com/FRRouting/frr/pull/5119

Signed-off-by: Lakshman Krishnamoorthy <lkrishnamoor@vmware.com>
4 years agoMerge pull request #5130 from donaldsharp/as_path_json_maximum_overdrive
Donatas Abraitis [Tue, 15 Oct 2019 06:14:16 +0000 (09:14 +0300)]
Merge pull request #5130 from donaldsharp/as_path_json_maximum_overdrive

bgpd: AS paths are uint32_t instead of integers

4 years agoMerge pull request #5128 from chiragshah6/yang_dev
Renato Westphal [Tue, 15 Oct 2019 01:40:59 +0000 (22:40 -0300)]
Merge pull request #5128 from chiragshah6/yang_dev

yang: zebra modules formatting

4 years agobgpd: Be careful about displaying vni's as labels.
Donald Sharp [Tue, 15 Oct 2019 01:09:55 +0000 (21:09 -0400)]
bgpd: Be careful about displaying vni's as labels.

When a type 2/3 or 5 route is received, verified and the
resulting route generated is pushed into the appropriate vrf
the vni's associated with the route are also passed in.
This is showing up as a Remote label when you dump
the route in bgp:

BGP routing table entry for 0.0.0.0/0^M
Paths: (1 available, best #1, table third)
   Advertised to non peer-group peers:
   10.10.120.22
   42001 42005 42006 42055
     10.10.120.22 from 10.10.120.22 (10.10.255.193)
       Origin IGP, valid, external, bestpath-from-AS 42001, best
       Remote label: 62750
       AddPath ID: RX 0, TX 2
       Last update: Fri Oct 11 12:59:56 2019

The `Remote label: 62750` is the mpls label version of the
vni passed in.  This is meaningless and confusing to the end
user.  Do not display this information.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agobgpd: Refactor bgp_path_info creation
Donald Sharp [Tue, 15 Oct 2019 01:05:15 +0000 (21:05 -0400)]
bgpd: Refactor bgp_path_info creation

We are doing the same thing in multiple places.  Refactor.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agobgpd: Properly lock parent node for type4 routes
Donald Sharp [Tue, 15 Oct 2019 00:44:56 +0000 (20:44 -0400)]
bgpd: Properly lock parent node for type4 routes

When creating a bgp_path_info for a type 4 route the pi->extra->parent
and the route node for the originating table were not being locked
properly.  This will prevent BGP from not properly cleaning up
the data structures on cleanup.

Possibly every one of the functions that we use to create the
new bgp_path_info's should use an abstracted version of this code,
but I am unsure at this point in time if a type 4 should use the same
or not.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agoMerge pull request #5083 from zays26/feature/vtysh-master
Quentin Young [Mon, 14 Oct 2019 19:34:44 +0000 (15:34 -0400)]
Merge pull request #5083 from zays26/feature/vtysh-master

vtysh: fix searching commands in parent nodes

4 years agoMerge pull request #5148 from qlyoung/fix-bgp-read-assert
Lou Berger [Mon, 14 Oct 2019 18:45:03 +0000 (14:45 -0400)]
Merge pull request #5148 from qlyoung/fix-bgp-read-assert

bgpd: move assert out of error case

4 years agoMerge pull request #5132 from sworleys/Fix-IF-Infinite-Loop
Russ White [Mon, 14 Oct 2019 18:21:19 +0000 (14:21 -0400)]
Merge pull request #5132 from sworleys/Fix-IF-Infinite-Loop

*: Fix Interface Infinite Loop Walk and Cleanup if_create Codepath

4 years agoRevert "Merge pull request #4885 from satheeshkarra/pim_mlag"
Quentin Young [Mon, 14 Oct 2019 17:15:09 +0000 (17:15 +0000)]
Revert "Merge pull request #4885 from satheeshkarra/pim_mlag"

This reverts commit d563896dada99f3474d428f928786cbfde936fee, reversing
changes made to 09ea1a40386f02a13cdb0462cc55af0d03f0c277.

4 years agobgpd: move assert out of error case
Quentin Young [Mon, 14 Oct 2019 16:09:36 +0000 (16:09 +0000)]
bgpd: move assert out of error case

bgp_process_packets has an assert to make sure an appropriate amount of
working space in the input buffer has been freed up for future reads.
However, this assert shouldn't be made when we have encountered an error
that's going to tear down the session, because in this case we may not
be able to process the full contents of the input buffer.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
4 years agoMerge pull request #5141 from opensourcerouting/bfdd-fixes-bundle
Donald Sharp [Mon, 14 Oct 2019 12:15:57 +0000 (08:15 -0400)]
Merge pull request #5141 from opensourcerouting/bfdd-fixes-bundle

bfdd: pack of bug fixes

4 years agoMerge pull request #5117 from ton31337/fix/remove_deprecation_for_ip_prefix
Donald Sharp [Mon, 14 Oct 2019 12:14:05 +0000 (08:14 -0400)]
Merge pull request #5117 from ton31337/fix/remove_deprecation_for_ip_prefix

bgpd: Remove depracated `ip` prefix for as-path/extcommunity/large/co…

4 years agoMerge pull request #5142 from opensourcerouting/northbound-perf
Donald Sharp [Mon, 14 Oct 2019 12:08:35 +0000 (08:08 -0400)]
Merge pull request #5142 from opensourcerouting/northbound-perf

Northbound optimizations

4 years agoMerge pull request #4885 from satheeshkarra/pim_mlag
Jafar Al-Gharaibeh [Mon, 14 Oct 2019 06:07:24 +0000 (01:07 -0500)]
Merge pull request #4885 from satheeshkarra/pim_mlag

pimd, lib, Zebra: PIM MLAG Support

4 years agolib: use `prefix` for yang get prefix wrapper
Rafael Zalamena [Fri, 11 Oct 2019 23:15:46 +0000 (20:15 -0300)]
lib: use `prefix` for yang get prefix wrapper

This change fixes a static analyzer warning and should also make us
safer when using this function. At the moment the code that triggered
the warning is the only one that uses this function.

Passing anything other than `struct prefix` to `str2prefix` function is
dangerous, because the structure might be smaller than expected and we
might have an buffer overflow.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
4 years agolib: reduce memory allocation when processing large config transactions
Renato Westphal [Thu, 10 Oct 2019 01:20:26 +0000 (22:20 -0300)]
lib: reduce memory allocation when processing large config transactions

Remove the xpath field from the nb_config_cb structure in order
to reduce its size. This allows the northbound to spend less time
allocating memory during the processing of large configuration
transactions.

To make this work, use yang_dnode_get_path() to obtain the xpath
from the dnode field whenever necessary.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
4 years agolib: fix processing of the 'apply_finish' callbacks
Renato Westphal [Thu, 10 Oct 2019 02:24:04 +0000 (23:24 -0300)]
lib: fix processing of the 'apply_finish' callbacks

Commit 6b5d6e2dbc88 changed how we order configuration callbacks
and introduced a regression in the processing of the 'apply_finish'
callbacks. Fix this.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
4 years agolib: optimize loading of the startup configuration
Renato Westphal [Thu, 10 Oct 2019 01:17:08 +0000 (22:17 -0300)]
lib: optimize loading of the startup configuration

Load the startup configuration directly into the CLI shared candidate
configuration instead of loading it into a private candidate
configuration. This way we don't need to initialize the shared
candidate separately later as a copy of the running configuration,
which is a potentially expensive operation.

Also, make the northbound process SIGHUP correctly even when --tcli
is not used.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
4 years agolib: avoid expensive operations when editing a candidate config
Renato Westphal [Sun, 6 Oct 2019 04:16:47 +0000 (01:16 -0300)]
lib: avoid expensive operations when editing a candidate config

nb_candidate_edit() was calling both the lyd_schema_sort() and
lyd_validate() functions whenever a new node was added to the
candidate configuration. This was done to ensure the candidate
is always ready to be displayed correctly (libyang only creates
default child nodes during the validation process, and data nodes
aren't guaranteed to be ordered by default).

The problem is that the two aforementioned functions are too
expensive to be called in the northbound hot path. Instead, it makes
more sense to call them only before displaying the configuration
(in which case a recursive sort needs to be done). Introduce the
nb_cli_show_config_prepare() to achieve that purpose.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
4 years agolib: remove expensive error handling in the northbound CLI client
Renato Westphal [Sun, 6 Oct 2019 00:20:28 +0000 (21:20 -0300)]
lib: remove expensive error handling in the northbound CLI client

The nb_cli_apply_changes() function was creating a full copy of
the candidate configuration before editing it. This excerpt from
the northbond documentation explains why this was being done:
 "NOTE: the nb_cli_cfg_change() function clones the candidate
  configuration before actually editing it. This way, if any error
  happens during the editing, the original candidate is restored to
  avoid inconsistencies. Either all changes from the configuration
  command are performed successfully or none are. It's like a
  mini-transaction but happening on the candidate configuration
  (thus the northbound callbacks are not involved)".

The problem is that this kind of error handling is just too
expensive. A command should never fail to edit the candidate
configuration unless there's a bug in the code (e.g. when the
CLI wrapper command passes an integer value that YANG rejects due
to a "range" statement). In such cases, a command might fail to
be applied or applied only partially if it edits multiple YANG
nodes. When that happens, just log an error to make the operator
aware of the problem, but otherwise ignore it instead of rejecting
the command and restoring the candidate to its previous state. We
shouldn't add an extreme overhead to the northbound CLI client only
to handle errors that should never happen in practice.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
4 years agolib: optimize VTY_CHECK_XPATH
Renato Westphal [Sat, 5 Oct 2019 23:52:36 +0000 (20:52 -0300)]
lib: optimize VTY_CHECK_XPATH

There's no need to check for removed configuration objects in the
following two cases:
* A private candidate configuration is being edited;
* The startup configuration is being read.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
4 years agobfdd: don't allow link-local without interface
Rafael Zalamena [Fri, 11 Oct 2019 19:54:51 +0000 (16:54 -0300)]
bfdd: don't allow link-local without interface

When using link-local addresses we must provide scope-id to the
operating system so it knows where to send packets.

Spotted by Pavel Ivashchenko (@zays26).

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
4 years agobfdd: simplify session observers code
Rafael Zalamena [Fri, 11 Oct 2019 19:13:24 +0000 (16:13 -0300)]
bfdd: simplify session observers code

Don't be selective about what to observe, always observe all possible
aspects of the session that may change on run-time (i.e. bind address,
interface and VRF existence).

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
4 years agobfdd: set session down after disabling it
Rafael Zalamena [Fri, 11 Oct 2019 16:12:26 +0000 (13:12 -0300)]
bfdd: set session down after disabling it

If a session is no longer able to send/receive packets, it is very
likely it will be down in a few milliseconds so lets speed up the
process and correctly mark it as down.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
4 years agolib: require json-c
Quentin Young [Fri, 11 Oct 2019 16:15:38 +0000 (16:15 +0000)]
lib: require json-c

We have unsigned 4 byte integrals in the codebase that end up in json
output, so we need to force a json library that can handle these.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
4 years agoMerge pull request #5138 from ghasemnaddaf/vrrp_updates
Quentin Young [Fri, 11 Oct 2019 16:04:32 +0000 (12:04 -0400)]
Merge pull request #5138 from ghasemnaddaf/vrrp_updates

doc: minor updates to vrrp doc

4 years agodoc: minor updates to vrrp doc
Ghasem Naddaf [Fri, 11 Oct 2019 15:28:12 +0000 (08:28 -0700)]
doc: minor updates to vrrp doc

fix wrapping and indentation

Signed-off-by: Ghasem Naddaf <ghasem.naddaf@gmail.com>
4 years agobfdd: disable sockets polling before closing it
Rafael Zalamena [Fri, 11 Oct 2019 14:15:56 +0000 (11:15 -0300)]
bfdd: disable sockets polling before closing it

Otherwise the `thread_read` will keep waking us up to handle closing
sockets which are never unregistered.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
4 years agobfdd: upon vrf disable, unlink bfd session with vrf
Philippe Guibert [Thu, 10 Oct 2019 07:07:21 +0000 (09:07 +0200)]
bfdd: upon vrf disable, unlink bfd session with vrf

bfd session has a vrf pointer that needs to be reset, when vrf is
disabled.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
4 years agobfdd: Fixing coredump in log
SumitAgarwal123 [Thu, 19 Sep 2019 10:04:48 +0000 (03:04 -0700)]
bfdd: Fixing coredump in log

Param missing in debug log, leading to coredump

Signed-off-by: Sayed Mohd Saquib <sayed.saquib@broadcom.com>
4 years agoMerge pull request #5131 from donaldsharp/extra_clean
Russ White [Fri, 11 Oct 2019 11:24:39 +0000 (07:24 -0400)]
Merge pull request #5131 from donaldsharp/extra_clean

bgpd: When creating extra from stack ensure it is zero'ed out

4 years agoMerge pull request #4265 from pguibert6WIND/bgp_export_entries_to_table
Donald Sharp [Fri, 11 Oct 2019 01:28:51 +0000 (21:28 -0400)]
Merge pull request #4265 from pguibert6WIND/bgp_export_entries_to_table

bgpd: ability to export prefixes entries to a kernel table identifier

4 years agodoc: minor updates to vrrp doc
Ghasem Naddaf [Thu, 10 Oct 2019 23:04:58 +0000 (16:04 -0700)]
doc: minor updates to vrrp doc

clarify IPv6 address, debug config and default version

Signed-off-by: Ghasem Naddaf <ghasem.naddaf@gmail.com>
4 years agoyang: add range to string nodes in zebra modules
Chirag Shah [Wed, 9 Oct 2019 01:17:12 +0000 (18:17 -0700)]
yang: add range to string nodes in zebra modules

Add range to few of the string nodes
(including vrf, iptable names)
Use interface reference instead of interface string.

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
4 years agoyang: align indent zebra modules
Chirag Shah [Sat, 5 Oct 2019 02:09:41 +0000 (19:09 -0700)]
yang: align indent zebra modules

Align zebra yang files based on pyang lint format.

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
4 years agozebra: entries can be pushed in tables, under vrf netns backend
Philippe Guibert [Tue, 9 Jul 2019 09:09:19 +0000 (11:09 +0200)]
zebra: entries can be pushed in tables, under vrf netns backend

initially, vrf backend if vrf-lite, and a specific table identifier is
associated to a vrf. here, with netns vrf backend, there is no specific
table assigned to except default routing table. use the passed table_id
parameter in zapi api, and apply it to the entry to be pushed in, or to
be removed.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
4 years agobgpd: withdraw fib entry on appropriate table identifier
Philippe Guibert [Tue, 9 Jul 2019 08:59:14 +0000 (10:59 +0200)]
bgpd: withdraw fib entry on appropriate table identifier

There are cases where the table identifier is set on a bgp entry, mainly
due to route-map, and associate fib entry needs to be removed.
This change encompasses also the route-map reconfiguration that leads to
removing the previous entry, whereas bgp update had been triggered (
this happens when software inbound reconfiguration is handled).

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
4 years agobgpd: ability to export prefixes entries to a kernel table identifier
Philippe Guibert [Mon, 29 Apr 2019 13:26:01 +0000 (15:26 +0200)]
bgpd: ability to export prefixes entries to a kernel table identifier

this table identifier can be used for policy routing. incoming entries
are locally exported to that local table identifier.
note that so that the user applies the new table identifier to all
entries, the user should flush local tables first.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
4 years agolib: Fix read beyond end of data structure
Donald Sharp [Thu, 10 Oct 2019 12:52:54 +0000 (08:52 -0400)]
lib: Fix read beyond end of data structure

Our Address Sanitizer CI is finding this issue:
error 09-Oct-2019 19:28:33 r4: bgpd triggered an exception by AddressSanitizer
error 09-Oct-2019 19:28:33 ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7ffdd425b060 at pc 0x00000068575f bp 0x7ffdd4258550 sp 0x7ffdd4258540
error 09-Oct-2019 19:28:33 READ of size 1 at 0x7ffdd425b060 thread T0
error 09-Oct-2019 19:28:33     #0 0x68575e in prefix_cmp lib/prefix.c:776
error 09-Oct-2019 19:28:33     #1 0x5889f5 in rfapiItBiIndexSearch bgpd/rfapi/rfapi_import.c:2230
error 09-Oct-2019 19:28:33     #2 0x5889f5 in rfapiBgpInfoFilteredImportVPN bgpd/rfapi/rfapi_import.c:3520
error 09-Oct-2019 19:28:33     #3 0x58b909 in rfapiProcessWithdraw bgpd/rfapi/rfapi_import.c:4071
error 09-Oct-2019 19:28:33     #4 0x4c459b in bgp_withdraw bgpd/bgp_route.c:3736
error 09-Oct-2019 19:28:33     #5 0x484122 in bgp_nlri_parse_vpn bgpd/bgp_mplsvpn.c:237
error 09-Oct-2019 19:28:33     #6 0x497f52 in bgp_nlri_parse bgpd/bgp_packet.c:315
error 09-Oct-2019 19:28:33     #7 0x49d06d in bgp_update_receive bgpd/bgp_packet.c:1598
error 09-Oct-2019 19:28:33     #8 0x49d06d in bgp_process_packet bgpd/bgp_packet.c:2274
error 09-Oct-2019 19:28:33     #9 0x6b9f54 in thread_call lib/thread.c:1531
error 09-Oct-2019 19:28:33     #10 0x657037 in frr_run lib/libfrr.c:1052
error 09-Oct-2019 19:28:33     #11 0x42d268 in main bgpd/bgp_main.c:486
error 09-Oct-2019 19:28:33     #12 0x7f806032482f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2082f)
error 09-Oct-2019 19:28:33     #13 0x42bcc8 in _start (/usr/lib/frr/bgpd+0x42bcc8)
error 09-Oct-2019 19:28:33
error 09-Oct-2019 19:28:33 Address 0x7ffdd425b060 is located in stack of thread T0 at offset 240 in frame
error 09-Oct-2019 19:28:33     #0 0x483945 in bgp_nlri_parse_vpn bgpd/bgp_mplsvpn.c:103
error 09-Oct-2019 19:28:33
error 09-Oct-2019 19:28:33   This frame has 5 object(s):
error 09-Oct-2019 19:28:33     [32, 36) 'label'
error 09-Oct-2019 19:28:33     [96, 108) 'rd_as'
error 09-Oct-2019 19:28:33     [160, 172) 'rd_ip'
error 09-Oct-2019 19:28:33     [224, 240) 'prd' <== Memory access at offset 240 overflows this variable
error 09-Oct-2019 19:28:33     [288, 336) 'p'
error 09-Oct-2019 19:28:33 HINT: this may be a false positive if your program uses some custom stack unwind mechanism or swapcontext
error 09-Oct-2019 19:28:33       (longjmp and C++ exceptions *are* supported)
error 09-Oct-2019 19:28:33 SUMMARY: AddressSanitizer: stack-buffer-overflow lib/prefix.c:776 prefix_cmp
error 09-Oct-2019 19:28:33 Shadow bytes around the buggy address:
error 09-Oct-2019 19:28:33   0x10003a8435b0: 00 00 00 00 00 00 f1 f1 f1 f1 00 00 00 00 00 00
error 09-Oct-2019 19:28:33   0x10003a8435c0: 00 00 00 00 00 00 00 00 00 00 f3 f3 f3 f3 f3 f3
error 09-Oct-2019 19:28:33   0x10003a8435d0: f3 f3 00 00 00 00 00 00 00 00 00 00 00 00 00 00
error 09-Oct-2019 19:28:33   0x10003a8435e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 f1 f1
error 09-Oct-2019 19:28:33   0x10003a8435f0: f1 f1 04 f4 f4 f4 f2 f2 f2 f2 00 04 f4 f4 f2 f2
error 09-Oct-2019 19:28:33 =>0x10003a843600: f2 f2 00 04 f4 f4 f2 f2 f2 f2 00 00[f4]f4 f2 f2
error 09-Oct-2019 19:28:33   0x10003a843610: f2 f2 00 00 00 00 00 00 f4 f4 f3 f3 f3 f3 00 00
error 09-Oct-2019 19:28:33   0x10003a843620: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
error 09-Oct-2019 19:28:33   0x10003a843630: 00 00 00 00 00 00 00 00 00 00 f1 f1 f1 f1 02 f4
error 09-Oct-2019 19:28:33   0x10003a843640: f4 f4 f2 f2 f2 f2 04 f4 f4 f4 f2 f2 f2 f2 00 00
error 09-Oct-2019 19:28:33   0x10003a843650: f4 f4 f2 f2 f2 f2 00 00 00 00 f2 f2 f2 f2 00 00
error 09-Oct-2019 19:28:33 Shadow byte legend (one shadow byte represents 8 application bytes):
error 09-Oct-2019 19:28:33   Addressable:           00
error 09-Oct-2019 19:28:33   Partially addressable: 01 02 03 04 05 06 07
error 09-Oct-2019 19:28:33   Heap left redzone:       fa
error 09-Oct-2019 19:28:33   Heap right redzone:      fb
error 09-Oct-2019 19:28:33   Freed heap region:       fd
error 09-Oct-2019 19:28:33   Stack left redzone:      f1
error 09-Oct-2019 19:28:33   Stack mid redzone:       f2
error 09-Oct-2019 19:28:33   Stack right redzone:     f3
error 09-Oct-2019 19:28:33   Stack partial redzone:   f4
error 09-Oct-2019 19:28:33   Stack after return:      f5
error 09-Oct-2019 19:28:33   Stack use after scope:   f8
error 09-Oct-2019 19:28:33   Global redzone:          f9
error 09-Oct-2019 19:28:33   Global init order:       f6
error 09-Oct-2019 19:28:33   Poisoned by user:        f7
error 09-Oct-2019 19:28:33   Container overflow:      fc
error 09-Oct-2019 19:28:33   Array cookie:            ac
error 09-Oct-2019 19:28:33   Intra object redzone:    bb
error 09-Oct-2019 19:28:33   ASan internal:           fe
error 09-Oct-2019 19:28:36 r3: Daemon bgpd not running

This is the result of this code pattern in rfapi/rfapi_import.c:

prefix_cmp((struct prefix *)&bpi_result->extra->vnc.import.rd,
   (struct prefix *)prd))

Effectively prd or vnc.import.rd are `struct prefix_rd` which
are being typecast to a `struct prefix`.  Not a big deal except commit
1315d74de97be2944d7b005b2f9a50e9ae5eff4d modified the prefix_cmp
function to allow for a sorted prefix_cmp.  In prefix_cmp
we were looking at the offset and shift.  In the case
of vnc we were passing a prefix length of 64 which is the exact length of
the remaining data structure for struct prefix_rd.  So we calculated
a offset of 8 and a shift of 0.  The data structures for the prefix
portion happened to be equal to 64 bits of data. So we checked that
with the memcmp got a 0 and promptly read off the end of the data
structure for the numcmp.  The fix is if shift is 0 that means thei
the memcmp has checked everything and there is nothing to do.

Please note: We will still crash if we set the prefixlen > then
~312 bits currently( ie if the prefixlen specifies a bit length
longer than the prefix length ).  I do not think there is
anything to do here( nor am I sure how to correct this either )
as that we are going to have some severe problems when we muck
up the prefixlen.

Fixes: #5025
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agobgpd: Ensure that struct prefix_rd rd is zero'ed out
Donald Sharp [Thu, 10 Oct 2019 12:52:13 +0000 (08:52 -0400)]
bgpd: Ensure that struct prefix_rd rd is zero'ed out

We are passing around the created rd, Just make sure that
the data is zero'ed out.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agobgpd: When creating extra from stack ensure it is zero'ed out
Donald Sharp [Thu, 10 Oct 2019 00:19:56 +0000 (20:19 -0400)]
bgpd: When creating extra from stack ensure it is zero'ed out

BGP code assumes that the extra data is zero'ed out.  Ensure that we
are not leaving any situation that the data on the stack is actually all
0's when we pass it around as a pointer later.

Please note in issue #5025, Lou reported a different valgrind
issue, which is not the same issue:

==7313== Conditional jump or move depends on uninitialised value(s)
==7313== at 0x181F9F: subgroup_announce_check (bgp_route.c:1555)
==7313== by 0x1A112B: subgroup_announce_table (bgp_updgrp_adv.c:641)
==7313== by 0x1A1340: subgroup_announce_route (bgp_updgrp_adv.c:704)
==7313== by 0x1A13E3: subgroup_coalesce_timer (bgp_updgrp_adv.c:331)
==7313== by 0x4EBA615: thread_call (thread.c:1531)
==7313== by 0x4E8AC37: frr_run (libfrr.c:1052)
==7313== by 0x1429E0: main (bgp_main.c:486)
==7313==
==7313== Conditional jump or move depends on uninitialised value(s)
==7313== at 0x201C0E: rfapi_vty_out_vncinfo (rfapi_vty.c:429)
==7313== by 0x18D0D6: route_vty_out (bgp_route.c:7481)
==7313== by 0x18DD76: bgp_show_table (bgp_route.c:9365)
==7313== by 0x1930C4: bgp_show_table_rd (bgp_route.c:9471)
==7313== by 0x1932A3: bgp_show (bgp_route.c:9510)
==7313== by 0x193E68: show_ip_bgp_json (bgp_route.c:10284)
==7313== by 0x4E6D024: cmd_execute_command_real.isra.2 (command.c:1072)
==7313== by 0x4E6F51E: cmd_execute_command (command.c:1131)
==7313== by 0x4E6F686: cmd_execute (command.c:1285)
==7313== by 0x4EBF9C4: vty_command (vty.c:516)
==7313== by 0x4EBFB9F: vty_execute (vty.c:1285)
==7313== by 0x4EC250F: vtysh_read (vty.c:2119)
==7313==

that is causing the actual crash.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agoMerge pull request #5129 from qlyoung/doc-yang-style
Donatas Abraitis [Thu, 10 Oct 2019 07:05:41 +0000 (10:05 +0300)]
Merge pull request #5129 from qlyoung/doc-yang-style

doc: add style guide for YANG

4 years ago*: Cleanup interface creation apis
Stephen Worley [Wed, 9 Oct 2019 23:50:13 +0000 (19:50 -0400)]
*: Cleanup interface creation apis

Cleanup the interface creation apis to make it more
clear what they are doing.

Make it explicit that the creation via name/ifindex will
only add it to the appropriate list.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agolib: Don't add/del from name tree if name isnt set
Stephen Worley [Wed, 9 Oct 2019 23:35:46 +0000 (19:35 -0400)]
lib: Don't add/del from name tree if name isnt set

If the name has not been set yet (we were only passed the
ifindex in some cases like with master/slave timings) then
do not add/del it from the ifname rb tree on the vrf struct.

Doing so causes duplicate entries on the tree and infinte loops
can happen when iterating over it.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agolib: Use correct if compare function in tree proto
Stephen Worley [Wed, 9 Oct 2019 20:43:27 +0000 (16:43 -0400)]
lib: Use correct if compare function in tree proto

We were using the incorrect comparison function for the
ifindex-based rb tree. Luckily, we were using the correct one
in RB_GENERATE so I guess that overwrote what was declared in the
prototype?

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years ago*: add ietf routing types yang module in makefile
Chirag Shah [Wed, 9 Oct 2019 20:19:50 +0000 (13:19 -0700)]
*: add ietf routing types yang module in makefile

Adding ietf routing types yang module to makefile

lib: Adding this yang module to common place
so it can be accessed from all frr modules.

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
4 years agoyang: add ietf routing types module
Chirag Shah [Fri, 4 Oct 2019 20:49:03 +0000 (13:49 -0700)]
yang: add ietf routing types module

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
4 years agobgpd: AS paths are uint32_t instead of integers
Donald Sharp [Wed, 9 Oct 2019 20:10:44 +0000 (16:10 -0400)]
bgpd: AS paths are uint32_t instead of integers

We have some JSON output that was displaying high order
AS path data as negative numbers:

{
 "paths":[
    {
      "aspath":{
        "string":"4200010118 4200010000 20473 1299",
        "segments":[
          {
            "type":"as-sequence",
            "list":[
              -94957178,
              -94957296,
              20473,
              1299
            ]
          }
        ],

Notice "String" output -vs- the list.

With fixed code:

  "paths":[
    {
      "aspath":{
        "string":"64539 4294967000 15096 6939 7922 7332 4249",
        "segments":[
          {
            "type":"as-sequence",
            "list":[
              64539,
              4294967000,
              15096,
              6939,
              7922,
              7332,
              4249
            ]
          }
        ],

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agoMerge pull request #5126 from qlyoung/fix-grpc-build
Renato Westphal [Wed, 9 Oct 2019 19:43:33 +0000 (16:43 -0300)]
Merge pull request #5126 from qlyoung/fix-grpc-build

lib: fix gRPC northbound plugin build

4 years agodoc: add style guide for YANG
Quentin Young [Wed, 9 Oct 2019 19:27:13 +0000 (19:27 +0000)]
doc: add style guide for YANG

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
4 years agoMerge pull request #5127 from opensourcerouting/asan-updates
Quentin Young [Wed, 9 Oct 2019 15:58:56 +0000 (11:58 -0400)]
Merge pull request #5127 from opensourcerouting/asan-updates

configure.ac/doc: update address sanitizer pointers

4 years agoMerge pull request #5125 from donaldsharp/pim_warnings_to_debugs
Donatas Abraitis [Wed, 9 Oct 2019 12:38:29 +0000 (15:38 +0300)]
Merge pull request #5125 from donaldsharp/pim_warnings_to_debugs

pimd: Fix zlog_warn when we mean debug and vice versa

4 years agodoc: update topotests doc for address sanitizer
Rafael Zalamena [Wed, 9 Oct 2019 00:35:06 +0000 (21:35 -0300)]
doc: update topotests doc for address sanitizer

Use the `--enable-address-sanitizer` option instead of the manual
version using environment flags.

This also avoids the problem of having to remember to skip clippy with
the custom flags:

```
make -C lib CFLAGS="-g -O2" LDFLAGS="-g" clippy
```

The snippet above is not needed with `--enable-address-sanitizer`!

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
4 years agoconfigure.ac: fix memory sanitizer test
Rafael Zalamena [Tue, 8 Oct 2019 23:47:38 +0000 (20:47 -0300)]
configure.ac: fix memory sanitizer test

We should test for `-fsanitize=memory` instead of `-fsanitize=thread`
when enabling memory sanitizer. While here, fix the error message.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
4 years agolib: fix gRPC northbound plugin build
Quentin Young [Tue, 8 Oct 2019 19:13:50 +0000 (19:13 +0000)]
lib: fix gRPC northbound plugin build

Some issues with our internal vector type being typedef'd as `vector`,
which conflicts with the C++ standard vector class...

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
4 years agoMerge pull request #5120 from sworleys/PBR-LL-FIX
Jafar Al-Gharaibeh [Tue, 8 Oct 2019 16:49:02 +0000 (09:49 -0700)]
Merge pull request #5120 from sworleys/PBR-LL-FIX

pbrd: Don't track ipv6 link locals

4 years agoMerge pull request #5121 from idryzhov/remove-brackets
Quentin Young [Tue, 8 Oct 2019 15:36:22 +0000 (11:36 -0400)]
Merge pull request #5121 from idryzhov/remove-brackets

*: remove redundant brackets in commands

4 years agoMerge pull request #5123 from idryzhov/fix-typo
Quentin Young [Tue, 8 Oct 2019 15:34:36 +0000 (11:34 -0400)]
Merge pull request #5123 from idryzhov/fix-typo

lib: fix typo

4 years agopimd: Fix zlog_warn when we mean debug and vice versa
Donald Sharp [Tue, 8 Oct 2019 14:36:02 +0000 (10:36 -0400)]
pimd: Fix zlog_warn when we mean debug and vice versa

There are several places in the pim where we are mixing up
zlog_warn w/ zlog_debug and vice versa.  If we are protecting
a zlog_warn w/ a debug is it really a warn?  If we have an actual
error situation we should also warn about it.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agolib: fix typo
Igor Ryzhov [Tue, 8 Oct 2019 13:52:33 +0000 (16:52 +0300)]
lib: fix typo

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
4 years ago*: remove redundant brackets in commands
Igor Ryzhov [Tue, 8 Oct 2019 12:30:38 +0000 (15:30 +0300)]
*: remove redundant brackets in commands

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
4 years agovtysh: fix searching commands in parent nodes
Pavel Ivashchenko [Mon, 30 Sep 2019 15:57:10 +0000 (15:57 +0000)]
vtysh: fix searching commands in parent nodes

  Do not check parent command nodes in case of ambiguous and incomplete commands

Signed-off-by: Pavel Ivashchenko <pivashchenko@nfware.com>
4 years agodoc: Replace `ip` prefix for as-path and community lists to `bgp`
Donatas Abraitis [Tue, 8 Oct 2019 06:08:36 +0000 (09:08 +0300)]
doc: Replace `ip` prefix for as-path and community lists to `bgp`

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
4 years agobgpd: Remove depracated `ip` prefix for as-path/extcommunity/large/communities
Donatas Abraitis [Mon, 2 Sep 2019 15:11:40 +0000 (18:11 +0300)]
bgpd: Remove depracated `ip` prefix for as-path/extcommunity/large/communities

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
4 years agopbrd: Don't track ipv6 link locals
Stephen Worley [Mon, 7 Oct 2019 22:01:21 +0000 (18:01 -0400)]
pbrd: Don't track ipv6 link locals

Don't bother tracking ipv6 link locals to determine if a map
should be installed. Every interface has a route of `fe80::/64`
so its just going to return the arbitrarily first one it finds
when it resolves it and hands it back to us.

Instead, just track the interface we specify along with it.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agoMerge pull request #5112 from qlyoung/cli-reject-ipv4-leading-zero
Jafar Al-Gharaibeh [Mon, 7 Oct 2019 20:05:09 +0000 (13:05 -0700)]
Merge pull request #5112 from qlyoung/cli-reject-ipv4-leading-zero

lib: reject leading 0 in ipv4 decimal quad

4 years agoMerge pull request #5105 from donaldsharp/watchfrr_more_systemd_status
Donatas Abraitis [Mon, 7 Oct 2019 17:46:46 +0000 (20:46 +0300)]
Merge pull request #5105 from donaldsharp/watchfrr_more_systemd_status

lib, watchfrr: Add some additional status messages to systemd

4 years agoMerge pull request #5106 from ton31337/fix/maximum-prefix_uint16_to_uint32
Quentin Young [Mon, 7 Oct 2019 16:33:04 +0000 (12:33 -0400)]
Merge pull request #5106 from ton31337/fix/maximum-prefix_uint16_to_uint32

bgpd: Use uint32_t for maximum-prefix

4 years agolib: reject leading 0 in ipv4 decimal quad
Quentin Young [Mon, 7 Oct 2019 15:36:39 +0000 (15:36 +0000)]
lib: reject leading 0 in ipv4 decimal quad

inet_pton() is used to parse ipv4 addresses internally, therefore FRR
does not support octal notation for quads. The ipv4 cli token validator
should make sure that str2prefix() can parse tokens it allows, and
str2prefix uses inet_pton, so we have to disallow leading zeros in ipv4
quads.

In short, 1.1.1.01 is no longer valid and must be expressed as 1.1.1.1.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
4 years agoMerge pull request #4964 from ashish12pant/ecmp_tests
Martin Winter [Fri, 4 Oct 2019 19:02:27 +0000 (21:02 +0200)]
Merge pull request #4964 from ashish12pant/ecmp_tests

tests: Fix bgp-ecmp-topo2

4 years agoMerge branch 'master' into ecmp_tests
Martin Winter [Fri, 4 Oct 2019 13:19:17 +0000 (15:19 +0200)]
Merge branch 'master' into ecmp_tests

4 years agoMerge pull request #5005 from Frankkkkk/dockerfile
Donatas Abraitis [Fri, 4 Oct 2019 12:51:23 +0000 (13:51 +0100)]
Merge pull request #5005 from Frankkkkk/dockerfile

Make docker images lighter and with less layers

4 years agobgpd: Use uint32_t for maximum-prefix
Donatas Abraitis [Thu, 3 Oct 2019 21:30:28 +0000 (00:30 +0300)]
bgpd: Use uint32_t for maximum-prefix

Currently we have unsigned long which is not what we defined
in CLI (1-4294967295).

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
4 years agoMerge pull request #5082 from donaldsharp/add_bgp_rr_ibgp_topotest
Donatas Abraitis [Fri, 4 Oct 2019 10:32:20 +0000 (11:32 +0100)]
Merge pull request #5082 from donaldsharp/add_bgp_rr_ibgp_topotest

tests: Add a topology that shows broken ibgp Route Reflector behavior

4 years agoZebra: Fixing Review comments in Zebra_MLAG
Satheesh Kumar K [Tue, 24 Sep 2019 09:29:15 +0000 (02:29 -0700)]
Zebra: Fixing Review comments in Zebra_MLAG

Signed-off-by: Satheesh Kumar K <sathk@cumulusnetworks.com>
4 years agolib, watchfrr: Add some additional status messages to systemd
Donald Sharp [Fri, 4 Oct 2019 01:09:28 +0000 (21:09 -0400)]
lib, watchfrr: Add some additional status messages to systemd

Allow systemd to be informed about operational state so operators can
infer a bit about what is going on with FRR from the systemd status
cli.

sharpd@robot ~/frr4> systemctl status frr
● frr.service - FRRouting
   Loaded: loaded (/usr/lib/systemd/system/frr.service; enabled; vendor preset: disabled)
   Active: active (running) since Thu 2019-10-03 21:09:04 EDT; 7s ago
     Docs: https://frrouting.readthedocs.io/en/latest/setup.html
  Process: 32455 ExecStart=/usr/lib/frr/frrinit.sh start (code=exited, status=0/SUCCESS)
   Status: "FRR Operational"
    Tasks: 12 (limit: 4915)
   Memory: 76.5M
   CGroup: /system.slice/frr.service
           ├─32468 /usr/lib/frr/watchfrr -d zebra bgpd staticd
           ├─32487 /usr/lib/frr/zebra -d -A 127.0.0.1 -s 90000000
           ├─32492 /usr/lib/frr/bgpd -d -A 127.0.0.1
           └─32500 /usr/lib/frr/staticd -d -A 127.0.0.1

Please note the `Status: ...` line above.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agoMerge pull request #5102 from donaldsharp/fix_some_warnings
Jafar Al-Gharaibeh [Thu, 3 Oct 2019 17:38:29 +0000 (10:38 -0700)]
Merge pull request #5102 from donaldsharp/fix_some_warnings

Fix some warnings

4 years agoMerge pull request #5103 from donaldsharp/doc_dont
Donatas Abraitis [Thu, 3 Oct 2019 15:58:11 +0000 (18:58 +0300)]
Merge pull request #5103 from donaldsharp/doc_dont

doc: Add some additional warnings around Turning off bgp capabilities

4 years agoMerge pull request #5079 from mjstapp/fix_dplane_drop_at_shut
Donald Sharp [Thu, 3 Oct 2019 15:49:07 +0000 (11:49 -0400)]
Merge pull request #5079 from mjstapp/fix_dplane_drop_at_shut

zebra: during shutdown processing, drop dplane results

4 years agodoc: Add some additional warnings around Turning off bgp capabilities
Donald Sharp [Thu, 3 Oct 2019 13:26:46 +0000 (09:26 -0400)]
doc: Add some additional warnings around Turning off bgp capabilities

FRR supports the ability to turn off the negotation of bgp capabilities.
Provide a few bread crumbs to the operator that it might not be as
useful as they would hope.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agobgpd: bgp pointer may be null
Donald Sharp [Thu, 3 Oct 2019 12:57:55 +0000 (08:57 -0400)]
bgpd: bgp pointer may be null

The bgp pointer may not be actually found.  The debug
message that was using it could get the same value
another way.  Convert over

Fixes Coverity Scan Issue:

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agobgpd: Show to compiler that uint64_t -> uint32_t is ok here
Donald Sharp [Thu, 3 Oct 2019 12:55:29 +0000 (08:55 -0400)]
bgpd: Show to compiler that uint64_t -> uint32_t is ok here

We only have a uint32_t value here but clippy is wise and
gives us more data than we need. Tell the compiler we can
throw some stuff away.

This was found by inspecting CI results.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agotests: Enabling bgp-ecmp-topo2 test cases
Ashish Pant [Tue, 24 Sep 2019 04:50:08 +0000 (10:20 +0530)]
tests: Enabling bgp-ecmp-topo2 test cases

Signed-off-by: Ashish Pant <ashish12pant@gmail.com>
4 years agotests: Modify json for bgp-ecmp-topo2
Ashish Pant [Thu, 12 Sep 2019 04:41:59 +0000 (10:11 +0530)]
tests: Modify json for bgp-ecmp-topo2

Signed-off-by: Ashish Pant <ashish12pant@gmail.com>
Modified json files to configure route-map which prefer global
address

4 years agotests: Add topojson route-map for nexthop
Ashish Pant [Thu, 12 Sep 2019 04:30:00 +0000 (10:00 +0530)]
tests: Add topojson route-map for nexthop

Signed-off-by: Ashish Pant <ashish12pant@gmail.com>
Add route-map option for ipv6 nexthop

Fix typo in bgp configuration

4 years agotests: Fix topojson link local ipv6 address
Ashish Pant [Thu, 12 Sep 2019 04:24:44 +0000 (09:54 +0530)]
tests: Fix topojson link local ipv6 address

Signed-off-by: Ashish Pant <ashish12pant@gmail.com>
Removed code that disabled link local ipv6 address on the interface

4 years agoMerge pull request #5095 from donaldsharp/static_fix_for_ROUTE_ALL
Jafar Al-Gharaibeh [Wed, 2 Oct 2019 16:30:36 +0000 (09:30 -0700)]
Merge pull request #5095 from donaldsharp/static_fix_for_ROUTE_ALL

ZEBRA_ROUTE_ALL fix

4 years agozebra: Fix redistribution deletion for ZEBRA_ROUTE_ALL
Donald Sharp [Wed, 2 Oct 2019 13:29:19 +0000 (09:29 -0400)]
zebra: Fix redistribution deletion for ZEBRA_ROUTE_ALL

commit ee8a72f315013aecd45bc9c3aaf7ea81b2ca747a

broke the usage of ZEBRA_ROUTE_ALL as a valid redistribution
command.  This commit puts it back in.  LDP uses ZEBRA_ROUTE_ALL
as an option to say it is interested in all REDISTRIBUTION events.

Fixes: #5072
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agosharpd: Start infrastructure to allow for redistribution testing
Donald Sharp [Wed, 2 Oct 2019 13:27:04 +0000 (09:27 -0400)]
sharpd: Start infrastructure to allow for redistribution testing

Start the work in sharpd to allow the testing of redistribution
of routes.  Namely telling zebra to tell us about redistribution events
via the callback.

Future work here will allow sharpd to specify the redistribution
events it wants and to allow us to track that via counters.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agoMerge pull request #5090 from sworleys/Fix-Vrf_ID-Decode
Sri Mohana Singamsetty [Wed, 2 Oct 2019 02:22:53 +0000 (19:22 -0700)]
Merge pull request #5090 from sworleys/Fix-Vrf_ID-Decode

lib: Decode vrf_id update appropriately from zapi

4 years agoMerge pull request #5087 from opensourcerouting/topotest-skip-on-assert-failure
Donald Sharp [Tue, 1 Oct 2019 23:14:11 +0000 (19:14 -0400)]
Merge pull request #5087 from opensourcerouting/topotest-skip-on-assert-failure

topotests: skip tests when any assert fails

4 years agolib: Decode vrf_id update appropriately from zapi
Stephen Worley [Tue, 1 Oct 2019 23:02:33 +0000 (19:02 -0400)]
lib: Decode vrf_id update appropriately from zapi

The vrf_id in `zsend_interface_vrf_update()` is encoded as
a long via `stream_putl()`, we should decode it as such
as well.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agoMerge pull request #5086 from cfra/fix/isis-threeway
Donald Sharp [Tue, 1 Oct 2019 13:00:32 +0000 (09:00 -0400)]
Merge pull request #5086 from cfra/fix/isis-threeway

isisd: Fix handling of neighbor circuit id in three way handshake

4 years agotests: Add a topology that shows broken ibgp behavior
Donald Sharp [Mon, 30 Sep 2019 12:49:40 +0000 (08:49 -0400)]
tests: Add a topology that shows broken ibgp behavior

In a leaf/spine topology with only IBGP connections, where
the same network is being redistributed at multiple points
in the network ( say a redistribute connected at both leaf and spines )
we end up in a state where zebra gets very confused.

eva# show ip route
Codes: K - kernel route, C - connected, S - static, R - RIP,
       O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
       T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP,
       F - PBR, f - OpenFabric,
       > - selected route, * - FIB route, q - queued route, r - rejected route

C>* 192.168.1.0/24 is directly connected, tor1-eth0, 00:00:30
C>* 192.168.2.0/24 is directly connected, tor1-eth1, 00:00:30
B   192.168.3.0/24 [200/0] via 192.168.4.2 inactive, 00:00:25
                           via 192.168.6.2 inactive, 00:00:25
B>* 192.168.4.0/24 [200/0] via 192.168.2.3, tor1-eth1, 00:00:25
  *                        via 192.168.6.2 inactive, 00:00:25
C>* 192.168.5.0/24 is directly connected, tor1-eth2, 00:00:30
B>* 192.168.6.0/24 [200/0] via 192.168.4.2 inactive, 00:00:25
  *                        via 192.168.5.4, tor1-eth2, 00:00:25

Effectively we have ibgp routes recursing through ibgp routes
and there is no metric to discern whom to listen to.

This draft:
https://tools.ietf.org/html/draft-ietf-idr-bgp-optimal-route-reflection-19

appears to address this issue.  From looking at both cisco and arista
deployments they are handling this issue by having the route reflector
prefer the localy learned routes over from their clients.

Add this topology, in a broken state, so that when we do fix this issue
it is a simple matter of touching this topology up and re-adding it
to the normal daily builds.  I also wanted to add this topology
since it is in a state of `doneness` and I wanted to move onto
my normal day job without having to remember about this test.

This topology is not configured to be run as part of the normal
topotests.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agoisisd: Fix handling of neighbor circuit id in three way handshake
Christian Franke [Mon, 30 Sep 2019 23:53:44 +0000 (01:53 +0200)]
isisd: Fix handling of neighbor circuit id in three way handshake

RFC 5303 states:

      If the system ID and Extended Local Circuit ID of the neighboring
      system are known (in adjacency three-way state Initializing or
      Up), the neighbor's system ID SHALL be reported in the Neighbor
      System ID field, and the neighbor's Extended Local Circuit ID
      SHALL be reported in the Neighbor Extended Local Circuit ID field.

There is nothing written about only setting the Extended circuit ID of the
adjacency only when we bring the three-way adjacency up.

In fact, we should always update it, to avoid the problem described in #4783.

Fixes: #4783
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
4 years agoMerge pull request #5085 from qlyoung/strip-trailing-whitespace-2019
Renato Westphal [Tue, 1 Oct 2019 01:53:56 +0000 (22:53 -0300)]
Merge pull request #5085 from qlyoung/strip-trailing-whitespace-2019

*: strip trailing whitespace