]> git.puffer.fish Git - matthieu/frr.git/log
matthieu/frr.git
21 months agotests: add one test to bgp_exclude_aspath_exclude.py
Francois Dumontet [Wed, 12 Jul 2023 17:55:52 +0000 (19:55 +0200)]
tests: add one test to bgp_exclude_aspath_exclude.py

add support of  set as-path exclude as-path-access-list

Signed-off-by: Francois Dumontet <francois.dumontet@6wind.com>
21 months agodoc: set as-path exclude as-path-access-list
Francois Dumontet [Wed, 12 Jul 2023 17:54:37 +0000 (19:54 +0200)]
doc: set as-path exclude as-path-access-list

Signed-off-by: Francois Dumontet <francois.dumontet@6wind.com>
21 months agobgpd: add set as-path exclude acl-list command
Francois Dumontet [Wed, 12 Jul 2023 17:44:02 +0000 (19:44 +0200)]
bgpd: add set as-path exclude acl-list command

A route-map applied on incoming BGP updates is not able
to exclude the unwanted as segments, based on an AS path
access-list.

The below configuration illustrates the case:

router bgp 65001

address-family ipv4 unicast
 neighbor 192.168.1.2 route-map rule_2 in
exit-address-family

bgp as-path access-list RULE permit ^65

route-map rule_2 permit 10
 set as-path exclude as-path-access-list RULE

```
BGP routing table entry for 10.10.10.10/32, version 13
Paths: (1 available, best #1, table default)
  Advertised to non peer-group peers:
  192.168.10.65
  65000 1 2 3 123
    192.168.10.65 from 192.168.10.65 (10.10.10.11)
      Origin IGP, metric 0, valid, external, best (First path received)
```

After:

```
do show ip bgp 10.10.10.10/32
BGP routing table entry for 10.10.10.10/32, version 15
    Paths: (1 available, best #1, table default)
      Advertised to non peer-group peers:
      192.168.10.65
      2 3 123
        192.168.10.65 from 192.168.10.65 (10.10.10.11)
          Origin IGP, metric 0, valid, external, best (First path
received)
```

Signed-off-by: Francois Dumontet <francois.dumontet@6wind.com>
21 months agoMerge pull request #10136 from idryzhov/frr-reload-exit
Mark Stapp [Tue, 18 Jul 2023 16:19:10 +0000 (12:19 -0400)]
Merge pull request #10136 from idryzhov/frr-reload-exit

tools: always append "exit" in frr-reload.py

21 months agoMerge pull request #13918 from rameshabhinay/evpn_memleak
Jafar Al-Gharaibeh [Tue, 18 Jul 2023 15:59:20 +0000 (10:59 -0500)]
Merge pull request #13918 from rameshabhinay/evpn_memleak

bgpd: fix bgp evpn cli memory leaks.

21 months agoMerge pull request #11831 from anlancs/fix/cleanup-default
Quentin Young [Tue, 18 Jul 2023 15:15:39 +0000 (15:15 +0000)]
Merge pull request #11831 from anlancs/fix/cleanup-default

zebra: remove unnecessary check for default vrf

21 months agoMerge pull request #14041 from opensourcerouting/fix/memory_leak_bgp_redistribute_add
Donald Sharp [Tue, 18 Jul 2023 14:55:22 +0000 (10:55 -0400)]
Merge pull request #14041 from opensourcerouting/fix/memory_leak_bgp_redistribute_add

bgpd: Do not try to redistribute routes if we are shutting down

21 months agoMerge pull request #14015 from opensourcerouting/fix/bgpd_refactor_bgp_update_withdra...
Russ White [Tue, 18 Jul 2023 13:42:07 +0000 (09:42 -0400)]
Merge pull request #14015 from opensourcerouting/fix/bgpd_refactor_bgp_update_withdraw_safi

bgpd: Refactor a bit bgp_{update,withdraw} functions

21 months agoMerge pull request #14037 from opensourcerouting/feature/enable_software_capability_f...
Donald Sharp [Tue, 18 Jul 2023 13:19:19 +0000 (09:19 -0400)]
Merge pull request #14037 from opensourcerouting/feature/enable_software_capability_for_datacenter_profile_by_default

bgpd: Enable software version capability for datacenter profile

21 months agoMerge pull request #13868 from zice312963205/zly_mapflag
Russ White [Tue, 18 Jul 2023 13:14:50 +0000 (09:14 -0400)]
Merge pull request #13868 from zice312963205/zly_mapflag

bgpd:Fixing a conflict issue between rmap_in_change_flag and rmap_out…

21 months agoMerge pull request #13974 from pguibert6WIND/bgp_nht_other_if_cases_2
Russ White [Tue, 18 Jul 2023 13:10:50 +0000 (09:10 -0400)]
Merge pull request #13974 from pguibert6WIND/bgp_nht_other_if_cases_2

Bgp nht other if cases 2

21 months agoMerge pull request #12964 from FRIDM636/bmp-basic-test
Russ White [Tue, 18 Jul 2023 12:53:07 +0000 (08:53 -0400)]
Merge pull request #12964 from FRIDM636/bmp-basic-test

Add basic bgp bmp test

21 months agoMerge pull request #13140 from rgwan/master
Donatas Abraitis [Tue, 18 Jul 2023 11:58:05 +0000 (14:58 +0300)]
Merge pull request #13140 from rgwan/master

ospfd: Show advertise router in 'show ip ospf route' command

21 months agobgpd: Do not try to redistribute routes if we are shutting down
Donatas Abraitis [Tue, 18 Jul 2023 10:14:08 +0000 (13:14 +0300)]
bgpd: Do not try to redistribute routes if we are shutting down

