]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
2 years agobgpd: VRF-Lite fix best path selection
Kantesh Mundaragi [Mon, 8 Jun 2020 21:40:17 +0000 (14:40 -0700)]
bgpd: VRF-Lite fix best path selection

Description:
Incorrect behavior during best path selection for the imported routes.
Imported routes are always treated as eBGP routes.

Change is intended for fixing the issues related to
bgp best path selection for leaked routes:
- FRR does ecmp for the imported routes,
  even without any ecmp related config.
  If the same prefix is imported from two different VRFs,
  then we configure the route with ecmp even without
  any ecmp related config.
- Locally imported routes are preferred over imported
  eBGP routes.
  If there is a local route and eBGP learned route
  for the same prefix, if we import both the routes,
  imported local route is selected as best path.
- Same route is imported from multiple tenant VRFs,
  both imported routes point to the same VRF in nexthop.
- When the same route with same nexthop in two different VRFs
  is imported from those two VRFs, route is not installed as ecmp,
  even though we had ecmp config.

- During best path selection, while comparing the paths for imported routes,
  we should correctly refer to the original route i.e. the ultimate path.
- When the same route is imported from multiple VRF,
  use the correct VRF while installing in the FIB.
- When same route is imported from two different tenant VRFs,
  while comparing bgp path info as part of bgp best path selection,
  we should ideally also compare corresponding VRFs.

See-also: https://github.com/FRRouting/frr/files/7169555/FRR.and.Cisco.VRF-Lite.Behaviour.pdf

Co-authored-by: Santosh P K <sapk@vmware.com>
Co-authored-by: Kantesh Mundaragi <kmundaragi@vmware.com>
Signed-off-by: Iqra Siddiqui <imujeebsiddi@vmware.com>
2 years agoMerge pull request #10092 from ton31337/feature/replace_json_object_string_add_to_jso...
Igor Ryzhov [Thu, 18 Nov 2021 19:19:40 +0000 (22:19 +0300)]
Merge pull request #10092 from ton31337/feature/replace_json_object_string_add_to_json_object_string_addf_for_inet_ntop

*: inet_ntop for JSON output

2 years agoMerge pull request #9706 from donaldsharp/zebra_client_summ_more_room
Russ White [Thu, 18 Nov 2021 17:19:44 +0000 (12:19 -0500)]
Merge pull request #9706 from donaldsharp/zebra_client_summ_more_room

zebra: Expand v4/v6 route space

2 years agoMerge pull request #10095 from imzyxwvu/nb-validation
Igor Ryzhov [Thu, 18 Nov 2021 16:52:32 +0000 (19:52 +0300)]
Merge pull request #10095 from imzyxwvu/nb-validation

lib: Do not use sizeof() on `size_t errmsg_len`.

2 years ago*: Remove unused variables
Donatas Abraitis [Thu, 18 Nov 2021 09:15:33 +0000 (11:15 +0200)]
*: Remove unused variables

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2 years agozebra: Replace inet_ntop to %pI4/6 for JSON outputs
Donatas Abraitis [Thu, 18 Nov 2021 08:58:23 +0000 (10:58 +0200)]
zebra: Replace inet_ntop to %pI4/6 for JSON outputs

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2 years agopimd: Replace inet_ntop to %pI4/6 for JSON outputs
Donatas Abraitis [Thu, 18 Nov 2021 08:58:09 +0000 (10:58 +0200)]
pimd: Replace inet_ntop to %pI4/6 for JSON outputs

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2 years agoospf6d: Replace inet_ntop to %pI4/6 for JSON outputs
Donatas Abraitis [Thu, 18 Nov 2021 08:57:55 +0000 (10:57 +0200)]
ospf6d: Replace inet_ntop to %pI4/6 for JSON outputs

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2 years agoospfd: Replace inet_ntop to %pI4/6 for JSON outputs
Donatas Abraitis [Thu, 18 Nov 2021 08:57:40 +0000 (10:57 +0200)]
ospfd: Replace inet_ntop to %pI4/6 for JSON outputs

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2 years agoMerge pull request #10080 from mjstapp/fix_lsp_workqueue
Igor Ryzhov [Thu, 18 Nov 2021 15:47:35 +0000 (18:47 +0300)]
Merge pull request #10080 from mjstapp/fix_lsp_workqueue

zebra: ignore workqueue delete callbacks during shutdown

2 years agolib: Do not use sizeof() on `size_t errmsg_len`.
zyxwvu Shi [Thu, 18 Nov 2021 14:42:12 +0000 (22:42 +0800)]
lib: Do not use sizeof() on `size_t errmsg_len`.

This prevents caller from getting complete
validation message.

Signed-off-by: zyxwvu Shi <i@shiyc.cn>
2 years agozebra: during shutdown, don't process LSPs on the lsp workqueue
Mark Stapp [Thu, 18 Nov 2021 12:21:34 +0000 (07:21 -0500)]
zebra: during shutdown, don't process LSPs on the lsp workqueue

