]> git.puffer.fish Git - mirror/frr.git/log
mirror/frr.git
3 months agobgpd: fix a bug in peer_allowas_in_set() 17780/head
Enke Chen [Tue, 7 Jan 2025 05:01:14 +0000 (21:01 -0800)]
bgpd: fix a bug in peer_allowas_in_set()

Fix a bug in peer_allowas_in_set() so that the config takes effect
for peer-group members.

Signed-off-by: Enke Chen <enchen@paloaltonetworks.com>
3 months agoMerge pull request #17770 from opensourcerouting/fix/BGP_NEXTHOP_EVPN_INCOMPLETE
Donald Sharp [Mon, 6 Jan 2025 18:25:02 +0000 (13:25 -0500)]
Merge pull request #17770 from opensourcerouting/fix/BGP_NEXTHOP_EVPN_INCOMPLETE

bgpd: Use unique value for BGP_NEXTHOP_EVPN_INCOMPLETE flag

3 months agobgpd: Use unique value for BGP_NEXTHOP_EVPN_INCOMPLETE flag 17770/head
Donatas Abraitis [Sun, 5 Jan 2025 19:42:18 +0000 (21:42 +0200)]
bgpd: Use unique value for BGP_NEXTHOP_EVPN_INCOMPLETE flag

This was reused with BGP_NEXTHOP_ULTIMATE by error.

Fixes: 93fd9cbb5022e0c40827cd6d6ef339624a8b5daa ("bgpd: Validate imported routes next-hop that is in a default VRF")
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
3 months agoMerge pull request #17752 from raja-rajasekar/rajasekarr/comp_issue
Jafar Al-Gharaibeh [Mon, 6 Jan 2025 02:15:20 +0000 (20:15 -0600)]
Merge pull request #17752 from raja-rajasekar/rajasekarr/comp_issue

zebra: fix dpdk compilation error

3 months agoMerge pull request #17750 from jvoss/vrf_rpki
Donatas Abraitis [Sat, 4 Jan 2025 11:52:40 +0000 (13:52 +0200)]
Merge pull request #17750 from jvoss/vrf_rpki

tools: Add missing rpki keyword to vrf in frr-reload

3 months agoMerge pull request #17715 from ykholod/master-17413-1
Donatas Abraitis [Sat, 4 Jan 2025 11:51:03 +0000 (13:51 +0200)]
Merge pull request #17715 from ykholod/master-17413-1

babel: Clean babel related config on daemon stop

3 months agoMerge pull request #17762 from anlancs/fix/ospf-minor-word
Donatas Abraitis [Sat, 4 Jan 2025 11:49:22 +0000 (13:49 +0200)]
Merge pull request #17762 from anlancs/fix/ospf-minor-word

ospfd: Correct one word

3 months agozebra: fix dpdk compilation error 17752/head
Rajasekar Raja [Fri, 3 Jan 2025 07:15:12 +0000 (23:15 -0800)]
zebra: fix dpdk compilation error

Fixing compilation error in a switch statement case

Fixes :aa4786642c9a65c282d0fd5247a35b0f14fa1c3c

Signed-off-by: Rajasekar Raja <rajasekarr@nvidia.com>
3 months agoospfd: Correct one word 17762/head
anlan_cs [Fri, 3 Jan 2025 14:55:40 +0000 (22:55 +0800)]
ospfd: Correct one word

Signed-off-by: anlan_cs <anlan_cs@126.com>
3 months agoMerge pull request #17732 from opensourcerouting/fix/isisd_detail_json
Mark Stapp [Fri, 3 Jan 2025 12:37:05 +0000 (07:37 -0500)]
Merge pull request #17732 from opensourcerouting/fix/isisd_detail_json

isisd: Show correct level information for `show isis interface detail json`

3 months agoMerge pull request #17737 from chiragshah6/fdev7
Donatas Abraitis [Fri, 3 Jan 2025 07:34:54 +0000 (09:34 +0200)]
Merge pull request #17737 from chiragshah6/fdev7

zebra:check DAD freeze action before notifying bgp

3 months agotools: Add missing rpki keyword to vrf in frr-reload 17750/head
Jonathan Voss [Fri, 3 Jan 2025 03:19:30 +0000 (03:19 +0000)]
tools: Add missing rpki keyword to vrf in frr-reload

When reloading the following configuration:
```
vrf red
 rpki
  rpki cache tcp 172.65.0.2 8282 preference 1
 exit
exit-vrf
```
frr-reload.py does not properly enter the `rpki` context
within a `vrf`. Because of this, it fails to apply RPKI
configurations.

Signed-off-by: Jonathan Voss <jvoss@onvox.net>
3 months agoMerge pull request #17726 from guoguojia2021/static_fix
Donatas Abraitis [Thu, 2 Jan 2025 11:22:54 +0000 (13:22 +0200)]
Merge pull request #17726 from guoguojia2021/static_fix

staticd: Reduce the frequency of adding routes

3 months agobabel: Clean babel related config on daemon stop 17715/head
Yaroslav Kholod [Mon, 23 Dec 2024 11:06:57 +0000 (13:06 +0200)]
babel: Clean babel related config on 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>
3 months agoMerge pull request #17716 from ykholod/master-17463
Donatas Abraitis [Wed, 1 Jan 2025 19:16:39 +0000 (21:16 +0200)]
Merge pull request #17716 from ykholod/master-17463

bgpd: Clean address-family config on daemon restart

3 months agoMerge pull request #17728 from dmytroshytyi-6WIND/bgp_rpki_state
Donatas Abraitis [Wed, 1 Jan 2025 19:15:42 +0000 (21:15 +0200)]
Merge pull request #17728 from dmytroshytyi-6WIND/bgp_rpki_state

bgpd: add rpki current state

