]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
4 years agoMerge pull request #5332 from mjstapp/remove_zapi_label_flag
Donald Sharp [Fri, 6 Dec 2019 18:19:34 +0000 (13:19 -0500)]
Merge pull request #5332 from mjstapp/remove_zapi_label_flag

*: revise zapi nexthop encoding

4 years agoMerge pull request #5462 from dslicenc/ipv6-ra-lifetime-0
David Lamparter [Fri, 6 Dec 2019 17:23:39 +0000 (18:23 +0100)]
Merge pull request #5462 from dslicenc/ipv6-ra-lifetime-0

zebra: send RA lifetime of 0 before ceasing to advertise RAs

4 years agoMerge pull request #5226 from donaldsharp/interface_fixup
David Lamparter [Fri, 6 Dec 2019 17:21:51 +0000 (18:21 +0100)]
Merge pull request #5226 from donaldsharp/interface_fixup

Interface fixup

4 years agoMerge pull request #5468 from qlyoung/bgpd-remove-bgp-attr-dup
David Lamparter [Fri, 6 Dec 2019 17:19:28 +0000 (18:19 +0100)]
Merge pull request #5468 from qlyoung/bgpd-remove-bgp-attr-dup

bgpd: remove bgp_attr_dup

4 years agoMerge pull request #5218 from mjstapp/fix_topo_kernel_5
David Lamparter [Fri, 6 Dec 2019 17:18:28 +0000 (18:18 +0100)]
Merge pull request #5218 from mjstapp/fix_topo_kernel_5

topotests: Adapt to linux kernel 5+

4 years ago*: revise zapi nexthop encoding
Mark Stapp [Wed, 13 Nov 2019 21:06:06 +0000 (16:06 -0500)]
*: revise zapi nexthop encoding

Use a per-nexthop flag to indicate the presence of labels; add
some utility zapi encode/decode apis for nexthops; use the zapi
apis more consistently.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
4 years agolib: use const in several stream lib apis
Mark Stapp [Fri, 15 Nov 2019 19:32:18 +0000 (14:32 -0500)]
lib: use const in several stream lib apis

Add some const to some stream apis.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
4 years agoMerge pull request #5438 from sworleys/PBR-Fixes
Renato Westphal [Fri, 6 Dec 2019 15:04:05 +0000 (12:04 -0300)]
Merge pull request #5438 from sworleys/PBR-Fixes

pbrd: Assorted Fixes

4 years agoMerge pull request #5439 from mjstapp/nhg_add_labels
Renato Westphal [Fri, 6 Dec 2019 14:17:10 +0000 (11:17 -0300)]
Merge pull request #5439 from mjstapp/nhg_add_labels

lib: support labelled nexthops in nexthop_groups

4 years agotopotests: Adapt to linux kernel 5+
Mark Stapp [Wed, 23 Oct 2019 16:42:19 +0000 (12:42 -0400)]
topotests: Adapt to linux kernel 5+

Make a few changes to try to support topotests with vrfs
on kernel 5 and later.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
4 years agoMerge pull request #5288 from SumitAgarwal123/bfd_docs
Rafael Zalamena [Fri, 6 Dec 2019 12:35:13 +0000 (09:35 -0300)]
Merge pull request #5288 from SumitAgarwal123/bfd_docs

doc: Adding new CLI and updating existing show output

4 years agoMerge pull request #5493 from ton31337/fix/doc_underline_too_short
Quentin Young [Fri, 6 Dec 2019 06:54:49 +0000 (01:54 -0500)]
Merge pull request #5493 from ton31337/fix/doc_underline_too_short

doc: Add moaar dashes to underline line

4 years agodoc: Add moaar dashes to underline line
Donatas Abraitis [Fri, 6 Dec 2019 06:33:30 +0000 (08:33 +0200)]
doc: Add moaar dashes to underline line

doc/user/bgp.rst:420: WARNING: Title underline too short.
Reject routes with AS_SET or AS_CONFED_SET types
-------------------------------

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
4 years agoMerge pull request #5464 from qlyoung/fix-bgp-prefix-orf-heap-overflow
Donatas Abraitis [Fri, 6 Dec 2019 06:15:49 +0000 (08:15 +0200)]
Merge pull request #5464 from qlyoung/fix-bgp-prefix-orf-heap-overflow

lib: fix heap buf overflow when adding prefix orf

4 years agoMerge pull request #5478 from mjstapp/fix_ospf_apiserver_sa
Donald Sharp [Fri, 6 Dec 2019 01:56:12 +0000 (20:56 -0500)]
Merge pull request #5478 from mjstapp/fix_ospf_apiserver_sa

ospfd: clean up SA warning

4 years agoMerge pull request #5476 from qlyoung/fix-init-script-bleh
Mark Stapp [Thu, 5 Dec 2019 21:41:48 +0000 (16:41 -0500)]
Merge pull request #5476 from qlyoung/fix-init-script-bleh