During zebra shutdown, we clear out the LSP workqueue. The LSPs
will be uninstalled and freed during the shutdown process, so
just ignore any LSPs that happen to be on the workqueue.

Signed-off-by: Mark Stapp <mstapp@nvidia.com>
2 years agozebra: free LSP workqueue early, revert PR 10050
Mark Stapp [Thu, 18 Nov 2021 12:32:01 +0000 (07:32 -0500)]
zebra: free LSP workqueue early, revert PR 10050

this reverts commit dd9538c5f36f9d6110, which tried to clear
the LSP workqueue late during shutdown.

Signed-off-by: Mark Stapp <mstapp@nvidia.com>
2 years agolib: Replace inet_ntop to %pI4/6 for JSON outputs
Donatas Abraitis [Thu, 18 Nov 2021 08:57:22 +0000 (10:57 +0200)]
lib: Replace inet_ntop to %pI4/6 for JSON outputs

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2 years agoldpd: Replace inet_ntop to %pI4/6 for JSON outputs
Donatas Abraitis [Thu, 18 Nov 2021 08:57:01 +0000 (10:57 +0200)]
ldpd: Replace inet_ntop to %pI4/6 for JSON outputs

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2 years agobgpd: Replace inet_ntop to %pI4/6 for JSON outputs
Donatas Abraitis [Thu, 18 Nov 2021 08:55:47 +0000 (10:55 +0200)]
bgpd: Replace inet_ntop to %pI4/6 for JSON outputs

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2 years agotools: Add coccinelle script to replace inet_ntop inside JSON
Donatas Abraitis [Thu, 18 Nov 2021 08:55:13 +0000 (10:55 +0200)]
tools: Add coccinelle script to replace inet_ntop inside JSON

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2 years agoMerge pull request #10091 from donaldsharp/ospf6_thread_stop
Igor Ryzhov [Thu, 18 Nov 2021 09:19:20 +0000 (12:19 +0300)]
Merge pull request #10091 from donaldsharp/ospf6_thread_stop

ospf6d: Prevent use after free

2 years agoMerge pull request #10077 from idryzhov/pim-if-addr-add
Donatas Abraitis [Thu, 18 Nov 2021 08:34:33 +0000 (10:34 +0200)]
Merge pull request #10077 from idryzhov/pim-if-addr-add

pimd: use correct VRF when processing interface address add

2 years agoMerge pull request #10084 from opensourcerouting/json-sugar
Donatas Abraitis [Thu, 18 Nov 2021 08:33:52 +0000 (10:33 +0200)]
Merge pull request #10084 from opensourcerouting/json-sugar

lib: make JSON output less painful/boilerplate-y

2 years agoospf6d: Prevent use after free
Donald Sharp [Wed, 17 Nov 2021 23:46:06 +0000 (18:46 -0500)]
ospf6d: Prevent use after free

I encountered a crash where the ospf6_write thread
was already thought to be scheduled by ospf6d:

(gdb) bt
    t_ptr=0x5624ee6bd260) at lib/thread.c:972
(gdb)

When poking around it was noticed that the ospf6 pointer was crap:
(gdb) p (struct ospf6 *)$7
$8 = (struct ospf6 *) 0x5624ee6c6b20
(gdb) p *$8
$9 = {vrf_id = 3998487040, name = 0x5624ee420010 "\a", router_id = 65892, router_id_static = 65892, router_id_zebra = 0, starttime = {tv_sec = 1654674, tv_usec = 678673},
  area_list = 0x0, backbone = 0x5624ee6c6710, lsdb = 0x5624ee6c2370, lsdb_self = 0x5624ee6c5d80, route_table = 0x5624ee6c5c10, brouter_table = 0x5624ee6c4690,
  external_table = 0x5624ee6c4710, external_id_table = 0x5624ee6c4f10, external_id = 24, redist = {0x0 <repeats 32 times>}, nssa_default_import_check = {refcnt = 0,
    status = false}, flag = 1 '\001', redistribute = 0, config_flags = 0 '\000', default_originate = 0, lsa_minarrival = 1000, spf_delay = 0, spf_holdtime = 50,
  spf_max_holdtime = 5000, spf_hold_multiplier = 1, spf_reason = 554, ts_spf = {tv_sec = 1654712, tv_usec = 122041}, ts_spf_duration = {tv_sec = 0, tv_usec = 48},
  last_spf_reason = 11, fd = -1, t_spf_calc = 0x0, t_ase_calc = 0x0, maxage_remover = 0x0, t_distribute_update = 0x0, t_ospf6_receive = 0x0, t_external_aggr = 0x0,
  t_write = 0x5624ee6cc930, write_oi_count = 20, ref_bandwidth = 100000, distance_all = 0 '\000', distance_intra = 0 '\000', distance_inter = 0 '\000',
  distance_external = 0 '\000', distance_table = 0x5624ee6c4f50, inst_shutdown = 1 '\001', max_multipath = 128, gr_info = {restart_support = false, restart_in_progress = false,
    prepare_in_progress = false, finishing_restart = false, grace_period = 0, t_grace_period = 0x0}, ospf6_helper_cfg = {supported_grace_time = 1800, is_helper_supported = false,
    strict_lsa_check = true, only_planned_restart = false, enable_rtr_list = 0x0, active_restarter_cnt = 0, last_exit_reason = 0}, anyNSSA = 0 '\000', t_abr_task = 0x0,
  oi_write_q = 0x0, redist_count = 0, aggr_action = 1, aggr_delay_interval = 6, rt_aggr_tbl = 0x5624ee6c51b0, qobj_node = {nid = 6163304287853836241, nodehash = {hi = {next = 0x0,
        hashval = 1613461457}}, type = 0x5624ed65e4e0 <qobj_t_ospf6>}}