3 months agoMerge pull request #17731 from raja-rajasekar/rajasekarr/stale_nhg_link_flap_4200788
Donatas Abraitis [Tue, 31 Dec 2024 13:39:40 +0000 (15:39 +0200)]
Merge pull request #17731 from raja-rajasekar/rajasekarr/stale_nhg_link_flap_4200788

zebra: Fix resetting valid flags for NHG dependents

3 months agoMerge pull request #17719 from jvoss/srv6_format
Donatas Abraitis [Tue, 31 Dec 2024 13:33:21 +0000 (15:33 +0200)]
Merge pull request #17719 from jvoss/srv6_format

tools: Add missing formats keyword to segment-routing in frr-reload

3 months agozebra:check DAD freeze action before notifying bgp 17737/head
Chirag Shah [Wed, 1 Nov 2023 05:11:04 +0000 (22:11 -0700)]
zebra:check DAD freeze action before notifying bgp

If Duplicate Address Detection action is freeze
(permanent or definite time means not warn only mode)
then locally duplicate detected MAC delete notification
is not require to inform,
instead ask BGP to sync previous remote MAC entry.
In freeze case local MAC event is not known to BGP,
instead BGP is pointing to remote VTEP for the MAC.

Ticket: #3652383
Issue: 3652383

Signed-off-by: Chirag Shah <chirag@nvidia.com>
3 months agozebra: Fix resetting valid flags for NHG dependents 17731/head
Donald Sharp [Sun, 29 Dec 2024 06:40:37 +0000 (22:40 -0800)]
zebra: Fix resetting valid flags for NHG dependents

Upon if_down, we don't reset the valid flag for dependents
and unset the INSTALLED flag.

So when its time for the NHG to be deleted (routes dereferenced),
zebra deletes it since refcnt goes to 0, but stale NHG remains in kernel.

Ticket :#4200788

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Signed-off-by: Rajasekar Raja <rajasekarr@nvidia.com>
3 months agoMerge pull request #17734 from opensourcerouting/fix/show_discarded_withdrawn_routes
Donald Sharp [Mon, 30 Dec 2024 13:20:25 +0000 (08:20 -0500)]
Merge pull request #17734 from opensourcerouting/fix/show_discarded_withdrawn_routes

bgpd: Show prefix-related stats per neighbor

3 months agoBGP: Clean address-family config on daemon restart 17716/head
Yaroslav Kholod [Mon, 23 Dec 2024 15:35:12 +0000 (17:35 +0200)]
BGP: Clean address-family config on daemon restart

When stopping and restarting BGP daemon part of the configuration
remains. It should be cleared.
Particulary those are address-family parametes, like: distance,
ead-es-frag, disable-ead-evi-rx, disable-ead-evi-tx.

Signed-off-by: Yaroslav Kholod <y.kholod@vyos.io>
3 months agotests: Check prefix statistics for path-attribute discard/withdraw 17734/head
Donatas Abraitis [Mon, 30 Dec 2024 10:27:00 +0000 (12:27 +0200)]
tests: Check prefix statistics for path-attribute discard/withdraw

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
3 months agobgpd: Show prefix-related stats per neighbor
Donatas Abraitis [Mon, 30 Dec 2024 10:26:19 +0000 (12:26 +0200)]
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>
3 months agotests: add bgp rpki topo1 rpkiValidationState 17728/head
Dmytro Shytyi [Thu, 26 Dec 2024 13:22:41 +0000 (14:22 +0100)]
tests: add bgp rpki topo1 rpkiValidationState

Topotest to verify the next key-value "rpkiValidationState": "valid"

Signed-off-by: Dmytro Shytyi <dmytro.shytyi@6wind.com>
3 months agoisisd: Show correct level information for `show isis interface detail json` 17732/head
Donatas Abraitis [Mon, 30 Dec 2024 08:31:44 +0000 (10:31 +0200)]
isisd: Show correct level information for `show isis interface detail json`

Having this configuration:

```
!
interface r1-eth0
 ip address 10.0.0.1/30
 ip router isis 1
 isis priority 44 level-1
 isis priority 88 level-2
 isis csnp-interval 90 level-1
 isis csnp-interval 99 level-2
 isis psnp-interval 70 level-1
 isis psnp-interval 50 level-2
 isis hello-interval level-1 120
 isis hello-interval level-2 150

!
interface r1-eth1
 ip address 10.0.0.10/30
 ip router isis 1
!
interface lo
 ip address 192.0.2.1/32
 ip router isis 1
 isis passive
!
router isis 1
net 49.0000.0000.0000.0001.00
 metric-style wide
```

Produces:

```
{
 "areas":[
   {
     "area":"1",
     "circuits":[
       {
         "circuit":2,
         "interface":{
           "name":"r1-eth0",
           "state":"Up",
           "is-passive":"active",
           "circuit-id":"0x2",
           "type":"lan",
           "level":"L1L2",
           "snpa":"6e28.9c92.da5e",
           "levels":[
             {
               "level":"L1",
               "metric":10,
               "active-neighbors":1,
               "hello-interval":120,
               "holddown":{
                 "count":10,
                 "pad":"yes"
               },
               "cnsp-interval":90,
               "psnp-interval":70,
               "lan":{
                 "priority":44,
                 "is-dis":"no"
               }
             },
             {
               "level":"L2",
               "metric":10,
               "active-neighbors":1,
               "hello-interval":120, <<<<<<<<<<<<<<<<<<
               "holddown":{
                 "count":10,
                 "pad":"yes"
               },
               "cnsp-interval":90, <<<<<<<<<<<<<<<<<<
               "psnp-interval":70, <<<<<<<<<<<<<<<<<<
               "lan":{
                 "priority":44, <<<<<<<<<<<<<<<<<<
                 "is-dis":"no"
               }
             }
           ],
...
```

