]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
3 years agolib: record output argument positions in zlog
David Lamparter [Mon, 22 Mar 2021 12:45:20 +0000 (13:45 +0100)]
lib: record output argument positions in zlog

printfrr() recently acquired the capability to record start/end of
formatting outputs.  Make use of this in the zlog code so logging
targets have access to this information.

(This also records how long the `[XXXXX-XXXXX][EC 9999999]` prefix was
so log targets can choose to skip over it.)

Signed-off-by: David Lamparter <equinox@diac24.net>
3 years agolib: add hook for `show logging` CLI
David Lamparter [Thu, 8 Apr 2021 12:29:18 +0000 (14:29 +0200)]
lib: add hook for `show logging` CLI

... so additional targets can print their state.

Signed-off-by: David Lamparter <equinox@diac24.net>
3 years agolib: de-conflict `log-filter` CLI command
David Lamparter [Thu, 8 Apr 2021 10:57:58 +0000 (12:57 +0200)]
lib: de-conflict `log-filter` CLI command

`log-filter WORD` was giving me a serious headache since it also matches
`log WORD` due to the way the CLI token handling works.  This meant that
a mistyped `log something` command would silently be interpreted as a
filter string, causing me serious headscratching and WTFs until I
figured what was going on.

Remove this UX pitfall so noone else falls into it.  (Since the command
was never saved to config, renaming it shouldn't cause trouble.)

[Also I apparently forgot to update the docs when I transferred this
over to the new zlog bits...]

TODO for a rainy day:  since we collect all the CLI commands anyway, we
should warn somewhere for "2nd level ambiguous" commands like this.

Signed-off-by: David Lamparter <equinox@diac24.net>
3 years agoMerge pull request #8478 from mjstapp/fix_nb_grpc_shutdown
Donald Sharp [Fri, 18 Jun 2021 12:52:44 +0000 (08:52 -0400)]
Merge pull request #8478 from mjstapp/fix_nb_grpc_shutdown

lib: stop grpc pthread at shutdown

3 years agoMerge pull request #8861 from wesleycoakley/docker-init-rework
Mark Stapp [Fri, 18 Jun 2021 12:33:03 +0000 (08:33 -0400)]
Merge pull request #8861 from wesleycoakley/docker-init-rework

docker: use tini as entrypoint unilaterally

3 years agoMerge pull request #8828 from idryzhov/bgp-routemap-update
Donald Sharp [Fri, 18 Jun 2021 12:25:50 +0000 (08:25 -0400)]
Merge pull request #8828 from idryzhov/bgp-routemap-update

bgpd: fix routemap update with disabled delay timer

3 years agoMerge pull request #8843 from idryzhov/isis-dyn-hostname-cache
Donald Sharp [Fri, 18 Jun 2021 12:20:25 +0000 (08:20 -0400)]
Merge pull request #8843 from idryzhov/isis-dyn-hostname-cache

isisd: per-instance dynamic hostname cache

3 years agoMerge pull request #8839 from volta-networks/fix_ospf6_flags_for_error_logs
Donald Sharp [Fri, 18 Jun 2021 12:18:25 +0000 (08:18 -0400)]
Merge pull request #8839 from volta-networks/fix_ospf6_flags_for_error_logs

ospf6d: move error logs out from behind debug flags

3 years agoMerge pull request #8846 from ton31337/fix/some_code_cleanups
Donald Sharp [Fri, 18 Jun 2021 12:12:01 +0000 (08:12 -0400)]
Merge pull request #8846 from ton31337/fix/some_code_cleanups

bgpd: A couple of cleanups

3 years agoMerge pull request #8865 from idryzhov/isis-fixes
Donald Sharp [Fri, 18 Jun 2021 12:06:01 +0000 (08:06 -0400)]
Merge pull request #8865 from idryzhov/isis-fixes

a couple of isis fixes

3 years agoisis: fix double-adding a circuit to the area
Igor Ryzhov [Wed, 16 Jun 2021 12:54:17 +0000 (15:54 +0300)]
isis: fix double-adding a circuit to the area

isis_circuit_enable can be called for an already enabled circuit. In this
case we would add the circuit to the area multiple times.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agoisisd: fix adding a circuit to the wrong area
Igor Ryzhov [Wed, 16 Jun 2021 12:52:14 +0000 (15:52 +0300)]
isisd: fix adding a circuit to the wrong area

When creating a new area, we're adding all circuits in the same VRF to
this area. We should only add circuits configured with the same tag.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agoMerge pull request #8874 from idryzhov/ospf-routemap-fix
Jafar Al-Gharaibeh [Thu, 17 Jun 2021 23:27:23 +0000 (18:27 -0500)]
Merge pull request #8874 from idryzhov/ospf-routemap-fix

ospfd: fix routemap update

3 years agoospfd: fix routemap update
Igor Ryzhov [Thu, 17 Jun 2021 16:31:03 +0000 (19:31 +0300)]
ospfd: fix routemap update

Currently, if the routemap already exists, we delete the pointer to it
when it is updated. We should delete the pointer only if the route-map
is actually deleted.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agolib: Do not double-assign freed pointer to NULL
Donatas Abraitis [Sun, 13 Jun 2021 18:44:06 +0000 (21:44 +0300)]
lib: Do not double-assign freed pointer to NULL

It's already done by XFREE.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
3 years agobgpd: Drop return for void bgp_evpn_show_routes_mac_ip_es()
Donatas Abraitis [Fri, 11 Jun 2021 15:58:21 +0000 (18:58 +0300)]
bgpd: Drop return for void bgp_evpn_show_routes_mac_ip_es()

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
3 years agobgpd: Do not test for bgp_path_info in rfapiCopyUnEncap2VPN()
Donatas Abraitis [Fri, 11 Jun 2021 15:44:01 +0000 (18:44 +0300)]
bgpd: Do not test for bgp_path_info in rfapiCopyUnEncap2VPN()

Already checked.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
3 years agobgpd: Remove double test against rfapi which is already checked
Donatas Abraitis [Fri, 11 Jun 2021 15:43:14 +0000 (18:43 +0300)]
bgpd: Remove double test against rfapi which is already checked

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
3 years agobgpd: Do not check against aspath `seg` which is already checked before
Donatas Abraitis [Fri, 11 Jun 2021 15:37:50 +0000 (18:37 +0300)]
bgpd: Do not check against aspath `seg` which is already checked before

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
3 years agobgpd: Remove redundand check against BGP_EVPNES_EVI_LOCAL flag
Donatas Abraitis [Fri, 11 Jun 2021 15:31:26 +0000 (18:31 +0300)]
bgpd: Remove redundand check against BGP_EVPNES_EVI_LOCAL flag

It's already checked earlier at bgp_evpn_local_es_evi_do_del()

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
3 years agobgpd: Avoid dereferencing EVPN ES if NULL
Donatas Abraitis [Fri, 11 Jun 2021 15:23:43 +0000 (18:23 +0300)]
bgpd: Avoid dereferencing EVPN ES if NULL

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
3 years agobgpd: Remove double check against match_packet_length_num
Donatas Abraitis [Fri, 11 Jun 2021 15:18:59 +0000 (18:18 +0300)]
bgpd: Remove double check against match_packet_length_num

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
3 years agobgpd: Do not test against bdc again since we already validated
Donatas Abraitis [Fri, 11 Jun 2021 15:14:27 +0000 (18:14 +0300)]
bgpd: Do not test against bdc again since we already validated

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
3 years agobgpd: Remove useless reuselist_node assignment before while loop
Donatas Abraitis [Fri, 11 Jun 2021 15:09:05 +0000 (18:09 +0300)]
bgpd: Remove useless reuselist_node assignment before while loop

Seems really not necessary pointing to initial value before while loop, where
it's assigned anyway.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
3 years agoMerge pull request #8856 from LabNConsulting/chopps/topo-valgrind
Quentin Young [Wed, 16 Jun 2021 18:57:25 +0000 (18:57 +0000)]
Merge pull request #8856 from LabNConsulting/chopps/topo-valgrind

3 years agoMerge pull request #8770 from gpnaveen/ospfv3_basic_functionality
Russ White [Wed, 16 Jun 2021 13:09:57 +0000 (09:09 -0400)]
Merge pull request #8770 from gpnaveen/ospfv3_basic_functionality

tests: Adding ospfv3 basic functionality test cases

3 years agotests: add valgrind memleaks run options and detection
Christian Hopps [Sat, 12 Jun 2021 09:07:24 +0000 (09:07 +0000)]
tests: add valgrind memleaks run options and detection

Signed-off-by: Christian Hopps <chopps@labn.net>
3 years agodocker: Use tini unilaterally and stop tailing /dev/null
Wesley Coakley [Wed, 9 Jun 2021 03:50:43 +0000 (23:50 -0400)]
docker: Use tini unilaterally and stop tailing /dev/null

tini is a hyper-minimal PID 0 which spawns a child process (watchfrr.sh
in our case), reaps zombies and forwards signals to the script. Starting
watchfrr.sh directly instead of through the old `tail /dev/null` or
`sleep 365d` helps keep things clean too :)

