]> git.puffer.fish Git - mirror/frr.git/log
mirror/frr.git
5 years agoMerge pull request #6149 from Spantik/route-map-yang
Donald Sharp [Fri, 3 Apr 2020 22:32:29 +0000 (18:32 -0400)]
Merge pull request #6149 from Spantik/route-map-yang

lib: [YANG] Route-map inteface forward ref

5 years agolib: [YANG] Route-map inteface forward ref 6149/head
Santosh P K [Fri, 3 Apr 2020 19:15:20 +0000 (12:15 -0700)]
lib: [YANG] Route-map inteface forward ref

To satisfy forward reference for interface in route-map.
Libyang 0.16 does not support leafref yet.

Signed-off-by: Santosh P K <sapk@vmware.com>
5 years agoMerge pull request #6071 from ton31337/feature/rfc6286
David Lamparter [Fri, 3 Apr 2020 13:16:59 +0000 (15:16 +0200)]
Merge pull request #6071 from ton31337/feature/rfc6286

bgpd: Add support for Autonomous-System-Wide Unique BGP Identifier

5 years agoMerge pull request #6138 from donaldsharp/rtadv_respect_the_vrf
David Lamparter [Fri, 3 Apr 2020 12:04:43 +0000 (14:04 +0200)]
Merge pull request #6138 from donaldsharp/rtadv_respect_the_vrf

Rtadv respect the vrf

5 years agoMerge pull request #6130 from ton31337/fix/remove_some_redundant_attributes_from_json
Sri Mohana Singamsetty [Thu, 2 Apr 2020 23:17:24 +0000 (16:17 -0700)]
Merge pull request #6130 from ton31337/fix/remove_some_redundant_attributes_from_json

bgpd: Remove deprecated JSON fields for `show bgp ... json`

5 years agoMerge pull request #6141 from opensourcerouting/defaults-fix-bools
Donald Sharp [Thu, 2 Apr 2020 22:49:34 +0000 (18:49 -0400)]
Merge pull request #6141 from opensourcerouting/defaults-fix-bools

