Commit Graph

26797 Commits

Author SHA1 Message Date
Ruslan Babayev
56fd4d3460 yang, ospfd: build frr-ospfd.yang when ospfd is enabled
Signed-off-by: Ruslan Babayev <ruslan@babayev.com>
2021-11-11 23:05:46 -08:00
Ruslan Babayev
3f5af3d50b yang, bgpd: add missing includes
Signed-off-by: Ruslan Babayev <ruslan@babayev.com>
2021-11-11 23:05:46 -08:00
Ruslan Babayev
084dfdc03c yang, ripd, ripngd: fix annotate statements
Add missing annotate-statement for the 'instance' list.

Signed-off-by: Ruslan Babayev <ruslan@babayev.com>
2021-11-11 23:05:46 -08:00
Ruslan Babayev
688c536fb3 yang: confd: compile yang modules to fxs
Signed-off-by: Ruslan Babayev <ruslan@babayev.com>
2021-11-11 23:05:46 -08:00
Ruslan Babayev
fc3ebe1235 lib: confd: fix format-truncation warnings
Signed-off-by: Ruslan Babayev <ruslan@babayev.com>
2021-11-11 23:05:46 -08:00
Ruslan Babayev
7f88892d96 lib: confd: fix non-void return-type warning
Signed-off-by: Ruslan Babayev <ruslan@babayev.com>
2021-11-11 23:05:46 -08:00
Ruslan Babayev
722e430fd5 lib: confd: fix compilation broken with libyang2
Fixes the following compilation errors:

In file included from /home/ruslan/sdk/sysroots/corei7-64-poky-linux/usr/include/libyang/tree_data.h:30,
                 from /home/ruslan/sdk/sysroots/corei7-64-poky-linux/usr/include/libyang/context.h:22,
                 from /home/ruslan/sdk/sysroots/corei7-64-poky-linux/usr/include/libyang/libyang.h:24,
                 from ../../src/frr/lib/yang.h:25,
                 from ../../src/frr/lib/northbound.h:27,
                 from ../../src/frr/lib/vty.h:36,
                 from ../../src/frr/lib/ferr.h:28,
                 from ../../src/frr/lib/lib_errors.h:24,
                 from ../../src/frr/lib/northbound_confd.c:23:
