]> git.puffer.fish Git - mirror/frr.git/log
mirror/frr.git
3 years agotests: topotests/lib/lutil.py: optimize wait to not repeat command after expected... 9902/head
Lou Berger [Tue, 26 Oct 2021 14:56:50 +0000 (10:56 -0400)]
tests: topotests/lib/lutil.py: optimize wait to not repeat command after expected result found

Signed-off-by: Lou Berger <lberger@labn.net>
3 years agoMerge pull request #9898 from donaldsharp/nexthop_stuff
Igor Ryzhov [Tue, 26 Oct 2021 14:45:16 +0000 (17:45 +0300)]
Merge pull request #9898 from donaldsharp/nexthop_stuff

include, zebra: Add recent nexthop.h

3 years agoMerge pull request #9886 from slankdev/fix-srv6-hardcode
Igor Ryzhov [Tue, 26 Oct 2021 14:43:54 +0000 (17:43 +0300)]
Merge pull request #9886 from slankdev/fix-srv6-hardcode

lib: fix srv6 route hardcode with BGP

3 years agoMerge pull request #9873 from bhinin/dynamic_peer_count_reset
Donatas Abraitis [Tue, 26 Oct 2021 05:59:39 +0000 (08:59 +0300)]
Merge pull request #9873 from bhinin/dynamic_peer_count_reset

bgpd: Reset dynamic peer counter

3 years agoMerge pull request #9883 from pguibert6WIND/iface_deleted_omitted_gre_tundest
Jafar Al-Gharaibeh [Tue, 26 Oct 2021 03:44:39 +0000 (22:44 -0500)]
Merge pull request #9883 from pguibert6WIND/iface_deleted_omitted_gre_tundest

zebra: GRE_UPDATE message incomplete

3 years agoMerge pull request #9882 from donaldsharp/version_doc
Jafar Al-Gharaibeh [Tue, 26 Oct 2021 03:31:05 +0000 (22:31 -0500)]
Merge pull request #9882 from donaldsharp/version_doc

doc: Remove reference to non-existent command

3 years agolib: fix srv6 route hardcode with BGP 9886/head
Hiroki Shirokura [Mon, 25 Oct 2021 23:36:14 +0000 (23:36 +0000)]
lib: fix srv6 route hardcode with BGP

zclient_send_localsid is called by various routing protocol daemons. To set the
srv6 endpoint function. Fix a hard-coded error in the initial implementation.
Before this PR, the srv6 function will be registered to zebra as a BGP route
even if isisd executes zclient_send_localsid.

Signed-off-by: Hiroki Shirokura <hiroki.shirokura@linecorp.com>
3 years agoMerge pull request #9881 from donaldsharp/micro_scale_fixes_1
Igor Ryzhov [Mon, 25 Oct 2021 21:19:14 +0000 (00:19 +0300)]
Merge pull request #9881 from donaldsharp/micro_scale_fixes_1

tests: Fix accidental 10 second wait

3 years agoinclude, zebra: Add recent nexthop.h 9898/head
Donald Sharp [Mon, 25 Oct 2021 18:11:37 +0000 (14:11 -0400)]
include, zebra: Add recent nexthop.h

Add actual recent nexthop.h file from kernel
and fix up resulting fallout because FRR's
original nexthop.h did not match upstream
linux kernel.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agoMerge pull request #9316 from ton31337/fix/send_best_path_reason_for_zebra
Donald Sharp [Mon, 25 Oct 2021 15:09:20 +0000 (11:09 -0400)]
Merge pull request #9316 from ton31337/fix/send_best_path_reason_for_zebra

bgpd: Send BGP best path reason to Zebra

3 years agoMerge pull request #9876 from donaldsharp/ttl_unset
Donatas Abraitis [Mon, 25 Oct 2021 14:41:57 +0000 (17:41 +0300)]
Merge pull request #9876 from donaldsharp/ttl_unset

bgpd: When issuing `no ... ebgp-multihop` always resets

3 years agozebra: GRE_UPDATE message incomplete 9883/head
Philippe Guibert [Thu, 7 May 2020 09:21:16 +0000 (11:21 +0200)]
zebra: GRE_UPDATE message incomplete

when gre information could not be retrieved because GRE interface has
been deleted, a GRE_UPDATE message may be sent to NHRP. In that case,
the gre values are reset. There was a missing tunnel destination value,
which has been omitted.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
3 years agodoc: Remove reference to non-existent command 9882/head
Donald Sharp [Mon, 25 Oct 2021 13:03:48 +0000 (09:03 -0400)]
doc: Remove reference to non-existent command

The `neighbor <peer> version <X>` command does not
exist.  I am unable to find it going back to version
2.0 of FRR.  So this command has been not in the system
for a very long time.

In any event bgp already supports version 4 of bgp and
it auto-negotiates this.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agotests: Fix accidental 10 second wait 9881/head
Donald Sharp [Mon, 25 Oct 2021 12:00:23 +0000 (08:00 -0400)]
tests: Fix accidental 10 second wait