bgpd, ospfd, ospf6d: long is not bool :(

5 years agobgpd, ospfd, ospf6d: long is not bool :( 6141/head
David Lamparter [Thu, 2 Apr 2020 19:16:04 +0000 (21:16 +0200)]
bgpd, ospfd, ospf6d: long is not bool :(

... Oops ...

(for context, the defaults code originally didn't have a dedicated
"bool" variant and just used long for bools...  I derp'd this when
adding bool as a separate case :( )

Reported-by: Donald Sharp <sharpd@cumulusnetworks.com>
Signed-off-by: David Lamparter <equinox@diac24.net>
5 years agoMerge pull request #6133 from sworleys/NHG-Fix-Dup-Leak
Mark Stapp [Thu, 2 Apr 2020 17:18:30 +0000 (13:18 -0400)]
Merge pull request #6133 from sworleys/NHG-Fix-Dup-Leak

zebra: free unhashable (dup) NHEs via ID table cleanup

5 years agozebra: free unhashable (dup) NHEs via ID table cleanup 6133/head
Stephen Worley [Wed, 1 Apr 2020 19:31:40 +0000 (15:31 -0400)]
zebra: free unhashable (dup) NHEs via ID table cleanup

Free unhashable (duplicate NHEs from the kernel) via ID table
cleanup. Since the NHE ID hash table contains extra entries,
that's the one we need to be calling zebra_nhg_hash_free()
on, otherwise we will never free the unhashable NHEs.

This was found via a memleak:

==1478713== HEAP SUMMARY:
==1478713==     in use at exit: 10,267 bytes in 46 blocks
==1478713==   total heap usage: 76,810 allocs, 76,764 frees, 3,901,237 bytes allocated
==1478713==
==1478713== 208 (88 direct, 120 indirect) bytes in 1 blocks are definitely lost in loss record 35 of 41
==1478713==    at 0x483BB1A: calloc (vg_replace_malloc.c:762)
==1478713==    by 0x48E35E8: qcalloc (memory.c:110)
==1478713==    by 0x451CCB: zebra_nhg_alloc (zebra_nhg.c:369)
==1478713==    by 0x453DE3: zebra_nhg_copy (zebra_nhg.c:379)
==1478713==    by 0x452670: nhg_ctx_process_new (zebra_nhg.c:1143)
==1478713==    by 0x4523A8: nhg_ctx_process (zebra_nhg.c:1234)
==1478713==    by 0x452A2D: zebra_nhg_kernel_find (zebra_nhg.c:1294)
==1478713==    by 0x4326E0: netlink_nexthop_change (rt_netlink.c:2433)
==1478713==    by 0x427320: netlink_parse_info (kernel_netlink.c:945)
==1478713==    by 0x432DAD: netlink_nexthop_read (rt_netlink.c:2488)
==1478713==    by 0x41B600: interface_list (if_netlink.c:1486)
==1478713==    by 0x457275: zebra_ns_enable (zebra_ns.c:127)

Repro with:
ip next add id 1 blackhole
ip next add id 2 blackhole

valgrind /usr/lib/frr/zebra

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
5 years agozebra: Add some vrf information to RA logs 6138/head
Donald Sharp [Thu, 2 Apr 2020 15:33:35 +0000 (11:33 -0400)]
zebra: Add some vrf information to RA logs

Add some data about what vrf we are operating on
in the RA logs.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agozebra: Don't kill the global rtadv socket when a vrf is deleted
Donald Sharp [Thu, 2 Apr 2020 15:16:50 +0000 (11:16 -0400)]
zebra: Don't kill the global rtadv socket when a vrf is deleted

The rtadv code has two types of sockets:
a) namespace -> Where each zvrf get's it's own socket
b) vrf lite -> Where we get 1 socket for everything

When we were terminating a vrf we were *always*
killing the (b) socket.  This is a mistake in
that other vrf's may need to be communicating.

Modify the code on vrf shutdown to only disable
that vrf's event processing and when we actually
terminate we shut the socket.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agoMerge pull request #6132 from qlyoung/fix-bgp-vnc-ifdef
Sri Mohana Singamsetty [Thu, 2 Apr 2020 02:35:13 +0000 (19:35 -0700)]
Merge pull request #6132 from qlyoung/fix-bgp-vnc-ifdef

bgpd: #if ENABLE_BGP_VNC -> #ifdef ENABLE_BGP_VNC

5 years agoMerge pull request #6131 from qlyoung/doc-json-camelcase
Renato Westphal [Wed, 1 Apr 2020 22:52:15 +0000 (19:52 -0300)]
Merge pull request #6131 from qlyoung/doc-json-camelcase

doc: document JSON conventions

5 years agoMerge pull request #6109 from volta-networks/feat_ldp_host_only
Renato Westphal [Wed, 1 Apr 2020 22:51:22 +0000 (19:51 -0300)]
Merge pull request #6109 from volta-networks/feat_ldp_host_only

ldpd:  host only filter

5 years agotests: Remove/change JSON attributes for `show bgp ... json` 6130/head
Donatas Abraitis [Wed, 1 Apr 2020 14:04:08 +0000 (17:04 +0300)]
tests: Remove/change JSON attributes for `show bgp ... json`

This is related to some attributes changes: aspath, med, localPref.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
5 years agobgpd: #if ENABLE_BGP_VNC -> #ifdef ENABLE_BGP_VNC 6132/head
Quentin Young [Wed, 1 Apr 2020 19:05:26 +0000 (15:05 -0400)]
bgpd: #if ENABLE_BGP_VNC -> #ifdef ENABLE_BGP_VNC

This macro is undefined if vnc is disabled, and while it defaults to 0,
this is still wrong and causes issues with -Werror

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
5 years agoldpd: fixing host-only configuration filter. 6109/head
lynne [Sun, 29 Mar 2020 17:47:36 +0000 (13:47 -0400)]
ldpd: fixing host-only configuration filter.

There is configuration in LDP to only create labels for
host-routes.   If the user remove this configuration the code
was not readvertising non-host routes to it's LDP neighbors.
The issue is the same in reverse also.  If the user adds this
configuration on an active LDP session the non-host routes were
not withdrawn.

Signed-off-by: Lynne Morrison <lynne@voltanet.io>
5 years agodoc: document JSON conventions 6131/head
Quentin Young [Wed, 1 Apr 2020 16:37:43 +0000 (12:37 -0400)]
doc: document JSON conventions

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
5 years agobgpd: Remove deprecated JSON fields for `show bgp ... json`
Donatas Abraitis [Wed, 1 Apr 2020 14:02:30 +0000 (17:02 +0300)]
bgpd: Remove deprecated JSON fields for `show bgp ... json`

med --------> metric
localPref --> locPrf
aspath -----> path

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
5 years agoMerge pull request #6120 from donaldsharp/ospf6_const
David Lamparter [Wed, 1 Apr 2020 12:10:26 +0000 (14:10 +0200)]
Merge pull request #6120 from donaldsharp/ospf6_const

ospf6d: Recent changes in our build cause const to be respected

5 years agoospf6d: Recent changes in our build cause const to be respected 6120/head
Donald Sharp [Tue, 31 Mar 2020 11:55:17 +0000 (07:55 -0400)]
ospf6d: Recent changes in our build cause const to be respected

We are seeing this crash:

New LWP 7673]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `/usr/lib/frr/ospf6d -d -F datacenter -M snmp -A ::1'.
Program terminated with signal SIGABRT, Aborted.
(gdb) bt
    vtysh=vtysh@entry=0) at lib/command.c:1288
(gdb)

The command entered is `debug ospf6 lsa inter-router examin`.  Code
inspection leads us to the fact that FRR is declaring the data as
const but we are attempting to modify it, causing the crash.

Remvoe the const of this set/get and let things work.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agoMerge pull request #6122 from donaldsharp/more_cbit_fun
Donatas Abraitis [Wed, 1 Apr 2020 09:39:41 +0000 (12:39 +0300)]
Merge pull request #6122 from donaldsharp/more_cbit_fun

tests: More cbit extensions

5 years agotests: More cbit extensions 6122/head
Donald Sharp [Tue, 31 Mar 2020 22:38:01 +0000 (18:38 -0400)]
tests: More cbit extensions

We are still seeing cbit test failures in the ci system.  I am
gonna try extending the timeout a bit more as that 8 seconds
doesn't seem to be long enough.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agotests: adding LDP tests for advertising host-routes.
lynne [Sun, 29 Mar 2020 17:43:05 +0000 (13:43 -0400)]
tests: adding LDP tests for advertising host-routes.

Adding test to verify that proper LDP labels are advertised if
host-route configuration is changed.

Signed-off-by: Lynne Morrison <lynne@voltanet.io>
5 years agoMerge pull request #6121 from ton31337/fix/typo_collision_function
Quentin Young [Tue, 31 Mar 2020 18:21:40 +0000 (14:21 -0400)]
Merge pull request #6121 from ton31337/fix/typo_collision_function

bgpd: Correct two comments typos for bgp_collision_detect()

5 years agoMerge pull request #5183 from opensourcerouting/zebra-route-map-nb
Quentin Young [Tue, 31 Mar 2020 18:21:20 +0000 (14:21 -0400)]
Merge pull request #5183 from opensourcerouting/zebra-route-map-nb

yang/zebra: migrate route map to northbound

5 years agobgpd: Correct two comments typos for bgp_collision_detect() 6121/head
Donatas Abraitis [Tue, 31 Mar 2020 14:54:40 +0000 (17:54 +0300)]
bgpd: Correct two comments typos for bgp_collision_detect()

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
5 years agobgpd: Add support for Autonomous-System-Wide Unique BGP Identifier 6071/head
Donatas Abraitis [Sun, 22 Mar 2020 20:22:47 +0000 (22:22 +0200)]
bgpd: Add support for Autonomous-System-Wide Unique BGP Identifier

Implement https://tools.ietf.org/html/rfc6286

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
5 years agoMerge pull request #5967 from rubenk/build-enable-wundef
David Lamparter [Tue, 31 Mar 2020 13:15:08 +0000 (15:15 +0200)]
Merge pull request #5967 from rubenk/build-enable-wundef

build: enable -Wundef warnings

5 years agoMerge pull request #6093 from LabNConsulting/working/lb/no-birds
David Lamparter [Tue, 31 Mar 2020 13:10:17 +0000 (15:10 +0200)]
Merge pull request #6093 from LabNConsulting/working/lb/no-birds

*: use the current project name (FRRouting)

5 years agoMerge pull request #6118 from qlyoung/display-ibuf-count
Donatas Abraitis [Tue, 31 Mar 2020 06:19:08 +0000 (09:19 +0300)]
Merge pull request #6118 from qlyoung/display-ibuf-count

bgpd: display ingress packet queue size

5 years agoMerge pull request #6116 from qlyoung/change-watchfrr-messages-to-info
Renato Westphal [Mon, 30 Mar 2020 22:35:39 +0000 (19:35 -0300)]
Merge pull request #6116 from qlyoung/change-watchfrr-messages-to-info

watchfrr: change some messages from errors to info

5 years agoMerge pull request #6117 from qlyoung/fix-grpc-plugin-with-daemonize
Renato Westphal [Mon, 30 Mar 2020 22:34:30 +0000 (19:34 -0300)]
Merge pull request #6117 from qlyoung/fix-grpc-plugin-with-daemonize

lib: defer grpc plugin initialization to post fork

5 years agobgpd: display ingress packet queue size 6118/head
Quentin Young [Mon, 30 Mar 2020 18:47:15 +0000 (14:47 -0400)]
bgpd: display ingress packet queue size

In the past, we always displayed the number of buffered ingress packets
as zero because there was no packet buffering in the input path and
therefore never any queue size to report. They're buffered now so we can
display something meaningful instead of 0.

Also change the inq / outq lookups to be atomic, since they can be
modified elsewhere. These should still compile down to an unfenced word
read but it's good to be explicit.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
5 years agolib: defer grpc plugin initialization to post fork 6117/head
Quentin Young [Mon, 30 Mar 2020 18:28:10 +0000 (14:28 -0400)]
lib: defer grpc plugin initialization to post fork

When using the GRPC northbound plugin, initialization occurs at the
frr_late_init hook. This is called before fork() when daemonizing (using
-d). Because the GRPC library internally creates threads, this means our
threads go away in the child process, so GRPC doesn't work when used
with -d. Rectify this situation by deferring plugin init to after fork
by scheduling a task on the threadmaster, since those are executed by
the child.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
5 years agowatchfrr: change some messages from errors to info 6116/head
Quentin Young [Mon, 30 Mar 2020 18:25:37 +0000 (14:25 -0400)]
watchfrr: change some messages from errors to info

When watchfrr starts up, it first tries to connect to daemons. This is
expected to fail if we are just starting up FRR, but we log it as an
error, and it shows up red in journalctl. Similarly when we fork
background commands that is also logged as an error. This is scaring
users, let's change these to info.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
5 years agoMerge pull request #5901 from mjstapp/backup_nh_prep
Stephen Worley [Mon, 30 Mar 2020 14:26:17 +0000 (10:26 -0400)]
Merge pull request #5901 from mjstapp/backup_nh_prep

zebra, lib: Backup nexthop (path) prep work

5 years agobuild: enable -Wundef warnings 5967/head
Ruben Kerkhof [Wed, 11 Mar 2020 10:05:34 +0000 (11:05 +0100)]
build: enable -Wundef warnings

Now that we've fixed all of them, enable them by default if the compiler
supports it.

Signed-off-by: Ruben Kerkhof <ruben@rubenkerkhof.com>
5 years agobfdd: fix -Wundef warning
Ruben Kerkhof [Mon, 30 Mar 2020 09:22:38 +0000 (11:22 +0200)]
bfdd: fix -Wundef warning

Signed-off-by: Ruben Kerkhof <ruben@rubenkerkhof.com>
5 years agoMerge pull request #6107 from ton31337/fix/unset_prefix_out_flag
Sri Mohana Singamsetty [Mon, 30 Mar 2020 02:52:41 +0000 (19:52 -0700)]
Merge pull request #6107 from ton31337/fix/unset_prefix_out_flag

bgpd: Unset PEER_FLAG_MAX_PREFIX_OUT for `no neighbor maximum-prefix-…

5 years agopimd: fix frr url 6093/head
Lou Berger [Sun, 29 Mar 2020 21:19:37 +0000 (17:19 -0400)]
pimd: fix frr url

Signed-off-by: Lou Berger <lberger@labn.net>
5 years agoMerge pull request #6104 from donaldsharp/bgp_rr_fixup
Sri Mohana Singamsetty [Sun, 29 Mar 2020 18:47:12 +0000 (11:47 -0700)]
Merge pull request #6104 from donaldsharp/bgp_rr_fixup

Bgp rr fixup

5 years agoMerge pull request #6106 from opensourcerouting/gcc-plugin
Donald Sharp [Sun, 29 Mar 2020 17:46:40 +0000 (13:46 -0400)]
Merge pull request #6106 from opensourcerouting/gcc-plugin

tools: add extended printfrr format checking GCC plugin

5 years agobgpd: Unset PEER_FLAG_MAX_PREFIX_OUT for `no neighbor maximum-prefix-out` 6107/head
Donatas Abraitis [Sun, 29 Mar 2020 16:16:16 +0000 (19:16 +0300)]
bgpd: Unset PEER_FLAG_MAX_PREFIX_OUT for `no neighbor maximum-prefix-out`

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
5 years agotests: fix clippy dependencies 6106/head
David Lamparter [Sun, 29 Mar 2020 08:18:22 +0000 (10:18 +0200)]
tests: fix clippy dependencies

Fixes straight "make check" without "make" first.

Signed-off-by: David Lamparter <equinox@diac24.net>
5 years agotests: use printfrr-based printf()
David Lamparter [Sun, 29 Mar 2020 08:17:13 +0000 (10:17 +0200)]
tests: use printfrr-based printf()

Just a small hack to use printfrr() in tests, since otherwise the
redefined PRId64 trips some warnings.

Signed-off-by: David Lamparter <equinox@diac24.net>
5 years agobuild: gcc -fplugin=frr-format support
David Lamparter [Sun, 29 Mar 2020 05:58:59 +0000 (07:58 +0200)]
build: gcc -fplugin=frr-format support

Try to find the plugin and add it to CFLAGS if successful.

Signed-off-by: David Lamparter <equinox@diac24.net>
5 years agotools/gcc-plugins: add small test for frr-format
David Lamparter [Sun, 29 Mar 2020 08:22:15 +0000 (10:22 +0200)]
tools/gcc-plugins: add small test for frr-format

Just enough to check that it works.

Signed-off-by: David Lamparter <equinox@diac24.net>
5 years agotools/gcc-plugins: frr-format
David Lamparter [Mon, 29 Jul 2019 20:43:09 +0000 (22:43 +0200)]
tools/gcc-plugins: frr-format

This provides the first reasonably-working version of the frr-format GCC
plugin.  I've only tested it with gcc 9.3.0.

Signed-off-by: David Lamparter <equinox@diac24.net>
5 years agotools/gcc-plugins: cut c-format.c to size
David Lamparter [Mon, 29 Jul 2019 14:36:49 +0000 (16:36 +0200)]
tools/gcc-plugins: cut c-format.c to size

... remove everything we don't need (or can't use because GCC doesn't
export all of its internal classes & stuff.)

