]> git.puffer.fish Git - mirror/frr.git/log
mirror/frr.git
17 months agolib: print all errors when validating a config 14800/head
Igor Ryzhov [Tue, 14 Nov 2023 18:57:05 +0000 (19:57 +0100)]
lib: print all errors when validating a config

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
17 months agolib: fix printing multiple yang errors
Igor Ryzhov [Tue, 14 Nov 2023 18:55:00 +0000 (19:55 +0100)]
lib: fix printing multiple yang errors

When printing multiple YANG errors, we should print paths for all of
them, not only for the last one.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
17 months agoMerge pull request #14712 from yenlu-keith/teamd-es-id
Donald Sharp [Tue, 14 Nov 2023 16:20:27 +0000 (11:20 -0500)]
Merge pull request #14712 from yenlu-keith/teamd-es-id

zebra: supports to listen teamd nlmsg as bond type

17 months agoMerge pull request #14725 from donaldsharp/event_io_smoothing
Russ White [Tue, 14 Nov 2023 16:15:54 +0000 (11:15 -0500)]
Merge pull request #14725 from donaldsharp/event_io_smoothing

Event io smoothing

17 months agoMerge pull request #14787 from opensourcerouting/fix/ospf6d_cost_fixup
Russ White [Tue, 14 Nov 2023 13:56:16 +0000 (08:56 -0500)]
Merge pull request #14787 from opensourcerouting/fix/ospf6d_cost_fixup

ospf6d: Let the user override interface cost for a loopback

17 months agoMerge pull request #14135 from squirrelking57/fix_isis_adj_level
Russ White [Tue, 14 Nov 2023 13:49:35 +0000 (08:49 -0500)]
Merge pull request #14135 from squirrelking57/fix_isis_adj_level

isisd:change ngh lvl when int circuit type setted

17 months agoMerge pull request #11800 from mxyns/bmp-locribmon
Russ White [Tue, 14 Nov 2023 13:27:45 +0000 (08:27 -0500)]
Merge pull request #11800 from mxyns/bmp-locribmon

bgpd: BMP Loc-Rib Monitoring (RFC9069) Implementation

17 months agoMerge pull request #14780 from fdumontet6WIND/coverity
Donatas Abraitis [Tue, 14 Nov 2023 07:48:15 +0000 (09:48 +0200)]
Merge pull request #14780 from fdumontet6WIND/coverity

bgpd: fix coverity issue in bgp_snmp_bgp4v2.c

17 months agoMerge pull request #14782 from donaldsharp/pbd
Donatas Abraitis [Tue, 14 Nov 2023 07:06:42 +0000 (09:06 +0200)]
Merge pull request #14782 from donaldsharp/pbd

bgpd: Used %pBD instead of %pRN

17 months agoospf6d: Let the user override interface cost for a loopback 14787/head
Donatas Abraitis [Mon, 13 Nov 2023 19:06:20 +0000 (21:06 +0200)]
ospf6d: Let the user override interface cost for a loopback

Fixes: 80dfa9e012eb ("ospf6d: Set loopback interface cost to 0")
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
17 months agoMerge pull request #14781 from donaldsharp/frr_memory_leaks_cleanup
Donatas Abraitis [Mon, 13 Nov 2023 19:17:16 +0000 (21:17 +0200)]
Merge pull request #14781 from donaldsharp/frr_memory_leaks_cleanup

Frr memory leaks cleanup

17 months agobgpd: fix coverity issue in bgp_snmp_bgp4v2.c 14780/head
Francois Dumontet [Mon, 13 Nov 2023 13:44:19 +0000 (14:44 +0100)]
bgpd: fix coverity issue in bgp_snmp_bgp4v2.c

CID 1570969 Overrun
/bgpd/bgp_snmp_bgp4v2.c: 534 in bgp4v2PathAttrLookup()
/bgpd/bgp_snmp_bgp4v2.c: 575 in bgp4v2PathAttrLookup()
/bgpd/bgp_snmp_bgp4v2.c: 514 in bgp4v2PathAttrLookup()

>>>     CID 1570969:    (OVERRUN)
>>>     Overrunning array "bgp->rib" of 4 64-byte elements at element index 4 (byte offset 319) using index "afi" (which evaluates to 4).

Signed-off-by: Francois Dumontet <francois.dumontet@6wind.com>
17 months agobgpd: Used %pBD instead of %pRN 14782/head
Donald Sharp [Mon, 13 Nov 2023 15:26:48 +0000 (10:26 -0500)]
bgpd: Used %pBD instead of %pRN

Let's use the natural data structure in bgp for the prefix display
instead of a bunch of places where we call a translator function.
The %pBD does this and actually ensures data is correct.
Also fix a few spots in bgp_zebra.c where the cast to a NULL
pointer causes the catcher functionality to not work and fix
the resulting crash that resulted.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
17 months agoMerge pull request #14768 from idryzhov/mgmtd-base-xpath
Donald Sharp [Mon, 13 Nov 2023 14:19:07 +0000 (09:19 -0500)]
Merge pull request #14768 from idryzhov/mgmtd-base-xpath