tools: [ [ is not valid shell test syntax

4 years agoospfd: clean up SA warning
Mark Stapp [Thu, 5 Dec 2019 21:12:09 +0000 (16:12 -0500)]
ospfd: clean up SA warning

remove an unneeded initialization to clear up an SA report.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
4 years agotools: [ [ is not valid test syntax
Quentin Young [Thu, 5 Dec 2019 17:57:45 +0000 (12:57 -0500)]
tools: [ [ is not valid test syntax

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
4 years agobgpd: remove bgp_attr_dup
Quentin Young [Tue, 3 Dec 2019 21:01:19 +0000 (16:01 -0500)]
bgpd: remove bgp_attr_dup

yeah

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
4 years agoMerge pull request #5472 from mjstapp/fix_dplane_prov_flags
Donatas Abraitis [Thu, 5 Dec 2019 12:03:35 +0000 (14:03 +0200)]
Merge pull request #5472 from mjstapp/fix_dplane_prov_flags

zebra: capture dplane plugin flags

4 years agoMerge pull request #5471 from sworleys/Doc-Sign-Off
Mark Stapp [Wed, 4 Dec 2019 19:56:58 +0000 (14:56 -0500)]
Merge pull request #5471 from sworleys/Doc-Sign-Off

doc: add doc for easy commit sign-off with `-s`

4 years agozebra: capture dplane plugin flags
Mark Stapp [Wed, 4 Dec 2019 19:54:38 +0000 (14:54 -0500)]
zebra: capture dplane plugin flags

The flags can be important - like "threaded" - so we need to
actually capture them when plugins are registered.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
4 years agoeigrpd, ospfd, pimd: Fix assumption that interface may not be up
Donald Sharp [Thu, 24 Oct 2019 19:09:18 +0000 (15:09 -0400)]
eigrpd, ospfd, pimd: Fix assumption that interface may not be up

Commit: ddbf3e60604019d4b38d51226700e2244cc531b6

This commit modified the interface up handling code in
ZAPI such that the zclient handled the decoding for you.
Prior to this commit ospf assumed that it could use the
old ifp pointer to know state before reading the stream.
This lead to a situation where ospf would `smartly` track
and do the right thing in this situation.  This commit
changed this assumption and in certain scenarios, say
a interface was changed after it was already up would
lead to situations where ospf would not properly handle
the new interface up.

Modify ospf to track data that is important to it in
it's interface->info pointer.

This code pattern was followed in both eigrp and pim.
In eigrp's case it was just behaving weirdly in any event
so fixing this pattern is not a big deal.  In pim's
case it was not properly using this so it's a no-op
to fix.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agoospfd: interface name and ip address can be 32 bytes
Donald Sharp [Fri, 25 Oct 2019 13:06:26 +0000 (09:06 -0400)]
ospfd: interface name and ip address can be 32 bytes

We are only saving 20 bytes of string output for ospf neighbor
commands.  Fixed output:

act-7326-05# show ip ospf vrf vrf1012 neighbor all
VRF Name: vrf1012

Neighbor ID     Pri State           Dead Time Address         Interface                        RXmtL RqstL DBsmL
9.9.12.11         1 Full/DROther      39.973s 200.254.2.10    swp49s0.2:200.254.2.9                4     0     0
9.9.12.12         1 Full/DROther      39.995s 200.254.2.14    swp49s1.2:200.254.2.13               9     0     0
9.9.12.13         1 Exchange/DROthe   39.981s 200.254.2.18    swp49s2.2:200.254.2.17             157     0     0

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agoMerge pull request #5416 from mjstapp/re_nhe_pointer
Donald Sharp [Wed, 4 Dec 2019 19:11:04 +0000 (14:11 -0500)]
Merge pull request #5416 from mjstapp/re_nhe_pointer

lib,zebra: use shared nexthop-group in route_entry

4 years agodoc: add doc for easy commit sign-off with `-s`
Stephen Worley [Wed, 4 Dec 2019 16:27:30 +0000 (11:27 -0500)]
doc: add doc for easy commit sign-off with `-s`

Add some doc to let developers know about the `-s` flag
with `git commit`.

We were seeing some people writing the sign-off manually.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agolib,zebra: use nhg_hash_entry pointer in route_entry
Mark Stapp [Fri, 22 Nov 2019 20:30:53 +0000 (15:30 -0500)]
lib,zebra: use nhg_hash_entry pointer in route_entry

Replace the existing list of nexthops (via a nexthop_group
struct) in the route_entry with a direct pointer to zebra's
new shared group (from zebra_nhg.h). This allows more
direct access to that shared group and the info it carries.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
4 years agoMerge pull request #5352 from donaldsharp/5013_cleanup_merge_issues
Rafael Zalamena [Wed, 4 Dec 2019 12:28:41 +0000 (09:28 -0300)]
Merge pull request #5352 from donaldsharp/5013_cleanup_merge_issues

5013 cleanup merge issues

4 years agoMerge pull request #5341 from rbauduin/patch-1
Donatas Abraitis [Wed, 4 Dec 2019 11:56:42 +0000 (13:56 +0200)]
Merge pull request #5341 from rbauduin/patch-1

mention allow-outbound-policy for route reflectors

4 years agoMerge pull request #5430 from taruta811/build-docker-centos
Donatas Abraitis [Wed, 4 Dec 2019 11:42:12 +0000 (13:42 +0200)]
Merge pull request #5430 from taruta811/build-docker-centos

docker: Make docker image on CentOS 7

4 years agoMerge pull request #5305 from ton31337/feature/draft-ietf-idr-deprecate-as-set-confed-set
Donald Sharp [Wed, 4 Dec 2019 02:29:09 +0000 (21:29 -0500)]
Merge pull request #5305 from ton31337/feature/draft-ietf-idr-deprecate-as-set-confed-set

bgpd: Reject incoming and outgoing UPDATES for AS_SET and AS_CONFED_SET

4 years agobfdd: Json fields for multiplier
SumitAgarwal123 [Tue, 29 Oct 2019 05:25:34 +0000 (22:25 -0700)]
bfdd: Json fields for multiplier

Adding fields "detect-multiplier" and "remote-detect-multiplier"
for JSON to to reflect changes in "show bfd peers output"

Signed-off-by: Sayed Mohd Saquib sayed.saquib@broadcom.com
4 years agobfdd: Adding new CLI, show bfd peers brief
SumitAgarwal123 [Thu, 19 Sep 2019 07:35:17 +0000 (00:35 -0700)]
bfdd: Adding new CLI, show bfd peers brief

Added new CLI to display all BFD peer in brief format

Signed-off-by: Sayed Mohd Saquib <sayed.saquib@broadcom.com>
4 years agobfdd: Adding new cli, clear bfd counters
SumitAgarwal123 [Thu, 19 Sep 2019 07:20:31 +0000 (00:20 -0700)]
bfdd: Adding new cli, clear bfd counters

Adding new CLI clear bfd counters,
This CLI wil only reset Rx/Tx counters,
it will not reset session UP/DOWN and Zebra event count

Signed-off-by: Sayed Mohd Saquib <sayed.saquib@broadcom.com>
4 years agobfdd: Adding new fields to display show bfd peer
SumitAgarwal123 [Thu, 19 Sep 2019 07:02:17 +0000 (00:02 -0700)]
bfdd: Adding new fields to display show bfd peer

Adding 2 two new fields
1. Peer type, configured/dynamic
2. Detect multiplier

Signed-off-by: Sayed Mohd Saquib <sayed.saquib@broadcom.com>
4 years agopbrd: make vty `match *` code more readable
Stephen Worley [Tue, 3 Dec 2019 21:59:21 +0000 (16:59 -0500)]
pbrd: make vty `match *` code more readable

Make the vty match src|dst|mark code a bit more readable
in its conditonal logic.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agolib: support labelled nexthops in nexthop_groups
Mark Stapp [Wed, 27 Nov 2019 18:02:23 +0000 (13:02 -0500)]
lib: support labelled nexthops in nexthop_groups

Add support for labelled nexthops in nexthop-group
vtysh configuration. Also update the PBR doc where
the cli is described.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
4 years agopbrd: consolidate rule_notify debugs into one call
Stephen Worley [Tue, 3 Dec 2019 21:25:40 +0000 (16:25 -0500)]
pbrd: consolidate rule_notify debugs into one call

Consolidate the rule_notify_owner() debugs based on type
into one call, making use of zapi_rule_notify_owner2str()
to do so.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agolib: Add zapi_rule_notify_owner2str() function
Stephen Worley [Tue, 3 Dec 2019 21:14:34 +0000 (16:14 -0500)]
lib: Add zapi_rule_notify_owner2str() function

Add a function for converting the zapi_rule_notify_owner enum
type to a string for ease of use.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agopbrd: Add newlines in `set nexthop*` vty output
Stephen Worley [Mon, 25 Nov 2019 20:25:08 +0000 (15:25 -0500)]
pbrd: Add newlines in `set nexthop*` vty output

We were missing some newlines in handling vty outputs
for the `set nexthop*` commands. Add them in there.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agopbrd: use dst string in match dst-ip vty description
Stephen Worley [Mon, 25 Nov 2019 20:22:35 +0000 (15:22 -0500)]
pbrd: use dst string in match dst-ip vty description

The vty description for the `set match dst-ip` command was
using "src ip" in its description. Change it to use "dst ip".

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agopbrd: don't silently fail on atomic match MARK change attempts
Stephen Worley [Mon, 25 Nov 2019 20:16:35 +0000 (15:16 -0500)]
pbrd: don't silently fail on atomic match MARK change attempts

Also don't silently fail when we attempt to atomically change
a match MARK to a new one.

We would overwrite the frist one but never actually install it.

Change it to explicitly fail if a config is already present for
now.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agopbrd: don't silently fail on atomic match IP change attempts
Stephen Worley [Mon, 25 Nov 2019 19:45:02 +0000 (14:45 -0500)]
pbrd: don't silently fail on atomic match IP change attempts

Currently pbrd does not support the abilitity to make atomic
changes to a config.

ex)
`match src-ip 1.1.1.1/32`
`match src-ip 1.1.1.0/24`

We would overwrite the first one but never actually install it.

In the `set nexthop commands` we explicitly fail if there is
already a `set nexthop` config present. This patch extends the
match src/dest-ip configs to do the same.

In the future we should make all these commands atomic but for
now its better to not fail silently at the very least.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agopbrd: don't set rule removed on fail
Stephen Worley [Mon, 25 Nov 2019 05:45:24 +0000 (00:45 -0500)]
pbrd: don't set rule removed on fail

Don't treat a remove failure as a successful remove.

This can cause us to get out of sync with the kernel.
Pbrd makes decisions on rule handling based on its installed
state so this needs to be as close to accurate as possible.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agolib: fix heap buf overflow when adding prefix orf
Quentin Young [Tue, 3 Dec 2019 18:12:25 +0000 (13:12 -0500)]
lib: fix heap buf overflow when adding prefix orf

Don't lose your way

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
4 years agoMerge pull request #5442 from opensourcerouting/mpls-label-stacks
Russ White [Tue, 3 Dec 2019 16:25:53 +0000 (11:25 -0500)]
Merge pull request #5442 from opensourcerouting/mpls-label-stacks

zebra: support LSPs with multiple outgoing labels

4 years agobgpd: Autocomplete neighbor for clear bgp (#5434)
David Lamparter [Tue, 3 Dec 2019 16:13:21 +0000 (17:13 +0100)]
bgpd: Autocomplete neighbor for clear bgp (#5434)

bgpd: Autocomplete neighbor for clear bgp

4 years agozebra: send RA lifetime of 0 before ceasing to advertise RAs
Don Slice [Tue, 3 Dec 2019 14:02:20 +0000 (14:02 +0000)]
zebra: send RA lifetime of 0 before ceasing to advertise RAs

Problem reported by testing agency that RFC4861 section 6.2.5
states that a router should send an RA with a lifetime of 0
before ceasing to send RAs on the interface, or when the interace
is shutdown, or the router is shutdown.  This fix adds that capability.

Ticket: CM-27061
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
4 years agoMerge pull request #5192 from donaldsharp/zebra_rejection
Donatas Abraitis [Tue, 3 Dec 2019 07:29:50 +0000 (09:29 +0200)]
Merge pull request #5192 from donaldsharp/zebra_rejection

zebra: Dissallow a /32 or /128 through itself

4 years agoMerge pull request #5432 from chiragshah6/evpn_dev2
Sri Mohana Singamsetty [Tue, 3 Dec 2019 01:17:26 +0000 (17:17 -0800)]
Merge pull request #5432 from chiragshah6/evpn_dev2

bgpd: Handle possible non-selection of local route

4 years agoMerge pull request #5450 from donaldsharp/rpki_node_issues
Sri Mohana Singamsetty [Tue, 3 Dec 2019 01:15:35 +0000 (17:15 -0800)]
Merge pull request #5450 from donaldsharp/rpki_node_issues

bgpd: Prevent crash in bgp_table_range_lookup

4 years agoMerge pull request #5444 from opensourcerouting/show-candidate-fix
Donald Sharp [Mon, 2 Dec 2019 16:26:33 +0000 (11:26 -0500)]
Merge pull request #5444 from opensourcerouting/show-candidate-fix

lib: fix display of candidate configurations

4 years agoMerge pull request #5389 from opensourcerouting/constify
Donald Sharp [Mon, 2 Dec 2019 16:26:11 +0000 (11:26 -0500)]
Merge pull request #5389 from opensourcerouting/constify

*: constify ALL the things

4 years agobgpd: Prevent crash in bgp_table_range_lookup
Donald Sharp [Mon, 2 Dec 2019 14:37:47 +0000 (09:37 -0500)]
bgpd: Prevent crash in bgp_table_range_lookup

The function bgp_table_range_lookup attempts to walk down
the table node data structures to find a list of matching
nodes.  We need to guard against the current node from
not matching and not having anything in the child nodes.
Add a bit of code to guard against this.

Traceback that lead me down this path:

Nov 24 12:22:38 frr bgpd[20257]: Received signal 11 at 1574616158 (si_addr 0x2, PC 0x46cdc3); aborting...
Nov 24 12:22:38 frr bgpd[20257]: Backtrace for 11 stack frames:
Nov 24 12:22:38 frr bgpd[20257]: /lib64/libfrr.so.0(zlog_backtrace_sigsafe+0x67) [0x7fd1ad445957]
Nov 24 12:22:38 frr bgpd[20257]: /lib64/libfrr.so.0(zlog_signal+0x113) [0x7fd1ad445db3]1ad445957]
Nov 24 12:22:38 frr bgpd[20257]: /lib64/libfrr.so.0(+0x70e65) [0x7fd1ad465e65]ad445db3]1ad445957]
Nov 24 12:22:38 frr bgpd[20257]: /lib64/libpthread.so.0(+0xf5f0) [0x7fd1abd605f0]45db3]1ad445957]
Nov 24 12:22:38 frr bgpd[20257]: /usr/lib/frr/bgpd(bgp_table_range_lookup+0x63) [0x46cdc3]445957]
Nov 24 12:22:38 frr bgpd[20257]: /usr/lib64/frr/modules/bgpd_rpki.so(+0x4f0d) [0x7fd1a934ff0d]57]
Nov 24 12:22:38 frr bgpd[20257]: /lib64/libfrr.so.0(thread_call+0x60) [0x7fd1ad4736e0]934ff0d]57]
Nov 24 12:22:38 frr bgpd[20257]: /lib64/libfrr.so.0(frr_run+0x128) [0x7fd1ad443ab8]e0]934ff0d]57]
Nov 24 12:22:38 frr bgpd[20257]: /usr/lib/frr/bgpd(main+0x2e3) [0x41c043]1ad443ab8]e0]934ff0d]57]
Nov 24 12:22:38 frr bgpd[20257]: /lib64/libc.so.6(__libc_start_main+0xf5) [0x7fd1ab9a5505]f0d]57]
Nov 24 12:22:38 frr bgpd[20257]: /usr/lib/frr/bgpd() [0x41d9bb]main+0xf5) [0x7fd1ab9a5505]f0d]57]
Nov 24 12:22:38 frr bgpd[20257]: in thread bgpd_sync_callback scheduled from bgpd/bgp_rpki.c:351#012; aborting...
Nov 24 12:22:38 frr watchfrr[6779]: [EC 268435457] bgpd state -> down : read returned EOF
Nov 24 12:22:38 frr zebra[5952]: [EC 4043309116] Client 'bgp' encountered an error and is shutting down.
Nov 24 12:22:38 frr zebra[5952]: zebra/zebra_ptm.c:1345 failed to find process pid registration
Nov 24 12:22:38 frr zebra[5952]: client 15 disconnected. 0 bgp routes removed from the rib