Signed-off-by: David Lamparter <equinox@diac24.net>
5 years agotools/gcc-plugins: import c-format from GCC
David Lamparter [Mon, 29 Jul 2019 13:59:42 +0000 (15:59 +0200)]
tools/gcc-plugins: import c-format from GCC

(and gcc-common.h from the Linux kernel)

Signed-off-by: David Lamparter <equinox@diac24.net>
5 years ago*: fix format string warnings
David Lamparter [Fri, 27 Mar 2020 12:14:37 +0000 (13:14 +0100)]
*: fix format string warnings

Signed-off-by: David Lamparter <equinox@diac24.net>
5 years agolib: prepare for plugin-based frr_format check
David Lamparter [Fri, 2 Aug 2019 15:42:06 +0000 (17:42 +0200)]
lib: prepare for plugin-based frr_format check

Signed-off-by: David Lamparter <equinox@diac24.net>
5 years agoMerge pull request #6101 from sarav511/vty_crash
David Lamparter [Sun, 29 Mar 2020 04:08:29 +0000 (06:08 +0200)]
Merge pull request #6101 from sarav511/vty_crash

vtysh: Crash during show running-config

5 years agotests: Modify bgp_rr_ibgp to test RR server correctness 6104/head
Donald Sharp [Sat, 28 Mar 2020 17:56:42 +0000 (13:56 -0400)]
tests: Modify bgp_rr_ibgp to test RR server correctness