lib, mgmtd: respect base xpath in mgmtd

17 months agotests: Remove `log monitor XX` it's not a cli command 14781/head
Donald Sharp [Mon, 13 Nov 2023 14:12:25 +0000 (09:12 -0500)]
tests: Remove `log monitor XX` it's not a cli command

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
17 months agozebra: More memory free up on shutdown
Donald Sharp [Mon, 13 Nov 2023 14:07:06 +0000 (09:07 -0500)]
zebra: More memory free up on shutdown

a) nl_batch_tx_buf was not being freed
b) the mlag_fifo was not being freed
c) the vrf->ns_ctxt was not being freed

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
17 months agopimd: Free up link list on shutdown
Donald Sharp [Mon, 13 Nov 2023 14:06:10 +0000 (09:06 -0500)]
pimd: Free up link list on shutdown

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
17 months agoospf6d: Cleanup memory on shutdown
Donald Sharp [Sun, 12 Nov 2023 03:58:16 +0000 (22:58 -0500)]
ospf6d: Cleanup memory on shutdown

some list data structures were never freed

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
17 months agoospfd: Cleanup route-map memory
Donald Sharp [Sun, 12 Nov 2023 03:57:24 +0000 (22:57 -0500)]
ospfd: Cleanup route-map memory

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
17 months agoripngd: Cleanup memory on shutdown
Donald Sharp [Sun, 12 Nov 2023 03:56:16 +0000 (22:56 -0500)]
ripngd: Cleanup memory on shutdown

a) routemap data was not being cleaned up
b) ripng data structure was not being cleaned up

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
17 months agoripd: Cleanup memory on shutdown
Donald Sharp [Sun, 12 Nov 2023 03:55:00 +0000 (22:55 -0500)]
ripd: Cleanup memory on shutdown

a) routemap data was not being cleaned up
b) rip data structure was not being cleaned up

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
17 months agobabeld: Cleanup vrf data structures on shutdown
Donald Sharp [Sun, 12 Nov 2023 03:53:50 +0000 (22:53 -0500)]
babeld: Cleanup vrf data structures on shutdown

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
17 months agosharpd: Clean up memory leaks on shutdown
Donald Sharp [Sun, 12 Nov 2023 01:31:55 +0000 (20:31 -0500)]
sharpd: Clean up memory leaks on shutdown

a) The cleanup of zclient on shutdown was not being
done
b) Cleanup vrf shutdown
c) Cleanup some lists

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
sharpd: Cleanup shutdown of vrf and some lists

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
17 months agopbrd: Cleanup zclient on shutdown
Donald Sharp [Sun, 12 Nov 2023 01:13:00 +0000 (20:13 -0500)]
pbrd: Cleanup zclient on shutdown

For some reason pbrd had no shutdown code for zclient.
Now it does.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
17 months agoMerge pull request #14772 from LabNConsulting/fix-darr-memory-acct
Igor Ryzhov [Mon, 13 Nov 2023 03:47:36 +0000 (05:47 +0200)]
Merge pull request #14772 from LabNConsulting/fix-darr-memory-acct

17 months agoMerge pull request #14771 from LabNConsulting/fix-mgmtd-client-memleaks
Igor Ryzhov [Sun, 12 Nov 2023 18:46:04 +0000 (20:46 +0200)]
Merge pull request #14771 from LabNConsulting/fix-mgmtd-client-memleaks

lib: mgmtd: fix debug cli commands and memleaks

17 months agolib, mgmtd: respect base xpath in mgmtd 14768/head
Igor Ryzhov [Sat, 11 Nov 2023 00:13:17 +0000 (02:13 +0200)]
lib, mgmtd: respect base xpath in mgmtd

`nb_cli_apply_changes` can be called with base xpath which should be
prepended to xpaths of every change in a transaction. This base xpath is
respected by regular northbound CLI but not by mgmtd. This commit fixes
the problem.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
17 months agoMerge pull request #14767 from idryzhov/fix-change-value-free
Donatas Abraitis [Sun, 12 Nov 2023 18:16:19 +0000 (20:16 +0200)]
Merge pull request #14767 from idryzhov/fix-change-value-free

lib: fix possible freeing of libyang data

17 months agoMerge pull request #14774 from idryzhov/bgp-snmp-fix-build
Donatas Abraitis [Sun, 12 Nov 2023 09:06:39 +0000 (10:06 +0100)]
Merge pull request #14774 from idryzhov/bgp-snmp-fix-build

bgpd: fix build error

17 months agobgpd: fix build error 14774/head
Igor Ryzhov [Sun, 12 Nov 2023 00:57:25 +0000 (02:57 +0200)]
bgpd: fix build error