Recent commit 83f325901aec28774ecb had a accidental
turn of a 1 second wait into a 10 second wait
between retries.  10 seconds is too long.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agoMerge pull request #9824 from idryzhov/nb-cli-const-lyd-node
Donald Sharp [Mon, 25 Oct 2021 11:55:39 +0000 (07:55 -0400)]
Merge pull request #9824 from idryzhov/nb-cli-const-lyd-node

lib: northbound cli show/cmd functions must not modify data nodes

3 years agoMerge pull request #9877 from opensourcerouting/ospf_gr_topo1-fix
Donald Sharp [Mon, 25 Oct 2021 11:00:19 +0000 (07:00 -0400)]
Merge pull request #9877 from opensourcerouting/ospf_gr_topo1-fix

tests: Fix frequent failure of ospf_gr_topo1 on slower systems

3 years agotests: Fix frequent failure of ospf_gr_topo1 on slower systems 9877/head
Martin Winter [Sun, 24 Oct 2021 22:53:49 +0000 (00:53 +0200)]
tests: Fix frequent failure of ospf_gr_topo1 on slower systems

Test doesn't wait long enough when it checks the routers after
restart. On slower systems, it frequently failed as it ran out
of time

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
3 years agobgpd: When issuing `no ... ebgp-multihop` always resets 9876/head
Donald Sharp [Sun, 24 Oct 2021 19:02:11 +0000 (15:02 -0400)]
bgpd: When issuing `no ... ebgp-multihop` always resets

When removing the command `no neighbor <X> ebgp-multihop <Y>`
the bgp code was always resetting the connection even if
the command would do nothing.

Fixes: #6464
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agoMerge pull request #9670 from LabNConsulting/chopps/fix-valgrind-fail-check
Donald Sharp [Sun, 24 Oct 2021 12:30:29 +0000 (08:30 -0400)]
Merge pull request #9670 from LabNConsulting/chopps/fix-valgrind-fail-check

Chopps/fix valgrind fail check

3 years agoMerge pull request #9874 from donaldsharp/micro_scale_fixes
Martin Winter [Sat, 23 Oct 2021 16:08:36 +0000 (18:08 +0200)]
Merge pull request #9874 from donaldsharp/micro_scale_fixes

Micro scale fixes

3 years agoMerge pull request #9742 from elimbaum/add-vlan-actions
Jafar Al-Gharaibeh [Sat, 23 Oct 2021 05:06:16 +0000 (00:06 -0500)]
Merge pull request #9742 from elimbaum/add-vlan-actions

pbrd: add vlan actions to vty

3 years agotests: bfd_isis_topo1 expects unreasonable convergence times under load 9874/head
Donald Sharp [Fri, 22 Oct 2021 19:27:50 +0000 (15:27 -0400)]
tests: bfd_isis_topo1 expects unreasonable convergence times under load

When our ci test system is under high load, expecting bfd to converge
in under 2 seconds is not going to happen.  Modify the test suites
to just ensure that things converge.  If we need actual functional
testing of bfd response times the topotests are not an appropriate place
to do this or we need to modify the test system to gather the data for
how long it takes after the tests are run.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agotests: Fix bgp_ecmp_topo3 to look for a bit more state
Donald Sharp [Fri, 22 Oct 2021 18:20:16 +0000 (14:20 -0400)]
tests: Fix bgp_ecmp_topo3 to look for a bit more state

During a local CI run, bgp_ecmp_topo3 was failing
to properly notice the fast-convergence command
issued before the interface is shut down.  As
such there exists a race condition where under
high load the zebra process can actually shut
an interface down before we have properly ensured
that fast convergence is on for ibgp.

Modify the test for in two ways:

1) Ensure that previous section makes sure
that we have properly converged for when we
bring back up the interfaces instead of
assuming that we have done so.

2) After issuing the fast-convergence command.
Ensure that bgp has fully processed it and is
ready to receive the interface down events
as triggers for shutting down the ibgp session.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agotests: Make test_ldp_topo1.py aware of how many neighbors it needs
Donald Sharp [Fri, 22 Oct 2021 18:18:33 +0000 (14:18 -0400)]
tests: Make test_ldp_topo1.py aware of how many neighbors it needs

On a local CI run.  The test_ldp_topo1.py showed fail to converge
on r3.  r3 has 2 neighbors but only 1 was up when we got to
further steps in the test suites.

Modify the neighbor checking to `know` how many neighbors
should be operational and continue looking for them until
they are up and running.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agotests: fix --valgrind-memleaks option 9670/head
Christian Hopps [Tue, 21 Sep 2021 00:39:09 +0000 (20:39 -0400)]
tests: fix --valgrind-memleaks option

Previously, when a valgrind memleak was discovered, would cause a
catastrophic pytest failure. Now correctly fails the current pytest as
intended.