Fixup this basically unused test to ensure that a RR server
passes the nexthop through correctly.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agobgpd: When acting as a RR server do not modify nexthop
Donald Sharp [Sat, 28 Mar 2020 17:58:46 +0000 (13:58 -0400)]
bgpd: When acting as a RR server do not modify nexthop

https://lists.frrouting.org/pipermail/frog/2020-March/000776.html

It was pointed out that we are not properly passing the nexthop
through and instead we were replacing the nexthop as a Route Server
with our own.

https://tools.ietf.org/html/rfc4456#section-4

10.  Implementation Considerations
   Care should be taken to make sure that none of the BGP path
   attributes defined above can be modified through configuration when
   exchanging internal routing information between RRs and Clients and
   Non-Clients.  Their modification could potentially result in routing
   loops.
   In addition, when a RR reflects a route, it SHOULD NOT modify the
   following path attributes: NEXT_HOP, AS_PATH, LOCAL_PREF, and MED.
   Their modification could potentially result in routing loops.

Modify the code such that when FRR is instructed to act as a
Route-Server to pass through the nexthop.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agozebra: include backup info in show ip route 5901/head
Mark Stapp [Tue, 10 Mar 2020 16:44:20 +0000 (12:44 -0400)]
zebra: include backup info in show ip route

