]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
11 months agoospfd: OSPF P2MP Delayed Reflooding configuration
Acee [Thu, 18 May 2023 14:43:52 +0000 (10:43 -0400)]
ospfd: OSPF P2MP Delayed Reflooding configuration

Currently, delayed reflooding on P2MP interfaces for LSAs received
from neighbors on the interface is unconditionally (see commit
c706f0e32ba8aa8780a0618b6fbba364c383ae05). In some cases, this
change wasn't desirable and this feature makes delayed reflooding
configurable for P2MP interfaces via the CLI command:
"ip ospf network point-to-multipoint delay-reflood" in interface
submode.

Signed-off-by: Acee <aceelindem@gmail.com>
11 months agoMerge pull request #13560 from donaldsharp/fpm_netlink_aroni
David Lamparter [Mon, 22 May 2023 13:46:29 +0000 (15:46 +0200)]
Merge pull request #13560 from donaldsharp/fpm_netlink_aroni

11 months agoMerge pull request #13506 from anlancs/fix/bfdd-vrf-check
Igor Ryzhov [Mon, 22 May 2023 11:24:34 +0000 (14:24 +0300)]
Merge pull request #13506 from anlancs/fix/bfdd-vrf-check

bfdd: Fix malformed session with vrf

11 months agoMerge pull request #13564 from chiragshah6/fdev1
Donatas Abraitis [Mon, 22 May 2023 06:45:54 +0000 (09:45 +0300)]
Merge pull request #13564 from chiragshah6/fdev1

 bgpd: aggregate route best path select and other fixes

11 months agoMerge pull request #13563 from donaldsharp/remove_true
Donatas Abraitis [Mon, 22 May 2023 06:38:53 +0000 (09:38 +0300)]
Merge pull request #13563 from donaldsharp/remove_true

tests: pytest does not like return True from a test

11 months agoMerge pull request #13566 from LabNConsulting/chopps/analyze-improvement
Donald Sharp [Mon, 22 May 2023 00:22:22 +0000 (20:22 -0400)]
Merge pull request #13566 from LabNConsulting/chopps/analyze-improvement

tests: have ananlyze.py `chown -R $SUDO_USER` when copying results

11 months agoMerge pull request #13568 from opensourcerouting/fix/timers_bgp_topotests
Donald Sharp [Mon, 22 May 2023 00:21:51 +0000 (20:21 -0400)]
Merge pull request #13568 from opensourcerouting/fix/timers_bgp_topotests

tests: Fix timers command for bgp_disable_addpath_rx test

11 months agoMerge pull request #13567 from opensourcerouting/fix/initialize_buf_char_for_path_inf...
Donald Sharp [Mon, 22 May 2023 00:21:21 +0000 (20:21 -0400)]
Merge pull request #13567 from opensourcerouting/fix/initialize_buf_char_for_path_info_cmp

bgpd: Initialize pfx_buf to zeros before using in bgp_path_info_cmp()

11 months agoMerge pull request #13565 from LabNConsulting/chopps/munet-update
Igor Ryzhov [Sat, 20 May 2023 11:11:05 +0000 (14:11 +0300)]
Merge pull request #13565 from LabNConsulting/chopps/munet-update

11 months agotests: Fix timers command for bgp_disable_addpath_rx test
Donatas Abraitis [Sat, 20 May 2023 07:06:49 +0000 (10:06 +0300)]
tests: Fix timers command for bgp_disable_addpath_rx test

Was incorrectly setting BGP timers.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
11 months agobgpd: Initialize pfx_buf to zeros before using in bgp_path_info_cmp()
Donatas Abraitis [Sat, 20 May 2023 07:03:10 +0000 (10:03 +0300)]
bgpd: Initialize pfx_buf to zeros before using in bgp_path_info_cmp()

This can lead into some garbage outputs, that can't be decoded in utf-8 or so.

This was catched when testing 76b246aa1f779e17ce6845c6ab0c292497b0008f.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
11 months agotests: munet to version 0.13.4
Christian Hopps [Sat, 20 May 2023 03:16:39 +0000 (23:16 -0400)]
tests: munet to version 0.13.4

Signed-off-by: Christian Hopps <chopps@labn.net>
11 months agotests: have ananlyze.py `chown -R $SUDO_USER` when copying results
Christian Hopps [Sat, 20 May 2023 03:14:18 +0000 (23:14 -0400)]
tests: have ananlyze.py `chown -R $SUDO_USER` when copying results

Signed-off-by: Christian Hopps <chopps@labn.net>
11 months agoMerge pull request #13559 from opensourcerouting/fix/ignore_decoding_chars
Donald Sharp [Sat, 20 May 2023 01:30:34 +0000 (21:30 -0400)]
Merge pull request #13559 from opensourcerouting/fix/ignore_decoding_chars

tests: Ignore utf-8 decoding errors

11 months agobgpd: fix memory leak in aggregate path info
Chirag Shah [Fri, 19 May 2023 18:41:38 +0000 (11:41 -0700)]
bgpd: fix memory leak in aggregate path info

Fix memory leak in aggregate route path info
comparison api.

Signed-off-by: Chirag shah <chirag@nvidia.com>
11 months agobgpd: fix aggregate route display
Chirag Shah [Fri, 19 May 2023 05:43:08 +0000 (22:43 -0700)]
bgpd: fix aggregate route display

Based on RFC-4760, if NEXT_HOP attribute is not
suppose to be set if MP_REACH_NLRI NLRI is used.
for IPv4 aggregate route only NEXT_HOP attribute
with ipv4 prefixlen needs to be set.

Testing Done:

Before fix:
----------
aggregate route:
*> 184.123.0.0/16   ::(TORC11)               0         32768 i

After fix:
---------
aggregate route:
*> 184.123.0.0/16   0.0.0.0(TORC11)          0         32768 i
* i                 peerlink-3               0    100      0 i
*                   uplink1                                0 4435 5546 i
   184.123.1.0/24   0.0.0.0(TORC11)          0         32768 i
s> 184.123.8.0/22   0.0.0.0(TORC11)          0         32768 i

Signed-off-by: Chirag Shah <chirag@nvidia.com>
11 months agobgpd: fix aggregate route best path select
Chirag Shah [Fri, 19 May 2023 04:49:03 +0000 (21:49 -0700)]
bgpd: fix aggregate route best path select