As a result of this fix --valgrind-memleaks now works in distributed
pytest mode as well.

Signed-off-by: Christian Hopps <chopps@labn.net>
3 years agotests: revert default enable of memleak tests
Christian Hopps [Sun, 26 Sep 2021 05:52:11 +0000 (01:52 -0400)]
tests: revert default enable of memleak tests

Revert the accidental enabling of the optional memleak tests that came
with the large micronet changeset.

Signed-off-by: Christian Hopps <chopps@labn.net>
3 years agotests: fix missing space in --valgrind-extra option
Christian Hopps [Sun, 26 Sep 2021 05:51:53 +0000 (01:51 -0400)]
tests: fix missing space in --valgrind-extra option

Signed-off-by: Christian Hopps <chopps@labn.net>
3 years agoMerge pull request #9378 from AnuradhaKaruppiah/evpn-mh-cleanup
Sri Mohana Singamsetty [Fri, 22 Oct 2021 16:26:06 +0000 (09:26 -0700)]
Merge pull request #9378 from AnuradhaKaruppiah/evpn-mh-cleanup

evpn-mh: fixes for sync-MAC-IP handling on ES bond del/add

3 years agoMerge pull request #9860 from pguibert6WIND/nhrp_align_privs
Mark Stapp [Fri, 22 Oct 2021 14:19:34 +0000 (10:19 -0400)]
Merge pull request #9860 from pguibert6WIND/nhrp_align_privs

nhrpd: align nhrp privs with definition from others

3 years agoMerge pull request #9765 from idryzhov/lib-bool-thread-add
Mark Stapp [Fri, 22 Oct 2021 13:59:54 +0000 (09:59 -0400)]
Merge pull request #9765 from idryzhov/lib-bool-thread-add

lib: change thread_add_* API

3 years agoMerge pull request #9866 from ewlumpkin/comment_spelling_fixes
Donald Sharp [Fri, 22 Oct 2021 13:38:44 +0000 (09:38 -0400)]
Merge pull request #9866 from ewlumpkin/comment_spelling_fixes

lib: finish fixing spelling in lib files

3 years agolib: finish fixing spelling in lib files 9866/head
ewlumpkin [Fri, 22 Oct 2021 02:56:56 +0000 (02:56 +0000)]
lib: finish fixing spelling in lib files

Signed-off-by: ewlumpkin <ewlumpkin@gmail.com>
3 years agonhrpd: align nhrp privs with definition from others 9860/head
Philippe Guibert [Tue, 10 Dec 2019 09:54:27 +0000 (10:54 +0100)]
nhrpd: align nhrp privs with definition from others

nhrp_privs global context is aligned with other daemon contexts

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
3 years agoMerge pull request #9843 from opensourcerouting/vtysh-startup-cost
Donald Sharp [Wed, 20 Oct 2021 22:52:00 +0000 (18:52 -0400)]
Merge pull request #9843 from opensourcerouting/vtysh-startup-cost

vtysh: improve startup time by ca. ×6

3 years agoMerge pull request #9783 from mjstapp/fix_bgp_lu_lsp
Russ White [Wed, 20 Oct 2021 22:22:01 +0000 (18:22 -0400)]
Merge pull request #9783 from mjstapp/fix_bgp_lu_lsp

bgpd, tests: BGP-labeled-unicast advertise implicit-null in more cases

3 years agoMerge pull request #9856 from donaldsharp/always_true
Igor Ryzhov [Wed, 20 Oct 2021 20:16:58 +0000 (23:16 +0300)]
Merge pull request #9856 from donaldsharp/always_true

zebra: Fix code paths that always resolve to true

3 years agoMerge pull request #9855 from donaldsharp/ospf_fini
David Lamparter [Wed, 20 Oct 2021 17:19:43 +0000 (19:19 +0200)]
Merge pull request #9855 from donaldsharp/ospf_fini

3 years agolib: change thread_add_* API 9765/head
Igor Ryzhov [Wed, 6 Oct 2021 19:06:23 +0000 (22:06 +0300)]
lib: change thread_add_* API

Do not return pointer to the newly created thread from various thread_add
functions. This should prevent developers from storing a thread pointer
into some variable without letting the lib know that the pointer is
stored. When the lib doesn't know that the pointer is stored, it doesn't
prevent rescheduling and it can lead to hard to find bugs. If someone
wants to store the pointer, they should pass a double pointer as the last
argument.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agoMerge pull request #9811 from donaldsharp/rib_update_fix
Igor Ryzhov [Wed, 20 Oct 2021 16:44:45 +0000 (19:44 +0300)]
Merge pull request #9811 from donaldsharp/rib_update_fix

Various thread functional fixes

3 years agoMerge pull request #9847 from ton31337/feature/prefix-list_autocomplete
Igor Ryzhov [Wed, 20 Oct 2021 15:45:07 +0000 (18:45 +0300)]
Merge pull request #9847 from ton31337/feature/prefix-list_autocomplete