Add backup nexthop info to the show output (if present).

Signed-off-by: Mark Stapp <mjs@voltanet.io>
5 years agozebra: include backup nexthops in nhe/nhg show output
Mark Stapp [Wed, 4 Mar 2020 21:05:58 +0000 (16:05 -0500)]
zebra: include backup nexthops in nhe/nhg show output

Include backup nexthops (if any) in the output of 'show
nexthop-group xxx'.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
5 years agozebra: don't include backup nhs in main nhe dependency tree
Mark Stapp [Fri, 13 Mar 2020 20:52:53 +0000 (16:52 -0400)]
zebra: don't include backup nhs in main nhe dependency tree

We don't want to install backup nexthops - yet - as part of the
nexthop-id-based kernel interactions on netlink platforms. Avoid
mixing backup and primary nexthops in the tree of dependencies
in the ecmp cases.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
5 years agozebra: handle backup nexthops in nhe/nhgs
Mark Stapp [Tue, 10 Mar 2020 14:50:40 +0000 (10:50 -0400)]
zebra: handle backup nexthops in nhe/nhgs

Include backup nexthops in nhe processing; connect incoming
zapi route data with updated rib/nhg apis; add more debugs in
nhg processing.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
5 years agozebra: improve route debugging and add support for backups
Mark Stapp [Thu, 23 Jan 2020 19:19:31 +0000 (14:19 -0500)]
zebra: improve route debugging and add support for backups

Refactor the detailed route debugging so that the dump of nexthops
can be used for both normal/active nexthops and backups (if they
are present).

Signed-off-by: Mark Stapp <mjs@voltanet.io>
5 years agozebra: add per-nexthop backup index
Mark Stapp [Tue, 24 Dec 2019 19:22:03 +0000 (14:22 -0500)]
zebra: add per-nexthop backup index

Use a backup index in a nexthop directly (if it has a backup
nexthop); revise the zebra nhe/nhg code; revise zapi route
decoding to match; revise the dataplane route datastructs.

