Commit Graph

37380 Commits

Author SHA1 Message Date
Donald Sharp
847d74a5b0
Merge pull request #16558 from nabahr/pim_doc
doc: Fix up pim user docs.
2024-08-13 08:47:27 -04:00
Donatas Abraitis
b4e4fb476a
Merge pull request #16557 from donaldsharp/pathd_shutdown_memory_leaks
pathd: Cleanup shutdown memory leaks
2024-08-12 23:45:32 +03:00
Donatas Abraitis
74333790e3
Merge pull request #16555 from donaldsharp/agentx_event_leak
lib: Fix memory leak in snmp on shutdown
2024-08-12 23:45:14 +03:00
Nathan Bahr
33ce5d2410 doc: Fix up pim user docs.
Signed-off-by: Nathan Bahr <nbahr@atcorp.com>
2024-08-12 18:48:02 +00:00
Donald Sharp
1563d9f9c8 tests: Fix bgp_duplicate_nexthop python warning
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-08-12 13:55:26 -04:00
Donald Sharp
c4fdc837c0
Merge pull request #16534 from opensourcerouting/fix/start_ldpd_if_unified
doc: Document on how to start specific daemons with unified config in topotests
2024-08-12 10:25:54 -04:00
Donald Sharp
33af3c0278 pathd: Cleanup shutdown memory leaks
Just some code to cleanup the shutdown memory leaks
that are in pathd.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-08-12 10:14:31 -04:00
Donald Sharp
b8b38a593c lib: Fix memory leak in snmp on shutdown
The events list is storing a `struct event *` allocated
as a MTYPE_TMP pointer, on shutdown ensure that it is
properly free'd up.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-08-12 08:51:19 -04:00
Donatas Abraitis
cc0fdd3b1d
Merge pull request #16439 from louis-6wind/fix-ipv4-mapped-ipv6
bgpd: fixes for ipv4 mapped ipv6 address
2024-08-12 15:37:36 +03:00
Donatas Abraitis
4e208087fd
Merge pull request #16545 from mjstapp/fix_isis_threeway
isisd: fix memory handling in isis_adj_process_threeway()
2024-08-12 09:39:45 +03:00
Donatas Abraitis
1d5f0a2beb
Merge pull request #16556 from donaldsharp/mgmt_ignore
mgmtd: Add to .gitignore for mgmtd_testc program
2024-08-12 09:39:22 +03:00
Donatas Abraitis
8c936d44d0
Merge pull request #16420 from pguibert6WIND/trap_rfc4382
bgpd: add bgp snmp traps rfc4382 command
2024-08-12 09:38:58 +03:00
Donatas Abraitis
263eb6d141
Merge pull request #16554 from donaldsharp/zebra_ensure_no_use_after_free
zebra: Ensure non-equal id's are not same nhg's
2024-08-12 07:59:42 +03:00
Philippe Guibert
d95f9a35d4 bgpd, doc: add bgp snmp traps rfc4382 command
Add a trap command to disable or enable the traps defined by
the RFC4382.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2024-08-11 19:28:50 +00:00
Donatas Abraitis
4ace11d010 bgpd: Move evpn_overlay to a pointer
Before this convertion:

```
	/* --- cacheline 3 boundary (192 bytes) --- */
	struct bgp_attr_encap_subtlv * encap_subtlvs;    /*   192     8 */
	struct bgp_attr_encap_subtlv * vnc_subtlvs;      /*   200     8 */
	struct bgp_route_evpn      evpn_overlay;         /*   208    36 */
```

After this convertion:

```
	/* --- cacheline 3 boundary (192 bytes) --- */
	struct bgp_attr_encap_subtlv * encap_subtlvs;    /*   192     8 */
	struct bgp_attr_encap_subtlv * vnc_subtlvs;      /*   200     8 */
	struct bgp_route_evpn *    evpn_overlay;         /*   208     8 */
```

Saving 28 bytes when EVPN is not used.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-08-11 13:59:13 +03:00
Donatas Abraitis
3901cfea23 doc: Document on how to run specific daemons with unified config in topotests
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-08-11 13:47:08 +03:00
Donatas Abraitis
79cbde8095 tests: Convert self.unified_config to boolean
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-08-11 13:32:11 +03:00
Donatas Abraitis
423e8076b5
Merge pull request #16542 from donaldsharp/vtysh_stupidly_large
lib: Don't print warning if not a daemon
2024-08-11 11:43:46 +03:00
Donald Sharp
0ec96ab525 mgmtd: Add to .gitignore for mgmtd_testc program
This program, mgmtd_testc, is built with the
--enable-mgmtd-test-be-client configure option
but it is not .gitignore'd.  Let's fix that

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-08-10 20:21:27 -04:00
Donald Sharp
3875588ece
Merge pull request #16548 from opensourcerouting/fix/reduce_attr_a_bit
Shrink a couple bytes of struct attr
2024-08-10 19:51:10 -04:00
Donald Sharp
c79599e497
Merge pull request #16551 from idryzhov/distrib-del
lib: fix distribute-list deletion
2024-08-10 19:50:26 -04:00
Donald Sharp
5a1b61aeba zebra: Ensure non-equal id's are not same nhg's
The function zebra_nhg_hash_equal is only used
as a hash function for storage of NHG's and retrieval.
If you have say two nhg's:

31 (25/26)
32 (25/26)

This function would return them as being equal.  Which
of course leads to the problem when you attempt to
hash_release 32 but release 31 from the hash.  Then later
when you attempt to do hash comparisons 32 has actually
been freed leaving to use after free situations and shit
goes down hill fast.

This hash is only used as part of the hash comparison
function for nexthop group storage.  Since this is so
let's always return the 31/32 nhg's are not equal at all.

We possibly have a different problem where we are creating
31 and 32 ( when 31 should have just been used instead of 32 )
but we need to prevent any type of hash release problem at all.
This supercedes any other issue( that should be tracked down
on it's own ).  Since you can have use after free situation
that leads to a crash -vs- some possible nexthop group duplication
which is very minor in comparison.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-08-10 19:49:35 -04:00
Christian Hopps
8cc83201fc
Merge pull request #16529 from idryzhov/fix-load-config
mgmtd: don't add implicit state data when reading config from file
2024-08-10 04:10:34 -04:00
Christian Hopps
64ac03c90b
Merge pull request #16511 from oplklum/master
Fix LYD_NEW_PATH_OUTPUT issue to support libyang v3.x
2024-08-10 03:46:11 -04:00
Lu.Mao
87c9060f90 lib: Fix LYD_NEW_PATH_OUTPUT issue to support libyang v3.x
Fix the LYD_NEW_PATH_OUTPUT undeclared error to support the latest libyang v3.x version,
and also compatible with old version.

Signed-off-by: Lu Mao <lu.mao@molex.com>
2024-08-09 17:32:37 -07:00
Igor Ryzhov
8fad4f317e lib: fix distribute-list deletion
When a whole distribute-list is deleted (can be done only using API),
all its children must be cleaned up manually.

Fixes #16538

Signed-off-by: Igor Ryzhov <idryzhov@gmail.com>
2024-08-10 01:36:15 +03:00
Donatas Abraitis
5c84cddab8 bgpd: Shrink rmap_change_flags to 2-bytes
4 bytes is not needed for this thing clearly.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-08-09 21:33:50 +03:00
Donatas Abraitis
8b66a236e8 bgpd: Reduce encap_tunneltype to 1 byte
It's not used as a bitmask, no point to use it as 2 bytes.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-08-09 21:33:46 +03:00
Mark Stapp
3eb7d16411 isisd: fix memory handling in isis_adj_process_threeway()
The adj_process_threeway() api may call the adj_state_change()
api, which may delete the adj struct being examined. Change the
signature so that callers pass a ptr-to-ptr so that they will
see that deletion.

Signed-off-by: Mark Stapp <mjs@cisco.com>
2024-08-09 10:08:21 -04:00
Donatas Abraitis
927be7a50e
Merge pull request #16539 from donaldsharp/tests_memory_shut
Tests memory shut
2024-08-09 13:30:30 +03:00
Donatas Abraitis
536d478049
Merge pull request #16535 from pguibert6WIND/srv6_nexthop_context
lib: add seg6localContext json attribute in nexthop information
2024-08-08 22:39:34 +03:00
Donald Sharp
cecf5716d5 lib: Don't print warning if not a daemon
vtysh will print out the `stupidly large FD limit` upon
every run of the program if the ulimit is set stupidly
large.  Prevent this from being displayed for vtysh.

Fixes: #16516
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-08-08 15:26:41 -04:00
Donald Sharp
7b8ca3e2ed
Merge pull request #16531 from idryzhov/fix-rip-show-distrib
ripd: fix show run output for distribute-list
2024-08-08 14:28:32 -04:00
Donald Sharp
208c53c90e isisd, lib: Cleanup linked list associated with snmp
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-08-08 14:24:59 -04:00
Donald Sharp
db986aded4 lib: Cleanup memory associated with modules on shutdown
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-08-08 14:24:59 -04:00
Donald Sharp
bc16c8ce8d isisd: Free up isis master list of instances
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-08-08 14:24:59 -04:00
Donald Sharp
2e7d915ca2 isisd: Cleanup leaked hash on shut in circuit
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-08-08 14:24:59 -04:00
Donald Sharp
b44972b65c isisd: Free up memory associated with rm/vrf's
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-08-08 14:24:59 -04:00
Donald Sharp
5891afb824 sharpd: Eliminate leaked list for locator-chunks
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-08-08 14:24:59 -04:00
Jafar Al-Gharaibeh
000ad7ff98
Merge pull request #16526 from opensourcerouting/fix/invalid_escape_chars_frr-reload.py
tools: Fix python string escape warnings for frr-reload.py
2024-08-08 12:31:48 -04:00
Donald Sharp
e7fd713afc
Merge pull request #16530 from idryzhov/fix-no-distrib-crash
lib: fix crash on distribute-list delete
2024-08-08 08:22:18 -04:00
Philippe Guibert
5d027fc791 lib: add seg6localContext json attribute in nexthop information
Some srv6 behaviors have a context attached that is visible if
no json is requested:

> # show ipv6 route
> [..]
> B>* 2001:db8:1:1:100::/128 [20/0] is directly connected, vrf10, seg6local End.DT6 table 10, weight 1, 00:00:14
> B>* 2001:db8:1:1:200::/128 [20/0] is directly connected, vrf20, seg6local End.DT6 table 20, weight 1, 00:00:14
>

The json does not dump this attribute:
> # show ipv6 route 2001:db8:1:1:100::/128 json
> [..]
>      "nexthops":[
>        {
>          "flags":3,
>          "fib":true,
>          "directlyConnected":true,
>          "interfaceIndex":6,
>          "interfaceName":"vrf10",
>          "active":true,
>          "weight":1,
>          "seg6local":{
>            "action":"End.DT6"
>          },
>        }
>

Add the json support for this.

>      "nexthops":[
>        {
>          "flags":3,
>          "fib":true,
>          "directlyConnected":true,
>          "interfaceIndex":6,
>          "interfaceName":"vrf10",
>          "active":true,
>          "weight":1,
>          "seg6local":{
>            "action":"End.DT6"
>          },
>          "seg6localContext":{
>            "table":10
>          }
>        }
>

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2024-08-08 11:36:01 +02:00
Donatas Abraitis
850076b3a1 tools: Fix python string escape warnings for frr-reload.py
When using a regex (or anything that uses `\?` escapes) in python, raw
strings (`r"content"`) should be used so python doesn't consume the
escapes itself.  Otherwise we get either broken behavior and/or
`SyntaxWarning: invalid escape sequence '\['`

Fixes: 8916953b53 ("build: fix a few python string escape warnings")
Fixes: https://github.com/FRRouting/frr/issues/16522

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-08-08 08:46:39 +03:00
Igor Ryzhov
25d94ec3ee ripd: fix show run output for distribute-list
CLI show callbacks should be defined in frr_ripd_cli_info instead of
frr_ripd_info, because only the former is loaded by mgmtd and only its
callbacks are getting called for config output.

Signed-off-by: Igor Ryzhov <idryzhov@gmail.com>
2024-08-08 01:25:02 +03:00
Igor Ryzhov
2b12d62e38 lib: fix crash on distribute-list delete
The destroy callback must be executed only once on APPLY stage.

Fixes #16528

Signed-off-by: Igor Ryzhov <idryzhov@gmail.com>
2024-08-08 01:17:11 +03:00
Donald Sharp
d304714697
Merge pull request #16525 from opensourcerouting/fix/remove_BGP_UPDATE_DELAY_MINMAX
bgpd: Remove BGP_UPDATE_DELAY_MIN/MAX
2024-08-07 18:10:56 -04:00
Igor Ryzhov
61e8d5e0b9 mgmtd: don't add implicit state data when reading config from file
When mgmt reads configuration from file, it shouldn't add implicit state
data to the candidate datastore. Configuration datastores like candidate
should never store state, otherwise they fail validation.

Fixes #15814

Signed-off-by: Igor Ryzhov <idryzhov@gmail.com>
2024-08-08 00:45:13 +03:00
Donald Sharp
d36ff6df2b
Merge pull request #16523 from LabNConsulting/chopps/fix-mgmt-rpc-test
tests: wait for test client to connect before running test
2024-08-07 13:27:39 -04:00
Donatas Abraitis
14b5c78d44 bgpd: Remove BGP_UPDATE_DELAY_MIN/MAX
Found randomly, and seems not used anymore.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-08-07 17:39:28 +03:00
Christian Hopps
2ee9f4d11f tests: wait for test client to connect before running test
Vtysh has been improved to startup very quickly this exposed a race in this
test, where the `clear ip rip...` command ran before the test client that
handles it had finished connecting to mgmtd. Add a retried check for the test
client being connected before issuing the `clear ip rip ...` test command.

Signed-off-by: Christian Hopps <chopps@labn.net>
2024-08-07 09:35:52 -04:00