bgpd: Add autocomplete for set/match community/large/ext lists

3 years agozebra: Fix code paths that always resolve to true 9856/head
Donald Sharp [Wed, 20 Oct 2021 14:15:41 +0000 (10:15 -0400)]
zebra: Fix code paths that always resolve to true

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agozebra: modify rib_update to be a bit smarter about malloc 9811/head
Donald Sharp [Tue, 12 Oct 2021 17:23:40 +0000 (13:23 -0400)]
zebra: modify rib_update to be a bit smarter about malloc

rib_update() was mallocing memory then attempting to schedule
and if the schedule failed( it was already going to be run )
FRR would then free the memory.  Fix this memory usage pattern

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agolib: Add a thread_is_scheduled function
Donald Sharp [Tue, 12 Oct 2021 17:22:54 +0000 (13:22 -0400)]
lib: Add a thread_is_scheduled function

The function thread_is_scheduled allows us to know if
the particular thread is scheduled for execution or not.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agoMerge pull request #9766 from opensourcerouting/typesafe-member-nhrp-zap
Mark Stapp [Wed, 20 Oct 2021 12:13:17 +0000 (08:13 -0400)]
Merge pull request #9766 from opensourcerouting/typesafe-member-nhrp-zap

lib: add typesafe membership-test functions

3 years agotests: When heavily loaded do not send SIGBUS so fast 9855/head
Donald Sharp [Wed, 20 Oct 2021 12:02:10 +0000 (08:02 -0400)]
tests: When heavily loaded do not send SIGBUS so fast

Our topotests send SIGBUS 2 seconds after a SIGTERM is
initiated.  This is bad because under a heavily loaded
topotest system we may have a case where the system has
not had a chance to properly shut down the daemon.
Extend the time greatly before topotests send SIGBUS.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agopathd: Call frr_fini() before exit
Donald Sharp [Wed, 20 Oct 2021 12:00:57 +0000 (08:00 -0400)]
pathd: Call frr_fini() before exit

pathd was never calling frr_fini and as such the
proper shutdown was not happening for libfrr.
This includes logging.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agoospfd: Close log files before exiting
Donald Sharp [Wed, 20 Oct 2021 12:00:02 +0000 (08:00 -0400)]
ospfd: Close log files before exiting

When doing a normal exit from ospf we should close
the log file as that we are leaving a bunch of
unterminated logging processes by not doing so.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agobgpd: Add autocomplete for community/large/extcommunity stuff 9847/head
Donatas Abraitis [Tue, 19 Oct 2021 12:14:19 +0000 (15:14 +0300)]
bgpd: Add autocomplete for community/large/extcommunity stuff

```
exit1-debian-9(config)# route-map test1 permit 10
exit1-debian-9(config-route-map)# match community ?
  (1-99)               Community-list number (standard)
  (100-500)            Community-list number (expanded)
  COMMUNITY_LIST_NAME  Community-list name
     testas
exit1-debian-9(config-route-map)# match large-community ?
  (1-99)                Large Community-list number (standard)
  (100-500)             Large Community-list number (expanded)
  LCOMMUNITY_LIST_NAME  Large Community-list name
     LCL-ORIGINATED-ALL
exit1-debian-9(config-route-map)#
```

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
3 years agobgpd: Reset dynamic peer counter 9873/head
Abhishek Naik [Tue, 19 Oct 2021 23:45:26 +0000 (23:45 +0000)]
bgpd: Reset dynamic peer counter

Dynamic peer count is inconsistent in
"show bgp summary json" and "show bgp summary failed json" due to
dynamic peer counter 'dn_count' being reused without resetting

Signed-off-by: Abhishek Naik <bhini@amazon.com>
3 years agoMerge pull request #9848 from ton31337/feature/as-path_autocomplete
Russ White [Tue, 19 Oct 2021 23:18:28 +0000 (19:18 -0400)]
Merge pull request #9848 from ton31337/feature/as-path_autocomplete

bgpd: Add autocomplete for as-path filters

3 years agoMerge pull request #9839 from donaldsharp/test_ospf_summarization
Russ White [Tue, 19 Oct 2021 23:17:35 +0000 (19:17 -0400)]
Merge pull request #9839 from donaldsharp/test_ospf_summarization

Test ospf summarization

3 years agoMerge pull request #9656 from chiragshah6/mdev
Russ White [Tue, 19 Oct 2021 23:16:14 +0000 (19:16 -0400)]
Merge pull request #9656 from chiragshah6/mdev

zebra: add resolver flag for nexthop in json

3 years agoMerge pull request #9752 from opensourcerouting/ospf6d-nssa-ranges
Russ White [Tue, 19 Oct 2021 23:15:40 +0000 (19:15 -0400)]
Merge pull request #9752 from opensourcerouting/ospf6d-nssa-ranges

ospf6d: add support for NSSA Type-7 address ranges