While tini was previously only used in the Alpine container it is useful
to apply this PID 0 to all containers except the special CI ones.

Fixes: #8788
Signed-off-by: Wesley Coakley <w@wesleycoakley.com>
3 years agotests: Adding ospfv3 basic functionality test cases
nguggarigoud [Tue, 1 Jun 2021 03:22:59 +0000 (20:22 -0700)]
tests: Adding ospfv3 basic functionality test cases

1. Adding  APIs to configure and verify ospfv3.
2. Adding ospfv3 base functionality testcase.

Signed-off-by: nguggarigoud <nguggarigoud@vmware.com>
3 years agoMerge pull request #8851 from opensourcerouting/ospf6-linkstateid-json
Quentin Young [Tue, 15 Jun 2021 15:50:38 +0000 (15:50 +0000)]
Merge pull request #8851 from opensourcerouting/ospf6-linkstateid-json

ospf6d: Link state ID in LSA database JSON output

3 years agolib: cleanup and stop grpc pthread
Mark Stapp [Mon, 7 Jun 2021 17:55:11 +0000 (13:55 -0400)]
lib: cleanup and stop grpc pthread

At shutdown, try to stop the grpc module and its
dedicated pthread cleanly.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
3 years agoMerge pull request #8833 from donaldsharp/zapi_message_count
Russ White [Tue, 15 Jun 2021 15:05:15 +0000 (11:05 -0400)]
Merge pull request #8833 from donaldsharp/zapi_message_count