Fixes: 9fee4d4c6038ef6b14e9f509d6b04d189660c4cd ("isisd: Add json to show isis interface command.")
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
4 months agobgpd: display rpki state in 'show bgp ipvX detail'
Philippe Guibert [Fri, 20 Dec 2024 07:47:04 +0000 (08:47 +0100)]
bgpd: display rpki state in 'show bgp ipvX detail'

The rpki current state was ignored when calling for the 'show bgp ipvX
detail' command. Handle the support for this, with json support too.

> "rpkiValidationState" : "valid",
> "rpkiValidationState" : "invalid",
> "rpkiValidationState" : "not used",
> "rpkiValidationState" : "not found",

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Signed-off-by: Dmytro Shytyi <dmytro.shytyi@6wind.com>
4 months agoMerge pull request #17720 from jvoss/srv6_cli
Igor Ryzhov [Fri, 27 Dec 2024 11:17:03 +0000 (13:17 +0200)]
Merge pull request #17720 from jvoss/srv6_cli

isisd: fix srv6 exit statements

4 months agostaticd: Reduce the frequency of adding routes 17726/head
guozhongfeng.gzf [Fri, 27 Dec 2024 04:16:17 +0000 (12:16 +0800)]
staticd: Reduce the frequency of adding routes

Signed-off-by: guozhongfeng.gzf <guozhongfeng.gzf@alibaba-inc.com>
4 months agoMerge pull request #17718 from cscarpitta/fix/fix-srv6-static-route-pytestmark
Donatas Abraitis [Thu, 26 Dec 2024 12:17:21 +0000 (14:17 +0200)]
Merge pull request #17718 from cscarpitta/fix/fix-srv6-static-route-pytestmark

tests: Fix markers in `srv6_static_route` topotest

4 months agoisisd: fix srv6 exit statements 17720/head
Jonathan Voss [Tue, 24 Dec 2024 23:26:37 +0000 (23:26 +0000)]
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>
4 months agoMerge pull request #17647 from LabNConsulting/fix-oper-test
Jafar Al-Gharaibeh [Tue, 24 Dec 2024 18:35:32 +0000 (12:35 -0600)]
Merge pull request #17647 from LabNConsulting/fix-oper-test

tests: enable test failure detection and fix resulting failures

4 months agotools: Add missing formats keyword to segment-routing in frr-reload 17719/head
Jonathan Voss [Tue, 24 Dec 2024 16:32:13 +0000 (16:32 +0000)]
tools: Add missing formats keyword to segment-routing in frr-reload

When reloading the following configuration:
```
segment-routing
 srv6
  formats
   format usid-f3216
     wide-local-id-block explicit start 100
   exit
   !
   format uncompressed-f4024
   exit
   !
  exit
  !
 exit
 !
exit
```
frr-reload.py does not properly enter the `formats` context. Because of this,
it fails with an unknown command error when applying new or updating format
configuration.

Signed-off-by: Jonathan Voss <jvoss@onvox.net>
4 months agotests: Fix markers in `srv6_static_route` topotest 17718/head
Carmine Scarpitta [Tue, 24 Dec 2024 09:38:37 +0000 (10:38 +0100)]
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>
4 months agomgmtd: fix memory leak in FE adapter 17647/head
Christian Hopps [Sun, 15 Dec 2024 01:54:33 +0000 (20:54 -0500)]
mgmtd: fix memory leak in FE adapter

Signed-off-by: Christian Hopps <chopps@labn.net>
4 months agotests: enable failure and fix broken tests
Christian Hopps [Sun, 24 Nov 2024 08:06:05 +0000 (03:06 -0500)]
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>
4 months agoMerge pull request #17580 from varuntumbe/dev/label_pool_release_fix
Donatas Abraitis [Mon, 23 Dec 2024 12:48:21 +0000 (14:48 +0200)]
Merge pull request #17580 from varuntumbe/dev/label_pool_release_fix

BGP Labelpool : Releasing the label in labelpool when VPN session gets removed

4 months agoMerge pull request #17711 from cscarpitta/fix/remove-srv6-locator-alloc-failure-tests
Donatas Abraitis [Mon, 23 Dec 2024 07:45:14 +0000 (09:45 +0200)]
Merge pull request #17711 from cscarpitta/fix/remove-srv6-locator-alloc-failure-tests

zebra: Remove tests for `srv6_locator_alloc` failure

4 months agozebra: Remove tests for `srv6_locator_alloc` failure 17711/head
Carmine Scarpitta [Sun, 22 Dec 2024 08:01:59 +0000 (09:01 +0100)]
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>
4 months agoMerge pull request #17684 from opensourcerouting/fix/json_time_no_newline
Jafar Al-Gharaibeh [Sun, 22 Dec 2024 04:59:58 +0000 (22:59 -0600)]
Merge pull request #17684 from opensourcerouting/fix/json_time_no_newline

bgpd, lib: Use frrstr_time() when using ctime_r()

4 months agoMerge pull request #17706 from cscarpitta/fix/convert-to-ipv6-max-bytelen
Jafar Al-Gharaibeh [Sun, 22 Dec 2024 04:56:47 +0000 (22:56 -0600)]
Merge pull request #17706 from cscarpitta/fix/convert-to-ipv6-max-bytelen

bgpd: Convert 16 to IPV6_MAX_BYTELEN

4 months agoMerge pull request #17705 from opensourcerouting/fix/enforce-first-as_peer-group
Jafar Al-Gharaibeh [Sun, 22 Dec 2024 04:54:50 +0000 (22:54 -0600)]
Merge pull request #17705 from opensourcerouting/fix/enforce-first-as_peer-group

bgpd: Fix enforce-first-as per peer-group removal