I am not really 100% sure what we are really trying to do with this function, but we must
guard against child nodes not having any data.

Fixes: #5440
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years ago*: generously apply const
David Lamparter [Wed, 20 Nov 2019 16:26:59 +0000 (17:26 +0100)]
*: generously apply const

const const const your boat, merrily down the stream...

Signed-off-by: David Lamparter <equinox@diac24.net>
4 years agoMerge pull request #5446 from donaldsharp/bgp_json_mem_leak
Jafar Al-Gharaibeh [Sun, 1 Dec 2019 19:39:14 +0000 (12:39 -0700)]
Merge pull request #5446 from donaldsharp/bgp_json_mem_leak

bgpd: Fix memory leak in json output of show commands

4 years agodoc: mention allow-outbound-policy for route reflectors
rbauduin [Thu, 14 Nov 2019 07:27:14 +0000 (08:27 +0100)]
doc: mention allow-outbound-policy for route reflectors

Signed-off-by: Raphael Bauduin <rb@raphinou.com>
4 years agobgpd: Fix memory leak in json output of show commands
Donald Sharp [Sun, 1 Dec 2019 14:29:32 +0000 (09:29 -0500)]
bgpd: Fix memory leak in json output of show commands

When dumping a large bit of table data via bgp_show_table
and if there is no information to display for a particular
`struct bgp_node *` the data allocated via json_object_new_array()
is leaked.  Not a big deal on small tables but if you have a full
bgp feed and issue a show command that does not match any of
the route nodes ( say `vtysh -c "show bgp ipv4 large-community-list FOO"`)
then we will leak memory.

