Commit Graph

37593 Commits

Author SHA1 Message Date
Philippe Guibert
7da91a8fb9 topotests: bmp_collector, fix display peer distinguisher IP:AS2B
The peer distinguisher format was badly displayed when a per peer
header is sent with an IP:AS2B format.

>  {"peer_type": "loc-rib instance", "is_filtered": false, "policy": "loc-rib",
> "peer_distinguisher": "None:2", ...

The IP header is incorrectly read. Fix it.

> {"peer_type": "loc-rib instance", "is_filtered": false, "policy": "loc-rib",
> "peer_distinguisher": "3.3.3.5:2", ...

Fixes: 875511c466 ("topotests: add basic bmp collector")
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2024-12-30 15:13:38 +01:00
Philippe Guibert
69c6a41fd2 topotests: bgp_bmp, add peer up message test when router-id changes
Add a test to control the value of the peer bgp id of loc-rib peer up
messages when the bgp router-id is reconfigured.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2024-12-30 15:13:38 +01:00
Philippe Guibert
4052c18a42 bgpd: bmp, define hook for route distinguisher updates
At startup, if bmp loc-rib is enabled, the peer_id of the
loc-rib per peer header message has the route distinguisher set to 0:0.
Actually, the route distinguisher has been updated after the peer up
message is sent, and the information is not refreshed.

Create a hook API to handle route distinguisher config events: pre and
post configuration. Use that hook in BMP module to send peer down, and
peer up events when necessary.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2024-12-30 15:13:38 +01:00
Philippe Guibert
f3c17d94e0 bgpd: bmp, define hook for router-id updates
At startup, if bmp loc-rib is enabled, the peer_id of the
loc-rib per peer header message has the router-id set to 0.0.0.0.
Actually, the router-id has been updated after the peer up
message is sent, and the information is not refreshed.

Create a hook API to handle router id events: withdraw and
updates. Use that hook in BMP module to send peer down, and
peer up events when necessary.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2024-12-30 15:13:38 +01:00
Philippe Guibert
bb02fb186a bgpd: bmp_route_update, replace bgp_bmp_get with bgp_bmp_find
There is no need to create the bgp bmp instance, while there
is no bmp target to send data to.
Rewrite the code by using bgp_bmp_find() API instead.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2024-12-30 15:13:38 +01:00
Philippe Guibert
eb570f0a70 topotests: bgp_bmp, add a test to check for bgp vrf peer loc-rib message
Add a test where, when the vrf interface is flapping, a peer down and a
peer up message are sent. This test, when used with ASAN, detects the
memory leak of the open_tx and open_rx messages of the loc-rib.

Refresh the method of updating the SEQ value when reading the peer
messages: only update to the last matching SEQ value.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2024-12-30 15:13:37 +01:00
Philippe Guibert
92f98484d7 bgpd: fix memory leak when updating peer up loc rib events
The following memory leak can be observed when turning off and on the
BGP vrf interface.

> ==706056==ERROR: LeakSanitizer: detected memory leaks
>
> Direct leak of 78 byte(s) in 1 object(s) allocated from:
>     #0 0x7fbf5f6b4887 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:145
>     #1 0x7fbf5f0771f8 in qmalloc lib/memory.c:101
>     #2 0x7fbf5bdde610 in bmp_bgp_peer_vrf bgpd/bgp_bmp.c:2042
>     #3 0x7fbf5bdde8aa in bmp_bgp_update_vrf_status bgpd/bgp_bmp.c:2079
>     #4 0x7fbf5bdeaa1c in bmp_vrf_itf_state_changed bgpd/bgp_bmp.c:3204
>     #5 0x562740f0d83f in hook_call_bgp_vrf_status_changed bgpd/bgp_zebra.c:64
>     #6 0x562740f0ee28 in bgp_ifp_up bgpd/bgp_zebra.c:234
>     #7 0x7fbf5f01c193 in hook_call_if_up lib/if.c:57
>     #8 0x7fbf5f01d09a in if_up_via_zapi lib/if.c:203
>     #9 0x7fbf5f1d6f54 in zclient_interface_up lib/zclient.c:2671
>     #10 0x7fbf5f1e3e5a in zclient_read lib/zclient.c:4624
>     #11 0x7fbf5f18078d in event_call lib/event.c:1996
>     #12 0x7fbf5f048933 in frr_run lib/libfrr.c:1232
>     #13 0x562740c0cae1 in main bgpd/bgp_main.c:557
>     #14 0x7fbf5ea29d8f in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58
>
> Direct leak of 78 byte(s) in 1 object(s) allocated from:
>     #0 0x7fbf5f6b4887 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:145
>     #1 0x7fbf5f0771f8 in qmalloc lib/memory.c:101
>     #2 0x7fbf5bdde610 in bmp_bgp_peer_vrf bgpd/bgp_bmp.c:2042
>     #3 0x7fbf5bdde8aa in bmp_bgp_update_vrf_status bgpd/bgp_bmp.c:2079
>     #4 0x7fbf5bdd4839 in bmp_send_peerup_vrf bgpd/bgp_bmp.c:627
>     #5 0x7fbf5bddb0d3 in bmp_wrfill bgpd/bgp_bmp.c:1590
>     #6 0x7fbf5f10841f in pullwr_run lib/pullwr.c:197
>     #7 0x7fbf5f18078d in event_call lib/event.c:1996
>     #8 0x7fbf5f048933 in frr_run lib/libfrr.c:1232
>     #9 0x562740c0cae1 in main bgpd/bgp_main.c:557
>     #10 0x7fbf5ea29d8f in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58

Fix this by freeing the previous open_tx and open_rx contexts before
setting up the new one. Also at deletion of peer, free the open_rx
context.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2024-12-30 15:13:37 +01:00
Philippe Guibert
6e2d58854d bgpd: fix do re-send post-policy bgp update when not valid
When a BGP listener configured with BMP receives the first BGP
IPv6 update from a connected BGP IPv6 peer, the BMP collector
receives a withdraw post-policy message.

> {"peer_type": "route distinguisher instance", "policy": "post-policy",
> "ipv6": true, "peer_ip": "192:167::3", "peer_distinguisher": "444:1",
> "peer_asn": 65501, "peer_bgp_id": "192.168.1.3", "timestamp":
> "2024-10-29 11:44:47.111962", "bmp_log_type": "withdraw", "afi": 2,
> "safi": 1, "ip_prefix": "2001::1125/128", "seq": 22}
> {"peer_type": "route distinguisher instance", "policy": "pre-policy",
> "ipv6": true, "peer_ip": "192:167::3", "peer_distinguisher": "444:1",
> "peer_asn": 65501, "peer_bgp_id": "192.168.1.3", "timestamp":
> "2024-10-29 11:44:47.111963", "bmp_log_type": "update", "origin":
> "IGP", "as_path": "", "afi": 2, "safi": 1, "nxhp_ip": "192:167::3",
> "nxhp_link-local": "fe80::7063:d8ff:fedb:9e11", "ip_prefix": "2001::1125/128", "seq": 23}

Actually, the BGP update is not valid, and BMP considers it as a
withdraw message. The BGP upate is not valid, because the nexthop
reachability is unknown at the time of reception, and no other
BMP message is sent.

Fix this by re-sending a BMP post update message when nexthop
tracking becomes successfull. Generalise the re-sending of
messages when nexthop tracking changes.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2024-12-30 15:13:37 +01:00
Philippe Guibert
955da5cbaa bgpd: fix warning of compilation when using bgp_trace
The following warning can be seen:
> In file included from ./bgpd/bgp_trace.h:21,
>                  from bgpd/bgp_io.c:27:
> bgpd/bgp_io.c: In function ‘read_ibuf_work’:
> bgpd/bgp_io.c:202:53: warning: passing argument 1 of ‘lttng_ust_tracepoint_cb_frr_bgp___packet_read’ from incompatible pointer type [-Wincompatible-pointer-types]
>   202 |         frrtrace(2, frr_bgp, packet_read, connection->peer, pkt);
>       |                                           ~~~~~~~~~~^~~~~~
>       |                                                     |
>       |                                                     struct peer *
> bgpd/bgp_io.c:202:9: note: in expansion of macro ‘frrtrace’
>   202 |         frrtrace(2, frr_bgp, packet_read, connection->peer, pkt);
>       |         ^~~~~~~~
> In file included from ./bgpd/bgp_trace.h:21,
>                  from bgpd/bgp_io.c:27:
> ./bgpd/bgp_trace.h:57:43: note: expected ‘struct peer_connection *’ but argument is of type ‘struct peer *’
>    57 |         TP_ARGS(struct peer_connection *, connection, struct stream *, pkt),
>       |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~

Use the appropriate connection parameter when calling the trace.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2024-12-30 15:13:37 +01:00
Philippe Guibert
9e940d4de3 bgpd: bmp, fix address sanitizer issue
The following ASAN error can be seen.

> ERROR: AddressSanitizer: attempting to call malloc_usable_size() for pointer which is not owned: 0x608000036c20
>     #0 0x7f3d7a4b5425 in __interceptor_malloc_usable_size ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:198
>     #1 0x7f3d7a426a16 in __sanitizer::BufferedStackTrace::Unwind(unsigned long, unsigned long, void*, bool, unsigned int) ../../../../src/libsanitizer/sanitizer_common
> /sanitizer_stacktrace.h:122
>     #2 0x7f3d7a426a16 in __asan::asan_malloc_usable_size(void const*, unsigned long, unsigned long) ../../../../src/libsanitizer/asan/asan_allocator.cpp:1074
>     #3 0x7f3d7a03f330 in mt_count_free lib/memory.c:78
>     #4 0x7f3d7a03f330 in qfree lib/memory.c:130
>     #5 0x7f3d76ccf89b in bmp_peer_status_changed bgpd/bgp_bmp.c:982
>     #6 0x560ae2aa6a94 in hook_call_peer_status_changed bgpd/bgp_fsm.c:47
>     #7 0x560ae2aa6a94 in bgp_fsm_change_status bgpd/bgp_fsm.c:1287
>     #8 0x560ae2c4f2e5 in peer_delete bgpd/bgpd.c:2777
>     #9 0x560ae2c58d24 in bgp_delete bgpd/bgpd.c:4140
>     #10 0x560ae2bbb47e in no_router_bgp bgpd/bgp_vty.c:1764
>     #11 0x7f3d79fb74ed in cmd_execute_command_real lib/command.c:1003
>     #12 0x7f3d79fb78a3 in cmd_execute_command lib/command.c:1062
>     #13 0x7f3d79fb7e03 in cmd_execute lib/command.c:1228
>     #14 0x7f3d7a107b53 in vty_command lib/vty.c:625
>     #15 0x7f3d7a109902 in vty_execute lib/vty.c:1388
>     #16 0x7f3d7a10cc32 in vtysh_read lib/vty.c:2400
>     #17 0x7f3d7a0f848b in event_call lib/event.c:2019
>     #18 0x7f3d7a01e627 in frr_run lib/libfrr.c:1232
>     #19 0x560ae29e0037 in main bgpd/bgp_main.c:555
>     #20 0x7f3d79a29d8f in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58
>     #21 0x7f3d79a29e3f in __libc_start_main_impl ../csu/libc-start.c:392
>     #22 0x560ae29e4ef4 in _start (/usr/lib/frr/bgpd+0x2eeef4)
>
> 0x608000036c20 is located 0 bytes inside of 81-byte region [0x608000036c20,0x608000036c71)
> freed by thread T0 here:
>     #0 0x7f3d7a4b4537 in __interceptor_free ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:127
>     #1 0x7f3d76ccf85f in bmp_peer_status_changed bgpd/bgp_bmp.c:981
>     #2 0x560ae2aa6a94 in hook_call_peer_status_changed bgpd/bgp_fsm.c:47
>     #3 0x560ae2aa6a94 in bgp_fsm_change_status bgpd/bgp_fsm.c:1287
>     #4 0x560ae2c4f2e5 in peer_delete bgpd/bgpd.c:2777
>     #5 0x560ae2c58d24 in bgp_delete bgpd/bgpd.c:4140
>     #6 0x560ae2bbb47e in no_router_bgp bgpd/bgp_vty.c:1764
>     #7 0x7f3d79fb74ed in cmd_execute_command_real lib/command.c:1003
>     #8 0x7f3d79fb78a3 in cmd_execute_command lib/command.c:1062
>     #9 0x7f3d79fb7e03 in cmd_execute lib/command.c:1228
>     #10 0x7f3d7a107b53 in vty_command lib/vty.c:625
>     #11 0x7f3d7a109902 in vty_execute lib/vty.c:1388
>     #12 0x7f3d7a10cc32 in vtysh_read lib/vty.c:2400
>     #13 0x7f3d7a0f848b in event_call lib/event.c:2019
>     #14 0x7f3d7a01e627 in frr_run lib/libfrr.c:1232
>     #15 0x560ae29e0037 in main bgpd/bgp_main.c:555
>     #16 0x7f3d79a29d8f in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58
>
> previously allocated by thread T0 here:
>     #0 0x7f3d7a4b4887 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:145
>     #1 0x7f3d7a03f0e9 in qmalloc lib/memory.c:101
>     #2 0x7f3d76cd0166 in bmp_bgp_peer_vrf bgpd/bgp_bmp.c:2194
>     #3 0x7f3d76cd0166 in bmp_bgp_update_vrf_status bgpd/bgp_bmp.c:2236
>     #4 0x7f3d76cd29b8 in bmp_vrf_state_changed bgpd/bgp_bmp.c:3479
>     #5 0x560ae2c45b34 in hook_call_bgp_instance_state bgpd/bgpd.c:88
>     #6 0x560ae2c4d158 in bgp_instance_up bgpd/bgpd.c:3936
>     #7 0x560ae29e5ed1 in bgp_vrf_enable bgpd/bgp_main.c:299
>     #8 0x7f3d7a0ff8b1 in vrf_enable lib/vrf.c:286
>     #9 0x7f3d7a0ff8b1 in vrf_enable lib/vrf.c:275
>     #10 0x7f3d7a12ab66 in zclient_vrf_add lib/zclient.c:2561
>     #11 0x7f3d7a12eb43 in zclient_read lib/zclient.c:4624
>     #12 0x7f3d7a0f848b in event_call lib/event.c:2019
>     #13 0x7f3d7a01e627 in frr_run lib/libfrr.c:1232
>     #14 0x560ae29e0037 in main bgpd/bgp_main.c:555
>     #15 0x7f3d79a29d8f in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2024-12-30 15:13:37 +01:00
Donald Sharp
8d8f73eed0
Merge pull request #17734 from opensourcerouting/fix/show_discarded_withdrawn_routes
bgpd: Show prefix-related stats per neighbor
2024-12-30 08:20:25 -05:00
Donatas Abraitis
6fb7b3401b tests: Check prefix statistics for path-attribute discard/withdraw
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-12-30 12:27:00 +02:00
Donatas Abraitis
28e62b46ba bgpd: Show prefix-related stats per neighbor
E.g.:

```
  Prefix statistics:
    Inbound filtered: 0
    AS-PATH loop: 0
    Originator loop: 0
    Cluster loop: 0
    Invalid next-hop: 0
    Withdrawn: 0
    Attributes discarded: 3
```

JSON:

```
    "prefixStats":{
      "inboundFiltered":0,
      "aspathLoop":0,
      "originatorLoop":0,
      "clusterLoop":0,
      "invalidNextHop":0,
      "withdrawn":0,
      "attributesDiscarded":3
    },
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-12-30 12:26:19 +02:00
Igor Ryzhov
1d63ddd4b9
Merge pull request #17720 from jvoss/srv6_cli
isisd: fix srv6 exit statements
2024-12-27 13:17:03 +02:00
Donatas Abraitis
3f6c106e48
Merge pull request #17718 from cscarpitta/fix/fix-srv6-static-route-pytestmark
tests: Fix markers in `srv6_static_route` topotest
2024-12-26 14:17:21 +02:00
Jonathan Voss
dcb03c44e7 isisd: fix srv6 exit statements
Fix missing and misplaced `exit` statements to `show running-config` output.

Before:
```
router isis ISIS_CORE
 [...]
 segment-routing srv6
  locator ISIS_LOC
 exit    <<<<<<< always placed after locator
  node-msd
    [...]
  exit    <<<<<<< missng
  interface dum6
exit
```

After:
```
router isis ISIS_CORE
 [...]
 segment-routing srv6
  locator ISIS_LOC
  node-msd
   [...]
  exit
  interface dum6
 exit
exit
```

Related #16694

Signed-off-by: Jonathan Voss <jvoss@onvox.net>
2024-12-25 00:46:17 +00:00
Jafar Al-Gharaibeh
803ff41cc4
Merge pull request #17647 from LabNConsulting/fix-oper-test
tests: enable test failure detection and fix resulting failures
2024-12-24 12:35:32 -06:00
Carmine Scarpitta
225a1c7ed6 tests: Fix markers in srv6_static_route topotest
`srv6_static_route` is a pure staticd topotest. It does not have any
dependency on bgpd and sharpd.

Let's fix the pytestmark to include only staticd.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2024-12-24 10:38:37 +01:00
Christian Hopps
764f276022 mgmtd: fix memory leak in FE adapter
Signed-off-by: Christian Hopps <chopps@labn.net>
2024-12-24 03:04:23 -05:00
Christian Hopps
3d3ee2a1af tests: enable failure and fix broken tests
This test was not actually failing when the results didn't match. Fail
now. Also fix the tests that are now found to be failing incorrectly
(wrong expected result).

Signed-off-by: Christian Hopps <chopps@labn.net>
2024-12-24 03:04:23 -05:00
Donatas Abraitis
9ce3b144c9
Merge pull request #17580 from varuntumbe/dev/label_pool_release_fix
BGP Labelpool : Releasing the label in labelpool when VPN session gets removed
2024-12-23 14:48:21 +02:00
Donatas Abraitis
61ba8b91e5
Merge pull request #17711 from cscarpitta/fix/remove-srv6-locator-alloc-failure-tests
zebra: Remove tests for `srv6_locator_alloc` failure
2024-12-23 09:45:14 +02:00
Carmine Scarpitta
13f3c7c679 zebra: Remove tests for srv6_locator_alloc failure
`srv6_locator_alloc` can never fail. Let's remove the tests for
allocation failure.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2024-12-22 09:01:59 +01:00
Jafar Al-Gharaibeh
e62c2f10bc
Merge pull request #17684 from opensourcerouting/fix/json_time_no_newline
bgpd, lib: Use frrstr_time() when using ctime_r()
2024-12-21 22:59:58 -06:00
Jafar Al-Gharaibeh
0fbda45105
Merge pull request #17706 from cscarpitta/fix/convert-to-ipv6-max-bytelen
bgpd: Convert 16 to IPV6_MAX_BYTELEN
2024-12-21 22:56:47 -06:00
Jafar Al-Gharaibeh
79be632713
Merge pull request #17705 from opensourcerouting/fix/enforce-first-as_peer-group
bgpd: Fix enforce-first-as per peer-group removal
2024-12-21 22:54:50 -06:00
Carmine Scarpitta
cfab26b180 bgpd: Replace 16 integer with IPV6_MAX_BYTELEN
Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2024-12-22 02:12:02 +01:00
Carmine Scarpitta
3bc44ee5eb bgpd: Replace 16 integer with IPV6_MAX_BYTELEN
Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2024-12-22 02:11:20 +01:00
Donatas Abraitis
8cd73c792c
Merge pull request #17703 from cscarpitta/fix/fix-srv6-locator-doc
doc: Fix SRv6 locator documentation
2024-12-21 17:14:42 +02:00
Donatas Abraitis
f3b55831b4
Merge pull request #17704 from anlancs/fix/mgmtd-compile-error
mgmtd: fix compile error
2024-12-21 17:14:06 +02:00
Donatas Abraitis
9047ce6d9c tests: Check if enforce-first-as is working with peer-groups
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-12-21 17:08:01 +02:00
Donatas Abraitis
b6dcf61877 bgpd: Fix enforce-first-as per peer-group removal
If we do `no neighbor PG enforce-first-as`, it wasn't working because the flag
was inherited incorrectly for the members of the peer-group.

Fixes: 322462920e ("bgpd: Enable enforce-first-as by default")

Closes: https://github.com/FRRouting/frr/issues/17702

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-12-21 17:04:30 +02:00
anlan_cs
b5b8c9d3ec mgmtd: fix compile error
Compile error with `--disable-ripd`:
```
mgmtd/mgmt_be_adapter.c:86:5: error: "HAVE_RIPD" is not defined, evaluates to 0 [-Werror=undef]
   86 | #if HAVE_RIPD
      |     ^~~~~~~~~
```
I have searched the code, there is only three places need to be fixed.

Signed-off-by: anlan_cs <anlan_cs@126.com>
2024-12-21 19:32:47 +08:00
Carmine Scarpitta
fd21131ecf doc: Show the valid range of SRv6 locator node-len
The documentation should provide the valid range of SRv6 locator
node-len parameter, rather than the default value.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2024-12-21 09:30:57 +01:00
Carmine Scarpitta
f8ff3e6e06 doc: Show the valid range of SRv6 locator block-len
The documentation should provide the valid range of SRv6 locator
block-len parameter, rather than the default value.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2024-12-21 09:29:55 +01:00
Carmine Scarpitta
bcad7df60d doc: Fix the order of SRv6 locator parameters
Align the order of the SRv6 locator parameters with the actual implementation:

```
"prefix X:X::X:X/M$prefix [block-len (16-64)$block_bit_len]  \
	        [node-len (16-64)$node_bit_len] [func-bits (0-64)$func_bit_len]"
```

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2024-12-21 09:26:44 +01:00
Jafar Al-Gharaibeh
f7fcc44292
Merge pull request #17674 from opensourcerouting/fix/bgp_show_advertised_routes_detail
bgpd: Fix show neighbor X advertised-routes detail
2024-12-20 14:01:34 -06:00
Jafar Al-Gharaibeh
c5123ff2b0
Merge pull request #17672 from raja-rajasekar/rajasekarr/batch_huge_cfg
lib: Fix to optimize the time taken while batching huge configs
2024-12-20 14:00:02 -06:00
Jafar Al-Gharaibeh
1b213448a9
Merge pull request #17619 from donaldsharp/bgp_metaq_upstream
bgpd: add meta queue in bgp
2024-12-20 13:59:15 -06:00
Jafar Al-Gharaibeh
ef4e2297ad
Merge pull request #17685 from ykholod/master-17413
babel: Clean babel config on babel daemon stop
2024-12-20 13:57:47 -06:00
Jafar Al-Gharaibeh
d34cfcb878
Merge pull request #17676 from LabNConsulting/fix-ut-error-label
test: fix label ordering on error diff report
2024-12-20 13:56:23 -06:00
Mark Stapp
abefc604f7
Merge pull request #17648 from LabNConsulting/fix-darr-sprintf
Fix 2 darr (dynamic-array) bugs
2024-12-20 11:10:18 -05:00
Donatas Abraitis
8f5821eb77 pathd: Replace ctime_r() with time_to_string()
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-12-20 17:58:49 +02:00
Donatas Abraitis
3784736b09 bgpd: Drop timestamp_string()
Replace with time_to_string().

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-12-20 17:58:49 +02:00
Donatas Abraitis
b37f5f53b3 bgpd: Replace ctime_r() to time_to_string[_json]() to handle JSON/non-JSON
For JSON output we don't need newline to be printed.

Before:

```
"lastUpdate":{"epoch":1734490463,"string":"Wed Dec 18 04:54:23 2024\n"
```

After:

```
"lastUpdate":{"epoch":1734678560,"string":"Fri Dec 20 09:09:20 2024"
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-12-20 17:58:49 +02:00
Donatas Abraitis
b3e1ceaf88 lib: Add a wrapper for time_to_string() to print time in JSON outputs
newline is not expected to be printed in JSON outputs, e.g.:

```
"lastUpdate":{"epoch":1734490463,"string":"Wed Dec 18 04:54:23 2024\n"
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-12-20 17:12:12 +02:00
Donatas Abraitis
7f4374fefc
Merge pull request #17669 from pguibert6WIND/rdvpn_mem_leak
bgpd: fix memory leak when reconfiguring a route distinguisher
2024-12-20 16:15:15 +02:00
Donatas Abraitis
f438329d23
Merge pull request #17673 from Jafaral/pim-coverity
pim: handle return code to fix a couple of coverity issues
2024-12-20 16:14:33 +02:00
Yaroslav Kholod
58188b5ff8 babel: Clean babel config on babel daemon stop
When deactivating babel no router babel and later re-enabling
it router babel the previous configuration is still in place.

Steps to reproduce:
 - Enable babel
 - Configure babel
 - Disable babel with "no router babel"
 - Verify config

Expected correct behavior: No config present

Signed-off-by: Yaroslav Kholod <y.kholod@vyos.io>
2024-12-20 15:20:59 +02:00
Jafar Al-Gharaibeh
2f0f5d9ab1
Merge pull request #17670 from pguibert6WIND/rpki_json_missing
bgpd: add rpki json attributes to bgp path
2024-12-19 20:27:01 -06:00