Zapi message count

3 years agoMerge pull request #8814 from kuldeepkash/topojson_framework
Martin Winter [Tue, 15 Jun 2021 15:03:57 +0000 (17:03 +0200)]
Merge pull request #8814 from kuldeepkash/topojson_framework

tests: Fixing common pylint error for topojson

3 years agoMerge pull request #8821 from anlancs/master-fix-doc-domainname
Russ White [Tue, 15 Jun 2021 15:03:48 +0000 (11:03 -0400)]
Merge pull request #8821 from anlancs/master-fix-doc-domainname

doc: add a note of domainname

3 years agoMerge pull request #8838 from LabNConsulting/chopps/fix-nb-edit-cli
Igor Ryzhov [Tue, 15 Jun 2021 09:18:29 +0000 (12:18 +0300)]
Merge pull request #8838 from LabNConsulting/chopps/fix-nb-edit-cli

lib: do not attempt to create default nodes from NULL tree node

3 years agoospf6d: move error logs out from behind debug flags
lynne [Fri, 11 Jun 2021 13:53:23 +0000 (09:53 -0400)]
ospf6d: move error logs out from behind debug flags

The logging in ospf6 is very verbose.  If you turn on logging on a scaled
system you get too many logs.   The problem is that there are some errors
that occur that are hidden behind the debug flags, and to see these errors
we currently need to turn on the debug logging.  This change converts these
error logs to warnings and removes the debug flags.

Signed-off-by: Lynne Morrison <lynne@voltanet.io>
3 years agoMerge pull request #8836 from ton31337/fix/generalize_bgp_dest_locks
Renato Westphal [Mon, 14 Jun 2021 13:11:17 +0000 (10:11 -0300)]
Merge pull request #8836 from ton31337/fix/generalize_bgp_dest_locks

bgpd: Call bgp_dest_unlock_node() inside bgp_adj_in_remove()

3 years agoMerge pull request #8844 from sworleys/Term-Default-VRF-Last
Renato Westphal [Mon, 14 Jun 2021 13:05:52 +0000 (10:05 -0300)]
Merge pull request #8844 from sworleys/Term-Default-VRF-Last

lib: terminate default vrf last

3 years agoospf6d: Link state ID in LSA database JSON output
David Schweizer [Mon, 14 Jun 2021 06:41:10 +0000 (08:41 +0200)]
ospf6d: Link state ID in LSA database JSON output

Added link state ID to JSON output of LSA database.

Signed-off-by: David Schweizer <dschweizer@opensourcerouting.org>
3 years agolib: do not attempt to create default nodes from NULL tree node
Christian Hopps [Fri, 11 Jun 2021 13:18:24 +0000 (13:18 +0000)]
lib: do not attempt to create default nodes from NULL tree node

Perform same NULL check for dependent node creation code too.

Signed-off-by: Christian Hopps <chopps@labn.net>
3 years agolib: terminate default vrf last
Stephen Worley [Thu, 10 Jun 2021 20:52:35 +0000 (16:52 -0400)]
lib: terminate default vrf last

Always terminate default VRF last during FRR shutdown.

On shutdown we were simply looping over the RB tree and terminating
VRFs from the ROOT. This is not guaranteed to be the default last ever.

Instead switch to RB_SAFE and skip the default VRF till the very end.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
3 years agoisisd: per-instance dynamic hostname cache
Igor Ryzhov [Fri, 11 Jun 2021 15:27:46 +0000 (18:27 +0300)]
isisd: per-instance dynamic hostname cache

Currently, the dynamic hostname cache is global. It is incorrect because
neighbors in different VRFs may have the same system ID and different
hostnames.

This also fixes a memory leak - when the instance is deleted, the cache
must be cleaned up and the cleanup thread must be cancelled.

Fixes #8832.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agoMerge pull request #8831 from sworleys/Fix-No-Ospf-Func
Igor Ryzhov [Fri, 11 Jun 2021 08:33:13 +0000 (11:33 +0300)]
Merge pull request #8831 from sworleys/Fix-No-Ospf-Func

ospf6d: fix undefined function

3 years agobgpd: Call bgp_dest_unlock_node() inside bgp_adj_in_remove()
Donatas Abraitis [Fri, 11 Jun 2021 06:17:05 +0000 (09:17 +0300)]
bgpd: Call bgp_dest_unlock_node() inside bgp_adj_in_remove()

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
3 years agozebra: Move individual lines to table in `show zebra client` command
Donald Sharp [Fri, 11 Jun 2021 00:21:26 +0000 (20:21 -0400)]
zebra: Move individual lines to table in `show zebra client` command