In ebgp+ ibgp deployment aggregate summary-only route
selected path should always be locally originated
summary route.
When aggregate route summary-only config is removed
The selected path is iBGP peer as its lower cost
Upon reconfiguring aggregate route summary-only,
the locally originated is not selected due to
always choosing first path attribute and bailing
out as no change in route update.

Ticket:#3467890
Issue:3467890
Testing Done:

Config:
------
TORC11(config-router)#router bgp
TORC11(config-router)# address-family ipv4 unicast
TORC11(config-router-af)# aggregate-address 184.123.0.0/16
        summary-only
TORC11(config-router-af)# no aggregate-address 184.123.0.0/16
        summary-only
TORC11(config-router-af)# aggregate-address 184.123.0.0/16
        summary-only

Before fix:
-----------
*> 184.123.0.0/16   ::(TORC11)               0         32768 i
*                   uplink1                                0 4435 5546 i
*                   uplink2                                0 4435 5546 i
* i                 peerlink-3               0    100      0 i

After fix:
----------
*> 184.123.0.0/16   ::(TORC11)               0         32768 i
* i                 peerlink-3               0    100      0 i
*                   uplink2                                0 4435 5546 i
*                   uplink1                                0 4435 5546 i

Signed-off-by: Chirag Shah <chirag@nvidia.com>
11 months agoMerge pull request #13562 from idryzhov/fix-doc-libyang-pluginsdir
Mark Stapp [Fri, 19 May 2023 18:58:33 +0000 (14:58 -0400)]
Merge pull request #13562 from idryzhov/fix-doc-libyang-pluginsdir

doc: remove non-existent configure option

11 months agotests: pytest does not like return True from a test
Donald Sharp [Fri, 19 May 2023 16:51:09 +0000 (12:51 -0400)]
tests: pytest does not like return True from a test