3 years agoMerge pull request #9818 from idryzhov/lib-if-fixes
Mark Stapp [Tue, 19 Oct 2021 20:46:58 +0000 (16:46 -0400)]
Merge pull request #9818 from idryzhov/lib-if-fixes

lib: allow to create interfaces in non-existing VRFs

3 years agobgpd: Add autocomplete for filter-list 9848/head
Donatas Abraitis [Tue, 19 Oct 2021 15:02:36 +0000 (18:02 +0300)]
bgpd: Add autocomplete for filter-list

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
3 years agotools: remove Linux kernel bits from checkpatch 9766/head
David Lamparter [Tue, 12 Oct 2021 22:01:43 +0000 (00:01 +0200)]
tools: remove Linux kernel bits from checkpatch

These aren't appropriate for use in FRR.  Among other things, this
enables running checkpatch by calling it in a git working tree with
`tools/checkpatch.pl -g origin/master..`

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
3 years agotools: add iterators to checkpatch
David Lamparter [Tue, 12 Oct 2021 22:00:03 +0000 (00:00 +0200)]
tools: add iterators to checkpatch

For the purpose of allowing the space in `frr_each (`, copy the list of
iterators from .clang-format and wire it up appropriately.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
3 years agobuild: add tests missed in .gitignore
David Lamparter [Wed, 29 Sep 2021 21:37:10 +0000 (23:37 +0200)]
build: add tests missed in .gitignore

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
3 years agonhrpd: drop list.h
David Lamparter [Sat, 27 Mar 2021 21:47:28 +0000 (22:47 +0100)]
nhrpd: drop list.h

`number_of_linked_lists_in_frr--;`

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
3 years agonhrpd: convert zbuf queue to DLIST
David Lamparter [Sat, 27 Mar 2021 21:46:33 +0000 (22:46 +0100)]
nhrpd: convert zbuf queue to DLIST

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
3 years agonhrpd: convert SA list to DLIST
David Lamparter [Sat, 27 Mar 2021 21:41:44 +0000 (22:41 +0100)]
nhrpd: convert SA list to DLIST

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
3 years agonhrpd: convert reg list to DLIST
David Lamparter [Sat, 27 Mar 2021 21:37:25 +0000 (22:37 +0100)]
nhrpd: convert reg list to DLIST

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
3 years agonhrpd: convert mcast list to DLIST
David Lamparter [Wed, 29 Sep 2021 21:16:17 +0000 (23:16 +0200)]
nhrpd: convert mcast list to DLIST

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
3 years agonhrpd: convert nhs list to DLIST
David Lamparter [Sat, 27 Mar 2021 21:30:51 +0000 (22:30 +0100)]
nhrpd: convert nhs list to DLIST

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
3 years agonhrpd: convert notifier list to DLIST
David Lamparter [Sat, 27 Mar 2021 21:20:10 +0000 (22:20 +0100)]
nhrpd: convert notifier list to DLIST

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
3 years agodoc/developer: add _member and _anywhere
David Lamparter [Wed, 29 Sep 2021 20:39:59 +0000 (22:39 +0200)]
doc/developer: add _member and _anywhere

New members in the typesafe.h API club.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
3 years agolib: add unsorted typesafe_anywhere()
David Lamparter [Wed, 29 Sep 2021 17:59:27 +0000 (19:59 +0200)]
lib: add unsorted typesafe_anywhere()

*_anywhere(item) returns whether an item is on _any_ container.  Only
available for unsorted containers for now.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
3 years agolib: use sentinel for single-linked lists
David Lamparter [Wed, 29 Sep 2021 20:15:11 +0000 (22:15 +0200)]
lib: use sentinel for single-linked lists

Using a non-NULL sentinel allows distinguishing between "end of list"
and "item not on any list".  It's a compare either way, just the value
is different.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
3 years agolib: typesafe *_member()
David Lamparter [Sat, 27 Mar 2021 21:05:07 +0000 (22:05 +0100)]
lib: typesafe *_member()

This provides a "is this item on this list" check, which may or may not
be faster than using *_find() for the same purpose.  (If the container
has no faster way of doing it, it falls back to using *_find().)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
3 years agolib: null out deleted pointers in typesafe containers
David Lamparter [Wed, 29 Sep 2021 18:45:34 +0000 (20:45 +0200)]
lib: null out deleted pointers in typesafe containers

Some of the typesafe containers didn't null out their innards of items
after an item was deleted or popped off the container.  This is both a
bit unsafe as well as hinders the upcoming _member() from working
efficiently.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
3 years agotests: fix leak in test code
David Lamparter [Wed, 29 Sep 2021 20:13:01 +0000 (22:13 +0200)]
tests: fix leak in test code

