]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
4 years agoMerge pull request #5721 from mjstapp/vty_copy_to_runn
Russ White [Tue, 28 Jan 2020 16:31:25 +0000 (11:31 -0500)]
Merge pull request #5721 from mjstapp/vty_copy_to_runn

vtysh: add a cli that reads a file into running-config

4 years agoMerge pull request #5706 from mjstapp/fix_nh_debug_show
Russ White [Tue, 28 Jan 2020 15:27:43 +0000 (10:27 -0500)]
Merge pull request #5706 from mjstapp/fix_nh_debug_show

zebra: include zebra nexthop debug in show runn

4 years agoMerge pull request #5716 from opensourcerouting/bfdd-log
Russ White [Tue, 28 Jan 2020 15:25:56 +0000 (10:25 -0500)]
Merge pull request #5716 from opensourcerouting/bfdd-log

bfdd: remove logging shim & fix warnings

4 years agoMerge pull request #5725 from ton31337/feature/doc_for_set_metric_increment_decrement
Russ White [Tue, 28 Jan 2020 15:06:43 +0000 (10:06 -0500)]
Merge pull request #5725 from ton31337/feature/doc_for_set_metric_increment_decrement

doc: Add documentation about OSPF(6) `set metric [+|-]metric` cmd

4 years agoMerge pull request #5731 from chiragshah6/mdev
Russ White [Tue, 28 Jan 2020 15:06:03 +0000 (10:06 -0500)]
Merge pull request #5731 from chiragshah6/mdev

bgpd: fix memory leak in evpn json outpus II

4 years agoMerge pull request #5673 from qlyoung/fix-zebra-ipset-iptable-memleak-on-disconnect
Donatas Abraitis [Tue, 28 Jan 2020 13:40:35 +0000 (15:40 +0200)]
Merge pull request #5673 from qlyoung/fix-zebra-ipset-iptable-memleak-on-disconnect

zebra: fix ipset, iptable, ipset entry memleaks

4 years agoMerge pull request #5728 from opensourcerouting/move_rpm_to_python3
Donatas Abraitis [Tue, 28 Jan 2020 08:40:08 +0000 (10:40 +0200)]
Merge pull request #5728 from opensourcerouting/move_rpm_to_python3

Move rpm to python3

4 years agobgpd: fix memory leak in evpn json outpus II
Chirag Shah [Mon, 27 Jan 2020 18:41:22 +0000 (10:41 -0800)]
bgpd: fix memory leak in evpn json outpus II

Two of the evpn show commands with json option has memory leak.
1) show bgp l2vpn evpn route vni all json
2) show bgp l2vpn evpn route esi json

Before fix:
----------
Executed 'show bgp l2vpn evpn route vni all json' multiple times
used ordinary blocks continue to increase.

Note at the time of show command capture there were 22 evpn routes
in vni evpn route table.

Memory statistics for bgpd:
System allocator statistics:
  Total heap allocated:  9152 KiB
  Holding block headers: 0 bytes
  Used small blocks:     0 bytes
  Used ordinary blocks:  7300 KiB
  Free small blocks:     1760 bytes
  Free ordinary blocks:  1852 KiB
  Ordinary blocks:       880
  Small blocks:          51
  Holding blocks:        0

Ticket:CM-27920
Reviewed By:
Testing Done:

After fix:
---------
Executed 'show bgp l2vpn evpn route vni all json' multiple times
Used ordinary blocks remains low.

Memory statistics for bgpd:
System allocator statistics:
  Total heap allocated:  8356 KiB
  Holding block headers: 0 bytes
  Used small blocks:     0 bytes
  Used ordinary blocks:  6492 KiB
  Free small blocks:     1840 bytes
  Free ordinary blocks:  1864 KiB
  Ordinary blocks:       939
  Small blocks:          52
  Holding blocks:        0

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
4 years agoMerge pull request #5727 from chiragshah6/mdev
Donatas Abraitis [Mon, 27 Jan 2020 07:12:44 +0000 (09:12 +0200)]
Merge pull request #5727 from chiragshah6/mdev

bgpd: fix memory leak in evpn json outputs

4 years agodoc: Update RedHat packaging description to use Python 3
Martin Winter [Sat, 25 Jan 2020 22:00:47 +0000 (23:00 +0100)]
doc: Update RedHat packaging description to use Python 3

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
4 years agoredhat: Update frr.spec.in to move all systems to Python3 except CentOS 6
Martin Winter [Fri, 24 Jan 2020 23:44:34 +0000 (00:44 +0100)]
redhat: Update frr.spec.in to move all systems to Python3 except CentOS 6

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
4 years agotools: Update generate_support_bundle.py to support Python 3
Martin Winter [Fri, 24 Jan 2020 23:43:20 +0000 (00:43 +0100)]
tools: Update generate_support_bundle.py to support Python 3

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
4 years agobgpd: fix memory leak in evpn json outputs
Chirag Shah [Wed, 22 Jan 2020 20:22:27 +0000 (12:22 -0800)]
bgpd: fix memory leak in evpn json outputs

Found memory leak in json output of evpn's route
commands.

After executing 'show bgp l2vpn evpn route type prefix json'
and 'show bgp l2vpn evpn route type macip json' few times
(6 times) with more than 600 routes in total seeing
memory footprint for bgpd continue to grow.