Before code change and issuing the above show bgp large-community-list command 15-20 times:
Memory statistics for bgpd:
System allocator statistics:
  Total heap allocated:  > 2GB
  Holding block headers: 0 bytes
  Used small blocks:     0 bytes
  Used ordinary blocks:  > 2GB
  Free small blocks:     31 MiB
  Free ordinary blocks:  616 KiB
  Ordinary blocks:       0
  Small blocks:          0
  Holding blocks:        0

After:

Memory statistics for bgpd:
System allocator statistics:
  Total heap allocated:  924 MiB
  Holding block headers: 0 bytes
  Used small blocks:     0 bytes
  Used ordinary blocks:  558 MiB
  Free small blocks:     26 MiB
  Free ordinary blocks:  340 MiB
  Ordinary blocks:       0
  Small blocks:          0
  Holding blocks:        0

Please note the 340mb of free ordinary blocks is from the fact I issued a
`show bgp ipv4 uni json` command and generated a large amount of data.

Fixes: #5445
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agolib: fix display of candidate configurations
Renato Westphal [Thu, 7 Nov 2019 16:20:06 +0000 (13:20 -0300)]
lib: fix display of candidate configurations

Commit 5e6a9350c16 implemented an optimization where candidate
configurations are validated only before being displayed. The
validation is done only to create default child nodes (due to
how libyang works) and any possible error is ignored (candidate
configurations can be invalid/incomplete).