Even if it doesn't matter for an unit test in general, it hides actual
leaks in the code being tested.  Fix so any leaks will be actual bugs.
(Currently there aren't any, yay.)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
3 years agobgpd: Add autocomplete for as-path filters
Donatas Abraitis [Tue, 19 Oct 2021 12:31:39 +0000 (15:31 +0300)]
bgpd: Add autocomplete for as-path filters

```
exit1-debian-9# show bgp as-path-access-list
  <cr>
  AS_PATH_FILTER_NAME  AS path access list name
     acl1 acl2
  json                 JavaScript Object Notation
exit1-debian-9(config)# route-map testas permit 10
exit1-debian-9(config-route-map)# match as-path ?
  AS_PATH_FILTER_NAME  AS path access-list name
     acl1 acl2
```

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
3 years agolib: allow to create interfaces in non-existing VRFs 9818/head
Igor Ryzhov [Wed, 13 Oct 2021 12:06:38 +0000 (15:06 +0300)]
lib: allow to create interfaces in non-existing VRFs

It allows FRR to read the interface config even when the necessary VRFs
are not yet created and interfaces are in "wrong" VRFs. Currently, such
config is rejected.

For VRF-lite backend, we don't care at all about the VRF of the inactive
interface. When the interface is created in the OS and becomes active,
we always use its actual VRF instead of the configured one. So there's
no need to reject the config.

For netns backend, we may have multiple interfaces with the same name in
different VRFs. So we care about the VRF of inactive interfaces. And we
must allow to preconfigure the interface in a VRF even before it is
moved to the corresponding netns. From now on, we allow to create
multiple configs for the same interface name in different VRFs and
the necessary config is applied once the OS interface is moved to the
corresponding netns.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agolib: keep element count in vector code 9843/head
David Lamparter [Mon, 18 Oct 2021 13:29:17 +0000 (15:29 +0200)]
lib: keep element count in vector code

... to speed up vector_empty_slot() among other things.

Behavior should be 100% identical to previous.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
3 years agovtysh: defer CLI tree building
David Lamparter [Mon, 18 Oct 2021 09:51:09 +0000 (11:51 +0200)]
vtysh: defer CLI tree building

We don't need the CLI tree until we actually enter the node.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
3 years agolib: assign CLI varnames while parsing
David Lamparter [Mon, 18 Oct 2021 12:30:01 +0000 (14:30 +0200)]
lib: assign CLI varnames while parsing

... rather than running a costly extra pass across the finished tree.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
3 years agoMerge pull request #9730 from AnuradhaKaruppiah/evpn-recv-lttng
Donatas Abraitis [Mon, 18 Oct 2021 07:17:19 +0000 (10:17 +0300)]
Merge pull request #9730 from AnuradhaKaruppiah/evpn-recv-lttng

bgp-evpn: lttng TPs for events received from zebra

3 years agoMerge pull request #9828 from idryzhov/if-lookup-optimize
Donatas Abraitis [Sat, 16 Oct 2021 08:17:57 +0000 (11:17 +0300)]
Merge pull request #9828 from idryzhov/if-lookup-optimize

lib: optimize if_lookup_by_name_all_vrf

3 years agozebra: defer local MAC dataplane install on an ES till the ES-EVI is created 9378/head
Anuradha Karuppiah [Tue, 10 Aug 2021 21:31:34 +0000 (14:31 -0700)]
zebra: defer local MAC dataplane install on an ES till the ES-EVI is created

When an ES is deleted and re-added bgpd can start sending MAC-IP sync updates
before the dataplane and zebra have setup the VLAN membership for the ES. Such
MAC entries are not installed in the dataplane till the ES-EVI is created.

Ticket: #2668488

Signed-off-by: Anuradha Karuppiah <anuradhak@nvidia.com>
3 years agozebra: ignore sync updates from bgp if the dest ES is not ready
Anuradha Karuppiah [Tue, 10 Aug 2021 15:56:55 +0000 (08:56 -0700)]
zebra: ignore sync updates from bgp if the dest ES is not ready

In the window immediately after an ES deletion bgpd can send MAC-IP updates
using that ES. Zebra needs to ignore these updates to prevent creation
of stale entries.

Ticket: #2668488

Signed-off-by: Anuradha Karuppiah <anuradhak@nvidia.com>
3 years agozebra: deref the ES on interface delete even if it was not setup as a br-port
Anuradha Karuppiah [Mon, 9 Aug 2021 18:50:22 +0000 (11:50 -0700)]
zebra: deref the ES on interface delete even if it was not setup as a br-port

This addresses deletion of ES interfaces that are were not completely
configured.

Ticket: #2668488

Signed-off-by: Anuradha Karuppiah <anuradhak@nvidia.com>
3 years agotools: upstream linter is recommending double quotes 9730/head
Anuradha Karuppiah [Mon, 4 Oct 2021 17:53:50 +0000 (10:53 -0700)]
tools: upstream linter is recommending double quotes

Replaced single quotes with double quotes for strings in
the frr_babeltrace.py utility.

Signed-off-by: Anuradha Karuppiah <anuradhak@nvidia.com>
3 years agotools: add frr_babeltrace.py to /usr/lib/frr
Anuradha Karuppiah [Fri, 1 Oct 2021 16:52:24 +0000 (09:52 -0700)]
tools: add frr_babeltrace.py to /usr/lib/frr

Make the script available as a part of the FRR package install for
ease of use.

Signed-off-by: Anuradha Karuppiah <anuradhak@nvidia.com>
3 years agobgpd: lttng tracepoint for local events received from zebra
Anuradha Karuppiah [Mon, 4 Oct 2021 16:41:43 +0000 (09:41 -0700)]
bgpd: lttng tracepoint for local events received from zebra

TPs -
=====
root@ibm-2410a1-01:mgmt:~# lttng list --userspace |grep frr_bgp:evpn.*recv
      frr_bgp:evpn_local_l3vni_del_zrecv (loglevel: TRACE_INFO (6)) (type: tracepoint)
      frr_bgp:evpn_local_l3vni_add_zrecv (loglevel: TRACE_INFO (6)) (type: tracepoint)
      frr_bgp:evpn_local_macip_del_zrecv (loglevel: TRACE_INFO (6)) (type: tracepoint)
      frr_bgp:evpn_local_macip_add_zrecv (loglevel: TRACE_INFO (6)) (type: tracepoint)
      frr_bgp:evpn_local_vni_del_zrecv (loglevel: TRACE_INFO (6)) (type: tracepoint)
      frr_bgp:evpn_local_vni_add_zrecv (loglevel: TRACE_INFO (6)) (type: tracepoint)
      frr_bgp:evpn_mh_local_es_evi_del_zrecv (loglevel: TRACE_INFO (6)) (type: tracepoint)
      frr_bgp:evpn_mh_local_es_evi_add_zrecv (loglevel: TRACE_INFO (6)) (type: tracepoint)
      frr_bgp:evpn_mh_local_es_del_zrecv (loglevel: TRACE_INFO (6)) (type: tracepoint)
      frr_bgp:evpn_mh_local_es_add_zrecv (loglevel: TRACE_INFO (6)) (type: tracepoint)
root@ibm-2410a1-01:mgmt:~#

Sample output -
===============
1. ES
frr_bgp:evpn_mh_local_es_add_zrecv {'esi': '03:44:38:39:ff:ff:01:00:00:01', 'vtep': '27.0.0.15', 'active': 0, 'bypass': 0, 'df_pref': 50000}
frr_bgp:evpn_mh_local_es_del_zrecv {'esi': '03:44:38:39:ff:ff:01:00:00:01'}

2. ES-EVI
frr_bgp:evpn_mh_local_es_evi_add_zrecv {'esi': '03:44:38:39:ff:ff:01:00:00:01', 'vni': 1004}
frr_bgp:evpn_mh_local_es_evi_del_zrecv {'esi': '03:44:38:39:ff:ff:01:00:00:01', 'vni': 1001}

3. L2-VNI
frr_bgp:evpn_local_vni_add_zrecv {'vni': 1004, 'vtep': '27.0.0.15', 'mc_grp': '239.1.1.104', 'vrf': 97}

4. L3-VNI
frr_bgp:evpn_local_l3vni_add_zrecv {'vni': 4001, 'vrf': 87, 'svi_rmac': '24:8a:07:cc:aa:5f', 'vrr_rmac': '24:8a:07:cc:aa:5f', 'vtep': '27.0.0.15', 'filter': 0, 'svi_ifindex': 95, 'anycast_mac': 'n'
frr_bgp:evpn_local_l3vni_del_zrecv {'vni': 4003, 'vrf': 107}

5. MAC-IP
frr_bgp:evpn_local_macip_add_zrecv {'vni': 1003, 'mac': '00:02:00:00:00:04', 'ip': 'fe80::202:ff:fe00:4', 'flags': 4, 'seq': 0, 'esi': '03:44:38:39:ff:ff:01:00:00:02'}
frr_bgp:evpn_local_macip_del_zrecv {'vni': 1000, 'mac': '00:02:00:00:00:04', 'ip': '2001:fee1::4', 'state': 1}

Signed-off-by: Anuradha Karuppiah <anuradhak@nvidia.com>
3 years agotests: Fix ospf_asbr_summary_topo1.py 9839/head
Donald Sharp [Fri, 15 Oct 2021 15:43:44 +0000 (11:43 -0400)]
tests: Fix ospf_asbr_summary_topo1.py

This script is failing occassionally in our upstream topotests.
Where it was changing route-maps and attempting to see if
summarization was working correctly.  The problem was that
the code appeared to be attempting to add route-maps to
redistribution in ospf then modifying the route-maps behavior
to affect summarization as well as the metric type of that
summarization.

The problem is of course that ospf does not appear to modify
the summary routes metric-type when the components
of that summary change it's metric-type.  So the test
is testing nothing.  In addition the test had messed
up the usage of the route-map generation code and all
the generated config was in different sequence numbers
but route-map processing would never get to those
new sequence numbers because of how route-maps are processed.

Let's just remove this part of the test instead of trying
to unwind it into anything meaningfull

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agolib: Add `metric-type` to possible set operations
Donald Sharp [Fri, 15 Oct 2021 15:42:06 +0000 (11:42 -0400)]
lib: Add `metric-type` to possible set operations

Several tests used the route_map_create functionality
with `metric-type` but never bothered to add the
backend code to ensure it works correctly.
Add it in so it can be used.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agoMerge pull request #9813 from opensourcerouting/ospf-gr-fixes
Donald Sharp [Fri, 15 Oct 2021 13:21:40 +0000 (09:21 -0400)]
Merge pull request #9813 from opensourcerouting/ospf-gr-fixes

ospfd: more GR fixes

3 years agoMerge pull request #9836 from opensourcerouting/doc-developer-fixes
Donald Sharp [Fri, 15 Oct 2021 13:16:27 +0000 (09:16 -0400)]
Merge pull request #9836 from opensourcerouting/doc-developer-fixes

doc/developer: fix random sphinx warnings/typos/…

3 years agoMerge pull request #9826 from donaldsharp/isis_signed
Igor Ryzhov [Fri, 15 Oct 2021 09:51:04 +0000 (12:51 +0300)]
Merge pull request #9826 from donaldsharp/isis_signed

warnings that should be fixed in our compiles

3 years agoMerge pull request #9834 from idryzhov/pbr-null-deref
Donatas Abraitis [Fri, 15 Oct 2021 09:01:00 +0000 (12:01 +0300)]
Merge pull request #9834 from idryzhov/pbr-null-deref

pbrd: protect from a possible NULL dereference

3 years agoMerge pull request #9835 from idryzhov/ospf6-no-op
Donatas Abraitis [Fri, 15 Oct 2021 09:00:51 +0000 (12:00 +0300)]
Merge pull request #9835 from idryzhov/ospf6-no-op

ospf6d: remove no-op

3 years agodoc/developer: fix duplicate const prototypes 9836/head
David Lamparter [Thu, 14 Oct 2021 17:19:23 +0000 (19:19 +0200)]
doc/developer: fix duplicate const prototypes

The const ones have const in the name.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
3 years agodoc/developer: use :c:macro: where appropriate
David Lamparter [Thu, 14 Oct 2021 17:17:30 +0000 (19:17 +0200)]
doc/developer: use :c:macro: where appropriate

Sphinx tries to parse :c:function: as function prototype, which doesn't
quite work with macros.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
3 years agodoc/developer: fix warnings in topotests doc
David Lamparter [Thu, 14 Oct 2021 17:11:02 +0000 (19:11 +0200)]
doc/developer: fix warnings in topotests doc

Sphinx warns about a few nits here, just fix.  (Note :option:`-E` can't
be used without a "option:: -E" definition, it's intended as a cross
reference.)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
3 years agodoc/developer: fix C struct references
David Lamparter [Thu, 14 Oct 2021 17:02:03 +0000 (19:02 +0200)]
doc/developer: fix C struct references

Sphinx wants `c:struct:: foo` rather than `c:type:: struct foo`.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
3 years agoospf6d: remove no-op 9835/head
Igor Ryzhov [Thu, 14 Oct 2021 16:47:02 +0000 (19:47 +0300)]
ospf6d: remove no-op

ospf6_route_create already sets route->ospf6.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agopbrd: protect from a possible NULL dereference 9834/head
Igor Ryzhov [Thu, 14 Oct 2021 16:45:43 +0000 (19:45 +0300)]
pbrd: protect from a possible NULL dereference

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agobgpd: Send BGP best path reason to Zebra 9316/head
Donatas Abraitis [Fri, 6 Aug 2021 16:54:57 +0000 (19:54 +0300)]
bgpd: Send BGP best path reason to Zebra

```
exit1-debian-9# show ip route 172.16.16.1/32
Routing entry for 172.16.16.1/32
  Known via "bgp", distance 20, metric 0, best
  Last update 00:00:28 ago
  * 192.168.0.2, via eth1, weight 1
    AS-Path          : 65003
    Communities      : first 65001:2 65001:3
    Large-Communities: 65001:1:1 65001:1:2 65001:1:3
    Selection reason : First path received
```

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
3 years agoMerge pull request #9817 from donaldsharp/link_type_ordering
Donatas Abraitis [Thu, 14 Oct 2021 13:25:02 +0000 (16:25 +0300)]
Merge pull request #9817 from donaldsharp/link_type_ordering

lib: Add missing enum values in switch statement for if_link_type_str

3 years agoMerge pull request #9825 from donaldsharp/one_sleep_twice_shy
Donatas Abraitis [Thu, 14 Oct 2021 12:31:23 +0000 (15:31 +0300)]
Merge pull request #9825 from donaldsharp/one_sleep_twice_shy

tests: BFD timing tests under system load need more leeway