Memory statistics for bgpd:
System allocator statistics:
  Total heap allocated:  12 MiB
  Holding block headers: 0 bytes
  Used small blocks:     0 bytes
  Used ordinary blocks:  8390 KiB
  Free small blocks:     1760 bytes
  Free ordinary blocks:  3762 KiB
  Ordinary blocks:       1161
  Small blocks:          51
  Holding blocks:        0

Ticket:CM-27920
Testing Done:

After fix:
excute few times,
'show bgp l2vpn evpn route type prefix json'
and 'show bgp l2vpn evpn route type macip json'
commands where used ordinary blocks (uordblks) is
in steady state.

Memory statistics for bgpd:
System allocator statistics:
  Total heap allocated:  9968 KiB
  Holding block headers: 0 bytes
  Used small blocks:     0 bytes
  Used ordinary blocks:  6486 KiB
  Free small blocks:     1984 bytes
  Free ordinary blocks:  3482 KiB
  Ordinary blocks:       1110
  Small blocks:          54
  Holding blocks:        0

Memory statistics for bgpd:
System allocator statistics:
  Total heap allocated:  10100 KiB
  Holding block headers: 0 bytes
  Used small blocks:     0 bytes
  Used ordinary blocks:  6488 KiB
  Free small blocks:     1984 bytes
  Free ordinary blocks:  3612 KiB
  Ordinary blocks:       1113
  Small blocks:          54
  Holding blocks:        0

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
4 years agodoc: Add documentation about OSPF(6) `set metric [+|-]metric` cmd
Donatas Abraitis [Fri, 24 Jan 2020 12:11:02 +0000 (14:11 +0200)]
doc: Add documentation about OSPF(6) `set metric [+|-]metric` cmd

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
4 years agovtysh: add a cli that reads a file into running-config
Mark Stapp [Thu, 23 Jan 2020 15:17:40 +0000 (10:17 -0500)]
vtysh: add a cli that reads a file into running-config

Add a 'copy' cli that reads a file into the current running
config. Add an entry about the new cli to the user doc.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
4 years agoMerge pull request #5620 from qlyoung/fix-zebra-vrf-label-afi-check
Mark Stapp [Thu, 23 Jan 2020 15:59:19 +0000 (10:59 -0500)]
Merge pull request #5620 from qlyoung/fix-zebra-vrf-label-afi-check

Fix zebra vrf label afi check

4 years agoMerge pull request #5711 from donaldsharp/onlink_loss
Mark Stapp [Thu, 23 Jan 2020 15:50:01 +0000 (10:50 -0500)]
Merge pull request #5711 from donaldsharp/onlink_loss

zebra: Re-add onlink flag due to loss in earlier commit

4 years agodoc: Update ospf unnumbered documentation
Donald Sharp [Thu, 23 Jan 2020 02:46:46 +0000 (21:46 -0500)]
doc: Update ospf unnumbered documentation

Update the ospf unnumbered documentation to reflect how
to get it working under linux.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agotests: Test ospf unnumbered behavior and ensure that it works
Donald Sharp [Mon, 20 Jan 2020 19:49:03 +0000 (14:49 -0500)]
tests: Test ospf unnumbered behavior and ensure that it works

Recent commit: 0eb97b860dc94329cf9add9f8f3d3a2c7f539568

Broke onlink behavior and as a result ospf unnumbered failed
to work.  This commit adds a small test to create 2 ospf routers,
connect them through ospf unlinked behavior and then ensure
that the routes are installed into the kernel as expected.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agozebra: Re-add onlink flag due to loss in earlier commit
Donald Sharp [Mon, 20 Jan 2020 21:53:34 +0000 (16:53 -0500)]
zebra: Re-add onlink flag due to loss in earlier commit

commit: 0eb97b860dc94329cf9add9f8f3d3a2c7f539568

Removed this chunk of code in zebra:
-       if (ifp)
-               if (connected_is_unnumbered(ifp))
-                       SET_FLAG(nexthop->flags, NEXTHOP_FLAG_ONLINK);

Effectively if we had a NEXTHOP_TYPE_IPV4_IFINDEX we would
auto set the onlink flag.  This commit dropped it for some reason.

Add it back in an intelligent manner.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agoMerge pull request #5412 from opensourcerouting/bfdd-vrf-fix
Quentin Young [Wed, 22 Jan 2020 19:14:21 +0000 (14:14 -0500)]
Merge pull request #5412 from opensourcerouting/bfdd-vrf-fix

bfdd: fix multiple VRF handling

4 years agozebra: check afi validity in vrf label message
Quentin Young [Fri, 3 Jan 2020 22:49:01 +0000 (17:49 -0500)]
zebra: check afi validity in vrf label message

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
4 years agolib: add macro to check if value is valid afi
Quentin Young [Fri, 3 Jan 2020 22:48:36 +0000 (17:48 -0500)]
lib: add macro to check if value is valid afi

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
4 years agoMerge pull request #5710 from opensourcerouting/fix_centos6
Mark Stapp [Wed, 22 Jan 2020 13:22:48 +0000 (08:22 -0500)]
Merge pull request #5710 from opensourcerouting/fix_centos6

lib: Fix missing __be16 typedef on CentOS6