4 months agobgpd: Replace 16 integer with IPV6_MAX_BYTELEN 17706/head
Carmine Scarpitta [Sun, 22 Dec 2024 01:09:44 +0000 (02:09 +0100)]
bgpd: Replace 16 integer with IPV6_MAX_BYTELEN

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
4 months agobgpd: Replace 16 integer with IPV6_MAX_BYTELEN
Carmine Scarpitta [Sun, 22 Dec 2024 01:02:09 +0000 (02:02 +0100)]
bgpd: Replace 16 integer with IPV6_MAX_BYTELEN

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
4 months agoMerge pull request #17703 from cscarpitta/fix/fix-srv6-locator-doc
Donatas Abraitis [Sat, 21 Dec 2024 15:14:42 +0000 (17:14 +0200)]
Merge pull request #17703 from cscarpitta/fix/fix-srv6-locator-doc

doc: Fix SRv6 locator documentation

4 months agoMerge pull request #17704 from anlancs/fix/mgmtd-compile-error
Donatas Abraitis [Sat, 21 Dec 2024 15:14:06 +0000 (17:14 +0200)]
Merge pull request #17704 from anlancs/fix/mgmtd-compile-error

mgmtd: fix compile error

4 months agotests: Check if enforce-first-as is working with peer-groups 17705/head
Donatas Abraitis [Sat, 21 Dec 2024 15:08:01 +0000 (17:08 +0200)]
tests: Check if enforce-first-as is working with peer-groups

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
4 months agobgpd: Fix `enforce-first-as` per peer-group removal
Donatas Abraitis [Sat, 21 Dec 2024 15:03:14 +0000 (17:03 +0200)]
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: 322462920e2a2c8b73191c6eb5157d64cf4a593e ("bgpd: Enable enforce-first-as by default")
Closes: https://github.com/FRRouting/frr/issues/17702
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
4 months agomgmtd: fix compile error 17704/head
anlan_cs [Sat, 21 Dec 2024 11:29:32 +0000 (19:29 +0800)]
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>
4 months agodoc: Show the valid range of SRv6 locator node-len 17703/head
Carmine Scarpitta [Sat, 21 Dec 2024 08:30:57 +0000 (09:30 +0100)]
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>
4 months agodoc: Show the valid range of SRv6 locator block-len
Carmine Scarpitta [Sat, 21 Dec 2024 08:29:55 +0000 (09:29 +0100)]
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>
4 months agodoc: Fix the order of SRv6 locator parameters
Carmine Scarpitta [Sat, 21 Dec 2024 08:26:44 +0000 (09:26 +0100)]
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>
4 months agoMerge pull request #17674 from opensourcerouting/fix/bgp_show_advertised_routes_detail
Jafar Al-Gharaibeh [Fri, 20 Dec 2024 20:01:34 +0000 (14:01 -0600)]
Merge pull request #17674 from opensourcerouting/fix/bgp_show_advertised_routes_detail

bgpd: Fix show neighbor X advertised-routes detail

4 months agoMerge pull request #17672 from raja-rajasekar/rajasekarr/batch_huge_cfg
Jafar Al-Gharaibeh [Fri, 20 Dec 2024 20:00:02 +0000 (14:00 -0600)]
Merge pull request #17672 from raja-rajasekar/rajasekarr/batch_huge_cfg

lib: Fix to optimize the time taken while batching huge configs

4 months agoMerge pull request #17619 from donaldsharp/bgp_metaq_upstream
Jafar Al-Gharaibeh [Fri, 20 Dec 2024 19:59:15 +0000 (13:59 -0600)]
Merge pull request #17619 from donaldsharp/bgp_metaq_upstream

bgpd: add meta queue in bgp

4 months agoMerge pull request #17685 from ykholod/master-17413
Jafar Al-Gharaibeh [Fri, 20 Dec 2024 19:57:47 +0000 (13:57 -0600)]
Merge pull request #17685 from ykholod/master-17413

babel: Clean babel config on babel daemon stop

4 months agoMerge pull request #17676 from LabNConsulting/fix-ut-error-label
Jafar Al-Gharaibeh [Fri, 20 Dec 2024 19:56:23 +0000 (13:56 -0600)]
Merge pull request #17676 from LabNConsulting/fix-ut-error-label

test: fix label ordering on error diff report

4 months agoMerge pull request #17648 from LabNConsulting/fix-darr-sprintf
Mark Stapp [Fri, 20 Dec 2024 16:10:18 +0000 (11:10 -0500)]
Merge pull request #17648 from LabNConsulting/fix-darr-sprintf

Fix 2 darr (dynamic-array) bugs

4 months agopathd: Replace ctime_r() with time_to_string() 17684/head
Donatas Abraitis [Fri, 20 Dec 2024 15:25:56 +0000 (17:25 +0200)]
pathd: Replace ctime_r() with time_to_string()

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
4 months agobgpd: Drop timestamp_string()
Donatas Abraitis [Fri, 20 Dec 2024 15:23:14 +0000 (17:23 +0200)]
bgpd: Drop timestamp_string()

Replace with time_to_string().

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
4 months agobgpd: Replace ctime_r() to time_to_string[_json]() to handle JSON/non-JSON
Donatas Abraitis [Fri, 20 Dec 2024 15:13:19 +0000 (17:13 +0200)]
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>
4 months agolib: Add a wrapper for time_to_string() to print time in JSON outputs
Donatas Abraitis [Fri, 20 Dec 2024 15:12:12 +0000 (17:12 +0200)]
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>
4 months agoMerge pull request #17669 from pguibert6WIND/rdvpn_mem_leak
Donatas Abraitis [Fri, 20 Dec 2024 14:15:15 +0000 (16:15 +0200)]
Merge pull request #17669 from pguibert6WIND/rdvpn_mem_leak

bgpd: fix memory leak when reconfiguring a route distinguisher

4 months agoMerge pull request #17673 from Jafaral/pim-coverity
Donatas Abraitis [Fri, 20 Dec 2024 14:14:33 +0000 (16:14 +0200)]
Merge pull request #17673 from Jafaral/pim-coverity