From running the test:
bgp_remove_private_as/test_bgp_remove_private_as.py::test_bgp_remove_private_as
  /home/sharpd/.local/lib/python3.10/site-packages/_pytest/python.py:198: PytestReturnNotNoneWarning: Expected None, but bgp_remove_private_as/test_bgp_remove_private_as.py::test_bgp_remove_private_as returned True, which will be an error in a future version of pytest.  Did you mean to use `assert` instead of `return`?
    warnings.warn(

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
11 months agodoc: remove non-existent configure option
Igor Ryzhov [Fri, 19 May 2023 16:35:19 +0000 (19:35 +0300)]
doc: remove non-existent configure option

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
11 months agozebra: On shutdown stop hook calls for fpm rmac updates
Donald Sharp [Thu, 18 May 2023 20:03:01 +0000 (16:03 -0400)]
zebra: On shutdown stop hook calls for fpm rmac updates

When shutting down zebra, the hook for the rmac update was
not being unregistered.  As such it would be possible
to get into a condition where more rmacs are being
added to the queue for handling in the future after we
are told to shutdown.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
11 months agozebra: Properly handle zfpm_g->t_conn_down in zebra_fpm.c
Donald Sharp [Thu, 18 May 2023 19:59:43 +0000 (15:59 -0400)]
zebra: Properly handle zfpm_g->t_conn_down in zebra_fpm.c

The t_conn_down pointer was being set to NULL when it already
was.  The t_conn_down pointer was being dropped( and leaving
a thread possibly running in the background ) which could
cause problems on shutdown.  And finally when shutting down
the t_conn_down event was not being stopped at all.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
11 months agozebra: Do not allow old FPM to access freed memory after shutdown
Donald Sharp [Fri, 19 May 2023 13:54:05 +0000 (09:54 -0400)]
zebra: Do not allow old FPM to access freed memory after shutdown

On shutdown, the old FPM queues up dests to be sent to
the FPM listener.  This is done through the rib_shutdown
hook.  Which is called when the table that the routes are
stored in are being deleted.  This dest has pointers
to the rnode.  The rnode has pointers to the table it
is associated with as well as the table->info pointer for
the zebra data associated with this table.

The FPM after this attempts to tell this to it's listener
via events.  Unfortunately the zvrf, table_id and nl_pid
was being grabbed from memory that had been freed!  Since
all this can be grabbed from memory that has not been freed
on shutdown let's switch over to using that instead of freed
memory for gathering data.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
11 months agoMerge pull request #13549 from LabNConsulting/chopps/cclsopt
Donatas Abraitis [Fri, 19 May 2023 13:25:23 +0000 (16:25 +0300)]
Merge pull request #13549 from LabNConsulting/chopps/cclsopt

doc: configure: add configure option to generate .ccls file

11 months agoMerge pull request #13553 from LabNConsulting/chopps/fixwarn+msg
Donald Sharp [Fri, 19 May 2023 13:04:09 +0000 (09:04 -0400)]
Merge pull request #13553 from LabNConsulting/chopps/fixwarn+msg

mgmtd: fix uninit warning and cleanup history error messages

11 months agotests: Ignore utf-8 decoding errors
Donatas Abraitis [Fri, 19 May 2023 11:57:56 +0000 (14:57 +0300)]
tests: Ignore utf-8 decoding errors

This is happening sometimes for stuff like `r1 shi cat ...`.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
12 months agodoc: configure: add configure option to generate .ccls file
Christian Hopps [Thu, 18 May 2023 02:26:49 +0000 (22:26 -0400)]
doc: configure: add configure option to generate .ccls file

`ccls` needs information from FRR build configuration to work,
so allow creation of a custom ccls config during autoconf.

Paraphrasing the doc entry: ccls is a very powerful tool that allows
dev environments to provide sophisticated IDE functionality, e.g.,
semantically aware jumps and code refactoring...

Signed-off-by: Christian Hopps <chopps@labn.net>
12 months agomgmtd: fix uninit warning and cleanup history error messages
Christian Hopps [Thu, 18 May 2023 12:42:42 +0000 (08:42 -0400)]
mgmtd: fix uninit warning and cleanup history error messages

Signed-off-by: Christian Hopps <chopps@labn.net>
12 months agoMerge pull request #13544 from cscarpitta/bugfix/fix-build-error
Donald Sharp [Thu, 18 May 2023 11:58:25 +0000 (07:58 -0400)]
Merge pull request #13544 from cscarpitta/bugfix/fix-build-error

zebra: Fix build error when FRR is built with the `--disable-bfdd` option

12 months agoMerge pull request #13369 from samanvithab/bgpd_fix
Donatas Abraitis [Thu, 18 May 2023 07:24:41 +0000 (10:24 +0300)]
Merge pull request #13369 from samanvithab/bgpd_fix

lib : fix duplicate prefix list delete

12 months agoMerge pull request #13541 from LabNConsulting/chopps/fixtestdefconf
Donatas Abraitis [Thu, 18 May 2023 06:44:38 +0000 (09:44 +0300)]
Merge pull request #13541 from LabNConsulting/chopps/fixtestdefconf

tests: fix implicit config file and recently added logic error

12 months agotests: fix implicit config file and recently added logic error
Christian Hopps [Wed, 17 May 2023 11:10:13 +0000 (07:10 -0400)]
tests: fix implicit config file and recently added logic error

- Restore default of looking for a daemon config underneath the router directory
if no config file was specified.
- Recent change for adding unified config support had a logic bug, fix
- Update the one test that conflicted with this default
- comment out asyncio option causing warnings if asyncio wasn't installed.

Signed-off-by: Christian Hopps <chopps@labn.net>
12 months agoMerge pull request #13546 from LabNConsulting/chopps/pylint-fix
Donatas Abraitis [Wed, 17 May 2023 19:56:03 +0000 (22:56 +0300)]
Merge pull request #13546 from LabNConsulting/chopps/pylint-fix

tests: fix pylint error, and update style in lib/*.py

12 months agoMerge pull request #13547 from LabNConsulting/chopps/topo-tshark-doc
Donatas Abraitis [Wed, 17 May 2023 19:55:28 +0000 (22:55 +0300)]
Merge pull request #13547 from LabNConsulting/chopps/topo-tshark-doc

doc: document optionally required packages

12 months agodoc: document optionally required packages
Christian Hopps [Wed, 17 May 2023 17:51:30 +0000 (13:51 -0400)]
doc: document optionally required packages

- tshark and valgrind are required but only if you enable those
  features during test runs.

Signed-off-by: Christian Hopps <chopps@labn.net>
12 months agotests: fix pylint error, and update style in lib/*.py
Christian Hopps [Wed, 17 May 2023 17:40:39 +0000 (13:40 -0400)]
tests: fix pylint error, and update style in lib/*.py

Signed-off-by: Christian Hopps <chopps@labn.net>
12 months agoMerge pull request #13543 from donaldsharp/clear_up_clear_command
Christian Hopps [Wed, 17 May 2023 17:41:43 +0000 (13:41 -0400)]
Merge pull request #13543 from donaldsharp/clear_up_clear_command

Clear up clear command

12 months agozebra: Fix build error when `--disable-bfdd`
Carmine Scarpitta [Wed, 17 May 2023 16:47:23 +0000 (18:47 +0200)]
zebra: Fix build error when `--disable-bfdd`

When FRR is built with the option `--disable-bfdd`, the build process
fails with the following error:

```
zebra/zebra_ptm.c: In function ‘zebra_ptm_init’:
zebra/zebra_ptm.c:119:35: error: ‘FRR_PTM_NAME’ undeclared (first use in this function)
  119 |  snprintf(buf, sizeof(buf), "%s", FRR_PTM_NAME);
      |                                   ^~~~~~~~~~~~
zebra/zebra_ptm.c:119:35: note: each undeclared identifier is reported only once for each function it appears in
make[1]: *** [Makefile:10520: zebra/zebra_ptm.o] Error 1
```

The reason is that `FRR_PTM_NAME` is defined in `version.h` which is not
imported.

This commit adds the missing import.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
12 months agotests: Change order of config files
Donald Sharp [Wed, 17 May 2023 11:56:27 +0000 (07:56 -0400)]
tests: Change order of config files

Our CI test system is configuring interfaces like this:

int A
  <ospfX config>

router ospfX
  router-id Z.Y.M.Q

On sufficiently loaded systems, the router-id might not be respected because
the interface A neighbor might have come up by the time the router-id
command is read in.  This is a problem for our topotests in that
the tests expect neighbors to be formed with certain router-id,
but the FRR code has stored the new router-id but not accepted
it's use since a neighbor relationship has formed.

Modify the ci test system code to put the 'router ospfX' commands
before the interface commands, thus forcing the router-id to be
read in *before* any possibility that the neighbor can have come
up.

Also, I've filed issue #13452 to address the ordering of commands
with regards to router-id in our ospf protocols.  Once that is
done this should be backed out, to return to a more natural ordering
of commands.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
12 months agotests: Clean up commands that do nothing
Donald Sharp [Tue, 16 May 2023 20:46:35 +0000 (16:46 -0400)]
tests: Clean up commands that do nothing

Recently clear commands were added to the tests that do nothing
because they are using the wrong way to input the command.
Since these do nothing remove them:

2023-05-16 16:39:07,072.072 DEBUG: topolog.r0: Router(r0):  cmd_status("['/bin/bash', '-c', 'clear ip ospf neighbor']", pre_cmd: "['/usr/bin/nsenter', '--mount=/proc/4157893/ns/mnt', '--net=/proc/4157893/ns/net', '--uts=/proc/4157893/ns/uts', '-F', '--wd=/tmp/topotests/ospf_basic_functionality.test_ospf_asbr_summary_topo1/r0']" use_pty: False kwargs: {'stdout': -1, 'stderr': -2, 'encoding': 'utf-8', 'shell': False, 'stdin': None, 'env': {'LANG': 'en_US.UTF-8', 'LS_COLO)
2023-05-16 16:39:07,120.120 WARNING: topolog.r0: Router(r0): proc failed: rc 1 pid 4161077
        args: /usr/bin/nsenter --mount=/proc/4157893/ns/mnt --net=/proc/4157893/ns/net --uts=/proc/4157893/ns/uts -F --wd=/tmp/topotests/ospf_basic_functionality.test_ospf_asbr_summary_topo1/r0 /bin/bash -c clear ip ospf neighbor
        stdout: Usage: clear [options]

Options:
  -T TERM     use this instead of $TERM
  -V          print curses-version
  -x          do not try to clear scrollback
        stderr: *empty*

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
12 months agoMerge pull request #13529 from pguibert6WIND/bgp_vpnv6_per_nexthop_fix
Donald Sharp [Wed, 17 May 2023 11:56:07 +0000 (07:56 -0400)]
Merge pull request #13529 from pguibert6WIND/bgp_vpnv6_per_nexthop_fix

topotests: fix bgp_vpnv6_per_nexthop, syncing with bgp rib

12 months agoMerge pull request #13526 from opensourcerouting/fix/show_table_version_per_subgrp
Russ White [Tue, 16 May 2023 14:14:04 +0000 (10:14 -0400)]
Merge pull request #13526 from opensourcerouting/fix/show_table_version_per_subgrp

bgpd: Show the real table version for a decent peer subgroup

12 months agoMerge pull request #12949 from opensourcerouting/ospf-unplanned-gr
Russ White [Tue, 16 May 2023 12:37:19 +0000 (08:37 -0400)]
Merge pull request #12949 from opensourcerouting/ospf-unplanned-gr

OSPF GR for unplanned outages

12 months agotopotests: bgp_vpnv6_per_nexthop_label, use only global ipv6 addresses
Philippe Guibert [Tue, 16 May 2023 08:47:35 +0000 (10:47 +0200)]
topotests: bgp_vpnv6_per_nexthop_label, use only global ipv6 addresses

The test is modified so as to use global ipv6 addresses for nexthop
resolution.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
12 months agoMerge pull request #12050 from LabNConsulting/working/lb/topotest-220909
David Lamparter [Tue, 16 May 2023 06:31:06 +0000 (08:31 +0200)]
Merge pull request #12050 from LabNConsulting/working/lb/topotest-220909

12 months agotests: Drop `tableVersion` from EVPN PIM test case
Donatas Abraitis [Tue, 16 May 2023 06:06:06 +0000 (09:06 +0300)]
tests: Drop `tableVersion` from EVPN PIM test case

tableVersion always incorrectly showed 0 instead of a decent value. Let's get rid
of this from the partial output at all.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
12 months agobgpd: Show the real table version for a decent peer subgroup
Donatas Abraitis [Mon, 15 May 2023 11:43:32 +0000 (14:43 +0300)]
bgpd: Show the real table version for a decent peer subgroup

Without the patch:

```
Neighbor        V         AS   MsgRcvd   MsgSent   TblVer  InQ OutQ  Up/Down State/PfxRcd   PfxSnt Desc
192.168.1.2     4      65002         4         5        2    0    0 00:00:45            1        1 N/A
192.168.1.3     4      65003         5         5        2    0    0 00:00:45            0        2 N/A
192.168.1.4     4      65004         5         5        2    0    0 00:00:45            0        2 N/A
```

With the patch:

```
Neighbor        V         AS   MsgRcvd   MsgSent   TblVer  InQ OutQ  Up/Down State/PfxRcd   PfxSnt Desc
192.168.1.2     4      65002         6         6        2    0    0 00:01:05            0        1 N/A
192.168.1.3     4      65003         7         7        3    0    0 00:01:05            0        1 N/A
192.168.1.4     4      65004         7         7        3    0    0 00:01:05            0        1 N/A
```

JSON output is also fixed:

```
munet> r1 shi vtysh -c 'sh ip bgp sum json' | grep version -i
  "tableVersion":3,
      "version":4,
      "tableVersion":2,
      "version":4,
      "tableVersion":3,
      "version":4,
      "tableVersion":3,

munet>
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
12 months agoMerge pull request #13528 from opensourcerouting/fix/revert_clang_formatting
Mark Stapp [Mon, 15 May 2023 13:27:10 +0000 (09:27 -0400)]
Merge pull request #13528 from opensourcerouting/fix/revert_clang_formatting

Revert "tools: config clang-format to allow aligned macros"

12 months agoRevert "tools: config clang-format to allow aligned macros"
Donatas Abraitis [Mon, 15 May 2023 12:32:43 +0000 (15:32 +0300)]
Revert "tools: config clang-format to allow aligned macros"

This reverts commit 25314d5d878bbcc5ff63ebe76db9b2143b3e04ab.

This causes errors on clang-formatter for versions <= 10.

```
% git clang-format bgpd
YAML:14:25: error: invalid boolean
AlignConsecutiveMacros: AcrossComments
                        ^~~~~~~~~~~~~~
error: `clang-format -lines=11624:11624 -lines=11802:11802 bgpd/bgp_vty.c` failed
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
12 months agoMerge pull request #13513 from subsecond/patch-4
Donatas Abraitis [Sun, 14 May 2023 19:03:06 +0000 (22:03 +0300)]
Merge pull request #13513 from subsecond/patch-4

Fix typo in multipath route docs

12 months agoMerge pull request #13439 from anlancs/fix/pimd-use-macro-pimreg
mobash-rasool [Sun, 14 May 2023 17:15:53 +0000 (22:45 +0530)]
Merge pull request #13439 from anlancs/fix/pimd-use-macro-pimreg

pimd: Use macro for pimreg interface

12 months agoMerge pull request #13522 from LabNConsulting/chopps/fix-bgp-test
Donald Sharp [Sun, 14 May 2023 01:43:29 +0000 (21:43 -0400)]
Merge pull request #13522 from LabNConsulting/chopps/fix-bgp-test

tests: improve bgp test determinism

12 months agotests: improve bgp test determinism
Christian Hopps [Sat, 13 May 2023 00:32:54 +0000 (20:32 -0400)]
tests: improve bgp test determinism

don't grep the tail of a log file after running a previous test, there could be
(and have been) other items added to the log in between.

add before and after count of shutdown messages to very the actual message shows
up as the test intended, and keep the search for the shutdown message.

Signed-off-by: Christian Hopps <chopps@labn.net>
12 months agoMerge pull request #13444 from donaldsharp/fix_dplane_provider_counter
Mark Stapp [Fri, 12 May 2023 18:54:13 +0000 (14:54 -0400)]
Merge pull request #13444 from donaldsharp/fix_dplane_provider_counter

zebra: Fix dp_out_queued counter to actually reflect real life

12 months agoMerge pull request #13463 from pguibert6WIND/mpls_alloc_per_nh_2
Donatas Abraitis [Fri, 12 May 2023 17:56:01 +0000 (20:56 +0300)]
Merge pull request #13463 from pguibert6WIND/mpls_alloc_per_nh_2

Mpls allocatio mode per nexthop

12 months agoMerge pull request #13518 from mjstapp/clang_align_macros
Donald Sharp [Fri, 12 May 2023 16:34:59 +0000 (12:34 -0400)]
Merge pull request #13518 from mjstapp/clang_align_macros

tools: config clang-format to allow aligned macros

12 months agozebra: Fix dp_out_queued counter to actually reflect real life
Donald Sharp [Fri, 5 May 2023 14:37:11 +0000 (10:37 -0400)]
zebra: Fix dp_out_queued counter to actually reflect real life

The prov->dp_out_queued counter was never being decremented
when a ctx was pulled off of the list.  Let's change it to
accurately reflect real life.

Broken:
janelle.pinkbelly.org# show zebra dplane providers detailed
Zebra dataplane providers:
Kernel (1): in: 330872, q: 0, q_max: 100, out: 330872, q: 330872, q_max: 330872
janelle.pinkbelly.org#

Fixed:
sharpd@janelle:/tmp/topotests$ vtysh -c "show zebra dplane providers detailed"
Zebra dataplane providers:
Kernel (1): in: 221495, q: 0, q_max: 100, out: 221495, q: 0, q_max: 100
sharpd@janelle:/tmp/topotests$

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
12 months agoMerge pull request #13517 from Keelan10/ospf_ti_lfa-memory-leak
Donald Sharp [Fri, 12 May 2023 14:06:45 +0000 (10:06 -0400)]
Merge pull request #13517 from Keelan10/ospf_ti_lfa-memory-leak

ospfd: Fix  ospf_ti_lfa memory leak

12 months agodoc: Fix typo in multipath route docs
Manuel Schweizer [Thu, 11 May 2023 19:53:50 +0000 (21:53 +0200)]
doc: Fix typo in multipath route docs

Signed-off-by: Manuel Schweizer <manuel.schweizer@cloudscale.ch>
12 months agotools: config clang-format to allow aligned macros
Mark Stapp [Fri, 12 May 2023 13:16:34 +0000 (09:16 -0400)]
tools: config clang-format to allow aligned macros

Add an AlignConsecutiveMacros config for clang-format.

Signed-off-by: Mark Stapp <mjs@labn.net>
12 months agoospf_ti_lfa: Free p_space memory allocation
Keelan10 [Fri, 12 May 2023 11:05:46 +0000 (15:05 +0400)]
ospf_ti_lfa: Free p_space memory allocation

Free p_space

Signed-off-by: Keelan Cannoo <keelan.cannoo@icloud.com>
12 months agoMerge pull request #13430 from opensourcerouting/feature/rip_allow-ecmp_limit
Donald Sharp [Fri, 12 May 2023 00:31:46 +0000 (20:31 -0400)]
Merge pull request #13430 from opensourcerouting/feature/rip_allow-ecmp_limit

ripd: Implement allow-ecmp X command

12 months agoMerge pull request #13490 from Jafaral/fix-ospf-asbr-test
Donald Sharp [Fri, 12 May 2023 00:31:21 +0000 (20:31 -0400)]
Merge pull request #13490 from Jafaral/fix-ospf-asbr-test

tests: improve log messages, clear neighbors to avoid bad state

12 months agotests: reset neighbor state machine to avoid bad/stale state
Jafar Al-Gharaibeh [Thu, 11 May 2023 05:12:29 +0000 (00:12 -0500)]
tests: reset neighbor state machine to avoid bad/stale state

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
12 months agoMerge pull request #13507 from opensourcerouting/feature/bgp_route-map_match_source...
Donald Sharp [Thu, 11 May 2023 13:38:57 +0000 (09:38 -0400)]
Merge pull request #13507 from opensourcerouting/feature/bgp_route-map_match_source-protocol

bgpd: Implement match source-protocol for route-maps

12 months agotopotest: all_protocol_startup - respect TOPOTESTS_CHECK_STDERR environ variable
Lou Berger [Mon, 10 Oct 2022 16:42:45 +0000 (16:42 +0000)]
topotest: all_protocol_startup - respect TOPOTESTS_CHECK_STDERR environ variable

Signed-off-by: Lou Berger <lberger@labn.net>
12 months agotopotest: add --memleaks topotest option
Lou Berger [Mon, 3 Oct 2022 00:31:31 +0000 (00:31 +0000)]
topotest: add --memleaks topotest option

Signed-off-by: Lou Berger <lberger@labn.net>
12 months agotopotests: fix looging of memstat results
Lou Berger [Sun, 2 Oct 2022 23:24:36 +0000 (23:24 +0000)]
topotests: fix looging of memstat results

Signed-off-by: Lou Berger <lberger@labn.net>
12 months agolib: when running as a daemon, only redirect sdtin, stdout, sdterr to null when a...
Lou Berger [Sun, 2 Oct 2022 15:56:07 +0000 (15:56 +0000)]
lib: when running as a daemon, only redirect sdtin, stdout, sdterr to null when a tty.

     Also write memstat to stderr when stderr is not a tty
     and allow for --log stdout

Signed-off-by: Lou Berger <lberger@labn.net>
12 months agodoc: update for ubuntu 22.04 and to run topotest with valgrind
Lou Berger [Sun, 2 Oct 2022 14:54:45 +0000 (14:54 +0000)]
doc: update for ubuntu 22.04 and to run topotest with valgrind

Signed-off-by: Lou Berger <lberger@labn.net>
12 months agotests: Check if `match source-protocol` route-map cmd works for BGP
Donatas Abraitis [Thu, 11 May 2023 08:34:10 +0000 (11:34 +0300)]
tests: Check if `match source-protocol` route-map cmd works for BGP

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
12 months agobgpd: Implement `match source-protocol` for route-maps
Donatas Abraitis [Wed, 10 May 2023 20:37:47 +0000 (23:37 +0300)]
bgpd: Implement `match source-protocol` for route-maps

The main idea is to filter routes by matching source (originating) protocol
for outgoing direction. For instance, filter outgoing routes to an arbitrary
router that are static only. Or filter out only routes learned from RIP.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
12 months agopimd: Use macro for pimreg interface
anlan_cs [Fri, 5 May 2023 06:51:50 +0000 (14:51 +0800)]
pimd: Use macro for pimreg interface

Some interfaces are special, they have the same `ifindex` with pimreg.
Use macro for `ifindex` of pimreg.

And adjust log.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
12 months agotests: log the router id in ospf tests, improve log in a couple of places
Jafar Al-Gharaibeh [Wed, 10 May 2023 20:40:00 +0000 (15:40 -0500)]
tests: log the router id in ospf tests, improve log in a couple of places

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
12 months agobfdd: Fix malformed session with vrf
anlan_cs [Wed, 10 May 2023 14:04:33 +0000 (22:04 +0800)]
bfdd: Fix malformed session with vrf

With this configuration:

```
bfd
 peer 33:33::66 local-address 33:33::88 vrf vrf8 interface enp1s0
 exit
 !
exit
```

The bfd session can't be established with error:

```
bfdd[18663]: [YA0Q5-C0BPV] control-packet: wrong vrfid. [mhop:no peer:33:33::66 local:33:33::88 port:2 vrf:61]
```

The vrf check should use the carefully adjusted `vrfid`, which is
based on globally/reliable interface.  We can't believe the
`bvrf->vrf->vrf_id` because the `/proc/sys/net/ipv4/udp_l3mdev_accept`
maybe is set "1" in VRF-lite backend even with security drawback.

Just correct the vrf check.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
12 months agoMerge pull request #13489 from LabNConsulting/ospf-opaque-stale-fix
Jafar Al-Gharaibeh [Wed, 10 May 2023 20:51:21 +0000 (15:51 -0500)]
Merge pull request #13489 from LabNConsulting/ospf-opaque-stale-fix

ospfd: OSPF opaque LSA stale processing fix and topotests.

12 months agoMerge pull request #13495 from LabNConsulting/chopps/munet-0.13.3
Jafar Al-Gharaibeh [Wed, 10 May 2023 20:05:47 +0000 (15:05 -0500)]
Merge pull request #13495 from LabNConsulting/chopps/munet-0.13.3

tests: update to munet 0.13.3, restoring GNU screen functionality

12 months agodoc: Use `match source-protocol` for route-maps in BGP as well
Donatas Abraitis [Wed, 10 May 2023 18:00:17 +0000 (21:00 +0300)]
doc: Use `match source-protocol` for route-maps in BGP as well

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
12 months agoMerge pull request #13485 from donaldsharp/ospf_loopback_cost
Jafar Al-Gharaibeh [Wed, 10 May 2023 16:13:15 +0000 (11:13 -0500)]
Merge pull request #13485 from donaldsharp/ospf_loopback_cost

ospfd: Respect loopback's cost that is set and set loopback costs to 0

12 months agoMerge pull request #13479 from ryndia/fix_leak
Donald Sharp [Wed, 10 May 2023 12:53:23 +0000 (08:53 -0400)]
Merge pull request #13479 from ryndia/fix_leak

[WIP] ospfd: opsf_abr.c memory leak fix, free unused range

12 months agoospfd: Respect loopback's cost that is set and set loopback costs to 0
Donald Sharp [Tue, 9 May 2023 17:10:35 +0000 (13:10 -0400)]
ospfd: Respect loopback's cost that is set and set loopback costs to 0

When setting an loopback's cost, set the value to 0, unless the operator
has assigned a value for the loopback's cost.

RFC states:

If the state of the interface is Loopback, add a Type 3
link (stub network) as long as this is not an interface
to an unnumbered point-to-point network. The Link ID
should be set to the IP interface address, the Link Data
set to the mask 0xffffffff (indicating a host route),
and the cost set to 0.

FRR is going to allow this to be overridden if the operator specifically
sets a value too.

Fixes: #13472
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
12 months agoMerge pull request #13486 from opensourcerouting/fix/doc_aigp_neighbor
Donald Sharp [Wed, 10 May 2023 12:25:40 +0000 (08:25 -0400)]
Merge pull request #13486 from opensourcerouting/fix/doc_aigp_neighbor

doc: Add `neighbor aigp` command for BGP

12 months agoMerge pull request #13493 from anlancs/fix/bgpd-cleanup-11
Donatas Abraitis [Wed, 10 May 2023 11:30:04 +0000 (14:30 +0300)]
Merge pull request #13493 from anlancs/fix/bgpd-cleanup-11

bgpd: Cosmetic change for mac check

12 months agotests: update to munet 0.13.3, restoring GNU screen functionality
Christian Hopps [Wed, 10 May 2023 09:44:16 +0000 (09:44 +0000)]
tests: update to munet 0.13.3, restoring GNU screen functionality

Signed-off-by: Christian Hopps <chopps@labn.net>
12 months agobgpd: Cosmetic change for mac check
anlan_cs [Wed, 10 May 2023 08:50:36 +0000 (16:50 +0800)]
bgpd: Cosmetic change for mac check

Remove useless `return` code, and correct a spelling.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
12 months agoospfd: opsf_abr.c memory leak fix, free range
Jeevesh Rishi Dindyal (Sarvesh) [Tue, 9 May 2023 09:59:58 +0000 (13:59 +0400)]
ospfd: opsf_abr.c memory leak fix, free range

The new create range attribute is send to add to ranges, but not use if the prefix already exist in the ranges.

Signed-off-by: ryndia <dindyalsarvesh@gmail.com>
12 months agoMerge pull request #13488 from LabNConsulting/chopps/wf-python
Jafar Al-Gharaibeh [Wed, 10 May 2023 00:17:25 +0000 (19:17 -0500)]
Merge pull request #13488 from LabNConsulting/chopps/wf-python

doc: python, required by clippy, is no longer a non-essential tool

12 months ago ospfd: OSPF opaque LSA stale processing fix and topotests.
Acee [Tue, 9 May 2023 20:51:03 +0000 (16:51 -0400)]
    ospfd: OSPF opaque LSA stale processing fix and topotests.

        1. Fix OSPF opaque LSA processing to preserve the stale opaque
            LSAs in the Link State Database for 60 seconds consistent with
            what is done for other LSA types.
         2. Add a topotest that tests for cases where ospfd is restarted
            and a stale OSPF opaque LSA exists in the OSPF routing domain
            both when the LSA is purged and when the LSA is reoriginagted
            with a more recent instance.

Signed-off-by: Acee <aceelindem@gmail.com>
12 months agodoc: python, required by clippy, is no longer a non-essential tool
Christian Hopps [Tue, 9 May 2023 20:22:39 +0000 (20:22 +0000)]
doc: python, required by clippy, is no longer a non-essential tool

Signed-off-by: Christian Hopps <chopps@labn.net>
12 months agodoc: add bgp allocation-mode per nexthop information
Philippe Guibert [Tue, 31 Jan 2023 10:05:12 +0000 (11:05 +0100)]
doc: add bgp allocation-mode per nexthop information

Add bgp allocation-mode per nexthop information.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
PR=81857
Link: https://github.com/FRRouting/frr/pull/12646
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Acked-by: Louis Scalbert <louis.scalbert@6wind.com>
12 months agotopotests: add bgp_vpnv6 test allocation
Philippe Guibert [Wed, 1 Feb 2023 16:28:15 +0000 (17:28 +0100)]
topotests: add bgp_vpnv6 test allocation

This test demonstrates that a label is allocated for each
ipv6 next-hop. IPv6 test introduces link local ipv6 addresses
as next hops, and compared to IPv4, one can have two different
next-hops depending if the next-hop is defined by a global
address (static route redistributed) or a bgp peer.

This test checks that:
- The labels are correctly allocated per connected next-hop.
- The default label is used for non connected prefixes.
- The withdraw operation frees the MPLS entry.
- If a recursive route is redistributed by BGP, then the nexthop
tracking will find the appropriate nexthop entry, and the
associated label will be found out.
- When a prefix moves from one peer to one another behind the
vrf, then the MPLS switching operation for return
traffic is changing the outgoing interface to use.
- When the 'label vpn export <value>' MPLS label value is changed,
then the modification is propagated to prefixes which use that value.
- Also, when unconfiguring the per-nexthop allocation mode, check
that the MPLS entries and the VPNv4 entries of r1 are changed
accordingly.
- Reversely, when re-configuring the per-nexthop allocation mode,
check that the allocation mode reuses the other label values.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
12 months agotopotests: add bgp mpls allocation per next-hop test
Philippe Guibert [Tue, 10 Jan 2023 13:53:54 +0000 (14:53 +0100)]
topotests: add bgp mpls allocation per next-hop test

A new test suite checks for the mpls label allocation
per nexthop mode. This test checks that:
- The labels are correctly allocated per connected
next-hop.
- The default label is used for non connected prefixes
- The withdraw operation frees the mpls entry.
- If a recursive route is redistributed by BGP, then the nexthop
tracking will find the appropriate nexthop entry, and the associated
label will be found out.
- When a prefix moves from one peer to one another behind the vrf,
then the MPLS switching operation for return traffic is changing
the outgoing interface to use.
- When the 'label vpn export <value>' MPLS label value is changed,
then the modification is propagated to prefixes which use that value.
- When unconfiguring the per-nexthop allocation mode, check
that the MPLS entries and the VPNv4 entries of r1 are changed
accordingly.
- Reversely, when re-configuring the per-nexthop allocation mode,
check that the allocation mode reuses the other label values.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
12 months agobgpd: add 'show bgp label-nexthop [detail]' command
Philippe Guibert [Mon, 16 Jan 2023 17:24:26 +0000 (18:24 +0100)]
bgpd: add 'show bgp label-nexthop [detail]' command

The following command is made available to list the labels
allocated per-nexthop, along with the paths registered to it.

 > # show bgp vrf vrf1 label-nexthop
 > Current BGP label nexthop cache for IP, VRF vrf1
 >  192.0.2.11, label 20 #paths 3
 >    if r1-eth1
 >    Last update: Mon Jan 16 18:52:11 2023
 >  192.0.2.12, label 17 #paths 2
 >    if r1-eth1
 >    Last update: Mon Jan 16 18:52:08 2023
 >  192.0.2.14, label 18 #paths 1
 >    if r1-eth1
 >    Last update: Mon Jan 16 18:52:07 2023
 >  192.168.255.13, label 19 #paths 1
 >    if r1-eth2
 >    Last update: Mon Jan 16 18:52:10 2023

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
12 months agobgpd: update time of last change when label nexthop entry changed
Philippe Guibert [Thu, 16 Feb 2023 12:46:32 +0000 (13:46 +0100)]
bgpd: update time of last change when label nexthop entry changed

A timer attribute is added for each label nexthop entry, in order
to know when the last change occured.
The timer value will be used for troubleshooting by a show
command in the next commit.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
12 months agobgpd: export redistributed routes with label allocation per nexthop
Philippe Guibert [Fri, 3 Mar 2023 20:33:34 +0000 (21:33 +0100)]
bgpd: export redistributed routes with label allocation per nexthop

The label allocation per nexthop mode requires to use a nexthop
tracking context. For redistributed routes, a nexthop tracking
context is created, and the resolution helps to know the real
nexthop ip address used. The below configuration example has
been used:

 > vrf vrf1
 >  ip route 172.31.0.14/32 192.0.2.14
 >  ip route 172.31.0.15/32 192.0.2.12
 >  ip route 172.31.0.30/32 192.0.2.30
 > exit
 > router bgp 65500 vrf vrf1
 >  address-family ipv4 unicast
 >   redistribute static
 >   label vpn export per-nexthop
 > [..]

The static routes are correctly imported in the BGP IPv4 RIB.
Contrary to label allocation per vrf mode, some nexthop tracking
are created/or reused:

 > # show bgp vrf vrf1 nexthop
 > 192.0.2.12 valid [IGP metric 0], #paths 3, peer 192.0.2.12
 >  if r1-eth1
 >  Last update: Fri Jan 13 15:49:42 2023
 > 192.0.2.14 valid [IGP metric 0], #paths 1
 >  if r1-eth1
 >  Last update: Fri Jan 13 15:49:42 2023
 > 192.0.2.30 valid [IGP metric 0], #paths 1
 >  if r1-eth1
 >  Last update: Fri Jan 13 15:49:51 2023
 > [..]

This results in having a BGP VPN route for each of the static
routes:

 > # show bgp ipv4 vpn
 > [..]
 > Route Distinguisher: 444:1
 >  *> 172.31.0.14/32   192.0.2.14@9<            0         32768 ?
 >  *> 172.31.0.15/32   192.0.2.12@9<            0         32768 ?
 >  *> 172.31.0.30/32   192.0.2.30@9<            0         32768 ?
 > [..]

Without that patch, only the redistributed routes that rely on a
pre-existing nexthop tracking context could be exported.

Also, a command in the code about redistributed routes is modified
accordingly, to explain that redistribute routes may be submitted
to nexthop tracking in the case label allocation per next-hop is
used.

note:
VNC routes have been removed from the redistribution,
because of a test failure in the bgp_l3vpn_to_bgp_direct test.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
12 months agobgpd: correctly initialize the IP nexthop of redistributed routes
Philippe Guibert [Fri, 13 Jan 2023 14:51:59 +0000 (15:51 +0100)]
bgpd: correctly initialize the IP nexthop of redistributed routes

This is a preliminary work to export redistributed routes from
a given VRF in an VPN network. The exportation works well, when
the label allocation is based on an per-vrf mode, but not on
a per nexthop mode.

To associate a label with a connected nexthop, the nexthop
tracking contexts are used. Until today, there was no tracking
context for redistributed routes. But when using this vpn
allocation mode, one needs to know whether the route is directly
connected or not. When using the nexthop tracking context, the
nexthop attribute of the bgp update needs to have the nexthop
properly set. This was not the case for the mp_nexthop_global_in
attribute which was empty.

This commit is mandatory in order to later use nexthop tracking
context.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
12 months agobgpd: use nexthop interface when adding LSP in BGP MPLSVPN
Philippe Guibert [Thu, 16 Feb 2023 09:39:40 +0000 (10:39 +0100)]
bgpd: use nexthop interface when adding LSP in BGP MPLSVPN

BGP MPLSVPN next hop label allocation was using only the next-hop
IP address. As MPLSVPN contexts rely on bnc contexts, the real
nexthop interface is known, and the LSP entry to enter can apply
to the specific interface. To illustrate, the BGP service is able
to handle the following two iproute2 commands:

 > ip -f mpls route add 105 via inet 192.0.2.45 dev r1-eth1
 > ip -f mpls route add 105 via inet 192.0.2.46 dev r1-eth2

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
12 months agobgpd: add support for l3vpn per-nexthop label
Philippe Guibert [Tue, 28 Feb 2023 13:25:02 +0000 (14:25 +0100)]
bgpd: add support for l3vpn per-nexthop label

This commit introduces a new method to associate a label to
prefixes to export to a VPNv4 backbone. All the methods to
associate a label to a BGP update is documented in rfc4364,
chapter 4.3.2. Initially, the "single label for an entire
VRF" method was available. This commit adds "single label
for each attachment circuit" method.

The change impacts the control-plane, because each BGP update
is checked to know if the nexthop has reachability in the VRF
or not. If this is the case, then a unique label for a given
destination IP in the VRF will be picked up. This label will
be reused for an other BGP update that will have the same
nexthop IP address.

The change impacts the data-plane, because the MPLs pop
mechanism applied to incoming labelled packets changes: the
MPLS label is popped, and the packet is directly sent to the
connected nexthop described in the previous outgoing BGP VPN
update.

By default per-vrf mode is done, but the user may choose
the per-nexthop mode, by using the vty command from the
previous commit. In the latter case, a per-vrf label
will however be allocated to handle networks that are not directly
connected. This is the case for local traffic for instance.

The change also include the following:

-  ECMP case
In case a route is learnt in a given VRF, and is resolved via an
ECMP nexthop. This implies that when exporting the route as a BGP
update, if label allocation per nexthop is used, then two possible
MPLS values could be picked up, which is not possible with the
current implementation. Actually, the NLRI for VPNv4 stores one
prefix, and one single label value, not two. Today, RFC8277 with
multiple label capability is not yet available.
To avoid this corner case, when a route is resolved via more than one
nexthop, the label allocation per nexthop will not apply, and the
default per-vrf label will be chosen.
Let us imagine BGP redistributes a static route using the `172.31.0.20`
nexthop. The nexthop resolution will find two different nexthops fo a
unique BGP update.

 > r1# show running-config
 > [..]
 > vrf vrf1
 >  ip route 172.31.0.30/32 172.31.0.20
 > r1# show bgp vrf vrf1 nexthop
 > [..]
 > 172.31.0.20 valid [IGP metric 0], #paths 1
 >  gate 192.0.2.11
 >  gate 192.0.2.12
 >  Last update: Mon Jan 16 09:27:09 2023
 >  Paths:
 >    1/1 172.31.0.30/32 VRF vrf1 flags 0x20018

To avoid this situation, BGP updates that resolve over multiple
nexthops are using the unique per-vrf label.

- recursive route case

Prefixes that need a recursive route to be resolved can
also be eligible for mpls allocation per nexthop. In that
case, the nexthop will be the recursive nexthop calculated.

To achieve this, all nexthop types in bnc contexts are valid,
except for the blackhole nexthops.

- network declared prefixes

Nexthop tracking is used to look for the reachability of the
prefixes. When the the 'no bgp network import-check' command
is used, network declared prefixes are maintained active,
even if there is no active nexthop.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
12 months agobgpd: add the bgp_label_per_nexthop_cache struct and apis
Philippe Guibert [Tue, 28 Feb 2023 13:17:17 +0000 (14:17 +0100)]
bgpd: add the bgp_label_per_nexthop_cache struct and apis

This commit introduces the necessary structs and apis to
create the cache entries that store the label information
associated to a given nexthop.

A hash table is created in each BGP instance for all the
AFIs: IPv4 and IPv6. That hash table is initialised.
An API to look and/or create an entry based on a given
nexthop.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
12 months agobgpd: introduce LP_TYPE_NEXTHOP label type
Philippe Guibert [Tue, 28 Feb 2023 13:11:30 +0000 (14:11 +0100)]
bgpd: introduce LP_TYPE_NEXTHOP label type

A new label type is introduced: LP_TYPE_NEXTHOP. This new
label type will be used in next commits to allocate labels
for a specific nexthop IP address.
The commit changes add vty and json outputs to display
the new label type and the label values associated.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>