4 years agoMerge pull request #5656 from pguibert6WIND/import_evpn_entries
Donatas Abraitis [Wed, 22 Jan 2020 08:21:59 +0000 (10:21 +0200)]
Merge pull request #5656 from pguibert6WIND/import_evpn_entries

bgpd: import evpn entries with nexthop self attribute

4 years agoMerge pull request #5473 from yasuhiro-ohara-ntt/ospf6d-self-orig-maxage-fix
Sri Mohana Singamsetty [Tue, 21 Jan 2020 17:04:04 +0000 (22:34 +0530)]
Merge pull request #5473 from yasuhiro-ohara-ntt/ospf6d-self-orig-maxage-fix

ospf6d: ospf6_flood.c: self-originated MaxAge LSAs to install and refresh.

4 years agotopotest: minor doc, lutil, sharpd not compiled changes (#5675)
David Lamparter [Tue, 21 Jan 2020 16:32:59 +0000 (17:32 +0100)]
topotest: minor doc, lutil, sharpd not compiled changes (#5675)

topotest: minor doc, lutil, sharpd not compiled changes

4 years agobfdd: fix format strings
David Lamparter [Tue, 21 Jan 2020 14:02:41 +0000 (15:02 +0100)]
bfdd: fix format strings

... now that we get warnings about them ...

Signed-off-by: David Lamparter <equinox@diac24.net>
4 years agobfdd: remove logging shim
David Lamparter [Tue, 21 Jan 2020 13:29:17 +0000 (14:29 +0100)]
bfdd: remove logging shim

This does exactly nothing, other than hiding format warnings...

Signed-off-by: David Lamparter <equinox@diac24.net>
4 years agozebra: include zebra nexthop debug in show runn
Mark Stapp [Fri, 17 Jan 2020 21:07:33 +0000 (16:07 -0500)]
zebra: include zebra nexthop debug in show runn

Add show output for 'debug zebra nexthop [detail]' category.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
4 years agotopotest: log results summary at end of lutil run
Lou Berger [Tue, 14 Jan 2020 16:24:12 +0000 (11:24 -0500)]
topotest: log results summary at end of lutil run

Signed-off-by: Lou Berger <lberger@labn.net>
4 years agotopotest: bgp_l3vpn_to_bgp_vrf - catch case of sharpd not being compiled
Lou Berger [Tue, 14 Jan 2020 13:19:05 +0000 (08:19 -0500)]
topotest: bgp_l3vpn_to_bgp_vrf - catch case of sharpd not being compiled

Signed-off-by: Lou Berger <lberger@labn.net>
4 years agodoc: recommend compiling with sharpd to enable scaling testing
Lou Berger [Tue, 14 Jan 2020 13:16:48 +0000 (08:16 -0500)]
doc: recommend compiling with sharpd to enable scaling testing

Signed-off-by: Lou Berger <lberger@labn.net>
4 years agolib: Fix missing __be16 typedef on CentOS6
Martin Winter [Mon, 20 Jan 2020 14:40:49 +0000 (15:40 +0100)]
lib: Fix missing __be16 typedef on CentOS6

Need to include linux/types.h on older Linux

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
4 years agodoc: add instructions for static linking (#5668)
David Lamparter [Mon, 20 Jan 2020 09:42:29 +0000 (10:42 +0100)]
doc: add instructions for static linking (#5668)

doc: add instructions for static linking

4 years agoMerge pull request #5707 from donaldsharp/nexthop_encoding
Donatas Abraitis [Sat, 18 Jan 2020 21:25:56 +0000 (23:25 +0200)]
Merge pull request #5707 from donaldsharp/nexthop_encoding

Nexthop encoding

4 years agotests: Add another router to the basic pim tests
Donald Sharp [Sat, 18 Jan 2020 14:16:10 +0000 (09:16 -0500)]
tests: Add another router to the basic pim tests

Add an additional router to the basic pim tests.
1) This test will add a link between r1 and a new rp
2) This test will ensure that r1 and rp have the expected
who is the rp.
3) This test will ensure that the rp has received the upstream
data for the multicast stream that is started.

Ostensibly commit
68a02e06e5f103048d947262c08c569056f74d1c is the first bad commit
commit 68a02e06e5f103048d947262c08c569056f74d1c
Author: Mark Stapp <mjs@voltanet.io>
Date:   Wed Nov 13 16:06:06 2019 -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>
Sparked this commit in that it broke nexthop reporting to upper
level protocols.  Ensure that this expectation stays working
in the future.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agoMerge pull request #5703 from ton31337/feature/limit_outgoing_prefixes
Donald Sharp [Sat, 18 Jan 2020 17:20:44 +0000 (12:20 -0500)]
Merge pull request #5703 from ton31337/feature/limit_outgoing_prefixes

bgpd: Add an option to limit outgoing prefixes

4 years agoMerge pull request #5704 from opensourcerouting/build-cleanup-20200117
Donald Sharp [Sat, 18 Jan 2020 17:09:45 +0000 (12:09 -0500)]
Merge pull request #5704 from opensourcerouting/build-cleanup-20200117

build: random cleanups

4 years agolib: Fix nexthop encoding
Donald Sharp [Sat, 18 Jan 2020 14:25:38 +0000 (09:25 -0500)]
lib: Fix nexthop encoding

Commit
68a02e06e5f103048d947262c08c569056f74d1c broke nexthop encoding
for nexthop tracking.

This code combined the different types of nexthop encoding
being done in the zapi protocol.  What was missed that
resolved nexthops of type NEXTHOP_TYPE_IPV4|6 have an ifindex
value that was not being reported.  This commit ensures
that we always send this data( even if it is 0).

The following test commit will ensure that this stays working
as is expected by an upper level protocol.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agoMerge pull request #5701 from ton31337/fix/remove_peer_scount
Rafael Zalamena [Fri, 17 Jan 2020 17:27:24 +0000 (17:27 +0000)]
Merge pull request #5701 from ton31337/fix/remove_peer_scount

bgpd: Remove peer->scount

4 years agobuild: fix auto git ID length
David Lamparter [Fri, 17 Jan 2020 14:53:47 +0000 (15:53 +0100)]
build: fix auto git ID length

This script was written back when `git describe` would abbreviate to
7-char commit IDs;  they're longer now and we're grabbing the tail
end...

Signed-off-by: David Lamparter <equinox@diac24.net>
4 years agobuild: accept libunwind without pkg-config
David Lamparter [Fri, 17 Jan 2020 12:57:15 +0000 (13:57 +0100)]
build: accept libunwind without pkg-config

NetBSD installs LLVM's libunwind without a pkg-config file, but it
works perfectly fine.

Signed-off-by: David Lamparter <equinox@diac24.net>
4 years agotests: Add test for `neighbor <X.X.X.X> maximum-prefix-out <Y>`
Donatas Abraitis [Fri, 17 Jan 2020 14:10:01 +0000 (16:10 +0200)]
tests: Add test for `neighbor <X.X.X.X> maximum-prefix-out <Y>`

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
4 years agobgpd: Add an option to limit outgoing prefixes
Donatas Abraitis [Fri, 17 Jan 2020 14:04:18 +0000 (16:04 +0200)]
bgpd: Add an option to limit outgoing prefixes

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
4 years agodoc: Add some words about `neighbor <X> maximum-prefix-out` cmd
Donatas Abraitis [Fri, 17 Jan 2020 14:03:38 +0000 (16:03 +0200)]
doc: Add some words about `neighbor <X> maximum-prefix-out` cmd

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
4 years agobuild: fix shell == mis-use
David Lamparter [Thu, 16 Jan 2020 19:23:23 +0000 (20:23 +0100)]
build: fix shell == mis-use

The "test" program uses =, not ==.  A lot of shells accept == as an
extension, but not all do and it's technically out of spec.

Signed-off-by: David Lamparter <equinox@diac24.net>
4 years agoconfigure.ac: add --enable-clang-coverage (#5698)
David Lamparter [Fri, 17 Jan 2020 10:38:44 +0000 (11:38 +0100)]
configure.ac: add --enable-clang-coverage (#5698)

configure.ac: add --enable-clang-coverage

4 years agobgpd: Remove peer->scount
Donatas Abraitis [Fri, 17 Jan 2020 09:02:00 +0000 (11:02 +0200)]
bgpd: Remove peer->scount

Looks like it's not used anywhere.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
4 years agoMerge pull request #5699 from qlyoung/zebra-iprule-print-unknown-family-as-number
Donatas Abraitis [Fri, 17 Jan 2020 08:23:08 +0000 (10:23 +0200)]
Merge pull request #5699 from qlyoung/zebra-iprule-print-unknown-family-as-number

zebra: print unknown rule family as number

4 years agoMerge pull request #5686 from qlyoung/fix-bgp-fqdn-capability-leak
Donatas Abraitis [Fri, 17 Jan 2020 08:22:26 +0000 (10:22 +0200)]
Merge pull request #5686 from qlyoung/fix-bgp-fqdn-capability-leak

bgpd: fix memory leak when parsing capabilities

4 years agozebra: print unknown rule family as number
Quentin Young [Fri, 17 Jan 2020 01:53:10 +0000 (20:53 -0500)]
zebra: print unknown rule family as number

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
4 years agoMerge pull request #5694 from kooky/bfd_doc
Quentin Young [Thu, 16 Jan 2020 22:47:10 +0000 (17:47 -0500)]
Merge pull request #5694 from kooky/bfd_doc

doc: Note about BFD debug logging

4 years agoconfigure.ac: add --enable-clang-coverage
Quentin Young [Thu, 16 Jan 2020 21:25:59 +0000 (16:25 -0500)]
configure.ac: add --enable-clang-coverage

Like gcov but better!
Also has a driveby fix for --enable-dev-build being mutually exclusive
with --enable-gcov...

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
4 years agozebra: fix ipset, iptable, ipset entry memleaks
Quentin Young [Tue, 14 Jan 2020 06:17:01 +0000 (01:17 -0500)]
zebra: fix ipset, iptable, ipset entry memleaks

Removed from hash, but not freed, on client disconnect.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
4 years agobgpd: fix memory leak when parsing capabilities
Quentin Young [Wed, 15 Jan 2020 18:00:34 +0000 (13:00 -0500)]
bgpd: fix memory leak when parsing capabilities

Duplicated domain name capability messages cause memory leak. The amount
of leaked memory is proportional to the size of the duplicated
capabilities. This bug was introduced in 2015.

To hit this, a BGP OPEN message must contain multiple FQDN capabilities.
Memory is leaked when the hostname portion of the capability is of
length 0, but the domainname portion is not, for any of the duplicated
capabilities beyond the first one.

https://tools.ietf.org/html/draft-walton-bgp-hostname-capability-00

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
4 years agodoc: add instructions for static linking
Quentin Young [Mon, 13 Jan 2020 16:30:27 +0000 (11:30 -0500)]
doc: add instructions for static linking

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
4 years agodoc: Note about BFD debug logging
Tim Bray [Thu, 16 Jan 2020 16:06:54 +0000 (16:06 +0000)]
doc: Note about BFD debug logging

Because there is nothing in config debug for BFD.

Signed-off-by: Tim Bray <tim@kooky.org>
4 years agoMerge pull request #5608 from dslicenc/frr-reload-deletes
Donatas Abraitis [Thu, 16 Jan 2020 14:41:34 +0000 (16:41 +0200)]
Merge pull request #5608 from dslicenc/frr-reload-deletes

tools: improve frr-reload delete performance for some commands

4 years agoMerge pull request #5612 from sworleys/NHG-Topotest
Mark Stapp [Thu, 16 Jan 2020 13:11:17 +0000 (08:11 -0500)]
Merge pull request #5612 from sworleys/NHG-Topotest

tests: add basic nexthop group functionality test

4 years agotools: improve frr-reload delete performance for some commands
Don Slice [Mon, 23 Dec 2019 16:18:50 +0000 (08:18 -0800)]
tools: improve frr-reload delete performance for some commands

Problem seen when deleting many static routes or access-lists due
to frr-reload.py issuing individual vtysh -c commands for every
line. On slow switches, this can take long enough for systemd to
time out the reload process and restart frr.  This fix uses add
logic for static routes, prefix-lists, and access-lists to gang
the changes together.

Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
Ticket: CM-27856

4 years agozebra: Fix label manager memory leak (#5680)
David Lamparter [Thu, 16 Jan 2020 09:20:57 +0000 (10:20 +0100)]
zebra: Fix label manager memory leak (#5680)

zebra: Fix label manager memory leak

4 years agoMerge pull request #5674 from qlyoung/fix-zebra-redist-disconnect-memleak
David Lamparter [Thu, 16 Jan 2020 09:18:35 +0000 (10:18 +0100)]
Merge pull request #5674 from qlyoung/fix-zebra-redist-disconnect-memleak

zebra: fix redist memleak on client disconnect

4 years agoMerge pull request #5672 from qlyoung/fix-zebra-pbr-iptable-heap-uaf
David Lamparter [Thu, 16 Jan 2020 09:14:45 +0000 (10:14 +0100)]
Merge pull request #5672 from qlyoung/fix-zebra-pbr-iptable-heap-uaf

zebra: fix iptable install heap UAF

4 years agozebra: fix assert crash on corrupt vxlan msg (#5670)
David Lamparter [Thu, 16 Jan 2020 09:13:59 +0000 (10:13 +0100)]
zebra: fix assert crash on corrupt vxlan msg (#5670)

zebra: fix assert crash on corrupt vxlan msg

4 years agozebra: Do not accept illegal safi's for route installation (#5679)
David Lamparter [Thu, 16 Jan 2020 09:12:44 +0000 (10:12 +0100)]
zebra: Do not accept illegal safi's for route installation (#5679)

zebra: Do not accept illegal safi's for route installation

4 years agoMerge pull request #5664 from mitch-skiba/addpath-adj-out
Donatas Abraitis [Thu, 16 Jan 2020 04:52:21 +0000 (06:52 +0200)]
Merge pull request #5664 from mitch-skiba/addpath-adj-out

bgpd: add addpath ID to adj_out tree sort

4 years agotests: add basic nexthop group functionality test
Stephen Worley [Tue, 31 Dec 2019 22:10:58 +0000 (17:10 -0500)]
tests: add basic nexthop group functionality test

Add a very basic nexthop group functionality test.

This test creates a 2-way ecmp group and installs a route
with it using sharpd. Then we check to see that the nexthop
groups are marked valid/installed in zebra.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agoMerge pull request #5600 from sworleys/NHG-Depend-Crash
Mark Stapp [Wed, 15 Jan 2020 21:31:55 +0000 (16:31 -0500)]
Merge pull request #5600 from sworleys/NHG-Depend-Crash

zebra: can't improve efficiency for recursive depends

4 years agoMerge pull request #5616 from sworleys/NHG-Fix-Recurse-to-Group
Mark Stapp [Wed, 15 Jan 2020 21:26:06 +0000 (16:26 -0500)]
Merge pull request #5616 from sworleys/NHG-Fix-Recurse-to-Group

zebra: just set nexthop member in handle_recursive_depend()

4 years agozebra: fix assert crash on corrupt vxlan msg
Quentin Young [Mon, 13 Jan 2020 21:22:27 +0000 (16:22 -0500)]
zebra: fix assert crash on corrupt vxlan msg

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
4 years agozebra: fix iptable install heap UAF
Quentin Young [Tue, 14 Jan 2020 06:18:44 +0000 (01:18 -0500)]
zebra: fix iptable install heap UAF

My previous patch to fix a memory leak, caused by not properly freeing
the iptable iface list on stream parse failure, created/exposed a heap
use after free because we were not doing a deep copy

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
4 years agozebra: fix redist memleak on client disconnect
Quentin Young [Tue, 14 Jan 2020 06:15:04 +0000 (01:15 -0500)]
zebra: fix redist memleak on client disconnect

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
4 years agoMerge pull request #5666 from donaldsharp/more_nhg_fixes
Donatas Abraitis [Wed, 15 Jan 2020 18:38:54 +0000 (20:38 +0200)]
Merge pull request #5666 from donaldsharp/more_nhg_fixes

bgpd, ospfd, zebra: Do not use 0 as VRF_DEFAULT

4 years agolib: assert if someone adds to nexthop list to nhg
Stephen Worley [Mon, 13 Jan 2020 19:28:29 +0000 (14:28 -0500)]
lib: assert if someone adds to nexthop list to nhg

If someone tries to add a nexthop with a list of nexthops
already attached to it, let's just assert. This standardizes
the API to say we assume this is an individual nexthop
you are appending to a group.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agozebra: just set nexthop member in handle_recursive_depend()
Stephen Worley [Fri, 3 Jan 2020 17:35:15 +0000 (12:35 -0500)]
zebra: just set nexthop member in handle_recursive_depend()

With recent changes to the lib nexthop_group
APIs (e1f3a8eb193267da195088cc515b598ae5a92a12), we are making
new assumptions that this should be adding a single nexthop
to a group, not a list of nexthops.

This broke the case of a recursive nexthop resolving to a group:

```
D>  2.2.2.1/32 [150/0] via 1.1.1.1 (recursive), 00:00:09
  *                      via 1.1.1.1, dummy1 onlink, 00:00:09
                       via 1.1.1.2 (recursive), 00:00:09
  *                      via 1.1.1.2, dummy2 onlink, 00:00:09
D>  3.3.3.1/32 [150/0] via 2.2.2.1 (recursive), 00:00:04
  *                      via 1.1.1.1, dummy1 onlink, 00:00:04
K * 10.0.0.0/8 [0/1] via 172.27.227.148, tun0, 00:00:21
```

This group can instead just directly point to the nh that was passed.
Its only being used for a lookup (the memory gets copied and used
elsewhere if the nexthop is not found).

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agolib,zebra: tighten up the nexthop_copy/nexthop_dup APIs
Stephen Worley [Mon, 13 Jan 2020 18:29:58 +0000 (13:29 -0500)]
lib,zebra: tighten up the nexthop_copy/nexthop_dup APIs

Make the nexthop_copy/nexthop_dup APIs more consistent by
adding a secondary, non-recursive, version of them. Before,
it was inconsistent whether the APIs were expected to copy
recursive info or not. Make it clear now that the default is
recursive info is copied unless the _no_recurse() version is
called. These APIs are not heavily used so it is fine to
change them for now.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agozebra: can't improve efficiency for recursive depends
Stephen Worley [Tue, 31 Dec 2019 17:10:58 +0000 (12:10 -0500)]
zebra: can't improve efficiency for recursive depends

cb86eba3ab3d82f540bdb9ed5f65d361ca301ea8 was causing zebra to crash
when handling a nexthop group that had a nexthop which was recursively resolved.

Steps to recreate:

!
nexthop-group red
 nexthop 1.1.1.1
 nexthop 1.1.1.2
!

sharp install routes 8.8.8.1 nexthop-group red 1

=========================================
==11898== Invalid write of size 8
==11898==    at 0x48E53B4: _nexthop_add_sorted (nexthop_group.c:254)
==11898==    by 0x48E5336: nexthop_group_add_sorted (nexthop_group.c:296)
==11898==    by 0x453593: handle_recursive_depend (zebra_nhg.c:481)
==11898==    by 0x451CA8: zebra_nhg_find (zebra_nhg.c:572)
==11898==    by 0x4530FB: zebra_nhg_find_nexthop (zebra_nhg.c:597)
==11898==    by 0x4536B4: depends_find (zebra_nhg.c:1065)
==11898==    by 0x453526: depends_find_add (zebra_nhg.c:1087)
==11898==    by 0x451C4D: zebra_nhg_find (zebra_nhg.c:567)
==11898==    by 0x4519DE: zebra_nhg_rib_find (zebra_nhg.c:1126)
==11898==    by 0x452268: nexthop_active_update (zebra_nhg.c:1729)
==11898==    by 0x461517: rib_process (zebra_rib.c:1049)
==11898==    by 0x4610C8: process_subq_route (zebra_rib.c:1967)
==11898==  Address 0x0 is not stack'd, malloc'd or (recently) free'd

Zebra crashes because we weren't handling the case of the depend nexthop
being recursive.

For this case, we cannot make the function more efficient. A nexthop
could resolve to a group of any size, thus we need allocs/frees.

To solve this and retain the goal of the original patch, we separate out the
two cases so it will still be more efficient if the nexthop is not recursive.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agobgpd: add addpath ID to adj_out tree sort
Mitchell Skiba [Thu, 9 Jan 2020 19:46:13 +0000 (11:46 -0800)]
bgpd: add addpath ID to adj_out tree sort

When withdrawing addpaths, adj_lookup was called to find the path that
needed to be withdrawn. It would lookup in the RB tree based on subgroup
pointer alone, often find the path with the wrong addpath ID, and return
null.  Only the path highest in the tree sent to the subgroup could be
found, thus withdrawn.

Adding the addpath ID to the sort criteria for the RB tree allows us to
simplify the logic for adj_lookup, and address this problem. We are able
to remove the logic around non-addpath subgroups because the addpath ID
is consistently 0 for non-addpath adj_outs, so special logic to skip
matching the addpath ID isn't required.  (As a side note, addpath will
also never use ID 0, so there won't be any ambiguity when looking at the
structure content.)

Signed-off-by: Mitchell Skiba <mskiba@amazon.com>
4 years agoMerge pull request #5681 from opensourcerouting/manpage-rename
Donald Sharp [Wed, 15 Jan 2020 16:24:26 +0000 (11:24 -0500)]
Merge pull request #5681 from opensourcerouting/manpage-rename

doc: manpage rename

4 years agobgpd, ospfd, zebra: Do not use 0 as VRF_DEFAULT
Donald Sharp [Thu, 9 Jan 2020 21:57:35 +0000 (16:57 -0500)]
bgpd, ospfd, zebra: Do not use 0 as VRF_DEFAULT

Explicitly spell out what we are trying to do.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agozebra: Do not accept illegal safi's for route installation
Donald Sharp [Wed, 15 Jan 2020 02:03:11 +0000 (21:03 -0500)]
zebra: Do not accept illegal safi's for route installation

The only two safi's that are usable for zebra for installation
of routes into the rib are SAFI_UNICAST and SAFI_MULTICAST.
The acceptance of other safi's is causing a memory leak:

Direct leak of 56 byte(s) in 1 object(s) allocated from:
    #0 0x5332f2 in calloc (/usr/lib/frr/zebra+0x5332f2)
    #1 0x7f594adc29db in qcalloc /opt/build/frr/lib/memory.c:110:27
    #2 0x686849 in zebra_vrf_get_table_with_table_id /opt/build/frr/zebra/zebra_vrf.c:390:11
    #3 0x65a245 in rib_add_multipath /opt/build/frr/zebra/zebra_rib.c:2591:10
    #4 0x7211bc in zread_route_add /opt/build/frr/zebra/zapi_msg.c:1616:8
    #5 0x73063c in zserv_handle_commands /opt/build/frr/zebra/zapi_msg.c:2682:2
Collapse

Sequence of events:

Upon vrf creation there is a zvrf->table[afi][safi] data structure
that tables are auto created for.  These tables only create SAFI_UNICAST
and SAFI_MULTICAST tables.  Since these are the only safi types that
are zebra can actually work on.  zvrf data structures also have a
zvrf->otable data structure that tracks in a RB tree other tables
that are created ( say you have routes stuck in any random table
in the 32bit route table space in linux ).  This data structure is
only used if the lookup in zvrf->table[afi][safi] fails.

After creation if we pass a route down from an upper level protocol
that has non unicast or multicast safi *but* has the actual
tableid of the vrf we are in, the initial lookup will always
return NULL leaving us to look in the otable.  This will create
a data structure to track this data.

If after this event you pass in a second route with the same
afi/safi/table_id, the otable will be created and attempted
to be stored, but the RB_TREE_UNIQ data structure when it sees
this will return the original otable returned and the lookup function
zebra_vrf_get_table_with_table_id will just drop the second otable.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agozebra: Fix label manager memory leak
Donald Sharp [Wed, 15 Jan 2020 03:38:49 +0000 (22:38 -0500)]
zebra: Fix label manager memory leak

==25402==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 16 byte(s) in 1 object(s) allocated from:
    #0 0x533302 in calloc (/usr/lib/frr/zebra+0x533302)
    #1 0x7fee84cdc80b in qcalloc /home/qlyoung/frr/lib/memory.c:110:27
    #2 0x5a3032 in create_label_chunk /home/qlyoung/frr/zebra/label_manager.c:188:3
    #3 0x5a3c2b in assign_label_chunk /home/qlyoung/frr/zebra/label_manager.c:354:8
    #4 0x5a2a38 in label_manager_get_chunk /home/qlyoung/frr/zebra/label_manager.c:424:9
    #5 0x5a1412 in hook_call_lm_get_chunk /home/qlyoung/frr/zebra/label_manager.c:60:1
    #6 0x5a1412 in lm_get_chunk_call /home/qlyoung/frr/zebra/label_manager.c:81:2
    #7 0x72a234 in zread_get_label_chunk /home/qlyoung/frr/zebra/zapi_msg.c:2026:2
    #8 0x72a234 in zread_label_manager_request /home/qlyoung/frr/zebra/zapi_msg.c:2073:4
    #9 0x73150c in zserv_handle_commands /home/qlyoung/frr/zebra/zapi_msg.c:2688:2

When creating label chunk that has a specified base, we eventually are
calling assign_specific_label_chunk. This function finds the appropriate
list node and deletes it from the lbl_mgr.lc_list but since
the function uses list_delete_node() the deletion function that is
specified for lbl_mgr.lc_list is not called thus dropping the memory.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agoospfclient: don't install man page
David Lamparter [Wed, 15 Jan 2020 11:22:26 +0000 (12:22 +0100)]
ospfclient: don't install man page

... we're not installing ospfclient (it's a demo/example program), so
installing the man page is quite useless.

Signed-off-by: David Lamparter <equinox@diac24.net>
4 years agodoc: rename man pages to frr-*
David Lamparter [Tue, 14 Jan 2020 23:00:32 +0000 (00:00 +0100)]
doc: rename man pages to frr-*

The vrrpd one conflicts with the standalone vrrpd package; also we're
installing daemons to /usr/lib/frr on some systems so they're not on
PATH.

Signed-off-by: David Lamparter <equinox@diac24.net>
4 years agoMerge pull request #5677 from qlyoung/fix-my-bfd-screwups
David Lamparter [Wed, 15 Jan 2020 13:04:44 +0000 (14:04 +0100)]
Merge pull request #5677 from qlyoung/fix-my-bfd-screwups

zebra: bfd message handling cleanup foo

4 years agoMerge pull request #5590 from qlyoung/fix-nhrp-underflow
Jafar Al-Gharaibeh [Wed, 15 Jan 2020 04:57:15 +0000 (22:57 -0600)]
Merge pull request #5590 from qlyoung/fix-nhrp-underflow

nhrpd: offset value not checked for min size

4 years agonhrpd: offset value not checked for min size
Quentin Young [Thu, 26 Dec 2019 11:58:02 +0000 (06:58 -0500)]
nhrpd: offset value not checked for min size

If the extension offset points to a location within the packet header,
we end up with an integer underflow leading to heap buffer read
overflow.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
4 years agoMerge pull request #5657 from mjstapp/staticd_add_debugs
Quentin Young [Tue, 14 Jan 2020 22:43:48 +0000 (17:43 -0500)]
Merge pull request #5657 from mjstapp/staticd_add_debugs

staticd: add debug support

4 years agozebra: bfd message handling cleanup foo
Quentin Young [Tue, 14 Jan 2020 18:55:55 +0000 (13:55 -0500)]
zebra: bfd message handling cleanup foo

Previous patches introduced various issues:
- Removal of stream_free() to fix double free caused memleak
- Patch for memleak was incomplete

This should fix it hopefully.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
4 years agoMerge pull request #5627 from chiragshah6/mdev
Renato Westphal [Tue, 14 Jan 2020 16:32:35 +0000 (13:32 -0300)]
Merge pull request #5627 from chiragshah6/mdev

*:  modify two evpn debugs

4 years ago*: Modify version number of build
Donald Sharp [Tue, 14 Jan 2020 13:21:57 +0000 (08:21 -0500)]
*: Modify version number of build

With the pull of the 7.3 stabilization branch, update the
version number we will auto generate.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agoMerge pull request #5663 from donaldsharp/nhg_topotests_fixes
Mark Stapp [Fri, 10 Jan 2020 23:19:23 +0000 (18:19 -0500)]
Merge pull request #5663 from donaldsharp/nhg_topotests_fixes

Nhg topotests fixes

4 years agoMerge pull request #5662 from qlyoung/fix-ptm-bfd-deregister-memleak
Mark Stapp [Fri, 10 Jan 2020 21:59:20 +0000 (16:59 -0500)]
Merge pull request #5662 from qlyoung/fix-ptm-bfd-deregister-memleak

zebra: fix bfd deregister message memleak

4 years agozebra: Actually add the NLA_F_NESTED flag to our code
Donald Sharp [Fri, 10 Jan 2020 20:13:36 +0000 (15:13 -0500)]
zebra: Actually add the NLA_F_NESTED flag to our code

The existing usage of the rta_nest and addattr_nest
functions were not adding the NLA_F_NESTED flag
to the type.  As such the new nexthop functionality was
actually looking for this flag, while apparently older
code did not.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agobgpd: debug convert to snprintf
Chirag Shah [Tue, 7 Jan 2020 04:45:53 +0000 (20:45 -0800)]
bgpd: debug convert to snprintf

Change sprintf to snprintf

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
4 years agozebra: fix debug in macvlan down event
Chirag Shah [Fri, 3 Jan 2020 23:34:44 +0000 (15:34 -0800)]
zebra: fix debug in macvlan down event

fix a debug where display parent interface name
only if it exists.

Ticket:CM-27733

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
4 years agobgpd: add rmac field in route_add debug
Chirag Shah [Sat, 19 Oct 2019 18:28:15 +0000 (11:28 -0700)]
bgpd: add rmac field in route_add debug

For evpn routes, nexthop and RMAC fileds are synced
in route add to zebra.

In case of EVPN routes display RMAC field in route add
debug log.

Reviewed By:CCR-9381
Testing Done:

BGP:   nhop [1]: 27.0.0.11 if 30 VRF 26   RMAC 00:02:00:00:00:2e

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
4 years agoMerge pull request #5661 from ton31337/fix/doc_for_redhat
Quentin Young [Fri, 10 Jan 2020 18:44:21 +0000 (13:44 -0500)]
Merge pull request #5661 from ton31337/fix/doc_for_redhat

doc: Replace wrong paths for centos/fedora source build instructions

4 years agotests: ospf6-topo1 did not work properly with nhg's and 5.3 kernels
Donald Sharp [Fri, 10 Jan 2020 13:57:18 +0000 (08:57 -0500)]
tests: ospf6-topo1 did not work properly with nhg's and 5.3 kernels

Fix the ospf6-topo1 test to understand nhg's and what happens
when they are installed into a kernel that can support them.

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