pim: handle return code to fix a couple of coverity issues

4 months agobabel: Clean babel config on babel daemon stop 17685/head
Yaroslav Kholod [Fri, 20 Dec 2024 07:43:30 +0000 (09:43 +0200)]
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>
4 months agoMerge pull request #17670 from pguibert6WIND/rpki_json_missing
Jafar Al-Gharaibeh [Fri, 20 Dec 2024 02:27:01 +0000 (20:27 -0600)]
Merge pull request #17670 from pguibert6WIND/rpki_json_missing

bgpd: add rpki json attributes to bgp path

4 months agoMerge pull request #17586 from opensourcerouting/fix/revalidate_only_affected_routes
Jafar Al-Gharaibeh [Thu, 19 Dec 2024 21:59:17 +0000 (15:59 -0600)]
Merge pull request #17586 from opensourcerouting/fix/revalidate_only_affected_routes

bgpd: Validate only affected RPKI prefixes instead of a full RIB

4 months agoMerge pull request #17675 from opensourcerouting/fix/memory_leaks_for_strdup
Jafar Al-Gharaibeh [Thu, 19 Dec 2024 21:55:07 +0000 (15:55 -0600)]
Merge pull request #17675 from opensourcerouting/fix/memory_leaks_for_strdup

bgpd: Fix memory leak when creating BMP connection with a source interface

4 months agotests: Ignore totalRoutes, totalPaths when checking strict output 17674/head
Donatas Abraitis [Thu, 19 Dec 2024 19:44:50 +0000 (21:44 +0200)]
tests: Ignore totalRoutes, totalPaths when checking strict output

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
4 months agotests: Check if we received a DECENT amount of prefixes/paths
Donatas Abraitis [Thu, 19 Dec 2024 16:24:06 +0000 (18:24 +0200)]
tests: Check if we received a DECENT amount of prefixes/paths

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
4 months agobgpd: Print totalRoutes and totalPaths in JSON output
Donatas Abraitis [Thu, 19 Dec 2024 16:21:07 +0000 (18:21 +0200)]
bgpd: Print totalRoutes and totalPaths in JSON output

E.g.:
```
r1# sh bgp ipv4 unicast neighbors 192.168.1.2 routes json
{
 "vrfId": 0,
 "vrfName": "default",
 "tableVersion": 2,
 "routerId": "192.168.1.1",
 "defaultLocPrf": 100,
 "localAS": 65001,
 "routes": { "172.16.16.254/32": [{"valid":true,"bestpath":true,"selectionReason":"Nothing left to compare","pathFrom":"external","prefix":"172.16.16.254","prefixLen":32,"network":"172.16.16.254\/32","version":2,"weight":0,"peerId":"192.168.1.2","path":"65002 65006","origin":"incomplete","nexthops":[{"ip":"192.168.1.2","hostname":"r2","afi":"ipv4","used":true}]},{"valid":true,"multipath":true,"pathFrom":"external","prefix":"172.16.16.254","prefixLen":32,"network":"172.16.16.254\/32","version":2,"weight":0,"peerId":"192.168.1.2","path":"65002 65005","origin":"incomplete","nexthops":[{"ip":"192.168.1.2","hostname":"r2","afi":"ipv4","used":true}]}]
 } , "totalRoutes": 1, "totalPaths": 2 }
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
4 months agobgpd: add rpki json attributes to bgp path 17670/head
Philippe Guibert [Wed, 18 Dec 2024 17:27:55 +0000 (18:27 +0100)]
bgpd: add rpki json attributes to bgp path

Add missing json attribute to BGP path.

Fixes: 82c298be7354 ("bgpd: Show RPKI short state in `show bgp <afi> <safi>`")
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
4 months agobgpd: Show applied route-map attributes for `neighbor X advertised-routes detail`
Donatas Abraitis [Thu, 19 Dec 2024 14:59:47 +0000 (16:59 +0200)]
bgpd: Show applied route-map attributes for `neighbor X advertised-routes detail`

If we have a route-map that sets some attributes e.g. community or large-community,
and the route-map is applied for outgoing direction, everything is fine, but
we missed the point that `advertised-routes detail` was not using the applied
attributes to display and instead it uses what is received from the peer (original).

Let's fix this, and use what's already applied (advertise attributes), and
we can now see:

```
route-map r3 permit 10
 match ip address prefix-list p1
 set community 65001:65002
 set extcommunity bandwidth 100
 set large-community 65001:65002:65003
exit
!
...
 address-family ipv4 unicast
  neighbor 192.168.2.3 route-map r3 out
 exit-address-family