Upon code inspection there was no place where we disabled the t_write thread upon ospf6 deletion.
If the code were to issue a `no router ospf6` and then recreate it.  We could see this crash.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agoMerge pull request #10089 from donaldsharp/really_remove
Donatas Abraitis [Wed, 17 Nov 2021 19:41:50 +0000 (21:41 +0200)]
Merge pull request #10089 from donaldsharp/really_remove

vtysh: Really remove `address-family evpn`

2 years agovtysh: Really remove `address-family evpn`
Donald Sharp [Wed, 17 Nov 2021 16:20:43 +0000 (11:20 -0500)]
vtysh: Really remove `address-family evpn`

I don't know how my original compile didn't fail
or I didn't notice :(

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agoMerge pull request #10086 from donaldsharp/cpp_removal
Igor Ryzhov [Wed, 17 Nov 2021 16:07:19 +0000 (19:07 +0300)]
Merge pull request #10086 from donaldsharp/cpp_removal

tools, vtysh: Remove final vestige of `address-family evpn`

2 years agoMerge pull request #10087 from donaldsharp/core_file_restore
David Lamparter [Wed, 17 Nov 2021 16:00:19 +0000 (17:00 +0100)]
Merge pull request #10087 from donaldsharp/core_file_restore

2 years agoMerge pull request #9914 from donaldsharp/coverity_script
Igor Ryzhov [Wed, 17 Nov 2021 15:17:30 +0000 (18:17 +0300)]
Merge pull request #9914 from donaldsharp/coverity_script

Do not return true/false in dplane_ctx_get_XXX functions

2 years agolib: use json-printf in filter code
David Lamparter [Wed, 17 Nov 2021 11:11:04 +0000 (12:11 +0100)]
lib: use json-printf in filter code

(This is mostly just to exercise the code, the actual replacement needs
to be a cocci script.)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2 years agolib: use vty_json()
David Lamparter [Wed, 17 Nov 2021 11:05:12 +0000 (12:05 +0100)]
lib: use vty_json()

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2 years agolib: add printfrr to json string helpers
David Lamparter [Wed, 17 Nov 2021 10:59:12 +0000 (11:59 +0100)]
lib: add printfrr to json string helpers

... these should probably have been added ages ago.
`json_object_string_addf(json, "key", "%pFX", prefix)` is super useful.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2 years agolib: add vty_json() helper
David Lamparter [Wed, 17 Nov 2021 10:39:00 +0000 (11:39 +0100)]
lib: add vty_json() helper

... this is copypasted all over the codebase & should've been a helper
to begin with really.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2 years agoMerge pull request #9852 from opensourcerouting/pim-nht-rework
Donald Sharp [Wed, 17 Nov 2021 14:34:51 +0000 (09:34 -0500)]
Merge pull request #9852 from opensourcerouting/pim-nht-rework

pimd: make PIM NHT less weird

2 years agotests: Re-add the ability to generate core files with topotests
Donald Sharp [Wed, 17 Nov 2021 13:51:14 +0000 (08:51 -0500)]
tests: Re-add the ability to generate core files with topotests

Somewhere along the line core-files stopped being generated
with the running of the topotests.  With this change we now
see this:

sharpd@eva /t/topotests> find . -name '*.dmp' -print
./ospfv3_basic_functionality.test_ospfv3_asbr_summary_topo1/r0/ospf6d_core-sig_6-pid_430478.dmp
sharpd@eva /t/topotests> sudo gdb /usr/lib/frr/ospf6d ./ospfv3_basic_functionality.test_ospfv3_asbr_summary_topo1/r0/ospf6d_core-sig_6-pid_430478.dmp
GNU gdb (Debian 10.1-1.7) 10.1.90.20210103-git
Copyright (C) 2021 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /usr/lib/frr/ospf6d...
[New LWP 430478]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `/usr/lib/frr/ospf6d --log file:ospf6d.log --log-level debug -d'.
Program terminated with signal SIGABRT, Aborted.
50 ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
(gdb)

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agotools, vtysh: Remove final vestige of `address-family evpn`
Donald Sharp [Wed, 17 Nov 2021 12:49:56 +0000 (07:49 -0500)]
tools, vtysh: Remove final vestige of `address-family evpn`

This was deprecated over a year ago now.  Let's finally
remove it from the system.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agozebra: Expand v4/v6 route space
Donald Sharp [Thu, 30 Sep 2021 17:56:15 +0000 (13:56 -0400)]
zebra: Expand v4/v6 route space

At some scale we eventually run out of room displaying v4/v6 route
totals for `show zebra client summ`:
janelle# show zebra client summ
Name      Connect Time    Last Read  Last Write  IPv4 Routes       IPv6 Routes
--------------------------------------------------------------------------------
bgp           04w0d18h     00:00:19    00:01:2411729127/4052681  2037786/903094

This total over ran the space in just a little over a week of uptime.
Expand to have a bit more room.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agozebra: return void for dplane_ctx_get_pbr_ipset_entry
Donald Sharp [Thu, 28 Oct 2021 14:42:23 +0000 (10:42 -0400)]
zebra: return void for dplane_ctx_get_pbr_ipset_entry

The dplane_ctx_get_pbr_ipset_entry function only
failed when the caller did not pass in a valid
usable pointer.  Change the code to assert on
a pointer not being passed in and remove the
bool return

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agozebra: return void for dplane_ctx_get_pbr_iptable
Donald Sharp [Thu, 28 Oct 2021 14:35:51 +0000 (10:35 -0400)]
zebra: return void for dplane_ctx_get_pbr_iptable

The only time this function ever failed is when
the developer does not pass in a usable pointer
to place the data in.  Change it to an assert
to signify to the end developer that is what
we want and then remove all the if checks
for failure

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agozebra: dplane_ctx_get_pbr_ipset should return void
Donald Sharp [Thu, 28 Oct 2021 13:15:44 +0000 (09:15 -0400)]
zebra: dplane_ctx_get_pbr_ipset should return void

The function call dplane_ctx_get_pbr_ipset only
returns false when the calling function fails to
pass in a valid ipset pointer.  This should
be an assertion issue since it's a programming
issue as opposed to an actual run time issue.

Change the function call parameter to not return
a bool on success/fail for a compile time decision.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agoMerge pull request #10075 from myloft/fix-chdir-judge
David Lamparter [Wed, 17 Nov 2021 11:26:23 +0000 (12:26 +0100)]
Merge pull request #10075 from myloft/fix-chdir-judge

2 years agolib: fix style misalignment
David Lamparter [Wed, 17 Nov 2021 10:33:12 +0000 (11:33 +0100)]
lib: fix style misalignment

Just a line that sticks out like a sore thumb.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2 years agopimd: correctly process rp-count==0 BSMs
David Lamparter [Thu, 22 Jul 2021 09:49:08 +0000 (11:49 +0200)]
pimd: correctly process rp-count==0 BSMs

rp-count==0 isn't a broken BSM, it just means the BSR no longer has any
Candidate RPs for the group range.  Previous behavior is badly mistaken
since it stops processing the entire packet.

Fix to correctly remove group range on rp-count==0 and continue
processing remainder of the packet.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2 years agotests: add one more BSR check to pim_bsmp_01
David Lamparter [Thu, 23 Sep 2021 13:04:24 +0000 (15:04 +0200)]
tests: add one more BSR check to pim_bsmp_01

This is implicitly checked by the "verify mroute" below, but it's much
more helpful to explicitly check in advance.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2 years agopimd: add back blocking RPF for BSM
David Lamparter [Mon, 26 Jul 2021 08:47:21 +0000 (10:47 +0200)]
pimd: add back blocking RPF for BSM

NHT won't have a result yet when we get the first BSM from a new BSR.
Hence, the first packet(s) are lost, since their RPF validation fails.

Re-add the blocking RPF check that was there before (though in a much
more sensible manner.)

Also nuke the now-unused pim_nexthop_match* functions.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2 years agopimd: move BSM clear into BSM code
David Lamparter [Sun, 25 Jul 2021 13:48:03 +0000 (15:48 +0200)]
pimd: move BSM clear into BSM code

... where it actually belongs.  And make a bunch of stuff static, since
it's no longer used across files now.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2 years agopimd: clean up BSR NHT & fix parallel links
David Lamparter [Fri, 25 Jun 2021 08:53:26 +0000 (10:53 +0200)]
pimd: clean up BSR NHT & fix parallel links

The Bootstrap message RX path needs a RPF check for the BSR address,
and this is implemented both incorrectly as well as quite ugly.

Clean up and fix case when we have multiple interfaces to the same LAN
and/or ECMP nexthops (both would cause message duplication, the former
can even cause BSM forwarding loops.)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2 years agopimd: actually return msec in timer_remain_msec()
David Lamparter [Wed, 22 Sep 2021 09:22:12 +0000 (11:22 +0200)]
pimd: actually return msec in timer_remain_msec()

... really old TODO sitting there.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2 years ago*: clean up ifp-by-local-address function(s)
David Lamparter [Wed, 23 Jun 2021 14:35:44 +0000 (16:35 +0200)]
*: clean up ifp-by-local-address function(s)

Most users of if_lookup_address_exact only cared about whether the
address is any local address.  Split that off into a separate function.

For the users that actually need the ifp - which I'm about to add a few
of - change it to prefer returning interfaces that are UP.

(Function name changed due to slight change in behavior re. UP state, to
avoid possible bugs from this change.)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2 years agoMerge pull request #9935 from idryzhov/fabricd-ifconf-cleanup
Mark Stapp [Tue, 16 Nov 2021 16:45:43 +0000 (11:45 -0500)]
Merge pull request #9935 from idryzhov/fabricd-ifconf-cleanup

fabricd: cleanup interface config output

2 years agoMerge pull request #10064 from idryzhov/ospf-grace-period
Russ White [Tue, 16 Nov 2021 16:32:45 +0000 (11:32 -0500)]
Merge pull request #10064 from idryzhov/ospf-grace-period

ospfd: fix no-form of "graceful-restart" command

2 years agoMerge pull request #10062 from idryzhov/bfd-replay
Russ White [Tue, 16 Nov 2021 16:32:20 +0000 (11:32 -0500)]
Merge pull request #10062 from idryzhov/bfd-replay

lib: rename bfd function to reflect real functionality

2 years agopimd: use correct VRF when processing interface address add
Igor Ryzhov [Tue, 16 Nov 2021 15:09:09 +0000 (18:09 +0300)]
pimd: use correct VRF when processing interface address add

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2 years agoMerge pull request #9944 from ARShreenidhi/tcp_mss_testcase
Russ White [Tue, 16 Nov 2021 14:56:48 +0000 (09:56 -0500)]
Merge pull request #9944 from ARShreenidhi/tcp_mss_testcase

tests: testcase to configure and verity tcp mss with vrf

2 years agoMerge pull request #10072 from idryzhov/zebra-memleak
Donald Sharp [Tue, 16 Nov 2021 13:01:30 +0000 (08:01 -0500)]
Merge pull request #10072 from idryzhov/zebra-memleak

zebra: fix memleak on shutdown

2 years agozebra: fix chdir judgment to avoid starting failed in a non-existent directory
Solyn [Tue, 16 Nov 2021 12:46:14 +0000 (20:46 +0800)]
zebra: fix chdir judgment to avoid starting failed in a non-existent directory

Signed-off-by: Solyn <admin@iloft.xyz>
2 years agoMerge pull request #10071 from donaldsharp/valgrind_supp_change
Igor Ryzhov [Tue, 16 Nov 2021 10:04:37 +0000 (13:04 +0300)]
Merge pull request #10071 from donaldsharp/valgrind_supp_change

tools: Add another valgrind suppression for libyang

2 years agozebra: fix memleak on shutdown
Igor Ryzhov [Mon, 15 Nov 2021 21:00:00 +0000 (00:00 +0300)]
zebra: fix memleak on shutdown

During shutdown, when table_manager_disable is called for the default
VRF, its vrf_id is already set to VRF_UNKNOWN, so the expression is true
and the table manager memory is not freed. Change the expression to
compare the VRF name instead of the id. The check in table_manager_enable
is changed for consistency.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2 years agoMerge pull request #10063 from idryzhov/ospf-gr-guarded-code
Donald Sharp [Mon, 15 Nov 2021 20:08:26 +0000 (15:08 -0500)]
Merge pull request #10063 from idryzhov/ospf-gr-guarded-code

ospfd: fix code being guarded by debug check

2 years agotools: Add another valgrind suppression for libyang
Donald Sharp [Mon, 15 Nov 2021 20:06:58 +0000 (15:06 -0500)]
tools: Add another valgrind suppression for libyang

More memory leaks from libyang that we can just ignore

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agoMerge pull request #10068 from Orange-OpenSource/ospf_ls
Donald Sharp [Mon, 15 Nov 2021 20:06:09 +0000 (15:06 -0500)]
Merge pull request #10068 from Orange-OpenSource/ospf_ls

ospfd: Fix wrong parsing of TE subTLV

2 years agoospfd: Fix wrong parsing of TE subTLV
Olivier Dugeon [Mon, 15 Nov 2021 17:19:35 +0000 (18:19 +0100)]
ospfd: Fix wrong parsing of TE subTLV

Function ospf_te_parse_te() and ospf_te_delete_te() browse TE TLV but also
subTLV. The loop that parse the subTLV check that cummulative read data doesn't
exceed the total size of the TLV. However, the sum variable that counts the
number of read data was wrongly intialize to 0 instead to 4 (i.e. the initial
TLV Header size that is located at the TOP of subTLV).

This patch adjust accordingly the initial value of the counter.

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
2 years agoMerge pull request #10014 from rgirada/ospf_nbr_cov
Donatas Abraitis [Mon, 15 Nov 2021 15:55:35 +0000 (17:55 +0200)]
Merge pull request #10014 from rgirada/ospf_nbr_cov

ospfd: fixing few coverity issues in ospf_vty.c

2 years agoMerge pull request #10048 from qlyoung/fix-reload-doc-comments
Donatas Abraitis [Mon, 15 Nov 2021 15:54:18 +0000 (17:54 +0200)]
Merge pull request #10048 from qlyoung/fix-reload-doc-comments

Fix reload comments

2 years agoMerge pull request #10050 from mjstapp/fix_mpls_queue_cleanup
Donatas Abraitis [Mon, 15 Nov 2021 15:51:51 +0000 (17:51 +0200)]
Merge pull request #10050 from mjstapp/fix_mpls_queue_cleanup

zebra: free LSP workqueue later during shutdown

2 years agoMerge pull request #10047 from idryzhov/fix-bfd-update-source
Donatas Abraitis [Mon, 15 Nov 2021 15:28:14 +0000 (17:28 +0200)]
Merge pull request #10047 from idryzhov/fix-bfd-update-source

bgpd: fix source-address for BFD sessions when using update-source IFNAME

2 years agolib: rename bfd function to reflect real functionality
Igor Ryzhov [Mon, 15 Nov 2021 15:11:49 +0000 (18:11 +0300)]
lib: rename bfd function to reflect real functionality

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2 years agoospfd: fix no-form of "graceful-restart" command
Igor Ryzhov [Wed, 10 Nov 2021 12:15:15 +0000 (15:15 +0300)]
ospfd: fix no-form of "graceful-restart" command

The no-form should use the same arguments as the regular command, hence
replace "period" with "grace-period".

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2 years agoospfd: fix code being guarded by debug check
Igor Ryzhov [Fri, 5 Nov 2021 10:54:57 +0000 (13:54 +0300)]
ospfd: fix code being guarded by debug check

OSPF_NSM_TIMER_ON must be called regardless of debug configuration.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2 years agoMerge pull request #10046 from donaldsharp/bgp_instance_del
David Lamparter [Mon, 15 Nov 2021 09:49:31 +0000 (10:49 +0100)]
Merge pull request #10046 from donaldsharp/bgp_instance_del

2 years agoMerge pull request #9956 from idryzhov/bfd-remove-ttl
Russ White [Sun, 14 Nov 2021 17:24:28 +0000 (12:24 -0500)]
Merge pull request #9956 from idryzhov/bfd-remove-ttl

lib: remove confusing bfd TTL API

2 years agoMerge pull request #10049 from qlyoung/doc-update-process-arch
Donatas Abraitis [Sat, 13 Nov 2021 19:45:40 +0000 (21:45 +0200)]
Merge pull request #10049 from qlyoung/doc-update-process-arch

doc: update & clarify language in process arch doc

2 years agoMerge pull request #10032 from opensourcerouting/build-fix-20211111
Donald Sharp [Sat, 13 Nov 2021 15:10:59 +0000 (10:10 -0500)]
Merge pull request #10032 from opensourcerouting/build-fix-20211111

build: assorted build system improvements, 2021-11 edition

2 years agoMerge pull request #10036 from donaldsharp/finally_frr
Jafar Al-Gharaibeh [Sat, 13 Nov 2021 03:35:27 +0000 (21:35 -0600)]
Merge pull request #10036 from donaldsharp/finally_frr

Finally frr

2 years agozebra: free LSP workqueue later during shutdown
Mark Stapp [Fri, 12 Nov 2021 20:10:00 +0000 (15:10 -0500)]
zebra: free LSP workqueue later during shutdown

Free the LSP workqueue later during shutdown, so that zebra
has enough time to clean up and uninstall any LSPs.

Signed-off-by: Mark Stapp <mstapp@nvidia.com>
2 years agodoc: update & clarify language in process arch doc
Quentin Young [Fri, 12 Nov 2021 19:45:36 +0000 (14:45 -0500)]
doc: update & clarify language in process arch doc

There was a historical blurb at the top of the process architecture
document that in several instances caused some confusion regarding
whether or not FRR supports multithreading. Remove this paragraph and
replace it with a summary of the page contents.

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
2 years agotools: simplify excessively complex conditional
Quentin Young [Fri, 12 Nov 2021 18:37:09 +0000 (13:37 -0500)]
tools: simplify excessively complex conditional

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
2 years agotests: Ensure BGP has had time to import routes through the vpn
Donald Sharp [Fri, 12 Nov 2021 15:52:03 +0000 (10:52 -0500)]
tests: Ensure BGP has had time to import routes through the vpn

Currently I get bgp_instance_del-test as well as bgp_l3vpn_to_bgp_vrf
failures every ~3-4 runs when under a 40 parallel run with micronet.
Examination of the failure and passing cases always leads to the
failures showing convergence of bgp bestpath immediately after
the show commands to ensure that the routes are there.

Modify the code to look for the fact that the vrf has
converged from routes being passed around across vrf's
and ensure that bestpath has run on them.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agobgpd: Add vrf information to best path debugging
Donald Sharp [Fri, 12 Nov 2021 15:46:48 +0000 (10:46 -0500)]
bgpd: Add vrf information to best path debugging

When debugging issues for routes in multiple vrf's.  It would
be extremely useful if the debug output had which vrf we
are acting on.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agotools: string literals -> comments
Quentin Young [Fri, 12 Nov 2021 18:16:25 +0000 (13:16 -0500)]
tools: string literals -> comments

Convert all floating string literals being used as comments, to comments

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
2 years agoMerge pull request #10045 from qlyoung/fix-pr-10006
Igor Ryzhov [Fri, 12 Nov 2021 18:12:58 +0000 (21:12 +0300)]
Merge pull request #10045 from qlyoung/fix-pr-10006

zebra: use tabs instead of spaces zebra_vxlan.c

2 years agobgpd: fix source-address for BFD sessions when using update-source IFNAME
Igor Ryzhov [Fri, 12 Nov 2021 16:32:06 +0000 (19:32 +0300)]
bgpd: fix source-address for BFD sessions when using update-source IFNAME

When "update-source IFNAME" is used for the neighbor, p->update_source
is set to NULL, so we can't use it as a source address and should use
the address from p->su_local.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2 years agozebra: use tabs instead of spaces zebra_vxlan.c
Quentin Young [Fri, 12 Nov 2021 16:09:48 +0000 (11:09 -0500)]
zebra: use tabs instead of spaces zebra_vxlan.c

Bad style introduced in
https://github.com/FRRouting/frr/pull/10006

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
2 years agoMerge pull request #9945 from idryzhov/isis-time-t
Donatas Abraitis [Fri, 12 Nov 2021 06:39:46 +0000 (08:39 +0200)]
Merge pull request #9945 from idryzhov/isis-time-t

isisd: use time_t for last update and last flap

2 years agoMerge pull request #9982 from idryzhov/fix-netns-delete
Donald Sharp [Thu, 11 Nov 2021 23:41:33 +0000 (18:41 -0500)]
Merge pull request #9982 from idryzhov/fix-netns-delete

zebra: fix netns deletion

2 years agoMerge pull request #9981 from idryzhov/fix-vrf-delete
Donald Sharp [Thu, 11 Nov 2021 23:41:02 +0000 (18:41 -0500)]
Merge pull request #9981 from idryzhov/fix-vrf-delete

lib: fix vrf deletion when the last interface is deleted

2 years agoMerge pull request #9965 from idryzhov/fix-table-manager-disable
Donald Sharp [Thu, 11 Nov 2021 23:40:08 +0000 (18:40 -0500)]
Merge pull request #9965 from idryzhov/fix-table-manager-disable

zebra: fix disabling table manager

2 years agoMerge pull request #10035 from donaldsharp/ospf_use_after_free
Igor Ryzhov [Thu, 11 Nov 2021 21:34:16 +0000 (00:34 +0300)]
Merge pull request #10035 from donaldsharp/ospf_use_after_free

ospfd: Prevent use after free on shutdown

2 years ago*: Cleanup some documentation from quagga->frr
Donald Sharp [Thu, 11 Nov 2021 19:40:17 +0000 (14:40 -0500)]
*: Cleanup some documentation from quagga->frr

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years ago*: Rename quagga_timestamp with frr_timestamp
Donald Sharp [Thu, 11 Nov 2021 19:33:41 +0000 (14:33 -0500)]
*: Rename quagga_timestamp with frr_timestamp

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years ago*: Convert quagga_signal_X to frr_signal_X
Donald Sharp [Thu, 11 Nov 2021 19:28:54 +0000 (14:28 -0500)]
*: Convert quagga_signal_X to frr_signal_X

Naming functions/data structures more appropriately for
the project we are actually in.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agoospfd: Prevent use after free on shutdown
Donald Sharp [Thu, 11 Nov 2021 18:25:35 +0000 (13:25 -0500)]
ospfd: Prevent use after free on shutdown

Running ospf_topo_vrf1 leads us to this valgrind issue:

==2386518== Invalid read of size 8
==2386518==    at 0x4971520: route_top (table.c:401)
==2386518==    by 0x181F08: ospf_interface_bfd_apply (ospf_bfd.c:126)
==2386518==    by 0x182069: ospf_interface_disable_bfd (ospf_bfd.c:158)
==2386518==    by 0x18BF51: ospf_del_if_params (ospf_interface.c:557)
==2386518==    by 0x18C584: ospf_if_delete_hook (ospf_interface.c:712)
==2386518==    by 0x490CA0B: hook_call_if_del (if.c:61)
==2386518==    by 0x490D1F3: if_delete_retain (if.c:286)
==2386518==    by 0x490D337: if_delete (if.c:309)
==2386518==    by 0x490CDED: if_destroy_via_zapi (if.c:200)
==2386518==    by 0x49940A9: zclient_interface_delete (zclient.c:2237)
==2386518==    by 0x4998062: zclient_read (zclient.c:3969)
==2386518==    by 0x4979529: thread_call (thread.c:1908)
==2386518==    by 0x4919918: frr_run (libfrr.c:1164)
==2386518==    by 0x181AC7: main (ospf_main.c:235)
==2386518==  Address 0x5df39a0 is 0 bytes inside a block of size 56 free'd
==2386518==    at 0x48399AB: free (vg_replace_malloc.c:538)
==2386518==    by 0x492A03E: qfree (memory.c:141)
==2386518==    by 0x4970C6F: route_table_free (table.c:141)
==2386518==    by 0x4970A36: route_table_finish (table.c:61)
==2386518==    by 0x18C543: ospf_if_delete_hook (ospf_interface.c:708)
==2386518==    by 0x490CA0B: hook_call_if_del (if.c:61)
==2386518==    by 0x490D1F3: if_delete_retain (if.c:286)
==2386518==    by 0x490D337: if_delete (if.c:309)
==2386518==    by 0x490CDED: if_destroy_via_zapi (if.c:200)
==2386518==    by 0x49940A9: zclient_interface_delete (zclient.c:2237)
==2386518==    by 0x4998062: zclient_read (zclient.c:3969)
==2386518==    by 0x4979529: thread_call (thread.c:1908)
==2386518==    by 0x4919918: frr_run (libfrr.c:1164)
==2386518==    by 0x181AC7: main (ospf_main.c:235)
==2386518==  Block was alloc'd at
==2386518==    at 0x483AB65: calloc (vg_replace_malloc.c:760)
==2386518==    by 0x4929EFC: qcalloc (memory.c:116)
==2386518==    by 0x49709F8: route_table_init_with_delegate (table.c:53)
==2386518==    by 0x49717F4: route_table_init (table.c:528)
==2386518==    by 0x18C328: ospf_if_new_hook (ospf_interface.c:659)
==2386518==    by 0x490C97D: hook_call_if_add (if.c:60)
==2386518==    by 0x490CE85: if_create_name (if.c:223)
==2386518==    by 0x490DF32: if_get_by_name (if.c:622)
==2386518==    by 0x4993F73: zclient_interface_add (zclient.c:2186)
==2386518==    by 0x4998062: zclient_read (zclient.c:3969)
==2386518==    by 0x4979529: thread_call (thread.c:1908)
==2386518==    by 0x4919918: frr_run (libfrr.c:1164)
==2386518==    by 0x181AC7: main (ospf_main.c:235)
==2386518==

Fix the ordering to do the individual node tree cleanup after we delete
the data we care about.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agoMerge pull request #10033 from donaldsharp/bgp_max_no_go
Igor Ryzhov [Thu, 11 Nov 2021 17:31:03 +0000 (20:31 +0300)]
Merge pull request #10033 from donaldsharp/bgp_max_no_go

*: use compiler.h MIN/MAX macros instead of everyone having one

2 years agobuild: fix duplicate yang.c file inclusions
David Lamparter [Thu, 11 Nov 2021 14:46:54 +0000 (15:46 +0100)]
build: fix duplicate yang.c file inclusions

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2 years agobuild: remove some useless intermediate libraries
David Lamparter [Thu, 11 Nov 2021 14:45:09 +0000 (15:45 +0100)]
build: remove some useless intermediate libraries

These really serve no purpose other than slowing our build down.  If
there's a benefit to any of these, they can be readded.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2 years ago*: use compiler.h MIN/MAX macros instead of everyone having one
Donald Sharp [Thu, 11 Nov 2021 14:39:52 +0000 (09:39 -0500)]
*: use compiler.h MIN/MAX macros instead of everyone having one

We had various forms of min/max macros across multiple daemons
all of which duplicated what we have in compiler.h.  Convert
everyone to use the `correct` ones

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agobuild: link libcrypt & libdl to libfrr only
David Lamparter [Thu, 11 Nov 2021 14:28:33 +0000 (15:28 +0100)]
build: link libcrypt & libdl to libfrr only

They're not needed elsewhere.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2 years agobuild: link libelf to clippy only
David Lamparter [Thu, 11 Nov 2021 14:05:02 +0000 (15:05 +0100)]
build: link libelf to clippy only

It's not needed elsewhere & generates a bogus dependency.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2 years agobuild: fix more libtool stupidity for modules
David Lamparter [Thu, 11 Nov 2021 13:27:13 +0000 (14:27 +0100)]
build: fix more libtool stupidity for modules

libtool, the radioactive dumpster fire of the GNU ecosystem.

A module should not have a SONAME set.  SONAMEs are for (versioned)
libraries on search paths.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2 years agobuild: break up tests/subdir.am
David Lamparter [Thu, 11 Nov 2021 13:36:28 +0000 (14:36 +0100)]
build: break up tests/subdir.am

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2 years agoMerge pull request #10006 from chiragshah6/evpn_dev
Russ White [Thu, 11 Nov 2021 13:09:06 +0000 (08:09 -0500)]
Merge pull request #10006 from chiragshah6/evpn_dev

zebra:  svi down remove evpn l2vni from l3vni list

2 years agoMerge pull request #10025 from opensourcerouting/xref-backtrace
Russ White [Thu, 11 Nov 2021 13:08:19 +0000 (08:08 -0500)]
Merge pull request #10025 from opensourcerouting/xref-backtrace

lib: backtraces for specific log messages

2 years agoMerge pull request #9861 from rgirada/ospf6_coverity
Russ White [Thu, 11 Nov 2021 13:04:28 +0000 (08:04 -0500)]
Merge pull request #9861 from rgirada/ospf6_coverity

ospf6d: Addressing few coverity issues.