Refactor some of the rib_add_multipath code to be prepared to
be called with an nhe, carrying nexthop and (possibly) backup
info together.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
5 years agosharpd: support backup nexthops
Mark Stapp [Fri, 15 Nov 2019 21:33:34 +0000 (16:33 -0500)]
sharpd: support backup nexthops

Add cli and zapi support for backup nexthops for sharpd routes.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
5 years agolib: support backup nexthops in nexthop-groups and zapi
Mark Stapp [Thu, 16 Jan 2020 21:25:22 +0000 (16:25 -0500)]
lib: support backup nexthops in nexthop-groups and zapi

Add vty support for backup nexthops in nexthop groups. Capture
backup nexthop info in zapi route messages.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
5 years agozebra: support backup nexthops in zapi route messages
Mark Stapp [Wed, 11 Mar 2020 20:08:19 +0000 (16:08 -0400)]
zebra: support backup nexthops in zapi route messages

Initial support to decode backup nexthops in zapi route
messages.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
5 years agolib: add backup nexthops to zapi routes
Mark Stapp [Mon, 11 Nov 2019 20:50:30 +0000 (15:50 -0500)]
lib: add backup nexthops to zapi routes

Add backup nexthop info to zapi route messages.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
5 years agolib: add backup-nexthop value to nexthop
Mark Stapp [Thu, 16 Jan 2020 21:24:16 +0000 (16:24 -0500)]
lib: add backup-nexthop value to nexthop

Add a field supporting a backup nexthop.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
5 years agozebra: clean up a debug and an api in netlink code
Mark Stapp [Fri, 31 Jan 2020 18:57:26 +0000 (13:57 -0500)]
zebra: clean up a debug and an api in netlink code

Simplify the netlink nexthop api; clean up a debug too.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
5 years agozebra,lib: use const in more apis
Mark Stapp [Fri, 8 Nov 2019 19:13:33 +0000 (14:13 -0500)]
zebra,lib: use const in more apis

Use const with some args to ipaddr, zebra vxlan, mpls
lsp, and nexthop apis; add some extra checks to some
nexthop-related apis.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
5 years agoMerge pull request #5740 from sworleys/NHG-2Grp-Fixes
Mark Stapp [Fri, 27 Mar 2020 13:25:18 +0000 (09:25 -0400)]
Merge pull request #5740 from sworleys/NHG-2Grp-Fixes

zebra: NHG fixes in the dataplane conversion function

5 years agoMerge pull request #6084 from sarav511/wrvif_crash
Donald Sharp [Fri, 27 Mar 2020 02:46:01 +0000 (22:46 -0400)]
Merge pull request #6084 from sarav511/wrvif_crash

pimd: avoiding crash in wrvifwhole path

5 years agoMerge pull request #6094 from sworleys/NHG-Fix-Src
Sri Mohana Singamsetty [Fri, 27 Mar 2020 02:08:32 +0000 (19:08 -0700)]
Merge pull request #6094 from sworleys/NHG-Fix-Src

zebra: determine src with nexthop objects as well

5 years agoMerge pull request #6085 from donaldsharp/bgp_node_get_prefix
Sri Mohana Singamsetty [Fri, 27 Mar 2020 02:07:36 +0000 (19:07 -0700)]
Merge pull request #6085 from donaldsharp/bgp_node_get_prefix

Bgp node get prefix

5 years agoMerge pull request #6092 from ton31337/fix/error_message_for_aggregator
Donald Sharp [Fri, 27 Mar 2020 02:07:02 +0000 (22:07 -0400)]
Merge pull request #6092 from ton31337/fix/error_message_for_aggregator

bgpd: Print readable error message when parsing AGGREGATOR attribute

5 years agovtysh: Crash during show running-config 6101/head
saravanank [Fri, 27 Mar 2020 00:36:37 +0000 (17:36 -0700)]
vtysh: Crash during show running-config

RCA:
when client is killed, show running-config command crashes vtysh.
vtysh_client_config function temporarily makes vty->of which is standard output file
pointer to null inorder to suppress output to user.
This call further tries to communicate with each client and when the client
is terminated, socket call fails and hits the exception path to print the
connection has failed using vty_out.
vty_out crashes because vtysh_client_config has temporarily made vty->of
pointer to NULL to supress o/p to user.

Fix:
vty_out function should check for the sanity of vty->of pointer.
If it doesn't exist, this must have hit exception path, so use the
vty->saved_of if exists.

Signed-off-by: Saravanan K <saravanank@vmware.com>
5 years agoMerge pull request #5925 from volta-networks/synchronous_client
Renato Westphal [Thu, 26 Mar 2020 20:32:37 +0000 (17:32 -0300)]
Merge pull request #5925 from volta-networks/synchronous_client

zebra: synchronous client queues accumulate messages from zebra

5 years agobgpd: Convert users of `rn->p` to use accessor function 6085/head
Donald Sharp [Sun, 22 Mar 2020 04:02:18 +0000 (00:02 -0400)]
bgpd: Convert users of `rn->p` to use accessor function