The problem is that we were calling lyd_validate() only when the
CLI "with-defaults" option was used. But some cli_show() callbacks
assume that default nodes exist and can crash when displaying a
candidate configuration that isn't validated. To fix this, call
lyd_validate() before displaying candidate configuration even when
"with-defaults" is not used (that was a micro-optimization that
shouldn't have been done).

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
4 years ago*: make frr_yang_module_info const
David Lamparter [Wed, 20 Nov 2019 16:23:04 +0000 (17:23 +0100)]
*: make frr_yang_module_info const

Signed-off-by: David Lamparter <equinox@diac24.net>
4 years ago*: make all route_map_rule_cmd const
David Lamparter [Wed, 20 Nov 2019 16:20:58 +0000 (17:20 +0100)]
*: make all route_map_rule_cmd const

Signed-off-by: David Lamparter <equinox@diac24.net>
4 years agolib: make cmd_element & qobj_type const
David Lamparter [Thu, 14 Nov 2019 22:27:29 +0000 (23:27 +0100)]
lib: make cmd_element & qobj_type const

Signed-off-by: David Lamparter <equinox@diac24.net>
4 years agolib: gcc 4.x workaround v2 for frr_interface_info
David Lamparter [Fri, 29 Nov 2019 23:36:45 +0000 (00:36 +0100)]
lib: gcc 4.x workaround v2 for frr_interface_info

The previous workaround only works for -O0, at higher optimization
levels gcc reorders the statements in the file global scope which breaks
the asm statement :(.

Fixes: #4563
Fixes: #5074
Signed-off-by: David Lamparter <equinox@diac24.net>
4 years agozebra: support LSPs with multiple outgoing labels
Renato Westphal [Fri, 29 Nov 2019 14:50:07 +0000 (11:50 -0300)]
zebra: support LSPs with multiple outgoing labels

For SR-TE we'll need to create Binding-SIDs which are essentially
LSPs that can push multiple outgoing labels. This commit sets the
groundwork for that. Luckily the netlink code didn't need to be
changed since it already supports pushing label stacks.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
4 years agobgpd: Autocomplete neighbor for clear bgp
Donatas Abraitis [Wed, 27 Nov 2019 19:44:46 +0000 (21:44 +0200)]
bgpd: Autocomplete neighbor for clear bgp

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
4 years agoMerge pull request #5409 from qlyoung/bgpd-lcom-ecom-parse-fixes
David Lamparter [Wed, 27 Nov 2019 17:35:03 +0000 (18:35 +0100)]
Merge pull request #5409 from qlyoung/bgpd-lcom-ecom-parse-fixes

bgp large & extended community parse fixes

4 years agoMerge pull request #5435 from opensourcerouting/gcc4-vla-size
Quentin Young [Wed, 27 Nov 2019 16:25:43 +0000 (11:25 -0500)]
Merge pull request #5435 from opensourcerouting/gcc4-vla-size

lib: add gcc 4.x workaround for frr_interface_info

4 years agoMerge pull request #5437 from ton31337/fix/replace_magic_number_to_readable
Russ White [Wed, 27 Nov 2019 12:18:21 +0000 (07:18 -0500)]
Merge pull request #5437 from ton31337/fix/replace_magic_number_to_readable

bgpd: Replace magic number 1 for TTL to BGP_DEFAULT_TTL

4 years agoMerge pull request #5356 from v00lk/master
Donatas Abraitis [Wed, 27 Nov 2019 08:54:25 +0000 (10:54 +0200)]
Merge pull request #5356 from v00lk/master

bgpd: IPv4 LU withdraw using 0x000000 label

4 years agobgpd: Replace magic number 1 for TTL to BGP_DEFAULT_TTL
Donatas Abraitis [Wed, 27 Nov 2019 08:48:17 +0000 (10:48 +0200)]
bgpd: Replace magic number 1 for TTL to BGP_DEFAULT_TTL

For readability and maintainability purposes.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
4 years agoMerge pull request #5419 from adharkar/frr-master-nh_connected
Donatas Abraitis [Wed, 27 Nov 2019 08:37:11 +0000 (10:37 +0200)]
Merge pull request #5419 from adharkar/frr-master-nh_connected

bgpd: Do not perform "connected" check for EVPN nexthop

4 years agoMerge pull request #5284 from sworleys/PBR-Add-NH-Table-2
Philippe Guibert [Tue, 26 Nov 2019 20:18:49 +0000 (21:18 +0100)]
Merge pull request #5284 from sworleys/PBR-Add-NH-Table-2

pbrd: Add `set vrf NAME` and `set vrf unchanged`

4 years agodocker: Make docker image on CentOS 7
Toshiki Tsuchiya [Sun, 24 Nov 2019 20:28:54 +0000 (20:28 +0000)]
docker: Make docker image on CentOS 7

- Build rpm package from source on CentOS 7
- Use multi-stage builds to reduce docker image size

Signed-off-by: Toshiki Tsuchiya <taruta0811@gmail.com>
4 years agoMerge pull request #4977 from chiragshah6/evpn_dev1
Philippe Guibert [Tue, 26 Nov 2019 16:56:59 +0000 (17:56 +0100)]
Merge pull request #4977 from chiragshah6/evpn_dev1

* evpn primary address advertisement

4 years agoMerge pull request #5415 from dslicenc/ipv6-ra-fast-retrans
Russ White [Tue, 26 Nov 2019 16:37:20 +0000 (11:37 -0500)]
Merge pull request #5415 from dslicenc/ipv6-ra-fast-retrans

zebra: knob to make ra retransmit interval rfc compliant

4 years agolib: add gcc 4.x workaround for frr_interface_info
David Lamparter [Tue, 26 Nov 2019 16:05:47 +0000 (17:05 +0100)]
lib: add gcc 4.x workaround for frr_interface_info

gcc 4.x does not properly support structs with variable length array
members.  Specifically, for global variables, it completely ignores the
array, coming up with a size much smaller than what is correct.  This is
broken for both sizeof() as well as ELF object size.

This breaks for frr_interface_info since this variable is in some cases
copy relocated by the linker.  (The linker does this to make the address
of the variable a "constant" for the main program.)  This copying uses
the ELF object size, thereby copying only the non-array part of the
struct.

Breakage ensues...

(This fix is a bit ugly, but it's limited to very old gcc, and it's
better than changing the array to "nodes[1000]" and wasting memory...)

Fixes: #4563
Fixes: #5074
Signed-off-by: David Lamparter <equinox@diac24.net>
4 years agoMerge pull request #5408 from donaldsharp/scan7
Russ White [Tue, 26 Nov 2019 14:48:20 +0000 (09:48 -0500)]
Merge pull request #5408 from donaldsharp/scan7

Scan7

4 years agoMerge pull request #5407 from lkrishnamoor/evpn_vni_json
Donatas Abraitis [Tue, 26 Nov 2019 06:49:54 +0000 (08:49 +0200)]
Merge pull request #5407 from lkrishnamoor/evpn_vni_json

zebra: "show evpn vni details json" prints incorrect JSON format

4 years agobgpd: Handle possible non-selection of local route
Chirag Shah [Mon, 25 Nov 2019 22:34:29 +0000 (14:34 -0800)]
bgpd: Handle possible non-selection of local route

In rare situations, the local route in a VNI may not get selected as the
best route. One situation is during a race between bgp and zebra which
was addressed in a prior commit. This change addresses another situation
where due to a change of tunnel IP, it is possible that a received route
may be selected as the best route if the path selection needs to take
next hop IPs into consideration. This is a pretty convoluted scenario,
but the code should handle it and delete and withdraw the local route
as well as (re)install the received route.

Ticket: CM-24114
Reviewed By: CCR-9487
Testing Done:
1. Manual tests - note, problem is not readily reproducible
2. evpn-smoke - results documented in the ticket

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
4 years agoMerge pull request #5420 from donaldsharp/zebra_client_summ_spacing
Donatas Abraitis [Mon, 25 Nov 2019 12:49:05 +0000 (14:49 +0200)]
Merge pull request #5420 from donaldsharp/zebra_client_summ_spacing

Zebra client summ spacing

4 years agoMerge pull request #5423 from qlyoung/fix-bgp-addpath-bad-boundscheck
Donatas Abraitis [Mon, 25 Nov 2019 12:46:35 +0000 (14:46 +0200)]
Merge pull request #5423 from qlyoung/fix-bgp-addpath-bad-boundscheck

bgpd: fix bad bounds check for addpath in nlri

4 years agobgpd: fix bad bounds check for addpath in nlri
Quentin Young [Sun, 24 Nov 2019 07:02:54 +0000 (02:02 -0500)]
bgpd: fix bad bounds check for addpath in nlri

If a peer advertised capability addpath in their OPEN, but sent us an
UPDATE without an ADDPATH, we overflow a heap buffer.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
4 years agozebra: Fix `show ip nexthop route-map` and `show ip protocol`
Donald Sharp [Sat, 23 Nov 2019 01:14:21 +0000 (20:14 -0500)]
zebra: Fix `show ip nexthop route-map` and `show ip protocol`

These commands were not properly lining up in their columns.
Fix this.

After:
VRF: default
Protocol                  : route-map
-------------------------------------
bgp                       : NO_INSTALL
vnc-direct                : none
vnc-rn                    : none
bgp-direct                : none
bgp-direct-to-nve-groups  : none

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agozebra: Fix `show zebra client` display to handle columns right
Donald Sharp [Sat, 23 Nov 2019 00:59:40 +0000 (19:59 -0500)]
zebra: Fix `show zebra client` display to handle columns right

Before:
Type        Add        Update     Del
==================================================
IPv4        11539033    272         10751107
IPv6        1122106     43          1047081

After:

Type        Add         Update      Del
==================================================
IPv4        10517740    64          9729917
IPv6        1016590     8           941567

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agozebra: Adjust column display of `show zebra client summ` for openfabric
Donald Sharp [Sat, 23 Nov 2019 00:29:55 +0000 (19:29 -0500)]
zebra: Adjust column display of `show zebra client summ` for openfabric

The openfabric daemon has a longer name than anticipated for
`show zebra client summary` adjust to allow it to fit without
making columns all blomped.

Before:
robot# show zebra client summ
Name      Connect Time    Last Read  Last Write  IPv4 Routes       IPv6 Routes
--------------------------------------------------------------------------------
static        00:00:06     00:00:06    00:00:06       4/0              0/0
openfabric      00:00:06     00:00:06    00:00:06       0/0              0/0

After:

[sharpd@robot frr4]$ vtysh -c "show zebra client summ"
Name      Connect Time    Last Read  Last Write  IPv4 Routes       IPv6 Routes
--------------------------------------------------------------------------------
static        00:02:16     00:02:16    00:02:16       4/0              0/0
openfabric    00:02:16     00:02:16    00:02:16       0/0              0/0

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agobgpd: Do not perform "connected" check for EVPN nexthop
Ameya Dharkar [Fri, 22 Nov 2019 23:48:37 +0000 (15:48 -0800)]
bgpd: Do not perform "connected" check for EVPN nexthop

This changeset follows the PR
https://github.com/FRRouting/frr/pull/5334

Above PR adds nexthop tracking support for EVPN RT-5 nexthops.
This route is marked VALID only if the BGP route has a valid nexthop.

If the EVPN peer is an EBGP pee and "disable_connected_check" flag is not set,
"connected" check is performed for the EVPN nexthop.
But, usually EVPN nexthop is not the BGP peering address, but the VTEP address.
Also, NEXTHOP_UNCHANGED flag is enabled by default for EVPN.
As a result, in a common deployment for EVPN, EVPN nexthop is not connected.

Thus, adding a fix to remove the "connected" check for EVPN nexthops.

Signed-off-by: Ameya Dharkar <adharkar@vmware.com>
4 years agozebra: knob to make ra retransmit interval rfc compliant
Don Slice [Fri, 22 Nov 2019 17:31:29 +0000 (17:31 +0000)]
zebra: knob to make ra retransmit interval rfc compliant

Problem reported by testing facility that our sending of Router
Advertisements more frequently than once very three seconds is not
compliant with rfc4861. Added a knob to turn off fast retransmits
in order to meet the requirement of the RFC.

Ticket: CM-27063
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
4 years agoMerge pull request #5413 from donaldsharp/eigrp_cleanup1
Mark Stapp [Fri, 22 Nov 2019 17:36:50 +0000 (12:36 -0500)]
Merge pull request #5413 from donaldsharp/eigrp_cleanup1

Eigrp cleanup1

4 years agolib: add some nexthop ctors
Mark Stapp [Fri, 22 Nov 2019 16:10:42 +0000 (11:10 -0500)]
lib: add some nexthop ctors

Add some apis that allocate and init nexthop objects
from various kinds of arguments: ip addrs, interfaces,
blackhole types.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
4 years agobgpd: adv pip to throw warning under default vrf
Chirag Shah [Mon, 28 Oct 2019 22:05:05 +0000 (15:05 -0700)]
bgpd: adv pip to throw warning under default vrf

Instead of CMD_WARNING, use CMD_WARNING_CONFIG_FAILED
for any mis-configuration scenario.

Testing Done:

TOR(config)# router bgp 5548
TOR(config-router)# address-family l2vpn evpn
TOR(config-router-af)# no advertise-pip
This command is supported under L3VNI BGP EVPN VRF

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
4 years agobgpd: adv pip update type-5 with correct rmac
Chirag Shah [Fri, 25 Oct 2019 22:27:47 +0000 (15:27 -0700)]
bgpd: adv pip update type-5 with correct rmac

when a pip is disabled or mac-vlan is not present
use anycast MAC as RMAC value.

Ticket:CM-26923
Reviewed By:CCR-9417
Testing Done:

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
4 years agozebra: display proper field in debug statement
Chirag Shah [Tue, 15 Oct 2019 18:26:32 +0000 (11:26 -0700)]
zebra: display proper field in debug statement

Ticket:CM-26622

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
4 years agozebra: handle macvlan down event
Chirag Shah [Fri, 11 Oct 2019 18:42:12 +0000 (11:42 -0700)]
zebra: handle macvlan down event

Macvlan down event have sentinel check of its parent
link presence.

Ticket:CM-26622
Reviewed By:CCR-9326
Testing Done:

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
4 years agobgpd: fix self type-2 routes rmac and nexhtop
Chirag Shah [Thu, 24 Oct 2019 21:32:49 +0000 (14:32 -0700)]
bgpd: fix self type-2 routes rmac and nexhtop

For self type-2 routes, do not assign system-rmac
as attribute RMAC value if advertise-pip is disable
or macvlan is not present.

Ticket:CM-26923
Reviewed By:CCR-9397
Testing Done:

pip is disabled under bgp vrf2 instance.
Trigger frr-restart.

Before fix:
*> [2]:[0]:[48]:[00:02:00:00:00:2e]:[32]:[45.0.4.4]
                    36.0.0.11                          32768 i
                    ET:8 RT:5546:1004 RT:5546:4002 Rmac:00:02:00:00:00:2e

After fix:
*> [2]:[0]:[48]:[00:02:00:00:00:2e]:[32]:[45.0.4.4]
                    36.0.0.11                          32768 i
                    ET:8 RT:5546:1004 RT:5546:4002 Rmac:44:38:39:ff:ff:01

TOR# ifquery vlan1004
auto vlan1004
iface vlan1004
        address 45.0.4.4/24
        vlan-id 1004
        vrf vrf2

VNI: 4002 (known to the kernel)
  Type: L3
  Tenant VRF: vrf2
  RD: 45.0.6.4:3
  Originator IP: 36.0.0.11
  Advertise-pip: Yes
  System-IP: 27.0.0.11
  System-MAC: 00:02:00:00:00:2e
  Router-MAC: 44:38:39:ff:ff:01

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
4 years agobgpd: evpn pip convert ntoa to ntop
Chirag Shah [Mon, 11 Nov 2019 22:59:08 +0000 (14:59 -0800)]
bgpd: evpn pip convert ntoa to ntop

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
4 years agozebra: print rmac and sys mac values
Chirag Shah [Tue, 15 Oct 2019 00:46:10 +0000 (17:46 -0700)]
zebra: print rmac and sys mac values

"show vrf vni" and "show evpn vni <l3vni>" commands
need to display correct router mac value.

"show evpn vni <l3vni>" detail l3vni needs to display
system mac as in PIP scenario value can be different.
Syste MAC would be derived from SVI interface MAC wherelse
Router MAC would be derived from macvlan interface MAC value.

Ticket:CM-26710
Reviewed By:CCR-9334
Testing Done:

TORC11# show evpn vni 4001
VNI: 4001
  Type: L3
  Tenant VRF: vrf1
  Local Vtep Ip: 36.0.0.11
  Vxlan-Intf: vx-4001
  SVI-If: vlan4001
  State: Up
  VNI Filter: none
  System MAC: 00:02:00:00:00:2e
  Router MAC: 44:38:39:ff:ff:01
  L2 VNIs: 1000
TORC11# show vrf vni
VRF     VNI    VxLAN IF   L3-SVI    State Rmac
vrf1    4001   vx-4001    vlan4001  Up    44:38:39:ff:ff:01

TORC11# show evpn vni 4001 json
{
  "vni":4001,
  "type":"L3",
  "localVtepIp":"36.0.0.11",
  "vxlanIntf":"vx-4001",
  "sviIntf":"vlan4001",
  "state":"Up",
  "vrf":"vrf1",
  "sysMac":"00:02:00:00:00:2e",
  "routerMac":"44:38:39:ff:ff:01",
  "vniFilter":"none",
  "l2Vnis":[
    1000,
  ]
}

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
4 years agodoc: evpn pip add documentation
Chirag Shah [Mon, 23 Sep 2019 00:46:46 +0000 (17:46 -0700)]
doc: evpn pip add documentation

Ticket:CM-26190
Reviewed By:
Testing Done:

Signed-off-by: Chirag Shah <chirag@cumulusntworks.com>
4 years agobgpd: evpn pip display pip values
Chirag Shah [Wed, 11 Sep 2019 01:36:05 +0000 (18:36 -0700)]
bgpd: evpn pip display pip values

Display pip system mac and ip values
in per vni detail output.

Ticket:CM-26190
Reviewed By:
Testing Done:

Following new values add to the below output
for L3vni:

  System-IP: 27.0.0.11
  System-MAC: 00:02:00:00:00:2e
  Router-MAC: 44:38:39:ff:ff:01

TORC11# show bgp l2vpn evpn vni 4002
VNI: 4002 (known to the kernel)
  Type: L3
  Tenant VRF: vrf2
  RD: 141.2.1.2:2
  Originator IP: 36.0.0.11
  Advertise-gw-macip : n/a
  Advertise-pip: Yes
  System-IP: 27.0.0.11
  System-MAC: 00:02:00:00:00:2e
  Router-MAC: 44:38:39:ff:ff:01
  Import Route Target:
    5546:4002
  Export Route Target:
    5546:4002

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
4 years agozebra: evpn pip mac vlan up-down event
Chirag Shah [Fri, 6 Sep 2019 20:55:35 +0000 (13:55 -0700)]
zebra: evpn pip mac vlan up-down event

macvlan interface up/down event triggers
bgp to send updates for evpn routes
with changed RMAC and nexthop IP values.

Ticket:CM-26190
Reviewed By:
Testing Done:

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
4 years agobgpd: evpn pip handle svi ip route
Chirag Shah [Fri, 9 Aug 2019 01:58:03 +0000 (18:58 -0700)]
bgpd: evpn pip handle svi ip route

By default announct Self Type-2 routes with
system IP as nexthop and system MAC as
nexthop.

An API to check type-2 is self route via
checking ipv4/ipv6 address from connected interfaces list.

An API to extract RMAC and nexthop for type-2
routes based on advertise-svi-ip knob is enabled.

When advertise-pip is enabled/disabled, trigger type-2
route update. For self type-2 routes to use
anycast or individual (rmac, nexthop) addresses.

Ticket:CM-26190
Reviewed By:
Testing Done:

Enable 'advertise-svi-ip' knob in bgp default instance.
the vrf instance svi ip is advertised with nexthop
as default instance router-id and RMAC as system MAC.

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>