When switching `router bgp`, `no router bgp` and doing redistributions, we should
ignore this action, otherwise memory leak happens:

```
Indirect leak of 400 byte(s) in 2 object(s) allocated from:
    0 0x7f81b36b3a06 in __interceptor_calloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cc:153
    1 0x7f81b327bd2e in qcalloc lib/memory.c:105
    2 0x55f301d28628 in bgp_node_create bgpd/bgp_table.c:92
    3 0x7f81b3309d0b in route_node_new lib/table.c:52
    4 0x7f81b3309d0b in route_node_set lib/table.c:61
    5 0x7f81b330be0a in route_node_get lib/table.c:319
    6 0x55f301ce89df in bgp_redistribute_add bgpd/bgp_route.c:8907
    7 0x55f301dac182 in zebra_read_route bgpd/bgp_zebra.c:593
    8 0x7f81b334dcd7 in zclient_read lib/zclient.c:4179
    9 0x7f81b331d702 in event_call lib/event.c:1995
    10 0x7f81b325d597 in frr_run lib/libfrr.c:1213
    11 0x55f301b94b12 in main bgpd/bgp_main.c:505
    12 0x7f81b2b57082 in __libc_start_main ../csu/libc-start.c:308
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
21 months agobgpd: fix bgp evpn cli memory leaks.
Abhinay Ramesh [Mon, 3 Jul 2023 09:40:11 +0000 (09:40 +0000)]
bgpd: fix bgp evpn cli memory leaks.

problem:
In CLI config codeflow there are memory leaks in failure scenario

Fix:
Code changes are done to free ecommunity

Signed-off-by: Abhinay Ramesh <rabhinay@vmware.com>
21 months agoMerge pull request #14033 from donaldsharp/zebra_same_route
Donatas Abraitis [Tue, 18 Jul 2023 07:37:15 +0000 (10:37 +0300)]
Merge pull request #14033 from donaldsharp/zebra_same_route

Zebra same route

21 months agoMerge pull request #14009 from rgangam-PAN/master
Donatas Abraitis [Tue, 18 Jul 2023 06:47:10 +0000 (09:47 +0300)]
Merge pull request #14009 from rgangam-PAN/master

test_grpc.cpp Fix Compilation Error and RuntimePath for finding grpc.so

21 months agobgpd: Send software-version capability by default
Donatas Abraitis [Mon, 17 Jul 2023 19:25:39 +0000 (22:25 +0300)]
bgpd: Send software-version capability by default

Useful to have it for datacenter profile only, disabled for traditional.

If the peer is not established or established, but has no description set,
we will show the FRR version instead, which is kinda handy to have instead of
nothing.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
21 months agotests: Add SPDX-License-Identifier for bgp_software_version topotest
Donatas Abraitis [Tue, 18 Jul 2023 06:33:36 +0000 (09:33 +0300)]
tests: Add SPDX-License-Identifier for bgp_software_version topotest

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
21 months agoospfd: Support show intra-area network type in 'show ip ospf route' command
Zhiyuan Wan [Mon, 3 Apr 2023 08:21:15 +0000 (16:21 +0800)]
ospfd: Support show intra-area network type in 'show ip ospf route' command

User can now use 'show ip ospf route detail' command to distinguish
intra-area stub network and transit network.
Transit network will be displayed as 'N T prefix ...'.

NOTICE: Json output format has been changed, intra-area transit networks
will have a new attribute 'transit' and value is 'true'.
And 'adv' (means advertise router) change to 'advertisedRouter'.

Example output:

bsp-debianrt-exp1# show ip ospf route detail
Codes: N  - network     T - transitive
       IA - inter-area  E - external route
       D  - destination R - router

============ OSPF network routing table ============
N T  10.0.0.0/24           [32] area: 0.0.0.0
                           via 192.168.124.67, ens192
                           adv 10.0.0.5
N    10.0.30.0/24          [33] area: 0.0.0.0
                           via 192.168.124.67, ens192
                           adv 10.0.0.5
...

Signed-off-by: Zhiyuan Wan <h@iloli.bid>
21 months agoospfd: Fix wrong advertise router calculation in transit network
Zhiyuan Wan [Mon, 3 Apr 2023 06:35:14 +0000 (14:35 +0800)]
ospfd: Fix wrong advertise router calculation in transit network

The ospfd mistakenly copy advertise router from vertex->id, which may
not be correct in an OSPF transit network.

Signed-off-by: Zhiyuan Wan <h@iloli.bid>
21 months agoospfd: Support show advertise router in 'show ip ospf route' command
Zhiyuan Wan [Wed, 29 Mar 2023 15:05:20 +0000 (23:05 +0800)]
ospfd: Support show advertise router in 'show ip ospf route' command

Users can now use 'show ip ospf route [detail]' command to show the
originator of each OSPF route item.

Signed-off-by: Zhiyuan Wan <h@iloli.bid>
21 months agotest: fix the topotest case for the bug fix
Jack.zhang [Fri, 30 Jun 2023 12:13:36 +0000 (20:13 +0800)]
test: fix the topotest case for the bug fix

Signed-off-by: Jack.zhang <hanyu.zly@alibaba-inc.com>
21 months agoMerge pull request #14025 from guoguojia2021/guozhongfeng_alibaba
Donald Sharp [Mon, 17 Jul 2023 18:27:56 +0000 (14:27 -0400)]
Merge pull request #14025 from guoguojia2021/guozhongfeng_alibaba

zebra: The command ipv6 nht xxx not work

21 months agozebra: Further handle route replace semantics
Donald Sharp [Mon, 17 Jul 2023 14:00:32 +0000 (10:00 -0400)]
zebra: Further handle route replace semantics

When an upper level protocol is installing a route X that needs to be
route replaced and at the same time the same or another protocol installs a
different route that depends on route X for nexthop resolution can leave
us with a state where the route is not accepted because zebra is still
really early in the route replace semantics ( route X is still on the work
Queue to be processed ) then the dependent route would not be installed.
This came up in the bgp_default_originate test cases frequently.

Further extendd the ROUTE_ENTR_ROUTE_REPLACING flag to cover this case
as well.  This has come up because the early route processing queueing
that was implemented late last year.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
21 months agotools: Add what FRR thinks as the fib routes for support_bundle
Donald Sharp [Mon, 17 Jul 2023 13:56:06 +0000 (09:56 -0400)]
tools: Add what FRR thinks as the fib routes for support_bundle

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
21 months agoMerge pull request #14017 from donaldsharp/bgp_always_compare_med_crash
Donatas Abraitis [Mon, 17 Jul 2023 12:12:46 +0000 (15:12 +0300)]
Merge pull request #14017 from donaldsharp/bgp_always_compare_med_crash

bgpd: Prevent use after free

21 months agoMerge pull request #14027 from LabNConsulting/ziemba-topotests-babel-relax
Donatas Abraitis [Mon, 17 Jul 2023 09:27:38 +0000 (12:27 +0300)]
Merge pull request #14027 from LabNConsulting/ziemba-topotests-babel-relax

tests: test_babel_topo1: tolerate slow results

21 months agoMerge pull request #14011 from opensourcerouting/fix/add_rfc5396_to_supported_list
Jafar Al-Gharaibeh [Mon, 17 Jul 2023 04:53:32 +0000 (23:53 -0500)]
Merge pull request #14011 from opensourcerouting/fix/add_rfc5396_to_supported_list

doc: Add RFC 5396 to the supported BGP RFC list

21 months agotests: test_babel_topo1: tolerate slow results
G. Paul Ziemba [Sun, 16 Jul 2023 21:30:24 +0000 (14:30 -0700)]
tests: test_babel_topo1: tolerate slow results

Signed-off-by: G. Paul Ziemba <paulz@labn.net>
21 months agozebra: The command ipv6 nht xxx not work
guozhongfeng [Fri, 14 Jul 2023 08:08:50 +0000 (16:08 +0800)]
zebra: The command ipv6 nht xxx not work

If the command is ipv6 nht protocol route-map rmap, this parameter should use AFI_IP6

Signed-off-by: guozhongfeng <guozhongfeng.gzf@alibaba-inc.com>
21 months agoMerge pull request #14019 from LabNConsulting/chopps/fix-mgmtd-assert
Donald Sharp [Sat, 15 Jul 2023 20:05:09 +0000 (16:05 -0400)]
Merge pull request #14019 from LabNConsulting/chopps/fix-mgmtd-assert

fix double lock bug and cmd resume early bugs

21 months agoMerge pull request #14020 from LabNConsulting/chopps/check-bt-cores-per-test
Donald Sharp [Sat, 15 Jul 2023 19:59:25 +0000 (15:59 -0400)]
Merge pull request #14020 from LabNConsulting/chopps/check-bt-cores-per-test

check for bt and cores per test

21 months agoMerge pull request #14008 from LabNConsulting/chopps/fix-backtrace
Donald Sharp [Sat, 15 Jul 2023 19:59:15 +0000 (15:59 -0400)]
Merge pull request #14008 from LabNConsulting/chopps/fix-backtrace

tests: fix/improve the printing of backtrace from cores

21 months agotests: backtraces/cores now fail tests
Christian Hopps [Sat, 15 Jul 2023 04:04:05 +0000 (00:04 -0400)]
tests: backtraces/cores now fail tests

Previously we just raised an error for the test file with possibly all tests
passing. Now we fail any test that produces new backtraces or cores. This
just works a lot better with analysis and even CI.

Also be less verbose to the console after failure runs, just show error
level and above logs. The log files still capture all levels (DEBUG).

Signed-off-by: Christian Hopps <chopps@labn.net>
21 months agotests: add regression test for issue $13920
Christian Hopps [Fri, 14 Jul 2023 23:29:57 +0000 (19:29 -0400)]
tests: add regression test for issue $13920

Signed-off-by: Christian Hopps <chopps@labn.net>
21 months agovtysh: track and fix file-lock use in the workaround from 2004
Christian Hopps [Fri, 14 Jul 2023 22:21:55 +0000 (18:21 -0400)]
vtysh: track and fix file-lock use in the workaround from 2004

There's a workaround in the code from a bug from back in 2004, it ends
and re-enters config mode anytime an `exit` is done from a level below
the top-level config node (e.g., from a `router isis` node). We need to
re-enter config mode with or without a lock according to how we actually
entered it to begin with.

fixes #13920

Signed-off-by: Christian Hopps <chopps@labn.net>
21 months agolib: mgmtd: only clear pending for the in-progress command
Christian Hopps [Fri, 14 Jul 2023 20:13:54 +0000 (16:13 -0400)]
lib: mgmtd: only clear pending for the in-progress command

The lock/unlocks are being done short-circuit so they are never pending;
however, the handling of the unlock notification was always resuming the command
if pending was set. In all cases pending is set for another command. For example
implicit commit locks then when notified its done unlocks which was clearing the
set-config pending flag and resuming that command incorrectly.

Signed-off-by: Christian Hopps <chopps@labn.net>
21 months agobgpd: Prevent use after free
Donald Sharp [Fri, 14 Jul 2023 16:14:20 +0000 (12:14 -0400)]
bgpd: Prevent use after free

When running bgp_always_compare_med, I am frequently seeing a crash
After running with valgrind I am seeing this and a invalid write
immediately after this as well.

==311743== Invalid read of size 2
==311743==    at 0x4992421: route_map_counter_decrement (routemap.c:3308)
==311743==    by 0x35664D: peer_route_map_unset (bgpd.c:7259)
==311743==    by 0x306546: peer_route_map_unset_vty (bgp_vty.c:8037)
==311743==    by 0x3066AC: no_neighbor_route_map (bgp_vty.c:8081)
==311743==    by 0x49078DE: cmd_execute_command_real (command.c:990)
==311743==    by 0x4907A63: cmd_execute_command (command.c:1050)
==311743==    by 0x490801F: cmd_execute (command.c:1217)
==311743==    by 0x49C5535: vty_command (vty.c:551)
==311743==    by 0x49C7459: vty_execute (vty.c:1314)
==311743==    by 0x49C97D1: vtysh_read (vty.c:2223)
==311743==    by 0x49BE5E2: event_call (event.c:1995)
==311743==    by 0x494786C: frr_run (libfrr.c:1204)
==311743==    by 0x1F7655: main (bgp_main.c:505)
==311743==  Address 0x9ec2180 is 64 bytes inside a block of size 120 free'd
==311743==    at 0x484B27F: free (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==311743==    by 0x495A1BA: qfree (memory.c:130)
==311743==    by 0x498D412: route_map_free_map (routemap.c:748)
==311743==    by 0x498D176: route_map_add (routemap.c:672)
==311743==    by 0x498D79B: route_map_get (routemap.c:857)
==311743==    by 0x499C256: lib_route_map_create (routemap_northbound.c:102)
==311743==    by 0x49702D8: nb_callback_create (northbound.c:1234)
==311743==    by 0x497107F: nb_callback_configuration (northbound.c:1578)
==311743==    by 0x4971693: nb_transaction_process (northbound.c:1709)
==311743==    by 0x496FCF4: nb_candidate_commit_apply (northbound.c:1103)
==311743==    by 0x496FE4E: nb_candidate_commit (northbound.c:1136)
==311743==    by 0x497798F: nb_cli_classic_commit (northbound_cli.c:49)
==311743==    by 0x4977B4F: nb_cli_pending_commit_check (northbound_cli.c:88)
==311743==    by 0x49078C1: cmd_execute_command_real (command.c:987)
==311743==    by 0x4907B44: cmd_execute_command (command.c:1068)
==311743==    by 0x490801F: cmd_execute (command.c:1217)
==311743==    by 0x49C5535: vty_command (vty.c:551)
==311743==    by 0x49C7459: vty_execute (vty.c:1314)
==311743==    by 0x49C97D1: vtysh_read (vty.c:2223)
==311743==    by 0x49BE5E2: event_call (event.c:1995)
==311743==    by 0x494786C: frr_run (libfrr.c:1204)
==311743==    by 0x1F7655: main (bgp_main.c:505)
==311743==  Block was alloc'd at
==311743==    at 0x484DA83: calloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==311743==    by 0x495A068: qcalloc (memory.c:105)
==311743==    by 0x498D0C8: route_map_new (routemap.c:646)
==311743==    by 0x498D128: route_map_add (routemap.c:658)
==311743==    by 0x498D79B: route_map_get (routemap.c:857)
==311743==    by 0x499C256: lib_route_map_create (routemap_northbound.c:102)
==311743==    by 0x49702D8: nb_callback_create (northbound.c:1234)
==311743==    by 0x497107F: nb_callback_configuration (northbound.c:1578)
==311743==    by 0x4971693: nb_transaction_process (northbound.c:1709)
==311743==    by 0x496FCF4: nb_candidate_commit_apply (northbound.c:1103)
==311743==    by 0x496FE4E: nb_candidate_commit (northbound.c:1136)
==311743==    by 0x497798F: nb_cli_classic_commit (northbound_cli.c:49)
==311743==    by 0x4977B4F: nb_cli_pending_commit_check (northbound_cli.c:88)
==311743==    by 0x49078C1: cmd_execute_command_real (command.c:987)
==311743==    by 0x4907B44: cmd_execute_command (command.c:1068)
==311743==    by 0x490801F: cmd_execute (command.c:1217)
==311743==    by 0x49C5535: vty_command (vty.c:551)
==311743==    by 0x49C7459: vty_execute (vty.c:1314)
==311743==    by 0x49C97D1: vtysh_read (vty.c:2223)
==311743==    by 0x49BE5E2: event_call (event.c:1995)
==311743==    by 0x494786C: frr_run (libfrr.c:1204)

Effectively the route_map that is being stored has been freed already
but we have not cleaned up properly yet.  Go through and clean the
code up by ensuring that the pointer actually exists instead of trusting
it does when doing the decrement operation.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
21 months agobgpd: Drop bgp_static_update_safi() function
Donatas Abraitis [Fri, 14 Jul 2023 11:10:14 +0000 (14:10 +0300)]
bgpd: Drop bgp_static_update_safi() function

Combine bgp_static_update() and bgp_static_update_safi() into a single one.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
21 months agobgpd: Drop bgp_static_withdraw_safi() function
Donatas Abraitis [Fri, 14 Jul 2023 10:34:47 +0000 (13:34 +0300)]
bgpd: Drop bgp_static_withdraw_safi() function

Combine bgp_static_withdraw() and bgp_static_withdraw_safi() into a single one.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
21 months agotests: fix/improve the printing of backtrace from cores
Christian Hopps [Fri, 14 Jul 2023 00:44:53 +0000 (20:44 -0400)]
tests: fix/improve the printing of backtrace from cores

Signed-off-by: Christian Hopps <chopps@labn.net>
21 months agoMerge pull request #13575 from anlancs/fix/zebra-if-vrf-change
Donatas Abraitis [Fri, 14 Jul 2023 09:11:38 +0000 (12:11 +0300)]
Merge pull request #13575 from anlancs/fix/zebra-if-vrf-change

zebra: Fix wrong vrf change procedure

21 months agoMerge pull request #13993 from achernavin22/fix-rmap-on-match2
Donatas Abraitis [Fri, 14 Jul 2023 09:05:02 +0000 (12:05 +0300)]
Merge pull request #13993 from achernavin22/fix-rmap-on-match2

lib: fix on-match when added to existing route-map entry

21 months agodoc: Add RFC 5396 to the supported BGP RFC list
Donatas Abraitis [Fri, 14 Jul 2023 07:29:45 +0000 (10:29 +0300)]
doc: Add RFC 5396 to the supported BGP RFC list

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
21 months agotests: Fix Compilation Error and RuntimePath changes for test_grpc
Rajesh Gangam [Fri, 14 Jul 2023 00:56:06 +0000 (00:56 +0000)]
tests: Fix Compilation Error and RuntimePath changes for test_grpc

The runtime path for grpc.so has been changed for test_grpc.cpp
and also there were couple of definitions which are duplicate,
hence renamed them.

Signed-off-by: Rajesh Gangam <rajeshgangam@gmail.com>
21 months agobgpd: upon if event, evaluate bnc with matching nexthop
Philippe Guibert [Thu, 11 May 2023 15:11:14 +0000 (17:11 +0200)]
bgpd: upon if event, evaluate bnc with matching nexthop

In BGP, when an interface event is detected or triggered,
the BNC that have a next-hop that matches the interface
are not evaluated.

The paths attached to the bnc context are evaluated in the
following situation:
- In the up event case, if at least one next-hop interface
matched the event interface.
- In the down event case, if there is no alternate next-hop
that does not use the event interface.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
21 months agobgpd: rename bnc->ifindex to bnc->ifindex_ipv6_ll
Philippe Guibert [Thu, 11 May 2023 15:10:58 +0000 (17:10 +0200)]
bgpd: rename bnc->ifindex to bnc->ifindex_ipv6_ll

This commit changes the 'ifindex' name of the bnc structure.
As it is used only to handle ipv6 link local addresses, let
us use the 'ifindex_ipv6_ll' naming to avoid any confusions
with the ifindex value of the resolved next-hops of the bnc
structure.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
21 months agolib: fix on-match when added to existing route-map entry
Alexander Chernavin [Fri, 14 Oct 2022 09:02:06 +0000 (09:02 +0000)]
lib: fix on-match when added to existing route-map entry

Currently, "on-match (next|goto)" only works if already present in a
route-map entry when the route-map is applied to the routes. However, if
the command is added to an existing route-map entry, the route-map is
not reapplied to the routes in order to accommodate the changes. And
service restart is needed. The problem is that setting the command
doesn't signal about the change to the listener (i.e. to a routing
daemon).

With this fix, signal to the listener about addition of "on-match
(next|goto)" to a route-map entry.

Signed-off-by: Alexander Chernavin <achernavin@netgate.com>
21 months agobgpd: ignore the wrong interface for nht procedure
anlan_cs [Mon, 5 Jun 2023 08:23:16 +0000 (16:23 +0800)]
bgpd: ignore the wrong interface for nht procedure

`bnc->ifindex` should not be with 0 ( IFINDEX_INTERNAL ), so we can ignore
the wrong interface to make it safe.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
21 months agozebra: Fix wrong vrf change procedure
anlan_cs [Mon, 22 May 2023 10:32:23 +0000 (18:32 +0800)]
zebra: Fix wrong vrf change procedure

Currently the vrf change procedure for the deleted interface is after
its deletion, it causes problem for upper daemons.

Here is the problem of `bgp`:

After deletion of one **irrelevant** interface in the same vrf, its
`ifindex` is set to 0. And then, the vrf change procedure will send
"ZEBRA_INTERFACE_DOWN" to `bgpd`.

Normally, `bgp_nht_ifp_table_handle()` should igore this message for
no correlation. However, it wrongly matched `ifindex` of 0, and removed
the related routes for the down `bnc`.

Adjust the location of the vrf change procedure to fix this issue.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
21 months agoMerge pull request #13717 from anlancs/fix/pimd-igmp-prot-back-2
mobash-rasool [Thu, 13 Jul 2023 05:34:52 +0000 (11:04 +0530)]
Merge pull request #13717 from anlancs/fix/pimd-igmp-prot-back-2

pimd: Fix wrong protocol for SSM

21 months agoMerge pull request #13937 from donaldsharp/ospf6_lsa_unlock_fix
mobash-rasool [Thu, 13 Jul 2023 03:42:37 +0000 (09:12 +0530)]
Merge pull request #13937 from donaldsharp/ospf6_lsa_unlock_fix

ospf6d: Convert ospf6_lsa_unlock to a better api

21 months agoospf6d: Convert ospf6_lsa_unlock to a better api
Donald Sharp [Wed, 5 Jul 2023 13:28:50 +0000 (09:28 -0400)]
ospf6d: Convert ospf6_lsa_unlock to a better api

Make the ospf6_lsa_unlock take the same parameters
that the ospf_lsa_unlock does to make it consistent
and to also ensure that no-one can make the mistake
of getting the pointer cleared up.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
21 months agoMerge pull request #13891 from opensourcerouting/fix/ignore_errors_from_frr-reload.py
Donald Sharp [Wed, 12 Jul 2023 19:11:58 +0000 (15:11 -0400)]
Merge pull request #13891 from opensourcerouting/fix/ignore_errors_from_frr-reload.py

tools: Ignore errors for frr reload stuff

21 months agoMerge pull request #13977 from anlancs/fix/mgmt-bool-change
Donald Sharp [Wed, 12 Jul 2023 18:45:58 +0000 (14:45 -0400)]
Merge pull request #13977 from anlancs/fix/mgmt-bool-change

mgmtd: adjust one unnecessary bool convert

21 months agoMerge pull request #13983 from WiMoVE-OSS/bgpd-memory-leak-table-stats-single
Donald Sharp [Wed, 12 Jul 2023 18:45:09 +0000 (14:45 -0400)]
Merge pull request #13983 from WiMoVE-OSS/bgpd-memory-leak-table-stats-single

bgpd: Fix memory leak by moving allocation of json object

21 months agotopotests: add basic bgp bmp test
Farid Mihoub [Tue, 7 Mar 2023 09:59:14 +0000 (10:59 +0100)]
topotests: add basic bgp bmp test

Test BMP messages logging.
Configure the BMP monitoring policy, add and withdraw IPv4/v6 prefixes.
Check if the received messages coincide with the monitored router BGP
session activity.

Signed-off-by: Farid Mihoub <farid.mihoub@6wind.com>
21 months agotopotests: add basic bmp collector
Farid Mihoub [Tue, 25 Apr 2023 15:27:46 +0000 (17:27 +0200)]
topotests: add basic bmp collector

Signed-off-by: Farid Mihoub <farid.mihoub@6wind.com>
21 months agomgmtd: adjust one unnecessary bool convert
anlan_cs [Mon, 10 Jul 2023 05:36:24 +0000 (13:36 +0800)]
mgmtd: adjust one unnecessary bool convert

It is unnecessary to do the bool calculation for expression.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
21 months agozebra: remove unnecessary check for default vrf
anlan_cs [Wed, 17 Aug 2022 07:26:24 +0000 (03:26 -0400)]
zebra: remove unnecessary check for default vrf

The default vrf is generally non-NULL, except when shutdown. So, most
of the time it is not necessary to check if it is NULL, we should
remove the useless checks for it.

Searched them with exact match:
```
grep -rI "zebra_vrf_lookup_by_id(VRF_DEFAULT)" | wc -l
31
```

Signed-off-by: anlan_cs <vic.lan@pica8.com>
21 months agoMerge pull request #13968 from zhengxiang311019/patch-1
Donald Sharp [Tue, 11 Jul 2023 16:25:40 +0000 (12:25 -0400)]
Merge pull request #13968 from zhengxiang311019/patch-1

doc: fix the error path.

21 months agoMerge pull request #13963 from chiragshah6/fdev4
Russ White [Tue, 11 Jul 2023 15:52:02 +0000 (11:52 -0400)]
Merge pull request #13963 from chiragshah6/fdev4

tools: fix ospf area stub summary in frr-reload

21 months agoMerge pull request #13885 from donaldsharp/tests_need_to_be_stricter
Russ White [Tue, 11 Jul 2023 15:49:38 +0000 (11:49 -0400)]
Merge pull request #13885 from donaldsharp/tests_need_to_be_stricter

Tests need to be stricter

21 months agoMerge pull request #13876 from LabNConsulting/mjs/nhrp_resolving
Russ White [Tue, 11 Jul 2023 15:48:16 +0000 (11:48 -0400)]
Merge pull request #13876 from LabNConsulting/mjs/nhrp_resolving

Allow NHRP routes to validate incoming nexthops

21 months agoMerge pull request #13691 from LabNConsulting/aceelindem/ospf-opaque-interface-disable
Russ White [Tue, 11 Jul 2023 15:47:32 +0000 (11:47 -0400)]
Merge pull request #13691 from LabNConsulting/aceelindem/ospf-opaque-interface-disable

ospfd: Configurable interface-level 'capability opaque' support

21 months agoMerge pull request #13958 from opensourcerouting/fix/coverity
Donald Sharp [Tue, 11 Jul 2023 15:26:47 +0000 (11:26 -0400)]
Merge pull request #13958 from opensourcerouting/fix/coverity

Coverity fixes

21 months agoMerge pull request #13880 from mjstapp/fix_ospf_intf_socket
Russ White [Tue, 11 Jul 2023 14:23:37 +0000 (10:23 -0400)]
Merge pull request #13880 from mjstapp/fix_ospf_intf_socket

ospfd: fix per-interface sockets

21 months agoMerge pull request #13936 from ryndia/fix_ospf_lsa_leak
Russ White [Tue, 11 Jul 2023 14:22:22 +0000 (10:22 -0400)]
Merge pull request #13936 from ryndia/fix_ospf_lsa_leak

ospfd: fix lsa leak

21 months agobgpd: Fix memory leak by moving allocation of json object
Alexander Sohn [Tue, 11 Jul 2023 14:21:57 +0000 (16:21 +0200)]
bgpd: Fix memory leak by moving allocation of json object

Signed-off-by: Alexander Sohn <github@asohn.de>
21 months agoMerge pull request #13947 from opensourcerouting/feature/bgpd_show_version_if_descrip...
Russ White [Tue, 11 Jul 2023 14:20:04 +0000 (10:20 -0400)]
Merge pull request #13947 from opensourcerouting/feature/bgpd_show_version_if_description_is_not_defined

bgpd: Show neighbors software version if description is not set

21 months agoMerge pull request #13948 from opensourcerouting/fix/bgpd_rfc7606_adjustments
Russ White [Tue, 11 Jul 2023 14:19:30 +0000 (10:19 -0400)]
Merge pull request #13948 from opensourcerouting/fix/bgpd_rfc7606_adjustments

bgpd: Some rfc7606 adjustments

21 months agoMerge pull request #13955 from opensourcerouting/fix/deprecate_orf_bgpd_130
Russ White [Tue, 11 Jul 2023 14:18:19 +0000 (10:18 -0400)]
Merge pull request #13955 from opensourcerouting/fix/deprecate_orf_bgpd_130

bgpd: Deprecate Prestandard Outbound Route Filtering capability

21 months agoMerge pull request #13956 from chiragshah6/fdev2
Russ White [Tue, 11 Jul 2023 14:16:55 +0000 (10:16 -0400)]
Merge pull request #13956 from chiragshah6/fdev2

bgpd: fix evpn zclient_send_messge return code

21 months agoMerge pull request #13964 from pguibert6WIND/mpls_again
Russ White [Tue, 11 Jul 2023 14:12:04 +0000 (10:12 -0400)]
Merge pull request #13964 from pguibert6WIND/mpls_again

zebra: fix mpls config on ifaces created post frr

21 months agoMerge pull request #13970 from ton31337/fix/bgpd_tunnel_encap_attr
Russ White [Tue, 11 Jul 2023 14:09:25 +0000 (10:09 -0400)]
Merge pull request #13970 from ton31337/fix/bgpd_tunnel_encap_attr

bgpd: Get 1 or 2 octets for Sub-TLV length (Tunnel Encap attr)

21 months agoMerge pull request #13971 from opensourcerouting/fix-bgp-delayopen-expire-test
Russ White [Tue, 11 Jul 2023 14:09:01 +0000 (10:09 -0400)]
Merge pull request #13971 from opensourcerouting/fix-bgp-delayopen-expire-test

tests: fix BGP delayopen timer expiration test

21 months agoMerge pull request #13975 from mjstapp/fix_isis_gmtime
Russ White [Tue, 11 Jul 2023 14:05:43 +0000 (10:05 -0400)]
Merge pull request #13975 from mjstapp/fix_isis_gmtime

isisd: replace gmtime with gmtime_r

21 months agoMerge pull request #13976 from anlancs/fix/cleanup-23
Donatas Abraitis [Tue, 11 Jul 2023 10:21:09 +0000 (13:21 +0300)]
Merge pull request #13976 from anlancs/fix/cleanup-23

zebra: adjust one debug info

21 months agoMerge pull request #13972 from donaldsharp/bgp_sync_issue
Donatas Abraitis [Tue, 11 Jul 2023 09:53:44 +0000 (12:53 +0300)]
Merge pull request #13972 from donaldsharp/bgp_sync_issue

bgpd: Fix table manager to use the synchronous client

21 months agoMerge pull request #13715 from patrasar/pim_nexthop
Donatas Abraitis [Tue, 11 Jul 2023 08:25:18 +0000 (11:25 +0300)]
Merge pull request #13715 from patrasar/pim_nexthop

pimd, pim6d: Added pimEnabled field in "show ip pim nexthop json" cli

21 months agozebra: adjust one debug info
anlan_cs [Mon, 10 Jul 2023 13:42:14 +0000 (21:42 +0800)]
zebra: adjust one debug info

Adjust one debug info, separate the ip address from it. Just like it is processed
in `redistribute_update()`.

Before:
```
34:1375.75.75.75/32: Redist del: re 0x55c1112067e0 (0:static), new re 0x55c1112de7c0 (0:static)
```

After:
```
(34:13):75.75.75.75/32: Redist del: re 0x55c1112067e0 (0:static), new re 0x55c1112de7c0 (0:static)
```

Signed-off-by: anlan_cs <vic.lan@pica8.com>
21 months agodoc: fix the error path
xzheng [Mon, 10 Jul 2023 09:32:45 +0000 (17:32 +0800)]
doc: fix the error path

fix the error path.

Signed-off-by: xzheng <zhengxiang311019@163.com>
21 months agoisisd: replace gmtime with gmtime_r
Mark Stapp [Mon, 10 Jul 2023 21:06:17 +0000 (17:06 -0400)]
isisd: replace gmtime with gmtime_r

No gmtime() allowed - use gmtime_r()

Signed-off-by: Mark Stapp <mjs@labn.net>
21 months agotests: add route-install test using NHRP tunnel
Mark Stapp [Wed, 28 Jun 2023 19:33:57 +0000 (15:33 -0400)]
tests: add route-install test using NHRP tunnel

Add a test-case to the NHRP test that installs routes over the
NHRP tunnel endpoint routes. This confirms that zebra will use
NHRP routes when validating incoming routes from other daemons
(sharpd in this test).

Signed-off-by: Mark Stapp <mjs@labn.net>
21 months agosharpd: allow sharpd to install non-recursive routes
Mark Stapp [Wed, 28 Jun 2023 19:31:23 +0000 (15:31 -0400)]
sharpd: allow sharpd to install non-recursive routes

Add a config option so that sharpd can install routes without
the ALLOW_RECURSION flag, matching IGP behavior.
The default remains 'recursion'.

Signed-off-by: Mark Stapp <mjs@labn.net>
21 months agozebra: use NHRP routes as valid in nexthop check
Mark Stapp [Wed, 28 Jun 2023 12:11:41 +0000 (08:11 -0400)]
zebra: use NHRP routes as valid in nexthop check

Treat NHRP-installed routes as valid, as if they were
CONNECTED routes, when checking candidate routes'
nexthops for validity. This allows use of NHRP by an
IGP, for example, that doesn't normally want recursive
nexthop resolution.

Signed-off-by: Mark Stapp <mjs@labn.net>
21 months agonhrpd: clean up locals in route zapi api
Mark Stapp [Wed, 28 Jun 2023 12:10:40 +0000 (08:10 -0400)]
nhrpd: clean up locals in route zapi api

Clean up use of a nexthop pointer - seemed inconsistent.

Signed-off-by: Mark Stapp <mjs@labn.net>
21 months agozebra: Guard printing an error by checking if VRF is not NULL
Donatas Abraitis [Sat, 8 Jul 2023 08:26:03 +0000 (11:26 +0300)]
zebra: Guard printing an error by checking if VRF is not NULL

Check if vrf_lookup_by_id() didn't return a NULL before dereferencing in
flor_err().

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
21 months agozebra: Check if ifp is not NULL in zebra_if_update_ctx()
Donatas Abraitis [Sat, 8 Jul 2023 08:23:51 +0000 (11:23 +0300)]
zebra: Check if ifp is not NULL in zebra_if_update_ctx()

Use the same logic as zebra_if_netconf_update_ctx().

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
21 months agozebra: Do not check ifp for NULL
Donatas Abraitis [Sat, 8 Jul 2023 08:20:14 +0000 (11:20 +0300)]
zebra: Do not check ifp for NULL

It's already checked at the bottom of the function.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
21 months agobgpd: Fix table manager to use the synchronous client
Donald Sharp [Mon, 10 Jul 2023 14:40:38 +0000 (10:40 -0400)]
bgpd: Fix table manager to use the synchronous client

bgp_zebra_tm_connect calls bgp_zebra_get_table_range which
just used the global zclient.  Which of course still had
us exposing the global zclient to read and drop important
data from zebra.  This fixes commit 787c61e03c760ffdb422bfc44c72d83fb451e0c8

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
21 months agobgpd: Fix table manager to use the synchronous client
Donald Sharp [Mon, 10 Jul 2023 14:40:38 +0000 (10:40 -0400)]
bgpd: Fix table manager to use the synchronous client

bgp_zebra_tm_connect calls bgp_zebra_get_table_range which
just used the global zclient.  Which of course still had
us exposing the global zclient to read and drop important
data from zebra.  This fixes commit 787c61e03c760ffdb422bfc44c72d83fb451e0c8

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
21 months agotests: fix BGP delayopen timer expiration test
David Schweizer [Mon, 10 Jul 2023 13:46:05 +0000 (15:46 +0200)]
tests: fix BGP delayopen timer expiration test

The changes allow the test to correctly pass in case the connection
between two peers is be established in less than 0.5 seconds after the
delayopen timer expires.

Signed-off-by: David Schweizer <dschweizer@opensourcerouting.org>
21 months agozebra: Lookup up nlsock * one time in call tree
Donald Sharp [Mon, 3 Jul 2023 20:49:34 +0000 (16:49 -0400)]
zebra: Lookup up nlsock * one time in call tree

Code is looking up the nlsock to generate the batch messages
and then looking it up again to get the response.  Let's
just look it up one time.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
21 months agotests: bgp_flowspec expand timings
Donald Sharp [Mon, 3 Jul 2023 20:12:16 +0000 (16:12 -0400)]
tests: bgp_flowspec expand timings

Attempt to set the hold time in the bgp flowspec exabgp
config.  In addition it was noticed that upstream bgp_flowspec
tests are still not negotiating peering within the time frame
specified.  This is because the first tcp packet is missed
and no keepalive/hold time are negotiated and exabgp will
not attempt a reconnect for quite some time.  Make this
test slower when things go south.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
21 months agotests: Fix wrong config line in bgp_l3vpn_to_bgp_vrf
Donald Sharp [Mon, 3 Jul 2023 12:18:00 +0000 (08:18 -0400)]
tests: Fix wrong config line in bgp_l3vpn_to_bgp_vrf

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
21 months agotests: isis_tilfa_topo1 fails sometimes due to insufficient time
Donald Sharp [Sat, 1 Jul 2023 17:30:12 +0000 (13:30 -0400)]
tests: isis_tilfa_topo1 fails sometimes due to insufficient time

The isis_tilfa_topo1 test is failing because insufficient time was
given for isis to converge on the system under system load.  Extend
the time and decrease the hello-interval timers to give it more
of a chance to converge.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
21 months agotests: bgp_vpnv4_per_nexthop_label is failing
Donald Sharp [Sat, 1 Jul 2023 17:29:27 +0000 (13:29 -0400)]
tests: bgp_vpnv4_per_nexthop_label is failing

The test is failing because it assumes a json key
is always present when it is not.  Test for it
before having the test fail.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
21 months agotests: zebra_rib route-map run times fixup
Donald Sharp [Sat, 1 Jul 2023 17:27:52 +0000 (13:27 -0400)]
tests: zebra_rib route-map run times fixup

I have a local test run where the sharp route-map usage
was being checked for 5 seconds.  I saw usages going up
for each 1 second check and the 5th one was at 497 out
of 500.  Looks like the system was really loaded.  Let's
give it more time to coalesce under heavy load.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>