Add new function `bgp_node_get_prefix()` and modify
the bgp code base to use it.

This is prep work for the struct bgp_dest rework.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agolib, bgpd: Another round of `struct const prefix` cleanup
Donald Sharp [Tue, 24 Mar 2020 11:58:08 +0000 (07:58 -0400)]
lib, bgpd: Another round of `struct const prefix` cleanup

Cleanup another set of functions that need to respect the
const'ness of a prefix.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agolib: make oid_copy_addr respect my constness
Donald Sharp [Tue, 24 Mar 2020 14:20:54 +0000 (10:20 -0400)]
lib: make oid_copy_addr respect my constness

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agobgpd: Refactor vnc_import_bgp_redist_table
Donald Sharp [Tue, 24 Mar 2020 14:09:01 +0000 (10:09 -0400)]
bgpd: Refactor vnc_import_bgp_redist_table

This function is heavily indented and hard to read
Make it easier to read.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agozebra: break if duplicate nexthop found in nhe2grp 5740/head
Stephen Worley [Thu, 26 Mar 2020 14:57:45 +0000 (10:57 -0400)]
zebra: break if duplicate nexthop found in nhe2grp

If we find that a nexthop is a duplicate, break immediately
rather than continuing to look through the rest of the list.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
5 years agozebra: properly set the NEXTHOP_GROUP_VALID flag
Stephen Worley [Thu, 30 Jan 2020 21:43:09 +0000 (16:43 -0500)]
zebra: properly set the NEXTHOP_GROUP_VALID flag

Properly set the NEXTHOP_GROUP_VALID flag and use it
as a conditional for installation decisions for individual
nexthop and groups containing it.

We set the NEXTHOP_GROUP_VALID flag it is:

1) A fully resolved active nexthop
or
2) Its a group that contains at least one VALID NHE

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
5 years agozebra: set valid on re->nhe directly in nexthop_active_update()
Stephen Worley [Thu, 30 Jan 2020 17:34:35 +0000 (12:34 -0500)]
zebra: set valid on re->nhe directly in nexthop_active_update()

We were still doing a lookup on the nhe_id from before we
started referencing re->nhe directly.

Change set flag to just use re->nhe directly here since they
should always be the same at this point in the code anyway.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
5 years agozebra: add debug for duplicate NH in dataplane array conversion
Stephen Worley [Tue, 28 Jan 2020 20:20:18 +0000 (15:20 -0500)]
zebra: add debug for duplicate NH in dataplane array conversion

When we find a nexthop ID thats a duplicate in the code that converts
NHG rb trees into a flat list of nexthop IDs for the dataplane,
output a debug message.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
5 years agozebra: don't add ID to kernel nh_grp if not installed/queued
Stephen Worley [Tue, 28 Jan 2020 19:33:10 +0000 (14:33 -0500)]
zebra: don't add ID to kernel nh_grp if not installed/queued

When we transform the nexthop group rb trees into a flat
array of IDs to send into the dataplane code (zebra_nhg_nhe2grp),
don't put an ID in there that has not been in installed or is
not currently queued to be installed into the dataplane.

Otherwise, if some of the nexthops fail to install, we will
still try to create a group with them and then the entire group
will fail.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
5 years agozebra: handle NHG in NHG dataplane group conversion
Stephen Worley [Tue, 28 Jan 2020 00:36:01 +0000 (19:36 -0500)]
zebra: handle NHG in NHG dataplane group conversion

We were not properly handling the case of a NHG inside of
another NHG when converting the rb tree of a multilevel NHG
into a flat list of IDs. When constructing, we call the function
zebra_nhg_nhe2grp_internal() recursively so that the rare
case of a group within a group is handled such that its
singleton nexthops are appended to the grp array of IDs
we send to the dataplane code.

Ex)

1:
-> 2:
-> 3
-> 4
->5:
->6

becomes this:

1:
->3
->4
->6

when its sent to the dataplane code for final kernel installation.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
5 years agozebra: remove unnecessary `cmd =` check 6094/head
Stephen Worley [Thu, 26 Mar 2020 14:39:16 +0000 (10:39 -0400)]
zebra: remove unnecessary `cmd =` check

In the netlink code for determining whether to set
a src on the route, we check if the cmd=NEW_ROUTE
but its not possible for this to ever be anything
but a new route since we do a goto skip further up
if its a DEL_ROUTE cmd.

So remove this unnecessary check.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
5 years agozebra: determine src when using nexthop objects
Stephen Worley [Tue, 24 Mar 2020 21:32:21 +0000 (17:32 -0400)]
zebra: determine src when using nexthop objects

Determine src based on nexthop data even when we are using
kernel nexthop objects.

Before, we were entirely skipping this step and just sending the
nexthop ID, ignoring src determination.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
5 years agozebra: abstract route src determiniation into func
Stephen Worley [Tue, 24 Mar 2020 21:10:08 +0000 (17:10 -0400)]
zebra: abstract route src determiniation into func