../../src/frr/lib/northbound_confd.c: In function 'frr_confd_init_cdb':
../../src/frr/lib/northbound_confd.c:533:28: error: 'const struct lys_module' has no member named 'data'
  533 |   LY_LIST_FOR (module->info->data, snode) {
      |                            ^~
../../src/frr/lib/northbound_confd.c: In function 'frr_confd_data_get_next_object':
../../src/frr/lib/northbound_confd.c:921:3: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
  921 |   LY_LIST_FOR (lysc_node_child(nb_node->snode), child) {
      |   ^~~~~~~~~~~

Signed-off-by: Ruslan Babayev <ruslan@babayev.com>
2021-11-11 23:05:46 -08:00
Donatas Abraitis
279ca4ddc2
Merge pull request #9945 from idryzhov/isis-time-t
isisd: use time_t for last update and last flap
2021-11-12 08:39:46 +02:00
Donald Sharp
f15d7a202e
Merge pull request #9982 from idryzhov/fix-netns-delete
zebra: fix netns deletion
2021-11-11 18:41:33 -05:00
Donald Sharp
13576f45f8
Merge pull request #9981 from idryzhov/fix-vrf-delete
lib: fix vrf deletion when the last interface is deleted
2021-11-11 18:41:02 -05:00
Donald Sharp
66e108cc25
Merge pull request #9965 from idryzhov/fix-table-manager-disable
zebra: fix disabling table manager
2021-11-11 18:40:08 -05:00
Igor Ryzhov
bf967f3ab9
Merge pull request #10035 from donaldsharp/ospf_use_after_free
ospfd: Prevent use after free on shutdown
2021-11-12 00:34:16 +03:00
Donald Sharp
b72aae2e04 *: Cleanup some documentation from quagga->frr
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-11-11 14:41:27 -05:00
Donald Sharp
e36f61b507 *: Rename quagga_timestamp with frr_timestamp
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-11-11 14:41:27 -05:00
Donald Sharp
7cc91e67a3 *: 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>
2021-11-11 14:41:27 -05:00
Donald Sharp
9ffde6e1b0 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>
2021-11-11 13:25:35 -05:00
Igor Ryzhov
4b80ea6252
Merge pull request #10033 from donaldsharp/bgp_max_no_go
*: use compiler.h MIN/MAX macros instead of everyone having one
2021-11-11 20:31:03 +03:00
David Lamparter
f642358837 build: fix duplicate yang.c file inclusions
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-11-11 15:49:40 +01:00
David Lamparter
e9f7a9655e 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>
2021-11-11 15:46:01 +01:00
Donald Sharp
7a8ce9d56d *: 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>
2021-11-11 09:39:52 -05:00
David Lamparter
3bd7df45a2 build: link libcrypt & libdl to libfrr only
They're not needed elsewhere.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-11-11 15:29:48 +01:00
David Lamparter
53c6125b9f build: link libelf to clippy only
It's not needed elsewhere & generates a bogus dependency.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-11-11 15:29:30 +01:00
David Lamparter
0198bd1fbb 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>
2021-11-11 14:40:03 +01:00
David Lamparter
e536bb107d build: break up tests/subdir.am
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-11-11 14:40:03 +01:00
Russ White
7347a4859d
Merge pull request #10006 from chiragshah6/evpn_dev
zebra:  svi down remove evpn l2vni from l3vni list
2021-11-11 08:09:06 -05:00
Russ White
eda02ab9da
Merge pull request #10025 from opensourcerouting/xref-backtrace
lib: backtraces for specific log messages
2021-11-11 08:08:19 -05:00
Russ White
83323dbf00
Merge pull request #9861 from rgirada/ospf6_coverity
ospf6d: Addressing few coverity issues.
2021-11-11 08:04:28 -05:00
Russ White
b761cb131a
Merge pull request #9864 from ton31337/feature/access_list_autocomplete
lib: Add autocomplete for access-lists
2021-11-11 08:03:33 -05:00
Russ White
46a66c563b
Merge pull request #10019 from donaldsharp/pim_upstream_reg_state
pimd: Remove default from enum based switch
2021-11-11 08:00:36 -05:00
David Lamparter
254144e7ef build: refactor tests/subdir.am
... to put related stuff next to each other.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-11-11 13:51:44 +01:00
Igor Ryzhov
928cd90201
Merge pull request #9931 from leibaogit/master
zebra: Fix the RA packets can not sent out
2021-11-11 15:34:01 +03:00
Igor Ryzhov
49df081596 zebra: fix disabling table manager
42d4b30e introduced per-VRF table manager.

Table manager is allocated when the VRF is created, but it is freed when
the VRF is disabled. When this VRF is re-enabled, zebra ends up with
table manager being NULL pointer and it crashes on any dereference.

Table manager should be freed when the VRF is deleted, not when it's
disabled.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-11-11 14:59:51 +03:00
Igor Ryzhov
ac716cdffd isisd: use time_t for last update and last flap
These variables are only assigned with time() which returns time_t.
This should also fix occasional CI build failures because of comparisons
of signed and unsigned integers.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-11-11 14:58:35 +03:00
Igor Ryzhov
ce27a13e90 lib: fix vrf deletion when the last interface is deleted
Currently, we automatically delete an inactive VRF when its last
interface is deleted. This code introduces a couple of crashes because
of the following problems:
- vrf_delete is called before calling if_del hook, so daemons may try to
  dereference an ifp->vrf pointer which is freed
- in if_terminate, we continue to use the VRF in the loop condition
  after the last interface is deleted

This check is needed only when the interface is deleted by the user,
because if the interface is deleted by the system, VRF must still exist
in the system. Move the check to appropriate places to fix crashes.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-11-11 14:57:59 +03:00
Igor Ryzhov
6502e5f104 zebra: fix netns deletion
We don't receive interface down/delete notifications from kernel when a
netns is deleted. Therefore we have to manually replicate the necessary
actions, otherwise interfaces are kept in the system with stale pointers
to the deleted netns.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-11-11 14:57:18 +03:00
Igor Ryzhov
88ae096331 fabricd: cleanup interface config output
We don't need to scan through all configured areas to find the circuit
associated with the interface. It is always stored in ifp->info.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-11-11 14:56:34 +03:00
Igor Ryzhov
92f85e656b lib: remove confusing bfd TTL API
There are two APIs to control the expected number of hops for a BFD
session – `bfd_sess_set_mininum_ttl` and `bfd_sess_set_hop_count`.
The former is very confusing, as it takes an expected TTL in the
BFD packet which is actually a protocol internal value. The latter is
simple and straightforward – it takes an expected number of hops, which
is always 1 for single-hop and >1 for multi-hop.

As the former API is not used anywhere, just remove it to avoid any
confusion.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-11-11 14:56:04 +03:00
Igor Ryzhov
0ac8055ca1
Merge pull request #10029 from anlancs/doc-bgp-title
doc: remove redundant chars for bgp
2021-11-11 14:50:53 +03:00
David Lamparter
fec9fb2985 tests: fix frr-format warnings in printfrr test
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-11-11 12:27:11 +01:00
David Lamparter
5863f58933 build: adjust silent make rules in tests
Purely aesthetic change to make these rules not stick out like a sore
thumb.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-11-11 12:26:29 +01:00
David Lamparter
5b21845971 build: adjust compiler/C11 bits for autoconf 2.70+
`autoconf` finally arrived in the 2010s and tries to do ISO C11.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-11-11 12:18:44 +01:00
David Lamparter
6125c10c29 build: work around AC_PROG_LEX deprecation warning
`AC_PROG_LEX without either yywrap or noyywrap is obsolete`, says
autoconf 2.70.  Sadly, there is no transition window for this, in 2.69
the macro takes no arguments.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-11-11 11:58:50 +01:00
anlan_cs
b58393f6ab doc: remove redundant chars for bgp
Signed-off-by: anlan_cs <anlan_cs@tom.com>
2021-11-11 03:19:59 -05:00
Donald Sharp
933a8c8a4c
Merge pull request #10026 from idryzhov/bfd-peer-str-coverity
bfdd: fix coverity warnings
2021-11-10 19:01:57 -05:00
Donald Sharp
e1d1b1dec7 pimd: Remove default from enum based switch
enum based switches should never use default.  It makes
it very hard to fix and find issues when the enum is
changed.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-11-10 17:35:22 -05:00
Donald Sharp
6f0331d8b4
Merge pull request #9988 from idryzhov/ospf-gr-broken
ospfd: remove commands for broken GR helper mode
2021-11-10 14:05:38 -05:00
Quentin Young
526e898295 doc: fix wrong reference to release filename
Signed-off-by: Quentin Young <qlyoung@nvidia.com>
2021-11-10 11:58:29 -05:00
Igor Ryzhov
accef597df ospfd: remove commands for broken GR helper mode
Issue #9983 explains what is wrong with the GR helper mode.

To unblock the CI that fails almost all the time on the ospf_gr_topo1
test, remove the commands and disable the test. Also add a reminder to
completely remove the helper mode if no one fixes the code in a month.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-11-10 19:17:03 +03:00
Donatas Abraitis
37b6787730
Merge pull request #9700 from mjstapp/add_json_det_attrs
bgpd: Add 'show bgp <afi> <safi> json detail' header data
2021-11-10 16:42:30 +02:00
David Lamparter
afb8fe93b1 doc: stick libunwind into build docs
It's strictly optional, but… the backtraces are really much better.
Specifically, `libunwind` is notably more capable in figuring out
function names compared to glibc/libexecinfo `backtrace_symbols()`.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-11-10 15:30:56 +01:00