Move some individual add/delete lines to the table format in
the `show zebra client` command

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agozebra: Add message counts for `show zebra client`
Donald Sharp [Fri, 11 Jun 2021 00:18:04 +0000 (20:18 -0400)]
zebra: Add message counts for `show zebra client`

There were counters FRR was keeping but never displaying.  Add them
in.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agoospf6d: fix undefined function
Stephen Worley [Thu, 10 Jun 2021 21:39:56 +0000 (17:39 -0400)]
ospf6d: fix undefined function

Some wires got crossed during a couple merges using/changing
this function.

Update it to its new name.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
3 years agoMerge pull request #8823 from donaldsharp/ospfv3_coverity
Rafael Zalamena [Thu, 10 Jun 2021 18:13:11 +0000 (15:13 -0300)]
Merge pull request #8823 from donaldsharp/ospfv3_coverity

Ospfv3 coverity

3 years agobgpd: fix routemap update with disabled delay timer
Igor Ryzhov [Thu, 10 Jun 2021 17:21:51 +0000 (20:21 +0300)]
bgpd: fix routemap update with disabled delay timer

- vnc_routemap_update is called only for the last bgp instance
- vpn_policy_routemap_event is not called at all
- unguarded debug (there's already a debug inside the called function)

Make the code consistent with the callback code that is used when the
delay timer is enabled.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agoMerge pull request #8691 from louis-oui/split-soft-reconfig
Donald Sharp [Thu, 10 Jun 2021 16:04:54 +0000 (12:04 -0400)]
Merge pull request #8691 from louis-oui/split-soft-reconfig

bgpd: split soft reconfig table task into several jobs to not block vtysh

3 years agoMerge pull request #8561 from opensourcerouting/msdp-refactor-v2
Donald Sharp [Thu, 10 Jun 2021 13:44:28 +0000 (09:44 -0400)]
Merge pull request #8561 from opensourcerouting/msdp-refactor-v2

pimd: rework MSDP mesh groups

3 years agoMerge pull request #8733 from idryzhov/ipv6-ospf6-area
Rafael Zalamena [Thu, 10 Jun 2021 13:34:45 +0000 (10:34 -0300)]
Merge pull request #8733 from idryzhov/ipv6-ospf6-area

ospf6d: fix interface area configuration

3 years agoospf6d: Rename ospf6_is_router_abr to more accurately reflect what it does
Donald Sharp [Thu, 10 Jun 2021 11:59:06 +0000 (07:59 -0400)]
ospf6d: Rename ospf6_is_router_abr to more accurately reflect what it does

The ospf6_is_router_abr is checking to see if ospfv3 is an abr router
and also setting values.  Let's rename it too `ospf6_check_and_set_router_abr`
to more accurately reflect what it is doing.

Additionally fix coverity #1505176 where we were not checking the return
value of ospf6_is_router_abr like we did every other time.  In this
case we don't care about the return value so indicate that we do not.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agoospf6d: Fix coverity Possible null deref
Donald Sharp [Thu, 10 Jun 2021 11:46:36 +0000 (07:46 -0400)]
ospf6d: Fix coverity Possible null deref

There exists a code path where ospf6 could be NULL and passing
to a function where it would always be derefed is a bad idea.

Put some small code in place to prevent this and allow this to be debuged
if it happens in the future.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agodoc: add a note of domainname
anlancs [Thu, 10 Jun 2021 01:36:19 +0000 (09:36 +0800)]
doc: add a note of domainname

Signed-off-by: anlancs <anlan_cs@tom.com>
3 years agoMerge pull request #8754 from louis-oui/bgp-summary-filter
Donatas Abraitis [Thu, 10 Jun 2021 06:58:31 +0000 (09:58 +0300)]
Merge pull request #8754 from louis-oui/bgp-summary-filter

bgpd: improve show bgp summary display

3 years agopimd: rename some MSDP functions
Rafael Zalamena [Wed, 9 Jun 2021 15:40:04 +0000 (12:40 -0300)]
pimd: rename some MSDP functions

Rename and shorten function names to make them uniform.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
3 years agotopotests: new test topology for MSDP
Rafael Zalamena [Tue, 20 Apr 2021 17:54:27 +0000 (14:54 -0300)]
topotests: new test topology for MSDP

Add basic topology test for MSDP meshed groups.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
3 years agotopotests: support adding hosts
Rafael Zalamena [Tue, 20 Apr 2021 17:54:20 +0000 (14:54 -0300)]
topotests: support adding hosts

Add API to topogen so we can build topology with simple hosts instead
of routers.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
3 years agopimd: rework MSDP mesh-group code
Rafael Zalamena [Tue, 20 Apr 2021 17:54:09 +0000 (14:54 -0300)]
pimd: rework MSDP mesh-group code

Fully utilize the northbound to hold pointers to our private data
instead of searching for data structures every time we need to change a
configuration.

Highlights:

 * Support multiple mesh groups per PIM instance (instead of one)
 * Use DEFPY instead of DEFUN to reduce code complexity
 * Use northbound private pointers to store data structures
 * Reduce callback names size

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
3 years agoyang: rework PIM MSDP mesh group
Rafael Zalamena [Tue, 20 Apr 2021 17:54:01 +0000 (14:54 -0300)]
yang: rework PIM MSDP mesh group

Allow PIM MSDP configuration to support multiple MSDP mesh groups per
PIM instance.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
3 years agoMerge pull request #8815 from idryzhov/fix-ospf-aggr
Donald Sharp [Wed, 9 Jun 2021 13:25:59 +0000 (09:25 -0400)]
Merge pull request #8815 from idryzhov/fix-ospf-aggr

ospfd: fix memory leaks in summarization

3 years agoMerge pull request #8808 from ton31337/feature/tracepoints_for_bgp_dest_lock_unlock
Donald Sharp [Wed, 9 Jun 2021 13:09:15 +0000 (09:09 -0400)]
Merge pull request #8808 from ton31337/feature/tracepoints_for_bgp_dest_lock_unlock

bgpd: Add tracepoints for bgp_dest_lock_node/bgp_dest_unlock_node

3 years agoMerge pull request #8807 from mjstapp/fix_srv6_delete
Donald Sharp [Wed, 9 Jun 2021 13:07:53 +0000 (09:07 -0400)]
Merge pull request #8807 from mjstapp/fix_srv6_delete

lib,zebra: srv6 cleanup

3 years agoMerge pull request #8817 from donaldsharp/mlag_crash
Russ White [Wed, 9 Jun 2021 13:03:41 +0000 (09:03 -0400)]
Merge pull request #8817 from donaldsharp/mlag_crash

zebra: Give extra space and stop processing if we run out of space

3 years agozebra: Give extra space and stop processing if we run out of space
Donald Sharp [Tue, 8 Jun 2021 19:38:11 +0000 (15:38 -0400)]
zebra: Give extra space and stop processing if we run out of space

When processing bulk messages we need more space to handle more
mroutes.  In this case we are doubling the stream size from
16k -> 32k, which should roughly double the number of mroutes
we can handle in one go.

Additionally.   If we cannot parse the passed message into
the stream to pass up to pimd then gracefully stop processing

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agoMerge pull request #8798 from opensourcerouting/ospfd-fixes
Olivier Dugeon [Wed, 9 Jun 2021 07:06:42 +0000 (09:06 +0200)]
Merge pull request #8798 from opensourcerouting/ospfd-fixes

ospfd: assorted fixes

3 years agotests: replace "interface IFNAME area" with "ipv6 ospf6 area"
Igor Ryzhov [Mon, 7 Jun 2021 19:58:30 +0000 (22:58 +0300)]
tests: replace "interface IFNAME area" with "ipv6 ospf6 area"

Only one test is modified yet, to have both new and deprecated commands
tested by the CI.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agodoc: replace "interface IFNAME area" with "ipv6 ospf6 area"
Igor Ryzhov [Tue, 25 May 2021 23:05:11 +0000 (02:05 +0300)]
doc: replace "interface IFNAME area" with "ipv6 ospf6 area"

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agoospf6d: fix interface area configuration
Igor Ryzhov [Tue, 25 May 2021 22:49:30 +0000 (01:49 +0300)]
ospf6d: fix interface area configuration

Currently the interface area is configured from the router node using
"interface IFNAME area ID" command. There are multiple problems with
this command:
- it is not in line with all other interface-related commands - other
  parameters are configured from the interface node using "ipv6 ospf6"
  prefix
- it is not in line with OSPFv2 - area is configured from the interface
  node using "ip ospf area" command
- most importantly, it doesn't work correctly when the interface is in
  a different VRF - instead of configuring the interface, it creates a
  new fake interface and configuring it instead

To fix all the problems, this commit adds a new command to the interface
configuration node - "ipv6 ospf6 area ID". The purpose of the command is
completely the same, but it works correctly in a multi-VRF environment.

The old command is preserved for the backward compatibility, but the
warning is added that it is deprecated because it doesn't work correctly
with VRFs.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agotests: fix ospf6_topo1_vrf
Igor Ryzhov [Mon, 7 Jun 2021 18:58:26 +0000 (21:58 +0300)]
tests: fix ospf6_topo1_vrf

ospf6d (and all other daemons except zebra) doesn't correctly process
`interface X vrf Y`, because it doesn't know existing VRFs at the time
of configuration file reading. Therefore it doesn't apply configuration
provided in the interface node.

Fix the problem by removing `vrf Y` part, having just an interface name
is enough.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agoMerge pull request #8593 from idryzhov/cmd-ambiguous
Quentin Young [Tue, 8 Jun 2021 15:41:45 +0000 (15:41 +0000)]
Merge pull request #8593 from idryzhov/cmd-ambiguous

vtysh: fix searching commands in parent nodes

3 years agoMerge pull request #8796 from idryzhov/ospf-passive
Russ White [Tue, 8 Jun 2021 15:24:30 +0000 (11:24 -0400)]
Merge pull request #8796 from idryzhov/ospf-passive

ospfd: fix passive interface configuration

3 years agoMerge pull request #7096 from gpnaveen/ospf_asbr_summarisation
Olivier Dugeon [Tue, 8 Jun 2021 15:20:33 +0000 (17:20 +0200)]
Merge pull request #7096 from gpnaveen/ospf_asbr_summarisation

tests : Adding 2 ospf asbr summary testcases.

3 years agoospfd: fix crash when displaying neighbor data in JSON
Renato Westphal [Mon, 31 May 2021 13:27:51 +0000 (10:27 -0300)]
ospfd: fix crash when displaying neighbor data in JSON

Add a null check to protect against the case where the neighbor
inactive timer is disabled. That can happen when the router is
acting as a helper for another router that is attempting to restart
gracefully.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
3 years agolib, ospfd, ospf6d: fix logging of pointer addresses
Renato Westphal [Mon, 31 May 2021 13:27:51 +0000 (10:27 -0300)]
lib, ospfd, ospf6d: fix logging of pointer addresses

The %p printf format specifier does already print the pointer address
with a leading "0x" prefix (indicating a hexadecimal number). There's
no need to add that prefix manually.

While here, replace explicit function names in log messages by
__func__.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
3 years agoospfd: fix wrong NSSA debug guards
Renato Westphal [Mon, 31 May 2021 13:27:51 +0000 (10:27 -0300)]
ospfd: fix wrong NSSA debug guards

Fix usage of NSSA debug guards in code paths that have nothing to
do with NSSA areas.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
3 years agozebra, ospfd: fix typos in the graceful restart code
Renato Westphal [Mon, 31 May 2021 13:27:51 +0000 (10:27 -0300)]
zebra, ospfd: fix typos in the graceful restart code

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
3 years agoospfd: fix logging of what triggered the SPF run
Renato Westphal [Mon, 31 May 2021 13:27:51 +0000 (10:27 -0300)]
ospfd: fix logging of what triggered the SPF run

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
3 years agoospfd: fix cleanup of MaxAge LSAs on exit
Renato Westphal [Mon, 31 May 2021 13:27:51 +0000 (10:27 -0300)]
ospfd: fix cleanup of MaxAge LSAs on exit

During shutdown, the ospf->maxage_lsa table is iterated over to
clean up all existing entries. While doing that, route_unlock_node()
should be called only for the nodes that have an associated entry,
otherwise the table will get corrupted and ospfd will crash.

As a side note, using a routing table to store MaxAge LSAs was a
very poor choice of a data structure, considering that a simple
rb-tree or hash table would get the job done with a much simpler
(and less error-prone) API. Something to cleanup in the future...

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
3 years agoospfd: fix null pointer dereference when flushing an opaque LSA
Renato Westphal [Mon, 31 May 2021 13:27:51 +0000 (10:27 -0300)]
ospfd: fix null pointer dereference when flushing an opaque LSA

Call ospf_lsa_flush() before free_opaque_info_per_id() since the
latter can deallocate the LSA that is going to be flushed.

Also, there's no need to set the LSA MaxAge to OSPF_LSA_MAXAGE
manually as the ospf_lsa_flush() function already takes care of that.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
3 years agoospfd: fix dangling pointer when exiting from the helper mode
Renato Westphal [Mon, 31 May 2021 13:27:51 +0000 (10:27 -0300)]
ospfd: fix dangling pointer when exiting from the helper mode

When exiting from the helper mode for a given router after an
unsuccessful graceful restart, removing the neighborship to that
router straight away leads to a dangling pointer in the associated
interface, which inevitably leads to a crash. To solve this
problem, schedule the removal of the neighbor instead of removing
it immediately.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
3 years agoospfd: fix crash when logging a Grace-LSA
Renato Westphal [Mon, 31 May 2021 13:27:51 +0000 (10:27 -0300)]
ospfd: fix crash when logging a Grace-LSA

Change the "show_ospf_grace_lsa_info" callback to account for the
fact that the "vty" parameter can be null.

This fixes a crash that happens when "debug ospf packet ls-update
detail" is configured and a Grace-LSA is sent or received.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
3 years agoospfd: fix small issue when exiting from the GR helper mode
Renato Westphal [Mon, 31 May 2021 13:27:51 +0000 (10:27 -0300)]
ospfd: fix small issue when exiting from the GR helper mode

When exiting from the GR helper mode, recalculate the DR only for
interfaces of the appropriate types (broadcast and NMBA).

This fixes a problem where the state of a neighbor reachable over a
p2p interface was changing from Full/DROther to Full/Backup across
a graceful restart.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
3 years agoospfd: fix GR helper initialization and termination
Renato Westphal [Mon, 31 May 2021 13:27:51 +0000 (10:27 -0300)]
ospfd: fix GR helper initialization and termination

Since a single ospfd process can have multiple OSPF interfaces
configured, we need to separate the global GR initialization and
termination from per-instance initialization and termination.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
3 years agoMerge pull request #8727 from opensourcerouting/ospfv3-nssa
Russ White [Tue, 8 Jun 2021 14:24:29 +0000 (10:24 -0400)]
Merge pull request #8727 from opensourcerouting/ospfv3-nssa

ospf6d: implement NSSA area support

3 years agoospfd: fix memory leaks in summarization
Igor Ryzhov [Tue, 8 Jun 2021 14:01:56 +0000 (17:01 +0300)]
ospfd: fix memory leaks in summarization

To reproduce the issue:
1. Create summary-address: `summary-address 1.1.1.0/24`.
2. Try to delete it with the wrong tag: `no summary-address 1.1.1.0/24 tag 1`.
   Each time this command is executed, route_node_lookup is called which
   locks route node one more time. As the tag is wrong, the function
   return immediately without unlock.
3. Finally delete the summary-address: `no summary-address 1.1.1.0/24`.

The route node won't be deleted.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agoMerge pull request #8713 from LabNConsulting/chopps/grpc-unit-test
Quentin Young [Tue, 8 Jun 2021 14:00:10 +0000 (14:00 +0000)]
Merge pull request #8713 from LabNConsulting/chopps/grpc-unit-test

3 years agoMerge pull request #8782 from LabNConsulting/chopps/timing-test
Rafael Zalamena [Tue, 8 Jun 2021 13:46:04 +0000 (10:46 -0300)]
Merge pull request #8782 from LabNConsulting/chopps/timing-test

tests: timing large config operations

3 years agobgpd: add terse display option on show bgp summary
Louis Scalbert [Wed, 12 May 2021 16:54:11 +0000 (18:54 +0200)]
bgpd: add terse display option on show bgp summary

Add a terse option to show bgp summary to shorten output.

Do not show the following information about the BGP
instances: the number of RIB entries, the table version and the used memory.
The "terse" option can be used in combination with the "remote-as", "neighbor",
"failed" and "established" filters, and with the "wide" option as well.

Before patch:

ubuntu# show bgp summary remote-as 123456
IPv4 Unicast Summary (VRF default):
BGP router identifier X.X.X.X, local AS number XXX vrf-id 0
BGP table version 0
RIB entries 3, using 552 bytes of memory
Peers 5, using 3635 KiB of memory

Neighbor        V         AS   MsgRcvd   MsgSent   TblVer  InQ OutQ  Up/Down State/PfxRcd   PfxSnt Desc
10.200.200.2    4     123456     81432         4        0 56092    0 00:00:13       572106        0 N/A

Displayed neighbors 1
Total number of neighbors 4

IPv6 Unicast Summary (VRF default):
BGP router identifier X.X.X.X, local AS number XXX vrf-id 0
BGP table version 0
RIB entries 3, using 552 bytes of memory
Peers 5, using 3635 KiB of memory

Neighbor        V         AS   MsgRcvd   MsgSent   TblVer  InQ OutQ  Up/Down State/PfxRcd   PfxSnt Desc
% No matching neighbor

Total number of neighbors 5

After patch:

ubuntu# show bgp summary remote-as 123456 terse
IPv4 Unicast Summary (VRF default):
BGP router identifier X.X.X.X, local AS number XXX vrf-id 0

Neighbor        V         AS   MsgRcvd   MsgSent   TblVer  InQ OutQ  Up/Down State/PfxRcd   PfxSnt Desc
10.200.200.2    4     123456     81432         4        0 56092    0 00:00:13       572106        0 N/A

Displayed neighbors 1
Total number of neighbors 4

IPv6 Unicast Summary (VRF default):
BGP router identifier X.X.X.X, local AS number XXX vrf-id 1

% No matching neighbor

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
3 years agobgpd: add counter of displayed show bgp summary when filtering
Louis Scalbert [Wed, 12 May 2021 15:40:03 +0000 (17:40 +0200)]
bgpd: add counter of displayed show bgp summary when filtering

When filtering sessions on show bgp summary with failed, established,
neighbor and remote-as options, add a counter of displayed neighbors
in addition to the total number of neighbor :

"Displayed neighbors X"

ubuntu# show bgp summary failed remote-as external
IPv4 Unicast Summary (VRF default):

Neighbor        EstdCnt DropCnt ResetTime Reason
10.200.200.2          0       0     never Waiting for NHT
172.16.29.2           0       0     never Waiting for NHT
10.22.1.2             0       0     never Waiting for NHT

Displayed neighbors 3
Total number of neighbors 5

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
3 years agobgpd: display pretty VRF/view name on no such neighbor
Louis Scalbert [Wed, 12 May 2021 13:49:40 +0000 (15:49 +0200)]
bgpd: display pretty VRF/view name on no such neighbor

Display on which VRF/view the neighbor was not found. Useful when
selecting "vrf all".

Before patch:
No such neighbor in this view/vrf

After patch:
No such neighbor in VRF default

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
3 years agotests: Fixing common pylint error for topojson
Kuldeep Kashyap [Tue, 8 Jun 2021 05:23:34 +0000 (22:23 -0700)]
tests: Fixing common pylint error for topojson

Issue: There was an error reported by Pylint regarding "expected" keyword:
   Unexpected keyword argument 'expected' in function call (unexpected-keyword-arg)
Fix: We have defined expected keyword in all topojson APIs.

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
3 years agoMerge pull request #8806 from donaldsharp/established
Sri Mohana Singamsetty [Mon, 7 Jun 2021 22:20:40 +0000 (15:20 -0700)]
Merge pull request #8806 from donaldsharp/established

bgpd: Convert to using peer_established(peer) function

3 years agotests: timing large config operations
Christian Hopps [Wed, 2 Jun 2021 22:32:37 +0000 (22:32 +0000)]
tests: timing large config operations

To start we use 10k static route config. This test goes along with
recent batching changes it will fail w/o them (b/c some operations w/o
batching take 100 times as long).

This test should be added to over time for other large config
items (e.g., acl, policy, etc)

Signed-off-by: Christian Hopps <chopps@labn.net>
3 years agobgpd: Add tracepoints for bgp_dest_lock_node/bgp_dest_unlock_node
Donatas Abraitis [Mon, 7 Jun 2021 19:27:31 +0000 (22:27 +0300)]
bgpd: Add tracepoints for bgp_dest_lock_node/bgp_dest_unlock_node

static inline functions cannot be probed, let's add USDT.

This will help catching memory leaks regarding lock/unlock in the future,
I believe.

```
global locks;

probe begin
{
ansi_clear_screen();
println("Starting...");
}

probe process("/usr/lib/frr/bgpd").mark("bgp_dest_lock")
{
prefix = @cast($arg1, "bgp_node")->p->u->val;
locks[prefix]++;
printf("---> %s %d (lock count: %d)\n", probefunc(),
prefix, @cast($arg1, "bgp_node")->lock);
}

probe process("/usr/lib/frr/bgpd").mark("bgp_dest_unlock")
{

prefix = @cast($arg1, "bgp_node")->p->u->val;
if (locks[prefix] > 0) {
locks[prefix]--;
}
printf("<--- %s %d (lock count: %d)\n", probefunc(),
prefix, @cast($arg1, "bgp_node")->lock);
}
```

Some outputs:

```
<--- adj_free 94283113939304 (lock count: 2)
<--- adj_free 94283114099240 (lock count: 3)
<--- adj_free 94283114099752 (lock count: 3)
---> bgp_clear_route_table 94283113936008 (lock count: 4)
---> bgp_clear_route_table 94283113932664 (lock count: 4)
---> bgp_clear_route_table 94283114099240 (lock count: 3)
---> bgp_clear_route_table 94283114099752 (lock count: 3)
<--- adj_free 94283113795608 (lock count: 2)
<--- adj_free 94283113797112 (lock count: 2)
<--- adj_free 94283113796456 (lock count: 2)
---> bgp_clear_route_table 94283113936008 (lock count: 5)
---> bgp_clear_route_table 94283113932664 (lock count: 5)
---> bgp_clear_route_table 94283114099240 (lock count: 4)
---> bgp_clear_route_table 94283114099752 (lock count: 4)
---> bgp_process 94283113936008 (lock count: 5)
<--- bgp_clear_node_queue_del 94283113936008 (lock count: 6)
---> bgp_process 94283113932664 (lock count: 5)
<--- bgp_clear_node_queue_del 94283113932664 (lock count: 6)
---> bgp_process 94283114099240 (lock count: 4)
<--- bgp_clear_node_queue_del 94283114099240 (lock count: 5)
---> bgp_process 94283114099752 (lock count: 4)
<--- bgp_clear_node_queue_del 94283114099752 (lock count: 5)
<--- bgp_clear_node_queue_del 94283113936008 (lock count: 5)
<--- bgp_clear_node_queue_del 94283113932664 (lock count: 5)
<--- bgp_clear_node_queue_del 94283114099240 (lock count: 4)
<--- bgp_clear_node_queue_del 94283114099752 (lock count: 4)
<--- bgp_path_info_reap 94283113936008 (lock count: 4)
<--- bgp_path_info_reap 94283113936008 (lock count: 3)
```

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
3 years agoMerge pull request #8805 from opensourcerouting/find-asan-crash
Igor Ryzhov [Mon, 7 Jun 2021 20:19:55 +0000 (23:19 +0300)]
Merge pull request #8805 from opensourcerouting/find-asan-crash

lib: fix address sanitizer crash on `find`

3 years agozebra: srv6 cleanup
Mark Stapp [Mon, 7 Jun 2021 18:26:25 +0000 (14:26 -0400)]
zebra: srv6 cleanup

Use NO_PROTO consistently in tests; make sure zapi client
instance and session are used for srv6 'chunks'.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
3 years agozebra: small srv6 text cleanup
Mark Stapp [Mon, 7 Jun 2021 18:25:46 +0000 (14:25 -0400)]
zebra: small srv6 text cleanup

Couple of small typos in srv6 zapi code.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
3 years agobgpd: Convert to using peer_established(peer) function
Donald Sharp [Mon, 7 Jun 2021 13:39:10 +0000 (09:39 -0400)]
bgpd: Convert to using peer_established(peer) function

We are inconsistently using peer_establiahed(peer) with
sometimes using `peer->status == Established`.  Just Convert
over to using the function for consistency.

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