Abstraction the route src determination from a nexthop in the
netlink code into a function for both singlepath and mutlipath
to call.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
5 years agobgpd: Show that prefix is malformed if aggregated by 0 6092/head
Donatas Abraitis [Thu, 26 Mar 2020 14:06:34 +0000 (16:06 +0200)]
bgpd: Show that prefix is malformed if aggregated by 0

Show if this malformed under `show [ip] bgp <prefix>`:
 ```
eva# sh ip bgp 103.79.124.0/22
BGP routing table entry for 103.79.124.0/22
Paths: (1 available, best #1, table default)
  Advertised to non peer-group peers:
  192.168.201.136
  64539 15096 6939 7545 7545 136001, (aggregated by 0(malformed) 0.0.0.0)
    192.168.201.136 from 192.168.201.136 (192.168.201.136)
      Origin IGP, valid, external, best (First path received)
      Last update: Thu Mar 26 10:02:07 2020
```

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
5 years agobgpd: Print readable error message when parsing AGGREGATOR attribute
Donatas Abraitis [Thu, 26 Mar 2020 14:06:00 +0000 (16:06 +0200)]
bgpd: Print readable error message when parsing AGGREGATOR attribute

Having a full feed this leads to unknown. You can't point which prefix or
aspath has this malforming behavior.

Printing just `[EC 33554434] AGGREGATOR attribute is BGP_AS_ZERO(0)` isn't
enough, you can't directly pin-point where is the problem.

Additionally print at least aspath here:
```
[EC 33554434] AGGREGATOR AS number is 0 for aspath: 65000 65031
```

Overall the full table has only 6 such malformed prefixes:
```
aspath: 64539 15096 6939 45430 45458
aspath: 64539 15096 6939 1299 3257 34984 34984 34984 34984 34984 51174
aspath: 64539 15096 6939 286 34984 16135 16135 {16135}
aspath: 64539 15096 6939 7545 7545 136001
aspath: 64539 15096 6939 6762 3269 20746
aspath: 64539 15096 6939 7018 3379
```

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
5 years ago*: use the current project name (FRRouting)
Lou Berger [Wed, 25 Mar 2020 21:38:56 +0000 (17:38 -0400)]
*: use the current project name (FRRouting)

Signed-off-by: Lou Berger <lberger@labn.net>
5 years agoMerge pull request #6091 from volta-networks/fix_isis_show_hello
Quentin Young [Wed, 25 Mar 2020 17:05:34 +0000 (13:05 -0400)]
Merge pull request #6091 from volta-networks/fix_isis_show_hello

isisd: fix more mismatches between vty command and show config

5 years agoisisd: fix hello cmds vtysh output 6091/head
Emanuele Di Pascale [Wed, 25 Mar 2020 15:19:01 +0000 (16:19 +0100)]
isisd: fix hello cmds vtysh output

once again, for both hello-multiplier and hello-interval
the order in which the number and level were shown in the
cli_show methods was inverted compared to the vtysh command,
which created issues with frr-reload.py.

Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
5 years agoyang: unionize IPv4/IPv6 route types 5183/head
Rafael Zalamena [Wed, 25 Mar 2020 15:26:14 +0000 (12:26 -0300)]
yang: unionize IPv4/IPv6 route types

Use a union to join the route types declaration instead of
copying/pasting them.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
5 years agoMerge pull request #6079 from sarav511/regstop_exp
Donald Sharp [Wed, 25 Mar 2020 10:32:42 +0000 (06:32 -0400)]
Merge pull request #6079 from sarav511/regstop_exp

pimd: Reg Suppression expiry has to account for couldreg->false while in RegPrune

5 years agoMerge pull request #6087 from opensourcerouting/log-kill-tabs
Donald Sharp [Wed, 25 Mar 2020 10:30:38 +0000 (06:30 -0400)]
Merge pull request #6087 from opensourcerouting/log-kill-tabs

*: remove tabs and linefeeds from log messages

5 years agoMerge pull request #6081 from dslicenc/import-vrf-routemap
Russ White [Tue, 24 Mar 2020 19:57:28 +0000 (15:57 -0400)]
Merge pull request #6081 from dslicenc/import-vrf-routemap

bgpd: clean up import vrf route-map command

5 years agolib: rewrite zlog_hexdump() 6087/head
David Lamparter [Tue, 24 Mar 2020 18:37:58 +0000 (19:37 +0100)]
lib: rewrite zlog_hexdump()

The old version was creating a multi-line log message, which we can't
properly handle right now.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
5 years ago*: remove line breaks from log messages
David Lamparter [Tue, 24 Mar 2020 18:15:04 +0000 (19:15 +0100)]
*: remove line breaks from log messages

Line break at the end of the message is implicit for zlog_* and flog_*,
don't put it in the string.  Mid-message line breaks are currently
unsupported.  (LF is "end of message" in syslog.)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>