I recieve the following error with GCC 9.4.0:
```
In file included from /usr/include/string.h:495,
                 from ./lib/zebra.h:23,
                 from bgpd/bgp_snmp_bgp4v2.c:7:
In function ‘memset’,
    inlined from ‘bgp4v2PathAttrLookup’ at bgpd/bgp_snmp_bgp4v2.c:605:3,
    inlined from ‘bgp4v2PathAttrTable’ at bgpd/bgp_snmp_bgp4v2.c:747:9:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:71:10: error: ‘__builtin_memset’ offset [9, 20] from the object at ‘paddr’ is out of the bounds of referenced subobject ‘_v4_addr’ with type ‘struct in_addr’ at offset 4 [-Werror=array-bounds]
   71 |   return __builtin___memset_chk (__dest, __ch, __len, __bos0 (__dest));
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
17 months agoMerge pull request #14773 from LabNConsulting/fix-log-vty-memleak
Donald Sharp [Sat, 11 Nov 2023 23:25:04 +0000 (18:25 -0500)]
Merge pull request #14773 from LabNConsulting/fix-log-vty-memleak

lib: free the log file resources created at startup and config

17 months agotools: suppress some reachable external lib "leaks" 14771/head
Christian Hopps [Sat, 11 Nov 2023 19:56:26 +0000 (20:56 +0100)]
tools: suppress some reachable external lib "leaks"

- These are just normal reachable allocs from inside external library code;
however, when running valgrind with memleak types "all" in order to find FRR
specific leaks (from memory.h) these are the only other reported leaks. Makes
easier checking and fixing.

Signed-off-by: Christian Hopps <chopps@labn.net>
17 months agolib: free the log file resources created at startup and config 14773/head
Christian Hopps [Sat, 11 Nov 2023 19:31:13 +0000 (20:31 +0100)]
lib: free the log file resources created at startup and config

Signed-off-by: Christian Hopps <chopps@labn.net>
17 months agolib: darr needs to use memory.h for both alloc and free 14772/head
Christian Hopps [Sat, 11 Nov 2023 19:27:22 +0000 (20:27 +0100)]
lib: darr needs to use memory.h for both alloc and free

Was using XREALLOC() and then free(). instant "memleaks".

Signed-off-by: Christian Hopps <chopps@labn.net>
17 months agolib: mgmtd: fix debug cli commands and memleaks
Christian Hopps [Sat, 11 Nov 2023 18:21:17 +0000 (19:21 +0100)]
lib: mgmtd: fix debug cli commands and memleaks

- Cannot have 2 cmd_node's with same .node number. Install the mgmtd
client library debug nodes (client frontend and client backend) using
new unique node numbers. Fixes memleaks.

- Fix "debug mgmt client backend" to generate correct config (and not
for frontend).

Signed-off-by: Christian Hopps <chopps@labn.net>
17 months agoMerge pull request #14766 from cscarpitta/fix/fix-missing-debug-guard
Donatas Abraitis [Sat, 11 Nov 2023 17:23:19 +0000 (18:23 +0100)]
Merge pull request #14766 from cscarpitta/fix/fix-missing-debug-guard

bgpd: Add missing guard for `zlog_debug`

17 months agolib: fix possible freeing of libyang data 14767/head
Igor Ryzhov [Sat, 11 Nov 2023 00:06:11 +0000 (02:06 +0200)]
lib: fix possible freeing of libyang data

mgmtd frees all non-NULL change->value variables at the end of every
commit. We shouldn't assign change->value with data returned by libyang
to prevent freeing of library-allocated memory.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
17 months agobgpd: Add guard for `zlog_debug` 14766/head
Carmine Scarpitta [Fri, 10 Nov 2023 21:31:09 +0000 (22:31 +0100)]
bgpd: Add guard for `zlog_debug`

Add guard for `zlog_debug` when bgpd is not connected to zebra
or zebra does not know the bgp instance.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
17 months agozebra: Support to listen teamd nlmsg as bond type 14712/head
yenlu [Wed, 1 Nov 2023 22:22:08 +0000 (15:22 -0700)]
zebra: Support to listen teamd nlmsg as bond type

this feature is to support teamd driver when configuring
ethernet segment's id and sys_mac via vtysh/zebra.

Signed-off-by: yenlu <yenlu@cisco.com>
17 months agoMerge pull request #14758 from LabNConsulting/fix-mgmtd-coverity
Donald Sharp [Thu, 9 Nov 2023 13:20:37 +0000 (08:20 -0500)]
Merge pull request #14758 from LabNConsulting/fix-mgmtd-coverity

mgmtd: get rid of unused init value to fix coverity warning

17 months agoMerge pull request #14751 from opensourcerouting/fix/soft_version_cap_received_fix
Donald Sharp [Thu, 9 Nov 2023 12:38:16 +0000 (07:38 -0500)]
Merge pull request #14751 from opensourcerouting/fix/soft_version_cap_received_fix

bgpd: Software capability nits

17 months agoMerge pull request #14756 from opensourcerouting/fix/bgpd_dynamic_cap_addpath_topotest
Donald Sharp [Thu, 9 Nov 2023 12:37:26 +0000 (07:37 -0500)]
Merge pull request #14756 from opensourcerouting/fix/bgpd_dynamic_cap_addpath_topotest

tests: Check received prefixes before immediately sending dynamic capabilities

17 months agoMerge pull request #14727 from fdumontet6WIND/bgp4v2_snmp
Donatas Abraitis [Thu, 9 Nov 2023 09:20:33 +0000 (10:20 +0100)]
Merge pull request #14727 from fdumontet6WIND/bgp4v2_snmp

bgpd: fix bgp4v2 MIB NLRI INDEX format and order

17 months agomgmtd: get rid of unused init value to fix coverity warning 14758/head
Christian Hopps [Thu, 9 Nov 2023 02:27:29 +0000 (21:27 -0500)]
mgmtd: get rid of unused init value to fix coverity warning

Signed-off-by: Christian Hopps <chopps@labn.net>
17 months agolib: Modify event system to treat fd access more fairly 14725/head
Donald Sharp [Thu, 2 Nov 2023 20:46:27 +0000 (16:46 -0400)]
lib: Modify event system to treat fd access more fairly

Keep track of the last starting spot of where fd's were
being handled for read operations.  Modify the io read
handler to cycle through the list of fd's that need
to be handled such that fd's at the front do not take
precedence for being handled all the time.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
17 months agolib: Create a helper function for io read operations
Donald Sharp [Thu, 2 Nov 2023 16:02:43 +0000 (12:02 -0400)]
lib: Create a helper function for io read operations

Currently when io is ready inside of the event system
the first FD received is always preferred as the ones
that are handled first.  This leads to results where
events associated with these first FD's are always handled
first.

In anticipation of a change to make this more fair
let's abstract the function handler.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
17 months agotests: take into account fix for NLRI Index 14727/head
Francois Dumontet [Fri, 3 Nov 2023 09:46:40 +0000 (10:46 +0100)]
tests: take into account fix for NLRI Index

Signed-off-by: Francois Dumontet <francois.dumontet@6wind.com>
17 months agobgp: fix bgp4v2 MIB NLRI INDEX format and order
Francois Dumontet [Fri, 29 Sep 2023 13:23:24 +0000 (15:23 +0200)]
bgp: fix bgp4v2 MIB NLRI INDEX format and order

With a BGP configuration with ipv4 peering, and ipv6 peering, an snmpwalk
is stopped while walking over the bgp4v2NlriTable

snmpwalk -c TEST -v2c -On -Ln 1.1.1.2 .1.3.6.1.3.5.1.1.4

[...]
.1.3.6.1.3.5.1.1.4.1.2.1.2.32.0.0.0.0.0.0.0.0.0.0.0.0.0.0.1 = Gauge32: 13380
.1.3.6.1.3.5.1.1.9.1.1.1.1.1.1.1.0.24.0.0.0.0 = Gauge32: 0
.1.3.6.1.3.5.1.1.9.1.1.1.1.1.1.1.0.24.0.0.0.0 = Gauge32: 0
 >= .1.3.6.1.3.5.1.1.9.1.1.1.1.1.1.1.0.24.0.0.0.0

The walk stopped because the index used in the NlriTable entries is
decrementing, and this is against the snmp specifications. Also, the
computed index is wrong, and does not match the provided
draft-ietf-idr-bgp4-mibv2-1 specification.

Fix this by computing a valid index, and by finding out the next
consecutive prefix.
The resulting changes do not break the walk, and the output is changed:

root@dut-vm:~# snmpwalk -v 2c -c public -Ln -On localhost 1.3.6.1.3.5.1.1.9.1
.1.3.6.1.3.5.1.1.9.1.1.1.1.1.1.10.200.0.0.24.1.10.125.0.2.1 = Gauge32: 0
.1.3.6.1.3.5.1.1.9.1.1.1.1.1.1.10.244.0.0.24.1.10.125.0.2.1 = Gauge32: 0
.1.3.6.1.3.5.1.1.9.1.2.1.1.1.1.10.200.0.0.24.1.10.125.0.2.1 = INTEGER: 1
.1.3.6.1.3.5.1.1.9.1.2.1.1.1.1.10.244.0.0.24.1.10.125.0.2.1 = INTEGER: 1
.1.3.6.1.3.5.1.1.9.1.3.1.1.1.1.10.200.0.0.24.1.10.125.0.2.1 = INTEGER: 1
.1.3.6.1.3.5.1.1.9.1.3.1.1.1.1.10.244.0.0.24.1.10.125.0.2.1 = INTEGER: 1
.1.3.6.1.3.5.1.1.9.1.4.1.1.1.1.10.200.0.0.24.1.10.125.0.2.1 = INTEGER: 1
.1.3.6.1.3.5.1.1.9.1.4.1.1.1.1.10.244.0.0.24.1.10.125.0.2.1 = INTEGER: 1
.1.3.6.1.3.5.1.1.9.1.5.1.1.1.1.10.200.0.0.24.1.10.125.0.2.1 = Hex-STRING: 0A C8 00 00
.1.3.6.1.3.5.1.1.9.1.5.1.1.1.1.10.244.0.0.24.1.10.125.0.2.1 = Hex-STRING: 0A F4 00 00

Fixes: c681e937d7ae8904f748819fce37498ce0ea8f7d (bgpd: Implement SNMP
BGP4V2-MIB (bgp4V2NlriTable), part 1)
Fixes: 2ce69011c4199bead8172b5ee7e63485e2f861c8 (bgpd: Implement SNMP
BGP4V2-MIB (bgp4V2NlriTable), part 2)

Signed-off-by: Francois Dumontet <francois.dumontet@6wind.com>
17 months agotests: Check received prefixes before immediately sending dynamic capabilities 14756/head
Donatas Abraitis [Wed, 8 Nov 2023 14:36:07 +0000 (16:36 +0200)]
tests: Check received prefixes before immediately sending dynamic capabilities

If we send capabilities immediately, before receiving an UPDATE message, we end up
with a notification received from the neighbor. Let's wait until we have the fully
converged topology and do the stuff.

Tested locally and can't replicate the failure, let's see how happy is the CI this time.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
17 months agoMerge pull request #14525 from LabNConsulting/chopps/mgmtd-simplify-xpaths
Igor Ryzhov [Wed, 8 Nov 2023 14:30:46 +0000 (16:30 +0200)]
Merge pull request #14525 from LabNConsulting/chopps/mgmtd-simplify-xpaths

chopps/mgmtd simplify xpaths

17 months agoMerge pull request #14544 from idryzhov/mgmt-scratch-buffer
Donald Sharp [Wed, 8 Nov 2023 14:18:27 +0000 (09:18 -0500)]
Merge pull request #14544 from idryzhov/mgmt-scratch-buffer

mgmt: delete candidate scratch buffer

17 months agoMerge pull request #14743 from idryzhov/mgmtd-local-validation
Donald Sharp [Wed, 8 Nov 2023 13:49:01 +0000 (08:49 -0500)]
Merge pull request #14743 from idryzhov/mgmtd-local-validation

mgmtd: fix local validation

17 months agobgpd: Send software version capability for OAD EBGP peers 14751/head
Donatas Abraitis [Wed, 8 Nov 2023 13:29:32 +0000 (15:29 +0200)]
bgpd: Send software version capability for OAD EBGP peers

We send this capability for iBGP peers by default. Recently OAD support was
merged, and we should adopt sending the capability according to OAD as well.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
17 months agobgpd: Set the software version capability received flag only after a validation
Donatas Abraitis [Wed, 8 Nov 2023 13:26:40 +0000 (15:26 +0200)]
bgpd: Set the software version capability received flag only after a validation

We shouldn't set it blindly once the packet is received, but first we have to
do some sanity checks.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
17 months agoMerge pull request #14741 from donaldsharp/zebra_h_cleanup
Donatas Abraitis [Wed, 8 Nov 2023 08:03:00 +0000 (09:03 +0100)]
Merge pull request #14741 from donaldsharp/zebra_h_cleanup

Zebra h cleanup

17 months agoMerge pull request #14746 from LabNConsulting/valgrind-leak-kinds
Donatas Abraitis [Wed, 8 Nov 2023 08:01:02 +0000 (09:01 +0100)]
Merge pull request #14746 from LabNConsulting/valgrind-leak-kinds

tests: add ability to show all types of valgrind memleaks

17 months agotests: add ability to show all types of valgrind memleaks 14746/head
Christian Hopps [Tue, 7 Nov 2023 20:27:33 +0000 (15:27 -0500)]
tests: add ability to show all types of valgrind memleaks

Signed-off-by: Christian Hopps <chopps@labn.net>
17 months agoMerge pull request #14698 from opensourcerouting/fix/remove_static_arp_entries_on_ifd...
Russ White [Tue, 7 Nov 2023 14:40:01 +0000 (09:40 -0500)]
Merge pull request #14698 from opensourcerouting/fix/remove_static_arp_entries_on_ifdown_events

zebra: Remove static ARP entries on interface down events

17 months ago*: Move distance related defines into their own header 14741/head
Donald Sharp [Sat, 4 Nov 2023 08:47:46 +0000 (08:47 +0000)]
*: Move distance related defines into their own header

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
17 months ago*: Remove APPLE #defines from build
Donald Sharp [Sat, 4 Nov 2023 08:30:31 +0000 (08:30 +0000)]
*: Remove APPLE #defines from build

We cannot build on apple machines at all due
to our usage of some gcc extensions that will
probably never see the light of day again.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
17 months ago*: Remove netlink headers from lib/zebra.h
Donald Sharp [Sat, 4 Nov 2023 08:15:54 +0000 (08:15 +0000)]
*: Remove netlink headers from lib/zebra.h

The headers associated with netlink code
really only belong in those that need it.
Move these headers out of lib/zebra.h and
into more appropriate places.  bgp's usage
of the RT_TABLE_XXX defines are probably not
appropriate and will be cleaned up in future
commits.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
17 months agomgmtd: fix local validation 14743/head
Igor Ryzhov [Tue, 7 Nov 2023 01:40:26 +0000 (03:40 +0200)]
mgmtd: fix local validation

When validating the config, we shouldn't also validate state.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
17 months agotools: checkpatch updated with darr_foreach iter macros 14525/head
Christian Hopps [Tue, 24 Oct 2023 18:58:11 +0000 (14:58 -0400)]
tools: checkpatch updated with darr_foreach iter macros

Also update `checkpatch.sh` so it runs `checkpatch.pl` from the same directory
it resides in. This allows copying them both somewhere else to use a specific
version.

Signed-off-by: Christian Hopps <chopps@labn.net>
17 months agolib: yang: restore old API use now that it's fixed
Christian Hopps [Sun, 9 Jul 2023 20:55:10 +0000 (16:55 -0400)]
lib: yang: restore old API use now that it's fixed

This also avoids a bug in the workaround function if the set variable
wasn't set to NULL the Debug version of libyang would sigsegv.

Signed-off-by: Christian Hopps <chopps@labn.net>
17 months agomgmtd: simplify xpath registries
Christian Hopps [Sun, 9 Jul 2023 03:11:15 +0000 (23:11 -0400)]
mgmtd: simplify xpath registries

- move from client id indexed array of uints for register info
  per client to a u64 bitmask.
- add bit walking FOREACH macro

Walk the client IDs whose bits are set in a mask.

Signed-off-by: Christian Hopps <chopps@labn.net>
17 months agoMerge pull request #14729 from donaldsharp/v6_rr_semantics_zrouter
Donatas Abraitis [Mon, 6 Nov 2023 21:00:50 +0000 (23:00 +0200)]
Merge pull request #14729 from donaldsharp/v6_rr_semantics_zrouter

V6 rr semantics zrouter

17 months agoMerge pull request #14742 from FRRouting/revert-14648-import_no_no_no
Mark Stapp [Mon, 6 Nov 2023 15:38:06 +0000 (10:38 -0500)]
Merge pull request #14742 from FRRouting/revert-14648-import_no_no_no

Revert "bgpd: combine import_check_table and nexthop_check_table"

17 months agoRevert "bgpd: combine import_check_table and nexthop_check_table" 14742/head
Donald Sharp [Mon, 6 Nov 2023 15:07:58 +0000 (10:07 -0500)]
Revert "bgpd: combine import_check_table and nexthop_check_table"

17 months agozebra: When using Nexthop groups, use v6 RR semantics 14729/head
Donald Sharp [Mon, 6 Nov 2023 13:56:50 +0000 (08:56 -0500)]
zebra: When using Nexthop groups, use v6 RR semantics

The nexthop group route replace operation was made consistent
across all versions of the kernel.  A v6 route replacement
does not need to do a delete than add when using nexthop
groups

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
17 months agozebra: Move v6_rr_semantics to be part of zrouter structure
Donald Sharp [Fri, 3 Nov 2023 16:58:42 +0000 (16:58 +0000)]
zebra: Move v6_rr_semantics to be part of zrouter structure

Move global variable v6_rr_semantics from a global data structure
into the zrouter data structure.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
17 months agozebra: Add v6_rr_semantics status to `show zebra`
Donald Sharp [Fri, 3 Nov 2023 16:35:45 +0000 (16:35 +0000)]
zebra: Add v6_rr_semantics status to `show zebra`

The v6_rr_semantics variable was being set but never
reported and had to be inferred from watching netlink
messages to the kernel.  Let's add a bit of code
to `show zebra` so that we can know how it is being
used.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
17 months agoMerge pull request #14730 from opensourcerouting/fix/doc_releases
Donald Sharp [Mon, 6 Nov 2023 13:11:03 +0000 (08:11 -0500)]
Merge pull request #14730 from opensourcerouting/fix/doc_releases

doc: Add a quick example on how to use release_notes.py

17 months agoMerge pull request #14734 from opensourcerouting/fix/add_missing_documentation_for_co...
Donald Sharp [Mon, 6 Nov 2023 13:10:45 +0000 (08:10 -0500)]
Merge pull request #14734 from opensourcerouting/fix/add_missing_documentation_for_community_any

doc: Add missing match community exact-match/any

17 months agoMerge pull request #14736 from opensourcerouting/transparent-sockunion
Donald Sharp [Mon, 6 Nov 2023 13:09:48 +0000 (08:09 -0500)]
Merge pull request #14736 from opensourcerouting/transparent-sockunion

lib: create a transparent union `sockunion`

17 months agozebra: Remove static ARP entries on interface down events 14698/head
Donatas Abraitis [Tue, 31 Oct 2023 15:09:48 +0000 (17:09 +0200)]
zebra: Remove static ARP entries on interface down events

Without this patch, static ARP entries remain active even if the interface is
down, but the kernel already removed them.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
17 months agoMerge pull request #14726 from cscarpitta/fix/fix-openfabric-crash
Igor Ryzhov [Sun, 5 Nov 2023 21:39:14 +0000 (23:39 +0200)]
Merge pull request #14726 from cscarpitta/fix/fix-openfabric-crash

isisd: Fix crash when enabling OpenFabric on an interface

17 months agolib: add a transparent union for sockaddrs 14736/head
David Lamparter [Wed, 30 Nov 2022 10:19:14 +0000 (11:19 +0100)]
lib: add a transparent union for sockaddrs

As with "prefixptr"/"prefixconstptr", this allows function prototypes to
say "just give me any sockaddr" typing-wise, without having the compiler
complain that a "struct sockaddr_in" is not a "struct sockaddr".

(Split off from other changes that start using this.)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
17 months agolib: rename `prefixtype` to `uniontype`
David Lamparter [Sun, 5 Nov 2023 17:16:54 +0000 (18:16 +0100)]
lib: rename `prefixtype` to `uniontype`

About to use this for sockunion, which is not a prefix.  `uniontype`
makes more sense, the macros are for defining transparent unions after
all.

(clang-format off thrown in as it otherwise wrecks formatting.)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
17 months agodoc: Add missing match community exact-match/any 14734/head
Donatas Abraitis [Sun, 5 Nov 2023 06:31:05 +0000 (08:31 +0200)]
doc: Add missing match community exact-match/any

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
17 months agodoc: Add a quick example on how to use release_notes.py 14730/head
Donatas Abraitis [Sat, 4 Nov 2023 14:32:01 +0000 (16:32 +0200)]
doc: Add a quick example on how to use release_notes.py

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
17 months agoMerge pull request #14724 from donaldsharp/workqueue_cleanup
Donatas Abraitis [Sat, 4 Nov 2023 11:58:55 +0000 (13:58 +0200)]
Merge pull request #14724 from donaldsharp/workqueue_cleanup

Workqueue cleanup

17 months agotests: extend the bmp test to support bmp loc-rib 11800/head
Farid MIHOUB [Fri, 11 Aug 2023 14:18:17 +0000 (16:18 +0200)]
tests: extend the bmp test to support bmp loc-rib

Configure the bmp monitor unicast loc-rib.
Check the logging messages for the updated/withdrawn prefixes with
the presence of the loc-rib peer-type.

Signed-off-by: Farid MIHOUB <farid.mihoub@6wind.com>
17 months agotests: rework bmp policy message logging
Farid MIHOUB [Fri, 11 Aug 2023 14:11:03 +0000 (16:11 +0200)]
tests: rework bmp policy message logging

Add "policy" field to the logged bmp messages so policy checks within
topotests would be easier and clearer.

Signed-off-by: Farid MIHOUB <farid.mihoub@6wind.com>
17 months agobgpd: bmp unset v6 flag + address PR#14188 comments
Maxence Younsi [Mon, 11 Sep 2023 12:51:45 +0000 (14:51 +0200)]
bgpd: bmp unset v6 flag + address PR#14188 comments

use CHECK_FLAG
fix comment spaces
change zlog_debug to zlog_warn
safeguard on updated_route
added doc/developer/bmp.rst to subdir.am
other qol changes

Signed-off-by: Maxence Younsi <mx.yns@outlook.fr>
17 months agobgpd: skip bmp messages when vrf id is unknown
Maxence Younsi [Mon, 6 Feb 2023 16:30:28 +0000 (17:30 +0100)]
bgpd: skip bmp messages when vrf id is unknown

changed result type of bmp_get_peer_distinguisher to int
added result pointer parameter to bmp_get_peer_distinguisher
bmp_get_peer_distinguisher returns 0 means the result is valid else
  error occured do not use result

Signed-off-by: Maxence Younsi <mx.yns@outlook.fr>
17 months agobgpd: loc-rib uptime moved to bgp_path_info_extra and set in header
mxyns [Wed, 28 Sep 2022 06:05:25 +0000 (08:05 +0200)]
bgpd: loc-rib uptime moved to bgp_path_info_extra and set in header

moved loc-rib uptime field "bgp_rib_uptime" to struct bgp_path_info_extra for memory concerns
moved logic into bgp_route_update's callback bmp_route_update
written timestamp in per peer header

Signed-off-by: Maxence Younsi <mx.yns@outlook.fr>
17 months agobgpd: applied styling and fixed warnings
mxyns [Fri, 12 Aug 2022 16:00:38 +0000 (18:00 +0200)]
bgpd: applied styling and fixed warnings

frrbot found style &/| linter errors
fixed bmp_process_one return value warnings and added safety checks
fixed const modifier warning in bmp_put_vrftablename_info_tlv
added unused attribute to bmp_put_vrftablename_info_tlv
remove unused variables in bmp_process_one and bmp_route_update

Signed-off-by: Maxence Younsi <mx.yns@outlook.fr>
17 months agobgpd: bmp locrib monitoring unlock node after lookup
Maxou [Fri, 12 Aug 2022 14:45:05 +0000 (16:45 +0200)]
bgpd: bmp locrib monitoring unlock node after lookup

bgp_afi_node_lookup calls bgp_node_lookup which locks the node, unlocking it safely after function is finished

Signed-off-by: Maxence Younsi <mx.yns@outlook.fr>
17 months agobgpd: Update bmp.rst documentation
Maxou [Mon, 8 Aug 2022 18:34:45 +0000 (20:34 +0200)]
bgpd: Update bmp.rst documentation

added documentation for the current state of the bmp implementation

Signed-off-by: Maxence Younsi <mx.yns@outlook.fr>
17 months agobgpd: refactored bmp_route_update & cleanup TODOs
Maxou [Mon, 8 Aug 2022 12:32:38 +0000 (14:32 +0200)]
bgpd: refactored bmp_route_update & cleanup TODOs

TODOs that are done/un-necessary now deleted
refactored bmp_route_update to use a modified bmp_process_one function call instead of duplicating similar code

Signed-off-by: Maxence Younsi <mx.yns@outlook.fr>
17 months agobgpd: removed temporary dev logs
Maxou [Mon, 8 Aug 2022 11:44:24 +0000 (13:44 +0200)]
bgpd: removed temporary dev logs

dev logs cleanup

Signed-off-by: Maxence Younsi <mx.yns@outlook.fr>
17 months agobgpd: cleanup bmp_get_peer_distinguisher function
Maxou [Mon, 8 Aug 2022 11:39:17 +0000 (13:39 +0200)]
bgpd: cleanup bmp_get_peer_distinguisher function

cleaner implementation and use of the new get peer distinguisher function
can be now used for other cases of RFC7854 that are not supported atm

Signed-off-by: Maxence Younsi <mx.yns@outlook.fr>
17 months agobgpd: beginning to add rib_uptime field for loc-rib timestamp
mxyns [Fri, 29 Jul 2022 18:06:08 +0000 (20:06 +0200)]
bgpd: beginning to add rib_uptime field for loc-rib timestamp

added time_t field to bgp_path_info
set value before bgp dp hook is called
value not set in the msg yet, testing and double checking is needed before

Signed-off-by: Maxence Younsi <mx.yns@outlook.fr>
17 months agobgpd: temporary set timestamp to 0 for loc rib monitoring messages
mxyns [Fri, 29 Jul 2022 15:41:30 +0000 (17:41 +0200)]
bgpd: temporary set timestamp to 0 for loc rib monitoring messages

set timestamp to 0 for loc rib monitoring messages as path selection time is not available atm
this is temporary and tv is meant to be set to the path selection/install time at some point

Signed-off-by: Maxence Younsi <mx.yns@outlook.fr>
17 months agobgpd: bmp loc-rib end-of-rib message add peer distinguisher
mxyns [Thu, 28 Jul 2022 16:54:10 +0000 (18:54 +0200)]
bgpd: bmp loc-rib end-of-rib message add peer distinguisher

added peer distinguisher for BMP_PEER_TYPE_LOC_RIB_INSTANCE in bmp_eor

Signed-off-by: Maxence Younsi <mx.yns@outlook.fr>
17 months agobgpd: safer vrf/table name (RFC9069) info tlv
mxyns [Thu, 28 Jul 2022 16:23:14 +0000 (18:23 +0200)]
bgpd: safer vrf/table name (RFC9069) info tlv

vrf_id_to_name is used for display values only and returns "Unknown" when the vrf is not found
doing a manual lookup and not providing any tlv when the vrf is not found should be better

Signed-off-by: Maxence Younsi <mx.yns@outlook.fr>
17 months agobgpd: bmp loc-rib RFC9069 compliant monitoring messages
mxyns [Thu, 28 Jul 2022 14:11:47 +0000 (16:11 +0200)]
bgpd: bmp loc-rib RFC9069 compliant monitoring messages

set field peer bgp id to the peer's remote id in every case except loc-rib (RFC9069 case) in which we put the bgp instance's router-id if available or 0-filled if not available
set field peer asn to local primary bgp asn in case of loc-rib instance (RFC9069) else it's set to the peer's asn
set field peer address to 0 in loc-rib instance (RFC9069 case) and to the peer's address in other cases
had to pass struct bgp reference to bmp_per_peer_hdr to access router-id and such, but it's always safely accessed when used

Signed-off-by: Maxence Younsi <mx.yns@outlook.fr>
17 months agobgpd: bmp set peer distinguisher with RD
mxyns [Wed, 27 Jul 2022 18:40:13 +0000 (20:40 +0200)]
bgpd: bmp set peer distinguisher with RD

peer distinguisher set to vrf RD if there is one or to vrf_id if in a vrf
set to 0 if in default vrf

Signed-off-by: Maxence Younsi <mx.yns@outlook.fr>
17 months agobgpd: bmp afi/safi sync for loc-rib
mxyns [Wed, 27 Jul 2022 15:56:00 +0000 (17:56 +0200)]
bgpd: bmp afi/safi sync for loc-rib

added afi/safi monitoring synchronisation for loc-rib
added peer_type_flag to bmp_eor signature, only set to BMP_PEER_TYPE_LOC_RIB and to 0 in other cases like it was before
updated tracelog to include peer_type_flag value

Signed-off-by: Maxence Younsi <mx.yns@outlook.fr>
17 months agobgpd: fixed bmp vpnv4 monitoring withdraws instead of updates
mxyns [Tue, 26 Jul 2022 16:15:17 +0000 (18:15 +0200)]
bgpd: fixed bmp vpnv4 monitoring withdraws instead of updates

vpnv4 monitoring always sends withdraws bc of wrong lookup call, fixes this

Signed-off-by: Maxence Younsi <mx.yns@outlook.fr>