...
```

The output:

```
r2# show bgp ipv4 neighbors 192.168.2.3 advertised-routes detail
BGP table version is 1, local router ID is 192.168.2.2, vrf id 0
Default local pref 100, local AS 65002
BGP routing table entry for 10.10.10.1/32, version 1
Paths: (1 available, best #1, table default)
  Advertised to non peer-group peers:
  192.168.1.1 192.168.2.3
  65001
    0.0.0.0 from 192.168.1.1 (192.168.1.1)
      Origin IGP, valid, external, best (First path received)
      Community: 65001:65002
      Extended Community: LB:65002:12500000 (100.000 Mbps)
      Large Community: 65001:65002:65003
      Last update: Thu Dec 19 17:00:40 2024
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
4 months agotest: fix label ordering on error diff report 17676/head
Christian Hopps [Thu, 19 Dec 2024 14:13:04 +0000 (08:13 -0600)]
test: fix label ordering on error diff report

Signed-off-by: Christian Hopps <chopps@labn.net>
4 months agoMerge pull request #17671 from Jafaral/static-propagation
Donald Sharp [Thu, 19 Dec 2024 13:53:06 +0000 (08:53 -0500)]
Merge pull request #17671 from Jafaral/static-propagation

tests: add a test case for static route propagation

4 months agobgpd: Fix memory leak when creating BMP connection with a source interface 17675/head
Donatas Abraitis [Thu, 19 Dec 2024 08:56:52 +0000 (10:56 +0200)]
bgpd: Fix memory leak when creating BMP connection with a source interface

Testing done with:

```
for x in $(seq 1 100000); do vtysh -c 'conf' -c 'router bgp' -c 'bmp targets test' -c 'bmp connect localhost port 123 min-retry 100 max-retry 100 source-interface lo'; done
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
4 months agotests: Check if we can see advertised routes with route-map applied
Donatas Abraitis [Thu, 19 Dec 2024 08:02:19 +0000 (10:02 +0200)]
tests: Check if we can see advertised routes with route-map applied

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
4 months agopim: handle return code to fix a couple of coverity issues 17673/head
Jafar Al-Gharaibeh [Wed, 18 Dec 2024 22:58:45 +0000 (16:58 -0600)]
pim: handle return code to fix a couple of coverity issues

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
4 months agoMerge pull request #17599 from opensourcerouting/fix/reduce_default_connect_timer
Jafar Al-Gharaibeh [Wed, 18 Dec 2024 22:26:37 +0000 (16:26 -0600)]
Merge pull request #17599 from opensourcerouting/fix/reduce_default_connect_timer

bgpd: Connect retry timer backoff

4 months agolib: Fix to optimize the time taken while batching huge configs 17672/head
Rajasekar Raja [Wed, 4 Oct 2023 16:20:35 +0000 (09:20 -0700)]
lib: Fix to optimize the time taken while batching huge configs

Issue: When the incoming config has say 30K entries of a prefix-lists,
current implementation is to schedule the configs to be batched and
only after batching the entire config, the processing of the configs
take place. As part of batching this config, we perform string
concatenation to save all the configs in the buffer which over time
results in taking longer time.

Ex: Imagine each line of config is 50 chars. With a delimiter of ‘- ‘ we end
up adding 52 chars to buffer for each command i.e. 52*30000 = 156K of chars.
Strlcat is an expensive operation and every time we strlcat, we have to
traverse at end of string to append new char.
Because of this, we end up adding extra 6-8 secs for accepting the config.

Fix: The idea here is to bring back something similar to the backoff
count implemented as part of 20e9a402 (lib: introduce configuration
back-off timer for YANG-modeled commands).

Essentially we keep a cap of 5000 per batch. So once 5000k config
commands are batched, we process them, clear the buffer, set the count
to 0 and then continue processing the rest of the config.

option1 file has 30K entries of prefix-list
Without Fix:
root@mlx-3700-20:mgmt:/var/log/raja/frr# time sudo vtysh -f option1
<SNIP>..............
Waiting for children to finish applying config...
[25191|staticd] done
[25189|watchfrr] done
[25178|ospfd] done
[25190|pbrd] done
[25181|bgpd] done
[25175|zebra] done

real    0m20.123s
user    0m9.384s
sys     0m2.403s

With Fix:
root@mlx-3700-20:mgmt:/var/log/raja/frr# time sudo vtysh -f option1
<SNIP>..............
Waiting for children to finish applying config...
[19887|staticd] done
[19885|watchfrr] done
[19886|pbrd] done
[19874|ospfd] done
[19877|bgpd] done
[19871|zebra] done

real 0m12.168s
user 0m7.511s
sys 0m1.981s

Issue: 3589101

Ticket# 3589101

Signed-off-by: Rajasekar Raja <rajasekarr@nvidia.com>
4 months agotests: add a test case for static route propagation 17671/head
Jafar Al-Gharaibeh [Wed, 18 Dec 2024 18:11:20 +0000 (12:11 -0600)]
tests: add a test case for static route propagation

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
4 months agobgpd: fix memory leak when reconfiguring a route distinguisher 17669/head
Philippe Guibert [Wed, 18 Dec 2024 15:53:48 +0000 (16:53 +0100)]
bgpd: fix memory leak when reconfiguring a route distinguisher

A memory leak happens when reconfiguring an already configured route
distinguisher on an L3VPN BGP instance. Fix this by freeing the previous
route distinguisher.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
4 months agoMerge pull request #17654 from mjstapp/remove_bgp_pRN
Donald Sharp [Tue, 17 Dec 2024 19:44:18 +0000 (14:44 -0500)]
Merge pull request #17654 from mjstapp/remove_bgp_pRN

bgpd: remove unneeded printfrr reg for pRN

4 months agobgpd: add meta queue in bgp 17619/head
Karthikeya Venkat Muppalla [Tue, 3 Dec 2024 22:59:57 +0000 (14:59 -0800)]
bgpd: add meta queue in bgp

This commit introduces meta queue to the BGP process_queue which is
helpful in having a priority of lists where some routes can be processed
earlier than 'other' routes. This is similar to how meta queue is
present in zebra.

After Fix:
---------

For testing, note that all 100.x routes are marked as Early routes which
got enqueued and dequeued first before Other routes in every batch of
updates. Also, the items are dequeued in FIFO order.

switch# cat /var/log/frr/bgpd.log | grep sub-queue
2024/12/06 19:19:42.788014 BGP: [V64FH-G6883] 88.0.0.9/32 queued into sub-queue Other Route
2024/12/06 19:19:42.856127 BGP: [V64FH-G6883] 100.90.9.186/32 queued into sub-queue Early Route
2024/12/06 19:19:42.856138 BGP: [V64FH-G6883] 100.90.9.187/32 queued into sub-queue Early Route
2024/12/06 19:19:42.886715 BGP: [V64FH-G6883] 66.0.0.9/32 queued into sub-queue Other Route
2024/12/06 19:19:43.022835 BGP: [V64FH-G6883] 33.0.0.9/32 queued into sub-queue Other Route
2024/12/06 19:19:43.058842 BGP: [V64FH-G6883] 44.0.0.9/32 queued into sub-queue Other Route
2024/12/06 19:19:43.092365 BGP: [V64FH-G6883] 55.0.0.9/32 queued into sub-queue Other Route
2024/12/06 19:19:43.540770 BGP: [ZAPXS-9754G] 100.90.9.186/32 dequeued from sub-queue Early Route
2024/12/06 19:19:43.541233 BGP: [ZAPXS-9754G] 100.90.9.187/32 dequeued from sub-queue Early Route
2024/12/06 19:19:43.541523 BGP: [ZAPXS-9754G] 88.0.0.9/32 dequeued from sub-queue Other Route
2024/12/06 19:19:43.602094 BGP: [V64FH-G6883] 88.0.0.9/32 queued into sub-queue Other Route
2024/12/06 19:19:43.649083 BGP: [V64FH-G6883] 100.90.9.186/32 queued into sub-queue Early Route
2024/12/06 19:19:43.649092 BGP: [V64FH-G6883] 100.90.9.187/32 queued into sub-queue Early Route
2024/12/06 19:19:43.649148 BGP: [V64FH-G6883] 77.0.0.9/32 queued into sub-queue Other Route
2024/12/06 19:19:43.712282 BGP: [V64FH-G6883] 100.90.9.138/32 queued into sub-queue Early Route
2024/12/06 19:19:43.712314 BGP: [V64FH-G6883] 100.90.9.139/32 queued into sub-queue Early Route
2024/12/06 19:19:43.817194 BGP: [V64FH-G6883] 100.90.8.58/32 queued into sub-queue Early Route
2024/12/06 19:19:43.817205 BGP: [V64FH-G6883] 100.90.8.59/32 queued into sub-queue Early Route
2024/12/06 19:19:43.942464 BGP: [ZAPXS-9754G] 100.90.9.186/32 dequeued from sub-queue Early Route
2024/12/06 19:19:43.942530 BGP: [ZAPXS-9754G] 100.90.9.187/32 dequeued from sub-queue Early Route
2024/12/06 19:19:43.942550 BGP: [ZAPXS-9754G] 100.90.9.138/32 dequeued from sub-queue Early Route
2024/12/06 19:19:43.942738 BGP: [ZAPXS-9754G] 100.90.9.139/32 dequeued from sub-queue Early Route
2024/12/06 19:19:43.942763 BGP: [ZAPXS-9754G] 100.90.8.58/32 dequeued from sub-queue Early Route
2024/12/06 19:19:43.942788 BGP: [ZAPXS-9754G] 100.90.8.59/32 dequeued from sub-queue Early Route
2024/12/06 19:19:44.558611 BGP: [ZAPXS-9754G] 66.0.0.9/32 dequeued from sub-queue Other Route
2024/12/06 19:19:44.893541 BGP: [ZAPXS-9754G] 33.0.0.9/32 dequeued from sub-queue Other Route
2024/12/06 19:19:45.171794 BGP: [ZAPXS-9754G] 44.0.0.9/32 dequeued from sub-queue Other Route
2024/12/06 19:19:45.453137 BGP: [ZAPXS-9754G] 55.0.0.9/32 dequeued from sub-queue Other Route
2024/12/06 19:19:45.685269 BGP: [ZAPXS-9754G] 88.0.0.9/32 dequeued from sub-queue Other Route
2024/12/06 19:19:45.764752 BGP: [ZAPXS-9754G] 77.0.0.9/32 dequeued from sub-queue Other Route

With 'update-delay' feature (EOIU marker):
------------------------------------------

switch# vtysh -c "show run bgp" | grep update-delay
 update-delay 40

switch# cat /var/log/frr/bgpd.log | grep sub-queue
2024/12/06 23:27:46.124461 BGP: [V64FH-G6883] 22.0.0.9/32 queued into sub-queue Other Route
2024/12/06 23:27:46.160224 BGP: [V64FH-G6883] 100.90.8.11/32 queued into sub-queue Early Route
2024/12/06 23:27:46.219663 BGP: [W9QTR-P4REP] EOIU Marker queued into sub-queue EOIU Marker
2024/12/06 23:27:46.269711 BGP: [ZAPXS-9754G] 100.90.8.11/32 dequeued from sub-queue Early Route
2024/12/06 23:27:46.270980 BGP: [ZAPXS-9754G] 22.0.0.9/32 dequeued from sub-queue Other Route
2024/12/06 23:27:46.404868 BGP: [RBX2V-K33CZ] EOIU Marker dequeued from sub-queue EOIU Markera

Ticket: #4200787
Signed-off-by: Karthikeya Venkat Muppalla <kmuppalla@nvidia.com>
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
4 months agoMerge pull request #16488 from JosiahMg/isis-subif-neighbor
Russ White [Tue, 17 Dec 2024 16:39:20 +0000 (11:39 -0500)]
Merge pull request #16488 from JosiahMg/isis-subif-neighbor

vlan-subif isis neigbor

4 months agoMerge pull request #17613 from donaldsharp/evpn_bgp_bestpath_failure
Russ White [Tue, 17 Dec 2024 16:31:52 +0000 (11:31 -0500)]
Merge pull request #17613 from donaldsharp/evpn_bgp_bestpath_failure

bgpd: Fix evpn bestpath calculation when path is not established

4 months agoMerge pull request #17615 from opensourcerouting/fix/ip_prefix_list_show_prefix
Russ White [Tue, 17 Dec 2024 16:30:01 +0000 (11:30 -0500)]
Merge pull request #17615 from opensourcerouting/fix/ip_prefix_list_show_prefix

lib: Take ge/le into consideration when checking the prefix with the prefix-list

4 months agoMerge pull request #17544 from anlancs/zebra/fix-plug-interface
Russ White [Tue, 17 Dec 2024 16:16:32 +0000 (11:16 -0500)]
Merge pull request #17544 from anlancs/zebra/fix-plug-interface

zebra: fix wrong nexthop status for kernel routes

4 months agoMerge pull request #17526 from raja-rajasekar/rajasekarr/evpn_bp_and_optimizations_38...
Russ White [Tue, 17 Dec 2024 16:15:27 +0000 (11:15 -0500)]
Merge pull request #17526 from raja-rajasekar/rajasekarr/evpn_bp_and_optimizations_3864372_FINAL_upstream

EVPN L2VNI/L3VNI Optimize inline Global walk for remote route installations

4 months agoMerge pull request #16830 from louis-6wind/fix-addpath-race
Russ White [Tue, 17 Dec 2024 16:10:12 +0000 (11:10 -0500)]
Merge pull request #16830 from louis-6wind/fix-addpath-race

bgpd: fix missing addpath withdrawal race condition

4 months agotests: add nexthop/interface's down/up topo for kernel routes 17544/head
anlan_cs [Fri, 13 Dec 2024 10:38:08 +0000 (18:38 +0800)]
tests: add nexthop/interface's down/up topo for kernel routes

Signed-off-by: anlan_cs <anlan_cs@126.com>
4 months agozebra: check kernel routes when interface becomes up
anlan_cs [Sat, 14 Dec 2024 10:40:45 +0000 (18:40 +0800)]
zebra: check kernel routes when interface becomes up

Just like `link down`, check all kernel routes when interface become up.
And, they maybe will be selected as the best one by zebra.

Signed-off-by: anlan_cs <anlan_cs@126.com>
4 months agozebra: don't uninstall kernel routes
anlan_cs [Sat, 14 Dec 2024 10:30:18 +0000 (18:30 +0800)]
zebra: don't uninstall kernel routes

After the nexthop check is fixed, zebra will wrongly uninstall the kernel routes
with inactive nexthop.

This commit would skip the uninstallation for kernel routes.

Signed-off-by: anlan_cs <anlan_cs@126.com>
4 months agozebra: fix wrong nexthop check
anlan_cs [Sat, 30 Nov 2024 13:11:04 +0000 (21:11 +0800)]
zebra: fix wrong nexthop check

The kernel routes are wrongly selected even the nexthop interface is linkdown.

Use `ip link set dev <interface> down` on the other box to set the box's
nexthop interface linkdown. The kernel routes will be kept as `linkdown`,
but are still with active nexthop in `zebra`.

Add three changes/commits for kernel routes in this PR:

1) The active nexthop should be the operative interface.
2) Don't uninstall the kernel routes from `zebra` even no active nexthops.
   (It doesn't affect the kernel routes' deletion from kernel netlink messages.)
3) Update the kernel routes when the nexthop interface becomes up.

Before: (during nexthop interface is linkdown)
```
K>* 3.3.3.3/32 [0/0] via 88.88.88.1, enp2s0, weight 1, 00:00:14
```

After: (during nexthop interface is linkdown, with all three changes)
```
K   3.3.3.3/32 [0/0] via 88.88.88.1, enp2s0 inactive, weight 1, 00:00:07
```

This commit is 1st change:
Improve the judgment for "active" nexthop to be more accurate, the active
nexthop should be the operative interface.

Signed-off-by: anlan_cs <anlan_cs@126.com>
4 months agobgpd: remove unneeded printfrr reg for pRN 17654/head
Mark Stapp [Mon, 16 Dec 2024 20:35:29 +0000 (15:35 -0500)]
bgpd: remove unneeded printfrr reg for pRN

Remove a printfrr registration for pRN from bgpd.

Signed-off-by: Mark Stapp <mjs@cisco.com>
4 months agobgpd: Releasing the label in bgp_delete flow 17580/head
varuntumbe [Thu, 12 Dec 2024 12:27:02 +0000 (17:57 +0530)]
bgpd: Releasing the label in bgp_delete flow

Releasing the vpn label from label pool chunk using bgp_lp_release routine whenever vpn session is removed.
bgp_lp_release will clear corresponding bit in the allocated map of the label pool chunk and increases nfree by 1

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
4 months agotopotests: Adding a test to control release of BGP labels
varuntumbe [Thu, 12 Dec 2024 12:25:37 +0000 (17:55 +0530)]
topotests: Adding a test to control release of BGP labels

Adding the topotest which verifies whether label beloning to corresponding chunk has been released properly or not once
we remove the vpn session

Signed-off-by: Varun Hegde <varuntumbe1@gmail.com>
4 months agoMerge pull request #17252 from nabahr/mcast-mode
Rafael Zalamena [Mon, 16 Dec 2024 12:57:31 +0000 (09:57 -0300)]
Merge pull request #17252 from nabahr/mcast-mode

Fix PIMD RPF lookup mode and nexthop tracking

4 months agolib: darr: fix bug with nested macro use 17648/head
Christian Hopps [Mon, 16 Dec 2024 02:37:41 +0000 (21:37 -0500)]
lib: darr: fix bug with nested macro use

- WHen declaring macro scoped variables, can run into problem if the macro
variable passed in has the same name as the new variable introduced in the inner
scope. We don't get a warning and the uses will be wrong.

e.g.,

```

{
    int __len = 10;
    foo(__len); // => 10 and not 15 as we wanted.
}
```

Signed-off-by: Christian Hopps <chopps@labn.net>
4 months agolib: mgmtd: use less common macro scoped variable names
Christian Hopps [Mon, 16 Dec 2024 03:00:01 +0000 (22:00 -0500)]
lib: mgmtd: use less common macro scoped variable names

- ran into problem with darr macros and nested macros using the same name
variables as passed in variables in an out scope. Make these macro scoped
variables more unique as well.

Signed-off-by: Christian Hopps <chopps@labn.net>